12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564645656456664567645686456964570645716457264573645746457564576645776457864579645806458164582645836458464585645866458764588645896459064591645926459364594645956459664597645986459964600646016460264603646046460564606646076460864609646106461164612646136461464615646166461764618646196462064621646226462364624646256462664627646286462964630646316463264633646346463564636646376463864639646406464164642646436464464645646466464764648646496465064651646526465364654646556465664657646586465964660646616466264663646646466564666646676466864669646706467164672646736467464675646766467764678646796468064681646826468364684646856468664687646886468964690646916469264693646946469564696646976469864699647006470164702647036470464705647066470764708647096471064711647126471364714647156471664717647186471964720647216472264723647246472564726647276472864729647306473164732647336473464735647366473764738647396474064741647426474364744647456474664747647486474964750647516475264753647546475564756647576475864759647606476164762647636476464765647666476764768647696477064771647726477364774647756477664777647786477964780647816478264783647846478564786647876478864789647906479164792647936479464795647966479764798647996480064801648026480364804648056480664807648086480964810648116481264813648146481564816648176481864819648206482164822648236482464825648266482764828648296483064831648326483364834648356483664837648386483964840648416484264843648446484564846648476484864849648506485164852648536485464855648566485764858648596486064861648626486364864648656486664867648686486964870648716487264873648746487564876648776487864879648806488164882648836488464885648866488764888648896489064891648926489364894648956489664897648986489964900649016490264903649046490564906649076490864909649106491164912649136491464915649166491764918649196492064921649226492364924649256492664927649286492964930649316493264933649346493564936649376493864939649406494164942649436494464945649466494764948649496495064951649526495364954649556495664957649586495964960649616496264963649646496564966649676496864969649706497164972649736497464975649766497764978649796498064981649826498364984649856498664987649886498964990649916499264993649946499564996649976499864999650006500165002650036500465005650066500765008650096501065011650126501365014650156501665017650186501965020650216502265023650246502565026650276502865029650306503165032650336503465035650366503765038650396504065041650426504365044650456504665047650486504965050650516505265053650546505565056650576505865059650606506165062650636506465065650666506765068650696507065071650726507365074650756507665077650786507965080650816508265083650846508565086650876508865089650906509165092650936509465095650966509765098650996510065101651026510365104651056510665107651086510965110651116511265113651146511565116651176511865119651206512165122651236512465125651266512765128651296513065131651326513365134651356513665137651386513965140651416514265143651446514565146651476514865149651506515165152651536515465155651566515765158651596516065161651626516365164651656516665167651686516965170651716517265173651746517565176651776517865179651806518165182651836518465185651866518765188651896519065191651926519365194651956519665197651986519965200652016520265203652046520565206652076520865209652106521165212652136521465215652166521765218652196522065221652226522365224652256522665227652286522965230652316523265233652346523565236652376523865239652406524165242652436524465245652466524765248652496525065251652526525365254652556525665257652586525965260652616526265263652646526565266652676526865269652706527165272652736527465275652766527765278652796528065281652826528365284652856528665287652886528965290652916529265293652946529565296652976529865299653006530165302653036530465305653066530765308653096531065311653126531365314653156531665317653186531965320653216532265323653246532565326653276532865329653306533165332653336533465335653366533765338653396534065341653426534365344653456534665347653486534965350653516535265353653546535565356653576535865359653606536165362653636536465365653666536765368653696537065371653726537365374653756537665377653786537965380653816538265383653846538565386653876538865389653906539165392653936539465395653966539765398653996540065401654026540365404654056540665407654086540965410654116541265413654146541565416654176541865419654206542165422654236542465425654266542765428654296543065431654326543365434654356543665437654386543965440654416544265443654446544565446654476544865449654506545165452654536545465455654566545765458654596546065461654626546365464654656546665467654686546965470654716547265473654746547565476654776547865479654806548165482654836548465485654866548765488654896549065491654926549365494654956549665497654986549965500655016550265503655046550565506655076550865509655106551165512655136551465515655166551765518655196552065521655226552365524655256552665527655286552965530655316553265533655346553565536655376553865539655406554165542655436554465545655466554765548655496555065551655526555365554655556555665557655586555965560655616556265563655646556565566655676556865569655706557165572655736557465575655766557765578655796558065581655826558365584655856558665587655886558965590655916559265593655946559565596655976559865599656006560165602656036560465605656066560765608656096561065611656126561365614656156561665617656186561965620656216562265623656246562565626656276562865629656306563165632656336563465635656366563765638656396564065641656426564365644656456564665647656486564965650656516565265653656546565565656656576565865659656606566165662656636566465665656666566765668656696567065671656726567365674656756567665677656786567965680656816568265683656846568565686656876568865689656906569165692656936569465695656966569765698656996570065701657026570365704657056570665707657086570965710657116571265713657146571565716657176571865719657206572165722657236572465725657266572765728657296573065731657326573365734657356573665737657386573965740657416574265743657446574565746657476574865749657506575165752657536575465755657566575765758657596576065761657626576365764657656576665767657686576965770657716577265773657746577565776657776577865779657806578165782657836578465785657866578765788657896579065791657926579365794657956579665797657986579965800658016580265803658046580565806658076580865809658106581165812658136581465815658166581765818658196582065821658226582365824658256582665827658286582965830658316583265833658346583565836658376583865839658406584165842658436584465845658466584765848658496585065851658526585365854658556585665857658586585965860658616586265863658646586565866658676586865869658706587165872658736587465875658766587765878658796588065881658826588365884658856588665887658886588965890658916589265893658946589565896658976589865899659006590165902659036590465905659066590765908659096591065911659126591365914659156591665917659186591965920659216592265923659246592565926659276592865929659306593165932659336593465935659366593765938659396594065941659426594365944659456594665947659486594965950659516595265953659546595565956659576595865959659606596165962659636596465965659666596765968659696597065971659726597365974659756597665977659786597965980659816598265983659846598565986659876598865989659906599165992659936599465995659966599765998659996600066001660026600366004660056600666007660086600966010660116601266013660146601566016660176601866019660206602166022660236602466025660266602766028660296603066031660326603366034660356603666037660386603966040660416604266043660446604566046660476604866049660506605166052660536605466055660566605766058660596606066061660626606366064660656606666067660686606966070660716607266073660746607566076660776607866079660806608166082660836608466085660866608766088660896609066091660926609366094660956609666097660986609966100661016610266103661046610566106661076610866109661106611166112661136611466115661166611766118661196612066121661226612366124661256612666127661286612966130661316613266133661346613566136661376613866139661406614166142661436614466145661466614766148661496615066151661526615366154661556615666157661586615966160661616616266163661646616566166661676616866169661706617166172661736617466175661766617766178661796618066181661826618366184661856618666187661886618966190661916619266193661946619566196661976619866199662006620166202662036620466205662066620766208662096621066211662126621366214662156621666217662186621966220662216622266223662246622566226662276622866229662306623166232662336623466235662366623766238662396624066241662426624366244662456624666247662486624966250662516625266253662546625566256662576625866259662606626166262662636626466265662666626766268662696627066271662726627366274662756627666277662786627966280662816628266283662846628566286662876628866289662906629166292662936629466295662966629766298662996630066301663026630366304663056630666307663086630966310663116631266313663146631566316663176631866319663206632166322663236632466325663266632766328663296633066331663326633366334663356633666337663386633966340663416634266343663446634566346663476634866349663506635166352663536635466355663566635766358663596636066361663626636366364663656636666367663686636966370663716637266373663746637566376663776637866379663806638166382663836638466385663866638766388663896639066391663926639366394663956639666397663986639966400664016640266403664046640566406664076640866409664106641166412664136641466415664166641766418664196642066421664226642366424664256642666427664286642966430664316643266433664346643566436664376643866439664406644166442664436644466445664466644766448664496645066451664526645366454664556645666457664586645966460664616646266463664646646566466664676646866469664706647166472664736647466475664766647766478664796648066481664826648366484664856648666487664886648966490664916649266493664946649566496664976649866499665006650166502665036650466505665066650766508665096651066511665126651366514665156651666517665186651966520665216652266523665246652566526665276652866529665306653166532665336653466535665366653766538665396654066541665426654366544665456654666547665486654966550665516655266553665546655566556665576655866559665606656166562665636656466565665666656766568665696657066571665726657366574665756657666577665786657966580665816658266583665846658566586665876658866589665906659166592665936659466595665966659766598665996660066601666026660366604666056660666607666086660966610666116661266613666146661566616666176661866619666206662166622666236662466625666266662766628666296663066631666326663366634666356663666637666386663966640666416664266643666446664566646666476664866649666506665166652666536665466655666566665766658666596666066661666626666366664666656666666667666686666966670666716667266673666746667566676666776667866679666806668166682666836668466685666866668766688666896669066691666926669366694666956669666697666986669966700667016670266703667046670566706667076670866709667106671166712667136671466715667166671766718667196672066721667226672366724667256672666727667286672966730667316673266733667346673566736667376673866739667406674166742667436674466745667466674766748667496675066751667526675366754667556675666757667586675966760667616676266763667646676566766667676676866769667706677166772667736677466775667766677766778667796678066781667826678366784667856678666787667886678966790667916679266793667946679566796667976679866799668006680166802668036680466805668066680766808668096681066811668126681366814668156681666817668186681966820668216682266823668246682566826668276682866829668306683166832668336683466835668366683766838668396684066841668426684366844668456684666847668486684966850668516685266853668546685566856668576685866859668606686166862668636686466865668666686766868668696687066871668726687366874668756687666877668786687966880668816688266883668846688566886668876688866889668906689166892668936689466895668966689766898668996690066901669026690366904669056690666907669086690966910669116691266913669146691566916669176691866919669206692166922669236692466925669266692766928669296693066931669326693366934669356693666937669386693966940669416694266943669446694566946669476694866949669506695166952669536695466955669566695766958669596696066961669626696366964669656696666967669686696966970669716697266973669746697566976669776697866979669806698166982669836698466985669866698766988669896699066991669926699366994669956699666997669986699967000670016700267003670046700567006670076700867009670106701167012670136701467015670166701767018670196702067021670226702367024670256702667027670286702967030670316703267033670346703567036670376703867039670406704167042670436704467045670466704767048670496705067051670526705367054670556705667057670586705967060670616706267063670646706567066670676706867069670706707167072670736707467075670766707767078670796708067081670826708367084670856708667087670886708967090670916709267093670946709567096670976709867099671006710167102671036710467105671066710767108671096711067111671126711367114671156711667117671186711967120671216712267123671246712567126671276712867129671306713167132671336713467135671366713767138671396714067141671426714367144671456714667147671486714967150671516715267153671546715567156671576715867159671606716167162671636716467165671666716767168671696717067171671726717367174671756717667177671786717967180671816718267183671846718567186671876718867189671906719167192671936719467195671966719767198671996720067201672026720367204672056720667207672086720967210672116721267213672146721567216672176721867219672206722167222672236722467225672266722767228672296723067231672326723367234672356723667237672386723967240672416724267243672446724567246672476724867249672506725167252672536725467255672566725767258672596726067261672626726367264672656726667267672686726967270672716727267273672746727567276672776727867279672806728167282672836728467285672866728767288672896729067291672926729367294672956729667297672986729967300673016730267303673046730567306673076730867309673106731167312673136731467315673166731767318673196732067321673226732367324673256732667327673286732967330673316733267333673346733567336673376733867339673406734167342673436734467345673466734767348673496735067351673526735367354673556735667357673586735967360673616736267363673646736567366673676736867369673706737167372673736737467375673766737767378673796738067381673826738367384673856738667387673886738967390673916739267393673946739567396673976739867399674006740167402674036740467405674066740767408674096741067411674126741367414674156741667417674186741967420674216742267423674246742567426674276742867429674306743167432674336743467435674366743767438674396744067441674426744367444674456744667447674486744967450674516745267453674546745567456674576745867459674606746167462674636746467465674666746767468674696747067471674726747367474674756747667477674786747967480674816748267483674846748567486674876748867489674906749167492674936749467495674966749767498674996750067501675026750367504675056750667507675086750967510675116751267513675146751567516675176751867519675206752167522675236752467525675266752767528675296753067531675326753367534675356753667537675386753967540675416754267543675446754567546675476754867549675506755167552675536755467555675566755767558675596756067561675626756367564675656756667567675686756967570675716757267573675746757567576675776757867579675806758167582675836758467585675866758767588675896759067591675926759367594675956759667597675986759967600676016760267603676046760567606676076760867609676106761167612676136761467615676166761767618676196762067621676226762367624676256762667627676286762967630676316763267633676346763567636676376763867639676406764167642676436764467645676466764767648676496765067651676526765367654676556765667657676586765967660676616766267663676646766567666676676766867669676706767167672676736767467675676766767767678676796768067681676826768367684676856768667687676886768967690676916769267693676946769567696676976769867699677006770167702677036770467705677066770767708677096771067711677126771367714677156771667717677186771967720677216772267723677246772567726677276772867729677306773167732677336773467735677366773767738677396774067741677426774367744677456774667747677486774967750677516775267753677546775567756677576775867759677606776167762677636776467765677666776767768677696777067771677726777367774677756777667777677786777967780677816778267783677846778567786677876778867789677906779167792677936779467795677966779767798677996780067801678026780367804678056780667807678086780967810678116781267813678146781567816678176781867819678206782167822678236782467825678266782767828678296783067831678326783367834678356783667837678386783967840678416784267843678446784567846678476784867849678506785167852678536785467855678566785767858678596786067861678626786367864678656786667867678686786967870678716787267873678746787567876678776787867879678806788167882678836788467885678866788767888678896789067891678926789367894678956789667897678986789967900679016790267903679046790567906679076790867909679106791167912679136791467915679166791767918679196792067921679226792367924679256792667927679286792967930679316793267933679346793567936679376793867939679406794167942679436794467945679466794767948679496795067951679526795367954679556795667957679586795967960679616796267963679646796567966679676796867969679706797167972679736797467975679766797767978679796798067981679826798367984679856798667987679886798967990679916799267993679946799567996679976799867999680006800168002680036800468005680066800768008680096801068011680126801368014680156801668017680186801968020680216802268023680246802568026680276802868029680306803168032680336803468035680366803768038680396804068041680426804368044680456804668047680486804968050680516805268053680546805568056680576805868059680606806168062680636806468065680666806768068680696807068071680726807368074680756807668077680786807968080680816808268083680846808568086680876808868089680906809168092680936809468095680966809768098680996810068101681026810368104681056810668107681086810968110681116811268113681146811568116681176811868119681206812168122681236812468125681266812768128681296813068131681326813368134681356813668137681386813968140681416814268143681446814568146681476814868149681506815168152681536815468155681566815768158681596816068161681626816368164681656816668167681686816968170681716817268173681746817568176681776817868179681806818168182681836818468185681866818768188681896819068191681926819368194681956819668197681986819968200682016820268203682046820568206682076820868209682106821168212682136821468215682166821768218682196822068221682226822368224682256822668227682286822968230682316823268233682346823568236682376823868239682406824168242682436824468245682466824768248682496825068251682526825368254682556825668257682586825968260682616826268263682646826568266682676826868269682706827168272682736827468275682766827768278682796828068281682826828368284682856828668287682886828968290682916829268293682946829568296682976829868299683006830168302683036830468305683066830768308683096831068311683126831368314683156831668317683186831968320683216832268323683246832568326683276832868329683306833168332683336833468335683366833768338683396834068341683426834368344683456834668347683486834968350683516835268353683546835568356683576835868359683606836168362683636836468365683666836768368683696837068371683726837368374683756837668377683786837968380683816838268383683846838568386683876838868389683906839168392683936839468395683966839768398683996840068401684026840368404684056840668407684086840968410684116841268413684146841568416684176841868419684206842168422684236842468425684266842768428684296843068431684326843368434684356843668437684386843968440684416844268443684446844568446684476844868449684506845168452684536845468455684566845768458684596846068461684626846368464684656846668467684686846968470684716847268473684746847568476684776847868479684806848168482684836848468485684866848768488684896849068491684926849368494684956849668497684986849968500685016850268503685046850568506685076850868509685106851168512685136851468515685166851768518685196852068521685226852368524685256852668527685286852968530685316853268533685346853568536685376853868539685406854168542685436854468545685466854768548685496855068551685526855368554685556855668557685586855968560685616856268563685646856568566685676856868569685706857168572685736857468575685766857768578685796858068581685826858368584685856858668587685886858968590685916859268593685946859568596685976859868599686006860168602686036860468605686066860768608686096861068611686126861368614686156861668617686186861968620686216862268623686246862568626686276862868629686306863168632686336863468635686366863768638686396864068641686426864368644686456864668647686486864968650686516865268653686546865568656686576865868659686606866168662686636866468665686666866768668686696867068671686726867368674686756867668677686786867968680686816868268683686846868568686686876868868689686906869168692686936869468695686966869768698686996870068701687026870368704687056870668707687086870968710687116871268713687146871568716687176871868719687206872168722687236872468725687266872768728687296873068731687326873368734687356873668737687386873968740687416874268743687446874568746687476874868749687506875168752687536875468755687566875768758687596876068761687626876368764687656876668767687686876968770687716877268773687746877568776687776877868779687806878168782687836878468785687866878768788687896879068791687926879368794687956879668797687986879968800688016880268803688046880568806688076880868809688106881168812688136881468815688166881768818688196882068821688226882368824688256882668827688286882968830688316883268833688346883568836688376883868839688406884168842688436884468845688466884768848688496885068851688526885368854688556885668857688586885968860688616886268863688646886568866688676886868869688706887168872688736887468875688766887768878688796888068881688826888368884688856888668887688886888968890688916889268893688946889568896688976889868899689006890168902689036890468905689066890768908689096891068911689126891368914689156891668917689186891968920689216892268923689246892568926689276892868929689306893168932689336893468935689366893768938689396894068941689426894368944689456894668947689486894968950689516895268953689546895568956689576895868959689606896168962689636896468965689666896768968689696897068971689726897368974689756897668977689786897968980689816898268983689846898568986689876898868989689906899168992689936899468995689966899768998689996900069001690026900369004690056900669007690086900969010690116901269013690146901569016690176901869019690206902169022690236902469025690266902769028690296903069031690326903369034690356903669037690386903969040690416904269043690446904569046690476904869049690506905169052690536905469055690566905769058690596906069061690626906369064690656906669067690686906969070690716907269073690746907569076690776907869079690806908169082690836908469085690866908769088690896909069091690926909369094690956909669097690986909969100691016910269103691046910569106691076910869109691106911169112691136911469115691166911769118691196912069121691226912369124691256912669127691286912969130691316913269133691346913569136691376913869139691406914169142691436914469145691466914769148691496915069151691526915369154691556915669157691586915969160691616916269163691646916569166691676916869169691706917169172691736917469175691766917769178691796918069181691826918369184691856918669187691886918969190691916919269193691946919569196691976919869199692006920169202692036920469205692066920769208692096921069211692126921369214692156921669217692186921969220692216922269223692246922569226692276922869229692306923169232692336923469235692366923769238692396924069241692426924369244692456924669247692486924969250692516925269253692546925569256692576925869259692606926169262692636926469265692666926769268692696927069271692726927369274692756927669277692786927969280692816928269283692846928569286692876928869289692906929169292692936929469295692966929769298692996930069301693026930369304693056930669307693086930969310693116931269313693146931569316693176931869319693206932169322693236932469325693266932769328693296933069331693326933369334693356933669337693386933969340693416934269343693446934569346693476934869349693506935169352693536935469355693566935769358693596936069361693626936369364693656936669367693686936969370693716937269373693746937569376693776937869379693806938169382693836938469385693866938769388693896939069391693926939369394693956939669397693986939969400694016940269403694046940569406694076940869409694106941169412694136941469415694166941769418694196942069421694226942369424694256942669427694286942969430694316943269433694346943569436694376943869439694406944169442694436944469445694466944769448694496945069451694526945369454694556945669457694586945969460694616946269463694646946569466694676946869469694706947169472694736947469475694766947769478694796948069481694826948369484694856948669487694886948969490694916949269493694946949569496694976949869499695006950169502695036950469505695066950769508695096951069511695126951369514695156951669517695186951969520695216952269523695246952569526695276952869529695306953169532695336953469535695366953769538695396954069541695426954369544695456954669547695486954969550695516955269553695546955569556695576955869559695606956169562695636956469565695666956769568695696957069571695726957369574695756957669577695786957969580695816958269583695846958569586695876958869589695906959169592695936959469595695966959769598695996960069601696026960369604696056960669607696086960969610696116961269613696146961569616696176961869619696206962169622696236962469625696266962769628696296963069631696326963369634696356963669637696386963969640696416964269643696446964569646696476964869649696506965169652696536965469655696566965769658696596966069661696626966369664696656966669667696686966969670696716967269673696746967569676696776967869679696806968169682696836968469685696866968769688696896969069691696926969369694696956969669697696986969969700697016970269703697046970569706697076970869709697106971169712697136971469715697166971769718697196972069721697226972369724697256972669727697286972969730697316973269733697346973569736697376973869739697406974169742697436974469745697466974769748697496975069751697526975369754697556975669757697586975969760697616976269763697646976569766697676976869769697706977169772697736977469775697766977769778697796978069781697826978369784697856978669787697886978969790697916979269793697946979569796697976979869799698006980169802698036980469805698066980769808698096981069811698126981369814698156981669817698186981969820698216982269823698246982569826698276982869829698306983169832698336983469835698366983769838698396984069841698426984369844698456984669847698486984969850698516985269853698546985569856698576985869859698606986169862698636986469865698666986769868698696987069871698726987369874698756987669877698786987969880698816988269883698846988569886698876988869889698906989169892698936989469895698966989769898698996990069901699026990369904699056990669907699086990969910699116991269913699146991569916699176991869919699206992169922699236992469925699266992769928699296993069931699326993369934699356993669937699386993969940699416994269943699446994569946699476994869949699506995169952699536995469955699566995769958699596996069961699626996369964699656996669967699686996969970699716997269973699746997569976699776997869979699806998169982699836998469985699866998769988699896999069991699926999369994699956999669997699986999970000700017000270003700047000570006700077000870009700107001170012700137001470015700167001770018700197002070021700227002370024700257002670027700287002970030700317003270033700347003570036700377003870039700407004170042700437004470045700467004770048700497005070051700527005370054700557005670057700587005970060700617006270063700647006570066700677006870069700707007170072700737007470075700767007770078700797008070081700827008370084700857008670087700887008970090700917009270093700947009570096700977009870099701007010170102701037010470105701067010770108701097011070111701127011370114701157011670117701187011970120701217012270123701247012570126701277012870129701307013170132701337013470135701367013770138701397014070141701427014370144701457014670147701487014970150701517015270153701547015570156701577015870159701607016170162701637016470165701667016770168701697017070171701727017370174701757017670177701787017970180701817018270183701847018570186701877018870189701907019170192701937019470195701967019770198701997020070201702027020370204702057020670207702087020970210702117021270213702147021570216702177021870219702207022170222702237022470225702267022770228702297023070231702327023370234702357023670237702387023970240702417024270243702447024570246702477024870249702507025170252702537025470255702567025770258702597026070261702627026370264702657026670267702687026970270702717027270273702747027570276702777027870279702807028170282702837028470285702867028770288702897029070291702927029370294702957029670297702987029970300703017030270303703047030570306703077030870309703107031170312703137031470315703167031770318703197032070321703227032370324703257032670327703287032970330703317033270333703347033570336703377033870339703407034170342703437034470345703467034770348703497035070351703527035370354703557035670357703587035970360703617036270363703647036570366703677036870369703707037170372703737037470375703767037770378703797038070381703827038370384703857038670387703887038970390703917039270393703947039570396703977039870399704007040170402704037040470405704067040770408704097041070411704127041370414704157041670417704187041970420704217042270423704247042570426704277042870429704307043170432704337043470435704367043770438704397044070441704427044370444704457044670447704487044970450704517045270453704547045570456704577045870459704607046170462704637046470465704667046770468704697047070471704727047370474704757047670477704787047970480704817048270483704847048570486704877048870489704907049170492704937049470495704967049770498704997050070501705027050370504705057050670507705087050970510705117051270513705147051570516705177051870519705207052170522705237052470525705267052770528705297053070531705327053370534705357053670537705387053970540705417054270543705447054570546705477054870549705507055170552705537055470555705567055770558705597056070561705627056370564705657056670567705687056970570705717057270573705747057570576705777057870579705807058170582705837058470585705867058770588705897059070591705927059370594705957059670597705987059970600706017060270603706047060570606706077060870609706107061170612706137061470615706167061770618706197062070621706227062370624706257062670627706287062970630706317063270633706347063570636706377063870639706407064170642706437064470645706467064770648706497065070651706527065370654706557065670657706587065970660706617066270663706647066570666706677066870669706707067170672706737067470675706767067770678706797068070681706827068370684706857068670687706887068970690706917069270693706947069570696706977069870699707007070170702707037070470705707067070770708707097071070711707127071370714707157071670717707187071970720707217072270723707247072570726707277072870729707307073170732707337073470735707367073770738707397074070741707427074370744707457074670747707487074970750707517075270753707547075570756707577075870759707607076170762707637076470765707667076770768707697077070771707727077370774707757077670777707787077970780707817078270783707847078570786707877078870789707907079170792707937079470795707967079770798707997080070801708027080370804708057080670807708087080970810708117081270813708147081570816708177081870819708207082170822708237082470825708267082770828708297083070831708327083370834708357083670837708387083970840708417084270843708447084570846708477084870849708507085170852708537085470855708567085770858708597086070861708627086370864708657086670867708687086970870708717087270873708747087570876708777087870879708807088170882708837088470885708867088770888708897089070891708927089370894708957089670897708987089970900709017090270903709047090570906709077090870909709107091170912709137091470915709167091770918709197092070921709227092370924709257092670927709287092970930709317093270933709347093570936709377093870939709407094170942709437094470945709467094770948709497095070951709527095370954709557095670957709587095970960709617096270963709647096570966709677096870969709707097170972709737097470975709767097770978709797098070981709827098370984709857098670987709887098970990709917099270993709947099570996709977099870999710007100171002710037100471005710067100771008710097101071011710127101371014710157101671017710187101971020710217102271023710247102571026710277102871029710307103171032710337103471035710367103771038710397104071041710427104371044710457104671047710487104971050710517105271053710547105571056710577105871059710607106171062710637106471065710667106771068710697107071071710727107371074710757107671077710787107971080710817108271083710847108571086710877108871089710907109171092710937109471095710967109771098710997110071101711027110371104711057110671107711087110971110711117111271113711147111571116711177111871119711207112171122711237112471125711267112771128711297113071131711327113371134711357113671137711387113971140711417114271143711447114571146711477114871149711507115171152711537115471155711567115771158711597116071161711627116371164711657116671167711687116971170711717117271173711747117571176711777117871179711807118171182711837118471185711867118771188711897119071191711927119371194711957119671197711987119971200712017120271203712047120571206712077120871209712107121171212712137121471215712167121771218712197122071221712227122371224712257122671227712287122971230712317123271233712347123571236712377123871239712407124171242712437124471245712467124771248712497125071251712527125371254712557125671257712587125971260712617126271263712647126571266712677126871269712707127171272712737127471275712767127771278712797128071281712827128371284712857128671287712887128971290712917129271293712947129571296712977129871299713007130171302713037130471305713067130771308713097131071311713127131371314713157131671317713187131971320713217132271323713247132571326713277132871329713307133171332713337133471335713367133771338713397134071341713427134371344713457134671347713487134971350713517135271353713547135571356713577135871359713607136171362713637136471365713667136771368713697137071371713727137371374713757137671377713787137971380713817138271383713847138571386713877138871389713907139171392713937139471395713967139771398713997140071401714027140371404714057140671407714087140971410714117141271413714147141571416714177141871419714207142171422714237142471425714267142771428714297143071431714327143371434714357143671437714387143971440714417144271443714447144571446714477144871449714507145171452714537145471455714567145771458714597146071461714627146371464714657146671467714687146971470714717147271473714747147571476714777147871479714807148171482714837148471485714867148771488714897149071491714927149371494714957149671497714987149971500715017150271503715047150571506715077150871509715107151171512715137151471515715167151771518715197152071521715227152371524715257152671527715287152971530715317153271533715347153571536715377153871539715407154171542715437154471545715467154771548715497155071551715527155371554715557155671557715587155971560715617156271563715647156571566715677156871569715707157171572715737157471575715767157771578715797158071581715827158371584715857158671587715887158971590715917159271593715947159571596715977159871599716007160171602716037160471605716067160771608716097161071611716127161371614716157161671617716187161971620716217162271623716247162571626716277162871629716307163171632716337163471635716367163771638716397164071641716427164371644716457164671647716487164971650716517165271653716547165571656716577165871659716607166171662716637166471665716667166771668716697167071671716727167371674716757167671677716787167971680716817168271683716847168571686716877168871689716907169171692716937169471695716967169771698716997170071701717027170371704717057170671707717087170971710717117171271713717147171571716717177171871719717207172171722717237172471725717267172771728717297173071731717327173371734717357173671737717387173971740717417174271743717447174571746717477174871749717507175171752717537175471755717567175771758717597176071761717627176371764717657176671767717687176971770717717177271773717747177571776717777177871779717807178171782717837178471785717867178771788717897179071791717927179371794717957179671797717987179971800718017180271803718047180571806718077180871809718107181171812718137181471815718167181771818718197182071821718227182371824718257182671827718287182971830718317183271833718347183571836718377183871839718407184171842718437184471845718467184771848718497185071851718527185371854718557185671857718587185971860718617186271863718647186571866718677186871869718707187171872718737187471875718767187771878718797188071881718827188371884718857188671887718887188971890718917189271893718947189571896718977189871899719007190171902719037190471905719067190771908719097191071911719127191371914719157191671917719187191971920719217192271923719247192571926719277192871929719307193171932719337193471935719367193771938719397194071941719427194371944719457194671947719487194971950719517195271953719547195571956719577195871959719607196171962719637196471965719667196771968719697197071971719727197371974719757197671977719787197971980719817198271983719847198571986719877198871989719907199171992719937199471995719967199771998719997200072001720027200372004720057200672007720087200972010720117201272013720147201572016720177201872019720207202172022720237202472025720267202772028720297203072031720327203372034720357203672037720387203972040720417204272043720447204572046720477204872049720507205172052720537205472055720567205772058720597206072061720627206372064720657206672067720687206972070720717207272073720747207572076720777207872079720807208172082720837208472085720867208772088720897209072091720927209372094720957209672097720987209972100721017210272103721047210572106721077210872109721107211172112721137211472115721167211772118721197212072121721227212372124721257212672127721287212972130721317213272133721347213572136721377213872139721407214172142721437214472145721467214772148721497215072151721527215372154721557215672157721587215972160721617216272163721647216572166721677216872169721707217172172721737217472175721767217772178721797218072181721827218372184721857218672187721887218972190721917219272193721947219572196721977219872199722007220172202722037220472205722067220772208722097221072211722127221372214722157221672217722187221972220722217222272223722247222572226722277222872229722307223172232722337223472235722367223772238722397224072241722427224372244722457224672247722487224972250722517225272253722547225572256722577225872259722607226172262722637226472265722667226772268722697227072271722727227372274722757227672277722787227972280722817228272283722847228572286722877228872289722907229172292722937229472295722967229772298722997230072301723027230372304723057230672307723087230972310723117231272313723147231572316723177231872319723207232172322723237232472325723267232772328723297233072331723327233372334723357233672337723387233972340723417234272343723447234572346723477234872349723507235172352723537235472355723567235772358723597236072361723627236372364723657236672367723687236972370723717237272373723747237572376723777237872379723807238172382723837238472385723867238772388723897239072391723927239372394723957239672397723987239972400724017240272403724047240572406724077240872409724107241172412724137241472415724167241772418724197242072421724227242372424724257242672427724287242972430724317243272433724347243572436724377243872439724407244172442724437244472445724467244772448724497245072451724527245372454724557245672457724587245972460724617246272463724647246572466724677246872469724707247172472724737247472475724767247772478724797248072481724827248372484724857248672487724887248972490724917249272493724947249572496724977249872499725007250172502725037250472505725067250772508725097251072511725127251372514725157251672517725187251972520725217252272523725247252572526725277252872529725307253172532725337253472535725367253772538725397254072541725427254372544725457254672547725487254972550725517255272553725547255572556725577255872559725607256172562725637256472565725667256772568725697257072571725727257372574725757257672577725787257972580725817258272583725847258572586725877258872589725907259172592725937259472595725967259772598725997260072601726027260372604726057260672607726087260972610726117261272613726147261572616726177261872619726207262172622726237262472625726267262772628726297263072631726327263372634726357263672637726387263972640726417264272643726447264572646726477264872649726507265172652726537265472655726567265772658726597266072661726627266372664726657266672667726687266972670726717267272673726747267572676726777267872679726807268172682726837268472685726867268772688726897269072691726927269372694726957269672697726987269972700727017270272703727047270572706727077270872709727107271172712727137271472715727167271772718727197272072721727227272372724727257272672727727287272972730727317273272733727347273572736727377273872739727407274172742727437274472745727467274772748727497275072751727527275372754727557275672757727587275972760727617276272763727647276572766727677276872769727707277172772727737277472775727767277772778727797278072781727827278372784727857278672787727887278972790727917279272793727947279572796727977279872799728007280172802728037280472805728067280772808728097281072811728127281372814728157281672817728187281972820728217282272823728247282572826728277282872829728307283172832728337283472835728367283772838728397284072841728427284372844728457284672847728487284972850728517285272853728547285572856728577285872859728607286172862728637286472865728667286772868728697287072871728727287372874728757287672877728787287972880728817288272883728847288572886728877288872889728907289172892728937289472895728967289772898728997290072901729027290372904729057290672907729087290972910729117291272913729147291572916729177291872919729207292172922729237292472925729267292772928729297293072931729327293372934729357293672937729387293972940729417294272943729447294572946729477294872949729507295172952729537295472955729567295772958729597296072961729627296372964729657296672967729687296972970729717297272973729747297572976729777297872979729807298172982729837298472985729867298772988729897299072991729927299372994729957299672997729987299973000730017300273003730047300573006730077300873009730107301173012730137301473015730167301773018730197302073021730227302373024730257302673027730287302973030730317303273033730347303573036730377303873039730407304173042730437304473045730467304773048730497305073051730527305373054730557305673057730587305973060730617306273063730647306573066730677306873069730707307173072730737307473075730767307773078730797308073081730827308373084730857308673087730887308973090730917309273093730947309573096730977309873099731007310173102731037310473105731067310773108731097311073111731127311373114731157311673117731187311973120731217312273123731247312573126731277312873129731307313173132731337313473135731367313773138731397314073141731427314373144731457314673147731487314973150731517315273153731547315573156731577315873159731607316173162731637316473165731667316773168731697317073171731727317373174731757317673177731787317973180731817318273183731847318573186731877318873189731907319173192731937319473195731967319773198731997320073201732027320373204732057320673207732087320973210732117321273213732147321573216732177321873219732207322173222732237322473225732267322773228732297323073231732327323373234732357323673237732387323973240732417324273243732447324573246732477324873249732507325173252732537325473255732567325773258732597326073261732627326373264732657326673267732687326973270732717327273273732747327573276732777327873279732807328173282732837328473285732867328773288732897329073291732927329373294732957329673297732987329973300733017330273303733047330573306733077330873309733107331173312733137331473315733167331773318733197332073321733227332373324733257332673327733287332973330733317333273333733347333573336733377333873339733407334173342733437334473345733467334773348733497335073351733527335373354733557335673357733587335973360733617336273363733647336573366733677336873369733707337173372733737337473375733767337773378733797338073381733827338373384733857338673387733887338973390733917339273393733947339573396733977339873399734007340173402734037340473405734067340773408734097341073411734127341373414734157341673417734187341973420734217342273423734247342573426734277342873429734307343173432734337343473435734367343773438734397344073441734427344373444734457344673447734487344973450734517345273453734547345573456734577345873459734607346173462734637346473465734667346773468734697347073471734727347373474734757347673477734787347973480734817348273483734847348573486734877348873489734907349173492734937349473495734967349773498734997350073501735027350373504735057350673507735087350973510735117351273513735147351573516735177351873519735207352173522735237352473525735267352773528735297353073531735327353373534735357353673537735387353973540735417354273543735447354573546735477354873549735507355173552735537355473555735567355773558735597356073561735627356373564735657356673567735687356973570735717357273573735747357573576735777357873579735807358173582735837358473585735867358773588735897359073591735927359373594735957359673597735987359973600736017360273603736047360573606736077360873609736107361173612736137361473615736167361773618736197362073621736227362373624736257362673627736287362973630736317363273633736347363573636736377363873639736407364173642736437364473645736467364773648736497365073651736527365373654736557365673657736587365973660736617366273663736647366573666736677366873669736707367173672736737367473675736767367773678736797368073681736827368373684736857368673687736887368973690736917369273693736947369573696736977369873699737007370173702737037370473705737067370773708737097371073711737127371373714737157371673717737187371973720737217372273723737247372573726737277372873729737307373173732737337373473735737367373773738737397374073741737427374373744737457374673747737487374973750737517375273753737547375573756737577375873759737607376173762737637376473765737667376773768737697377073771737727377373774737757377673777737787377973780737817378273783737847378573786737877378873789737907379173792737937379473795737967379773798737997380073801738027380373804738057380673807738087380973810738117381273813738147381573816738177381873819738207382173822738237382473825738267382773828738297383073831738327383373834738357383673837738387383973840738417384273843738447384573846738477384873849738507385173852738537385473855738567385773858738597386073861738627386373864738657386673867738687386973870738717387273873738747387573876738777387873879738807388173882738837388473885738867388773888738897389073891738927389373894738957389673897738987389973900739017390273903739047390573906739077390873909739107391173912739137391473915739167391773918739197392073921739227392373924739257392673927739287392973930739317393273933739347393573936739377393873939739407394173942739437394473945739467394773948739497395073951739527395373954739557395673957739587395973960739617396273963739647396573966739677396873969739707397173972739737397473975739767397773978739797398073981739827398373984739857398673987739887398973990739917399273993739947399573996739977399873999740007400174002740037400474005740067400774008740097401074011740127401374014740157401674017740187401974020740217402274023740247402574026740277402874029740307403174032740337403474035740367403774038740397404074041740427404374044740457404674047740487404974050740517405274053740547405574056740577405874059740607406174062740637406474065740667406774068740697407074071740727407374074740757407674077740787407974080740817408274083740847408574086740877408874089740907409174092740937409474095740967409774098740997410074101741027410374104741057410674107741087410974110741117411274113741147411574116741177411874119741207412174122741237412474125741267412774128741297413074131741327413374134741357413674137741387413974140741417414274143741447414574146741477414874149741507415174152741537415474155741567415774158741597416074161741627416374164741657416674167741687416974170741717417274173741747417574176741777417874179741807418174182741837418474185741867418774188741897419074191741927419374194741957419674197741987419974200742017420274203742047420574206742077420874209742107421174212742137421474215742167421774218742197422074221742227422374224742257422674227742287422974230742317423274233742347423574236742377423874239742407424174242742437424474245742467424774248742497425074251742527425374254742557425674257742587425974260742617426274263742647426574266742677426874269742707427174272742737427474275742767427774278742797428074281742827428374284742857428674287742887428974290742917429274293742947429574296742977429874299743007430174302743037430474305743067430774308743097431074311743127431374314743157431674317743187431974320743217432274323743247432574326743277432874329743307433174332743337433474335743367433774338743397434074341743427434374344743457434674347743487434974350743517435274353743547435574356743577435874359743607436174362743637436474365743667436774368743697437074371743727437374374743757437674377743787437974380743817438274383743847438574386743877438874389743907439174392743937439474395743967439774398743997440074401744027440374404744057440674407744087440974410744117441274413744147441574416744177441874419744207442174422744237442474425744267442774428744297443074431744327443374434744357443674437744387443974440744417444274443744447444574446744477444874449744507445174452744537445474455744567445774458744597446074461744627446374464744657446674467744687446974470744717447274473744747447574476744777447874479744807448174482744837448474485744867448774488744897449074491744927449374494744957449674497744987449974500745017450274503745047450574506745077450874509745107451174512745137451474515745167451774518745197452074521745227452374524745257452674527745287452974530745317453274533745347453574536745377453874539745407454174542745437454474545745467454774548745497455074551745527455374554745557455674557745587455974560745617456274563745647456574566745677456874569745707457174572745737457474575745767457774578745797458074581745827458374584745857458674587745887458974590745917459274593745947459574596745977459874599746007460174602746037460474605746067460774608746097461074611746127461374614746157461674617746187461974620746217462274623746247462574626746277462874629746307463174632746337463474635746367463774638746397464074641746427464374644746457464674647746487464974650746517465274653746547465574656746577465874659746607466174662746637466474665746667466774668746697467074671746727467374674746757467674677746787467974680746817468274683746847468574686746877468874689746907469174692746937469474695746967469774698746997470074701747027470374704747057470674707747087470974710747117471274713747147471574716747177471874719747207472174722747237472474725747267472774728747297473074731747327473374734747357473674737747387473974740747417474274743747447474574746747477474874749747507475174752747537475474755747567475774758747597476074761747627476374764747657476674767747687476974770747717477274773747747477574776747777477874779747807478174782747837478474785747867478774788747897479074791747927479374794747957479674797747987479974800748017480274803748047480574806748077480874809748107481174812748137481474815748167481774818748197482074821748227482374824748257482674827748287482974830748317483274833748347483574836748377483874839748407484174842748437484474845748467484774848748497485074851748527485374854748557485674857748587485974860748617486274863748647486574866748677486874869748707487174872748737487474875748767487774878748797488074881748827488374884748857488674887748887488974890748917489274893748947489574896748977489874899749007490174902749037490474905749067490774908749097491074911749127491374914749157491674917749187491974920749217492274923749247492574926749277492874929749307493174932749337493474935749367493774938749397494074941749427494374944749457494674947749487494974950749517495274953749547495574956749577495874959749607496174962749637496474965749667496774968749697497074971749727497374974749757497674977749787497974980749817498274983749847498574986749877498874989749907499174992749937499474995749967499774998749997500075001750027500375004750057500675007750087500975010750117501275013750147501575016750177501875019750207502175022750237502475025750267502775028750297503075031750327503375034750357503675037750387503975040750417504275043750447504575046750477504875049750507505175052750537505475055750567505775058750597506075061750627506375064750657506675067750687506975070750717507275073750747507575076750777507875079750807508175082750837508475085750867508775088750897509075091750927509375094750957509675097750987509975100751017510275103751047510575106751077510875109751107511175112751137511475115751167511775118751197512075121751227512375124751257512675127751287512975130751317513275133751347513575136751377513875139751407514175142751437514475145751467514775148751497515075151751527515375154751557515675157751587515975160751617516275163751647516575166751677516875169751707517175172751737517475175751767517775178751797518075181751827518375184751857518675187751887518975190751917519275193751947519575196751977519875199752007520175202752037520475205752067520775208752097521075211752127521375214752157521675217752187521975220752217522275223752247522575226752277522875229752307523175232752337523475235752367523775238752397524075241752427524375244752457524675247752487524975250752517525275253752547525575256752577525875259752607526175262752637526475265752667526775268752697527075271752727527375274752757527675277752787527975280752817528275283752847528575286752877528875289752907529175292752937529475295752967529775298752997530075301753027530375304753057530675307753087530975310753117531275313753147531575316753177531875319753207532175322753237532475325753267532775328753297533075331753327533375334753357533675337753387533975340753417534275343753447534575346753477534875349753507535175352753537535475355753567535775358753597536075361753627536375364753657536675367753687536975370753717537275373753747537575376753777537875379753807538175382753837538475385753867538775388753897539075391753927539375394753957539675397753987539975400754017540275403754047540575406754077540875409754107541175412754137541475415754167541775418754197542075421754227542375424754257542675427754287542975430754317543275433754347543575436754377543875439754407544175442754437544475445754467544775448754497545075451754527545375454754557545675457754587545975460754617546275463754647546575466754677546875469754707547175472754737547475475754767547775478754797548075481754827548375484754857548675487754887548975490754917549275493754947549575496754977549875499755007550175502755037550475505755067550775508755097551075511755127551375514755157551675517755187551975520755217552275523755247552575526755277552875529755307553175532755337553475535755367553775538755397554075541755427554375544755457554675547755487554975550755517555275553755547555575556755577555875559755607556175562755637556475565755667556775568755697557075571755727557375574755757557675577755787557975580755817558275583755847558575586755877558875589755907559175592755937559475595755967559775598755997560075601756027560375604756057560675607756087560975610756117561275613756147561575616756177561875619756207562175622756237562475625756267562775628756297563075631756327563375634756357563675637756387563975640756417564275643756447564575646756477564875649756507565175652756537565475655756567565775658756597566075661756627566375664756657566675667756687566975670756717567275673756747567575676756777567875679756807568175682756837568475685756867568775688756897569075691756927569375694756957569675697756987569975700757017570275703757047570575706757077570875709757107571175712757137571475715757167571775718757197572075721757227572375724757257572675727757287572975730757317573275733757347573575736757377573875739757407574175742757437574475745757467574775748757497575075751757527575375754757557575675757757587575975760757617576275763757647576575766757677576875769757707577175772757737577475775757767577775778757797578075781757827578375784757857578675787757887578975790757917579275793757947579575796757977579875799758007580175802758037580475805758067580775808758097581075811758127581375814758157581675817758187581975820758217582275823758247582575826758277582875829758307583175832758337583475835758367583775838758397584075841758427584375844758457584675847758487584975850758517585275853758547585575856758577585875859758607586175862758637586475865758667586775868758697587075871758727587375874758757587675877758787587975880758817588275883758847588575886758877588875889758907589175892758937589475895758967589775898758997590075901759027590375904759057590675907759087590975910759117591275913759147591575916759177591875919759207592175922759237592475925759267592775928759297593075931759327593375934759357593675937759387593975940759417594275943759447594575946759477594875949759507595175952759537595475955759567595775958759597596075961759627596375964759657596675967759687596975970759717597275973759747597575976759777597875979759807598175982759837598475985759867598775988759897599075991759927599375994759957599675997759987599976000760017600276003760047600576006760077600876009760107601176012760137601476015760167601776018760197602076021760227602376024760257602676027760287602976030760317603276033760347603576036760377603876039760407604176042760437604476045760467604776048760497605076051760527605376054760557605676057760587605976060760617606276063760647606576066760677606876069760707607176072760737607476075760767607776078760797608076081760827608376084760857608676087760887608976090760917609276093760947609576096760977609876099761007610176102761037610476105761067610776108761097611076111761127611376114761157611676117761187611976120761217612276123761247612576126761277612876129761307613176132761337613476135761367613776138761397614076141761427614376144761457614676147761487614976150761517615276153761547615576156761577615876159761607616176162761637616476165761667616776168761697617076171761727617376174761757617676177761787617976180761817618276183761847618576186761877618876189761907619176192761937619476195761967619776198761997620076201762027620376204762057620676207762087620976210762117621276213762147621576216762177621876219762207622176222762237622476225762267622776228762297623076231762327623376234762357623676237762387623976240762417624276243762447624576246762477624876249762507625176252762537625476255762567625776258762597626076261762627626376264762657626676267762687626976270762717627276273762747627576276762777627876279762807628176282762837628476285762867628776288762897629076291762927629376294762957629676297762987629976300763017630276303763047630576306763077630876309763107631176312763137631476315763167631776318763197632076321763227632376324763257632676327763287632976330763317633276333763347633576336763377633876339763407634176342763437634476345763467634776348763497635076351763527635376354763557635676357763587635976360763617636276363763647636576366763677636876369763707637176372763737637476375763767637776378763797638076381763827638376384763857638676387763887638976390763917639276393763947639576396763977639876399764007640176402764037640476405764067640776408764097641076411764127641376414764157641676417764187641976420764217642276423764247642576426764277642876429764307643176432764337643476435764367643776438764397644076441764427644376444764457644676447764487644976450764517645276453764547645576456764577645876459764607646176462764637646476465764667646776468764697647076471764727647376474764757647676477764787647976480764817648276483764847648576486764877648876489764907649176492764937649476495764967649776498764997650076501765027650376504765057650676507765087650976510765117651276513765147651576516765177651876519765207652176522765237652476525765267652776528765297653076531765327653376534765357653676537765387653976540765417654276543765447654576546765477654876549765507655176552765537655476555765567655776558765597656076561765627656376564765657656676567765687656976570765717657276573765747657576576765777657876579765807658176582765837658476585765867658776588765897659076591765927659376594765957659676597765987659976600766017660276603766047660576606766077660876609766107661176612766137661476615766167661776618766197662076621766227662376624766257662676627766287662976630766317663276633766347663576636766377663876639766407664176642766437664476645766467664776648766497665076651766527665376654766557665676657766587665976660766617666276663766647666576666766677666876669766707667176672766737667476675766767667776678766797668076681766827668376684766857668676687766887668976690766917669276693766947669576696766977669876699767007670176702767037670476705767067670776708767097671076711767127671376714767157671676717767187671976720767217672276723767247672576726767277672876729767307673176732767337673476735767367673776738767397674076741767427674376744767457674676747767487674976750767517675276753767547675576756767577675876759767607676176762767637676476765767667676776768767697677076771767727677376774767757677676777767787677976780767817678276783767847678576786767877678876789767907679176792767937679476795767967679776798767997680076801768027680376804768057680676807768087680976810768117681276813768147681576816768177681876819768207682176822768237682476825768267682776828768297683076831768327683376834768357683676837768387683976840768417684276843768447684576846768477684876849768507685176852768537685476855768567685776858768597686076861768627686376864768657686676867768687686976870768717687276873768747687576876768777687876879768807688176882768837688476885768867688776888768897689076891768927689376894768957689676897768987689976900769017690276903769047690576906769077690876909769107691176912769137691476915769167691776918769197692076921769227692376924769257692676927769287692976930769317693276933769347693576936769377693876939769407694176942769437694476945769467694776948769497695076951769527695376954769557695676957769587695976960769617696276963769647696576966769677696876969769707697176972769737697476975769767697776978769797698076981769827698376984769857698676987769887698976990769917699276993769947699576996769977699876999770007700177002770037700477005770067700777008770097701077011770127701377014770157701677017770187701977020770217702277023770247702577026770277702877029770307703177032770337703477035770367703777038770397704077041770427704377044770457704677047770487704977050770517705277053770547705577056770577705877059770607706177062770637706477065770667706777068770697707077071770727707377074770757707677077770787707977080770817708277083770847708577086770877708877089770907709177092770937709477095770967709777098770997710077101771027710377104771057710677107771087710977110771117711277113771147711577116771177711877119771207712177122771237712477125771267712777128771297713077131771327713377134771357713677137771387713977140771417714277143771447714577146771477714877149771507715177152771537715477155771567715777158771597716077161771627716377164771657716677167771687716977170771717717277173771747717577176771777717877179771807718177182771837718477185771867718777188771897719077191771927719377194771957719677197771987719977200772017720277203772047720577206772077720877209772107721177212772137721477215772167721777218772197722077221772227722377224772257722677227772287722977230772317723277233772347723577236772377723877239772407724177242772437724477245772467724777248772497725077251772527725377254772557725677257772587725977260772617726277263772647726577266772677726877269772707727177272772737727477275772767727777278772797728077281772827728377284772857728677287772887728977290772917729277293772947729577296772977729877299773007730177302773037730477305773067730777308773097731077311773127731377314773157731677317773187731977320773217732277323773247732577326773277732877329773307733177332773337733477335773367733777338773397734077341773427734377344773457734677347773487734977350773517735277353773547735577356773577735877359773607736177362773637736477365773667736777368773697737077371773727737377374773757737677377773787737977380773817738277383773847738577386773877738877389773907739177392773937739477395773967739777398773997740077401774027740377404774057740677407774087740977410774117741277413774147741577416774177741877419774207742177422774237742477425774267742777428774297743077431774327743377434774357743677437774387743977440774417744277443774447744577446774477744877449774507745177452774537745477455774567745777458774597746077461774627746377464774657746677467774687746977470774717747277473774747747577476774777747877479774807748177482774837748477485774867748777488774897749077491774927749377494774957749677497774987749977500775017750277503775047750577506775077750877509775107751177512775137751477515775167751777518775197752077521775227752377524775257752677527775287752977530775317753277533775347753577536775377753877539775407754177542775437754477545775467754777548775497755077551775527755377554775557755677557775587755977560775617756277563775647756577566775677756877569775707757177572775737757477575775767757777578775797758077581775827758377584775857758677587775887758977590775917759277593775947759577596775977759877599776007760177602776037760477605776067760777608776097761077611776127761377614776157761677617776187761977620776217762277623776247762577626776277762877629776307763177632776337763477635776367763777638776397764077641776427764377644776457764677647776487764977650776517765277653776547765577656776577765877659776607766177662776637766477665776667766777668776697767077671776727767377674776757767677677776787767977680776817768277683776847768577686776877768877689776907769177692776937769477695776967769777698776997770077701777027770377704777057770677707777087770977710777117771277713777147771577716777177771877719777207772177722777237772477725777267772777728777297773077731777327773377734777357773677737777387773977740777417774277743777447774577746777477774877749777507775177752777537775477755777567775777758777597776077761777627776377764777657776677767777687776977770777717777277773777747777577776777777777877779777807778177782777837778477785777867778777788777897779077791777927779377794777957779677797777987779977800778017780277803778047780577806778077780877809778107781177812778137781477815778167781777818778197782077821778227782377824778257782677827778287782977830778317783277833778347783577836778377783877839778407784177842778437784477845778467784777848778497785077851778527785377854778557785677857778587785977860778617786277863778647786577866778677786877869778707787177872778737787477875778767787777878778797788077881778827788377884778857788677887778887788977890778917789277893778947789577896778977789877899779007790177902779037790477905779067790777908779097791077911779127791377914779157791677917779187791977920779217792277923779247792577926779277792877929779307793177932779337793477935779367793777938779397794077941779427794377944779457794677947779487794977950779517795277953779547795577956779577795877959779607796177962779637796477965779667796777968779697797077971779727797377974779757797677977779787797977980779817798277983779847798577986779877798877989779907799177992779937799477995779967799777998779997800078001780027800378004780057800678007780087800978010780117801278013780147801578016780177801878019780207802178022780237802478025780267802778028780297803078031780327803378034780357803678037780387803978040780417804278043780447804578046780477804878049780507805178052780537805478055780567805778058780597806078061780627806378064780657806678067780687806978070780717807278073780747807578076780777807878079780807808178082780837808478085780867808778088780897809078091780927809378094780957809678097780987809978100781017810278103781047810578106781077810878109781107811178112781137811478115781167811778118781197812078121781227812378124781257812678127781287812978130781317813278133781347813578136781377813878139781407814178142781437814478145781467814778148781497815078151781527815378154781557815678157781587815978160781617816278163781647816578166781677816878169781707817178172781737817478175781767817778178781797818078181781827818378184781857818678187781887818978190781917819278193781947819578196781977819878199782007820178202782037820478205782067820778208782097821078211782127821378214782157821678217782187821978220782217822278223782247822578226782277822878229782307823178232782337823478235782367823778238782397824078241782427824378244782457824678247782487824978250782517825278253782547825578256782577825878259782607826178262782637826478265782667826778268782697827078271782727827378274782757827678277782787827978280782817828278283782847828578286782877828878289782907829178292782937829478295782967829778298782997830078301783027830378304783057830678307783087830978310783117831278313783147831578316783177831878319783207832178322783237832478325783267832778328783297833078331783327833378334783357833678337783387833978340783417834278343783447834578346783477834878349783507835178352783537835478355783567835778358783597836078361783627836378364783657836678367783687836978370783717837278373783747837578376783777837878379783807838178382783837838478385783867838778388783897839078391783927839378394783957839678397783987839978400784017840278403784047840578406784077840878409784107841178412784137841478415784167841778418784197842078421784227842378424784257842678427784287842978430784317843278433784347843578436784377843878439784407844178442784437844478445784467844778448784497845078451784527845378454784557845678457784587845978460784617846278463784647846578466784677846878469784707847178472784737847478475784767847778478784797848078481784827848378484784857848678487784887848978490784917849278493784947849578496784977849878499785007850178502785037850478505785067850778508785097851078511785127851378514785157851678517785187851978520785217852278523785247852578526785277852878529785307853178532785337853478535785367853778538785397854078541785427854378544785457854678547785487854978550785517855278553785547855578556785577855878559785607856178562785637856478565785667856778568785697857078571785727857378574785757857678577785787857978580785817858278583785847858578586785877858878589785907859178592785937859478595785967859778598785997860078601786027860378604786057860678607786087860978610786117861278613786147861578616786177861878619786207862178622786237862478625786267862778628786297863078631786327863378634786357863678637786387863978640786417864278643786447864578646786477864878649786507865178652786537865478655786567865778658786597866078661786627866378664786657866678667786687866978670786717867278673786747867578676786777867878679786807868178682786837868478685786867868778688786897869078691786927869378694786957869678697786987869978700787017870278703787047870578706787077870878709787107871178712787137871478715787167871778718787197872078721787227872378724787257872678727787287872978730787317873278733787347873578736787377873878739787407874178742787437874478745787467874778748787497875078751787527875378754787557875678757787587875978760787617876278763787647876578766787677876878769787707877178772787737877478775787767877778778787797878078781787827878378784787857878678787787887878978790787917879278793787947879578796787977879878799788007880178802788037880478805788067880778808788097881078811788127881378814788157881678817788187881978820788217882278823788247882578826788277882878829788307883178832788337883478835788367883778838788397884078841788427884378844788457884678847788487884978850788517885278853788547885578856788577885878859788607886178862788637886478865788667886778868788697887078871788727887378874788757887678877788787887978880788817888278883788847888578886788877888878889788907889178892788937889478895788967889778898788997890078901789027890378904789057890678907789087890978910789117891278913789147891578916789177891878919789207892178922789237892478925789267892778928789297893078931789327893378934789357893678937789387893978940789417894278943789447894578946789477894878949789507895178952789537895478955789567895778958789597896078961789627896378964789657896678967789687896978970789717897278973789747897578976789777897878979789807898178982789837898478985789867898778988789897899078991789927899378994789957899678997789987899979000790017900279003790047900579006790077900879009790107901179012790137901479015790167901779018790197902079021790227902379024790257902679027790287902979030790317903279033790347903579036790377903879039790407904179042790437904479045790467904779048790497905079051790527905379054790557905679057790587905979060790617906279063790647906579066790677906879069790707907179072790737907479075790767907779078790797908079081790827908379084790857908679087790887908979090790917909279093790947909579096790977909879099791007910179102791037910479105791067910779108791097911079111791127911379114791157911679117791187911979120791217912279123791247912579126791277912879129791307913179132791337913479135791367913779138791397914079141791427914379144791457914679147791487914979150791517915279153791547915579156791577915879159791607916179162791637916479165791667916779168791697917079171791727917379174791757917679177791787917979180791817918279183791847918579186791877918879189791907919179192791937919479195791967919779198791997920079201792027920379204792057920679207792087920979210792117921279213792147921579216792177921879219792207922179222792237922479225792267922779228792297923079231792327923379234792357923679237792387923979240792417924279243792447924579246792477924879249792507925179252792537925479255792567925779258792597926079261792627926379264792657926679267792687926979270792717927279273792747927579276792777927879279792807928179282792837928479285792867928779288792897929079291792927929379294792957929679297792987929979300793017930279303793047930579306793077930879309793107931179312793137931479315793167931779318793197932079321793227932379324793257932679327793287932979330793317933279333793347933579336793377933879339793407934179342793437934479345793467934779348793497935079351793527935379354793557935679357793587935979360793617936279363793647936579366793677936879369793707937179372793737937479375793767937779378793797938079381793827938379384793857938679387793887938979390793917939279393793947939579396793977939879399794007940179402794037940479405794067940779408794097941079411794127941379414794157941679417794187941979420794217942279423794247942579426794277942879429794307943179432794337943479435794367943779438794397944079441794427944379444794457944679447794487944979450794517945279453794547945579456794577945879459794607946179462794637946479465794667946779468794697947079471794727947379474794757947679477794787947979480794817948279483794847948579486794877948879489794907949179492794937949479495794967949779498794997950079501795027950379504795057950679507795087950979510795117951279513795147951579516795177951879519795207952179522795237952479525795267952779528795297953079531795327953379534795357953679537795387953979540795417954279543795447954579546795477954879549795507955179552795537955479555795567955779558795597956079561795627956379564795657956679567795687956979570795717957279573795747957579576795777957879579795807958179582795837958479585795867958779588795897959079591795927959379594795957959679597795987959979600796017960279603796047960579606796077960879609796107961179612796137961479615796167961779618796197962079621796227962379624796257962679627796287962979630796317963279633796347963579636796377963879639796407964179642796437964479645796467964779648796497965079651796527965379654796557965679657796587965979660796617966279663796647966579666796677966879669796707967179672796737967479675796767967779678796797968079681796827968379684796857968679687796887968979690796917969279693796947969579696796977969879699797007970179702797037970479705797067970779708797097971079711797127971379714797157971679717797187971979720797217972279723797247972579726797277972879729797307973179732797337973479735797367973779738797397974079741797427974379744797457974679747797487974979750797517975279753797547975579756797577975879759797607976179762797637976479765797667976779768797697977079771797727977379774797757977679777797787977979780797817978279783797847978579786797877978879789797907979179792797937979479795797967979779798797997980079801798027980379804798057980679807798087980979810798117981279813798147981579816798177981879819798207982179822798237982479825798267982779828798297983079831798327983379834798357983679837798387983979840798417984279843798447984579846798477984879849798507985179852798537985479855798567985779858798597986079861798627986379864798657986679867798687986979870798717987279873798747987579876798777987879879798807988179882798837988479885798867988779888798897989079891798927989379894798957989679897798987989979900799017990279903799047990579906799077990879909799107991179912799137991479915799167991779918799197992079921799227992379924799257992679927799287992979930799317993279933799347993579936799377993879939799407994179942799437994479945799467994779948799497995079951799527995379954799557995679957799587995979960799617996279963799647996579966799677996879969799707997179972799737997479975799767997779978799797998079981799827998379984799857998679987799887998979990799917999279993799947999579996799977999879999800008000180002800038000480005800068000780008800098001080011800128001380014800158001680017800188001980020800218002280023800248002580026800278002880029800308003180032800338003480035800368003780038800398004080041800428004380044800458004680047800488004980050800518005280053800548005580056800578005880059800608006180062800638006480065800668006780068800698007080071800728007380074800758007680077800788007980080800818008280083800848008580086800878008880089800908009180092800938009480095800968009780098800998010080101801028010380104801058010680107801088010980110801118011280113801148011580116801178011880119801208012180122801238012480125801268012780128801298013080131801328013380134801358013680137801388013980140801418014280143801448014580146801478014880149801508015180152801538015480155801568015780158801598016080161801628016380164801658016680167801688016980170801718017280173801748017580176801778017880179801808018180182801838018480185801868018780188801898019080191801928019380194801958019680197801988019980200802018020280203802048020580206802078020880209802108021180212802138021480215802168021780218802198022080221802228022380224802258022680227802288022980230802318023280233802348023580236802378023880239802408024180242802438024480245802468024780248802498025080251802528025380254802558025680257802588025980260802618026280263802648026580266802678026880269802708027180272802738027480275802768027780278802798028080281802828028380284802858028680287802888028980290802918029280293802948029580296802978029880299803008030180302803038030480305803068030780308803098031080311803128031380314803158031680317803188031980320803218032280323803248032580326803278032880329803308033180332803338033480335803368033780338803398034080341803428034380344803458034680347803488034980350803518035280353803548035580356803578035880359803608036180362803638036480365803668036780368803698037080371803728037380374803758037680377803788037980380803818038280383803848038580386803878038880389803908039180392803938039480395803968039780398803998040080401804028040380404804058040680407804088040980410804118041280413804148041580416804178041880419804208042180422804238042480425804268042780428804298043080431804328043380434804358043680437804388043980440804418044280443804448044580446804478044880449804508045180452804538045480455804568045780458804598046080461804628046380464804658046680467804688046980470804718047280473804748047580476804778047880479804808048180482804838048480485804868048780488804898049080491804928049380494804958049680497804988049980500805018050280503805048050580506805078050880509805108051180512805138051480515805168051780518805198052080521805228052380524805258052680527805288052980530805318053280533805348053580536805378053880539805408054180542805438054480545805468054780548805498055080551805528055380554805558055680557805588055980560805618056280563805648056580566805678056880569805708057180572805738057480575805768057780578805798058080581805828058380584805858058680587805888058980590805918059280593805948059580596805978059880599806008060180602806038060480605806068060780608806098061080611806128061380614806158061680617806188061980620806218062280623806248062580626806278062880629806308063180632806338063480635806368063780638806398064080641806428064380644806458064680647806488064980650806518065280653806548065580656806578065880659806608066180662806638066480665806668066780668806698067080671806728067380674806758067680677806788067980680806818068280683806848068580686806878068880689806908069180692806938069480695806968069780698806998070080701807028070380704807058070680707807088070980710807118071280713807148071580716807178071880719807208072180722807238072480725807268072780728807298073080731807328073380734807358073680737807388073980740807418074280743807448074580746807478074880749807508075180752807538075480755807568075780758807598076080761807628076380764807658076680767807688076980770807718077280773807748077580776807778077880779807808078180782807838078480785807868078780788807898079080791807928079380794807958079680797807988079980800808018080280803808048080580806808078080880809808108081180812808138081480815808168081780818808198082080821808228082380824808258082680827808288082980830808318083280833808348083580836808378083880839808408084180842808438084480845808468084780848808498085080851808528085380854808558085680857808588085980860808618086280863808648086580866808678086880869808708087180872808738087480875808768087780878808798088080881808828088380884808858088680887808888088980890808918089280893808948089580896808978089880899809008090180902809038090480905809068090780908809098091080911809128091380914809158091680917809188091980920809218092280923809248092580926809278092880929809308093180932809338093480935809368093780938809398094080941809428094380944809458094680947809488094980950809518095280953809548095580956809578095880959809608096180962809638096480965809668096780968809698097080971809728097380974809758097680977809788097980980809818098280983809848098580986809878098880989809908099180992809938099480995809968099780998809998100081001810028100381004810058100681007810088100981010810118101281013810148101581016810178101881019810208102181022810238102481025810268102781028810298103081031810328103381034810358103681037810388103981040810418104281043810448104581046810478104881049810508105181052810538105481055810568105781058810598106081061810628106381064810658106681067810688106981070810718107281073810748107581076810778107881079810808108181082810838108481085810868108781088810898109081091810928109381094810958109681097810988109981100811018110281103811048110581106811078110881109811108111181112811138111481115811168111781118811198112081121811228112381124811258112681127811288112981130811318113281133811348113581136811378113881139811408114181142811438114481145811468114781148811498115081151811528115381154811558115681157811588115981160811618116281163811648116581166811678116881169811708117181172811738117481175811768117781178811798118081181811828118381184811858118681187811888118981190811918119281193811948119581196811978119881199812008120181202812038120481205812068120781208812098121081211812128121381214812158121681217812188121981220812218122281223812248122581226812278122881229812308123181232812338123481235812368123781238812398124081241812428124381244812458124681247812488124981250812518125281253812548125581256812578125881259812608126181262812638126481265812668126781268812698127081271812728127381274812758127681277812788127981280812818128281283812848128581286812878128881289812908129181292812938129481295812968129781298812998130081301813028130381304813058130681307813088130981310813118131281313813148131581316813178131881319813208132181322813238132481325813268132781328813298133081331813328133381334813358133681337813388133981340813418134281343813448134581346813478134881349813508135181352813538135481355813568135781358813598136081361813628136381364813658136681367813688136981370813718137281373813748137581376813778137881379813808138181382813838138481385813868138781388813898139081391813928139381394813958139681397813988139981400814018140281403814048140581406814078140881409814108141181412814138141481415814168141781418814198142081421814228142381424814258142681427814288142981430814318143281433814348143581436814378143881439814408144181442814438144481445814468144781448814498145081451814528145381454814558145681457814588145981460814618146281463814648146581466814678146881469814708147181472814738147481475814768147781478814798148081481814828148381484814858148681487814888148981490814918149281493814948149581496814978149881499815008150181502815038150481505815068150781508815098151081511815128151381514815158151681517815188151981520815218152281523815248152581526815278152881529815308153181532815338153481535815368153781538815398154081541815428154381544815458154681547815488154981550815518155281553815548155581556815578155881559815608156181562815638156481565815668156781568815698157081571815728157381574815758157681577815788157981580815818158281583815848158581586815878158881589815908159181592815938159481595815968159781598815998160081601816028160381604816058160681607816088160981610816118161281613816148161581616816178161881619816208162181622816238162481625816268162781628816298163081631816328163381634816358163681637816388163981640816418164281643816448164581646816478164881649816508165181652816538165481655816568165781658816598166081661816628166381664816658166681667816688166981670816718167281673816748167581676816778167881679816808168181682816838168481685816868168781688816898169081691816928169381694816958169681697816988169981700817018170281703817048170581706817078170881709817108171181712817138171481715817168171781718817198172081721817228172381724817258172681727817288172981730817318173281733817348173581736817378173881739817408174181742817438174481745817468174781748817498175081751817528175381754817558175681757817588175981760817618176281763817648176581766817678176881769817708177181772817738177481775817768177781778817798178081781817828178381784817858178681787817888178981790817918179281793817948179581796817978179881799818008180181802818038180481805818068180781808818098181081811818128181381814818158181681817818188181981820818218182281823818248182581826818278182881829818308183181832818338183481835818368183781838818398184081841818428184381844818458184681847818488184981850818518185281853818548185581856818578185881859818608186181862818638186481865818668186781868818698187081871818728187381874818758187681877818788187981880818818188281883818848188581886818878188881889818908189181892818938189481895818968189781898818998190081901819028190381904819058190681907819088190981910819118191281913819148191581916819178191881919819208192181922819238192481925819268192781928819298193081931819328193381934819358193681937819388193981940819418194281943819448194581946819478194881949819508195181952819538195481955819568195781958819598196081961819628196381964819658196681967819688196981970819718197281973819748197581976819778197881979819808198181982819838198481985819868198781988819898199081991819928199381994819958199681997819988199982000820018200282003820048200582006820078200882009820108201182012820138201482015820168201782018820198202082021820228202382024820258202682027820288202982030820318203282033820348203582036820378203882039820408204182042820438204482045820468204782048820498205082051820528205382054820558205682057820588205982060820618206282063820648206582066820678206882069820708207182072820738207482075820768207782078820798208082081820828208382084820858208682087820888208982090820918209282093820948209582096820978209882099821008210182102821038210482105821068210782108821098211082111821128211382114821158211682117821188211982120821218212282123821248212582126821278212882129821308213182132821338213482135821368213782138821398214082141821428214382144821458214682147821488214982150821518215282153821548215582156821578215882159821608216182162821638216482165821668216782168821698217082171821728217382174821758217682177821788217982180821818218282183821848218582186821878218882189821908219182192821938219482195821968219782198821998220082201822028220382204822058220682207822088220982210822118221282213822148221582216822178221882219822208222182222822238222482225822268222782228822298223082231822328223382234822358223682237822388223982240822418224282243822448224582246822478224882249822508225182252822538225482255822568225782258822598226082261822628226382264822658226682267822688226982270822718227282273822748227582276822778227882279822808228182282822838228482285822868228782288822898229082291822928229382294822958229682297822988229982300823018230282303823048230582306823078230882309823108231182312823138231482315823168231782318823198232082321823228232382324823258232682327823288232982330823318233282333823348233582336823378233882339823408234182342823438234482345823468234782348823498235082351823528235382354823558235682357823588235982360823618236282363823648236582366823678236882369823708237182372823738237482375823768237782378823798238082381823828238382384823858238682387823888238982390823918239282393823948239582396823978239882399824008240182402824038240482405824068240782408824098241082411824128241382414824158241682417824188241982420824218242282423824248242582426824278242882429824308243182432824338243482435824368243782438824398244082441824428244382444824458244682447824488244982450824518245282453824548245582456824578245882459824608246182462824638246482465824668246782468824698247082471824728247382474824758247682477824788247982480824818248282483824848248582486824878248882489824908249182492824938249482495824968249782498824998250082501825028250382504825058250682507825088250982510825118251282513825148251582516825178251882519825208252182522825238252482525825268252782528825298253082531825328253382534825358253682537825388253982540825418254282543825448254582546825478254882549825508255182552825538255482555825568255782558825598256082561825628256382564825658256682567825688256982570825718257282573825748257582576825778257882579825808258182582825838258482585825868258782588825898259082591825928259382594825958259682597825988259982600826018260282603826048260582606826078260882609826108261182612826138261482615826168261782618826198262082621826228262382624826258262682627826288262982630826318263282633826348263582636826378263882639826408264182642826438264482645826468264782648826498265082651826528265382654826558265682657826588265982660826618266282663826648266582666826678266882669826708267182672826738267482675826768267782678826798268082681826828268382684826858268682687826888268982690826918269282693826948269582696826978269882699827008270182702827038270482705827068270782708827098271082711827128271382714827158271682717827188271982720827218272282723827248272582726827278272882729827308273182732827338273482735827368273782738827398274082741827428274382744827458274682747827488274982750827518275282753827548275582756827578275882759827608276182762827638276482765827668276782768827698277082771827728277382774827758277682777827788277982780827818278282783827848278582786827878278882789827908279182792827938279482795827968279782798827998280082801828028280382804828058280682807828088280982810828118281282813828148281582816828178281882819828208282182822828238282482825828268282782828828298283082831828328283382834828358283682837828388283982840828418284282843828448284582846828478284882849828508285182852828538285482855828568285782858828598286082861828628286382864828658286682867828688286982870828718287282873828748287582876828778287882879828808288182882828838288482885828868288782888828898289082891828928289382894828958289682897828988289982900829018290282903829048290582906829078290882909829108291182912829138291482915829168291782918829198292082921829228292382924829258292682927829288292982930829318293282933829348293582936829378293882939829408294182942829438294482945829468294782948829498295082951829528295382954829558295682957829588295982960829618296282963829648296582966829678296882969829708297182972829738297482975829768297782978829798298082981829828298382984829858298682987829888298982990829918299282993829948299582996829978299882999830008300183002830038300483005830068300783008830098301083011830128301383014830158301683017830188301983020830218302283023830248302583026830278302883029830308303183032830338303483035830368303783038830398304083041830428304383044830458304683047830488304983050830518305283053830548305583056830578305883059830608306183062830638306483065830668306783068830698307083071830728307383074830758307683077830788307983080830818308283083830848308583086830878308883089830908309183092830938309483095830968309783098830998310083101831028310383104831058310683107831088310983110831118311283113831148311583116831178311883119831208312183122831238312483125831268312783128831298313083131831328313383134831358313683137831388313983140831418314283143831448314583146831478314883149831508315183152831538315483155831568315783158831598316083161831628316383164831658316683167831688316983170831718317283173831748317583176831778317883179831808318183182831838318483185831868318783188831898319083191831928319383194831958319683197831988319983200832018320283203832048320583206832078320883209832108321183212832138321483215832168321783218832198322083221832228322383224832258322683227832288322983230832318323283233832348323583236832378323883239832408324183242832438324483245832468324783248832498325083251832528325383254832558325683257832588325983260832618326283263832648326583266832678326883269832708327183272832738327483275832768327783278832798328083281832828328383284832858328683287832888328983290832918329283293832948329583296832978329883299833008330183302833038330483305833068330783308833098331083311833128331383314833158331683317833188331983320833218332283323833248332583326833278332883329833308333183332833338333483335833368333783338833398334083341833428334383344833458334683347833488334983350833518335283353833548335583356833578335883359833608336183362833638336483365833668336783368833698337083371833728337383374833758337683377833788337983380833818338283383833848338583386833878338883389833908339183392833938339483395833968339783398833998340083401834028340383404834058340683407834088340983410834118341283413834148341583416834178341883419834208342183422834238342483425834268342783428834298343083431834328343383434834358343683437834388343983440834418344283443834448344583446834478344883449834508345183452834538345483455834568345783458834598346083461834628346383464834658346683467834688346983470834718347283473834748347583476834778347883479834808348183482834838348483485834868348783488834898349083491834928349383494834958349683497834988349983500835018350283503835048350583506835078350883509835108351183512835138351483515835168351783518835198352083521835228352383524835258352683527835288352983530835318353283533835348353583536835378353883539835408354183542835438354483545835468354783548835498355083551835528355383554835558355683557835588355983560835618356283563835648356583566835678356883569835708357183572835738357483575835768357783578835798358083581835828358383584835858358683587835888358983590835918359283593835948359583596835978359883599836008360183602836038360483605836068360783608836098361083611836128361383614836158361683617836188361983620836218362283623836248362583626836278362883629836308363183632836338363483635836368363783638836398364083641836428364383644836458364683647836488364983650836518365283653836548365583656836578365883659836608366183662836638366483665836668366783668836698367083671836728367383674836758367683677836788367983680836818368283683836848368583686836878368883689836908369183692836938369483695836968369783698836998370083701837028370383704837058370683707837088370983710837118371283713837148371583716837178371883719837208372183722837238372483725837268372783728837298373083731837328373383734837358373683737837388373983740837418374283743837448374583746837478374883749837508375183752837538375483755837568375783758837598376083761837628376383764837658376683767837688376983770837718377283773837748377583776837778377883779837808378183782837838378483785837868378783788837898379083791837928379383794837958379683797837988379983800838018380283803838048380583806838078380883809838108381183812838138381483815838168381783818838198382083821838228382383824838258382683827838288382983830838318383283833838348383583836838378383883839838408384183842838438384483845838468384783848838498385083851838528385383854838558385683857838588385983860838618386283863838648386583866838678386883869838708387183872838738387483875838768387783878838798388083881838828388383884838858388683887838888388983890838918389283893838948389583896838978389883899839008390183902839038390483905839068390783908839098391083911839128391383914839158391683917839188391983920839218392283923839248392583926839278392883929839308393183932839338393483935839368393783938839398394083941839428394383944839458394683947839488394983950839518395283953839548395583956839578395883959839608396183962839638396483965839668396783968839698397083971839728397383974839758397683977839788397983980839818398283983839848398583986839878398883989839908399183992839938399483995839968399783998839998400084001840028400384004840058400684007840088400984010840118401284013840148401584016840178401884019840208402184022840238402484025840268402784028840298403084031840328403384034840358403684037840388403984040840418404284043840448404584046840478404884049840508405184052840538405484055840568405784058840598406084061840628406384064840658406684067840688406984070840718407284073840748407584076840778407884079840808408184082840838408484085840868408784088840898409084091840928409384094840958409684097840988409984100841018410284103841048410584106841078410884109841108411184112841138411484115841168411784118841198412084121841228412384124841258412684127841288412984130841318413284133841348413584136841378413884139841408414184142841438414484145841468414784148841498415084151841528415384154841558415684157841588415984160841618416284163841648416584166841678416884169841708417184172841738417484175841768417784178841798418084181841828418384184841858418684187841888418984190841918419284193841948419584196841978419884199842008420184202842038420484205842068420784208842098421084211842128421384214842158421684217842188421984220842218422284223842248422584226842278422884229842308423184232842338423484235842368423784238842398424084241842428424384244842458424684247842488424984250842518425284253842548425584256842578425884259842608426184262842638426484265842668426784268842698427084271842728427384274842758427684277842788427984280842818428284283842848428584286842878428884289842908429184292842938429484295842968429784298842998430084301843028430384304843058430684307843088430984310843118431284313843148431584316843178431884319843208432184322843238432484325843268432784328843298433084331843328433384334843358433684337843388433984340843418434284343843448434584346843478434884349843508435184352843538435484355843568435784358843598436084361843628436384364843658436684367843688436984370843718437284373843748437584376843778437884379843808438184382843838438484385843868438784388843898439084391843928439384394843958439684397843988439984400844018440284403844048440584406844078440884409844108441184412844138441484415844168441784418844198442084421844228442384424844258442684427844288442984430844318443284433844348443584436844378443884439844408444184442844438444484445844468444784448844498445084451844528445384454844558445684457844588445984460844618446284463844648446584466844678446884469844708447184472844738447484475844768447784478844798448084481844828448384484844858448684487844888448984490844918449284493844948449584496844978449884499845008450184502845038450484505845068450784508845098451084511845128451384514845158451684517845188451984520845218452284523845248452584526845278452884529845308453184532845338453484535845368453784538845398454084541845428454384544845458454684547845488454984550845518455284553845548455584556845578455884559845608456184562845638456484565845668456784568845698457084571845728457384574845758457684577845788457984580845818458284583845848458584586845878458884589845908459184592845938459484595845968459784598845998460084601846028460384604846058460684607846088460984610846118461284613846148461584616846178461884619846208462184622846238462484625846268462784628846298463084631846328463384634846358463684637846388463984640846418464284643846448464584646846478464884649846508465184652846538465484655846568465784658846598466084661846628466384664846658466684667846688466984670846718467284673846748467584676846778467884679846808468184682846838468484685846868468784688846898469084691846928469384694846958469684697846988469984700847018470284703847048470584706847078470884709847108471184712847138471484715847168471784718847198472084721847228472384724847258472684727847288472984730847318473284733847348473584736847378473884739847408474184742847438474484745847468474784748847498475084751847528475384754847558475684757847588475984760847618476284763847648476584766847678476884769847708477184772847738477484775847768477784778847798478084781847828478384784847858478684787847888478984790847918479284793847948479584796847978479884799848008480184802848038480484805848068480784808848098481084811848128481384814848158481684817848188481984820848218482284823848248482584826848278482884829848308483184832848338483484835848368483784838848398484084841848428484384844848458484684847848488484984850848518485284853848548485584856848578485884859848608486184862848638486484865848668486784868848698487084871848728487384874848758487684877848788487984880848818488284883848848488584886848878488884889848908489184892848938489484895848968489784898848998490084901849028490384904849058490684907849088490984910849118491284913849148491584916849178491884919849208492184922849238492484925849268492784928849298493084931849328493384934849358493684937849388493984940849418494284943849448494584946849478494884949849508495184952849538495484955849568495784958849598496084961849628496384964849658496684967849688496984970849718497284973849748497584976849778497884979849808498184982849838498484985849868498784988849898499084991849928499384994849958499684997849988499985000850018500285003850048500585006850078500885009850108501185012850138501485015850168501785018850198502085021850228502385024850258502685027850288502985030850318503285033850348503585036850378503885039850408504185042850438504485045850468504785048850498505085051850528505385054850558505685057850588505985060850618506285063850648506585066850678506885069850708507185072850738507485075850768507785078850798508085081850828508385084850858508685087850888508985090850918509285093850948509585096850978509885099851008510185102851038510485105851068510785108851098511085111851128511385114851158511685117851188511985120851218512285123851248512585126851278512885129851308513185132851338513485135851368513785138851398514085141851428514385144851458514685147851488514985150851518515285153851548515585156851578515885159851608516185162851638516485165851668516785168851698517085171851728517385174851758517685177851788517985180851818518285183851848518585186851878518885189851908519185192851938519485195851968519785198851998520085201852028520385204852058520685207852088520985210852118521285213852148521585216852178521885219852208522185222852238522485225852268522785228852298523085231852328523385234852358523685237852388523985240852418524285243852448524585246852478524885249852508525185252852538525485255852568525785258852598526085261852628526385264852658526685267852688526985270852718527285273852748527585276852778527885279852808528185282852838528485285852868528785288852898529085291852928529385294852958529685297852988529985300853018530285303853048530585306853078530885309853108531185312853138531485315853168531785318853198532085321853228532385324853258532685327853288532985330853318533285333853348533585336853378533885339853408534185342853438534485345853468534785348853498535085351853528535385354853558535685357853588535985360853618536285363853648536585366853678536885369853708537185372853738537485375853768537785378853798538085381853828538385384853858538685387853888538985390853918539285393853948539585396853978539885399854008540185402854038540485405854068540785408854098541085411854128541385414854158541685417854188541985420854218542285423854248542585426854278542885429854308543185432854338543485435854368543785438854398544085441854428544385444854458544685447854488544985450854518545285453854548545585456854578545885459854608546185462854638546485465854668546785468854698547085471854728547385474854758547685477854788547985480854818548285483854848548585486854878548885489854908549185492854938549485495854968549785498854998550085501855028550385504855058550685507855088550985510855118551285513855148551585516855178551885519855208552185522855238552485525855268552785528855298553085531855328553385534855358553685537855388553985540855418554285543855448554585546855478554885549855508555185552855538555485555855568555785558855598556085561855628556385564855658556685567855688556985570855718557285573855748557585576855778557885579855808558185582855838558485585855868558785588855898559085591855928559385594855958559685597855988559985600856018560285603856048560585606856078560885609856108561185612856138561485615856168561785618856198562085621856228562385624856258562685627856288562985630856318563285633856348563585636856378563885639856408564185642856438564485645856468564785648856498565085651856528565385654856558565685657856588565985660856618566285663856648566585666856678566885669856708567185672856738567485675856768567785678856798568085681856828568385684856858568685687856888568985690856918569285693856948569585696856978569885699857008570185702857038570485705857068570785708857098571085711857128571385714857158571685717857188571985720857218572285723857248572585726857278572885729857308573185732857338573485735857368573785738857398574085741857428574385744857458574685747857488574985750857518575285753857548575585756857578575885759857608576185762857638576485765857668576785768857698577085771857728577385774857758577685777857788577985780857818578285783857848578585786857878578885789857908579185792857938579485795857968579785798857998580085801858028580385804858058580685807858088580985810858118581285813858148581585816858178581885819858208582185822858238582485825858268582785828858298583085831858328583385834858358583685837858388583985840858418584285843858448584585846858478584885849858508585185852858538585485855858568585785858858598586085861858628586385864858658586685867858688586985870858718587285873858748587585876858778587885879858808588185882858838588485885858868588785888858898589085891858928589385894858958589685897858988589985900859018590285903859048590585906859078590885909859108591185912859138591485915859168591785918859198592085921859228592385924859258592685927859288592985930859318593285933859348593585936859378593885939859408594185942859438594485945859468594785948859498595085951859528595385954859558595685957859588595985960859618596285963859648596585966859678596885969859708597185972859738597485975859768597785978859798598085981859828598385984859858598685987859888598985990859918599285993859948599585996859978599885999860008600186002860038600486005860068600786008860098601086011860128601386014860158601686017860188601986020860218602286023860248602586026860278602886029860308603186032860338603486035860368603786038860398604086041860428604386044860458604686047860488604986050860518605286053860548605586056860578605886059860608606186062860638606486065860668606786068860698607086071860728607386074860758607686077860788607986080860818608286083860848608586086860878608886089860908609186092860938609486095860968609786098860998610086101861028610386104861058610686107861088610986110861118611286113861148611586116861178611886119861208612186122861238612486125861268612786128861298613086131861328613386134861358613686137861388613986140861418614286143861448614586146861478614886149861508615186152861538615486155861568615786158861598616086161861628616386164861658616686167861688616986170861718617286173861748617586176861778617886179861808618186182861838618486185861868618786188861898619086191861928619386194861958619686197861988619986200862018620286203862048620586206862078620886209862108621186212862138621486215862168621786218862198622086221862228622386224862258622686227862288622986230862318623286233862348623586236862378623886239862408624186242862438624486245862468624786248862498625086251862528625386254862558625686257862588625986260862618626286263862648626586266862678626886269862708627186272862738627486275862768627786278862798628086281862828628386284862858628686287862888628986290862918629286293862948629586296862978629886299863008630186302863038630486305863068630786308863098631086311863128631386314863158631686317863188631986320863218632286323863248632586326863278632886329863308633186332863338633486335863368633786338863398634086341863428634386344863458634686347863488634986350863518635286353863548635586356863578635886359863608636186362863638636486365863668636786368863698637086371863728637386374863758637686377863788637986380863818638286383863848638586386863878638886389863908639186392863938639486395863968639786398863998640086401864028640386404864058640686407864088640986410864118641286413864148641586416864178641886419864208642186422864238642486425864268642786428864298643086431864328643386434864358643686437864388643986440864418644286443864448644586446864478644886449864508645186452864538645486455864568645786458864598646086461864628646386464864658646686467864688646986470864718647286473864748647586476864778647886479864808648186482864838648486485864868648786488864898649086491864928649386494864958649686497864988649986500865018650286503865048650586506865078650886509865108651186512865138651486515865168651786518865198652086521865228652386524865258652686527865288652986530865318653286533865348653586536865378653886539865408654186542865438654486545865468654786548865498655086551865528655386554865558655686557865588655986560865618656286563865648656586566865678656886569865708657186572865738657486575865768657786578865798658086581865828658386584865858658686587865888658986590865918659286593865948659586596865978659886599866008660186602866038660486605866068660786608866098661086611866128661386614866158661686617866188661986620866218662286623866248662586626866278662886629866308663186632866338663486635866368663786638866398664086641866428664386644866458664686647866488664986650866518665286653866548665586656866578665886659866608666186662866638666486665866668666786668866698667086671866728667386674866758667686677866788667986680866818668286683866848668586686866878668886689866908669186692866938669486695866968669786698866998670086701867028670386704867058670686707867088670986710867118671286713867148671586716867178671886719867208672186722867238672486725867268672786728867298673086731867328673386734867358673686737867388673986740867418674286743867448674586746867478674886749867508675186752867538675486755867568675786758867598676086761867628676386764867658676686767867688676986770867718677286773867748677586776867778677886779867808678186782867838678486785867868678786788867898679086791867928679386794867958679686797867988679986800868018680286803868048680586806868078680886809868108681186812868138681486815868168681786818868198682086821868228682386824868258682686827868288682986830868318683286833868348683586836868378683886839868408684186842868438684486845868468684786848868498685086851868528685386854868558685686857868588685986860868618686286863868648686586866868678686886869868708687186872868738687486875868768687786878868798688086881868828688386884868858688686887868888688986890868918689286893868948689586896868978689886899869008690186902869038690486905869068690786908869098691086911869128691386914869158691686917869188691986920869218692286923869248692586926869278692886929869308693186932869338693486935869368693786938869398694086941869428694386944869458694686947869488694986950869518695286953869548695586956869578695886959869608696186962869638696486965869668696786968869698697086971869728697386974869758697686977869788697986980869818698286983869848698586986869878698886989869908699186992869938699486995869968699786998869998700087001870028700387004870058700687007870088700987010870118701287013870148701587016870178701887019870208702187022870238702487025870268702787028870298703087031870328703387034870358703687037870388703987040870418704287043870448704587046870478704887049870508705187052870538705487055870568705787058870598706087061870628706387064870658706687067870688706987070870718707287073870748707587076870778707887079870808708187082870838708487085870868708787088870898709087091870928709387094870958709687097870988709987100871018710287103871048710587106871078710887109871108711187112871138711487115871168711787118871198712087121871228712387124871258712687127871288712987130871318713287133871348713587136871378713887139871408714187142871438714487145871468714787148871498715087151871528715387154871558715687157871588715987160871618716287163871648716587166871678716887169871708717187172871738717487175871768717787178871798718087181871828718387184871858718687187871888718987190871918719287193871948719587196871978719887199872008720187202872038720487205872068720787208872098721087211872128721387214872158721687217872188721987220872218722287223872248722587226872278722887229872308723187232872338723487235872368723787238872398724087241872428724387244872458724687247872488724987250872518725287253872548725587256872578725887259872608726187262872638726487265872668726787268872698727087271872728727387274872758727687277872788727987280872818728287283872848728587286872878728887289872908729187292872938729487295872968729787298872998730087301873028730387304873058730687307873088730987310873118731287313873148731587316873178731887319873208732187322873238732487325873268732787328873298733087331873328733387334873358733687337873388733987340873418734287343873448734587346873478734887349873508735187352873538735487355873568735787358873598736087361873628736387364873658736687367873688736987370873718737287373873748737587376873778737887379873808738187382873838738487385873868738787388873898739087391873928739387394873958739687397873988739987400874018740287403874048740587406874078740887409874108741187412874138741487415874168741787418874198742087421874228742387424874258742687427874288742987430874318743287433874348743587436874378743887439874408744187442874438744487445874468744787448874498745087451874528745387454874558745687457874588745987460874618746287463874648746587466874678746887469874708747187472874738747487475874768747787478874798748087481874828748387484874858748687487874888748987490874918749287493874948749587496874978749887499875008750187502875038750487505875068750787508875098751087511875128751387514875158751687517875188751987520875218752287523875248752587526875278752887529875308753187532875338753487535875368753787538875398754087541875428754387544875458754687547875488754987550875518755287553875548755587556875578755887559875608756187562875638756487565875668756787568875698757087571875728757387574875758757687577875788757987580875818758287583875848758587586875878758887589875908759187592875938759487595875968759787598875998760087601876028760387604876058760687607876088760987610876118761287613876148761587616876178761887619876208762187622876238762487625876268762787628876298763087631876328763387634876358763687637876388763987640876418764287643876448764587646876478764887649876508765187652876538765487655876568765787658876598766087661876628766387664876658766687667876688766987670876718767287673876748767587676876778767887679876808768187682876838768487685876868768787688876898769087691876928769387694876958769687697876988769987700877018770287703877048770587706877078770887709877108771187712877138771487715877168771787718877198772087721877228772387724877258772687727877288772987730877318773287733877348773587736877378773887739877408774187742877438774487745877468774787748877498775087751877528775387754877558775687757877588775987760877618776287763877648776587766877678776887769877708777187772877738777487775877768777787778877798778087781877828778387784877858778687787877888778987790877918779287793877948779587796877978779887799878008780187802878038780487805878068780787808878098781087811878128781387814878158781687817878188781987820878218782287823878248782587826878278782887829878308783187832878338783487835878368783787838878398784087841878428784387844878458784687847878488784987850878518785287853878548785587856878578785887859878608786187862878638786487865878668786787868878698787087871878728787387874878758787687877878788787987880878818788287883878848788587886878878788887889878908789187892878938789487895878968789787898878998790087901879028790387904879058790687907879088790987910879118791287913879148791587916879178791887919879208792187922879238792487925879268792787928879298793087931879328793387934879358793687937879388793987940879418794287943879448794587946879478794887949879508795187952879538795487955879568795787958879598796087961879628796387964879658796687967879688796987970879718797287973879748797587976879778797887979879808798187982879838798487985879868798787988879898799087991879928799387994879958799687997879988799988000880018800288003880048800588006880078800888009880108801188012880138801488015880168801788018880198802088021880228802388024880258802688027880288802988030880318803288033880348803588036880378803888039880408804188042880438804488045880468804788048880498805088051880528805388054880558805688057880588805988060880618806288063880648806588066880678806888069880708807188072880738807488075880768807788078880798808088081880828808388084880858808688087880888808988090880918809288093880948809588096880978809888099881008810188102881038810488105881068810788108881098811088111881128811388114881158811688117881188811988120881218812288123881248812588126881278812888129881308813188132881338813488135881368813788138881398814088141881428814388144881458814688147881488814988150881518815288153881548815588156881578815888159881608816188162881638816488165881668816788168881698817088171881728817388174881758817688177881788817988180881818818288183881848818588186881878818888189881908819188192881938819488195881968819788198881998820088201882028820388204882058820688207882088820988210882118821288213882148821588216882178821888219882208822188222882238822488225882268822788228882298823088231882328823388234882358823688237882388823988240882418824288243882448824588246882478824888249882508825188252882538825488255882568825788258882598826088261882628826388264882658826688267882688826988270882718827288273882748827588276882778827888279882808828188282882838828488285882868828788288882898829088291882928829388294882958829688297882988829988300883018830288303883048830588306883078830888309883108831188312883138831488315883168831788318883198832088321883228832388324883258832688327883288832988330883318833288333883348833588336883378833888339883408834188342883438834488345883468834788348883498835088351883528835388354883558835688357883588835988360883618836288363883648836588366883678836888369883708837188372883738837488375883768837788378883798838088381883828838388384883858838688387883888838988390883918839288393883948839588396883978839888399884008840188402884038840488405884068840788408884098841088411884128841388414884158841688417884188841988420884218842288423884248842588426884278842888429884308843188432884338843488435884368843788438884398844088441884428844388444884458844688447884488844988450884518845288453884548845588456884578845888459884608846188462884638846488465884668846788468884698847088471884728847388474884758847688477884788847988480884818848288483884848848588486884878848888489884908849188492884938849488495884968849788498884998850088501885028850388504885058850688507885088850988510885118851288513885148851588516885178851888519885208852188522885238852488525885268852788528885298853088531885328853388534885358853688537885388853988540885418854288543885448854588546885478854888549885508855188552885538855488555885568855788558885598856088561885628856388564885658856688567885688856988570885718857288573885748857588576885778857888579885808858188582885838858488585885868858788588885898859088591885928859388594885958859688597885988859988600886018860288603886048860588606886078860888609886108861188612886138861488615886168861788618886198862088621886228862388624886258862688627886288862988630886318863288633886348863588636886378863888639886408864188642886438864488645886468864788648886498865088651886528865388654886558865688657886588865988660886618866288663886648866588666886678866888669886708867188672886738867488675886768867788678886798868088681886828868388684886858868688687886888868988690886918869288693886948869588696886978869888699887008870188702887038870488705887068870788708887098871088711887128871388714887158871688717887188871988720887218872288723887248872588726887278872888729887308873188732887338873488735887368873788738887398874088741887428874388744887458874688747887488874988750887518875288753887548875588756887578875888759887608876188762887638876488765887668876788768887698877088771887728877388774887758877688777887788877988780887818878288783887848878588786887878878888789887908879188792887938879488795887968879788798887998880088801888028880388804888058880688807888088880988810888118881288813888148881588816888178881888819888208882188822888238882488825888268882788828888298883088831888328883388834888358883688837888388883988840888418884288843888448884588846888478884888849888508885188852888538885488855888568885788858888598886088861888628886388864888658886688867888688886988870888718887288873888748887588876888778887888879888808888188882888838888488885888868888788888888898889088891888928889388894888958889688897888988889988900889018890288903889048890588906889078890888909889108891188912889138891488915889168891788918889198892088921889228892388924889258892688927889288892988930889318893288933889348893588936889378893888939889408894188942889438894488945889468894788948889498895088951889528895388954889558895688957889588895988960889618896288963889648896588966889678896888969889708897188972889738897488975889768897788978889798898088981889828898388984889858898688987889888898988990889918899288993889948899588996889978899888999890008900189002890038900489005890068900789008890098901089011890128901389014890158901689017890188901989020890218902289023890248902589026890278902889029890308903189032890338903489035890368903789038890398904089041890428904389044890458904689047890488904989050890518905289053890548905589056890578905889059890608906189062890638906489065890668906789068890698907089071890728907389074890758907689077890788907989080890818908289083890848908589086890878908889089890908909189092890938909489095890968909789098890998910089101891028910389104891058910689107891088910989110891118911289113891148911589116891178911889119891208912189122891238912489125891268912789128891298913089131891328913389134891358913689137891388913989140891418914289143891448914589146891478914889149891508915189152891538915489155891568915789158891598916089161891628916389164891658916689167891688916989170891718917289173891748917589176891778917889179891808918189182891838918489185891868918789188891898919089191891928919389194891958919689197891988919989200892018920289203892048920589206892078920889209892108921189212892138921489215892168921789218892198922089221892228922389224892258922689227892288922989230892318923289233892348923589236892378923889239892408924189242892438924489245892468924789248892498925089251892528925389254892558925689257892588925989260892618926289263892648926589266892678926889269892708927189272892738927489275892768927789278892798928089281892828928389284892858928689287892888928989290892918929289293892948929589296892978929889299893008930189302893038930489305893068930789308893098931089311893128931389314893158931689317893188931989320893218932289323893248932589326893278932889329893308933189332893338933489335893368933789338893398934089341893428934389344893458934689347893488934989350893518935289353893548935589356893578935889359893608936189362893638936489365893668936789368893698937089371893728937389374893758937689377893788937989380893818938289383893848938589386893878938889389893908939189392893938939489395893968939789398893998940089401894028940389404894058940689407894088940989410894118941289413894148941589416894178941889419894208942189422894238942489425894268942789428894298943089431894328943389434894358943689437894388943989440894418944289443894448944589446894478944889449894508945189452894538945489455894568945789458894598946089461894628946389464894658946689467894688946989470894718947289473894748947589476894778947889479894808948189482894838948489485894868948789488894898949089491894928949389494894958949689497894988949989500895018950289503895048950589506895078950889509895108951189512895138951489515895168951789518895198952089521895228952389524895258952689527895288952989530895318953289533895348953589536895378953889539895408954189542895438954489545895468954789548895498955089551895528955389554895558955689557895588955989560895618956289563895648956589566895678956889569895708957189572895738957489575895768957789578895798958089581895828958389584895858958689587895888958989590895918959289593895948959589596895978959889599896008960189602896038960489605896068960789608896098961089611896128961389614896158961689617896188961989620896218962289623896248962589626896278962889629896308963189632896338963489635896368963789638896398964089641896428964389644896458964689647896488964989650896518965289653896548965589656896578965889659896608966189662896638966489665896668966789668896698967089671896728967389674896758967689677896788967989680896818968289683896848968589686896878968889689896908969189692896938969489695896968969789698896998970089701897028970389704897058970689707897088970989710897118971289713897148971589716897178971889719897208972189722897238972489725897268972789728897298973089731897328973389734897358973689737897388973989740897418974289743897448974589746897478974889749897508975189752897538975489755897568975789758897598976089761897628976389764897658976689767897688976989770897718977289773897748977589776897778977889779897808978189782897838978489785897868978789788897898979089791897928979389794897958979689797897988979989800898018980289803898048980589806898078980889809898108981189812898138981489815898168981789818898198982089821898228982389824898258982689827898288982989830898318983289833898348983589836898378983889839898408984189842898438984489845898468984789848898498985089851898528985389854898558985689857898588985989860898618986289863898648986589866898678986889869898708987189872898738987489875898768987789878898798988089881898828988389884898858988689887898888988989890898918989289893898948989589896898978989889899899008990189902899038990489905899068990789908899098991089911899128991389914899158991689917899188991989920899218992289923899248992589926899278992889929899308993189932899338993489935899368993789938899398994089941899428994389944899458994689947899488994989950899518995289953899548995589956899578995889959899608996189962899638996489965899668996789968899698997089971899728997389974899758997689977899788997989980899818998289983899848998589986899878998889989899908999189992899938999489995899968999789998899999000090001900029000390004900059000690007900089000990010900119001290013900149001590016900179001890019900209002190022900239002490025900269002790028900299003090031900329003390034900359003690037900389003990040900419004290043900449004590046900479004890049900509005190052900539005490055900569005790058900599006090061900629006390064900659006690067900689006990070900719007290073900749007590076900779007890079900809008190082900839008490085900869008790088900899009090091900929009390094900959009690097900989009990100901019010290103901049010590106901079010890109901109011190112901139011490115901169011790118901199012090121901229012390124901259012690127901289012990130901319013290133901349013590136901379013890139901409014190142901439014490145901469014790148901499015090151901529015390154901559015690157901589015990160901619016290163901649016590166901679016890169901709017190172901739017490175901769017790178901799018090181901829018390184901859018690187901889018990190901919019290193901949019590196901979019890199902009020190202902039020490205902069020790208902099021090211902129021390214902159021690217902189021990220902219022290223902249022590226902279022890229902309023190232902339023490235902369023790238902399024090241902429024390244902459024690247902489024990250902519025290253902549025590256902579025890259902609026190262902639026490265902669026790268902699027090271902729027390274902759027690277902789027990280902819028290283902849028590286902879028890289902909029190292902939029490295902969029790298902999030090301903029030390304903059030690307903089030990310903119031290313903149031590316903179031890319903209032190322903239032490325903269032790328903299033090331903329033390334903359033690337903389033990340903419034290343903449034590346903479034890349903509035190352903539035490355903569035790358903599036090361903629036390364903659036690367903689036990370903719037290373903749037590376903779037890379903809038190382903839038490385903869038790388903899039090391903929039390394903959039690397903989039990400904019040290403904049040590406904079040890409904109041190412904139041490415904169041790418904199042090421904229042390424904259042690427904289042990430904319043290433904349043590436904379043890439904409044190442904439044490445904469044790448904499045090451904529045390454904559045690457904589045990460904619046290463904649046590466904679046890469904709047190472904739047490475904769047790478904799048090481904829048390484904859048690487904889048990490904919049290493904949049590496904979049890499905009050190502905039050490505905069050790508905099051090511905129051390514905159051690517905189051990520905219052290523905249052590526905279052890529905309053190532905339053490535905369053790538905399054090541905429054390544905459054690547905489054990550905519055290553905549055590556905579055890559905609056190562905639056490565905669056790568905699057090571905729057390574905759057690577905789057990580905819058290583905849058590586905879058890589905909059190592905939059490595905969059790598905999060090601906029060390604906059060690607906089060990610906119061290613906149061590616906179061890619906209062190622906239062490625906269062790628906299063090631906329063390634906359063690637906389063990640906419064290643906449064590646906479064890649906509065190652906539065490655906569065790658906599066090661906629066390664906659066690667906689066990670906719067290673906749067590676906779067890679906809068190682906839068490685906869068790688906899069090691906929069390694906959069690697906989069990700907019070290703907049070590706907079070890709907109071190712907139071490715907169071790718907199072090721907229072390724907259072690727907289072990730907319073290733907349073590736907379073890739907409074190742907439074490745907469074790748907499075090751907529075390754907559075690757907589075990760907619076290763907649076590766907679076890769907709077190772907739077490775907769077790778907799078090781907829078390784907859078690787907889078990790907919079290793907949079590796907979079890799908009080190802908039080490805908069080790808908099081090811908129081390814908159081690817908189081990820908219082290823908249082590826908279082890829908309083190832908339083490835908369083790838908399084090841908429084390844908459084690847908489084990850908519085290853908549085590856908579085890859908609086190862908639086490865908669086790868908699087090871908729087390874908759087690877908789087990880908819088290883908849088590886908879088890889908909089190892908939089490895908969089790898908999090090901909029090390904909059090690907 |
- var __accessCheck = (obj, member, msg) => {
- if (!member.has(obj))
- throw TypeError("Cannot " + msg);
- };
- var __privateGet = (obj, member, getter) => {
- __accessCheck(obj, member, "read from private field");
- return getter ? getter.call(obj) : member.get(obj);
- };
- var __privateAdd = (obj, member, value) => {
- if (member.has(obj))
- throw TypeError("Cannot add the same private member more than once");
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
- };
- var __privateSet = (obj, member, value, setter) => {
- __accessCheck(obj, member, "write to private field");
- setter ? setter.call(obj, value) : member.set(obj, value);
- return value;
- };
- if (typeof Promise !== "undefined" && !Promise.prototype.finally) {
- Promise.prototype.finally = function(callback) {
- const promise = this.constructor;
- return this.then(
- (value) => promise.resolve(callback()).then(() => value),
- (reason) => promise.resolve(callback()).then(() => {
- throw reason;
- })
- );
- };
- }
- ;
- if (typeof uni !== "undefined" && uni && uni.requireGlobal) {
- const global2 = uni.requireGlobal();
- ArrayBuffer = global2.ArrayBuffer;
- Int8Array = global2.Int8Array;
- Uint8Array = global2.Uint8Array;
- Uint8ClampedArray = global2.Uint8ClampedArray;
- Int16Array = global2.Int16Array;
- Uint16Array = global2.Uint16Array;
- Int32Array = global2.Int32Array;
- Uint32Array = global2.Uint32Array;
- Float32Array = global2.Float32Array;
- Float64Array = global2.Float64Array;
- BigInt64Array = global2.BigInt64Array;
- BigUint64Array = global2.BigUint64Array;
- }
- ;
- if (uni.restoreGlobal) {
- uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval);
- }
- (function(vue) {
- "use strict";
- const ON_SHOW = "onShow";
- const ON_HIDE = "onHide";
- const ON_LAUNCH = "onLaunch";
- const ON_ERROR = "onError";
- const ON_LOAD = "onLoad";
- const ON_READY = "onReady";
- const ON_BACK_PRESS = "onBackPress";
- const ON_PAGE_SCROLL = "onPageScroll";
- const ON_REACH_BOTTOM = "onReachBottom";
- const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
- function formatAppLog(type, filename, ...args) {
- if (uni.__log__) {
- uni.__log__(type, filename, ...args);
- } else {
- console[type].apply(console, [...args, filename]);
- }
- }
- function resolveEasycom(component, easycom2) {
- return typeof component === "string" ? easycom2 : component;
- }
- const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) => {
- !vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
- };
- const onShow = /* @__PURE__ */ createHook(ON_SHOW);
- const onHide = /* @__PURE__ */ createHook(ON_HIDE);
- const onLaunch = /* @__PURE__ */ createHook(ON_LAUNCH);
- const onError = /* @__PURE__ */ createHook(ON_ERROR);
- const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
- const onReady = /* @__PURE__ */ createHook(ON_READY);
- const onBackPress = /* @__PURE__ */ createHook(ON_BACK_PRESS);
- const onPageScroll = /* @__PURE__ */ createHook(ON_PAGE_SCROLL);
- const onReachBottom = /* @__PURE__ */ createHook(ON_REACH_BOTTOM);
- const onPullDownRefresh = /* @__PURE__ */ createHook(ON_PULL_DOWN_REFRESH);
- var toString$1 = Object.prototype.toString;
- function isArray$3(val) {
- return toString$1.call(val) === "[object Array]";
- }
- function isObject$6(val) {
- return val !== null && typeof val === "object";
- }
- function isDate$2(val) {
- return toString$1.call(val) === "[object Date]";
- }
- function isURLSearchParams$1(val) {
- return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
- }
- function forEach$1(obj, fn) {
- if (obj === null || typeof obj === "undefined") {
- return;
- }
- if (typeof obj !== "object") {
- obj = [obj];
- }
- if (isArray$3(obj)) {
- for (var i2 = 0, l2 = obj.length; i2 < l2; i2++) {
- fn.call(null, obj[i2], i2, obj);
- }
- } else {
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- fn.call(null, obj[key], key, obj);
- }
- }
- }
- }
- function isPlainObject$3(obj) {
- return Object.prototype.toString.call(obj) === "[object Object]";
- }
- function deepMerge$1() {
- let result2 = {};
- function assignValue(val, key) {
- if (typeof result2[key] === "object" && typeof val === "object") {
- result2[key] = deepMerge$1(result2[key], val);
- } else if (typeof val === "object") {
- result2[key] = deepMerge$1({}, val);
- } else {
- result2[key] = val;
- }
- }
- for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) {
- forEach$1(arguments[i2], assignValue);
- }
- return result2;
- }
- function isUndefined$1(val) {
- return typeof val === "undefined";
- }
- function encode$2(val) {
- return encodeURIComponent(val).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
- }
- function buildURL$1(url2, params, paramsSerializer) {
- if (!params) {
- return url2;
- }
- var serializedParams;
- if (paramsSerializer) {
- serializedParams = paramsSerializer(params);
- } else if (isURLSearchParams$1(params)) {
- serializedParams = params.toString();
- } else {
- var parts = [];
- forEach$1(params, function serialize(val, key) {
- if (val === null || typeof val === "undefined") {
- return;
- }
- if (isArray$3(val)) {
- key = key + "[]";
- } else {
- val = [val];
- }
- forEach$1(val, function parseValue2(v2) {
- if (isDate$2(v2)) {
- v2 = v2.toISOString();
- } else if (isObject$6(v2)) {
- v2 = JSON.stringify(v2);
- }
- parts.push(encode$2(key) + "=" + encode$2(v2));
- });
- });
- serializedParams = parts.join("&");
- }
- if (serializedParams) {
- var hashmarkIndex = url2.indexOf("#");
- if (hashmarkIndex !== -1) {
- url2 = url2.slice(0, hashmarkIndex);
- }
- url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
- }
- return url2;
- }
- function isAbsoluteURL$1(url2) {
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
- }
- function combineURLs$1(baseURL, relativeURL) {
- return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
- }
- function buildFullPath$1(baseURL, requestedURL) {
- if (baseURL && !isAbsoluteURL$1(requestedURL)) {
- return combineURLs$1(baseURL, requestedURL);
- }
- return requestedURL;
- }
- function settle$1(resolve, reject, response) {
- const validateStatus = response.config.validateStatus;
- const status = response.statusCode;
- if (status && (!validateStatus || validateStatus(status))) {
- resolve(response);
- } else {
- reject(response);
- }
- }
- const mergeKeys$1 = (keys, config2) => {
- let config3 = {};
- keys.forEach((prop) => {
- if (!isUndefined$1(config2[prop])) {
- config3[prop] = config2[prop];
- }
- });
- return config3;
- };
- const adapter = (config2) => {
- return new Promise((resolve, reject) => {
- let fullPath = buildURL$1(buildFullPath$1(config2.baseURL, config2.url), config2.params, config2.paramsSerializer);
- const _config = {
- url: fullPath,
- header: config2.header,
- complete: (response) => {
- config2.fullPath = fullPath;
- response.config = config2;
- response.rawData = response.data;
- try {
- let jsonParseHandle = false;
- const forcedJSONParsingType = typeof config2.forcedJSONParsing;
- if (forcedJSONParsingType === "boolean") {
- jsonParseHandle = config2.forcedJSONParsing;
- } else if (forcedJSONParsingType === "object") {
- const includesMethod = config2.forcedJSONParsing.include || [];
- jsonParseHandle = includesMethod.includes(config2.method);
- }
- if (jsonParseHandle && typeof response.data === "string") {
- response.data = JSON.parse(response.data);
- }
- } catch (e2) {
- }
- settle$1(resolve, reject, response);
- }
- };
- let requestTask;
- if (config2.method === "UPLOAD") {
- delete _config.header["content-type"];
- delete _config.header["Content-Type"];
- let otherConfig = {
- filePath: config2.filePath,
- name: config2.name
- };
- const optionalKeys = [
- "files",
- "timeout",
- "formData"
- ];
- requestTask = uni.uploadFile({ ..._config, ...otherConfig, ...mergeKeys$1(optionalKeys, config2) });
- } else if (config2.method === "DOWNLOAD") {
- const optionalKeys = [
- "timeout"
- ];
- requestTask = uni.downloadFile({ ..._config, ...mergeKeys$1(optionalKeys, config2) });
- } else {
- const optionalKeys = [
- "data",
- "method",
- "timeout",
- "dataType",
- "responseType",
- "sslVerify",
- "firstIpv4"
- ];
- requestTask = uni.request({ ..._config, ...mergeKeys$1(optionalKeys, config2) });
- }
- if (config2.getTask) {
- config2.getTask(requestTask, config2);
- }
- });
- };
- const dispatchRequest$1 = (config2) => {
- return adapter(config2);
- };
- function InterceptorManager$1() {
- this.handlers = [];
- }
- InterceptorManager$1.prototype.use = function use(fulfilled, rejected) {
- this.handlers.push({
- fulfilled,
- rejected
- });
- return this.handlers.length - 1;
- };
- InterceptorManager$1.prototype.eject = function eject(id) {
- if (this.handlers[id]) {
- this.handlers[id] = null;
- }
- };
- InterceptorManager$1.prototype.forEach = function forEach2(fn) {
- this.handlers.forEach((h2) => {
- if (h2 !== null) {
- fn(h2);
- }
- });
- };
- const mergeKeys = (keys, globalsConfig, config2) => {
- let config3 = {};
- keys.forEach((prop) => {
- if (!isUndefined$1(config2[prop])) {
- config3[prop] = config2[prop];
- } else if (!isUndefined$1(globalsConfig[prop])) {
- config3[prop] = globalsConfig[prop];
- }
- });
- return config3;
- };
- const mergeConfig$1 = (globalsConfig, config2 = {}) => {
- const method = config2.method || globalsConfig.method || "GET";
- let config3 = {
- baseURL: config2.baseURL || globalsConfig.baseURL || "",
- method,
- url: config2.url || "",
- params: config2.params || {},
- custom: { ...globalsConfig.custom || {}, ...config2.custom || {} },
- header: deepMerge$1(globalsConfig.header || {}, config2.header || {})
- };
- const defaultToConfig2Keys = ["getTask", "validateStatus", "paramsSerializer", "forcedJSONParsing"];
- config3 = { ...config3, ...mergeKeys(defaultToConfig2Keys, globalsConfig, config2) };
- if (method === "DOWNLOAD") {
- const downloadKeys = [
- "timeout"
- ];
- config3 = { ...config3, ...mergeKeys(downloadKeys, globalsConfig, config2) };
- } else if (method === "UPLOAD") {
- delete config3.header["content-type"];
- delete config3.header["Content-Type"];
- const uploadKeys = [
- "files",
- "filePath",
- "name",
- "timeout",
- "formData"
- ];
- uploadKeys.forEach((prop) => {
- if (!isUndefined$1(config2[prop])) {
- config3[prop] = config2[prop];
- }
- });
- if (isUndefined$1(config3.timeout) && !isUndefined$1(globalsConfig.timeout)) {
- config3["timeout"] = globalsConfig["timeout"];
- }
- } else {
- const defaultsKeys = [
- "data",
- "timeout",
- "dataType",
- "responseType",
- "sslVerify",
- "firstIpv4"
- ];
- config3 = { ...config3, ...mergeKeys(defaultsKeys, globalsConfig, config2) };
- }
- return config3;
- };
- const defaults$2 = {
- baseURL: "",
- header: {},
- method: "GET",
- dataType: "json",
- paramsSerializer: null,
- responseType: "text",
- custom: {},
- timeout: 6e4,
- sslVerify: true,
- firstIpv4: false,
- validateStatus: function validateStatus(status) {
- return status >= 200 && status < 300;
- },
- // 是否尝试将响应数据json化
- forcedJSONParsing: true
- };
- var clone = function() {
- function _instanceof(obj, type) {
- return type != null && obj instanceof type;
- }
- var nativeMap;
- try {
- nativeMap = Map;
- } catch (_2) {
- nativeMap = function() {
- };
- }
- var nativeSet;
- try {
- nativeSet = Set;
- } catch (_2) {
- nativeSet = function() {
- };
- }
- var nativePromise;
- try {
- nativePromise = Promise;
- } catch (_2) {
- nativePromise = function() {
- };
- }
- function clone2(parent2, circular, depth, prototype2, includeNonEnumerable) {
- if (typeof circular === "object") {
- depth = circular.depth;
- prototype2 = circular.prototype;
- includeNonEnumerable = circular.includeNonEnumerable;
- circular = circular.circular;
- }
- var allParents = [];
- var allChildren = [];
- var useBuffer = typeof Buffer != "undefined";
- if (typeof circular == "undefined")
- circular = true;
- if (typeof depth == "undefined")
- depth = Infinity;
- function _clone(parent3, depth2) {
- if (parent3 === null)
- return null;
- if (depth2 === 0)
- return parent3;
- var child;
- var proto;
- if (typeof parent3 != "object") {
- return parent3;
- }
- if (_instanceof(parent3, nativeMap)) {
- child = new nativeMap();
- } else if (_instanceof(parent3, nativeSet)) {
- child = new nativeSet();
- } else if (_instanceof(parent3, nativePromise)) {
- child = new nativePromise(function(resolve, reject) {
- parent3.then(function(value) {
- resolve(_clone(value, depth2 - 1));
- }, function(err) {
- reject(_clone(err, depth2 - 1));
- });
- });
- } else if (clone2.__isArray(parent3)) {
- child = [];
- } else if (clone2.__isRegExp(parent3)) {
- child = new RegExp(parent3.source, __getRegExpFlags(parent3));
- if (parent3.lastIndex)
- child.lastIndex = parent3.lastIndex;
- } else if (clone2.__isDate(parent3)) {
- child = new Date(parent3.getTime());
- } else if (useBuffer && Buffer.isBuffer(parent3)) {
- if (Buffer.from) {
- child = Buffer.from(parent3);
- } else {
- child = new Buffer(parent3.length);
- parent3.copy(child);
- }
- return child;
- } else if (_instanceof(parent3, Error)) {
- child = Object.create(parent3);
- } else {
- if (typeof prototype2 == "undefined") {
- proto = Object.getPrototypeOf(parent3);
- child = Object.create(proto);
- } else {
- child = Object.create(prototype2);
- proto = prototype2;
- }
- }
- if (circular) {
- var index2 = allParents.indexOf(parent3);
- if (index2 != -1) {
- return allChildren[index2];
- }
- allParents.push(parent3);
- allChildren.push(child);
- }
- if (_instanceof(parent3, nativeMap)) {
- parent3.forEach(function(value, key) {
- var keyChild = _clone(key, depth2 - 1);
- var valueChild = _clone(value, depth2 - 1);
- child.set(keyChild, valueChild);
- });
- }
- if (_instanceof(parent3, nativeSet)) {
- parent3.forEach(function(value) {
- var entryChild = _clone(value, depth2 - 1);
- child.add(entryChild);
- });
- }
- for (var i2 in parent3) {
- var attrs = Object.getOwnPropertyDescriptor(parent3, i2);
- if (attrs) {
- child[i2] = _clone(parent3[i2], depth2 - 1);
- }
- try {
- var objProperty = Object.getOwnPropertyDescriptor(parent3, i2);
- if (objProperty.set === "undefined") {
- continue;
- }
- child[i2] = _clone(parent3[i2], depth2 - 1);
- } catch (e2) {
- if (e2 instanceof TypeError) {
- continue;
- } else if (e2 instanceof ReferenceError) {
- continue;
- }
- }
- }
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(parent3);
- for (var i2 = 0; i2 < symbols.length; i2++) {
- var symbol = symbols[i2];
- var descriptor = Object.getOwnPropertyDescriptor(parent3, symbol);
- if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
- continue;
- }
- child[symbol] = _clone(parent3[symbol], depth2 - 1);
- Object.defineProperty(child, symbol, descriptor);
- }
- }
- if (includeNonEnumerable) {
- var allPropertyNames = Object.getOwnPropertyNames(parent3);
- for (var i2 = 0; i2 < allPropertyNames.length; i2++) {
- var propertyName = allPropertyNames[i2];
- var descriptor = Object.getOwnPropertyDescriptor(parent3, propertyName);
- if (descriptor && descriptor.enumerable) {
- continue;
- }
- child[propertyName] = _clone(parent3[propertyName], depth2 - 1);
- Object.defineProperty(child, propertyName, descriptor);
- }
- }
- return child;
- }
- return _clone(parent2, depth);
- }
- clone2.clonePrototype = function clonePrototype(parent2) {
- if (parent2 === null)
- return null;
- var c2 = function() {
- };
- c2.prototype = parent2;
- return new c2();
- };
- function __objToStr(o2) {
- return Object.prototype.toString.call(o2);
- }
- clone2.__objToStr = __objToStr;
- function __isDate(o2) {
- return typeof o2 === "object" && __objToStr(o2) === "[object Date]";
- }
- clone2.__isDate = __isDate;
- function __isArray(o2) {
- return typeof o2 === "object" && __objToStr(o2) === "[object Array]";
- }
- clone2.__isArray = __isArray;
- function __isRegExp(o2) {
- return typeof o2 === "object" && __objToStr(o2) === "[object RegExp]";
- }
- clone2.__isRegExp = __isRegExp;
- function __getRegExpFlags(re2) {
- var flags = "";
- if (re2.global)
- flags += "g";
- if (re2.ignoreCase)
- flags += "i";
- if (re2.multiline)
- flags += "m";
- return flags;
- }
- clone2.__getRegExpFlags = __getRegExpFlags;
- return clone2;
- }();
- let Request$1 = class Request {
- /**
- * @param {Object} arg - 全局配置
- * @param {String} arg.baseURL - 全局根路径
- * @param {Object} arg.header - 全局header
- * @param {String} arg.method = [GET|POST|PUT|DELETE|CONNECT|HEAD|OPTIONS|TRACE] - 全局默认请求方式
- * @param {String} arg.dataType = [json] - 全局默认的dataType
- * @param {String} arg.responseType = [text|arraybuffer] - 全局默认的responseType。支付宝小程序不支持
- * @param {Object} arg.custom - 全局默认的自定义参数
- * @param {Number} arg.timeout - 全局默认的超时时间,单位 ms。默认60000。H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)、微信小程序(2.10.0)、支付宝小程序
- * @param {Boolean} arg.sslVerify - 全局默认的是否验证 ssl 证书。默认true.仅App安卓端支持(HBuilderX 2.3.3+)
- * @param {Boolean} arg.withCredentials - 全局默认的跨域请求时是否携带凭证(cookies)。默认false。仅H5支持(HBuilderX 2.6.15+)
- * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4。默认false。仅 App-Android 支持 (HBuilderX 2.8.0+)
- * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器。默认statusCode >= 200 && statusCode < 300
- */
- constructor(arg = {}) {
- if (!isPlainObject$3(arg)) {
- arg = {};
- formatAppLog("warn", "at node_modules/luch-request/src/lib/core/Request.js:37", "设置全局参数必须接收一个Object");
- }
- this.config = clone({ ...defaults$2, ...arg });
- this.interceptors = {
- request: new InterceptorManager$1(),
- response: new InterceptorManager$1()
- };
- }
- /**
- * @Function
- * @param {Request~setConfigCallback} f - 设置全局默认配置
- */
- setConfig(f2) {
- this.config = f2(this.config);
- }
- middleware(config2) {
- config2 = mergeConfig$1(this.config, config2);
- let chain = [dispatchRequest$1, void 0];
- let promise = Promise.resolve(config2);
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
- chain.unshift(interceptor.fulfilled, interceptor.rejected);
- });
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
- chain.push(interceptor.fulfilled, interceptor.rejected);
- });
- while (chain.length) {
- promise = promise.then(chain.shift(), chain.shift());
- }
- return promise;
- }
- /**
- * @Function
- * @param {Object} config - 请求配置项
- * @prop {String} options.url - 请求路径
- * @prop {Object} options.data - 请求参数
- * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型
- * @prop {Object} [options.dataType = config.dataType] - 如果设为 json,会尝试对返回的数据做一次 JSON.parse
- * @prop {Object} [options.header = config.header] - 请求header
- * @prop {Object} [options.method = config.method] - 请求方法
- * @returns {Promise<unknown>}
- */
- request(config2 = {}) {
- return this.middleware(config2);
- }
- get(url2, options2 = {}) {
- return this.middleware({
- url: url2,
- method: "GET",
- ...options2
- });
- }
- post(url2, data, options2 = {}) {
- return this.middleware({
- url: url2,
- data,
- method: "POST",
- ...options2
- });
- }
- put(url2, data, options2 = {}) {
- return this.middleware({
- url: url2,
- data,
- method: "PUT",
- ...options2
- });
- }
- delete(url2, data, options2 = {}) {
- return this.middleware({
- url: url2,
- data,
- method: "DELETE",
- ...options2
- });
- }
- options(url2, data, options2 = {}) {
- return this.middleware({
- url: url2,
- data,
- method: "OPTIONS",
- ...options2
- });
- }
- upload(url2, config2 = {}) {
- config2.url = url2;
- config2.method = "UPLOAD";
- return this.middleware(config2);
- }
- download(url2, config2 = {}) {
- config2.url = url2;
- config2.method = "DOWNLOAD";
- return this.middleware(config2);
- }
- get version() {
- return "3.1.0";
- }
- };
- let baseUrl;
- {
- baseUrl = "https://zxgz.newfeifan.cn";
- }
- const apiPath = "/app-api";
- const staticUrl = "http://localhost";
- const DiyApi = {
- getUsedDiyTemplate: () => {
- return request$1({
- url: "/promotion/diy-template/used",
- method: "GET",
- custom: {
- showError: false,
- showLoading: false
- }
- });
- },
- getDiyTemplate: (id) => {
- return request$1({
- url: "/promotion/diy-template/get",
- method: "GET",
- params: {
- id
- },
- custom: {
- showError: false,
- showLoading: false
- }
- });
- },
- getDiyPage: (id) => {
- return request$1({
- url: "/promotion/diy-page/get",
- method: "GET",
- params: {
- id
- }
- });
- }
- };
- const __vite_glob_0_29 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: DiyApi
- }, Symbol.toStringTag, { value: "Module" }));
- var isVue2 = false;
- function set(target, key, val) {
- if (Array.isArray(target)) {
- target.length = Math.max(target.length, key);
- target.splice(key, 1, val);
- return val;
- }
- target[key] = val;
- return val;
- }
- function del(target, key) {
- if (Array.isArray(target)) {
- target.splice(key, 1);
- return;
- }
- delete target[key];
- }
- function getDevtoolsGlobalHook$1() {
- return getTarget$1().__VUE_DEVTOOLS_GLOBAL_HOOK__;
- }
- function getTarget$1() {
- return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
- }
- const isProxyAvailable$1 = typeof Proxy === "function";
- const HOOK_SETUP$1 = "devtools-plugin:setup";
- const HOOK_PLUGIN_SETTINGS_SET$1 = "plugin:settings:set";
- let supported;
- let perf;
- function isPerformanceSupported() {
- var _a2;
- if (supported !== void 0) {
- return supported;
- }
- if (typeof window !== "undefined" && window.performance) {
- supported = true;
- perf = window.performance;
- } else if (typeof global !== "undefined" && ((_a2 = global.perf_hooks) === null || _a2 === void 0 ? void 0 : _a2.performance)) {
- supported = true;
- perf = global.perf_hooks.performance;
- } else {
- supported = false;
- }
- return supported;
- }
- function now() {
- return isPerformanceSupported() ? perf.now() : Date.now();
- }
- let ApiProxy$1 = class ApiProxy {
- constructor(plugin, hook) {
- this.target = null;
- this.targetQueue = [];
- this.onQueue = [];
- this.plugin = plugin;
- this.hook = hook;
- const defaultSettings = {};
- if (plugin.settings) {
- for (const id in plugin.settings) {
- const item = plugin.settings[id];
- defaultSettings[id] = item.defaultValue;
- }
- }
- const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
- let currentSettings = Object.assign({}, defaultSettings);
- try {
- const raw = localStorage.getItem(localSettingsSaveId);
- const data = JSON.parse(raw);
- Object.assign(currentSettings, data);
- } catch (e2) {
- }
- this.fallbacks = {
- getSettings() {
- return currentSettings;
- },
- setSettings(value) {
- try {
- localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
- } catch (e2) {
- }
- currentSettings = value;
- },
- now() {
- return now();
- }
- };
- if (hook) {
- hook.on(HOOK_PLUGIN_SETTINGS_SET$1, (pluginId, value) => {
- if (pluginId === this.plugin.id) {
- this.fallbacks.setSettings(value);
- }
- });
- }
- this.proxiedOn = new Proxy({}, {
- get: (_target, prop) => {
- if (this.target) {
- return this.target.on[prop];
- } else {
- return (...args) => {
- this.onQueue.push({
- method: prop,
- args
- });
- };
- }
- }
- });
- this.proxiedTarget = new Proxy({}, {
- get: (_target, prop) => {
- if (this.target) {
- return this.target[prop];
- } else if (prop === "on") {
- return this.proxiedOn;
- } else if (Object.keys(this.fallbacks).includes(prop)) {
- return (...args) => {
- this.targetQueue.push({
- method: prop,
- args,
- resolve: () => {
- }
- });
- return this.fallbacks[prop](...args);
- };
- } else {
- return (...args) => {
- return new Promise((resolve) => {
- this.targetQueue.push({
- method: prop,
- args,
- resolve
- });
- });
- };
- }
- }
- });
- }
- async setRealTarget(target) {
- this.target = target;
- for (const item of this.onQueue) {
- this.target.on[item.method](...item.args);
- }
- for (const item of this.targetQueue) {
- item.resolve(await this.target[item.method](...item.args));
- }
- }
- };
- function setupDevtoolsPlugin$1(pluginDescriptor, setupFn) {
- const descriptor = pluginDescriptor;
- const target = getTarget$1();
- const hook = getDevtoolsGlobalHook$1();
- const enableProxy = isProxyAvailable$1 && descriptor.enableEarlyProxy;
- if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
- hook.emit(HOOK_SETUP$1, pluginDescriptor, setupFn);
- } else {
- const proxy = enableProxy ? new ApiProxy$1(descriptor, hook) : null;
- const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
- list.push({
- pluginDescriptor: descriptor,
- setupFn,
- proxy
- });
- if (proxy)
- setupFn(proxy.proxiedTarget);
- }
- }
- /*!
- * pinia v2.1.7
- * (c) 2023 Eduardo San Martin Morote
- * @license MIT
- */
- let activePinia;
- const setActivePinia = (pinia) => activePinia = pinia;
- const piniaSymbol = Symbol("pinia");
- function isPlainObject$2(o2) {
- return o2 && typeof o2 === "object" && Object.prototype.toString.call(o2) === "[object Object]" && typeof o2.toJSON !== "function";
- }
- var MutationType;
- (function(MutationType2) {
- MutationType2["direct"] = "direct";
- MutationType2["patchObject"] = "patch object";
- MutationType2["patchFunction"] = "patch function";
- })(MutationType || (MutationType = {}));
- const IS_CLIENT = typeof window !== "undefined";
- const USE_DEVTOOLS = IS_CLIENT;
- const _global$1 = /* @__PURE__ */ (() => typeof window === "object" && window.window === window ? window : typeof self === "object" && self.self === self ? self : typeof global === "object" && global.global === global ? global : typeof globalThis === "object" ? globalThis : { HTMLElement: null })();
- function bom(blob, { autoBom = false } = {}) {
- if (autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
- return new Blob([String.fromCharCode(65279), blob], { type: blob.type });
- }
- return blob;
- }
- function download(url2, name2, opts) {
- const xhr = new XMLHttpRequest();
- xhr.open("GET", url2);
- xhr.responseType = "blob";
- xhr.onload = function() {
- saveAs(xhr.response, name2, opts);
- };
- xhr.onerror = function() {
- console.error("could not download file");
- };
- xhr.send();
- }
- function corsEnabled(url2) {
- const xhr = new XMLHttpRequest();
- xhr.open("HEAD", url2, false);
- try {
- xhr.send();
- } catch (e2) {
- }
- return xhr.status >= 200 && xhr.status <= 299;
- }
- function click(node2) {
- try {
- node2.dispatchEvent(new MouseEvent("click"));
- } catch (e2) {
- const evt = document.createEvent("MouseEvents");
- evt.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
- node2.dispatchEvent(evt);
- }
- }
- const _navigator$1 = typeof navigator === "object" ? navigator : { userAgent: "" };
- const isMacOSWebView = /* @__PURE__ */ (() => /Macintosh/.test(_navigator$1.userAgent) && /AppleWebKit/.test(_navigator$1.userAgent) && !/Safari/.test(_navigator$1.userAgent))();
- const saveAs = !IS_CLIENT ? () => {
- } : (
- // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
- typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype && !isMacOSWebView ? downloadSaveAs : (
- // Use msSaveOrOpenBlob as a second approach
- "msSaveOrOpenBlob" in _navigator$1 ? msSaveAs : (
- // Fallback to using FileReader and a popup
- fileSaverSaveAs
- )
- )
- );
- function downloadSaveAs(blob, name2 = "download", opts) {
- const a2 = document.createElement("a");
- a2.download = name2;
- a2.rel = "noopener";
- if (typeof blob === "string") {
- a2.href = blob;
- if (a2.origin !== location.origin) {
- if (corsEnabled(a2.href)) {
- download(blob, name2, opts);
- } else {
- a2.target = "_blank";
- click(a2);
- }
- } else {
- click(a2);
- }
- } else {
- a2.href = URL.createObjectURL(blob);
- setTimeout(function() {
- URL.revokeObjectURL(a2.href);
- }, 4e4);
- setTimeout(function() {
- click(a2);
- }, 0);
- }
- }
- function msSaveAs(blob, name2 = "download", opts) {
- if (typeof blob === "string") {
- if (corsEnabled(blob)) {
- download(blob, name2, opts);
- } else {
- const a2 = document.createElement("a");
- a2.href = blob;
- a2.target = "_blank";
- setTimeout(function() {
- click(a2);
- });
- }
- } else {
- navigator.msSaveOrOpenBlob(bom(blob, opts), name2);
- }
- }
- function fileSaverSaveAs(blob, name2, opts, popup) {
- popup = popup || open("", "_blank");
- if (popup) {
- popup.document.title = popup.document.body.innerText = "downloading...";
- }
- if (typeof blob === "string")
- return download(blob, name2, opts);
- const force = blob.type === "application/octet-stream";
- const isSafari = /constructor/i.test(String(_global$1.HTMLElement)) || "safari" in _global$1;
- const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
- if ((isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== "undefined") {
- const reader = new FileReader();
- reader.onloadend = function() {
- let url2 = reader.result;
- if (typeof url2 !== "string") {
- popup = null;
- throw new Error("Wrong reader.result type");
- }
- url2 = isChromeIOS ? url2 : url2.replace(/^data:[^;]*;/, "data:attachment/file;");
- if (popup) {
- popup.location.href = url2;
- } else {
- location.assign(url2);
- }
- popup = null;
- };
- reader.readAsDataURL(blob);
- } else {
- const url2 = URL.createObjectURL(blob);
- if (popup)
- popup.location.assign(url2);
- else
- location.href = url2;
- popup = null;
- setTimeout(function() {
- URL.revokeObjectURL(url2);
- }, 4e4);
- }
- }
- function toastMessage(message, type) {
- const piniaMessage = "🍍 " + message;
- if (typeof __VUE_DEVTOOLS_TOAST__ === "function") {
- __VUE_DEVTOOLS_TOAST__(piniaMessage, type);
- } else if (type === "error") {
- console.error(piniaMessage);
- } else if (type === "warn") {
- console.warn(piniaMessage);
- } else {
- console.log(piniaMessage);
- }
- }
- function isPinia(o2) {
- return "_a" in o2 && "install" in o2;
- }
- function checkClipboardAccess() {
- if (!("clipboard" in navigator)) {
- toastMessage(`Your browser doesn't support the Clipboard API`, "error");
- return true;
- }
- }
- function checkNotFocusedError(error2) {
- if (error2 instanceof Error && error2.message.toLowerCase().includes("document is not focused")) {
- toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn");
- return true;
- }
- return false;
- }
- async function actionGlobalCopyState(pinia) {
- if (checkClipboardAccess())
- return;
- try {
- await navigator.clipboard.writeText(JSON.stringify(pinia.state.value));
- toastMessage("Global state copied to clipboard.");
- } catch (error2) {
- if (checkNotFocusedError(error2))
- return;
- toastMessage(`Failed to serialize the state. Check the console for more details.`, "error");
- console.error(error2);
- }
- }
- async function actionGlobalPasteState(pinia) {
- if (checkClipboardAccess())
- return;
- try {
- loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText()));
- toastMessage("Global state pasted from clipboard.");
- } catch (error2) {
- if (checkNotFocusedError(error2))
- return;
- toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, "error");
- console.error(error2);
- }
- }
- async function actionGlobalSaveState(pinia) {
- try {
- saveAs(new Blob([JSON.stringify(pinia.state.value)], {
- type: "text/plain;charset=utf-8"
- }), "pinia-state.json");
- } catch (error2) {
- toastMessage(`Failed to export the state as JSON. Check the console for more details.`, "error");
- console.error(error2);
- }
- }
- let fileInput;
- function getFileOpener() {
- if (!fileInput) {
- fileInput = document.createElement("input");
- fileInput.type = "file";
- fileInput.accept = ".json";
- }
- function openFile() {
- return new Promise((resolve, reject) => {
- fileInput.onchange = async () => {
- const files2 = fileInput.files;
- if (!files2)
- return resolve(null);
- const file = files2.item(0);
- if (!file)
- return resolve(null);
- return resolve({ text: await file.text(), file });
- };
- fileInput.oncancel = () => resolve(null);
- fileInput.onerror = reject;
- fileInput.click();
- });
- }
- return openFile;
- }
- async function actionGlobalOpenStateFile(pinia) {
- try {
- const open2 = getFileOpener();
- const result2 = await open2();
- if (!result2)
- return;
- const { text, file } = result2;
- loadStoresState(pinia, JSON.parse(text));
- toastMessage(`Global state imported from "${file.name}".`);
- } catch (error2) {
- toastMessage(`Failed to import the state from JSON. Check the console for more details.`, "error");
- console.error(error2);
- }
- }
- function loadStoresState(pinia, state) {
- for (const key in state) {
- const storeState = pinia.state.value[key];
- if (storeState) {
- Object.assign(storeState, state[key]);
- } else {
- pinia.state.value[key] = state[key];
- }
- }
- }
- function formatDisplay(display) {
- return {
- _custom: {
- display
- }
- };
- }
- const PINIA_ROOT_LABEL = "🍍 Pinia (root)";
- const PINIA_ROOT_ID = "_root";
- function formatStoreForInspectorTree(store) {
- return isPinia(store) ? {
- id: PINIA_ROOT_ID,
- label: PINIA_ROOT_LABEL
- } : {
- id: store.$id,
- label: store.$id
- };
- }
- function formatStoreForInspectorState(store) {
- if (isPinia(store)) {
- const storeNames = Array.from(store._s.keys());
- const storeMap = store._s;
- const state2 = {
- state: storeNames.map((storeId) => ({
- editable: true,
- key: storeId,
- value: store.state.value[storeId]
- })),
- getters: storeNames.filter((id) => storeMap.get(id)._getters).map((id) => {
- const store2 = storeMap.get(id);
- return {
- editable: false,
- key: id,
- value: store2._getters.reduce((getters, key) => {
- getters[key] = store2[key];
- return getters;
- }, {})
- };
- })
- };
- return state2;
- }
- const state = {
- state: Object.keys(store.$state).map((key) => ({
- editable: true,
- key,
- value: store.$state[key]
- }))
- };
- if (store._getters && store._getters.length) {
- state.getters = store._getters.map((getterName) => ({
- editable: false,
- key: getterName,
- value: store[getterName]
- }));
- }
- if (store._customProperties.size) {
- state.customProperties = Array.from(store._customProperties).map((key) => ({
- editable: true,
- key,
- value: store[key]
- }));
- }
- return state;
- }
- function formatEventData(events) {
- if (!events)
- return {};
- if (Array.isArray(events)) {
- return events.reduce((data, event) => {
- data.keys.push(event.key);
- data.operations.push(event.type);
- data.oldValue[event.key] = event.oldValue;
- data.newValue[event.key] = event.newValue;
- return data;
- }, {
- oldValue: {},
- keys: [],
- operations: [],
- newValue: {}
- });
- } else {
- return {
- operation: formatDisplay(events.type),
- key: formatDisplay(events.key),
- oldValue: events.oldValue,
- newValue: events.newValue
- };
- }
- }
- function formatMutationType(type) {
- switch (type) {
- case MutationType.direct:
- return "mutation";
- case MutationType.patchFunction:
- return "$patch";
- case MutationType.patchObject:
- return "$patch";
- default:
- return "unknown";
- }
- }
- let isTimelineActive = true;
- const componentStateTypes = [];
- const MUTATIONS_LAYER_ID = "pinia:mutations";
- const INSPECTOR_ID = "pinia";
- const { assign: assign$1 } = Object;
- const getStoreType = (id) => "🍍 " + id;
- function registerPiniaDevtools(app2, pinia) {
- setupDevtoolsPlugin$1({
- id: "dev.esm.pinia",
- label: "Pinia 🍍",
- logo: "https://pinia.vuejs.org/logo.svg",
- packageName: "pinia",
- homepage: "https://pinia.vuejs.org",
- componentStateTypes,
- app: app2
- }, (api2) => {
- if (typeof api2.now !== "function") {
- toastMessage("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.");
- }
- api2.addTimelineLayer({
- id: MUTATIONS_LAYER_ID,
- label: `Pinia 🍍`,
- color: 15064968
- });
- api2.addInspector({
- id: INSPECTOR_ID,
- label: "Pinia 🍍",
- icon: "storage",
- treeFilterPlaceholder: "Search stores",
- actions: [
- {
- icon: "content_copy",
- action: () => {
- actionGlobalCopyState(pinia);
- },
- tooltip: "Serialize and copy the state"
- },
- {
- icon: "content_paste",
- action: async () => {
- await actionGlobalPasteState(pinia);
- api2.sendInspectorTree(INSPECTOR_ID);
- api2.sendInspectorState(INSPECTOR_ID);
- },
- tooltip: "Replace the state with the content of your clipboard"
- },
- {
- icon: "save",
- action: () => {
- actionGlobalSaveState(pinia);
- },
- tooltip: "Save the state as a JSON file"
- },
- {
- icon: "folder_open",
- action: async () => {
- await actionGlobalOpenStateFile(pinia);
- api2.sendInspectorTree(INSPECTOR_ID);
- api2.sendInspectorState(INSPECTOR_ID);
- },
- tooltip: "Import the state from a JSON file"
- }
- ],
- nodeActions: [
- {
- icon: "restore",
- tooltip: 'Reset the state (with "$reset")',
- action: (nodeId) => {
- const store = pinia._s.get(nodeId);
- if (!store) {
- toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, "warn");
- } else if (typeof store.$reset !== "function") {
- toastMessage(`Cannot reset "${nodeId}" store because it doesn't have a "$reset" method implemented.`, "warn");
- } else {
- store.$reset();
- toastMessage(`Store "${nodeId}" reset.`);
- }
- }
- }
- ]
- });
- api2.on.inspectComponent((payload, ctx) => {
- const proxy = payload.componentInstance && payload.componentInstance.proxy;
- if (proxy && proxy._pStores) {
- const piniaStores = payload.componentInstance.proxy._pStores;
- Object.values(piniaStores).forEach((store) => {
- payload.instanceData.state.push({
- type: getStoreType(store.$id),
- key: "state",
- editable: true,
- value: store._isOptionsAPI ? {
- _custom: {
- value: vue.toRaw(store.$state),
- actions: [
- {
- icon: "restore",
- tooltip: "Reset the state of this store",
- action: () => store.$reset()
- }
- ]
- }
- } : (
- // NOTE: workaround to unwrap transferred refs
- Object.keys(store.$state).reduce((state, key) => {
- state[key] = store.$state[key];
- return state;
- }, {})
- )
- });
- if (store._getters && store._getters.length) {
- payload.instanceData.state.push({
- type: getStoreType(store.$id),
- key: "getters",
- editable: false,
- value: store._getters.reduce((getters, key) => {
- try {
- getters[key] = store[key];
- } catch (error2) {
- getters[key] = error2;
- }
- return getters;
- }, {})
- });
- }
- });
- }
- });
- api2.on.getInspectorTree((payload) => {
- if (payload.app === app2 && payload.inspectorId === INSPECTOR_ID) {
- let stores = [pinia];
- stores = stores.concat(Array.from(pinia._s.values()));
- payload.rootNodes = (payload.filter ? stores.filter((store) => "$id" in store ? store.$id.toLowerCase().includes(payload.filter.toLowerCase()) : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) : stores).map(formatStoreForInspectorTree);
- }
- });
- api2.on.getInspectorState((payload) => {
- if (payload.app === app2 && payload.inspectorId === INSPECTOR_ID) {
- const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia : pinia._s.get(payload.nodeId);
- if (!inspectedStore) {
- return;
- }
- if (inspectedStore) {
- payload.state = formatStoreForInspectorState(inspectedStore);
- }
- }
- });
- api2.on.editInspectorState((payload, ctx) => {
- if (payload.app === app2 && payload.inspectorId === INSPECTOR_ID) {
- const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia : pinia._s.get(payload.nodeId);
- if (!inspectedStore) {
- return toastMessage(`store "${payload.nodeId}" not found`, "error");
- }
- const { path } = payload;
- if (!isPinia(inspectedStore)) {
- if (path.length !== 1 || !inspectedStore._customProperties.has(path[0]) || path[0] in inspectedStore.$state) {
- path.unshift("$state");
- }
- } else {
- path.unshift("state");
- }
- isTimelineActive = false;
- payload.set(inspectedStore, path, payload.state.value);
- isTimelineActive = true;
- }
- });
- api2.on.editComponentState((payload) => {
- if (payload.type.startsWith("🍍")) {
- const storeId = payload.type.replace(/^🍍\s*/, "");
- const store = pinia._s.get(storeId);
- if (!store) {
- return toastMessage(`store "${storeId}" not found`, "error");
- }
- const { path } = payload;
- if (path[0] !== "state") {
- return toastMessage(`Invalid path for store "${storeId}":
- ${path}
- Only state can be modified.`);
- }
- path[0] = "$state";
- isTimelineActive = false;
- payload.set(store, path, payload.state.value);
- isTimelineActive = true;
- }
- });
- });
- }
- function addStoreToDevtools(app2, store) {
- if (!componentStateTypes.includes(getStoreType(store.$id))) {
- componentStateTypes.push(getStoreType(store.$id));
- }
- setupDevtoolsPlugin$1({
- id: "dev.esm.pinia",
- label: "Pinia 🍍",
- logo: "https://pinia.vuejs.org/logo.svg",
- packageName: "pinia",
- homepage: "https://pinia.vuejs.org",
- componentStateTypes,
- app: app2,
- settings: {
- logStoreChanges: {
- label: "Notify about new/deleted stores",
- type: "boolean",
- defaultValue: true
- }
- // useEmojis: {
- // label: 'Use emojis in messages ⚡️',
- // type: 'boolean',
- // defaultValue: true,
- // },
- }
- }, (api2) => {
- const now2 = typeof api2.now === "function" ? api2.now.bind(api2) : Date.now;
- store.$onAction(({ after, onError: onError2, name: name2, args }) => {
- const groupId = runningActionId++;
- api2.addTimelineEvent({
- layerId: MUTATIONS_LAYER_ID,
- event: {
- time: now2(),
- title: "🛫 " + name2,
- subtitle: "start",
- data: {
- store: formatDisplay(store.$id),
- action: formatDisplay(name2),
- args
- },
- groupId
- }
- });
- after((result2) => {
- activeAction = void 0;
- api2.addTimelineEvent({
- layerId: MUTATIONS_LAYER_ID,
- event: {
- time: now2(),
- title: "🛬 " + name2,
- subtitle: "end",
- data: {
- store: formatDisplay(store.$id),
- action: formatDisplay(name2),
- args,
- result: result2
- },
- groupId
- }
- });
- });
- onError2((error2) => {
- activeAction = void 0;
- api2.addTimelineEvent({
- layerId: MUTATIONS_LAYER_ID,
- event: {
- time: now2(),
- logType: "error",
- title: "💥 " + name2,
- subtitle: "end",
- data: {
- store: formatDisplay(store.$id),
- action: formatDisplay(name2),
- args,
- error: error2
- },
- groupId
- }
- });
- });
- }, true);
- store._customProperties.forEach((name2) => {
- vue.watch(() => vue.unref(store[name2]), (newValue, oldValue) => {
- api2.notifyComponentUpdate();
- api2.sendInspectorState(INSPECTOR_ID);
- if (isTimelineActive) {
- api2.addTimelineEvent({
- layerId: MUTATIONS_LAYER_ID,
- event: {
- time: now2(),
- title: "Change",
- subtitle: name2,
- data: {
- newValue,
- oldValue
- },
- groupId: activeAction
- }
- });
- }
- }, { deep: true });
- });
- store.$subscribe(({ events, type }, state) => {
- api2.notifyComponentUpdate();
- api2.sendInspectorState(INSPECTOR_ID);
- if (!isTimelineActive)
- return;
- const eventData = {
- time: now2(),
- title: formatMutationType(type),
- data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)),
- groupId: activeAction
- };
- if (type === MutationType.patchFunction) {
- eventData.subtitle = "⤵️";
- } else if (type === MutationType.patchObject) {
- eventData.subtitle = "🧩";
- } else if (events && !Array.isArray(events)) {
- eventData.subtitle = events.type;
- }
- if (events) {
- eventData.data["rawEvent(s)"] = {
- _custom: {
- display: "DebuggerEvent",
- type: "object",
- tooltip: "raw DebuggerEvent[]",
- value: events
- }
- };
- }
- api2.addTimelineEvent({
- layerId: MUTATIONS_LAYER_ID,
- event: eventData
- });
- }, { detached: true, flush: "sync" });
- const hotUpdate = store._hotUpdate;
- store._hotUpdate = vue.markRaw((newStore) => {
- hotUpdate(newStore);
- api2.addTimelineEvent({
- layerId: MUTATIONS_LAYER_ID,
- event: {
- time: now2(),
- title: "🔥 " + store.$id,
- subtitle: "HMR update",
- data: {
- store: formatDisplay(store.$id),
- info: formatDisplay(`HMR update`)
- }
- }
- });
- api2.notifyComponentUpdate();
- api2.sendInspectorTree(INSPECTOR_ID);
- api2.sendInspectorState(INSPECTOR_ID);
- });
- const { $dispose } = store;
- store.$dispose = () => {
- $dispose();
- api2.notifyComponentUpdate();
- api2.sendInspectorTree(INSPECTOR_ID);
- api2.sendInspectorState(INSPECTOR_ID);
- api2.getSettings().logStoreChanges && toastMessage(`Disposed "${store.$id}" store 🗑`);
- };
- api2.notifyComponentUpdate();
- api2.sendInspectorTree(INSPECTOR_ID);
- api2.sendInspectorState(INSPECTOR_ID);
- api2.getSettings().logStoreChanges && toastMessage(`"${store.$id}" store installed 🆕`);
- });
- }
- let runningActionId = 0;
- let activeAction;
- function patchActionForGrouping(store, actionNames, wrapWithProxy) {
- const actions = actionNames.reduce((storeActions, actionName) => {
- storeActions[actionName] = vue.toRaw(store)[actionName];
- return storeActions;
- }, {});
- for (const actionName in actions) {
- store[actionName] = function() {
- const _actionId = runningActionId;
- const trackedStore = wrapWithProxy ? new Proxy(store, {
- get(...args) {
- activeAction = _actionId;
- return Reflect.get(...args);
- },
- set(...args) {
- activeAction = _actionId;
- return Reflect.set(...args);
- }
- }) : store;
- activeAction = _actionId;
- const retValue = actions[actionName].apply(trackedStore, arguments);
- activeAction = void 0;
- return retValue;
- };
- }
- }
- function devtoolsPlugin({ app: app2, store, options: options2 }) {
- if (store.$id.startsWith("__hot:")) {
- return;
- }
- store._isOptionsAPI = !!options2.state;
- patchActionForGrouping(store, Object.keys(options2.actions), store._isOptionsAPI);
- const originalHotUpdate = store._hotUpdate;
- vue.toRaw(store)._hotUpdate = function(newStore) {
- originalHotUpdate.apply(this, arguments);
- patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);
- };
- addStoreToDevtools(
- app2,
- // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
- store
- );
- }
- function createPinia() {
- const scope = vue.effectScope(true);
- const state = scope.run(() => vue.ref({}));
- let _p = [];
- let toBeInstalled = [];
- const pinia = vue.markRaw({
- install(app2) {
- setActivePinia(pinia);
- {
- pinia._a = app2;
- app2.provide(piniaSymbol, pinia);
- app2.config.globalProperties.$pinia = pinia;
- if (USE_DEVTOOLS) {
- registerPiniaDevtools(app2, pinia);
- }
- toBeInstalled.forEach((plugin) => _p.push(plugin));
- toBeInstalled = [];
- }
- },
- use(plugin) {
- if (!this._a && !isVue2) {
- toBeInstalled.push(plugin);
- } else {
- _p.push(plugin);
- }
- return this;
- },
- _p,
- // it's actually undefined here
- // @ts-expect-error
- _a: null,
- _e: scope,
- _s: /* @__PURE__ */ new Map(),
- state
- });
- if (USE_DEVTOOLS && typeof Proxy !== "undefined") {
- pinia.use(devtoolsPlugin);
- }
- return pinia;
- }
- function patchObject(newState, oldState) {
- for (const key in oldState) {
- const subPatch = oldState[key];
- if (!(key in newState)) {
- continue;
- }
- const targetValue = newState[key];
- if (isPlainObject$2(targetValue) && isPlainObject$2(subPatch) && !vue.isRef(subPatch) && !vue.isReactive(subPatch)) {
- newState[key] = patchObject(targetValue, subPatch);
- } else {
- {
- newState[key] = subPatch;
- }
- }
- }
- return newState;
- }
- const noop$1 = () => {
- };
- function addSubscription(subscriptions, callback, detached, onCleanup = noop$1) {
- subscriptions.push(callback);
- const removeSubscription = () => {
- const idx = subscriptions.indexOf(callback);
- if (idx > -1) {
- subscriptions.splice(idx, 1);
- onCleanup();
- }
- };
- if (!detached && vue.getCurrentScope()) {
- vue.onScopeDispose(removeSubscription);
- }
- return removeSubscription;
- }
- function triggerSubscriptions(subscriptions, ...args) {
- subscriptions.slice().forEach((callback) => {
- callback(...args);
- });
- }
- const fallbackRunWithContext = (fn) => fn();
- function mergeReactiveObjects(target, patchToApply) {
- if (target instanceof Map && patchToApply instanceof Map) {
- patchToApply.forEach((value, key) => target.set(key, value));
- }
- if (target instanceof Set && patchToApply instanceof Set) {
- patchToApply.forEach(target.add, target);
- }
- for (const key in patchToApply) {
- if (!patchToApply.hasOwnProperty(key))
- continue;
- const subPatch = patchToApply[key];
- const targetValue = target[key];
- if (isPlainObject$2(targetValue) && isPlainObject$2(subPatch) && target.hasOwnProperty(key) && !vue.isRef(subPatch) && !vue.isReactive(subPatch)) {
- target[key] = mergeReactiveObjects(targetValue, subPatch);
- } else {
- target[key] = subPatch;
- }
- }
- return target;
- }
- const skipHydrateSymbol = Symbol("pinia:skipHydration");
- function shouldHydrate(obj) {
- return !isPlainObject$2(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
- }
- const { assign: assign$2 } = Object;
- function isComputed(o2) {
- return !!(vue.isRef(o2) && o2.effect);
- }
- function createOptionsStore(id, options2, pinia, hot) {
- const { state, actions, getters } = options2;
- const initialState = pinia.state.value[id];
- let store;
- function setup() {
- if (!initialState && !hot) {
- {
- pinia.state.value[id] = state ? state() : {};
- }
- }
- const localState = hot ? (
- // use ref() to unwrap refs inside state TODO: check if this is still necessary
- vue.toRefs(vue.ref(state ? state() : {}).value)
- ) : vue.toRefs(pinia.state.value[id]);
- return assign$2(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name2) => {
- if (name2 in localState) {
- console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name2}" in store "${id}".`);
- }
- computedGetters[name2] = vue.markRaw(vue.computed(() => {
- setActivePinia(pinia);
- const store2 = pinia._s.get(id);
- return getters[name2].call(store2, store2);
- }));
- return computedGetters;
- }, {}));
- }
- store = createSetupStore(id, setup, options2, pinia, hot, true);
- return store;
- }
- function createSetupStore($id, setup, options2 = {}, pinia, hot, isOptionsStore) {
- let scope;
- const optionsForPlugin = assign$2({ actions: {} }, options2);
- if (!pinia._e.active) {
- throw new Error("Pinia destroyed");
- }
- const $subscribeOptions = {
- deep: true
- // flush: 'post',
- };
- {
- $subscribeOptions.onTrigger = (event) => {
- if (isListening) {
- debuggerEvents = event;
- } else if (isListening == false && !store._hotUpdating) {
- if (Array.isArray(debuggerEvents)) {
- debuggerEvents.push(event);
- } else {
- console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.");
- }
- }
- };
- }
- let isListening;
- let isSyncListening;
- let subscriptions = [];
- let actionSubscriptions = [];
- let debuggerEvents;
- const initialState = pinia.state.value[$id];
- if (!isOptionsStore && !initialState && !hot) {
- {
- pinia.state.value[$id] = {};
- }
- }
- const hotState = vue.ref({});
- let activeListener;
- function $patch(partialStateOrMutator) {
- let subscriptionMutation;
- isListening = isSyncListening = false;
- {
- debuggerEvents = [];
- }
- if (typeof partialStateOrMutator === "function") {
- partialStateOrMutator(pinia.state.value[$id]);
- subscriptionMutation = {
- type: MutationType.patchFunction,
- storeId: $id,
- events: debuggerEvents
- };
- } else {
- mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
- subscriptionMutation = {
- type: MutationType.patchObject,
- payload: partialStateOrMutator,
- storeId: $id,
- events: debuggerEvents
- };
- }
- const myListenerId = activeListener = Symbol();
- vue.nextTick().then(() => {
- if (activeListener === myListenerId) {
- isListening = true;
- }
- });
- isSyncListening = true;
- triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
- }
- const $reset = isOptionsStore ? function $reset2() {
- const { state } = options2;
- const newState = state ? state() : {};
- this.$patch(($state) => {
- assign$2($state, newState);
- });
- } : (
- /* istanbul ignore next */
- () => {
- throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
- }
- );
- function $dispose() {
- scope.stop();
- subscriptions = [];
- actionSubscriptions = [];
- pinia._s.delete($id);
- }
- function wrapAction(name2, action) {
- return function() {
- setActivePinia(pinia);
- const args = Array.from(arguments);
- const afterCallbackList = [];
- const onErrorCallbackList = [];
- function after(callback) {
- afterCallbackList.push(callback);
- }
- function onError2(callback) {
- onErrorCallbackList.push(callback);
- }
- triggerSubscriptions(actionSubscriptions, {
- args,
- name: name2,
- store,
- after,
- onError: onError2
- });
- let ret;
- try {
- ret = action.apply(this && this.$id === $id ? this : store, args);
- } catch (error2) {
- triggerSubscriptions(onErrorCallbackList, error2);
- throw error2;
- }
- if (ret instanceof Promise) {
- return ret.then((value) => {
- triggerSubscriptions(afterCallbackList, value);
- return value;
- }).catch((error2) => {
- triggerSubscriptions(onErrorCallbackList, error2);
- return Promise.reject(error2);
- });
- }
- triggerSubscriptions(afterCallbackList, ret);
- return ret;
- };
- }
- const _hmrPayload = /* @__PURE__ */ vue.markRaw({
- actions: {},
- getters: {},
- state: [],
- hotState
- });
- const partialStore = {
- _p: pinia,
- // _s: scope,
- $id,
- $onAction: addSubscription.bind(null, actionSubscriptions),
- $patch,
- $reset,
- $subscribe(callback, options22 = {}) {
- const removeSubscription = addSubscription(subscriptions, callback, options22.detached, () => stopWatcher());
- const stopWatcher = scope.run(() => vue.watch(() => pinia.state.value[$id], (state) => {
- if (options22.flush === "sync" ? isSyncListening : isListening) {
- callback({
- storeId: $id,
- type: MutationType.direct,
- events: debuggerEvents
- }, state);
- }
- }, assign$2({}, $subscribeOptions, options22)));
- return removeSubscription;
- },
- $dispose
- };
- const store = vue.reactive(assign$2(
- {
- _hmrPayload,
- _customProperties: vue.markRaw(/* @__PURE__ */ new Set())
- // devtools custom properties
- },
- partialStore
- // must be added later
- // setupStore
- ));
- pinia._s.set($id, store);
- const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext;
- const setupStore = runWithContext(() => pinia._e.run(() => (scope = vue.effectScope()).run(setup)));
- for (const key in setupStore) {
- const prop = setupStore[key];
- if (vue.isRef(prop) && !isComputed(prop) || vue.isReactive(prop)) {
- if (hot) {
- set(hotState.value, key, vue.toRef(setupStore, key));
- } else if (!isOptionsStore) {
- if (initialState && shouldHydrate(prop)) {
- if (vue.isRef(prop)) {
- prop.value = initialState[key];
- } else {
- mergeReactiveObjects(prop, initialState[key]);
- }
- }
- {
- pinia.state.value[$id][key] = prop;
- }
- }
- {
- _hmrPayload.state.push(key);
- }
- } else if (typeof prop === "function") {
- const actionValue = hot ? prop : wrapAction(key, prop);
- {
- setupStore[key] = actionValue;
- }
- {
- _hmrPayload.actions[key] = prop;
- }
- optionsForPlugin.actions[key] = prop;
- } else {
- if (isComputed(prop)) {
- _hmrPayload.getters[key] = isOptionsStore ? (
- // @ts-expect-error
- options2.getters[key]
- ) : prop;
- if (IS_CLIENT) {
- const getters = setupStore._getters || // @ts-expect-error: same
- (setupStore._getters = vue.markRaw([]));
- getters.push(key);
- }
- }
- }
- }
- {
- assign$2(store, setupStore);
- assign$2(vue.toRaw(store), setupStore);
- }
- Object.defineProperty(store, "$state", {
- get: () => hot ? hotState.value : pinia.state.value[$id],
- set: (state) => {
- if (hot) {
- throw new Error("cannot set hotState");
- }
- $patch(($state) => {
- assign$2($state, state);
- });
- }
- });
- {
- store._hotUpdate = vue.markRaw((newStore) => {
- store._hotUpdating = true;
- newStore._hmrPayload.state.forEach((stateKey) => {
- if (stateKey in store.$state) {
- const newStateTarget = newStore.$state[stateKey];
- const oldStateSource = store.$state[stateKey];
- if (typeof newStateTarget === "object" && isPlainObject$2(newStateTarget) && isPlainObject$2(oldStateSource)) {
- patchObject(newStateTarget, oldStateSource);
- } else {
- newStore.$state[stateKey] = oldStateSource;
- }
- }
- set(store, stateKey, vue.toRef(newStore.$state, stateKey));
- });
- Object.keys(store.$state).forEach((stateKey) => {
- if (!(stateKey in newStore.$state)) {
- del(store, stateKey);
- }
- });
- isListening = false;
- isSyncListening = false;
- pinia.state.value[$id] = vue.toRef(newStore._hmrPayload, "hotState");
- isSyncListening = true;
- vue.nextTick().then(() => {
- isListening = true;
- });
- for (const actionName in newStore._hmrPayload.actions) {
- const action = newStore[actionName];
- set(store, actionName, wrapAction(actionName, action));
- }
- for (const getterName in newStore._hmrPayload.getters) {
- const getter = newStore._hmrPayload.getters[getterName];
- const getterValue = isOptionsStore ? (
- // special handling of options api
- vue.computed(() => {
- setActivePinia(pinia);
- return getter.call(store, store);
- })
- ) : getter;
- set(store, getterName, getterValue);
- }
- Object.keys(store._hmrPayload.getters).forEach((key) => {
- if (!(key in newStore._hmrPayload.getters)) {
- del(store, key);
- }
- });
- Object.keys(store._hmrPayload.actions).forEach((key) => {
- if (!(key in newStore._hmrPayload.actions)) {
- del(store, key);
- }
- });
- store._hmrPayload = newStore._hmrPayload;
- store._getters = newStore._getters;
- store._hotUpdating = false;
- });
- }
- if (USE_DEVTOOLS) {
- const nonEnumerable = {
- writable: true,
- configurable: true,
- // avoid warning on devtools trying to display this property
- enumerable: false
- };
- ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p2) => {
- Object.defineProperty(store, p2, assign$2({ value: store[p2] }, nonEnumerable));
- });
- }
- pinia._p.forEach((extender) => {
- if (USE_DEVTOOLS) {
- const extensions = scope.run(() => extender({
- store,
- app: pinia._a,
- pinia,
- options: optionsForPlugin
- }));
- Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));
- assign$2(store, extensions);
- } else {
- assign$2(store, scope.run(() => extender({
- store,
- app: pinia._a,
- pinia,
- options: optionsForPlugin
- })));
- }
- });
- if (store.$state && typeof store.$state === "object" && typeof store.$state.constructor === "function" && !store.$state.constructor.toString().includes("[native code]")) {
- console.warn(`[🍍]: The "state" must be a plain object. It cannot be
- state: () => new MyClass()
- Found in store "${store.$id}".`);
- }
- if (initialState && isOptionsStore && options2.hydrate) {
- options2.hydrate(store.$state, initialState);
- }
- isListening = true;
- isSyncListening = true;
- return store;
- }
- function defineStore(idOrOptions, setup, setupOptions) {
- let id;
- let options2;
- const isSetupStore = typeof setup === "function";
- if (typeof idOrOptions === "string") {
- id = idOrOptions;
- options2 = isSetupStore ? setupOptions : setup;
- } else {
- options2 = idOrOptions;
- id = idOrOptions.id;
- if (typeof id !== "string") {
- throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`);
- }
- }
- function useStore(pinia, hot) {
- const hasContext = vue.hasInjectionContext();
- pinia = // in test mode, ignore the argument provided as we can always retrieve a
- // pinia instance with getActivePinia()
- pinia || (hasContext ? vue.inject(piniaSymbol, null) : null);
- if (pinia)
- setActivePinia(pinia);
- if (!activePinia) {
- throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
- See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
- This will fail in production.`);
- }
- pinia = activePinia;
- if (!pinia._s.has(id)) {
- if (isSetupStore) {
- createSetupStore(id, setup, options2, pinia);
- } else {
- createOptionsStore(id, options2, pinia);
- }
- {
- useStore._pinia = pinia;
- }
- }
- const store = pinia._s.get(id);
- if (hot) {
- const hotId = "__hot:" + id;
- const newStore = isSetupStore ? createSetupStore(hotId, setup, options2, pinia, true) : createOptionsStore(hotId, assign$2({}, options2), pinia, true);
- hot._hotUpdate(newStore);
- delete pinia.state.value[hotId];
- pinia._s.delete(hotId);
- }
- if (IS_CLIENT) {
- const currentInstance = vue.getCurrentInstance();
- if (currentInstance && currentInstance.proxy && // avoid adding stores that are just built for hot module replacement
- !hot) {
- const vm = currentInstance.proxy;
- const cache2 = "_pStores" in vm ? vm._pStores : vm._pStores = {};
- cache2[id] = store;
- }
- }
- return store;
- }
- useStore.$id = id;
- return useStore;
- }
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
- function getDefaultExportFromCjs(x) {
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
- }
- var lodash = { exports: {} };
- /**
- * @license
- * Lodash <https://lodash.com/>
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
- lodash.exports;
- (function(module, exports) {
- (function() {
- var undefined$1;
- var VERSION2 = "4.17.21";
- var LARGE_ARRAY_SIZE = 200;
- var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
- var MAX_MEMOIZE_SIZE = 500;
- var PLACEHOLDER = "__lodash_placeholder__";
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
- var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
- var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
- var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
- var HOT_COUNT = 800, HOT_SPAN = 16;
- var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
- var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
- var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
- var wrapFlags = [
- ["ary", WRAP_ARY_FLAG],
- ["bind", WRAP_BIND_FLAG],
- ["bindKey", WRAP_BIND_KEY_FLAG],
- ["curry", WRAP_CURRY_FLAG],
- ["curryRight", WRAP_CURRY_RIGHT_FLAG],
- ["flip", WRAP_FLIP_FLAG],
- ["partial", WRAP_PARTIAL_FLAG],
- ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
- ["rearg", WRAP_REARG_FLAG]
- ];
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
- var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
- var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
- var reTrimStart = /^\s+/;
- var reWhitespace = /\s/;
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
- var reEscapeChar = /\\(\\)?/g;
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
- var reFlags = /\w*$/;
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
- var reIsBinary = /^0b[01]+$/i;
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- var reIsOctal = /^0o[0-7]+$/i;
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
- var reNoMatch = /($^)/;
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
- var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
- var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
- var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
- var reApos = RegExp(rsApos, "g");
- var reComboMark = RegExp(rsCombo, "g");
- var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
- var reUnicodeWord = RegExp([
- rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
- rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
- rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
- rsUpper + "+" + rsOptContrUpper,
- rsOrdUpper,
- rsOrdLower,
- rsDigits,
- rsEmoji
- ].join("|"), "g");
- var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
- var contextProps = [
- "Array",
- "Buffer",
- "DataView",
- "Date",
- "Error",
- "Float32Array",
- "Float64Array",
- "Function",
- "Int8Array",
- "Int16Array",
- "Int32Array",
- "Map",
- "Math",
- "Object",
- "Promise",
- "RegExp",
- "Set",
- "String",
- "Symbol",
- "TypeError",
- "Uint8Array",
- "Uint8ClampedArray",
- "Uint16Array",
- "Uint32Array",
- "WeakMap",
- "_",
- "clearTimeout",
- "isFinite",
- "parseInt",
- "setTimeout"
- ];
- var templateCounter = -1;
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
- var deburredLetters = {
- // Latin-1 Supplement block.
- "À": "A",
- "Á": "A",
- "Â": "A",
- "Ã": "A",
- "Ä": "A",
- "Å": "A",
- "à": "a",
- "á": "a",
- "â": "a",
- "ã": "a",
- "ä": "a",
- "å": "a",
- "Ç": "C",
- "ç": "c",
- "Ð": "D",
- "ð": "d",
- "È": "E",
- "É": "E",
- "Ê": "E",
- "Ë": "E",
- "è": "e",
- "é": "e",
- "ê": "e",
- "ë": "e",
- "Ì": "I",
- "Í": "I",
- "Î": "I",
- "Ï": "I",
- "ì": "i",
- "í": "i",
- "î": "i",
- "ï": "i",
- "Ñ": "N",
- "ñ": "n",
- "Ò": "O",
- "Ó": "O",
- "Ô": "O",
- "Õ": "O",
- "Ö": "O",
- "Ø": "O",
- "ò": "o",
- "ó": "o",
- "ô": "o",
- "õ": "o",
- "ö": "o",
- "ø": "o",
- "Ù": "U",
- "Ú": "U",
- "Û": "U",
- "Ü": "U",
- "ù": "u",
- "ú": "u",
- "û": "u",
- "ü": "u",
- "Ý": "Y",
- "ý": "y",
- "ÿ": "y",
- "Æ": "Ae",
- "æ": "ae",
- "Þ": "Th",
- "þ": "th",
- "ß": "ss",
- // Latin Extended-A block.
- "Ā": "A",
- "Ă": "A",
- "Ą": "A",
- "ā": "a",
- "ă": "a",
- "ą": "a",
- "Ć": "C",
- "Ĉ": "C",
- "Ċ": "C",
- "Č": "C",
- "ć": "c",
- "ĉ": "c",
- "ċ": "c",
- "č": "c",
- "Ď": "D",
- "Đ": "D",
- "ď": "d",
- "đ": "d",
- "Ē": "E",
- "Ĕ": "E",
- "Ė": "E",
- "Ę": "E",
- "Ě": "E",
- "ē": "e",
- "ĕ": "e",
- "ė": "e",
- "ę": "e",
- "ě": "e",
- "Ĝ": "G",
- "Ğ": "G",
- "Ġ": "G",
- "Ģ": "G",
- "ĝ": "g",
- "ğ": "g",
- "ġ": "g",
- "ģ": "g",
- "Ĥ": "H",
- "Ħ": "H",
- "ĥ": "h",
- "ħ": "h",
- "Ĩ": "I",
- "Ī": "I",
- "Ĭ": "I",
- "Į": "I",
- "İ": "I",
- "ĩ": "i",
- "ī": "i",
- "ĭ": "i",
- "į": "i",
- "ı": "i",
- "Ĵ": "J",
- "ĵ": "j",
- "Ķ": "K",
- "ķ": "k",
- "ĸ": "k",
- "Ĺ": "L",
- "Ļ": "L",
- "Ľ": "L",
- "Ŀ": "L",
- "Ł": "L",
- "ĺ": "l",
- "ļ": "l",
- "ľ": "l",
- "ŀ": "l",
- "ł": "l",
- "Ń": "N",
- "Ņ": "N",
- "Ň": "N",
- "Ŋ": "N",
- "ń": "n",
- "ņ": "n",
- "ň": "n",
- "ŋ": "n",
- "Ō": "O",
- "Ŏ": "O",
- "Ő": "O",
- "ō": "o",
- "ŏ": "o",
- "ő": "o",
- "Ŕ": "R",
- "Ŗ": "R",
- "Ř": "R",
- "ŕ": "r",
- "ŗ": "r",
- "ř": "r",
- "Ś": "S",
- "Ŝ": "S",
- "Ş": "S",
- "Š": "S",
- "ś": "s",
- "ŝ": "s",
- "ş": "s",
- "š": "s",
- "Ţ": "T",
- "Ť": "T",
- "Ŧ": "T",
- "ţ": "t",
- "ť": "t",
- "ŧ": "t",
- "Ũ": "U",
- "Ū": "U",
- "Ŭ": "U",
- "Ů": "U",
- "Ű": "U",
- "Ų": "U",
- "ũ": "u",
- "ū": "u",
- "ŭ": "u",
- "ů": "u",
- "ű": "u",
- "ų": "u",
- "Ŵ": "W",
- "ŵ": "w",
- "Ŷ": "Y",
- "ŷ": "y",
- "Ÿ": "Y",
- "Ź": "Z",
- "Ż": "Z",
- "Ž": "Z",
- "ź": "z",
- "ż": "z",
- "ž": "z",
- "IJ": "IJ",
- "ij": "ij",
- "Œ": "Oe",
- "œ": "oe",
- "ʼn": "'n",
- "ſ": "s"
- };
- var htmlEscapes = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'"
- };
- var htmlUnescapes = {
- "&": "&",
- "<": "<",
- ">": ">",
- """: '"',
- "'": "'"
- };
- var stringEscapes = {
- "\\": "\\",
- "'": "'",
- "\n": "n",
- "\r": "r",
- "\u2028": "u2028",
- "\u2029": "u2029"
- };
- var freeParseFloat = parseFloat, freeParseInt = parseInt;
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
- var root = freeGlobal || freeSelf || Function("return this")();
- var freeExports = exports && !exports.nodeType && exports;
- var freeModule = freeExports && true && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var freeProcess = moduleExports && freeGlobal.process;
- var nodeUtil = function() {
- try {
- var types2 = freeModule && freeModule.require && freeModule.require("util").types;
- if (types2) {
- return types2;
- }
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
- } catch (e2) {
- }
- }();
- var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
- function apply2(func, thisArg, args) {
- switch (args.length) {
- case 0:
- return func.call(thisArg);
- case 1:
- return func.call(thisArg, args[0]);
- case 2:
- return func.call(thisArg, args[0], args[1]);
- case 3:
- return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
- function arrayAggregator(array2, setter, iteratee, accumulator) {
- var index2 = -1, length = array2 == null ? 0 : array2.length;
- while (++index2 < length) {
- var value = array2[index2];
- setter(accumulator, value, iteratee(value), array2);
- }
- return accumulator;
- }
- function arrayEach(array2, iteratee) {
- var index2 = -1, length = array2 == null ? 0 : array2.length;
- while (++index2 < length) {
- if (iteratee(array2[index2], index2, array2) === false) {
- break;
- }
- }
- return array2;
- }
- function arrayEachRight(array2, iteratee) {
- var length = array2 == null ? 0 : array2.length;
- while (length--) {
- if (iteratee(array2[length], length, array2) === false) {
- break;
- }
- }
- return array2;
- }
- function arrayEvery(array2, predicate) {
- var index2 = -1, length = array2 == null ? 0 : array2.length;
- while (++index2 < length) {
- if (!predicate(array2[index2], index2, array2)) {
- return false;
- }
- }
- return true;
- }
- function arrayFilter(array2, predicate) {
- var index2 = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result2 = [];
- while (++index2 < length) {
- var value = array2[index2];
- if (predicate(value, index2, array2)) {
- result2[resIndex++] = value;
- }
- }
- return result2;
- }
- function arrayIncludes(array2, value) {
- var length = array2 == null ? 0 : array2.length;
- return !!length && baseIndexOf(array2, value, 0) > -1;
- }
- function arrayIncludesWith(array2, value, comparator) {
- var index2 = -1, length = array2 == null ? 0 : array2.length;
- while (++index2 < length) {
- if (comparator(value, array2[index2])) {
- return true;
- }
- }
- return false;
- }
- function arrayMap(array2, iteratee) {
- var index2 = -1, length = array2 == null ? 0 : array2.length, result2 = Array(length);
- while (++index2 < length) {
- result2[index2] = iteratee(array2[index2], index2, array2);
- }
- return result2;
- }
- function arrayPush(array2, values) {
- var index2 = -1, length = values.length, offset = array2.length;
- while (++index2 < length) {
- array2[offset + index2] = values[index2];
- }
- return array2;
- }
- function arrayReduce(array2, iteratee, accumulator, initAccum) {
- var index2 = -1, length = array2 == null ? 0 : array2.length;
- if (initAccum && length) {
- accumulator = array2[++index2];
- }
- while (++index2 < length) {
- accumulator = iteratee(accumulator, array2[index2], index2, array2);
- }
- return accumulator;
- }
- function arrayReduceRight(array2, iteratee, accumulator, initAccum) {
- var length = array2 == null ? 0 : array2.length;
- if (initAccum && length) {
- accumulator = array2[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array2[length], length, array2);
- }
- return accumulator;
- }
- function arraySome(array2, predicate) {
- var index2 = -1, length = array2 == null ? 0 : array2.length;
- while (++index2 < length) {
- if (predicate(array2[index2], index2, array2)) {
- return true;
- }
- }
- return false;
- }
- var asciiSize = baseProperty("length");
- function asciiToArray(string) {
- return string.split("");
- }
- function asciiWords(string) {
- return string.match(reAsciiWord) || [];
- }
- function baseFindKey(collection, predicate, eachFunc) {
- var result2;
- eachFunc(collection, function(value, key, collection2) {
- if (predicate(value, key, collection2)) {
- result2 = key;
- return false;
- }
- });
- return result2;
- }
- function baseFindIndex(array2, predicate, fromIndex, fromRight) {
- var length = array2.length, index2 = fromIndex + (fromRight ? 1 : -1);
- while (fromRight ? index2-- : ++index2 < length) {
- if (predicate(array2[index2], index2, array2)) {
- return index2;
- }
- }
- return -1;
- }
- function baseIndexOf(array2, value, fromIndex) {
- return value === value ? strictIndexOf(array2, value, fromIndex) : baseFindIndex(array2, baseIsNaN, fromIndex);
- }
- function baseIndexOfWith(array2, value, fromIndex, comparator) {
- var index2 = fromIndex - 1, length = array2.length;
- while (++index2 < length) {
- if (comparator(array2[index2], value)) {
- return index2;
- }
- }
- return -1;
- }
- function baseIsNaN(value) {
- return value !== value;
- }
- function baseMean(array2, iteratee) {
- var length = array2 == null ? 0 : array2.length;
- return length ? baseSum(array2, iteratee) / length : NAN;
- }
- function baseProperty(key) {
- return function(object2) {
- return object2 == null ? undefined$1 : object2[key];
- };
- }
- function basePropertyOf(object2) {
- return function(key) {
- return object2 == null ? undefined$1 : object2[key];
- };
- }
- function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
- eachFunc(collection, function(value, index2, collection2) {
- accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index2, collection2);
- });
- return accumulator;
- }
- function baseSortBy(array2, comparer) {
- var length = array2.length;
- array2.sort(comparer);
- while (length--) {
- array2[length] = array2[length].value;
- }
- return array2;
- }
- function baseSum(array2, iteratee) {
- var result2, index2 = -1, length = array2.length;
- while (++index2 < length) {
- var current = iteratee(array2[index2]);
- if (current !== undefined$1) {
- result2 = result2 === undefined$1 ? current : result2 + current;
- }
- }
- return result2;
- }
- function baseTimes(n2, iteratee) {
- var index2 = -1, result2 = Array(n2);
- while (++index2 < n2) {
- result2[index2] = iteratee(index2);
- }
- return result2;
- }
- function baseToPairs(object2, props) {
- return arrayMap(props, function(key) {
- return [key, object2[key]];
- });
- }
- function baseTrim(string) {
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
- }
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
- function baseValues(object2, props) {
- return arrayMap(props, function(key) {
- return object2[key];
- });
- }
- function cacheHas(cache2, key) {
- return cache2.has(key);
- }
- function charsStartIndex(strSymbols, chrSymbols) {
- var index2 = -1, length = strSymbols.length;
- while (++index2 < length && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) {
- }
- return index2;
- }
- function charsEndIndex(strSymbols, chrSymbols) {
- var index2 = strSymbols.length;
- while (index2-- && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) {
- }
- return index2;
- }
- function countHolders(array2, placeholder) {
- var length = array2.length, result2 = 0;
- while (length--) {
- if (array2[length] === placeholder) {
- ++result2;
- }
- }
- return result2;
- }
- var deburrLetter = basePropertyOf(deburredLetters);
- var escapeHtmlChar = basePropertyOf(htmlEscapes);
- function escapeStringChar(chr) {
- return "\\" + stringEscapes[chr];
- }
- function getValue(object2, key) {
- return object2 == null ? undefined$1 : object2[key];
- }
- function hasUnicode(string) {
- return reHasUnicode.test(string);
- }
- function hasUnicodeWord(string) {
- return reHasUnicodeWord.test(string);
- }
- function iteratorToArray(iterator) {
- var data, result2 = [];
- while (!(data = iterator.next()).done) {
- result2.push(data.value);
- }
- return result2;
- }
- function mapToArray(map) {
- var index2 = -1, result2 = Array(map.size);
- map.forEach(function(value, key) {
- result2[++index2] = [key, value];
- });
- return result2;
- }
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
- function replaceHolders(array2, placeholder) {
- var index2 = -1, length = array2.length, resIndex = 0, result2 = [];
- while (++index2 < length) {
- var value = array2[index2];
- if (value === placeholder || value === PLACEHOLDER) {
- array2[index2] = PLACEHOLDER;
- result2[resIndex++] = index2;
- }
- }
- return result2;
- }
- function setToArray(set2) {
- var index2 = -1, result2 = Array(set2.size);
- set2.forEach(function(value) {
- result2[++index2] = value;
- });
- return result2;
- }
- function setToPairs(set2) {
- var index2 = -1, result2 = Array(set2.size);
- set2.forEach(function(value) {
- result2[++index2] = [value, value];
- });
- return result2;
- }
- function strictIndexOf(array2, value, fromIndex) {
- var index2 = fromIndex - 1, length = array2.length;
- while (++index2 < length) {
- if (array2[index2] === value) {
- return index2;
- }
- }
- return -1;
- }
- function strictLastIndexOf(array2, value, fromIndex) {
- var index2 = fromIndex + 1;
- while (index2--) {
- if (array2[index2] === value) {
- return index2;
- }
- }
- return index2;
- }
- function stringSize(string) {
- return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
- }
- function stringToArray(string) {
- return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
- }
- function trimmedEndIndex(string) {
- var index2 = string.length;
- while (index2-- && reWhitespace.test(string.charAt(index2))) {
- }
- return index2;
- }
- var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
- function unicodeSize(string) {
- var result2 = reUnicode.lastIndex = 0;
- while (reUnicode.test(string)) {
- ++result2;
- }
- return result2;
- }
- function unicodeToArray(string) {
- return string.match(reUnicode) || [];
- }
- function unicodeWords(string) {
- return string.match(reUnicodeWord) || [];
- }
- var runInContext = function runInContext2(context) {
- context = context == null ? root : _2.defaults(root.Object(), context, _2.pick(root, contextProps));
- var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
- var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
- var coreJsData = context["__core-js_shared__"];
- var funcToString = funcProto.toString;
- var hasOwnProperty2 = objectProto.hasOwnProperty;
- var idCounter = 0;
- var maskSrcKey = function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
- return uid ? "Symbol(src)_1." + uid : "";
- }();
- var nativeObjectToString = objectProto.toString;
- var objectCtorString = funcToString.call(Object2);
- var oldDash = root._;
- var reIsNative = RegExp2(
- "^" + funcToString.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
- );
- var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
- var defineProperty = function() {
- try {
- var func = getNative(Object2, "defineProperty");
- func({}, "", {});
- return func;
- } catch (e2) {
- }
- }();
- var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
- var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
- var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
- var metaMap = WeakMap2 && new WeakMap2();
- var realNames = {};
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
- var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
- function lodash2(value) {
- if (isObjectLike(value) && !isArray2(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty2.call(value, "__wrapped__")) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
- }
- var baseCreate = /* @__PURE__ */ function() {
- function object2() {
- }
- return function(proto) {
- if (!isObject2(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object2.prototype = proto;
- var result3 = new object2();
- object2.prototype = undefined$1;
- return result3;
- };
- }();
- function baseLodash() {
- }
- function LodashWrapper(value, chainAll) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__chain__ = !!chainAll;
- this.__index__ = 0;
- this.__values__ = undefined$1;
- }
- lodash2.templateSettings = {
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "escape": reEscape,
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "evaluate": reEvaluate,
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "interpolate": reInterpolate,
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type {string}
- */
- "variable": "",
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type {Object}
- */
- "imports": {
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type {Function}
- */
- "_": lodash2
- }
- };
- lodash2.prototype = baseLodash.prototype;
- lodash2.prototype.constructor = lodash2;
- LodashWrapper.prototype = baseCreate(baseLodash.prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = MAX_ARRAY_LENGTH;
- this.__views__ = [];
- }
- function lazyClone() {
- var result3 = new LazyWrapper(this.__wrapped__);
- result3.__actions__ = copyArray(this.__actions__);
- result3.__dir__ = this.__dir__;
- result3.__filtered__ = this.__filtered__;
- result3.__iteratees__ = copyArray(this.__iteratees__);
- result3.__takeCount__ = this.__takeCount__;
- result3.__views__ = copyArray(this.__views__);
- return result3;
- }
- function lazyReverse() {
- if (this.__filtered__) {
- var result3 = new LazyWrapper(this);
- result3.__dir__ = -1;
- result3.__filtered__ = true;
- } else {
- result3 = this.clone();
- result3.__dir__ *= -1;
- }
- return result3;
- }
- function lazyValue() {
- var array2 = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray2(array2), isRight = dir < 0, arrLength = isArr ? array2.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index2 = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
- if (!isArr || !isRight && arrLength == length && takeCount == length) {
- return baseWrapperValue(array2, this.__actions__);
- }
- var result3 = [];
- outer:
- while (length-- && resIndex < takeCount) {
- index2 += dir;
- var iterIndex = -1, value = array2[index2];
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value);
- if (type == LAZY_MAP_FLAG) {
- value = computed;
- } else if (!computed) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result3[resIndex++] = value;
- }
- return result3;
- }
- LazyWrapper.prototype = baseCreate(baseLodash.prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
- function Hash(entries) {
- var index2 = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index2 < length) {
- var entry = entries[index2];
- this.set(entry[0], entry[1]);
- }
- }
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- this.size = 0;
- }
- function hashDelete(key) {
- var result3 = this.has(key) && delete this.__data__[key];
- this.size -= result3 ? 1 : 0;
- return result3;
- }
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result3 = data[key];
- return result3 === HASH_UNDEFINED ? undefined$1 : result3;
- }
- return hasOwnProperty2.call(data, key) ? data[key] : undefined$1;
- }
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? data[key] !== undefined$1 : hasOwnProperty2.call(data, key);
- }
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = nativeCreate && value === undefined$1 ? HASH_UNDEFINED : value;
- return this;
- }
- Hash.prototype.clear = hashClear;
- Hash.prototype["delete"] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
- function ListCache(entries) {
- var index2 = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index2 < length) {
- var entry = entries[index2];
- this.set(entry[0], entry[1]);
- }
- }
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
- function listCacheDelete(key) {
- var data = this.__data__, index2 = assocIndexOf(data, key);
- if (index2 < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index2 == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index2, 1);
- }
- --this.size;
- return true;
- }
- function listCacheGet(key) {
- var data = this.__data__, index2 = assocIndexOf(data, key);
- return index2 < 0 ? undefined$1 : data[index2][1];
- }
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
- function listCacheSet(key, value) {
- var data = this.__data__, index2 = assocIndexOf(data, key);
- if (index2 < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index2][1] = value;
- }
- return this;
- }
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype["delete"] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
- function MapCache(entries) {
- var index2 = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index2 < length) {
- var entry = entries[index2];
- this.set(entry[0], entry[1]);
- }
- }
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- "hash": new Hash(),
- "map": new (Map2 || ListCache)(),
- "string": new Hash()
- };
- }
- function mapCacheDelete(key) {
- var result3 = getMapData(this, key)["delete"](key);
- this.size -= result3 ? 1 : 0;
- return result3;
- }
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
- function mapCacheSet(key, value) {
- var data = getMapData(this, key), size2 = data.size;
- data.set(key, value);
- this.size += data.size == size2 ? 0 : 1;
- return this;
- }
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype["delete"] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
- function SetCache(values2) {
- var index2 = -1, length = values2 == null ? 0 : values2.length;
- this.__data__ = new MapCache();
- while (++index2 < length) {
- this.add(values2[index2]);
- }
- }
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED);
- return this;
- }
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
- SetCache.prototype.has = setCacheHas;
- function Stack(entries) {
- var data = this.__data__ = new ListCache(entries);
- this.size = data.size;
- }
- function stackClear() {
- this.__data__ = new ListCache();
- this.size = 0;
- }
- function stackDelete(key) {
- var data = this.__data__, result3 = data["delete"](key);
- this.size = data.size;
- return result3;
- }
- function stackGet(key) {
- return this.__data__.get(key);
- }
- function stackHas(key) {
- return this.__data__.has(key);
- }
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof ListCache) {
- var pairs = data.__data__;
- if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
- Stack.prototype.clear = stackClear;
- Stack.prototype["delete"] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
- function arrayLikeKeys(value, inherited) {
- var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer2(value), isType = !isArr && !isArg && !isBuff && isTypedArray2(value), skipIndexes = isArr || isArg || isBuff || isType, result3 = skipIndexes ? baseTimes(value.length, String2) : [], length = result3.length;
- for (var key in value) {
- if ((inherited || hasOwnProperty2.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
- (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
- isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
- isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
- isIndex(key, length)))) {
- result3.push(key);
- }
- }
- return result3;
- }
- function arraySample(array2) {
- var length = array2.length;
- return length ? array2[baseRandom(0, length - 1)] : undefined$1;
- }
- function arraySampleSize(array2, n2) {
- return shuffleSelf(copyArray(array2), baseClamp(n2, 0, array2.length));
- }
- function arrayShuffle(array2) {
- return shuffleSelf(copyArray(array2));
- }
- function assignMergeValue(object2, key, value) {
- if (value !== undefined$1 && !eq(object2[key], value) || value === undefined$1 && !(key in object2)) {
- baseAssignValue(object2, key, value);
- }
- }
- function assignValue(object2, key, value) {
- var objValue = object2[key];
- if (!(hasOwnProperty2.call(object2, key) && eq(objValue, value)) || value === undefined$1 && !(key in object2)) {
- baseAssignValue(object2, key, value);
- }
- }
- function assocIndexOf(array2, key) {
- var length = array2.length;
- while (length--) {
- if (eq(array2[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
- function baseAggregator(collection, setter, iteratee2, accumulator) {
- baseEach(collection, function(value, key, collection2) {
- setter(accumulator, value, iteratee2(value), collection2);
- });
- return accumulator;
- }
- function baseAssign(object2, source) {
- return object2 && copyObject(source, keys(source), object2);
- }
- function baseAssignIn(object2, source) {
- return object2 && copyObject(source, keysIn(source), object2);
- }
- function baseAssignValue(object2, key, value) {
- if (key == "__proto__" && defineProperty) {
- defineProperty(object2, key, {
- "configurable": true,
- "enumerable": true,
- "value": value,
- "writable": true
- });
- } else {
- object2[key] = value;
- }
- }
- function baseAt(object2, paths) {
- var index2 = -1, length = paths.length, result3 = Array2(length), skip = object2 == null;
- while (++index2 < length) {
- result3[index2] = skip ? undefined$1 : get(object2, paths[index2]);
- }
- return result3;
- }
- function baseClamp(number2, lower, upper) {
- if (number2 === number2) {
- if (upper !== undefined$1) {
- number2 = number2 <= upper ? number2 : upper;
- }
- if (lower !== undefined$1) {
- number2 = number2 >= lower ? number2 : lower;
- }
- }
- return number2;
- }
- function baseClone(value, bitmask, customizer, key, object2, stack) {
- var result3, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
- if (customizer) {
- result3 = object2 ? customizer(value, key, object2, stack) : customizer(value);
- }
- if (result3 !== undefined$1) {
- return result3;
- }
- if (!isObject2(value)) {
- return value;
- }
- var isArr = isArray2(value);
- if (isArr) {
- result3 = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result3);
- }
- } else {
- var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
- if (isBuffer2(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || isFunc && !object2) {
- result3 = isFlat || isFunc ? {} : initCloneObject(value);
- if (!isDeep) {
- return isFlat ? copySymbolsIn(value, baseAssignIn(result3, value)) : copySymbols(value, baseAssign(result3, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object2 ? value : {};
- }
- result3 = initCloneByTag(value, tag, isDeep);
- }
- }
- stack || (stack = new Stack());
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result3);
- if (isSet(value)) {
- value.forEach(function(subValue) {
- result3.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
- });
- } else if (isMap(value)) {
- value.forEach(function(subValue, key2) {
- result3.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
- });
- }
- var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
- var props = isArr ? undefined$1 : keysFunc(value);
- arrayEach(props || value, function(subValue, key2) {
- if (props) {
- key2 = subValue;
- subValue = value[key2];
- }
- assignValue(result3, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
- });
- return result3;
- }
- function baseConforms(source) {
- var props = keys(source);
- return function(object2) {
- return baseConformsTo(object2, source, props);
- };
- }
- function baseConformsTo(object2, source, props) {
- var length = props.length;
- if (object2 == null) {
- return !length;
- }
- object2 = Object2(object2);
- while (length--) {
- var key = props[length], predicate = source[key], value = object2[key];
- if (value === undefined$1 && !(key in object2) || !predicate(value)) {
- return false;
- }
- }
- return true;
- }
- function baseDelay(func, wait, args) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return setTimeout2(function() {
- func.apply(undefined$1, args);
- }, wait);
- }
- function baseDifference(array2, values2, iteratee2, comparator) {
- var index2 = -1, includes2 = arrayIncludes, isCommon = true, length = array2.length, result3 = [], valuesLength = values2.length;
- if (!length) {
- return result3;
- }
- if (iteratee2) {
- values2 = arrayMap(values2, baseUnary(iteratee2));
- }
- if (comparator) {
- includes2 = arrayIncludesWith;
- isCommon = false;
- } else if (values2.length >= LARGE_ARRAY_SIZE) {
- includes2 = cacheHas;
- isCommon = false;
- values2 = new SetCache(values2);
- }
- outer:
- while (++index2 < length) {
- var value = array2[index2], computed = iteratee2 == null ? value : iteratee2(value);
- value = comparator || value !== 0 ? value : 0;
- if (isCommon && computed === computed) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values2[valuesIndex] === computed) {
- continue outer;
- }
- }
- result3.push(value);
- } else if (!includes2(values2, computed, comparator)) {
- result3.push(value);
- }
- }
- return result3;
- }
- var baseEach = createBaseEach(baseForOwn);
- var baseEachRight = createBaseEach(baseForOwnRight, true);
- function baseEvery(collection, predicate) {
- var result3 = true;
- baseEach(collection, function(value, index2, collection2) {
- result3 = !!predicate(value, index2, collection2);
- return result3;
- });
- return result3;
- }
- function baseExtremum(array2, iteratee2, comparator) {
- var index2 = -1, length = array2.length;
- while (++index2 < length) {
- var value = array2[index2], current = iteratee2(value);
- if (current != null && (computed === undefined$1 ? current === current && !isSymbol(current) : comparator(current, computed))) {
- var computed = current, result3 = value;
- }
- }
- return result3;
- }
- function baseFill(array2, value, start, end) {
- var length = array2.length;
- start = toInteger(start);
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end === undefined$1 || end > length ? length : toInteger(end);
- if (end < 0) {
- end += length;
- }
- end = start > end ? 0 : toLength(end);
- while (start < end) {
- array2[start++] = value;
- }
- return array2;
- }
- function baseFilter(collection, predicate) {
- var result3 = [];
- baseEach(collection, function(value, index2, collection2) {
- if (predicate(value, index2, collection2)) {
- result3.push(value);
- }
- });
- return result3;
- }
- function baseFlatten(array2, depth, predicate, isStrict, result3) {
- var index2 = -1, length = array2.length;
- predicate || (predicate = isFlattenable);
- result3 || (result3 = []);
- while (++index2 < length) {
- var value = array2[index2];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- baseFlatten(value, depth - 1, predicate, isStrict, result3);
- } else {
- arrayPush(result3, value);
- }
- } else if (!isStrict) {
- result3[result3.length] = value;
- }
- }
- return result3;
- }
- var baseFor = createBaseFor();
- var baseForRight = createBaseFor(true);
- function baseForOwn(object2, iteratee2) {
- return object2 && baseFor(object2, iteratee2, keys);
- }
- function baseForOwnRight(object2, iteratee2) {
- return object2 && baseForRight(object2, iteratee2, keys);
- }
- function baseFunctions(object2, props) {
- return arrayFilter(props, function(key) {
- return isFunction2(object2[key]);
- });
- }
- function baseGet(object2, path) {
- path = castPath(path, object2);
- var index2 = 0, length = path.length;
- while (object2 != null && index2 < length) {
- object2 = object2[toKey(path[index2++])];
- }
- return index2 && index2 == length ? object2 : undefined$1;
- }
- function baseGetAllKeys(object2, keysFunc, symbolsFunc) {
- var result3 = keysFunc(object2);
- return isArray2(object2) ? result3 : arrayPush(result3, symbolsFunc(object2));
- }
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined$1 ? undefinedTag : nullTag;
- }
- return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString2(value);
- }
- function baseGt(value, other) {
- return value > other;
- }
- function baseHas(object2, key) {
- return object2 != null && hasOwnProperty2.call(object2, key);
- }
- function baseHasIn(object2, key) {
- return object2 != null && key in Object2(object2);
- }
- function baseInRange(number2, start, end) {
- return number2 >= nativeMin(start, end) && number2 < nativeMax(start, end);
- }
- function baseIntersection(arrays, iteratee2, comparator) {
- var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result3 = [];
- while (othIndex--) {
- var array2 = arrays[othIndex];
- if (othIndex && iteratee2) {
- array2 = arrayMap(array2, baseUnary(iteratee2));
- }
- maxLength = nativeMin(array2.length, maxLength);
- caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array2.length >= 120) ? new SetCache(othIndex && array2) : undefined$1;
- }
- array2 = arrays[0];
- var index2 = -1, seen = caches[0];
- outer:
- while (++index2 < length && result3.length < maxLength) {
- var value = array2[index2], computed = iteratee2 ? iteratee2(value) : value;
- value = comparator || value !== 0 ? value : 0;
- if (!(seen ? cacheHas(seen, computed) : includes2(result3, computed, comparator))) {
- othIndex = othLength;
- while (--othIndex) {
- var cache2 = caches[othIndex];
- if (!(cache2 ? cacheHas(cache2, computed) : includes2(arrays[othIndex], computed, comparator))) {
- continue outer;
- }
- }
- if (seen) {
- seen.push(computed);
- }
- result3.push(value);
- }
- }
- return result3;
- }
- function baseInverter(object2, setter, iteratee2, accumulator) {
- baseForOwn(object2, function(value, key, object3) {
- setter(accumulator, iteratee2(value), key, object3);
- });
- return accumulator;
- }
- function baseInvoke(object2, path, args) {
- path = castPath(path, object2);
- object2 = parent2(object2, path);
- var func = object2 == null ? object2 : object2[toKey(last(path))];
- return func == null ? undefined$1 : apply2(func, object2, args);
- }
- function baseIsArguments(value) {
- return isObjectLike(value) && baseGetTag(value) == argsTag;
- }
- function baseIsArrayBuffer(value) {
- return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
- }
- function baseIsDate(value) {
- return isObjectLike(value) && baseGetTag(value) == dateTag;
- }
- function baseIsEqual(value, other, bitmask, customizer, stack) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
- }
- function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = isArray2(object2), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag(object2), othTag = othIsArr ? arrayTag : getTag(other);
- objTag = objTag == argsTag ? objectTag : objTag;
- othTag = othTag == argsTag ? objectTag : othTag;
- var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
- if (isSameTag && isBuffer2(object2)) {
- if (!isBuffer2(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack || (stack = new Stack());
- return objIsArr || isTypedArray2(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
- var objIsWrapped = objIsObj && hasOwnProperty2.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other, "__wrapped__");
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
- stack || (stack = new Stack());
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack || (stack = new Stack());
- return equalObjects(object2, other, bitmask, customizer, equalFunc, stack);
- }
- function baseIsMap(value) {
- return isObjectLike(value) && getTag(value) == mapTag;
- }
- function baseIsMatch(object2, source, matchData, customizer) {
- var index2 = matchData.length, length = index2, noCustomizer = !customizer;
- if (object2 == null) {
- return !length;
- }
- object2 = Object2(object2);
- while (index2--) {
- var data = matchData[index2];
- if (noCustomizer && data[2] ? data[1] !== object2[data[0]] : !(data[0] in object2)) {
- return false;
- }
- }
- while (++index2 < length) {
- data = matchData[index2];
- var key = data[0], objValue = object2[key], srcValue = data[1];
- if (noCustomizer && data[2]) {
- if (objValue === undefined$1 && !(key in object2)) {
- return false;
- }
- } else {
- var stack = new Stack();
- if (customizer) {
- var result3 = customizer(objValue, srcValue, key, object2, source, stack);
- }
- if (!(result3 === undefined$1 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result3)) {
- return false;
- }
- }
- }
- return true;
- }
- function baseIsNative(value) {
- if (!isObject2(value) || isMasked(value)) {
- return false;
- }
- var pattern2 = isFunction2(value) ? reIsNative : reIsHostCtor;
- return pattern2.test(toSource(value));
- }
- function baseIsRegExp(value) {
- return isObjectLike(value) && baseGetTag(value) == regexpTag;
- }
- function baseIsSet(value) {
- return isObjectLike(value) && getTag(value) == setTag;
- }
- function baseIsTypedArray(value) {
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
- }
- function baseIteratee(value) {
- if (typeof value == "function") {
- return value;
- }
- if (value == null) {
- return identity;
- }
- if (typeof value == "object") {
- return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
- }
- return property(value);
- }
- function baseKeys(object2) {
- if (!isPrototype(object2)) {
- return nativeKeys(object2);
- }
- var result3 = [];
- for (var key in Object2(object2)) {
- if (hasOwnProperty2.call(object2, key) && key != "constructor") {
- result3.push(key);
- }
- }
- return result3;
- }
- function baseKeysIn(object2) {
- if (!isObject2(object2)) {
- return nativeKeysIn(object2);
- }
- var isProto = isPrototype(object2), result3 = [];
- for (var key in object2) {
- if (!(key == "constructor" && (isProto || !hasOwnProperty2.call(object2, key)))) {
- result3.push(key);
- }
- }
- return result3;
- }
- function baseLt(value, other) {
- return value < other;
- }
- function baseMap(collection, iteratee2) {
- var index2 = -1, result3 = isArrayLike(collection) ? Array2(collection.length) : [];
- baseEach(collection, function(value, key, collection2) {
- result3[++index2] = iteratee2(value, key, collection2);
- });
- return result3;
- }
- function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- return matchesStrictComparable(matchData[0][0], matchData[0][1]);
- }
- return function(object2) {
- return object2 === source || baseIsMatch(object2, source, matchData);
- };
- }
- function baseMatchesProperty(path, srcValue) {
- if (isKey(path) && isStrictComparable(srcValue)) {
- return matchesStrictComparable(toKey(path), srcValue);
- }
- return function(object2) {
- var objValue = get(object2, path);
- return objValue === undefined$1 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
- };
- }
- function baseMerge(object2, source, srcIndex, customizer, stack) {
- if (object2 === source) {
- return;
- }
- baseFor(source, function(srcValue, key) {
- stack || (stack = new Stack());
- if (isObject2(srcValue)) {
- baseMergeDeep(object2, source, key, srcIndex, baseMerge, customizer, stack);
- } else {
- var newValue = customizer ? customizer(safeGet(object2, key), srcValue, key + "", object2, source, stack) : undefined$1;
- if (newValue === undefined$1) {
- newValue = srcValue;
- }
- assignMergeValue(object2, key, newValue);
- }
- }, keysIn);
- }
- function baseMergeDeep(object2, source, key, srcIndex, mergeFunc, customizer, stack) {
- var objValue = safeGet(object2, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
- if (stacked) {
- assignMergeValue(object2, key, stacked);
- return;
- }
- var newValue = customizer ? customizer(objValue, srcValue, key + "", object2, source, stack) : undefined$1;
- var isCommon = newValue === undefined$1;
- if (isCommon) {
- var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer2(srcValue), isTyped = !isArr && !isBuff && isTypedArray2(srcValue);
- newValue = srcValue;
- if (isArr || isBuff || isTyped) {
- if (isArray2(objValue)) {
- newValue = objValue;
- } else if (isArrayLikeObject(objValue)) {
- newValue = copyArray(objValue);
- } else if (isBuff) {
- isCommon = false;
- newValue = cloneBuffer(srcValue, true);
- } else if (isTyped) {
- isCommon = false;
- newValue = cloneTypedArray(srcValue, true);
- } else {
- newValue = [];
- }
- } else if (isPlainObject2(srcValue) || isArguments(srcValue)) {
- newValue = objValue;
- if (isArguments(objValue)) {
- newValue = toPlainObject(objValue);
- } else if (!isObject2(objValue) || isFunction2(objValue)) {
- newValue = initCloneObject(srcValue);
- }
- } else {
- isCommon = false;
- }
- }
- if (isCommon) {
- stack.set(srcValue, newValue);
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
- stack["delete"](srcValue);
- }
- assignMergeValue(object2, key, newValue);
- }
- function baseNth(array2, n2) {
- var length = array2.length;
- if (!length) {
- return;
- }
- n2 += n2 < 0 ? length : 0;
- return isIndex(n2, length) ? array2[n2] : undefined$1;
- }
- function baseOrderBy(collection, iteratees, orders) {
- if (iteratees.length) {
- iteratees = arrayMap(iteratees, function(iteratee2) {
- if (isArray2(iteratee2)) {
- return function(value) {
- return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
- };
- }
- return iteratee2;
- });
- } else {
- iteratees = [identity];
- }
- var index2 = -1;
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- var result3 = baseMap(collection, function(value, key, collection2) {
- var criteria = arrayMap(iteratees, function(iteratee2) {
- return iteratee2(value);
- });
- return { "criteria": criteria, "index": ++index2, "value": value };
- });
- return baseSortBy(result3, function(object2, other) {
- return compareMultiple(object2, other, orders);
- });
- }
- function basePick(object2, paths) {
- return basePickBy(object2, paths, function(value, path) {
- return hasIn(object2, path);
- });
- }
- function basePickBy(object2, paths, predicate) {
- var index2 = -1, length = paths.length, result3 = {};
- while (++index2 < length) {
- var path = paths[index2], value = baseGet(object2, path);
- if (predicate(value, path)) {
- baseSet(result3, castPath(path, object2), value);
- }
- }
- return result3;
- }
- function basePropertyDeep(path) {
- return function(object2) {
- return baseGet(object2, path);
- };
- }
- function basePullAll(array2, values2, iteratee2, comparator) {
- var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index2 = -1, length = values2.length, seen = array2;
- if (array2 === values2) {
- values2 = copyArray(values2);
- }
- if (iteratee2) {
- seen = arrayMap(array2, baseUnary(iteratee2));
- }
- while (++index2 < length) {
- var fromIndex = 0, value = values2[index2], computed = iteratee2 ? iteratee2(value) : value;
- while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
- if (seen !== array2) {
- splice.call(seen, fromIndex, 1);
- }
- splice.call(array2, fromIndex, 1);
- }
- }
- return array2;
- }
- function basePullAt(array2, indexes) {
- var length = array2 ? indexes.length : 0, lastIndex = length - 1;
- while (length--) {
- var index2 = indexes[length];
- if (length == lastIndex || index2 !== previous) {
- var previous = index2;
- if (isIndex(index2)) {
- splice.call(array2, index2, 1);
- } else {
- baseUnset(array2, index2);
- }
- }
- }
- return array2;
- }
- function baseRandom(lower, upper) {
- return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
- }
- function baseRange(start, end, step, fromRight) {
- var index2 = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result3 = Array2(length);
- while (length--) {
- result3[fromRight ? length : ++index2] = start;
- start += step;
- }
- return result3;
- }
- function baseRepeat(string, n2) {
- var result3 = "";
- if (!string || n2 < 1 || n2 > MAX_SAFE_INTEGER) {
- return result3;
- }
- do {
- if (n2 % 2) {
- result3 += string;
- }
- n2 = nativeFloor(n2 / 2);
- if (n2) {
- string += string;
- }
- } while (n2);
- return result3;
- }
- function baseRest(func, start) {
- return setToString(overRest(func, start, identity), func + "");
- }
- function baseSample(collection) {
- return arraySample(values(collection));
- }
- function baseSampleSize(collection, n2) {
- var array2 = values(collection);
- return shuffleSelf(array2, baseClamp(n2, 0, array2.length));
- }
- function baseSet(object2, path, value, customizer) {
- if (!isObject2(object2)) {
- return object2;
- }
- path = castPath(path, object2);
- var index2 = -1, length = path.length, lastIndex = length - 1, nested = object2;
- while (nested != null && ++index2 < length) {
- var key = toKey(path[index2]), newValue = value;
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
- return object2;
- }
- if (index2 != lastIndex) {
- var objValue = nested[key];
- newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
- if (newValue === undefined$1) {
- newValue = isObject2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
- }
- }
- assignValue(nested, key, newValue);
- nested = nested[key];
- }
- return object2;
- }
- var baseSetData = !metaMap ? identity : function(func, data) {
- metaMap.set(func, data);
- return func;
- };
- var baseSetToString = !defineProperty ? identity : function(func, string) {
- return defineProperty(func, "toString", {
- "configurable": true,
- "enumerable": false,
- "value": constant(string),
- "writable": true
- });
- };
- function baseShuffle(collection) {
- return shuffleSelf(values(collection));
- }
- function baseSlice(array2, start, end) {
- var index2 = -1, length = array2.length;
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : end - start >>> 0;
- start >>>= 0;
- var result3 = Array2(length);
- while (++index2 < length) {
- result3[index2] = array2[index2 + start];
- }
- return result3;
- }
- function baseSome(collection, predicate) {
- var result3;
- baseEach(collection, function(value, index2, collection2) {
- result3 = predicate(value, index2, collection2);
- return !result3;
- });
- return !!result3;
- }
- function baseSortedIndex(array2, value, retHighest) {
- var low = 0, high = array2 == null ? low : array2.length;
- if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = low + high >>> 1, computed = array2[mid];
- if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return baseSortedIndexBy(array2, value, identity, retHighest);
- }
- function baseSortedIndexBy(array2, value, iteratee2, retHighest) {
- var low = 0, high = array2 == null ? 0 : array2.length;
- if (high === 0) {
- return 0;
- }
- value = iteratee2(value);
- var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined$1;
- while (low < high) {
- var mid = nativeFloor((low + high) / 2), computed = iteratee2(array2[mid]), othIsDefined = computed !== undefined$1, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
- if (valIsNaN) {
- var setLow = retHighest || othIsReflexive;
- } else if (valIsUndefined) {
- setLow = othIsReflexive && (retHighest || othIsDefined);
- } else if (valIsNull) {
- setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
- } else if (valIsSymbol) {
- setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
- } else if (othIsNull || othIsSymbol) {
- setLow = false;
- } else {
- setLow = retHighest ? computed <= value : computed < value;
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
- function baseSortedUniq(array2, iteratee2) {
- var index2 = -1, length = array2.length, resIndex = 0, result3 = [];
- while (++index2 < length) {
- var value = array2[index2], computed = iteratee2 ? iteratee2(value) : value;
- if (!index2 || !eq(computed, seen)) {
- var seen = computed;
- result3[resIndex++] = value === 0 ? 0 : value;
- }
- }
- return result3;
- }
- function baseToNumber(value) {
- if (typeof value == "number") {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- return +value;
- }
- function baseToString(value) {
- if (typeof value == "string") {
- return value;
- }
- if (isArray2(value)) {
- return arrayMap(value, baseToString) + "";
- }
- if (isSymbol(value)) {
- return symbolToString ? symbolToString.call(value) : "";
- }
- var result3 = value + "";
- return result3 == "0" && 1 / value == -INFINITY ? "-0" : result3;
- }
- function baseUniq(array2, iteratee2, comparator) {
- var index2 = -1, includes2 = arrayIncludes, length = array2.length, isCommon = true, result3 = [], seen = result3;
- if (comparator) {
- isCommon = false;
- includes2 = arrayIncludesWith;
- } else if (length >= LARGE_ARRAY_SIZE) {
- var set3 = iteratee2 ? null : createSet(array2);
- if (set3) {
- return setToArray(set3);
- }
- isCommon = false;
- includes2 = cacheHas;
- seen = new SetCache();
- } else {
- seen = iteratee2 ? [] : result3;
- }
- outer:
- while (++index2 < length) {
- var value = array2[index2], computed = iteratee2 ? iteratee2(value) : value;
- value = comparator || value !== 0 ? value : 0;
- if (isCommon && computed === computed) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee2) {
- seen.push(computed);
- }
- result3.push(value);
- } else if (!includes2(seen, computed, comparator)) {
- if (seen !== result3) {
- seen.push(computed);
- }
- result3.push(value);
- }
- }
- return result3;
- }
- function baseUnset(object2, path) {
- path = castPath(path, object2);
- object2 = parent2(object2, path);
- return object2 == null || delete object2[toKey(last(path))];
- }
- function baseUpdate(object2, path, updater, customizer) {
- return baseSet(object2, path, updater(baseGet(object2, path)), customizer);
- }
- function baseWhile(array2, predicate, isDrop, fromRight) {
- var length = array2.length, index2 = fromRight ? length : -1;
- while ((fromRight ? index2-- : ++index2 < length) && predicate(array2[index2], index2, array2)) {
- }
- return isDrop ? baseSlice(array2, fromRight ? 0 : index2, fromRight ? index2 + 1 : length) : baseSlice(array2, fromRight ? index2 + 1 : 0, fromRight ? length : index2);
- }
- function baseWrapperValue(value, actions) {
- var result3 = value;
- if (result3 instanceof LazyWrapper) {
- result3 = result3.value();
- }
- return arrayReduce(actions, function(result4, action) {
- return action.func.apply(action.thisArg, arrayPush([result4], action.args));
- }, result3);
- }
- function baseXor(arrays, iteratee2, comparator) {
- var length = arrays.length;
- if (length < 2) {
- return length ? baseUniq(arrays[0]) : [];
- }
- var index2 = -1, result3 = Array2(length);
- while (++index2 < length) {
- var array2 = arrays[index2], othIndex = -1;
- while (++othIndex < length) {
- if (othIndex != index2) {
- result3[index2] = baseDifference(result3[index2] || array2, arrays[othIndex], iteratee2, comparator);
- }
- }
- }
- return baseUniq(baseFlatten(result3, 1), iteratee2, comparator);
- }
- function baseZipObject(props, values2, assignFunc) {
- var index2 = -1, length = props.length, valsLength = values2.length, result3 = {};
- while (++index2 < length) {
- var value = index2 < valsLength ? values2[index2] : undefined$1;
- assignFunc(result3, props[index2], value);
- }
- return result3;
- }
- function castArrayLikeObject(value) {
- return isArrayLikeObject(value) ? value : [];
- }
- function castFunction(value) {
- return typeof value == "function" ? value : identity;
- }
- function castPath(value, object2) {
- if (isArray2(value)) {
- return value;
- }
- return isKey(value, object2) ? [value] : stringToPath(toString2(value));
- }
- var castRest = baseRest;
- function castSlice(array2, start, end) {
- var length = array2.length;
- end = end === undefined$1 ? length : end;
- return !start && end >= length ? array2 : baseSlice(array2, start, end);
- }
- var clearTimeout2 = ctxClearTimeout || function(id) {
- return root.clearTimeout(id);
- };
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var length = buffer.length, result3 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
- buffer.copy(result3);
- return result3;
- }
- function cloneArrayBuffer(arrayBuffer) {
- var result3 = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array2(result3).set(new Uint8Array2(arrayBuffer));
- return result3;
- }
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
- function cloneRegExp(regexp) {
- var result3 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result3.lastIndex = regexp.lastIndex;
- return result3;
- }
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
- }
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
- function compareAscending(value, other) {
- if (value !== other) {
- var valIsDefined = value !== undefined$1, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
- var othIsDefined = other !== undefined$1, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
- if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
- return 1;
- }
- if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
- return -1;
- }
- }
- return 0;
- }
- function compareMultiple(object2, other, orders) {
- var index2 = -1, objCriteria = object2.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
- while (++index2 < length) {
- var result3 = compareAscending(objCriteria[index2], othCriteria[index2]);
- if (result3) {
- if (index2 >= ordersLength) {
- return result3;
- }
- var order2 = orders[index2];
- return result3 * (order2 == "desc" ? -1 : 1);
- }
- }
- return object2.index - other.index;
- }
- function composeArgs(args, partials, holders, isCurried) {
- var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength2 = nativeMax(argsLength - holdersLength, 0), result3 = Array2(leftLength + rangeLength2), isUncurried = !isCurried;
- while (++leftIndex < leftLength) {
- result3[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result3[holders[argsIndex]] = args[argsIndex];
- }
- }
- while (rangeLength2--) {
- result3[leftIndex++] = args[argsIndex++];
- }
- return result3;
- }
- function composeArgsRight(args, partials, holders, isCurried) {
- var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength2 = nativeMax(argsLength - holdersLength, 0), result3 = Array2(rangeLength2 + rightLength), isUncurried = !isCurried;
- while (++argsIndex < rangeLength2) {
- result3[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result3[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result3[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- }
- return result3;
- }
- function copyArray(source, array2) {
- var index2 = -1, length = source.length;
- array2 || (array2 = Array2(length));
- while (++index2 < length) {
- array2[index2] = source[index2];
- }
- return array2;
- }
- function copyObject(source, props, object2, customizer) {
- var isNew = !object2;
- object2 || (object2 = {});
- var index2 = -1, length = props.length;
- while (++index2 < length) {
- var key = props[index2];
- var newValue = customizer ? customizer(object2[key], source[key], key, object2, source) : undefined$1;
- if (newValue === undefined$1) {
- newValue = source[key];
- }
- if (isNew) {
- baseAssignValue(object2, key, newValue);
- } else {
- assignValue(object2, key, newValue);
- }
- }
- return object2;
- }
- function copySymbols(source, object2) {
- return copyObject(source, getSymbols(source), object2);
- }
- function copySymbolsIn(source, object2) {
- return copyObject(source, getSymbolsIn(source), object2);
- }
- function createAggregator(setter, initializer) {
- return function(collection, iteratee2) {
- var func = isArray2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
- return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
- };
- }
- function createAssigner(assigner) {
- return baseRest(function(object2, sources) {
- var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined$1, guard = length > 2 ? sources[2] : undefined$1;
- customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined$1;
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined$1 : customizer;
- length = 1;
- }
- object2 = Object2(object2);
- while (++index2 < length) {
- var source = sources[index2];
- if (source) {
- assigner(object2, source, index2, customizer);
- }
- }
- return object2;
- });
- }
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee2) {
- if (collection == null) {
- return collection;
- }
- if (!isArrayLike(collection)) {
- return eachFunc(collection, iteratee2);
- }
- var length = collection.length, index2 = fromRight ? length : -1, iterable = Object2(collection);
- while (fromRight ? index2-- : ++index2 < length) {
- if (iteratee2(iterable[index2], index2, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
- function createBaseFor(fromRight) {
- return function(object2, iteratee2, keysFunc) {
- var index2 = -1, iterable = Object2(object2), props = keysFunc(object2), length = props.length;
- while (length--) {
- var key = props[fromRight ? length : ++index2];
- if (iteratee2(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object2;
- };
- }
- function createBind(func, bitmask, thisArg) {
- var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
- function wrapper() {
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, arguments);
- }
- return wrapper;
- }
- function createCaseFirst(methodName) {
- return function(string) {
- string = toString2(string);
- var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined$1;
- var chr = strSymbols ? strSymbols[0] : string.charAt(0);
- var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
- return chr[methodName]() + trailing;
- };
- }
- function createCompounder(callback) {
- return function(string) {
- return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
- };
- }
- function createCtor(Ctor) {
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0:
- return new Ctor();
- case 1:
- return new Ctor(args[0]);
- case 2:
- return new Ctor(args[0], args[1]);
- case 3:
- return new Ctor(args[0], args[1], args[2]);
- case 4:
- return new Ctor(args[0], args[1], args[2], args[3]);
- case 5:
- return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = baseCreate(Ctor.prototype), result3 = Ctor.apply(thisBinding, args);
- return isObject2(result3) ? result3 : thisBinding;
- };
- }
- function createCurry(func, bitmask, arity) {
- var Ctor = createCtor(func);
- function wrapper() {
- var length = arguments.length, args = Array2(length), index2 = length, placeholder = getHolder(wrapper);
- while (index2--) {
- args[index2] = arguments[index2];
- }
- var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
- length -= holders.length;
- if (length < arity) {
- return createRecurry(
- func,
- bitmask,
- createHybrid,
- wrapper.placeholder,
- undefined$1,
- args,
- holders,
- undefined$1,
- undefined$1,
- arity - length
- );
- }
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- return apply2(fn, this, args);
- }
- return wrapper;
- }
- function createFind(findIndexFunc) {
- return function(collection, predicate, fromIndex) {
- var iterable = Object2(collection);
- if (!isArrayLike(collection)) {
- var iteratee2 = getIteratee(predicate, 3);
- collection = keys(collection);
- predicate = function(key) {
- return iteratee2(iterable[key], key, iterable);
- };
- }
- var index2 = findIndexFunc(collection, predicate, fromIndex);
- return index2 > -1 ? iterable[iteratee2 ? collection[index2] : index2] : undefined$1;
- };
- }
- function createFlow(fromRight) {
- return flatRest(function(funcs) {
- var length = funcs.length, index2 = length, prereq = LodashWrapper.prototype.thru;
- if (fromRight) {
- funcs.reverse();
- }
- while (index2--) {
- var func = funcs[index2];
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- if (prereq && !wrapper && getFuncName(func) == "wrapper") {
- var wrapper = new LodashWrapper([], true);
- }
- }
- index2 = wrapper ? index2 : length;
- while (++index2 < length) {
- func = funcs[index2];
- var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined$1;
- if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
- wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments, value = args[0];
- if (wrapper && args.length == 1 && isArray2(value)) {
- return wrapper.plant(value).value();
- }
- var index3 = 0, result3 = length ? funcs[index3].apply(this, args) : value;
- while (++index3 < length) {
- result3 = funcs[index3].call(this, result3);
- }
- return result3;
- };
- });
- }
- function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
- var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined$1 : createCtor(func);
- function wrapper() {
- var length = arguments.length, args = Array2(length), index2 = length;
- while (index2--) {
- args[index2] = arguments[index2];
- }
- if (isCurried) {
- var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
- }
- if (partials) {
- args = composeArgs(args, partials, holders, isCurried);
- }
- if (partialsRight) {
- args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
- }
- length -= holdersCount;
- if (isCurried && length < arity) {
- var newHolders = replaceHolders(args, placeholder);
- return createRecurry(
- func,
- bitmask,
- createHybrid,
- wrapper.placeholder,
- thisArg,
- args,
- newHolders,
- argPos,
- ary2,
- arity - length
- );
- }
- var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
- length = args.length;
- if (argPos) {
- args = reorder(args, argPos);
- } else if (isFlip && length > 1) {
- args.reverse();
- }
- if (isAry && ary2 < length) {
- args.length = ary2;
- }
- if (this && this !== root && this instanceof wrapper) {
- fn = Ctor || createCtor(fn);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
- function createInverter(setter, toIteratee) {
- return function(object2, iteratee2) {
- return baseInverter(object2, setter, toIteratee(iteratee2), {});
- };
- }
- function createMathOperation(operator, defaultValue) {
- return function(value, other) {
- var result3;
- if (value === undefined$1 && other === undefined$1) {
- return defaultValue;
- }
- if (value !== undefined$1) {
- result3 = value;
- }
- if (other !== undefined$1) {
- if (result3 === undefined$1) {
- return other;
- }
- if (typeof value == "string" || typeof other == "string") {
- value = baseToString(value);
- other = baseToString(other);
- } else {
- value = baseToNumber(value);
- other = baseToNumber(other);
- }
- result3 = operator(value, other);
- }
- return result3;
- };
- }
- function createOver(arrayFunc) {
- return flatRest(function(iteratees) {
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- return baseRest(function(args) {
- var thisArg = this;
- return arrayFunc(iteratees, function(iteratee2) {
- return apply2(iteratee2, thisArg, args);
- });
- });
- });
- }
- function createPadding(length, chars) {
- chars = chars === undefined$1 ? " " : baseToString(chars);
- var charsLength = chars.length;
- if (charsLength < 2) {
- return charsLength ? baseRepeat(chars, length) : chars;
- }
- var result3 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
- return hasUnicode(chars) ? castSlice(stringToArray(result3), 0, length).join("") : result3.slice(0, length);
- }
- function createPartial(func, bitmask, thisArg, partials) {
- var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
- function wrapper() {
- var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- return apply2(fn, isBind ? thisArg : this, args);
- }
- return wrapper;
- }
- function createRange(fromRight) {
- return function(start, end, step) {
- if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
- end = step = undefined$1;
- }
- start = toFinite(start);
- if (end === undefined$1) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- step = step === undefined$1 ? start < end ? 1 : -1 : toFinite(step);
- return baseRange(start, end, step, fromRight);
- };
- }
- function createRelationalOperation(operator) {
- return function(value, other) {
- if (!(typeof value == "string" && typeof other == "string")) {
- value = toNumber(value);
- other = toNumber(other);
- }
- return operator(value, other);
- };
- }
- function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
- var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined$1, newHoldersRight = isCurry ? undefined$1 : holders, newPartials = isCurry ? partials : undefined$1, newPartialsRight = isCurry ? undefined$1 : partials;
- bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
- bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
- if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
- bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
- }
- var newData = [
- func,
- bitmask,
- thisArg,
- newPartials,
- newHolders,
- newPartialsRight,
- newHoldersRight,
- argPos,
- ary2,
- arity
- ];
- var result3 = wrapFunc.apply(undefined$1, newData);
- if (isLaziable(func)) {
- setData(result3, newData);
- }
- result3.placeholder = placeholder;
- return setWrapToString(result3, func, bitmask);
- }
- function createRound(methodName) {
- var func = Math2[methodName];
- return function(number2, precision) {
- number2 = toNumber(number2);
- precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
- if (precision && nativeIsFinite(number2)) {
- var pair = (toString2(number2) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
- pair = (toString2(value) + "e").split("e");
- return +(pair[0] + "e" + (+pair[1] - precision));
- }
- return func(number2);
- };
- }
- var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values2) {
- return new Set2(values2);
- };
- function createToPairs(keysFunc) {
- return function(object2) {
- var tag = getTag(object2);
- if (tag == mapTag) {
- return mapToArray(object2);
- }
- if (tag == setTag) {
- return setToPairs(object2);
- }
- return baseToPairs(object2, keysFunc(object2));
- };
- }
- function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
- var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
- if (!isBindKey && typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
- partials = holders = undefined$1;
- }
- ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0);
- arity = arity === undefined$1 ? arity : toInteger(arity);
- length -= holders ? holders.length : 0;
- if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials, holdersRight = holders;
- partials = holders = undefined$1;
- }
- var data = isBindKey ? undefined$1 : getData(func);
- var newData = [
- func,
- bitmask,
- thisArg,
- partials,
- holders,
- partialsRight,
- holdersRight,
- argPos,
- ary2,
- arity
- ];
- if (data) {
- mergeData(newData, data);
- }
- func = newData[0];
- bitmask = newData[1];
- thisArg = newData[2];
- partials = newData[3];
- holders = newData[4];
- arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
- if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
- bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
- }
- if (!bitmask || bitmask == WRAP_BIND_FLAG) {
- var result3 = createBind(func, bitmask, thisArg);
- } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
- result3 = createCurry(func, bitmask, arity);
- } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
- result3 = createPartial(func, bitmask, thisArg, partials);
- } else {
- result3 = createHybrid.apply(undefined$1, newData);
- }
- var setter = data ? baseSetData : setData;
- return setWrapToString(setter(result3, newData), func, bitmask);
- }
- function customDefaultsAssignIn(objValue, srcValue, key, object2) {
- if (objValue === undefined$1 || eq(objValue, objectProto[key]) && !hasOwnProperty2.call(object2, key)) {
- return srcValue;
- }
- return objValue;
- }
- function customDefaultsMerge(objValue, srcValue, key, object2, source, stack) {
- if (isObject2(objValue) && isObject2(srcValue)) {
- stack.set(srcValue, objValue);
- baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack);
- stack["delete"](srcValue);
- }
- return objValue;
- }
- function customOmitClone(value) {
- return isPlainObject2(value) ? undefined$1 : value;
- }
- function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length;
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- var arrStacked = stack.get(array2);
- var othStacked = stack.get(other);
- if (arrStacked && othStacked) {
- return arrStacked == other && othStacked == array2;
- }
- var index2 = -1, result3 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1;
- stack.set(array2, other);
- stack.set(other, array2);
- while (++index2 < arrLength) {
- var arrValue = array2[index2], othValue = other[index2];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack);
- }
- if (compared !== undefined$1) {
- if (compared) {
- continue;
- }
- result3 = false;
- break;
- }
- if (seen) {
- if (!arraySome(other, function(othValue2, othIndex) {
- if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
- return seen.push(othIndex);
- }
- })) {
- result3 = false;
- break;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- result3 = false;
- break;
- }
- }
- stack["delete"](array2);
- stack["delete"](other);
- return result3;
- }
- function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack) {
- switch (tag) {
- case dataViewTag:
- if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) {
- return false;
- }
- object2 = object2.buffer;
- other = other.buffer;
- case arrayBufferTag:
- if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object2), new Uint8Array2(other))) {
- return false;
- }
- return true;
- case boolTag:
- case dateTag:
- case numberTag:
- return eq(+object2, +other);
- case errorTag:
- return object2.name == other.name && object2.message == other.message;
- case regexpTag:
- case stringTag:
- return object2 == other + "";
- case mapTag:
- var convert = mapToArray;
- case setTag:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
- convert || (convert = setToArray);
- if (object2.size != other.size && !isPartial) {
- return false;
- }
- var stacked = stack.get(object2);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG;
- stack.set(object2, other);
- var result3 = equalArrays(convert(object2), convert(other), bitmask, customizer, equalFunc, stack);
- stack["delete"](object2);
- return result3;
- case symbolTag:
- if (symbolValueOf) {
- return symbolValueOf.call(object2) == symbolValueOf.call(other);
- }
- }
- return false;
- }
- function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index2 = objLength;
- while (index2--) {
- var key = objProps[index2];
- if (!(isPartial ? key in other : hasOwnProperty2.call(other, key))) {
- return false;
- }
- }
- var objStacked = stack.get(object2);
- var othStacked = stack.get(other);
- if (objStacked && othStacked) {
- return objStacked == other && othStacked == object2;
- }
- var result3 = true;
- stack.set(object2, other);
- stack.set(other, object2);
- var skipCtor = isPartial;
- while (++index2 < objLength) {
- key = objProps[index2];
- var objValue = object2[key], othValue = other[key];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack);
- }
- if (!(compared === undefined$1 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
- result3 = false;
- break;
- }
- skipCtor || (skipCtor = key == "constructor");
- }
- if (result3 && !skipCtor) {
- var objCtor = object2.constructor, othCtor = other.constructor;
- if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
- result3 = false;
- }
- }
- stack["delete"](object2);
- stack["delete"](other);
- return result3;
- }
- function flatRest(func) {
- return setToString(overRest(func, undefined$1, flatten), func + "");
- }
- function getAllKeys(object2) {
- return baseGetAllKeys(object2, keys, getSymbols);
- }
- function getAllKeysIn(object2) {
- return baseGetAllKeys(object2, keysIn, getSymbolsIn);
- }
- var getData = !metaMap ? noop2 : function(func) {
- return metaMap.get(func);
- };
- function getFuncName(func) {
- var result3 = func.name + "", array2 = realNames[result3], length = hasOwnProperty2.call(realNames, result3) ? array2.length : 0;
- while (length--) {
- var data = array2[length], otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result3;
- }
- function getHolder(func) {
- var object2 = hasOwnProperty2.call(lodash2, "placeholder") ? lodash2 : func;
- return object2.placeholder;
- }
- function getIteratee() {
- var result3 = lodash2.iteratee || iteratee;
- result3 = result3 === iteratee ? baseIteratee : result3;
- return arguments.length ? result3(arguments[0], arguments[1]) : result3;
- }
- function getMapData(map2, key) {
- var data = map2.__data__;
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
- }
- function getMatchData(object2) {
- var result3 = keys(object2), length = result3.length;
- while (length--) {
- var key = result3[length], value = object2[key];
- result3[length] = [key, value, isStrictComparable(value)];
- }
- return result3;
- }
- function getNative(object2, key) {
- var value = getValue(object2, key);
- return baseIsNative(value) ? value : undefined$1;
- }
- function getRawTag(value) {
- var isOwn = hasOwnProperty2.call(value, symToStringTag), tag = value[symToStringTag];
- try {
- value[symToStringTag] = undefined$1;
- var unmasked = true;
- } catch (e2) {
- }
- var result3 = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result3;
- }
- var getSymbols = !nativeGetSymbols ? stubArray : function(object2) {
- if (object2 == null) {
- return [];
- }
- object2 = Object2(object2);
- return arrayFilter(nativeGetSymbols(object2), function(symbol) {
- return propertyIsEnumerable.call(object2, symbol);
- });
- };
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object2) {
- var result3 = [];
- while (object2) {
- arrayPush(result3, getSymbols(object2));
- object2 = getPrototype(object2);
- }
- return result3;
- };
- var getTag = baseGetTag;
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
- getTag = function(value) {
- var result3 = baseGetTag(value), Ctor = result3 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag;
- case mapCtorString:
- return mapTag;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag;
- case weakMapCtorString:
- return weakMapTag;
- }
- }
- return result3;
- };
- }
- function getView(start, end, transforms) {
- var index2 = -1, length = transforms.length;
- while (++index2 < length) {
- var data = transforms[index2], size2 = data.size;
- switch (data.type) {
- case "drop":
- start += size2;
- break;
- case "dropRight":
- end -= size2;
- break;
- case "take":
- end = nativeMin(end, start + size2);
- break;
- case "takeRight":
- start = nativeMax(start, end - size2);
- break;
- }
- }
- return { "start": start, "end": end };
- }
- function getWrapDetails(source) {
- var match = source.match(reWrapDetails);
- return match ? match[1].split(reSplitDetails) : [];
- }
- function hasPath(object2, path, hasFunc) {
- path = castPath(path, object2);
- var index2 = -1, length = path.length, result3 = false;
- while (++index2 < length) {
- var key = toKey(path[index2]);
- if (!(result3 = object2 != null && hasFunc(object2, key))) {
- break;
- }
- object2 = object2[key];
- }
- if (result3 || ++index2 != length) {
- return result3;
- }
- length = object2 == null ? 0 : object2.length;
- return !!length && isLength(length) && isIndex(key, length) && (isArray2(object2) || isArguments(object2));
- }
- function initCloneArray(array2) {
- var length = array2.length, result3 = new array2.constructor(length);
- if (length && typeof array2[0] == "string" && hasOwnProperty2.call(array2, "index")) {
- result3.index = array2.index;
- result3.input = array2.input;
- }
- return result3;
- }
- function initCloneObject(object2) {
- return typeof object2.constructor == "function" && !isPrototype(object2) ? baseCreate(getPrototype(object2)) : {};
- }
- function initCloneByTag(object2, tag, isDeep) {
- var Ctor = object2.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object2);
- case boolTag:
- case dateTag:
- return new Ctor(+object2);
- case dataViewTag:
- return cloneDataView(object2, isDeep);
- case float32Tag:
- case float64Tag:
- case int8Tag:
- case int16Tag:
- case int32Tag:
- case uint8Tag:
- case uint8ClampedTag:
- case uint16Tag:
- case uint32Tag:
- return cloneTypedArray(object2, isDeep);
- case mapTag:
- return new Ctor();
- case numberTag:
- case stringTag:
- return new Ctor(object2);
- case regexpTag:
- return cloneRegExp(object2);
- case setTag:
- return new Ctor();
- case symbolTag:
- return cloneSymbol(object2);
- }
- }
- function insertWrapDetails(source, details) {
- var length = details.length;
- if (!length) {
- return source;
- }
- var lastIndex = length - 1;
- details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
- details = details.join(length > 2 ? ", " : " ");
- return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
- }
- function isFlattenable(value) {
- return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
- function isIndex(value, length) {
- var type = typeof value;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
- }
- function isIterateeCall(value, index2, object2) {
- if (!isObject2(object2)) {
- return false;
- }
- var type = typeof index2;
- if (type == "number" ? isArrayLike(object2) && isIndex(index2, object2.length) : type == "string" && index2 in object2) {
- return eq(object2[index2], value);
- }
- return false;
- }
- function isKey(value, object2) {
- if (isArray2(value)) {
- return false;
- }
- var type = typeof value;
- if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object2 != null && value in Object2(object2);
- }
- function isKeyable(value) {
- var type = typeof value;
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
- }
- function isLaziable(func) {
- var funcName = getFuncName(func), other = lodash2[funcName];
- if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
- return false;
- }
- if (func === other) {
- return true;
- }
- var data = getData(other);
- return !!data && func === data[0];
- }
- function isMasked(func) {
- return !!maskSrcKey && maskSrcKey in func;
- }
- var isMaskable = coreJsData ? isFunction2 : stubFalse;
- function isPrototype(value) {
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
- return value === proto;
- }
- function isStrictComparable(value) {
- return value === value && !isObject2(value);
- }
- function matchesStrictComparable(key, srcValue) {
- return function(object2) {
- if (object2 == null) {
- return false;
- }
- return object2[key] === srcValue && (srcValue !== undefined$1 || key in Object2(object2));
- };
- }
- function memoizeCapped(func) {
- var result3 = memoize(func, function(key) {
- if (cache2.size === MAX_MEMOIZE_SIZE) {
- cache2.clear();
- }
- return key;
- });
- var cache2 = result3.cache;
- return result3;
- }
- function mergeData(data, source) {
- var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
- var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
- if (!(isCommon || isCombo)) {
- return data;
- }
- if (srcBitmask & WRAP_BIND_FLAG) {
- data[2] = source[2];
- newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
- }
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? composeArgs(partials, value, source[4]) : value;
- data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
- }
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
- data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
- }
- value = source[7];
- if (value) {
- data[7] = value;
- }
- if (srcBitmask & WRAP_ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- if (data[9] == null) {
- data[9] = source[9];
- }
- data[0] = source[0];
- data[1] = newBitmask;
- return data;
- }
- function nativeKeysIn(object2) {
- var result3 = [];
- if (object2 != null) {
- for (var key in Object2(object2)) {
- result3.push(key);
- }
- }
- return result3;
- }
- function objectToString2(value) {
- return nativeObjectToString.call(value);
- }
- function overRest(func, start, transform2) {
- start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0);
- return function() {
- var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array2 = Array2(length);
- while (++index2 < length) {
- array2[index2] = args[start + index2];
- }
- index2 = -1;
- var otherArgs = Array2(start + 1);
- while (++index2 < start) {
- otherArgs[index2] = args[index2];
- }
- otherArgs[start] = transform2(array2);
- return apply2(func, this, otherArgs);
- };
- }
- function parent2(object2, path) {
- return path.length < 2 ? object2 : baseGet(object2, baseSlice(path, 0, -1));
- }
- function reorder(array2, indexes) {
- var arrLength = array2.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array2);
- while (length--) {
- var index2 = indexes[length];
- array2[length] = isIndex(index2, arrLength) ? oldArray[index2] : undefined$1;
- }
- return array2;
- }
- function safeGet(object2, key) {
- if (key === "constructor" && typeof object2[key] === "function") {
- return;
- }
- if (key == "__proto__") {
- return;
- }
- return object2[key];
- }
- var setData = shortOut(baseSetData);
- var setTimeout2 = ctxSetTimeout || function(func, wait) {
- return root.setTimeout(func, wait);
- };
- var setToString = shortOut(baseSetToString);
- function setWrapToString(wrapper, reference, bitmask) {
- var source = reference + "";
- return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
- }
- function shortOut(func) {
- var count = 0, lastCalled = 0;
- return function() {
- var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(undefined$1, arguments);
- };
- }
- function shuffleSelf(array2, size2) {
- var index2 = -1, length = array2.length, lastIndex = length - 1;
- size2 = size2 === undefined$1 ? length : size2;
- while (++index2 < size2) {
- var rand = baseRandom(index2, lastIndex), value = array2[rand];
- array2[rand] = array2[index2];
- array2[index2] = value;
- }
- array2.length = size2;
- return array2;
- }
- var stringToPath = memoizeCapped(function(string) {
- var result3 = [];
- if (string.charCodeAt(0) === 46) {
- result3.push("");
- }
- string.replace(rePropName, function(match, number2, quote, subString) {
- result3.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match);
- });
- return result3;
- });
- function toKey(value) {
- if (typeof value == "string" || isSymbol(value)) {
- return value;
- }
- var result3 = value + "";
- return result3 == "0" && 1 / value == -INFINITY ? "-0" : result3;
- }
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e2) {
- }
- try {
- return func + "";
- } catch (e2) {
- }
- }
- return "";
- }
- function updateWrapDetails(details, bitmask) {
- arrayEach(wrapFlags, function(pair) {
- var value = "_." + pair[0];
- if (bitmask & pair[1] && !arrayIncludes(details, value)) {
- details.push(value);
- }
- });
- return details.sort();
- }
- function wrapperClone(wrapper) {
- if (wrapper instanceof LazyWrapper) {
- return wrapper.clone();
- }
- var result3 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
- result3.__actions__ = copyArray(wrapper.__actions__);
- result3.__index__ = wrapper.__index__;
- result3.__values__ = wrapper.__values__;
- return result3;
- }
- function chunk(array2, size2, guard) {
- if (guard ? isIterateeCall(array2, size2, guard) : size2 === undefined$1) {
- size2 = 1;
- } else {
- size2 = nativeMax(toInteger(size2), 0);
- }
- var length = array2 == null ? 0 : array2.length;
- if (!length || size2 < 1) {
- return [];
- }
- var index2 = 0, resIndex = 0, result3 = Array2(nativeCeil(length / size2));
- while (index2 < length) {
- result3[resIndex++] = baseSlice(array2, index2, index2 += size2);
- }
- return result3;
- }
- function compact(array2) {
- var index2 = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result3 = [];
- while (++index2 < length) {
- var value = array2[index2];
- if (value) {
- result3[resIndex++] = value;
- }
- }
- return result3;
- }
- function concat() {
- var length = arguments.length;
- if (!length) {
- return [];
- }
- var args = Array2(length - 1), array2 = arguments[0], index2 = length;
- while (index2--) {
- args[index2 - 1] = arguments[index2];
- }
- return arrayPush(isArray2(array2) ? copyArray(array2) : [array2], baseFlatten(args, 1));
- }
- var difference = baseRest(function(array2, values2) {
- return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
- });
- var differenceBy = baseRest(function(array2, values2) {
- var iteratee2 = last(values2);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
- });
- var differenceWith = baseRest(function(array2, values2) {
- var comparator = last(values2);
- if (isArrayLikeObject(comparator)) {
- comparator = undefined$1;
- }
- return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values2, 1, isArrayLikeObject, true), undefined$1, comparator) : [];
- });
- function drop(array2, n2, guard) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return [];
- }
- n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
- return baseSlice(array2, n2 < 0 ? 0 : n2, length);
- }
- function dropRight(array2, n2, guard) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return [];
- }
- n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
- n2 = length - n2;
- return baseSlice(array2, 0, n2 < 0 ? 0 : n2);
- }
- function dropRightWhile(array2, predicate) {
- return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3), true, true) : [];
- }
- function dropWhile(array2, predicate) {
- return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3), true) : [];
- }
- function fill(array2, value, start, end) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return [];
- }
- if (start && typeof start != "number" && isIterateeCall(array2, value, start)) {
- start = 0;
- end = length;
- }
- return baseFill(array2, value, start, end);
- }
- function findIndex(array2, predicate, fromIndex) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return -1;
- }
- var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index2 < 0) {
- index2 = nativeMax(length + index2, 0);
- }
- return baseFindIndex(array2, getIteratee(predicate, 3), index2);
- }
- function findLastIndex(array2, predicate, fromIndex) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return -1;
- }
- var index2 = length - 1;
- if (fromIndex !== undefined$1) {
- index2 = toInteger(fromIndex);
- index2 = fromIndex < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
- }
- return baseFindIndex(array2, getIteratee(predicate, 3), index2, true);
- }
- function flatten(array2) {
- var length = array2 == null ? 0 : array2.length;
- return length ? baseFlatten(array2, 1) : [];
- }
- function flattenDeep(array2) {
- var length = array2 == null ? 0 : array2.length;
- return length ? baseFlatten(array2, INFINITY) : [];
- }
- function flattenDepth(array2, depth) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return [];
- }
- depth = depth === undefined$1 ? 1 : toInteger(depth);
- return baseFlatten(array2, depth);
- }
- function fromPairs(pairs) {
- var index2 = -1, length = pairs == null ? 0 : pairs.length, result3 = {};
- while (++index2 < length) {
- var pair = pairs[index2];
- result3[pair[0]] = pair[1];
- }
- return result3;
- }
- function head(array2) {
- return array2 && array2.length ? array2[0] : undefined$1;
- }
- function indexOf(array2, value, fromIndex) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return -1;
- }
- var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index2 < 0) {
- index2 = nativeMax(length + index2, 0);
- }
- return baseIndexOf(array2, value, index2);
- }
- function initial(array2) {
- var length = array2 == null ? 0 : array2.length;
- return length ? baseSlice(array2, 0, -1) : [];
- }
- var intersection = baseRest(function(arrays) {
- var mapped = arrayMap(arrays, castArrayLikeObject);
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
- });
- var intersectionBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
- if (iteratee2 === last(mapped)) {
- iteratee2 = undefined$1;
- } else {
- mapped.pop();
- }
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
- });
- var intersectionWith = baseRest(function(arrays) {
- var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- if (comparator) {
- mapped.pop();
- }
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined$1, comparator) : [];
- });
- function join(array2, separator) {
- return array2 == null ? "" : nativeJoin.call(array2, separator);
- }
- function last(array2) {
- var length = array2 == null ? 0 : array2.length;
- return length ? array2[length - 1] : undefined$1;
- }
- function lastIndexOf(array2, value, fromIndex) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return -1;
- }
- var index2 = length;
- if (fromIndex !== undefined$1) {
- index2 = toInteger(fromIndex);
- index2 = index2 < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
- }
- return value === value ? strictLastIndexOf(array2, value, index2) : baseFindIndex(array2, baseIsNaN, index2, true);
- }
- function nth(array2, n2) {
- return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined$1;
- }
- var pull = baseRest(pullAll);
- function pullAll(array2, values2) {
- return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
- }
- function pullAllBy(array2, values2, iteratee2) {
- return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2, getIteratee(iteratee2, 2)) : array2;
- }
- function pullAllWith(array2, values2, comparator) {
- return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2, undefined$1, comparator) : array2;
- }
- var pullAt = flatRest(function(array2, indexes) {
- var length = array2 == null ? 0 : array2.length, result3 = baseAt(array2, indexes);
- basePullAt(array2, arrayMap(indexes, function(index2) {
- return isIndex(index2, length) ? +index2 : index2;
- }).sort(compareAscending));
- return result3;
- });
- function remove(array2, predicate) {
- var result3 = [];
- if (!(array2 && array2.length)) {
- return result3;
- }
- var index2 = -1, indexes = [], length = array2.length;
- predicate = getIteratee(predicate, 3);
- while (++index2 < length) {
- var value = array2[index2];
- if (predicate(value, index2, array2)) {
- result3.push(value);
- indexes.push(index2);
- }
- }
- basePullAt(array2, indexes);
- return result3;
- }
- function reverse(array2) {
- return array2 == null ? array2 : nativeReverse.call(array2);
- }
- function slice(array2, start, end) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return [];
- }
- if (end && typeof end != "number" && isIterateeCall(array2, start, end)) {
- start = 0;
- end = length;
- } else {
- start = start == null ? 0 : toInteger(start);
- end = end === undefined$1 ? length : toInteger(end);
- }
- return baseSlice(array2, start, end);
- }
- function sortedIndex(array2, value) {
- return baseSortedIndex(array2, value);
- }
- function sortedIndexBy(array2, value, iteratee2) {
- return baseSortedIndexBy(array2, value, getIteratee(iteratee2, 2));
- }
- function sortedIndexOf(array2, value) {
- var length = array2 == null ? 0 : array2.length;
- if (length) {
- var index2 = baseSortedIndex(array2, value);
- if (index2 < length && eq(array2[index2], value)) {
- return index2;
- }
- }
- return -1;
- }
- function sortedLastIndex(array2, value) {
- return baseSortedIndex(array2, value, true);
- }
- function sortedLastIndexBy(array2, value, iteratee2) {
- return baseSortedIndexBy(array2, value, getIteratee(iteratee2, 2), true);
- }
- function sortedLastIndexOf(array2, value) {
- var length = array2 == null ? 0 : array2.length;
- if (length) {
- var index2 = baseSortedIndex(array2, value, true) - 1;
- if (eq(array2[index2], value)) {
- return index2;
- }
- }
- return -1;
- }
- function sortedUniq(array2) {
- return array2 && array2.length ? baseSortedUniq(array2) : [];
- }
- function sortedUniqBy(array2, iteratee2) {
- return array2 && array2.length ? baseSortedUniq(array2, getIteratee(iteratee2, 2)) : [];
- }
- function tail(array2) {
- var length = array2 == null ? 0 : array2.length;
- return length ? baseSlice(array2, 1, length) : [];
- }
- function take(array2, n2, guard) {
- if (!(array2 && array2.length)) {
- return [];
- }
- n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
- return baseSlice(array2, 0, n2 < 0 ? 0 : n2);
- }
- function takeRight(array2, n2, guard) {
- var length = array2 == null ? 0 : array2.length;
- if (!length) {
- return [];
- }
- n2 = guard || n2 === undefined$1 ? 1 : toInteger(n2);
- n2 = length - n2;
- return baseSlice(array2, n2 < 0 ? 0 : n2, length);
- }
- function takeRightWhile(array2, predicate) {
- return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3), false, true) : [];
- }
- function takeWhile(array2, predicate) {
- return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3)) : [];
- }
- var union = baseRest(function(arrays) {
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
- });
- var unionBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
- });
- var unionWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined$1, comparator);
- });
- function uniq(array2) {
- return array2 && array2.length ? baseUniq(array2) : [];
- }
- function uniqBy(array2, iteratee2) {
- return array2 && array2.length ? baseUniq(array2, getIteratee(iteratee2, 2)) : [];
- }
- function uniqWith(array2, comparator) {
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- return array2 && array2.length ? baseUniq(array2, undefined$1, comparator) : [];
- }
- function unzip(array2) {
- if (!(array2 && array2.length)) {
- return [];
- }
- var length = 0;
- array2 = arrayFilter(array2, function(group) {
- if (isArrayLikeObject(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- return baseTimes(length, function(index2) {
- return arrayMap(array2, baseProperty(index2));
- });
- }
- function unzipWith(array2, iteratee2) {
- if (!(array2 && array2.length)) {
- return [];
- }
- var result3 = unzip(array2);
- if (iteratee2 == null) {
- return result3;
- }
- return arrayMap(result3, function(group) {
- return apply2(iteratee2, undefined$1, group);
- });
- }
- var without = baseRest(function(array2, values2) {
- return isArrayLikeObject(array2) ? baseDifference(array2, values2) : [];
- });
- var xor = baseRest(function(arrays) {
- return baseXor(arrayFilter(arrays, isArrayLikeObject));
- });
- var xorBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
- });
- var xorWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator);
- });
- var zip = baseRest(unzip);
- function zipObject(props, values2) {
- return baseZipObject(props || [], values2 || [], assignValue);
- }
- function zipObjectDeep(props, values2) {
- return baseZipObject(props || [], values2 || [], baseSet);
- }
- var zipWith = baseRest(function(arrays) {
- var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined$1;
- iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined$1;
- return unzipWith(arrays, iteratee2);
- });
- function chain(value) {
- var result3 = lodash2(value);
- result3.__chain__ = true;
- return result3;
- }
- function tap(value, interceptor) {
- interceptor(value);
- return value;
- }
- function thru(value, interceptor) {
- return interceptor(value);
- }
- var wrapperAt = flatRest(function(paths) {
- var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object2) {
- return baseAt(object2, paths);
- };
- if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
- return this.thru(interceptor);
- }
- value = value.slice(start, +start + (length ? 1 : 0));
- value.__actions__.push({
- "func": thru,
- "args": [interceptor],
- "thisArg": undefined$1
- });
- return new LodashWrapper(value, this.__chain__).thru(function(array2) {
- if (length && !array2.length) {
- array2.push(undefined$1);
- }
- return array2;
- });
- });
- function wrapperChain() {
- return chain(this);
- }
- function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
- }
- function wrapperNext() {
- if (this.__values__ === undefined$1) {
- this.__values__ = toArray2(this.value());
- }
- var done = this.__index__ >= this.__values__.length, value = done ? undefined$1 : this.__values__[this.__index__++];
- return { "done": done, "value": value };
- }
- function wrapperToIterator() {
- return this;
- }
- function wrapperPlant(value) {
- var result3, parent3 = this;
- while (parent3 instanceof baseLodash) {
- var clone3 = wrapperClone(parent3);
- clone3.__index__ = 0;
- clone3.__values__ = undefined$1;
- if (result3) {
- previous.__wrapped__ = clone3;
- } else {
- result3 = clone3;
- }
- var previous = clone3;
- parent3 = parent3.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result3;
- }
- function wrapperReverse() {
- var value = this.__wrapped__;
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({
- "func": thru,
- "args": [reverse],
- "thisArg": undefined$1
- });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(reverse);
- }
- function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
- }
- var countBy = createAggregator(function(result3, value, key) {
- if (hasOwnProperty2.call(result3, key)) {
- ++result3[key];
- } else {
- baseAssignValue(result3, key, 1);
- }
- });
- function every(collection, predicate, guard) {
- var func = isArray2(collection) ? arrayEvery : baseEvery;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined$1;
- }
- return func(collection, getIteratee(predicate, 3));
- }
- function filter(collection, predicate) {
- var func = isArray2(collection) ? arrayFilter : baseFilter;
- return func(collection, getIteratee(predicate, 3));
- }
- var find = createFind(findIndex);
- var findLast = createFind(findLastIndex);
- function flatMap(collection, iteratee2) {
- return baseFlatten(map(collection, iteratee2), 1);
- }
- function flatMapDeep(collection, iteratee2) {
- return baseFlatten(map(collection, iteratee2), INFINITY);
- }
- function flatMapDepth(collection, iteratee2, depth) {
- depth = depth === undefined$1 ? 1 : toInteger(depth);
- return baseFlatten(map(collection, iteratee2), depth);
- }
- function forEach2(collection, iteratee2) {
- var func = isArray2(collection) ? arrayEach : baseEach;
- return func(collection, getIteratee(iteratee2, 3));
- }
- function forEachRight(collection, iteratee2) {
- var func = isArray2(collection) ? arrayEachRight : baseEachRight;
- return func(collection, getIteratee(iteratee2, 3));
- }
- var groupBy = createAggregator(function(result3, value, key) {
- if (hasOwnProperty2.call(result3, key)) {
- result3[key].push(value);
- } else {
- baseAssignValue(result3, key, [value]);
- }
- });
- function includes(collection, value, fromIndex, guard) {
- collection = isArrayLike(collection) ? collection : values(collection);
- fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
- var length = collection.length;
- if (fromIndex < 0) {
- fromIndex = nativeMax(length + fromIndex, 0);
- }
- return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
- }
- var invokeMap = baseRest(function(collection, path, args) {
- var index2 = -1, isFunc = typeof path == "function", result3 = isArrayLike(collection) ? Array2(collection.length) : [];
- baseEach(collection, function(value) {
- result3[++index2] = isFunc ? apply2(path, value, args) : baseInvoke(value, path, args);
- });
- return result3;
- });
- var keyBy = createAggregator(function(result3, value, key) {
- baseAssignValue(result3, key, value);
- });
- function map(collection, iteratee2) {
- var func = isArray2(collection) ? arrayMap : baseMap;
- return func(collection, getIteratee(iteratee2, 3));
- }
- function orderBy(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (!isArray2(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- orders = guard ? undefined$1 : orders;
- if (!isArray2(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseOrderBy(collection, iteratees, orders);
- }
- var partition = createAggregator(function(result3, value, key) {
- result3[key ? 0 : 1].push(value);
- }, function() {
- return [[], []];
- });
- function reduce(collection, iteratee2, accumulator) {
- var func = isArray2(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
- return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
- }
- function reduceRight(collection, iteratee2, accumulator) {
- var func = isArray2(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
- return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
- }
- function reject(collection, predicate) {
- var func = isArray2(collection) ? arrayFilter : baseFilter;
- return func(collection, negate(getIteratee(predicate, 3)));
- }
- function sample(collection) {
- var func = isArray2(collection) ? arraySample : baseSample;
- return func(collection);
- }
- function sampleSize(collection, n2, guard) {
- if (guard ? isIterateeCall(collection, n2, guard) : n2 === undefined$1) {
- n2 = 1;
- } else {
- n2 = toInteger(n2);
- }
- var func = isArray2(collection) ? arraySampleSize : baseSampleSize;
- return func(collection, n2);
- }
- function shuffle(collection) {
- var func = isArray2(collection) ? arrayShuffle : baseShuffle;
- return func(collection);
- }
- function size(collection) {
- if (collection == null) {
- return 0;
- }
- if (isArrayLike(collection)) {
- return isString2(collection) ? stringSize(collection) : collection.length;
- }
- var tag = getTag(collection);
- if (tag == mapTag || tag == setTag) {
- return collection.size;
- }
- return baseKeys(collection).length;
- }
- function some(collection, predicate, guard) {
- var func = isArray2(collection) ? arraySome : baseSome;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined$1;
- }
- return func(collection, getIteratee(predicate, 3));
- }
- var sortBy = baseRest(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var length = iteratees.length;
- if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
- iteratees = [];
- } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
- iteratees = [iteratees[0]];
- }
- return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
- });
- var now2 = ctxNow || function() {
- return root.Date.now();
- };
- function after(n2, func) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- n2 = toInteger(n2);
- return function() {
- if (--n2 < 1) {
- return func.apply(this, arguments);
- }
- };
- }
- function ary(func, n2, guard) {
- n2 = guard ? undefined$1 : n2;
- n2 = func && n2 == null ? func.length : n2;
- return createWrap(func, WRAP_ARY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, n2);
- }
- function before(n2, func) {
- var result3;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- n2 = toInteger(n2);
- return function() {
- if (--n2 > 0) {
- result3 = func.apply(this, arguments);
- }
- if (n2 <= 1) {
- func = undefined$1;
- }
- return result3;
- };
- }
- var bind2 = baseRest(function(func, thisArg, partials) {
- var bitmask = WRAP_BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bind2));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(func, bitmask, thisArg, partials, holders);
- });
- var bindKey = baseRest(function(object2, key, partials) {
- var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bindKey));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(key, bitmask, object2, partials, holders);
- });
- function curry(func, arity, guard) {
- arity = guard ? undefined$1 : arity;
- var result3 = createWrap(func, WRAP_CURRY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
- result3.placeholder = curry.placeholder;
- return result3;
- }
- function curryRight(func, arity, guard) {
- arity = guard ? undefined$1 : arity;
- var result3 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
- result3.placeholder = curryRight.placeholder;
- return result3;
- }
- function debounce(func, wait, options2) {
- var lastArgs, lastThis, maxWait, result3, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- wait = toNumber(wait) || 0;
- if (isObject2(options2)) {
- leading = !!options2.leading;
- maxing = "maxWait" in options2;
- maxWait = maxing ? nativeMax(toNumber(options2.maxWait) || 0, wait) : maxWait;
- trailing = "trailing" in options2 ? !!options2.trailing : trailing;
- }
- function invokeFunc(time2) {
- var args = lastArgs, thisArg = lastThis;
- lastArgs = lastThis = undefined$1;
- lastInvokeTime = time2;
- result3 = func.apply(thisArg, args);
- return result3;
- }
- function leadingEdge(time2) {
- lastInvokeTime = time2;
- timerId = setTimeout2(timerExpired, wait);
- return leading ? invokeFunc(time2) : result3;
- }
- function remainingWait(time2) {
- var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
- return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
- }
- function shouldInvoke(time2) {
- var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
- return lastCallTime === undefined$1 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
- }
- function timerExpired() {
- var time2 = now2();
- if (shouldInvoke(time2)) {
- return trailingEdge(time2);
- }
- timerId = setTimeout2(timerExpired, remainingWait(time2));
- }
- function trailingEdge(time2) {
- timerId = undefined$1;
- if (trailing && lastArgs) {
- return invokeFunc(time2);
- }
- lastArgs = lastThis = undefined$1;
- return result3;
- }
- function cancel() {
- if (timerId !== undefined$1) {
- clearTimeout2(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined$1;
- }
- function flush() {
- return timerId === undefined$1 ? result3 : trailingEdge(now2());
- }
- function debounced() {
- var time2 = now2(), isInvoking = shouldInvoke(time2);
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time2;
- if (isInvoking) {
- if (timerId === undefined$1) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- clearTimeout2(timerId);
- timerId = setTimeout2(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined$1) {
- timerId = setTimeout2(timerExpired, wait);
- }
- return result3;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
- var defer = baseRest(function(func, args) {
- return baseDelay(func, 1, args);
- });
- var delay = baseRest(function(func, wait, args) {
- return baseDelay(func, toNumber(wait) || 0, args);
- });
- function flip(func) {
- return createWrap(func, WRAP_FLIP_FLAG);
- }
- function memoize(func, resolver) {
- if (typeof func != "function" || resolver != null && typeof resolver != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
- if (cache2.has(key)) {
- return cache2.get(key);
- }
- var result3 = func.apply(this, args);
- memoized.cache = cache2.set(key, result3) || cache2;
- return result3;
- };
- memoized.cache = new (memoize.Cache || MapCache)();
- return memoized;
- }
- memoize.Cache = MapCache;
- function negate(predicate) {
- if (typeof predicate != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0:
- return !predicate.call(this);
- case 1:
- return !predicate.call(this, args[0]);
- case 2:
- return !predicate.call(this, args[0], args[1]);
- case 3:
- return !predicate.call(this, args[0], args[1], args[2]);
- }
- return !predicate.apply(this, args);
- };
- }
- function once(func) {
- return before(2, func);
- }
- var overArgs = castRest(function(func, transforms) {
- transforms = transforms.length == 1 && isArray2(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
- var funcsLength = transforms.length;
- return baseRest(function(args) {
- var index2 = -1, length = nativeMin(args.length, funcsLength);
- while (++index2 < length) {
- args[index2] = transforms[index2].call(this, args[index2]);
- }
- return apply2(func, this, args);
- });
- });
- var partial = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partial));
- return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders);
- });
- var partialRight = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partialRight));
- return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders);
- });
- var rearg = flatRest(function(func, indexes) {
- return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes);
- });
- function rest(func, start) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- start = start === undefined$1 ? start : toInteger(start);
- return baseRest(func, start);
- }
- function spread2(func, start) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- start = start == null ? 0 : nativeMax(toInteger(start), 0);
- return baseRest(function(args) {
- var array2 = args[start], otherArgs = castSlice(args, 0, start);
- if (array2) {
- arrayPush(otherArgs, array2);
- }
- return apply2(func, this, otherArgs);
- });
- }
- function throttle2(func, wait, options2) {
- var leading = true, trailing = true;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- if (isObject2(options2)) {
- leading = "leading" in options2 ? !!options2.leading : leading;
- trailing = "trailing" in options2 ? !!options2.trailing : trailing;
- }
- return debounce(func, wait, {
- "leading": leading,
- "maxWait": wait,
- "trailing": trailing
- });
- }
- function unary(func) {
- return ary(func, 1);
- }
- function wrap(value, wrapper) {
- return partial(castFunction(wrapper), value);
- }
- function castArray() {
- if (!arguments.length) {
- return [];
- }
- var value = arguments[0];
- return isArray2(value) ? value : [value];
- }
- function clone2(value) {
- return baseClone(value, CLONE_SYMBOLS_FLAG);
- }
- function cloneWith(value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
- }
- function cloneDeep2(value) {
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
- function cloneDeepWith(value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
- }
- function conformsTo(object2, source) {
- return source == null || baseConformsTo(object2, source, keys(source));
- }
- function eq(value, other) {
- return value === other || value !== value && other !== other;
- }
- var gt2 = createRelationalOperation(baseGt);
- var gte = createRelationalOperation(function(value, other) {
- return value >= other;
- });
- var isArguments = baseIsArguments(/* @__PURE__ */ function() {
- return arguments;
- }()) ? baseIsArguments : function(value) {
- return isObjectLike(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
- };
- var isArray2 = Array2.isArray;
- var isArrayBuffer2 = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction2(value);
- }
- function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
- }
- function isBoolean2(value) {
- return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
- }
- var isBuffer2 = nativeIsBuffer || stubFalse;
- var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
- function isElement(value) {
- return isObjectLike(value) && value.nodeType === 1 && !isPlainObject2(value);
- }
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) && (isArray2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer2(value) || isTypedArray2(value) || isArguments(value))) {
- return !value.length;
- }
- var tag = getTag(value);
- if (tag == mapTag || tag == setTag) {
- return !value.size;
- }
- if (isPrototype(value)) {
- return !baseKeys(value).length;
- }
- for (var key in value) {
- if (hasOwnProperty2.call(value, key)) {
- return false;
- }
- }
- return true;
- }
- function isEqual(value, other) {
- return baseIsEqual(value, other);
- }
- function isEqualWith(value, other, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- var result3 = customizer ? customizer(value, other) : undefined$1;
- return result3 === undefined$1 ? baseIsEqual(value, other, undefined$1, customizer) : !!result3;
- }
- function isError(value) {
- if (!isObjectLike(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject2(value);
- }
- function isFinite2(value) {
- return typeof value == "number" && nativeIsFinite(value);
- }
- function isFunction2(value) {
- if (!isObject2(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
- function isInteger(value) {
- return typeof value == "number" && value == toInteger(value);
- }
- function isLength(value) {
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
- function isObject2(value) {
- var type = typeof value;
- return value != null && (type == "object" || type == "function");
- }
- function isObjectLike(value) {
- return value != null && typeof value == "object";
- }
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
- function isMatch(object2, source) {
- return object2 === source || baseIsMatch(object2, source, getMatchData(source));
- }
- function isMatchWith(object2, source, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseIsMatch(object2, source, getMatchData(source), customizer);
- }
- function isNaN2(value) {
- return isNumber2(value) && value != +value;
- }
- function isNative(value) {
- if (isMaskable(value)) {
- throw new Error2(CORE_ERROR_TEXT);
- }
- return baseIsNative(value);
- }
- function isNull(value) {
- return value === null;
- }
- function isNil(value) {
- return value == null;
- }
- function isNumber2(value) {
- return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
- }
- function isPlainObject2(value) {
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
- return false;
- }
- var proto = getPrototype(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor;
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
- }
- var isRegExp2 = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
- function isSafeInteger(value) {
- return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
- }
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
- function isString2(value) {
- return typeof value == "string" || !isArray2(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
- }
- function isSymbol(value) {
- return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
- }
- var isTypedArray2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
- function isUndefined2(value) {
- return value === undefined$1;
- }
- function isWeakMap(value) {
- return isObjectLike(value) && getTag(value) == weakMapTag;
- }
- function isWeakSet(value) {
- return isObjectLike(value) && baseGetTag(value) == weakSetTag;
- }
- var lt2 = createRelationalOperation(baseLt);
- var lte = createRelationalOperation(function(value, other) {
- return value <= other;
- });
- function toArray2(value) {
- if (!value) {
- return [];
- }
- if (isArrayLike(value)) {
- return isString2(value) ? stringToArray(value) : copyArray(value);
- }
- if (symIterator && value[symIterator]) {
- return iteratorToArray(value[symIterator]());
- }
- var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
- return func(value);
- }
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = toNumber(value);
- if (value === INFINITY || value === -INFINITY) {
- var sign2 = value < 0 ? -1 : 1;
- return sign2 * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
- function toInteger(value) {
- var result3 = toFinite(value), remainder = result3 % 1;
- return result3 === result3 ? remainder ? result3 - remainder : result3 : 0;
- }
- function toLength(value) {
- return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
- }
- function toNumber(value) {
- if (typeof value == "number") {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- if (isObject2(value)) {
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
- value = isObject2(other) ? other + "" : other;
- }
- if (typeof value != "string") {
- return value === 0 ? value : +value;
- }
- value = baseTrim(value);
- var isBinary = reIsBinary.test(value);
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
- }
- function toPlainObject(value) {
- return copyObject(value, keysIn(value));
- }
- function toSafeInteger(value) {
- return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
- }
- function toString2(value) {
- return value == null ? "" : baseToString(value);
- }
- var assign2 = createAssigner(function(object2, source) {
- if (isPrototype(source) || isArrayLike(source)) {
- copyObject(source, keys(source), object2);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty2.call(source, key)) {
- assignValue(object2, key, source[key]);
- }
- }
- });
- var assignIn = createAssigner(function(object2, source) {
- copyObject(source, keysIn(source), object2);
- });
- var assignInWith = createAssigner(function(object2, source, srcIndex, customizer) {
- copyObject(source, keysIn(source), object2, customizer);
- });
- var assignWith = createAssigner(function(object2, source, srcIndex, customizer) {
- copyObject(source, keys(source), object2, customizer);
- });
- var at2 = flatRest(baseAt);
- function create(prototype2, properties) {
- var result3 = baseCreate(prototype2);
- return properties == null ? result3 : baseAssign(result3, properties);
- }
- var defaults2 = baseRest(function(object2, sources) {
- object2 = Object2(object2);
- var index2 = -1;
- var length = sources.length;
- var guard = length > 2 ? sources[2] : undefined$1;
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- length = 1;
- }
- while (++index2 < length) {
- var source = sources[index2];
- var props = keysIn(source);
- var propsIndex = -1;
- var propsLength = props.length;
- while (++propsIndex < propsLength) {
- var key = props[propsIndex];
- var value = object2[key];
- if (value === undefined$1 || eq(value, objectProto[key]) && !hasOwnProperty2.call(object2, key)) {
- object2[key] = source[key];
- }
- }
- }
- return object2;
- });
- var defaultsDeep = baseRest(function(args) {
- args.push(undefined$1, customDefaultsMerge);
- return apply2(mergeWith, undefined$1, args);
- });
- function findKey2(object2, predicate) {
- return baseFindKey(object2, getIteratee(predicate, 3), baseForOwn);
- }
- function findLastKey(object2, predicate) {
- return baseFindKey(object2, getIteratee(predicate, 3), baseForOwnRight);
- }
- function forIn(object2, iteratee2) {
- return object2 == null ? object2 : baseFor(object2, getIteratee(iteratee2, 3), keysIn);
- }
- function forInRight(object2, iteratee2) {
- return object2 == null ? object2 : baseForRight(object2, getIteratee(iteratee2, 3), keysIn);
- }
- function forOwn(object2, iteratee2) {
- return object2 && baseForOwn(object2, getIteratee(iteratee2, 3));
- }
- function forOwnRight(object2, iteratee2) {
- return object2 && baseForOwnRight(object2, getIteratee(iteratee2, 3));
- }
- function functions(object2) {
- return object2 == null ? [] : baseFunctions(object2, keys(object2));
- }
- function functionsIn(object2) {
- return object2 == null ? [] : baseFunctions(object2, keysIn(object2));
- }
- function get(object2, path, defaultValue) {
- var result3 = object2 == null ? undefined$1 : baseGet(object2, path);
- return result3 === undefined$1 ? defaultValue : result3;
- }
- function has(object2, path) {
- return object2 != null && hasPath(object2, path, baseHas);
- }
- function hasIn(object2, path) {
- return object2 != null && hasPath(object2, path, baseHasIn);
- }
- var invert = createInverter(function(result3, value, key) {
- if (value != null && typeof value.toString != "function") {
- value = nativeObjectToString.call(value);
- }
- result3[value] = key;
- }, constant(identity));
- var invertBy = createInverter(function(result3, value, key) {
- if (value != null && typeof value.toString != "function") {
- value = nativeObjectToString.call(value);
- }
- if (hasOwnProperty2.call(result3, value)) {
- result3[value].push(key);
- } else {
- result3[value] = [key];
- }
- }, getIteratee);
- var invoke = baseRest(baseInvoke);
- function keys(object2) {
- return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2);
- }
- function keysIn(object2) {
- return isArrayLike(object2) ? arrayLikeKeys(object2, true) : baseKeysIn(object2);
- }
- function mapKeys(object2, iteratee2) {
- var result3 = {};
- iteratee2 = getIteratee(iteratee2, 3);
- baseForOwn(object2, function(value, key, object3) {
- baseAssignValue(result3, iteratee2(value, key, object3), value);
- });
- return result3;
- }
- function mapValues(object2, iteratee2) {
- var result3 = {};
- iteratee2 = getIteratee(iteratee2, 3);
- baseForOwn(object2, function(value, key, object3) {
- baseAssignValue(result3, key, iteratee2(value, key, object3));
- });
- return result3;
- }
- var merge2 = createAssigner(function(object2, source, srcIndex) {
- baseMerge(object2, source, srcIndex);
- });
- var mergeWith = createAssigner(function(object2, source, srcIndex, customizer) {
- baseMerge(object2, source, srcIndex, customizer);
- });
- var omit = flatRest(function(object2, paths) {
- var result3 = {};
- if (object2 == null) {
- return result3;
- }
- var isDeep = false;
- paths = arrayMap(paths, function(path) {
- path = castPath(path, object2);
- isDeep || (isDeep = path.length > 1);
- return path;
- });
- copyObject(object2, getAllKeysIn(object2), result3);
- if (isDeep) {
- result3 = baseClone(result3, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
- }
- var length = paths.length;
- while (length--) {
- baseUnset(result3, paths[length]);
- }
- return result3;
- });
- function omitBy(object2, predicate) {
- return pickBy(object2, negate(getIteratee(predicate)));
- }
- var pick = flatRest(function(object2, paths) {
- return object2 == null ? {} : basePick(object2, paths);
- });
- function pickBy(object2, predicate) {
- if (object2 == null) {
- return {};
- }
- var props = arrayMap(getAllKeysIn(object2), function(prop) {
- return [prop];
- });
- predicate = getIteratee(predicate);
- return basePickBy(object2, props, function(value, path) {
- return predicate(value, path[0]);
- });
- }
- function result2(object2, path, defaultValue) {
- path = castPath(path, object2);
- var index2 = -1, length = path.length;
- if (!length) {
- length = 1;
- object2 = undefined$1;
- }
- while (++index2 < length) {
- var value = object2 == null ? undefined$1 : object2[toKey(path[index2])];
- if (value === undefined$1) {
- index2 = length;
- value = defaultValue;
- }
- object2 = isFunction2(value) ? value.call(object2) : value;
- }
- return object2;
- }
- function set2(object2, path, value) {
- return object2 == null ? object2 : baseSet(object2, path, value);
- }
- function setWith(object2, path, value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return object2 == null ? object2 : baseSet(object2, path, value, customizer);
- }
- var toPairs = createToPairs(keys);
- var toPairsIn = createToPairs(keysIn);
- function transform(object2, iteratee2, accumulator) {
- var isArr = isArray2(object2), isArrLike = isArr || isBuffer2(object2) || isTypedArray2(object2);
- iteratee2 = getIteratee(iteratee2, 4);
- if (accumulator == null) {
- var Ctor = object2 && object2.constructor;
- if (isArrLike) {
- accumulator = isArr ? new Ctor() : [];
- } else if (isObject2(object2)) {
- accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object2)) : {};
- } else {
- accumulator = {};
- }
- }
- (isArrLike ? arrayEach : baseForOwn)(object2, function(value, index2, object3) {
- return iteratee2(accumulator, value, index2, object3);
- });
- return accumulator;
- }
- function unset(object2, path) {
- return object2 == null ? true : baseUnset(object2, path);
- }
- function update(object2, path, updater) {
- return object2 == null ? object2 : baseUpdate(object2, path, castFunction(updater));
- }
- function updateWith(object2, path, updater, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return object2 == null ? object2 : baseUpdate(object2, path, castFunction(updater), customizer);
- }
- function values(object2) {
- return object2 == null ? [] : baseValues(object2, keys(object2));
- }
- function valuesIn(object2) {
- return object2 == null ? [] : baseValues(object2, keysIn(object2));
- }
- function clamp(number2, lower, upper) {
- if (upper === undefined$1) {
- upper = lower;
- lower = undefined$1;
- }
- if (upper !== undefined$1) {
- upper = toNumber(upper);
- upper = upper === upper ? upper : 0;
- }
- if (lower !== undefined$1) {
- lower = toNumber(lower);
- lower = lower === lower ? lower : 0;
- }
- return baseClamp(toNumber(number2), lower, upper);
- }
- function inRange(number2, start, end) {
- start = toFinite(start);
- if (end === undefined$1) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- number2 = toNumber(number2);
- return baseInRange(number2, start, end);
- }
- function random2(lower, upper, floating) {
- if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
- upper = floating = undefined$1;
- }
- if (floating === undefined$1) {
- if (typeof upper == "boolean") {
- floating = upper;
- upper = undefined$1;
- } else if (typeof lower == "boolean") {
- floating = lower;
- lower = undefined$1;
- }
- }
- if (lower === undefined$1 && upper === undefined$1) {
- lower = 0;
- upper = 1;
- } else {
- lower = toFinite(lower);
- if (upper === undefined$1) {
- upper = lower;
- lower = 0;
- } else {
- upper = toFinite(upper);
- }
- }
- if (lower > upper) {
- var temp = lower;
- lower = upper;
- upper = temp;
- }
- if (floating || lower % 1 || upper % 1) {
- var rand = nativeRandom();
- return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
- }
- return baseRandom(lower, upper);
- }
- var camelCase = createCompounder(function(result3, word, index2) {
- word = word.toLowerCase();
- return result3 + (index2 ? capitalize(word) : word);
- });
- function capitalize(string) {
- return upperFirst(toString2(string).toLowerCase());
- }
- function deburr(string) {
- string = toString2(string);
- return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
- }
- function endsWith2(string, target, position) {
- string = toString2(string);
- target = baseToString(target);
- var length = string.length;
- position = position === undefined$1 ? length : baseClamp(toInteger(position), 0, length);
- var end = position;
- position -= target.length;
- return position >= 0 && string.slice(position, end) == target;
- }
- function escape2(string) {
- string = toString2(string);
- return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
- }
- function escapeRegExp(string) {
- string = toString2(string);
- return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
- }
- var kebabCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? "-" : "") + word.toLowerCase();
- });
- var lowerCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? " " : "") + word.toLowerCase();
- });
- var lowerFirst = createCaseFirst("toLowerCase");
- function pad(string, length, chars) {
- string = toString2(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- if (!length || strLength >= length) {
- return string;
- }
- var mid = (length - strLength) / 2;
- return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
- }
- function padEnd(string, length, chars) {
- string = toString2(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
- }
- function padStart(string, length, chars) {
- string = toString2(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
- }
- function parseInt2(string, radix, guard) {
- if (guard || radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- return nativeParseInt(toString2(string).replace(reTrimStart, ""), radix || 0);
- }
- function repeat2(string, n2, guard) {
- if (guard ? isIterateeCall(string, n2, guard) : n2 === undefined$1) {
- n2 = 1;
- } else {
- n2 = toInteger(n2);
- }
- return baseRepeat(toString2(string), n2);
- }
- function replace() {
- var args = arguments, string = toString2(args[0]);
- return args.length < 3 ? string : string.replace(args[1], args[2]);
- }
- var snakeCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? "_" : "") + word.toLowerCase();
- });
- function split(string, separator, limit) {
- if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
- separator = limit = undefined$1;
- }
- limit = limit === undefined$1 ? MAX_ARRAY_LENGTH : limit >>> 0;
- if (!limit) {
- return [];
- }
- string = toString2(string);
- if (string && (typeof separator == "string" || separator != null && !isRegExp2(separator))) {
- separator = baseToString(separator);
- if (!separator && hasUnicode(string)) {
- return castSlice(stringToArray(string), 0, limit);
- }
- }
- return string.split(separator, limit);
- }
- var startCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? " " : "") + upperFirst(word);
- });
- function startsWith2(string, target, position) {
- string = toString2(string);
- position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
- target = baseToString(target);
- return string.slice(position, position + target.length) == target;
- }
- function template(string, options2, guard) {
- var settings2 = lodash2.templateSettings;
- if (guard && isIterateeCall(string, options2, guard)) {
- options2 = undefined$1;
- }
- string = toString2(string);
- options2 = assignInWith({}, options2, settings2, customDefaultsAssignIn);
- var imports = assignInWith({}, options2.imports, settings2.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
- var isEscaping, isEvaluating, index2 = 0, interpolate = options2.interpolate || reNoMatch, source = "__p += '";
- var reDelimiters = RegExp2(
- (options2.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options2.evaluate || reNoMatch).source + "|$",
- "g"
- );
- var sourceURL = "//# sourceURL=" + (hasOwnProperty2.call(options2, "sourceURL") ? (options2.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
- interpolateValue || (interpolateValue = esTemplateValue);
- source += string.slice(index2, offset).replace(reUnescapedString, escapeStringChar);
- if (escapeValue) {
- isEscaping = true;
- source += "' +\n__e(" + escapeValue + ") +\n'";
- }
- if (evaluateValue) {
- isEvaluating = true;
- source += "';\n" + evaluateValue + ";\n__p += '";
- }
- if (interpolateValue) {
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
- }
- index2 = offset + match.length;
- return match;
- });
- source += "';\n";
- var variable = hasOwnProperty2.call(options2, "variable") && options2.variable;
- if (!variable) {
- source = "with (obj) {\n" + source + "\n}\n";
- } else if (reForbiddenIdentifierChars.test(variable)) {
- throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
- }
- source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
- source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
- var result3 = attempt(function() {
- return Function2(importsKeys, sourceURL + "return " + source).apply(undefined$1, importsValues);
- });
- result3.source = source;
- if (isError(result3)) {
- throw result3;
- }
- return result3;
- }
- function toLower(value) {
- return toString2(value).toLowerCase();
- }
- function toUpper(value) {
- return toString2(value).toUpperCase();
- }
- function trim2(string, chars, guard) {
- string = toString2(string);
- if (string && (guard || chars === undefined$1)) {
- return baseTrim(string);
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
- return castSlice(strSymbols, start, end).join("");
- }
- function trimEnd(string, chars, guard) {
- string = toString2(string);
- if (string && (guard || chars === undefined$1)) {
- return string.slice(0, trimmedEndIndex(string) + 1);
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
- return castSlice(strSymbols, 0, end).join("");
- }
- function trimStart(string, chars, guard) {
- string = toString2(string);
- if (string && (guard || chars === undefined$1)) {
- return string.replace(reTrimStart, "");
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
- return castSlice(strSymbols, start).join("");
- }
- function truncate(string, options2) {
- var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
- if (isObject2(options2)) {
- var separator = "separator" in options2 ? options2.separator : separator;
- length = "length" in options2 ? toInteger(options2.length) : length;
- omission = "omission" in options2 ? baseToString(options2.omission) : omission;
- }
- string = toString2(string);
- var strLength = string.length;
- if (hasUnicode(string)) {
- var strSymbols = stringToArray(string);
- strLength = strSymbols.length;
- }
- if (length >= strLength) {
- return string;
- }
- var end = length - stringSize(omission);
- if (end < 1) {
- return omission;
- }
- var result3 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
- if (separator === undefined$1) {
- return result3 + omission;
- }
- if (strSymbols) {
- end += result3.length - end;
- }
- if (isRegExp2(separator)) {
- if (string.slice(end).search(separator)) {
- var match, substring = result3;
- if (!separator.global) {
- separator = RegExp2(separator.source, toString2(reFlags.exec(separator)) + "g");
- }
- separator.lastIndex = 0;
- while (match = separator.exec(substring)) {
- var newEnd = match.index;
- }
- result3 = result3.slice(0, newEnd === undefined$1 ? end : newEnd);
- }
- } else if (string.indexOf(baseToString(separator), end) != end) {
- var index2 = result3.lastIndexOf(separator);
- if (index2 > -1) {
- result3 = result3.slice(0, index2);
- }
- }
- return result3 + omission;
- }
- function unescape2(string) {
- string = toString2(string);
- return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
- }
- var upperCase = createCompounder(function(result3, word, index2) {
- return result3 + (index2 ? " " : "") + word.toUpperCase();
- });
- var upperFirst = createCaseFirst("toUpperCase");
- function words(string, pattern2, guard) {
- string = toString2(string);
- pattern2 = guard ? undefined$1 : pattern2;
- if (pattern2 === undefined$1) {
- return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
- }
- return string.match(pattern2) || [];
- }
- var attempt = baseRest(function(func, args) {
- try {
- return apply2(func, undefined$1, args);
- } catch (e2) {
- return isError(e2) ? e2 : new Error2(e2);
- }
- });
- var bindAll = flatRest(function(object2, methodNames) {
- arrayEach(methodNames, function(key) {
- key = toKey(key);
- baseAssignValue(object2, key, bind2(object2[key], object2));
- });
- return object2;
- });
- function cond(pairs) {
- var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
- pairs = !length ? [] : arrayMap(pairs, function(pair) {
- if (typeof pair[1] != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return [toIteratee(pair[0]), pair[1]];
- });
- return baseRest(function(args) {
- var index2 = -1;
- while (++index2 < length) {
- var pair = pairs[index2];
- if (apply2(pair[0], this, args)) {
- return apply2(pair[1], this, args);
- }
- }
- });
- }
- function conforms(source) {
- return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
- }
- function constant(value) {
- return function() {
- return value;
- };
- }
- function defaultTo(value, defaultValue) {
- return value == null || value !== value ? defaultValue : value;
- }
- var flow = createFlow();
- var flowRight = createFlow(true);
- function identity(value) {
- return value;
- }
- function iteratee(func) {
- return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
- }
- function matches(source) {
- return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
- }
- function matchesProperty(path, srcValue) {
- return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
- }
- var method = baseRest(function(path, args) {
- return function(object2) {
- return baseInvoke(object2, path, args);
- };
- });
- var methodOf = baseRest(function(object2, args) {
- return function(path) {
- return baseInvoke(object2, path, args);
- };
- });
- function mixin(object2, source, options2) {
- var props = keys(source), methodNames = baseFunctions(source, props);
- if (options2 == null && !(isObject2(source) && (methodNames.length || !props.length))) {
- options2 = source;
- source = object2;
- object2 = this;
- methodNames = baseFunctions(source, keys(source));
- }
- var chain2 = !(isObject2(options2) && "chain" in options2) || !!options2.chain, isFunc = isFunction2(object2);
- arrayEach(methodNames, function(methodName) {
- var func = source[methodName];
- object2[methodName] = func;
- if (isFunc) {
- object2.prototype[methodName] = function() {
- var chainAll = this.__chain__;
- if (chain2 || chainAll) {
- var result3 = object2(this.__wrapped__), actions = result3.__actions__ = copyArray(this.__actions__);
- actions.push({ "func": func, "args": arguments, "thisArg": object2 });
- result3.__chain__ = chainAll;
- return result3;
- }
- return func.apply(object2, arrayPush([this.value()], arguments));
- };
- }
- });
- return object2;
- }
- function noConflict() {
- if (root._ === this) {
- root._ = oldDash;
- }
- return this;
- }
- function noop2() {
- }
- function nthArg(n2) {
- n2 = toInteger(n2);
- return baseRest(function(args) {
- return baseNth(args, n2);
- });
- }
- var over = createOver(arrayMap);
- var overEvery = createOver(arrayEvery);
- var overSome = createOver(arraySome);
- function property(path) {
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
- }
- function propertyOf(object2) {
- return function(path) {
- return object2 == null ? undefined$1 : baseGet(object2, path);
- };
- }
- var range2 = createRange();
- var rangeRight = createRange(true);
- function stubArray() {
- return [];
- }
- function stubFalse() {
- return false;
- }
- function stubObject() {
- return {};
- }
- function stubString() {
- return "";
- }
- function stubTrue() {
- return true;
- }
- function times2(n2, iteratee2) {
- n2 = toInteger(n2);
- if (n2 < 1 || n2 > MAX_SAFE_INTEGER) {
- return [];
- }
- var index2 = MAX_ARRAY_LENGTH, length = nativeMin(n2, MAX_ARRAY_LENGTH);
- iteratee2 = getIteratee(iteratee2);
- n2 -= MAX_ARRAY_LENGTH;
- var result3 = baseTimes(length, iteratee2);
- while (++index2 < n2) {
- iteratee2(index2);
- }
- return result3;
- }
- function toPath(value) {
- if (isArray2(value)) {
- return arrayMap(value, toKey);
- }
- return isSymbol(value) ? [value] : copyArray(stringToPath(toString2(value)));
- }
- function uniqueId(prefix) {
- var id = ++idCounter;
- return toString2(prefix) + id;
- }
- var add = createMathOperation(function(augend, addend) {
- return augend + addend;
- }, 0);
- var ceil = createRound("ceil");
- var divide2 = createMathOperation(function(dividend, divisor) {
- return dividend / divisor;
- }, 1);
- var floor = createRound("floor");
- function max(array2) {
- return array2 && array2.length ? baseExtremum(array2, identity, baseGt) : undefined$1;
- }
- function maxBy(array2, iteratee2) {
- return array2 && array2.length ? baseExtremum(array2, getIteratee(iteratee2, 2), baseGt) : undefined$1;
- }
- function mean(array2) {
- return baseMean(array2, identity);
- }
- function meanBy(array2, iteratee2) {
- return baseMean(array2, getIteratee(iteratee2, 2));
- }
- function min(array2) {
- return array2 && array2.length ? baseExtremum(array2, identity, baseLt) : undefined$1;
- }
- function minBy(array2, iteratee2) {
- return array2 && array2.length ? baseExtremum(array2, getIteratee(iteratee2, 2), baseLt) : undefined$1;
- }
- var multiply = createMathOperation(function(multiplier, multiplicand) {
- return multiplier * multiplicand;
- }, 1);
- var round2 = createRound("round");
- var subtract = createMathOperation(function(minuend, subtrahend) {
- return minuend - subtrahend;
- }, 0);
- function sum(array2) {
- return array2 && array2.length ? baseSum(array2, identity) : 0;
- }
- function sumBy(array2, iteratee2) {
- return array2 && array2.length ? baseSum(array2, getIteratee(iteratee2, 2)) : 0;
- }
- lodash2.after = after;
- lodash2.ary = ary;
- lodash2.assign = assign2;
- lodash2.assignIn = assignIn;
- lodash2.assignInWith = assignInWith;
- lodash2.assignWith = assignWith;
- lodash2.at = at2;
- lodash2.before = before;
- lodash2.bind = bind2;
- lodash2.bindAll = bindAll;
- lodash2.bindKey = bindKey;
- lodash2.castArray = castArray;
- lodash2.chain = chain;
- lodash2.chunk = chunk;
- lodash2.compact = compact;
- lodash2.concat = concat;
- lodash2.cond = cond;
- lodash2.conforms = conforms;
- lodash2.constant = constant;
- lodash2.countBy = countBy;
- lodash2.create = create;
- lodash2.curry = curry;
- lodash2.curryRight = curryRight;
- lodash2.debounce = debounce;
- lodash2.defaults = defaults2;
- lodash2.defaultsDeep = defaultsDeep;
- lodash2.defer = defer;
- lodash2.delay = delay;
- lodash2.difference = difference;
- lodash2.differenceBy = differenceBy;
- lodash2.differenceWith = differenceWith;
- lodash2.drop = drop;
- lodash2.dropRight = dropRight;
- lodash2.dropRightWhile = dropRightWhile;
- lodash2.dropWhile = dropWhile;
- lodash2.fill = fill;
- lodash2.filter = filter;
- lodash2.flatMap = flatMap;
- lodash2.flatMapDeep = flatMapDeep;
- lodash2.flatMapDepth = flatMapDepth;
- lodash2.flatten = flatten;
- lodash2.flattenDeep = flattenDeep;
- lodash2.flattenDepth = flattenDepth;
- lodash2.flip = flip;
- lodash2.flow = flow;
- lodash2.flowRight = flowRight;
- lodash2.fromPairs = fromPairs;
- lodash2.functions = functions;
- lodash2.functionsIn = functionsIn;
- lodash2.groupBy = groupBy;
- lodash2.initial = initial;
- lodash2.intersection = intersection;
- lodash2.intersectionBy = intersectionBy;
- lodash2.intersectionWith = intersectionWith;
- lodash2.invert = invert;
- lodash2.invertBy = invertBy;
- lodash2.invokeMap = invokeMap;
- lodash2.iteratee = iteratee;
- lodash2.keyBy = keyBy;
- lodash2.keys = keys;
- lodash2.keysIn = keysIn;
- lodash2.map = map;
- lodash2.mapKeys = mapKeys;
- lodash2.mapValues = mapValues;
- lodash2.matches = matches;
- lodash2.matchesProperty = matchesProperty;
- lodash2.memoize = memoize;
- lodash2.merge = merge2;
- lodash2.mergeWith = mergeWith;
- lodash2.method = method;
- lodash2.methodOf = methodOf;
- lodash2.mixin = mixin;
- lodash2.negate = negate;
- lodash2.nthArg = nthArg;
- lodash2.omit = omit;
- lodash2.omitBy = omitBy;
- lodash2.once = once;
- lodash2.orderBy = orderBy;
- lodash2.over = over;
- lodash2.overArgs = overArgs;
- lodash2.overEvery = overEvery;
- lodash2.overSome = overSome;
- lodash2.partial = partial;
- lodash2.partialRight = partialRight;
- lodash2.partition = partition;
- lodash2.pick = pick;
- lodash2.pickBy = pickBy;
- lodash2.property = property;
- lodash2.propertyOf = propertyOf;
- lodash2.pull = pull;
- lodash2.pullAll = pullAll;
- lodash2.pullAllBy = pullAllBy;
- lodash2.pullAllWith = pullAllWith;
- lodash2.pullAt = pullAt;
- lodash2.range = range2;
- lodash2.rangeRight = rangeRight;
- lodash2.rearg = rearg;
- lodash2.reject = reject;
- lodash2.remove = remove;
- lodash2.rest = rest;
- lodash2.reverse = reverse;
- lodash2.sampleSize = sampleSize;
- lodash2.set = set2;
- lodash2.setWith = setWith;
- lodash2.shuffle = shuffle;
- lodash2.slice = slice;
- lodash2.sortBy = sortBy;
- lodash2.sortedUniq = sortedUniq;
- lodash2.sortedUniqBy = sortedUniqBy;
- lodash2.split = split;
- lodash2.spread = spread2;
- lodash2.tail = tail;
- lodash2.take = take;
- lodash2.takeRight = takeRight;
- lodash2.takeRightWhile = takeRightWhile;
- lodash2.takeWhile = takeWhile;
- lodash2.tap = tap;
- lodash2.throttle = throttle2;
- lodash2.thru = thru;
- lodash2.toArray = toArray2;
- lodash2.toPairs = toPairs;
- lodash2.toPairsIn = toPairsIn;
- lodash2.toPath = toPath;
- lodash2.toPlainObject = toPlainObject;
- lodash2.transform = transform;
- lodash2.unary = unary;
- lodash2.union = union;
- lodash2.unionBy = unionBy;
- lodash2.unionWith = unionWith;
- lodash2.uniq = uniq;
- lodash2.uniqBy = uniqBy;
- lodash2.uniqWith = uniqWith;
- lodash2.unset = unset;
- lodash2.unzip = unzip;
- lodash2.unzipWith = unzipWith;
- lodash2.update = update;
- lodash2.updateWith = updateWith;
- lodash2.values = values;
- lodash2.valuesIn = valuesIn;
- lodash2.without = without;
- lodash2.words = words;
- lodash2.wrap = wrap;
- lodash2.xor = xor;
- lodash2.xorBy = xorBy;
- lodash2.xorWith = xorWith;
- lodash2.zip = zip;
- lodash2.zipObject = zipObject;
- lodash2.zipObjectDeep = zipObjectDeep;
- lodash2.zipWith = zipWith;
- lodash2.entries = toPairs;
- lodash2.entriesIn = toPairsIn;
- lodash2.extend = assignIn;
- lodash2.extendWith = assignInWith;
- mixin(lodash2, lodash2);
- lodash2.add = add;
- lodash2.attempt = attempt;
- lodash2.camelCase = camelCase;
- lodash2.capitalize = capitalize;
- lodash2.ceil = ceil;
- lodash2.clamp = clamp;
- lodash2.clone = clone2;
- lodash2.cloneDeep = cloneDeep2;
- lodash2.cloneDeepWith = cloneDeepWith;
- lodash2.cloneWith = cloneWith;
- lodash2.conformsTo = conformsTo;
- lodash2.deburr = deburr;
- lodash2.defaultTo = defaultTo;
- lodash2.divide = divide2;
- lodash2.endsWith = endsWith2;
- lodash2.eq = eq;
- lodash2.escape = escape2;
- lodash2.escapeRegExp = escapeRegExp;
- lodash2.every = every;
- lodash2.find = find;
- lodash2.findIndex = findIndex;
- lodash2.findKey = findKey2;
- lodash2.findLast = findLast;
- lodash2.findLastIndex = findLastIndex;
- lodash2.findLastKey = findLastKey;
- lodash2.floor = floor;
- lodash2.forEach = forEach2;
- lodash2.forEachRight = forEachRight;
- lodash2.forIn = forIn;
- lodash2.forInRight = forInRight;
- lodash2.forOwn = forOwn;
- lodash2.forOwnRight = forOwnRight;
- lodash2.get = get;
- lodash2.gt = gt2;
- lodash2.gte = gte;
- lodash2.has = has;
- lodash2.hasIn = hasIn;
- lodash2.head = head;
- lodash2.identity = identity;
- lodash2.includes = includes;
- lodash2.indexOf = indexOf;
- lodash2.inRange = inRange;
- lodash2.invoke = invoke;
- lodash2.isArguments = isArguments;
- lodash2.isArray = isArray2;
- lodash2.isArrayBuffer = isArrayBuffer2;
- lodash2.isArrayLike = isArrayLike;
- lodash2.isArrayLikeObject = isArrayLikeObject;
- lodash2.isBoolean = isBoolean2;
- lodash2.isBuffer = isBuffer2;
- lodash2.isDate = isDate2;
- lodash2.isElement = isElement;
- lodash2.isEmpty = isEmpty;
- lodash2.isEqual = isEqual;
- lodash2.isEqualWith = isEqualWith;
- lodash2.isError = isError;
- lodash2.isFinite = isFinite2;
- lodash2.isFunction = isFunction2;
- lodash2.isInteger = isInteger;
- lodash2.isLength = isLength;
- lodash2.isMap = isMap;
- lodash2.isMatch = isMatch;
- lodash2.isMatchWith = isMatchWith;
- lodash2.isNaN = isNaN2;
- lodash2.isNative = isNative;
- lodash2.isNil = isNil;
- lodash2.isNull = isNull;
- lodash2.isNumber = isNumber2;
- lodash2.isObject = isObject2;
- lodash2.isObjectLike = isObjectLike;
- lodash2.isPlainObject = isPlainObject2;
- lodash2.isRegExp = isRegExp2;
- lodash2.isSafeInteger = isSafeInteger;
- lodash2.isSet = isSet;
- lodash2.isString = isString2;
- lodash2.isSymbol = isSymbol;
- lodash2.isTypedArray = isTypedArray2;
- lodash2.isUndefined = isUndefined2;
- lodash2.isWeakMap = isWeakMap;
- lodash2.isWeakSet = isWeakSet;
- lodash2.join = join;
- lodash2.kebabCase = kebabCase;
- lodash2.last = last;
- lodash2.lastIndexOf = lastIndexOf;
- lodash2.lowerCase = lowerCase;
- lodash2.lowerFirst = lowerFirst;
- lodash2.lt = lt2;
- lodash2.lte = lte;
- lodash2.max = max;
- lodash2.maxBy = maxBy;
- lodash2.mean = mean;
- lodash2.meanBy = meanBy;
- lodash2.min = min;
- lodash2.minBy = minBy;
- lodash2.stubArray = stubArray;
- lodash2.stubFalse = stubFalse;
- lodash2.stubObject = stubObject;
- lodash2.stubString = stubString;
- lodash2.stubTrue = stubTrue;
- lodash2.multiply = multiply;
- lodash2.nth = nth;
- lodash2.noConflict = noConflict;
- lodash2.noop = noop2;
- lodash2.now = now2;
- lodash2.pad = pad;
- lodash2.padEnd = padEnd;
- lodash2.padStart = padStart;
- lodash2.parseInt = parseInt2;
- lodash2.random = random2;
- lodash2.reduce = reduce;
- lodash2.reduceRight = reduceRight;
- lodash2.repeat = repeat2;
- lodash2.replace = replace;
- lodash2.result = result2;
- lodash2.round = round2;
- lodash2.runInContext = runInContext2;
- lodash2.sample = sample;
- lodash2.size = size;
- lodash2.snakeCase = snakeCase;
- lodash2.some = some;
- lodash2.sortedIndex = sortedIndex;
- lodash2.sortedIndexBy = sortedIndexBy;
- lodash2.sortedIndexOf = sortedIndexOf;
- lodash2.sortedLastIndex = sortedLastIndex;
- lodash2.sortedLastIndexBy = sortedLastIndexBy;
- lodash2.sortedLastIndexOf = sortedLastIndexOf;
- lodash2.startCase = startCase;
- lodash2.startsWith = startsWith2;
- lodash2.subtract = subtract;
- lodash2.sum = sum;
- lodash2.sumBy = sumBy;
- lodash2.template = template;
- lodash2.times = times2;
- lodash2.toFinite = toFinite;
- lodash2.toInteger = toInteger;
- lodash2.toLength = toLength;
- lodash2.toLower = toLower;
- lodash2.toNumber = toNumber;
- lodash2.toSafeInteger = toSafeInteger;
- lodash2.toString = toString2;
- lodash2.toUpper = toUpper;
- lodash2.trim = trim2;
- lodash2.trimEnd = trimEnd;
- lodash2.trimStart = trimStart;
- lodash2.truncate = truncate;
- lodash2.unescape = unescape2;
- lodash2.uniqueId = uniqueId;
- lodash2.upperCase = upperCase;
- lodash2.upperFirst = upperFirst;
- lodash2.each = forEach2;
- lodash2.eachRight = forEachRight;
- lodash2.first = head;
- mixin(lodash2, function() {
- var source = {};
- baseForOwn(lodash2, function(func, methodName) {
- if (!hasOwnProperty2.call(lodash2.prototype, methodName)) {
- source[methodName] = func;
- }
- });
- return source;
- }(), { "chain": false });
- lodash2.VERSION = VERSION2;
- arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
- lodash2[methodName].placeholder = lodash2;
- });
- arrayEach(["drop", "take"], function(methodName, index2) {
- LazyWrapper.prototype[methodName] = function(n2) {
- n2 = n2 === undefined$1 ? 1 : nativeMax(toInteger(n2), 0);
- var result3 = this.__filtered__ && !index2 ? new LazyWrapper(this) : this.clone();
- if (result3.__filtered__) {
- result3.__takeCount__ = nativeMin(n2, result3.__takeCount__);
- } else {
- result3.__views__.push({
- "size": nativeMin(n2, MAX_ARRAY_LENGTH),
- "type": methodName + (result3.__dir__ < 0 ? "Right" : "")
- });
- }
- return result3;
- };
- LazyWrapper.prototype[methodName + "Right"] = function(n2) {
- return this.reverse()[methodName](n2).reverse();
- };
- });
- arrayEach(["filter", "map", "takeWhile"], function(methodName, index2) {
- var type = index2 + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
- LazyWrapper.prototype[methodName] = function(iteratee2) {
- var result3 = this.clone();
- result3.__iteratees__.push({
- "iteratee": getIteratee(iteratee2, 3),
- "type": type
- });
- result3.__filtered__ = result3.__filtered__ || isFilter;
- return result3;
- };
- });
- arrayEach(["head", "last"], function(methodName, index2) {
- var takeName = "take" + (index2 ? "Right" : "");
- LazyWrapper.prototype[methodName] = function() {
- return this[takeName](1).value()[0];
- };
- });
- arrayEach(["initial", "tail"], function(methodName, index2) {
- var dropName = "drop" + (index2 ? "" : "Right");
- LazyWrapper.prototype[methodName] = function() {
- return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
- };
- });
- LazyWrapper.prototype.compact = function() {
- return this.filter(identity);
- };
- LazyWrapper.prototype.find = function(predicate) {
- return this.filter(predicate).head();
- };
- LazyWrapper.prototype.findLast = function(predicate) {
- return this.reverse().find(predicate);
- };
- LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
- if (typeof path == "function") {
- return new LazyWrapper(this);
- }
- return this.map(function(value) {
- return baseInvoke(value, path, args);
- });
- });
- LazyWrapper.prototype.reject = function(predicate) {
- return this.filter(negate(getIteratee(predicate)));
- };
- LazyWrapper.prototype.slice = function(start, end) {
- start = toInteger(start);
- var result3 = this;
- if (result3.__filtered__ && (start > 0 || end < 0)) {
- return new LazyWrapper(result3);
- }
- if (start < 0) {
- result3 = result3.takeRight(-start);
- } else if (start) {
- result3 = result3.drop(start);
- }
- if (end !== undefined$1) {
- end = toInteger(end);
- result3 = end < 0 ? result3.dropRight(-end) : result3.take(end - start);
- }
- return result3;
- };
- LazyWrapper.prototype.takeRightWhile = function(predicate) {
- return this.reverse().takeWhile(predicate).reverse();
- };
- LazyWrapper.prototype.toArray = function() {
- return this.take(MAX_ARRAY_LENGTH);
- };
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
- if (!lodashFunc) {
- return;
- }
- lodash2.prototype[methodName] = function() {
- var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray2(value);
- var interceptor = function(value2) {
- var result4 = lodashFunc.apply(lodash2, arrayPush([value2], args));
- return isTaker && chainAll ? result4[0] : result4;
- };
- if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
- isLazy = useLazy = false;
- }
- var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
- if (!retUnwrapped && useLazy) {
- value = onlyLazy ? value : new LazyWrapper(this);
- var result3 = func.apply(value, args);
- result3.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 });
- return new LodashWrapper(result3, chainAll);
- }
- if (isUnwrapped && onlyLazy) {
- return func.apply(this, args);
- }
- result3 = this.thru(interceptor);
- return isUnwrapped ? isTaker ? result3.value()[0] : result3.value() : result3;
- };
- });
- arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
- var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
- lodash2.prototype[methodName] = function() {
- var args = arguments;
- if (retUnwrapped && !this.__chain__) {
- var value = this.value();
- return func.apply(isArray2(value) ? value : [], args);
- }
- return this[chainName](function(value2) {
- return func.apply(isArray2(value2) ? value2 : [], args);
- });
- };
- });
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var lodashFunc = lodash2[methodName];
- if (lodashFunc) {
- var key = lodashFunc.name + "";
- if (!hasOwnProperty2.call(realNames, key)) {
- realNames[key] = [];
- }
- realNames[key].push({ "name": methodName, "func": lodashFunc });
- }
- });
- realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
- "name": "wrapper",
- "func": undefined$1
- }];
- LazyWrapper.prototype.clone = lazyClone;
- LazyWrapper.prototype.reverse = lazyReverse;
- LazyWrapper.prototype.value = lazyValue;
- lodash2.prototype.at = wrapperAt;
- lodash2.prototype.chain = wrapperChain;
- lodash2.prototype.commit = wrapperCommit;
- lodash2.prototype.next = wrapperNext;
- lodash2.prototype.plant = wrapperPlant;
- lodash2.prototype.reverse = wrapperReverse;
- lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
- lodash2.prototype.first = lodash2.prototype.head;
- if (symIterator) {
- lodash2.prototype[symIterator] = wrapperToIterator;
- }
- return lodash2;
- };
- var _2 = runInContext();
- if (freeModule) {
- (freeModule.exports = _2)._ = _2;
- freeExports._ = _2;
- } else {
- root._ = _2;
- }
- }).call(commonjsGlobal);
- })(lodash, lodash.exports);
- var lodashExports = lodash.exports;
- const _$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
- /*!
- * @intlify/shared v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const inBrowser = typeof window !== "undefined";
- let mark;
- let measure;
- {
- const perf2 = inBrowser && window.performance;
- if (perf2 && perf2.mark && perf2.measure && perf2.clearMarks && perf2.clearMeasures) {
- mark = (tag) => perf2.mark(tag);
- measure = (name2, startTag, endTag) => {
- perf2.measure(name2, startTag, endTag);
- perf2.clearMarks(startTag);
- perf2.clearMarks(endTag);
- };
- }
- }
- const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g;
- function format(message, ...args) {
- if (args.length === 1 && isObject$5(args[0])) {
- args = args[0];
- }
- if (!args || !args.hasOwnProperty) {
- args = {};
- }
- return message.replace(RE_ARGS, (match, identifier) => {
- return args.hasOwnProperty(identifier) ? args[identifier] : "";
- });
- }
- const hasSymbol = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
- const makeSymbol = (name2) => hasSymbol ? Symbol(name2) : name2;
- const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });
- const friendlyJSONstringify = (json) => JSON.stringify(json).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027");
- const isNumber$1 = (val) => typeof val === "number" && isFinite(val);
- const isDate$1 = (val) => toTypeString(val) === "[object Date]";
- const isRegExp$1 = (val) => toTypeString(val) === "[object RegExp]";
- const isEmptyObject = (val) => isPlainObject$1(val) && Object.keys(val).length === 0;
- function warn(msg, err) {
- if (typeof console !== "undefined") {
- console.warn(`[intlify] ` + msg);
- if (err) {
- console.warn(err.stack);
- }
- }
- }
- const assign = Object.assign;
- let _globalThis;
- const getGlobalThis = () => {
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
- };
- function escapeHtml(rawText) {
- return rawText.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
- }
- const hasOwnProperty$3 = Object.prototype.hasOwnProperty;
- function hasOwn$2(obj, key) {
- return hasOwnProperty$3.call(obj, key);
- }
- const isArray$2 = Array.isArray;
- const isFunction$1 = (val) => typeof val === "function";
- const isString$1 = (val) => typeof val === "string";
- const isBoolean$1 = (val) => typeof val === "boolean";
- const isObject$5 = (val) => (
- // eslint-disable-line
- val !== null && typeof val === "object"
- );
- const objectToString = Object.prototype.toString;
- const toTypeString = (value) => objectToString.call(value);
- const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]";
- const toDisplayString = (val) => {
- return val == null ? "" : isArray$2(val) || isPlainObject$1(val) && val.toString === objectToString ? JSON.stringify(val, null, 2) : String(val);
- };
- const RANGE = 2;
- function generateCodeFrame(source, start = 0, end = source.length) {
- const lines = source.split(/\r?\n/);
- let count = 0;
- const res = [];
- for (let i2 = 0; i2 < lines.length; i2++) {
- count += lines[i2].length + 1;
- if (count >= start) {
- for (let j2 = i2 - RANGE; j2 <= i2 + RANGE || end > count; j2++) {
- if (j2 < 0 || j2 >= lines.length)
- continue;
- const line = j2 + 1;
- res.push(`${line}${" ".repeat(3 - String(line).length)}| ${lines[j2]}`);
- const lineLength = lines[j2].length;
- if (j2 === i2) {
- const pad = start - (count - lineLength) + 1;
- const length = Math.max(1, end > count ? lineLength - pad : end - start);
- res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
- } else if (j2 > i2) {
- if (end > count) {
- const length = Math.max(Math.min(end - count, lineLength), 1);
- res.push(` | ` + "^".repeat(length));
- }
- count += lineLength + 1;
- }
- }
- break;
- }
- }
- return res.join("\n");
- }
- function createEmitter() {
- const events = /* @__PURE__ */ new Map();
- const emitter = {
- events,
- on(event, handler) {
- const handlers = events.get(event);
- const added = handlers && handlers.push(handler);
- if (!added) {
- events.set(event, [handler]);
- }
- },
- off(event, handler) {
- const handlers = events.get(event);
- if (handlers) {
- handlers.splice(handlers.indexOf(handler) >>> 0, 1);
- }
- },
- emit(event, payload) {
- (events.get(event) || []).slice().map((handler) => handler(payload));
- (events.get("*") || []).slice().map((handler) => handler(event, payload));
- }
- };
- return emitter;
- }
- /*!
- * @intlify/message-resolver v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
- function hasOwn$1(obj, key) {
- return hasOwnProperty$2.call(obj, key);
- }
- const isObject$4 = (val) => (
- // eslint-disable-line
- val !== null && typeof val === "object"
- );
- const pathStateMachine = [];
- pathStateMachine[
- 0
- /* BEFORE_PATH */
- ] = {
- [
- "w"
- /* WORKSPACE */
- ]: [
- 0
- /* BEFORE_PATH */
- ],
- [
- "i"
- /* IDENT */
- ]: [
- 3,
- 0
- /* APPEND */
- ],
- [
- "["
- /* LEFT_BRACKET */
- ]: [
- 4
- /* IN_SUB_PATH */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: [
- 7
- /* AFTER_PATH */
- ]
- };
- pathStateMachine[
- 1
- /* IN_PATH */
- ] = {
- [
- "w"
- /* WORKSPACE */
- ]: [
- 1
- /* IN_PATH */
- ],
- [
- "."
- /* DOT */
- ]: [
- 2
- /* BEFORE_IDENT */
- ],
- [
- "["
- /* LEFT_BRACKET */
- ]: [
- 4
- /* IN_SUB_PATH */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: [
- 7
- /* AFTER_PATH */
- ]
- };
- pathStateMachine[
- 2
- /* BEFORE_IDENT */
- ] = {
- [
- "w"
- /* WORKSPACE */
- ]: [
- 2
- /* BEFORE_IDENT */
- ],
- [
- "i"
- /* IDENT */
- ]: [
- 3,
- 0
- /* APPEND */
- ],
- [
- "0"
- /* ZERO */
- ]: [
- 3,
- 0
- /* APPEND */
- ]
- };
- pathStateMachine[
- 3
- /* IN_IDENT */
- ] = {
- [
- "i"
- /* IDENT */
- ]: [
- 3,
- 0
- /* APPEND */
- ],
- [
- "0"
- /* ZERO */
- ]: [
- 3,
- 0
- /* APPEND */
- ],
- [
- "w"
- /* WORKSPACE */
- ]: [
- 1,
- 1
- /* PUSH */
- ],
- [
- "."
- /* DOT */
- ]: [
- 2,
- 1
- /* PUSH */
- ],
- [
- "["
- /* LEFT_BRACKET */
- ]: [
- 4,
- 1
- /* PUSH */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: [
- 7,
- 1
- /* PUSH */
- ]
- };
- pathStateMachine[
- 4
- /* IN_SUB_PATH */
- ] = {
- [
- "'"
- /* SINGLE_QUOTE */
- ]: [
- 5,
- 0
- /* APPEND */
- ],
- [
- '"'
- /* DOUBLE_QUOTE */
- ]: [
- 6,
- 0
- /* APPEND */
- ],
- [
- "["
- /* LEFT_BRACKET */
- ]: [
- 4,
- 2
- /* INC_SUB_PATH_DEPTH */
- ],
- [
- "]"
- /* RIGHT_BRACKET */
- ]: [
- 1,
- 3
- /* PUSH_SUB_PATH */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: 8,
- [
- "l"
- /* ELSE */
- ]: [
- 4,
- 0
- /* APPEND */
- ]
- };
- pathStateMachine[
- 5
- /* IN_SINGLE_QUOTE */
- ] = {
- [
- "'"
- /* SINGLE_QUOTE */
- ]: [
- 4,
- 0
- /* APPEND */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: 8,
- [
- "l"
- /* ELSE */
- ]: [
- 5,
- 0
- /* APPEND */
- ]
- };
- pathStateMachine[
- 6
- /* IN_DOUBLE_QUOTE */
- ] = {
- [
- '"'
- /* DOUBLE_QUOTE */
- ]: [
- 4,
- 0
- /* APPEND */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: 8,
- [
- "l"
- /* ELSE */
- ]: [
- 6,
- 0
- /* APPEND */
- ]
- };
- const literalValueRE = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
- function isLiteral(exp) {
- return literalValueRE.test(exp);
- }
- function stripQuotes(str) {
- const a2 = str.charCodeAt(0);
- const b2 = str.charCodeAt(str.length - 1);
- return a2 === b2 && (a2 === 34 || a2 === 39) ? str.slice(1, -1) : str;
- }
- function getPathCharType(ch) {
- if (ch === void 0 || ch === null) {
- return "o";
- }
- const code2 = ch.charCodeAt(0);
- switch (code2) {
- case 91:
- case 93:
- case 46:
- case 34:
- case 39:
- return ch;
- case 95:
- case 36:
- case 45:
- return "i";
- case 9:
- case 10:
- case 13:
- case 160:
- case 65279:
- case 8232:
- case 8233:
- return "w";
- }
- return "i";
- }
- function formatSubPath(path) {
- const trimmed = path.trim();
- if (path.charAt(0) === "0" && isNaN(parseInt(path))) {
- return false;
- }
- return isLiteral(trimmed) ? stripQuotes(trimmed) : "*" + trimmed;
- }
- function parse$2(path) {
- const keys = [];
- let index2 = -1;
- let mode = 0;
- let subPathDepth = 0;
- let c2;
- let key;
- let newChar;
- let type;
- let transition;
- let action;
- let typeMap;
- const actions = [];
- actions[
- 0
- /* APPEND */
- ] = () => {
- if (key === void 0) {
- key = newChar;
- } else {
- key += newChar;
- }
- };
- actions[
- 1
- /* PUSH */
- ] = () => {
- if (key !== void 0) {
- keys.push(key);
- key = void 0;
- }
- };
- actions[
- 2
- /* INC_SUB_PATH_DEPTH */
- ] = () => {
- actions[
- 0
- /* APPEND */
- ]();
- subPathDepth++;
- };
- actions[
- 3
- /* PUSH_SUB_PATH */
- ] = () => {
- if (subPathDepth > 0) {
- subPathDepth--;
- mode = 4;
- actions[
- 0
- /* APPEND */
- ]();
- } else {
- subPathDepth = 0;
- if (key === void 0) {
- return false;
- }
- key = formatSubPath(key);
- if (key === false) {
- return false;
- } else {
- actions[
- 1
- /* PUSH */
- ]();
- }
- }
- };
- function maybeUnescapeQuote() {
- const nextChar = path[index2 + 1];
- if (mode === 5 && nextChar === "'" || mode === 6 && nextChar === '"') {
- index2++;
- newChar = "\\" + nextChar;
- actions[
- 0
- /* APPEND */
- ]();
- return true;
- }
- }
- while (mode !== null) {
- index2++;
- c2 = path[index2];
- if (c2 === "\\" && maybeUnescapeQuote()) {
- continue;
- }
- type = getPathCharType(c2);
- typeMap = pathStateMachine[mode];
- transition = typeMap[type] || typeMap[
- "l"
- /* ELSE */
- ] || 8;
- if (transition === 8) {
- return;
- }
- mode = transition[0];
- if (transition[1] !== void 0) {
- action = actions[transition[1]];
- if (action) {
- newChar = c2;
- if (action() === false) {
- return;
- }
- }
- }
- if (mode === 7) {
- return keys;
- }
- }
- }
- const cache = /* @__PURE__ */ new Map();
- function resolveValue(obj, path) {
- if (!isObject$4(obj)) {
- return null;
- }
- let hit = cache.get(path);
- if (!hit) {
- hit = parse$2(path);
- if (hit) {
- cache.set(path, hit);
- }
- }
- if (!hit) {
- return null;
- }
- const len = hit.length;
- let last = obj;
- let i2 = 0;
- while (i2 < len) {
- const val = last[hit[i2]];
- if (val === void 0) {
- return null;
- }
- last = val;
- i2++;
- }
- return last;
- }
- function handleFlatJson(obj) {
- if (!isObject$4(obj)) {
- return obj;
- }
- for (const key in obj) {
- if (!hasOwn$1(obj, key)) {
- continue;
- }
- if (!key.includes(
- "."
- /* DOT */
- )) {
- if (isObject$4(obj[key])) {
- handleFlatJson(obj[key]);
- }
- } else {
- const subKeys = key.split(
- "."
- /* DOT */
- );
- const lastIndex = subKeys.length - 1;
- let currentObj = obj;
- for (let i2 = 0; i2 < lastIndex; i2++) {
- if (!(subKeys[i2] in currentObj)) {
- currentObj[subKeys[i2]] = {};
- }
- currentObj = currentObj[subKeys[i2]];
- }
- currentObj[subKeys[lastIndex]] = obj[key];
- delete obj[key];
- if (isObject$4(currentObj[subKeys[lastIndex]])) {
- handleFlatJson(currentObj[subKeys[lastIndex]]);
- }
- }
- }
- return obj;
- }
- /*!
- * @intlify/runtime v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const DEFAULT_MODIFIER = (str) => str;
- const DEFAULT_MESSAGE = (ctx) => "";
- const DEFAULT_MESSAGE_DATA_TYPE = "text";
- const DEFAULT_NORMALIZE = (values) => values.length === 0 ? "" : values.join("");
- const DEFAULT_INTERPOLATE = toDisplayString;
- function pluralDefault(choice, choicesLength) {
- choice = Math.abs(choice);
- if (choicesLength === 2) {
- return choice ? choice > 1 ? 1 : 0 : 1;
- }
- return choice ? Math.min(choice, 2) : 0;
- }
- function getPluralIndex(options2) {
- const index2 = isNumber$1(options2.pluralIndex) ? options2.pluralIndex : -1;
- return options2.named && (isNumber$1(options2.named.count) || isNumber$1(options2.named.n)) ? isNumber$1(options2.named.count) ? options2.named.count : isNumber$1(options2.named.n) ? options2.named.n : index2 : index2;
- }
- function normalizeNamed(pluralIndex, props) {
- if (!props.count) {
- props.count = pluralIndex;
- }
- if (!props.n) {
- props.n = pluralIndex;
- }
- }
- function createMessageContext(options2 = {}) {
- const locale = options2.locale;
- const pluralIndex = getPluralIndex(options2);
- const pluralRule = isObject$5(options2.pluralRules) && isString$1(locale) && isFunction$1(options2.pluralRules[locale]) ? options2.pluralRules[locale] : pluralDefault;
- const orgPluralRule = isObject$5(options2.pluralRules) && isString$1(locale) && isFunction$1(options2.pluralRules[locale]) ? pluralDefault : void 0;
- const plural = (messages2) => messages2[pluralRule(pluralIndex, messages2.length, orgPluralRule)];
- const _list = options2.list || [];
- const list = (index2) => _list[index2];
- const _named = options2.named || {};
- isNumber$1(options2.pluralIndex) && normalizeNamed(pluralIndex, _named);
- const named = (key) => _named[key];
- function message(key) {
- const msg = isFunction$1(options2.messages) ? options2.messages(key) : isObject$5(options2.messages) ? options2.messages[key] : false;
- return !msg ? options2.parent ? options2.parent.message(key) : DEFAULT_MESSAGE : msg;
- }
- const _modifier = (name2) => options2.modifiers ? options2.modifiers[name2] : DEFAULT_MODIFIER;
- const normalize = isPlainObject$1(options2.processor) && isFunction$1(options2.processor.normalize) ? options2.processor.normalize : DEFAULT_NORMALIZE;
- const interpolate = isPlainObject$1(options2.processor) && isFunction$1(options2.processor.interpolate) ? options2.processor.interpolate : DEFAULT_INTERPOLATE;
- const type = isPlainObject$1(options2.processor) && isString$1(options2.processor.type) ? options2.processor.type : DEFAULT_MESSAGE_DATA_TYPE;
- const ctx = {
- [
- "list"
- /* LIST */
- ]: list,
- [
- "named"
- /* NAMED */
- ]: named,
- [
- "plural"
- /* PLURAL */
- ]: plural,
- [
- "linked"
- /* LINKED */
- ]: (key, modifier) => {
- const msg = message(key)(ctx);
- return isString$1(modifier) ? _modifier(modifier)(msg) : msg;
- },
- [
- "message"
- /* MESSAGE */
- ]: message,
- [
- "type"
- /* TYPE */
- ]: type,
- [
- "interpolate"
- /* INTERPOLATE */
- ]: interpolate,
- [
- "normalize"
- /* NORMALIZE */
- ]: normalize
- };
- return ctx;
- }
- /*!
- * @intlify/message-compiler v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const errorMessages$2 = {
- // tokenizer error messages
- [
- 0
- /* EXPECTED_TOKEN */
- ]: `Expected token: '{0}'`,
- [
- 1
- /* INVALID_TOKEN_IN_PLACEHOLDER */
- ]: `Invalid token in placeholder: '{0}'`,
- [
- 2
- /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */
- ]: `Unterminated single quote in placeholder`,
- [
- 3
- /* UNKNOWN_ESCAPE_SEQUENCE */
- ]: `Unknown escape sequence: \\{0}`,
- [
- 4
- /* INVALID_UNICODE_ESCAPE_SEQUENCE */
- ]: `Invalid unicode escape sequence: {0}`,
- [
- 5
- /* UNBALANCED_CLOSING_BRACE */
- ]: `Unbalanced closing brace`,
- [
- 6
- /* UNTERMINATED_CLOSING_BRACE */
- ]: `Unterminated closing brace`,
- [
- 7
- /* EMPTY_PLACEHOLDER */
- ]: `Empty placeholder`,
- [
- 8
- /* NOT_ALLOW_NEST_PLACEHOLDER */
- ]: `Not allowed nest placeholder`,
- [
- 9
- /* INVALID_LINKED_FORMAT */
- ]: `Invalid linked format`,
- // parser error messages
- [
- 10
- /* MUST_HAVE_MESSAGES_IN_PLURAL */
- ]: `Plural must have messages`,
- [
- 11
- /* UNEXPECTED_EMPTY_LINKED_MODIFIER */
- ]: `Unexpected empty linked modifier`,
- [
- 12
- /* UNEXPECTED_EMPTY_LINKED_KEY */
- ]: `Unexpected empty linked key`,
- [
- 13
- /* UNEXPECTED_LEXICAL_ANALYSIS */
- ]: `Unexpected lexical analysis in token: '{0}'`
- };
- function createCompileError(code2, loc, options2 = {}) {
- const { domain, messages: messages2, args } = options2;
- const msg = format((messages2 || errorMessages$2)[code2] || "", ...args || []);
- const error2 = new SyntaxError(String(msg));
- error2.code = code2;
- if (loc) {
- error2.location = loc;
- }
- error2.domain = domain;
- return error2;
- }
- /*!
- * @intlify/devtools-if v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const IntlifyDevToolsHooks = {
- I18nInit: "i18n:init",
- FunctionTranslate: "function:translate"
- };
- /*!
- * @intlify/core-base v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- let devtools = null;
- function setDevToolsHook(hook) {
- devtools = hook;
- }
- function initI18nDevTools(i18n2, version, meta) {
- devtools && devtools.emit(IntlifyDevToolsHooks.I18nInit, {
- timestamp: Date.now(),
- i18n: i18n2,
- version,
- meta
- });
- }
- const translateDevTools = /* @__PURE__ */ createDevToolsHook(IntlifyDevToolsHooks.FunctionTranslate);
- function createDevToolsHook(hook) {
- return (payloads) => devtools && devtools.emit(hook, payloads);
- }
- const warnMessages$1 = {
- [
- 0
- /* NOT_FOUND_KEY */
- ]: `Not found '{key}' key in '{locale}' locale messages.`,
- [
- 1
- /* FALLBACK_TO_TRANSLATE */
- ]: `Fall back to translate '{key}' key with '{target}' locale.`,
- [
- 2
- /* CANNOT_FORMAT_NUMBER */
- ]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
- [
- 3
- /* FALLBACK_TO_NUMBER_FORMAT */
- ]: `Fall back to number format '{key}' key with '{target}' locale.`,
- [
- 4
- /* CANNOT_FORMAT_DATE */
- ]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
- [
- 5
- /* FALLBACK_TO_DATE_FORMAT */
- ]: `Fall back to datetime format '{key}' key with '{target}' locale.`
- };
- function getWarnMessage$1(code2, ...args) {
- return format(warnMessages$1[code2], ...args);
- }
- const VERSION$2 = "9.1.9";
- const NOT_REOSLVED = -1;
- const MISSING_RESOLVE_VALUE = "";
- function getDefaultLinkedModifiers() {
- return {
- upper: (val) => isString$1(val) ? val.toUpperCase() : val,
- lower: (val) => isString$1(val) ? val.toLowerCase() : val,
- // prettier-ignore
- capitalize: (val) => isString$1(val) ? `${val.charAt(0).toLocaleUpperCase()}${val.substr(1)}` : val
- };
- }
- let _compiler;
- let _additionalMeta = null;
- const setAdditionalMeta = (meta) => {
- _additionalMeta = meta;
- };
- const getAdditionalMeta = () => _additionalMeta;
- let _cid = 0;
- function createCoreContext(options2 = {}) {
- const version = isString$1(options2.version) ? options2.version : VERSION$2;
- const locale = isString$1(options2.locale) ? options2.locale : "en-US";
- const fallbackLocale = isArray$2(options2.fallbackLocale) || isPlainObject$1(options2.fallbackLocale) || isString$1(options2.fallbackLocale) || options2.fallbackLocale === false ? options2.fallbackLocale : locale;
- const messages2 = isPlainObject$1(options2.messages) ? options2.messages : { [locale]: {} };
- const datetimeFormats = isPlainObject$1(options2.datetimeFormats) ? options2.datetimeFormats : { [locale]: {} };
- const numberFormats = isPlainObject$1(options2.numberFormats) ? options2.numberFormats : { [locale]: {} };
- const modifiers = assign({}, options2.modifiers || {}, getDefaultLinkedModifiers());
- const pluralRules = options2.pluralRules || {};
- const missing = isFunction$1(options2.missing) ? options2.missing : null;
- const missingWarn = isBoolean$1(options2.missingWarn) || isRegExp$1(options2.missingWarn) ? options2.missingWarn : true;
- const fallbackWarn = isBoolean$1(options2.fallbackWarn) || isRegExp$1(options2.fallbackWarn) ? options2.fallbackWarn : true;
- const fallbackFormat = !!options2.fallbackFormat;
- const unresolving = !!options2.unresolving;
- const postTranslation = isFunction$1(options2.postTranslation) ? options2.postTranslation : null;
- const processor = isPlainObject$1(options2.processor) ? options2.processor : null;
- const warnHtmlMessage = isBoolean$1(options2.warnHtmlMessage) ? options2.warnHtmlMessage : true;
- const escapeParameter = !!options2.escapeParameter;
- const messageCompiler = isFunction$1(options2.messageCompiler) ? options2.messageCompiler : _compiler;
- const onWarn = isFunction$1(options2.onWarn) ? options2.onWarn : warn;
- const internalOptions = options2;
- const __datetimeFormatters = isObject$5(internalOptions.__datetimeFormatters) ? internalOptions.__datetimeFormatters : /* @__PURE__ */ new Map();
- const __numberFormatters = isObject$5(internalOptions.__numberFormatters) ? internalOptions.__numberFormatters : /* @__PURE__ */ new Map();
- const __meta = isObject$5(internalOptions.__meta) ? internalOptions.__meta : {};
- _cid++;
- const context = {
- version,
- cid: _cid,
- locale,
- fallbackLocale,
- messages: messages2,
- datetimeFormats,
- numberFormats,
- modifiers,
- pluralRules,
- missing,
- missingWarn,
- fallbackWarn,
- fallbackFormat,
- unresolving,
- postTranslation,
- processor,
- warnHtmlMessage,
- escapeParameter,
- messageCompiler,
- onWarn,
- __datetimeFormatters,
- __numberFormatters,
- __meta
- };
- {
- context.__v_emitter = internalOptions.__v_emitter != null ? internalOptions.__v_emitter : void 0;
- }
- {
- initI18nDevTools(context, version, __meta);
- }
- return context;
- }
- function isTranslateFallbackWarn(fallback, key) {
- return fallback instanceof RegExp ? fallback.test(key) : fallback;
- }
- function isTranslateMissingWarn(missing, key) {
- return missing instanceof RegExp ? missing.test(key) : missing;
- }
- function handleMissing(context, key, locale, missingWarn, type) {
- const { missing, onWarn } = context;
- {
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("missing", {
- locale,
- key,
- type,
- groupId: `${type}:${key}`
- });
- }
- }
- if (missing !== null) {
- const ret = missing(context, locale, key, type);
- return isString$1(ret) ? ret : key;
- } else {
- if (isTranslateMissingWarn(missingWarn, key)) {
- onWarn(getWarnMessage$1(0, { key, locale }));
- }
- return key;
- }
- }
- function getLocaleChain(ctx, fallback, start) {
- const context = ctx;
- if (!context.__localeChainCache) {
- context.__localeChainCache = /* @__PURE__ */ new Map();
- }
- let chain = context.__localeChainCache.get(start);
- if (!chain) {
- chain = [];
- let block = [start];
- while (isArray$2(block)) {
- block = appendBlockToChain(chain, block, fallback);
- }
- const defaults2 = isArray$2(fallback) ? fallback : isPlainObject$1(fallback) ? fallback["default"] ? fallback["default"] : null : fallback;
- block = isString$1(defaults2) ? [defaults2] : defaults2;
- if (isArray$2(block)) {
- appendBlockToChain(chain, block, false);
- }
- context.__localeChainCache.set(start, chain);
- }
- return chain;
- }
- function appendBlockToChain(chain, block, blocks) {
- let follow = true;
- for (let i2 = 0; i2 < block.length && isBoolean$1(follow); i2++) {
- const locale = block[i2];
- if (isString$1(locale)) {
- follow = appendLocaleToChain(chain, block[i2], blocks);
- }
- }
- return follow;
- }
- function appendLocaleToChain(chain, locale, blocks) {
- let follow;
- const tokens = locale.split("-");
- do {
- const target = tokens.join("-");
- follow = appendItemToChain(chain, target, blocks);
- tokens.splice(-1, 1);
- } while (tokens.length && follow === true);
- return follow;
- }
- function appendItemToChain(chain, target, blocks) {
- let follow = false;
- if (!chain.includes(target)) {
- follow = true;
- if (target) {
- follow = target[target.length - 1] !== "!";
- const locale = target.replace(/!/g, "");
- chain.push(locale);
- if ((isArray$2(blocks) || isPlainObject$1(blocks)) && blocks[locale]) {
- follow = blocks[locale];
- }
- }
- }
- return follow;
- }
- function updateFallbackLocale(ctx, locale, fallback) {
- const context = ctx;
- context.__localeChainCache = /* @__PURE__ */ new Map();
- getLocaleChain(ctx, fallback, locale);
- }
- function createCoreError(code2) {
- return createCompileError(code2, null, { messages: errorMessages$1 });
- }
- const errorMessages$1 = {
- [
- 14
- /* INVALID_ARGUMENT */
- ]: "Invalid arguments",
- [
- 15
- /* INVALID_DATE_ARGUMENT */
- ]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
- [
- 16
- /* INVALID_ISO_DATE_ARGUMENT */
- ]: "The argument provided is not a valid ISO date string"
- };
- const NOOP_MESSAGE_FUNCTION = () => "";
- const isMessageFunction = (val) => isFunction$1(val);
- function translate(context, ...args) {
- const { fallbackFormat, postTranslation, unresolving, fallbackLocale, messages: messages2 } = context;
- const [key, options2] = parseTranslateArgs(...args);
- const missingWarn = isBoolean$1(options2.missingWarn) ? options2.missingWarn : context.missingWarn;
- const fallbackWarn = isBoolean$1(options2.fallbackWarn) ? options2.fallbackWarn : context.fallbackWarn;
- const escapeParameter = isBoolean$1(options2.escapeParameter) ? options2.escapeParameter : context.escapeParameter;
- const resolvedMessage = !!options2.resolvedMessage;
- const defaultMsgOrKey = isString$1(options2.default) || isBoolean$1(options2.default) ? !isBoolean$1(options2.default) ? options2.default : key : fallbackFormat ? key : "";
- const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== "";
- const locale = isString$1(options2.locale) ? options2.locale : context.locale;
- escapeParameter && escapeParams(options2);
- let [format2, targetLocale, message] = !resolvedMessage ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) : [
- key,
- locale,
- messages2[locale] || {}
- ];
- let cacheBaseKey = key;
- if (!resolvedMessage && !(isString$1(format2) || isMessageFunction(format2))) {
- if (enableDefaultMsg) {
- format2 = defaultMsgOrKey;
- cacheBaseKey = format2;
- }
- }
- if (!resolvedMessage && (!(isString$1(format2) || isMessageFunction(format2)) || !isString$1(targetLocale))) {
- return unresolving ? NOT_REOSLVED : key;
- }
- if (isString$1(format2) && context.messageCompiler == null) {
- warn(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${key}'.`);
- return key;
- }
- let occurred = false;
- const errorDetector = () => {
- occurred = true;
- };
- const msg = !isMessageFunction(format2) ? compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, errorDetector) : format2;
- if (occurred) {
- return format2;
- }
- const ctxOptions = getMessageContextOptions(context, targetLocale, message, options2);
- const msgContext = createMessageContext(ctxOptions);
- const messaged = evaluateMessage(context, msg, msgContext);
- const ret = postTranslation ? postTranslation(messaged) : messaged;
- {
- const payloads = {
- timestamp: Date.now(),
- key: isString$1(key) ? key : isMessageFunction(format2) ? format2.key : "",
- locale: targetLocale || (isMessageFunction(format2) ? format2.locale : ""),
- format: isString$1(format2) ? format2 : isMessageFunction(format2) ? format2.source : "",
- message: ret
- };
- payloads.meta = assign({}, context.__meta, getAdditionalMeta() || {});
- translateDevTools(payloads);
- }
- return ret;
- }
- function escapeParams(options2) {
- if (isArray$2(options2.list)) {
- options2.list = options2.list.map((item) => isString$1(item) ? escapeHtml(item) : item);
- } else if (isObject$5(options2.named)) {
- Object.keys(options2.named).forEach((key) => {
- if (isString$1(options2.named[key])) {
- options2.named[key] = escapeHtml(options2.named[key]);
- }
- });
- }
- }
- function resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {
- const { messages: messages2, onWarn } = context;
- const locales = getLocaleChain(context, fallbackLocale, locale);
- let message = {};
- let targetLocale;
- let format2 = null;
- let from = locale;
- let to = null;
- const type = "translate";
- for (let i2 = 0; i2 < locales.length; i2++) {
- targetLocale = to = locales[i2];
- if (locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
- onWarn(getWarnMessage$1(1, {
- key,
- target: targetLocale
- }));
- }
- if (locale !== targetLocale) {
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("fallback", {
- type,
- key,
- from,
- to,
- groupId: `${type}:${key}`
- });
- }
- }
- message = messages2[targetLocale] || {};
- let start = null;
- let startTag;
- let endTag;
- if (inBrowser) {
- start = window.performance.now();
- startTag = "intlify-message-resolve-start";
- endTag = "intlify-message-resolve-end";
- mark && mark(startTag);
- }
- if ((format2 = resolveValue(message, key)) === null) {
- format2 = message[key];
- }
- if (inBrowser) {
- const end = window.performance.now();
- const emitter = context.__v_emitter;
- if (emitter && start && format2) {
- emitter.emit("message-resolve", {
- type: "message-resolve",
- key,
- message: format2,
- time: end - start,
- groupId: `${type}:${key}`
- });
- }
- if (startTag && endTag && mark && measure) {
- mark(endTag);
- measure("intlify message resolve", startTag, endTag);
- }
- }
- if (isString$1(format2) || isFunction$1(format2))
- break;
- const missingRet = handleMissing(context, key, targetLocale, missingWarn, type);
- if (missingRet !== key) {
- format2 = missingRet;
- }
- from = to;
- }
- return [format2, targetLocale, message];
- }
- function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, errorDetector) {
- const { messageCompiler, warnHtmlMessage } = context;
- if (isMessageFunction(format2)) {
- const msg2 = format2;
- msg2.locale = msg2.locale || targetLocale;
- msg2.key = msg2.key || key;
- return msg2;
- }
- let start = null;
- let startTag;
- let endTag;
- if (inBrowser) {
- start = window.performance.now();
- startTag = "intlify-message-compilation-start";
- endTag = "intlify-message-compilation-end";
- mark && mark(startTag);
- }
- const msg = messageCompiler(format2, getCompileOptions(context, targetLocale, cacheBaseKey, format2, warnHtmlMessage, errorDetector));
- if (inBrowser) {
- const end = window.performance.now();
- const emitter = context.__v_emitter;
- if (emitter && start) {
- emitter.emit("message-compilation", {
- type: "message-compilation",
- message: format2,
- time: end - start,
- groupId: `${"translate"}:${key}`
- });
- }
- if (startTag && endTag && mark && measure) {
- mark(endTag);
- measure("intlify message compilation", startTag, endTag);
- }
- }
- msg.locale = targetLocale;
- msg.key = key;
- msg.source = format2;
- return msg;
- }
- function evaluateMessage(context, msg, msgCtx) {
- let start = null;
- let startTag;
- let endTag;
- if (inBrowser) {
- start = window.performance.now();
- startTag = "intlify-message-evaluation-start";
- endTag = "intlify-message-evaluation-end";
- mark && mark(startTag);
- }
- const messaged = msg(msgCtx);
- if (inBrowser) {
- const end = window.performance.now();
- const emitter = context.__v_emitter;
- if (emitter && start) {
- emitter.emit("message-evaluation", {
- type: "message-evaluation",
- value: messaged,
- time: end - start,
- groupId: `${"translate"}:${msg.key}`
- });
- }
- if (startTag && endTag && mark && measure) {
- mark(endTag);
- measure("intlify message evaluation", startTag, endTag);
- }
- }
- return messaged;
- }
- function parseTranslateArgs(...args) {
- const [arg1, arg2, arg3] = args;
- const options2 = {};
- if (!isString$1(arg1) && !isNumber$1(arg1) && !isMessageFunction(arg1)) {
- throw createCoreError(
- 14
- /* INVALID_ARGUMENT */
- );
- }
- const key = isNumber$1(arg1) ? String(arg1) : isMessageFunction(arg1) ? arg1 : arg1;
- if (isNumber$1(arg2)) {
- options2.plural = arg2;
- } else if (isString$1(arg2)) {
- options2.default = arg2;
- } else if (isPlainObject$1(arg2) && !isEmptyObject(arg2)) {
- options2.named = arg2;
- } else if (isArray$2(arg2)) {
- options2.list = arg2;
- }
- if (isNumber$1(arg3)) {
- options2.plural = arg3;
- } else if (isString$1(arg3)) {
- options2.default = arg3;
- } else if (isPlainObject$1(arg3)) {
- assign(options2, arg3);
- }
- return [key, options2];
- }
- function getCompileOptions(context, locale, key, source, warnHtmlMessage, errorDetector) {
- return {
- warnHtmlMessage,
- onError: (err) => {
- errorDetector && errorDetector(err);
- {
- const message = `Message compilation error: ${err.message}`;
- const codeFrame = err.location && generateCodeFrame(source, err.location.start.offset, err.location.end.offset);
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("compile-error", {
- message: source,
- error: err.message,
- start: err.location && err.location.start.offset,
- end: err.location && err.location.end.offset,
- groupId: `${"translate"}:${key}`
- });
- }
- console.error(codeFrame ? `${message}
- ${codeFrame}` : message);
- }
- },
- onCacheKey: (source2) => generateFormatCacheKey(locale, key, source2)
- };
- }
- function getMessageContextOptions(context, locale, message, options2) {
- const { modifiers, pluralRules } = context;
- const resolveMessage = (key) => {
- const val = resolveValue(message, key);
- if (isString$1(val)) {
- let occurred = false;
- const errorDetector = () => {
- occurred = true;
- };
- const msg = compileMessageFormat(context, key, locale, val, key, errorDetector);
- return !occurred ? msg : NOOP_MESSAGE_FUNCTION;
- } else if (isMessageFunction(val)) {
- return val;
- } else {
- return NOOP_MESSAGE_FUNCTION;
- }
- };
- const ctxOptions = {
- locale,
- modifiers,
- pluralRules,
- messages: resolveMessage
- };
- if (context.processor) {
- ctxOptions.processor = context.processor;
- }
- if (options2.list) {
- ctxOptions.list = options2.list;
- }
- if (options2.named) {
- ctxOptions.named = options2.named;
- }
- if (isNumber$1(options2.plural)) {
- ctxOptions.pluralIndex = options2.plural;
- }
- return ctxOptions;
- }
- const intlDefined = typeof Intl !== "undefined";
- const Availabilities = {
- dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== "undefined",
- numberFormat: intlDefined && typeof Intl.NumberFormat !== "undefined"
- };
- function datetime(context, ...args) {
- const { datetimeFormats, unresolving, fallbackLocale, onWarn } = context;
- const { __datetimeFormatters } = context;
- if (!Availabilities.dateTimeFormat) {
- onWarn(getWarnMessage$1(
- 4
- /* CANNOT_FORMAT_DATE */
- ));
- return MISSING_RESOLVE_VALUE;
- }
- const [key, value, options2, overrides] = parseDateTimeArgs(...args);
- const missingWarn = isBoolean$1(options2.missingWarn) ? options2.missingWarn : context.missingWarn;
- const fallbackWarn = isBoolean$1(options2.fallbackWarn) ? options2.fallbackWarn : context.fallbackWarn;
- const part = !!options2.part;
- const locale = isString$1(options2.locale) ? options2.locale : context.locale;
- const locales = getLocaleChain(context, fallbackLocale, locale);
- if (!isString$1(key) || key === "") {
- return new Intl.DateTimeFormat(locale).format(value);
- }
- let datetimeFormat = {};
- let targetLocale;
- let format2 = null;
- let from = locale;
- let to = null;
- const type = "datetime format";
- for (let i2 = 0; i2 < locales.length; i2++) {
- targetLocale = to = locales[i2];
- if (locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
- onWarn(getWarnMessage$1(5, {
- key,
- target: targetLocale
- }));
- }
- if (locale !== targetLocale) {
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("fallback", {
- type,
- key,
- from,
- to,
- groupId: `${type}:${key}`
- });
- }
- }
- datetimeFormat = datetimeFormats[targetLocale] || {};
- format2 = datetimeFormat[key];
- if (isPlainObject$1(format2))
- break;
- handleMissing(context, key, targetLocale, missingWarn, type);
- from = to;
- }
- if (!isPlainObject$1(format2) || !isString$1(targetLocale)) {
- return unresolving ? NOT_REOSLVED : key;
- }
- let id = `${targetLocale}__${key}`;
- if (!isEmptyObject(overrides)) {
- id = `${id}__${JSON.stringify(overrides)}`;
- }
- let formatter = __datetimeFormatters.get(id);
- if (!formatter) {
- formatter = new Intl.DateTimeFormat(targetLocale, assign({}, format2, overrides));
- __datetimeFormatters.set(id, formatter);
- }
- return !part ? formatter.format(value) : formatter.formatToParts(value);
- }
- function parseDateTimeArgs(...args) {
- const [arg1, arg2, arg3, arg4] = args;
- let options2 = {};
- let overrides = {};
- let value;
- if (isString$1(arg1)) {
- if (!/\d{4}-\d{2}-\d{2}(T.*)?/.test(arg1)) {
- throw createCoreError(
- 16
- /* INVALID_ISO_DATE_ARGUMENT */
- );
- }
- value = new Date(arg1);
- try {
- value.toISOString();
- } catch (e2) {
- throw createCoreError(
- 16
- /* INVALID_ISO_DATE_ARGUMENT */
- );
- }
- } else if (isDate$1(arg1)) {
- if (isNaN(arg1.getTime())) {
- throw createCoreError(
- 15
- /* INVALID_DATE_ARGUMENT */
- );
- }
- value = arg1;
- } else if (isNumber$1(arg1)) {
- value = arg1;
- } else {
- throw createCoreError(
- 14
- /* INVALID_ARGUMENT */
- );
- }
- if (isString$1(arg2)) {
- options2.key = arg2;
- } else if (isPlainObject$1(arg2)) {
- options2 = arg2;
- }
- if (isString$1(arg3)) {
- options2.locale = arg3;
- } else if (isPlainObject$1(arg3)) {
- overrides = arg3;
- }
- if (isPlainObject$1(arg4)) {
- overrides = arg4;
- }
- return [options2.key || "", value, options2, overrides];
- }
- function clearDateTimeFormat(ctx, locale, format2) {
- const context = ctx;
- for (const key in format2) {
- const id = `${locale}__${key}`;
- if (!context.__datetimeFormatters.has(id)) {
- continue;
- }
- context.__datetimeFormatters.delete(id);
- }
- }
- function number$1(context, ...args) {
- const { numberFormats, unresolving, fallbackLocale, onWarn } = context;
- const { __numberFormatters } = context;
- if (!Availabilities.numberFormat) {
- onWarn(getWarnMessage$1(
- 2
- /* CANNOT_FORMAT_NUMBER */
- ));
- return MISSING_RESOLVE_VALUE;
- }
- const [key, value, options2, overrides] = parseNumberArgs(...args);
- const missingWarn = isBoolean$1(options2.missingWarn) ? options2.missingWarn : context.missingWarn;
- const fallbackWarn = isBoolean$1(options2.fallbackWarn) ? options2.fallbackWarn : context.fallbackWarn;
- const part = !!options2.part;
- const locale = isString$1(options2.locale) ? options2.locale : context.locale;
- const locales = getLocaleChain(context, fallbackLocale, locale);
- if (!isString$1(key) || key === "") {
- return new Intl.NumberFormat(locale).format(value);
- }
- let numberFormat = {};
- let targetLocale;
- let format2 = null;
- let from = locale;
- let to = null;
- const type = "number format";
- for (let i2 = 0; i2 < locales.length; i2++) {
- targetLocale = to = locales[i2];
- if (locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
- onWarn(getWarnMessage$1(3, {
- key,
- target: targetLocale
- }));
- }
- if (locale !== targetLocale) {
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("fallback", {
- type,
- key,
- from,
- to,
- groupId: `${type}:${key}`
- });
- }
- }
- numberFormat = numberFormats[targetLocale] || {};
- format2 = numberFormat[key];
- if (isPlainObject$1(format2))
- break;
- handleMissing(context, key, targetLocale, missingWarn, type);
- from = to;
- }
- if (!isPlainObject$1(format2) || !isString$1(targetLocale)) {
- return unresolving ? NOT_REOSLVED : key;
- }
- let id = `${targetLocale}__${key}`;
- if (!isEmptyObject(overrides)) {
- id = `${id}__${JSON.stringify(overrides)}`;
- }
- let formatter = __numberFormatters.get(id);
- if (!formatter) {
- formatter = new Intl.NumberFormat(targetLocale, assign({}, format2, overrides));
- __numberFormatters.set(id, formatter);
- }
- return !part ? formatter.format(value) : formatter.formatToParts(value);
- }
- function parseNumberArgs(...args) {
- const [arg1, arg2, arg3, arg4] = args;
- let options2 = {};
- let overrides = {};
- if (!isNumber$1(arg1)) {
- throw createCoreError(
- 14
- /* INVALID_ARGUMENT */
- );
- }
- const value = arg1;
- if (isString$1(arg2)) {
- options2.key = arg2;
- } else if (isPlainObject$1(arg2)) {
- options2 = arg2;
- }
- if (isString$1(arg3)) {
- options2.locale = arg3;
- } else if (isPlainObject$1(arg3)) {
- overrides = arg3;
- }
- if (isPlainObject$1(arg4)) {
- overrides = arg4;
- }
- return [options2.key || "", value, options2, overrides];
- }
- function clearNumberFormat(ctx, locale, format2) {
- const context = ctx;
- for (const key in format2) {
- const id = `${locale}__${key}`;
- if (!context.__numberFormatters.has(id)) {
- continue;
- }
- context.__numberFormatters.delete(id);
- }
- }
- function getDevtoolsGlobalHook() {
- return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
- }
- function getTarget() {
- return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
- }
- const isProxyAvailable = typeof Proxy === "function";
- const HOOK_SETUP = "devtools-plugin:setup";
- const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
- class ApiProxy {
- constructor(plugin, hook) {
- this.target = null;
- this.targetQueue = [];
- this.onQueue = [];
- this.plugin = plugin;
- this.hook = hook;
- const defaultSettings = {};
- if (plugin.settings) {
- for (const id in plugin.settings) {
- const item = plugin.settings[id];
- defaultSettings[id] = item.defaultValue;
- }
- }
- const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
- let currentSettings = { ...defaultSettings };
- try {
- const raw = localStorage.getItem(localSettingsSaveId);
- const data = JSON.parse(raw);
- Object.assign(currentSettings, data);
- } catch (e2) {
- }
- this.fallbacks = {
- getSettings() {
- return currentSettings;
- },
- setSettings(value) {
- try {
- localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
- } catch (e2) {
- }
- currentSettings = value;
- }
- };
- hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
- if (pluginId === this.plugin.id) {
- this.fallbacks.setSettings(value);
- }
- });
- this.proxiedOn = new Proxy({}, {
- get: (_target, prop) => {
- if (this.target) {
- return this.target.on[prop];
- } else {
- return (...args) => {
- this.onQueue.push({
- method: prop,
- args
- });
- };
- }
- }
- });
- this.proxiedTarget = new Proxy({}, {
- get: (_target, prop) => {
- if (this.target) {
- return this.target[prop];
- } else if (prop === "on") {
- return this.proxiedOn;
- } else if (Object.keys(this.fallbacks).includes(prop)) {
- return (...args) => {
- this.targetQueue.push({
- method: prop,
- args,
- resolve: () => {
- }
- });
- return this.fallbacks[prop](...args);
- };
- } else {
- return (...args) => {
- return new Promise((resolve) => {
- this.targetQueue.push({
- method: prop,
- args,
- resolve
- });
- });
- };
- }
- }
- });
- }
- async setRealTarget(target) {
- this.target = target;
- for (const item of this.onQueue) {
- this.target.on[item.method](...item.args);
- }
- for (const item of this.targetQueue) {
- item.resolve(await this.target[item.method](...item.args));
- }
- }
- }
- function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
- const target = getTarget();
- const hook = getDevtoolsGlobalHook();
- const enableProxy = isProxyAvailable && pluginDescriptor.enableEarlyProxy;
- if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
- hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
- } else {
- const proxy = enableProxy ? new ApiProxy(pluginDescriptor, hook) : null;
- const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
- list.push({
- pluginDescriptor,
- setupFn,
- proxy
- });
- if (proxy)
- setupFn(proxy.proxiedTarget);
- }
- }
- /*!
- * @intlify/vue-devtools v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const VueDevToolsLabels = {
- [
- "vue-devtools-plugin-vue-i18n"
- /* PLUGIN */
- ]: "Vue I18n devtools",
- [
- "vue-i18n-resource-inspector"
- /* CUSTOM_INSPECTOR */
- ]: "I18n Resources",
- [
- "vue-i18n-timeline"
- /* TIMELINE */
- ]: "Vue I18n"
- };
- const VueDevToolsPlaceholders = {
- [
- "vue-i18n-resource-inspector"
- /* CUSTOM_INSPECTOR */
- ]: "Search for scopes ..."
- };
- const VueDevToolsTimelineColors = {
- [
- "vue-i18n-timeline"
- /* TIMELINE */
- ]: 16764185
- };
- /*!
- * vue-i18n v9.1.9
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */
- const VERSION$1 = "9.1.9";
- function initFeatureFlags() {
- let needWarn = false;
- {
- needWarn = true;
- }
- if (needWarn) {
- console.warn(`You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.`);
- }
- }
- const warnMessages = {
- [
- 6
- /* FALLBACK_TO_ROOT */
- ]: `Fall back to {type} '{key}' with root locale.`,
- [
- 7
- /* NOT_SUPPORTED_PRESERVE */
- ]: `Not supported 'preserve'.`,
- [
- 8
- /* NOT_SUPPORTED_FORMATTER */
- ]: `Not supported 'formatter'.`,
- [
- 9
- /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
- ]: `Not supported 'preserveDirectiveContent'.`,
- [
- 10
- /* NOT_SUPPORTED_GET_CHOICE_INDEX */
- ]: `Not supported 'getChoiceIndex'.`,
- [
- 11
- /* COMPONENT_NAME_LEGACY_COMPATIBLE */
- ]: `Component name legacy compatible: '{name}' -> 'i18n'`,
- [
- 12
- /* NOT_FOUND_PARENT_SCOPE */
- ]: `Not found parent scope. use the global scope.`
- };
- function getWarnMessage(code2, ...args) {
- return format(warnMessages[code2], ...args);
- }
- function createI18nError(code2, ...args) {
- return createCompileError(code2, null, { messages: errorMessages, args });
- }
- const errorMessages = {
- [
- 14
- /* UNEXPECTED_RETURN_TYPE */
- ]: "Unexpected return type in composer",
- [
- 15
- /* INVALID_ARGUMENT */
- ]: "Invalid argument",
- [
- 16
- /* MUST_BE_CALL_SETUP_TOP */
- ]: "Must be called at the top of a `setup` function",
- [
- 17
- /* NOT_INSLALLED */
- ]: "Need to install with `app.use` function",
- [
- 22
- /* UNEXPECTED_ERROR */
- ]: "Unexpected error",
- [
- 18
- /* NOT_AVAILABLE_IN_LEGACY_MODE */
- ]: "Not available in legacy mode",
- [
- 19
- /* REQUIRED_VALUE */
- ]: `Required in value: {0}`,
- [
- 20
- /* INVALID_VALUE */
- ]: `Invalid value`,
- [
- 21
- /* CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN */
- ]: `Cannot setup vue-devtools plugin`
- };
- const DEVTOOLS_META = "__INTLIFY_META__";
- const TransrateVNodeSymbol = makeSymbol("__transrateVNode");
- const DatetimePartsSymbol = makeSymbol("__datetimeParts");
- const NumberPartsSymbol = makeSymbol("__numberParts");
- const EnableEmitter = makeSymbol("__enableEmitter");
- const DisableEmitter = makeSymbol("__disableEmitter");
- const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
- const InejctWithOption = makeSymbol("__injectWithOption");
- let composerID = 0;
- function defineCoreMissingHandler(missing) {
- return (ctx, locale, key, type) => {
- return missing(locale, key, vue.getCurrentInstance() || void 0, type);
- };
- }
- function getLocaleMessages(locale, options2) {
- const { messages: messages2, __i18n } = options2;
- const ret = isPlainObject$1(messages2) ? messages2 : isArray$2(__i18n) ? {} : { [locale]: {} };
- if (isArray$2(__i18n)) {
- __i18n.forEach(({ locale: locale2, resource }) => {
- if (locale2) {
- ret[locale2] = ret[locale2] || {};
- deepCopy(resource, ret[locale2]);
- } else {
- deepCopy(resource, ret);
- }
- });
- }
- if (options2.flatJson) {
- for (const key in ret) {
- if (hasOwn$2(ret, key)) {
- handleFlatJson(ret[key]);
- }
- }
- }
- return ret;
- }
- const isNotObjectOrIsArray = (val) => !isObject$5(val) || isArray$2(val);
- function deepCopy(src, des) {
- if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
- throw createI18nError(
- 20
- /* INVALID_VALUE */
- );
- }
- for (const key in src) {
- if (hasOwn$2(src, key)) {
- if (isNotObjectOrIsArray(src[key]) || isNotObjectOrIsArray(des[key])) {
- des[key] = src[key];
- } else {
- deepCopy(src[key], des[key]);
- }
- }
- }
- }
- const getMetaInfo = () => {
- const instance = vue.getCurrentInstance();
- return instance && instance.type[DEVTOOLS_META] ? { [DEVTOOLS_META]: instance.type[DEVTOOLS_META] } : null;
- };
- function createComposer(options2 = {}) {
- const { __root } = options2;
- const _isGlobal = __root === void 0;
- let _inheritLocale = isBoolean$1(options2.inheritLocale) ? options2.inheritLocale : true;
- const _locale = vue.ref(
- // prettier-ignore
- __root && _inheritLocale ? __root.locale.value : isString$1(options2.locale) ? options2.locale : "en-US"
- );
- const _fallbackLocale = vue.ref(
- // prettier-ignore
- __root && _inheritLocale ? __root.fallbackLocale.value : isString$1(options2.fallbackLocale) || isArray$2(options2.fallbackLocale) || isPlainObject$1(options2.fallbackLocale) || options2.fallbackLocale === false ? options2.fallbackLocale : _locale.value
- );
- const _messages = vue.ref(getLocaleMessages(_locale.value, options2));
- const _datetimeFormats = vue.ref(isPlainObject$1(options2.datetimeFormats) ? options2.datetimeFormats : { [_locale.value]: {} });
- const _numberFormats = vue.ref(isPlainObject$1(options2.numberFormats) ? options2.numberFormats : { [_locale.value]: {} });
- let _missingWarn = __root ? __root.missingWarn : isBoolean$1(options2.missingWarn) || isRegExp$1(options2.missingWarn) ? options2.missingWarn : true;
- let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean$1(options2.fallbackWarn) || isRegExp$1(options2.fallbackWarn) ? options2.fallbackWarn : true;
- let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean$1(options2.fallbackRoot) ? options2.fallbackRoot : true;
- let _fallbackFormat = !!options2.fallbackFormat;
- let _missing = isFunction$1(options2.missing) ? options2.missing : null;
- let _runtimeMissing = isFunction$1(options2.missing) ? defineCoreMissingHandler(options2.missing) : null;
- let _postTranslation = isFunction$1(options2.postTranslation) ? options2.postTranslation : null;
- let _warnHtmlMessage = isBoolean$1(options2.warnHtmlMessage) ? options2.warnHtmlMessage : true;
- let _escapeParameter = !!options2.escapeParameter;
- const _modifiers = __root ? __root.modifiers : isPlainObject$1(options2.modifiers) ? options2.modifiers : {};
- let _pluralRules = options2.pluralRules || __root && __root.pluralRules;
- let _context;
- function getCoreContext() {
- return createCoreContext({
- version: VERSION$1,
- locale: _locale.value,
- fallbackLocale: _fallbackLocale.value,
- messages: _messages.value,
- messageCompiler: function compileToFunction(source) {
- return (ctx) => {
- return ctx.normalize([source]);
- };
- },
- datetimeFormats: _datetimeFormats.value,
- numberFormats: _numberFormats.value,
- modifiers: _modifiers,
- pluralRules: _pluralRules,
- missing: _runtimeMissing === null ? void 0 : _runtimeMissing,
- missingWarn: _missingWarn,
- fallbackWarn: _fallbackWarn,
- fallbackFormat: _fallbackFormat,
- unresolving: true,
- postTranslation: _postTranslation === null ? void 0 : _postTranslation,
- warnHtmlMessage: _warnHtmlMessage,
- escapeParameter: _escapeParameter,
- __datetimeFormatters: isPlainObject$1(_context) ? _context.__datetimeFormatters : void 0,
- __numberFormatters: isPlainObject$1(_context) ? _context.__numberFormatters : void 0,
- __v_emitter: isPlainObject$1(_context) ? _context.__v_emitter : void 0,
- __meta: { framework: "vue" }
- });
- }
- _context = getCoreContext();
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
- function trackReactivityValues() {
- return [
- _locale.value,
- _fallbackLocale.value,
- _messages.value,
- _datetimeFormats.value,
- _numberFormats.value
- ];
- }
- const locale = vue.computed({
- get: () => _locale.value,
- set: (val) => {
- _locale.value = val;
- _context.locale = _locale.value;
- }
- });
- const fallbackLocale = vue.computed({
- get: () => _fallbackLocale.value,
- set: (val) => {
- _fallbackLocale.value = val;
- _context.fallbackLocale = _fallbackLocale.value;
- updateFallbackLocale(_context, _locale.value, val);
- }
- });
- const messages2 = vue.computed(() => _messages.value);
- const datetimeFormats = vue.computed(() => _datetimeFormats.value);
- const numberFormats = vue.computed(() => _numberFormats.value);
- function getPostTranslationHandler() {
- return isFunction$1(_postTranslation) ? _postTranslation : null;
- }
- function setPostTranslationHandler(handler) {
- _postTranslation = handler;
- _context.postTranslation = handler;
- }
- function getMissingHandler() {
- return _missing;
- }
- function setMissingHandler(handler) {
- if (handler !== null) {
- _runtimeMissing = defineCoreMissingHandler(handler);
- }
- _missing = handler;
- _context.missing = _runtimeMissing;
- }
- function isResolvedTranslateMessage(type, arg) {
- return type !== "translate" || !!arg.resolvedMessage === false;
- }
- function wrapWithDeps(fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) {
- trackReactivityValues();
- let ret;
- {
- try {
- setAdditionalMeta(getMetaInfo());
- ret = fn(_context);
- } finally {
- setAdditionalMeta(null);
- }
- }
- if (isNumber$1(ret) && ret === NOT_REOSLVED) {
- const [key, arg2] = argumentParser();
- if (__root && isString$1(key) && isResolvedTranslateMessage(warnType, arg2)) {
- if (_fallbackRoot && (isTranslateFallbackWarn(_fallbackWarn, key) || isTranslateMissingWarn(_missingWarn, key))) {
- warn(getWarnMessage(6, {
- key,
- type: warnType
- }));
- }
- {
- const { __v_emitter: emitter } = _context;
- if (emitter && _fallbackRoot) {
- emitter.emit("fallback", {
- type: warnType,
- key,
- to: "global",
- groupId: `${warnType}:${key}`
- });
- }
- }
- }
- return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key);
- } else if (successCondition(ret)) {
- return ret;
- } else {
- throw createI18nError(
- 14
- /* UNEXPECTED_RETURN_TYPE */
- );
- }
- }
- function t2(...args) {
- return wrapWithDeps((context) => translate(context, ...args), () => parseTranslateArgs(...args), "translate", (root) => root.t(...args), (key) => key, (val) => isString$1(val));
- }
- function rt2(...args) {
- const [arg1, arg2, arg3] = args;
- if (arg3 && !isObject$5(arg3)) {
- throw createI18nError(
- 15
- /* INVALID_ARGUMENT */
- );
- }
- return t2(...[arg1, arg2, assign({ resolvedMessage: true }, arg3 || {})]);
- }
- function d2(...args) {
- return wrapWithDeps((context) => datetime(context, ...args), () => parseDateTimeArgs(...args), "datetime format", (root) => root.d(...args), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val));
- }
- function n2(...args) {
- return wrapWithDeps((context) => number$1(context, ...args), () => parseNumberArgs(...args), "number format", (root) => root.n(...args), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val));
- }
- function normalize(values) {
- return values.map((val) => isString$1(val) ? vue.createVNode(vue.Text, null, val, 0) : val);
- }
- const interpolate = (val) => val;
- const processor = {
- normalize,
- interpolate,
- type: "vnode"
- };
- function transrateVNode(...args) {
- return wrapWithDeps(
- (context) => {
- let ret;
- const _context2 = context;
- try {
- _context2.processor = processor;
- ret = translate(_context2, ...args);
- } finally {
- _context2.processor = null;
- }
- return ret;
- },
- () => parseTranslateArgs(...args),
- "translate",
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (root) => root[TransrateVNodeSymbol](...args),
- (key) => [vue.createVNode(vue.Text, null, key, 0)],
- (val) => isArray$2(val)
- );
- }
- function numberParts(...args) {
- return wrapWithDeps(
- (context) => number$1(context, ...args),
- () => parseNumberArgs(...args),
- "number format",
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (root) => root[NumberPartsSymbol](...args),
- () => [],
- (val) => isString$1(val) || isArray$2(val)
- );
- }
- function datetimeParts(...args) {
- return wrapWithDeps(
- (context) => datetime(context, ...args),
- () => parseDateTimeArgs(...args),
- "datetime format",
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (root) => root[DatetimePartsSymbol](...args),
- () => [],
- (val) => isString$1(val) || isArray$2(val)
- );
- }
- function setPluralRules(rules2) {
- _pluralRules = rules2;
- _context.pluralRules = _pluralRules;
- }
- function te2(key, locale2) {
- const targetLocale = isString$1(locale2) ? locale2 : _locale.value;
- const message = getLocaleMessage(targetLocale);
- return resolveValue(message, key) !== null;
- }
- function resolveMessages(key) {
- let messages22 = null;
- const locales = getLocaleChain(_context, _fallbackLocale.value, _locale.value);
- for (let i2 = 0; i2 < locales.length; i2++) {
- const targetLocaleMessages = _messages.value[locales[i2]] || {};
- const messageValue = resolveValue(targetLocaleMessages, key);
- if (messageValue != null) {
- messages22 = messageValue;
- break;
- }
- }
- return messages22;
- }
- function tm(key) {
- const messages22 = resolveMessages(key);
- return messages22 != null ? messages22 : __root ? __root.tm(key) || {} : {};
- }
- function getLocaleMessage(locale2) {
- return _messages.value[locale2] || {};
- }
- function setLocaleMessage(locale2, message) {
- _messages.value[locale2] = message;
- _context.messages = _messages.value;
- }
- function mergeLocaleMessage(locale2, message) {
- _messages.value[locale2] = _messages.value[locale2] || {};
- deepCopy(message, _messages.value[locale2]);
- _context.messages = _messages.value;
- }
- function getDateTimeFormat(locale2) {
- return _datetimeFormats.value[locale2] || {};
- }
- function setDateTimeFormat(locale2, format2) {
- _datetimeFormats.value[locale2] = format2;
- _context.datetimeFormats = _datetimeFormats.value;
- clearDateTimeFormat(_context, locale2, format2);
- }
- function mergeDateTimeFormat(locale2, format2) {
- _datetimeFormats.value[locale2] = assign(_datetimeFormats.value[locale2] || {}, format2);
- _context.datetimeFormats = _datetimeFormats.value;
- clearDateTimeFormat(_context, locale2, format2);
- }
- function getNumberFormat(locale2) {
- return _numberFormats.value[locale2] || {};
- }
- function setNumberFormat(locale2, format2) {
- _numberFormats.value[locale2] = format2;
- _context.numberFormats = _numberFormats.value;
- clearNumberFormat(_context, locale2, format2);
- }
- function mergeNumberFormat(locale2, format2) {
- _numberFormats.value[locale2] = assign(_numberFormats.value[locale2] || {}, format2);
- _context.numberFormats = _numberFormats.value;
- clearNumberFormat(_context, locale2, format2);
- }
- composerID++;
- if (__root) {
- vue.watch(__root.locale, (val) => {
- if (_inheritLocale) {
- _locale.value = val;
- _context.locale = val;
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
- }
- });
- vue.watch(__root.fallbackLocale, (val) => {
- if (_inheritLocale) {
- _fallbackLocale.value = val;
- _context.fallbackLocale = val;
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
- }
- });
- }
- const composer = {
- id: composerID,
- locale,
- fallbackLocale,
- get inheritLocale() {
- return _inheritLocale;
- },
- set inheritLocale(val) {
- _inheritLocale = val;
- if (val && __root) {
- _locale.value = __root.locale.value;
- _fallbackLocale.value = __root.fallbackLocale.value;
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
- }
- },
- get availableLocales() {
- return Object.keys(_messages.value).sort();
- },
- messages: messages2,
- datetimeFormats,
- numberFormats,
- get modifiers() {
- return _modifiers;
- },
- get pluralRules() {
- return _pluralRules || {};
- },
- get isGlobal() {
- return _isGlobal;
- },
- get missingWarn() {
- return _missingWarn;
- },
- set missingWarn(val) {
- _missingWarn = val;
- _context.missingWarn = _missingWarn;
- },
- get fallbackWarn() {
- return _fallbackWarn;
- },
- set fallbackWarn(val) {
- _fallbackWarn = val;
- _context.fallbackWarn = _fallbackWarn;
- },
- get fallbackRoot() {
- return _fallbackRoot;
- },
- set fallbackRoot(val) {
- _fallbackRoot = val;
- },
- get fallbackFormat() {
- return _fallbackFormat;
- },
- set fallbackFormat(val) {
- _fallbackFormat = val;
- _context.fallbackFormat = _fallbackFormat;
- },
- get warnHtmlMessage() {
- return _warnHtmlMessage;
- },
- set warnHtmlMessage(val) {
- _warnHtmlMessage = val;
- _context.warnHtmlMessage = val;
- },
- get escapeParameter() {
- return _escapeParameter;
- },
- set escapeParameter(val) {
- _escapeParameter = val;
- _context.escapeParameter = val;
- },
- t: t2,
- rt: rt2,
- d: d2,
- n: n2,
- te: te2,
- tm,
- getLocaleMessage,
- setLocaleMessage,
- mergeLocaleMessage,
- getDateTimeFormat,
- setDateTimeFormat,
- mergeDateTimeFormat,
- getNumberFormat,
- setNumberFormat,
- mergeNumberFormat,
- getPostTranslationHandler,
- setPostTranslationHandler,
- getMissingHandler,
- setMissingHandler,
- [TransrateVNodeSymbol]: transrateVNode,
- [NumberPartsSymbol]: numberParts,
- [DatetimePartsSymbol]: datetimeParts,
- [SetPluralRulesSymbol]: setPluralRules,
- [InejctWithOption]: options2.__injectWithOption
- // eslint-disable-line @typescript-eslint/no-explicit-any
- };
- {
- composer[EnableEmitter] = (emitter) => {
- _context.__v_emitter = emitter;
- };
- composer[DisableEmitter] = () => {
- _context.__v_emitter = void 0;
- };
- }
- return composer;
- }
- function convertComposerOptions(options2) {
- const locale = isString$1(options2.locale) ? options2.locale : "en-US";
- const fallbackLocale = isString$1(options2.fallbackLocale) || isArray$2(options2.fallbackLocale) || isPlainObject$1(options2.fallbackLocale) || options2.fallbackLocale === false ? options2.fallbackLocale : locale;
- const missing = isFunction$1(options2.missing) ? options2.missing : void 0;
- const missingWarn = isBoolean$1(options2.silentTranslationWarn) || isRegExp$1(options2.silentTranslationWarn) ? !options2.silentTranslationWarn : true;
- const fallbackWarn = isBoolean$1(options2.silentFallbackWarn) || isRegExp$1(options2.silentFallbackWarn) ? !options2.silentFallbackWarn : true;
- const fallbackRoot = isBoolean$1(options2.fallbackRoot) ? options2.fallbackRoot : true;
- const fallbackFormat = !!options2.formatFallbackMessages;
- const modifiers = isPlainObject$1(options2.modifiers) ? options2.modifiers : {};
- const pluralizationRules = options2.pluralizationRules;
- const postTranslation = isFunction$1(options2.postTranslation) ? options2.postTranslation : void 0;
- const warnHtmlMessage = isString$1(options2.warnHtmlInMessage) ? options2.warnHtmlInMessage !== "off" : true;
- const escapeParameter = !!options2.escapeParameterHtml;
- const inheritLocale = isBoolean$1(options2.sync) ? options2.sync : true;
- if (options2.formatter) {
- warn(getWarnMessage(
- 8
- /* NOT_SUPPORTED_FORMATTER */
- ));
- }
- if (options2.preserveDirectiveContent) {
- warn(getWarnMessage(
- 9
- /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
- ));
- }
- let messages2 = options2.messages;
- if (isPlainObject$1(options2.sharedMessages)) {
- const sharedMessages = options2.sharedMessages;
- const locales = Object.keys(sharedMessages);
- messages2 = locales.reduce((messages22, locale2) => {
- const message = messages22[locale2] || (messages22[locale2] = {});
- assign(message, sharedMessages[locale2]);
- return messages22;
- }, messages2 || {});
- }
- const { __i18n, __root, __injectWithOption } = options2;
- const datetimeFormats = options2.datetimeFormats;
- const numberFormats = options2.numberFormats;
- const flatJson = options2.flatJson;
- return {
- locale,
- fallbackLocale,
- messages: messages2,
- flatJson,
- datetimeFormats,
- numberFormats,
- missing,
- missingWarn,
- fallbackWarn,
- fallbackRoot,
- fallbackFormat,
- modifiers,
- pluralRules: pluralizationRules,
- postTranslation,
- warnHtmlMessage,
- escapeParameter,
- inheritLocale,
- __i18n,
- __root,
- __injectWithOption
- };
- }
- function createVueI18n(options2 = {}) {
- const composer = createComposer(convertComposerOptions(options2));
- const vueI18n = {
- // id
- id: composer.id,
- // locale
- get locale() {
- return composer.locale.value;
- },
- set locale(val) {
- composer.locale.value = val;
- },
- // fallbackLocale
- get fallbackLocale() {
- return composer.fallbackLocale.value;
- },
- set fallbackLocale(val) {
- composer.fallbackLocale.value = val;
- },
- // messages
- get messages() {
- return composer.messages.value;
- },
- // datetimeFormats
- get datetimeFormats() {
- return composer.datetimeFormats.value;
- },
- // numberFormats
- get numberFormats() {
- return composer.numberFormats.value;
- },
- // availableLocales
- get availableLocales() {
- return composer.availableLocales;
- },
- // formatter
- get formatter() {
- warn(getWarnMessage(
- 8
- /* NOT_SUPPORTED_FORMATTER */
- ));
- return {
- interpolate() {
- return [];
- }
- };
- },
- set formatter(val) {
- warn(getWarnMessage(
- 8
- /* NOT_SUPPORTED_FORMATTER */
- ));
- },
- // missing
- get missing() {
- return composer.getMissingHandler();
- },
- set missing(handler) {
- composer.setMissingHandler(handler);
- },
- // silentTranslationWarn
- get silentTranslationWarn() {
- return isBoolean$1(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn;
- },
- set silentTranslationWarn(val) {
- composer.missingWarn = isBoolean$1(val) ? !val : val;
- },
- // silentFallbackWarn
- get silentFallbackWarn() {
- return isBoolean$1(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn;
- },
- set silentFallbackWarn(val) {
- composer.fallbackWarn = isBoolean$1(val) ? !val : val;
- },
- // modifiers
- get modifiers() {
- return composer.modifiers;
- },
- // formatFallbackMessages
- get formatFallbackMessages() {
- return composer.fallbackFormat;
- },
- set formatFallbackMessages(val) {
- composer.fallbackFormat = val;
- },
- // postTranslation
- get postTranslation() {
- return composer.getPostTranslationHandler();
- },
- set postTranslation(handler) {
- composer.setPostTranslationHandler(handler);
- },
- // sync
- get sync() {
- return composer.inheritLocale;
- },
- set sync(val) {
- composer.inheritLocale = val;
- },
- // warnInHtmlMessage
- get warnHtmlInMessage() {
- return composer.warnHtmlMessage ? "warn" : "off";
- },
- set warnHtmlInMessage(val) {
- composer.warnHtmlMessage = val !== "off";
- },
- // escapeParameterHtml
- get escapeParameterHtml() {
- return composer.escapeParameter;
- },
- set escapeParameterHtml(val) {
- composer.escapeParameter = val;
- },
- // preserveDirectiveContent
- get preserveDirectiveContent() {
- warn(getWarnMessage(
- 9
- /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
- ));
- return true;
- },
- set preserveDirectiveContent(val) {
- warn(getWarnMessage(
- 9
- /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
- ));
- },
- // pluralizationRules
- get pluralizationRules() {
- return composer.pluralRules || {};
- },
- // for internal
- __composer: composer,
- // t
- t(...args) {
- const [arg1, arg2, arg3] = args;
- const options22 = {};
- let list = null;
- let named = null;
- if (!isString$1(arg1)) {
- throw createI18nError(
- 15
- /* INVALID_ARGUMENT */
- );
- }
- const key = arg1;
- if (isString$1(arg2)) {
- options22.locale = arg2;
- } else if (isArray$2(arg2)) {
- list = arg2;
- } else if (isPlainObject$1(arg2)) {
- named = arg2;
- }
- if (isArray$2(arg3)) {
- list = arg3;
- } else if (isPlainObject$1(arg3)) {
- named = arg3;
- }
- return composer.t(key, list || named || {}, options22);
- },
- rt(...args) {
- return composer.rt(...args);
- },
- // tc
- tc(...args) {
- const [arg1, arg2, arg3] = args;
- const options22 = { plural: 1 };
- let list = null;
- let named = null;
- if (!isString$1(arg1)) {
- throw createI18nError(
- 15
- /* INVALID_ARGUMENT */
- );
- }
- const key = arg1;
- if (isString$1(arg2)) {
- options22.locale = arg2;
- } else if (isNumber$1(arg2)) {
- options22.plural = arg2;
- } else if (isArray$2(arg2)) {
- list = arg2;
- } else if (isPlainObject$1(arg2)) {
- named = arg2;
- }
- if (isString$1(arg3)) {
- options22.locale = arg3;
- } else if (isArray$2(arg3)) {
- list = arg3;
- } else if (isPlainObject$1(arg3)) {
- named = arg3;
- }
- return composer.t(key, list || named || {}, options22);
- },
- // te
- te(key, locale) {
- return composer.te(key, locale);
- },
- // tm
- tm(key) {
- return composer.tm(key);
- },
- // getLocaleMessage
- getLocaleMessage(locale) {
- return composer.getLocaleMessage(locale);
- },
- // setLocaleMessage
- setLocaleMessage(locale, message) {
- composer.setLocaleMessage(locale, message);
- },
- // mergeLocaleMessage
- mergeLocaleMessage(locale, message) {
- composer.mergeLocaleMessage(locale, message);
- },
- // d
- d(...args) {
- return composer.d(...args);
- },
- // getDateTimeFormat
- getDateTimeFormat(locale) {
- return composer.getDateTimeFormat(locale);
- },
- // setDateTimeFormat
- setDateTimeFormat(locale, format2) {
- composer.setDateTimeFormat(locale, format2);
- },
- // mergeDateTimeFormat
- mergeDateTimeFormat(locale, format2) {
- composer.mergeDateTimeFormat(locale, format2);
- },
- // n
- n(...args) {
- return composer.n(...args);
- },
- // getNumberFormat
- getNumberFormat(locale) {
- return composer.getNumberFormat(locale);
- },
- // setNumberFormat
- setNumberFormat(locale, format2) {
- composer.setNumberFormat(locale, format2);
- },
- // mergeNumberFormat
- mergeNumberFormat(locale, format2) {
- composer.mergeNumberFormat(locale, format2);
- },
- // getChoiceIndex
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- getChoiceIndex(choice, choicesLength) {
- warn(getWarnMessage(
- 10
- /* NOT_SUPPORTED_GET_CHOICE_INDEX */
- ));
- return -1;
- },
- // for internal
- __onComponentInstanceCreated(target) {
- const { componentInstanceCreatedListener } = options2;
- if (componentInstanceCreatedListener) {
- componentInstanceCreatedListener(target, vueI18n);
- }
- }
- };
- {
- vueI18n.__enableEmitter = (emitter) => {
- const __composer = composer;
- __composer[EnableEmitter] && __composer[EnableEmitter](emitter);
- };
- vueI18n.__disableEmitter = () => {
- const __composer = composer;
- __composer[DisableEmitter] && __composer[DisableEmitter]();
- };
- }
- return vueI18n;
- }
- const baseFormatProps = {
- tag: {
- type: [String, Object]
- },
- locale: {
- type: String
- },
- scope: {
- type: String,
- validator: (val) => val === "parent" || val === "global",
- default: "parent"
- },
- i18n: {
- type: Object
- }
- };
- const Translation = {
- /* eslint-disable */
- name: "i18n-t",
- props: assign({
- keypath: {
- type: String,
- required: true
- },
- plural: {
- type: [Number, String],
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- validator: (val) => isNumber$1(val) || !isNaN(val)
- }
- }, baseFormatProps),
- /* eslint-enable */
- setup(props, context) {
- const { slots, attrs } = context;
- const i18n2 = props.i18n || useI18n({
- useScope: props.scope,
- __useComponent: true
- });
- const keys = Object.keys(slots).filter((key) => key !== "_");
- return () => {
- const options2 = {};
- if (props.locale) {
- options2.locale = props.locale;
- }
- if (props.plural !== void 0) {
- options2.plural = isString$1(props.plural) ? +props.plural : props.plural;
- }
- const arg = getInterpolateArg(context, keys);
- const children = i18n2[TransrateVNodeSymbol](props.keypath, arg, options2);
- const assignedAttrs = assign({}, attrs);
- return isString$1(props.tag) ? vue.h(props.tag, assignedAttrs, children) : isObject$5(props.tag) ? vue.h(props.tag, assignedAttrs, children) : vue.h(vue.Fragment, assignedAttrs, children);
- };
- }
- };
- function getInterpolateArg({ slots }, keys) {
- if (keys.length === 1 && keys[0] === "default") {
- return slots.default ? slots.default() : [];
- } else {
- return keys.reduce((arg, key) => {
- const slot = slots[key];
- if (slot) {
- arg[key] = slot();
- }
- return arg;
- }, {});
- }
- }
- function renderFormatter(props, context, slotKeys, partFormatter) {
- const { slots, attrs } = context;
- return () => {
- const options2 = { part: true };
- let overrides = {};
- if (props.locale) {
- options2.locale = props.locale;
- }
- if (isString$1(props.format)) {
- options2.key = props.format;
- } else if (isObject$5(props.format)) {
- if (isString$1(props.format.key)) {
- options2.key = props.format.key;
- }
- overrides = Object.keys(props.format).reduce((options22, prop) => {
- return slotKeys.includes(prop) ? assign({}, options22, { [prop]: props.format[prop] }) : options22;
- }, {});
- }
- const parts = partFormatter(...[props.value, options2, overrides]);
- let children = [options2.key];
- if (isArray$2(parts)) {
- children = parts.map((part, index2) => {
- const slot = slots[part.type];
- return slot ? slot({ [part.type]: part.value, index: index2, parts }) : [part.value];
- });
- } else if (isString$1(parts)) {
- children = [parts];
- }
- const assignedAttrs = assign({}, attrs);
- return isString$1(props.tag) ? vue.h(props.tag, assignedAttrs, children) : isObject$5(props.tag) ? vue.h(props.tag, assignedAttrs, children) : vue.h(vue.Fragment, assignedAttrs, children);
- };
- }
- const NUMBER_FORMAT_KEYS = [
- "localeMatcher",
- "style",
- "unit",
- "unitDisplay",
- "currency",
- "currencyDisplay",
- "useGrouping",
- "numberingSystem",
- "minimumIntegerDigits",
- "minimumFractionDigits",
- "maximumFractionDigits",
- "minimumSignificantDigits",
- "maximumSignificantDigits",
- "notation",
- "formatMatcher"
- ];
- const NumberFormat = {
- /* eslint-disable */
- name: "i18n-n",
- props: assign({
- value: {
- type: Number,
- required: true
- },
- format: {
- type: [String, Object]
- }
- }, baseFormatProps),
- /* eslint-enable */
- setup(props, context) {
- const i18n2 = props.i18n || useI18n({ useScope: "parent", __useComponent: true });
- return renderFormatter(props, context, NUMBER_FORMAT_KEYS, (...args) => (
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- i18n2[NumberPartsSymbol](...args)
- ));
- }
- };
- const DATETIME_FORMAT_KEYS = [
- "dateStyle",
- "timeStyle",
- "fractionalSecondDigits",
- "calendar",
- "dayPeriod",
- "numberingSystem",
- "localeMatcher",
- "timeZone",
- "hour12",
- "hourCycle",
- "formatMatcher",
- "weekday",
- "era",
- "year",
- "month",
- "day",
- "hour",
- "minute",
- "second",
- "timeZoneName"
- ];
- const DatetimeFormat = {
- /* eslint-disable */
- name: "i18n-d",
- props: assign({
- value: {
- type: [Number, Date],
- required: true
- },
- format: {
- type: [String, Object]
- }
- }, baseFormatProps),
- /* eslint-enable */
- setup(props, context) {
- const i18n2 = props.i18n || useI18n({ useScope: "parent", __useComponent: true });
- return renderFormatter(props, context, DATETIME_FORMAT_KEYS, (...args) => (
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- i18n2[DatetimePartsSymbol](...args)
- ));
- }
- };
- function getComposer$2(i18n2, instance) {
- const i18nInternal = i18n2;
- if (i18n2.mode === "composition") {
- return i18nInternal.__getInstance(instance) || i18n2.global;
- } else {
- const vueI18n = i18nInternal.__getInstance(instance);
- return vueI18n != null ? vueI18n.__composer : i18n2.global.__composer;
- }
- }
- function vTDirective(i18n2) {
- const bind2 = (el, { instance, value, modifiers }) => {
- if (!instance || !instance.$) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- const composer = getComposer$2(i18n2, instance.$);
- if (modifiers.preserve) {
- warn(getWarnMessage(
- 7
- /* NOT_SUPPORTED_PRESERVE */
- ));
- }
- const parsedValue = parseValue(value);
- el.textContent = composer.t(...makeParams(parsedValue));
- };
- return {
- beforeMount: bind2,
- beforeUpdate: bind2
- };
- }
- function parseValue(value) {
- if (isString$1(value)) {
- return { path: value };
- } else if (isPlainObject$1(value)) {
- if (!("path" in value)) {
- throw createI18nError(19, "path");
- }
- return value;
- } else {
- throw createI18nError(
- 20
- /* INVALID_VALUE */
- );
- }
- }
- function makeParams(value) {
- const { path, locale, args, choice, plural } = value;
- const options2 = {};
- const named = args || {};
- if (isString$1(locale)) {
- options2.locale = locale;
- }
- if (isNumber$1(choice)) {
- options2.plural = choice;
- }
- if (isNumber$1(plural)) {
- options2.plural = plural;
- }
- return [path, named, options2];
- }
- function apply(app2, i18n2, ...options2) {
- const pluginOptions = isPlainObject$1(options2[0]) ? options2[0] : {};
- const useI18nComponentName = !!pluginOptions.useI18nComponentName;
- const globalInstall = isBoolean$1(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
- if (globalInstall && useI18nComponentName) {
- warn(getWarnMessage(11, {
- name: Translation.name
- }));
- }
- if (globalInstall) {
- app2.component(!useI18nComponentName ? Translation.name : "i18n", Translation);
- app2.component(NumberFormat.name, NumberFormat);
- app2.component(DatetimeFormat.name, DatetimeFormat);
- }
- app2.directive("t", vTDirective(i18n2));
- }
- const VUE_I18N_COMPONENT_TYPES = "vue-i18n: composer properties";
- let devtoolsApi;
- async function enableDevTools(app2, i18n2) {
- return new Promise((resolve, reject) => {
- try {
- setupDevtoolsPlugin({
- id: "vue-devtools-plugin-vue-i18n",
- label: VueDevToolsLabels[
- "vue-devtools-plugin-vue-i18n"
- /* PLUGIN */
- ],
- packageName: "vue-i18n",
- homepage: "https://vue-i18n.intlify.dev",
- logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
- componentStateTypes: [VUE_I18N_COMPONENT_TYPES],
- app: app2
- }, (api2) => {
- devtoolsApi = api2;
- api2.on.visitComponentTree(({ componentInstance, treeNode }) => {
- updateComponentTreeTags(componentInstance, treeNode, i18n2);
- });
- api2.on.inspectComponent(({ componentInstance, instanceData }) => {
- if (componentInstance.vnode.el.__VUE_I18N__ && instanceData) {
- if (i18n2.mode === "legacy") {
- if (componentInstance.vnode.el.__VUE_I18N__ !== i18n2.global.__composer) {
- inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
- }
- } else {
- inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
- }
- }
- });
- api2.addInspector({
- id: "vue-i18n-resource-inspector",
- label: VueDevToolsLabels[
- "vue-i18n-resource-inspector"
- /* CUSTOM_INSPECTOR */
- ],
- icon: "language",
- treeFilterPlaceholder: VueDevToolsPlaceholders[
- "vue-i18n-resource-inspector"
- /* CUSTOM_INSPECTOR */
- ]
- });
- api2.on.getInspectorTree((payload) => {
- if (payload.app === app2 && payload.inspectorId === "vue-i18n-resource-inspector") {
- registerScope(payload, i18n2);
- }
- });
- api2.on.getInspectorState((payload) => {
- if (payload.app === app2 && payload.inspectorId === "vue-i18n-resource-inspector") {
- inspectScope(payload, i18n2);
- }
- });
- api2.on.editInspectorState((payload) => {
- if (payload.app === app2 && payload.inspectorId === "vue-i18n-resource-inspector") {
- editScope(payload, i18n2);
- }
- });
- api2.addTimelineLayer({
- id: "vue-i18n-timeline",
- label: VueDevToolsLabels[
- "vue-i18n-timeline"
- /* TIMELINE */
- ],
- color: VueDevToolsTimelineColors[
- "vue-i18n-timeline"
- /* TIMELINE */
- ]
- });
- resolve(true);
- });
- } catch (e2) {
- console.error(e2);
- reject(false);
- }
- });
- }
- function updateComponentTreeTags(instance, treeNode, i18n2) {
- const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
- if (instance && instance.vnode.el.__VUE_I18N__) {
- if (instance.vnode.el.__VUE_I18N__ !== global2) {
- const label = instance.type.name || instance.type.displayName || instance.type.__file;
- const tag = {
- label: `i18n (${label} Scope)`,
- textColor: 0,
- backgroundColor: 16764185
- };
- treeNode.tags.push(tag);
- }
- }
- }
- function inspectComposer(instanceData, composer) {
- const type = VUE_I18N_COMPONENT_TYPES;
- instanceData.state.push({
- type,
- key: "locale",
- editable: true,
- value: composer.locale.value
- });
- instanceData.state.push({
- type,
- key: "availableLocales",
- editable: false,
- value: composer.availableLocales
- });
- instanceData.state.push({
- type,
- key: "fallbackLocale",
- editable: true,
- value: composer.fallbackLocale.value
- });
- instanceData.state.push({
- type,
- key: "inheritLocale",
- editable: true,
- value: composer.inheritLocale
- });
- instanceData.state.push({
- type,
- key: "messages",
- editable: false,
- value: getLocaleMessageValue(composer.messages.value)
- });
- instanceData.state.push({
- type,
- key: "datetimeFormats",
- editable: false,
- value: composer.datetimeFormats.value
- });
- instanceData.state.push({
- type,
- key: "numberFormats",
- editable: false,
- value: composer.numberFormats.value
- });
- }
- function getLocaleMessageValue(messages2) {
- const value = {};
- Object.keys(messages2).forEach((key) => {
- const v2 = messages2[key];
- if (isFunction$1(v2) && "source" in v2) {
- value[key] = getMessageFunctionDetails(v2);
- } else if (isObject$5(v2)) {
- value[key] = getLocaleMessageValue(v2);
- } else {
- value[key] = v2;
- }
- });
- return value;
- }
- const ESC = {
- "<": "<",
- ">": ">",
- '"': """,
- "&": "&"
- };
- function escape$1(s2) {
- return s2.replace(/[<>"&]/g, escapeChar);
- }
- function escapeChar(a2) {
- return ESC[a2] || a2;
- }
- function getMessageFunctionDetails(func) {
- const argString = func.source ? `("${escape$1(func.source)}")` : `(?)`;
- return {
- _custom: {
- type: "function",
- display: `<span>ƒ</span> ${argString}`
- }
- };
- }
- function registerScope(payload, i18n2) {
- payload.rootNodes.push({
- id: "global",
- label: "Global Scope"
- });
- const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
- for (const [keyInstance, instance] of i18n2.__instances) {
- const composer = i18n2.mode === "composition" ? instance : instance.__composer;
- if (global2 === composer) {
- continue;
- }
- const label = keyInstance.type.name || keyInstance.type.displayName || keyInstance.type.__file;
- payload.rootNodes.push({
- id: composer.id.toString(),
- label: `${label} Scope`
- });
- }
- }
- function getComposer$1(nodeId, i18n2) {
- if (nodeId === "global") {
- return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
- } else {
- const instance = Array.from(i18n2.__instances.values()).find((item) => item.id.toString() === nodeId);
- if (instance) {
- return i18n2.mode === "composition" ? instance : instance.__composer;
- } else {
- return null;
- }
- }
- }
- function inspectScope(payload, i18n2) {
- const composer = getComposer$1(payload.nodeId, i18n2);
- if (composer) {
- payload.state = makeScopeInspectState(composer);
- }
- }
- function makeScopeInspectState(composer) {
- const state = {};
- const localeType = "Locale related info";
- const localeStates = [
- {
- type: localeType,
- key: "locale",
- editable: true,
- value: composer.locale.value
- },
- {
- type: localeType,
- key: "fallbackLocale",
- editable: true,
- value: composer.fallbackLocale.value
- },
- {
- type: localeType,
- key: "availableLocales",
- editable: false,
- value: composer.availableLocales
- },
- {
- type: localeType,
- key: "inheritLocale",
- editable: true,
- value: composer.inheritLocale
- }
- ];
- state[localeType] = localeStates;
- const localeMessagesType = "Locale messages info";
- const localeMessagesStates = [
- {
- type: localeMessagesType,
- key: "messages",
- editable: false,
- value: getLocaleMessageValue(composer.messages.value)
- }
- ];
- state[localeMessagesType] = localeMessagesStates;
- const datetimeFormatsType = "Datetime formats info";
- const datetimeFormatsStates = [
- {
- type: datetimeFormatsType,
- key: "datetimeFormats",
- editable: false,
- value: composer.datetimeFormats.value
- }
- ];
- state[datetimeFormatsType] = datetimeFormatsStates;
- const numberFormatsType = "Datetime formats info";
- const numberFormatsStates = [
- {
- type: numberFormatsType,
- key: "numberFormats",
- editable: false,
- value: composer.numberFormats.value
- }
- ];
- state[numberFormatsType] = numberFormatsStates;
- return state;
- }
- function addTimelineEvent(event, payload) {
- if (devtoolsApi) {
- let groupId;
- if (payload && "groupId" in payload) {
- groupId = payload.groupId;
- delete payload.groupId;
- }
- devtoolsApi.addTimelineEvent({
- layerId: "vue-i18n-timeline",
- event: {
- title: event,
- groupId,
- time: Date.now(),
- meta: {},
- data: payload || {},
- logType: event === "compile-error" ? "error" : event === "fallback" || event === "missing" ? "warning" : "default"
- }
- });
- }
- }
- function editScope(payload, i18n2) {
- const composer = getComposer$1(payload.nodeId, i18n2);
- if (composer) {
- const [field] = payload.path;
- if (field === "locale" && isString$1(payload.state.value)) {
- composer.locale.value = payload.state.value;
- } else if (field === "fallbackLocale" && (isString$1(payload.state.value) || isArray$2(payload.state.value) || isObject$5(payload.state.value))) {
- composer.fallbackLocale.value = payload.state.value;
- } else if (field === "inheritLocale" && isBoolean$1(payload.state.value)) {
- composer.inheritLocale = payload.state.value;
- }
- }
- }
- function defineMixin(vuei18n, composer, i18n2) {
- return {
- beforeCreate() {
- const instance = vue.getCurrentInstance();
- if (!instance) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- const options2 = this.$options;
- if (options2.i18n) {
- const optionsI18n = options2.i18n;
- if (options2.__i18n) {
- optionsI18n.__i18n = options2.__i18n;
- }
- optionsI18n.__root = composer;
- if (this === this.$root) {
- this.$i18n = mergeToRoot(vuei18n, optionsI18n);
- } else {
- optionsI18n.__injectWithOption = true;
- this.$i18n = createVueI18n(optionsI18n);
- }
- } else if (options2.__i18n) {
- if (this === this.$root) {
- this.$i18n = mergeToRoot(vuei18n, options2);
- } else {
- this.$i18n = createVueI18n({
- __i18n: options2.__i18n,
- __injectWithOption: true,
- __root: composer
- });
- }
- } else {
- this.$i18n = vuei18n;
- }
- vuei18n.__onComponentInstanceCreated(this.$i18n);
- i18n2.__setInstance(instance, this.$i18n);
- this.$t = (...args) => this.$i18n.t(...args);
- this.$rt = (...args) => this.$i18n.rt(...args);
- this.$tc = (...args) => this.$i18n.tc(...args);
- this.$te = (key, locale) => this.$i18n.te(key, locale);
- this.$d = (...args) => this.$i18n.d(...args);
- this.$n = (...args) => this.$i18n.n(...args);
- this.$tm = (key) => this.$i18n.tm(key);
- },
- mounted() {
- {
- this.$el.__VUE_I18N__ = this.$i18n.__composer;
- const emitter = this.__v_emitter = createEmitter();
- const _vueI18n = this.$i18n;
- _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
- emitter.on("*", addTimelineEvent);
- }
- },
- beforeUnmount() {
- const instance = vue.getCurrentInstance();
- if (!instance) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- {
- if (this.__v_emitter) {
- this.__v_emitter.off("*", addTimelineEvent);
- delete this.__v_emitter;
- }
- const _vueI18n = this.$i18n;
- _vueI18n.__disableEmitter && _vueI18n.__disableEmitter();
- delete this.$el.__VUE_I18N__;
- }
- delete this.$t;
- delete this.$rt;
- delete this.$tc;
- delete this.$te;
- delete this.$d;
- delete this.$n;
- delete this.$tm;
- i18n2.__deleteInstance(instance);
- delete this.$i18n;
- }
- };
- }
- function mergeToRoot(root, options2) {
- root.locale = options2.locale || root.locale;
- root.fallbackLocale = options2.fallbackLocale || root.fallbackLocale;
- root.missing = options2.missing || root.missing;
- root.silentTranslationWarn = options2.silentTranslationWarn || root.silentFallbackWarn;
- root.silentFallbackWarn = options2.silentFallbackWarn || root.silentFallbackWarn;
- root.formatFallbackMessages = options2.formatFallbackMessages || root.formatFallbackMessages;
- root.postTranslation = options2.postTranslation || root.postTranslation;
- root.warnHtmlInMessage = options2.warnHtmlInMessage || root.warnHtmlInMessage;
- root.escapeParameterHtml = options2.escapeParameterHtml || root.escapeParameterHtml;
- root.sync = options2.sync || root.sync;
- root.__composer[SetPluralRulesSymbol](options2.pluralizationRules || root.pluralizationRules);
- const messages2 = getLocaleMessages(root.locale, {
- messages: options2.messages,
- __i18n: options2.__i18n
- });
- Object.keys(messages2).forEach((locale) => root.mergeLocaleMessage(locale, messages2[locale]));
- if (options2.datetimeFormats) {
- Object.keys(options2.datetimeFormats).forEach((locale) => root.mergeDateTimeFormat(locale, options2.datetimeFormats[locale]));
- }
- if (options2.numberFormats) {
- Object.keys(options2.numberFormats).forEach((locale) => root.mergeNumberFormat(locale, options2.numberFormats[locale]));
- }
- return root;
- }
- function createI18n(options2 = {}) {
- const __legacyMode = isBoolean$1(options2.legacy) ? options2.legacy : true;
- const __globalInjection = !!options2.globalInjection;
- const __instances = /* @__PURE__ */ new Map();
- const __global = __legacyMode ? createVueI18n(options2) : createComposer(options2);
- const symbol = makeSymbol("vue-i18n");
- const i18n2 = {
- // mode
- get mode() {
- return __legacyMode ? "legacy" : "composition";
- },
- // install plugin
- async install(app2, ...options22) {
- {
- app2.__VUE_I18N__ = i18n2;
- }
- app2.__VUE_I18N_SYMBOL__ = symbol;
- app2.provide(app2.__VUE_I18N_SYMBOL__, i18n2);
- if (!__legacyMode && __globalInjection) {
- injectGlobalFields(app2, i18n2.global);
- }
- {
- apply(app2, i18n2, ...options22);
- }
- if (__legacyMode) {
- app2.mixin(defineMixin(__global, __global.__composer, i18n2));
- }
- {
- const ret = await enableDevTools(app2, i18n2);
- if (!ret) {
- throw createI18nError(
- 21
- /* CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN */
- );
- }
- const emitter = createEmitter();
- if (__legacyMode) {
- const _vueI18n = __global;
- _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
- } else {
- const _composer = __global;
- _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
- }
- emitter.on("*", addTimelineEvent);
- }
- },
- // global accessor
- get global() {
- return __global;
- },
- // @internal
- __instances,
- // @internal
- __getInstance(component) {
- return __instances.get(component) || null;
- },
- // @internal
- __setInstance(component, instance) {
- __instances.set(component, instance);
- },
- // @internal
- __deleteInstance(component) {
- __instances.delete(component);
- }
- };
- return i18n2;
- }
- function useI18n(options2 = {}) {
- const instance = vue.getCurrentInstance();
- if (instance == null) {
- throw createI18nError(
- 16
- /* MUST_BE_CALL_SETUP_TOP */
- );
- }
- if (!instance.appContext.app.__VUE_I18N_SYMBOL__) {
- throw createI18nError(
- 17
- /* NOT_INSLALLED */
- );
- }
- const i18n2 = vue.inject(instance.appContext.app.__VUE_I18N_SYMBOL__);
- if (!i18n2) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
- const scope = isEmptyObject(options2) ? "__i18n" in instance.type ? "local" : "global" : !options2.useScope ? "local" : options2.useScope;
- if (scope === "global") {
- let messages2 = isObject$5(options2.messages) ? options2.messages : {};
- if ("__i18nGlobal" in instance.type) {
- messages2 = getLocaleMessages(global2.locale.value, {
- messages: messages2,
- __i18n: instance.type.__i18nGlobal
- });
- }
- const locales = Object.keys(messages2);
- if (locales.length) {
- locales.forEach((locale) => {
- global2.mergeLocaleMessage(locale, messages2[locale]);
- });
- }
- if (isObject$5(options2.datetimeFormats)) {
- const locales2 = Object.keys(options2.datetimeFormats);
- if (locales2.length) {
- locales2.forEach((locale) => {
- global2.mergeDateTimeFormat(locale, options2.datetimeFormats[locale]);
- });
- }
- }
- if (isObject$5(options2.numberFormats)) {
- const locales2 = Object.keys(options2.numberFormats);
- if (locales2.length) {
- locales2.forEach((locale) => {
- global2.mergeNumberFormat(locale, options2.numberFormats[locale]);
- });
- }
- }
- return global2;
- }
- if (scope === "parent") {
- let composer2 = getComposer(i18n2, instance, options2.__useComponent);
- if (composer2 == null) {
- {
- warn(getWarnMessage(
- 12
- /* NOT_FOUND_PARENT_SCOPE */
- ));
- }
- composer2 = global2;
- }
- return composer2;
- }
- if (i18n2.mode === "legacy") {
- throw createI18nError(
- 18
- /* NOT_AVAILABLE_IN_LEGACY_MODE */
- );
- }
- const i18nInternal = i18n2;
- let composer = i18nInternal.__getInstance(instance);
- if (composer == null) {
- const type = instance.type;
- const composerOptions = assign({}, options2);
- if (type.__i18n) {
- composerOptions.__i18n = type.__i18n;
- }
- if (global2) {
- composerOptions.__root = global2;
- }
- composer = createComposer(composerOptions);
- setupLifeCycle(i18nInternal, instance, composer);
- i18nInternal.__setInstance(instance, composer);
- }
- return composer;
- }
- function getComposer(i18n2, target, useComponent = false) {
- let composer = null;
- const root = target.root;
- let current = target.parent;
- while (current != null) {
- const i18nInternal = i18n2;
- if (i18n2.mode === "composition") {
- composer = i18nInternal.__getInstance(current);
- } else {
- const vueI18n = i18nInternal.__getInstance(current);
- if (vueI18n != null) {
- composer = vueI18n.__composer;
- }
- if (useComponent && composer && !composer[InejctWithOption]) {
- composer = null;
- }
- }
- if (composer != null) {
- break;
- }
- if (root === current) {
- break;
- }
- current = current.parent;
- }
- return composer;
- }
- function setupLifeCycle(i18n2, target, composer) {
- let emitter = null;
- vue.onMounted(() => {
- if (target.vnode.el) {
- target.vnode.el.__VUE_I18N__ = composer;
- emitter = createEmitter();
- const _composer = composer;
- _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
- emitter.on("*", addTimelineEvent);
- }
- }, target);
- vue.onUnmounted(() => {
- if (target.vnode.el && target.vnode.el.__VUE_I18N__) {
- emitter && emitter.off("*", addTimelineEvent);
- const _composer = composer;
- _composer[DisableEmitter] && _composer[DisableEmitter]();
- delete target.vnode.el.__VUE_I18N__;
- }
- i18n2.__deleteInstance(target);
- }, target);
- }
- const globalExportProps = [
- "locale",
- "fallbackLocale",
- "availableLocales"
- ];
- const globalExportMethods = ["t", "rt", "d", "n", "tm"];
- function injectGlobalFields(app2, composer) {
- const i18n2 = /* @__PURE__ */ Object.create(null);
- globalExportProps.forEach((prop) => {
- const desc = Object.getOwnPropertyDescriptor(composer, prop);
- if (!desc) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- const wrap = vue.isRef(desc.value) ? {
- get() {
- return desc.value.value;
- },
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- set(val) {
- desc.value.value = val;
- }
- } : {
- get() {
- return desc.get && desc.get();
- }
- };
- Object.defineProperty(i18n2, prop, wrap);
- });
- app2.config.globalProperties.$i18n = i18n2;
- globalExportMethods.forEach((method) => {
- const desc = Object.getOwnPropertyDescriptor(composer, method);
- if (!desc || !desc.value) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- Object.defineProperty(app2.config.globalProperties, `$${method}`, desc);
- });
- }
- {
- initFeatureFlags();
- }
- {
- const target = getGlobalThis();
- target.__INTLIFY__ = true;
- setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
- }
- const settings$1 = "Settings";
- const agreement$1 = "User privacy Agreement";
- const user_management$1 = "User management";
- const role_management$1 = "Role management";
- const menu_management$1 = "Menu management";
- const post_management$1 = "Position management";
- const org_management$1 = "Organization management";
- const add_user$1 = "Add a user";
- const about$1 = "About";
- const common$1 = {
- letcgo: "letcgo",
- home: "Home",
- category: "Category",
- cart: "Cart",
- my: "My",
- product: "Product",
- review: "Review",
- detail: "Detail",
- view_all: "View All",
- none: "None",
- all: "All",
- search_products: "Search Products",
- buy_now: "Buy Now",
- sold: "Sold",
- sales_volume: "Sales Volume",
- go_buy: "Go Buy",
- add_to_cart: "Add to Cart",
- redeem_now: "Redeem Now",
- sold_out: "Sold Out",
- product_not_exist: "Product not available or has been removed",
- awaiting_your_first_review: "Awaiting Your First Review",
- browse_more: "Browse More",
- select_product_options: "Please Select Product Options",
- favorite: "Favorite",
- unfavorite: "Unfavorite",
- favorite_success: "Favorite Success",
- points: "Points",
- cancel: "Cancel",
- confirm: "Confirm",
- submit: "Submit",
- save: "Save",
- "delete": "Delete",
- edit: "Edit",
- close: "Close",
- back: "Back",
- next: "Next",
- previous: "Previous",
- yes: "Yes",
- no: "No",
- ok: "OK",
- post: "Post",
- loading: "Loading...",
- refresh: "Refresh",
- search: "Search",
- reset: "Reset",
- add: "Add",
- update: "Update",
- upload: "Upload",
- download: "Download",
- level: "Level",
- no_level: "No Level",
- select: "Select",
- select_product_specification: "Please Select Product Specification",
- clear: "Clear",
- delete_footprint: "Delete Footprint",
- select_all: "Select All",
- my_footprints: "My Footprints",
- total_goods: "Total {number} items",
- recommended: "Recommended",
- price_asc: "Price Low-High",
- price_desc: "Price High-Low",
- sales: "Sales",
- newest: "Newest",
- enter_keywords: "Enter Keywords",
- checkout: "Checkout",
- total: "Total",
- "default": "Default",
- empty_cart: "Your cart is empty, go shop around!",
- select_area: "Select Area",
- click_to_load_more: "Click to Load More",
- system: "System",
- current_version: "Current Version",
- local_cache: "Local Cache",
- about_us: "About Us",
- logout_account: "Log Out",
- confirm_logout: "Confirm Log Out?",
- no_data: "No Data",
- uploading: "Uploading",
- verifying: "Verifying",
- fetching: "Fetching",
- save_success: "Save Successful",
- update_success: "Update Successful",
- logging_in: "Logging In",
- login_success: "Login Successful",
- registering: "Registering",
- register_success: "Registration Successful",
- sending: "Sending",
- send_success: "Send Successful",
- binding: "Binding",
- bind_success: "Bind Successful",
- unbind: "Unbinding",
- unbind_success: "Unbind Successful",
- claiming: "Claiming",
- claim_success: "Claim Successful",
- collect_success: "Collect Successful",
- cancel_success: "Cancel Successful",
- delete_success: "Delete Successful",
- clear_success: "Clear Successful",
- apply_success: "Apply Successful",
- change_success: "Change Successful",
- added_to_cart: "Added to Cart",
- just_now: "Just Now",
- minutes_ago: "{m} Minutes Ago",
- hours_ago: "{h} Hours Ago",
- days_ago: "{d} Days Ago",
- months_ago: "{m} Months Ago",
- years_ago: "{y} Years Ago",
- copy_success: "Copy Successful!",
- copy_fail: "Copy Failed!",
- sms_error: "SMS Sending Error",
- try_later: "Please Try Later",
- phone_format_error: "Incorrect Phone Format",
- get_verification_code: "Get Code",
- use_wechat_browser: "Please Open in WeChat Browser",
- platform_not_supported: "Platform Not Supported",
- payment_manually_cancelled: "Payment Manually Cancelled",
- alipay_payment: "Alipay Payment",
- copy_link_to_browser: "Copy Link to Browser",
- copy_link: "Copy Link",
- wechat_payment: "WeChat Payment",
- bind_wechat_for_payment: "Bind WeChat for Payment",
- bind: "Bind",
- balance_payment: "Balance Payment",
- mock_payment: "Mock Payment",
- update_prompt: "Update Prompt",
- new_version_ready: "New Version Ready, Restart Now?",
- latest_version: "Latest Version",
- server_error_try_later: "Server Error, Please Try Later",
- network_request_error: "Network Request Error",
- request_error: "Request Error",
- login_expired: "Your Login Has Expired",
- please_login: "Please Log In",
- access_denied: "Access Denied",
- request_timeout: "Request Timeout",
- frequent_requests: "Frequent Requests, Please Try Later",
- server_unavailable: "Service Unimplemented",
- network_error: "Network Error",
- service_unavailable: "Service Unavailable",
- network_timeout: "Network Timeout",
- http_not_supported: "HTTP Version Not Supported",
- server_exception: "Server Exception",
- check_network_connection: "Check Your Network Connection",
- not_bound_wechat: "WeChat Not Bound, Please Bind First",
- platform_intro: "Platform Intro",
- industry_intro: "Industry Intro",
- latest_news: "Latest News",
- shared_mall: "Shared Mall",
- activities: "Activities",
- videos: "Videos",
- mall: "Mall",
- shop_index: "Shop Index",
- shop_category: "Shop Category",
- all_product: "All Product"
- };
- const account$1 = {
- account_login: "Account Login",
- sms_login: "SMS Login",
- register: "Register",
- read_and_agree: "I have read and agree to the",
- user_agreement: "User Agreement",
- privacy_policy: "Privacy Policy",
- and: "and",
- wechat_authorization_login: "WeChat Authorization Login",
- wechat_authorization_register: "WeChat Authorization Register",
- please_agree: "Please check to agree",
- register_by_sharing_only: "You can only register via sharing",
- quick_login_failed: "Quick Login Failed",
- username: "Username",
- password: "Password",
- enter_username: "Enter Username",
- enter_valid_username: "Please enter a valid username!",
- enter_password: "Enter Password",
- login: "Login",
- phone_number: "Phone",
- verification_code: "Verification Code",
- enter_verification_code: "Enter Verification Code",
- get_verification_code: "Get Code",
- incorrect_phone_format: "Incorrect Phone Format",
- enter_phone_number: "Enter Phone Number",
- username_exists: "Username Already Exists!",
- change_phone_number: "Change Phone",
- bind_phone_number: "Bind Phone",
- old_phone_number: "Old Phone",
- enter_old_phone_number: "Enter Old Phone",
- security_notice: "For security, use your personal phone number",
- new_phone_number: "New Phone",
- enter_new_phone_number: "Enter New Phone",
- login_again: "Update Successful, Log In Again",
- change_password: "Change Password",
- cancel_change: "Cancel Change",
- password_requirements: "6-12 chars with letters & numbers",
- modification_successful: "Successful Update",
- authorization_info: "Authorization Info",
- complete_profile: "Complete Your Profile",
- avatar: "Avatar",
- select_avatar: "Select Avatar",
- nickname: "Nickname",
- enter_nickname: "Enter Nickname",
- confirm_authorization: "Confirm Authorization",
- authorization_successful: "Authorization Successful",
- first_time_login: "First-time Login, Verify Phone",
- continue_login: "Continue Login",
- change_alipay_account: "Change Alipay Account",
- bind_alipay_account: "Bind Alipay Account",
- bind_realname_alipay: "Bind Real-name Verified Alipay Account",
- name: "Name",
- enter_name: "Enter Name",
- account: "Account",
- enter_account: "Enter Account",
- change_bank_card: "Change Bank Card",
- bind_bank_card: "Bind Bank Card",
- bank_branch: "Bank Branch",
- bank_branch_example: "E.g., XX Bank Ltd. XX Branch",
- account_holder: "Account Holder",
- account_holder_name: "Holder's Name",
- bank_account_number: "Bank Account Number",
- select_account_login: "Select Account Login",
- wechat_no_bind: "This WeChat is not linked to any account, please use another login method",
- wechat_register: "WeChat Register",
- wechat_no_account: "Your WeChat has no account, please register via sharing"
- };
- const review$1 = {
- all_reviews: "All Reviews",
- positive: "Positive",
- neutral: "Neutral",
- negative: "Negative"
- };
- const confirm$1 = {
- confirm_order: "Confirm Order",
- shipping_fee: "Shipping Fee",
- free_shipping: "Free Shipping",
- order_note: "Order Note",
- communication_advice: "Contact seller first",
- quantity: "Quantity",
- price_details: "Price Details",
- total_price: "Total Price",
- total_items: "Total {count} items",
- commission_deduction: "Commission Deduction",
- deduction: "Deduct {count} yuan",
- no_commission: "No Commission Use",
- consumption_point_deduction: "Point Use",
- no_consumption_points: "No Consumption Points",
- total_items_count: "Total {count} items",
- submit_order: "Submit Order",
- select_shipping_address: "Select Shipping Address",
- insufficient_commission: "Insufficient Commission",
- insufficient_consumption_points: "Insufficient Consumption Points",
- commission_points_no_mix: "Cannot Combine Commission with Consumption Points"
- };
- const address$1 = {
- select_shipping_address: "Select Shipping Address",
- shipping_address: "Shipping Address",
- import_wechat_address: "Import from WeChat",
- add_new_shipping_address: "Add Address",
- no_shipping_address: "No Shipping Address",
- edit_address: "Edit Address",
- add_address: "Add Address",
- recipient: "Recipient",
- enter_recipient_name: "Enter Recipient's Name",
- province_city_district: "Province/City/District",
- select_province_city_district: "Select Province/City/District",
- detailed_address: "Detailed Address",
- enter_detailed_address: "Enter Detailed Address",
- set_as_default_address: "Set as Default Address",
- confirm_delete_address: "Confirm Delete This Address?",
- virtual_goods_address: "Virtual Address",
- edit_virtual_address: "Edit Virtual Address",
- add_virtual_address: "Add Virtual Address",
- set_as_default_virtual_address: "Set as Default Virtual Address"
- };
- const selectSku$1 = {
- insufficient_stock: "Insufficient Stock",
- select_specification: "Select Specification",
- amount_less_than_min: "Amount Less Than Minimum Purchase",
- insufficient_points: "Insufficient Points",
- min_points_required: "Minimum of 1 Point Required",
- purchase_quantity: "Purchase Quantity",
- purchase_amount: "Purchase Amount",
- available_points: "Available Points: {points}"
- };
- const cashier$1 = {
- cashier: "Cashier",
- select_payment_method: "Select Payment Method",
- phone_number: "Phone Number",
- enter_phone_number: "Enter Phone Number",
- verification_code: "Verification Code",
- enter_verification_code: "Enter Verification Code",
- checking_payment_environment: "Checking Payment Environment",
- payment_expired: "Payment Expired",
- pay_now: "Pay Now",
- verification_code_cannot_be_empty: "Verification Code Cannot Be Empty",
- choose_payment_method: "Choose Payment Method",
- order_paid: "Order Paid",
- no_payment_order_found: "No Payment Order Found",
- remaining_payment_time: "Remaining Payment Time {h}:{m}:{s}"
- };
- const share$1 = {
- share: "Share",
- poster_loading: "Poster Loading...",
- long_press_to_save: "Long Press to Save",
- save_success: "Save Successful",
- save_failure: "Save Failed"
- };
- const merchant$1 = {
- merchant_registration: "Merchant Signup",
- merchant_name: "Merchant Name",
- enter_merchant_name: "Enter Merchant Name",
- contact_person: "Contact Person",
- enter_contact_person: "Enter Contact Person",
- contact_phone: "Contact Phone",
- enter_contact_phone: "Enter Contact Phone",
- legal_person: "Legal Representative",
- enter_legal_person: "Enter Legal Representative",
- legal_person_phone: "Legal Representative Phone",
- enter_legal_person_phone: "Enter Legal Representative Phone",
- legal_person_id_front: "Legal ID Front",
- legal_person_id_back: "Legal ID Back",
- location: "Location",
- email: "Email",
- enter_email: "Enter Email",
- office_address: "Office Address",
- enter_office_address: "Enter Office Address",
- rights_phone: "Rights Phone",
- enter_rights_phone: "Enter Rights Phone",
- customer_service_phone: "Customer Service Phone",
- enter_customer_service_phone: "Enter Customer Service Phone",
- website: "Website",
- enter_website: "Enter Website",
- bank: "Bank",
- enter_bank: "Enter Bank",
- account_name: "Account Name",
- enter_account_name: "Enter Account Name",
- account_number: "Account Number",
- enter_account_number: "Enter Account Number",
- business_license: "Business License",
- brand_authorization: "Brand Authorization",
- download_template: "Download Template",
- other_certificates: "Other Certificates",
- introduction: "Introduction",
- enter_introduction: "Enter Introduction",
- status: "Status",
- review_in_progress: "Review in Progress",
- review_records: "Review Records",
- changes: "Changes",
- save_and_submit: "Save and Submit",
- existing_merchant_alert: "Existing merchant account for user ({user}), please apply with a different account!",
- merchant_name_required: "Merchant name is required",
- introduction_required: "Introduction is required",
- contact_required: "Contact is required",
- contact_phone_required: "Contact phone is required",
- customer_service_phone_required: "Customer service phone is required",
- legal_person_required: "Legal representative is required",
- legal_person_phone_required: "Legal representative phone is required",
- account_name_required: "Account name is required",
- account_number_required: "Account number is required",
- bank_required: "Bank is required",
- under_review: "Under Review",
- approved: "Approved",
- rejected: "Rejected",
- non_exclusive_authorization: "Non-exclusive Brand Authorization",
- select_location: "Select Location",
- select_legal_person_id_front: "Select Upload of Legal ID Front (National Emblem)",
- select_legal_person_id_back: "Select Upload of Legal ID Back (Portrait)",
- upload_business_license: "Upload Business License",
- upload_brand_authorization: "Upload Brand Authorization"
- };
- const useGoods$1 = {
- redeemed: "Redeemed",
- in_stock: "In Stock",
- pending_payment: "Pending Payment",
- awaiting_shipment: "Awaiting Shipment",
- awaiting_write_off: "Awaiting Write-off",
- awaiting_delivery: "Awaiting Delivery",
- awaiting_review: "Awaiting Review",
- completed: "Completed",
- closed: "Closed",
- complete_payment_by: "Please complete the payment by {time}",
- merchant_not_shipped: "Merchant has not shipped yet, please be patient",
- merchant_shipped: "Merchant has shipped, please be patient",
- goods_received: "Goods received, go leave a review",
- transaction_completed: "Transaction completed, thank you for your support",
- transaction_closed: "Transaction closed",
- apply_for_after_sales: "Apply for after-sales",
- goods_awaiting_return: "Goods awaiting return",
- merchant_awaiting_goods: "Merchant awaiting goods",
- waiting_for_refund: "Waiting for refund",
- refund_successful: "Refund successful",
- buyer_cancelled: "Buyer cancelled",
- merchant_refused: "Merchant refused",
- merchant_refused_goods: "Merchant refused to receive goods",
- unknown_status: "Unknown status",
- refund_request_awaiting_merchant: "Refund request awaiting merchant",
- return_goods_fill_logistics: "Return goods and fill logistics information",
- return_refund_request_awaiting_merchant: "Return and refund request awaiting merchant",
- refund_closed: "Refund closed",
- merchant_disagrees_with_refund_request: "Merchant disagrees with refund request, reason:",
- merchant_refuses_to_accept_goods: "Merchant refuses to accept goods, disagrees with refund, reason:"
- };
- const menu$1 = {
- quick_menu: "Quick Menu",
- search: "Search",
- personal_center: "Center",
- shopping_cart: "Cart",
- browsing_history: "History",
- my_favorites: "Favorites",
- customer_service: "Service"
- };
- const user$3 = {
- name: "Name",
- username: "Username",
- nickname: "Nickname",
- password: "Password",
- confirm_password: "Confirm password",
- email: "Email",
- phone: "Phone",
- avatar: "Avatar",
- status: "Status",
- create_time: "Create time",
- update_time: "Update time",
- last_login_time: "Last login time",
- last_login_ip: "Last login ip",
- clear_cache: "Clera cache",
- switch_language: "Switch language",
- log_out: "Log out",
- change: "Change",
- sex: "Sex",
- male: "Male",
- female: "Female",
- user_info: "User Information",
- unbind_reminder: "Unbinding Reminder",
- please_login: "Please Login"
- };
- const wallet$1 = {
- wallet: "Wallet",
- balance: "Balance",
- commission: "Commission",
- consumption_points: "Consumption",
- team: "Team",
- people: "People",
- generation_rules: "Net Worth Rules",
- benefits: "Net Worth Benefits",
- recharge: "Recharge",
- withdraw: "Withdraw",
- transfer_points: "Transfer Points",
- points_transfer: "Points Transfer",
- current_peak: "Current Peak Available:",
- commission_record: "Commission Record",
- points_record: "Points Record",
- withdrawal: "Withdrawal (expected within 24 hours)",
- commission_rules: "Commission Calculation Rules",
- exceed_limit: "Exceed Limit",
- withdrawal_records: "Withdrawal Records",
- wechat: "WeChat",
- alipay: "Alipay",
- bank_card: "Bank Card",
- credited: "Credited",
- withdrawal_failed: "Withdrawal Failed",
- withdrawing: "Withdrawing",
- select_withdrawal_method: "Select Withdrawal Method",
- not_bound_click_to_bind: "Not Bound, Click to Bind",
- withdrawal_amount: "Withdrawal Amount",
- actual_amount_received: "Actual Amount Received",
- note: "Note: Actual received amount {commission}, consumption points {consumption}.No withdrawal fee",
- withdraw_to_wechat: "Withdraw to WeChat",
- withdraw_to_alipay: "Withdraw to Alipay",
- withdraw_to_bank_card: "Withdraw to Bank Card",
- please_select_withdrawal_method: "Please Select Withdrawal Method",
- enter_withdrawal_amount: "Enter Withdrawal Amount",
- alipay_not_bound: "Alipay Account Not Bound",
- bank_card_not_bound: "Bank Card Not Bound",
- go_bind: "Go Bind",
- application_successful: "Application Successful",
- current_exchangeable_amount: "Your Current Exchangeable Amount:",
- commission_to_points: "Convert to Points",
- enter_transfer_amount: "Enter Transfer Amount",
- current_commission_available: "Current Commission Available",
- transfer_amount_cannot_be_empty: "Conversion Amount Cannot Be Empty",
- transfer_amount_cannot_be_zero: "Conversion Amount Must Be Greater Than Zero",
- commission_to_points_irreversible: "Conversion to points is irreversible. Proceed?",
- conversion_successful: "Conversion Successful",
- points_recharge: "Points Recharge",
- recharge_amount: "Recharge Amount",
- enter_recharge_amount: "Enter Recharge Amount",
- actual_points_received: "Actual Points Received",
- note_recharge_bonus: "Note: Recharge {amount} yuan or more to get {multiplier} times the points",
- recharge_amount_less_than: "Recharge Amount Cannot Be Less Than {point}",
- recipient: "Recipient",
- enter_recipient_username: "Enter Recipient's Username",
- recipient_phone: "Recipient's Phone",
- enter_recipient_phone: "Enter Recipient's Phone Number",
- transfer_amount: "Transfer Amount",
- current_transferable_amount: "Current Transferable Amount:",
- recipient_cannot_be_empty: "Recipient Cannot Be Empty",
- recipient_phone_cannot_be_empty: "Recipient's Phone Cannot Be Empty",
- verification_code_cannot_be_empty: "Verification Code Cannot Be Empty",
- transfer_amount_less_than_zero: "Transfer Amount Must Be Greater Than Zero",
- recipient_cannot_be_self: "Recipient Cannot Be Yourself",
- user_does_not_exist: "User Does Not Exist!",
- username_phone_mismatch: "Recipient's Username and Phone Number Do Not Match!",
- cannot_transfer_to_self: "Cannot Transfer to Oneself",
- transfer_successful: "Transfer Successful"
- };
- const team$1 = {
- total_people: "Total {count} People",
- retain_performance: "Keep Score",
- referrer: "Referrer",
- direct_referral: "Direct Referral",
- team_count: "Team: {count} People",
- new_performance_value: "New Score",
- no_team_members: "No Team Members"
- };
- const sign$1 = {
- check_in: "Check-in",
- check_in_gift: "Gift with Check-in",
- consecutive_check_ins: "Consecutive Check-ins:",
- sunday: "Sun",
- monday: "Mon",
- tuesday: "Tue",
- wednesday: "Wed",
- thursday: "Thu",
- friday: "Fri",
- saturday: "Sat",
- days: "Days",
- month_year: "{month}/{year}",
- already_checked_in: "Already Checked In",
- check_in_description: "Check-in Description",
- daily_check_in_fixed: "Daily check-in earns {social} social value",
- congratulations_on_check_in: "Congratulations on Successful Check-in",
- check_in_not_started: "Check-in Event Has Not Started",
- daily_check_in_reward: "Earn {social} Points of Social Value for Daily Check-in",
- level_upgraded: "Your Level has been Upgraded to {level}"
- };
- const order$1 = {
- payment_result: "Payment Result",
- payment_successful: "Payment Successful",
- payment_failed: "Payment Failed",
- order_closed: "Order Closed",
- checking_payment_result: "Checking Payment Result...",
- return_home: "Return Home",
- retry_payment: "Retry Payment",
- view_order: "View Order",
- view_wallet: "View Wallet",
- my_group_buying: "My Group Buying",
- get_realtime_shipping_info: "Get Real-time Shipping and Order Status",
- subscribe_now: "Subscribe Now",
- pending_payment: "Pay Now",
- pending_shipment: "To Ship",
- pending_receipt: "To Receive",
- pending_review: "To Review",
- all_orders: "All",
- my_orders: "My Orders",
- no_orders: "No Orders",
- order_number: "Order Number",
- total_items: "Total {count} Items",
- total_amount: "Total Amount",
- group_details: "Group Buying Details",
- view_details: "View Details",
- view_logistics: "View Logistics",
- confirm_receipt: "Confirm Receipt",
- cancel_order: "Cancel",
- review_order: "Review",
- delete_order: "Delete",
- continue_payment: "Continue Payment",
- confirm_receipt_question: "Confirm Receipt?",
- upgrade_wechat: "Please Upgrade WeChat Version",
- confirm_cancel_order: "Are You Sure You Want to Cancel the Order?",
- confirm_delete_order: "Are You Sure You Want to Delete the Order?",
- order_details: "Order Details",
- apply_for_service: "Apply for Service",
- refund_in_progress: "Refund in Progress",
- refund_successful: "Refund Successful",
- copy: "Copy",
- customer_message: "Customer Message",
- order_time: "Order Time",
- payment_time: "Payment Time",
- payment_method: "Payment Method",
- shipping_fee: "Shipping Fee",
- use_commission: "Use Commission",
- use_points: "Use Points",
- discount_amount: "Discount Amount",
- paid: "Paid",
- amount_due: "Amount Due",
- refunded: "Refunded",
- cancel_request: "Cancel Request",
- fill_return: "Fill Return",
- confirm_cancel_request: "Are You Sure You Want to Cancel This Request?",
- not_logged_in: "You are not logged in, please log in as {user} to continue",
- account_switch_needed: "You are currently logged in as {user}, please switch to {user} to proceed",
- product_quality: "Product Quality",
- service_attitude: "Service Attitude",
- meet_expectations: "Did the item meet your expectations? Share your experience to help others decide.",
- confirm_post_review: "Post Review?",
- missing_order_info: "Missing order information, please check",
- no_reviews_pending: "No Reviews Pending",
- after_sales_list: "After-Sales List",
- apply_for_after_sales: "Apply for Service",
- reason_for_application: "Reason for Application",
- select_reason_for_application: "Select a Reason",
- customer_prompt: "Please describe your issue, photo upload recommended",
- contact_customer_service: "Contact Support",
- select_after_sales_type: "Select Service Type",
- please_fill_in_description: "Please Fill in the Description",
- after_sales_details: "After-Sales Details",
- total_refund: "Total Refund",
- refund_amount: "Refund Amount",
- refund_commission: "Refund Commission",
- refund_points: "Refund Points",
- service_order_number: "Service Id",
- application_time: "Application Time",
- after_sales_type: "After-Sales Type",
- application_reason: "Application Reason",
- related_description: "Related Description",
- no_after_sales_details: "No After-Sales Details for This Order",
- submit_application: "Apply Now",
- processing: "Processing",
- completed: "Completed",
- refund_only: "Refund Only",
- refund_and_return: "Refund and Return",
- after_sales_progress: "After-Sales Progress",
- logistics_tracking: "Logistics Tracking",
- tracking_number: "Track #",
- courier_company: "Courier",
- shipping_time: "Shipped"
- };
- const setting$1 = {
- signature: "Personal Signature",
- set: "Settings",
- bind: "Bind",
- unbind: "Unbind",
- physical_address_management: "Physical Address Management",
- virtual_address_management: "Virtual Address Management",
- alipay_account: "Alipay Account",
- bank_card: "Bank Card",
- enter_platform: "Enter Platform",
- enter_merchant_backend: "Enter Merchant Backend",
- my_qrcode: "My QR Code",
- third_party_account_binding: "Third-party Account Binding",
- wechat_public_account: "WeChat Public Account",
- wechat_mini_program: "WeChat Mini Program",
- wechat_open_platform: "WeChat Open Platform",
- prompt: "Prompt",
- confirm_logout: "Confirm logout?"
- };
- const pop$1 = {
- confirm: "Confirm",
- cancel: "Cancel",
- Commission: {
- usingCommission: "Using Commission",
- availableCommission: "Your available commission",
- currentOrderTotalPrice: "Current order price ",
- canUseMaxCommission: ", maximum ",
- commission: " commission can be used"
- },
- ConsumptionPoints: {
- usingPoints: "Using Consumption Points",
- availablePoints: "Your available consumption points",
- currentOrderTotalPrice: "Current order price ",
- canUseMaxPoints: ", maximum ",
- points: " consumption points can be used"
- },
- congratulations: "Congratulations",
- commission_earned: "Commission Earned",
- social_value_earned: "Social Value Earned",
- order_success: "Order Successful",
- auto_checkin_success: "Congratulations! Auto Check-in Successful!",
- daily_checkin_reward: "Earned {point} Points for Daily Check-in",
- level_upgraded: "Your Level has been Upgraded to",
- follow_public_account: "Follow Our Public Account",
- long_press_qrcode_follow: "Long Press QR Code to Follow Public Account",
- wechat_friend: "WeChat Friend",
- create_poster: "Create Poster",
- copy_link: "Copy Link"
- };
- const rules$1 = {
- username: "Please enter your username",
- username_taken: "Username is already taken!",
- usernameNotnull: "Username cannot be empty",
- nickname: "Please enter your nickname",
- nicknameNotnull: "Nickname cannot be empty",
- password: "Please enter your password",
- passwordNotnull: "Password cannot be empty",
- confirm_password: "Please confirm your password",
- confirmPasswordNotnull: "Confirm password cannot be empty",
- email: "Please enter your email",
- emailNotnull: "Email cannot be empty",
- phone: "Please enter your phone number",
- phoneNotnull: "Phone number cannot be empty",
- avatar: "Please upload your avatar",
- avatarNotnull: "Avatar cannot be empty",
- sex: "Please select your gender",
- sexNotnull: "Gender cannot be empty",
- password_error: "Passwords do not match",
- click_change_password: "Click to change password",
- modify_success: "Modification successful, please log in again",
- unbind_warning: "After unbinding, you will no longer be able to log in to this account via WeChat",
- bind_phone: "Please bind your phone number",
- enter_username: "Enter Username",
- username_required: "Username Required",
- enter_phone: "Enter Phone Number",
- incorrect_phone_format: "Incorrect Phone Format",
- enter_password: "Enter Password",
- password_requirements: "6-12 chars with letters & numbers",
- enter_verification_code: "Enter Verification Code",
- enter_name: "Enter Name",
- enter_chinese_characters: "Enter Chinese Characters",
- enter_invoice_title: "Enter Invoice Title",
- enter_tax_number: "Enter Tax Number",
- enter_bank: "Enter Bank",
- enter_bank_card_number: "Enter Bank Card Number",
- correct_bank_card_number: "Enter Correct Bank Card Number",
- enter_alipay_account: "Enter Alipay Account",
- correct_account_number: "Enter Correct Account",
- enter_email: "Enter Email",
- correct_email: "Enter Correct Email"
- };
- const en$3 = {
- "lang.en": "EngLish",
- "lang.zh-hans": "简体中文",
- settings: settings$1,
- agreement: agreement$1,
- user_management: user_management$1,
- role_management: role_management$1,
- menu_management: menu_management$1,
- post_management: post_management$1,
- org_management: org_management$1,
- add_user: add_user$1,
- about: about$1,
- "title.home": "Home",
- "title.userinfo": "User Information",
- "title.settings": "Settings",
- "title.usercenter": "User Center",
- "title.product_category": "Categories",
- "title.cart": "Cart",
- "title.search": "Search",
- "title.product_details": "Details",
- "title.group_buying": "Group Buy",
- "title.flash_sale": "Flash Sale",
- "title.product_list": "Products",
- "title.rate_product": "Rate Product",
- "title.product_reviews": "Reviews",
- "title.order_details": "Order Details",
- "title.confirm_order": "Confirm Order",
- "title.my_orders": "My Orders",
- "title.apply_service": "After-Sales",
- "title.return_logistics": "Return Logistics",
- "title.after_sales_list": "After-Sales",
- "title.after_sales_details": "Service Details",
- "title.after_sales_progress": "Service Progress",
- "title.logistics_tracking": "Tracking",
- "title.share": "Share",
- "title.my_favorites": "Favorites",
- "title.my_footprints": "Footprints",
- "title.physical_address": "Shipping Address",
- "title.virtual_address": "Virtual Address",
- "title.edit_invoice": "Edit Invoice",
- "title.manage_invoice": "Manage Invoice",
- "title.edit_address": "Edit Address",
- "title.my_balance": "My Balance",
- "title.wallet": "Wallet",
- "title.points_source": "Points Source",
- "title.points_recharge": "Points Recharge",
- "title.points_transfer": "Points Transfer",
- "title.commission_to_points": "Convert to Points",
- "title.withdraw": "Withdraw",
- "title.withdraw_records": "Withdrawals",
- "title.commission_exchange": "Exchange",
- "title.team": "Team",
- "title.distribution": "Distribution",
- "title.my_commission": "My Commission",
- "title.promote_products": "Promote",
- "title.distribution_orders": "Dist. Orders",
- "title.my_team": "My Team",
- "title.promoter_ranking": "Promoter Rank",
- "title.commission_ranking": "Commission Rank",
- "title.apply_withdraw": "Withdraw",
- "title.check_in_center": "Check-In",
- "title.shop_home": "Shop Home",
- "title.system_settings": "Settings",
- "title.rich_text": "Rich Text",
- "title.faq": "FAQ",
- "title.error_page": "Error Page",
- "title.coupon_center": "Coupons",
- "title.coupons": "Coupons",
- "title.customer_service": "Support",
- "title.checkout": "Checkout",
- "title.fuiou_result": "Payment Result",
- "title.payment_result": "Payment Result",
- "title.recharge_balance": "Recharge",
- "title.recharge_records": "Recharge History",
- "title.group_details": "Group Details",
- "title.my_groups": "My Groups",
- "title.marketing_products": "Marketing",
- "title.group_activities": "Group Activities",
- "title.seckill_activities": "Seckill",
- "title.bargain_list": "Bargain List",
- "title.bargain_details": "Bargain Details",
- common: common$1,
- account: account$1,
- review: review$1,
- confirm: confirm$1,
- address: address$1,
- selectSku: selectSku$1,
- cashier: cashier$1,
- share: share$1,
- merchant: merchant$1,
- useGoods: useGoods$1,
- menu: menu$1,
- user: user$3,
- wallet: wallet$1,
- team: team$1,
- sign: sign$1,
- order: order$1,
- setting: setting$1,
- pop: pop$1,
- rules: rules$1
- };
- const settings = "设置";
- const agreement = "用户隐私协议";
- const user_management = "用户管理";
- const role_management = "角色管理";
- const menu_management = "菜单管理";
- const post_management = "岗位管理";
- const org_management = "组织管理";
- const add_user = "新增用户";
- const about = "关于";
- const common = {
- letcgo: "常来此购",
- home: "首页",
- category: "分类",
- cart: "购物车",
- my: "我的",
- product: "商品",
- review: "评价",
- detail: "详情",
- view_all: "查看全部",
- none: "无",
- all: "全部",
- search_products: "搜索商品",
- buy_now: "立即购买",
- sold: "已售",
- sales_volume: "销量",
- go_buy: "去购买",
- add_to_cart: "加入购物车",
- redeem_now: "立即兑换",
- sold_out: "已售罄",
- product_not_exist: "商品不存在或已下架",
- awaiting_your_first_review: "期待您的第一个评价",
- browse_more: "再逛逛",
- select_product_options: "请选择商品规格",
- favorite: "收藏",
- unfavorite: "取消收藏",
- favorite_success: "收藏成功",
- points: "积分",
- cancel: "取消",
- confirm: "确定",
- submit: "提交",
- save: "保存",
- "delete": "删除",
- edit: "编辑",
- close: "关闭",
- back: "返回",
- next: "下一步",
- previous: "上一步",
- yes: "是",
- no: "否",
- ok: "好的",
- post: "发布",
- loading: "加载中...",
- refresh: "刷新",
- search: "搜索",
- reset: "重置",
- add: "添加",
- update: "更新",
- upload: "上传",
- download: "下载",
- level: "等级",
- no_level: "无等级",
- select: "选择",
- select_product_specification: "请选择商品规格",
- clear: "清空",
- delete_footprint: "删除足迹",
- select_all: "全选",
- my_footprints: "我的足迹",
- total_goods: "共 {number} 件商品",
- recommended: "综合推荐",
- price_asc: "价格升序",
- price_desc: "价格降序",
- sales: "销量",
- newest: "新品优先",
- enter_keywords: "请输入关键词",
- checkout: "去结算",
- total: "合计",
- "default": "默认",
- empty_cart: "购物车空空如也,快去逛逛吧~",
- select_area: "选择区域",
- click_to_load_more: "点击加载更多",
- system: "系统",
- current_version: "当前版本",
- local_cache: "本地缓存",
- about_us: "关于我们",
- logout_account: "注销账号",
- confirm_logout: "确认注销账号?",
- no_data: "暂无数据",
- uploading: "上传中",
- verifying: "验证中",
- fetching: "获取中",
- save_success: "保存成功",
- update_success: "更新成功",
- logging_in: "登录中",
- login_success: "登录成功",
- registering: "注册中",
- register_success: "注册成功",
- sending: "发送中",
- send_success: "发送成功",
- binding: "绑定中",
- bind_success: "绑定成功",
- unbind: "解除绑定",
- unbind_success: "解绑成功",
- claiming: "领取中",
- claim_success: "领取成功",
- collect_success: "收藏成功",
- cancel_success: "取消成功",
- delete_success: "删除成功",
- clear_success: "清空成功",
- apply_success: "申请成功",
- change_success: "变动成功",
- added_to_cart: "已添加到购物车",
- just_now: "刚刚",
- minutes_ago: "{m}分钟前",
- hours_ago: "{h}小时前",
- days_ago: "{d}天前",
- months_ago: "{m}个月前",
- years_ago: "{y}年前",
- copy_success: "复制成功!",
- copy_fail: "复制失败!",
- sms_error: "短信发送事件错误",
- try_later: "请稍后再试",
- phone_format_error: "手机号码格式不正确",
- get_verification_code: "获取验证码",
- use_wechat_browser: "请使用微信网页浏览器打开",
- platform_not_supported: "暂不支持该平台",
- payment_manually_cancelled: "支付已手动取消",
- alipay_payment: "支付宝支付",
- copy_link_to_browser: "复制链接到外部浏览器",
- copy_link: "复制链接",
- wechat_payment: "微信支付",
- bind_wechat_for_payment: "请先绑定微信再使用微信支付",
- bind: "绑定",
- balance_payment: "余额支付",
- mock_payment: "模拟支付",
- update_prompt: "更新提示",
- new_version_ready: "新版本已经准备好,是否重启应用?",
- latest_version: "当前为最新版本",
- server_error_try_later: "服务器开小差啦,请稍后再试~",
- network_request_error: "网络请求出错",
- request_error: "请求出错",
- login_expired: "您的登陆已过期",
- please_login: "请登录",
- access_denied: "拒绝访问",
- request_timeout: "请求超时",
- frequent_requests: "请求频繁, 请稍后再访问",
- server_unavailable: "服务未实现",
- network_error: "网络错误",
- service_unavailable: "服务不可用",
- network_timeout: "网络超时",
- http_not_supported: "HTTP 版本不受支持",
- server_exception: "服务器异常",
- check_network_connection: "请检查您的网络连接",
- not_bound_wechat: "您未绑定微信,请先绑定",
- platform_intro: "平台简介",
- industry_intro: "产业介绍",
- latest_news: "最新资讯",
- shared_mall: "共享商城",
- activities: "活动",
- videos: "视频",
- mall: "商城",
- shop_index: "店铺首页",
- shop_category: "店铺分类",
- all_product: "所有商品"
- };
- const account = {
- account_login: "账号登录",
- sms_login: "短信登录",
- register: "注册",
- read_and_agree: "我已阅读并遵守",
- user_agreement: "《用户协议》",
- privacy_policy: "《隐私协议》",
- and: "与",
- wechat_authorization_login: "微信授权登录",
- wechat_authorization_register: "微信授权注册",
- please_agree: "请勾选同意",
- register_by_sharing_only: "您只能通过分享注册",
- quick_login_failed: "快捷登录失败",
- username: "用户名",
- password: "密码",
- enter_username: "请输入用户名",
- enter_valid_username: "请输入正确的用户名!",
- enter_password: "请输入密码",
- login: "登录",
- phone_number: "手机号",
- verification_code: "验证码",
- enter_verification_code: "请输入验证码",
- get_verification_code: "获取验证码",
- incorrect_phone_format: "手机号码格式不正确",
- enter_phone_number: "请输入手机号",
- username_exists: "已存在用户名!",
- change_phone_number: "更换手机号",
- bind_phone_number: "绑定手机号",
- old_phone_number: "原手机号",
- enter_old_phone_number: "请输入原手机号",
- security_notice: "为了您的账号安全,请使用本人手机号码",
- new_phone_number: "新手机号",
- enter_new_phone_number: "请输入新手机号",
- login_again: "修改成功,请重新登录",
- change_password: "修改密码",
- cancel_change: "取消修改",
- password_requirements: "需包含字母和数字,长度在6-12之间",
- modification_successful: "修改成功",
- authorization_info: "授权信息",
- complete_profile: "完善您的头像、昵称、手机号",
- avatar: "头像",
- select_avatar: "请选择头像",
- nickname: "昵称",
- enter_nickname: "请输入昵称",
- confirm_authorization: "确认授权",
- authorization_successful: "授权成功",
- first_time_login: "您首次登录,请输入手机号验证",
- continue_login: "继续登录",
- change_alipay_account: "更换支付宝账号",
- bind_alipay_account: "绑定支付宝账号",
- bind_realname_alipay: "请绑定已实名认证的支付宝账号",
- name: "名称",
- enter_name: "请输入名称",
- account: "账号",
- enter_account: "请输入账号",
- change_bank_card: "更换银行卡",
- bind_bank_card: "绑定银行卡",
- bank_branch: "开户行",
- bank_branch_example: "例:xx银行股份有限公司xx分行xx支行",
- account_holder: "开户名",
- account_holder_name: "个人姓名",
- bank_account_number: "银行卡账号",
- select_account_login: "请选择账号登录",
- wechat_no_bind: "该微信暂绑定无账号,请使用其他登陆方式",
- wechat_register: "微信注册",
- wechat_no_account: "您的微信没有账号,请先注册"
- };
- const review = {
- all_reviews: "全部评价",
- positive: "好评",
- neutral: "中评",
- negative: "差评"
- };
- const confirm = {
- confirm_order: "确认订单",
- shipping_fee: "运费",
- free_shipping: "包邮",
- order_note: "订单备注",
- communication_advice: "建议留言前先与商家沟通",
- quantity: "数量",
- price_details: "价格明细",
- total_price: "商品总价",
- total_items: "共{count}件商品",
- commission_deduction: "佣金抵扣",
- deduction: "抵扣{count}元",
- no_commission: "不使用佣金",
- consumption_point_deduction: "消费分抵扣",
- no_consumption_points: "不使用消费分",
- total_items_count: "共{count}件",
- submit_order: "提交订单",
- select_shipping_address: "请选择收货地址",
- insufficient_commission: "可用佣金不足",
- insufficient_consumption_points: "可用消费分不足",
- commission_points_no_mix: "佣金不能搭配消费分使用"
- };
- const address = {
- select_shipping_address: "请选择收货地址",
- shipping_address: "收货地址",
- import_wechat_address: "导入微信地址",
- add_new_shipping_address: "新增收货地址",
- no_shipping_address: "暂无收货地址",
- edit_address: "编辑地址",
- add_address: "新增地址",
- recipient: "收货人",
- enter_recipient_name: "请填写收货人姓名",
- province_city_district: "省市区",
- select_province_city_district: "请选择省市区",
- detailed_address: "详细地址",
- enter_detailed_address: "请输入详细地址",
- set_as_default_address: "设为默认地址",
- confirm_delete_address: "确认删除此收货地址吗?",
- virtual_goods_address: "虚拟商品收货地址",
- edit_virtual_address: "编辑虚拟地址",
- add_virtual_address: "新增虚拟地址",
- set_as_default_virtual_address: "设为默认虚拟地址"
- };
- const selectSku = {
- insufficient_stock: "库存不足",
- select_specification: "请选择规格",
- amount_less_than_min: "输入金额少于可购买数量",
- insufficient_points: "可用积分不足",
- min_points_required: "最低使用1积分",
- purchase_quantity: "购买数量",
- purchase_amount: "购买金额",
- available_points: "当前可用积分:{points}"
- };
- const cashier = {
- cashier: "收银台",
- select_payment_method: "选择支付方式",
- phone_number: "手机号",
- enter_phone_number: "请输入手机号",
- verification_code: "验证码",
- enter_verification_code: "请输入验证码",
- checking_payment_environment: "检测支付环境中",
- payment_expired: "支付已过期",
- pay_now: "立即支付",
- verification_code_cannot_be_empty: "验证码不能为空",
- choose_payment_method: "请选择支付方式",
- order_paid: "该订单已支付",
- no_payment_order_found: "未查询到支付单信息",
- remaining_payment_time: "剩余支付时间 {h}:{m}:{s}"
- };
- const share = {
- share: "分享",
- poster_loading: "海报加载中...",
- long_press_to_save: "长按图片保存",
- save_success: "保存成功",
- save_failure: "保存失败"
- };
- const merchant = {
- merchant_registration: "商家入驻",
- merchant_name: "商家名称",
- enter_merchant_name: "请输入商家名称",
- contact_person: "联络人",
- enter_contact_person: "请输入联络人",
- contact_phone: "联络人手机号",
- enter_contact_phone: "请输入联络人手机号",
- legal_person: "法人",
- enter_legal_person: "请输入法人",
- legal_person_phone: "法人手机号",
- enter_legal_person_phone: "请输入法人手机号",
- legal_person_id_front: "法人身份证正面",
- legal_person_id_back: "法人身份证反面",
- location: "所在地",
- email: "邮箱",
- enter_email: "请输入邮箱",
- office_address: "办公地址",
- enter_office_address: "请输入办公地址",
- rights_phone: "维权电话",
- enter_rights_phone: "请输入维权电话",
- customer_service_phone: "客服电话",
- enter_customer_service_phone: "请输入客服电话",
- website: "官网",
- enter_website: "请输入官网",
- bank: "开户银行",
- enter_bank: "请输入开户银行",
- account_name: "账户名称",
- enter_account_name: "请输入账户名称",
- account_number: "账户号码",
- enter_account_number: "请输入账户号码",
- business_license: "营业执照",
- brand_authorization: "品牌授权书",
- download_template: "下载模板",
- other_certificates: "其他证书",
- introduction: "简介",
- enter_introduction: "请输入简介",
- status: "状态",
- review_in_progress: "审核中",
- review_records: "审核记录",
- changes: "变动",
- save_and_submit: "保存并提交",
- existing_merchant_alert: "当前用户({user}),已存在商户账号,请更换账号申请!",
- merchant_name_required: "商户名称不能为空",
- introduction_required: "简介不能为空",
- contact_required: "联络人不能为空",
- contact_phone_required: "联络人手机号不能为空",
- customer_service_phone_required: "客服电话不能为空",
- legal_person_required: "法人不能为空",
- legal_person_phone_required: "法人电话不能为空",
- account_name_required: "账户名称不能为空",
- account_number_required: "账户号码不能为空",
- bank_required: "开户银行不能为空",
- under_review: "审核中",
- approved: "通过",
- rejected: "拒绝",
- non_exclusive_authorization: "非独家品牌授权书",
- select_location: "请选择所在地",
- select_legal_person_id_front: "请选择上传法人身份证正面(国徽面)",
- select_legal_person_id_back: "请选择上传法人身份证背面(人像面)",
- upload_business_license: "请上传营业执照",
- upload_brand_authorization: "请上传品牌授权书"
- };
- const useGoods = {
- redeemed: "已兑换",
- in_stock: "库存",
- pending_payment: "待付款",
- awaiting_shipment: "待发货",
- awaiting_write_off: "待核销",
- awaiting_delivery: "待收货",
- awaiting_review: "待评价",
- completed: "已完成",
- closed: "已关闭",
- complete_payment_by: "请在 {time} 前完成支付",
- merchant_not_shipped: "商家未发货,请耐心等待",
- merchant_shipped: "商家已发货,请耐心等待",
- goods_received: "已收货,快去评价一下吧",
- transaction_completed: "交易完成,感谢您的支持",
- transaction_closed: "交易关闭",
- apply_for_after_sales: "申请售后",
- goods_awaiting_return: "商品待退货",
- merchant_awaiting_goods: "商家待收货",
- waiting_for_refund: "等待退款",
- refund_successful: "退款成功",
- buyer_cancelled: "买家取消",
- merchant_refused: "商家拒绝",
- merchant_refused_goods: "商家拒收货",
- unknown_status: "未知状态",
- refund_request_awaiting_merchant: "退款申请待商家处理",
- return_goods_fill_logistics: "请退货并填写物流信息",
- return_refund_request_awaiting_merchant: "退货退款申请待商家处理",
- refund_closed: "退款关闭",
- merchant_disagrees_with_refund_request: "商家不同意退款申请,拒绝原因:",
- merchant_refuses_to_accept_goods: "商家拒绝收货,不同意退款,拒绝原因:"
- };
- const menu = {
- quick_menu: "快捷菜单",
- search: "搜索",
- personal_center: "个人中心",
- shopping_cart: "购物车",
- browsing_history: "浏览记录",
- my_favorites: "我的收藏",
- customer_service: "客服"
- };
- const user$2 = {
- name: "名称",
- username: "用户名",
- nickname: "昵称",
- password: "密码",
- confirm_password: "确认密码",
- email: "邮箱",
- phone: "手机号",
- avatar: "头像",
- status: "状态",
- create_time: "创建时间",
- update_time: "更新时间",
- last_login_time: "最后登录时间",
- last_login_ip: "最后登录IP",
- clear_cache: "清理缓存",
- switch_language: "切换语言",
- log_out: "退出登录",
- change: "修改",
- sex: "性别",
- male: "男",
- female: "女",
- user_info: "用户信息",
- unbind_reminder: "解绑提醒",
- please_login: "请登录"
- };
- const wallet = {
- wallet: "钱包",
- balance: "余额",
- commission: "佣金",
- consumption_points: "消费分",
- team: "团队",
- people: "人",
- generation_rules: "身价产生规则",
- benefits: "身价权益",
- recharge: "充值",
- withdraw: "提现",
- transfer_points: "转消费分",
- points_transfer: "消费分转让",
- current_peak: "当前可获得峰值:",
- commission_record: "佣金记录",
- points_record: "消费分记录",
- withdrawal: "提现 (预计24小时左右到账)",
- commission_rules: "佣金计算规则",
- exceed_limit: "超出额度",
- withdrawal_records: "提现记录",
- wechat: "微信",
- alipay: "支付宝",
- bank_card: "银行卡",
- credited: "已到账",
- withdrawal_failed: "提现失败",
- withdrawing: "提现中",
- select_withdrawal_method: "选择提现方式",
- not_bound_click_to_bind: "暂未绑定,点击绑定",
- withdrawal_amount: "提现金额",
- actual_amount_received: "实到金额",
- note: "备注:实际到账金额{commission},消费分{consumption}。免提现手续费",
- withdraw_to_wechat: "提现到微信",
- withdraw_to_alipay: "提现到支付宝",
- withdraw_to_bank_card: "提现到银行卡",
- please_select_withdrawal_method: "请选择提现方式",
- enter_withdrawal_amount: "请输入提现金额",
- alipay_not_bound: "未绑定支付宝账号",
- bank_card_not_bound: "未绑定银行卡",
- go_bind: "去绑定",
- application_successful: "申请成功",
- current_exchangeable_amount: "您当前可兑换金额:",
- commission_to_points: "佣金转消费分",
- enter_transfer_amount: "请输入转让金额",
- current_commission_available: "您当前可转换的佣金额度",
- transfer_amount_cannot_be_zero: "转换金额不能小于等于0",
- commission_to_points_irreversible: "佣金转为消费分后不可逆,是否转换?",
- conversion_successful: "转换成功",
- points_recharge: "消费分充值",
- recharge_amount: "充值金额",
- enter_recharge_amount: "请输入充值金额",
- actual_points_received: "实到消费分",
- note_recharge_bonus: "备注:充值{amount}元及以上,可获得{multiplier}倍消费分",
- recharge_amount_less_than: "充值金额不能少于{point}",
- recipient: "接收人",
- enter_recipient_username: "请输入接收人用户名",
- recipient_phone: "接收人手机号",
- enter_recipient_phone: "请输入接收人手机号",
- transfer_amount: "转让金额",
- current_transferable_amount: "您当前可转让的金额:",
- recipient_cannot_be_empty: "接收人不能为空",
- recipient_phone_cannot_be_empty: "接收人手机号不能为空",
- verification_code_cannot_be_empty: "验证码不能为空",
- transfer_amount_cannot_be_empty: "转让金额不能为空",
- transfer_amount_less_than_zero: "转让金额不能小于等于0",
- recipient_cannot_be_self: "接收人不能为自己",
- user_does_not_exist: "用户不存在!",
- username_phone_mismatch: "接收人用户名与手机号不匹配!",
- cannot_transfer_to_self: "不能给自己转账",
- transfer_successful: "转账成功"
- };
- const team = {
- total_people: "共{count}人",
- retain_performance: "保留绩效值",
- referrer: "推荐人",
- direct_referral: "直推人",
- team_count: "团队:{count}人",
- new_performance_value: "新增绩效值:",
- no_team_members: "暂无团队成员"
- };
- const sign = {
- check_in: "签到",
- check_in_gift: "签到有礼",
- consecutive_check_ins: "已连续签到",
- days: "天",
- sunday: "日",
- monday: "一",
- tuesday: "二",
- wednesday: "三",
- thursday: "四",
- friday: "五",
- saturday: "六",
- month_year: "{year}年{month}月",
- already_checked_in: "已签到",
- check_in_description: "签到说明",
- daily_check_in_fixed: "每日签到固定 {social} 身价",
- congratulations_on_check_in: "恭喜签到成功",
- check_in_not_started: "签到活动还未开始",
- daily_check_in_reward: "获得每日签到{social}点身价",
- level_upgraded: "您已升级等级为{level}"
- };
- const order = {
- payment_result: "支付结果",
- payment_successful: "支付成功",
- payment_failed: "支付失败",
- order_closed: "该订单已关闭",
- checking_payment_result: "检测支付结果...",
- return_home: "返回首页",
- retry_payment: "重新支付",
- view_order: "查看订单",
- view_wallet: "查看钱包",
- my_group_buying: "我的拼团",
- get_realtime_shipping_info: "获取实时发货信息与订单状态",
- subscribe_now: "立即订阅",
- pending_payment: "待付款",
- pending_shipment: "待发货",
- pending_receipt: "待收货",
- pending_review: "待评价",
- all_orders: "全部订单",
- my_orders: "我的订单",
- no_orders: "暂无订单",
- order_number: "订单号",
- total_items: "共 {count} 件商品",
- total_amount: "总金额",
- group_details: "拼团详情",
- view_details: "查看详情",
- view_logistics: "查看物流",
- confirm_receipt: "确认收货",
- cancel_order: "取消订单",
- review_order: "评价",
- delete_order: "删除订单",
- continue_payment: "继续支付",
- confirm_receipt_question: "确认收货?",
- upgrade_wechat: "请升级微信版本",
- confirm_cancel_order: "确定要取消订单吗?",
- confirm_delete_order: "确定要删除订单吗?",
- order_details: "订单详情",
- apply_for_service: "申请售后",
- refund_in_progress: "退款中",
- refund_successful: "退款成功",
- copy: "复制",
- customer_message: "用户留言",
- order_time: "下单时间",
- payment_time: "支付时间",
- payment_method: "支付方式",
- shipping_fee: "运费",
- use_commission: "使用佣金",
- use_points: "使用消费分",
- discount_amount: "优惠金额",
- paid: "已付款",
- amount_due: "需付款",
- refunded: "已退款",
- cancel_request: "取消申请",
- fill_return: "填写退货",
- confirm_cancel_request: "确定要取消此申请吗",
- not_logged_in: "您尚未登录,请登录: {user}后再试",
- account_switch_needed: "您当前登录的账号是{user},请切换到{user}后再试",
- product_quality: "商品质量",
- service_attitude: "服务态度",
- meet_expectations: "宝贝满足你的期待吗?说说你的使用心得,分享给想买的他们吧~",
- confirm_post_review: "发布评论?",
- missing_order_info: "缺少订单信息,请检查",
- no_reviews_pending: "无待评价订单",
- after_sales_list: "售后列表",
- apply_for_after_sales: "申请售后",
- reason_for_application: "申请原因",
- select_reason_for_application: "请选择申请原因",
- customer_prompt: "客官~请描述您遇到的问题,建议上传照片",
- contact_customer_service: "联系客服",
- select_after_sales_type: "请选择售后类型",
- please_fill_in_description: "请填写相关描述",
- after_sales_details: "售后详情",
- total_refund: "退款总额",
- refund_amount: "退款金额",
- refund_commission: "退款佣金",
- refund_points: "退款消费分",
- service_order_number: "服务单号",
- application_time: "申请时间",
- after_sales_type: "售后类型",
- application_reason: "申请原因",
- related_description: "相关描述",
- no_after_sales_details: "暂无该订单售后详情",
- submit_application: "提交申请",
- processing: "处理中",
- completed: "完成",
- refund_only: "仅退款",
- refund_and_return: "退款退货",
- after_sales_progress: "售后进度",
- logistics_tracking: "物流追踪",
- tracking_number: "快递单号",
- courier_company: "快递公司",
- shipping_time: "发货时间"
- };
- const setting = {
- signature: "个性签名",
- set: "设置",
- bind: "绑定",
- unbind: "解绑",
- physical_address_management: "实体收货地址管理",
- virtual_address_management: "虚拟收货地址管理",
- alipay_account: "支付宝账号",
- bank_card: "银行卡",
- enter_platform: "进入平台",
- enter_merchant_backend: "进入商家后台",
- my_qrcode: "我的二维码",
- third_party_account_binding: "第三方账号绑定",
- wechat_public_account: "微信公众号",
- wechat_mini_program: "微信小程序",
- wechat_open_platform: "微信开放平台",
- prompt: "提示",
- confirm_logout: "确认退出账号?"
- };
- const pop = {
- confirm: "确定",
- cancel: "取消",
- Commission: {
- usingCommission: "使用佣金",
- availableCommission: "您的可用佣金",
- currentOrderTotalPrice: "当前订单价格",
- canUseMaxCommission: ",可使用最高",
- commission: "佣金"
- },
- ConsumptionPoints: {
- usingPoints: "使用消费分",
- availablePoints: "您的可用消费分",
- currentOrderTotalPrice: "当前订单价格",
- canUseMaxPoints: ",可使用最高",
- points: "消费分"
- },
- congratulations: "恭喜",
- commission_earned: "获得佣金",
- social_value_earned: "获得身价",
- order_success: "下单成功",
- auto_checkin_success: "恭喜!自动签到成功!",
- daily_checkin_reward: "获得每日签到{point}点身价",
- level_upgraded: "您已升级等级为",
- follow_public_account: "关注公众号",
- long_press_qrcode_follow: "长按二维码关注公众号",
- wechat_friend: "微信好友",
- create_poster: "生成海报",
- copy_link: "复制链接"
- };
- const rules = {
- username: "请输入用户名",
- username_taken: "用户名已被使用!",
- usernameNotnull: "用户名不能为空",
- nickname: "请输入昵称",
- nicknameNotnull: "昵称不能为空",
- password: "请输入密码",
- passwordNotnull: "密码不能为空",
- confirm_password: "请确认密码",
- confirmPasswordNotnull: "确认密码不能为空",
- email: "请输入邮箱",
- emailNotnull: "邮箱不能为空",
- phone: "请输入手机号",
- phoneNotnull: "手机号不能为空",
- avatar: "请上传头像",
- avatarNotnull: "头像不能为空",
- sex: "请选择性别",
- sexNotnull: "性别不能为空",
- password_error: "两次密码不一致",
- click_change_password: "点击修改密码",
- bind_phone: "请绑定手机号",
- unbind_warning: "解绑后您将无法通过微信登录此账号",
- modify_success: "修改成功,请重新登录",
- enter_username: "请输入用户名",
- username_required: "用户名不能为空",
- enter_phone: "请输入手机号",
- enter_password: "请输入密码",
- password_requirements: "需包含字母和数字,长度在6-12之间",
- enter_verification_code: "请输入验证码",
- enter_name: "请输入姓名",
- enter_chinese_characters: "请输入汉字",
- enter_invoice_title: "请输入发票抬头名称",
- enter_tax_number: "请输入税号",
- enter_bank: "请输入开户行",
- enter_bank_card_number: "请输入银行卡号",
- correct_bank_card_number: "请输入正确的银行卡号",
- enter_alipay_account: "请输入支付宝账号",
- correct_account_number: "请输入正确账号",
- enter_email: "请输入邮箱",
- correct_email: "请输入正确邮箱账号"
- };
- const zhHans$3 = {
- "lang.en": "EngLish",
- "lang.zh-hans": "简体中文",
- settings,
- agreement,
- user_management,
- role_management,
- menu_management,
- post_management,
- org_management,
- add_user,
- about,
- "title.home": "首页",
- "title.userinfo": "用户信息",
- "title.settings": "用户设置",
- "title.usercenter": "用户中心",
- "title.product_category": "商品分类",
- "title.cart": "购物车",
- "title.search": "搜索",
- "title.product_details": "商品详情",
- "title.group_buying": "拼团商品",
- "title.flash_sale": "秒杀商品",
- "title.product_list": "商品列表",
- "title.rate_product": "评价商品",
- "title.product_reviews": "商品评价",
- "title.order_details": "订单详情",
- "title.confirm_order": "确认订单",
- "title.my_orders": "我的订单",
- "title.apply_service": "申请售后",
- "title.return_logistics": "退货物流",
- "title.after_sales_list": "售后列表",
- "title.after_sales_details": "售后详情",
- "title.after_sales_progress": "售后进度",
- "title.logistics_tracking": "物流轨迹",
- "title.share": "分享",
- "title.my_favorites": "我的收藏",
- "title.my_footprints": "我的足迹",
- "title.physical_address": "实体商品收货地址",
- "title.virtual_address": "虚拟商品收货地址",
- "title.edit_invoice": "发票抬头编辑",
- "title.manage_invoice": "发票抬头管理",
- "title.edit_address": "编辑地址",
- "title.my_balance": "我的余额",
- "title.wallet": "钱包",
- "title.points_source": "消费分来源",
- "title.points_recharge": "消费分充值",
- "title.points_transfer": "消费分转账",
- "title.commission_to_points": "佣金转消费分",
- "title.withdraw": "提现",
- "title.withdraw_records": "提现记录",
- "title.commission_exchange": "佣金兑换",
- "title.team": "团队",
- "title.distribution": "分销",
- "title.my_commission": "我的佣金",
- "title.promote_products": "推广商品",
- "title.distribution_orders": "分销订单",
- "title.my_team": "我的团队",
- "title.promoter_ranking": "推广人排行榜",
- "title.commission_ranking": "佣金排行榜",
- "title.apply_withdraw": "申请提现",
- "title.check_in_center": "签到中心",
- "title.shop_home": "店铺",
- "title.system_settings": "系统设置",
- "title.rich_text": "富文本",
- "title.faq": "常见问题",
- "title.error_page": "错误页面",
- "title.coupon_center": "领券中心",
- "title.coupons": "优惠券",
- "title.customer_service": "客服",
- "title.checkout": "收银台",
- "title.fuiou_result": "富友支付结果",
- "title.payment_result": "支付结果",
- "title.recharge_balance": "充值余额",
- "title.recharge_records": "充值记录",
- "title.group_details": "拼团详情",
- "title.my_groups": "我的拼团",
- "title.marketing_products": "营销商品",
- "title.group_activities": "拼团活动",
- "title.seckill_activities": "秒杀活动",
- "title.bargain_list": "砍价列表",
- "title.bargain_details": "砍价详情",
- common,
- account,
- review,
- confirm,
- address,
- selectSku,
- cashier,
- share,
- merchant,
- useGoods,
- menu,
- user: user$2,
- wallet,
- team,
- sign,
- order,
- setting,
- pop,
- rules
- };
- const userLanguage = vue.ref(uni.getLocale() || "en-US");
- uni.setStorageSync("userLanguage", userLanguage.value);
- const i18n = createI18n({
- locale: userLanguage.value,
- fallbackLocale: "en-US",
- messages: {
- "en": en$3,
- "zh-Hans": zhHans$3
- }
- });
- async function setLanguage(language) {
- userLanguage.value = language;
- uni.setStorageSync("userLanguage", language);
- uni.setLocale(language);
- location.reload();
- }
- function t$6(key, params) {
- return i18n.global.t(key, params);
- }
- const SocialApi = {
- // 获得社交用户
- getSocialUser: (type) => {
- return request$1({
- url: "/member/social-user/get",
- method: "GET",
- params: {
- type
- },
- custom: {
- showLoading: false
- }
- });
- },
- // 社交绑定
- socialBind: (type, code2, state) => {
- return request$1({
- url: "/member/social-user/bind",
- method: "POST",
- data: {
- type,
- code: code2,
- state
- },
- custom: {
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.binding"),
- successMsg: t$6("common.bind_success")
- }
- }
- });
- },
- // 社交绑定
- socialUnbind: (type, openid) => {
- return request$1({
- url: "/member/social-user/unbind",
- method: "DELETE",
- data: {
- type,
- openid
- },
- custom: {
- showLoading: false,
- loadingMsg: t$6("common.unbind"),
- successMsg: t$6("common.unbind_success")
- }
- });
- }
- };
- const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: SocialApi
- }, Symbol.toStringTag, { value: "Module" }));
- const socialType = 32;
- const load$1 = async () => {
- };
- const login$1 = () => {
- return new Promise(async (resolve, reject) => {
- const loginRes = await uni.login({
- provider: "weixin",
- onlyAuthorize: true
- });
- debugger;
- if (loginRes.errMsg == "login:ok") {
- const res = await third.wechat.login({
- platform: "openPlatform",
- shareInfo: uni.getStorageSync("shareLog") || {},
- payload: encodeURIComponent(
- JSON.stringify({
- code: loginRes.code
- })
- )
- });
- if (res.error === 0) {
- resolve(true);
- }
- } else {
- uni.showToast({
- icon: "none",
- title: loginRes.errMsg
- });
- }
- resolve(false);
- });
- };
- async function getInfo() {
- const { code: code2, data } = await SocialApi.getSocialUser(socialType);
- if (code2 !== 0) {
- return void 0;
- }
- return data;
- }
- const service$1 = {
- load: load$1,
- login: login$1,
- getInfo
- };
- const wechat = service$1;
- const login = () => {
- return new Promise(async (resolve, reject) => {
- await uni.login({
- provider: "apple",
- success: () => {
- uni.getUserInfo({
- provider: "apple",
- success: async (res) => {
- if (res.errMsg === "getUserInfo:ok") {
- const payload = res.userInfo;
- const { error: error2 } = await third.apple.login({
- payload,
- shareInfo: uni.getStorageSync("shareLog") || {}
- });
- if (error2 === 0) {
- resolve(true);
- } else {
- resolve(false);
- }
- }
- }
- });
- },
- fail: (err) => {
- resolve(false);
- }
- });
- });
- };
- const service = {
- login
- };
- let apple = {};
- if (typeof service !== "undefined") {
- apple = service;
- }
- const apple$1 = apple;
- function email$1(value) {
- return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
- }
- function mobile$1(value) {
- return /^1[3456789]\d{9}$/.test(value);
- }
- function url(value) {
- return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/.test(
- value
- );
- }
- function date(value) {
- if (!value)
- return false;
- if (number(value))
- value = +value;
- return !/Invalid|NaN/.test(new Date(value).toString());
- }
- function dateISO(value) {
- return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
- }
- function number(value) {
- return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value);
- }
- function digits(value) {
- return /^\d+$/.test(value);
- }
- function idCard(value) {
- return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value);
- }
- function carNo(value) {
- const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
- const creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
- if (value.length === 7) {
- return creg.test(value);
- }
- if (value.length === 8) {
- return xreg.test(value);
- }
- return false;
- }
- function amount(value) {
- return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
- }
- function chinese(value) {
- const reg = /^[\u4e00-\u9fa5]+$/gi;
- return reg.test(value);
- }
- function letter(value) {
- return /^[a-zA-Z]*$/.test(value);
- }
- function enOrNum(value) {
- const reg = /^[0-9a-zA-Z]*$/g;
- return reg.test(value);
- }
- function contains(value, param) {
- return value.indexOf(param) >= 0;
- }
- function range$1(value, param) {
- return value >= param[0] && value <= param[1];
- }
- function rangeLength(value, param) {
- return value.length >= param[0] && value.length <= param[1];
- }
- function landline(value) {
- const reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
- return reg.test(value);
- }
- function empty(value) {
- switch (typeof value) {
- case "undefined":
- return true;
- case "string":
- if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, "").length == 0)
- return true;
- break;
- case "boolean":
- if (!value)
- return true;
- break;
- case "number":
- if (value === 0 || isNaN(value))
- return true;
- break;
- case "object":
- if (value === null || value.length === 0)
- return true;
- for (const i2 in value) {
- return false;
- }
- return true;
- }
- return false;
- }
- function jsonString(value) {
- if (typeof value === "string") {
- try {
- const obj = JSON.parse(value);
- if (typeof obj === "object" && obj) {
- return true;
- }
- return false;
- } catch (e2) {
- return false;
- }
- }
- return false;
- }
- function array(value) {
- if (typeof Array.isArray === "function") {
- return Array.isArray(value);
- }
- return Object.prototype.toString.call(value) === "[object Array]";
- }
- function object(value) {
- return Object.prototype.toString.call(value) === "[object Object]";
- }
- function code$1(value, len = 6) {
- return new RegExp(`^\\d{${len}}$`).test(value);
- }
- const test$1 = {
- email: email$1,
- mobile: mobile$1,
- url,
- date,
- dateISO,
- number,
- digits,
- idCard,
- carNo,
- amount,
- chinese,
- letter,
- enOrNum,
- contains,
- range: range$1,
- rangeLength,
- empty,
- isEmpty: empty,
- isNumber: number,
- jsonString,
- landline,
- object,
- array,
- code: code$1
- };
- function strip(num, precision = 15) {
- return +parseFloat(Number(num).toPrecision(precision));
- }
- function digitLength(num) {
- const eSplit = num.toString().split(/[eE]/);
- const len = (eSplit[0].split(".")[1] || "").length - +(eSplit[1] || 0);
- return len > 0 ? len : 0;
- }
- function float2Fixed(num) {
- if (num.toString().indexOf("e") === -1) {
- return Number(num.toString().replace(".", ""));
- }
- const dLen = digitLength(num);
- return dLen > 0 ? strip(Number(num) * Math.pow(10, dLen)) : Number(num);
- }
- function checkBoundary(num) {
- {
- if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
- formatAppLog("warn", "at sheep/helper/digit.js:45", `${num} 超出了精度限制,结果可能不正确`);
- }
- }
- }
- function iteratorOperation(arr, operation) {
- const [num1, num2, ...others] = arr;
- let res = operation(num1, num2);
- others.forEach((num) => {
- res = operation(res, num);
- });
- return res;
- }
- function times(...nums) {
- if (nums.length > 2) {
- return iteratorOperation(nums, times);
- }
- const [num1, num2] = nums;
- const num1Changed = float2Fixed(num1);
- const num2Changed = float2Fixed(num2);
- const baseNum = digitLength(num1) + digitLength(num2);
- const leftValue = num1Changed * num2Changed;
- checkBoundary(leftValue);
- return leftValue / Math.pow(10, baseNum);
- }
- function divide(...nums) {
- if (nums.length > 2) {
- return iteratorOperation(nums, divide);
- }
- const [num1, num2] = nums;
- const num1Changed = float2Fixed(num1);
- const num2Changed = float2Fixed(num2);
- checkBoundary(num1Changed);
- checkBoundary(num2Changed);
- return times(
- num1Changed / num2Changed,
- strip(Math.pow(10, digitLength(num2) - digitLength(num1)))
- );
- }
- function round(num, ratio) {
- const base = Math.pow(10, ratio);
- let result2 = divide(Math.round(Math.abs(times(num, base))), base);
- if (num < 0 && result2 !== 0) {
- result2 = times(result2, -1);
- }
- return result2;
- }
- var weixinJsSdk = { exports: {} };
- !function(e2, n2) {
- weixinJsSdk.exports = n2(e2);
- }(typeof window === "object" && window, function(r2, e2) {
- if (!r2) {
- formatAppLog("warn", "at node_modules/weixin-js-sdk/index.js:5", "can't use weixin-js-sdk in server side");
- return;
- }
- var a2, c2, n2, i2, t2, o2, s2, d2, l2, u2, p2, f2, m2, g2, h2, S2, y2, I2, v2, _2, w2, T2;
- if (!r2.jWeixin)
- return a2 = {
- config: "preVerifyJSAPI",
- onMenuShareTimeline: "menu:share:timeline",
- onMenuShareAppMessage: "menu:share:appmessage",
- onMenuShareQQ: "menu:share:qq",
- onMenuShareWeibo: "menu:share:weiboApp",
- onMenuShareQZone: "menu:share:QZone",
- previewImage: "imagePreview",
- getLocation: "geoLocation",
- openProductSpecificView: "openProductViewWithPid",
- addCard: "batchAddCard",
- openCard: "batchViewCard",
- chooseWXPay: "getBrandWCPayRequest",
- openEnterpriseRedPacket: "getRecevieBizHongBaoRequest",
- startSearchBeacons: "startMonitoringBeacons",
- stopSearchBeacons: "stopMonitoringBeacons",
- onSearchBeacons: "onBeaconsInRange",
- consumeAndShareCard: "consumedShareCard",
- openAddress: "editAddress"
- }, c2 = function() {
- var e3, n3 = {};
- for (e3 in a2)
- n3[a2[e3]] = e3;
- return n3;
- }(), n2 = r2.document, i2 = n2.title, t2 = navigator.userAgent.toLowerCase(), f2 = navigator.platform.toLowerCase(), o2 = !(!f2.match("mac") && !f2.match("win")), s2 = -1 != t2.indexOf("wxdebugger"), d2 = -1 != t2.indexOf("micromessenger"), l2 = -1 != t2.indexOf("android"), u2 = -1 != t2.indexOf("iphone") || -1 != t2.indexOf("ipad"), p2 = (f2 = t2.match(/micromessenger\/(\d+\.\d+\.\d+)/) || t2.match(/micromessenger\/(\d+\.\d+)/)) ? f2[1] : "", m2 = {
- initStartTime: L2(),
- initEndTime: 0,
- preVerifyStartTime: 0,
- preVerifyEndTime: 0
- }, g2 = {
- version: 1,
- appId: "",
- initTime: 0,
- preVerifyTime: 0,
- networkType: "",
- isPreVerifyOk: 1,
- systemType: u2 ? 1 : l2 ? 2 : -1,
- clientVersion: p2,
- url: encodeURIComponent(location.href)
- }, h2 = {}, S2 = { _completes: [] }, y2 = { state: 0, data: {} }, O2(function() {
- m2.initEndTime = L2();
- }), I2 = false, v2 = [], _2 = {
- config: function(e3) {
- C2("config", h2 = e3);
- var o3 = false !== h2.check;
- O2(function() {
- if (o3)
- k(
- a2.config,
- {
- verifyJsApiList: A2(h2.jsApiList),
- verifyOpenTagList: A2(h2.openTagList)
- },
- (S2._complete = function(e5) {
- m2.preVerifyEndTime = L2(), y2.state = 1, y2.data = e5;
- }, S2.success = function(e5) {
- g2.isPreVerifyOk = 0;
- }, S2.fail = function(e5) {
- S2._fail ? S2._fail(e5) : y2.state = -1;
- }, (t3 = S2._completes).push(function() {
- B2();
- }), S2.complete = function(e5) {
- for (var n4 = 0, i4 = t3.length; n4 < i4; ++n4)
- t3[n4]();
- S2._completes = [];
- }, S2)
- ), m2.preVerifyStartTime = L2();
- else {
- y2.state = 1;
- for (var e4 = S2._completes, n3 = 0, i3 = e4.length; n3 < i3; ++n3)
- e4[n3]();
- S2._completes = [];
- }
- var t3;
- }), _2.invoke || (_2.invoke = function(e4, n3, i3) {
- r2.WeixinJSBridge && WeixinJSBridge.invoke(e4, P2(n3), i3);
- }, _2.on = function(e4, n3) {
- r2.WeixinJSBridge && WeixinJSBridge.on(e4, n3);
- });
- },
- ready: function(e3) {
- (0 != y2.state || (S2._completes.push(e3), !d2 && h2.debug)) && e3();
- },
- error: function(e3) {
- p2 < "6.0.2" || (-1 == y2.state ? e3(y2.data) : S2._fail = e3);
- },
- checkJsApi: function(e3) {
- k(
- "checkJsApi",
- { jsApiList: A2(e3.jsApiList) },
- (e3._complete = function(e4) {
- l2 && (i3 = e4.checkResult) && (e4.checkResult = JSON.parse(i3));
- var n3, i3 = e4, t3 = i3.checkResult;
- for (n3 in t3) {
- var o3 = c2[n3];
- o3 && (t3[o3] = t3[n3], delete t3[n3]);
- }
- }, e3)
- );
- },
- onMenuShareTimeline: function(e3) {
- M2(
- a2.onMenuShareTimeline,
- {
- complete: function() {
- k(
- "shareTimeline",
- {
- title: e3.title || i2,
- desc: e3.title || i2,
- img_url: e3.imgUrl || "",
- link: e3.link || location.href,
- type: e3.type || "link",
- data_url: e3.dataUrl || ""
- },
- e3
- );
- }
- },
- e3
- );
- },
- onMenuShareAppMessage: function(n3) {
- M2(
- a2.onMenuShareAppMessage,
- {
- complete: function(e3) {
- "favorite" === e3.scene ? k("sendAppMessage", {
- title: n3.title || i2,
- desc: n3.desc || "",
- link: n3.link || location.href,
- img_url: n3.imgUrl || "",
- type: n3.type || "link",
- data_url: n3.dataUrl || ""
- }) : k(
- "sendAppMessage",
- {
- title: n3.title || i2,
- desc: n3.desc || "",
- link: n3.link || location.href,
- img_url: n3.imgUrl || "",
- type: n3.type || "link",
- data_url: n3.dataUrl || ""
- },
- n3
- );
- }
- },
- n3
- );
- },
- onMenuShareQQ: function(e3) {
- M2(
- a2.onMenuShareQQ,
- {
- complete: function() {
- k(
- "shareQQ",
- {
- title: e3.title || i2,
- desc: e3.desc || "",
- img_url: e3.imgUrl || "",
- link: e3.link || location.href
- },
- e3
- );
- }
- },
- e3
- );
- },
- onMenuShareWeibo: function(e3) {
- M2(
- a2.onMenuShareWeibo,
- {
- complete: function() {
- k(
- "shareWeiboApp",
- {
- title: e3.title || i2,
- desc: e3.desc || "",
- img_url: e3.imgUrl || "",
- link: e3.link || location.href
- },
- e3
- );
- }
- },
- e3
- );
- },
- onMenuShareQZone: function(e3) {
- M2(
- a2.onMenuShareQZone,
- {
- complete: function() {
- k(
- "shareQZone",
- {
- title: e3.title || i2,
- desc: e3.desc || "",
- img_url: e3.imgUrl || "",
- link: e3.link || location.href
- },
- e3
- );
- }
- },
- e3
- );
- },
- updateTimelineShareData: function(e3) {
- k(
- "updateTimelineShareData",
- { title: e3.title, link: e3.link, imgUrl: e3.imgUrl },
- e3
- );
- },
- updateAppMessageShareData: function(e3) {
- k(
- "updateAppMessageShareData",
- { title: e3.title, desc: e3.desc, link: e3.link, imgUrl: e3.imgUrl },
- e3
- );
- },
- startRecord: function(e3) {
- k("startRecord", {}, e3);
- },
- stopRecord: function(e3) {
- k("stopRecord", {}, e3);
- },
- onVoiceRecordEnd: function(e3) {
- M2("onVoiceRecordEnd", e3);
- },
- playVoice: function(e3) {
- k("playVoice", { localId: e3.localId }, e3);
- },
- pauseVoice: function(e3) {
- k("pauseVoice", { localId: e3.localId }, e3);
- },
- stopVoice: function(e3) {
- k("stopVoice", { localId: e3.localId }, e3);
- },
- onVoicePlayEnd: function(e3) {
- M2("onVoicePlayEnd", e3);
- },
- uploadVoice: function(e3) {
- k(
- "uploadVoice",
- {
- localId: e3.localId,
- isShowProgressTips: 0 == e3.isShowProgressTips ? 0 : 1
- },
- e3
- );
- },
- downloadVoice: function(e3) {
- k(
- "downloadVoice",
- {
- serverId: e3.serverId,
- isShowProgressTips: 0 == e3.isShowProgressTips ? 0 : 1
- },
- e3
- );
- },
- translateVoice: function(e3) {
- k(
- "translateVoice",
- {
- localId: e3.localId,
- isShowProgressTips: 0 == e3.isShowProgressTips ? 0 : 1
- },
- e3
- );
- },
- chooseImage: function(e3) {
- k(
- "chooseImage",
- {
- scene: "1|2",
- count: e3.count || 9,
- sizeType: e3.sizeType || ["original", "compressed"],
- sourceType: e3.sourceType || ["album", "camera"]
- },
- (e3._complete = function(e4) {
- if (l2) {
- var n3 = e4.localIds;
- try {
- n3 && (e4.localIds = JSON.parse(n3));
- } catch (e5) {
- }
- }
- }, e3)
- );
- },
- getLocation: function(e3) {
- e3 = e3 || {}, k(
- a2.getLocation,
- { type: e3.type || "wgs84" },
- (e3._complete = function(e4) {
- delete e4.type;
- }, e3)
- );
- },
- previewImage: function(e3) {
- k(a2.previewImage, { current: e3.current, urls: e3.urls }, e3);
- },
- uploadImage: function(e3) {
- k(
- "uploadImage",
- {
- localId: e3.localId,
- isShowProgressTips: 0 == e3.isShowProgressTips ? 0 : 1
- },
- e3
- );
- },
- downloadImage: function(e3) {
- k(
- "downloadImage",
- {
- serverId: e3.serverId,
- isShowProgressTips: 0 == e3.isShowProgressTips ? 0 : 1
- },
- e3
- );
- },
- getLocalImgData: function(e3) {
- false === I2 ? (I2 = true, k(
- "getLocalImgData",
- { localId: e3.localId },
- (e3._complete = function(e4) {
- var n3;
- I2 = false, 0 < v2.length && (n3 = v2.shift(), wx.getLocalImgData(n3));
- }, e3)
- )) : v2.push(e3);
- },
- getNetworkType: function(e3) {
- k(
- "getNetworkType",
- {},
- (e3._complete = function(e4) {
- var n3 = e4, e4 = n3.errMsg, i3 = (n3.errMsg = "getNetworkType:ok", n3.subtype);
- if (delete n3.subtype, i3)
- n3.networkType = i3;
- else {
- var i3 = e4.indexOf(":"), t3 = e4.substring(i3 + 1);
- switch (t3) {
- case "wifi":
- case "edge":
- case "wwan":
- n3.networkType = t3;
- break;
- default:
- n3.errMsg = "getNetworkType:fail";
- }
- }
- }, e3)
- );
- },
- openLocation: function(e3) {
- k(
- "openLocation",
- {
- latitude: e3.latitude,
- longitude: e3.longitude,
- name: e3.name || "",
- address: e3.address || "",
- scale: e3.scale || 28,
- infoUrl: e3.infoUrl || ""
- },
- e3
- );
- },
- hideOptionMenu: function(e3) {
- k("hideOptionMenu", {}, e3);
- },
- showOptionMenu: function(e3) {
- k("showOptionMenu", {}, e3);
- },
- closeWindow: function(e3) {
- k("closeWindow", {}, e3 = e3 || {});
- },
- hideMenuItems: function(e3) {
- k("hideMenuItems", { menuList: e3.menuList }, e3);
- },
- showMenuItems: function(e3) {
- k("showMenuItems", { menuList: e3.menuList }, e3);
- },
- hideAllNonBaseMenuItem: function(e3) {
- k("hideAllNonBaseMenuItem", {}, e3);
- },
- showAllNonBaseMenuItem: function(e3) {
- k("showAllNonBaseMenuItem", {}, e3);
- },
- scanQRCode: function(e3) {
- k(
- "scanQRCode",
- {
- needResult: (e3 = e3 || {}).needResult || 0,
- scanType: e3.scanType || ["qrCode", "barCode"]
- },
- (e3._complete = function(e4) {
- var n3;
- u2 && (n3 = e4.resultStr) && (n3 = JSON.parse(n3), e4.resultStr = n3 && n3.scan_code && n3.scan_code.scan_result);
- }, e3)
- );
- },
- openAddress: function(e3) {
- k(
- a2.openAddress,
- {},
- (e3._complete = function(e4) {
- (e4 = e4).postalCode = e4.addressPostalCode, delete e4.addressPostalCode, e4.provinceName = e4.proviceFirstStageName, delete e4.proviceFirstStageName, e4.cityName = e4.addressCitySecondStageName, delete e4.addressCitySecondStageName, e4.countryName = e4.addressCountiesThirdStageName, delete e4.addressCountiesThirdStageName, e4.detailInfo = e4.addressDetailInfo, delete e4.addressDetailInfo;
- }, e3)
- );
- },
- openProductSpecificView: function(e3) {
- k(
- a2.openProductSpecificView,
- {
- pid: e3.productId,
- view_type: e3.viewType || 0,
- ext_info: e3.extInfo
- },
- e3
- );
- },
- addCard: function(e3) {
- for (var n3 = e3.cardList, i3 = [], t3 = 0, o3 = n3.length; t3 < o3; ++t3) {
- var r3 = n3[t3], r3 = { card_id: r3.cardId, card_ext: r3.cardExt };
- i3.push(r3);
- }
- k(
- a2.addCard,
- { card_list: i3 },
- (e3._complete = function(e4) {
- if (n4 = e4.card_list) {
- for (var n4, i4 = 0, t4 = (n4 = JSON.parse(n4)).length; i4 < t4; ++i4) {
- var o4 = n4[i4];
- o4.cardId = o4.card_id, o4.cardExt = o4.card_ext, o4.isSuccess = !!o4.is_succ, delete o4.card_id, delete o4.card_ext, delete o4.is_succ;
- }
- e4.cardList = n4, delete e4.card_list;
- }
- }, e3)
- );
- },
- chooseCard: function(e3) {
- k(
- "chooseCard",
- {
- app_id: h2.appId,
- location_id: e3.shopId || "",
- sign_type: e3.signType || "SHA1",
- card_id: e3.cardId || "",
- card_type: e3.cardType || "",
- card_sign: e3.cardSign,
- time_stamp: e3.timestamp + "",
- nonce_str: e3.nonceStr
- },
- (e3._complete = function(e4) {
- e4.cardList = e4.choose_card_info, delete e4.choose_card_info;
- }, e3)
- );
- },
- openCard: function(e3) {
- for (var n3 = e3.cardList, i3 = [], t3 = 0, o3 = n3.length; t3 < o3; ++t3) {
- var r3 = n3[t3], r3 = { card_id: r3.cardId, code: r3.code };
- i3.push(r3);
- }
- k(a2.openCard, { card_list: i3 }, e3);
- },
- consumeAndShareCard: function(e3) {
- k(
- a2.consumeAndShareCard,
- { consumedCardId: e3.cardId, consumedCode: e3.code },
- e3
- );
- },
- chooseWXPay: function(e3) {
- k(a2.chooseWXPay, x(e3), e3), B2({ jsApiName: "chooseWXPay" });
- },
- openEnterpriseRedPacket: function(e3) {
- k(a2.openEnterpriseRedPacket, x(e3), e3);
- },
- startSearchBeacons: function(e3) {
- k(a2.startSearchBeacons, { ticket: e3.ticket }, e3);
- },
- stopSearchBeacons: function(e3) {
- k(a2.stopSearchBeacons, {}, e3);
- },
- onSearchBeacons: function(e3) {
- M2(a2.onSearchBeacons, e3);
- },
- openEnterpriseChat: function(e3) {
- k(
- "openEnterpriseChat",
- { useridlist: e3.userIds, chatname: e3.groupName },
- e3
- );
- },
- launchMiniProgram: function(e3) {
- k(
- "launchMiniProgram",
- {
- targetAppId: e3.targetAppId,
- path: function(e4) {
- var n3;
- if ("string" == typeof e4 && 0 < e4.length)
- return n3 = e4.split("?")[0], n3 += ".html", void 0 !== (e4 = e4.split("?")[1]) ? n3 + "?" + e4 : n3;
- }(e3.path),
- envVersion: e3.envVersion
- },
- e3
- );
- },
- openBusinessView: function(e3) {
- k(
- "openBusinessView",
- {
- businessType: e3.businessType,
- queryString: e3.queryString || "",
- envVersion: e3.envVersion
- },
- (e3._complete = function(n3) {
- if (l2) {
- var e4 = n3.extraData;
- if (e4)
- try {
- n3.extraData = JSON.parse(e4);
- } catch (e5) {
- n3.extraData = {};
- }
- }
- }, e3)
- );
- },
- miniProgram: {
- navigateBack: function(e3) {
- e3 = e3 || {}, O2(function() {
- k(
- "invokeMiniProgramAPI",
- { name: "navigateBack", arg: { delta: e3.delta || 1 } },
- e3
- );
- });
- },
- navigateTo: function(e3) {
- O2(function() {
- k(
- "invokeMiniProgramAPI",
- { name: "navigateTo", arg: { url: e3.url } },
- e3
- );
- });
- },
- redirectTo: function(e3) {
- O2(function() {
- k(
- "invokeMiniProgramAPI",
- { name: "redirectTo", arg: { url: e3.url } },
- e3
- );
- });
- },
- switchTab: function(e3) {
- O2(function() {
- k(
- "invokeMiniProgramAPI",
- { name: "switchTab", arg: { url: e3.url } },
- e3
- );
- });
- },
- reLaunch: function(e3) {
- O2(function() {
- k(
- "invokeMiniProgramAPI",
- { name: "reLaunch", arg: { url: e3.url } },
- e3
- );
- });
- },
- postMessage: function(e3) {
- O2(function() {
- k(
- "invokeMiniProgramAPI",
- { name: "postMessage", arg: e3.data || {} },
- e3
- );
- });
- },
- getEnv: function(e3) {
- O2(function() {
- e3({ miniprogram: "miniprogram" === r2.__wxjs_environment });
- });
- }
- }
- }, w2 = 1, T2 = {}, n2.addEventListener(
- "error",
- function(e3) {
- var n3, i3, t3;
- l2 || (t3 = (n3 = e3.target).tagName, i3 = n3.src, "IMG" != t3 && "VIDEO" != t3 && "AUDIO" != t3 && "SOURCE" != t3) || -1 != i3.indexOf("wxlocalresource://") && (e3.preventDefault(), e3.stopPropagation(), (t3 = n3["wx-id"]) || (t3 = w2++, n3["wx-id"] = t3), T2[t3] || (T2[t3] = true, wx.ready(function() {
- wx.getLocalImgData({
- localId: i3,
- success: function(e4) {
- n3.src = e4.localData;
- }
- });
- })));
- },
- true
- ), n2.addEventListener(
- "load",
- function(e3) {
- var n3;
- l2 || (n3 = (e3 = e3.target).tagName, e3.src, "IMG" != n3 && "VIDEO" != n3 && "AUDIO" != n3 && "SOURCE" != n3) || (n3 = e3["wx-id"]) && (T2[n3] = false);
- },
- true
- ), e2 && (r2.wx = r2.jWeixin = _2), _2;
- else
- return r2.jWeixin;
- function k(n3, e3, i3) {
- r2.WeixinJSBridge ? WeixinJSBridge.invoke(n3, P2(e3), function(e4) {
- V2(n3, e4, i3);
- }) : C2(n3, i3);
- }
- function M2(n3, i3, t3) {
- r2.WeixinJSBridge ? WeixinJSBridge.on(n3, function(e3) {
- t3 && t3.trigger && t3.trigger(e3), V2(n3, e3, i3);
- }) : C2(n3, t3 || i3);
- }
- function P2(e3) {
- return (e3 = e3 || {}).appId = h2.appId, e3.verifyAppId = h2.appId, e3.verifySignType = "sha1", e3.verifyTimestamp = h2.timestamp + "", e3.verifyNonceStr = h2.nonceStr, e3.verifySignature = h2.signature, e3;
- }
- function x(e3) {
- return {
- timeStamp: e3.timestamp + "",
- nonceStr: e3.nonceStr,
- package: e3.package,
- paySign: e3.paySign,
- signType: e3.signType || "SHA1"
- };
- }
- function V2(e3, n3, i3) {
- "openEnterpriseChat" != e3 && "openBusinessView" !== e3 || (n3.errCode = n3.err_code), delete n3.err_code, delete n3.err_desc, delete n3.err_detail;
- var t3 = n3.errMsg, e3 = (t3 || (t3 = n3.err_msg, delete n3.err_msg, t3 = function(e4, n4) {
- var i4 = c2[e4];
- i4 && (e4 = i4);
- i4 = "ok";
- {
- var t4;
- n4 && (t4 = n4.indexOf(":"), "access denied" != (i4 = (i4 = (i4 = -1 != (i4 = -1 != (i4 = "failed" == (i4 = "confirm" == (i4 = n4.substring(t4 + 1)) ? "ok" : i4) ? "fail" : i4).indexOf("failed_") ? i4.substring(7) : i4).indexOf("fail_") ? i4.substring(5) : i4).replace(/_/g, " ")).toLowerCase()) && "no permission to execute" != i4 || (i4 = "permission denied"), "" == (i4 = "config" == e4 && "function not exist" == i4 ? "ok" : i4)) && (i4 = "fail");
- }
- return n4 = e4 + ":" + i4;
- }(e3, t3), n3.errMsg = t3), (i3 = i3 || {})._complete && (i3._complete(n3), delete i3._complete), t3 = n3.errMsg || "", h2.debug && !i3.isInnerInvoke && alert(JSON.stringify(n3)), t3.indexOf(":"));
- switch (t3.substring(e3 + 1)) {
- case "ok":
- i3.success && i3.success(n3);
- break;
- case "cancel":
- i3.cancel && i3.cancel(n3);
- break;
- default:
- i3.fail && i3.fail(n3);
- }
- i3.complete && i3.complete(n3);
- }
- function A2(e3) {
- if (e3) {
- for (var n3 = 0, i3 = e3.length; n3 < i3; ++n3) {
- var t3 = e3[n3], t3 = a2[t3];
- t3 && (e3[n3] = t3);
- }
- return e3;
- }
- }
- function C2(e3, n3) {
- var i3;
- !h2.debug || n3 && n3.isInnerInvoke || ((i3 = c2[e3]) && (e3 = i3), n3 && n3._complete && delete n3._complete, formatAppLog("log", "at node_modules/weixin-js-sdk/index.js:839", '"' + e3 + '",', n3 || ""));
- }
- function B2(n3) {
- var i3;
- o2 || s2 || h2.debug || p2 < "6.0.2" || g2.systemType < 0 || (i3 = new Image(), g2.appId = h2.appId, g2.initTime = m2.initEndTime - m2.initStartTime, g2.preVerifyTime = m2.preVerifyEndTime - m2.preVerifyStartTime, _2.getNetworkType({
- isInnerInvoke: true,
- success: function(e3) {
- g2.networkType = e3.networkType;
- e3 = "https://open.weixin.qq.com/sdk/report?v=" + g2.version + "&o=" + g2.isPreVerifyOk + "&s=" + g2.systemType + "&c=" + g2.clientVersion + "&a=" + g2.appId + "&n=" + g2.networkType + "&i=" + g2.initTime + "&p=" + g2.preVerifyTime + "&u=" + g2.url + "&jsapi_name=" + (n3 ? n3.jsApiName : "");
- i3.src = e3;
- }
- }));
- }
- function L2() {
- return (/* @__PURE__ */ new Date()).getTime();
- }
- function O2(e3) {
- d2 && (r2.WeixinJSBridge ? e3() : n2.addEventListener && n2.addEventListener("WeixinJSBridgeReady", e3, false));
- }
- });
- var weixinJsSdkExports = weixinJsSdk.exports;
- const wx$1 = /* @__PURE__ */ getDefaultExportFromCjs(weixinJsSdkExports);
- function range(min = 0, max = 0, value = 0) {
- return Math.max(min, Math.min(max, Number(value)));
- }
- function getPx(value, unit = false) {
- if (test$1.number(value)) {
- return unit ? `${value}px` : Number(value);
- }
- if (/(rpx|upx)$/.test(value)) {
- return unit ? `${uni.upx2px(parseInt(value))}px` : Number(uni.upx2px(parseInt(value)));
- }
- return unit ? `${parseInt(value)}px` : parseInt(value);
- }
- function sleep(value = 30) {
- return new Promise((resolve) => {
- setTimeout(() => {
- resolve();
- }, value);
- });
- }
- function os$2() {
- return uni.getSystemInfoSync().platform.toLowerCase();
- }
- function sys$1() {
- return uni.getSystemInfoSync();
- }
- function random(min, max) {
- if (min >= 0 && max > 0 && max >= min) {
- const gab = max - min + 1;
- return Math.floor(Math.random() * gab + min);
- }
- return 0;
- }
- function guid(len = 32, firstU = true, radix = null) {
- const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
- const uuid = [];
- radix = radix || chars.length;
- if (len) {
- for (let i2 = 0; i2 < len; i2++)
- uuid[i2] = chars[0 | Math.random() * radix];
- } else {
- let r2;
- uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
- uuid[14] = "4";
- for (let i2 = 0; i2 < 36; i2++) {
- if (!uuid[i2]) {
- r2 = 0 | Math.random() * 16;
- uuid[i2] = chars[i2 == 19 ? r2 & 3 | 8 : r2];
- }
- }
- }
- if (firstU) {
- uuid.shift();
- return `u${uuid.join("")}`;
- }
- return uuid.join("");
- }
- function $parent(name2 = void 0) {
- let parent2 = this.$parent;
- while (parent2) {
- if (parent2.$options && parent2.$options.name !== name2) {
- parent2 = parent2.$parent;
- } else {
- return parent2;
- }
- }
- return false;
- }
- function addStyle(customStyle, target = "object") {
- if (test$1.empty(customStyle) || typeof customStyle === "object" && target === "object" || target === "string" && typeof customStyle === "string") {
- return customStyle;
- }
- if (target === "object") {
- customStyle = trim$1(customStyle);
- const styleArray = customStyle.split(";");
- const style = {};
- for (let i2 = 0; i2 < styleArray.length; i2++) {
- if (styleArray[i2]) {
- const item = styleArray[i2].split(":");
- style[trim$1(item[0])] = trim$1(item[1]);
- }
- }
- return style;
- }
- let string = "";
- for (const i2 in customStyle) {
- const key = i2.replace(/([A-Z])/g, "-$1").toLowerCase();
- string += `${key}:${customStyle[i2]};`;
- }
- return trim$1(string);
- }
- function addUnit(value = "auto", unit = "px") {
- value = String(value);
- return test$1.number(value) ? `${value}${unit}` : value;
- }
- function deepClone(obj) {
- if ([null, void 0, NaN, false].includes(obj))
- return obj;
- if (typeof obj !== "object" && typeof obj !== "function") {
- return obj;
- }
- const o2 = test$1.array(obj) ? [] : {};
- for (const i2 in obj) {
- if (obj.hasOwnProperty(i2)) {
- o2[i2] = typeof obj[i2] === "object" ? deepClone(obj[i2]) : obj[i2];
- }
- }
- return o2;
- }
- function deepMerge(target = {}, source = {}) {
- target = deepClone(target);
- if (typeof target !== "object" || typeof source !== "object")
- return false;
- for (const prop in source) {
- if (!source.hasOwnProperty(prop))
- continue;
- if (prop in target) {
- if (typeof target[prop] !== "object") {
- target[prop] = source[prop];
- } else if (typeof source[prop] !== "object") {
- target[prop] = source[prop];
- } else if (target[prop].concat && source[prop].concat) {
- target[prop] = target[prop].concat(source[prop]);
- } else {
- target[prop] = deepMerge(target[prop], source[prop]);
- }
- } else {
- target[prop] = source[prop];
- }
- }
- return target;
- }
- function error$1(err) {
- {
- formatAppLog("error", "at sheep/helper/index.js:241", `SheepJS:${err}`);
- }
- }
- function randomArray(array2 = []) {
- return array2.sort(() => Math.random() - 0.5);
- }
- if (!String.prototype.padStart) {
- String.prototype.padStart = function(maxLength, fillString = " ") {
- if (Object.prototype.toString.call(fillString) !== "[object String]") {
- throw new TypeError("fillString must be String");
- }
- const str = this;
- if (str.length >= maxLength)
- return String(str);
- const fillLength = maxLength - str.length;
- let times2 = Math.ceil(fillLength / fillString.length);
- while (times2 >>= 1) {
- fillString += fillString;
- if (times2 === 1) {
- fillString += fillString;
- }
- }
- return fillString.slice(0, fillLength) + str;
- };
- }
- function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd") {
- let date2;
- if (!dateTime) {
- date2 = /* @__PURE__ */ new Date();
- } else if (/^\d{10}$/.test(dateTime == null ? void 0 : dateTime.toString().trim())) {
- date2 = new Date(dateTime * 1e3);
- } else if (typeof dateTime === "string" && /^\d+$/.test(dateTime.trim())) {
- date2 = new Date(Number(dateTime));
- } else {
- date2 = new Date(typeof dateTime === "string" ? dateTime.replace(/-/g, "/") : dateTime);
- }
- const timeSource = {
- y: date2.getFullYear().toString(),
- // 年
- m: (date2.getMonth() + 1).toString().padStart(2, "0"),
- // 月
- d: date2.getDate().toString().padStart(2, "0"),
- // 日
- h: date2.getHours().toString().padStart(2, "0"),
- // 时
- M: date2.getMinutes().toString().padStart(2, "0"),
- // 分
- s: date2.getSeconds().toString().padStart(2, "0")
- // 秒
- // 有其他格式化字符需求可以继续添加,必须转化成字符串
- };
- for (const key in timeSource) {
- const [ret] = new RegExp(`${key}+`).exec(formatStr) || [];
- if (ret) {
- const beginIndex = key === "y" && ret.length === 2 ? 2 : 0;
- formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex));
- }
- }
- return formatStr;
- }
- function timeFrom(timestamp = null, format2 = "yyyy-mm-dd") {
- if (timestamp == null)
- timestamp = Number(/* @__PURE__ */ new Date());
- timestamp = parseInt(timestamp);
- if (timestamp.toString().length == 10)
- timestamp *= 1e3;
- let timer2 = (/* @__PURE__ */ new Date()).getTime() - timestamp;
- timer2 = parseInt(timer2 / 1e3);
- let tips = "";
- switch (true) {
- case timer2 < 300:
- tips = t$6("common.just_now");
- break;
- case (timer2 >= 300 && timer2 < 3600):
- tips = t$6("common.minutes_ago", { m: parseInt(timer2 / 60) });
- break;
- case (timer2 >= 3600 && timer2 < 86400):
- tips = t$6("common.hours_ago", { h: parseInt(timer2 / 3600) });
- break;
- case (timer2 >= 86400 && timer2 < 2592e3):
- tips = t$6("common.days_ago", { d: parseInt(timer2 / 86400) });
- break;
- default:
- if (format2 === false) {
- if (timer2 >= 2592e3 && timer2 < 365 * 86400) {
- tips = t$6("common.months_ago", { m: parseInt(timer2 / (86400 * 30)) });
- } else {
- tips = t$6("common.years_ago", { y: parseInt(timer2 / (86400 * 365)) });
- }
- } else {
- tips = timeFormat(timestamp, format2);
- }
- }
- return tips;
- }
- function trim$1(str, pos = "both") {
- str = String(str);
- if (pos == "both") {
- return str.replace(/^\s+|\s+$/g, "");
- }
- if (pos == "left") {
- return str.replace(/^\s*/, "");
- }
- if (pos == "right") {
- return str.replace(/(\s*$)/g, "");
- }
- if (pos == "all") {
- return str.replace(/\s+/g, "");
- }
- return str;
- }
- function queryParams(data = {}, isPrefix = true, arrayFormat = "brackets") {
- const prefix = isPrefix ? "?" : "";
- const _result = [];
- if (["indices", "brackets", "repeat", "comma"].indexOf(arrayFormat) == -1)
- arrayFormat = "brackets";
- for (const key in data) {
- const value = data[key];
- if (["", void 0, null].indexOf(value) >= 0) {
- continue;
- }
- if (value.constructor === Array) {
- switch (arrayFormat) {
- case "indices":
- for (let i2 = 0; i2 < value.length; i2++) {
- _result.push(`${key}[${i2}]=${value[i2]}`);
- }
- break;
- case "brackets":
- value.forEach((_value) => {
- _result.push(`${key}[]=${_value}`);
- });
- break;
- case "repeat":
- value.forEach((_value) => {
- _result.push(`${key}=${_value}`);
- });
- break;
- case "comma":
- let commaStr = "";
- value.forEach((_value) => {
- commaStr += (commaStr ? "," : "") + _value;
- });
- _result.push(`${key}=${commaStr}`);
- break;
- default:
- value.forEach((_value) => {
- _result.push(`${key}[]=${_value}`);
- });
- }
- } else {
- _result.push(`${key}=${value}`);
- }
- }
- return _result.length ? prefix + _result.join("&") : "";
- }
- function toast(title, duration2 = 2e3) {
- uni.showToast({
- title: String(title),
- icon: "none",
- duration: duration2
- });
- }
- function type2icon(type = "success", fill = false) {
- if (["primary", "info", "error", "warning", "success"].indexOf(type) == -1)
- type = "success";
- let iconName = "";
- switch (type) {
- case "primary":
- iconName = "info-circle";
- break;
- case "info":
- iconName = "info-circle";
- break;
- case "error":
- iconName = "close-circle";
- break;
- case "warning":
- iconName = "error-circle";
- break;
- case "success":
- iconName = "checkmark-circle";
- break;
- default:
- iconName = "checkmark-circle";
- }
- if (fill)
- iconName += "-fill";
- return iconName;
- }
- function priceFormat(number2, decimals = 0, decimalPoint = ".", thousandsSeparator = ",") {
- number2 = `${number2}`.replace(/[^0-9+-Ee.]/g, "");
- const n2 = !isFinite(+number2) ? 0 : +number2;
- const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
- const sep = typeof thousandsSeparator === "undefined" ? "," : thousandsSeparator;
- const dec = typeof decimalPoint === "undefined" ? "." : decimalPoint;
- let s2 = "";
- s2 = (prec ? round(n2, prec) + "" : `${Math.round(n2)}`).split(".");
- const re2 = /(-?\d+)(\d{3})/;
- while (re2.test(s2[0])) {
- s2[0] = s2[0].replace(re2, `$1${sep}$2`);
- }
- if ((s2[1] || "").length < prec) {
- s2[1] = s2[1] || "";
- s2[1] += new Array(prec - s2[1].length + 1).join("0");
- }
- return s2.join(dec);
- }
- function getDuration(value, unit = true) {
- const valueNum = parseInt(value);
- if (unit) {
- if (/s$/.test(value))
- return value;
- return value > 30 ? `${value}ms` : `${value}s`;
- }
- if (/ms$/.test(value))
- return valueNum;
- if (/s$/.test(value))
- return valueNum > 30 ? valueNum : valueNum * 1e3;
- return valueNum;
- }
- function padZero(value) {
- return `00${value}`.slice(-2);
- }
- function getProperty(obj, key) {
- if (!obj) {
- return;
- }
- if (typeof key !== "string" || key === "") {
- return "";
- }
- if (key.indexOf(".") !== -1) {
- const keys = key.split(".");
- let firstObj = obj[keys[0]] || {};
- for (let i2 = 1; i2 < keys.length; i2++) {
- if (firstObj) {
- firstObj = firstObj[keys[i2]];
- }
- }
- return firstObj;
- }
- return obj[key];
- }
- function setProperty(obj, key, value) {
- if (!obj) {
- return;
- }
- const inFn = function(_obj, keys, v2) {
- if (keys.length === 1) {
- _obj[keys[0]] = v2;
- return;
- }
- while (keys.length > 1) {
- const k = keys[0];
- if (!_obj[k] || typeof _obj[k] !== "object") {
- _obj[k] = {};
- }
- keys.shift();
- inFn(_obj[k], keys, v2);
- }
- };
- if (typeof key !== "string" || key === "")
- ;
- else if (key.indexOf(".") !== -1) {
- const keys = key.split(".");
- inFn(obj, keys, value);
- } else {
- obj[key] = value;
- }
- }
- function page() {
- var _a2;
- const pages2 = getCurrentPages();
- return `/${((_a2 = pages2[pages2.length - 1]) == null ? void 0 : _a2.route) ?? ""}`;
- }
- function pages$1() {
- const pages2 = getCurrentPages();
- return pages2;
- }
- function getRootUrl() {
- let url2 = "";
- return url2;
- }
- function copyText(text) {
- uni.setClipboardData({
- data: text,
- success: function() {
- toast(t$6("common.copy_success"));
- },
- fail: function() {
- toast(t$6("common.copy_fail"));
- }
- });
- }
- const $helper = {
- range,
- getPx,
- sleep,
- os: os$2,
- sys: sys$1,
- random,
- guid,
- $parent,
- addStyle,
- addUnit,
- deepClone,
- deepMerge,
- error: error$1,
- randomArray,
- timeFormat,
- timeFrom,
- trim: trim$1,
- queryParams,
- toast,
- type2icon,
- priceFormat,
- getDuration,
- padZero,
- getProperty,
- setProperty,
- page,
- pages: pages$1,
- test: test$1,
- getRootUrl,
- copyText
- };
- var dayjs_min = { exports: {} };
- (function(module, exports) {
- !function(t2, e2) {
- module.exports = e2();
- }(commonjsGlobal, function() {
- var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) {
- var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
- return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
- } }, m2 = function(t3, e3, n3) {
- var r3 = String(t3);
- return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3;
- }, v2 = { s: m2, z: function(t3) {
- var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
- return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0");
- }, m: function t3(e3, n3) {
- if (e3.date() < n3.date())
- return -t3(n3, e3);
- var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i3 = e3.clone().add(r3, c2), s3 = n3 - i3 < 0, u3 = e3.clone().add(r3 + (s3 ? -1 : 1), c2);
- return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
- }, a: function(t3) {
- return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
- }, p: function(t3) {
- return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
- }, u: function(t3) {
- return void 0 === t3;
- } }, g2 = "en", D2 = {};
- D2[g2] = M2;
- var p2 = "$isDayjsObject", S2 = function(t3) {
- return t3 instanceof _2 || !(!t3 || !t3[p2]);
- }, w2 = function t3(e3, n3, r3) {
- var i3;
- if (!e3)
- return g2;
- if ("string" == typeof e3) {
- var s3 = e3.toLowerCase();
- D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
- var u3 = e3.split("-");
- if (!i3 && u3.length > 1)
- return t3(u3[0]);
- } else {
- var a3 = e3.name;
- D2[a3] = e3, i3 = a3;
- }
- return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
- }, O2 = function(t3, e3) {
- if (S2(t3))
- return t3.clone();
- var n3 = "object" == typeof e3 ? e3 : {};
- return n3.date = t3, n3.args = arguments, new _2(n3);
- }, b2 = v2;
- b2.l = w2, b2.i = S2, b2.w = function(t3, e3) {
- return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
- };
- var _2 = function() {
- function M3(t3) {
- this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
- }
- var m3 = M3.prototype;
- return m3.parse = function(t3) {
- this.$d = function(t4) {
- var e3 = t4.date, n3 = t4.utc;
- if (null === e3)
- return /* @__PURE__ */ new Date(NaN);
- if (b2.u(e3))
- return /* @__PURE__ */ new Date();
- if (e3 instanceof Date)
- return new Date(e3);
- if ("string" == typeof e3 && !/Z$/i.test(e3)) {
- var r3 = e3.match($2);
- if (r3) {
- var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
- return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
- }
- }
- return new Date(e3);
- }(t3), this.init();
- }, m3.init = function() {
- var t3 = this.$d;
- this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
- }, m3.$utils = function() {
- return b2;
- }, m3.isValid = function() {
- return !(this.$d.toString() === l2);
- }, m3.isSame = function(t3, e3) {
- var n3 = O2(t3);
- return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
- }, m3.isAfter = function(t3, e3) {
- return O2(t3) < this.startOf(e3);
- }, m3.isBefore = function(t3, e3) {
- return this.endOf(e3) < O2(t3);
- }, m3.$g = function(t3, e3, n3) {
- return b2.u(t3) ? this[e3] : this.set(n3, t3);
- }, m3.unix = function() {
- return Math.floor(this.valueOf() / 1e3);
- }, m3.valueOf = function() {
- return this.$d.getTime();
- }, m3.startOf = function(t3, e3) {
- var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) {
- var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
- return r3 ? i3 : i3.endOf(a2);
- }, $3 = function(t4, e4) {
- return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3);
- }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
- switch (f3) {
- case h2:
- return r3 ? l3(1, 0) : l3(31, 11);
- case c2:
- return r3 ? l3(1, M4) : l3(0, M4 + 1);
- case o2:
- var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
- return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
- case a2:
- case d2:
- return $3(v3 + "Hours", 0);
- case u2:
- return $3(v3 + "Minutes", 1);
- case s2:
- return $3(v3 + "Seconds", 2);
- case i2:
- return $3(v3 + "Milliseconds", 3);
- default:
- return this.clone();
- }
- }, m3.endOf = function(t3) {
- return this.startOf(t3, false);
- }, m3.$set = function(t3, e3) {
- var n3, o3 = b2.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $3 = o3 === a2 ? this.$D + (e3 - this.$W) : e3;
- if (o3 === c2 || o3 === h2) {
- var y3 = this.clone().set(d2, 1);
- y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
- } else
- l3 && this.$d[l3]($3);
- return this.init(), this;
- }, m3.set = function(t3, e3) {
- return this.clone().$set(t3, e3);
- }, m3.get = function(t3) {
- return this[b2.p(t3)]();
- }, m3.add = function(r3, f3) {
- var d3, l3 = this;
- r3 = Number(r3);
- var $3 = b2.p(f3), y3 = function(t3) {
- var e3 = O2(l3);
- return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
- };
- if ($3 === c2)
- return this.set(c2, this.$M + r3);
- if ($3 === h2)
- return this.set(h2, this.$y + r3);
- if ($3 === a2)
- return y3(1);
- if ($3 === o2)
- return y3(7);
- var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n2, d3[i2] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M4;
- return b2.w(m4, this);
- }, m3.subtract = function(t3, e3) {
- return this.add(-1 * t3, e3);
- }, m3.format = function(t3) {
- var e3 = this, n3 = this.$locale();
- if (!this.isValid())
- return n3.invalidDate || l2;
- var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, i4, s4) {
- return t4 && (t4[n4] || t4(e3, r3)) || i4[n4].slice(0, s4);
- }, d3 = function(t4) {
- return b2.s(s3 % 12 || 12, t4, "0");
- }, $3 = f3 || function(t4, e4, n4) {
- var r4 = t4 < 12 ? "AM" : "PM";
- return n4 ? r4.toLowerCase() : r4;
- };
- return r3.replace(y2, function(t4, r4) {
- return r4 || function(t5) {
- switch (t5) {
- case "YY":
- return String(e3.$y).slice(-2);
- case "YYYY":
- return b2.s(e3.$y, 4, "0");
- case "M":
- return a3 + 1;
- case "MM":
- return b2.s(a3 + 1, 2, "0");
- case "MMM":
- return h3(n3.monthsShort, a3, c3, 3);
- case "MMMM":
- return h3(c3, a3);
- case "D":
- return e3.$D;
- case "DD":
- return b2.s(e3.$D, 2, "0");
- case "d":
- return String(e3.$W);
- case "dd":
- return h3(n3.weekdaysMin, e3.$W, o3, 2);
- case "ddd":
- return h3(n3.weekdaysShort, e3.$W, o3, 3);
- case "dddd":
- return o3[e3.$W];
- case "H":
- return String(s3);
- case "HH":
- return b2.s(s3, 2, "0");
- case "h":
- return d3(1);
- case "hh":
- return d3(2);
- case "a":
- return $3(s3, u3, true);
- case "A":
- return $3(s3, u3, false);
- case "m":
- return String(u3);
- case "mm":
- return b2.s(u3, 2, "0");
- case "s":
- return String(e3.$s);
- case "ss":
- return b2.s(e3.$s, 2, "0");
- case "SSS":
- return b2.s(e3.$ms, 3, "0");
- case "Z":
- return i3;
- }
- return null;
- }(t4) || i3.replace(":", "");
- });
- }, m3.utcOffset = function() {
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
- }, m3.diff = function(r3, d3, l3) {
- var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() {
- return b2.m(y3, m4);
- };
- switch (M4) {
- case h2:
- $3 = D3() / 12;
- break;
- case c2:
- $3 = D3();
- break;
- case f2:
- $3 = D3() / 3;
- break;
- case o2:
- $3 = (g3 - v3) / 6048e5;
- break;
- case a2:
- $3 = (g3 - v3) / 864e5;
- break;
- case u2:
- $3 = g3 / n2;
- break;
- case s2:
- $3 = g3 / e2;
- break;
- case i2:
- $3 = g3 / t2;
- break;
- default:
- $3 = g3;
- }
- return l3 ? $3 : b2.a($3);
- }, m3.daysInMonth = function() {
- return this.endOf(c2).$D;
- }, m3.$locale = function() {
- return D2[this.$L];
- }, m3.locale = function(t3, e3) {
- if (!t3)
- return this.$L;
- var n3 = this.clone(), r3 = w2(t3, e3, true);
- return r3 && (n3.$L = r3), n3;
- }, m3.clone = function() {
- return b2.w(this.$d, this);
- }, m3.toDate = function() {
- return new Date(this.valueOf());
- }, m3.toJSON = function() {
- return this.isValid() ? this.toISOString() : null;
- }, m3.toISOString = function() {
- return this.$d.toISOString();
- }, m3.toString = function() {
- return this.$d.toUTCString();
- }, M3;
- }(), k = _2.prototype;
- return O2.prototype = k, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
- k[t3[1]] = function(e3) {
- return this.$g(e3, t3[0], t3[1]);
- };
- }), O2.extend = function(t3, e3) {
- return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2;
- }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
- return O2(1e3 * t3);
- }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
- });
- })(dayjs_min);
- var dayjs_minExports = dayjs_min.exports;
- const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
- const AuthUtil = {
- // 使用手机 + 密码登录
- login: (data) => {
- return request$1({
- url: "/member/auth/login",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.logging_in"),
- successMsg: t$6("common.login_success")
- }
- });
- },
- // 使用手机 + 验证码登录
- smsLogin: (data) => {
- return request$1({
- url: "/member/auth/sms-login",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.logging_in"),
- successMsg: t$6("common.login_success")
- }
- });
- },
- // 账号注册
- register: (data) => {
- return request$1({
- url: "/member/auth/sms-register",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.registering"),
- successMsg: t$6("common.register_success")
- }
- });
- },
- // 注册校验用户名是否重复
- verifyUsername: (username2) => {
- return request$1({
- url: "/member/user/verifyUsername?username=" + username2,
- method: "GET"
- });
- },
- // 根据用户名和手机号查询用户
- verifyPhone: (username2, mobile2) => {
- return request$1({
- url: "/member/user/getUserByUserNameWithMobile?username=" + username2 + "&mobile=" + mobile2,
- method: "GET"
- });
- },
- // 发送手机验证码
- sendSmsCode: (mobile2, scene) => {
- return request$1({
- url: "/member/auth/send-sms-code",
- method: "POST",
- data: {
- mobile: mobile2,
- scene
- },
- custom: {
- loadingMsg: t$6("common.sending"),
- showSuccess: true,
- successMsg: t$6("common.send_success")
- }
- });
- },
- // 校验手机验证码
- validatePhone: (mobile2, code2, scene) => {
- return request$1({
- url: "/member/auth/validate-sms-code",
- method: "POST",
- data: {
- mobile: mobile2,
- code: code2,
- scene
- }
- });
- },
- // 微信公众号登录选择账号登录
- selectUsernameLogin: (data) => {
- return request$1({
- url: "/member/auth/select-username-login",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.logging_in"),
- successMsg: t$6("common.login_success")
- }
- });
- },
- // 微信公众号注册
- officialRegister: (data) => {
- return request$1({
- url: "/member/auth/social-register",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.registering"),
- successMsg: t$6("common.register_success")
- }
- });
- },
- // 微信公众号首次登录校验手机
- OfficialEnterLogin: (reqVO, registerReqVO) => {
- return request$1({
- url: "/member/auth/social-login-validate-sms-code",
- method: "POST",
- data: {
- reqVO,
- registerReqVO
- }
- });
- },
- // 登出系统
- logout: () => {
- return request$1({
- url: "/member/auth/logout",
- method: "POST"
- });
- },
- // 刷新令牌
- refreshToken: (refreshToken2) => {
- return request$1({
- url: "/member/auth/refresh-token",
- method: "POST",
- params: {
- refreshToken: refreshToken2
- },
- custom: {
- loading: false,
- // 不用加载中
- showError: false
- // 不展示错误提示
- }
- });
- },
- // 社交授权的跳转
- socialAuthRedirect: (type, redirectUri) => {
- return request$1({
- url: "/member/auth/social-auth-redirect",
- method: "GET",
- params: {
- type,
- redirectUri
- },
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.logging_in")
- }
- });
- },
- // 社交快捷登录
- socialLogin: (type, code2, state) => {
- return request$1({
- url: "/member/auth/social-login",
- method: "POST",
- data: {
- type,
- code: code2,
- state
- },
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.logging_in")
- }
- });
- },
- // 微信小程序的一键登录
- weixinMiniAppLogin: (phoneCode, loginCode, state) => {
- return request$1({
- url: "/member/auth/weixin-mini-app-login",
- method: "POST",
- data: {
- phoneCode,
- loginCode,
- state
- },
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.logging_in"),
- successMsg: t$6("common.login_success")
- }
- });
- },
- // 创建微信 JS SDK 初始化所需的签名
- createWeixinMpJsapiSignature: (url2) => {
- return request$1({
- url: "/member/auth/create-weixin-jsapi-signature",
- method: "POST",
- params: {
- url: url2
- },
- custom: {
- showError: false,
- showLoading: false
- }
- });
- },
- // 获得消费者跳转到平台或者商户的链接
- getConsumerRedirectUrl: () => {
- return request$1({
- url: "/member/auth/redirectLogin",
- method: "GET"
- });
- }
- };
- const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: AuthUtil
- }, Symbol.toStringTag, { value: "Module" }));
- const SignInApi = {
- // 获得签到规则列表
- getSignInConfigList: () => {
- return request$1({
- url: "/member/sign-in/config/list",
- method: "GET"
- });
- },
- // 获得个人签到统计
- getSignInRecordSummary: () => {
- return request$1({
- url: "/member/sign-in/record/get-summary",
- method: "GET"
- });
- },
- // 获得
- getOwnSignInMoon: (params) => {
- return request$1({
- url: "/member/sign-in/record/get-own-signInMoon",
- method: "GET",
- params
- });
- },
- // 签到
- createSignInRecord: () => {
- return request$1({
- url: "/distri/user-sign-in-log/create",
- method: "POST"
- });
- },
- // 获得签到记录分页
- getSignRecordPage: (params) => {
- formatAppLog("log", "at sheep/api/member/signin.js:37", params);
- const queryString = Object.keys(params).map((key) => encodeURIComponent(key) + "=" + params[key]).join("&");
- return request$1({
- url: `/member/sign-in/record/page?${queryString}`,
- method: "GET"
- });
- }
- };
- const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: SignInApi
- }, Symbol.toStringTag, { value: "Module" }));
- let time = 30;
- let timer = null;
- async function onSign() {
- const {
- code: code2,
- data
- } = await SignInApi.createSignInRecord();
- if (code2 === 0) {
- showSignUpModal(data);
- }
- if (timer) {
- clearInterval(timer);
- }
- uni.setStorageSync("isRun", false);
- uni.setStorageSync("isSign", true);
- }
- function resetSignStatusIfNeeded() {
- const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
- const lastCheckDate = uni.getStorageSync("lastCheckDate");
- if (today !== lastCheckDate) {
- uni.setStorageSync("isSign", false);
- uni.setStorageSync("lastCheckDate", today);
- }
- }
- function autoSign() {
- resetSignStatusIfNeeded();
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- if (isLogin.value) {
- uni.setStorageSync("isRun", true);
- if (uni.getStorageSync("isRun") && !uni.getStorageSync("isSign")) {
- timer = setInterval(() => {
- time--;
- if (uni.getStorageSync("isSign") || !isLogin.value) {
- cancelAutoSign();
- }
- if (time <= 0 && !uni.getStorageSync("isSign")) {
- clearInterval(timer);
- onSign();
- }
- }, 1e3);
- }
- }
- }
- function cancelAutoSign() {
- if (timer) {
- clearInterval(timer);
- }
- time = 30;
- uni.setStorageSync("isRun", false);
- }
- function showSignUpModal(obj) {
- $store("modal").$patch((state) => {
- state.signUp = true;
- state.signUpInfo = obj;
- });
- }
- function colseSignUpModal() {
- $store("modal").$patch((state) => {
- state.signUp = false;
- });
- }
- function showWalletModal(obj) {
- $store("modal").$patch((state) => {
- state.getWallet = true;
- state.getWalletInfo = obj;
- });
- }
- function colseWalletModal() {
- $store("modal").$patch((state) => {
- state.getWallet = false;
- });
- }
- function showSubscribeModal() {
- const modal2 = $store("modal");
- modal2.$patch((state) => {
- state.subscribe = true;
- });
- }
- function closeSubscribeModal() {
- const modal2 = $store("modal");
- modal2.$patch((state) => {
- state.subscribe = false;
- });
- }
- function showAuthModal(type = "accountLogin", isActive = "accountLogin") {
- const modal2 = $store("modal");
- if (modal2.auth !== "") {
- closeAuthModal();
- setTimeout(() => {
- modal2.$patch((state) => {
- state.auth = type;
- state.isActive = isActive;
- });
- }, 100);
- } else {
- modal2.$patch((state) => {
- state.auth = type;
- state.isActive = isActive;
- });
- }
- }
- function closeAuthModal() {
- $store("modal").$patch((state) => {
- state.auth = "";
- });
- }
- function showShareModal(spuId = 0) {
- $store("modal").$patch((state) => {
- state.share = true;
- state.shareInfo.spuId = spuId;
- });
- }
- function closeShareModal() {
- $store("modal").$patch((state) => {
- state.share = false;
- });
- }
- function showMenuTools() {
- $store("modal").$patch((state) => {
- state.menu = true;
- });
- }
- function closeMenuTools() {
- $store("modal").$patch((state) => {
- state.menu = false;
- });
- }
- function getSmsCode(event, mobile2) {
- const modalStore = $store("modal");
- const lastSendTimer = modalStore.lastTimer[event];
- if (typeof lastSendTimer === "undefined") {
- $helper.toast(t$6("common.sms_error"));
- return;
- }
- const duration2 = dayjs().unix() - lastSendTimer;
- const canSend = duration2 >= 60;
- if (!canSend) {
- $helper.toast(t$6("common.try_later"));
- return;
- }
- if (mobile2 && !test$1.mobile(mobile2)) {
- $helper.toast(t$6("common.phone_format_error"));
- return;
- }
- let scene = -1;
- switch (event) {
- case "resetPassword":
- scene = 4;
- break;
- case "changePassword":
- scene = 3;
- break;
- case "changeMobileOld":
- scene = 2;
- break;
- case "changeMobileNew":
- scene = 5;
- break;
- case "smsLogin":
- scene = 1;
- break;
- case "consumptionTransfers":
- scene = 11;
- break;
- case "zeroBuy":
- scene = 12;
- break;
- }
- AuthUtil.sendSmsCode(mobile2, scene).then((res) => {
- if (res.code === 0) {
- modalStore.$patch((state) => {
- state.lastTimer[event] = dayjs().unix();
- });
- }
- });
- }
- function getSmsTimer(event, mobile2 = "") {
- const modalStore = $store("modal");
- const lastSendTimer = modalStore.lastTimer[event];
- if (typeof lastSendTimer === "undefined") {
- $helper.toast(t$6("common.sms_error"));
- return;
- }
- const duration2 = vue.ref(dayjs().unix() - lastSendTimer - 60);
- const canSend = duration2.value >= 0;
- if (canSend) {
- return t$6("common.get_verification_code");
- }
- if (!canSend) {
- setTimeout(() => {
- duration2.value++;
- }, 1e3);
- return -duration2.value.toString() + " s";
- }
- }
- function saveAdvHistory(adv) {
- const modal2 = $store("modal");
- modal2.$patch((state) => {
- if (!state.advHistory.includes(adv.imgUrl)) {
- state.advHistory.push(adv.imgUrl);
- }
- });
- }
- let flag;
- function throttle$1(func, wait = 500, immediate = true) {
- if (immediate) {
- if (!flag) {
- flag = true;
- typeof func === "function" && func();
- setTimeout(() => {
- flag = false;
- }, wait);
- }
- } else if (!flag) {
- flag = true;
- setTimeout(() => {
- flag = false;
- typeof func === "function" && func();
- }, wait);
- }
- }
- var define_ROUTES_MAP_default = { "/pages/index/FirstIndex": { path: "/pages/index/FirstIndex", aliasPath: "/", meta: { auth: false, sync: true, title: "首页", group: "商城" } }, "/pages/index/FirstActivity": { path: "/pages/index/FirstActivity", meta: { auth: false, sync: true, title: "活动", group: "商城" } }, "/pages/index/FirstVideo": { path: "/pages/index/FirstVideo", meta: { auth: false, sync: true, title: "视频", group: "商城" } }, "/pages/index/FirstList": { path: "/pages/index/FirstList", meta: { auth: false, sync: true, title: "列表", group: "商城" } }, "/pages/index/index": { path: "/pages/index/index", meta: { auth: false, sync: true, title: "首页", group: "商城" } }, "/pages/index/user": { path: "/pages/index/user", meta: { sync: true, title: "个人中心", group: "商城" } }, "/pages/index/category": { path: "/pages/index/category", meta: { sync: true, title: "商品分类", group: "商城" } }, "/pages/index/cart": { path: "/pages/index/cart", meta: { sync: true, title: "购物车", group: "商城" } }, "/pages/index/login": { path: "/pages/index/login" }, "/pages/index/search": { path: "/pages/index/search", meta: { sync: true, title: "搜索", group: "商城" } }, "/pages/index/page": { path: "/pages/index/page", meta: { auth: false, sync: true, title: "自定义页面", group: "商城" } }, "/pages/goods/index": { path: "/pages/goods/index", meta: { sync: true, title: "普通商品", group: "商品" } }, "/pages/goods/groupon": { path: "/pages/goods/groupon", meta: { sync: true, title: "拼团商品", group: "商品" } }, "/pages/goods/seckill": { path: "/pages/goods/seckill", meta: { sync: true, title: "秒杀商品", group: "商品" } }, "/pages/goods/list": { path: "/pages/goods/list", meta: { sync: true, title: "商品列表", group: "商品" } }, "/pages/goods/comment/add": { path: "/pages/goods/comment/add", meta: { auth: true } }, "/pages/goods/comment/list": { path: "/pages/goods/comment/list" }, "/pages/order/detail": { path: "/pages/order/detail", meta: { auth: true, title: "订单详情" } }, "/pages/order/confirm": { path: "/pages/order/confirm", meta: { auth: true, title: "确认订单" } }, "/pages/order/list": { path: "/pages/order/list", meta: { auth: true, sync: true, title: "用户订单", group: "订单中心" } }, "/pages/order/aftersale/apply": { path: "/pages/order/aftersale/apply", meta: { auth: true, title: "申请售后" } }, "/pages/order/aftersale/return-delivery": { path: "/pages/order/aftersale/return-delivery", meta: { auth: true, title: "退货物流" } }, "/pages/order/aftersale/list": { path: "/pages/order/aftersale/list", meta: { auth: true, sync: true, title: "售后订单", group: "订单中心" } }, "/pages/order/aftersale/detail": { path: "/pages/order/aftersale/detail", meta: { auth: true, title: "售后详情" } }, "/pages/order/aftersale/log": { path: "/pages/order/aftersale/log", meta: { auth: true, title: "售后进度" } }, "/pages/order/express/log": { path: "/pages/order/express/log", meta: { auth: true, title: "物流轨迹" } }, "/pages/order/otherlist": { path: "/pages/order/otherlist" }, "/pages/user/info": { path: "/pages/user/info", meta: { auth: true, sync: true, title: "用户信息", group: "用户中心" } }, "/pages/user/setting": { path: "/pages/user/setting", meta: { auth: true, sync: true, title: "用户设置", group: "用户中心" } }, "/pages/user/qrcode-share": { path: "/pages/user/qrcode-share", meta: { auth: true, sync: true, title: "我的二维码/分享页", group: "用户中心" } }, "/pages/user/goods-collect": { path: "/pages/user/goods-collect", meta: { auth: true, sync: true, title: "商品收藏", group: "用户中心" } }, "/pages/user/goods-log": { path: "/pages/user/goods-log", meta: { auth: true, sync: true, title: "浏览记录", group: "用户中心" } }, "/pages/user/address/list": { path: "/pages/user/address/list", meta: { auth: true, sync: true, title: "地址管理", group: "用户中心" } }, "/pages/user/dummyAddress/list": { path: "/pages/user/dummyAddress/list", meta: { auth: true, sync: true, title: "虚拟商品收货地址", group: "用户中心" } }, "/pages/user/invoice/edit": { path: "/pages/user/invoice/edit", meta: { auth: true, title: "发票抬头" } }, "/pages/user/invoice/list": { path: "/pages/user/invoice/list", meta: { auth: true, sync: true, title: "发票抬头管理", group: "用户中心" } }, "/pages/user/address/edit": { path: "/pages/user/address/edit", meta: { auth: true, title: "编辑地址" } }, "/pages/user/dummyAddress/edit": { path: "/pages/user/dummyAddress/edit", meta: { auth: true, title: "编辑地址" } }, "/pages/user/wallet/money": { path: "/pages/user/wallet/money", meta: { auth: true, sync: true, title: "用户余额", group: "用户中心" } }, "/pages/user/wallet/score": { path: "/pages/user/wallet/score", meta: { auth: true, sync: true, title: "钱包", group: "用户中心" } }, "/pages/user/wallet/consumptionLog": { path: "/pages/user/wallet/consumptionLog", meta: { auth: true, sync: true, title: "消费分来源", group: "用户中心" } }, "/pages/user/wallet/topupConsumptionPoints": { path: "/pages/user/wallet/topupConsumptionPoints", meta: { auth: true, sync: true, title: "消费分充值", group: "用户中心" } }, "/pages/user/wallet/consumptionTransfersLog": { path: "/pages/user/wallet/consumptionTransfersLog", meta: { auth: true, sync: true, title: "消费分转账", group: "用户中心" } }, "/pages/user/wallet/consumptionTransfers": { path: "/pages/user/wallet/consumptionTransfers", meta: { auth: true, sync: true, title: "消费分转让", group: "用户中心" } }, "/pages/user/wallet/scoreToConsumption": { path: "/pages/user/wallet/scoreToConsumption", meta: { auth: true, sync: true, title: "佣金转消费分", group: "用户中心" } }, "/pages/user/wallet/withdraw": { path: "/pages/user/wallet/withdraw", meta: { auth: true, sync: true, title: "提现", group: "提现" } }, "/pages/user/wallet/withdrawalLog": { path: "/pages/user/wallet/withdrawalLog", meta: { auth: true, sync: true, title: "提现记录", group: "提现记录" } }, "/pages/user/wallet/scoreToMoney": { path: "/pages/user/wallet/scoreToMoney", meta: { auth: true, sync: true, title: "佣金兑换", group: "用户中心" } }, "/pages/user/wallet/ScoreLog": { path: "/pages/user/wallet/ScoreLog" }, "/pages/user/wallet/maxScoreLog": { path: "/pages/user/wallet/maxScoreLog" }, "/pages/user/wallet/team": { path: "/pages/user/wallet/team", meta: { auth: true, sync: true, title: "团队", group: "用户中心" } }, "/pages/commission/index": { path: "/pages/commission/index", meta: { auth: true, sync: true, title: "分销中心", group: "分销商城" } }, "/pages/commission/wallet": { path: "/pages/commission/wallet", meta: { auth: true, sync: true, title: "用户佣金", group: "分销中心" } }, "/pages/commission/goods": { path: "/pages/commission/goods", meta: { auth: true, sync: true, title: "推广商品", group: "分销商城" } }, "/pages/commission/order": { path: "/pages/commission/order", meta: { auth: true, sync: true, title: "分销订单", group: "分销商城" } }, "/pages/commission/team": { path: "/pages/commission/team", meta: { auth: true, sync: true, title: "我的团队", group: "分销商城" } }, "/pages/commission/promoter": { path: "/pages/commission/promoter", meta: { auth: true, sync: true, title: "推广人排行榜", group: "分销商城" } }, "/pages/commission/commission-ranking": { path: "/pages/commission/commission-ranking", meta: { auth: true, sync: true, title: "佣金排行榜", group: "分销商城" } }, "/pages/commission/withdraw": { path: "/pages/commission/withdraw", meta: { auth: true, sync: true, title: "申请提现", group: "分销商城" } }, "/pages/app/sign": { path: "/pages/app/sign", meta: { auth: true, sync: true, title: "签到中心", group: "应用" } }, "/pages/shop/index": { path: "/pages/shop/index", meta: { auth: true, sync: true, title: "店铺首页", group: "应用" } }, "/pages/shop/category": { path: "/pages/shop/category", meta: { auth: true, sync: true, title: "店铺分类", group: "应用" } }, "/pages/shop/allproduct": { path: "/pages/shop/allproduct", meta: { auth: true, sync: true, title: "所有商品", group: "应用" } }, "/pages/public/setting": { path: "/pages/public/setting", meta: { sync: true, title: "系统设置", group: "通用" } }, "/pages/public/richtext": { path: "/pages/public/richtext", meta: { sync: true, title: "富文本", group: "通用" } }, "/pages/public/faq": { path: "/pages/public/faq", meta: { sync: true, title: "常见问题", group: "通用" } }, "/pages/public/error": { path: "/pages/public/error" }, "/pages/public/webview": { path: "/pages/public/webview" }, "/pages/public/merchant": { path: "/pages/public/merchant" }, "/pages/public/merchantApplyList": { path: "/pages/public/merchantApplyList" }, "/pages/coupon/list": { path: "/pages/coupon/list", meta: { sync: true, title: "领券中心", group: "优惠券" } }, "/pages/coupon/detail": { path: "/pages/coupon/detail", meta: { auth: false, sync: true, title: "优惠券详情", group: "优惠券" } }, "/pages/chat/index": { path: "/pages/chat/index", meta: { auth: true, sync: true, title: "客服", group: "客服" } }, "/pages/chat/speechtotext": { path: "/pages/chat/speechtotext", meta: { auth: true, sync: true, title: "语音转文字", group: "语音转文字" } }, "/pages/pay/index": { path: "/pages/pay/index" }, "/pages/pay/result": { path: "/pages/pay/result" }, "/pages/pay/resultYuan": { path: "/pages/pay/resultYuan" }, "/pages/pay/recharge": { path: "/pages/pay/recharge", meta: { auth: true, sync: true, title: "充值余额", group: "支付" } }, "/pages/pay/recharge-log": { path: "/pages/pay/recharge-log", meta: { auth: true, sync: true, title: "充值记录", group: "支付" } }, "/pages/activity/groupon/detail": { path: "/pages/activity/groupon/detail" }, "/pages/activity/groupon/order": { path: "/pages/activity/groupon/order", meta: { auth: true, sync: true, title: "拼团订单", group: "营销活动" } }, "/pages/activity/index": { path: "/pages/activity/index", meta: { sync: true, title: "营销商品", group: "营销活动" } }, "/pages/activity/groupon/list": { path: "/pages/activity/groupon/list", meta: { sync: true, title: "拼团活动", group: "营销活动" } }, "/pages/activity/seckill/list": { path: "/pages/activity/seckill/list", meta: { sync: true, title: "秒杀活动", group: "营销活动" } }, "/pages/activity/bargain/list": { path: "/pages/activity/bargain/list", meta: { sync: true, title: "砍价列表", group: "营销活动" } }, "/pages/activity/bargain/detail": { path: "/pages/activity/bargain/detail", meta: { sync: true, title: "砍价详情", group: "营销活动" } } };
- var define_TABBAR_default = ["/pages/index/index", "/pages/index/cart", "/pages/index/user"];
- const _go = (path, params = {}, options2 = {
- redirect: false
- }) => {
- var _a2;
- let page2 = "";
- let query = "";
- let url2 = "";
- if (lodashExports.isString(path)) {
- if (lodashExports.startsWith(path, "http")) {
- page2 = `/pages/public/webview`;
- query = `url=${encodeURIComponent(path)}`;
- } else if (lodashExports.startsWith(path, "action:")) {
- handleAction(path);
- return;
- } else {
- [page2, query] = path.split("?");
- }
- if (!lodashExports.isEmpty(params)) {
- let query2 = paramsToQuery(params);
- if (lodashExports.isEmpty(query)) {
- query = query2;
- } else {
- query += "&" + query2;
- }
- }
- }
- if (lodashExports.isObject(path)) {
- page2 = path.url;
- if (!lodashExports.isNil(path.params)) {
- query = paramsToQuery(path.params);
- }
- }
- const nextRoute = define_ROUTES_MAP_default[page2];
- if (!nextRoute) {
- formatAppLog("log", "at sheep/router/index.js:56", `%c跳转路径参数错误<${page2 || "EMPTY"}>`, "color:red;background:yellow");
- return;
- }
- if (((_a2 = nextRoute.meta) == null ? void 0 : _a2.auth) && !$store("user").isLogin) {
- showAuthModal();
- return;
- }
- url2 = page2;
- if (!lodashExports.isEmpty(query)) {
- url2 += `?${query}`;
- }
- if (define_TABBAR_default.includes(page2)) {
- uni.switchTab({
- url: url2
- });
- return;
- }
- if (options2.redirect) {
- uni.redirectTo({
- url: url2
- });
- return;
- }
- uni.navigateTo({
- url: url2
- });
- };
- function go(...args) {
- throttle$1(() => {
- _go(...args);
- });
- }
- function paramsToQuery(params) {
- if (lodashExports.isEmpty(params)) {
- return "";
- }
- let query = [];
- for (let key in params) {
- query.push(key + "=" + params[key]);
- }
- return query.join("&");
- }
- function back() {
- uni.navigateBack();
- }
- function redirect(path, params = {}) {
- go(path, params, {
- redirect: true
- });
- }
- function hasHistory() {
- const pages2 = getCurrentPages();
- if (pages2.length > 1) {
- return true;
- }
- return false;
- }
- function getCurrentRoute(field = "") {
- let currentPage = getCurrentPage();
- if (field !== "") {
- return currentPage.$page[field];
- } else {
- return currentPage.$page;
- }
- }
- function getCurrentPage() {
- let pages2 = getCurrentPages();
- return pages2[pages2.length - 1];
- }
- function handleAction(path) {
- const action = path.split(":");
- switch (action[1]) {
- case "showShareModal":
- showShareModal();
- break;
- }
- }
- function error(errCode, errMsg = "") {
- redirect("/pages/public/error", {
- errCode,
- errMsg
- });
- }
- const $router = {
- go,
- back,
- hasHistory,
- redirect,
- getCurrentPage,
- getCurrentRoute,
- error
- };
- const cdn = (url2 = "", cdnurl = "") => {
- if (!url2)
- return "";
- if (url2.indexOf("http") === 0) {
- return url2;
- }
- if (cdnurl === "") {
- cdnurl = $store("app").info.cdnurl;
- }
- return cdnurl + url2;
- };
- const $url = {
- // 添加cdn域名前缀
- cdn,
- // 对象存储自动剪裁缩略图
- thumb: (url2 = "", params) => {
- url2 = cdn(url2);
- return append_thumbnail_params(url2, params);
- },
- // 静态资源地址
- static: (url2 = "", staticurl = "") => {
- if (staticurl === "") {
- staticurl = staticUrl;
- }
- if (staticurl !== "local") {
- url2 = cdn(url2, staticurl);
- }
- return url2;
- },
- // css背景图片地址
- css: (url2 = "", staticurl = "") => {
- if (staticurl === "") {
- staticurl = staticUrl;
- }
- if (staticurl !== "local") {
- url2 = cdn(url2, staticurl);
- }
- if (staticurl === "local") {
- url2 = plus.io.convertLocalFileSystemURL(url2);
- }
- return `url(${url2})`;
- }
- };
- function append_thumbnail_params(url2, params) {
- const filesystem = $store("app").info.filesystem;
- if (filesystem === "public") {
- return url2;
- }
- let width = params.width || "200";
- let height = params.height || "200";
- let mode = params.mode || "lfit";
- let quality = params.quality || 90;
- let gravity = params.gravity || "center";
- let suffix = "";
- let crop_str = "";
- let quality_str = "";
- let size = width + "x" + height;
- switch (filesystem) {
- case "aliyun":
- if (!gravity && gravity != "center") {
- mode = "mfit";
- crop_str = "/crop,g_" + gravityFormat("aliyun", gravity) + ",w_" + width + ",h_" + height;
- }
- if (quality > 0 && quality < 100) {
- quality_str = "/quality,q_" + quality;
- }
- suffix = "x-oss-process=image/resize,m_" + mode + ",w_" + width + ",h_" + height;
- suffix += crop_str + quality_str;
- break;
- case "qcloud":
- let mode_str = "thumbnail";
- if (mode == "fill" || !gravity && gravity != "center") {
- mode_str = "crop";
- mode = "fill";
- crop_str = "/gravity/" + gravityFormat("qcloud", gravity);
- }
- if (quality > 0 && quality < 100) {
- quality_str = "/rquality/" + quality;
- }
- switch (mode) {
- case "lfit":
- size = "" + size + ">";
- break;
- case "mfit":
- size = "!" + size + "r";
- case "fill":
- break;
- case "pad":
- size = size + "/pad/1";
- break;
- case "fixed":
- size = size + "!";
- break;
- }
- suffix = "imageMogr2/" + mode_str + "/" + size + crop_str + quality_str;
- break;
- case "qiniu":
- if (mode == "fill" || !gravity && gravity != "center") {
- mode = "mfit";
- crop_str = "/gravity/" + gravityFormat("qiniu", gravity) + "/crop/" + size;
- }
- if (quality > 0 && quality < 100) {
- quality_str = "/quality/" + quality;
- }
- switch (mode) {
- case "lfit":
- case "pad":
- size = size + ">";
- break;
- case "mfit":
- size = "!" + size + "r";
- break;
- case "fill":
- break;
- case "fixed":
- size = size + "!";
- break;
- }
- suffix = "imageMogr2/thumbnail/" + size + crop_str + quality_str;
- break;
- }
- return url2 + "?" + suffix;
- }
- const platformMap = ["H5", "WechatOfficialAccount", "WechatMiniProgram", "App"];
- const fromMap = ["forward", "poster", "link"];
- const getShareInfo = (scene = {
- title: "",
- // 自定义分享标题
- desc: "",
- // 自定义描述
- image: "",
- // 自定义分享图片
- params: {}
- // 自定义分享参数
- }, poster = {
- // 自定义海报数据
- type: "user"
- }) => {
- let shareInfo = {
- title: "",
- // 分享标题
- desc: "",
- // 描述
- image: "",
- // 分享图片
- path: "",
- // 分享页面+参数
- link: "",
- // 分享Url+参数
- query: "",
- // 分享参数
- poster
- // 海报所需数据
- };
- const app2 = $store("app");
- const shareConfig = app2.platform.share;
- const query = buildSpmQuery(scene.params);
- shareInfo.query = query;
- shareInfo.link = buildSpmLink(query, shareConfig.linkAddress);
- if (shareConfig.methods.includes("forward")) {
- if (shareConfig.forwardInfo.title === "" || shareConfig.forwardInfo.image === "") {
- formatAppLog("log", "at sheep/platform/share.js:52", "请在平台设置中配置转发信息");
- }
- shareInfo.title = scene.title || shareConfig.forwardInfo.title;
- shareInfo.image = $url.cdn(scene.image || shareConfig.forwardInfo.image);
- shareInfo.desc = scene.desc || shareConfig.forwardInfo.subtitle;
- shareInfo.path = buildSpmPath(query);
- }
- return shareInfo;
- };
- const buildSpmQuery = (params) => {
- const user2 = $store("user");
- let shareId = "0";
- if (typeof params.shareId === "undefined") {
- if (user2.isLogin) {
- shareId = user2.userInfo.id;
- }
- }
- let page2 = "1";
- if (typeof params.page !== "undefined") {
- page2 = params.page;
- }
- let query = "0";
- if (typeof params.query !== "undefined") {
- query = params.query;
- }
- let platform2 = platformMap.indexOf(_platform.name) + 1;
- let from = "1";
- if (typeof params.from !== "undefined") {
- from = platformMap.indexOf(params.from) + 1;
- }
- return `spm=${shareId}.${page2}.${query}.${platform2}.${from}`;
- };
- const buildSpmPath = (query) => {
- return `/pages/index/index?${query}`;
- };
- const buildSpmLink = (query, linkAddress = "") => {
- return `${linkAddress}?${query}`;
- };
- const decryptSpm = (spm) => {
- const user2 = $store("user");
- let shareParamsArray = spm.split(".");
- let shareParams = {
- spm,
- shareId: 0,
- page: "",
- query: {},
- platform: "",
- from: ""
- };
- let query;
- shareParams.shareId = shareParamsArray[0];
- switch (shareParamsArray[1]) {
- case "1":
- shareParams.page = "/pages/index/index";
- break;
- case "2":
- shareParams.page = "/pages/goods/index";
- shareParams.query = {
- linkId: shareParamsArray[2]
- };
- formatAppLog("log", "at sheep/platform/share.js:126", shareParams.query);
- break;
- case "3":
- shareParams.page = "/pages/goods/groupon";
- query = shareParamsArray[2].split(",");
- shareParams.query = {
- id: query[0],
- activity_id: query[1]
- };
- break;
- case "4":
- shareParams.page = "/pages/goods/seckill";
- query = shareParamsArray[2].split(",");
- shareParams.query = {
- id: query[1]
- };
- break;
- case "5":
- shareParams.page = "/pages/activity/groupon/detail";
- shareParams.query = {
- id: shareParamsArray[2]
- };
- break;
- }
- shareParams.platform = platformMap[shareParamsArray[3] - 1];
- shareParams.from = fromMap[shareParamsArray[4] - 1];
- if (shareParams.shareId != 0) {
- if (user2.isLogin) {
- user2.addShareLog(shareParams);
- } else {
- uni.setStorageSync("shareLog", shareParams);
- }
- }
- if (shareParams.page !== "/pages/index/index") {
- $router.go(shareParams.page, shareParams.query);
- }
- return shareParams;
- };
- const updateShareInfo = (shareInfo) => {
- };
- const $share = {
- getShareInfo,
- updateShareInfo,
- decryptSpm
- };
- const PayOrderApi = {
- // 获得支付订单
- getOrder: (id) => {
- return request$1({
- url: "/pay/order/get",
- method: "GET",
- params: { id }
- });
- },
- // 获得支付后的订单条件
- getByStatus: (id) => {
- return request$1({
- url: "/trade/order/getPayOrderByStatus",
- method: "GET",
- params: { id }
- });
- },
- // 获得支付后的订单条件2 实际用的
- getByStatus2: (id) => {
- return request$1({
- url: "/trade/order/getPayOrderByStatus2",
- method: "GET",
- params: { id }
- });
- },
- // 富友微信jsapi支付成功
- getFuYouPayOrderByStatus: (payOrderNo) => {
- return request$1({
- url: "/trade/order/getFuYouPayOrderByStatus",
- method: "POST",
- params: {
- payOrderNo
- }
- });
- },
- getPayOrder: (tradeOrderId) => {
- return request$1({
- url: "/trade/order/getPayOrder",
- method: "GET",
- params: { tradeOrderId }
- });
- },
- // 提交支付订单
- submitOrder: (data) => {
- return request$1({
- url: "/pay/order/submit",
- method: "POST",
- data
- });
- },
- // 佣金、消费分抵扣完 0元购
- ZeroPurchaseSubmit: (data) => {
- return request$1({
- url: "/trade/order/submit-ZeroPurchase",
- method: "POST",
- data
- });
- },
- // 第三方富友支付
- fuYouSubmitOrder: (data) => {
- return request$1({
- url: "/fuYou/pay/order/submit",
- method: "POST",
- data
- });
- }
- };
- const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: PayOrderApi
- }, Symbol.toStringTag, { value: "Module" }));
- class SheepPay {
- constructor(payment, orderType, id, orderType2) {
- this.payment = payment;
- this.id = id;
- this.orderType = orderType;
- this.orderType2 = orderType2;
- this.payAction();
- }
- payAction() {
- const payAction = {
- WechatOfficialAccount: {
- wechat: () => {
- this.wechatOfficialAccountPay();
- },
- JSAPI: () => {
- this.fuYouWechatOfficialAccountPay();
- },
- alipay: () => {
- this.redirectPay();
- },
- wallet: () => {
- this.walletPay();
- },
- mock: () => {
- this.mockPay();
- },
- wx_pub: () => {
- payAction.WechatOfficialAccount.wechat();
- }
- },
- WechatMiniProgram: {
- wechat: () => {
- this.wechatMiniProgramPay();
- },
- JSAPI: () => {
- this.fuYouWechatOfficialAccountPay();
- },
- alipay: () => {
- this.copyPayLink();
- },
- wallet: () => {
- this.walletPay();
- },
- mock: () => {
- this.mockPay();
- },
- wx_pub: () => {
- this.wechatMiniProgramPay();
- }
- },
- App: {
- wechat: () => {
- this.wechatAppPay();
- },
- JSAPI: () => {
- this.fuYouWechatOfficialAccountPay();
- },
- alipay: () => {
- this.alipay();
- },
- wallet: () => {
- this.walletPay();
- },
- mock: () => {
- this.mockPay();
- }
- },
- H5: {
- wechat: () => {
- this.wechatWapPay();
- },
- JSAPI: () => {
- this.fuYouWechatOfficialAccountPay();
- },
- alipay: () => {
- this.redirectPay();
- },
- wallet: () => {
- this.walletPay();
- },
- mock: () => {
- this.mockPay();
- },
- wx_pub: () => {
- payAction.WechatOfficialAccount.wechat();
- }
- }
- };
- return payAction[sheep$1.$platform.name][this.payment]();
- }
- // 预支付
- prepay(channel) {
- return new Promise(async (resolve, reject) => {
- let data = {
- id: this.id,
- channelCode: channel,
- channelExtras: {},
- orderType: this.orderType2
- };
- if (["wx_pub", "wx_lite"].includes(channel)) {
- const openid = await sheep$1.$platform.useProvider("wechat").getOpenid(true);
- if (!openid) {
- this.bindWeixin();
- return;
- }
- data.channelExtras.openid = openid;
- }
- PayOrderApi.submitOrder(data).then((res) => {
- res.code === 0 && resolve(res);
- if (res.code !== 0 && res.msg.indexOf("无效的openid") >= 0) {
- if (res.msg.indexOf("无效的openid") >= 0 || res.msg.indexOf("下单账号与支付账号不一致") >= 0) {
- this.bindWeixin();
- }
- }
- });
- });
- }
- // 富友预支付
- fuYouPrePay(channel) {
- return new Promise(async (resolve, reject) => {
- let data = {
- id: this.id,
- channelCode: channel,
- orderType: this.orderType2,
- req: {
- trade_type: channel
- }
- };
- if (["wx_pub", "wx_lite", "JSAPI"].includes(channel)) {
- const openid = await sheep$1.$platform.useProvider("wechat").getOpenid(true);
- if (!openid) {
- this.bindWeixin();
- return;
- }
- data.req.sub_openid = openid;
- }
- PayOrderApi.fuYouSubmitOrder(data).then((res) => {
- res.code === 0 && resolve(res);
- if (res.code !== 0 && res.msg.indexOf("无效的openid") >= 0) {
- if (res.msg.indexOf("无效的openid") >= 0 || res.msg.indexOf("下单账号与支付账号不一致") >= 0) {
- this.bindWeixin();
- }
- }
- });
- });
- }
- // 微信小程序支付
- async wechatMiniProgramPay() {
- let {
- code: code2,
- data
- } = await this.prepay("wx_lite");
- if (code2 !== 0) {
- return;
- }
- const payConfig = JSON.parse(data.displayContent);
- uni.requestPayment({
- provider: "wxpay",
- timeStamp: payConfig.timeStamp,
- nonceStr: payConfig.nonceStr,
- package: payConfig.packageValue,
- signType: payConfig.signType,
- paySign: payConfig.paySign,
- success: (res) => {
- this.payResult("success");
- },
- fail: (err) => {
- if (err.errMsg === "requestPayment:fail cancel") {
- sheep$1.$helper.toast(t$6("common.payment_manually_cancelled"));
- } else {
- this.payResult("fail");
- }
- }
- });
- }
- // 余额支付
- async walletPay() {
- const {
- code: code2
- } = await this.prepay("wallet");
- code2 === 0 && this.payResult("success");
- }
- // 模拟支付
- async mockPay() {
- const {
- code: code2
- } = await this.prepay("mock");
- code2 === 0 && this.payResult("success");
- }
- // 支付宝复制链接支付 TODO 非繁人:待接入
- async copyPayLink() {
- let {
- error: error2,
- data
- } = await this.prepay();
- if (error2 === 0) {
- uni.showModal({
- title: t$6("common.alipay_payment"),
- content: t$6("common.copy_link_to_browser"),
- confirmText: t$6("common.copy_link"),
- success: (res) => {
- if (res.confirm) {
- sheep$1.$helper.copyText(data.pay_data);
- }
- }
- });
- }
- }
- // 支付宝支付 TODO 非繁人:待接入
- async alipay() {
- let that = this;
- const {
- error: error2,
- data
- } = await this.prepay();
- if (error2 === 0) {
- uni.requestPayment({
- provider: "alipay",
- orderInfo: data.pay_data,
- //支付宝订单数据
- success: (res) => {
- that.payResult("success");
- },
- fail: (err) => {
- if (err.errMsg === "requestPayment:fail [paymentAlipay:62001]user cancel") {
- sheep$1.$helper.toast(t$6("common.payment_manually_cancelled"));
- } else {
- that.payResult("fail");
- }
- }
- });
- }
- }
- // 微信支付 TODO 非繁人:待接入
- async wechatAppPay() {
- let that = this;
- let {
- error: error2,
- data
- } = await this.prepay();
- if (error2 === 0) {
- uni.requestPayment({
- provider: "wxpay",
- orderInfo: data.pay_data,
- //微信订单数据(官方说是string。实测为object)
- success: (res) => {
- that.payResult("success");
- },
- fail: (err) => {
- err.errMsg !== "requestPayment:fail cancel" && that.payResult("fail");
- }
- });
- }
- }
- // 支付结果跳转,success:成功,fail:失败
- payResult(resultType) {
- sheep$1.$router.redirect("/pages/pay/resultYuan", {
- id: this.id,
- orderType: this.orderType,
- payState: resultType
- });
- }
- // 引导绑定微信
- bindWeixin() {
- uni.showModal({
- title: t$6("common.wechat_payment"),
- content: t$6("common.bind_wechat_for_payment"),
- confirmText: t$6("common.bind"),
- success: function(res) {
- if (res.confirm) {
- sheep$1.$platform.useProvider("wechat").bind();
- }
- }
- });
- }
- }
- function getPayMethods(channels) {
- let payMethods = [
- {
- icon: "/static/images/wechat.png",
- title: t$6("common.wechat_payment"),
- value: "wx_pub",
- disabled: false
- },
- {
- icon: "/static/images/wechat.png",
- title: t$6("common.wechat_payment"),
- value: "JSAPI",
- disabled: false
- },
- {
- icon: "/static/images/alipay.png",
- title: t$6("common.alipay_payment"),
- value: "alipay",
- disabled: false
- },
- {
- icon: "/static/images/wallet.png",
- title: t$6("common.balance_payment"),
- value: "wallet",
- disabled: false
- },
- {
- icon: "/static/images/apple.png",
- title: "Apple Pay",
- value: "apple",
- disabled: false
- },
- {
- icon: "/static/images/wallet.png",
- title: t$6("common.mock_payment"),
- value: "mock",
- disabled: false
- }
- ];
- const platform2 = sheep$1.$platform.name;
- const wechatMethod = payMethods[0];
- if (platform2 === "WechatOfficialAccount" && channels.includes("wx_pub") || platform2 === "WechatMiniProgram" && channels.includes("wx_lite") || platform2 === "App" && channels.includes("wx_app")) {
- wechatMethod.disabled = false;
- }
- const alipayMethod = payMethods[1];
- if (platform2 === "WechatOfficialAccount" && channels.includes("alipay_wap") || platform2 === "WechatMiniProgram" && channels.includes("alipay_wap") || platform2 === "App" && channels.includes("alipay_app")) {
- alipayMethod.disabled = false;
- }
- const walletMethod = payMethods[2];
- if (channels.includes("wallet")) {
- walletMethod.disabled = false;
- }
- const mockMethod = payMethods[4];
- if (channels.includes("mock")) {
- mockMethod.disabled = false;
- }
- function filterPayMethods(payMethods2, channels2) {
- for (let i2 = payMethods2.length - 1; i2 >= 0; i2--) {
- if (!channels2.includes(payMethods2[i2].value)) {
- payMethods2.splice(i2, 1);
- }
- }
- }
- filterPayMethods(payMethods, channels);
- formatAppLog("log", "at sheep/platform/pay.js:511", payMethods);
- return payMethods;
- }
- const device = uni.getSystemInfoSync();
- const os$1 = device.platform;
- let name = "";
- let provider = "";
- let platform$4 = "";
- let isWechatInstalled = true;
- name = "App";
- platform$4 = "openPlatform";
- if (os$1 === "ios") {
- isWechatInstalled = plus.ios.import("WXApi").isWXAppInstalled();
- }
- if (lodashExports.isEmpty(name)) {
- uni.showToast({
- title: t$6("common.platform_not_supported"),
- icon: "none"
- });
- }
- const load = () => {
- };
- const useProvider = (_provider = "") => {
- if (_provider === "")
- _provider = provider;
- if (_provider === "wechat")
- return wechat;
- if (_provider === "apple")
- return apple$1;
- };
- const pay = (payment, orderType, orderSN, orderType2) => {
- return new SheepPay(payment, orderType, orderSN, orderType2);
- };
- const checkUpdate = (silence = false) => {
- };
- async function checkNetwork() {
- const networkStatus = await uni.getNetworkType();
- if (networkStatus.networkType == "none") {
- return Promise.resolve(false);
- }
- return Promise.resolve(true);
- }
- const getCapsule = () => {
- return {
- bottom: 56,
- height: 32,
- left: 278,
- right: 365,
- top: 24,
- width: 87
- };
- };
- const capsule = getCapsule();
- const getNavBar = () => {
- return device.statusBarHeight + 44;
- };
- const navbar = getNavBar();
- function getLandingPage() {
- let page2 = "";
- return page2;
- }
- const landingPage = getLandingPage();
- const _platform = {
- name,
- device,
- os: os$1,
- provider,
- platform: platform$4,
- useProvider,
- checkUpdate,
- checkNetwork,
- pay,
- share: $share,
- load,
- capsule,
- navbar,
- landingPage,
- isWechatInstalled
- };
- const CartApi = {
- addCart: (data) => {
- return request$1({
- url: "/trade/cart/add",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- successMsg: t$6("common.added_to_cart")
- }
- });
- },
- updateCartCount: (data) => {
- return request$1({
- url: "/trade/cart/update-count",
- method: "PUT",
- data
- });
- },
- updateCartSelected: (data) => {
- return request$1({
- url: "/trade/cart/update-selected",
- method: "PUT",
- data
- });
- },
- deleteCart: (ids) => {
- return request$1({
- url: "/trade/cart/delete",
- method: "DELETE",
- params: {
- ids
- }
- });
- },
- getCartList: () => {
- return request$1({
- url: "/trade/cart/list",
- method: "GET",
- custom: {
- showLoading: false,
- auth: true
- }
- });
- }
- };
- const __vite_glob_0_38 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: CartApi
- }, Symbol.toStringTag, { value: "Module" }));
- const cart = defineStore({
- id: "cart",
- state: () => ({
- shopNameMap: [],
- shopSkuMap: [],
- list: [],
- // 购物车列表
- selectedIds: [],
- // 已选列表
- isAllSelected: false,
- // 是否全选
- totalPriceSelected: 0
- // 选中项总金额
- }),
- actions: {
- // 获取购物车列表
- async getList() {
- const {
- data,
- code: code2
- } = await CartApi.getCartList();
- if (code2 === 0) {
- this.list = data.validList;
- this.shopSkuMap = data.shopSkuMap;
- this.shopNameMap = data.shopNameMap;
- this.selectedIds = [];
- this.isAllSelected = true;
- this.totalPriceSelected = 0;
- this.list.forEach((item) => {
- if (item.selected) {
- this.selectedIds.push(item.id);
- this.totalPriceSelected += item.count * item.sku.price;
- } else {
- this.isAllSelected = false;
- }
- });
- }
- },
- // 添加购物车
- async add(goodsInfo) {
- const {
- code: code2
- } = await CartApi.addCart({
- skuId: goodsInfo.id,
- count: goodsInfo.goods_num
- });
- if (code2 === 0) {
- await this.getList();
- }
- },
- // 更新购物车
- async update(goodsInfo) {
- const {
- code: code2
- } = await CartApi.updateCartCount({
- id: goodsInfo.goods_id,
- count: goodsInfo.goods_num
- });
- if (code2 === 0) {
- await this.getList();
- }
- },
- // 移除购物车
- async delete(ids) {
- let id;
- if (typeof ids === "number") {
- id = ids;
- } else {
- id = ids.join(",");
- }
- const {
- code: code2
- } = await CartApi.deleteCart(id);
- if (code2 === 0) {
- await this.getList();
- }
- },
- // 单选购物车商品
- async selectSingle(goodsId) {
- const {
- code: code2
- } = await CartApi.updateCartSelected({
- ids: [goodsId],
- selected: !this.selectedIds.includes(goodsId)
- // 取反
- });
- if (code2 === 0) {
- await this.getList();
- }
- },
- // 全选购物车商品
- async selectAll(flag2) {
- const {
- code: code2
- } = await CartApi.updateCartSelected({
- ids: this.list.map((item) => item.id),
- selected: flag2
- });
- if (code2 === 0) {
- await this.getList();
- }
- },
- // 清空购物车。注意,仅用于用户退出时,重置数据
- emptyList() {
- this.list = [];
- this.selectedIds = [];
- this.isAllSelected = true;
- this.totalPriceSelected = 0;
- }
- },
- persist: {
- enabled: true,
- strategies: [{
- key: "cart-store"
- }]
- }
- });
- const __vite_glob_0_1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: cart
- }, Symbol.toStringTag, { value: "Module" }));
- const UserApi = {
- // 获得基本信息
- getUserInfo: () => {
- return request$1({
- url: "/member/user/get",
- method: "GET",
- custom: {
- showLoading: false,
- auth: true
- }
- });
- },
- // 修改基本信息
- updateUser: (data) => {
- return request$1({
- url: "/member/user/update",
- method: "PUT",
- data,
- custom: {
- auth: true,
- showSuccess: true,
- successMsg: t$6("common.update_success")
- }
- });
- },
- updateUserAlipayAccount: (data) => {
- return request$1({
- url: "/member/user/updateByAlipayAccount",
- method: "PUT",
- data,
- custom: {
- auth: true,
- showSuccess: true,
- successMsg: t$6("common.update_success")
- }
- });
- },
- updateUserBankAccount: (data) => {
- return request$1({
- url: "/member/user/updateByBankAccount",
- method: "PUT",
- data,
- custom: {
- auth: true,
- showSuccess: true,
- successMsg: t$6("common.update_success")
- }
- });
- },
- // 修改用户手机
- updateUserMobile: (data) => {
- return request$1({
- url: "/member/user/update-mobile",
- method: "PUT",
- data,
- custom: {
- loadingMsg: t$6("common.verifying"),
- showSuccess: true,
- successMsg: t$6("account.modification_successful")
- }
- });
- },
- // 基于微信小程序的授权码,修改用户手机
- updateUserMobileByWeixin: (code2) => {
- return request$1({
- url: "/member/user/update-mobile-by-weixin",
- method: "PUT",
- data: {
- code: code2
- },
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.fetching"),
- successMsg: t$6("account.modification_successful")
- }
- });
- },
- // 修改密码
- updateUserPassword: (data) => {
- return request$1({
- url: "/member/user/update-password",
- method: "PUT",
- data,
- custom: {
- loadingMsg: t$6("common.verifying"),
- showSuccess: true,
- successMsg: t$6("account.modification_successful")
- }
- });
- },
- // 重置密码
- resetUserPassword: (data) => {
- return request$1({
- url: "/member/user/reset-password",
- method: "PUT",
- data,
- custom: {
- loadingMsg: t$6("common.verifying"),
- showSuccess: true,
- successMsg: t$6("account.modification_successful")
- }
- });
- },
- // 更新安卓用户的极光id
- updateAndroidJiGuangId: (registerId) => {
- return request$1({
- url: "/member/user/addRegisterId?registerId=" + registerId,
- method: "PUT",
- custom: {
- showSuccess: false
- }
- });
- }
- };
- const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: UserApi
- }, Symbol.toStringTag, { value: "Module" }));
- const PayWalletApi = {
- // 获取钱包
- getPayWallet() {
- return request$1({
- url: "/pay/wallet/get",
- method: "GET",
- custom: {
- showLoading: false,
- auth: true
- }
- });
- },
- // 获得佣金等基本信息
- getDuserInfo: () => {
- return request$1({
- url: "/distri/duser/getDuserInfo",
- method: "GET",
- custom: {
- showLoading: false,
- auth: true
- }
- });
- },
- // 获得钱包流水分页
- getWalletTransactionPage: (params) => {
- const queryString = Object.keys(params).map((key) => encodeURIComponent(key) + "=" + params[key]).join("&");
- return request$1({
- url: `/pay/wallet-transaction/page?${queryString}`,
- method: "GET"
- });
- },
- // 获得钱包流水统计
- getWalletTransactionSummary: (params) => {
- const queryString = `createTime=${params.createTime[0]}&createTime=${params.createTime[1]}`;
- return request$1({
- url: `/pay/wallet-transaction/get-summary?${queryString}`,
- // url: `/pay/wallet-transaction/get-summary`,
- method: "GET"
- // params: params
- });
- },
- // 获得钱包充值套餐列表
- getWalletRechargePackageList: () => {
- return request$1({
- url: "/pay/wallet-recharge-package/list",
- method: "GET",
- custom: {
- showError: false,
- showLoading: false
- }
- });
- },
- // 创建钱包充值记录(发起充值)
- createWalletRecharge: (data) => {
- return request$1({
- url: "/pay/wallet-recharge/create",
- method: "POST",
- data
- });
- },
- // 消费分充值
- topupConsumptionPointsCreate: (data) => {
- return request$1({
- url: "/distri/user-top-up-consumption-points-order/create",
- method: "POST",
- data,
- custom: {
- showError: true,
- showLoading: true
- }
- });
- },
- // 获得钱包充值记录分页
- getWalletRechargePage: (params) => {
- return request$1({
- url: "/pay/wallet-recharge/page",
- method: "GET",
- params,
- custom: {
- showError: false,
- showLoading: false
- }
- });
- },
- // 创建提现申请记录
- createWithdrawal: (data) => {
- return request$1({
- url: "/distri/application-for-withdrawal/create",
- method: "POST",
- data
- });
- }
- };
- const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: PayWalletApi
- }, Symbol.toStringTag, { value: "Module" }));
- const OrderApi = {
- // 计算订单信息
- settlementOrder: (data) => {
- const data2 = {
- ...data
- };
- if (!(data.couponId > 0)) {
- delete data2.couponId;
- }
- if (!(data.addressId > 0)) {
- delete data2.addressId;
- }
- if (!data.combinationActivityId > 0) {
- delete data2.combinationActivityId;
- }
- if (!(data.combinationHeadId > 0)) {
- delete data2.combinationHeadId;
- }
- if (!(data.seckillActivityId > 0)) {
- delete data2.seckillActivityId;
- }
- delete data2.items;
- for (let i2 = 0; i2 < data.items.length; i2++) {
- data2[encodeURIComponent("items[" + i2 + "].skuId")] = data.items[i2].skuId + "";
- data2[encodeURIComponent("items[" + i2 + "].count")] = data.items[i2].count + "";
- if (data.items[i2].cartId) {
- data2[encodeURIComponent("items[" + i2 + "].cartId")] = data.items[i2].cartId + "";
- }
- }
- const queryString = Object.keys(data2).map((key) => key + "=" + data2[key]).join("&");
- return request$1({
- url: `/trade/order/settlement?${queryString}`,
- method: "GET",
- custom: {
- showError: true,
- showLoading: true
- }
- });
- },
- // 创建订单
- createOrder: (data) => {
- return request$1({
- url: `/trade/order/create`,
- method: "POST",
- data
- });
- },
- // 获得订单
- getOrder: (id) => {
- return request$1({
- url: `/trade/order/get-detail`,
- method: "GET",
- params: {
- id
- },
- custom: {
- showLoading: false
- }
- });
- },
- // 订单列表
- getOrderPage: (params) => {
- return request$1({
- url: "/trade/order/page",
- method: "GET",
- params,
- custom: {
- showLoading: false
- }
- });
- },
- // 确认收货
- receiveOrder: (id) => {
- return request$1({
- url: `/trade/order/receive`,
- method: "PUT",
- params: {
- id
- }
- });
- },
- // 取消订单
- cancelOrder: (id) => {
- return request$1({
- url: `/trade/order/cancel`,
- method: "DELETE",
- params: {
- id
- }
- });
- },
- // 删除订单
- deleteOrder: (id) => {
- return request$1({
- url: `/trade/order/delete`,
- method: "DELETE",
- params: {
- id
- }
- });
- },
- // 获得交易订单的物流轨迹
- getOrderExpressTrackList: (id) => {
- return request$1({
- url: `/trade/order/get-express-track-list`,
- method: "GET",
- params: {
- id
- }
- });
- },
- // 获得交易订单数量
- getOrderCount: () => {
- return request$1({
- url: "/trade/order/get-count",
- method: "GET",
- custom: {
- showLoading: false,
- auth: true
- }
- });
- },
- // 创建单个评论
- createOrderItemComment: (data) => {
- return request$1({
- url: `/trade/order/item/create-comment`,
- method: "POST",
- data
- });
- }
- };
- const __vite_glob_0_41 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: OrderApi
- }, Symbol.toStringTag, { value: "Module" }));
- const CouponApi = {
- // 获得优惠劵模板列表
- getCouponTemplateListByIds: (ids) => {
- return request$1({
- url: "/promotion/coupon-template/list-by-ids",
- method: "GET",
- params: { ids },
- custom: {
- showLoading: false,
- // 不展示 Loading,避免领取优惠劵时,不成功提示
- showError: false
- }
- });
- },
- // 获得优惠劵模版列表
- getCouponTemplateList: (spuId, productScope, count) => {
- return request$1({
- url: "/promotion/coupon-template/list",
- method: "GET",
- params: { spuId, productScope, count }
- });
- },
- // 获得优惠劵模版分页
- getCouponTemplatePage: (params) => {
- return request$1({
- url: "/promotion/coupon-template/page",
- method: "GET",
- params
- });
- },
- // 获得优惠劵模版
- getCouponTemplate: (id) => {
- return request$1({
- url: "/promotion/coupon-template/get",
- method: "GET",
- params: { id }
- });
- },
- // 我的优惠劵列表
- getCouponPage: (params) => {
- return request$1({
- url: "/promotion/coupon/page",
- method: "GET",
- params
- });
- },
- // 领取优惠券
- takeCoupon: (templateId) => {
- return request$1({
- url: "/promotion/coupon/take",
- method: "POST",
- data: { templateId },
- custom: {
- auth: true,
- showLoading: true,
- loadingMsg: t$6("common.claiming"),
- showSuccess: true,
- successMsg: t$6("common.claim_success")
- }
- });
- },
- // 获得优惠劵
- getCoupon: (id) => {
- return request$1({
- url: "/promotion/coupon/get",
- method: "GET",
- params: { id }
- });
- },
- // 获得未使用的优惠劵数量
- getUnusedCouponCount: () => {
- return request$1({
- url: "/promotion/coupon/get-unused-count",
- method: "GET",
- custom: {
- showLoading: false,
- auth: true
- }
- });
- },
- // 获得匹配指定商品的优惠劵列表
- getMatchCouponList: (price, spuIds, skuIds, categoryIds) => {
- return request$1({
- url: "/promotion/coupon/match-list",
- method: "GET",
- params: {
- price,
- spuIds: spuIds.join(","),
- skuIds: skuIds.join(","),
- categoryIds: categoryIds.join(",")
- },
- custom: {
- showError: false,
- showLoading: false
- // 避免影响 settlementOrder 结算的结果
- }
- });
- }
- };
- const __vite_glob_0_28 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: CouponApi
- }, Symbol.toStringTag, { value: "Module" }));
- const userInfo = vue.computed(() => sheep$1.$store("user").userInfo);
- function isBetaUser() {
- const username2 = userInfo.value.username;
- return username2 === "ru10" || username2 === "迷鹿" || username2 === "非繁";
- }
- function isAndroid() {
- return window.Android && window.Android.getIdentifier();
- }
- function getAndroidJiGuangId() {
- return window.Android && window.Android.getRegistrationID();
- }
- const android = vue.computed(() => isAndroid());
- const androidJiGuangId = vue.computed(() => getAndroidJiGuangId());
- const defaultUserInfo = {
- avatar: "",
- // 头像
- nickname: "",
- // 昵称
- gender: 0,
- // 性别
- mobile: "",
- // 手机号
- point: 0,
- // 佣金
- username: "",
- //用户名
- socialStatusLevel: "",
- socialStatusLevelName: "",
- socialStatusPoint: 0,
- socialUpNeed: 0
- };
- const defaultUserWallet = {
- integralDO: {
- currentQuota: 0,
- // 当前佣金
- highQuota: 0,
- //最高佣金
- freezeQuota: 0,
- //冻结佣金
- consumptionPoints: 0
- //消费分
- },
- descNo: 0,
- //用户直推人人数
- descPrice: 0,
- //团队昨日贡献值
- descTotalPrice: 0
- // 团队历史总贡献值
- };
- const defaultNumData = {
- unusedCouponCount: 0,
- orderCount: {
- allCount: 0,
- unpaidCount: 0,
- undeliveredCount: 0,
- deliveredCount: 0,
- uncommentedCount: 0,
- afterSaleCount: 0
- }
- };
- const user$1 = defineStore({
- id: "user",
- state: () => ({
- userInfo: lodashExports.clone(defaultUserInfo),
- // 用户信息
- userWallet: lodashExports.clone(defaultUserWallet),
- // 用户钱包信息
- isLogin: !!uni.getStorageSync("token"),
- // 登录状态
- numData: lodashExports.cloneDeep(defaultNumData),
- // 用户其他数据
- lastUpdateTime: 0
- // 上次更新时间
- }),
- actions: {
- // 获取用户信息
- async getInfo() {
- const {
- code: code2,
- data
- } = await UserApi.getUserInfo();
- if (code2 !== 0) {
- return;
- }
- this.userInfo = data;
- return Promise.resolve(data);
- },
- // 获得用户钱包
- async getWallet() {
- const {
- code: code2,
- data
- } = await PayWalletApi.getDuserInfo();
- if (code2 !== 0) {
- return;
- }
- if (android.value) {
- if (!data.androidRegisterId || data.androidRegisterId !== androidJiGuangId.value) {
- await UserApi.updateAndroidJiGuangId(androidJiGuangId.value);
- }
- }
- this.userWallet = data;
- this.userWallet.descNo = data.descNo + 1;
- uni.setStorageSync("isSign", data.isSign);
- },
- // 获取订单、优惠券等其他资产信息
- getNumData() {
- OrderApi.getOrderCount().then((res) => {
- if (res.code === 0) {
- this.numData.orderCount = res.data;
- }
- });
- CouponApi.getUnusedCouponCount().then((res) => {
- if (res.code === 0) {
- this.numData.unusedCouponCount = res.data;
- }
- });
- },
- // 添加分享记录
- // TODO 非繁人:整理下;
- async addShareLog(params) {
- const {
- error: error2
- } = await userApi.addShareLog(params);
- if (error2 === 0)
- uni.removeStorageSync("shareLog");
- },
- // 设置 token
- async setToken(token = "", refreshToken2 = "") {
- if (token === "") {
- this.isLogin = false;
- uni.removeStorageSync("token");
- uni.removeStorageSync("refresh-token");
- } else {
- this.isLogin = true;
- uni.setStorageSync("token", token);
- uni.setStorageSync("refresh-token", refreshToken2);
- await this.loginAfter();
- if (!this.userInfo.language) {
- const language = uni.getStorageSync("userLanguage");
- await UserApi.updateUser({ language });
- setLanguage(language);
- } else {
- setLanguage(this.userInfo.language);
- }
- const openid = await sheep$1.$platform.useProvider("wechat").getOpenid(true);
- if (!openid) {
- uni.showModal({
- title: t$6("common.letcgo"),
- content: t$6("common.not_bound_wechat"),
- confirmText: t$6("common.bind"),
- success: function(res) {
- if (res.confirm) {
- sheep$1.$platform.useProvider("wechat").bind();
- }
- }
- });
- }
- }
- return this.isLogin;
- },
- // 更新用户相关信息 (手动限流,5 秒之内不刷新)
- async updateUserData() {
- if (!this.isLogin) {
- this.resetUserData();
- return;
- }
- const nowTime = (/* @__PURE__ */ new Date()).getTime();
- if (this.lastUpdateTime + 5e3 > nowTime) {
- return;
- }
- this.lastUpdateTime = nowTime;
- await this.getInfo();
- this.getWallet();
- this.getNumData();
- return this.userInfo;
- },
- // 重置用户默认数据
- resetUserData() {
- this.setToken();
- this.userInfo = lodashExports.clone(defaultUserInfo);
- this.userWallet = lodashExports.clone(defaultUserWallet);
- this.numData = lodashExports.cloneDeep(defaultNumData);
- cart().emptyList();
- cancelAutoSign();
- uni.removeStorageSync("isSign");
- uni.removeStorageSync("openid");
- },
- // 登录后,加载各种信息
- // TODO 非繁人:整理下;
- async loginAfter() {
- await this.updateUserData();
- cart().getList();
- $share.getShareInfo();
- autoSign();
- const shareLog = uni.getStorageSync("shareLog");
- if (!lodashExports.isEmpty(shareLog)) {
- this.addShareLog({
- ...shareLog
- });
- }
- setTimeout(async () => {
- const openid = await sheep$1.$platform.useProvider("wechat").getOpenid(true);
- if (!this.userInfo.subscribe && openid) {
- showSubscribeModal();
- }
- }, 800);
- },
- // 登出系统
- async logout() {
- this.resetUserData();
- return !this.isLogin;
- }
- },
- persist: {
- enabled: true,
- strategies: [{
- key: "user-store"
- }]
- }
- });
- const __vite_glob_0_4$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: user$1
- }, Symbol.toStringTag, { value: "Module" }));
- const sys = defineStore({
- id: "sys",
- state: () => ({
- theme: "",
- // 主题,
- mode: "light",
- // 明亮模式、暗黑模式(暂未支持)
- modeAuto: false,
- // 跟随系统
- fontSize: 1
- // 设置默认字号等级(0-4)
- }),
- getters: {},
- actions: {
- setTheme(theme = "") {
- var _a2;
- if (theme === "") {
- this.theme = ((_a2 = app$1().template) == null ? void 0 : _a2.basic.theme) || "orange";
- } else {
- this.theme = theme;
- }
- }
- },
- persist: {
- enabled: true,
- strategies: [
- {
- key: "sys-store"
- }
- ]
- }
- });
- const __vite_glob_0_3$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: sys
- }, Symbol.toStringTag, { value: "Module" }));
- const app$1 = defineStore({
- id: "app",
- state: () => ({
- info: {
- // 应用信息
- name: "",
- // 商城名称
- logo: "",
- // logo
- version: "",
- // 版本号
- copyright: "",
- // 版权信息 I
- copytime: "",
- // 版权信息 II
- cdnurl: "",
- // 云存储域名
- filesystem: ""
- // 云存储平台
- },
- platform: {
- share: {
- methods: [],
- // 支持的分享方式
- forwardInfo: {},
- // 默认转发信息
- posterInfo: {},
- // 海报信息
- linkAddress: ""
- // 复制链接地址
- },
- bind_mobile: 0
- // 登陆后绑定手机号提醒 (弱提醒,可手动关闭)
- },
- chat: {},
- template: {
- // 店铺装修模板
- basic: {},
- // 基本信息
- home: {
- // 首页模板
- style: {},
- data: []
- },
- user: {
- // 个人中心模板
- style: {},
- data: []
- }
- },
- shareInfo: {},
- // 全局分享信息
- has_wechat_trade_managed: 0
- // 小程序发货信息管理 0 没有 || 1 有
- }),
- actions: {
- // 获取Shopro应用配置和模板
- async init(templateId = null) {
- const networkStatus = await _platform.checkNetwork();
- if (!networkStatus) {
- $router.error("NetworkError");
- }
- await adaptTemplate(this.template, templateId);
- {
- this.info = {
- name: "常来此购",
- logo: "/static/zxlogo.png",
- version: "1.1.13",
- copyright: "全部开源,个人与企业可 100% 免费使用",
- copytime: "Copyright© 2018-2024",
- cdnurl: "https://file.sheepjs.com",
- // 云存储域名
- filesystem: "qcloud"
- // 云存储平台
- };
- this.platform = {
- share: {
- methods: ["poster", "link"],
- // linkAddress: "http://localhost/#/", //跳转链接
- linkAddress: "https://zxgz.newfeifan.cn/#/",
- //跳转链接
- posterInfo: {
- "user_bg": "/static/user-poster-bg.jpg",
- "goods_bg": "/static/user-poster-bg.jpg",
- "groupon_bg": "/static/img/shop/config/groupon-poster-bg.png"
- }
- },
- bind_mobile: 0
- };
- this.chat = {
- chat_domain: "https://api.shopro.sheepjs.com/chat",
- room_id: "admin"
- };
- this.has_wechat_trade_managed = 0;
- const sysStore = sys();
- sysStore.setTheme();
- const userStore = user$1();
- if (userStore.isLogin) {
- userStore.loginAfter();
- }
- return Promise.resolve(true);
- }
- }
- },
- persist: {
- enabled: true,
- strategies: [{
- key: "app-store"
- }]
- }
- });
- const adaptTemplate = async (appTemplate, templateId) => {
- var _a2;
- const {
- data: diyTemplate
- } = templateId ? await DiyApi.getDiyTemplate(templateId) : await DiyApi.getUsedDiyTemplate();
- if (!diyTemplate) {
- $router.error("TemplateError");
- return;
- }
- const tabBar2 = (_a2 = diyTemplate == null ? void 0 : diyTemplate.property) == null ? void 0 : _a2.tabBar;
- if (tabBar2) {
- appTemplate.basic.tabbar = tabBar2;
- if (tabBar2 == null ? void 0 : tabBar2.theme) {
- appTemplate.basic.theme = tabBar2 == null ? void 0 : tabBar2.theme;
- }
- }
- appTemplate.home = diyTemplate == null ? void 0 : diyTemplate.home;
- appTemplate.user = diyTemplate == null ? void 0 : diyTemplate.user;
- };
- const __vite_glob_0_0$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: app$1
- }, Symbol.toStringTag, { value: "Module" }));
- const modal = defineStore({
- id: "modal",
- state: () => ({
- auth: "",
- // 授权弹框 accountLogin|smsLogin|resetPassword|changeMobile|changePassword|changeUsername
- isActive: "",
- share: false,
- // 分享弹框
- shareInfo: {
- spuId: 0
- },
- // 分享弹框信息
- signUp: false,
- // 签到弹框
- signUpInfo: {},
- // 签到弹框信息
- subscribe: false,
- // 关注弹框
- getWallet: false,
- // 获得佣金/身价弹窗
- getWalletInfo: {
- points: 0,
- socialStatus: 0
- },
- // 获得佣金/身价弹窗信息
- menu: false,
- // 快捷菜单弹框
- advHistory: [],
- // 广告弹框记录
- lastTimer: {
- // 短信验证码计时器,为了防止刷新请求做了持久化
- smsLogin: 0,
- // changeMobile: 0,
- changeMobileOld: 0,
- changeMobileNew: 0,
- resetPassword: 0,
- changePassword: 0,
- consumptionTransfers: 0,
- zeroBuy: 0
- }
- }),
- persist: {
- enabled: true,
- strategies: [
- {
- key: "modal-store",
- paths: ["lastTimer", "advHistory"]
- }
- ]
- }
- });
- const __vite_glob_0_2$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: modal
- }, Symbol.toStringTag, { value: "Module" }));
- var _a, _b;
- const isH5 = typeof uni !== "undefined" ? ["web", "h5", void 0].includes((_b = (_a = uni == null ? void 0 : uni.getSystemInfoSync()) == null ? void 0 : _a.uniPlatform) == null ? void 0 : _b.toLocaleLowerCase()) : true;
- const updateStorage = (strategy, store, options2) => {
- const storage = strategy.storage;
- const storeKey = strategy.key || store.$id;
- const isCustomStorage = isH5 || (options2 == null ? void 0 : options2.enforceCustomStorage);
- if (strategy.paths) {
- const partialState = strategy.paths.reduce((finalObj, key) => {
- finalObj[key] = store.$state[key];
- return finalObj;
- }, {});
- if (isCustomStorage && storage) {
- storage.setItem(storeKey, JSON.stringify(partialState));
- } else {
- uni.setStorage({ key: storeKey, data: JSON.stringify(partialState) });
- }
- } else if (isCustomStorage && storage) {
- storage.setItem(storeKey, JSON.stringify(store.$state));
- } else {
- uni.setStorage({ key: storeKey, data: JSON.stringify(store.$state) });
- }
- };
- var index = ({ options: options2, store }) => {
- var _a2, _b2, _c, _d, _e2, _f;
- if ((_a2 = options2.persist) == null ? void 0 : _a2.enabled) {
- const defaultStrat = [
- {
- key: store.$id,
- storage: ((_b2 = options2.persist) == null ? void 0 : _b2.H5Storage) || (window == null ? void 0 : window.sessionStorage)
- }
- ];
- const strategies = ((_d = (_c = options2.persist) == null ? void 0 : _c.strategies) == null ? void 0 : _d.length) ? (_e2 = options2.persist) == null ? void 0 : _e2.strategies : defaultStrat;
- strategies.forEach((strategy) => {
- var _a3, _b3;
- const storage = strategy.storage || ((_a3 = options2.persist) == null ? void 0 : _a3.H5Storage) || (window == null ? void 0 : window.sessionStorage);
- const storeKey = strategy.key || store.$id;
- let storageResult;
- if (isH5 || ((_b3 = options2.persist) == null ? void 0 : _b3.enforceCustomStorage)) {
- storageResult = storage.getItem(storeKey);
- } else {
- storageResult = uni.getStorageSync(storeKey);
- }
- if (storageResult) {
- store.$patch(JSON.parse(storageResult));
- updateStorage(strategy, store, options2.persist);
- }
- });
- store.$subscribe(() => {
- strategies.forEach((strategy) => {
- updateStorage(strategy, store, options2.persist);
- });
- }, { detached: ((_f = options2.persist) == null ? void 0 : _f.detached) ? true : false });
- }
- };
- const files$2 = /* @__PURE__ */ Object.assign({ "./app.js": __vite_glob_0_0$1, "./cart.js": __vite_glob_0_1$1, "./modal.js": __vite_glob_0_2$1, "./sys.js": __vite_glob_0_3$1, "./user.js": __vite_glob_0_4$1 });
- const modules = {};
- Object.keys(files$2).forEach((key) => {
- modules[key.replace(/(.*\/)*([^.]+).*/gi, "$2")] = files$2[key].default;
- });
- const setupPinia = (app2) => {
- const pinia = createPinia();
- pinia.use(index);
- app2.use(pinia);
- };
- const $store = (name2) => {
- return modules[name2]();
- };
- const options = {
- // 显示操作成功消息 默认不显示
- showSuccess: false,
- // 成功提醒 默认使用后端返回值
- successMsg: "",
- // 显示失败消息 默认显示
- showError: true,
- // 失败提醒 默认使用后端返回信息
- errorMsg: "",
- // 显示请求时loading模态框 默认显示
- showLoading: true,
- // loading提醒文字
- loadingMsg: t$6("common.loading"),
- // 需要授权才能请求 默认放开
- auth: false
- // ...
- };
- let LoadingInstance = {
- target: null,
- count: 0
- };
- function closeLoading() {
- if (LoadingInstance.count > 0)
- LoadingInstance.count--;
- if (LoadingInstance.count === 0)
- uni.hideLoading();
- }
- const http = new Request$1({
- baseURL: baseUrl + apiPath,
- timeout: 8e3,
- method: "GET",
- header: {
- Accept: "text/json",
- "Content-Type": "application/json;charset=UTF-8",
- platform: _platform.name,
- "Accept-Language": uni.getStorageSync("userLanguage") || uni.getLocale()
- },
- sslVerify: false,
- custom: options
- });
- http.interceptors.request.use(
- (config2) => {
- if (config2.custom.auth && !$store("user").isLogin) {
- showAuthModal();
- return Promise.reject();
- }
- if (config2.custom.showLoading) {
- LoadingInstance.count++;
- LoadingInstance.count === 1 && uni.showLoading({
- title: config2.custom.loadingMsg,
- mask: true,
- fail: () => {
- uni.hideLoading();
- }
- });
- }
- const token = getAccessToken();
- if (token) {
- config2.header["Authorization"] = token;
- }
- config2.header["Accept"] = "*/*";
- config2.header["tenant-id"] = "1";
- config2.header["terminal"] = "20";
- return config2;
- },
- (error2) => {
- return Promise.reject(error2);
- }
- );
- http.interceptors.response.use(
- (response) => {
- var _a2, _b2;
- if (response.config.url.indexOf("/member/auth/") >= 0 && ((_b2 = (_a2 = response.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.accessToken)) {
- $store("user").setToken(response.data.data.accessToken, response.data.data.refreshToken);
- }
- response.config.custom.showLoading && closeLoading();
- if (response.data.code !== 0) {
- if (response.data.code === 401) {
- cancelAutoSign();
- return refreshToken(response.config);
- }
- if (response.config.custom.showError) {
- cancelAutoSign();
- uni.showToast({
- title: response.data.msg || t$6("common.server_error_try_later"),
- icon: "none",
- mask: true
- });
- }
- }
- if (response.config.custom.showSuccess && response.config.custom.successMsg !== "" && response.data.code === 0) {
- uni.showToast({
- title: response.config.custom.successMsg,
- icon: "none"
- });
- }
- return Promise.resolve(response.data);
- },
- (error2) => {
- var _a2;
- formatAppLog("log", "at sheep/request/index.js:159", "服务器开小差");
- cancelAutoSign();
- const userStore = $store("user");
- const isLogin = userStore.isLogin;
- let errorMessage = t$6("common.network_request_error");
- if (error2 !== void 0) {
- switch (error2.statusCode) {
- case 400:
- errorMessage = t$6("common.request_error");
- break;
- case 401:
- errorMessage = isLogin ? t$6("common.login_expired") : t$6("common.please_login");
- break;
- case 403:
- errorMessage = t$6("common.access_denied");
- break;
- case 404:
- errorMessage = t$6("common.request_error");
- break;
- case 408:
- errorMessage = t$6("common.request_timeout");
- break;
- case 429:
- errorMessage = t$6("common.frequent_requests");
- break;
- case 500:
- errorMessage = t$6("common.server_error_try_later");
- break;
- case 501:
- errorMessage = t$6("common.server_unavailable");
- break;
- case 502:
- errorMessage = t$6("common.network_error");
- break;
- case 503:
- errorMessage = t$6("common.service_unavailable");
- break;
- case 504:
- errorMessage = t$6("common.network_timeout");
- break;
- case 505:
- errorMessage = t$6("common.http_not_supported");
- break;
- }
- if (error2.errMsg.includes("timeout"))
- errorMessage = t$6("common.request_timeout");
- }
- if (error2 && error2.config) {
- if (error2.config.custom.showError === false) {
- uni.showToast({
- title: ((_a2 = error2.data) == null ? void 0 : _a2.msg) || errorMessage,
- icon: "none",
- mask: true
- });
- }
- error2.config.custom.showLoading && closeLoading();
- }
- return false;
- }
- );
- let requestList = [];
- let isRefreshToken = false;
- const refreshToken = async (config2) => {
- if (config2.url.indexOf("/member/auth/refresh-token") >= 0) {
- return Promise.reject("error");
- }
- if (!isRefreshToken) {
- isRefreshToken = true;
- const refreshToken2 = getRefreshToken();
- if (!refreshToken2) {
- return handleAuthorized();
- }
- try {
- const refreshTokenResult = await AuthUtil.refreshToken(refreshToken2);
- if (refreshTokenResult.code !== 0) {
- throw new Error("刷新令牌失败");
- }
- config2.header.Authorization = "Bearer " + getAccessToken();
- requestList.forEach((cb) => {
- cb();
- });
- requestList = [];
- return request(config2);
- } catch (e2) {
- requestList.forEach((cb) => {
- cb();
- });
- return handleAuthorized();
- } finally {
- requestList = [];
- isRefreshToken = false;
- }
- } else {
- return new Promise((resolve) => {
- requestList.push(() => {
- config2.header.Authorization = "Bearer " + getAccessToken();
- resolve(request(config2));
- });
- });
- }
- };
- const handleAuthorized = () => {
- const userStore = $store("user");
- userStore.logout(true);
- showAuthModal();
- return Promise.reject({
- code: 401,
- msg: userStore.isLogin ? t$6("common.login_expired") : t$6("common.please_login")
- });
- };
- const getAccessToken = () => {
- return uni.getStorageSync("token");
- };
- const getRefreshToken = () => {
- return uni.getStorageSync("refresh-token");
- };
- const request = (config2) => {
- return http.middleware(config2);
- };
- const request$1 = request;
- const ConsumptionApi = {
- // 获取消费分记录
- getConsumptionLog: (params) => {
- return request$1({
- url: "/distri/consumption-change-log/page",
- method: "GET",
- params,
- custom: {
- showLoading: true,
- showError: true
- }
- });
- },
- // 消费分转让
- createConsumptionLog: (data) => {
- return request$1({
- url: "/distri/consumption-transfer-log/create",
- method: "POST",
- data,
- custom: {
- showLoading: true,
- showError: true
- }
- });
- },
- // 获取消费分转让记录
- getConsumptionTransfersLog: (params) => {
- return request$1({
- url: "/distri/consumption-transfer-log/page",
- method: "GET",
- params,
- custom: {
- showLoading: true,
- showError: true
- }
- });
- },
- quotaTransition: (quota) => {
- return request$1({
- url: "/distri/integral/quotaTransition?quota=" + quota,
- method: "PUT",
- custom: {
- showLoading: true,
- showError: true
- }
- });
- }
- };
- const __vite_glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: ConsumptionApi
- }, Symbol.toStringTag, { value: "Module" }));
- const ScoreApi = {
- getScoreApi: (params) => {
- return request$1({
- url: "/distri/pt-profit-log/page",
- method: "GET",
- params,
- custom: {
- showLoading: false,
- showError: false
- }
- });
- },
- getMaxScoreList: (params) => {
- return request$1({
- url: "/distri/pt-profit-log/getMaxAmountPage",
- method: "GET",
- params,
- custom: {
- showLoading: false,
- showError: false
- }
- });
- }
- };
- const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: ScoreApi
- }, Symbol.toStringTag, { value: "Module" }));
- const ShareApi = {
- // 查询商品linkId
- getLinkId: (category, objectId) => {
- return request$1({
- url: "/distri/share-link/getShareLink",
- method: "GET",
- params: { category, objectId },
- custom: {
- showLoading: false,
- showError: false
- }
- });
- },
- // 根据linkId查id
- getObjectIdByLinkId: (linkId) => {
- return request$1({
- url: "/distri/share-link/getObjectIdByLinkId",
- method: "GET",
- params: { linkId },
- custom: {
- showLoading: false,
- showError: false
- }
- });
- }
- };
- const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: ShareApi
- }, Symbol.toStringTag, { value: "Module" }));
- const TeamApi = {
- // 查询商品linkId
- getTeam: (params) => {
- return request$1({
- url: "/distri/share-path/getTeam",
- method: "GET",
- params,
- custom: {
- showLoading: true,
- showError: false
- }
- });
- }
- };
- const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: TeamApi
- }, Symbol.toStringTag, { value: "Module" }));
- const WithdrawalApi = {
- getWithdrawalPage: (params) => {
- return request$1({
- url: "/distri/application-for-withdrawal/page",
- method: "GET",
- params,
- custom: {
- showLoading: false,
- showError: false
- }
- });
- },
- // 获得提现比例
- getWithdrawalPercentage: (params) => {
- return request$1({
- url: "/distri/order-percentage/get",
- method: "GET",
- params,
- custom: {
- showLoading: false,
- showError: false
- }
- });
- }
- };
- const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: WithdrawalApi
- }, Symbol.toStringTag, { value: "Module" }));
- const FileApi = {
- // 上传文件
- uploadFile: (file) => {
- uni.getStorageSync("token");
- uni.showLoading({
- title: t$6("common.uploading")
- });
- return new Promise((resolve, reject) => {
- uni.uploadFile({
- url: baseUrl + apiPath + "/infra/file/upload",
- filePath: file,
- name: "file",
- header: {
- // Accept: 'text/json',
- Accept: "*/*",
- "tenant-id": "1"
- // Authorization: 'Bearer test247',
- },
- success: (uploadFileRes) => {
- let result2 = JSON.parse(uploadFileRes.data);
- if (result2.error === 1) {
- uni.showToast({
- icon: "none",
- title: result2.msg
- });
- } else {
- return resolve(result2);
- }
- },
- fail: (error2) => {
- formatAppLog("log", "at sheep/api/infra/file.js:40", "上传失败:", error2);
- return resolve(false);
- },
- complete: () => {
- uni.hideLoading();
- }
- });
- });
- },
- // 通过图片url获得文件流
- getFileIO: async (fileUrl) => {
- const response = await fetch("https://zxgz.newfeifan.cn/app-api/infra/file/downloadByUrl?fileUrl=" + fileUrl, { method: "GET" });
- if (!response.ok) {
- throw new Error("网络响应不是OK状态");
- }
- const blob = await response.blob();
- return blob;
- }
- };
- const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: FileApi
- }, Symbol.toStringTag, { value: "Module" }));
- const AddressApi = {
- // 获得用户收件地址列表
- getAddressList: (addressType = 1) => {
- return request$1({
- url: "/member/address/list",
- method: "GET",
- params: { addressType }
- });
- },
- // 创建用户收件地址
- createAddress: (data) => {
- return request$1({
- url: "/member/address/create",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- successMsg: t$6("common.save_success")
- }
- });
- },
- // 更新用户收件地址
- updateAddress: (data) => {
- return request$1({
- url: "/member/address/update",
- method: "PUT",
- data,
- custom: {
- showSuccess: true,
- successMsg: t$6("common.update_success")
- }
- });
- },
- // 获得用户收件地址
- getAddress: (id, addressType = 1) => {
- formatAppLog("log", "at sheep/api/member/address.js:38", "123123", addressType);
- return request$1({
- url: "/member/address/get",
- method: "GET",
- params: { id, addressType }
- });
- },
- // 删除用户收件地址
- deleteAddress: (id, addressType = 1) => {
- return request$1({
- url: "/member/address/delete",
- method: "DELETE",
- params: { id, addressType }
- });
- }
- };
- const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: AddressApi
- }, Symbol.toStringTag, { value: "Module" }));
- const PointApi = {
- // 获得用户佣金记录分页
- getPointRecordPage: (params) => {
- if (params.addStatus === void 0) {
- delete params.addStatus;
- }
- const queryString = Object.keys(params).map((key) => encodeURIComponent(key) + "=" + params[key]).join("&");
- return request$1({
- url: `/member/point/record/page?${queryString}`,
- method: "GET"
- });
- }
- };
- const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: PointApi
- }, Symbol.toStringTag, { value: "Module" }));
- const app = {
- //小程序直播
- mplive: {
- getRoomList: (ids) => request$1({
- url: "app/mplive/getRoomList",
- method: "GET",
- params: {
- ids: ids.join(",")
- }
- }),
- getMpLink: () => request$1({
- url: "app/mplive/getMpLink",
- method: "GET"
- })
- }
- };
- const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: app
- }, Symbol.toStringTag, { value: "Module" }));
- const chat$1 = {
- // 获取聊天token
- unifiedToken: () => request$1({
- url: "unifiedToken",
- custom: {
- showError: false,
- showLoading: false
- }
- })
- };
- const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: chat$1
- }, Symbol.toStringTag, { value: "Module" }));
- const third$1 = {
- // 微信相关
- wechat: {
- // 小程序订阅消息
- subscribeTemplate: (params) => request$1({
- url: "third/wechat/subscribeTemplate",
- method: "GET",
- params: {
- platform: "miniProgram"
- },
- custom: {
- showError: false,
- showLoading: false
- }
- }),
- // 获取微信小程序码
- getWxacode: (path) => `${baseUrl}${apiPath}third/wechat/wxacode?platform=miniProgram&payload=${encodeURIComponent(
- JSON.stringify({
- path
- })
- )}`
- },
- // 苹果相关
- apple: {
- // 第三方登录
- login: (data) => request$1({
- url: "third/apple/login",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- loadingMsg: t$6("common.logging_in")
- }
- })
- }
- };
- const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: third$1
- }, Symbol.toStringTag, { value: "Module" }));
- const files$1 = /* @__PURE__ */ Object.assign({ "./app.js": __vite_glob_0_12, "./chat.js": __vite_glob_0_13, "./third.js": __vite_glob_0_15 });
- let api$1 = {};
- Object.keys(files$1).forEach((key) => {
- api$1 = {
- ...api$1,
- [key.replace(/(.*\/)*([^.]+).*/gi, "$2")]: files$1[key].default
- };
- });
- const api$2 = api$1;
- const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: api$2
- }, Symbol.toStringTag, { value: "Module" }));
- const PayChannelApi = {
- // 获得指定应用的开启的支付渠道编码列表
- getEnableChannelCodeList: (appId) => {
- return request$1({
- url: "/pay/channel/get-enable-code-list",
- method: "GET",
- params: { appId }
- });
- }
- };
- const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: PayChannelApi
- }, Symbol.toStringTag, { value: "Module" }));
- const CategoryApi = {
- // 查询分类列表
- getCategoryList: () => {
- return request$1({
- url: "/product/category/list",
- method: "GET"
- });
- },
- // 查询分类列表,指定编号
- getCategoryListByIds: (ids) => {
- return request$1({
- url: "/product/category/list-by-ids",
- method: "GET",
- params: { ids }
- });
- }
- };
- const __vite_glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: CategoryApi
- }, Symbol.toStringTag, { value: "Module" }));
- const CommentApi = {
- // 获得商品评价分页
- getCommentPage: (spuId, pageNo, pageSize, type) => {
- return request$1({
- url: "/product/comment/page",
- method: "GET",
- params: {
- spuId,
- pageNo,
- pageSize,
- type
- },
- custom: {
- showLoading: false,
- showError: false
- }
- });
- }
- };
- const __vite_glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: CommentApi
- }, Symbol.toStringTag, { value: "Module" }));
- const FavoriteApi = {
- // 获得商品收藏分页
- getFavoritePage: (data) => {
- return request$1({
- url: "/product/favorite/page",
- method: "GET",
- params: data
- });
- },
- // 检查是否收藏过商品
- isFavoriteExists: (spuId) => {
- return request$1({
- url: "/product/favorite/exits",
- method: "GET",
- params: {
- spuId
- }
- });
- },
- // 添加商品收藏
- createFavorite: (spuId) => {
- return request$1({
- url: "/product/favorite/create",
- method: "POST",
- data: {
- spuId
- },
- custom: {
- auth: true,
- showSuccess: true,
- successMsg: t$6("common.collect_success")
- }
- });
- },
- // 添加商品收藏时调用的加身价
- createCollectBefore: (spuId) => {
- return request$1({
- url: "/distri/user-collect-before/create",
- method: "POST",
- data: {
- productSpuId: spuId
- }
- });
- },
- // 取消商品收藏
- deleteFavorite: (spuId) => {
- return request$1({
- url: "/product/favorite/delete",
- method: "DELETE",
- data: {
- spuId
- },
- custom: {
- auth: true,
- showSuccess: true,
- successMsg: t$6("common.cancel_success")
- }
- });
- }
- };
- const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: FavoriteApi
- }, Symbol.toStringTag, { value: "Module" }));
- const SpuHistoryApi = {
- // 删除商品浏览记录
- deleteBrowseHistory: (spuIds) => {
- return request$1({
- url: "/product/browse-history/delete",
- method: "DELETE",
- data: { spuIds },
- custom: {
- showSuccess: true,
- successMsg: t$6("common.delete_success")
- }
- });
- },
- // 清空商品浏览记录
- cleanBrowseHistory: () => {
- return request$1({
- url: "/product/browse-history/clean",
- method: "DELETE",
- custom: {
- showSuccess: true,
- successMsg: t$6("common.clear_success")
- }
- });
- },
- // 获得商品浏览记录分页
- getBrowseHistoryPage: (data) => {
- return request$1({
- url: "/product/browse-history/page",
- method: "GET",
- data,
- custom: {
- showLoading: false
- }
- });
- }
- };
- const __vite_glob_0_22 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: SpuHistoryApi
- }, Symbol.toStringTag, { value: "Module" }));
- const SpuApi = {
- // 获得商品 SPU 列表
- getSpuListByIds: (ids) => {
- return request$1({
- url: "/product/spu/list-by-ids",
- method: "GET",
- params: { ids },
- custom: {
- showLoading: false,
- showError: false
- }
- });
- },
- // 获得商品 SPU 分页
- getSpuPage: (params) => {
- return request$1({
- url: "/product/spu/page",
- method: "GET",
- params,
- custom: {
- showLoading: false,
- showError: false
- }
- });
- },
- // 查询商品
- getSpuDetail: (id) => {
- return request$1({
- url: "/product/spu/get-detail",
- method: "GET",
- params: { id },
- custom: {
- showLoading: false,
- showError: false
- }
- });
- }
- };
- const __vite_glob_0_23 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: SpuApi
- }, Symbol.toStringTag, { value: "Module" }));
- const ActivityApi = {
- // 获得单个商品,近期参与的每个活动
- getActivityListBySpuId: (spuId) => {
- return request$1({
- url: "/promotion/activity/list-by-spu-id",
- method: "GET",
- params: {
- spuId
- }
- });
- }
- };
- const __vite_glob_0_24 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: ActivityApi
- }, Symbol.toStringTag, { value: "Module" }));
- const ArticleApi = {
- // 获得文章详情
- getArticle: (id, title) => {
- return request$1({
- url: "/promotion/article/get",
- method: "GET",
- params: { id, title }
- });
- },
- // 获得文章列表
- getHomeList: () => {
- return request$1({
- url: "/promotion/article/getHomeInfo",
- method: "GET"
- });
- },
- getArticleByCategory: (params) => {
- return request$1({
- url: "/promotion/article/page",
- method: "GET",
- params
- });
- }
- };
- const __vite_glob_0_25 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: ArticleApi
- }, Symbol.toStringTag, { value: "Module" }));
- const BargainApi = {
- // 获得砍价记录的概要信息
- getBargainRecordSummary: () => {
- return request$1({
- url: "/promotion/bargain-record/get-summary",
- method: "GET"
- });
- },
- // 获得砍价活动分页
- getBargainActivityPage: () => {
- return request$1({
- url: "/promotion/bargain-activity/page",
- method: "GET"
- });
- },
- // 获得砍价活动详情
- getBargainActivityDetail(params) {
- return request$1({
- url: "/promotion/bargain-activity/get-detail",
- method: "GET",
- params
- });
- }
- };
- const __vite_glob_0_26 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: BargainApi
- }, Symbol.toStringTag, { value: "Module" }));
- const CombinationApi = {
- // 获得拼团活动列表
- getCombinationActivityList: (count) => {
- return request$1({
- url: "/promotion/combination-activity/list",
- method: "GET",
- params: { count }
- });
- },
- // 获得拼团活动分页
- getCombinationActivityPage: (params) => {
- return request$1({
- url: "/promotion/combination-activity/page",
- method: "GET",
- params
- });
- },
- // 获得拼团活动明细
- getCombinationActivity: (id) => {
- return request$1({
- url: "/promotion/combination-activity/get-detail",
- method: "GET",
- params: {
- id
- }
- });
- },
- // 获得最近 n 条拼团记录(团长发起的)
- getHeadCombinationRecordList: (activityId, status, count) => {
- return request$1({
- url: "/promotion/combination-record/get-head-list",
- method: "GET",
- params: {
- activityId,
- status,
- count
- }
- });
- },
- // 获得我的拼团记录分页
- getCombinationRecordPage: (params) => {
- return request$1({
- url: "/promotion/combination-record/page",
- method: "GET",
- params
- });
- },
- // 获得拼团记录明细
- getCombinationRecordDetail: (id) => {
- return request$1({
- url: "/promotion/combination-record/get-detail",
- method: "GET",
- params: {
- id
- }
- });
- },
- // 获得拼团记录的概要信息
- getCombinationRecordSummary: () => {
- return request$1({
- url: "/promotion/combination-record/get-summary",
- method: "GET"
- });
- }
- };
- const __vite_glob_0_27 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: CombinationApi
- }, Symbol.toStringTag, { value: "Module" }));
- const PageApi = {
- // 获得页面
- getPage: (params) => {
- return request$1({
- url: "/promotion/diy-page/get",
- method: "GET",
- params
- });
- }
- };
- const __vite_glob_0_30 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: PageApi
- }, Symbol.toStringTag, { value: "Module" }));
- const RewardActivityApi = {
- // 获得满减送活动
- getRewardActivity: (id) => {
- return request$1({
- url: "/promotion/reward-activity/get",
- method: "GET",
- params: { id }
- });
- }
- };
- const __vite_glob_0_31 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: RewardActivityApi
- }, Symbol.toStringTag, { value: "Module" }));
- const SeckillApi = {
- // 获得秒杀时间段列表
- getSeckillConfigList: () => {
- return request$1({ url: "promotion/seckill-config/list", method: "GET" });
- },
- // 获得当前秒杀活动
- getNowSeckillActivity: () => {
- return request$1({ url: "promotion/seckill-activity/get-now", method: "GET" });
- },
- // 获得秒杀活动分页
- getSeckillActivityPage: (params) => {
- return request$1({ url: "promotion/seckill-activity/page", method: "GET", params });
- },
- /**
- * 获得秒杀活动明细
- * @param {number} id 秒杀活动编号
- * @return {*}
- */
- getSeckillActivity: (id) => {
- return request$1({
- url: "promotion/seckill-activity/get-detail",
- method: "GET",
- params: { id }
- });
- }
- };
- const __vite_glob_0_32 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: SeckillApi
- }, Symbol.toStringTag, { value: "Module" }));
- const SaleApi = {
- // 申请成为商户
- createMerchant: (data) => {
- return request$1({
- url: "/sale/merchant-apply/create",
- method: "POST",
- data,
- custom: {
- showSuccess: true,
- successMsg: t$6("common.apply_success")
- }
- });
- },
- // 获取商户信息
- getMerchant: () => {
- return request$1({
- url: "/sale/merchant-apply/get",
- method: "GET"
- });
- },
- // 变动商户信息
- updateMerchant: (data) => {
- return request$1({
- url: "/sale/merchant-apply/update",
- method: "PUT",
- data,
- custom: {
- showSuccess: true,
- successMsg: t$6("common.change_success")
- }
- });
- },
- getMerchantPage: (params) => {
- return request$1({
- url: "/sale/merchant-apply-log/page",
- method: "GET",
- params,
- custom: {
- showLoading: true
- }
- });
- },
- checkContactNumber: (params) => {
- return request$1({
- url: "/system/users/getUserMobile",
- method: "GET",
- params,
- custom: {
- showLoading: true
- }
- });
- },
- checkSystemUser: (params) => {
- return request$1({
- url: "/sale/merchant-apply/isSystemUserByMobile",
- method: "GET",
- params,
- custom: {
- showLoading: true
- }
- });
- }
- };
- const __vite_glob_0_33 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: SaleApi
- }, Symbol.toStringTag, { value: "Module" }));
- const AreaApi = {
- // 获得地区树
- getAreaTree: () => {
- return request$1({
- url: "/system/area/tree",
- method: "GET"
- });
- }
- };
- const __vite_glob_0_34 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: AreaApi
- }, Symbol.toStringTag, { value: "Module" }));
- const VoiceApi = {
- // 语音转文字
- getVoiceToText: () => {
- return request$1({
- url: "/voice2text",
- method: "POST"
- });
- }
- };
- const __vite_glob_0_35 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: VoiceApi
- }, Symbol.toStringTag, { value: "Module" }));
- const AfterSaleApi = {
- // 获得售后分页
- getAfterSalePage: (params) => {
- return request$1({
- url: `/trade/after-sale/page`,
- method: "GET",
- params,
- custom: {
- showLoading: false
- }
- });
- },
- // 创建售后
- createAfterSale: (data) => {
- return request$1({
- url: `/trade/after-sale/create`,
- method: "POST",
- data
- });
- },
- // 获得售后
- getAfterSale: (id) => {
- return request$1({
- url: `/trade/after-sale/get`,
- method: "GET",
- params: {
- id
- }
- });
- },
- // 取消售后
- cancelAfterSale: (id) => {
- return request$1({
- url: `/trade/after-sale/cancel`,
- method: "DELETE",
- params: {
- id
- }
- });
- },
- // 获得售后日志列表
- getAfterSaleLogList: (afterSaleId) => {
- return request$1({
- url: `/trade/after-sale-log/list`,
- method: "GET",
- params: {
- afterSaleId
- }
- });
- },
- // 退回货物
- deliveryAfterSale: (data) => {
- return request$1({
- url: `/trade/after-sale/delivery`,
- method: "PUT",
- data
- });
- }
- };
- const __vite_glob_0_36 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: AfterSaleApi
- }, Symbol.toStringTag, { value: "Module" }));
- const BrokerageApi = {
- // 获得个人分销信息
- getBrokerageUser: () => {
- return request$1({
- url: "/trade/brokerage-user/get",
- method: "GET"
- });
- },
- // 获得个人分销统计
- getBrokerageUserSummary: () => {
- return request$1({
- url: "/trade/brokerage-user/get-summary",
- method: "GET"
- });
- },
- // 获得分销记录分页
- getBrokerageRecordPage: (params) => {
- if (params.status === void 0) {
- delete params.status;
- }
- const queryString = Object.keys(params).map((key) => encodeURIComponent(key) + "=" + params[key]).join("&");
- return request$1({
- url: `/trade/brokerage-record/page?${queryString}`,
- method: "GET"
- });
- },
- // 创建分销提现
- createBrokerageWithdraw: (data) => {
- return request$1({
- url: "/trade/brokerage-withdraw/create",
- method: "POST",
- data
- });
- },
- // 获得商品的分销金额
- getProductBrokeragePrice: (spuId) => {
- return request$1({
- url: "/trade/brokerage-record/get-product-brokerage-price",
- method: "GET",
- params: {
- spuId
- }
- });
- },
- // 获得分销用户排行(基于佣金)
- getRankByPrice: (params) => {
- const queryString = `times=${params.times[0]}×=${params.times[1]}`;
- return request$1({
- url: `/trade/brokerage-user/get-rank-by-price?${queryString}`,
- method: "GET"
- });
- },
- // 获得分销用户排行分页(基于佣金)
- getBrokerageUserChildSummaryPageByPrice: (params) => {
- const queryString = Object.keys(params).map((key) => encodeURIComponent(key) + "=" + params[key]).join("&");
- return request$1({
- url: `/trade/brokerage-user/rank-page-by-price?${queryString}`,
- method: "GET"
- });
- },
- // 获得分销用户排行分页(基于用户量)
- getBrokerageUserRankPageByUserCount: (params) => {
- const queryString = Object.keys(params).map((key) => encodeURIComponent(key) + "=" + params[key]).join("&");
- return request$1({
- url: `/trade/brokerage-user/rank-page-by-user-count?${queryString}`,
- method: "GET"
- });
- },
- // 获得下级分销统计分页
- getBrokerageUserChildSummaryPage: (params) => {
- return request$1({
- url: "/trade/brokerage-user/child-summary-page",
- method: "GET",
- params
- });
- }
- };
- const __vite_glob_0_37 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: BrokerageApi
- }, Symbol.toStringTag, { value: "Module" }));
- const TradeConfigApi = {
- // 获得交易配置
- getTradeConfig: () => {
- return request$1({
- url: `/trade/config/get`,
- method: "GET"
- });
- }
- };
- const __vite_glob_0_39 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: TradeConfigApi
- }, Symbol.toStringTag, { value: "Module" }));
- const DeliveryApi = {
- // 获得快递公司列表
- getDeliveryExpressList: () => {
- return request$1({
- url: `/trade/delivery/express/list`,
- method: "get"
- });
- }
- };
- const __vite_glob_0_40 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: DeliveryApi
- }, Symbol.toStringTag, { value: "Module" }));
- const files = /* @__PURE__ */ Object.assign({ "./distri/consumption.js": __vite_glob_0_0, "./distri/score.js": __vite_glob_0_1, "./distri/share.js": __vite_glob_0_2, "./distri/team.js": __vite_glob_0_3, "./distri/withdrawal.js": __vite_glob_0_4, "./infra/file.js": __vite_glob_0_5, "./member/address.js": __vite_glob_0_6, "./member/auth.js": __vite_glob_0_7, "./member/point.js": __vite_glob_0_8, "./member/signin.js": __vite_glob_0_9, "./member/social.js": __vite_glob_0_10, "./member/user.js": __vite_glob_0_11, "./migration/app.js": __vite_glob_0_12, "./migration/chat.js": __vite_glob_0_13, "./migration/index.js": __vite_glob_0_14, "./migration/third.js": __vite_glob_0_15, "./pay/channel.js": __vite_glob_0_16, "./pay/order.js": __vite_glob_0_17, "./pay/wallet.js": __vite_glob_0_18, "./product/category.js": __vite_glob_0_19, "./product/comment.js": __vite_glob_0_20, "./product/favorite.js": __vite_glob_0_21, "./product/history.js": __vite_glob_0_22, "./product/spu.js": __vite_glob_0_23, "./promotion/activity.js": __vite_glob_0_24, "./promotion/article.js": __vite_glob_0_25, "./promotion/bargain.js": __vite_glob_0_26, "./promotion/combination.js": __vite_glob_0_27, "./promotion/coupon.js": __vite_glob_0_28, "./promotion/diy.js": __vite_glob_0_29, "./promotion/page.js": __vite_glob_0_30, "./promotion/rewardActivity.js": __vite_glob_0_31, "./promotion/seckill.js": __vite_glob_0_32, "./sale/sale.js": __vite_glob_0_33, "./system/area.js": __vite_glob_0_34, "./system/voice.js": __vite_glob_0_35, "./trade/afterSale.js": __vite_glob_0_36, "./trade/brokerage.js": __vite_glob_0_37, "./trade/cart.js": __vite_glob_0_38, "./trade/config.js": __vite_glob_0_39, "./trade/delivery.js": __vite_glob_0_40, "./trade/order.js": __vite_glob_0_41 });
- let api = {};
- Object.keys(files).forEach((key) => {
- const fileName = key.replace(/(.*\/)*([^.]+).*/gi, "$2");
- api = {
- ...api,
- [fileName]: files[key].default
- };
- });
- const $api = api;
- const zIndex = {
- toast: 10090,
- noNetwork: 10080,
- popup: 10075,
- // popup包含popup,actionsheet,keyboard,picker的值
- mask: 10070,
- navbar: 980,
- topTips: 975,
- sticky: 970,
- indexListSticky: 965,
- popover: 960
- };
- var relativeTime$1 = { exports: {} };
- (function(module, exports) {
- !function(r2, e2) {
- module.exports = e2();
- }(commonjsGlobal, function() {
- return function(r2, e2, t2) {
- r2 = r2 || {};
- var n2 = e2.prototype, o2 = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
- function i2(r3, e3, t3, o3) {
- return n2.fromToBase(r3, e3, t3, o3);
- }
- t2.en.relativeTime = o2, n2.fromToBase = function(e3, n3, i3, d3, u2) {
- for (var f2, a2, s2, l2 = i3.$locale().relativeTime || o2, h2 = r2.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m2 = h2.length, c2 = 0; c2 < m2; c2 += 1) {
- var y2 = h2[c2];
- y2.d && (f2 = d3 ? t2(e3).diff(i3, y2.d, true) : i3.diff(e3, y2.d, true));
- var p2 = (r2.rounding || Math.round)(Math.abs(f2));
- if (s2 = f2 > 0, p2 <= y2.r || !y2.r) {
- p2 <= 1 && c2 > 0 && (y2 = h2[c2 - 1]);
- var v2 = l2[y2.l];
- u2 && (p2 = u2("" + p2)), a2 = "string" == typeof v2 ? v2.replace("%d", p2) : v2(p2, n3, y2.l, s2);
- break;
- }
- }
- if (n3)
- return a2;
- var M2 = s2 ? l2.future : l2.past;
- return "function" == typeof M2 ? M2(a2) : M2.replace("%s", a2);
- }, n2.to = function(r3, e3) {
- return i2(r3, e3, this, true);
- }, n2.from = function(r3, e3) {
- return i2(r3, e3, this);
- };
- var d2 = function(r3) {
- return r3.$u ? t2.utc() : t2();
- };
- n2.toNow = function(r3) {
- return this.to(d2(this), r3);
- }, n2.fromNow = function(r3) {
- return this.from(d2(this), r3);
- };
- };
- });
- })(relativeTime$1);
- var relativeTimeExports = relativeTime$1.exports;
- const relativeTime = /* @__PURE__ */ getDefaultExportFromCjs(relativeTimeExports);
- var duration$1 = { exports: {} };
- (function(module, exports) {
- !function(t2, s2) {
- module.exports = s2();
- }(commonjsGlobal, function() {
- var t2, s2, n2 = 1e3, i2 = 6e4, e2 = 36e5, r2 = 864e5, o2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, u2 = 31536e6, d2 = 2628e6, a2 = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, h2 = { years: u2, months: d2, days: r2, hours: e2, minutes: i2, seconds: n2, milliseconds: 1, weeks: 6048e5 }, c2 = function(t3) {
- return t3 instanceof g2;
- }, f2 = function(t3, s3, n3) {
- return new g2(t3, n3, s3.$l);
- }, m2 = function(t3) {
- return s2.p(t3) + "s";
- }, l2 = function(t3) {
- return t3 < 0;
- }, $2 = function(t3) {
- return l2(t3) ? Math.ceil(t3) : Math.floor(t3);
- }, y2 = function(t3) {
- return Math.abs(t3);
- }, v2 = function(t3, s3) {
- return t3 ? l2(t3) ? { negative: true, format: "" + y2(t3) + s3 } : { negative: false, format: "" + t3 + s3 } : { negative: false, format: "" };
- }, g2 = function() {
- function l3(t3, s3, n3) {
- var i3 = this;
- if (this.$d = {}, this.$l = n3, void 0 === t3 && (this.$ms = 0, this.parseFromMilliseconds()), s3)
- return f2(t3 * h2[m2(s3)], this);
- if ("number" == typeof t3)
- return this.$ms = t3, this.parseFromMilliseconds(), this;
- if ("object" == typeof t3)
- return Object.keys(t3).forEach(function(s4) {
- i3.$d[m2(s4)] = t3[s4];
- }), this.calMilliseconds(), this;
- if ("string" == typeof t3) {
- var e3 = t3.match(a2);
- if (e3) {
- var r3 = e3.slice(2).map(function(t4) {
- return null != t4 ? Number(t4) : 0;
- });
- return this.$d.years = r3[0], this.$d.months = r3[1], this.$d.weeks = r3[2], this.$d.days = r3[3], this.$d.hours = r3[4], this.$d.minutes = r3[5], this.$d.seconds = r3[6], this.calMilliseconds(), this;
- }
- }
- return this;
- }
- var y3 = l3.prototype;
- return y3.calMilliseconds = function() {
- var t3 = this;
- this.$ms = Object.keys(this.$d).reduce(function(s3, n3) {
- return s3 + (t3.$d[n3] || 0) * h2[n3];
- }, 0);
- }, y3.parseFromMilliseconds = function() {
- var t3 = this.$ms;
- this.$d.years = $2(t3 / u2), t3 %= u2, this.$d.months = $2(t3 / d2), t3 %= d2, this.$d.days = $2(t3 / r2), t3 %= r2, this.$d.hours = $2(t3 / e2), t3 %= e2, this.$d.minutes = $2(t3 / i2), t3 %= i2, this.$d.seconds = $2(t3 / n2), t3 %= n2, this.$d.milliseconds = t3;
- }, y3.toISOString = function() {
- var t3 = v2(this.$d.years, "Y"), s3 = v2(this.$d.months, "M"), n3 = +this.$d.days || 0;
- this.$d.weeks && (n3 += 7 * this.$d.weeks);
- var i3 = v2(n3, "D"), e3 = v2(this.$d.hours, "H"), r3 = v2(this.$d.minutes, "M"), o3 = this.$d.seconds || 0;
- this.$d.milliseconds && (o3 += this.$d.milliseconds / 1e3, o3 = Math.round(1e3 * o3) / 1e3);
- var u3 = v2(o3, "S"), d3 = t3.negative || s3.negative || i3.negative || e3.negative || r3.negative || u3.negative, a3 = e3.format || r3.format || u3.format ? "T" : "", h3 = (d3 ? "-" : "") + "P" + t3.format + s3.format + i3.format + a3 + e3.format + r3.format + u3.format;
- return "P" === h3 || "-P" === h3 ? "P0D" : h3;
- }, y3.toJSON = function() {
- return this.toISOString();
- }, y3.format = function(t3) {
- var n3 = t3 || "YYYY-MM-DDTHH:mm:ss", i3 = { Y: this.$d.years, YY: s2.s(this.$d.years, 2, "0"), YYYY: s2.s(this.$d.years, 4, "0"), M: this.$d.months, MM: s2.s(this.$d.months, 2, "0"), D: this.$d.days, DD: s2.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: s2.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: s2.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: s2.s(this.$d.seconds, 2, "0"), SSS: s2.s(this.$d.milliseconds, 3, "0") };
- return n3.replace(o2, function(t4, s3) {
- return s3 || String(i3[t4]);
- });
- }, y3.as = function(t3) {
- return this.$ms / h2[m2(t3)];
- }, y3.get = function(t3) {
- var s3 = this.$ms, n3 = m2(t3);
- return "milliseconds" === n3 ? s3 %= 1e3 : s3 = "weeks" === n3 ? $2(s3 / h2[n3]) : this.$d[n3], s3 || 0;
- }, y3.add = function(t3, s3, n3) {
- var i3;
- return i3 = s3 ? t3 * h2[m2(s3)] : c2(t3) ? t3.$ms : f2(t3, this).$ms, f2(this.$ms + i3 * (n3 ? -1 : 1), this);
- }, y3.subtract = function(t3, s3) {
- return this.add(t3, s3, true);
- }, y3.locale = function(t3) {
- var s3 = this.clone();
- return s3.$l = t3, s3;
- }, y3.clone = function() {
- return f2(this.$ms, this);
- }, y3.humanize = function(s3) {
- return t2().add(this.$ms, "ms").locale(this.$l).fromNow(!s3);
- }, y3.valueOf = function() {
- return this.asMilliseconds();
- }, y3.milliseconds = function() {
- return this.get("milliseconds");
- }, y3.asMilliseconds = function() {
- return this.as("milliseconds");
- }, y3.seconds = function() {
- return this.get("seconds");
- }, y3.asSeconds = function() {
- return this.as("seconds");
- }, y3.minutes = function() {
- return this.get("minutes");
- }, y3.asMinutes = function() {
- return this.as("minutes");
- }, y3.hours = function() {
- return this.get("hours");
- }, y3.asHours = function() {
- return this.as("hours");
- }, y3.days = function() {
- return this.get("days");
- }, y3.asDays = function() {
- return this.as("days");
- }, y3.weeks = function() {
- return this.get("weeks");
- }, y3.asWeeks = function() {
- return this.as("weeks");
- }, y3.months = function() {
- return this.get("months");
- }, y3.asMonths = function() {
- return this.as("months");
- }, y3.years = function() {
- return this.get("years");
- }, y3.asYears = function() {
- return this.as("years");
- }, l3;
- }(), p2 = function(t3, s3, n3) {
- return t3.add(s3.years() * n3, "y").add(s3.months() * n3, "M").add(s3.days() * n3, "d").add(s3.hours() * n3, "h").add(s3.minutes() * n3, "m").add(s3.seconds() * n3, "s").add(s3.milliseconds() * n3, "ms");
- };
- return function(n3, i3, e3) {
- t2 = e3, s2 = e3().$utils(), e3.duration = function(t3, s3) {
- var n4 = e3.locale();
- return f2(t3, { $l: n4 }, s3);
- }, e3.isDuration = c2;
- var r3 = i3.prototype.add, o3 = i3.prototype.subtract;
- i3.prototype.add = function(t3, s3) {
- return c2(t3) ? p2(this, t3, 1) : r3.bind(this)(t3, s3);
- }, i3.prototype.subtract = function(t3, s3) {
- return c2(t3) ? p2(this, t3, -1) : o3.bind(this)(t3, s3);
- };
- };
- });
- })(duration$1);
- var durationExports = duration$1.exports;
- const duration = /* @__PURE__ */ getDefaultExportFromCjs(durationExports);
- var zhCn = { exports: {} };
- (function(module, exports) {
- !function(e2, _2) {
- module.exports = _2(dayjs_minExports);
- }(commonjsGlobal, function(e2) {
- function _2(e3) {
- return e3 && "object" == typeof e3 && "default" in e3 ? e3 : { default: e3 };
- }
- var t2 = _2(e2), d2 = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(e3, _3) {
- return "W" === _3 ? e3 + "周" : e3 + "日";
- }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(e3, _3) {
- var t3 = 100 * e3 + _3;
- return t3 < 600 ? "凌晨" : t3 < 900 ? "早上" : t3 < 1100 ? "上午" : t3 < 1300 ? "中午" : t3 < 1800 ? "下午" : "晚上";
- } };
- return t2.default.locale(d2, null, true), d2;
- });
- })(zhCn);
- dayjs.locale("zh-cn");
- dayjs.extend(relativeTime);
- dayjs.extend(duration);
- const sheep = {
- $api,
- $store,
- $url,
- $router,
- $platform: _platform,
- $helper,
- $zIndex: zIndex
- };
- async function ShoproInit() {
- await $store("app").init();
- _platform.load();
- }
- const sheep$1 = sheep;
- const _export_sfc = (sfc, props) => {
- const target = sfc.__vccOpts || sfc;
- for (const [key, val] of props) {
- target[key] = val;
- }
- return target;
- };
- const _sfc_main$3v = {
- __name: "su-video",
- props: {
- moveX: {
- type: [Number],
- default: 0
- },
- // 下标索引
- uid: {
- type: [Number, String],
- default: 0
- },
- // 视频高度
- height: {
- type: Number,
- default: 300
- },
- // 视频宽度
- width: {
- type: Number,
- default: 750
- },
- // 指定视频初始播放位置,单位为秒(s)
- initialTime: {
- type: Number,
- default: 1
- },
- src: {
- type: String,
- default: ""
- },
- poster: {
- type: String,
- default: "https://img1.baidu.com/it/u=1601695551,235775011&fm=26&fmt=auto"
- },
- autoplay: {
- type: Boolean,
- default: false
- }
- },
- emits: ["videoTimeupdate"],
- setup(__props, { expose: __expose, emit: __emit }) {
- const vm = vue.getCurrentInstance();
- const state = vue.reactive({
- enableProgressGesture: true,
- // 手势滑动
- showModal: false
- // 弹框
- });
- const props = __props;
- const emits = __emit;
- const timeupdate = (e2) => {
- emits("videoTimeupdate", e2);
- };
- const videoErrorCallback = (e2) => {
- uni.showToast({
- title: JSON.stringify(e2),
- icon: "none"
- });
- formatAppLog("log", "at sheep/ui/su-video/su-video.vue:114", "视频错误信息:", e2.target.errMsg);
- };
- const play = () => {
- formatAppLog("log", "at sheep/ui/su-video/su-video.vue:119", "视频开始");
- };
- const pause = () => {
- formatAppLog("log", "at sheep/ui/su-video/su-video.vue:123", "视频暂停");
- };
- const end = () => {
- formatAppLog("log", "at sheep/ui/su-video/su-video.vue:127", "视频结束");
- };
- const startPlay = () => {
- vue.nextTick(() => {
- const video = uni.createVideoContext(`sVideo${props.index}`, vm);
- video.play();
- });
- };
- const pausePlay = () => {
- const video = uni.createVideoContext(`sVideo${props.index}`, vm);
- video.pause();
- };
- const beforePlay = () => {
- uni.getNetworkType({
- success: (res) => {
- res.networkType;
- startPlay();
- }
- });
- };
- __expose({
- pausePlay
- });
- const __returned__ = { vm, state, props, emits, timeupdate, videoErrorCallback, play, pause, end, startPlay, pausePlay, beforePlay, reactive: vue.reactive, nextTick: vue.nextTick, getCurrentInstance: vue.getCurrentInstance, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3u(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "ui-video-wrap" }, [
- vue.createElementVNode("video", {
- id: `sVideo${$props.uid}`,
- class: "radius",
- style: vue.normalizeStyle([{ height: $props.height + "rpx" }]),
- src: $props.src,
- controls: "",
- "object-fit": "contain",
- "enable-progress-gesture": $setup.state.enableProgressGesture,
- "initial-time": $props.initialTime,
- "x5-video-player-type": "h5",
- "x-webkit-airplay": "allow",
- "webkit-playsinline": "true",
- onError: $setup.videoErrorCallback,
- onTimeupdate: $setup.timeupdate,
- onPlay: $setup.play,
- onPause: $setup.pause,
- onEnded: $setup.end,
- poster: $props.poster,
- autoplay: $props.autoplay
- }, [
- vue.createElementVNode(
- "cover-view",
- {
- style: vue.normalizeStyle({ transform: "translateX(" + $props.moveX + "px)" })
- },
- null,
- 4
- /* STYLE */
- )
- ], 44, ["id", "src", "enable-progress-gesture", "initial-time", "poster", "autoplay"])
- ]);
- }
- const __easycom_0$t = /* @__PURE__ */ _export_sfc(_sfc_main$3v, [["render", _sfc_render$3u], ["__scopeId", "data-v-f4b9589e"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-video/su-video.vue"]]);
- const _sfc_main$3u = {
- __name: "su-swiper",
- props: {
- circular: {
- type: Boolean,
- default: true
- },
- autoplay: {
- type: Boolean,
- default: false
- },
- interval: {
- type: Number,
- default: 3e3
- },
- duration: {
- type: Number,
- default: 500
- },
- mode: {
- type: String,
- default: "default"
- },
- imageMode: {
- type: String,
- default: "scaleToFill"
- },
- list: {
- type: Array,
- default() {
- return [];
- }
- },
- dotStyle: {
- type: String,
- default: "long"
- //default long tag
- },
- dotCur: {
- type: String,
- default: "ss-bg-opactity-block"
- },
- bg: {
- type: String,
- default: "bg-none"
- },
- height: {
- type: Number,
- default: 0
- },
- imgHeight: {
- type: Number,
- default: 0
- },
- imgTopRadius: {
- type: Number,
- default: 0
- },
- imgBottomRadius: {
- type: Number,
- default: 0
- },
- isPreview: {
- type: Boolean,
- default: false
- },
- seizeHeight: {
- type: Number,
- default: 200
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- imgHeight: 0,
- cur: 0,
- moveX: 0,
- videoPlaySataus: false,
- heightList: []
- });
- const refs = vue.reactive({
- videoRef: {}
- });
- const props = __props;
- const swiperChange = (e2) => {
- if (e2.detail.source !== "touch" && e2.detail.source !== "autoplay")
- return;
- state.cur = e2.detail.current;
- state.videoPlaySataus = false;
- if (props.list[state.cur].type === "video") {
- refs.videoRef[`video_${state.cur}`].pausePlay();
- }
- };
- const onSwiperItem = (item) => {
- if (item.type === "video") {
- state.videoPlaySataus = true;
- } else {
- if (item.urlParams && item.urlParams.title) {
- sheep$1.$router.go(item.url, { title: item.urlParams.title });
- } else {
- sheep$1.$router.go(item.url);
- }
- onPreview();
- }
- };
- const onPreview = () => {
- if (!props.isPreview)
- return;
- let previewImage = lodashExports.clone(props.list);
- previewImage.forEach((item, index2) => {
- if (item.type === "video") {
- previewImage.splice(index2, 1);
- }
- });
- uni.previewImage({
- urls: previewImage.length < 1 ? [props.src] : previewImage.reduce((pre, cur) => {
- pre.push(cur.src);
- return pre;
- }, []),
- current: state.cur
- // longPressActions: {
- // itemList: ['发送给朋友', '保存图片', '收藏'],
- // success: function (data) {
- // __f__('log','at sheep/ui/su-swiper/su-swiper.vue:222','选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
- // },
- // fail: function (err) {
- // __f__('log','at sheep/ui/su-swiper/su-swiper.vue:225',err.errMsg);
- // },
- // },
- });
- };
- const transition = (e2) => {
- state.moveX = e2.detail.dx;
- };
- const animationfinish = (e2) => {
- state.moveX = 0;
- };
- const videoTimeupdate = (e2) => {
- props.list[state.cur].currentTime = e2.detail.currentTime;
- };
- const customStyle = vue.computed(() => {
- let height;
- if (props.height !== 0) {
- height = props.height;
- }
- if (props.height === 0) {
- if (state.imgHeight !== 0) {
- height = state.imgHeight;
- } else if (props.seizeHeight !== 0) {
- height = props.seizeHeight;
- }
- }
- return {
- height: height + "rpx"
- };
- });
- function onImgLoad(e2) {
- if (props.height === 0) {
- let newHeight = e2.detail.height / e2.detail.width * 750;
- if (state.imgHeight < newHeight) {
- state.imgHeight = newHeight;
- }
- }
- }
- const __returned__ = { state, refs, props, swiperChange, onSwiperItem, onPreview, transition, animationfinish, videoTimeupdate, customStyle, onImgLoad, reactive: vue.reactive, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get clone() {
- return lodashExports.clone;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3t(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_video = resolveEasycom(vue.resolveDynamicComponent("su-video"), __easycom_0$t);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["ui-swiper", [$setup.props.mode, $setup.props.bg, $setup.props.ui]])
- },
- [
- vue.createElementVNode("swiper", {
- circular: $setup.props.circular,
- current: $setup.state.cur,
- autoplay: $setup.props.autoplay && !$setup.state.videoPlaySataus,
- interval: $setup.props.interval,
- duration: $setup.props.duration,
- onTransition: $setup.transition,
- onAnimationfinish: $setup.animationfinish,
- style: vue.normalizeStyle($setup.customStyle),
- onChange: $setup.swiperChange
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.props.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("swiper-item", {
- class: vue.normalizeClass(["swiper-item", { cur: $setup.state.cur == index2 }]),
- key: index2,
- onClick: ($event) => $setup.onSwiperItem(item)
- }, [
- vue.createElementVNode("view", { class: "ui-swiper-main" }, [
- item.type === "image" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "swiper-image",
- mode: $setup.props.imageMode,
- src: item.src,
- width: "100%",
- height: "100%",
- onLoad: $setup.onImgLoad
- }, null, 40, ["mode", "src"])) : (vue.openBlock(), vue.createBlock(_component_su_video, {
- key: 1,
- ref_for: true,
- ref: (el) => $setup.refs.videoRef[`video_${index2}`] = el,
- poster: $setup.sheep.$url.cdn(item.poster),
- src: $setup.sheep.$url.cdn(item.src),
- index: index2,
- moveX: $setup.state.moveX,
- initialTime: item.currentTime || 0,
- height: $props.seizeHeight,
- onVideoTimeupdate: $setup.videoTimeupdate
- }, null, 8, ["poster", "src", "index", "moveX", "initialTime", "height"]))
- ])
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 44, ["circular", "current", "autoplay", "interval", "duration"]),
- !$setup.state.videoPlaySataus ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- $setup.props.dotStyle != "tag" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["ui-swiper-dot", $setup.props.dotStyle])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.props.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["line-box", [$setup.state.cur == index2 ? "cur" : "", $setup.props.dotCur]]),
- key: index2
- },
- null,
- 2
- /* CLASS */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- $setup.props.dotStyle == "tag" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["ui-swiper-dot", $setup.props.dotStyle])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["ui-tag radius-lg", [$setup.props.dotCur]]),
- style: { "pointer-events": "none", "padding": "0 10rpx" }
- },
- [
- vue.createElementVNode(
- "view",
- { style: { "transform": "scale(0.7)" } },
- vue.toDisplayString($setup.state.cur + 1) + " / " + vue.toDisplayString($setup.props.list.length),
- 1
- /* TEXT */
- )
- ],
- 2
- /* CLASS */
- )
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- )
- ]);
- }
- const __easycom_1$d = /* @__PURE__ */ _export_sfc(_sfc_main$3u, [["render", _sfc_render$3t], ["__scopeId", "data-v-b37b3c30"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-swiper/su-swiper.vue"]]);
- const _sfc_main$3t = {
- __name: "s-image-banner",
- props: {
- data: {
- type: Object,
- default: () => ({})
- },
- styles: {
- type: Object,
- default: () => ({})
- },
- height: {
- type: Number
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const imgList = vue.computed(
- () => props.data.items.map((item) => {
- const src = item.type === "img" ? item.imgUrl : item.videoUrl;
- return {
- ...item,
- type: item.type === "img" ? "image" : "video",
- src: sheep$1.$url.cdn(src),
- poster: sheep$1.$url.cdn(item.imgUrl)
- };
- })
- );
- const __returned__ = { props, imgList, computed: vue.computed, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3s(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_swiper = resolveEasycom(vue.resolveDynamicComponent("su-swiper"), __easycom_1$d);
- return vue.openBlock(), vue.createBlock(_component_su_swiper, {
- list: $setup.imgList,
- dotStyle: $props.data.indicator === "dot" ? "long" : "tag",
- imageMode: "scaleToFill",
- dotCur: "bg-mask-40",
- seizeHeight: 300,
- autoplay: $props.data.autoplay,
- interval: $props.data.interval * 1e3,
- mode: $props.data.type,
- height: $props.height
- }, null, 8, ["list", "dotStyle", "autoplay", "interval", "mode", "height"]);
- }
- const __easycom_8$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3t, [["render", _sfc_render$3s], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-image-banner/s-image-banner.vue"]]);
- const _sfc_main$3s = {
- name: "su-tabbar-item",
- props: {
- customStyle: {
- type: [Object, String],
- default: () => ({})
- },
- customClass: {
- type: String,
- default: ""
- },
- // 跳转的页面路径
- url: {
- type: String,
- default: ""
- },
- // 页面跳转的类型
- linkType: {
- type: String,
- default: "navigateTo"
- },
- // item标签的名称,作为与u-tabbar的value参数匹配的标识符
- name: {
- type: [String, Number, null],
- default: ""
- },
- // uView内置图标或者绝对路径的图片
- icon: {
- icon: String,
- default: ""
- },
- // 右上角的角标提示信息
- badge: {
- type: [String, Number, null],
- default: ""
- },
- // 是否显示圆点,将会覆盖badge参数
- dot: {
- type: Boolean,
- default: false
- },
- // 描述文本
- text: {
- type: String,
- default: ""
- },
- // 控制徽标的位置,对象或者字符串形式,可以设置top和right属性
- badgeStyle: {
- type: [Object, String],
- default: ""
- },
- isCenter: {
- type: Boolean,
- default: false
- },
- centerImage: {
- type: String,
- default: ""
- }
- },
- data() {
- return {
- isActive: false,
- // 是否处于激活状态
- addStyle,
- parentData: {
- value: null,
- activeColor: "",
- color: ""
- },
- parent: {}
- };
- },
- setup() {
- const { t: t2 } = useI18n();
- return {
- t: t2
- };
- },
- created() {
- this.init();
- },
- methods: {
- getParentData(parentName = "") {
- if (!this.parent)
- this.parent = {};
- this.parent = $parent.call(this, parentName);
- if (this.parent.children) {
- this.parent.children.indexOf(this) === -1 && this.parent.children.push(this);
- }
- if (this.parent && this.parentData) {
- Object.keys(this.parentData).map((key) => {
- this.parentData[key] = this.parent[key];
- });
- }
- },
- init() {
- this.updateParentData();
- if (!this.parent) {
- formatAppLog("log", "at sheep/ui/su-tabbar-item/su-tabbar-item.vue:168", "u-tabbar-item必须搭配u-tabbar组件使用");
- }
- const index2 = this.parent.children.indexOf(this);
- this.isActive = (this.name.split("?")[0] || index2) === this.parentData.value;
- },
- updateParentData() {
- this.getParentData("su-tabbar");
- },
- // 此方法将会被父组件u-tabbar调用
- updateFromParent() {
- this.init();
- },
- clickHandler() {
- this.$nextTick(() => {
- const index2 = this.parent.children.indexOf(this);
- const name2 = this.name || index2;
- if (name2 !== this.parent.value) {
- this.parent.$emit("change", name2);
- }
- this.$emit("click", name2);
- });
- }
- }
- };
- function _sfc_render$3r(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-tabbar-item",
- style: vue.normalizeStyle([$data.addStyle($props.customStyle)])
- },
- [
- $props.isCenter ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "tabbar-center-item"
- }, [
- vue.createElementVNode("image", {
- class: "center-image",
- src: $props.centerImage,
- mode: "aspectFill"
- }, null, 8, ["src"])
- ])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createElementVNode("view", { class: "u-tabbar-item__icon" }, [
- $props.icon ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- name: $props.icon,
- color: $data.isActive ? $data.parentData.activeColor : $data.parentData.color,
- size: 20
- }, null, 8, ["name", "color"])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- $data.isActive ? vue.renderSlot(_ctx.$slots, "active-icon", { key: 0 }, void 0, true) : vue.renderSlot(_ctx.$slots, "inactive-icon", { key: 1 }, void 0, true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )),
- vue.createCommentVNode(` <u-badge
- absolute
- :offset="[0, dot ? '34rpx' : badge > 9 ? '14rpx' : '20rpx']"
- :customStyle="badgeStyle"
- :isDot="dot"
- :value="badge || (dot ? 1 : null)"
- :show="dot || badge > 0"
- ></u-badge> `)
- ]),
- vue.renderSlot(_ctx.$slots, "text", {}, () => [
- vue.createElementVNode(
- "text",
- {
- class: "u-tabbar-item__text",
- style: vue.normalizeStyle({
- color: $data.isActive ? $data.parentData.activeColor : $data.parentData.color
- })
- },
- vue.toDisplayString($props.text),
- 5
- /* TEXT, STYLE */
- )
- ], true)
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_0$s = /* @__PURE__ */ _export_sfc(_sfc_main$3s, [["render", _sfc_render$3r], ["__scopeId", "data-v-a62e13d6"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-tabbar-item/su-tabbar-item.vue"]]);
- const _sfc_main$3r = {
- name: "su-tabbar",
- props: {
- customStyle: {
- type: [Object, String],
- default: () => ({})
- },
- customClass: {
- type: String,
- default: ""
- },
- // 跳转的页面路径
- url: {
- type: String,
- default: ""
- },
- // 页面跳转的类型
- linkType: {
- type: String,
- default: "navigateTo"
- },
- // 当前匹配项的name
- value: {
- type: [String, Number, null],
- default: ""
- },
- // 是否为iPhoneX留出底部安全距离
- safeAreaInsetBottom: {
- type: Boolean,
- default: true
- },
- // 是否显示上方边框
- border: {
- type: Boolean,
- default: true
- },
- // 元素层级z-index
- zIndex: {
- type: [String, Number],
- default: 10
- },
- // 选中标签的颜色
- activeColor: {
- type: String,
- default: "#1989fa"
- },
- // 未选中标签的颜色
- inactiveColor: {
- type: String,
- default: "#7d7e80"
- },
- // 是否固定在底部
- fixed: {
- type: Boolean,
- default: true
- },
- // fixed定位固定在底部时,是否生成一个等高元素防止塌陷
- placeholder: {
- type: Boolean,
- default: true
- },
- midTabBar: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- placeholderHeight: 0,
- safeBottomHeight: sheep$1.$platform.device.safeAreaInsets.bottom
- };
- },
- computed: {
- tabbarStyle() {
- const style = {
- zIndex: this.zIndex
- };
- return deepMerge(style, addStyle(this.customStyle));
- },
- // 监听多个参数的变化,通过在computed执行对应的操作
- updateChild() {
- return [this.value, this.activeColor, this.inactiveColor];
- },
- color() {
- return this.inactiveColor;
- },
- updatePlaceholder() {
- return [this.fixed, this.placeholder];
- }
- },
- watch: {
- updateChild() {
- this.updateChildren();
- },
- updatePlaceholder() {
- this.setPlaceholderHeight();
- }
- },
- created() {
- this.children = [];
- },
- mounted() {
- this.setPlaceholderHeight();
- },
- methods: {
- updateChildren() {
- this.children.length && this.children.map((child) => child.updateFromParent());
- },
- getRect(selector, all) {
- return new Promise((resolve) => {
- uni.createSelectorQuery().in(this)[all ? "selectAll" : "select"](selector).boundingClientRect((rect) => {
- if (all && Array.isArray(rect) && rect.length) {
- resolve(rect);
- }
- if (!all && rect) {
- resolve(rect);
- }
- }).exec();
- });
- },
- // 设置用于防止塌陷元素的高度
- async setPlaceholderHeight() {
- if (!this.fixed || !this.placeholder)
- return;
- await sleep(20);
- this.getRect(".u-tabbar__content").then(({
- height = 50
- }) => {
- this.placeholderHeight = height;
- });
- }
- }
- };
- function _sfc_render$3q(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-tabbar" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-tabbar__content", [$props.border && "u-border-top", $props.fixed && "u-tabbar--fixed", { "mid-tabbar": $props.midTabBar }]]),
- ref: "u-tabbar__content",
- onTouchmove: _cache[0] || (_cache[0] = vue.withModifiers(() => {
- }, ["stop", "prevent"])),
- style: vue.normalizeStyle([$options.tabbarStyle])
- },
- [
- vue.createElementVNode("view", { class: "u-tabbar__content__item-wrapper" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ]),
- $props.safeAreaInsetBottom ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- style: vue.normalizeStyle([{ height: $data.safeBottomHeight + "px" }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 38
- /* CLASS, STYLE, NEED_HYDRATION */
- ),
- $props.placeholder ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-tabbar__placeholder",
- style: vue.normalizeStyle({
- height: $data.placeholderHeight + "px"
- })
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_1$c = /* @__PURE__ */ _export_sfc(_sfc_main$3r, [["render", _sfc_render$3q], ["__scopeId", "data-v-b5af0eb7"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-tabbar/su-tabbar.vue"]]);
- const _sfc_main$3q = {
- __name: "s-tabbar",
- props: {
- path: {
- type: String,
- default: ""
- },
- tabbar: {
- type: Object,
- default: () => {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const tabbar = vue.computed(() => {
- var _a2;
- if (props.tabbar)
- return props.tabbar;
- return (_a2 = sheep$1.$store("app").template.basic) == null ? void 0 : _a2.tabbar;
- });
- const tabbarStyle = vue.computed(() => {
- const backgroundStyle = tabbar.value.style;
- if (backgroundStyle.bgType === "color") {
- return {
- background: backgroundStyle.bgColor
- };
- }
- if (backgroundStyle.bgType === "img")
- return {
- background: `url(${sheep$1.$url.cdn(
- backgroundStyle.bgImg
- )}) no-repeat top center / 100% auto`
- };
- });
- const getTabbarCenter = (index2) => {
- if (vue.unref(tabbar).mode !== 2)
- return false;
- return vue.unref(tabbar).items % 2 > 0 ? Math.ceil(vue.unref(tabbar).items.length / 2) === index2 + 1 : false;
- };
- const __returned__ = { props, tabbar, tabbarStyle, getTabbarCenter, computed: vue.computed, unref: vue.unref, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3p(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2, _b2;
- const _component_su_tabbar_item = resolveEasycom(vue.resolveDynamicComponent("su-tabbar-item"), __easycom_0$s);
- const _component_su_tabbar = resolveEasycom(vue.resolveDynamicComponent("su-tabbar"), __easycom_1$c);
- return ((_b2 = (_a2 = $setup.tabbar) == null ? void 0 : _a2.items) == null ? void 0 : _b2.length) > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-page__item"
- }, [
- vue.createVNode(_component_su_tabbar, {
- value: $props.path,
- fixed: true,
- placeholder: true,
- safeAreaInsetBottom: true,
- inactiveColor: $setup.tabbar.style.color,
- activeColor: $setup.tabbar.style.activeColor,
- midTabBar: $setup.tabbar.mode === 2,
- customStyle: $setup.tabbarStyle
- }, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.tabbar.items, (item, index2) => {
- return vue.openBlock(), vue.createBlock(_component_su_tabbar_item, {
- key: item.text,
- text: item.text,
- name: item.url,
- isCenter: $setup.getTabbarCenter(index2),
- centerImage: $setup.sheep.$url.cdn(item.iconUrl),
- onClick: ($event) => $setup.sheep.$router.go(item.url)
- }, {
- "active-icon": vue.withCtx(() => [
- vue.createElementVNode("image", {
- class: "u-page__item__slot-icon",
- src: $setup.sheep.$url.cdn(item.activeIconUrl)
- }, null, 8, ["src"])
- ]),
- "inactive-icon": vue.withCtx(() => [
- vue.createElementVNode("image", {
- class: "u-page__item__slot-icon",
- src: $setup.sheep.$url.cdn(item.iconUrl)
- }, null, 8, ["src"])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["text", "name", "isCenter", "centerImage", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["value", "inactiveColor", "activeColor", "midTabBar", "customStyle"])
- ])) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_3$7 = /* @__PURE__ */ _export_sfc(_sfc_main$3q, [["render", _sfc_render$3p], ["__scopeId", "data-v-434f93ee"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-tabbar/s-tabbar.vue"]]);
- const block0 = (Comp) => {
- (Comp.$wxs || (Comp.$wxs = [])).push("handler");
- (Comp.$wxsModules || (Comp.$wxsModules = {}))["handler"] = "2f992f8c";
- };
- const _sfc_main$3p = {
- name: "node",
- options: {},
- data() {
- return {
- ctrl: {}
- };
- },
- props: {
- name: String,
- attrs: {
- type: Object,
- default() {
- return {};
- }
- },
- childs: Array,
- opts: Array
- },
- components: {},
- mounted() {
- this.$nextTick(() => {
- for (this.root = this.$parent; this.root.$options.name !== "mp-html"; this.root = this.root.$parent)
- ;
- });
- if (this.opts[0]) {
- let i2;
- for (i2 = this.childs.length; i2--; ) {
- if (this.childs[i2].name === "img")
- break;
- }
- if (i2 !== -1) {
- this.observer = uni.createIntersectionObserver(this).relativeToViewport({
- top: 500,
- bottom: 500
- });
- this.observer.observe("._img", (res) => {
- if (res.intersectionRatio) {
- this.$set(this.ctrl, "load", 1);
- this.observer.disconnect();
- }
- });
- }
- }
- },
- beforeDestroy() {
- if (this.observer) {
- this.observer.disconnect();
- }
- },
- methods: {
- /**
- * @description 播放视频事件
- * @param {Event} e
- */
- play(e2) {
- this.root.$emit("play");
- },
- /**
- * @description 图片点击事件
- * @param {Event} e
- */
- imgTap(e2) {
- const node2 = this.childs[e2.currentTarget.dataset.i];
- if (node2.a) {
- this.linkTap(node2.a);
- return;
- }
- if (node2.attrs.ignore)
- return;
- node2.attrs.src = node2.attrs.src || node2.attrs["data-src"];
- this.root.$emit("imgtap", node2.attrs);
- if (this.root.previewImg) {
- uni.previewImage({
- current: parseInt(node2.attrs.i),
- urls: this.root.imgList
- });
- }
- },
- /**
- * @description 图片长按
- */
- imgLongTap(e2) {
- const attrs = this.childs[e2.currentTarget.dataset.i].attrs;
- if (this.opts[3] && !attrs.ignore) {
- uni.showActionSheet({
- itemList: ["保存图片"],
- success: () => {
- const save = (path) => {
- uni.saveImageToPhotosAlbum({
- filePath: path,
- success() {
- uni.showToast({
- title: "保存成功"
- });
- }
- });
- };
- if (this.root.imgList[attrs.i].startsWith("http")) {
- uni.downloadFile({
- url: this.root.imgList[attrs.i],
- success: (res) => save(res.tempFilePath)
- });
- } else {
- save(this.root.imgList[attrs.i]);
- }
- }
- });
- }
- },
- /**
- * @description 图片加载完成事件
- * @param {Event} e
- */
- imgLoad(e2) {
- const i2 = e2.currentTarget.dataset.i;
- if (!this.childs[i2].w) {
- this.$set(this.ctrl, i2, e2.detail.width);
- } else if (this.opts[1] && !this.ctrl[i2] || this.ctrl[i2] === -1) {
- this.$set(this.ctrl, i2, 1);
- }
- this.checkReady();
- },
- /**
- * @description 检查是否所有图片加载完毕
- */
- checkReady() {
- if (!this.root.lazyLoad) {
- this.root._unloadimgs -= 1;
- if (!this.root._unloadimgs) {
- setTimeout(() => {
- this.root.getRect().then((rect) => {
- this.root.$emit("ready", rect);
- }).catch(() => {
- this.root.$emit("ready", {});
- });
- }, 350);
- }
- }
- },
- /**
- * @description 链接点击事件
- * @param {Event} e
- */
- linkTap(e2) {
- const node2 = e2.currentTarget ? this.childs[e2.currentTarget.dataset.i] : {};
- const attrs = node2.attrs || e2;
- const href = attrs.href;
- this.root.$emit("linktap", Object.assign({
- innerText: this.root.getText(node2.children || [])
- // 链接内的文本内容
- }, attrs));
- if (href) {
- if (href[0] === "#") {
- this.root.navigateTo(href.substring(1)).catch(() => {
- });
- } else if (href.split("?")[0].includes("://")) {
- if (this.root.copyLink) {
- plus.runtime.openWeb(href);
- }
- } else {
- uni.navigateTo({
- url: href,
- fail() {
- uni.switchTab({
- url: href,
- fail() {
- }
- });
- }
- });
- }
- }
- },
- /**
- * @description 错误事件
- * @param {Event} e
- */
- mediaError(e2) {
- const i2 = e2.currentTarget.dataset.i;
- const node2 = this.childs[i2];
- if (node2.name === "video" || node2.name === "audio") {
- let index2 = (this.ctrl[i2] || 0) + 1;
- if (index2 > node2.src.length) {
- index2 = 0;
- }
- if (index2 < node2.src.length) {
- this.$set(this.ctrl, i2, index2);
- return;
- }
- } else if (node2.name === "img") {
- if (this.opts[2]) {
- this.$set(this.ctrl, i2, -1);
- }
- this.checkReady();
- }
- if (this.root) {
- this.root.$emit("error", {
- source: node2.name,
- attrs: node2.attrs,
- errMsg: e2.detail.errMsg
- });
- }
- }
- }
- };
- function _sfc_render$3o(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_node = vue.resolveComponent("node", true);
- return vue.openBlock(), vue.createElementBlock("view", {
- id: $props.attrs.id,
- class: vue.normalizeClass("_block _" + $props.name + " " + $props.attrs.class),
- style: vue.normalizeStyle($props.attrs.style)
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.childs, (n2, i2) => {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: i2 },
- [
- vue.createCommentVNode(" 图片 "),
- vue.createCommentVNode(" 占位图 "),
- n2.name === "img" && !n2.t && ($props.opts[1] && !$data.ctrl[i2] || $data.ctrl[i2] < 0) ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "_img",
- style: vue.normalizeStyle(n2.attrs.style),
- src: $data.ctrl[i2] < 0 ? $props.opts[2] : $props.opts[1],
- mode: "widthFix"
- }, null, 12, ["src"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 显示图片 "),
- vue.createCommentVNode(" 表格中的图片,使用 rich-text 防止大小不正确 "),
- n2.name === "img" && n2.t ? (vue.openBlock(), vue.createElementBlock("rich-text", {
- key: 1,
- style: vue.normalizeStyle("display:" + n2.t),
- nodes: "<img class='_img' style='" + n2.attrs.style + "' src='" + n2.attrs.src + "'>",
- "data-i": i2,
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.imgTap && $options.imgTap(...args), ["stop"]))
- }, null, 12, ["nodes", "data-i"])) : n2.name === "img" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 2,
- id: n2.attrs.id,
- class: vue.normalizeClass("_img " + n2.attrs.class),
- style: vue.normalizeStyle(($data.ctrl[i2] === -1 ? "display:none;" : "") + "width:" + ($data.ctrl[i2] || 1) + "px;" + n2.attrs.style),
- src: n2.attrs.src || ($data.ctrl.load ? n2.attrs["data-src"] : ""),
- mode: !n2.h ? "widthFix" : !n2.w ? "heightFix" : "",
- "data-i": i2,
- onLoad: _cache[1] || (_cache[1] = (...args) => $options.imgLoad && $options.imgLoad(...args)),
- onError: _cache[2] || (_cache[2] = (...args) => $options.mediaError && $options.mediaError(...args)),
- onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.imgTap && $options.imgTap(...args), ["stop"])),
- onLongpress: _cache[4] || (_cache[4] = (...args) => $options.imgLongTap && $options.imgLongTap(...args))
- }, null, 46, ["id", "src", "mode", "data-i"])) : n2.text ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 3 },
- [
- vue.createCommentVNode(" 文本 "),
- vue.createElementVNode(
- "text",
- { decode: "" },
- vue.toDisplayString(n2.text),
- 1
- /* TEXT */
- )
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : n2.name === "br" ? (vue.openBlock(), vue.createElementBlock("text", { key: 4 }, "\\n")) : n2.name === "a" ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 5 },
- [
- vue.createCommentVNode(" 链接 "),
- vue.createElementVNode("view", {
- id: n2.attrs.id,
- class: vue.normalizeClass((n2.attrs.href ? "_a " : "") + n2.attrs.class),
- "hover-class": "_hover",
- style: vue.normalizeStyle("display:inline;" + n2.attrs.style),
- "data-i": i2,
- onClick: _cache[5] || (_cache[5] = vue.withModifiers((...args) => $options.linkTap && $options.linkTap(...args), ["stop"]))
- }, [
- vue.createVNode(_component_node, {
- name: "span",
- childs: n2.children,
- opts: $props.opts,
- style: { "display": "inherit" }
- }, null, 8, ["childs", "opts"])
- ], 14, ["id", "data-i"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : n2.html ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 6 },
- [
- vue.createCommentVNode(" 视频 "),
- vue.createElementVNode("view", {
- id: n2.attrs.id,
- class: vue.normalizeClass("_video " + n2.attrs.class),
- style: vue.normalizeStyle(n2.attrs.style),
- innerHTML: n2.html,
- onVplay: _cache[6] || (_cache[6] = vue.withModifiers((...args) => $options.play && $options.play(...args), ["stop"]))
- }, null, 46, ["id", "innerHTML"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : n2.name === "iframe" ? (vue.openBlock(), vue.createElementBlock("iframe", {
- key: 7,
- style: vue.normalizeStyle(n2.attrs.style),
- allowfullscreen: n2.attrs.allowfullscreen,
- frameborder: n2.attrs.frameborder,
- src: n2.attrs.src
- }, null, 12, ["allowfullscreen", "frameborder", "src"])) : n2.name === "embed" ? (vue.openBlock(), vue.createElementBlock("embed", {
- key: 8,
- style: vue.normalizeStyle(n2.attrs.style),
- src: n2.attrs.src
- }, null, 12, ["src"])) : n2.name === "table" && n2.c || n2.name === "li" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 9,
- id: n2.attrs.id,
- class: vue.normalizeClass("_" + n2.name + " " + n2.attrs.class),
- style: vue.normalizeStyle(n2.attrs.style)
- }, [
- n2.name === "li" ? (vue.openBlock(), vue.createBlock(_component_node, {
- key: 0,
- childs: n2.children,
- opts: $props.opts
- }, null, 8, ["childs", "opts"])) : (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- vue.renderList(n2.children, (tbody, x) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: x,
- class: vue.normalizeClass("_" + tbody.name + " " + tbody.attrs.class),
- style: vue.normalizeStyle(tbody.attrs.style)
- },
- [
- tbody.name === "td" || tbody.name === "th" ? (vue.openBlock(), vue.createBlock(_component_node, {
- key: 0,
- childs: tbody.children,
- opts: $props.opts
- }, null, 8, ["childs", "opts"])) : (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- vue.renderList(tbody.children, (tr, y2) => {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: y2 },
- [
- tr.name === "td" || tr.name === "th" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass("_" + tr.name + " " + tr.attrs.class),
- style: vue.normalizeStyle(tr.attrs.style)
- },
- [
- vue.createVNode(_component_node, {
- childs: tr.children,
- opts: $props.opts
- }, null, 8, ["childs", "opts"])
- ],
- 6
- /* CLASS, STYLE */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass("_" + tr.name + " " + tr.attrs.class),
- style: vue.normalizeStyle(tr.attrs.style)
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(tr.children, (td, z2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: z2,
- class: vue.normalizeClass("_" + td.name + " " + td.attrs.class),
- style: vue.normalizeStyle(td.attrs.style)
- },
- [
- vue.createVNode(_component_node, {
- childs: td.children,
- opts: $props.opts
- }, null, 8, ["childs", "opts"])
- ],
- 6
- /* CLASS, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 6
- /* CLASS, STYLE */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 6
- /* CLASS, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 14, ["id"])) : !n2.c ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 10 },
- [
- vue.createCommentVNode(" 富文本 "),
- vue.createElementVNode("rich-text", {
- id: n2.attrs.id,
- style: vue.normalizeStyle(n2.f + ";display:inline"),
- preview: false,
- selectable: $props.opts[4],
- "user-select": $props.opts[4],
- nodes: [n2]
- }, null, 12, ["id", "selectable", "user-select", "nodes"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : n2.c === 2 ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 11 },
- [
- vue.createCommentVNode(" 继续递归 "),
- vue.createElementVNode("view", {
- id: n2.attrs.id,
- class: vue.normalizeClass("_block _" + n2.name + " " + n2.attrs.class),
- style: vue.normalizeStyle(n2.f + ";" + n2.attrs.style)
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(n2.children, (n22, j2) => {
- return vue.openBlock(), vue.createBlock(_component_node, {
- key: j2,
- style: vue.normalizeStyle(n22.f),
- name: n22.name,
- attrs: n22.attrs,
- childs: n22.children,
- opts: $props.opts
- }, null, 8, ["style", "name", "attrs", "childs", "opts"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 14, ["id"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : (vue.openBlock(), vue.createBlock(_component_node, {
- key: 12,
- style: vue.normalizeStyle(n2.f),
- name: n2.name,
- attrs: n2.attrs,
- childs: n2.children,
- opts: $props.opts
- }, null, 8, ["style", "name", "attrs", "childs", "opts"]))
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 14, ["id"]);
- }
- if (typeof block0 === "function")
- block0(_sfc_main$3p);
- const node = /* @__PURE__ */ _export_sfc(_sfc_main$3p, [["render", _sfc_render$3o], ["__scopeId", "data-v-8845ff2f"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/mp-html/components/mp-html/node/node.vue"]]);
- const config = {
- // 信任的标签(保持标签名不变)
- trustTags: makeMap("a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,ruby,rt,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video"),
- // 块级标签(转为 div,其他的非信任标签转为 span)
- blockTags: makeMap("address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section"),
- // 行内标签
- inlineTags: makeMap("abbr,b,big,code,del,em,i,ins,label,q,small,span,strong,sub,sup"),
- // 要移除的标签
- ignoreTags: makeMap("area,base,canvas,embed,frame,head,iframe,input,link,map,meta,param,rp,script,source,style,textarea,title,track,wbr"),
- // 自闭合的标签
- voidTags: makeMap("area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr"),
- // html 实体
- entities: {
- lt: "<",
- gt: ">",
- quot: '"',
- apos: "'",
- ensp: " ",
- emsp: " ",
- nbsp: " ",
- semi: ";",
- ndash: "–",
- mdash: "—",
- middot: "·",
- lsquo: "‘",
- rsquo: "’",
- ldquo: "“",
- rdquo: "”",
- bull: "•",
- hellip: "…",
- larr: "←",
- uarr: "↑",
- rarr: "→",
- darr: "↓"
- },
- // 默认的标签样式
- tagStyle: {
- address: "font-style:italic",
- big: "display:inline;font-size:1.2em",
- caption: "display:table-caption;text-align:center",
- center: "text-align:center",
- cite: "font-style:italic",
- dd: "margin-left:40px",
- mark: "background-color:yellow",
- pre: "font-family:monospace;white-space:pre",
- s: "text-decoration:line-through",
- small: "display:inline;font-size:0.8em",
- strike: "text-decoration:line-through",
- u: "text-decoration:underline"
- },
- // svg 大小写对照表
- svgDict: {
- animatetransform: "animateTransform",
- lineargradient: "linearGradient",
- viewbox: "viewBox",
- attributename: "attributeName",
- repeatcount: "repeatCount",
- repeatdur: "repeatDur"
- }
- };
- const tagSelector = {};
- const {
- windowWidth
- } = uni.getSystemInfoSync();
- const blankChar = makeMap(" ,\r,\n, ,\f");
- let idIndex = 0;
- config.ignoreTags.iframe = void 0;
- config.trustTags.iframe = true;
- config.ignoreTags.embed = void 0;
- config.trustTags.embed = true;
- function makeMap(str) {
- const map = /* @__PURE__ */ Object.create(null);
- const list = str.split(",");
- for (let i2 = list.length; i2--; ) {
- map[list[i2]] = true;
- }
- return map;
- }
- function decodeEntity(str, amp) {
- let i2 = str.indexOf("&");
- while (i2 !== -1) {
- const j2 = str.indexOf(";", i2 + 3);
- let code2;
- if (j2 === -1)
- break;
- if (str[i2 + 1] === "#") {
- code2 = parseInt((str[i2 + 2] === "x" ? "0" : "") + str.substring(i2 + 2, j2));
- if (!isNaN(code2)) {
- str = str.substr(0, i2) + String.fromCharCode(code2) + str.substr(j2 + 1);
- }
- } else {
- code2 = str.substring(i2 + 1, j2);
- if (config.entities[code2] || code2 === "amp" && amp) {
- str = str.substr(0, i2) + (config.entities[code2] || "&") + str.substr(j2 + 1);
- }
- }
- i2 = str.indexOf("&", i2 + 1);
- }
- return str;
- }
- function mergeNodes(nodes) {
- let i2 = nodes.length - 1;
- for (let j2 = i2; j2 >= -1; j2--) {
- if (j2 === -1 || nodes[j2].c || !nodes[j2].name || nodes[j2].name !== "div" && nodes[j2].name !== "p" && nodes[j2].name[0] !== "h" || (nodes[j2].attrs.style || "").includes("inline")) {
- if (i2 - j2 >= 5) {
- nodes.splice(j2 + 1, i2 - j2, {
- name: "div",
- attrs: {},
- children: nodes.slice(j2 + 1, i2 + 1)
- });
- }
- i2 = j2 - 1;
- }
- }
- }
- function Parser(vm) {
- this.options = vm || {};
- this.tagStyle = Object.assign({}, config.tagStyle, this.options.tagStyle);
- this.imgList = vm.imgList || [];
- this.imgList._unloadimgs = 0;
- this.plugins = vm.plugins || [];
- this.attrs = /* @__PURE__ */ Object.create(null);
- this.stack = [];
- this.nodes = [];
- this.pre = (this.options.containerStyle || "").includes("white-space") && this.options.containerStyle.includes("pre") ? 2 : 0;
- }
- Parser.prototype.parse = function(content) {
- for (let i2 = this.plugins.length; i2--; ) {
- if (this.plugins[i2].onUpdate) {
- content = this.plugins[i2].onUpdate(content, config) || content;
- }
- }
- new Lexer(this).parse(content);
- while (this.stack.length) {
- this.popNode();
- }
- if (this.nodes.length > 50) {
- mergeNodes(this.nodes);
- }
- return this.nodes;
- };
- Parser.prototype.expose = function() {
- for (let i2 = this.stack.length; i2--; ) {
- const item = this.stack[i2];
- if (item.c || item.name === "a" || item.name === "video" || item.name === "audio")
- return;
- item.c = 1;
- }
- };
- Parser.prototype.hook = function(node2) {
- for (let i2 = this.plugins.length; i2--; ) {
- if (this.plugins[i2].onParse && this.plugins[i2].onParse(node2, this) === false) {
- return false;
- }
- }
- return true;
- };
- Parser.prototype.getUrl = function(url2) {
- const domain = this.options.domain;
- if (url2[0] === "/") {
- if (url2[1] === "/") {
- url2 = (domain ? domain.split("://")[0] : "http") + ":" + url2;
- } else if (domain) {
- url2 = domain + url2;
- } else {
- url2 = plus.io.convertLocalFileSystemURL(url2);
- }
- } else if (!url2.includes("data:") && !url2.includes("://")) {
- if (domain) {
- url2 = domain + "/" + url2;
- } else {
- url2 = plus.io.convertLocalFileSystemURL(url2);
- }
- }
- return url2;
- };
- Parser.prototype.parseStyle = function(node2) {
- const attrs = node2.attrs;
- const list = (this.tagStyle[node2.name] || "").split(";").concat((attrs.style || "").split(";"));
- const styleObj = {};
- let tmp = "";
- if (attrs.id && !this.xml) {
- if (this.options.useAnchor) {
- this.expose();
- } else if (node2.name !== "img" && node2.name !== "a" && node2.name !== "video" && node2.name !== "audio") {
- attrs.id = void 0;
- }
- }
- if (attrs.width) {
- styleObj.width = parseFloat(attrs.width) + (attrs.width.includes("%") ? "%" : "px");
- attrs.width = void 0;
- }
- if (attrs.height) {
- styleObj.height = parseFloat(attrs.height) + (attrs.height.includes("%") ? "%" : "px");
- attrs.height = void 0;
- }
- for (let i2 = 0, len = list.length; i2 < len; i2++) {
- const info = list[i2].split(":");
- if (info.length < 2)
- continue;
- const key = info.shift().trim().toLowerCase();
- let value = info.join(":").trim();
- if (value[0] === "-" && value.lastIndexOf("-") > 0 || value.includes("safe")) {
- tmp += `;${key}:${value}`;
- } else if (!styleObj[key] || value.includes("import") || !styleObj[key].includes("import")) {
- if (value.includes("url")) {
- let j2 = value.indexOf("(") + 1;
- if (j2) {
- while (value[j2] === '"' || value[j2] === "'" || blankChar[value[j2]]) {
- j2++;
- }
- value = value.substr(0, j2) + this.getUrl(value.substr(j2));
- }
- } else if (value.includes("rpx")) {
- value = value.replace(/[0-9.]+\s*rpx/g, ($2) => parseFloat($2) * windowWidth / 750 + "px");
- }
- styleObj[key] = value;
- }
- }
- node2.attrs.style = tmp;
- return styleObj;
- };
- Parser.prototype.onTagName = function(name2) {
- this.tagName = this.xml ? name2 : name2.toLowerCase();
- if (this.tagName === "svg") {
- this.xml = (this.xml || 0) + 1;
- }
- };
- Parser.prototype.onAttrName = function(name2) {
- name2 = this.xml ? name2 : name2.toLowerCase();
- if (name2.substr(0, 5) === "data-") {
- if (name2 === "data-src" && !this.attrs.src) {
- this.attrName = "src";
- } else if (this.tagName === "img" || this.tagName === "a") {
- this.attrName = name2;
- } else {
- this.attrName = void 0;
- }
- } else {
- this.attrName = name2;
- this.attrs[name2] = "T";
- }
- };
- Parser.prototype.onAttrVal = function(val) {
- const name2 = this.attrName || "";
- if (name2 === "style" || name2 === "href") {
- this.attrs[name2] = decodeEntity(val, true);
- } else if (name2.includes("src")) {
- this.attrs[name2] = this.getUrl(decodeEntity(val, true));
- } else if (name2) {
- this.attrs[name2] = val;
- }
- };
- Parser.prototype.onOpenTag = function(selfClose) {
- const node2 = /* @__PURE__ */ Object.create(null);
- node2.name = this.tagName;
- node2.attrs = this.attrs;
- if (this.options.nodes.length) {
- node2.type = "node";
- }
- this.attrs = /* @__PURE__ */ Object.create(null);
- const attrs = node2.attrs;
- const parent2 = this.stack[this.stack.length - 1];
- const siblings = parent2 ? parent2.children : this.nodes;
- const close = this.xml ? selfClose : config.voidTags[node2.name];
- if (tagSelector[node2.name]) {
- attrs.class = tagSelector[node2.name] + (attrs.class ? " " + attrs.class : "");
- }
- if (node2.name === "embed") {
- this.expose();
- }
- if (node2.name === "video" || node2.name === "audio") {
- if (node2.name === "video" && !attrs.id) {
- attrs.id = "v" + idIndex++;
- }
- if (!attrs.controls && !attrs.autoplay) {
- attrs.controls = "T";
- }
- node2.src = [];
- if (attrs.src) {
- node2.src.push(attrs.src);
- attrs.src = void 0;
- }
- this.expose();
- }
- if (close) {
- if (!this.hook(node2) || config.ignoreTags[node2.name]) {
- if (node2.name === "base" && !this.options.domain) {
- this.options.domain = attrs.href;
- } else if (node2.name === "source" && parent2 && (parent2.name === "video" || parent2.name === "audio") && attrs.src) {
- parent2.src.push(attrs.src);
- }
- return;
- }
- const styleObj = this.parseStyle(node2);
- if (node2.name === "img") {
- if (attrs.src) {
- if (attrs.src.includes("webp")) {
- node2.webp = "T";
- }
- if (attrs.src.includes("data:") && !attrs["original-src"]) {
- attrs.ignore = "T";
- }
- if (!attrs.ignore || node2.webp || attrs.src.includes("cloud://")) {
- for (let i2 = this.stack.length; i2--; ) {
- const item = this.stack[i2];
- if (item.name === "a") {
- node2.a = item.attrs;
- }
- if (item.name === "table" && !node2.webp && !attrs.src.includes("cloud://")) {
- if (!styleObj.display || styleObj.display.includes("inline")) {
- node2.t = "inline-block";
- } else {
- node2.t = styleObj.display;
- }
- styleObj.display = void 0;
- }
- item.c = 1;
- }
- attrs.i = this.imgList.length.toString();
- let src = attrs["original-src"] || attrs.src;
- this.imgList.push(src);
- if (!node2.t) {
- this.imgList._unloadimgs += 1;
- }
- if (this.options.lazyLoad) {
- attrs["data-src"] = attrs.src;
- attrs.src = void 0;
- }
- }
- }
- if (styleObj.display === "inline") {
- styleObj.display = "";
- }
- if (attrs.ignore) {
- styleObj["max-width"] = styleObj["max-width"] || "100%";
- attrs.style += ";-webkit-touch-callout:none";
- }
- if (parseInt(styleObj.width) > windowWidth) {
- styleObj.height = void 0;
- }
- if (!isNaN(parseInt(styleObj.width))) {
- node2.w = "T";
- }
- if (!isNaN(parseInt(styleObj.height)) && (!styleObj.height.includes("%") || parent2 && (parent2.attrs.style || "").includes("height"))) {
- node2.h = "T";
- }
- } else if (node2.name === "svg") {
- siblings.push(node2);
- this.stack.push(node2);
- this.popNode();
- return;
- }
- for (const key in styleObj) {
- if (styleObj[key]) {
- attrs.style += `;${key}:${styleObj[key].replace(" !important", "")}`;
- }
- }
- attrs.style = attrs.style.substr(1) || void 0;
- } else {
- if ((node2.name === "pre" || (attrs.style || "").includes("white-space") && attrs.style.includes("pre")) && this.pre !== 2) {
- this.pre = node2.pre = 1;
- }
- node2.children = [];
- this.stack.push(node2);
- }
- siblings.push(node2);
- };
- Parser.prototype.onCloseTag = function(name2) {
- name2 = this.xml ? name2 : name2.toLowerCase();
- let i2;
- for (i2 = this.stack.length; i2--; ) {
- if (this.stack[i2].name === name2)
- break;
- }
- if (i2 !== -1) {
- while (this.stack.length > i2) {
- this.popNode();
- }
- } else if (name2 === "p" || name2 === "br") {
- const siblings = this.stack.length ? this.stack[this.stack.length - 1].children : this.nodes;
- siblings.push({
- name: name2,
- attrs: {
- class: tagSelector[name2] || "",
- style: this.tagStyle[name2] || ""
- }
- });
- }
- };
- Parser.prototype.popNode = function() {
- const node2 = this.stack.pop();
- let attrs = node2.attrs;
- const children = node2.children;
- const parent2 = this.stack[this.stack.length - 1];
- const siblings = parent2 ? parent2.children : this.nodes;
- if (!this.hook(node2) || config.ignoreTags[node2.name]) {
- if (node2.name === "title" && children.length && children[0].type === "text" && this.options.setTitle) {
- uni.setNavigationBarTitle({
- title: children[0].text
- });
- }
- siblings.pop();
- return;
- }
- if (node2.pre && this.pre !== 2) {
- this.pre = node2.pre = void 0;
- for (let i2 = this.stack.length; i2--; ) {
- if (this.stack[i2].pre) {
- this.pre = 1;
- }
- }
- }
- const styleObj = {};
- if (node2.name === "svg") {
- if (this.xml > 1) {
- this.xml--;
- return;
- }
- let src = "";
- const style = attrs.style;
- attrs.style = "";
- attrs.xmlns = "http://www.w3.org/2000/svg";
- (function traversal(node3) {
- if (node3.type === "text") {
- src += node3.text;
- return;
- }
- const name2 = config.svgDict[node3.name] || node3.name;
- src += "<" + name2;
- for (const item in node3.attrs) {
- const val = node3.attrs[item];
- if (val) {
- src += ` ${config.svgDict[item] || item}="${val}"`;
- }
- }
- if (!node3.children) {
- src += "/>";
- } else {
- src += ">";
- for (let i2 = 0; i2 < node3.children.length; i2++) {
- traversal(node3.children[i2]);
- }
- src += "</" + name2 + ">";
- }
- })(node2);
- node2.name = "img";
- node2.attrs = {
- src: "data:image/svg+xml;utf8," + src.replace(/#/g, "%23"),
- style,
- ignore: "T"
- };
- node2.children = void 0;
- this.xml = false;
- return;
- }
- if (attrs.align) {
- if (node2.name === "table") {
- if (attrs.align === "center") {
- styleObj["margin-inline-start"] = styleObj["margin-inline-end"] = "auto";
- } else {
- styleObj.float = attrs.align;
- }
- } else {
- styleObj["text-align"] = attrs.align;
- }
- attrs.align = void 0;
- }
- if (attrs.dir) {
- styleObj.direction = attrs.dir;
- attrs.dir = void 0;
- }
- if (node2.name === "font") {
- if (attrs.color) {
- styleObj.color = attrs.color;
- attrs.color = void 0;
- }
- if (attrs.face) {
- styleObj["font-family"] = attrs.face;
- attrs.face = void 0;
- }
- if (attrs.size) {
- let size = parseInt(attrs.size);
- if (!isNaN(size)) {
- if (size < 1) {
- size = 1;
- } else if (size > 7) {
- size = 7;
- }
- styleObj["font-size"] = ["x-small", "small", "medium", "large", "x-large", "xx-large", "xxx-large"][size - 1];
- }
- attrs.size = void 0;
- }
- }
- if ((attrs.class || "").includes("align-center")) {
- styleObj["text-align"] = "center";
- }
- Object.assign(styleObj, this.parseStyle(node2));
- if (node2.name !== "table" && parseInt(styleObj.width) > windowWidth) {
- styleObj["max-width"] = "100%";
- styleObj["box-sizing"] = "border-box";
- }
- if (config.blockTags[node2.name]) {
- node2.name = "div";
- } else if (!config.trustTags[node2.name] && !this.xml) {
- node2.name = "span";
- }
- if (node2.name === "a" || node2.name === "ad" || node2.name === "iframe") {
- this.expose();
- } else if (node2.name === "video") {
- if ((styleObj.height || "").includes("auto")) {
- styleObj.height = void 0;
- }
- let str = '<video style="width:100%;height:100%"';
- for (const item in attrs) {
- if (attrs[item]) {
- str += " " + item + '="' + attrs[item] + '"';
- }
- }
- if (this.options.pauseVideo) {
- str += ` onplay="this.dispatchEvent(new CustomEvent('vplay',{bubbles:!0}));for(var e=document.getElementsByTagName('video'),t=0;t<e.length;t++)e[t]!=this&&e[t].pause()"`;
- }
- str += ">";
- for (let i2 = 0; i2 < node2.src.length; i2++) {
- str += '<source src="' + node2.src[i2] + '">';
- }
- str += "</video>";
- node2.html = str;
- } else if ((node2.name === "ul" || node2.name === "ol") && node2.c) {
- const types2 = {
- a: "lower-alpha",
- A: "upper-alpha",
- i: "lower-roman",
- I: "upper-roman"
- };
- if (types2[attrs.type]) {
- attrs.style += ";list-style-type:" + types2[attrs.type];
- attrs.type = void 0;
- }
- for (let i2 = children.length; i2--; ) {
- if (children[i2].name === "li") {
- children[i2].c = 1;
- }
- }
- } else if (node2.name === "table") {
- let padding = parseFloat(attrs.cellpadding);
- let spacing = parseFloat(attrs.cellspacing);
- const border = parseFloat(attrs.border);
- const bordercolor = styleObj["border-color"];
- const borderstyle = styleObj["border-style"];
- if (node2.c) {
- if (isNaN(padding)) {
- padding = 2;
- }
- if (isNaN(spacing)) {
- spacing = 2;
- }
- }
- if (border) {
- attrs.style += `;border:${border}px ${borderstyle || "solid"} ${bordercolor || "gray"}`;
- }
- if (node2.flag && node2.c) {
- styleObj.display = "grid";
- if (spacing) {
- styleObj["grid-gap"] = spacing + "px";
- styleObj.padding = spacing + "px";
- } else if (border) {
- attrs.style += ";border-left:0;border-top:0";
- }
- const width = [];
- const trList = [];
- const cells = [];
- const map = {};
- (function traversal(nodes) {
- for (let i2 = 0; i2 < nodes.length; i2++) {
- if (nodes[i2].name === "tr") {
- trList.push(nodes[i2]);
- } else {
- traversal(nodes[i2].children || []);
- }
- }
- })(children);
- for (let row = 1; row <= trList.length; row++) {
- let col = 1;
- for (let j2 = 0; j2 < trList[row - 1].children.length; j2++) {
- const td = trList[row - 1].children[j2];
- if (td.name === "td" || td.name === "th") {
- while (map[row + "." + col]) {
- col++;
- }
- let style = td.attrs.style || "";
- let start = style.indexOf("width") ? style.indexOf(";width") : 0;
- if (start !== -1) {
- let end = style.indexOf(";", start + 6);
- if (end === -1) {
- end = style.length;
- }
- if (!td.attrs.colspan) {
- width[col] = style.substring(start ? start + 7 : 6, end);
- }
- style = style.substr(0, start) + style.substr(end);
- }
- style += ";display:flex";
- start = style.indexOf("vertical-align");
- if (start !== -1) {
- const val = style.substr(start + 15, 10);
- if (val.includes("middle")) {
- style += ";align-items:center";
- } else if (val.includes("bottom")) {
- style += ";align-items:flex-end";
- }
- } else {
- style += ";align-items:center";
- }
- start = style.indexOf("text-align");
- if (start !== -1) {
- const val = style.substr(start + 11, 10);
- if (val.includes("center")) {
- style += ";justify-content: center";
- } else if (val.includes("right")) {
- style += ";justify-content: right";
- }
- }
- style = (border ? `;border:${border}px ${borderstyle || "solid"} ${bordercolor || "gray"}` + (spacing ? "" : ";border-right:0;border-bottom:0") : "") + (padding ? `;padding:${padding}px` : "") + ";" + style;
- if (td.attrs.colspan) {
- style += `;grid-column-start:${col};grid-column-end:${col + parseInt(td.attrs.colspan)}`;
- if (!td.attrs.rowspan) {
- style += `;grid-row-start:${row};grid-row-end:${row + 1}`;
- }
- col += parseInt(td.attrs.colspan) - 1;
- }
- if (td.attrs.rowspan) {
- style += `;grid-row-start:${row};grid-row-end:${row + parseInt(td.attrs.rowspan)}`;
- if (!td.attrs.colspan) {
- style += `;grid-column-start:${col};grid-column-end:${col + 1}`;
- }
- for (let rowspan = 1; rowspan < td.attrs.rowspan; rowspan++) {
- for (let colspan = 0; colspan < (td.attrs.colspan || 1); colspan++) {
- map[row + rowspan + "." + (col - colspan)] = 1;
- }
- }
- }
- if (style) {
- td.attrs.style = style;
- }
- cells.push(td);
- col++;
- }
- }
- if (row === 1) {
- let temp = "";
- for (let i2 = 1; i2 < col; i2++) {
- temp += (width[i2] ? width[i2] : "auto") + " ";
- }
- styleObj["grid-template-columns"] = temp;
- }
- }
- node2.children = cells;
- } else {
- if (node2.c) {
- styleObj.display = "table";
- }
- if (!isNaN(spacing)) {
- styleObj["border-spacing"] = spacing + "px";
- }
- if (border || padding) {
- (function traversal(nodes) {
- for (let i2 = 0; i2 < nodes.length; i2++) {
- const td = nodes[i2];
- if (td.name === "th" || td.name === "td") {
- if (border) {
- td.attrs.style = `border:${border}px ${borderstyle || "solid"} ${bordercolor || "gray"};${td.attrs.style || ""}`;
- }
- if (padding) {
- td.attrs.style = `padding:${padding}px;${td.attrs.style || ""}`;
- }
- } else if (td.children) {
- traversal(td.children);
- }
- }
- })(children);
- }
- }
- if (this.options.scrollTable && !(attrs.style || "").includes("inline")) {
- const table = Object.assign({}, node2);
- node2.name = "div";
- node2.attrs = {
- style: "overflow:auto"
- };
- node2.children = [table];
- attrs = table.attrs;
- }
- } else if ((node2.name === "td" || node2.name === "th") && (attrs.colspan || attrs.rowspan)) {
- for (let i2 = this.stack.length; i2--; ) {
- if (this.stack[i2].name === "table") {
- this.stack[i2].flag = 1;
- break;
- }
- }
- } else if (node2.name === "ruby") {
- node2.name = "span";
- for (let i2 = 0; i2 < children.length - 1; i2++) {
- if (children[i2].type === "text" && children[i2 + 1].name === "rt") {
- children[i2] = {
- name: "div",
- attrs: {
- style: "display:inline-block;text-align:center"
- },
- children: [{
- name: "div",
- attrs: {
- style: "font-size:50%;" + (children[i2 + 1].attrs.style || "")
- },
- children: children[i2 + 1].children
- }, children[i2]]
- };
- children.splice(i2 + 1, 1);
- }
- }
- } else if (node2.c) {
- (function traversal(node3) {
- node3.c = 2;
- for (let i2 = node3.children.length; i2--; ) {
- const child = node3.children[i2];
- if (child.name && (config.inlineTags[child.name] || (child.attrs.style || "").includes("inline") && child.children) && !child.c) {
- traversal(child);
- }
- if (!child.c || child.name === "table") {
- node3.c = 1;
- }
- }
- })(node2);
- }
- if ((styleObj.display || "").includes("flex") && !node2.c) {
- for (let i2 = children.length; i2--; ) {
- const item = children[i2];
- if (item.f) {
- item.attrs.style = (item.attrs.style || "") + item.f;
- item.f = void 0;
- }
- }
- }
- const flex = parent2 && ((parent2.attrs.style || "").includes("flex") || (parent2.attrs.style || "").includes("grid")) && !node2.c;
- if (flex) {
- node2.f = ";max-width:100%";
- }
- if (children.length >= 50 && node2.c && !(styleObj.display || "").includes("flex")) {
- mergeNodes(children);
- }
- for (const key in styleObj) {
- if (styleObj[key]) {
- const val = `;${key}:${styleObj[key].replace(" !important", "")}`;
- if (flex && (key.includes("flex") && key !== "flex-direction" || key === "align-self" || key.includes("grid") || styleObj[key][0] === "-" || key.includes("width") && val.includes("%"))) {
- node2.f += val;
- if (key === "width") {
- attrs.style += ";width:100%";
- }
- } else {
- attrs.style += val;
- }
- }
- }
- attrs.style = attrs.style.substr(1) || void 0;
- };
- Parser.prototype.onText = function(text) {
- if (!this.pre) {
- let trim2 = "";
- let flag2;
- for (let i2 = 0, len = text.length; i2 < len; i2++) {
- if (!blankChar[text[i2]]) {
- trim2 += text[i2];
- } else {
- if (trim2[trim2.length - 1] !== " ") {
- trim2 += " ";
- }
- if (text[i2] === "\n" && !flag2) {
- flag2 = true;
- }
- }
- }
- if (trim2 === " ") {
- if (flag2)
- return;
- else {
- const parent2 = this.stack[this.stack.length - 1];
- if (parent2 && parent2.name[0] === "t")
- return;
- }
- }
- text = trim2;
- }
- const node2 = /* @__PURE__ */ Object.create(null);
- node2.type = "text";
- node2.text = decodeEntity(text);
- if (this.hook(node2)) {
- const siblings = this.stack.length ? this.stack[this.stack.length - 1].children : this.nodes;
- siblings.push(node2);
- }
- };
- function Lexer(handler) {
- this.handler = handler;
- }
- Lexer.prototype.parse = function(content) {
- this.content = content || "";
- this.i = 0;
- this.start = 0;
- this.state = this.text;
- for (let len = this.content.length; this.i !== -1 && this.i < len; ) {
- this.state();
- }
- };
- Lexer.prototype.checkClose = function(method) {
- const selfClose = this.content[this.i] === "/";
- if (this.content[this.i] === ">" || selfClose && this.content[this.i + 1] === ">") {
- if (method) {
- this.handler[method](this.content.substring(this.start, this.i));
- }
- this.i += selfClose ? 2 : 1;
- this.start = this.i;
- this.handler.onOpenTag(selfClose);
- if (this.handler.tagName === "script") {
- this.i = this.content.indexOf("</", this.i);
- if (this.i !== -1) {
- this.i += 2;
- this.start = this.i;
- }
- this.state = this.endTag;
- } else {
- this.state = this.text;
- }
- return true;
- }
- return false;
- };
- Lexer.prototype.text = function() {
- this.i = this.content.indexOf("<", this.i);
- if (this.i === -1) {
- if (this.start < this.content.length) {
- this.handler.onText(this.content.substring(this.start, this.content.length));
- }
- return;
- }
- const c2 = this.content[this.i + 1];
- if (c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z") {
- if (this.start !== this.i) {
- this.handler.onText(this.content.substring(this.start, this.i));
- }
- this.start = ++this.i;
- this.state = this.tagName;
- } else if (c2 === "/" || c2 === "!" || c2 === "?") {
- if (this.start !== this.i) {
- this.handler.onText(this.content.substring(this.start, this.i));
- }
- const next = this.content[this.i + 2];
- if (c2 === "/" && (next >= "a" && next <= "z" || next >= "A" && next <= "Z")) {
- this.i += 2;
- this.start = this.i;
- this.state = this.endTag;
- return;
- }
- let end = "-->";
- if (c2 !== "!" || this.content[this.i + 2] !== "-" || this.content[this.i + 3] !== "-") {
- end = ">";
- }
- this.i = this.content.indexOf(end, this.i);
- if (this.i !== -1) {
- this.i += end.length;
- this.start = this.i;
- }
- } else {
- this.i++;
- }
- };
- Lexer.prototype.tagName = function() {
- if (blankChar[this.content[this.i]]) {
- this.handler.onTagName(this.content.substring(this.start, this.i));
- while (blankChar[this.content[++this.i]])
- ;
- if (this.i < this.content.length && !this.checkClose()) {
- this.start = this.i;
- this.state = this.attrName;
- }
- } else if (!this.checkClose("onTagName")) {
- this.i++;
- }
- };
- Lexer.prototype.attrName = function() {
- let c2 = this.content[this.i];
- if (blankChar[c2] || c2 === "=") {
- this.handler.onAttrName(this.content.substring(this.start, this.i));
- let needVal = c2 === "=";
- const len = this.content.length;
- while (++this.i < len) {
- c2 = this.content[this.i];
- if (!blankChar[c2]) {
- if (this.checkClose())
- return;
- if (needVal) {
- this.start = this.i;
- this.state = this.attrVal;
- return;
- }
- if (this.content[this.i] === "=") {
- needVal = true;
- } else {
- this.start = this.i;
- this.state = this.attrName;
- return;
- }
- }
- }
- } else if (!this.checkClose("onAttrName")) {
- this.i++;
- }
- };
- Lexer.prototype.attrVal = function() {
- const c2 = this.content[this.i];
- const len = this.content.length;
- if (c2 === '"' || c2 === "'") {
- this.start = ++this.i;
- this.i = this.content.indexOf(c2, this.i);
- if (this.i === -1)
- return;
- this.handler.onAttrVal(this.content.substring(this.start, this.i));
- } else {
- for (; this.i < len; this.i++) {
- if (blankChar[this.content[this.i]]) {
- this.handler.onAttrVal(this.content.substring(this.start, this.i));
- break;
- } else if (this.checkClose("onAttrVal"))
- return;
- }
- }
- while (blankChar[this.content[++this.i]])
- ;
- if (this.i < len && !this.checkClose()) {
- this.start = this.i;
- this.state = this.attrName;
- }
- };
- Lexer.prototype.endTag = function() {
- const c2 = this.content[this.i];
- if (blankChar[c2] || c2 === ">" || c2 === "/") {
- this.handler.onCloseTag(this.content.substring(this.start, this.i));
- if (c2 !== ">") {
- this.i = this.content.indexOf(">", this.i);
- if (this.i === -1)
- return;
- }
- this.start = ++this.i;
- this.state = this.text;
- } else {
- this.i++;
- }
- };
- const plugins = [];
- const _sfc_main$3o = {
- name: "mp-html",
- data() {
- return {
- nodes: []
- };
- },
- props: {
- containerStyle: {
- type: String,
- default: ""
- },
- content: {
- type: String,
- default: ""
- },
- copyLink: {
- type: [Boolean, String],
- default: true
- },
- domain: String,
- errorImg: {
- type: String,
- default: ""
- },
- lazyLoad: {
- type: [Boolean, String],
- default: false
- },
- loadingImg: {
- type: String,
- default: ""
- },
- pauseVideo: {
- type: [Boolean, String],
- default: true
- },
- previewImg: {
- type: [Boolean, String],
- default: true
- },
- scrollTable: [Boolean, String],
- selectable: [Boolean, String],
- setTitle: {
- type: [Boolean, String],
- default: true
- },
- showImgMenu: {
- type: [Boolean, String],
- default: true
- },
- tagStyle: Object,
- useAnchor: [Boolean, Number]
- },
- emits: ["load", "ready", "imgtap", "linktap", "play", "error"],
- components: {
- node
- },
- watch: {
- content(content) {
- this.setContent(content);
- }
- },
- created() {
- this.plugins = [];
- for (let i2 = plugins.length; i2--; ) {
- this.plugins.push(new plugins[i2](this));
- }
- },
- mounted() {
- if (this.content && !this.nodes.length) {
- this.setContent(this.content);
- }
- },
- beforeDestroy() {
- this._hook("onDetached");
- },
- methods: {
- /**
- * @description 将锚点跳转的范围限定在一个 scroll-view 内
- * @param {Object} page scroll-view 所在页面的示例
- * @param {String} selector scroll-view 的选择器
- * @param {String} scrollTop scroll-view scroll-top 属性绑定的变量名
- */
- in(page2, selector, scrollTop) {
- if (page2 && selector && scrollTop) {
- this._in = {
- page: page2,
- selector,
- scrollTop
- };
- }
- },
- /**
- * @description 锚点跳转
- * @param {String} id 要跳转的锚点 id
- * @param {Number} offset 跳转位置的偏移量
- * @returns {Promise}
- */
- navigateTo(id, offset) {
- return new Promise((resolve, reject) => {
- if (!this.useAnchor) {
- reject(Error("Anchor is disabled"));
- return;
- }
- offset = offset || parseInt(this.useAnchor) || 0;
- let deep = " ";
- const selector = uni.createSelectorQuery().in(this._in ? this._in.page : this).select((this._in ? this._in.selector : "._root") + (id ? `${deep}#${id}` : "")).boundingClientRect();
- if (this._in) {
- selector.select(this._in.selector).scrollOffset().select(this._in.selector).boundingClientRect();
- } else {
- selector.selectViewport().scrollOffset();
- }
- selector.exec((res) => {
- if (!res[0]) {
- reject(Error("Label not found"));
- return;
- }
- const scrollTop = res[1].scrollTop + res[0].top - (res[2] ? res[2].top : 0) + offset;
- if (this._in) {
- this._in.page[this._in.scrollTop] = scrollTop;
- } else {
- uni.pageScrollTo({
- scrollTop,
- duration: 300
- });
- }
- resolve();
- });
- });
- },
- /**
- * @description 获取文本内容
- * @return {String}
- */
- getText(nodes) {
- let text = "";
- (function traversal(nodes2) {
- for (let i2 = 0; i2 < nodes2.length; i2++) {
- const node2 = nodes2[i2];
- if (node2.type === "text") {
- text += node2.text.replace(/&/g, "&");
- } else if (node2.name === "br") {
- text += "\n";
- } else {
- const isBlock = node2.name === "p" || node2.name === "div" || node2.name === "tr" || node2.name === "li" || node2.name[0] === "h" && node2.name[1] > "0" && node2.name[1] < "7";
- if (isBlock && text && text[text.length - 1] !== "\n") {
- text += "\n";
- }
- if (node2.children) {
- traversal(node2.children);
- }
- if (isBlock && text[text.length - 1] !== "\n") {
- text += "\n";
- } else if (node2.name === "td" || node2.name === "th") {
- text += " ";
- }
- }
- }
- })(nodes || this.nodes);
- return text;
- },
- /**
- * @description 获取内容大小和位置
- * @return {Promise}
- */
- getRect() {
- return new Promise((resolve, reject) => {
- uni.createSelectorQuery().in(this).select("#_root").boundingClientRect().exec((res) => res[0] ? resolve(res[0]) : reject(Error("Root label not found")));
- });
- },
- /**
- * @description 暂停播放媒体
- */
- pauseMedia() {
- for (let i2 = (this._videos || []).length; i2--; ) {
- this._videos[i2].pause();
- }
- const command = 'for(var e=document.getElementsByTagName("video"),i=e.length;i--;)e[i].pause()';
- let page2 = this.$parent;
- while (!page2.$scope)
- page2 = page2.$parent;
- page2.$scope.$getAppWebview().evalJS(command);
- },
- /**
- * @description 设置媒体播放速率
- * @param {Number} rate 播放速率
- */
- setPlaybackRate(rate) {
- this.playbackRate = rate;
- for (let i2 = (this._videos || []).length; i2--; ) {
- this._videos[i2].playbackRate(rate);
- }
- const command = 'for(var e=document.getElementsByTagName("video"),i=e.length;i--;)e[i].playbackRate=' + rate;
- let page2 = this.$parent;
- while (!page2.$scope)
- page2 = page2.$parent;
- page2.$scope.$getAppWebview().evalJS(command);
- },
- /**
- * @description 设置内容
- * @param {String} content html 内容
- * @param {Boolean} append 是否在尾部追加
- */
- setContent(content, append) {
- if (!append || !this.imgList) {
- this.imgList = [];
- }
- const nodes = new Parser(this).parse(content);
- this.$set(this, "nodes", append ? (this.nodes || []).concat(nodes) : nodes);
- this._videos = [];
- this.$nextTick(() => {
- this._hook("onLoad");
- this.$emit("load");
- });
- if (this.lazyLoad || this.imgList._unloadimgs < this.imgList.length / 2) {
- let height = 0;
- const callback = (rect) => {
- if (!rect || !rect.height)
- rect = {};
- if (rect.height === height) {
- this.$emit("ready", rect);
- } else {
- height = rect.height;
- setTimeout(() => {
- this.getRect().then(callback).catch(callback);
- }, 350);
- }
- };
- this.getRect().then(callback).catch(callback);
- } else {
- if (!this.imgList._unloadimgs) {
- this.getRect().then((rect) => {
- this.$emit("ready", rect);
- }).catch(() => {
- this.$emit("ready", {});
- });
- }
- }
- },
- /**
- * @description 调用插件钩子函数
- */
- _hook(name2) {
- for (let i2 = plugins.length; i2--; ) {
- if (this.plugins[i2][name2]) {
- this.plugins[i2][name2]();
- }
- }
- }
- }
- };
- function _sfc_render$3n(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_node = vue.resolveComponent("node");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- id: "_root",
- class: vue.normalizeClass(($props.selectable ? "_select " : "") + "_root"),
- style: vue.normalizeStyle($props.containerStyle)
- },
- [
- !$data.nodes[0] ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createBlock(_component_node, {
- key: 1,
- childs: $data.nodes,
- opts: [$props.lazyLoad, $props.loadingImg, $props.errorImg, $props.showImgMenu, $props.selectable],
- name: "span"
- }, null, 8, ["childs", "opts"]))
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_0$r = /* @__PURE__ */ _export_sfc(_sfc_main$3o, [["render", _sfc_render$3n], ["__scopeId", "data-v-a290f043"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/mp-html/components/mp-html/mp-html.vue"]]);
- const _sfc_main$3n = {
- __name: "su-status-bar",
- setup(__props, { expose: __expose }) {
- __expose();
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight + "px";
- const __returned__ = { statusBarHeight, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3m(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle({ height: $setup.statusBarHeight }),
- class: "uni-status-bar"
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_0$q = /* @__PURE__ */ _export_sfc(_sfc_main$3n, [["render", _sfc_render$3m], ["__scopeId", "data-v-78e027a3"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-status-bar/su-status-bar.vue"]]);
- const icons = {
- "id": "2852637",
- "name": "uniui图标库",
- "font_family": "uniicons",
- "css_prefix_text": "uniui-",
- "description": "",
- "glyphs": [
- {
- "icon_id": "25027049",
- "name": "yanse",
- "font_class": "color",
- "unicode": "e6cf",
- "unicode_decimal": 59087
- },
- {
- "icon_id": "25027048",
- "name": "wallet",
- "font_class": "wallet",
- "unicode": "e6b1",
- "unicode_decimal": 59057
- },
- {
- "icon_id": "25015720",
- "name": "settings-filled",
- "font_class": "settings-filled",
- "unicode": "e6ce",
- "unicode_decimal": 59086
- },
- {
- "icon_id": "25015434",
- "name": "shimingrenzheng-filled",
- "font_class": "auth-filled",
- "unicode": "e6cc",
- "unicode_decimal": 59084
- },
- {
- "icon_id": "24934246",
- "name": "shop-filled",
- "font_class": "shop-filled",
- "unicode": "e6cd",
- "unicode_decimal": 59085
- },
- {
- "icon_id": "24934159",
- "name": "staff-filled-01",
- "font_class": "staff-filled",
- "unicode": "e6cb",
- "unicode_decimal": 59083
- },
- {
- "icon_id": "24932461",
- "name": "VIP-filled",
- "font_class": "vip-filled",
- "unicode": "e6c6",
- "unicode_decimal": 59078
- },
- {
- "icon_id": "24932462",
- "name": "plus_circle_fill",
- "font_class": "plus-filled",
- "unicode": "e6c7",
- "unicode_decimal": 59079
- },
- {
- "icon_id": "24932463",
- "name": "folder_add-filled",
- "font_class": "folder-add-filled",
- "unicode": "e6c8",
- "unicode_decimal": 59080
- },
- {
- "icon_id": "24932464",
- "name": "yanse-filled",
- "font_class": "color-filled",
- "unicode": "e6c9",
- "unicode_decimal": 59081
- },
- {
- "icon_id": "24932465",
- "name": "tune-filled",
- "font_class": "tune-filled",
- "unicode": "e6ca",
- "unicode_decimal": 59082
- },
- {
- "icon_id": "24932455",
- "name": "a-rilidaka-filled",
- "font_class": "calendar-filled",
- "unicode": "e6c0",
- "unicode_decimal": 59072
- },
- {
- "icon_id": "24932456",
- "name": "notification-filled",
- "font_class": "notification-filled",
- "unicode": "e6c1",
- "unicode_decimal": 59073
- },
- {
- "icon_id": "24932457",
- "name": "wallet-filled",
- "font_class": "wallet-filled",
- "unicode": "e6c2",
- "unicode_decimal": 59074
- },
- {
- "icon_id": "24932458",
- "name": "paihangbang-filled",
- "font_class": "medal-filled",
- "unicode": "e6c3",
- "unicode_decimal": 59075
- },
- {
- "icon_id": "24932459",
- "name": "gift-filled",
- "font_class": "gift-filled",
- "unicode": "e6c4",
- "unicode_decimal": 59076
- },
- {
- "icon_id": "24932460",
- "name": "fire-filled",
- "font_class": "fire-filled",
- "unicode": "e6c5",
- "unicode_decimal": 59077
- },
- {
- "icon_id": "24928001",
- "name": "refreshempty",
- "font_class": "refreshempty",
- "unicode": "e6bf",
- "unicode_decimal": 59071
- },
- {
- "icon_id": "24926853",
- "name": "location-ellipse",
- "font_class": "location-filled",
- "unicode": "e6af",
- "unicode_decimal": 59055
- },
- {
- "icon_id": "24926735",
- "name": "person-filled",
- "font_class": "person-filled",
- "unicode": "e69d",
- "unicode_decimal": 59037
- },
- {
- "icon_id": "24926703",
- "name": "personadd-filled",
- "font_class": "personadd-filled",
- "unicode": "e698",
- "unicode_decimal": 59032
- },
- {
- "icon_id": "24923351",
- "name": "back",
- "font_class": "back",
- "unicode": "e6b9",
- "unicode_decimal": 59065
- },
- {
- "icon_id": "24923352",
- "name": "forward",
- "font_class": "forward",
- "unicode": "e6ba",
- "unicode_decimal": 59066
- },
- {
- "icon_id": "24923353",
- "name": "arrowthinright",
- "font_class": "arrow-right",
- "unicode": "e6bb",
- "unicode_decimal": 59067
- },
- {
- "icon_id": "24923353",
- "name": "arrowthinright",
- "font_class": "arrowthinright",
- "unicode": "e6bb",
- "unicode_decimal": 59067
- },
- {
- "icon_id": "24923354",
- "name": "arrowthinleft",
- "font_class": "arrow-left",
- "unicode": "e6bc",
- "unicode_decimal": 59068
- },
- {
- "icon_id": "24923354",
- "name": "arrowthinleft",
- "font_class": "arrowthinleft",
- "unicode": "e6bc",
- "unicode_decimal": 59068
- },
- {
- "icon_id": "24923355",
- "name": "arrowthinup",
- "font_class": "arrow-up",
- "unicode": "e6bd",
- "unicode_decimal": 59069
- },
- {
- "icon_id": "24923355",
- "name": "arrowthinup",
- "font_class": "arrowthinup",
- "unicode": "e6bd",
- "unicode_decimal": 59069
- },
- {
- "icon_id": "24923356",
- "name": "arrowthindown",
- "font_class": "arrow-down",
- "unicode": "e6be",
- "unicode_decimal": 59070
- },
- {
- "icon_id": "24923356",
- "name": "arrowthindown",
- "font_class": "arrowthindown",
- "unicode": "e6be",
- "unicode_decimal": 59070
- },
- {
- "icon_id": "24923349",
- "name": "arrowdown",
- "font_class": "bottom",
- "unicode": "e6b8",
- "unicode_decimal": 59064
- },
- {
- "icon_id": "24923349",
- "name": "arrowdown",
- "font_class": "arrowdown",
- "unicode": "e6b8",
- "unicode_decimal": 59064
- },
- {
- "icon_id": "24923346",
- "name": "arrowright",
- "font_class": "right",
- "unicode": "e6b5",
- "unicode_decimal": 59061
- },
- {
- "icon_id": "24923346",
- "name": "arrowright",
- "font_class": "arrowright",
- "unicode": "e6b5",
- "unicode_decimal": 59061
- },
- {
- "icon_id": "24923347",
- "name": "arrowup",
- "font_class": "top",
- "unicode": "e6b6",
- "unicode_decimal": 59062
- },
- {
- "icon_id": "24923347",
- "name": "arrowup",
- "font_class": "arrowup",
- "unicode": "e6b6",
- "unicode_decimal": 59062
- },
- {
- "icon_id": "24923348",
- "name": "arrowleft",
- "font_class": "left",
- "unicode": "e6b7",
- "unicode_decimal": 59063
- },
- {
- "icon_id": "24923348",
- "name": "arrowleft",
- "font_class": "arrowleft",
- "unicode": "e6b7",
- "unicode_decimal": 59063
- },
- {
- "icon_id": "24923334",
- "name": "eye",
- "font_class": "eye",
- "unicode": "e651",
- "unicode_decimal": 58961
- },
- {
- "icon_id": "24923335",
- "name": "eye-filled",
- "font_class": "eye-filled",
- "unicode": "e66a",
- "unicode_decimal": 58986
- },
- {
- "icon_id": "24923336",
- "name": "eye-slash",
- "font_class": "eye-slash",
- "unicode": "e6b3",
- "unicode_decimal": 59059
- },
- {
- "icon_id": "24923337",
- "name": "eye-slash-filled",
- "font_class": "eye-slash-filled",
- "unicode": "e6b4",
- "unicode_decimal": 59060
- },
- {
- "icon_id": "24923305",
- "name": "info-filled",
- "font_class": "info-filled",
- "unicode": "e649",
- "unicode_decimal": 58953
- },
- {
- "icon_id": "24923299",
- "name": "reload-01",
- "font_class": "reload",
- "unicode": "e6b2",
- "unicode_decimal": 59058
- },
- {
- "icon_id": "24923195",
- "name": "mic_slash_fill",
- "font_class": "micoff-filled",
- "unicode": "e6b0",
- "unicode_decimal": 59056
- },
- {
- "icon_id": "24923165",
- "name": "map-pin-ellipse",
- "font_class": "map-pin-ellipse",
- "unicode": "e6ac",
- "unicode_decimal": 59052
- },
- {
- "icon_id": "24923166",
- "name": "map-pin",
- "font_class": "map-pin",
- "unicode": "e6ad",
- "unicode_decimal": 59053
- },
- {
- "icon_id": "24923167",
- "name": "location",
- "font_class": "location",
- "unicode": "e6ae",
- "unicode_decimal": 59054
- },
- {
- "icon_id": "24923064",
- "name": "starhalf",
- "font_class": "starhalf",
- "unicode": "e683",
- "unicode_decimal": 59011
- },
- {
- "icon_id": "24923065",
- "name": "star",
- "font_class": "star",
- "unicode": "e688",
- "unicode_decimal": 59016
- },
- {
- "icon_id": "24923066",
- "name": "star-filled",
- "font_class": "star-filled",
- "unicode": "e68f",
- "unicode_decimal": 59023
- },
- {
- "icon_id": "24899646",
- "name": "a-rilidaka",
- "font_class": "calendar",
- "unicode": "e6a0",
- "unicode_decimal": 59040
- },
- {
- "icon_id": "24899647",
- "name": "fire",
- "font_class": "fire",
- "unicode": "e6a1",
- "unicode_decimal": 59041
- },
- {
- "icon_id": "24899648",
- "name": "paihangbang",
- "font_class": "medal",
- "unicode": "e6a2",
- "unicode_decimal": 59042
- },
- {
- "icon_id": "24899649",
- "name": "font",
- "font_class": "font",
- "unicode": "e6a3",
- "unicode_decimal": 59043
- },
- {
- "icon_id": "24899650",
- "name": "gift",
- "font_class": "gift",
- "unicode": "e6a4",
- "unicode_decimal": 59044
- },
- {
- "icon_id": "24899651",
- "name": "link",
- "font_class": "link",
- "unicode": "e6a5",
- "unicode_decimal": 59045
- },
- {
- "icon_id": "24899652",
- "name": "notification",
- "font_class": "notification",
- "unicode": "e6a6",
- "unicode_decimal": 59046
- },
- {
- "icon_id": "24899653",
- "name": "staff",
- "font_class": "staff",
- "unicode": "e6a7",
- "unicode_decimal": 59047
- },
- {
- "icon_id": "24899654",
- "name": "VIP",
- "font_class": "vip",
- "unicode": "e6a8",
- "unicode_decimal": 59048
- },
- {
- "icon_id": "24899655",
- "name": "folder_add",
- "font_class": "folder-add",
- "unicode": "e6a9",
- "unicode_decimal": 59049
- },
- {
- "icon_id": "24899656",
- "name": "tune",
- "font_class": "tune",
- "unicode": "e6aa",
- "unicode_decimal": 59050
- },
- {
- "icon_id": "24899657",
- "name": "shimingrenzheng",
- "font_class": "auth",
- "unicode": "e6ab",
- "unicode_decimal": 59051
- },
- {
- "icon_id": "24899565",
- "name": "person",
- "font_class": "person",
- "unicode": "e699",
- "unicode_decimal": 59033
- },
- {
- "icon_id": "24899566",
- "name": "email-filled",
- "font_class": "email-filled",
- "unicode": "e69a",
- "unicode_decimal": 59034
- },
- {
- "icon_id": "24899567",
- "name": "phone-filled",
- "font_class": "phone-filled",
- "unicode": "e69b",
- "unicode_decimal": 59035
- },
- {
- "icon_id": "24899568",
- "name": "phone",
- "font_class": "phone",
- "unicode": "e69c",
- "unicode_decimal": 59036
- },
- {
- "icon_id": "24899570",
- "name": "email",
- "font_class": "email",
- "unicode": "e69e",
- "unicode_decimal": 59038
- },
- {
- "icon_id": "24899571",
- "name": "personadd",
- "font_class": "personadd",
- "unicode": "e69f",
- "unicode_decimal": 59039
- },
- {
- "icon_id": "24899558",
- "name": "chatboxes-filled",
- "font_class": "chatboxes-filled",
- "unicode": "e692",
- "unicode_decimal": 59026
- },
- {
- "icon_id": "24899559",
- "name": "contact",
- "font_class": "contact",
- "unicode": "e693",
- "unicode_decimal": 59027
- },
- {
- "icon_id": "24899560",
- "name": "chatbubble-filled",
- "font_class": "chatbubble-filled",
- "unicode": "e694",
- "unicode_decimal": 59028
- },
- {
- "icon_id": "24899561",
- "name": "contact-filled",
- "font_class": "contact-filled",
- "unicode": "e695",
- "unicode_decimal": 59029
- },
- {
- "icon_id": "24899562",
- "name": "chatboxes",
- "font_class": "chatboxes",
- "unicode": "e696",
- "unicode_decimal": 59030
- },
- {
- "icon_id": "24899563",
- "name": "chatbubble",
- "font_class": "chatbubble",
- "unicode": "e697",
- "unicode_decimal": 59031
- },
- {
- "icon_id": "24881290",
- "name": "upload-filled",
- "font_class": "upload-filled",
- "unicode": "e68e",
- "unicode_decimal": 59022
- },
- {
- "icon_id": "24881292",
- "name": "upload",
- "font_class": "upload",
- "unicode": "e690",
- "unicode_decimal": 59024
- },
- {
- "icon_id": "24881293",
- "name": "weixin",
- "font_class": "weixin",
- "unicode": "e691",
- "unicode_decimal": 59025
- },
- {
- "icon_id": "24881274",
- "name": "compose",
- "font_class": "compose",
- "unicode": "e67f",
- "unicode_decimal": 59007
- },
- {
- "icon_id": "24881275",
- "name": "qq",
- "font_class": "qq",
- "unicode": "e680",
- "unicode_decimal": 59008
- },
- {
- "icon_id": "24881276",
- "name": "download-filled",
- "font_class": "download-filled",
- "unicode": "e681",
- "unicode_decimal": 59009
- },
- {
- "icon_id": "24881277",
- "name": "pengyouquan",
- "font_class": "pyq",
- "unicode": "e682",
- "unicode_decimal": 59010
- },
- {
- "icon_id": "24881279",
- "name": "sound",
- "font_class": "sound",
- "unicode": "e684",
- "unicode_decimal": 59012
- },
- {
- "icon_id": "24881280",
- "name": "trash-filled",
- "font_class": "trash-filled",
- "unicode": "e685",
- "unicode_decimal": 59013
- },
- {
- "icon_id": "24881281",
- "name": "sound-filled",
- "font_class": "sound-filled",
- "unicode": "e686",
- "unicode_decimal": 59014
- },
- {
- "icon_id": "24881282",
- "name": "trash",
- "font_class": "trash",
- "unicode": "e687",
- "unicode_decimal": 59015
- },
- {
- "icon_id": "24881284",
- "name": "videocam-filled",
- "font_class": "videocam-filled",
- "unicode": "e689",
- "unicode_decimal": 59017
- },
- {
- "icon_id": "24881285",
- "name": "spinner-cycle",
- "font_class": "spinner-cycle",
- "unicode": "e68a",
- "unicode_decimal": 59018
- },
- {
- "icon_id": "24881286",
- "name": "weibo",
- "font_class": "weibo",
- "unicode": "e68b",
- "unicode_decimal": 59019
- },
- {
- "icon_id": "24881288",
- "name": "videocam",
- "font_class": "videocam",
- "unicode": "e68c",
- "unicode_decimal": 59020
- },
- {
- "icon_id": "24881289",
- "name": "download",
- "font_class": "download",
- "unicode": "e68d",
- "unicode_decimal": 59021
- },
- {
- "icon_id": "24879601",
- "name": "help",
- "font_class": "help",
- "unicode": "e679",
- "unicode_decimal": 59001
- },
- {
- "icon_id": "24879602",
- "name": "navigate-filled",
- "font_class": "navigate-filled",
- "unicode": "e67a",
- "unicode_decimal": 59002
- },
- {
- "icon_id": "24879603",
- "name": "plusempty",
- "font_class": "plusempty",
- "unicode": "e67b",
- "unicode_decimal": 59003
- },
- {
- "icon_id": "24879604",
- "name": "smallcircle",
- "font_class": "smallcircle",
- "unicode": "e67c",
- "unicode_decimal": 59004
- },
- {
- "icon_id": "24879605",
- "name": "minus-filled",
- "font_class": "minus-filled",
- "unicode": "e67d",
- "unicode_decimal": 59005
- },
- {
- "icon_id": "24879606",
- "name": "micoff",
- "font_class": "micoff",
- "unicode": "e67e",
- "unicode_decimal": 59006
- },
- {
- "icon_id": "24879588",
- "name": "closeempty",
- "font_class": "closeempty",
- "unicode": "e66c",
- "unicode_decimal": 58988
- },
- {
- "icon_id": "24879589",
- "name": "clear",
- "font_class": "clear",
- "unicode": "e66d",
- "unicode_decimal": 58989
- },
- {
- "icon_id": "24879590",
- "name": "navigate",
- "font_class": "navigate",
- "unicode": "e66e",
- "unicode_decimal": 58990
- },
- {
- "icon_id": "24879591",
- "name": "minus",
- "font_class": "minus",
- "unicode": "e66f",
- "unicode_decimal": 58991
- },
- {
- "icon_id": "24879592",
- "name": "image",
- "font_class": "image",
- "unicode": "e670",
- "unicode_decimal": 58992
- },
- {
- "icon_id": "24879593",
- "name": "mic",
- "font_class": "mic",
- "unicode": "e671",
- "unicode_decimal": 58993
- },
- {
- "icon_id": "24879594",
- "name": "paperplane",
- "font_class": "paperplane",
- "unicode": "e672",
- "unicode_decimal": 58994
- },
- {
- "icon_id": "24879595",
- "name": "close",
- "font_class": "close",
- "unicode": "e673",
- "unicode_decimal": 58995
- },
- {
- "icon_id": "24879596",
- "name": "help-filled",
- "font_class": "help-filled",
- "unicode": "e674",
- "unicode_decimal": 58996
- },
- {
- "icon_id": "24879597",
- "name": "plus-filled",
- "font_class": "paperplane-filled",
- "unicode": "e675",
- "unicode_decimal": 58997
- },
- {
- "icon_id": "24879598",
- "name": "plus",
- "font_class": "plus",
- "unicode": "e676",
- "unicode_decimal": 58998
- },
- {
- "icon_id": "24879599",
- "name": "mic-filled",
- "font_class": "mic-filled",
- "unicode": "e677",
- "unicode_decimal": 58999
- },
- {
- "icon_id": "24879600",
- "name": "image-filled",
- "font_class": "image-filled",
- "unicode": "e678",
- "unicode_decimal": 59e3
- },
- {
- "icon_id": "24855900",
- "name": "locked-filled",
- "font_class": "locked-filled",
- "unicode": "e668",
- "unicode_decimal": 58984
- },
- {
- "icon_id": "24855901",
- "name": "info",
- "font_class": "info",
- "unicode": "e669",
- "unicode_decimal": 58985
- },
- {
- "icon_id": "24855903",
- "name": "locked",
- "font_class": "locked",
- "unicode": "e66b",
- "unicode_decimal": 58987
- },
- {
- "icon_id": "24855884",
- "name": "camera-filled",
- "font_class": "camera-filled",
- "unicode": "e658",
- "unicode_decimal": 58968
- },
- {
- "icon_id": "24855885",
- "name": "chat-filled",
- "font_class": "chat-filled",
- "unicode": "e659",
- "unicode_decimal": 58969
- },
- {
- "icon_id": "24855886",
- "name": "camera",
- "font_class": "camera",
- "unicode": "e65a",
- "unicode_decimal": 58970
- },
- {
- "icon_id": "24855887",
- "name": "circle",
- "font_class": "circle",
- "unicode": "e65b",
- "unicode_decimal": 58971
- },
- {
- "icon_id": "24855888",
- "name": "checkmarkempty",
- "font_class": "checkmarkempty",
- "unicode": "e65c",
- "unicode_decimal": 58972
- },
- {
- "icon_id": "24855889",
- "name": "chat",
- "font_class": "chat",
- "unicode": "e65d",
- "unicode_decimal": 58973
- },
- {
- "icon_id": "24855890",
- "name": "circle-filled",
- "font_class": "circle-filled",
- "unicode": "e65e",
- "unicode_decimal": 58974
- },
- {
- "icon_id": "24855891",
- "name": "flag",
- "font_class": "flag",
- "unicode": "e65f",
- "unicode_decimal": 58975
- },
- {
- "icon_id": "24855892",
- "name": "flag-filled",
- "font_class": "flag-filled",
- "unicode": "e660",
- "unicode_decimal": 58976
- },
- {
- "icon_id": "24855893",
- "name": "gear-filled",
- "font_class": "gear-filled",
- "unicode": "e661",
- "unicode_decimal": 58977
- },
- {
- "icon_id": "24855894",
- "name": "home",
- "font_class": "home",
- "unicode": "e662",
- "unicode_decimal": 58978
- },
- {
- "icon_id": "24855895",
- "name": "home-filled",
- "font_class": "home-filled",
- "unicode": "e663",
- "unicode_decimal": 58979
- },
- {
- "icon_id": "24855896",
- "name": "gear",
- "font_class": "gear",
- "unicode": "e664",
- "unicode_decimal": 58980
- },
- {
- "icon_id": "24855897",
- "name": "smallcircle-filled",
- "font_class": "smallcircle-filled",
- "unicode": "e665",
- "unicode_decimal": 58981
- },
- {
- "icon_id": "24855898",
- "name": "map-filled",
- "font_class": "map-filled",
- "unicode": "e666",
- "unicode_decimal": 58982
- },
- {
- "icon_id": "24855899",
- "name": "map",
- "font_class": "map",
- "unicode": "e667",
- "unicode_decimal": 58983
- },
- {
- "icon_id": "24855825",
- "name": "refresh-filled",
- "font_class": "refresh-filled",
- "unicode": "e656",
- "unicode_decimal": 58966
- },
- {
- "icon_id": "24855826",
- "name": "refresh",
- "font_class": "refresh",
- "unicode": "e657",
- "unicode_decimal": 58967
- },
- {
- "icon_id": "24855808",
- "name": "cloud-upload",
- "font_class": "cloud-upload",
- "unicode": "e645",
- "unicode_decimal": 58949
- },
- {
- "icon_id": "24855809",
- "name": "cloud-download-filled",
- "font_class": "cloud-download-filled",
- "unicode": "e646",
- "unicode_decimal": 58950
- },
- {
- "icon_id": "24855810",
- "name": "cloud-download",
- "font_class": "cloud-download",
- "unicode": "e647",
- "unicode_decimal": 58951
- },
- {
- "icon_id": "24855811",
- "name": "cloud-upload-filled",
- "font_class": "cloud-upload-filled",
- "unicode": "e648",
- "unicode_decimal": 58952
- },
- {
- "icon_id": "24855813",
- "name": "redo",
- "font_class": "redo",
- "unicode": "e64a",
- "unicode_decimal": 58954
- },
- {
- "icon_id": "24855814",
- "name": "images-filled",
- "font_class": "images-filled",
- "unicode": "e64b",
- "unicode_decimal": 58955
- },
- {
- "icon_id": "24855815",
- "name": "undo-filled",
- "font_class": "undo-filled",
- "unicode": "e64c",
- "unicode_decimal": 58956
- },
- {
- "icon_id": "24855816",
- "name": "more",
- "font_class": "more",
- "unicode": "e64d",
- "unicode_decimal": 58957
- },
- {
- "icon_id": "24855817",
- "name": "more-filled",
- "font_class": "more-filled",
- "unicode": "e64e",
- "unicode_decimal": 58958
- },
- {
- "icon_id": "24855818",
- "name": "undo",
- "font_class": "undo",
- "unicode": "e64f",
- "unicode_decimal": 58959
- },
- {
- "icon_id": "24855819",
- "name": "images",
- "font_class": "images",
- "unicode": "e650",
- "unicode_decimal": 58960
- },
- {
- "icon_id": "24855821",
- "name": "paperclip",
- "font_class": "paperclip",
- "unicode": "e652",
- "unicode_decimal": 58962
- },
- {
- "icon_id": "24855822",
- "name": "settings",
- "font_class": "settings",
- "unicode": "e653",
- "unicode_decimal": 58963
- },
- {
- "icon_id": "24855823",
- "name": "search",
- "font_class": "search",
- "unicode": "e654",
- "unicode_decimal": 58964
- },
- {
- "icon_id": "24855824",
- "name": "redo-filled",
- "font_class": "redo-filled",
- "unicode": "e655",
- "unicode_decimal": 58965
- },
- {
- "icon_id": "24841702",
- "name": "list",
- "font_class": "list",
- "unicode": "e644",
- "unicode_decimal": 58948
- },
- {
- "icon_id": "24841489",
- "name": "mail-open-filled",
- "font_class": "mail-open-filled",
- "unicode": "e63a",
- "unicode_decimal": 58938
- },
- {
- "icon_id": "24841491",
- "name": "hand-thumbsdown-filled",
- "font_class": "hand-down-filled",
- "unicode": "e63c",
- "unicode_decimal": 58940
- },
- {
- "icon_id": "24841492",
- "name": "hand-thumbsdown",
- "font_class": "hand-down",
- "unicode": "e63d",
- "unicode_decimal": 58941
- },
- {
- "icon_id": "24841493",
- "name": "hand-thumbsup-filled",
- "font_class": "hand-up-filled",
- "unicode": "e63e",
- "unicode_decimal": 58942
- },
- {
- "icon_id": "24841494",
- "name": "hand-thumbsup",
- "font_class": "hand-up",
- "unicode": "e63f",
- "unicode_decimal": 58943
- },
- {
- "icon_id": "24841496",
- "name": "heart-filled",
- "font_class": "heart-filled",
- "unicode": "e641",
- "unicode_decimal": 58945
- },
- {
- "icon_id": "24841498",
- "name": "mail-open",
- "font_class": "mail-open",
- "unicode": "e643",
- "unicode_decimal": 58947
- },
- {
- "icon_id": "24841488",
- "name": "heart",
- "font_class": "heart",
- "unicode": "e639",
- "unicode_decimal": 58937
- },
- {
- "icon_id": "24839963",
- "name": "loop",
- "font_class": "loop",
- "unicode": "e633",
- "unicode_decimal": 58931
- },
- {
- "icon_id": "24839866",
- "name": "pulldown",
- "font_class": "pulldown",
- "unicode": "e632",
- "unicode_decimal": 58930
- },
- {
- "icon_id": "24813798",
- "name": "scan",
- "font_class": "scan",
- "unicode": "e62a",
- "unicode_decimal": 58922
- },
- {
- "icon_id": "24813786",
- "name": "bars",
- "font_class": "bars",
- "unicode": "e627",
- "unicode_decimal": 58919
- },
- {
- "icon_id": "24813788",
- "name": "cart-filled",
- "font_class": "cart-filled",
- "unicode": "e629",
- "unicode_decimal": 58921
- },
- {
- "icon_id": "24813790",
- "name": "checkbox",
- "font_class": "checkbox",
- "unicode": "e62b",
- "unicode_decimal": 58923
- },
- {
- "icon_id": "24813791",
- "name": "checkbox-filled",
- "font_class": "checkbox-filled",
- "unicode": "e62c",
- "unicode_decimal": 58924
- },
- {
- "icon_id": "24813794",
- "name": "shop",
- "font_class": "shop",
- "unicode": "e62f",
- "unicode_decimal": 58927
- },
- {
- "icon_id": "24813795",
- "name": "headphones",
- "font_class": "headphones",
- "unicode": "e630",
- "unicode_decimal": 58928
- },
- {
- "icon_id": "24813796",
- "name": "cart",
- "font_class": "cart",
- "unicode": "e631",
- "unicode_decimal": 58929
- }
- ]
- };
- const getVal = (val) => {
- const reg = /^[0-9]*$/g;
- return typeof val === "number" || reg.test(val) ? val + "px" : val;
- };
- const _sfc_main$3m = {
- name: "UniIcons",
- emits: ["click"],
- props: {
- type: {
- type: String,
- default: ""
- },
- color: {
- type: String,
- default: "#333333"
- },
- size: {
- type: [Number, String],
- default: 16
- },
- customPrefix: {
- type: String,
- default: ""
- }
- },
- data() {
- return {
- icons: icons.glyphs
- };
- },
- computed: {
- unicode() {
- let code2 = this.icons.find((v2) => v2.font_class === this.type);
- if (code2) {
- return unescape(`%u${code2.unicode}`);
- }
- return "";
- },
- iconSize() {
- return getVal(this.size);
- }
- },
- methods: {
- _onClick() {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$3l(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "text",
- {
- style: vue.normalizeStyle({ color: $props.color, "font-size": $options.iconSize }),
- class: vue.normalizeClass(["uni-icons", ["uniui-" + $props.type, $props.customPrefix, $props.customPrefix ? $props.type : ""]]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
- },
- null,
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_1$b = /* @__PURE__ */ _export_sfc(_sfc_main$3m, [["render", _sfc_render$3l], ["__scopeId", "data-v-d31e1c47"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-icons/components/uni-icons/uni-icons.vue"]]);
- const isObject$3 = (val) => val !== null && typeof val === "object";
- const defaultDelimiters = ["{", "}"];
- class BaseFormatter {
- constructor() {
- this._caches = /* @__PURE__ */ Object.create(null);
- }
- interpolate(message, values, delimiters = defaultDelimiters) {
- if (!values) {
- return [message];
- }
- let tokens = this._caches[message];
- if (!tokens) {
- tokens = parse$1(message, delimiters);
- this._caches[message] = tokens;
- }
- return compile(tokens, values);
- }
- }
- const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
- const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
- function parse$1(format2, [startDelimiter, endDelimiter]) {
- const tokens = [];
- let position = 0;
- let text = "";
- while (position < format2.length) {
- let char = format2[position++];
- if (char === startDelimiter) {
- if (text) {
- tokens.push({ type: "text", value: text });
- }
- text = "";
- let sub = "";
- char = format2[position++];
- while (char !== void 0 && char !== endDelimiter) {
- sub += char;
- char = format2[position++];
- }
- const isClosed = char === endDelimiter;
- const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
- tokens.push({ value: sub, type });
- } else {
- text += char;
- }
- }
- text && tokens.push({ type: "text", value: text });
- return tokens;
- }
- function compile(tokens, values) {
- const compiled = [];
- let index2 = 0;
- const mode = Array.isArray(values) ? "list" : isObject$3(values) ? "named" : "unknown";
- if (mode === "unknown") {
- return compiled;
- }
- while (index2 < tokens.length) {
- const token = tokens[index2];
- switch (token.type) {
- case "text":
- compiled.push(token.value);
- break;
- case "list":
- compiled.push(values[parseInt(token.value, 10)]);
- break;
- case "named":
- if (mode === "named") {
- compiled.push(values[token.value]);
- } else {
- {
- console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);
- }
- }
- break;
- case "unknown":
- {
- console.warn(`Detect 'unknown' type of token!`);
- }
- break;
- }
- index2++;
- }
- return compiled;
- }
- const LOCALE_ZH_HANS = "zh-Hans";
- const LOCALE_ZH_HANT = "zh-Hant";
- const LOCALE_EN = "en";
- const LOCALE_FR = "fr";
- const LOCALE_ES = "es";
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
- const defaultFormatter = new BaseFormatter();
- function include(str, parts) {
- return !!parts.find((part) => str.indexOf(part) !== -1);
- }
- function startsWith(str, parts) {
- return parts.find((part) => str.indexOf(part) === 0);
- }
- function normalizeLocale(locale, messages2) {
- if (!locale) {
- return;
- }
- locale = locale.trim().replace(/_/g, "-");
- if (messages2 && messages2[locale]) {
- return locale;
- }
- locale = locale.toLowerCase();
- if (locale === "chinese") {
- return LOCALE_ZH_HANS;
- }
- if (locale.indexOf("zh") === 0) {
- if (locale.indexOf("-hans") > -1) {
- return LOCALE_ZH_HANS;
- }
- if (locale.indexOf("-hant") > -1) {
- return LOCALE_ZH_HANT;
- }
- if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
- return LOCALE_ZH_HANT;
- }
- return LOCALE_ZH_HANS;
- }
- let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
- if (messages2 && Object.keys(messages2).length > 0) {
- locales = Object.keys(messages2);
- }
- const lang = startsWith(locale, locales);
- if (lang) {
- return lang;
- }
- }
- class I18n {
- constructor({ locale, fallbackLocale, messages: messages2, watcher, formater: formater2 }) {
- this.locale = LOCALE_EN;
- this.fallbackLocale = LOCALE_EN;
- this.message = {};
- this.messages = {};
- this.watchers = [];
- if (fallbackLocale) {
- this.fallbackLocale = fallbackLocale;
- }
- this.formater = formater2 || defaultFormatter;
- this.messages = messages2 || {};
- this.setLocale(locale || LOCALE_EN);
- if (watcher) {
- this.watchLocale(watcher);
- }
- }
- setLocale(locale) {
- const oldLocale = this.locale;
- this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
- if (!this.messages[this.locale]) {
- this.messages[this.locale] = {};
- }
- this.message = this.messages[this.locale];
- if (oldLocale !== this.locale) {
- this.watchers.forEach((watcher) => {
- watcher(this.locale, oldLocale);
- });
- }
- }
- getLocale() {
- return this.locale;
- }
- watchLocale(fn) {
- const index2 = this.watchers.push(fn) - 1;
- return () => {
- this.watchers.splice(index2, 1);
- };
- }
- add(locale, message, override = true) {
- const curMessages = this.messages[locale];
- if (curMessages) {
- if (override) {
- Object.assign(curMessages, message);
- } else {
- Object.keys(message).forEach((key) => {
- if (!hasOwn(curMessages, key)) {
- curMessages[key] = message[key];
- }
- });
- }
- } else {
- this.messages[locale] = message;
- }
- }
- f(message, values, delimiters) {
- return this.formater.interpolate(message, values, delimiters).join("");
- }
- t(key, locale, values) {
- let message = this.message;
- if (typeof locale === "string") {
- locale = normalizeLocale(locale, this.messages);
- locale && (message = this.messages[locale]);
- } else {
- values = locale;
- }
- if (!hasOwn(message, key)) {
- console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
- return key;
- }
- return this.formater.interpolate(message[key], values).join("");
- }
- }
- function watchAppLocale(appVm, i18n2) {
- if (appVm.$watchLocale) {
- appVm.$watchLocale((newLocale) => {
- i18n2.setLocale(newLocale);
- });
- } else {
- appVm.$watch(() => appVm.$locale, (newLocale) => {
- i18n2.setLocale(newLocale);
- });
- }
- }
- function getDefaultLocale() {
- if (typeof uni !== "undefined" && uni.getLocale) {
- return uni.getLocale();
- }
- if (typeof global !== "undefined" && global.getLocale) {
- return global.getLocale();
- }
- return LOCALE_EN;
- }
- function initVueI18n(locale, messages2 = {}, fallbackLocale, watcher) {
- if (typeof locale !== "string") {
- const options2 = [
- messages2,
- locale
- ];
- locale = options2[0];
- messages2 = options2[1];
- }
- if (typeof locale !== "string") {
- locale = getDefaultLocale();
- }
- if (typeof fallbackLocale !== "string") {
- fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
- }
- const i18n2 = new I18n({
- locale,
- fallbackLocale,
- messages: messages2,
- watcher
- });
- let t2 = (key, values) => {
- if (typeof getApp !== "function") {
- t2 = function(key2, values2) {
- return i18n2.t(key2, values2);
- };
- } else {
- let isWatchedAppLocale = false;
- t2 = function(key2, values2) {
- const appVm = getApp().$vm;
- if (appVm) {
- appVm.$locale;
- if (!isWatchedAppLocale) {
- isWatchedAppLocale = true;
- watchAppLocale(appVm, i18n2);
- }
- }
- return i18n2.t(key2, values2);
- };
- }
- return t2(key, values);
- };
- return {
- i18n: i18n2,
- f(message, values, delimiters) {
- return i18n2.f(message, values, delimiters);
- },
- t(key, values) {
- return t2(key, values);
- },
- add(locale2, message, override = true) {
- return i18n2.add(locale2, message, override);
- },
- watch(fn) {
- return i18n2.watchLocale(fn);
- },
- getLocale() {
- return i18n2.getLocale();
- },
- setLocale(newLocale) {
- return i18n2.setLocale(newLocale);
- }
- };
- }
- const en$2 = {
- "uni-search-bar.cancel": "cancel",
- "uni-search-bar.placeholder": "Search enter content"
- };
- const zhHans$2 = {
- "uni-search-bar.cancel": "cancel",
- "uni-search-bar.placeholder": "请输入搜索内容"
- };
- const zhHant$2 = {
- "uni-search-bar.cancel": "cancel",
- "uni-search-bar.placeholder": "請輸入搜索內容"
- };
- const messages$2 = {
- en: en$2,
- "zh-Hans": zhHans$2,
- "zh-Hant": zhHant$2
- };
- const {
- t: t$5
- } = initVueI18n(messages$2);
- const _sfc_main$3l = {
- name: "UniSearchBar",
- emits: ["input", "update:modelValue", "clear", "cancel", "confirm", "blur", "focus"],
- props: {
- placeholder: {
- type: String,
- default: ""
- },
- radius: {
- type: [Number, String],
- default: 5
- },
- clearButton: {
- type: String,
- default: "auto"
- },
- cancelButton: {
- type: String,
- default: "auto"
- },
- cancelText: {
- type: String,
- default: "取消"
- },
- bgColor: {
- type: String,
- default: "#F8F8F8"
- },
- maxlength: {
- type: [Number, String],
- default: 100
- },
- value: {
- type: [Number, String],
- default: ""
- },
- modelValue: {
- type: [Number, String],
- default: ""
- },
- focus: {
- type: Boolean,
- default: false
- },
- readonly: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- show: false,
- showSync: false,
- searchVal: ""
- };
- },
- computed: {
- cancelTextI18n() {
- return this.cancelText || t$5("uni-search-bar.cancel");
- },
- placeholderText() {
- return this.placeholder || t$5("uni-search-bar.placeholder");
- }
- },
- watch: {
- modelValue: {
- immediate: true,
- handler(newVal) {
- this.searchVal = newVal;
- if (newVal) {
- this.show = true;
- }
- }
- },
- focus: {
- immediate: true,
- handler(newVal) {
- if (newVal) {
- if (this.readonly)
- return;
- this.show = true;
- this.$nextTick(() => {
- this.showSync = true;
- });
- }
- }
- },
- searchVal(newVal, oldVal) {
- this.$emit("input", newVal);
- this.$emit("update:modelValue", newVal);
- }
- },
- methods: {
- searchClick() {
- if (this.readonly)
- return;
- if (this.show) {
- return;
- }
- this.show = true;
- this.$nextTick(() => {
- this.showSync = true;
- });
- },
- clear() {
- this.$emit("clear", {
- value: this.searchVal
- });
- this.searchVal = "";
- },
- cancel() {
- if (this.readonly)
- return;
- this.$emit("cancel", {
- value: this.searchVal
- });
- this.searchVal = "";
- this.show = false;
- this.showSync = false;
- plus.key.hideSoftKeybord();
- },
- confirm() {
- plus.key.hideSoftKeybord();
- this.$emit("confirm", {
- value: this.searchVal
- });
- },
- blur() {
- plus.key.hideSoftKeybord();
- this.$emit("blur", {
- value: this.searchVal
- });
- },
- emitFocus(e2) {
- this.$emit("focus", e2.detail);
- }
- }
- };
- function _sfc_render$3k(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-searchbar" }, [
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle({ borderRadius: $props.radius + "px", backgroundColor: $props.bgColor }),
- class: "uni-searchbar__box",
- onClick: _cache[5] || (_cache[5] = (...args) => $options.searchClick && $options.searchClick(...args))
- },
- [
- vue.createElementVNode("view", { class: "uni-searchbar__box-icon-search" }, [
- vue.renderSlot(_ctx.$slots, "searchIcon", {}, () => [
- vue.createVNode(_component_uni_icons, {
- color: "#c0c4cc",
- size: "18",
- type: "search"
- })
- ], true)
- ]),
- $data.show || $data.searchVal ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
- key: 0,
- focus: $data.showSync,
- disabled: $props.readonly,
- placeholder: $options.placeholderText,
- maxlength: $props.maxlength,
- class: "uni-searchbar__box-search-input",
- "confirm-type": "search",
- type: "text",
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.searchVal = $event),
- onConfirm: _cache[1] || (_cache[1] = (...args) => $options.confirm && $options.confirm(...args)),
- onBlur: _cache[2] || (_cache[2] = (...args) => $options.blur && $options.blur(...args)),
- onFocus: _cache[3] || (_cache[3] = (...args) => $options.emitFocus && $options.emitFocus(...args))
- }, null, 40, ["focus", "disabled", "placeholder", "maxlength"])), [
- [vue.vModelText, $data.searchVal]
- ]) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "uni-searchbar__text-placeholder"
- },
- vue.toDisplayString($props.placeholder),
- 1
- /* TEXT */
- )),
- $data.show && ($props.clearButton === "always" || $props.clearButton === "auto" && $data.searchVal !== "") && !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "uni-searchbar__box-icon-clear",
- onClick: _cache[4] || (_cache[4] = (...args) => $options.clear && $options.clear(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "clearIcon", {}, () => [
- vue.createVNode(_component_uni_icons, {
- color: "#c0c4cc",
- size: "20",
- type: "clear"
- })
- ], true)
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- ),
- $props.cancelButton === "always" || $data.show && $props.cancelButton === "auto" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- onClick: _cache[6] || (_cache[6] = (...args) => $options.cancel && $options.cancel(...args)),
- class: "uni-searchbar__cancel"
- },
- vue.toDisplayString($options.cancelTextI18n),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_0$p = /* @__PURE__ */ _export_sfc(_sfc_main$3l, [["render", _sfc_render$3k], ["__scopeId", "data-v-f07ef577"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue"]]);
- const _sfc_main$3k = {
- __name: "su-navbar",
- props: {
- dark: {
- type: Boolean,
- default: false
- },
- modelValue: {
- type: String,
- default: ""
- },
- title: {
- type: String,
- default: ""
- },
- titleAlign: {
- type: String,
- default: "center"
- // left | center
- },
- rightText: {
- type: String,
- default: ""
- },
- leftIcon: {
- type: String,
- default: "left"
- },
- rightIcon: {
- type: String,
- default: ""
- },
- fixed: {
- type: [Boolean, String],
- default: true
- },
- placeholder: {
- type: [Boolean, String],
- default: true
- },
- color: {
- type: String,
- default: ""
- },
- backgroundColor: {
- type: String,
- default: ""
- },
- opacity: {
- type: [Boolean, String],
- default: false
- },
- opacityBgUi: {
- type: String,
- default: "bg-white"
- },
- statusBar: {
- type: [Boolean, String],
- default: false
- },
- shadow: {
- type: [Boolean, String],
- default: false
- },
- border: {
- type: [Boolean, String],
- default: false
- },
- height: {
- type: [Number, String],
- default: 44
- },
- leftWidth: {
- type: [Number, String],
- default: 80
- },
- rightWidth: {
- type: [Number, String],
- default: 0
- },
- tools: {
- type: String,
- default: "title"
- },
- defaultSearch: {
- type: String,
- default: ""
- }
- },
- emits: ["clickLeft", "clickRight", "clickTitle", "search"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const getVal2 = (val) => typeof val === "number" ? val + "px" : val;
- const emits = __emit;
- const props = __props;
- const capsuleStyle = vue.computed(() => {
- return {
- width: sheep$1.$platform.capsule.width + "px",
- height: sheep$1.$platform.capsule.height + "px",
- margin: "0 " + (sheep$1.$platform.device.windowWidth - sheep$1.$platform.capsule.right) + "px"
- };
- });
- const searchModel = vue.computed(() => {
- return props.defaultSearch;
- });
- const themeBgColor = vue.computed(() => {
- if (props.dark) {
- if (props.backgroundColor) {
- return props.backgroundColor;
- } else {
- return props.dark ? "#333" : "#FFF";
- }
- }
- return props.backgroundColor || "#FFF";
- });
- const themeColor = vue.computed(() => {
- if (props.dark) {
- if (props.color) {
- return props.color;
- } else {
- return props.dark ? "#fff" : "#333";
- }
- }
- return props.color || "#333";
- });
- const navbarHeight = vue.computed(() => {
- return getVal2(props.height);
- });
- const leftIconWidth = vue.computed(() => {
- return getVal2(props.leftWidth);
- });
- const rightIconWidth = vue.computed(() => {
- return getVal2(props.rightWidth);
- });
- function onSearch(e2) {
- emits("search", e2.value);
- }
- onLoad(() => {
- if (uni.report && props.title !== "") {
- uni.report("title", props.title);
- }
- });
- const hasHistory2 = sheep$1.$router.hasHistory();
- function onClickLeft() {
- if (hasHistory2) {
- sheep$1.$router.back();
- } else {
- sheep$1.$router.go("/pages/index/index");
- }
- emits("clickLeft");
- }
- function onClickRight() {
- showMenuTools();
- }
- function onClickTitle() {
- emits("clickTitle");
- }
- const __returned__ = { getVal: getVal2, emits, props, capsuleStyle, searchModel, themeBgColor, themeColor, navbarHeight, leftIconWidth, rightIconWidth, onSearch, hasHistory: hasHistory2, onClickLeft, onClickRight, onClickTitle, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get showMenuTools() {
- return showMenuTools;
- }, get closeMenuTools() {
- return closeMenuTools;
- }, computed: vue.computed, ref: vue.ref };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3j(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_status_bar = resolveEasycom(vue.resolveDynamicComponent("su-status-bar"), __easycom_0$q);
- const _component_uni_search_bar = resolveEasycom(vue.resolveDynamicComponent("uni-search-bar"), __easycom_0$p);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uni-navbar", { "uni-dark": $props.dark }])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([{
- "uni-navbar--fixed": $props.fixed,
- "uni-navbar--shadow": $props.shadow,
- "uni-navbar--border": $props.border
- }, "uni-navbar__content"])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["fixed-bg", [$props.opacity ? "" : $props.opacityBgUi]])
- },
- null,
- 2
- /* CLASS */
- ),
- $props.statusBar ? (vue.openBlock(), vue.createBlock(_component_su_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle({
- color: $setup.themeColor,
- height: $setup.navbarHeight,
- background: $props.backgroundColor
- }),
- class: "uni-navbar__header"
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "uni-navbar__header-btns uni-navbar__header-btns-left",
- style: vue.normalizeStyle({ width: $setup.leftIconWidth })
- },
- [
- vue.renderSlot(_ctx.$slots, "left", {}, () => [
- $props.leftIcon.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-navbar__content_view"
- }, [
- vue.createElementVNode("view", { class: "icon-box ss-flex" }, [
- vue.createElementVNode("view", {
- class: "icon-button icon-button-left ss-flex ss-row-center",
- onClick: $setup.onClickLeft
- }, [
- $setup.hasHistory ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "sicon-back"
- })) : (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- class: "sicon-home"
- }))
- ]),
- vue.createElementVNode("view", { class: "line" }),
- vue.createElementVNode("view", {
- class: "icon-button icon-button-right ss-flex ss-row-center",
- onClick: _cache[0] || (_cache[0] = (...args) => $setup.showMenuTools && $setup.showMenuTools(...args))
- }, [
- vue.createElementVNode("text", { class: "sicon-more" })
- ])
- ])
- ])) : vue.createCommentVNode("v-if", true),
- $props.titleAlign === "left" && $props.title.length && $setup.sheep.$platform.name !== "WechatOfficialAccount" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass([{ "uni-navbar-btn-icon-left": !$props.leftIcon.length > 0 }, "uni-navbar-btn-text"])
- },
- [
- vue.createElementVNode(
- "text",
- {
- style: vue.normalizeStyle({ color: $setup.themeColor, fontSize: "18px" })
- },
- vue.toDisplayString($props.title),
- 5
- /* TEXT, STYLE */
- )
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ],
- 4
- /* STYLE */
- ),
- $props.tools === "search" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "ss-flex-1"
- }, [
- vue.renderSlot(_ctx.$slots, "center", {}, () => [
- vue.createVNode(_component_uni_search_bar, {
- class: "ss-flex-1 search-box",
- radius: 20,
- placeholder: _ctx.$t("common.enter_keywords"),
- cancelButton: "none",
- modelValue: $setup.searchModel,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.searchModel = $event),
- onConfirm: $setup.onSearch
- }, null, 8, ["placeholder", "modelValue"])
- ], true)
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-navbar__header-container",
- onClick: $setup.onClickTitle
- }, [
- vue.renderSlot(_ctx.$slots, "center", {}, () => [
- $props.tools === "title" && $props.titleAlign === "center" && $props.title.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-navbar__header-container-inner"
- }, [
- vue.createElementVNode(
- "text",
- {
- style: vue.normalizeStyle({ color: $setup.themeColor, fontSize: "36rpx" }),
- class: "ss-line-1"
- },
- vue.toDisplayString($props.title),
- 5
- /* TEXT, STYLE */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ], true)
- ]))
- ],
- 4
- /* STYLE */
- )
- ],
- 2
- /* CLASS */
- ),
- $props.placeholder ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-navbar__placeholder"
- }, [
- $props.statusBar ? (vue.openBlock(), vue.createBlock(_component_su_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "uni-navbar__placeholder-view",
- style: vue.normalizeStyle({ height: $setup.navbarHeight })
- },
- null,
- 4
- /* STYLE */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 头部问题 ")
- ],
- 2
- /* CLASS */
- );
- }
- const __easycom_0$o = /* @__PURE__ */ _export_sfc(_sfc_main$3k, [["render", _sfc_render$3j], ["__scopeId", "data-v-305eaf98"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-navbar/su-navbar.vue"]]);
- const _sfc_main$3j = {
- __name: "su-fixed",
- props: {
- noNav: {
- type: Boolean,
- default: false
- },
- bottom: {
- type: Boolean,
- default: false
- },
- bg: {
- type: String,
- default: ""
- },
- bgStyles: {
- type: Object,
- default() {
- }
- },
- val: {
- type: Number,
- default: 0
- },
- width: {
- type: [String, Number],
- default: 0
- },
- alway: {
- type: Boolean,
- default: true
- },
- opacity: {
- type: Boolean,
- default: false
- },
- index: {
- type: [Number, String],
- default: 0
- },
- placeholder: {
- type: [Boolean],
- default: false
- },
- sticky: {
- type: [Boolean],
- default: false
- },
- noFixed: {
- type: Boolean,
- default: false
- },
- ui: {
- type: String,
- default: ""
- },
- clickTo: {
- type: Boolean,
- default: false
- },
- //是否需要安全区
- isInset: {
- type: Boolean,
- default: true
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const { safeAreaInsets } = sheep$1.$platform.device;
- const vm = vue.getCurrentInstance();
- const uuid = sheep$1.$helper.guid();
- const sys_navBar = sheep$1.$platform.navbar;
- const state = vue.reactive({
- content: {},
- fixed: true,
- scrollTop: 0,
- opacityVal: 0
- });
- const insetHeight = vue.computed(() => {
- if (state.fixed && props.bottom) {
- if (props.isInset) {
- return props.val + "px";
- } else {
- return props.val + safeAreaInsets.bottom + "px";
- }
- } else {
- return "auto";
- }
- });
- const props = __props;
- state.fixed = !vue.unref(props.sticky);
- onPageScroll((e2) => {
- let top = e2.scrollTop;
- state.scrollTop = top;
- state.opacityVal = top > sheep$1.$platform.navbar ? 1 : top * 0.01;
- });
- vue.onMounted(() => {
- vue.nextTick(() => {
- computedQuery();
- });
- });
- const computedQuery = () => {
- uni.createSelectorQuery().in(vm).select(`#fixed-${uuid}`).boundingClientRect((data) => {
- if (data != null) {
- state.content = data;
- if (vue.unref(props.sticky)) {
- setFixed(state.scrollTop);
- }
- }
- }).exec();
- };
- const setFixed = (value) => {
- if (vue.unref(props.bottom)) {
- state.fixed = value >= state.content.bottom - sheep$1.$platform.device.windowHeight + state.content.height + vue.unref(props.val);
- } else {
- state.fixed = value >= state.content.top - (vue.unref(props.noNav) ? vue.unref(props.val) : vue.unref(props.val) + sheep$1.$platform.navbar);
- }
- };
- const toTop = () => {
- if (props.hasToTop) {
- uni.pageScrollTo({
- scrollTop: state.content.top,
- duration: 100
- });
- }
- };
- const __returned__ = { safeAreaInsets, vm, uuid, sys_navBar, state, insetHeight, props, computedQuery, setFixed, toTop, get onPageScroll() {
- return onPageScroll;
- }, getCurrentInstance: vue.getCurrentInstance, unref: vue.unref, onMounted: vue.onMounted, reactive: vue.reactive, nextTick: vue.nextTick, computed: vue.computed, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3i(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "ui-fixed" }, [
- vue.createElementVNode("view", {
- class: vue.normalizeClass(["ui-fixed-box", [{ fixed: $setup.state.fixed }]]),
- id: `fixed-${$setup.uuid}`,
- style: vue.normalizeStyle([
- {
- left: $props.sticky ? "auto" : "0px",
- top: $setup.state.fixed && !$props.bottom ? ($props.noNav ? $props.val : $props.val + $setup.sys_navBar) + "px" : "auto",
- bottom: $setup.insetHeight,
- zIndex: $props.index + $setup.sheep.$zIndex.navbar
- },
- !$props.alway ? { opacity: $setup.state.opacityVal } : ""
- ])
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "ui-fixed-content",
- onClick: $setup.toTop,
- style: vue.normalizeStyle([{ zIndex: $props.index + $setup.sheep.$zIndex.navbar }])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- $setup.safeAreaInsets.bottom && $props.bottom && $props.isInset ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "inset-bottom",
- style: vue.normalizeStyle([{ height: $setup.safeAreaInsets.bottom + "px" }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- ),
- $props.bottom ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["ui-fixed-bottom", [$props.bg]])
- },
- null,
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["ui-fixed-bg", [$props.ui, $props.bg]]),
- style: vue.normalizeStyle([
- { zIndex: $props.index + $setup.sheep.$zIndex.navbar - 1 },
- $props.bgStyles,
- $props.opacity ? { opacity: $setup.state.opacityVal } : ""
- ])
- },
- null,
- 6
- /* CLASS, STYLE */
- )
- ], 14, ["id"]),
- ($props.sticky ? $setup.state.fixed : $props.placeholder && $setup.state.fixed) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "skeleton",
- style: vue.normalizeStyle([{ height: $setup.state.content.height + "px", width: $props.width + "px" }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_2$9 = /* @__PURE__ */ _export_sfc(_sfc_main$3j, [["render", _sfc_render$3i], ["__scopeId", "data-v-96c3469f"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-fixed/su-fixed.vue"]]);
- const _sfc_main$3i = {
- __name: "navbar",
- props: {
- sticky: Boolean,
- zIndex: {
- type: Number,
- default: 100
- },
- back: {
- //是否返回上一页
- type: Boolean,
- default: true
- },
- backtext: {
- //返回文本
- type: String,
- default: ""
- },
- bg: {
- type: String,
- default: "bg-white"
- },
- status: {
- //状态栏颜色 可以选择light dark/其他字符串视为黑色
- type: String,
- default: ""
- },
- // 常驻
- alway: {
- type: Boolean,
- default: true
- },
- opacity: {
- //是否开启滑动渐变
- type: Boolean,
- default: false
- },
- opacityBg: {
- //开启滑动渐变后 返回按钮是否添加背景
- type: Boolean,
- default: false
- },
- noFixed: {
- //是否浮动
- type: Boolean,
- default: false
- },
- ui: {
- type: String,
- default: ""
- },
- capsule: {
- //是否开启胶囊返回
- type: Boolean,
- default: false
- },
- stopBack: {
- type: Boolean,
- default: false
- },
- placeholder: {
- type: [Boolean],
- default: true
- },
- bgStyles: {
- type: Object,
- default() {
- }
- }
- },
- emits: ["navback"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const state = vue.reactive({
- statusCur: "",
- capsuleStyle: {},
- capsuleBack: {}
- });
- const sys_statusBar = sheep$1.$platform.device.statusBarHeight;
- const sys_navBar = sheep$1.$platform.navbar;
- const props = __props;
- const emits = __emit;
- vue.onBeforeMount(() => {
- init();
- });
- const onNavback = () => {
- sheep$1.$router.back();
- };
- const init = () => {
- state.capsuleStyle = {
- width: sheep$1.$platform.capsule.width + "px",
- height: sheep$1.$platform.capsule.height + "px",
- margin: "0 " + (sheep$1.$platform.device.windowWidth - sheep$1.$platform.capsule.right) + "px"
- };
- state.capsuleBack = state.capsuleStyle;
- };
- const __returned__ = { state, sys_statusBar, sys_navBar, props, emits, onNavback, init, computed: vue.computed, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3h(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_status_bar = resolveEasycom(vue.resolveDynamicComponent("su-status-bar"), __easycom_0$q);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- return vue.openBlock(), vue.createBlock(_component_su_fixed, {
- noFixed: $setup.props.noFixed,
- alway: $setup.props.alway,
- bgStyles: $setup.props.bgStyles,
- val: 0,
- index: $setup.props.zIndex,
- noNav: "",
- bg: $setup.props.bg,
- ui: $setup.props.ui,
- opacity: $setup.props.opacity,
- placeholder: $setup.props.placeholder,
- sticky: $setup.props.sticky
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_status_bar),
- vue.createCommentVNode(`
- :class="[{ 'border-bottom': !props.opacity && props.bg != 'bg-none' }]"
- `),
- vue.createElementVNode("view", { class: "ui-navbar-box" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([
- "ui-bar",
- $setup.props.status == "" ? `text-a` : $setup.props.status == "light" ? "text-white" : "text-black"
- ]),
- style: vue.normalizeStyle([{ height: $setup.sys_navBar - $setup.sys_statusBar + "px" }])
- },
- [
- vue.renderSlot(_ctx.$slots, "item", {}, void 0, true),
- vue.createElementVNode("view", { class: "right" })
- ],
- 6
- /* CLASS, STYLE */
- )
- ])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["noFixed", "alway", "bgStyles", "index", "bg", "ui", "opacity", "placeholder", "sticky"]);
- }
- const Navbar = /* @__PURE__ */ _export_sfc(_sfc_main$3i, [["render", _sfc_render$3h], ["__scopeId", "data-v-81e1f503"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-custom-navbar/components/navbar.vue"]]);
- const _sfc_main$3h = {
- __name: "s-search-block",
- props: {
- data: {
- type: Object,
- default: () => ({})
- },
- // 输入框背景色
- elBackground: {
- type: String,
- default: ""
- },
- height: {
- type: Number,
- default: 36
- },
- // 图标颜色
- iconColor: {
- type: String,
- default: "#b0b3bf"
- },
- // 字体颜色
- fontColor: {
- type: String,
- default: "#b0b3bf"
- },
- // placeholder
- placeholder: {
- type: String,
- default: "这是一个搜索框"
- },
- radius: {
- type: Number,
- default: 10
- },
- width: {
- type: String,
- default: "100%"
- },
- navbar: {
- type: Boolean,
- default: true
- }
- },
- emits: ["click"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const state = vue.reactive({
- searchVal: ""
- });
- const emits = __emit;
- const props = __props;
- const click2 = () => {
- emits("click");
- };
- function onSearch(e2) {
- if (e2.value) {
- sheep$1.$router.go("/pages/goods/list", {
- keyword: e2.value
- });
- setTimeout(() => {
- state.searchVal = "";
- }, 100);
- }
- }
- const __returned__ = { state, emits, props, click: click2, onSearch, computed: vue.computed, reactive: vue.reactive, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3g(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_search_bar = resolveEasycom(vue.resolveDynamicComponent("uni-search-bar"), __easycom_0$p);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["search-content ss-flex ss-col-center ss-row-between", [{ "border-content": $props.navbar }]]),
- onClick: $setup.click,
- style: vue.normalizeStyle([
- {
- borderRadius: $props.radius + "px",
- background: $props.elBackground,
- height: $props.height + "px",
- width: $props.width
- }
- ])
- },
- [
- $props.navbar ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "ss-flex ss-col-center"
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "search-icon _icon-search ss-m-l-10",
- style: vue.normalizeStyle([{ color: $setup.props.iconColor }])
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "search-input ss-flex-1 ss-line-1",
- style: vue.normalizeStyle([{ color: $props.fontColor, width: $props.width }])
- },
- vue.toDisplayString($props.placeholder),
- 5
- /* TEXT, STYLE */
- )
- ])) : vue.createCommentVNode("v-if", true),
- !$props.navbar ? (vue.openBlock(), vue.createBlock(_component_uni_search_bar, {
- key: 1,
- class: "ss-flex-1",
- radius: $props.data.borderRadius,
- placeholder: $props.data.placeholder,
- cancelButton: "none",
- clearButton: "none",
- onConfirm: $setup.onSearch,
- modelValue: $setup.state.searchVal,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.searchVal = $event)
- }, null, 8, ["radius", "placeholder", "modelValue"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "keyword-link ss-flex" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.data.hotKeywords, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
- vue.createElementVNode("view", {
- class: "ss-m-r-16",
- style: vue.normalizeStyle([{ color: $props.data.textColor }]),
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go("/pages/goods/list", { keyword: item }), ["stop"])
- }, vue.toDisplayString(item), 13, ["onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- $props.data.hotKeywords && $props.data.hotKeywords.length && $props.navbar ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "ss-flex"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.data.hotKeywords, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "button",
- {
- class: "ss-reset-button keyword-btn",
- key: index2,
- style: vue.normalizeStyle([{ color: $props.data.textColor, marginRight: "10rpx" }])
- },
- vue.toDisplayString(item),
- 5
- /* TEXT, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_0$n = /* @__PURE__ */ _export_sfc(_sfc_main$3h, [["render", _sfc_render$3g], ["__scopeId", "data-v-1f3fe5bf"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-search-block/s-search-block.vue"]]);
- const _sfc_main$3g = {
- __name: "navbar-item",
- props: {
- data: {
- type: Object,
- default: () => ({})
- },
- width: {
- type: String,
- default: "1px"
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const height = vue.computed(() => sheep$1.$platform.capsule.height);
- const __returned__ = { props, height, get sheep() {
- return sheep$1;
- }, computed: vue.computed };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3f(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_search_block = resolveEasycom(vue.resolveDynamicComponent("s-search-block"), __easycom_0$n);
- return vue.openBlock(), vue.createElementBlock("view", { class: "ss-flex ss-col-center" }, [
- $props.data.type === "text" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "nav-title inline",
- style: vue.normalizeStyle([{ color: $props.data.textColor, width: $props.width }])
- },
- vue.toDisplayString($props.data.text),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.data.type === "image" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- style: vue.normalizeStyle([{ width: $props.width }]),
- class: "menu-icon-wrap ss-flex ss-row-center ss-col-center",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go($props.data.url))
- },
- [
- vue.createElementVNode("image", {
- class: "nav-image",
- src: $setup.sheep.$url.cdn($props.data.src),
- mode: "aspectFit"
- }, null, 8, ["src"])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.data.type == "search" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "ss-flex-1",
- style: vue.normalizeStyle([{ width: $props.width }])
- },
- [
- vue.createVNode(_component_s_search_block, {
- placeholder: $props.data.placeholder || "搜索关键字",
- radius: $props.data.borderRadius,
- elBackground: "#fff",
- height: $setup.height,
- width: $props.width,
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/index/search"))
- }, null, 8, ["placeholder", "radius", "height", "width"])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const NavbarItem = /* @__PURE__ */ _export_sfc(_sfc_main$3g, [["render", _sfc_render$3f], ["__scopeId", "data-v-c063d35d"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-custom-navbar/components/navbar-item.vue"]]);
- const _sfc_main$3f = {
- __name: "s-custom-navbar",
- props: {
- data: {
- type: Object,
- default: () => ({})
- },
- showLeftButton: {
- type: Boolean,
- default: false
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const hasHistory2 = sheep$1.$router.hasHistory();
- const sticky = vue.computed(() => {
- if (props.data.mode == "inner") {
- if (props.data.alway) {
- return false;
- }
- }
- if (props.data.mode == "normal") {
- return false;
- }
- });
- const navList = vue.computed(() => {
- if (!props.data.list)
- return [];
- return props.data.list.app;
- });
- const windowWidth2 = sheep$1.$platform.device.windowWidth;
- const cell = vue.computed(() => {
- if (vue.unref(navList).length) {
- let cell2 = (windowWidth2 - 90) / 8;
- return cell2;
- }
- });
- const parseImgStyle = (item) => {
- let obj = {
- width: item.width * cell.value + (item.width - 1) * 10 + "px",
- left: item.left * cell.value + (item.left + 1) * 10 + "px",
- "border-radius": item.borderRadius + "px"
- };
- return obj;
- };
- const isAlway = vue.computed(
- () => props.data.mode === "inner" ? Boolean(props.data.alwaysShow) : true
- );
- const isOpacity = vue.computed(
- () => props.data.mode === "normal" ? false : props.showLeftButton ? false : props.data.mode === "inner"
- );
- const isPlaceholder = vue.computed(() => props.data.mode === "normal");
- const bgStyles = vue.computed(() => {
- if (props.data.type) {
- return {
- background: props.data.type == "color" ? props.data.color : `url(${sheep$1.$url.cdn(props.data.src)}) no-repeat top center / 100% 100%`
- };
- }
- });
- function onClickLeft() {
- if (hasHistory2) {
- sheep$1.$router.back();
- } else {
- sheep$1.$router.go("/pages/index/index");
- }
- }
- function onClickRight() {
- showMenuTools();
- }
- const __returned__ = { props, hasHistory: hasHistory2, sticky, navList, windowWidth: windowWidth2, cell, parseImgStyle, isAlway, isOpacity, isPlaceholder, bgStyles, onClickLeft, onClickRight, computed: vue.computed, unref: vue.unref, get sheep() {
- return sheep$1;
- }, Navbar, NavbarItem, get showMenuTools() {
- return showMenuTools;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3e(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createBlock($setup["Navbar"], {
- alway: $setup.isAlway,
- back: false,
- bg: "",
- placeholder: $setup.isPlaceholder,
- bgStyles: $setup.bgStyles,
- opacity: $setup.isOpacity,
- sticky: $setup.sticky
- }, {
- item: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "nav-box" }, [
- $props.showLeftButton ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "nav-icon"
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["icon-box ss-flex", { "inner-icon-box": $props.data.mode == "inner" }])
- },
- [
- vue.createElementVNode("view", {
- class: "icon-button icon-button-left ss-flex ss-row-center",
- onClick: $setup.onClickLeft
- }, [
- $setup.hasHistory ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "sicon-back"
- })) : (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- class: "sicon-home"
- }))
- ]),
- vue.createElementVNode("view", { class: "line" }),
- vue.createElementVNode("view", {
- class: "icon-button icon-button-right ss-flex ss-row-center",
- onClick: $setup.onClickRight
- }, [
- vue.createElementVNode("text", { class: "sicon-more" })
- ])
- ],
- 2
- /* CLASS */
- )
- ])) : vue.createCommentVNode("v-if", true),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.navList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["nav-item", [{ "ss-flex ss-col-center ss-row-center": item.type !== "search" }]]),
- key: index2,
- style: vue.normalizeStyle([$setup.parseImgStyle(item)])
- },
- [
- vue.createVNode($setup["NavbarItem"], {
- data: item,
- width: $setup.parseImgStyle(item).width
- }, null, 8, ["data", "width"])
- ],
- 6
- /* CLASS, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["alway", "placeholder", "bgStyles", "opacity", "sticky"]);
- }
- const __easycom_1$a = /* @__PURE__ */ _export_sfc(_sfc_main$3f, [["render", _sfc_render$3e], ["__scopeId", "data-v-6417c6b5"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-custom-navbar/s-custom-navbar.vue"]]);
- const _sfc_main$3e = {
- __name: "su-inner-navbar",
- props: {
- zIndex: {
- type: Number,
- default: 100
- },
- title: {
- //返回文本
- type: String,
- default: ""
- },
- bg: {
- type: String,
- default: "bg-white"
- },
- // 常驻
- alway: {
- type: Boolean,
- default: true
- },
- opacity: {
- //是否开启滑动渐变
- type: Boolean,
- default: true
- },
- noFixed: {
- //是否浮动
- type: Boolean,
- default: true
- },
- ui: {
- type: String,
- default: ""
- },
- capsule: {
- //是否开启胶囊返回
- type: Boolean,
- default: false
- },
- stopBack: {
- type: Boolean,
- default: false
- },
- placeholder: {
- type: [Boolean],
- default: false
- },
- bgStyles: {
- type: Object,
- default() {
- }
- }
- },
- emits: ["navback", "clickLeft"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const state = vue.reactive({
- statusCur: "",
- capsuleStyle: {},
- capsuleBack: {},
- isDark: true
- });
- const sys_statusBar = sheep$1.$platform.device.statusBarHeight;
- const sys_navBar = sheep$1.$platform.navbar;
- const props = __props;
- const emits = __emit;
- const hasHistory2 = sheep$1.$router.hasHistory();
- vue.onBeforeMount(() => {
- init();
- });
- onPageScroll((e2) => {
- let top = e2.scrollTop;
- state.isDark = top < sheep$1.$platform.navbar;
- });
- function onClickLeft() {
- if (hasHistory2) {
- sheep$1.$router.back();
- } else {
- sheep$1.$router.go("/pages/index/index");
- }
- emits("clickLeft");
- }
- function onClickRight() {
- showMenuTools();
- }
- const init = () => {
- state.capsuleStyle = {
- width: sheep$1.$platform.capsule.width + "px",
- height: sheep$1.$platform.capsule.height + "px"
- };
- state.capsuleBack = state.capsuleStyle;
- };
- const __returned__ = { state, sys_statusBar, sys_navBar, props, emits, hasHistory: hasHistory2, onClickLeft, onClickRight, init, computed: vue.computed, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, ref: vue.ref, get sheep() {
- return sheep$1;
- }, get onPageScroll() {
- return onPageScroll;
- }, get showMenuTools() {
- return showMenuTools;
- }, get closeMenuTools() {
- return closeMenuTools;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3d(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_status_bar = resolveEasycom(vue.resolveDynamicComponent("su-status-bar"), __easycom_0$q);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- return vue.openBlock(), vue.createBlock(_component_su_fixed, {
- noFixed: $setup.props.noFixed,
- alway: $setup.props.alway,
- bgStyles: $setup.props.bgStyles,
- val: 0,
- index: $setup.props.zIndex,
- noNav: "",
- bg: $setup.props.bg,
- ui: $setup.props.ui,
- opacity: $setup.props.opacity,
- placeholder: $setup.props.placeholder
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_status_bar),
- vue.createCommentVNode(`
- :class="[{ 'border-bottom': !props.opacity && props.bg != 'bg-none' }]"
- `),
- vue.createElementVNode("view", { class: "ui-navbar-box" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["ui-bar ss-p-x-20", $setup.state.isDark ? "text-white" : "text-black"]),
- style: vue.normalizeStyle([{ height: $setup.sys_navBar - $setup.sys_statusBar + "px" }])
- },
- [
- vue.createElementVNode("view", { class: "icon-box ss-flex" }, [
- vue.createElementVNode("view", {
- class: "icon-button icon-button-left ss-flex ss-row-center",
- onClick: $setup.onClickLeft
- }, [
- $setup.hasHistory ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "sicon-back"
- })) : (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- class: "sicon-home"
- }))
- ]),
- vue.createElementVNode("view", { class: "line" }),
- vue.createElementVNode("view", {
- class: "icon-button icon-button-right ss-flex ss-row-center",
- onClick: $setup.onClickRight
- }, [
- vue.createElementVNode("text", { class: "sicon-more" })
- ])
- ]),
- vue.renderSlot(_ctx.$slots, "center", {}, () => [
- vue.createElementVNode(
- "view",
- { class: "center navbar-title" },
- vue.toDisplayString($props.title),
- 1
- /* TEXT */
- )
- ], true)
- ],
- 6
- /* CLASS, STYLE */
- )
- ])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["noFixed", "alway", "bgStyles", "index", "bg", "ui", "opacity", "placeholder"]);
- }
- const __easycom_2$8 = /* @__PURE__ */ _export_sfc(_sfc_main$3e, [["render", _sfc_render$3d], ["__scopeId", "data-v-374b2fee"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-inner-navbar/su-inner-navbar.vue"]]);
- class MPAnimation {
- constructor(options2, _this) {
- this.options = options2;
- this.animation = uni.createAnimation(options2);
- this.currentStepAnimates = {};
- this.next = 0;
- this.$ = _this;
- }
- _nvuePushAnimates(type, args) {
- let aniObj = this.currentStepAnimates[this.next];
- let styles = {};
- if (!aniObj) {
- styles = {
- styles: {},
- config: {}
- };
- } else {
- styles = aniObj;
- }
- if (animateTypes1.includes(type)) {
- if (!styles.styles.transform) {
- styles.styles.transform = "";
- }
- let unit = "";
- if (type === "rotate") {
- unit = "deg";
- }
- styles.styles.transform += `${type}(${args + unit}) `;
- } else {
- styles.styles[type] = `${args}`;
- }
- this.currentStepAnimates[this.next] = styles;
- }
- _animateRun(styles = {}, config2 = {}) {
- let ref = this.$.$refs["ani"].ref;
- if (!ref)
- return;
- return new Promise((resolve, reject) => {
- nvueAnimation.transition(ref, {
- styles,
- ...config2
- }, (res) => {
- resolve();
- });
- });
- }
- _nvueNextAnimate(animates, step = 0, fn) {
- let obj = animates[step];
- if (obj) {
- let {
- styles,
- config: config2
- } = obj;
- this._animateRun(styles, config2).then(() => {
- step += 1;
- this._nvueNextAnimate(animates, step, fn);
- });
- } else {
- this.currentStepAnimates = {};
- typeof fn === "function" && fn();
- this.isEnd = true;
- }
- }
- step(config2 = {}) {
- this.animation.step(config2);
- return this;
- }
- run(fn) {
- this.$.animationData = this.animation.export();
- this.$.timer = setTimeout(() => {
- typeof fn === "function" && fn();
- }, this.$.durationTime);
- }
- }
- const animateTypes1 = [
- "matrix",
- "matrix3d",
- "rotate",
- "rotate3d",
- "rotateX",
- "rotateY",
- "rotateZ",
- "scale",
- "scale3d",
- "scaleX",
- "scaleY",
- "scaleZ",
- "skew",
- "skewX",
- "skewY",
- "translate",
- "translate3d",
- "translateX",
- "translateY",
- "translateZ"
- ];
- const animateTypes2 = ["opacity", "backgroundColor"];
- const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
- animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
- MPAnimation.prototype[type] = function(...args) {
- this.animation[type](...args);
- return this;
- };
- });
- function createAnimation(option, _this) {
- if (!_this)
- return;
- clearTimeout(_this.timer);
- return new MPAnimation(option, _this);
- }
- const _sfc_main$3d = {
- name: "uniTransition",
- emits: ["click", "change"],
- props: {
- show: {
- type: Boolean,
- default: false
- },
- modeClass: {
- type: [Array, String],
- default() {
- return "fade";
- }
- },
- duration: {
- type: Number,
- default: 300
- },
- styles: {
- type: Object,
- default() {
- return {};
- }
- },
- customClass: {
- type: String,
- default: ""
- }
- },
- data() {
- return {
- isShow: false,
- transform: "",
- opacity: 1,
- animationData: {},
- durationTime: 300,
- config: {}
- };
- },
- watch: {
- show: {
- handler(newVal) {
- if (newVal) {
- this.open();
- } else {
- if (this.isShow) {
- this.close();
- }
- }
- },
- immediate: true
- }
- },
- computed: {
- // 生成样式数据
- stylesObject() {
- let styles = {
- ...this.styles,
- "transition-duration": this.duration / 1e3 + "s"
- };
- let transform = "";
- for (let i2 in styles) {
- let line = this.toLine(i2);
- transform += line + ":" + styles[i2] + ";";
- }
- return transform;
- },
- // 初始化动画条件
- transformStyles() {
- return "transform:" + this.transform + ";opacity:" + this.opacity + ";" + this.stylesObject;
- }
- },
- created() {
- this.config = {
- duration: this.duration,
- timingFunction: "ease",
- transformOrigin: "50% 50%",
- delay: 0
- };
- this.durationTime = this.duration;
- },
- methods: {
- /**
- * ref 触发 初始化动画
- */
- init(obj = {}) {
- if (obj.duration) {
- this.durationTime = obj.duration;
- }
- this.animation = createAnimation(Object.assign(this.config, obj), this);
- },
- /**
- * 点击组件触发回调
- */
- onClick() {
- this.$emit("click", {
- detail: this.isShow
- });
- },
- /**
- * ref 触发 动画分组
- * @param {Object} obj
- */
- step(obj, config2 = {}) {
- if (!this.animation)
- return;
- for (let i2 in obj) {
- try {
- if (typeof obj[i2] === "object") {
- this.animation[i2](...obj[i2]);
- } else {
- this.animation[i2](obj[i2]);
- }
- } catch (e2) {
- formatAppLog("error", "at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:161", `方法 ${i2} 不存在`);
- }
- }
- this.animation.step(config2);
- return this;
- },
- /**
- * ref 触发 执行动画
- */
- run(fn) {
- if (!this.animation)
- return;
- this.animation.run(fn);
- },
- // 开始过度动画
- open() {
- clearTimeout(this.timer);
- this.transform = "";
- this.isShow = true;
- let { opacity, transform } = this.styleInit(false);
- if (typeof opacity !== "undefined") {
- this.opacity = opacity;
- }
- this.transform = transform;
- this.$nextTick(() => {
- this.timer = setTimeout(() => {
- this.animation = createAnimation(this.config, this);
- this.tranfromInit(false).step();
- this.animation.run();
- this.$emit("change", {
- detail: this.isShow
- });
- }, 20);
- });
- },
- // 关闭过度动画
- close(type) {
- if (!this.animation)
- return;
- this.tranfromInit(true).step().run(() => {
- this.isShow = false;
- this.animationData = null;
- this.animation = null;
- let { opacity, transform } = this.styleInit(false);
- this.opacity = opacity || 1;
- this.transform = transform;
- this.$emit("change", {
- detail: this.isShow
- });
- });
- },
- // 处理动画开始前的默认样式
- styleInit(type) {
- let styles = {
- transform: ""
- };
- let buildStyle = (type2, mode) => {
- if (mode === "fade") {
- styles.opacity = this.animationType(type2)[mode];
- } else {
- styles.transform += this.animationType(type2)[mode] + " ";
- }
- };
- if (typeof this.modeClass === "string") {
- buildStyle(type, this.modeClass);
- } else {
- this.modeClass.forEach((mode) => {
- buildStyle(type, mode);
- });
- }
- return styles;
- },
- // 处理内置组合动画
- tranfromInit(type) {
- let buildTranfrom = (type2, mode) => {
- let aniNum = null;
- if (mode === "fade") {
- aniNum = type2 ? 0 : 1;
- } else {
- aniNum = type2 ? "-100%" : "0";
- if (mode === "zoom-in") {
- aniNum = type2 ? 0.8 : 1;
- }
- if (mode === "zoom-out") {
- aniNum = type2 ? 1.2 : 1;
- }
- if (mode === "slide-right") {
- aniNum = type2 ? "100%" : "0";
- }
- if (mode === "slide-bottom") {
- aniNum = type2 ? "100%" : "0";
- }
- }
- this.animation[this.animationMode()[mode]](aniNum);
- };
- if (typeof this.modeClass === "string") {
- buildTranfrom(type, this.modeClass);
- } else {
- this.modeClass.forEach((mode) => {
- buildTranfrom(type, mode);
- });
- }
- return this.animation;
- },
- animationType(type) {
- return {
- fade: type ? 1 : 0,
- "slide-top": `translateY(${type ? "0" : "-100%"})`,
- "slide-right": `translateX(${type ? "0" : "100%"})`,
- "slide-bottom": `translateY(${type ? "0" : "100%"})`,
- "slide-left": `translateX(${type ? "0" : "-100%"})`,
- "zoom-in": `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
- "zoom-out": `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
- };
- },
- // 内置动画类型与实际动画对应字典
- animationMode() {
- return {
- fade: "opacity",
- "slide-top": "translateY",
- "slide-right": "translateX",
- "slide-bottom": "translateY",
- "slide-left": "translateX",
- "zoom-in": "scale",
- "zoom-out": "scale"
- };
- },
- // 驼峰转中横线
- toLine(name2) {
- return name2.replace(/([A-Z])/g, "-$1").toLowerCase();
- }
- }
- };
- function _sfc_render$3c(_ctx, _cache, $props, $setup, $data, $options) {
- return $data.isShow ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- ref: "ani",
- animation: $data.animationData,
- class: vue.normalizeClass($props.customClass),
- style: vue.normalizeStyle($options.transformStyles),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default")
- ], 14, ["animation"])) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0$m = /* @__PURE__ */ _export_sfc(_sfc_main$3d, [["render", _sfc_render$3c], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-transition/components/uni-transition/uni-transition.vue"]]);
- const _sfc_main$3c = {
- name: "SuPopup",
- components: {},
- emits: ["change", "maskClick", "close"],
- props: {
- // 开启状态
- show: {
- type: Boolean,
- default: false
- },
- // 顶部,底部时有效
- space: {
- type: Number,
- default: 0
- },
- // 默认圆角
- round: {
- type: [String, Number],
- default: 0
- },
- // 是否显示关闭
- showClose: {
- type: Boolean,
- default: false
- },
- // 开启动画
- animation: {
- type: Boolean,
- default: true
- },
- // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
- // message: 消息提示 ; dialog : 对话框
- type: {
- type: String,
- default: "bottom"
- },
- // maskClick
- isMaskClick: {
- type: Boolean,
- default: null
- },
- // TODO 2 个版本后废弃属性 ,使用 isMaskClick
- maskClick: {
- type: Boolean,
- default: null
- },
- // 可设置none
- backgroundColor: {
- type: String,
- default: "#ffffff"
- },
- backgroundImage: {
- type: String,
- default: ""
- },
- safeArea: {
- type: Boolean,
- default: true
- },
- maskBackgroundColor: {
- type: String,
- default: "rgba(0, 0, 0, 0.4)"
- },
- zIndex: {
- type: [String, Number],
- default: 10075
- }
- },
- watch: {
- show: {
- handler: function(newValue, oldValue) {
- if (typeof oldValue === "undefined" && !newValue) {
- return;
- }
- if (newValue) {
- this.open();
- } else {
- this.close();
- }
- },
- immediate: true
- },
- /**
- * 监听type类型
- */
- type: {
- handler: function(type) {
- if (!this.config[type])
- return;
- this[this.config[type]](true);
- },
- immediate: true
- },
- isDesktop: {
- handler: function(newVal) {
- if (!this.config[newVal])
- return;
- this[this.config[this.type]](true);
- },
- immediate: true
- },
- /**
- * 监听遮罩是否可点击
- * @param {Object} val
- */
- maskClick: {
- handler: function(val) {
- this.mkclick = val;
- },
- immediate: true
- },
- isMaskClick: {
- handler: function(val) {
- this.mkclick = val;
- },
- immediate: true
- },
- // H5 下禁止底部滚动
- showPopup(show) {
- }
- },
- data() {
- return {
- sheep: sheep$1,
- duration: 300,
- ani: [],
- showPopup: false,
- showTrans: false,
- popupWidth: 0,
- popupHeight: 0,
- config: {
- top: "top",
- bottom: "bottom",
- center: "center",
- left: "left",
- right: "right",
- message: "top",
- dialog: "center",
- share: "bottom"
- },
- maskClass: {
- position: "fixed",
- bottom: 0,
- top: 0,
- left: 0,
- right: 0,
- backgroundColor: "rgba(0, 0, 0, 0.4)"
- },
- transClass: {
- position: "fixed",
- left: 0,
- right: 0
- },
- maskShow: true,
- mkclick: true,
- popupstyle: this.isDesktop ? "fixforpc-top" : "top"
- };
- },
- computed: {
- isDesktop() {
- return this.popupWidth >= 500 && this.popupHeight >= 500;
- },
- bg() {
- if (this.backgroundColor === "" || this.backgroundColor === "none") {
- return "transparent";
- }
- return this.backgroundColor;
- },
- borderRadius() {
- if (this.round) {
- if (this.type === "bottom") {
- return {
- "border-top-left-radius": parseFloat(this.round) + "px",
- "border-top-right-radius": parseFloat(this.round) + "px"
- };
- }
- if (this.type === "center") {
- return {
- "border-top-left-radius": parseFloat(this.round) + "px",
- "border-top-right-radius": parseFloat(this.round) + "px",
- "border-bottom-left-radius": parseFloat(this.round) + "px",
- "border-bottom-right-radius": parseFloat(this.round) + "px"
- };
- }
- if (this.type === "top") {
- return {
- "border-bottom-left-radius": parseFloat(this.round) + "px",
- "border-bottom-right-radius": parseFloat(this.round) + "px"
- };
- }
- }
- }
- },
- mounted() {
- const fixSize = () => {
- const { windowWidth: windowWidth2, windowHeight, windowTop, safeArea, screenHeight, safeAreaInsets } = sheep$1.$platform.device;
- this.popupWidth = windowWidth2;
- this.popupHeight = windowHeight + (windowTop || 0);
- if (safeArea && this.safeArea) {
- this.safeAreaInsets = safeAreaInsets.bottom;
- } else {
- this.safeAreaInsets = 0;
- }
- };
- fixSize();
- },
- // TODO vue3
- unmounted() {
- this.setH5Visible();
- },
- created() {
- if (this.isMaskClick === null && this.maskClick === null) {
- this.mkclick = true;
- } else {
- this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
- }
- if (this.animation) {
- this.duration = 300;
- } else {
- this.duration = 0;
- }
- this.messageChild = null;
- this.clearPropagation = false;
- this.maskClass.backgroundColor = this.maskBackgroundColor;
- },
- methods: {
- setH5Visible() {
- },
- /**
- * 公用方法,不显示遮罩层
- */
- closeMask() {
- this.maskShow = false;
- },
- /**
- * 公用方法,遮罩层禁止点击
- */
- disableMask() {
- this.mkclick = false;
- },
- // TODO nvue 取消冒泡
- clear(e2) {
- e2.stopPropagation();
- this.clearPropagation = true;
- },
- open(direction) {
- if (this.showPopup) {
- clearTimeout(this.timer);
- this.showPopup = false;
- }
- let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
- if (!(direction && innerType.indexOf(direction) !== -1)) {
- direction = this.type;
- }
- if (!this.config[direction]) {
- formatAppLog("error", "at sheep/ui/su-popup/su-popup.vue:384", "缺少类型:", direction);
- return;
- }
- this[this.config[direction]]();
- this.$emit("change", {
- show: true,
- type: direction
- });
- },
- close(type) {
- this.showTrans = false;
- this.$emit("change", {
- show: false,
- type: this.type
- });
- this.$emit("close");
- clearTimeout(this.timer);
- this.timer = setTimeout(() => {
- this.showPopup = false;
- }, 300);
- },
- // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
- touchstart() {
- this.clearPropagation = false;
- },
- onTap() {
- if (this.clearPropagation) {
- this.clearPropagation = false;
- return;
- }
- this.$emit("maskClick");
- if (!this.mkclick)
- return;
- this.close();
- },
- /**
- * 顶部弹出样式处理
- */
- top(type) {
- this.popupstyle = this.isDesktop ? "fixforpc-top" : "top";
- this.ani = ["slide-top"];
- this.transClass = {
- position: "fixed",
- left: 0,
- right: 0,
- top: this.space + "px",
- backgroundColor: this.bg
- };
- if (type)
- return;
- this.showPopup = true;
- this.showTrans = true;
- this.$nextTick(() => {
- if (this.messageChild && this.type === "message") {
- this.messageChild.timerClose();
- }
- });
- },
- /**
- * 底部弹出样式处理
- */
- bottom(type) {
- this.popupstyle = "bottom";
- this.ani = ["slide-bottom"];
- this.transClass = {
- position: "fixed",
- left: 0,
- right: 0,
- bottom: 0,
- paddingBottom: this.safeAreaInsets + this.space + "px",
- backgroundColor: this.bg
- };
- if (type)
- return;
- this.showPopup = true;
- this.showTrans = true;
- },
- /**
- * 中间弹出样式处理
- */
- center(type) {
- this.popupstyle = "center";
- this.ani = ["zoom-out", "fade"];
- this.transClass = {
- position: "fixed",
- display: "flex",
- flexDirection: "column",
- bottom: 0,
- left: 0,
- right: 0,
- top: 0,
- justifyContent: "center",
- alignItems: "center"
- };
- if (type)
- return;
- this.showPopup = true;
- this.showTrans = true;
- },
- left(type) {
- this.popupstyle = "left";
- this.ani = ["slide-left"];
- this.transClass = {
- position: "fixed",
- left: 0,
- bottom: 0,
- top: 0,
- backgroundColor: this.bg,
- display: "flex",
- flexDirection: "column"
- };
- if (type)
- return;
- this.showPopup = true;
- this.showTrans = true;
- },
- right(type) {
- this.popupstyle = "right";
- this.ani = ["slide-right"];
- this.transClass = {
- position: "fixed",
- bottom: 0,
- right: 0,
- top: 0,
- backgroundColor: this.bg,
- display: "flex",
- flexDirection: "column"
- };
- if (type)
- return;
- this.showPopup = true;
- this.showTrans = true;
- }
- }
- };
- const __injectCSSVars__ = () => {
- vue.useCssVars((_ctx) => ({
- "f2bacd7c-backgroundImage": _ctx.backgroundImage
- }));
- };
- const __setup__ = _sfc_main$3c.setup;
- _sfc_main$3c.setup = __setup__ ? (props, ctx) => {
- __injectCSSVars__();
- return __setup__(props, ctx);
- } : __injectCSSVars__;
- function _sfc_render$3b(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_transition = resolveEasycom(vue.resolveDynamicComponent("uni-transition"), __easycom_0$m);
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return $data.showPopup ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uni-popup", [$data.popupstyle, $options.isDesktop ? "fixforpc-z-index" : ""]]),
- style: vue.normalizeStyle([{ zIndex: $props.zIndex }]),
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop", "prevent"]))
- },
- [
- vue.createElementVNode(
- "view",
- {
- onTouchstart: _cache[1] || (_cache[1] = (...args) => $options.touchstart && $options.touchstart(...args))
- },
- [
- $data.maskShow ? (vue.openBlock(), vue.createBlock(_component_uni_transition, {
- key: "1",
- name: "mask",
- "mode-class": "fade",
- styles: $data.maskClass,
- duration: $data.duration,
- show: $data.showTrans,
- onClick: $options.onTap
- }, null, 8, ["styles", "duration", "show", "onClick"])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_uni_transition, {
- key: "2",
- "mode-class": $data.ani,
- name: "content",
- styles: { ...$data.transClass, ...$options.borderRadius },
- duration: $data.duration,
- show: $data.showTrans,
- onClick: $options.onTap
- }, {
- default: vue.withCtx(() => [
- $data.showPopup ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uni-popup__wrapper", [$data.popupstyle]]),
- style: vue.normalizeStyle([{ backgroundColor: $options.bg }, $options.borderRadius]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clear && $options.clear(...args))
- },
- [
- $props.showClose ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
- key: 0,
- class: "close-icon",
- color: "#F6F6F6",
- type: "closeempty",
- size: "32",
- onClick: $options.close
- }, null, 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["mode-class", "styles", "duration", "show", "onClick"])
- ],
- 32
- /* NEED_HYDRATION */
- )
- ],
- 38
- /* CLASS, STYLE, NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_4$3 = /* @__PURE__ */ _export_sfc(_sfc_main$3c, [["render", _sfc_render$3b], ["__scopeId", "data-v-f2bacd7c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-popup/su-popup.vue"]]);
- const formatToFraction = (num) => {
- if (typeof num === "undefined")
- return 0;
- const parsedNumber = typeof num === "string" ? parseFloat(num) : num;
- return parseFloat((parsedNumber / 100).toFixed(2));
- };
- const floatToFixed2 = (num) => {
- let str = "0.00";
- if (typeof num === "undefined") {
- return str;
- }
- const f2 = formatToFraction(num);
- const decimalPart = f2.toString().split(".")[1];
- const len = decimalPart ? decimalPart.length : 0;
- switch (len) {
- case 0:
- str = f2.toString() + ".00";
- break;
- case 1:
- str = f2.toString() + ".0";
- break;
- case 2:
- str = f2.toString();
- break;
- }
- return str;
- };
- function formatDate(date2, format2) {
- if (!date2) {
- return "";
- }
- if (format2 === void 0) {
- format2 = "YYYY-MM-DD HH:mm:ss";
- }
- return dayjs(date2).format(format2);
- }
- function handleTree(data, id = "id", parentId = "parentId", children = "children", rootId = 0) {
- const cloneData = JSON.parse(JSON.stringify(data));
- const treeData = cloneData.filter((father) => {
- let branchArr = cloneData.filter((child) => {
- return father[id] === child[parentId];
- });
- branchArr.length > 0 ? father.children = branchArr : "";
- return father[parentId] === rootId;
- });
- return treeData !== "" ? treeData : data;
- }
- function resetPagination(pagination) {
- pagination.list = [];
- pagination.total = 0;
- pagination.pageNo = 1;
- }
- function formatSales(type, num) {
- let prefix = type !== "exact" && num < 10 ? t$6("common.sales_volume") : t$6("common.sold");
- return formatNum(prefix, type, num);
- }
- function formatStock(type, num) {
- return formatNum(t$6("useGoods.in_stock"), type, num);
- }
- function formatNum(prefix, type, num) {
- num = num || 0;
- if (type === "exact") {
- return prefix + num;
- }
- if (num < 10) {
- return `${prefix}≤10`;
- }
- let pow = Math.pow(10, `${num}`.length - 1);
- return `${prefix}${num / pow * pow}+`;
- }
- const VIDEO_SUFFIX_LIST = [".avi", ".mp4"];
- function formatGoodsSwiper(urlList) {
- return (urlList == null ? void 0 : urlList.filter((url2) => url2).map((url2, key) => {
- const isVideo = VIDEO_SUFFIX_LIST.some((suffix) => url2.includes(suffix));
- const type = isVideo ? "video" : "image";
- const src = $url.cdn(url2);
- return {
- type,
- src
- };
- })) || [];
- }
- function formatOrderColor(order2) {
- if (order2.status === 0) {
- return "info-color";
- }
- if (order2.status === 10 || order2.status === 20 || order2.status === 30 && !order2.commentStatus) {
- return "warning-color";
- }
- if (order2.status === 30 && order2.commentStatus) {
- return "success-color";
- }
- return "danger-color";
- }
- function formatOrderStatus(order2) {
- if (order2.status === 0) {
- return t$6("useGoods.pending_payment");
- }
- if (order2.status === 10 && order2.deliveryType === 1 || order2.status === 10 && order2.deliveryType === 3) {
- return t$6("useGoods.awaiting_shipment");
- }
- if (order2.status === 10 && order2.deliveryType === 2) {
- return t$6("useGoods.awaiting_write_off");
- }
- if (order2.status === 20) {
- return t$6("useGoods.awaiting_delivery");
- }
- if (order2.status === 30 && !order2.commentStatus) {
- return t$6("useGoods.awaiting_review");
- }
- if (order2.status === 30 && order2.commentStatus) {
- return t$6("useGoods.completed");
- }
- return t$6("useGoods.closed");
- }
- function formatOrderStatusDescription(order2) {
- if (order2.status === 0) {
- return t$6("useGoods.complete_payment_by", { time: formatDate(order2.payExpireTime) });
- }
- if (order2.status === 10) {
- return t$6("useGoods.merchant_not_shipped");
- }
- if (order2.status === 20) {
- return t$6("useGoods.merchant_shipped");
- }
- if (order2.status === 30 && !order2.commentStatus) {
- return t$6("useGoods.goods_received");
- }
- if (order2.status === 30 && order2.commentStatus) {
- return t$6("useGoods.transaction_completed");
- }
- return t$6("useGoods.transaction_closed");
- }
- function handleOrderButtons(order2) {
- var _a2, _b2;
- console.log();
- order2.buttons = [];
- if (order2.type === 3) {
- order2.buttons.push("combination");
- }
- if (order2.status === 20) {
- order2.buttons.push("express");
- order2.buttons.push("confirm");
- }
- if (order2.logisticsId > 0) {
- order2.buttons.push("express");
- }
- if (order2.status === 0) {
- order2.buttons.push("cancel");
- order2.buttons.push("pay");
- }
- if (order2.status === 30 && !order2.commentStatus) {
- order2.buttons.push("comment");
- }
- if (order2.status === 40) {
- order2.buttons.push("delete");
- }
- if ([10, 20, 30].includes((_a2 = order2.items[0]) == null ? void 0 : _a2.refundStatus)) {
- order2.buttons.push("aftersaleCancel");
- }
- if (((_b2 = order2.items[0]) == null ? void 0 : _b2.refundStatus) === 20) {
- order2.buttons.push("aftersaleDelivery");
- }
- }
- function formatAfterSaleStatus(afterSale) {
- if (afterSale.status === 10) {
- return t$6("useGoods.apply_for_after_sales");
- }
- if (afterSale.status === 20) {
- return t$6("useGoods.goods_awaiting_return");
- }
- if (afterSale.status === 30) {
- return t$6("useGoods.merchant_awaiting_goods");
- }
- if (afterSale.status === 40) {
- return t$6("useGoods.waiting_for_refund");
- }
- if (afterSale.status === 50) {
- return t$6("useGoods.refund_successful");
- }
- if (afterSale.status === 61) {
- return t$6("useGoods.buyer_cancelled");
- }
- if (afterSale.status === 62) {
- return t$6("useGoods.merchant_refused");
- }
- if (afterSale.status === 63) {
- return t$6("useGoods.merchant_refused_goods");
- }
- return t$6("useGoods.unknown_status");
- }
- function formatAfterSaleStatusDescription(afterSale) {
- if (afterSale.status === 10) {
- return t$6("useGoods.refund_request_awaiting_merchant");
- }
- if (afterSale.status === 20) {
- return t$6("useGoods.return_goods_fill_logistics");
- }
- if (afterSale.status === 30) {
- return t$6("useGoods.return_refund_request_awaiting_merchant");
- }
- if (afterSale.status === 40) {
- return t$6("useGoods.waiting_for_refund");
- }
- if (afterSale.status === 50) {
- return t$6("useGoods.refund_successful");
- }
- if (afterSale.status === 61) {
- return t$6("useGoods.refund_closed");
- }
- if (afterSale.status === 62) {
- return t$6("useGoods.merchant_disagrees_with_refund_request") + `${afterSale.auditReason}`;
- }
- if (afterSale.status === 63) {
- return t$6("useGoods.merchant_refuses_to_accept_goods") + `${afterSale.auditReason}`;
- }
- return t$6("useGoods.unknown_status");
- }
- function handleAfterSaleButtons(afterSale) {
- formatAppLog("log", "at sheep/hooks/useGoods.js:291", afterSale);
- afterSale.buttons = [];
- if ([10, 20, 30].includes(afterSale.status)) {
- afterSale.buttons.push("cancel");
- }
- if (afterSale.status === 20) {
- afterSale.buttons.push("delivery");
- }
- }
- function useDurationTime(toTime, fromTime = "") {
- toTime = getDayjsTime(toTime);
- if (fromTime === "") {
- fromTime = dayjs();
- }
- let duration2 = vue.ref(toTime - fromTime);
- if (duration2.value > 0) {
- setTimeout(() => {
- if (duration2.value > 0) {
- duration2.value -= 1e3;
- }
- }, 1e3);
- }
- let durationTime = dayjs.duration(duration2.value);
- return {
- h: (durationTime.months() * 30 * 24 + durationTime.days() * 24 + durationTime.hours()).toString().padStart(2, "0"),
- m: durationTime.minutes().toString().padStart(2, "0"),
- s: durationTime.seconds().toString().padStart(2, "0"),
- ms: durationTime.$ms
- };
- }
- function getDayjsTime(time2) {
- time2 = time2.toString();
- if (time2.indexOf("-") > 0) {
- return dayjs(time2);
- }
- if (time2.length > 10) {
- return dayjs(parseInt(time2));
- }
- if (time2.length === 10) {
- return dayjs.unix(parseInt(time2));
- }
- }
- function fen2yuan(price) {
- return (price / 100).toFixed(2);
- }
- function fen2yuan6(price) {
- return (price / 100).toFixed(6);
- }
- function points2point(point) {
- return (point / 1e6).toFixed(3).slice(0, -1);
- }
- function convertProductPropertyList(skus) {
- let result2 = [];
- for (const sku of skus) {
- if (!sku.properties) {
- continue;
- }
- for (const property of sku.properties) {
- let resultProperty = result2.find((item) => item.id === property.propertyId);
- if (!resultProperty) {
- resultProperty = {
- id: property.propertyId,
- name: property.propertyName,
- values: []
- };
- result2.push(resultProperty);
- }
- let resultValue = resultProperty.values.find((item) => item.id === property.valueId);
- if (!resultValue) {
- resultProperty.values.push({
- id: property.valueId,
- name: property.valueName
- });
- }
- }
- }
- return result2;
- }
- function formatRewardActivityRule(activity, rule) {
- if (activity.conditionType === 10) {
- return `满 ${fen2yuan(rule.limit)} 元减 ${fen2yuan(rule.discountPrice)} 元`;
- }
- if (activity.conditionType === 20) {
- return `满 ${rule.limit} 件减 ${fen2yuan(rule.discountPrice)} 元`;
- }
- return "";
- }
- const _sfc_main$3b = {
- __name: "s-wallet-modal",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "bd9b951b-headerBg": vue.unref(headerBg)
- }));
- const headerBg = sheep$1.$url.css("/static/images/sign.png");
- const show = vue.computed(() => sheep$1.$store("modal").getWallet);
- const state = vue.computed(() => sheep$1.$store("modal").getWalletInfo);
- const __returned__ = { headerBg, show, state, computed: vue.computed, reactive: vue.reactive, ref: vue.ref, watch: vue.watch, get sheep() {
- return sheep$1;
- }, get showWalletModal() {
- return showWalletModal;
- }, get colseWalletModal() {
- return colseWalletModal;
- }, get points2point() {
- return points2point;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3a(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 规格弹窗 "),
- vue.createCommentVNode(" showClose "),
- vue.createVNode(_component_su_popup, {
- show: $setup.show,
- onClose: $setup.colseWalletModal,
- type: "center",
- round: "10"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- vue.createElementVNode("view", { class: "ss-m-t-56 ss-flex-col ss-col-center" }, [
- vue.createElementVNode("text", { class: "cicon-check-round" }),
- !$setup.state.msg ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createElementVNode(
- "view",
- { class: "score-title" },
- vue.toDisplayString($setup.t("pop.congratulations")),
- 1
- /* TEXT */
- ),
- $setup.state.points && $setup.state.points !== "null" && $setup.points2point($setup.state.points) > 0 || $setup.state.socialStatus && $setup.state.socialStatus !== "null" ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- $setup.state.points && $setup.points2point($setup.state.points) > 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "model-title ss-flex ss-col-center ss-m-t-15 ss-font-35"
- },
- vue.toDisplayString($setup.t("pop.commission_earned")) + ":" + vue.toDisplayString($setup.points2point($setup.state.points)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.state.socialStatus ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "model-title ss-flex ss-col-center ss-m-t-15 ss-font-35"
- },
- vue.toDisplayString($setup.t("pop.social_value_earned")) + ":" + vue.toDisplayString($setup.state.socialStatus),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "model-title ss-flex ss-col-center ss-m-y-15"
- },
- vue.toDisplayString($setup.t("pop.order_success")),
- 1
- /* TEXT */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "model-title ss-flex ss-col-center ss-m-y-15"
- },
- vue.toDisplayString($setup.state.msg),
- 1
- /* TEXT */
- ))
- ]),
- vue.createElementVNode("view", { class: "model-bg ss-flex-col ss-col-center ss-row-right" }, [
- vue.createElementVNode("view", { class: "ss-m-b-40" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button confirm-btn",
- onClick: _cache[0] || (_cache[0] = ($event) => {
- $setup.colseWalletModal();
- })
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show", "onClose"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const __easycom_4$2 = /* @__PURE__ */ _export_sfc(_sfc_main$3b, [["render", _sfc_render$3a], ["__scopeId", "data-v-bd9b951b"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-wallet-modal/s-wallet-modal.vue"]]);
- const _sfc_main$3a = {
- __name: "s-signup-modal",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "a1af371b-headerBg": vue.unref(headerBg)
- }));
- const headerBg = sheep$1.$url.css("/static/images/sign.png");
- const show = vue.computed(() => sheep$1.$store("modal").signUp);
- const state = vue.computed(() => sheep$1.$store("modal").signUpInfo);
- vue.watch(() => show.value, (newValue) => {
- if (newValue) {
- setTimeout(colseSignUpModal, 3e3);
- }
- });
- const __returned__ = { headerBg, show, state, computed: vue.computed, reactive: vue.reactive, ref: vue.ref, watch: vue.watch, get sheep() {
- return sheep$1;
- }, get t() {
- return t$6;
- }, get colseSignUpModal() {
- return colseSignUpModal;
- }, get showSignUpModal() {
- return showSignUpModal;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$39(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 规格弹窗 "),
- vue.createCommentVNode(" showClose "),
- vue.createVNode(_component_su_popup, {
- show: $setup.show,
- onClose: $setup.colseSignUpModal,
- type: "center",
- round: "10"
- }, {
- default: vue.withCtx(() => {
- var _a2, _b2, _c;
- return [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- vue.createElementVNode("view", { class: "ss-m-t-56 ss-flex-col ss-col-center" }, [
- vue.createElementVNode("text", { class: "cicon-check-round" }),
- vue.createElementVNode(
- "view",
- { class: "score-title" },
- vue.toDisplayString($setup.t("pop.auto_checkin_success")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "model-title ss-flex ss-col-center ss-m-t-22 ss-m-b-30" }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.t("pop.daily_checkin_reward", { point: (_a2 = $setup.state) == null ? void 0 : _a2.social })) + " ",
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(" 获得每日签到{{state?.social}}点身价 ")
- ]),
- ((_b2 = $setup.state) == null ? void 0 : _b2.upgradeOrNot) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "model-title ss-flex ss-col-center ss-m-b-30"
- },
- vue.toDisplayString($setup.t("pop.level_upgraded")) + vue.toDisplayString((_c = $setup.state) == null ? void 0 : _c.socialStatusName),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", { class: "model-bg ss-flex-col ss-col-center ss-row-right" }, [
- vue.createElementVNode("view", { class: "ss-m-b-40" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button confirm-btn",
- onClick: _cache[0] || (_cache[0] = ($event) => {
- $setup.colseSignUpModal();
- })
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["show", "onClose"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const __easycom_5$2 = /* @__PURE__ */ _export_sfc(_sfc_main$3a, [["render", _sfc_render$39], ["__scopeId", "data-v-a1af371b"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-signup-modal/s-signup-modal.vue"]]);
- var qsCanvas = { exports: {} };
- (function(module) {
- (function() {
- var _nc;
- const platform2 = getPlatform(), isUni = platform2 == "uni", isNode = platform2 == "node", isWeb = platform2 == "web", imgCache = {}, vmCache = {}, asyncDrawWhiteList = Object.freeze([
- "init",
- "initAsyncDrawMode",
- "initArgs",
- "initCanvas",
- "handleCtx",
- "initData",
- "draw",
- "toImage",
- "updateCanvasWH",
- "clear",
- "restoreAsyncDrawMode"
- ]), calcMethods = Object.freeze([
- "setPaintbrush",
- "setPaintbrushProp",
- "resetPaintbrush",
- "savePaintbrush",
- "restorePaintbrush",
- "calcText",
- "calcImg",
- "measureText",
- "loadImage"
- ]), asyncDrawMethods = Object.freeze([
- "setPaintbrush",
- "setPaintbrushProp",
- "resetPaintbrush",
- "savePaintbrush",
- "restorePaintbrush",
- "drawText",
- "drawStraightLine",
- "drawDoubleStraightLine",
- "drawDotted",
- "drawDottedStraightLine",
- "drawLine",
- "drawTextDecoration",
- "drawImg",
- "drawQrCode",
- "setCircle",
- "setRect"
- ]), allSelfMethods = Object.freeze([
- "setPaintbrush",
- "setPaintbrushProp",
- "resetPaintbrush",
- "savePaintbrush",
- "restorePaintbrush",
- "drawText",
- "drawStraightLine",
- "drawDoubleStraightLine",
- "drawDotted",
- "drawDottedStraightLine",
- "drawLine",
- "drawTextDecoration",
- "drawImg",
- "drawQrCode",
- "setCircle",
- "setRect",
- "calcText",
- "calcImg",
- "measureText",
- "loadImage",
- "drawArray",
- "drawItem"
- ]), needReturnMethods = Object.freeze(["drawText", "drawImg"]), commonMethods = Object.freeze([
- "drawImage",
- "putImageData",
- "getImageData",
- "createImageData",
- "addPage",
- "save",
- "restore",
- "rotate",
- "translate",
- "transform",
- "getTransform",
- "resetTransform",
- "setTransform",
- "isPointInPath",
- "scale",
- "clip",
- "fill",
- "stroke",
- "fillText",
- "strokeText",
- "fillRect",
- "strokeRect",
- "clearRect",
- "rect",
- "measureText",
- "moveTo",
- "lineTo",
- "bezierCurveTo",
- "quadraticCurveTo",
- "beginPath",
- "closePath",
- "arc",
- "arcTo",
- "ellipse",
- "setLineDash",
- "getLineDash",
- "createPattern",
- "createLinearGradient",
- "createRadialGradient"
- ]);
- let nodeCanvas, id = 1;
- function notUnd(t2) {
- return String(t2) != "undefined";
- }
- function isNull(a2) {
- return !((a2 || a2 == 0) && !["undefined", "null"].includes(String(a2)));
- }
- function getPlatform() {
- if (notUnd(typeof uni))
- return "uni";
- if (notUnd(typeof window) && notUnd(typeof document))
- return "web";
- return "node";
- }
- function getCtx(vm, args) {
- if (isUni) {
- if (!args.canvasId) {
- throw new Error("canvasId 不能为空");
- }
- }
- let canvas, obj = {};
- switch (platform2) {
- case "uni":
- canvas = uni.createCanvasContext(args.canvasId, vm);
- obj.canvas = canvas;
- obj.ctx = canvas;
- break;
- case "web":
- canvas = (args == null ? void 0 : args.canvasId) ? document.getElementById(args == null ? void 0 : args.canvasId) : document.createElement("canvas");
- canvas.width = (args == null ? void 0 : args.width) || 10;
- canvas.height = (args == null ? void 0 : args.height) || 10;
- obj.canvas = canvas;
- obj.ctx = canvas.getContext("2d");
- break;
- case "node":
- canvas = nodeCanvas.createCanvas((args == null ? void 0 : args.width) || 10, (args == null ? void 0 : args.height) || 10);
- obj.canvas = canvas;
- obj.ctx = canvas.getContext("2d");
- break;
- }
- return obj;
- }
- const _QSCanvas = class _QSCanvas {
- constructor(obj, vm) {
- __privateAdd(this, _nc, void 0);
- this._id = id++;
- vmCache[this._id] = vm;
- if (obj) {
- this.init(obj);
- }
- }
- init(obj = {}) {
- this.initArgs(obj).initData().initCanvas().handleCtx().resetPaintbrush();
- if (this._data.asyncDrawMode === true) {
- __privateSet(this, _nc, new _QSCanvas({ asyncDrawMode: false }));
- this.initAsyncDrawMode();
- }
- }
- initAsyncDrawMode() {
- if (isUni)
- return;
- const ctxMethods = this._data.ctxMethods;
- const arr = [.../* @__PURE__ */ new Set([...allSelfMethods, ...ctxMethods])];
- for (let i2 = 0; i2 < arr.length; i2++) {
- const item = arr[i2];
- this.handleAsyncDrawModeItem(item);
- }
- }
- handleAsyncDrawModeItem(i2) {
- if (isUni)
- return;
- if (asyncDrawWhiteList.includes(i2)) {
- formatAppLog("log", "at node_modules/qs-canvas/index.js:124", "白名单跳过");
- return;
- }
- if (typeof this[i2] == "function") {
- if (!this._data.nMethods[i2])
- this._data.nMethods[i2] = this[i2];
- let _this = this;
- this[i2] = function() {
- let r2;
- if (calcMethods.includes(i2)) {
- r2 = __privateGet(_this, _nc)[i2](...arguments);
- }
- if (r2 && r2 !== _this && r2 !== __privateGet(_this, _nc))
- return r2;
- if (asyncDrawMethods.includes(i2) || _this._data.ctxMethods.includes(i2)) {
- _this._data.asyncDrawQueue.push({ method: i2, args: arguments });
- }
- if (needReturnMethods.includes(i2)) {
- return __privateGet(_this, _nc)[i2](...arguments);
- }
- };
- }
- }
- restoreAsyncDrawMode() {
- if (isUni)
- return;
- const nMethods = this._data.nMethods;
- for (const i2 in nMethods) {
- this[i2] = nMethods[i2];
- }
- }
- initArgs(obj = {}) {
- this._args = obj;
- return this;
- }
- initCanvas() {
- const canvasObj = getCtx(vmCache[this._id], this._args);
- this.canvas = canvasObj.canvas;
- this.ctx = canvasObj.ctx;
- return this;
- }
- /**
- * 使QSCanvas拥有原有方法
- */
- handleCtx() {
- const ctx = this.ctx;
- const active = (i2) => {
- this._data.ctxMethods.push(i2);
- this[i2] = ctx[i2].bind(ctx);
- return;
- };
- for (const i2 in ctx) {
- if (typeof ctx[i2] == "function") {
- if (!this[i2]) {
- active(i2);
- }
- }
- }
- for (let k = 0; k < commonMethods.length; k++) {
- const i2 = commonMethods[k];
- if (typeof ctx[i2] == "function") {
- if (!this[i2]) {
- active(i2);
- }
- }
- }
- return this;
- }
- initData() {
- this._data = {
- oldPaintbrushProps: {},
- savedPaintbrushProps: [],
- font: { fontStyle: "normal", fontVariant: "normal", fontWeight: "normal", fontSize: 10, fontFamily: "sans-serif" },
- height: this._args.height || 10,
- width: this._args.width || 10,
- whChange: false,
- asyncDrawQueue: [],
- nMethods: {},
- asyncDrawMode: isNode || isWeb ? this._args.asyncDrawMode !== false : false,
- ctxMethods: []
- };
- return this;
- }
- /**
- * 设置画笔
- */
- setPaintbrush(obj = {}) {
- filterPaintbrushProps(obj);
- for (const k in obj) {
- this.setPaintbrushProp(k, obj[k]);
- }
- return this;
- }
- /**
- * 设置画笔操作兼容uni
- */
- setPaintbrushProp(prop, data) {
- if (isNull(prop) || isNull(data))
- return;
- prop = hyphen2Hump(prop);
- const ctx = this.ctx;
- if (prop == "font") {
- if (data) {
- if (typeof data != "object") {
- formatAppLog("warn", "at node_modules/qs-canvas/index.js:235", "font属性需Object格式");
- return;
- }
- for (const k in data)
- if (isNull(data[k]))
- delete data[k];
- const font = { ...this._data.font, ...data };
- if (isUni)
- font.fontSize = Math.round(font.fontSize);
- this._data.font = font;
- const f2 = this._data.font;
- this._data.oldPaintbrushProps[prop] = f2;
- const setFont = () => {
- ctx.font = `${f2.fontStyle || "normal"} ${f2.fontVariant || "normal"} ${f2.fontWeight || "normal"} ${f2.fontSize ?? 10}px ${f2.fontFamily || "sans-serif"}`;
- };
- if (isUni) {
- setFont();
- } else
- setFont();
- }
- } else {
- this._data.oldPaintbrushProps[prop] = data;
- const fnn = "set" + prop[0].toUpperCase() + prop.slice(1);
- if (typeof (ctx == null ? void 0 : ctx[fnn]) == "function") {
- ctx[fnn](data);
- } else {
- ctx[prop] = data;
- }
- }
- return this;
- }
- /**
- * 重置画笔
- */
- resetPaintbrush(obj = {}) {
- this.setPaintbrush({
- fillStyle: "#000000",
- strokeStyle: "#000000",
- shadowColor: "#000000",
- shadowBlur: 0,
- shadowOffsetX: 0,
- shadowOffsetY: 0,
- lineCap: "butt",
- lineJoin: "miter",
- lineWidth: 1,
- miterLimit: 10,
- font: this._data.font,
- textAlign: "start",
- textBaseline: "top",
- globalAlpha: 1,
- globalCompositeOperation: "source-over",
- ...obj
- });
- return this;
- }
- saveAndSetPaintbrush(paintbrushProps = {}) {
- this.savePaintbrush();
- this.setPaintbrush(paintbrushProps);
- return this;
- }
- /**
- * 保存画笔设置
- */
- savePaintbrush() {
- this._data.savedPaintbrushProps.unshift({ ...this._data.oldPaintbrushProps });
- return this;
- }
- /**
- * 恢复上次保存的画笔设置
- */
- restorePaintbrush() {
- const savedProps = this._data.savedPaintbrushProps.shift();
- if (savedProps)
- this._data.oldPaintbrushProps = { ...this._data.oldPaintbrushProps, ...savedProps };
- this.resetPaintbrush({ ...this._data.oldPaintbrushProps });
- return this;
- }
- /**
- * 更新画布宽高
- */
- updateCanvasWH(obj = {}) {
- var _a2, _b2, _c;
- let { width, height, delay } = obj, setCanvasWH = (_a2 = this._args) == null ? void 0 : _a2.setCanvasWH;
- width = width || ((_b2 = this._data) == null ? void 0 : _b2.width) || 10;
- height = height || ((_c = this._data) == null ? void 0 : _c.height) || 10;
- return new Promise((rs2, rj) => {
- if (isUni) {
- if (!setCanvasWH || typeof setCanvasWH != "function") {
- rj("setCanvasWH异常, uni-app 请在初始化时传入setCanvasWH函数");
- return;
- }
- setCanvasWH({ height, width });
- setTimeout(() => {
- rs2();
- }, delay ?? 50);
- } else {
- this.canvas.height = height;
- this.canvas.width = width;
- rs2();
- }
- }).then((r2) => {
- if (this._data.width != width || this._data.height != height) {
- this._data.whChange = true;
- }
- this._data.width = width;
- this._data.height = height;
- if (!this._data.asyncDrawMode)
- this.resetPaintbrush(this._data.oldPaintbrushProps);
- });
- }
- /**
- * 清除画布内容
- */
- clear() {
- this.ctx.clearRect(0, 0, this._data.width || 999999, this._data.height || 999999);
- return this;
- }
- /**
- * 兼容uni draw
- */
- draw(obj = {}) {
- const { reserve } = obj;
- return new Promise((rs2, rj) => {
- if (isUni) {
- let done = false;
- const settimeoutkey = setTimeout(() => {
- if (!done) {
- rs2();
- } else {
- clearTimeout(settimeoutkey);
- }
- }, 3e3);
- this.ctx.draw(reserve ?? false, () => {
- done = true;
- clearTimeout(settimeoutkey);
- rs2();
- });
- } else {
- if (this._data.asyncDrawMode) {
- if (reserve !== true)
- this.clear();
- this.restoreAsyncDrawMode();
- this.resetPaintbrush();
- const arr = this._data.asyncDrawQueue;
- new Promise(async (resolve, reject) => {
- for (let i2 = 0; i2 < arr.length; i2++) {
- const item = arr[i2];
- try {
- const r2 = this[item.method].call(this, ...item.args);
- if (typeof (r2 == null ? void 0 : r2.then) == "function")
- await r2;
- } catch (error2) {
- reject(error2);
- return;
- }
- }
- resolve();
- }).then(() => {
- this._data.asyncDrawQueue = [];
- this.initAsyncDrawMode();
- rs2();
- }).catch((err) => {
- this.initAsyncDrawMode();
- rj(err);
- });
- } else {
- rs2();
- }
- }
- });
- }
- /**
- * canvas2image
- */
- toImage(obj = {}) {
- return new Promise((rs2, rj) => {
- if (isUni) {
- const canvasId = this._args.canvasId;
- if (!canvasId) {
- rj("canvasId不存在");
- return;
- }
- uni.canvasToTempFilePath({
- ...obj,
- canvasId,
- success: (r2) => {
- var _a2;
- (_a2 = obj.success) == null ? void 0 : _a2.call(obj, r2);
- rs2(r2.tempFilePath);
- },
- fail: (err) => {
- var _a2;
- (_a2 = obj.fail) == null ? void 0 : _a2.call(obj, err);
- rj(err);
- }
- }, vmCache[this._id]);
- } else {
- rs2(this.canvas.toDataURL(`image/${["jpg", "jpeg"].includes(obj.fileType) ? "jpeg" : "png"}`, obj.quality ?? 1));
- }
- });
- }
- /**
- * 计算文字多行
- */
- calcText(obj = {}) {
- const line = obj.line || -1;
- return new Promise((rs2, rj) => {
- try {
- let run = function(text, endLine) {
- let endLineWidth = 0;
- const textWidth = mt2(text).width;
- if (endLine) {
- if (textWidth < obj.maxWidth || text.length < 2) {
- return { index: text.length, ellipsis: false, width: textWidth };
- } else {
- endLineWidth = mt2("...").width;
- }
- }
- const textWidthEndLineWidth = textWidth + endLineWidth;
- if (textWidthEndLineWidth < obj.maxWidth || text.length < 2) {
- return { index: text.length, ellipsis: false, width: textWidthEndLineWidth };
- }
- let loop = true, mid = Math.floor((text.length + 1) / 2), oldMid = 1, mode = "", tw;
- while (loop) {
- if (mid <= 1) {
- loop = false;
- break;
- }
- if (mid > text.length) {
- mid = text.length;
- loop = false;
- break;
- }
- const t2 = text.substr(0, mid);
- tw = mt2(t2).width + endLineWidth;
- if (tw > obj.maxWidth) {
- text = t2;
- if (mode == "xy" && Math.abs(oldMid - mid) < 1) {
- loop = false;
- } else {
- mode = "dy";
- oldMid = mid;
- mid = Math.floor((t2.length + 1) / 2);
- }
- } else if (tw == obj.maxWidth) {
- loop = false;
- } else {
- if (mid <= 1 || Math.abs(oldMid - mid) < 1) {
- loop = false;
- } else {
- mode = "xy";
- oldMid = mid;
- mid += Math.floor((text.length - mid) / 2);
- }
- }
- }
- return { index: mid, ellipsis: endLine, width: tw };
- };
- this.saveAndSetPaintbrush({
- ...obj.paintbrushProps || {}
- });
- const mt2 = this.measureText;
- let splitTexts = [], str = obj.val, width = 0;
- const font = { ...this._data.font };
- if (obj.maxWidth) {
- let i2 = 0;
- while (str.length) {
- const endLine = line > 0 && splitTexts.length + 1 >= line, { index: len, ellipsis, width: width2 } = run(str, endLine);
- const txt = str.substr(0, len);
- splitTexts.push({ ...obj, val: txt, y: i2 ? obj.y + (font.fontSize + (obj.lineHeight || 0)) * i2 : obj.y, width: width2 });
- if (endLine) {
- if (ellipsis)
- splitTexts[splitTexts.length - 1].val += "...";
- str = "";
- } else
- str = str.slice(len);
- i2++;
- }
- width = splitTexts.length == 1 ? splitTexts[0].width : splitTexts.length > 1 ? obj.maxWidth : 0;
- } else {
- splitTexts = [obj];
- width = mt2(obj.val).width;
- }
- this.restorePaintbrush();
- rs2({
- ...obj,
- calcTexts: splitTexts,
- _calc: true,
- left: obj.x,
- top: obj.y,
- right: obj.x + width,
- bottom: splitTexts[splitTexts.length - 1].y + font.fontSize,
- width,
- height: splitTexts[splitTexts.length - 1].y + font.fontSize - obj.y,
- fontSize: font.fontSize
- });
- } catch (error2) {
- rj(error2);
- }
- });
- }
- /* 绘制 */
- /**
- * 绘制文本
- */
- drawText(obj = {}) {
- return new Promise(async (rs2, rj) => {
- try {
- if (!obj.val) {
- formatAppLog("warn", "at node_modules/qs-canvas/index.js:547", `需绘制的文本为空`);
- rs2();
- return;
- }
- this.saveAndSetPaintbrush({
- ...obj.paintbrushProps || {}
- });
- const ft2 = (obj2) => {
- this.fillText(obj2.val, obj2.x, obj2.y);
- }, ftItem = (item) => {
- ft2(item);
- if (item.textDecoration)
- this.drawTextDecoration(item);
- };
- const calcR = obj._calc ? obj : await this.calcText(obj);
- for (let i2 = 0; i2 < calcR.calcTexts.length; i2++) {
- ftItem(calcR.calcTexts[i2]);
- }
- this.restorePaintbrush();
- rs2(calcR);
- } catch (error2) {
- rj(error2);
- }
- });
- }
- drawStraightLine(obj = {}) {
- const { x1, y1, x2, y2, paintbrushProps } = obj, ctx = this.ctx;
- ctx.beginPath();
- ctx.moveTo(x1, y1);
- ctx.lineTo(x2, y2);
- this.saveAndSetPaintbrush(paintbrushProps || {});
- ctx.stroke();
- this.restorePaintbrush();
- }
- drawDoubleStraightLine(obj = {}) {
- let { gap } = obj;
- gap = gap ?? 1;
- this.drawStraightLine(obj);
- this.drawStraightLine({ ...obj, y1: obj.y1 + gap, y2: obj.y2 + gap });
- }
- drawDotted(obj = {}) {
- this.setCircle(obj);
- if (obj.clip)
- obj.clip = false;
- this.saveAndSetPaintbrush(obj.paintbrushProps || {});
- this.ctx.fill();
- this.restorePaintbrush();
- }
- drawDottedStraightLine(obj = {}) {
- let { x1, x2, y1, y2, gap, width, paintbrushProps } = obj;
- x2 = x2 - width;
- gap = gap || 1;
- const len = Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
- const points = getPoints(x1, y1, x2, y2, Math.floor((len - gap) / (width + gap)), 9999999999);
- this.saveAndSetPaintbrush(paintbrushProps);
- this.drawDotted({ x: x1, y: y1, d: width });
- for (let i2 = 0; i2 < points.length; i2++)
- this.drawDotted({ x: points[i2][0], y: points[i2][1], d: width });
- this.drawDotted({ x: x2, y: y2, d: width });
- this.restorePaintbrush();
- }
- drawLine(obj = {}) {
- const { style } = obj;
- switch (style) {
- case "double":
- obj.gap = (obj.width || 1) * 1.5;
- this.drawDoubleStraightLine(obj);
- break;
- case "solide":
- this.drawStraightLine(obj);
- break;
- case "dotted":
- obj.gap = (obj.gap || 1) * 1.5;
- obj.paintbrushProps = { fillStyle: obj.color };
- this.drawDottedStraightLine(obj);
- break;
- }
- }
- /**
- * {
- ...(drawText属性),
- textDecoration: {
- line, //类型 同css text-decoration-line
- color, //线颜色
- width, //线宽度
- * }
- * }
- */
- drawTextDecoration(obj = {}) {
- this.savePaintbrush();
- const oldProps = this._data.oldPaintbrushProps, tw = this.measureText(obj.val).width, tD = obj.textDecoration, line = tD.line || "line-through", color = tD.color || obj.color || oldProps.fillStyle || "#000000", width = tD.thickness || tD.width || (obj.fontSize ? obj.fontSize * 0.1 : false) || 1, style = tD.style || "solide", offset = tD.offset || 0, gap = tD.gap ?? 1, fontSize = obj.fontSize || this._data.font.fontSize;
- this.setPaintbrush({ lineWidth: width, strokeStyle: color });
- let y2 = 0;
- switch (line) {
- case "line-through":
- y2 = obj.y + fontSize / 2 - width / 2;
- break;
- case "underline":
- y2 = obj.y + fontSize;
- break;
- case "overline":
- y2 = obj.y;
- break;
- }
- switch (oldProps.textBaseline) {
- case "top":
- y2 += width / 2;
- break;
- case "bottom":
- y2 -= fontSize;
- break;
- case "center":
- y2 -= fontSize / 2;
- break;
- }
- y2 += offset;
- switch (line) {
- case "line-through":
- case "underline":
- case "overline":
- this.drawLine({ x1: obj.x, y1: y2, x2: obj.x + tw, y2, style, gap, width, color });
- break;
- }
- this.restorePaintbrush();
- }
- /**
- * 绘制图片
- */
- drawImg(obj = {}) {
- return new Promise(async (rs2, rj) => {
- try {
- if (!obj.val) {
- formatAppLog("warn", "at node_modules/qs-canvas/index.js:687", `需绘制的图片为空`);
- rs2();
- return;
- }
- const calcR = obj._calc ? obj : await this.calcImg(obj);
- if ((calcR == null ? void 0 : calcR.drawImageArgs) && Array.isArray(calcR.drawImageArgs))
- this.ctx.drawImage(...(calcR == null ? void 0 : calcR.drawImageArgs) || []);
- rs2(calcR);
- } catch (error2) {
- rj(error2);
- }
- });
- }
- calcImg(obj = {}) {
- return new Promise(async (rs2, rj) => {
- try {
- if (!obj.val) {
- formatAppLog("warn", "at node_modules/qs-canvas/index.js:704", `需绘制的图片为空`);
- rs2();
- return;
- }
- const img = await this.loadImage(obj.val), mode = obj.mode || "scaleToFill";
- let arr, x = obj.x || 0, y2 = obj.y || 0, w2 = obj.width || 0, h2 = obj.height || 0, sw = img.width, sh = img.height, sx = 0, sy = 0;
- const get_6 = () => {
- if (isUni) {
- }
- return [sx, sy, sw, sh, x, y2, w2, h2];
- };
- switch (mode) {
- case "aspectFit":
- h2 = img.height / img.width * w2;
- if (h2 < obj.height) {
- y2 = Number(obj.y) + obj.height / 2 - h2 / 2;
- } else {
- h2 = obj.height;
- w2 = img.width / img.height * h2;
- x = Number(obj.x) + obj.width / 2 - w2 / 2;
- }
- arr = get_6();
- break;
- case "aspectFill":
- h2 = img.height / img.width * w2;
- if (h2 < obj.height) {
- h2 = obj.height;
- sx = img.width / img.height * obj.height;
- sx = (sx - obj.width) / sx * img.width / 2;
- sw = img.width - sx * 2;
- } else {
- sy = (h2 - obj.height) / h2 * img.height / 2;
- sh = img.height - sy * 2;
- }
- w2 = obj.width;
- h2 = obj.height;
- arr = get_6();
- break;
- case "widthFix":
- h2 = obj.height = img.height / img.width * obj.width;
- arr = [x, y2, w2, h2];
- break;
- case "heightFix":
- w2 = obj.width = img.width / img.height * obj.height;
- arr = [x, y2, w2, h2];
- break;
- default:
- arr = [x, y2, w2, h2];
- }
- arr.unshift(isUni ? img.toString() : img);
- rs2({ ...obj, drawImageArgs: [...arr], img, left: obj.x, top: obj.y, right: obj.x + obj.width, bottom: obj.y + obj.height, _calc: true });
- } catch (error2) {
- rj(error2);
- }
- });
- }
- /**
- * 绘制二维码
- * 诗小柒 的二维码生成器代码
- */
- drawQrCode(obj = {}) {
- return new Promise((rs2, rj) => {
- if (!(obj == null ? void 0 : obj.val)) {
- formatAppLog("warn", "at node_modules/qs-canvas/index.js:771", "绘制二维码val为空");
- rs2();
- return;
- }
- this.savePaintbrush();
- let qrcodeAlgObjCache = [];
- let options2 = {
- text: String(obj.val || "") || "",
- // 生成内容
- size: Number(obj.size || 0) || 200,
- // 二维码大小
- background: String(obj.background || "") || "#ffffff",
- // 背景色
- foreground: String(obj.foreground || "") || "#000000",
- // 前景色
- pdground: String(obj.pdground || "") || "#000000",
- // 定位角点颜色
- correctLevel: Number(obj.correctLevel || 0) || 3,
- // 容错级别
- dx: Number(obj.x || 0) || 0,
- // x轴距离
- dy: Number(obj.y || 0) || 0
- // y轴距离
- };
- let qrCodeAlg = null;
- let d2 = 0;
- for (var i2 = 0, l2 = qrcodeAlgObjCache.length; i2 < l2; i2++) {
- d2 = i2;
- if (qrcodeAlgObjCache[i2].text == options2.text && qrcodeAlgObjCache[i2].text.correctLevel == options2.correctLevel) {
- qrCodeAlg = qrcodeAlgObjCache[i2].obj;
- break;
- }
- }
- if (d2 == l2) {
- qrCodeAlg = new QRCodeAlg(options2.text, options2.correctLevel);
- qrcodeAlgObjCache.push({
- text: options2.text,
- correctLevel: options2.correctLevel,
- obj: qrCodeAlg
- });
- }
- let getForeGround = function(config2) {
- let options3 = config2.options;
- if (options3.pdground && (config2.row > 1 && config2.row < 5 && config2.col > 1 && config2.col < 5 || config2.row > config2.count - 6 && config2.row < config2.count - 2 && config2.col > 1 && config2.col < 5 || config2.row > 1 && config2.row < 5 && config2.col > config2.count - 6 && config2.col < config2.count - 2)) {
- return options3.pdground;
- }
- return options3.foreground;
- };
- let count = qrCodeAlg.getModuleCount();
- let ratioSize = options2.size;
- let tileW = ratioSize / count;
- let tileH = ratioSize / count;
- for (let row = 0; row < count; row++) {
- for (let col = 0; col < count; col++) {
- let w2 = (col + 1) * tileW - col * tileW;
- let h2 = (row + 1) * tileW - row * tileW;
- let foreground = getForeGround({
- row,
- col,
- count,
- options: options2
- });
- this.setPaintbrush({ fillStyle: qrCodeAlg.modules[row][col] ? foreground : options2.background });
- this.ctx.fillRect(options2.dx + col * tileW, options2.dy + row * tileH, w2, h2);
- }
- }
- this.restorePaintbrush();
- rs2({ ...obj, height: obj.size, width: obj.size, left: obj.x, top: obj.y, right: obj.x + obj.width, bottom: obj.y + obj.size });
- });
- }
- /**
- * 圆形
- */
- setCircle(obj = {}) {
- const ctx = this.ctx;
- let { x, y: y2, d: d2, mode } = obj;
- mode = mode || "leftTop";
- const r2 = d2 / 2;
- if (obj.clip)
- ctx.save();
- ctx.beginPath();
- switch (mode) {
- case "leftTop":
- ctx.arc(x + r2, y2 + r2, r2, 0, 2 * Math.PI);
- break;
- case "center":
- ctx.arc(x, y2, r2, 0, 2 * Math.PI);
- break;
- }
- ctx.closePath();
- if (obj.clip)
- ctx.clip();
- return this;
- }
- /**
- * 矩形
- */
- setRect(obj = {}) {
- const ctx = this.ctx;
- const { x, y: y2, r: r2, height, width } = obj;
- if (obj.clip)
- ctx.save();
- ctx.beginPath();
- if (r2 && r2 > 0) {
- ctx.arc(x + r2, y2 + r2, r2, 1 * Math.PI, 1.5 * Math.PI);
- ctx.lineTo(x + width - r2, y2);
- ctx.arc(x + width - r2, y2 + r2, r2, 1.5 * Math.PI, 0);
- ctx.lineTo(x + width, y2 + height - r2);
- ctx.arc(x + width - r2, y2 + height - r2, r2, 0, 0.5 * Math.PI);
- ctx.lineTo(x + r2, y2 + height);
- ctx.arc(x + r2, y2 + height - r2, r2, 0.5 * Math.PI, 1 * Math.PI);
- ctx.lineTo(x, y2 + r2);
- } else {
- ctx.moveTo(x, y2);
- ctx.lineTo(x + width, y2);
- ctx.lineTo(x + width, y2 + height);
- ctx.lineTo(x, y2 + height);
- ctx.lineTo(x, y2);
- }
- ctx.closePath();
- if (obj.clip)
- ctx.clip();
- return this;
- }
- /**
- * 加载图片
- */
- loadImage(url2) {
- return new Promise(async (resolve, reject) => {
- if (!url2) {
- formatAppLog("warn", "at node_modules/qs-canvas/index.js:899", "加载图片url为空");
- resolve();
- return;
- }
- if (imgCache[url2]) {
- resolve(imgCache[url2]);
- return;
- }
- let img;
- try {
- switch (platform2) {
- case "uni":
- img = await new Promise((rs2, rj) => {
- if (url2._loaded) {
- rs2(url2);
- return;
- }
- if (~url2.indexOf("data:image")) {
- let tempFilePath = url2, imageInfoR = {};
- imgTools.base64ToPath(url2).then((t2) => {
- tempFilePath = t2;
- uni.getImageInfo({
- src: tempFilePath,
- success: (imgInfo) => {
- imageInfoR = imgInfo;
- const uniImg = new String(tempFilePath);
- for (const i2 in imageInfoR)
- uniImg[i2] = imageInfoR[i2];
- uniImg._loaded = true;
- rs2(uniImg);
- },
- fail: (err) => rj(err)
- });
- }).catch((err) => {
- rj(err);
- });
- } else if (url2.substr(0, 4) == "http") {
- uni.downloadFile({
- url: url2,
- success: ({ tempFilePath }) => {
- uni.getImageInfo({
- src: tempFilePath,
- success: (imageInfoR) => {
- const uniImg = new String(tempFilePath);
- for (const i2 in imageInfoR)
- uniImg[i2] = imageInfoR[i2];
- uniImg._loaded = true;
- rs2(uniImg);
- },
- fail: (err) => rj(err)
- });
- },
- fail: (error2) => rj(error2)
- });
- } else {
- uni.getImageInfo({
- src: url2,
- success: (imageInfoR) => {
- const uniImg = new String(url2);
- for (const i2 in imageInfoR)
- uniImg[i2] = imageInfoR[i2];
- uniImg._loaded = true;
- rs2(uniImg);
- },
- fail: (err) => rj(err)
- });
- }
- });
- break;
- case "web":
- img = await new Promise((rs2, rj) => {
- if (typeof url2 != "string") {
- rs2(url2);
- return;
- }
- const imgObj = new Image();
- imgObj.onload = () => {
- rs2(imgObj);
- };
- imgObj.onerror = (err) => {
- rj(err);
- };
- imgObj.src = url2;
- });
- break;
- case "node":
- img = await new Promise((rs2, rj) => {
- if (typeof url2 != "string") {
- rs2(url2);
- return;
- }
- nodeCanvas.loadImage(url2).then((res) => {
- rs2(res);
- }).catch((err) => {
- rj(err);
- });
- });
- break;
- }
- } catch (error2) {
- reject(error2);
- }
- imgCache[url2] = img;
- resolve(img);
- });
- }
- drawArray(data) {
- return new Promise(async (rs2, rj) => {
- try {
- if (!data) {
- rj("drawArray需绘制参数不存在");
- return;
- }
- if (!Array.isArray(data)) {
- rj("drawArray参数需要是Array");
- return;
- }
- data = [...data].sort((a2, b2) => ((a2 == null ? void 0 : a2.zIndex) ?? 0) - ((b2 == null ? void 0 : b2.zIndex) ?? 0));
- const arr = [];
- for (let i2 = 0; i2 < data.length; i2++) {
- const item = data[i2];
- let r2;
- switch (typeof item) {
- case "function":
- r2 = item();
- if (typeof (r2 == null ? void 0 : r2.then) == "function")
- r2 = await r2;
- break;
- case "object":
- if (Array.isArray(item))
- r2 = await this.drawArray(item);
- else
- r2 = await this.drawItem(item);
- break;
- }
- arr.push({ item, result: r2 });
- }
- rs2(arr);
- } catch (error2) {
- rj(error2);
- }
- });
- }
- drawItem(obj = {}) {
- return new Promise(async (rs2, rj) => {
- var _a2, _b2;
- try {
- let r2;
- switch (obj.type) {
- case "text":
- r2 = await this.drawText(obj);
- break;
- case "image":
- r2 = await this.drawImg(obj);
- break;
- case "qrcode":
- r2 = await this.drawQrCode(obj);
- break;
- case "method":
- r2 = (_a2 = this[obj.name]) == null ? void 0 : _a2.call(this, ...obj.data ? Array.isArray(obj.data) ? obj.data : [obj.data] : []);
- if (typeof (r2 == null ? void 0 : r2.then) == "function")
- r2 = await r2;
- break;
- case "function":
- r2 = (_b2 = obj.val) == null ? void 0 : _b2.call(obj);
- if (typeof (r2 == null ? void 0 : r2.then) == "function")
- r2 = await r2;
- break;
- }
- rs2(r2);
- } catch (error2) {
- rj(error2);
- }
- });
- }
- drawRichText(html) {
- return new Promise(async (rs2, rj) => {
- if (!html) {
- rj("drawRichText需绘制参数不存在");
- return;
- }
- if (typeof html == "string")
- html = htmlParse(html);
- const result2 = [];
- function run(arr, parent2) {
- return new Promise(async (res, rej) => {
- var _a2;
- for (let i2 = 0; i2 < arr.length; i2++) {
- const item = arr[i2];
- if (item.type == "text")
- ;
- else {
- switch (item.name) {
- }
- }
- result2.push(item);
- if ((_a2 = item.children) == null ? void 0 : _a2.length) {
- item.__handle = function(obj) {
- };
- try {
- await run(item.children, item);
- } catch (error2) {
- rej(error2);
- return;
- }
- }
- }
- res(result2);
- });
- }
- try {
- rs2({ html, htmlParses: await run(html) });
- } catch (error2) {
- rj(error2);
- }
- });
- }
- };
- _nc = new WeakMap();
- let QSCanvas2 = _QSCanvas;
- function filterPaintbrushProps(obj) {
- switch (obj == null ? void 0 : obj.textBaseline) {
- case "normal":
- if (isUni)
- obj.textBaseline = "alphabetic";
- break;
- case "hanging":
- if (isUni)
- obj.textBaseline = "top";
- break;
- case "ideographic":
- if (isUni)
- obj.textBaseline = "bottom";
- break;
- }
- switch (obj == null ? void 0 : obj.textAlign) {
- case "start":
- obj.textAlign = "left";
- break;
- case "end":
- obj.textAlign = "right";
- break;
- }
- }
- function hyphen2Hump(s2) {
- if (!s2)
- return "";
- const arr = s2.split("-");
- for (var i2 = 1; i2 < arr.length; i2++) {
- arr[i2] = arr[i2].charAt(0).toUpperCase() + arr[i2].substring(1);
- }
- return arr.join("");
- }
- function getPoints(x1, y1, x2, y2, pointCount, level) {
- let a2, b2, rSquare, k, kv, points = [];
- if (x1 === x2) {
- a2 = x1 + (y2 - y1) * level;
- b2 = y1 + (y2 - y1) / 2;
- rSquare = (x1 - a2) ** 2 + (y1 - b2) ** 2;
- } else if (y1 === y2) {
- a2 = x1 + (x2 - x1) / 2;
- b2 = y1 - (x2 - x1) * level;
- rSquare = (x1 - a2) ** 2 + (y1 - b2) ** 2;
- } else {
- let xc = (x1 + x2) / 2, yc = (y1 + y2) / 2, lenSquare = ((x2 - x1) ** 2 + (y2 - y1) ** 2) * level ** 2;
- k = (x2 - x1) / (y1 - y2);
- let l2 = yc - k * xc;
- let a1 = 1 + k ** 2, b1 = 2 * k * (l2 - yc) - 2 * xc, c1 = xc ** 2 + (l2 - yc) ** 2 - lenSquare;
- kv = -1 / k;
- a2 = (-b1 + Math.sqrt(b1 ** 2 - 4 * a1 * c1) * (kv > 0 && x2 > x1 || kv < 0 && x2 < x1 ? 1 : -1)) / (2 * a1);
- b2 = k * a2 + l2;
- rSquare = (x1 - a2) ** 2 + (y1 - b2) ** 2;
- }
- if (x1 === x2 || Math.abs(kv) > 1) {
- let yDistance = y2 - y1;
- let yDis = yDistance / (pointCount + 1);
- for (let i2 = 0; i2 < pointCount; i2++) {
- let y3 = y1 + yDis * (i2 + 1);
- let x = Math.sqrt(rSquare - (y3 - b2) ** 2) * (y2 > y1 ? -1 : 1) + a2;
- points.push([x, y3]);
- }
- } else {
- let xDistance = x2 - x1;
- let xDis = xDistance / (pointCount + 1);
- for (let i2 = 0; i2 < pointCount; i2++) {
- let x = x1 + xDis * (i2 + 1);
- let y3 = Math.sqrt(rSquare - (x - a2) ** 2) * (x2 > x1 ? 1 : -1) + b2;
- points.push([x, y3]);
- }
- }
- return points;
- }
- var QRCodeAlg = function() {
- function unicodeFormat8(code2) {
- var c0, c1, c2;
- if (code2 < 128) {
- return [code2];
- } else if (code2 < 2048) {
- c0 = 192 + (code2 >> 6);
- c1 = 128 + (code2 & 63);
- return [c0, c1];
- } else {
- c0 = 224 + (code2 >> 12);
- c1 = 128 + (code2 >> 6 & 63);
- c2 = 128 + (code2 & 63);
- return [c0, c1, c2];
- }
- }
- function getUTF8Bytes(string) {
- var utf8codes = [];
- for (var i3 = 0; i3 < string.length; i3++) {
- var code2 = string.charCodeAt(i3);
- var utf8 = unicodeFormat8(code2);
- for (var j2 = 0; j2 < utf8.length; j2++) {
- utf8codes.push(utf8[j2]);
- }
- }
- return utf8codes;
- }
- function QRCodeAlg2(data, errorCorrectLevel) {
- this.typeNumber = -1;
- this.errorCorrectLevel = errorCorrectLevel;
- this.modules = null;
- this.moduleCount = 0;
- this.dataCache = null;
- this.rsBlocks = null;
- this.totalDataCount = -1;
- this.data = data;
- this.utf8bytes = getUTF8Bytes(data);
- this.make();
- }
- QRCodeAlg2.prototype = { constructor: QRCodeAlg2, getModuleCount: function() {
- return this.moduleCount;
- }, make: function() {
- this.getRightType();
- this.dataCache = this.createData();
- this.createQrcode();
- }, makeImpl: function(maskPattern) {
- this.moduleCount = this.typeNumber * 4 + 17;
- this.modules = new Array(this.moduleCount);
- for (var row = 0; row < this.moduleCount; row++) {
- this.modules[row] = new Array(this.moduleCount);
- }
- this.setupPositionProbePattern(0, 0);
- this.setupPositionProbePattern(this.moduleCount - 7, 0);
- this.setupPositionProbePattern(0, this.moduleCount - 7);
- this.setupPositionAdjustPattern();
- this.setupTimingPattern();
- this.setupTypeInfo(true, maskPattern);
- if (this.typeNumber >= 7) {
- this.setupTypeNumber(true);
- }
- this.mapData(this.dataCache, maskPattern);
- }, setupPositionProbePattern: function(row, col) {
- for (var r2 = -1; r2 <= 7; r2++) {
- if (row + r2 <= -1 || this.moduleCount <= row + r2)
- continue;
- for (var c2 = -1; c2 <= 7; c2++) {
- if (col + c2 <= -1 || this.moduleCount <= col + c2)
- continue;
- if (0 <= r2 && r2 <= 6 && (c2 == 0 || c2 == 6) || 0 <= c2 && c2 <= 6 && (r2 == 0 || r2 == 6) || 2 <= r2 && r2 <= 4 && 2 <= c2 && c2 <= 4) {
- this.modules[row + r2][col + c2] = true;
- } else {
- this.modules[row + r2][col + c2] = false;
- }
- }
- }
- }, createQrcode: function() {
- var minLostPoint = 0;
- var pattern2 = 0;
- var bestModules = null;
- for (var i3 = 0; i3 < 8; i3++) {
- this.makeImpl(i3);
- var lostPoint = QRUtil.getLostPoint(this);
- if (i3 == 0 || minLostPoint > lostPoint) {
- minLostPoint = lostPoint;
- pattern2 = i3;
- bestModules = this.modules;
- }
- }
- this.modules = bestModules;
- this.setupTypeInfo(false, pattern2);
- if (this.typeNumber >= 7) {
- this.setupTypeNumber(false);
- }
- }, setupTimingPattern: function() {
- for (var r2 = 8; r2 < this.moduleCount - 8; r2++) {
- if (this.modules[r2][6] != null) {
- continue;
- }
- this.modules[r2][6] = r2 % 2 == 0;
- if (this.modules[6][r2] != null) {
- continue;
- }
- this.modules[6][r2] = r2 % 2 == 0;
- }
- }, setupPositionAdjustPattern: function() {
- var pos = QRUtil.getPatternPosition(this.typeNumber);
- for (var i3 = 0; i3 < pos.length; i3++) {
- for (var j2 = 0; j2 < pos.length; j2++) {
- var row = pos[i3];
- var col = pos[j2];
- if (this.modules[row][col] != null) {
- continue;
- }
- for (var r2 = -2; r2 <= 2; r2++) {
- for (var c2 = -2; c2 <= 2; c2++) {
- if (r2 == -2 || r2 == 2 || c2 == -2 || c2 == 2 || r2 == 0 && c2 == 0) {
- this.modules[row + r2][col + c2] = true;
- } else {
- this.modules[row + r2][col + c2] = false;
- }
- }
- }
- }
- }
- }, setupTypeNumber: function(test2) {
- var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
- for (var i3 = 0; i3 < 18; i3++) {
- var mod = !test2 && (bits >> i3 & 1) == 1;
- this.modules[Math.floor(i3 / 3)][i3 % 3 + this.moduleCount - 8 - 3] = mod;
- this.modules[i3 % 3 + this.moduleCount - 8 - 3][Math.floor(i3 / 3)] = mod;
- }
- }, setupTypeInfo: function(test2, maskPattern) {
- var data = QRErrorCorrectLevel[this.errorCorrectLevel] << 3 | maskPattern;
- var bits = QRUtil.getBCHTypeInfo(data);
- for (var i3 = 0; i3 < 15; i3++) {
- var mod = !test2 && (bits >> i3 & 1) == 1;
- if (i3 < 6) {
- this.modules[i3][8] = mod;
- } else if (i3 < 8) {
- this.modules[i3 + 1][8] = mod;
- } else {
- this.modules[this.moduleCount - 15 + i3][8] = mod;
- }
- var mod = !test2 && (bits >> i3 & 1) == 1;
- if (i3 < 8) {
- this.modules[8][this.moduleCount - i3 - 1] = mod;
- } else if (i3 < 9) {
- this.modules[8][15 - i3 - 1 + 1] = mod;
- } else {
- this.modules[8][15 - i3 - 1] = mod;
- }
- }
- this.modules[this.moduleCount - 8][8] = !test2;
- }, createData: function() {
- var buffer = new QRBitBuffer();
- var lengthBits = this.typeNumber > 9 ? 16 : 8;
- buffer.put(4, 4);
- buffer.put(this.utf8bytes.length, lengthBits);
- for (var i3 = 0, l2 = this.utf8bytes.length; i3 < l2; i3++) {
- buffer.put(this.utf8bytes[i3], 8);
- }
- if (buffer.length + 4 <= this.totalDataCount * 8) {
- buffer.put(0, 4);
- }
- while (buffer.length % 8 != 0) {
- buffer.putBit(false);
- }
- while (true) {
- if (buffer.length >= this.totalDataCount * 8) {
- break;
- }
- buffer.put(QRCodeAlg2.PAD0, 8);
- if (buffer.length >= this.totalDataCount * 8) {
- break;
- }
- buffer.put(QRCodeAlg2.PAD1, 8);
- }
- return this.createBytes(buffer);
- }, createBytes: function(buffer) {
- var offset = 0;
- var maxDcCount = 0;
- var maxEcCount = 0;
- var length = this.rsBlock.length / 3;
- var rsBlocks = new Array();
- for (var i3 = 0; i3 < length; i3++) {
- var count = this.rsBlock[i3 * 3 + 0];
- var totalCount = this.rsBlock[i3 * 3 + 1];
- var dataCount = this.rsBlock[i3 * 3 + 2];
- for (var j2 = 0; j2 < count; j2++) {
- rsBlocks.push([dataCount, totalCount]);
- }
- }
- var dcdata = new Array(rsBlocks.length);
- var ecdata = new Array(rsBlocks.length);
- for (var r2 = 0; r2 < rsBlocks.length; r2++) {
- var dcCount = rsBlocks[r2][0];
- var ecCount = rsBlocks[r2][1] - dcCount;
- maxDcCount = Math.max(maxDcCount, dcCount);
- maxEcCount = Math.max(maxEcCount, ecCount);
- dcdata[r2] = new Array(dcCount);
- for (var i3 = 0; i3 < dcdata[r2].length; i3++) {
- dcdata[r2][i3] = 255 & buffer.buffer[i3 + offset];
- }
- offset += dcCount;
- var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
- var rawPoly = new QRPolynomial(dcdata[r2], rsPoly.getLength() - 1);
- var modPoly = rawPoly.mod(rsPoly);
- ecdata[r2] = new Array(rsPoly.getLength() - 1);
- for (var i3 = 0; i3 < ecdata[r2].length; i3++) {
- var modIndex = i3 + modPoly.getLength() - ecdata[r2].length;
- ecdata[r2][i3] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
- }
- }
- var data = new Array(this.totalDataCount);
- var index2 = 0;
- for (var i3 = 0; i3 < maxDcCount; i3++) {
- for (var r2 = 0; r2 < rsBlocks.length; r2++) {
- if (i3 < dcdata[r2].length) {
- data[index2++] = dcdata[r2][i3];
- }
- }
- }
- for (var i3 = 0; i3 < maxEcCount; i3++) {
- for (var r2 = 0; r2 < rsBlocks.length; r2++) {
- if (i3 < ecdata[r2].length) {
- data[index2++] = ecdata[r2][i3];
- }
- }
- }
- return data;
- }, mapData: function(data, maskPattern) {
- var inc = -1;
- var row = this.moduleCount - 1;
- var bitIndex = 7;
- var byteIndex = 0;
- for (var col = this.moduleCount - 1; col > 0; col -= 2) {
- if (col == 6)
- col--;
- while (true) {
- for (var c2 = 0; c2 < 2; c2++) {
- if (this.modules[row][col - c2] == null) {
- var dark = false;
- if (byteIndex < data.length) {
- dark = (data[byteIndex] >>> bitIndex & 1) == 1;
- }
- var mask = QRUtil.getMask(maskPattern, row, col - c2);
- if (mask) {
- dark = !dark;
- }
- this.modules[row][col - c2] = dark;
- bitIndex--;
- if (bitIndex == -1) {
- byteIndex++;
- bitIndex = 7;
- }
- }
- }
- row += inc;
- if (row < 0 || this.moduleCount <= row) {
- row -= inc;
- inc = -inc;
- break;
- }
- }
- }
- } };
- QRCodeAlg2.PAD0 = 236;
- QRCodeAlg2.PAD1 = 17;
- var QRErrorCorrectLevel = [1, 0, 3, 2];
- var QRMaskPattern = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 };
- var QRUtil = { PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0, G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0, G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1, getBCHTypeInfo: function(data) {
- var d2 = data << 10;
- while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
- d2 ^= QRUtil.G15 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15);
- }
- return (data << 10 | d2) ^ QRUtil.G15_MASK;
- }, getBCHTypeNumber: function(data) {
- var d2 = data << 12;
- while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
- d2 ^= QRUtil.G18 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18);
- }
- return data << 12 | d2;
- }, getBCHDigit: function(data) {
- var digit = 0;
- while (data != 0) {
- digit++;
- data >>>= 1;
- }
- return digit;
- }, getPatternPosition: function(typeNumber) {
- return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
- }, getMask: function(maskPattern, i3, j2) {
- switch (maskPattern) {
- case QRMaskPattern.PATTERN000:
- return (i3 + j2) % 2 == 0;
- case QRMaskPattern.PATTERN001:
- return i3 % 2 == 0;
- case QRMaskPattern.PATTERN010:
- return j2 % 3 == 0;
- case QRMaskPattern.PATTERN011:
- return (i3 + j2) % 3 == 0;
- case QRMaskPattern.PATTERN100:
- return (Math.floor(i3 / 2) + Math.floor(j2 / 3)) % 2 == 0;
- case QRMaskPattern.PATTERN101:
- return i3 * j2 % 2 + i3 * j2 % 3 == 0;
- case QRMaskPattern.PATTERN110:
- return (i3 * j2 % 2 + i3 * j2 % 3) % 2 == 0;
- case QRMaskPattern.PATTERN111:
- return (i3 * j2 % 3 + (i3 + j2) % 2) % 2 == 0;
- default:
- throw new Error("bad maskPattern:" + maskPattern);
- }
- }, getErrorCorrectPolynomial: function(errorCorrectLength) {
- var a2 = new QRPolynomial([1], 0);
- for (var i3 = 0; i3 < errorCorrectLength; i3++) {
- a2 = a2.multiply(new QRPolynomial([1, QRMath.gexp(i3)], 0));
- }
- return a2;
- }, getLostPoint: function(qrCode) {
- var moduleCount = qrCode.getModuleCount(), lostPoint = 0, darkCount = 0;
- for (var row = 0; row < moduleCount; row++) {
- var sameCount = 0;
- var head = qrCode.modules[row][0];
- for (var col = 0; col < moduleCount; col++) {
- var current = qrCode.modules[row][col];
- if (col < moduleCount - 6) {
- if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
- if (col < moduleCount - 10) {
- if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
- lostPoint += 40;
- }
- } else if (col > 3) {
- if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
- lostPoint += 40;
- }
- }
- }
- }
- if (row < moduleCount - 1 && col < moduleCount - 1) {
- var count = 0;
- if (current)
- count++;
- if (qrCode.modules[row + 1][col])
- count++;
- if (qrCode.modules[row][col + 1])
- count++;
- if (qrCode.modules[row + 1][col + 1])
- count++;
- if (count == 0 || count == 4) {
- lostPoint += 3;
- }
- }
- if (head ^ current) {
- sameCount++;
- } else {
- head = current;
- if (sameCount >= 5) {
- lostPoint += 3 + sameCount - 5;
- }
- sameCount = 1;
- }
- if (current) {
- darkCount++;
- }
- }
- }
- for (var col = 0; col < moduleCount; col++) {
- var sameCount = 0;
- var head = qrCode.modules[0][col];
- for (var row = 0; row < moduleCount; row++) {
- var current = qrCode.modules[row][col];
- if (row < moduleCount - 6) {
- if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
- if (row < moduleCount - 10) {
- if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
- lostPoint += 40;
- }
- } else if (row > 3) {
- if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
- lostPoint += 40;
- }
- }
- }
- }
- if (head ^ current) {
- sameCount++;
- } else {
- head = current;
- if (sameCount >= 5) {
- lostPoint += 3 + sameCount - 5;
- }
- sameCount = 1;
- }
- }
- }
- var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
- lostPoint += ratio * 10;
- return lostPoint;
- } };
- var QRMath = { glog: function(n2) {
- if (n2 < 1) {
- throw new Error("glog(" + n2 + ")");
- }
- return QRMath.LOG_TABLE[n2];
- }, gexp: function(n2) {
- while (n2 < 0) {
- n2 += 255;
- }
- while (n2 >= 256) {
- n2 -= 255;
- }
- return QRMath.EXP_TABLE[n2];
- }, EXP_TABLE: new Array(256), LOG_TABLE: new Array(256) };
- for (var i2 = 0; i2 < 8; i2++) {
- QRMath.EXP_TABLE[i2] = 1 << i2;
- }
- for (var i2 = 8; i2 < 256; i2++) {
- QRMath.EXP_TABLE[i2] = QRMath.EXP_TABLE[i2 - 4] ^ QRMath.EXP_TABLE[i2 - 5] ^ QRMath.EXP_TABLE[i2 - 6] ^ QRMath.EXP_TABLE[i2 - 8];
- }
- for (var i2 = 0; i2 < 255; i2++) {
- QRMath.LOG_TABLE[QRMath.EXP_TABLE[i2]] = i2;
- }
- function QRPolynomial(num, shift) {
- if (num.length == void 0) {
- throw new Error(num.length + "/" + shift);
- }
- var offset = 0;
- while (offset < num.length && num[offset] == 0) {
- offset++;
- }
- this.num = new Array(num.length - offset + shift);
- for (var i3 = 0; i3 < num.length - offset; i3++) {
- this.num[i3] = num[i3 + offset];
- }
- }
- QRPolynomial.prototype = { get: function(index2) {
- return this.num[index2];
- }, getLength: function() {
- return this.num.length;
- }, multiply: function(e2) {
- var num = new Array(this.getLength() + e2.getLength() - 1);
- for (var i3 = 0; i3 < this.getLength(); i3++) {
- for (var j2 = 0; j2 < e2.getLength(); j2++) {
- num[i3 + j2] ^= QRMath.gexp(QRMath.glog(this.get(i3)) + QRMath.glog(e2.get(j2)));
- }
- }
- return new QRPolynomial(num, 0);
- }, mod: function(e2) {
- var tl = this.getLength(), el = e2.getLength();
- if (tl - el < 0) {
- return this;
- }
- var num = new Array(tl);
- for (var i3 = 0; i3 < tl; i3++) {
- num[i3] = this.get(i3);
- }
- while (num.length >= el) {
- var ratio = QRMath.glog(num[0]) - QRMath.glog(e2.get(0));
- for (var i3 = 0; i3 < e2.getLength(); i3++) {
- num[i3] ^= QRMath.gexp(QRMath.glog(e2.get(i3)) + ratio);
- }
- while (num[0] == 0) {
- num.shift();
- }
- }
- return new QRPolynomial(num, 0);
- } };
- var RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];
- QRCodeAlg2.prototype.getRightType = function() {
- for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
- var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
- if (rsBlock == void 0) {
- throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
- }
- var length = rsBlock.length / 3;
- var totalDataCount = 0;
- for (var i3 = 0; i3 < length; i3++) {
- var count = rsBlock[i3 * 3 + 0];
- var dataCount = rsBlock[i3 * 3 + 2];
- totalDataCount += dataCount * count;
- }
- var lengthBytes = typeNumber > 9 ? 2 : 1;
- if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
- this.typeNumber = typeNumber;
- this.rsBlock = rsBlock;
- this.totalDataCount = totalDataCount;
- break;
- }
- }
- };
- function QRBitBuffer() {
- this.buffer = new Array();
- this.length = 0;
- }
- QRBitBuffer.prototype = { get: function(index2) {
- var bufIndex = Math.floor(index2 / 8);
- return this.buffer[bufIndex] >>> 7 - index2 % 8 & 1;
- }, put: function(num, length) {
- for (var i3 = 0; i3 < length; i3++) {
- this.putBit(num >>> length - i3 - 1 & 1);
- }
- }, putBit: function(bit) {
- var bufIndex = Math.floor(this.length / 8);
- if (this.buffer.length <= bufIndex) {
- this.buffer.push(0);
- }
- if (bit) {
- this.buffer[bufIndex] |= 128 >>> this.length % 8;
- }
- this.length++;
- } };
- return QRCodeAlg2;
- }();
- var htmlParse = function() {
- var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
- var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
- var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
- var empty2 = makeMap2("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
- var block = makeMap2("a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
- var inline = makeMap2("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
- var closeSelf = makeMap2("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
- var fillAttrs = makeMap2("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
- var special = makeMap2("script,style");
- function HTMLParser(html, handler) {
- var index2;
- var chars;
- var match;
- var stack = [];
- var last = html;
- stack.last = function() {
- return this[this.length - 1];
- };
- while (html) {
- chars = true;
- if (!stack.last() || !special[stack.last()]) {
- if (html.indexOf("<!--") == 0) {
- index2 = html.indexOf("-->");
- if (index2 >= 0) {
- if (handler.comment) {
- handler.comment(html.substring(4, index2));
- }
- html = html.substring(index2 + 3);
- chars = false;
- }
- } else if (html.indexOf("</") == 0) {
- match = html.match(endTag);
- if (match) {
- html = html.substring(match[0].length);
- match[0].replace(endTag, parseEndTag);
- chars = false;
- }
- } else if (html.indexOf("<") == 0) {
- match = html.match(startTag);
- if (match) {
- html = html.substring(match[0].length);
- match[0].replace(startTag, parseStartTag);
- chars = false;
- }
- }
- if (chars) {
- index2 = html.indexOf("<");
- var text = index2 < 0 ? html : html.substring(0, index2);
- html = index2 < 0 ? "" : html.substring(index2);
- if (handler.chars) {
- handler.chars(text);
- }
- }
- } else {
- html = html.replace(new RegExp("([\\s\\S]*?)</" + stack.last() + "[^>]*>"), function(all, text2) {
- text2 = text2.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2");
- if (handler.chars) {
- handler.chars(text2);
- }
- return "";
- });
- parseEndTag("", stack.last());
- }
- if (html == last) {
- throw "Parse Error: " + html;
- }
- last = html;
- }
- parseEndTag();
- function parseStartTag(tag, tagName, rest, unary) {
- tagName = tagName.toLowerCase();
- if (block[tagName]) {
- while (stack.last() && inline[stack.last()]) {
- parseEndTag("", stack.last());
- }
- }
- if (closeSelf[tagName] && stack.last() == tagName) {
- parseEndTag("", tagName);
- }
- unary = empty2[tagName] || !!unary;
- if (!unary) {
- stack.push(tagName);
- }
- if (handler.start) {
- var attrs = [];
- rest.replace(attr, function(match2, name2) {
- var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name2] ? name2 : "";
- attrs.push({ name: name2, value, escaped: value.replace(/(^|[^\\])"/g, '$1\\"') });
- });
- if (handler.start) {
- handler.start(tagName, attrs, unary);
- }
- }
- }
- function parseEndTag(tag, tagName) {
- if (!tagName) {
- var pos = 0;
- } else {
- for (var pos = stack.length - 1; pos >= 0; pos--) {
- if (stack[pos] == tagName) {
- break;
- }
- }
- }
- if (pos >= 0) {
- for (var i2 = stack.length - 1; i2 >= pos; i2--) {
- if (handler.end) {
- handler.end(stack[i2]);
- }
- }
- stack.length = pos;
- }
- }
- }
- function makeMap2(str) {
- var obj = {};
- var items = str.split(",");
- for (var i2 = 0; i2 < items.length; i2++) {
- obj[items[i2]] = true;
- }
- return obj;
- }
- function removeDOCTYPE(html) {
- return html.replace(/<\?xml.*\?>\n/, "").replace(/<!doctype.*>\n/, "").replace(/<!DOCTYPE.*>\n/, "");
- }
- function parseAttrs(attrs) {
- return attrs.reduce(function(pre, attr2) {
- var value = attr2.value;
- var name2 = attr2.name;
- if (pre[name2]) {
- pre[name2] = pre[name2] + " " + value;
- } else {
- pre[name2] = value;
- }
- return pre;
- }, {});
- }
- function parseHtml(html) {
- html = removeDOCTYPE(html);
- var stacks = [];
- var results = { node: "root", children: [] };
- HTMLParser(html, { start: function start(tag, attrs, unary) {
- var node2 = { name: tag };
- if (attrs.length !== 0) {
- node2.attrs = parseAttrs(attrs);
- }
- if (unary) {
- var parent2 = stacks[0] || results;
- if (!parent2.children) {
- parent2.children = [];
- }
- parent2.children.push(node2);
- } else {
- stacks.unshift(node2);
- }
- }, end: function end(tag) {
- var node2 = stacks.shift();
- if (node2.name !== tag)
- formatAppLog("error", "at node_modules/qs-canvas/index.js:1260", "invalid state: mismatch end tag");
- if (stacks.length === 0) {
- results.children.push(node2);
- } else {
- var parent2 = stacks[0];
- if (!parent2.children) {
- parent2.children = [];
- }
- parent2.children.push(node2);
- }
- }, chars: function chars(text) {
- var node2 = { type: "text", text };
- if (stacks.length === 0) {
- results.children.push(node2);
- } else {
- var parent2 = stacks[0];
- if (!parent2.children) {
- parent2.children = [];
- }
- parent2.children.push(node2);
- }
- }, comment: function comment(text) {
- var node2 = { node: "comment", text };
- var parent2 = stacks[0];
- if (!parent2.children) {
- parent2.children = [];
- }
- parent2.children.push(node2);
- } });
- return results.children;
- }
- return parseHtml;
- }();
- var imgTools = /* @__PURE__ */ function() {
- function getLocalFilePath(path) {
- if (path.indexOf("_www") === 0 || path.indexOf("_doc") === 0 || path.indexOf("_documents") === 0 || path.indexOf("_downloads") === 0) {
- return path;
- }
- if (path.indexOf("file://") === 0) {
- return path;
- }
- if (path.indexOf("/storage/emulated/0/") === 0) {
- return path;
- }
- if (path.indexOf("/") === 0) {
- var localFilePath = plus.io.convertAbsoluteFileSystem(path);
- if (localFilePath !== path) {
- return localFilePath;
- } else {
- path = path.substr(1);
- }
- }
- return "_www/" + path;
- }
- function dataUrlToBase64(str) {
- var array2 = str.split(",");
- return array2[array2.length - 1];
- }
- var index2 = 0;
- function getNewFileId() {
- return Date.now() + String(index2++);
- }
- function biggerThan(v1, v2) {
- var v1Array = v1.split(".");
- var v2Array = v2.split(".");
- var update = false;
- for (var index3 = 0; index3 < v2Array.length; index3++) {
- var diff = v1Array[index3] - v2Array[index3];
- if (diff !== 0) {
- update = diff > 0;
- break;
- }
- }
- return update;
- }
- function pathToBase64(path) {
- return new Promise(function(resolve, reject) {
- if (typeof window === "object" && "document" in window) {
- if (typeof FileReader === "function") {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", path, true);
- xhr.responseType = "blob";
- xhr.onload = function() {
- if (this.status === 200) {
- let fileReader = new FileReader();
- fileReader.onload = function(e2) {
- resolve(e2.target.result);
- };
- fileReader.onerror = reject;
- fileReader.readAsDataURL(this.response);
- }
- };
- xhr.onerror = reject;
- xhr.send();
- return;
- }
- var canvas = document.createElement("canvas");
- var c2x = canvas.getContext("2d");
- var img = new Image();
- img.onload = function() {
- canvas.width = img.width;
- canvas.height = img.height;
- c2x.drawImage(img, 0, 0);
- resolve(canvas.toDataURL());
- canvas.height = canvas.width = 0;
- };
- img.onerror = reject;
- img.src = path;
- return;
- }
- if (typeof plus === "object") {
- plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) {
- entry.file(function(file) {
- var fileReader = new plus.io.FileReader();
- fileReader.onload = function(data) {
- resolve(data.target.result);
- };
- fileReader.onerror = function(error2) {
- reject(error2);
- };
- fileReader.readAsDataURL(file);
- }, function(error2) {
- reject(error2);
- });
- }, function(error2) {
- reject(error2);
- });
- return;
- }
- if (typeof wx === "object" && wx.canIUse("getFileSystemManager")) {
- wx.getFileSystemManager().readFile({
- filePath: path,
- encoding: "base64",
- success: function(res) {
- resolve("data:image/png;base64," + res.data);
- },
- fail: function(error2) {
- reject(error2);
- }
- });
- return;
- }
- reject(new Error("not support"));
- });
- }
- function base64ToPath(base64) {
- return new Promise(function(resolve, reject) {
- if (typeof window === "object" && "document" in window) {
- base64 = base64.split(",");
- var type = base64[0].match(/:(.*?);/)[1];
- var str = atob(base64[1]);
- var n2 = str.length;
- var array2 = new Uint8Array(n2);
- while (n2--) {
- array2[n2] = str.charCodeAt(n2);
- }
- return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array2], { type })));
- }
- var extName = base64.split(",")[0].match(/data\:\S+\/(\S+);/);
- if (extName) {
- extName = extName[1];
- } else {
- reject(new Error("base64 error"));
- }
- var fileName = getNewFileId() + "." + extName;
- if (typeof plus === "object") {
- var basePath = "_doc";
- var dirPath = "uniapp_temp";
- var filePath = basePath + "/" + dirPath + "/" + fileName;
- if (!biggerThan(plus.os.name === "Android" ? "1.9.9.80627" : "1.9.9.80472", plus.runtime.innerVersion)) {
- plus.io.resolveLocalFileSystemURL(basePath, function(entry) {
- entry.getDirectory(dirPath, {
- create: true,
- exclusive: false
- }, function(entry2) {
- entry2.getFile(fileName, {
- create: true,
- exclusive: false
- }, function(entry3) {
- entry3.createWriter(function(writer) {
- writer.onwrite = function() {
- resolve(filePath);
- };
- writer.onerror = reject;
- writer.seek(0);
- writer.writeAsBinary(dataUrlToBase64(base64));
- }, reject);
- }, reject);
- }, reject);
- }, reject);
- return;
- }
- var bitmap = new plus.nativeObj.Bitmap(fileName);
- bitmap.loadBase64Data(base64, function() {
- bitmap.save(filePath, {}, function() {
- bitmap.clear();
- resolve(filePath);
- }, function(error2) {
- bitmap.clear();
- reject(error2);
- });
- }, function(error2) {
- bitmap.clear();
- reject(error2);
- });
- return;
- }
- function getEnvPath() {
- var _a2, _b2, _c, _d, _e2, _f;
- if (typeof my === "object" && ((_a2 = my == null ? void 0 : my.env) == null ? void 0 : _a2.USER_DATA_PATH)) {
- return my.env.USER_DATA_PATH;
- }
- if (typeof swan === "object" && ((_b2 = swan == null ? void 0 : swan.env) == null ? void 0 : _b2.USER_DATA_PATH)) {
- return swan.env.USER_DATA_PATH;
- }
- if (typeof tt === "object" && ((_c = tt == null ? void 0 : tt.env) == null ? void 0 : _c.USER_DATA_PATH)) {
- return tt.env.USER_DATA_PATH;
- }
- if (typeof qq === "object" && ((_d = qq == null ? void 0 : qq.env) == null ? void 0 : _d.USER_DATA_PATH)) {
- return qq.env.USER_DATA_PATH;
- }
- if (typeof qh === "object" && ((_e2 = qh == null ? void 0 : qh.env) == null ? void 0 : _e2.USER_DATA_PATH)) {
- return qh.env.USER_DATA_PATH;
- }
- if (typeof wx === "object" && ((_f = wx == null ? void 0 : wx.env) == null ? void 0 : _f.USER_DATA_PATH)) {
- return wx.env.USER_DATA_PATH;
- }
- return "https://user";
- }
- try {
- var filePath = getEnvPath() + "/" + fileName;
- uni.getFileSystemManager().writeFile({
- filePath,
- data: dataUrlToBase64(base64),
- encoding: "base64",
- success: function() {
- resolve(filePath);
- },
- fail: function(error2) {
- reject(error2);
- }
- });
- } catch (e2) {
- reject(new Error("not support"));
- }
- });
- }
- return { pathToBase64, base64ToPath };
- }();
- if (notUnd("object")) {
- module.exports = QSCanvas2;
- }
- return QSCanvas2;
- })();
- })(qsCanvas);
- var qsCanvasExports = qsCanvas.exports;
- const QSCanvas = /* @__PURE__ */ getDefaultExportFromCjs(qsCanvasExports);
- var define_import_meta_env_default = { SHOPRO_VERSION: "v1.8.3", SHOPRO_BASE_URL: "https://zxgz.newfeifan.cn", SHOPRO_DEV_BASE_URL: "https://zxgz.newfeifan.cn", SHOPRO_API_PATH: "/app-api", SHOPRO_DEV_PORT: "3000", SHOPRO_STATIC_URL: "http://localhost", SHOPRO_MPLIVE_ON: "0", BASE_URL: "/", MODE: "development", DEV: true, PROD: false, SSR: false };
- const _sfc_main$39 = {
- __name: "s-follow-modal",
- setup(__props, { expose: __expose }) {
- __expose();
- const show = vue.computed(() => sheep$1.$store("modal").subscribe);
- const imagePath = vue.ref("");
- async function drawQrCode(url2) {
- formatAppLog("log", "at sheep/components/s-follow-modal/s-follow-modal.vue:47", url2);
- const qsc = new QSCanvas({
- canvasId: "myCanvas",
- width: 300,
- height: 300,
- setCanvasWH: (canvas) => {
- canvas.width = 300;
- canvas.height = 300;
- }
- });
- await qsc.drawQrCode({
- val: url2,
- // 二维码内容
- x: 25,
- y: 15,
- size: 250,
- // 二维码大小
- background: "#ffffff",
- // 背景色
- foreground: "#000000",
- // 前景色
- pdground: "#000000",
- // 定位角点颜色
- correctLevel: 3
- // 容错级别
- });
- const qrY = 15;
- const qrHeight = 250;
- const textX = 300 / 2;
- const textY = qrY + qrHeight + 15;
- await qsc.drawText({
- val: t$6("pop.long_press_qrcode_follow"),
- // 文字内容
- x: textX,
- y: textY,
- maxWidth: 250,
- // 文字的最大宽度,确保文字不会超出画布
- paintbrushProps: {
- fillStyle: "#333",
- // 文字颜色
- textAlign: "center",
- // 文字水平居中
- textBaseline: "middle",
- // 文字垂直居中
- font: {
- // 字体属性以对象格式传递
- fontStyle: "normal",
- // 字体样式
- fontVariant: "normal",
- // 字体变体
- fontWeight: "normal",
- // 字体粗细
- fontSize: 14,
- // 字体大小
- fontFamily: "sans-serif"
- // 字体系列
- }
- }
- });
- await qsc.draw();
- const imagePathData = await qsc.toImage();
- if (imagePathData) {
- imagePath.value = imagePathData;
- }
- }
- function createQrcode() {
- let SHOPRO_DEV_BASE_URL = "https://zxgz.newfeifan.cn";
- formatAppLog("log", "at sheep/components/s-follow-modal/s-follow-modal.vue:113", "当前接口Url", SHOPRO_DEV_BASE_URL);
- if (SHOPRO_DEV_BASE_URL.includes("letcgo.com")) {
- drawQrCode(define_import_meta_env_default.SHOPRO_MP_HOME_PAGE_LETCGO);
- } else {
- drawQrCode(define_import_meta_env_default.SHOPRO_MP_HOME_PAGE_FEIFAN);
- }
- }
- vue.watchEffect(() => {
- if (show.value) {
- vue.nextTick().then(() => {
- createQrcode();
- });
- }
- });
- const __returned__ = { show, imagePath, drawQrCode, createQrcode, computed: vue.computed, onMounted: vue.onMounted, ref: vue.ref, watchEffect: vue.watchEffect, nextTick: vue.nextTick, get sheep() {
- return sheep$1;
- }, get QSCanvas() {
- return QSCanvas;
- }, get onShow() {
- return onShow;
- }, get closeSubscribeModal() {
- return closeSubscribeModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$38(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 关注 "),
- vue.createVNode(_component_su_popup, {
- show: $setup.show,
- round: "10",
- onClose: $setup.closeSubscribeModal
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "login-wrap" }, [
- vue.createElementVNode("view", { class: "head-box" }, [
- vue.createElementVNode("view", { class: "ss-m-b-20" }, [
- vue.createElementVNode(
- "view",
- { class: "head-title ss-m-r-40 head-title-animation" },
- vue.toDisplayString($setup.t("pop.follow_public_account")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex ss-row-center" }, [
- vue.createElementVNode("canvas", {
- class: "hideCanvas",
- "canvas-id": "myCanvas",
- style: { "width": "300px", "height": "300px" }
- }),
- vue.createElementVNode("image", {
- src: $setup.imagePath,
- mode: "widthFix"
- }, null, 8, ["src"])
- ])
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show", "onClose"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const __easycom_6$1 = /* @__PURE__ */ _export_sfc(_sfc_main$39, [["render", _sfc_render$38], ["__scopeId", "data-v-7b106c15"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-follow-modal/s-follow-modal.vue"]]);
- const _sfc_main$38 = {
- name: "uni-easyinput",
- emits: ["click", "iconClick", "update:modelValue", "input", "focus", "blur", "confirm"],
- model: {
- prop: "modelValue",
- event: "update:modelValue"
- },
- props: {
- name: String,
- value: [Number, String],
- modelValue: [Number, String],
- type: {
- type: String,
- default: "text"
- },
- clearable: {
- type: Boolean,
- default: true
- },
- autoHeight: {
- type: Boolean,
- default: false
- },
- placeholder: String,
- placeholderStyle: String,
- focus: {
- type: Boolean,
- default: false
- },
- disabled: {
- type: Boolean,
- default: false
- },
- maxlength: {
- type: [Number, String],
- default: 140
- },
- confirmType: {
- type: String,
- default: "done"
- },
- clearSize: {
- type: [Number, String],
- default: 15
- },
- inputBorder: {
- type: Boolean,
- default: true
- },
- prefixIcon: {
- type: String,
- default: ""
- },
- suffixIcon: {
- type: String,
- default: ""
- },
- trim: {
- type: [Boolean, String],
- default: true
- },
- passwordIcon: {
- type: Boolean,
- default: true
- },
- styles: {
- type: Object,
- default() {
- return {
- color: "#333",
- disableColor: "#ffffff",
- borderColor: "#ffffff"
- };
- }
- },
- errorMessage: {
- type: [String, Boolean],
- default: ""
- },
- paddingLeft: {
- type: [Number, String],
- default: 0
- }
- },
- data() {
- return {
- focused: false,
- errMsg: "",
- val: "",
- showMsg: "",
- border: false,
- isFirstBorder: false,
- showClearIcon: false,
- showPassword: false
- };
- },
- computed: {
- msg() {
- return this.errorMessage || this.errMsg;
- },
- // 因为uniapp的input组件的maxlength组件必须要数值,这里转为数值,用户可以传入字符串数值
- inputMaxlength() {
- return Number(this.maxlength);
- }
- },
- watch: {
- value(newVal) {
- if (this.errMsg)
- this.errMsg = "";
- this.val = newVal;
- if (this.form && this.formItem && !this.is_reset) {
- this.is_reset = false;
- this.formItem.setValue(newVal);
- }
- },
- modelValue(newVal) {
- if (this.errMsg)
- this.errMsg = "";
- this.val = newVal;
- if (this.form && this.formItem && !this.is_reset) {
- this.is_reset = false;
- this.formItem.setValue(newVal);
- }
- },
- focus(newVal) {
- this.$nextTick(() => {
- this.focused = this.focus;
- });
- }
- },
- created() {
- if (!this.value && this.value !== 0) {
- this.val = this.modelValue;
- }
- if (!this.modelValue && this.modelValue !== 0) {
- this.val = this.value;
- }
- this.form = this.getForm("uniForms");
- this.formItem = this.getForm("uniFormsItem");
- if (this.form && this.formItem) {
- if (this.formItem.name) {
- if (!this.is_reset) {
- this.is_reset = false;
- this.formItem.setValue(this.val);
- }
- this.rename = this.formItem.name;
- this.form.inputChildrens.push(this);
- }
- }
- },
- mounted() {
- this.$nextTick(() => {
- this.focused = this.focus;
- });
- },
- methods: {
- /**
- * 初始化变量值
- */
- init() {
- },
- onClickIcon(type) {
- this.$emit("iconClick", type);
- },
- /**
- * 获取父元素实例
- */
- getForm(name2 = "uniForms") {
- let parent2 = this.$parent;
- let parentName = parent2.$options.name;
- while (parentName !== name2) {
- parent2 = parent2.$parent;
- if (!parent2)
- return false;
- parentName = parent2.$options.name;
- }
- return parent2;
- },
- onEyes() {
- this.showPassword = !this.showPassword;
- },
- onInput(event) {
- let value = event.detail.value;
- if (this.trim) {
- if (typeof this.trim === "boolean" && this.trim) {
- value = this.trimStr(value);
- }
- if (typeof this.trim === "string") {
- value = this.trimStr(value, this.trim);
- }
- }
- if (this.errMsg)
- this.errMsg = "";
- this.val = value;
- this.$emit("input", value);
- this.$emit("update:modelValue", value);
- },
- onFocus(event) {
- this.$emit("focus", event);
- },
- onBlur(event) {
- event.detail.value;
- this.$emit("blur", event);
- },
- onConfirm(e2) {
- this.$emit("confirm", e2.detail.value);
- },
- onClear(event) {
- this.val = "";
- this.$emit("input", "");
- this.$emit("update:modelValue", "");
- },
- fieldClick() {
- this.$emit("click");
- },
- trimStr(str, pos = "both") {
- if (pos === "both") {
- return str.trim();
- } else if (pos === "left") {
- return str.trimLeft();
- } else if (pos === "right") {
- return str.trimRight();
- } else if (pos === "start") {
- return str.trimStart();
- } else if (pos === "end") {
- return str.trimEnd();
- } else if (pos === "all") {
- return str.replace(/\s+/g, "");
- } else if (pos === "none") {
- return str;
- }
- return str;
- }
- }
- };
- function _sfc_render$37(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uni-easyinput", { "uni-easyinput-error": $options.msg }]),
- style: vue.normalizeStyle({ color: $props.inputBorder && $options.msg ? "#e43d33" : $props.styles.color })
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-easyinput__content", {
- "is-input-border": $props.inputBorder,
- "is-input-error-border": $props.inputBorder && $options.msg,
- "is-textarea": $props.type === "textarea",
- "is-disabled": $props.disabled
- }]),
- style: vue.normalizeStyle({
- "border-color": $props.inputBorder && $options.msg ? "#dd524d" : $props.styles.borderColor,
- "background-color": $props.disabled ? $props.styles.disableColor : ""
- })
- },
- [
- $props.prefixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
- key: 0,
- class: "content-clear-icon",
- type: $props.prefixIcon,
- color: "#c0c4cc",
- onClick: _cache[0] || (_cache[0] = ($event) => $options.onClickIcon("prefix"))
- }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true),
- $props.type === "textarea" ? (vue.openBlock(), vue.createElementBlock("textarea", {
- key: 1,
- class: vue.normalizeClass(["uni-easyinput__content-textarea", { "input-padding": $props.inputBorder }]),
- name: $props.name,
- value: $data.val,
- placeholder: $props.placeholder,
- placeholderStyle: $props.placeholderStyle,
- disabled: $props.disabled,
- "placeholder-class": "uni-easyinput__placeholder-class",
- maxlength: $options.inputMaxlength,
- focus: $data.focused,
- autoHeight: $props.autoHeight,
- onInput: _cache[1] || (_cache[1] = (...args) => $options.onInput && $options.onInput(...args)),
- onBlur: _cache[2] || (_cache[2] = (...args) => $options.onBlur && $options.onBlur(...args)),
- onFocus: _cache[3] || (_cache[3] = (...args) => $options.onFocus && $options.onFocus(...args)),
- onConfirm: _cache[4] || (_cache[4] = (...args) => $options.onConfirm && $options.onConfirm(...args))
- }, null, 42, ["name", "value", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "autoHeight"])) : (vue.openBlock(), vue.createElementBlock("input", {
- key: 2,
- type: $props.type === "password" ? "text" : $props.type,
- class: "uni-easyinput__content-input",
- style: vue.normalizeStyle({
- "padding-right": $props.type === "password" || $props.clearable || $props.prefixIcon ? "" : "10px",
- "padding-left": $props.paddingLeft + "px"
- }),
- name: $props.name,
- value: $data.val,
- password: !$data.showPassword && $props.type === "password",
- placeholder: $props.placeholder,
- placeholderStyle: $props.placeholderStyle,
- "placeholder-class": "uni-easyinput__placeholder-class",
- disabled: $props.disabled,
- maxlength: $options.inputMaxlength,
- focus: $data.focused,
- confirmType: $props.confirmType,
- onFocus: _cache[5] || (_cache[5] = (...args) => $options.onFocus && $options.onFocus(...args)),
- onBlur: _cache[6] || (_cache[6] = (...args) => $options.onBlur && $options.onBlur(...args)),
- onInput: _cache[7] || (_cache[7] = (...args) => $options.onInput && $options.onInput(...args)),
- onChange: _cache[8] || (_cache[8] = (...args) => $options.onInput && $options.onInput(...args)),
- onConfirm: _cache[9] || (_cache[9] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
- "cursor-spacing": 30,
- "always-embed": ""
- }, null, 44, ["type", "name", "value", "password", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "confirmType"])),
- $props.type === "password" && $props.passwordIcon ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 3 },
- [
- $data.val ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
- key: 0,
- class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
- type: $data.showPassword ? "eye-slash-filled" : "eye-filled",
- size: 18,
- color: "#c0c4cc",
- onClick: $options.onEyes
- }, null, 8, ["class", "type", "onClick"])) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : $props.suffixIcon ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 4 },
- [
- $props.suffixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
- key: 0,
- class: "content-clear-icon",
- type: $props.suffixIcon,
- color: "#c0c4cc",
- onClick: _cache[10] || (_cache[10] = ($event) => $options.onClickIcon("suffix"))
- }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 5 },
- [
- $props.clearable && $data.val && !$props.disabled ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
- key: 0,
- class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
- type: "clear",
- size: $props.clearSize,
- color: "#c0c4cc",
- onClick: $options.onClear
- }, null, 8, ["class", "size", "onClick"])) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )),
- vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- )
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_0$l = /* @__PURE__ */ _export_sfc(_sfc_main$38, [["render", _sfc_render$37], ["__scopeId", "data-v-09fd5285"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue"]]);
- const _sfc_main$37 = {
- name: "uniFormsItem",
- props: {
- // 自定义内容
- custom: {
- type: Boolean,
- default: false
- },
- // 是否显示报错信息
- showMessage: {
- type: Boolean,
- default: true
- },
- name: String,
- required: Boolean,
- validateTrigger: {
- type: String,
- default: ""
- },
- leftIcon: String,
- iconColor: {
- type: String,
- default: "#606266"
- },
- label: String,
- // 左边标题的宽度单位px
- labelWidth: {
- type: [Number, String],
- default: ""
- },
- // 对齐方式,left|center|right
- labelAlign: {
- type: String,
- default: ""
- },
- // lable的位置,可选为 left-左边,top-上边
- labelPosition: {
- type: String,
- default: ""
- },
- errorMessage: {
- type: [String, Boolean],
- default: ""
- },
- // 表单校验规则
- rules: {
- type: Array,
- default() {
- return [];
- }
- }
- },
- data() {
- return {
- errorTop: false,
- errorBottom: false,
- labelMarginBottom: "",
- errorWidth: "",
- errMsg: "",
- val: "",
- labelPos: "",
- labelWid: "",
- labelAli: "",
- showMsg: "undertext",
- border: false,
- isFirstBorder: false,
- isArray: false,
- arrayField: ""
- };
- },
- computed: {
- msg() {
- return this.errorMessage || this.errMsg;
- },
- fieldStyle() {
- let style = {};
- if (this.labelPos == "top") {
- style.padding = "0 0";
- this.labelMarginBottom = "6px";
- }
- if (this.labelPos == "left" && this.msg !== false && this.msg != "") {
- style.paddingBottom = "0px";
- this.errorBottom = true;
- this.errorTop = false;
- } else if (this.labelPos == "top" && this.msg !== false && this.msg != "") {
- this.errorBottom = false;
- this.errorTop = true;
- } else {
- this.errorTop = false;
- this.errorBottom = false;
- }
- return style;
- },
- // uni不支持在computed中写style.justifyContent = 'center'的形式,故用此方法
- justifyContent() {
- if (this.labelAli === "left")
- return "flex-start";
- if (this.labelAli === "center")
- return "center";
- if (this.labelAli === "right")
- return "flex-end";
- },
- labelLeft() {
- return (this.labelPos === "left" ? parseInt(this.labelWid) : 0) + "rpx";
- }
- },
- watch: {
- validateTrigger(trigger) {
- this.formTrigger = trigger;
- }
- },
- created() {
- this.form = this.getForm();
- this.group = this.getForm("uniGroup");
- this.formRules = [];
- this.formTrigger = this.validateTrigger;
- if (this.name && this.name.indexOf("[") !== -1 && this.name.indexOf("]") !== -1) {
- this.isArray = true;
- this.arrayField = this.name;
- this.form.formData[this.name] = this.form._getValue(this.name, "");
- }
- },
- mounted() {
- if (this.form) {
- this.form.childrens.push(this);
- }
- this.init();
- },
- unmounted() {
- this.__isUnmounted = true;
- this.unInit();
- },
- methods: {
- init() {
- if (this.form) {
- let {
- formRules,
- validator: validator2,
- formData,
- value,
- labelPosition,
- labelWidth,
- labelAlign,
- errShowType
- } = this.form;
- this.labelPos = this.labelPosition ? this.labelPosition : labelPosition;
- if (this.label) {
- this.labelWid = this.labelWidth ? this.labelWidth : labelWidth || 140;
- } else {
- this.labelWid = this.labelWidth ? this.labelWidth : labelWidth || "auto";
- }
- if (this.labelWid && this.labelWid !== "auto") {
- this.labelWid += "rpx";
- }
- this.labelAli = this.labelAlign ? this.labelAlign : labelAlign;
- if (!this.form.isFirstBorder) {
- this.form.isFirstBorder = true;
- this.isFirstBorder = true;
- }
- if (this.group) {
- if (!this.group.isFirstBorder) {
- this.group.isFirstBorder = true;
- this.isFirstBorder = true;
- }
- }
- this.border = this.form.border;
- this.showMsg = errShowType;
- let name2 = this.isArray ? this.arrayField : this.name;
- if (!name2)
- return;
- if (formRules && this.rules.length > 0) {
- if (!formRules[name2]) {
- formRules[name2] = {
- rules: this.rules
- };
- }
- validator2.updateSchema(formRules);
- }
- this.formRules = formRules[name2] || {};
- this.validator = validator2;
- } else {
- this.labelPos = this.labelPosition || "left";
- this.labelWid = this.labelWidth || 130;
- this.labelAli = this.labelAlign || "left";
- }
- },
- unInit() {
- if (this.form) {
- this.form.childrens.forEach((item, index2) => {
- if (item === this) {
- this.form.childrens.splice(index2, 1);
- delete this.form.formData[item.name];
- }
- });
- }
- },
- /**
- * 获取父元素实例
- */
- getForm(name2 = "uniForms") {
- let parent2 = this.$parent;
- let parentName = parent2.$options.name;
- while (parentName !== name2) {
- parent2 = parent2.$parent;
- if (!parent2)
- return false;
- parentName = parent2.$options.name;
- }
- return parent2;
- },
- /**
- * 移除该表单项的校验结果
- */
- clearValidate() {
- this.errMsg = "";
- },
- /**
- * 子组件调用,如 easyinput
- * @param {Object} value
- */
- setValue(value) {
- let name2 = this.isArray ? this.arrayField : this.name;
- if (name2) {
- if (this.errMsg)
- this.errMsg = "";
- this.form.formData[name2] = this.form._getValue(name2, value);
- if (!this.formRules || typeof this.formRules && JSON.stringify(this.formRules) === "{}")
- return;
- this.triggerCheck(this.form._getValue(this.name, value));
- }
- },
- /**
- * 校验规则
- * @param {Object} value
- */
- async triggerCheck(value, formTrigger) {
- this.errMsg = "";
- if (!this.validator || Object.keys(this.formRules).length === 0)
- return;
- const isNoField = this.isRequired(this.formRules.rules || []);
- let isTrigger = this.isTrigger(
- this.formRules.validateTrigger,
- this.validateTrigger,
- this.form.validateTrigger
- );
- let result2 = null;
- if (!!isTrigger || formTrigger) {
- let name2 = this.isArray ? this.arrayField : this.name;
- result2 = await this.validator.validateUpdate(
- {
- [name2]: value
- },
- this.form.formData
- );
- }
- if (!isNoField && (value === void 0 || value === "")) {
- result2 = null;
- }
- const inputComp = this.form.inputChildrens.find((child) => child.rename === this.name);
- if ((isTrigger || formTrigger) && result2 && result2.errorMessage) {
- if (inputComp) {
- inputComp.errMsg = result2.errorMessage;
- }
- if (this.form.errShowType === "toast") {
- uni.showToast({
- title: result2.errorMessage || "校验错误",
- icon: "none"
- });
- }
- if (this.form.errShowType === "modal") {
- uni.showModal({
- title: "提示",
- content: result2.errorMessage || "校验错误"
- });
- }
- } else {
- if (inputComp) {
- inputComp.errMsg = "";
- }
- }
- this.errMsg = !result2 ? "" : result2.errorMessage;
- this.form.validateCheck(result2 ? result2 : null);
- return result2 ? result2 : null;
- },
- /**
- * 触发时机
- * @param {Object} event
- */
- isTrigger(rule, itemRlue, parentRule) {
- if (rule === "submit" || !rule) {
- if (rule === void 0) {
- if (itemRlue !== "bind") {
- if (!itemRlue) {
- return parentRule === "bind" ? true : false;
- }
- return false;
- }
- return true;
- }
- return false;
- }
- return true;
- },
- // 是否有必填字段
- isRequired(rules2) {
- let isNoField = false;
- for (let i2 = 0; i2 < rules2.length; i2++) {
- const ruleData = rules2[i2];
- if (ruleData.required) {
- isNoField = true;
- break;
- }
- }
- return isNoField;
- }
- }
- };
- function _sfc_render$36(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return vue.openBlock(), vue.createElementBlock("view", { class: "" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-forms-item", {
- "uni-forms-item--border": $data.border,
- "is-first-border": $data.border && $data.isFirstBorder,
- "uni-forms-item-error": $options.msg
- }])
- },
- [
- vue.createElementVNode("view", { class: "uni-forms-item__box" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-forms-item__inner", ["is-direction-" + $data.labelPos]])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "uni-forms-item__label",
- style: vue.normalizeStyle({ width: $data.labelWid, justifyContent: $options.justifyContent })
- },
- [
- vue.renderSlot(_ctx.$slots, "label", {}, () => [
- $props.required ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "is-required"
- }, "*")) : vue.createCommentVNode("v-if", true),
- $props.leftIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
- key: 1,
- class: "label-icon",
- size: "16",
- type: $props.leftIcon,
- color: $props.iconColor
- }, null, 8, ["type", "color"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- { class: "label-text" },
- vue.toDisplayString($props.label),
- 1
- /* TEXT */
- ),
- $props.label ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "label-seat"
- })) : vue.createCommentVNode("v-if", true)
- ], true)
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-forms-item__content", { "is-input-error-border": $options.msg }])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 2
- /* CLASS */
- )
- ],
- 2
- /* CLASS */
- ),
- $options.msg ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uni-error-message", { "uni-error-msg--boeder": $data.border }]),
- style: vue.normalizeStyle({
- paddingLeft: $options.labelLeft
- })
- },
- [
- vue.createElementVNode(
- "text",
- { class: "uni-error-message-text" },
- vue.toDisplayString($data.showMsg === "undertext" ? $options.msg : ""),
- 1
- /* TEXT */
- )
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 2
- /* CLASS */
- )
- ]);
- }
- const __easycom_1$9 = /* @__PURE__ */ _export_sfc(_sfc_main$37, [["render", _sfc_render$36], ["__scopeId", "data-v-462874dd"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue"]]);
- var pattern = {
- email: /^\S+?@\S+?\.\S+?$/,
- idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
- url: new RegExp(
- "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
- "i"
- )
- };
- const FORMAT_MAPPING = {
- "int": "integer",
- "bool": "boolean",
- "double": "number",
- "long": "number",
- "password": "string"
- // "fileurls": 'array'
- };
- function formatMessage(args, resources = "") {
- var defaultMessage = ["label"];
- defaultMessage.forEach((item) => {
- if (args[item] === void 0) {
- args[item] = "";
- }
- });
- let str = resources;
- for (let key in args) {
- let reg = new RegExp("{" + key + "}");
- str = str.replace(reg, args[key]);
- }
- return str;
- }
- function isEmptyValue(value, type) {
- if (value === void 0 || value === null) {
- return true;
- }
- if (typeof value === "string" && !value) {
- return true;
- }
- if (Array.isArray(value) && !value.length) {
- return true;
- }
- if (type === "object" && !Object.keys(value).length) {
- return true;
- }
- return false;
- }
- const types = {
- integer(value) {
- return types.number(value) && parseInt(value, 10) === value;
- },
- string(value) {
- return typeof value === "string";
- },
- number(value) {
- if (isNaN(value)) {
- return false;
- }
- return typeof value === "number";
- },
- "boolean": function(value) {
- return typeof value === "boolean";
- },
- "float": function(value) {
- return types.number(value) && !types.integer(value);
- },
- array(value) {
- return Array.isArray(value);
- },
- object(value) {
- return typeof value === "object" && !types.array(value);
- },
- date(value) {
- return value instanceof Date;
- },
- timestamp(value) {
- if (!this.integer(value) || Math.abs(value).toString().length > 16) {
- return false;
- }
- return true;
- },
- file(value) {
- return typeof value.url === "string";
- },
- email(value) {
- return typeof value === "string" && !!value.match(pattern.email) && value.length < 255;
- },
- url(value) {
- return typeof value === "string" && !!value.match(pattern.url);
- },
- pattern(reg, value) {
- try {
- return new RegExp(reg).test(value);
- } catch (e2) {
- return false;
- }
- },
- method(value) {
- return typeof value === "function";
- },
- idcard(value) {
- return typeof value === "string" && !!value.match(pattern.idcard);
- },
- "url-https"(value) {
- return this.url(value) && value.startsWith("https://");
- },
- "url-scheme"(value) {
- return value.startsWith("://");
- },
- "url-web"(value) {
- return false;
- }
- };
- class RuleValidator {
- constructor(message) {
- this._message = message;
- }
- async validateRule(fieldKey, fieldValue, value, data, allData) {
- var result2 = null;
- let rules2 = fieldValue.rules;
- let hasRequired = rules2.findIndex((item) => {
- return item.required;
- });
- if (hasRequired < 0) {
- if (value === null || value === void 0) {
- return result2;
- }
- if (typeof value === "string" && !value.length) {
- return result2;
- }
- }
- var message = this._message;
- if (rules2 === void 0) {
- return message["default"];
- }
- for (var i2 = 0; i2 < rules2.length; i2++) {
- let rule = rules2[i2];
- let vt2 = this._getValidateType(rule);
- Object.assign(rule, {
- label: fieldValue.label || `["${fieldKey}"]`
- });
- if (RuleValidatorHelper[vt2]) {
- result2 = RuleValidatorHelper[vt2](rule, value, message);
- if (result2 != null) {
- break;
- }
- }
- if (rule.validateExpr) {
- let now2 = Date.now();
- let resultExpr = rule.validateExpr(value, allData, now2);
- if (resultExpr === false) {
- result2 = this._getMessage(rule, rule.errorMessage || this._message["default"]);
- break;
- }
- }
- if (rule.validateFunction) {
- result2 = await this.validateFunction(rule, value, data, allData, vt2);
- if (result2 !== null) {
- break;
- }
- }
- }
- if (result2 !== null) {
- result2 = message.TAG + result2;
- }
- return result2;
- }
- async validateFunction(rule, value, data, allData, vt2) {
- let result2 = null;
- try {
- let callbackMessage = null;
- const res = await rule.validateFunction(rule, value, allData || data, (message) => {
- callbackMessage = message;
- });
- if (callbackMessage || typeof res === "string" && res || res === false) {
- result2 = this._getMessage(rule, callbackMessage || res, vt2);
- }
- } catch (e2) {
- result2 = this._getMessage(rule, e2.message, vt2);
- }
- return result2;
- }
- _getMessage(rule, message, vt2) {
- return formatMessage(rule, message || rule.errorMessage || this._message[vt2] || message["default"]);
- }
- _getValidateType(rule) {
- var result2 = "";
- if (rule.required) {
- result2 = "required";
- } else if (rule.format) {
- result2 = "format";
- } else if (rule.arrayType) {
- result2 = "arrayTypeFormat";
- } else if (rule.range) {
- result2 = "range";
- } else if (rule.maximum !== void 0 || rule.minimum !== void 0) {
- result2 = "rangeNumber";
- } else if (rule.maxLength !== void 0 || rule.minLength !== void 0) {
- result2 = "rangeLength";
- } else if (rule.pattern) {
- result2 = "pattern";
- } else if (rule.validateFunction) {
- result2 = "validateFunction";
- }
- return result2;
- }
- }
- const RuleValidatorHelper = {
- required(rule, value, message) {
- if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
- return formatMessage(rule, rule.errorMessage || message.required);
- }
- return null;
- },
- range(rule, value, message) {
- const {
- range: range2,
- errorMessage
- } = rule;
- let list = new Array(range2.length);
- for (let i2 = 0; i2 < range2.length; i2++) {
- const item = range2[i2];
- if (types.object(item) && item.value !== void 0) {
- list[i2] = item.value;
- } else {
- list[i2] = item;
- }
- }
- let result2 = false;
- if (Array.isArray(value)) {
- result2 = new Set(value.concat(list)).size === list.length;
- } else {
- if (list.indexOf(value) > -1) {
- result2 = true;
- }
- }
- if (!result2) {
- return formatMessage(rule, errorMessage || message["enum"]);
- }
- return null;
- },
- rangeNumber(rule, value, message) {
- if (!types.number(value)) {
- return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
- }
- let {
- minimum,
- maximum,
- exclusiveMinimum,
- exclusiveMaximum
- } = rule;
- let min = exclusiveMinimum ? value <= minimum : value < minimum;
- let max = exclusiveMaximum ? value >= maximum : value > maximum;
- if (minimum !== void 0 && min) {
- return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMinimum ? "exclusiveMinimum" : "minimum"]);
- } else if (maximum !== void 0 && max) {
- return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMaximum ? "exclusiveMaximum" : "maximum"]);
- } else if (minimum !== void 0 && maximum !== void 0 && (min || max)) {
- return formatMessage(rule, rule.errorMessage || message["number"].range);
- }
- return null;
- },
- rangeLength(rule, value, message) {
- if (!types.string(value) && !types.array(value)) {
- return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
- }
- let min = rule.minLength;
- let max = rule.maxLength;
- let val = value.length;
- if (min !== void 0 && val < min) {
- return formatMessage(rule, rule.errorMessage || message["length"].minLength);
- } else if (max !== void 0 && val > max) {
- return formatMessage(rule, rule.errorMessage || message["length"].maxLength);
- } else if (min !== void 0 && max !== void 0 && (val < min || val > max)) {
- return formatMessage(rule, rule.errorMessage || message["length"].range);
- }
- return null;
- },
- pattern(rule, value, message) {
- if (!types["pattern"](rule.pattern, value)) {
- return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
- }
- return null;
- },
- format(rule, value, message) {
- var customTypes = Object.keys(types);
- var format2 = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
- if (customTypes.indexOf(format2) > -1) {
- if (!types[format2](value)) {
- return formatMessage(rule, rule.errorMessage || message.typeError);
- }
- }
- return null;
- },
- arrayTypeFormat(rule, value, message) {
- if (!Array.isArray(value)) {
- return formatMessage(rule, rule.errorMessage || message.typeError);
- }
- for (let i2 = 0; i2 < value.length; i2++) {
- const element = value[i2];
- let formatResult = this.format(rule, element, message);
- if (formatResult !== null) {
- return formatResult;
- }
- }
- return null;
- }
- };
- class SchemaValidator extends RuleValidator {
- constructor(schema, options2) {
- super(SchemaValidator.message);
- this._schema = schema;
- this._options = options2 || null;
- }
- updateSchema(schema) {
- this._schema = schema;
- }
- async validate(data, allData) {
- let result2 = this._checkFieldInSchema(data);
- if (!result2) {
- result2 = await this.invokeValidate(data, false, allData);
- }
- return result2.length ? result2[0] : null;
- }
- async validateAll(data, allData) {
- let result2 = this._checkFieldInSchema(data);
- if (!result2) {
- result2 = await this.invokeValidate(data, true, allData);
- }
- return result2;
- }
- async validateUpdate(data, allData) {
- let result2 = this._checkFieldInSchema(data);
- if (!result2) {
- result2 = await this.invokeValidateUpdate(data, false, allData);
- }
- return result2.length ? result2[0] : null;
- }
- async invokeValidate(data, all, allData) {
- let result2 = [];
- let schema = this._schema;
- for (let key in schema) {
- let value = schema[key];
- let errorMessage = await this.validateRule(key, value, data[key], data, allData);
- if (errorMessage != null) {
- result2.push({
- key,
- errorMessage
- });
- if (!all)
- break;
- }
- }
- return result2;
- }
- async invokeValidateUpdate(data, all, allData) {
- let result2 = [];
- for (let key in data) {
- let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData);
- if (errorMessage != null) {
- result2.push({
- key,
- errorMessage
- });
- if (!all)
- break;
- }
- }
- return result2;
- }
- _checkFieldInSchema(data) {
- var keys = Object.keys(data);
- var keys2 = Object.keys(this._schema);
- if (new Set(keys.concat(keys2)).size === keys2.length) {
- return "";
- }
- var noExistFields = keys.filter((key) => {
- return keys2.indexOf(key) < 0;
- });
- var errorMessage = formatMessage({
- field: JSON.stringify(noExistFields)
- }, SchemaValidator.message.TAG + SchemaValidator.message["defaultInvalid"]);
- return [{
- key: "invalid",
- errorMessage
- }];
- }
- }
- function Message() {
- return {
- TAG: "",
- default: "验证错误",
- defaultInvalid: "提交的字段{field}在数据库中并不存在",
- validateFunction: "验证无效",
- required: "{label}必填",
- "enum": "{label}超出范围",
- timestamp: "{label}格式无效",
- whitespace: "{label}不能为空",
- typeError: "{label}类型无效",
- date: {
- format: "{label}日期{value}格式无效",
- parse: "{label}日期无法解析,{value}无效",
- invalid: "{label}日期{value}无效"
- },
- length: {
- minLength: "{label}长度不能少于{minLength}",
- maxLength: "{label}长度不能超过{maxLength}",
- range: "{label}必须介于{minLength}和{maxLength}之间"
- },
- number: {
- minimum: "{label}不能小于{minimum}",
- maximum: "{label}不能大于{maximum}",
- exclusiveMinimum: "{label}不能小于等于{minimum}",
- exclusiveMaximum: "{label}不能大于等于{maximum}",
- range: "{label}必须介于{minimum}and{maximum}之间"
- },
- pattern: {
- mismatch: "{label}格式不匹配"
- }
- };
- }
- SchemaValidator.message = new Message();
- const _sfc_main$36 = {
- name: "uniForms",
- components: {},
- emits: ["input", "reset", "validate", "submit"],
- props: {
- // 即将弃用
- value: {
- type: Object,
- default() {
- return {};
- }
- },
- // 替换 value 属性
- modelValue: {
- type: Object,
- default() {
- return {};
- }
- },
- // 表单校验规则
- rules: {
- type: Object,
- default() {
- return {};
- }
- },
- // 校验触发器方式,默认 关闭
- validateTrigger: {
- type: String,
- default: ""
- },
- // label 位置,可选值 top/left
- labelPosition: {
- type: String,
- default: "left"
- },
- // label 宽度,单位 px
- labelWidth: {
- type: [String, Number],
- default: ""
- },
- // label 居中方式,可选值 left/center/right
- labelAlign: {
- type: String,
- default: "left"
- },
- errShowType: {
- type: String,
- default: "undertext"
- },
- border: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- formData: {}
- };
- },
- computed: {
- dataValue() {
- if (JSON.stringify(this.modelValue) === "{}") {
- return this.value;
- } else {
- return this.modelValue;
- }
- }
- },
- watch: {
- rules(newVal) {
- this.init(newVal);
- },
- labelPosition() {
- this.childrens.forEach((vm) => {
- vm.init();
- });
- }
- },
- created() {
- let getbinddata = getApp().$vm.$.appContext.config.globalProperties.binddata;
- if (!getbinddata) {
- getApp().$vm.$.appContext.config.globalProperties.binddata = function(name2, value, formName) {
- if (formName) {
- this.$refs[formName].setValue(name2, value);
- } else {
- let formVm;
- for (let i2 in this.$refs) {
- const vm = this.$refs[i2];
- if (vm && vm.$options && vm.$options.name === "uniForms") {
- formVm = vm;
- break;
- }
- }
- if (!formVm)
- return formatAppLog("error", "at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:152", "当前 uni-froms 组件缺少 ref 属性");
- formVm.setValue(name2, value);
- }
- };
- }
- this.unwatchs = [];
- this.childrens = [];
- this.inputChildrens = [];
- this.checkboxChildrens = [];
- this.formRules = [];
- this.init(this.rules);
- },
- // mounted() {
- // this.init(this.rules)
- // },
- methods: {
- init(formRules) {
- if (Object.keys(formRules).length === 0) {
- this.formData = this.dataValue;
- return;
- }
- this.formRules = formRules;
- this.validator = new SchemaValidator(formRules);
- this.registerWatch();
- },
- // 监听 watch
- registerWatch() {
- this.unwatchs.forEach((v2) => v2());
- this.childrens.forEach((v2) => {
- v2.init();
- });
- Object.keys(this.dataValue).forEach((key) => {
- let watch = this.$watch(
- "dataValue." + key,
- (value) => {
- if (!value)
- return;
- if (value.toString() === "[object Object]") {
- for (let i2 in value) {
- let name2 = `${key}[${i2}]`;
- this.formData[name2] = this._getValue(name2, value[i2]);
- }
- } else {
- this.formData[key] = this._getValue(key, value);
- }
- },
- {
- deep: true,
- immediate: true
- }
- );
- this.unwatchs.push(watch);
- });
- },
- /**
- * 公开给用户使用
- * 设置校验规则
- * @param {Object} formRules
- */
- setRules(formRules) {
- this.init(formRules);
- },
- /**
- * 公开给用户使用
- * 设置自定义表单组件 value 值
- * @param {String} name 字段名称
- * @param {String} value 字段值
- */
- setValue(name2, value, callback) {
- let example = this.childrens.find((child) => child.name === name2);
- if (!example)
- return null;
- value = this._getValue(example.name, value);
- this.formData[name2] = value;
- example.val = value;
- return example.triggerCheck(value, callback);
- },
- /**
- * 表单重置
- * @param {Object} event
- */
- resetForm(event) {
- this.childrens.forEach((item) => {
- item.errMsg = "";
- const inputComp = this.inputChildrens.find((child) => child.rename === item.name);
- if (inputComp) {
- inputComp.errMsg = "";
- inputComp.is_reset = true;
- inputComp.$emit("input", inputComp.multiple ? [] : "");
- inputComp.$emit("update:modelValue", inputComp.multiple ? [] : "");
- }
- });
- this.childrens.forEach((item) => {
- if (item.name) {
- this.formData[item.name] = this._getValue(item.name, "");
- }
- });
- this.$emit("reset", event);
- },
- /**
- * 触发表单校验,通过 @validate 获取
- * @param {Object} validate
- */
- validateCheck(validate) {
- if (validate === null)
- validate = null;
- this.$emit("validate", validate);
- },
- /**
- * 校验所有或者部分表单
- */
- async validateAll(invalidFields, type, keepitem, callback) {
- let childrens = [];
- for (let i2 in invalidFields) {
- const item = this.childrens.find((v2) => v2.name === i2);
- if (item) {
- childrens.push(item);
- }
- }
- if (!callback && typeof keepitem === "function") {
- callback = keepitem;
- }
- let promise;
- if (!callback && typeof callback !== "function" && Promise) {
- promise = new Promise((resolve, reject) => {
- callback = function(valid, invalidFields2) {
- !valid ? resolve(invalidFields2) : reject(valid);
- };
- });
- }
- let results = [];
- let newFormData = {};
- if (this.validator) {
- for (let key in childrens) {
- const child = childrens[key];
- let name2 = child.isArray ? child.arrayField : child.name;
- if (child.isArray) {
- if (child.name.indexOf("[") !== -1 && child.name.indexOf("]") !== -1) {
- const fieldData = child.name.split("[");
- const fieldName = fieldData[0];
- const fieldValue = fieldData[1].replace("]", "");
- if (!newFormData[fieldName]) {
- newFormData[fieldName] = {};
- }
- newFormData[fieldName][fieldValue] = this._getValue(name2, invalidFields[name2]);
- }
- } else {
- newFormData[name2] = this._getValue(name2, invalidFields[name2]);
- }
- const result2 = await child.triggerCheck(invalidFields[name2], true);
- if (result2) {
- results.push(result2);
- if (this.errShowType === "toast" || this.errShowType === "modal")
- break;
- }
- }
- } else {
- newFormData = invalidFields;
- }
- if (Array.isArray(results)) {
- if (results.length === 0)
- results = null;
- }
- if (Array.isArray(keepitem)) {
- keepitem.forEach((v2) => {
- newFormData[v2] = this.dataValue[v2];
- });
- }
- if (type === "submit") {
- this.$emit("submit", {
- detail: {
- value: newFormData,
- errors: results
- }
- });
- } else {
- this.$emit("validate", results);
- }
- callback && typeof callback === "function" && callback(results, newFormData);
- if (promise && callback) {
- return promise;
- } else {
- return null;
- }
- },
- submitForm() {
- },
- /**
- * 外部调用方法
- * 手动提交校验表单
- * 对整个表单进行校验的方法,参数为一个回调函数。
- */
- submit(keepitem, callback, type) {
- for (let i2 in this.dataValue) {
- const itemData = this.childrens.find((v2) => v2.name === i2);
- if (itemData) {
- if (this.formData[i2] === void 0) {
- this.formData[i2] = this._getValue(i2, this.dataValue[i2]);
- }
- }
- }
- if (!type) {
- formatAppLog("warn", "at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:371", "submit 方法即将废弃,请使用validate方法代替!");
- }
- return this.validateAll(this.formData, "submit", keepitem, callback);
- },
- /**
- * 外部调用方法
- * 校验表单
- * 对整个表单进行校验的方法,参数为一个回调函数。
- */
- validate(keepitem, callback) {
- return this.submit(keepitem, callback, true);
- },
- /**
- * 部分表单校验
- * @param {Object} props
- * @param {Object} cb
- */
- validateField(props, callback) {
- props = [].concat(props);
- let invalidFields = {};
- this.childrens.forEach((item) => {
- if (props.indexOf(item.name) !== -1) {
- invalidFields = Object.assign({}, invalidFields, {
- [item.name]: this.formData[item.name]
- });
- }
- });
- return this.validateAll(invalidFields, "submit", [], callback);
- },
- /**
- * 对整个表单进行重置,将所有字段值重置为初始值并移除校验结果
- */
- resetFields() {
- this.resetForm();
- },
- /**
- * 移除表单项的校验结果。传入待移除的表单项的 prop 属性或者 prop 组成的数组,如不传则移除整个表单的校验结果
- */
- clearValidate(props) {
- props = [].concat(props);
- this.childrens.forEach((item) => {
- const inputComp = this.inputChildrens.find((child) => child.rename === item.name);
- if (props.length === 0) {
- item.errMsg = "";
- if (inputComp) {
- inputComp.errMsg = "";
- }
- } else {
- if (props.indexOf(item.name) !== -1) {
- item.errMsg = "";
- if (inputComp) {
- inputComp.errMsg = "";
- }
- }
- }
- });
- },
- /**
- * 把 value 转换成指定的类型
- * @param {Object} key
- * @param {Object} value
- */
- _getValue(key, value) {
- const rules2 = this.formRules[key] && this.formRules[key].rules || [];
- const isRuleNum = rules2.find((val) => val.format && this.type_filter(val.format));
- const isRuleBool = rules2.find((val) => val.format && val.format === "boolean" || val.format === "bool");
- if (isRuleNum) {
- value = isNaN(value) ? value : value === "" || value === null ? null : Number(value);
- }
- if (isRuleBool) {
- value = !value ? false : true;
- }
- return value;
- },
- /**
- * 过滤数字类型
- * @param {Object} format
- */
- type_filter(format2) {
- return format2 === "int" || format2 === "double" || format2 === "number" || format2 === "timestamp";
- }
- }
- };
- function _sfc_render$35(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uni-forms", { "uni-forms--top": !$props.border }])
- },
- [
- vue.createElementVNode(
- "form",
- {
- onSubmit: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.submitForm && $options.submitForm(...args), ["stop"])),
- onReset: _cache[1] || (_cache[1] = (...args) => $options.resetForm && $options.resetForm(...args))
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 32
- /* NEED_HYDRATION */
- )
- ],
- 2
- /* CLASS */
- );
- }
- const __easycom_2$7 = /* @__PURE__ */ _export_sfc(_sfc_main$36, [["render", _sfc_render$35], ["__scopeId", "data-v-9a1e3c32"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-forms/components/uni-forms/uni-forms.vue"]]);
- const username = {
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_username")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- if (!value) {
- callback(t$6("rules.username_required"));
- }
- return true;
- }
- }
- ]
- };
- const mobile = {
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_phone")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- if (!test$1.mobile(value)) {
- callback(t$6("rules.incorrect_phone_format"));
- }
- return true;
- }
- }
- ]
- };
- const password = {
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_password")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+\S{5,12}$/.test(value)) {
- callback(t$6("rules.password_requirements"));
- }
- return true;
- }
- }
- ]
- };
- const code = {
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_verification_code")
- }
- ]
- };
- ({
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_name")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- if (!test$1.chinese(value)) {
- callback(t$6("rules.enter_chinese_characters"));
- }
- return true;
- }
- }
- ]
- });
- ({
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_invoice_title")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- if (!test$1.chinese(value)) {
- callback(t$6("rules.enter_chinese_characters"));
- }
- return true;
- }
- }
- ]
- });
- ({
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_tax_number")
- }
- ]
- });
- ({
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_bank")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- if (!test$1.chinese(value)) {
- callback(t$6("rules.enter_chinese_characters"));
- }
- return true;
- }
- }
- ]
- });
- const bankCode = {
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_bank_card_number")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- if (!/^\d+$/.test(value)) {
- callback(t$6("rules.correct_bank_card_number"));
- }
- return true;
- }
- }
- ]
- };
- const alipayAccount$1 = {
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_alipay_account")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- let isEmail = test$1.email(value);
- let isMobile = test$1.mobile(value);
- if (!isEmail && !isMobile) {
- callback(t$6("rules.correct_account_number"));
- }
- return true;
- }
- }
- ]
- };
- const email = {
- rules: [
- {
- required: true,
- errorMessage: t$6("rules.enter_email")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- let isEmail = test$1.email(value);
- if (!isEmail) {
- callback(t$6("rules.correct_email"));
- }
- return true;
- }
- }
- ]
- };
- const _sfc_main$35 = {
- __name: "account-login",
- props: {
- agreeStatus: {
- type: Boolean,
- default: false
- }
- },
- emits: ["onConfirm"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const accountLoginRef = vue.ref(null);
- const emits = __emit;
- const props = __props;
- const state = vue.reactive({
- model: {
- username: "",
- // 账号
- password: ""
- // 密码
- },
- rules: {
- username,
- password
- }
- });
- async function accountLoginSubmit() {
- const validate = await vue.unref(accountLoginRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/account-login.vue:73", "error: ", error2);
- });
- if (!validate)
- return;
- if (!props.agreeStatus) {
- emits("onConfirm", true);
- sheep$1.$helper.toast(t$6("account.please_agree"));
- return;
- }
- const {
- code: code2,
- data
- } = await AuthUtil.login(state.model);
- if (code2 === 0) {
- closeAuthModal();
- }
- }
- const __returned__ = { accountLoginRef, emits, props, state, accountLoginSubmit, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get username() {
- return username;
- }, get password() {
- return password;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get AuthUtil() {
- return AuthUtil;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$34(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- ref: "accountLoginRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "160",
- labelAlign: "center",
- class: "loginUniForm"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- name: "username",
- label: $setup.t("account.username"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_username"),
- modelValue: $setup.state.model.username,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.username = $event),
- inputBorder: false
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "password",
- label: $setup.t("account.password"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- type: "password",
- placeholder: $setup.t("account.enter_password"),
- modelValue: $setup.state.model.password,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.password = $event),
- inputBorder: false
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- vue.createElementVNode("view", { style: { "display": "flex", "justify-content": "space-between", "margin-top": "20rpx" } }, [
- vue.createCommentVNode(` <button class="ss-reset-button forgot-btn" @tap="showAuthModal('resetPassword')">\r
- 忘记密码\r
- </button> `),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.accountLoginSubmit
- },
- vue.toDisplayString($setup.t("account.login")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const accountLogin = /* @__PURE__ */ _export_sfc(_sfc_main$35, [["render", _sfc_render$34], ["__scopeId", "data-v-f21c903c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/account-login.vue"]]);
- const countryData = [
- {
- english_name: "China",
- chinese_name: "中国",
- country_code: "CN",
- phone_code: "86"
- },
- {
- english_name: "Hong Kong",
- chinese_name: "中国香港",
- country_code: "HK",
- phone_code: "852"
- },
- {
- english_name: "Taiwan",
- chinese_name: "中国台湾",
- country_code: "TW",
- phone_code: "886"
- },
- {
- english_name: "Macau",
- chinese_name: "中国澳门",
- country_code: "MO",
- phone_code: "853"
- },
- {
- english_name: "Central African Republic",
- chinese_name: "中非共和国",
- country_code: "CF",
- phone_code: "236"
- },
- {
- english_name: "Chile",
- chinese_name: "智利",
- country_code: "CL",
- phone_code: "56"
- },
- {
- english_name: "Gibraltar",
- chinese_name: "直布罗陀",
- country_code: "GI",
- phone_code: "350"
- },
- {
- english_name: "Chad",
- chinese_name: "乍得",
- country_code: "TD",
- phone_code: "235"
- },
- {
- english_name: "Zambia",
- chinese_name: "赞比亚",
- country_code: "ZM",
- phone_code: "260"
- },
- {
- english_name: "Vietnam",
- chinese_name: "越南",
- country_code: "VN",
- phone_code: "84"
- },
- {
- english_name: "Jordan",
- chinese_name: "约旦",
- country_code: "JO",
- phone_code: "962"
- },
- {
- english_name: "Virgin Islands, British",
- chinese_name: "英属处女群岛",
- country_code: "VG",
- phone_code: "1340"
- },
- {
- english_name: "United Kingdom",
- chinese_name: "英国",
- country_code: "GB",
- phone_code: "44"
- },
- {
- english_name: "Indonesia",
- chinese_name: "印度尼西亚",
- country_code: "ID",
- phone_code: "62"
- },
- {
- english_name: "India",
- chinese_name: "印度",
- country_code: "IN",
- phone_code: "91"
- },
- {
- english_name: "Italy",
- chinese_name: "意大利",
- country_code: "IT",
- phone_code: "39"
- },
- {
- english_name: "Israel",
- chinese_name: "以色列",
- country_code: "IL",
- phone_code: "972"
- },
- {
- english_name: "Iran",
- chinese_name: "伊朗",
- country_code: "IR",
- phone_code: "98"
- },
- {
- english_name: "Iraq",
- chinese_name: "伊拉克",
- country_code: "IQ",
- phone_code: "964"
- },
- {
- english_name: "Yemen",
- chinese_name: "也门",
- country_code: "YE",
- phone_code: "967"
- },
- {
- english_name: "Armenia",
- chinese_name: "亚美尼亚",
- country_code: "AM",
- phone_code: "374"
- },
- {
- english_name: "Jamaica",
- chinese_name: "牙买加",
- country_code: "JM",
- phone_code: "1876"
- },
- {
- english_name: "Syria",
- chinese_name: "叙利亚",
- country_code: "SY",
- phone_code: "963"
- },
- {
- english_name: "Hungary",
- chinese_name: "匈牙利",
- country_code: "HU",
- phone_code: "36"
- },
- {
- english_name: "New Zealand",
- chinese_name: "新西兰",
- country_code: "NZ",
- phone_code: "64"
- },
- {
- english_name: "New Caledonia",
- chinese_name: "新喀里多尼亚",
- country_code: "NC",
- phone_code: "687"
- },
- {
- english_name: "Singapore",
- chinese_name: "新加坡",
- country_code: "SG",
- phone_code: "65"
- },
- {
- english_name: "Ivory Coast",
- chinese_name: "象牙海岸",
- country_code: "CI",
- phone_code: "225"
- },
- {
- english_name: "Greece",
- chinese_name: "希腊",
- country_code: "GR",
- phone_code: "30"
- },
- {
- english_name: "Spain",
- chinese_name: "西班牙",
- country_code: "ES",
- phone_code: "34"
- },
- {
- english_name: "Uzbekistan",
- chinese_name: "乌兹别克斯坦",
- country_code: "UZ",
- phone_code: "998"
- },
- {
- english_name: "Uruguay",
- chinese_name: "乌拉圭",
- country_code: "UY",
- phone_code: "598"
- },
- {
- english_name: "Ukraine",
- chinese_name: "乌克兰",
- country_code: "UA",
- phone_code: "380"
- },
- {
- english_name: "Uganda",
- chinese_name: "乌干达",
- country_code: "UG",
- phone_code: "256"
- },
- {
- english_name: "Brunei",
- chinese_name: "文莱",
- country_code: "BN",
- phone_code: "673"
- },
- {
- english_name: "Venezuela",
- chinese_name: "委内瑞拉",
- country_code: "VE",
- phone_code: "58"
- },
- {
- english_name: "Vanuatu",
- chinese_name: "瓦努阿图",
- country_code: "VU",
- phone_code: "678"
- },
- {
- english_name: "Turkmenistan",
- chinese_name: "土库曼斯坦",
- country_code: "TM",
- phone_code: "993"
- },
- {
- english_name: "Turkey",
- chinese_name: "土耳其",
- country_code: "TR",
- phone_code: "90"
- },
- {
- english_name: "Tunisia",
- chinese_name: "突尼斯",
- country_code: "TN",
- phone_code: "216"
- },
- {
- english_name: "Trinidad and Tobago",
- chinese_name: "特立尼达和多巴哥",
- country_code: "TT",
- phone_code: "1868"
- },
- {
- english_name: "Turks and Caicos Islands",
- chinese_name: "特克斯和凯科斯群岛",
- country_code: "TC",
- phone_code: "1649"
- },
- {
- english_name: "Tonga",
- chinese_name: "汤加",
- country_code: "TO",
- phone_code: "676"
- },
- {
- english_name: "Tanzania",
- chinese_name: "坦桑尼亚",
- country_code: "TZ",
- phone_code: "255"
- },
- {
- english_name: "Thailand",
- chinese_name: "泰国",
- country_code: "TH",
- phone_code: "66"
- },
- {
- english_name: "Tajikistan",
- chinese_name: "塔吉克斯坦",
- country_code: "TJ",
- phone_code: "992"
- },
- {
- english_name: "Somalia",
- chinese_name: "索马里",
- country_code: "SO",
- phone_code: "252"
- },
- {
- english_name: "Solomon Islands",
- chinese_name: "所罗门群岛",
- country_code: "SB",
- phone_code: "677"
- },
- {
- english_name: "Suriname",
- chinese_name: "苏里南",
- country_code: "SR",
- phone_code: "597"
- },
- {
- english_name: "Sudan",
- chinese_name: "苏丹",
- country_code: "SD",
- phone_code: "249"
- },
- {
- english_name: "Swaziland",
- chinese_name: "斯威士兰",
- country_code: "SZ",
- phone_code: "268"
- },
- {
- english_name: "Slovenia",
- chinese_name: "斯洛文尼亚",
- country_code: "SI",
- phone_code: "386"
- },
- {
- english_name: "Slovakia",
- chinese_name: "斯洛伐克",
- country_code: "SK",
- phone_code: "421"
- },
- {
- english_name: "Sri Lanka",
- chinese_name: "斯里兰卡",
- country_code: "LK",
- phone_code: "94"
- },
- {
- english_name: "Saint Vincent and The Grenadines",
- chinese_name: "圣文森特和格林纳丁斯",
- country_code: "VC",
- phone_code: "1784"
- },
- {
- english_name: "San Marino",
- chinese_name: "圣马力诺",
- country_code: "SM",
- phone_code: "378"
- },
- {
- english_name: "Saint Maarten (Dutch Part)",
- chinese_name: "圣马丁岛(荷兰部分)",
- country_code: "SX",
- phone_code: "1721"
- },
- {
- english_name: "Saint Lucia",
- chinese_name: "圣露西亚",
- country_code: "LC",
- phone_code: "1758"
- },
- {
- english_name: "Saint Kitts and Nevis",
- chinese_name: "圣基茨和尼维斯",
- country_code: "KN",
- phone_code: "1869"
- },
- {
- english_name: "Sao Tome and Principe",
- chinese_name: "圣多美和普林西比",
- country_code: "ST",
- phone_code: "239"
- },
- {
- english_name: "Saint Pierre and Miquelon",
- chinese_name: "圣彼埃尔和密克隆岛",
- country_code: "PM",
- phone_code: "508"
- },
- {
- english_name: "Saudi Arabia",
- chinese_name: "沙特阿拉伯",
- country_code: "SA",
- phone_code: "966"
- },
- {
- english_name: "Seychelles",
- chinese_name: "塞舌尔",
- country_code: "SC",
- phone_code: "248"
- },
- {
- english_name: "Cyprus",
- chinese_name: "塞浦路斯",
- country_code: "CY",
- phone_code: "357"
- },
- {
- english_name: "Senegal",
- chinese_name: "塞内加尔",
- country_code: "SN",
- phone_code: "221"
- },
- {
- english_name: "Sierra Leone",
- chinese_name: "塞拉利昂",
- country_code: "SL",
- phone_code: "232"
- },
- {
- english_name: "Serbia",
- chinese_name: "塞尔维亚",
- country_code: "RS",
- phone_code: "381"
- },
- {
- english_name: "Samoa",
- chinese_name: "萨摩亚",
- country_code: "WS",
- phone_code: "685"
- },
- {
- english_name: "El Salvador",
- chinese_name: "萨尔瓦多",
- country_code: "SV",
- phone_code: "503"
- },
- {
- english_name: "Switzerland",
- chinese_name: "瑞士",
- country_code: "CH",
- phone_code: "41"
- },
- {
- english_name: "Sweden",
- chinese_name: "瑞典",
- country_code: "SE",
- phone_code: "46"
- },
- {
- english_name: "Japan",
- chinese_name: "日本",
- country_code: "JP",
- phone_code: "81"
- },
- {
- english_name: "Portugal",
- chinese_name: "葡萄牙",
- country_code: "PT",
- phone_code: "351"
- },
- {
- english_name: "Palau",
- chinese_name: "帕劳",
- country_code: "PW",
- phone_code: "680"
- },
- {
- english_name: "Norway",
- chinese_name: "挪威",
- country_code: "NO",
- phone_code: "47"
- },
- {
- english_name: "Nigeria",
- chinese_name: "尼日利亚",
- country_code: "NG",
- phone_code: "234"
- },
- {
- english_name: "Niger",
- chinese_name: "尼日尔",
- country_code: "NE",
- phone_code: "227"
- },
- {
- english_name: "Nepal",
- chinese_name: "尼泊尔",
- country_code: "NP",
- phone_code: "977"
- },
- {
- english_name: "Nicaragua",
- chinese_name: "尼加拉瓜",
- country_code: "NI",
- phone_code: "505"
- },
- {
- english_name: "South Africa",
- chinese_name: "南非",
- country_code: "ZA",
- phone_code: "27"
- },
- {
- english_name: "Namibia",
- chinese_name: "纳米比亚",
- country_code: "NA",
- phone_code: "264"
- },
- {
- english_name: "Mexico",
- chinese_name: "墨西哥",
- country_code: "MX",
- phone_code: "52"
- },
- {
- english_name: "Mozambique",
- chinese_name: "莫桑比克",
- country_code: "MZ",
- phone_code: "258"
- },
- {
- english_name: "Monaco",
- chinese_name: "摩纳哥",
- country_code: "MC",
- phone_code: "377"
- },
- {
- english_name: "Morocco",
- chinese_name: "摩洛哥",
- country_code: "MA",
- phone_code: "212"
- },
- {
- english_name: "Moldova",
- chinese_name: "摩尔多瓦",
- country_code: "MD",
- phone_code: "373"
- },
- {
- english_name: "Myanmar",
- chinese_name: "缅甸",
- country_code: "MM",
- phone_code: "95"
- },
- {
- english_name: "Peru",
- chinese_name: "秘鲁",
- country_code: "PE",
- phone_code: "51"
- },
- {
- english_name: "Bangladesh",
- chinese_name: "孟加拉国",
- country_code: "BD",
- phone_code: "880"
- },
- {
- english_name: "Montserrat",
- chinese_name: "蒙特塞拉特岛",
- country_code: "MS",
- phone_code: "1664"
- },
- {
- english_name: "Mongolia",
- chinese_name: "蒙古",
- country_code: "MN",
- phone_code: "976"
- },
- {
- english_name: "Virgin Islands, US",
- chinese_name: "美属维尔京群岛",
- country_code: "VI",
- phone_code: "1284"
- },
- {
- english_name: "American Samoa",
- chinese_name: "美属萨摩亚",
- country_code: "AS",
- phone_code: "1684"
- },
- {
- english_name: "United States",
- chinese_name: "美国",
- country_code: "US",
- phone_code: "1"
- },
- {
- english_name: "Mauritania",
- chinese_name: "毛里塔尼亚",
- country_code: "MR",
- phone_code: "222"
- },
- {
- english_name: "Mauritius",
- chinese_name: "毛里求斯",
- country_code: "MU",
- phone_code: "230"
- },
- {
- english_name: "Mayotte",
- chinese_name: "马约特",
- country_code: "YT",
- phone_code: "269"
- },
- {
- english_name: "Martinique",
- chinese_name: "马提尼克",
- country_code: "MQ",
- phone_code: "596"
- },
- {
- english_name: "Macedonia",
- chinese_name: "马其顿",
- country_code: "MK",
- phone_code: "389"
- },
- {
- english_name: "Mali",
- chinese_name: "马里",
- country_code: "ML",
- phone_code: "223"
- },
- {
- english_name: "Malaysia",
- chinese_name: "马来西亚",
- country_code: "MY",
- phone_code: "60"
- },
- {
- english_name: "Malawi",
- chinese_name: "马拉维",
- country_code: "MW",
- phone_code: "265"
- },
- {
- english_name: "Malta",
- chinese_name: "马耳他",
- country_code: "MT",
- phone_code: "356"
- },
- {
- english_name: "Maldives",
- chinese_name: "马尔代夫",
- country_code: "MV",
- phone_code: "960"
- },
- {
- english_name: "Madagascar",
- chinese_name: "马达加斯加",
- country_code: "MG",
- phone_code: "261"
- },
- {
- english_name: "Romania",
- chinese_name: "罗马尼亚",
- country_code: "RO",
- phone_code: "40"
- },
- {
- english_name: "Rwanda",
- chinese_name: "卢旺达",
- country_code: "RW",
- phone_code: "250"
- },
- {
- english_name: "Luxembourg",
- chinese_name: "卢森堡",
- country_code: "LU",
- phone_code: "352"
- },
- {
- english_name: "Réunion Island",
- chinese_name: "留尼汪",
- country_code: "RE",
- phone_code: "262"
- },
- {
- english_name: "Liechtenstein",
- chinese_name: "列支敦士登",
- country_code: "LI",
- phone_code: "423"
- },
- {
- english_name: "Libya",
- chinese_name: "利比亚",
- country_code: "LY",
- phone_code: "218"
- },
- {
- english_name: "Liberia",
- chinese_name: "利比里亚",
- country_code: "LR",
- phone_code: "231"
- },
- {
- english_name: "Lithuania",
- chinese_name: "立陶宛",
- country_code: "LT",
- phone_code: "370"
- },
- {
- english_name: "Lebanon",
- chinese_name: "黎巴嫩",
- country_code: "LB",
- phone_code: "961"
- },
- {
- english_name: "Laos",
- chinese_name: "老挝",
- country_code: "LA",
- phone_code: "856"
- },
- {
- english_name: "Lesotho",
- chinese_name: "莱索托",
- country_code: "LS",
- phone_code: "266"
- },
- {
- english_name: "Latvia",
- chinese_name: "拉脱维亚",
- country_code: "LV",
- phone_code: "371"
- },
- {
- english_name: "Curacao",
- chinese_name: "库拉索",
- country_code: "CW",
- phone_code: "599"
- },
- {
- english_name: "Cook Islands",
- chinese_name: "库克群岛",
- country_code: "CK",
- phone_code: "682"
- },
- {
- english_name: "Kenya",
- chinese_name: "肯尼亚",
- country_code: "KE",
- phone_code: "254"
- },
- {
- english_name: "Croatia",
- chinese_name: "克罗地亚",
- country_code: "HR",
- phone_code: "385"
- },
- {
- english_name: "Kuwait",
- chinese_name: "科威特",
- country_code: "KW",
- phone_code: "965"
- },
- {
- english_name: "Comoros",
- chinese_name: "科摩罗",
- country_code: "KM",
- phone_code: "269"
- },
- {
- english_name: "Cape Verde",
- chinese_name: "开普",
- country_code: "CV",
- phone_code: "238"
- },
- {
- english_name: "Cayman Islands",
- chinese_name: "开曼群岛",
- country_code: "KY",
- phone_code: "1345"
- },
- {
- english_name: "Qatar",
- chinese_name: "卡塔尔",
- country_code: "QA",
- phone_code: "974"
- },
- {
- english_name: "Cameroon",
- chinese_name: "喀麦隆",
- country_code: "CM",
- phone_code: "237"
- },
- {
- english_name: "Zimbabwe",
- chinese_name: "津巴布韦",
- country_code: "ZW",
- phone_code: "263"
- },
- {
- english_name: "Czech",
- chinese_name: "捷克",
- country_code: "CZ",
- phone_code: "420"
- },
- {
- english_name: "Cambodia",
- chinese_name: "柬埔寨",
- country_code: "KH",
- phone_code: "855"
- },
- {
- english_name: "Gabon",
- chinese_name: "加蓬",
- country_code: "GA",
- phone_code: "241"
- },
- {
- english_name: "Ghana",
- chinese_name: "加纳",
- country_code: "GH",
- phone_code: "233"
- },
- {
- english_name: "Canada",
- chinese_name: "加拿大",
- country_code: "CA",
- phone_code: "1"
- },
- {
- english_name: "Guinea-Bissau",
- chinese_name: "几内亚比绍共和国",
- country_code: "GW",
- phone_code: "245"
- },
- {
- english_name: "Guinea",
- chinese_name: "几内亚",
- country_code: "GN",
- phone_code: "224"
- },
- {
- english_name: "Kyrgyzstan",
- chinese_name: "吉尔吉斯斯坦",
- country_code: "KG",
- phone_code: "996"
- },
- {
- english_name: "Djibouti",
- chinese_name: "吉布提",
- country_code: "DJ",
- phone_code: "253"
- },
- {
- english_name: "Kiribati",
- chinese_name: "基里巴斯",
- country_code: "KI",
- phone_code: "686"
- },
- {
- english_name: "Honduras",
- chinese_name: "洪都拉斯",
- country_code: "HN",
- phone_code: "504"
- },
- {
- english_name: "Montenegro",
- chinese_name: "黑山",
- country_code: "ME",
- phone_code: "382"
- },
- {
- english_name: "Netherlands",
- chinese_name: "荷兰",
- country_code: "NL",
- phone_code: "31"
- },
- {
- english_name: "South Korea",
- chinese_name: "韩国",
- country_code: "KR",
- phone_code: "82"
- },
- {
- english_name: "Haiti",
- chinese_name: "海地",
- country_code: "HT",
- phone_code: "509"
- },
- {
- english_name: "Kazakhstan",
- chinese_name: "哈萨克斯坦",
- country_code: "KZ",
- phone_code: "7"
- },
- {
- english_name: "Guyana",
- chinese_name: "圭亚那",
- country_code: "GY",
- phone_code: "592"
- },
- {
- english_name: "Guam",
- chinese_name: "关岛",
- country_code: "GU",
- phone_code: "1671"
- },
- {
- english_name: "Guatemala",
- chinese_name: "瓜地马拉",
- country_code: "GT",
- phone_code: "502"
- },
- {
- english_name: "Guadeloupe",
- chinese_name: "瓜德罗普岛",
- country_code: "GP",
- phone_code: "590"
- },
- {
- english_name: "Cuba",
- chinese_name: "古巴",
- country_code: "CU",
- phone_code: "53"
- },
- {
- english_name: "Georgia",
- chinese_name: "格鲁吉亚",
- country_code: "GE",
- phone_code: "995"
- },
- {
- english_name: "Greenland",
- chinese_name: "格陵兰岛",
- country_code: "GL",
- phone_code: "299"
- },
- {
- english_name: "Grenada",
- chinese_name: "格林纳达",
- country_code: "GD",
- phone_code: "1473"
- },
- {
- english_name: "Costa Rica",
- chinese_name: "哥斯达黎加",
- country_code: "CR",
- phone_code: "506"
- },
- {
- english_name: "Colombia",
- chinese_name: "哥伦比亚",
- country_code: "CO",
- phone_code: "57"
- },
- {
- english_name: "Democratic Republic of the Congo",
- chinese_name: "刚果民主共和国",
- country_code: "CD",
- phone_code: "243"
- },
- {
- english_name: "Republic Of The Congo",
- chinese_name: "刚果共和国",
- country_code: "CG",
- phone_code: "242"
- },
- {
- english_name: "Gambia",
- chinese_name: "冈比亚",
- country_code: "GM",
- phone_code: "220"
- },
- {
- english_name: "Finland",
- chinese_name: "芬兰",
- country_code: "FI",
- phone_code: "358"
- },
- {
- english_name: "Fiji",
- chinese_name: "斐济",
- country_code: "FJ",
- phone_code: "679"
- },
- {
- english_name: "Philippines",
- chinese_name: "菲律宾",
- country_code: "PH",
- phone_code: "63"
- },
- {
- english_name: "French Guiana",
- chinese_name: "法属圭亚那",
- country_code: "GF",
- phone_code: "594"
- },
- {
- english_name: "French Polynesia",
- chinese_name: "法属波利尼西亚",
- country_code: "PF",
- phone_code: "689"
- },
- {
- english_name: "Faroe Islands",
- chinese_name: "法罗群岛",
- country_code: "FO",
- phone_code: "298"
- },
- {
- english_name: "France",
- chinese_name: "法国",
- country_code: "FR",
- phone_code: "33"
- },
- {
- english_name: "Eritrea",
- chinese_name: "厄立特里亚",
- country_code: "ER",
- phone_code: "291"
- },
- {
- english_name: "Ecuador",
- chinese_name: "厄瓜多尔",
- country_code: "EC",
- phone_code: "593"
- },
- {
- english_name: "Russia",
- chinese_name: "俄罗斯",
- country_code: "RU",
- phone_code: "7"
- },
- {
- english_name: "Dominican Republic",
- chinese_name: "多米尼加共和国",
- country_code: "DO",
- phone_code: "1809"
- },
- {
- english_name: "Dominica",
- chinese_name: "多米尼加",
- country_code: "DM",
- phone_code: "1767"
- },
- {
- english_name: "Togo",
- chinese_name: "多哥",
- country_code: "TG",
- phone_code: "228"
- },
- {
- english_name: "Timor-Leste",
- chinese_name: "东帝汶",
- country_code: "TL",
- phone_code: "670"
- },
- {
- english_name: "Germany",
- chinese_name: "德国",
- country_code: "DE",
- phone_code: "49"
- },
- {
- english_name: "Denmark",
- chinese_name: "丹麦",
- country_code: "DK",
- phone_code: "45"
- },
- {
- english_name: "Equatorial Guinea",
- chinese_name: "赤道几内亚",
- country_code: "GQ",
- phone_code: "240"
- },
- {
- english_name: "Burundi",
- chinese_name: "布隆迪",
- country_code: "BI",
- phone_code: "257"
- },
- {
- english_name: "Burkina Faso",
- chinese_name: "布基纳法索",
- country_code: "BF",
- phone_code: "226"
- },
- {
- english_name: "Bhutan",
- chinese_name: "不丹",
- country_code: "BT",
- phone_code: "975"
- },
- {
- english_name: "Botswana",
- chinese_name: "博茨瓦纳",
- country_code: "BW",
- phone_code: "267"
- },
- {
- english_name: "Belize",
- chinese_name: "伯利兹",
- country_code: "BZ",
- phone_code: "501"
- },
- {
- english_name: "Bolivia",
- chinese_name: "玻利维亚",
- country_code: "BO",
- phone_code: "591"
- },
- {
- english_name: "Bosnia and Herzegovina",
- chinese_name: "波斯尼亚和黑塞哥维那",
- country_code: "BA",
- phone_code: "387"
- },
- {
- english_name: "Poland",
- chinese_name: "波兰",
- country_code: "PL",
- phone_code: "48"
- },
- {
- english_name: "Puerto Rico",
- chinese_name: "波多黎各",
- country_code: "PR",
- phone_code: "1787"
- },
- {
- english_name: "Iceland",
- chinese_name: "冰岛",
- country_code: "IS",
- phone_code: "354"
- },
- {
- english_name: "Belgium",
- chinese_name: "比利时",
- country_code: "BE",
- phone_code: "32"
- },
- {
- english_name: "Benin",
- chinese_name: "贝宁",
- country_code: "BJ",
- phone_code: "229"
- },
- {
- english_name: "Bulgaria",
- chinese_name: "保加利亚",
- country_code: "BG",
- phone_code: "359"
- },
- {
- english_name: "Bermuda",
- chinese_name: "百慕大群岛",
- country_code: "BM",
- phone_code: "1441"
- },
- {
- english_name: "Belarus",
- chinese_name: "白俄罗斯",
- country_code: "BY",
- phone_code: "375"
- },
- {
- english_name: "Brazil",
- chinese_name: "巴西",
- country_code: "BR",
- phone_code: "55"
- },
- {
- english_name: "Panama",
- chinese_name: "巴拿马",
- country_code: "PA",
- phone_code: "507"
- },
- {
- english_name: "Bahrain",
- chinese_name: "巴林",
- country_code: "BH",
- phone_code: "973"
- },
- {
- english_name: "Palestine",
- chinese_name: "巴勒斯坦",
- country_code: "BL",
- phone_code: "970"
- },
- {
- english_name: "Paraguay",
- chinese_name: "巴拉圭",
- country_code: "PY",
- phone_code: "595"
- },
- {
- english_name: "Pakistan",
- chinese_name: "巴基斯坦",
- country_code: "PK",
- phone_code: "92"
- },
- {
- english_name: "Bahamas",
- chinese_name: "巴哈马",
- country_code: "BS",
- phone_code: "1242"
- },
- {
- english_name: "Papua New Guinea",
- chinese_name: "巴布亚新几内亚",
- country_code: "PG",
- phone_code: "675"
- },
- {
- english_name: "Barbados",
- chinese_name: "巴巴多斯",
- country_code: "BB",
- phone_code: "1246"
- },
- {
- english_name: "Australia",
- chinese_name: "澳大利亚",
- country_code: "AU",
- phone_code: "61"
- },
- {
- english_name: "Austria",
- chinese_name: "奥地利",
- country_code: "AT",
- phone_code: "43"
- },
- {
- english_name: "Antigua and Barbuda",
- chinese_name: "安提瓜和巴布达",
- country_code: "AG",
- phone_code: "1268"
- },
- {
- english_name: "Anguilla",
- chinese_name: "安圭拉",
- country_code: "AI",
- phone_code: "1264"
- },
- {
- english_name: "Angola",
- chinese_name: "安哥拉",
- country_code: "AO",
- phone_code: "244"
- },
- {
- english_name: "Andorra",
- chinese_name: "安道尔",
- country_code: "AD",
- phone_code: "376"
- },
- {
- english_name: "Estonia",
- chinese_name: "爱沙尼亚",
- country_code: "EE",
- phone_code: "372"
- },
- {
- english_name: "Ireland",
- chinese_name: "爱尔兰",
- country_code: "IE",
- phone_code: "353"
- },
- {
- english_name: "Ethiopia",
- chinese_name: "埃塞俄比亚",
- country_code: "ET",
- phone_code: "251"
- },
- {
- english_name: "Egypt",
- chinese_name: "埃及",
- country_code: "EG",
- phone_code: "20"
- },
- {
- english_name: "Azerbaijan",
- chinese_name: "阿塞拜疆",
- country_code: "AZ",
- phone_code: "994"
- },
- {
- english_name: "Oman",
- chinese_name: "阿曼",
- country_code: "OM",
- phone_code: "968"
- },
- {
- english_name: "Aruba",
- chinese_name: "阿鲁巴",
- country_code: "AW",
- phone_code: "297"
- },
- {
- english_name: "United Arab Emirates",
- chinese_name: "阿拉伯联合酋长国",
- country_code: "AE",
- phone_code: "971"
- },
- {
- english_name: "Argentina",
- chinese_name: "阿根廷",
- country_code: "AR",
- phone_code: "54"
- },
- {
- english_name: "Afghanistan",
- chinese_name: "阿富汗",
- country_code: "AF",
- phone_code: "93"
- },
- {
- english_name: "Algeria",
- chinese_name: "阿尔及利亚",
- country_code: "DZ",
- phone_code: "213"
- },
- {
- english_name: "Albania",
- chinese_name: "阿尔巴尼亚",
- country_code: "AL",
- phone_code: "355"
- }
- ];
- const metadata$1 = { "version": 4, "country_calling_codes": { "1": ["US", "AG", "AI", "AS", "BB", "BM", "BS", "CA", "DM", "DO", "GD", "GU", "JM", "KN", "KY", "LC", "MP", "MS", "PR", "SX", "TC", "TT", "VC", "VG", "VI"], "7": ["RU", "KZ"], "20": ["EG"], "27": ["ZA"], "30": ["GR"], "31": ["NL"], "32": ["BE"], "33": ["FR"], "34": ["ES"], "36": ["HU"], "39": ["IT", "VA"], "40": ["RO"], "41": ["CH"], "43": ["AT"], "44": ["GB", "GG", "IM", "JE"], "45": ["DK"], "46": ["SE"], "47": ["NO", "SJ"], "48": ["PL"], "49": ["DE"], "51": ["PE"], "52": ["MX"], "53": ["CU"], "54": ["AR"], "55": ["BR"], "56": ["CL"], "57": ["CO"], "58": ["VE"], "60": ["MY"], "61": ["AU", "CC", "CX"], "62": ["ID"], "63": ["PH"], "64": ["NZ"], "65": ["SG"], "66": ["TH"], "81": ["JP"], "82": ["KR"], "84": ["VN"], "86": ["CN"], "90": ["TR"], "91": ["IN"], "92": ["PK"], "93": ["AF"], "94": ["LK"], "95": ["MM"], "98": ["IR"], "211": ["SS"], "212": ["MA", "EH"], "213": ["DZ"], "216": ["TN"], "218": ["LY"], "220": ["GM"], "221": ["SN"], "222": ["MR"], "223": ["ML"], "224": ["GN"], "225": ["CI"], "226": ["BF"], "227": ["NE"], "228": ["TG"], "229": ["BJ"], "230": ["MU"], "231": ["LR"], "232": ["SL"], "233": ["GH"], "234": ["NG"], "235": ["TD"], "236": ["CF"], "237": ["CM"], "238": ["CV"], "239": ["ST"], "240": ["GQ"], "241": ["GA"], "242": ["CG"], "243": ["CD"], "244": ["AO"], "245": ["GW"], "246": ["IO"], "247": ["AC"], "248": ["SC"], "249": ["SD"], "250": ["RW"], "251": ["ET"], "252": ["SO"], "253": ["DJ"], "254": ["KE"], "255": ["TZ"], "256": ["UG"], "257": ["BI"], "258": ["MZ"], "260": ["ZM"], "261": ["MG"], "262": ["RE", "YT"], "263": ["ZW"], "264": ["NA"], "265": ["MW"], "266": ["LS"], "267": ["BW"], "268": ["SZ"], "269": ["KM"], "290": ["SH", "TA"], "291": ["ER"], "297": ["AW"], "298": ["FO"], "299": ["GL"], "350": ["GI"], "351": ["PT"], "352": ["LU"], "353": ["IE"], "354": ["IS"], "355": ["AL"], "356": ["MT"], "357": ["CY"], "358": ["FI", "AX"], "359": ["BG"], "370": ["LT"], "371": ["LV"], "372": ["EE"], "373": ["MD"], "374": ["AM"], "375": ["BY"], "376": ["AD"], "377": ["MC"], "378": ["SM"], "380": ["UA"], "381": ["RS"], "382": ["ME"], "383": ["XK"], "385": ["HR"], "386": ["SI"], "387": ["BA"], "389": ["MK"], "420": ["CZ"], "421": ["SK"], "423": ["LI"], "500": ["FK"], "501": ["BZ"], "502": ["GT"], "503": ["SV"], "504": ["HN"], "505": ["NI"], "506": ["CR"], "507": ["PA"], "508": ["PM"], "509": ["HT"], "590": ["GP", "BL", "MF"], "591": ["BO"], "592": ["GY"], "593": ["EC"], "594": ["GF"], "595": ["PY"], "596": ["MQ"], "597": ["SR"], "598": ["UY"], "599": ["CW", "BQ"], "670": ["TL"], "672": ["NF"], "673": ["BN"], "674": ["NR"], "675": ["PG"], "676": ["TO"], "677": ["SB"], "678": ["VU"], "679": ["FJ"], "680": ["PW"], "681": ["WF"], "682": ["CK"], "683": ["NU"], "685": ["WS"], "686": ["KI"], "687": ["NC"], "688": ["TV"], "689": ["PF"], "690": ["TK"], "691": ["FM"], "692": ["MH"], "850": ["KP"], "852": ["HK"], "853": ["MO"], "855": ["KH"], "856": ["LA"], "880": ["BD"], "886": ["TW"], "960": ["MV"], "961": ["LB"], "962": ["JO"], "963": ["SY"], "964": ["IQ"], "965": ["KW"], "966": ["SA"], "967": ["YE"], "968": ["OM"], "970": ["PS"], "971": ["AE"], "972": ["IL"], "973": ["BH"], "974": ["QA"], "975": ["BT"], "976": ["MN"], "977": ["NP"], "992": ["TJ"], "993": ["TM"], "994": ["AZ"], "995": ["GE"], "996": ["KG"], "998": ["UZ"] }, "countries": { "AC": ["247", "00", "(?:[01589]\\d|[46])\\d{4}", [5, 6]], "AD": ["376", "00", "(?:1|6\\d)\\d{7}|[135-9]\\d{5}", [6, 8, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["[135-9]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["1"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]]], "AE": ["971", "00", "(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{2,9})", "$1 $2", ["60|8"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[236]|[479][2-8]"], "0$1"], ["(\\d{3})(\\d)(\\d{5})", "$1 $2 $3", ["[479]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"]], "0"], "AF": ["93", "00", "[2-7]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"]], "0"], "AG": ["1", "011", "(?:268|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([457]\\d{6})$|1", "268$1", 0, "268"], "AI": ["1", "011", "(?:264|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2457]\\d{6})$|1", "264$1", 0, "264"], "AL": ["355", "00", "(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}", [6, 7, 8, 9], [["(\\d{3})(\\d{3,4})", "$1 $2", ["80|9"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["4[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2358][2-5]|4"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["[23578]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["6"], "0$1"]], "0"], "AM": ["374", "00", "(?:[1-489]\\d|55|60|77)\\d{6}", [8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[89]0"], "0 $1"], ["(\\d{3})(\\d{5})", "$1 $2", ["2|3[12]"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["1|47"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[3-9]"], "0$1"]], "0"], "AO": ["244", "00", "[29]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[29]"]]]], "AR": ["54", "00", "(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}", [10, 11], [["(\\d{4})(\\d{2})(\\d{4})", "$1 $2-$3", ["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])", "2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["1"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[68]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2-$3", ["[23]"], "0$1", 1], ["(\\d)(\\d{4})(\\d{2})(\\d{4})", "$2 15-$3-$4", ["9(?:2[2-469]|3[3-578])", "9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))", "9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d)(\\d{2})(\\d{4})(\\d{4})", "$2 15-$3-$4", ["91"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d{3})(\\d{3})(\\d{5})", "$1-$2-$3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{4})", "$2 15-$3-$4", ["9"], "0$1", 0, "$1 $2 $3-$4"]], "0", 0, "0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?", "9$1"], "AS": ["1", "011", "(?:[58]\\d\\d|684|900)\\d{7}", [10], 0, "1", 0, "([267]\\d{6})$|1", "684$1", 0, "684"], "AT": ["43", "00", "1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{3,12})", "$1 $2", ["1(?:11|[2-9])"], "0$1"], ["(\\d{3})(\\d{2})", "$1 $2", ["517"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["5[079]"], "0$1"], ["(\\d{3})(\\d{3,10})", "$1 $2", ["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"], "0$1"], ["(\\d{4})(\\d{3,9})", "$1 $2", ["[2-467]|5[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,7})", "$1 $2 $3", ["5"], "0$1"]], "0"], "AU": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}", [5, 6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{3,4})", "$1 $2", ["16"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["16"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["14|4"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[2378]"], "(0$1)"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:30|[89])"]]], "0", 0, "(183[12])|0", 0, 0, 0, [["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}", [9]], ["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, ["163\\d{2,6}", [5, 6, 7, 8, 9]], ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "AW": ["297", "00", "(?:[25-79]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[25-9]"]]]], "AX": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}", [5, 6, 7, 8, 9, 10, 11, 12], 0, "0", 0, 0, 0, 0, "18", 0, "00"], "AZ": ["994", "00", "365\\d{6}|(?:[124579]\\d|60|88)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[28]|2|365|46", "1[28]|2|365[45]|46", "1[28]|2|365(?:4|5[02])|46"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[13-9]"], "0$1"]], "0"], "BA": ["387", "00", "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[1-3]|[7-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2-$3", ["[3-5]|6[56]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["6"], "0$1"]], "0"], "BB": ["1", "011", "(?:246|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "246$1", 0, "246"], "BD": ["880", "00", "[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{4,6})", "$1-$2", ["31[5-8]|[459]1"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1-$2", ["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"], "0$1"], ["(\\d{4})(\\d{3,6})", "$1-$2", ["[13-9]|2[23]"], "0$1"], ["(\\d)(\\d{7,8})", "$1-$2", ["2"], "0$1"]], "0"], "BE": ["32", "00", "4\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:80|9)0"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[239]|4[23]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[15-8]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4"], "0$1"]], "0"], "BF": ["226", "00", "[025-7]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[025-7]"]]]], "BG": ["359", "00", "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}", [6, 7, 8, 9, 12], [["(\\d)(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["43[1-6]|70[1-9]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:70|8)0"], "0$1"], ["(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3", ["43[1-7]|7"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[48]|9[08]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"]], "0"], "BH": ["973", "00", "[136-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[13679]|8[02-4679]"]]]], "BI": ["257", "00", "(?:[267]\\d|31)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2367]"]]]], "BJ": ["229", "00", "[24-689]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-689]"]]]], "BL": ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"], ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]], "BM": ["1", "011", "(?:441|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "441$1", 0, "441"], "BN": ["673", "00", "[2-578]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-578]"]]]], "BO": ["591", "00(?:1\\d)?", "8001\\d{5}|(?:[2-467]\\d|50)\\d{6}", [8, 9], [["(\\d)(\\d{7})", "$1 $2", ["[235]|4[46]"]], ["(\\d{8})", "$1", ["[67]"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, "0(1\\d)?"], "BQ": ["599", "00", "(?:[34]1|7\\d)\\d{5}", [7], 0, 0, 0, 0, 0, 0, "[347]"], "BR": ["55", "00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)", "(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}", [8, 9, 10, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["300|4(?:0[02]|37)", "4(?:02|37)0|[34]00"]], ["(\\d{3})(\\d{2,3})(\\d{4})", "$1 $2 $3", ["(?:[358]|90)0"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"], "($1)"], ["(\\d{2})(\\d{5})(\\d{4})", "$1 $2-$3", ["[16][1-9]|[2-57-9]"], "($1)"]], "0", 0, "(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?", "$2"], "BS": ["1", "011", "(?:242|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([3-8]\\d{6})$|1", "242$1", 0, "242"], "BT": ["975", "00", "[17]\\d{7}|[2-8]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-68]|7[246]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|7"]]]], "BW": ["267", "00", "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]]], "BY": ["375", "810", "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3})", "$1 $2", ["800"], "8 $1"], ["(\\d{3})(\\d{2})(\\d{2,4})", "$1 $2 $3", ["800"], "8 $1"], ["(\\d{4})(\\d{2})(\\d{3})", "$1 $2-$3", ["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])", "1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"], "8 0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["1(?:[56]|7[467])|2[1-3]"], "8 0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-4]"], "8 0$1"], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[89]"], "8 $1"]], "8", 0, "0|80?", 0, 0, 0, 0, "8~10"], "BZ": ["501", "00", "(?:0800\\d|[2-8])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-8]"]], ["(\\d)(\\d{3})(\\d{4})(\\d{3})", "$1-$2-$3-$4", ["0"]]]], "CA": ["1", "011", "(?:[2-8]\\d|90)\\d{8}|3\\d{6}", [7, 10], 0, "1", 0, 0, 0, 0, 0, [["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|90[25])[2-9]\\d{6}", [10]], ["", [10]], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}", [10]], ["900[2-9]\\d{6}", [10]], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}", [10]], 0, ["310\\d{4}", [7]], 0, ["600[2-9]\\d{6}", [10]]]], "CC": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}", [9]], ["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CD": ["243", "00", "(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[1-6]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["5"], "0$1"]], "0"], "CF": ["236", "00", "(?:[27]\\d{3}|8776)\\d{4}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[278]"]]]], "CG": ["242", "00", "222\\d{6}|(?:0\\d|80)\\d{7}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[02]"]]]], "CH": ["41", "00", "8\\d{11}|[2-9]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8[047]|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]|81"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["8"], "0$1"]], "0"], "CI": ["225", "00", "[02]\\d{9}", [10], [["(\\d{2})(\\d{2})(\\d)(\\d{5})", "$1 $2 $3 $4", ["2"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3 $4", ["0"]]]], "CK": ["682", "00", "[2-578]\\d{4}", [5], [["(\\d{2})(\\d{3})", "$1 $2", ["[2-578]"]]]], "CL": ["56", "(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0", "12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}", [9, 10, 11], [["(\\d{5})(\\d{4})", "$1 $2", ["219", "2196"], "($1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["44"]], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2[1-36]"], "($1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["9[2-9]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["60|8"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{3})(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["60"]]]], "CM": ["237", "00", "[26]\\d{8}|88\\d{6,7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["88"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[26]|88"]]]], "CN": ["86", "00|1(?:[12]\\d|79)\\d\\d00", "(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]", "(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"], "0$1"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]", "(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]", "85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])", "85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["(?:4|80)0"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|2(?:[02-57-9]|1[1-9])", "10|2(?:[02-57-9]|1[1-9])", "10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["80"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[3-578]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["1[3-9]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["[12]"], "0$1", 1]], "0", 0, "(1(?:[12]\\d|79)\\d\\d)|0", 0, 0, 0, 0, "00"], "CO": ["57", "00(?:4(?:[14]4|56)|[579])", "(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["46"]], ["(\\d{3})(\\d{7})", "$1 $2", ["6|90"], "($1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3[0-357]|91"]], ["(\\d)(\\d{3})(\\d{7})", "$1-$2-$3", ["1"], "0$1", 0, "$1 $2 $3"]], "0", 0, "0([3579]|4(?:[14]4|56))?"], "CR": ["506", "00", "(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}", [8, 10], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[3-9]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[89]"]]], 0, 0, "(19(?:0[0-2468]|1[09]|20|66|77|99))"], "CU": ["53", "119", "(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}", [6, 7, 8, 10], [["(\\d{2})(\\d{4,6})", "$1 $2", ["2[1-4]|[34]"], "(0$1)"], ["(\\d)(\\d{6,7})", "$1 $2", ["7"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["[56]"], "0$1"], ["(\\d{3})(\\d{7})", "$1 $2", ["8"], "0$1"]], "0"], "CV": ["238", "0", "(?:[2-59]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-589]"]]]], "CW": ["599", "00", "(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[3467]"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["9[4-8]"]]], 0, 0, 0, 0, 0, "[69]"], "CX": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}", [9]], ["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CY": ["357", "00", "(?:[279]\\d|[58]0)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[257-9]"]]]], "CZ": ["420", "00", "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}", [9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]]], "DE": ["49", "00", "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [["(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"], ["(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"], ["(\\d{4})(\\d{2,11})", "$1 $2", ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"], ["(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"], ["(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"], ["(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"], ["(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"], ["(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|31)"], "0$1"], ["(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"], ["(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"], ["(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]], "0"], "DJ": ["253", "00", "(?:2\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[27]"]]]], "DK": ["45", "00", "[2-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-9]"]]]], "DM": ["1", "011", "(?:[58]\\d\\d|767|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "767$1", 0, "767"], "DO": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "8001|8[024]9"], "DZ": ["213", "00", "(?:[1-4]|[5-79]\\d|80)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["9"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-8]"], "0$1"]], "0"], "EC": ["593", "00", "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}", [8, 9, 10, 11], [["(\\d)(\\d{3})(\\d{4})", "$1 $2-$3", ["[2-7]"], "(0$1)", 0, "$1-$2-$3"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1"]]], "0"], "EE": ["372", "00", "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88", "[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]], ["(\\d{4})(\\d{3,4})", "$1 $2", ["[45]|8(?:00|[1-49])", "[45]|8(?:00[1-9]|[1-49])"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "EG": ["20", "00", "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}", [8, 9, 10], [["(\\d)(\\d{7,8})", "$1 $2", ["[23]"], "0$1"], ["(\\d{2})(\\d{6,7})", "$1 $2", ["1[35]|[4-6]|8[2468]|9[235-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{8})", "$1 $2", ["1"], "0$1"]], "0"], "EH": ["212", "00", "[5-8]\\d{8}", [9], 0, "0", 0, 0, 0, 0, "528[89]"], "ER": ["291", "00", "[178]\\d{6}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[178]"], "0$1"]], "0"], "ES": ["34", "00", "[5-9]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]00"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-9]"]]]], "ET": ["251", "00", "(?:11|[2-579]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-579]"], "0$1"]], "0"], "FI": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{5})", "$1", ["20[2-59]"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1 $2", ["(?:[1-3]0|[68])0|70[07-9]"], "0$1"], ["(\\d{2})(\\d{4,8})", "$1 $2", ["[14]|2[09]|50|7[135]"], "0$1"], ["(\\d{2})(\\d{6,10})", "$1 $2", ["7"], "0$1"], ["(\\d)(\\d{4,9})", "$1 $2", ["(?:1[49]|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"], "0$1"]], "0", 0, 0, 0, 0, "1[03-79]|[2-9]", 0, "00"], "FJ": ["679", "0(?:0|52)", "45\\d{5}|(?:0800\\d|[235-9])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[235-9]|45"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "FK": ["500", "00", "[2-7]\\d{4}", [5]], "FM": ["691", "00", "(?:[39]\\d\\d|820)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[389]"]]]], "FO": ["298", "00", "[2-9]\\d{5}", [6], [["(\\d{6})", "$1", ["[2-9]"]]], 0, 0, "(10(?:01|[12]0|88))"], "FR": ["33", "00", "[1-9]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0 $1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[1-79]"], "0$1"]], "0"], "GA": ["241", "00", "(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}", [7, 8], [["(\\d)(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-7]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["11|[67]"], "0$1"]], 0, 0, "0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})", "$1"], "GB": ["44", "00", "[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}", [7, 9, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["800", "8001", "80011", "800111", "8001111"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["845", "8454", "84546", "845464"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["800"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["1(?:38|5[23]|69|76|94)", "1(?:(?:38|69)7|5(?:24|39)|768|946)", "1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["1(?:[2-69][02-9]|[78])"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[25]|7(?:0|6[02-9])", "[25]|7(?:0|6(?:[03-9]|2[356]))"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1389]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}", [9, 10]], ["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]], 0, " x"], "GD": ["1", "011", "(?:473|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "473$1", 0, "473"], "GE": ["995", "00", "(?:[3-57]\\d\\d|800)\\d{6}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["32"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[57]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[348]"], "0$1"]], "0"], "GF": ["594", "00", "[56]94\\d{6}|(?:80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[56]|9[47]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[89]"], "0$1"]], "0"], "GG": ["44", "00", "(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?", [7, 9, 10], 0, "0", 0, "([25-9]\\d{5})$|0", "1481$1", 0, 0, [["1481[25-9]\\d{5}", [10]], ["7(?:(?:781|839)\\d|911[17])\\d{5}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]]], "GH": ["233", "00", "(?:[235]\\d{3}|800)\\d{5}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[235]"], "0$1"]], "0"], "GI": ["350", "00", "(?:[25]\\d|60)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["2"]]]], "GL": ["299", "00", "(?:19|[2-689]\\d|70)\\d{4}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["19|[2-9]"]]]], "GM": ["220", "00", "[2-9]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "GN": ["224", "00", "722\\d{6}|(?:3|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["3"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[67]"]]]], "GP": ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[569]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"], ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]], "GQ": ["240", "00", "222\\d{6}|(?:3\\d|55|[89]0)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235]"]], ["(\\d{3})(\\d{6})", "$1 $2", ["[89]"]]]], "GR": ["30", "00", "5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}", [10, 11, 12], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["21|7"]], ["(\\d{4})(\\d{6})", "$1 $2", ["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2689]"]], ["(\\d{3})(\\d{3,4})(\\d{5})", "$1 $2 $3", ["8"]]]], "GT": ["502", "00", "80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-8]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "GU": ["1", "011", "(?:[58]\\d\\d|671|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "671$1", 0, "671"], "GW": ["245", "00", "[49]\\d{8}|4\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["40"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"]]]], "GY": ["592", "001", "(?:[2-8]\\d{3}|9008)\\d{3}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "HK": ["852", "00(?:30|5[09]|[126-9]?)", "8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}", [5, 6, 7, 8, 9, 11], [["(\\d{3})(\\d{2,5})", "$1 $2", ["900", "9003"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{3})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "HN": ["504", "00", "8\\d{10}|[237-9]\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["[237-9]"]]]], "HR": ["385", "00", "(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}", [6, 7, 8, 9], [["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["6[01]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{4})(\\d{3})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6|7[245]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-57]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"]], "0"], "HT": ["509", "00", "(?:[2-489]\\d|55)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[2-589]"]]]], "HU": ["36", "00", "[235-7]\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "06 $1"]], "06"], "ID": ["62", "00[89]", "00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}", [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["15"]], ["(\\d{2})(\\d{5,9})", "$1 $2", ["2[124]|[36]1"], "(0$1)"], ["(\\d{3})(\\d{5,7})", "$1 $2", ["800"], "0$1"], ["(\\d{3})(\\d{5,8})", "$1 $2", ["[2-79]"], "(0$1)"], ["(\\d{3})(\\d{3,4})(\\d{3})", "$1-$2-$3", ["8[1-35-9]"], "0$1"], ["(\\d{3})(\\d{6,8})", "$1 $2", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["804"], "0$1"], ["(\\d{3})(\\d)(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["80"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1-$2-$3", ["8"], "0$1"]], "0"], "IE": ["353", "00", "(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["2[24-9]|47|58|6[237-9]|9[35-9]"], "(0$1)"], ["(\\d{3})(\\d{5})", "$1 $2", ["[45]0"], "(0$1)"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2569]|4[1-69]|7[14]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["81"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["4"], "(0$1)"], ["(\\d{2})(\\d)(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "IL": ["972", "0(?:0|1[2-9])", "1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}", [7, 8, 9, 10, 11, 12], [["(\\d{4})(\\d{3})", "$1-$2", ["125"]], ["(\\d{4})(\\d{2})(\\d{2})", "$1-$2-$3", ["121"]], ["(\\d)(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-489]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1-$2-$3", ["12"]], ["(\\d{4})(\\d{6})", "$1-$2", ["159"]], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3-$4", ["1[7-9]"]], ["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})", "$1-$2 $3-$4", ["15"]]], "0"], "IM": ["44", "00", "1624\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([25-8]\\d{5})$|0", "1624$1", 0, "74576|(?:16|7[56])24"], "IN": ["91", "00", "(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}", [8, 9, 10, 11, 12, 13], [["(\\d{8})", "$1", ["5(?:0|2[23]|3[03]|[67]1|88)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"], 0, 1], ["(\\d{4})(\\d{4,5})", "$1 $2", ["180", "1800"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["140"], 0, 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["11|2[02]|33|4[04]|79[1-7]|80[2-46]", "11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"], "0$1", 1], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807", "1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]", "1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"], "0$1", 1], ["(\\d{5})(\\d{5})", "$1 $2", ["[6-9]"], "0$1", 1], ["(\\d{4})(\\d{2,4})(\\d{4})", "$1 $2 $3", ["1(?:6|8[06])", "1(?:6|8[06]0)"], 0, 1], ["(\\d{4})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["18"], 0, 1]], "0"], "IO": ["246", "00", "3\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["3"]]]], "IQ": ["964", "00", "(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-6]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0"], "IR": ["98", "00", "[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}", [4, 5, 6, 7, 10], [["(\\d{4,5})", "$1", ["96"], "0$1"], ["(\\d{2})(\\d{4,5})", "$1 $2", ["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[1-8]"], "0$1"]], "0"], "IS": ["354", "00|1(?:0(?:01|[12]0)|100)", "(?:38\\d|[4-9])\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "IT": ["39", "00", "0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", [6, 7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], ["(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], ["(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], ["(\\d{4})(\\d{4})", "$1 $2", ["894"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1(?:44|[679])|[378]|43"]], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], ["(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, [["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}", [6, 7, 8, 9, 10, 11]], ["3[2-9]\\d{7,8}|(?:31|43)\\d{8}", [9, 10]], ["80(?:0\\d{3}|3)\\d{3}", [6, 9]], ["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}", [6, 8, 9, 10]], ["1(?:78\\d|99)\\d{6}", [9, 10]], ["3[2-8]\\d{9,10}", [11, 12]], 0, 0, ["55\\d{8}", [10]], ["84(?:[08]\\d{3}|[17])\\d{3}", [6, 9]]]], "JE": ["44", "00", "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([0-24-8]\\d{5})$|0", "1534$1", 0, 0, [["1534[0-24-8]\\d{5}"], ["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"], ["80(?:07(?:35|81)|8901)\\d{4}"], ["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"], ["701511\\d{4}"], 0, ["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"], ["56\\d{8}"]]], "JM": ["1", "011", "(?:[58]\\d\\d|658|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "658|876"], "JO": ["962", "00", "(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0"], "JP": ["81", "010", "00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}", [8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3", ["(?:12|57|99)0"], "0$1"], ["(\\d{4})(\\d)(\\d{4})", "$1-$2-$3", ["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2-$3", ["[36]|4(?:2[09]|7[01])", "[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3", ["[14]|[289][2-9]|5[3-9]|7[2-4679]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["800"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[257-9]"], "0$1"]], "0", 0, "(000[259]\\d{6})$|(?:(?:003768)0?)|0", "$1"], "KE": ["254", "000", "(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}", [7, 8, 9, 10], [["(\\d{2})(\\d{5,7})", "$1 $2", ["[24-6]"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[17]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0"], "KG": ["996", "00", "8\\d{9}|[235-9]\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["3(?:1[346]|[24-79])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-79]|88"], "0$1"], ["(\\d{3})(\\d{3})(\\d)(\\d{2,3})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "KH": ["855", "00[14-9]", "1\\d{9}|[1-9]\\d{7,8}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "KI": ["686", "00", "(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}", [5, 8], 0, "0"], "KM": ["269", "00", "[3478]\\d{6}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[3478]"]]]], "KN": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "869$1", 0, "869"], "KP": ["850", "00|99", "85\\d{6}|(?:19\\d|[2-7])\\d{7}", [8, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"]], "0"], "KR": ["82", "00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))", "00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}", [5, 6, 8, 9, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3,4})", "$1-$2", ["(?:3[1-3]|[46][1-4]|5[1-5])1"], "0$1"], ["(\\d{4})(\\d{4})", "$1-$2", ["1"]], ["(\\d)(\\d{3,4})(\\d{4})", "$1-$2-$3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[36]0|8"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1-$2-$3", ["[1346]|5[1-5]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{2})(\\d{5})(\\d{4})", "$1-$2-$3", ["5"], "0$1"]], "0", 0, "0(8(?:[1-46-8]|5\\d\\d))?"], "KW": ["965", "00", "18\\d{5}|(?:[2569]\\d|41)\\d{6}", [7, 8], [["(\\d{4})(\\d{3,4})", "$1 $2", ["[169]|2(?:[235]|4[1-35-9])|52"]], ["(\\d{3})(\\d{5})", "$1 $2", ["[245]"]]]], "KY": ["1", "011", "(?:345|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "345$1", 0, "345"], "KZ": ["7", "810", "(?:33622|8\\d{8})\\d{5}|[78]\\d{9}", [10, 14], 0, "8", 0, 0, 0, 0, "33|7", 0, "8~10"], "LA": ["856", "00", "[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2[13]|3[14]|[4-8]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["30[0135-9]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0"], "LB": ["961", "00", "[27-9]\\d{7}|[13-9]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27-9]"]]], "0"], "LC": ["1", "011", "(?:[58]\\d\\d|758|900)\\d{7}", [10], 0, "1", 0, "([2-8]\\d{6})$|1", "758$1", 0, "758"], "LI": ["423", "00", "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", [7, 9], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2379]|8(?:0[09]|7)", "[2379]|8(?:0(?:02|9)|7)"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["69"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], "0", 0, "(1001)|0"], "LK": ["94", "00", "[1-9]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[1-689]"], "0$1"]], "0"], "LR": ["231", "00", "(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["4[67]|[56]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-578]"], "0$1"]], "0"], "LS": ["266", "00", "(?:[256]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2568]"]]]], "LT": ["370", "00", "(?:[3469]\\d|52|[78]0)\\d{6}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["52[0-7]"], "(0-$1)", 1], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0 $1", 1], ["(\\d{2})(\\d{6})", "$1 $2", ["37|4(?:[15]|6[1-8])"], "(0-$1)", 1], ["(\\d{3})(\\d{5})", "$1 $2", ["[3-6]"], "(0-$1)", 1]], "0", 0, "[08]"], "LU": ["352", "00", "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}", [4, 5, 6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{3})", "$1 $2", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["20[2-689]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4", ["2(?:[0367]|4[3-8])"]], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["80[01]|90[015]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["2(?:[0367]|4[3-8])"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]], 0, 0, "(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"], "LV": ["371", "00", "(?:[268]\\d|90)\\d{6}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[269]|8[01]"]]]], "LY": ["218", "00", "[2-9]\\d{8}", [9], [["(\\d{2})(\\d{7})", "$1-$2", ["[2-9]"], "0$1"]], "0"], "MA": ["212", "00", "[5-8]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5[45]"], "0$1"], ["(\\d{4})(\\d{5})", "$1-$2", ["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"], "0$1"], ["(\\d{2})(\\d{7})", "$1-$2", ["8"], "0$1"], ["(\\d{3})(\\d{6})", "$1-$2", ["[5-7]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"], ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"], ["80[0-7]\\d{6}"], ["89\\d{7}"], 0, 0, 0, 0, ["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]], "MC": ["377", "00", "(?:[3489]|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[389]"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["6"], "0$1"]], "0"], "MD": ["373", "00", "(?:[235-7]\\d|[89]0)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["22|3"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[25-7]"], "0$1"]], "0"], "ME": ["382", "00", "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], "0"], "MF": ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"], ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]], "MG": ["261", "00", "[23]\\d{8}", [9], [["(\\d{2})(\\d{2})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, "([24-9]\\d{6})$|0", "20$1"], "MH": ["692", "011", "329\\d{4}|(?:[256]\\d|45)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-6]"]]], "1"], "MK": ["389", "00", "[2-578]\\d{7}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2|34[47]|4(?:[37]7|5[47]|64)"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[347]"], "0$1"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[58]"], "0$1"]], "0"], "ML": ["223", "00", "[24-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-9]"]]]], "MM": ["95", "00", "1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}", [6, 7, 8, 9, 10], [["(\\d)(\\d{2})(\\d{3})", "$1 $2 $3", ["16|2"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]|452|678|86", "[12]|452|6788|86"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[4-7]|8[1-35]"], "0$1"], ["(\\d)(\\d{3})(\\d{4,6})", "$1 $2 $3", ["9(?:2[0-4]|[35-9]|4[137-9])"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["92"], "0$1"], ["(\\d)(\\d{5})(\\d{4})", "$1 $2 $3", ["9"], "0$1"]], "0"], "MN": ["976", "001", "[12]\\d{7,9}|[5-9]\\d{7}", [8, 9, 10], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[12]1"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[5-9]"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[12]2[1-3]"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["[12](?:27|3[2-8]|4[2-68]|5[1-4689])", "[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["[12]"], "0$1"]], "0"], "MO": ["853", "00", "0800\\d{3}|(?:28|[68]\\d)\\d{6}", [7, 8], [["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[268]"]]]], "MP": ["1", "011", "[58]\\d{9}|(?:67|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "670$1", 0, "670"], "MQ": ["596", "00", "596\\d{6}|(?:69|[89]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[569]|8(?:0[6-9]|[36])"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "MR": ["222", "00", "(?:[2-4]\\d\\d|800)\\d{5}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-48]"]]]], "MS": ["1", "011", "(?:[58]\\d\\d|664|900)\\d{7}", [10], 0, "1", 0, "([34]\\d{6})$|1", "664$1", 0, "664"], "MT": ["356", "00", "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2357-9]"]]]], "MU": ["230", "0(?:0|[24-7]0|3[03])", "(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46]|8[013]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[57]"]], ["(\\d{5})(\\d{5})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, 0, "020"], "MV": ["960", "0(?:0|19)", "(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}", [7, 10], [["(\\d{3})(\\d{4})", "$1-$2", ["[34679]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MW": ["265", "00", "(?:[1289]\\d|31|77)\\d{7}|1\\d{6}", [7, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["1[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[137-9]"], "0$1"]], "0"], "MX": ["52", "0[09]", "[2-9]\\d{9}", [10], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["33|5[56]|81"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MY": ["60", "00", "1\\d{8,9}|(?:3\\d|[4-9])\\d{7}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1-$2 $3", ["[4-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1-$2 $3", ["1(?:[02469]|[378][1-9]|53)|8", "1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2 $3", ["3"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3-$4", ["1(?:[367]|80)"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2 $3", ["15"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2 $3", ["1"], "0$1"]], "0"], "MZ": ["258", "00", "(?:2|8\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2|8[2-79]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "NA": ["264", "00", "[68]\\d{7,8}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["87"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "NC": ["687", "00", "(?:050|[2-57-9]\\d\\d)\\d{3}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1.$2.$3", ["[02-57-9]"]]]], "NE": ["227", "00", "[027-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["08"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[089]|2[013]|7[0467]"]]]], "NF": ["672", "00", "[13]\\d{5}", [6], [["(\\d{2})(\\d{4})", "$1 $2", ["1[0-3]"]], ["(\\d)(\\d{5})", "$1 $2", ["[13]"]]], 0, 0, "([0-258]\\d{4})$", "3$1"], "NG": ["234", "009", "38\\d{6}|[78]\\d{9,13}|(?:20|9\\d)\\d{8}", [8, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["3"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[7-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["20[129]"], "0$1"], ["(\\d{4})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{3})(\\d{5})(\\d{5,6})", "$1 $2 $3", ["[78]"], "0$1"]], "0"], "NI": ["505", "00", "(?:1800|[25-8]\\d{3})\\d{4}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[125-8]"]]]], "NL": ["31", "00", "(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}", [5, 6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{4,7})", "$1 $2", ["[89]0"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["66"], "0$1"], ["(\\d)(\\d{8})", "$1 $2", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-578]|91"], "0$1"], ["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3", ["9"], "0$1"]], "0"], "NO": ["47", "00", "(?:0|[2-9]\\d{3})\\d{4}", [5, 8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]"]]], 0, 0, 0, 0, 0, "[02-689]|7[0-8]"], "NP": ["977", "00", "(?:1\\d|9)\\d{9}|[1-9]\\d{7}", [8, 10, 11], [["(\\d)(\\d{7})", "$1-$2", ["1[2-6]"], "0$1"], ["(\\d{2})(\\d{6})", "$1-$2", ["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"], "0$1"], ["(\\d{3})(\\d{7})", "$1-$2", ["9"]]], "0"], "NR": ["674", "00", "(?:444|(?:55|8\\d)\\d|666)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-68]"]]]], "NU": ["683", "00", "(?:[4-7]|888\\d)\\d{3}", [4, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["8"]]]], "NZ": ["64", "0(?:0|161)", "[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,8})", "$1 $2", ["8[1-79]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["50[036-8]|8|90", "50(?:[0367]|88)|8|90"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["24|[346]|7[2-57-9]|9[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:10|74)|[589]"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1|2[028]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,5})", "$1 $2 $3", ["2(?:[169]|7[0-35-9])|7"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "00"], "OM": ["968", "00", "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", [7, 8, 9], [["(\\d{3})(\\d{4,6})", "$1 $2", ["[58]"]], ["(\\d{2})(\\d{6})", "$1 $2", ["2"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[179]"]]]], "PA": ["507", "00", "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", [7, 8, 10, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[1-57-9]"]], ["(\\d{4})(\\d{4})", "$1-$2", ["[68]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]]], "PE": ["51", "00|19(?:1[124]|77|90)00", "(?:[14-8]|9\\d)\\d{7}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["80"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["1"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[4-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"]]], "0", 0, 0, 0, 0, 0, 0, "00", " Anexo "], "PF": ["689", "00", "4\\d{5}(?:\\d{2})?|8\\d{7,8}", [6, 8, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["44"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4|8[7-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "PG": ["675", "00|140[1-3]", "(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["18|[2-69]|85"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[78]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "PH": ["63", "00", "(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}", [6, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{5})", "$1 $2", ["2"], "(0$1)"], ["(\\d{4})(\\d{4,6})", "$1 $2", ["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2", "3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"], "(0$1)"], ["(\\d{5})(\\d{4})", "$1 $2", ["346|4(?:27|9[35])|883", "3469|4(?:279|9(?:30|56))|8834"], "(0$1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|8[2-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["1"]]], "0"], "PK": ["92", "00", "122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,7})", "$1 $2 $3", ["[89]0"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["1"]], ["(\\d{3})(\\d{6,7})", "$1 $2", ["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])", "9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"], "(0$1)"], ["(\\d{2})(\\d{7,8})", "$1 $2", ["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"], "(0$1)"], ["(\\d{5})(\\d{5})", "$1 $2", ["58"], "(0$1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[24-9]"], "(0$1)"]], "0"], "PL": ["48", "00", "(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{5})", "$1", ["19"]], ["(\\d{3})(\\d{3})", "$1 $2", ["11|20|64"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1", "(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["64"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[2-8]|[2-7]|8[1-79]|9[145]"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["8"]]]], "PM": ["508", "00", "[45]\\d{5}|(?:708|8\\d\\d)\\d{6}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[45]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "PR": ["1", "011", "(?:[589]\\d\\d|787)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "787|939"], "PS": ["970", "00", "[2489]2\\d{6}|(?:1\\d|5)\\d{8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2489]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "PT": ["351", "00", "1693\\d{5}|(?:[26-9]\\d|30)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["2[12]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["16|[236-9]"]]]], "PW": ["680", "01[12]", "(?:[24-8]\\d\\d|345|900)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "PY": ["595", "00", "59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3,6})", "$1 $2", ["[2-9]0"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"], "(0$1)"], ["(\\d{3})(\\d{4,5})", "$1 $2", ["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["87"]], ["(\\d{3})(\\d{6})", "$1 $2", ["9(?:[5-79]|8[1-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"]]], "0"], "QA": ["974", "00", "800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}", [7, 8, 9, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["2[16]|8"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[3-7]"]]]], "RE": ["262", "00", "(?:26|[689]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2689]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"], ["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))\\d{4}"], ["80\\d{7}"], ["89[1-37-9]\\d{6}"], 0, 0, 0, 0, ["9(?:399[0-3]|479[0-5]|76(?:2[278]|3[0-37]))\\d{4}"], ["8(?:1[019]|2[0156]|84|90)\\d{6}"]]], "RO": ["40", "00", "(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}", [6, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["2[3-6]", "2[3-6]\\d9"], "0$1"], ["(\\d{2})(\\d{4})", "$1 $2", ["219|31"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23]1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[236-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, " int "], "RS": ["381", "00", "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}", [6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{3,9})", "$1 $2", ["(?:2[389]|39)0|[7-9]"], "0$1"], ["(\\d{2})(\\d{5,10})", "$1 $2", ["[1-36]"], "0$1"]], "0"], "RU": ["7", "810", "8\\d{13}|[347-9]\\d{9}", [10, 14], [["(\\d{4})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-8]|2[1-9])", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"], "8 ($1)", 1], ["(\\d{5})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-68]|2[1-9])", "7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))", "7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[349]|8(?:[02-7]|1[1-8])"], "8 ($1)", 1], ["(\\d{4})(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["8"], "8 ($1)"]], "8", 0, 0, 0, 0, "3[04-689]|[489]", 0, "8~10"], "RW": ["250", "00", "(?:06|[27]\\d\\d|[89]00)\\d{6}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0$1"]], "0"], "SA": ["966", "00", "92\\d{7}|(?:[15]|8\\d)\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["9"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["81"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], "0"], "SB": ["677", "0[01]", "[6-9]\\d{6}|[1-6]\\d{4}", [5, 7], [["(\\d{2})(\\d{5})", "$1 $2", ["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]], "SC": ["248", "010|0[0-2]", "(?:[2489]\\d|64)\\d{5}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[246]|9[57]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "SD": ["249", "00", "[19]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "SE": ["46", "00", "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}", [6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["20"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{4})", "$1-$2", ["9(?:00|39|44|9)"], "0$1", 0, "$1 $2"], ["(\\d{2})(\\d{3})(\\d{2})", "$1-$2 $3", ["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3"], ["(\\d)(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{2,3})(\\d{3})", "$1-$2 $3", ["9(?:00|39|44)"], "0$1", 0, "$1 $2 $3"], ["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["10|7"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{3})", "$1-$2 $3 $4", ["9"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4 $5", ["[26]"], "0$1", 0, "$1 $2 $3 $4 $5"]], "0"], "SG": ["65", "0[0-3]\\d", "(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{4})(\\d{4})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "SH": ["290", "00", "(?:[256]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[256]"], "SI": ["386", "00|10(?:22|66|88|99)", "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}", [5, 6, 7, 8], [["(\\d{2})(\\d{3,6})", "$1 $2", ["8[09]|9"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["59|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37][01]|4[0139]|51|6"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-57]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, 0, "00"], "SJ": ["47", "00", "0\\d{4}|(?:[489]\\d|79)\\d{6}", [5, 8], 0, 0, 0, 0, 0, 0, "79"], "SK": ["421", "00", "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}", [6, 7, 9], [["(\\d)(\\d{2})(\\d{3,4})", "$1 $2 $3", ["21"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["[3-5][1-8]1", "[3-5][1-8]1[67]"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1/$2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[689]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1/$2 $3 $4", ["[3-5]"], "0$1"]], "0"], "SL": ["232", "00", "(?:[237-9]\\d|66)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[236-9]"], "(0$1)"]], "0"], "SM": ["378", "00", "(?:0549|[5-7]\\d)\\d{6}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]"]], ["(\\d{4})(\\d{6})", "$1 $2", ["0"]]], 0, 0, "([89]\\d{5})$", "0549$1"], "SN": ["221", "00", "(?:[378]\\d|93)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[379]"]]]], "SO": ["252", "00", "[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}", [6, 7, 8, 9], [["(\\d{2})(\\d{4})", "$1 $2", ["8[125]"]], ["(\\d{6})", "$1", ["[134]"]], ["(\\d)(\\d{6})", "$1 $2", ["[15]|2[0-79]|3[0-46-8]|4[0-7]"]], ["(\\d)(\\d{7})", "$1 $2", ["(?:2|90)4|[67]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[348]|64|79|90"]], ["(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|6[0-35-9]|77|9[2-9]"]]], "0"], "SR": ["597", "00", "(?:[2-5]|68|[78]\\d)\\d{5}", [6, 7], [["(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], ["(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], ["(\\d{3})(\\d{4})", "$1-$2", ["[6-8]"]]]], "SS": ["211", "00", "[19]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "ST": ["239", "00", "(?:22|9\\d)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]]], "SV": ["503", "00", "[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", [7, 8, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[89]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[267]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[89]"]]]], "SX": ["1", "011", "7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "(5\\d{6})$|1", "721$1", 0, "721"], "SY": ["963", "00", "[1-39]\\d{8}|[1-5]\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-5]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1", 1]], "0"], "SZ": ["268", "00", "0800\\d{4}|(?:[237]\\d|900)\\d{6}", [8, 9], [["(\\d{4})(\\d{4})", "$1 $2", ["[0237]"]], ["(\\d{5})(\\d{4})", "$1 $2", ["9"]]]], "TA": ["290", "00", "8\\d{3}", [4], 0, 0, 0, 0, 0, 0, "8"], "TC": ["1", "011", "(?:[58]\\d\\d|649|900)\\d{7}", [10], 0, "1", 0, "([2-479]\\d{6})$|1", "649$1", 0, "649"], "TD": ["235", "00|16", "(?:22|[689]\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "TG": ["228", "00", "[279]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[279]"]]]], "TH": ["66", "00[1-9]", "(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}", [8, 9, 10, 13], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[13-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "TJ": ["992", "810", "[0-57-9]\\d{8}", [9], [["(\\d{6})(\\d)(\\d{2})", "$1 $2 $3", ["331", "3317"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["44[02-479]|[34]7"]], ["(\\d{4})(\\d)(\\d{4})", "$1 $2 $3", ["3(?:[1245]|3[12])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[0-57-9]"]]], 0, 0, 0, 0, 0, 0, 0, "8~10"], "TK": ["690", "00", "[2-47]\\d{3,6}", [4, 5, 6, 7]], "TL": ["670", "00", "7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-489]|70"]], ["(\\d{4})(\\d{4})", "$1 $2", ["7"]]]], "TM": ["993", "810", "(?:[1-6]\\d|71)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["12"], "(8 $1)"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-5]"], "(8 $1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[67]"], "8 $1"]], "8", 0, 0, 0, 0, 0, 0, "8~10"], "TN": ["216", "00", "[2-57-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-57-9]"]]]], "TO": ["676", "00", "(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}", [5, 7], [["(\\d{2})(\\d{3})", "$1-$2", ["[2-4]|50|6[09]|7[0-24-69]|8[05]"]], ["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[5-9]"]]]], "TR": ["90", "00", "4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}", [7, 10, 12, 13], [["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["512|8[01589]|90"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5(?:[0-59]|61)", "5(?:[0-59]|61[06])", "5(?:[0-59]|61[06]1)"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24][1-8]|3[1-9]"], "(0$1)", 1], ["(\\d{3})(\\d{3})(\\d{6,7})", "$1 $2 $3", ["80"], "0$1", 1]], "0"], "TT": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-46-8]\\d{6})$|1", "868$1", 0, "868"], "TV": ["688", "00", "(?:2|7\\d\\d|90)\\d{4}", [5, 6, 7], [["(\\d{2})(\\d{3})", "$1 $2", ["2"]], ["(\\d{2})(\\d{4})", "$1 $2", ["90"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "TW": ["886", "0(?:0[25-79]|19)", "[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}", [7, 8, 9, 10, 11], [["(\\d{2})(\\d)(\\d{4})", "$1 $2 $3", ["202"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[258]0"], "0$1"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]", "[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, "#"], "TZ": ["255", "00[056]", "(?:[25-8]\\d|41|90)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[24]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["5"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[67]"], "0$1"]], "0"], "UA": ["380", "00", "[89]\\d{9}|[3-9]\\d{8}", [9, 10], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]", "6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])", "3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|89|9[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "0~0"], "UG": ["256", "00[057]", "800\\d{6}|(?:[29]0|[347]\\d)\\d{7}", [9], [["(\\d{4})(\\d{5})", "$1 $2", ["202", "2024"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[27-9]|4(?:6[45]|[7-9])"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[34]"], "0$1"]], "0"], "US": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [10], [["(\\d{3})(\\d{4})", "$1-$2", ["310"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], 0, 1, "$1-$2-$3"]], "1", 0, 0, 0, 0, 0, [["(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468])|7302[0-4]\\d)\\d{4}|(?:305[3-9]|472[24]|505[2-57-9]|7306|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013569]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"], [""], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"], ["900[2-9]\\d{6}"], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"], 0, 0, 0, ["305209\\d{4}"]]], "UY": ["598", "0(?:0|1[3-9]\\d)", "0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}", [6, 7, 8, 9, 10, 11, 12, 13], [["(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], ["(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], "0", 0, 0, 0, 0, 0, 0, "00", " int. "], "UZ": ["998", "00", "(?:20|33|[5-79]\\d|88)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]]], "VA": ["39", "00", "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", [6, 7, 8, 9, 10, 11, 12], 0, 0, 0, 0, 0, 0, "06698"], "VC": ["1", "011", "(?:[58]\\d\\d|784|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "784$1", 0, "784"], "VE": ["58", "00", "[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}", [10], [["(\\d{3})(\\d{7})", "$1-$2", ["[24-689]"], "0$1"]], "0"], "VG": ["1", "011", "(?:284|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-578]\\d{6})$|1", "284$1", 0, "284"], "VI": ["1", "011", "[58]\\d{9}|(?:34|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "340$1", 0, "340"], "VN": ["84", "00", "[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["80"], "0$1", 1], ["(\\d{4})(\\d{4,6})", "$1 $2", ["1"], 0, 1], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["6"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[357-9]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["2[48]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["2"], "0$1", 1]], "0"], "VU": ["678", "00", "[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}", [5, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["[57-9]"]]]], "WF": ["681", "00", "(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[47-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "WS": ["685", "0", "(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}", [5, 6, 7, 10], [["(\\d{5})", "$1", ["[2-5]|6[1-9]"]], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[68]"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "XK": ["383", "00", "2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2|39"], "0$1"], ["(\\d{2})(\\d{7,10})", "$1 $2", ["3"], "0$1"]], "0"], "YE": ["967", "00", "(?:1|7\\d)\\d{7}|[1-7]\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-6]|7(?:[24-6]|8[0-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"], "0$1"]], "0"], "YT": ["262", "00", "(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}", [9], 0, "0", 0, 0, 0, 0, 0, [["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"], ["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"], ["80\\d{7}"], 0, 0, 0, 0, 0, ["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]], "ZA": ["27", "00", "[1-79]\\d{8}|8\\d{4,9}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,4})", "$1 $2", ["8[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["8[1-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["860"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "ZM": ["260", "00", "800\\d{6}|(?:21|63|[79]\\d)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[28]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[79]"], "0$1"]], "0"], "ZW": ["263", "00", "2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}", [5, 6, 7, 8, 9, 10], [["(\\d{3})(\\d{3,5})", "$1 $2", ["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"], "0$1"], ["(\\d)(\\d{3})(\\d{2,4})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2", "2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)", "2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["29[013-9]|39|54"], "0$1"], ["(\\d{4})(\\d{3,5})", "$1 $2", ["(?:25|54)8", "258|5483"], "0$1"]], "0"] }, "nonGeographic": { "800": ["800", 0, "(?:00|[1-9]\\d)\\d{6}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["\\d"]]], 0, 0, 0, 0, 0, 0, [0, 0, ["(?:00|[1-9]\\d)\\d{6}"]]], "808": ["808", 0, "[1-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[1-9]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, ["[1-9]\\d{7}"]]], "870": ["870", 0, "7\\d{11}|[35-7]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[35-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]], "878": ["878", 0, "10\\d{10}", [12], [["(\\d{2})(\\d{5})(\\d{5})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["10\\d{10}"]]], "881": ["881", 0, "6\\d{9}|[0-36-9]\\d{8}", [9, 10], [["(\\d)(\\d{3})(\\d{5})", "$1 $2 $3", ["[0-37-9]"]], ["(\\d)(\\d{3})(\\d{5,6})", "$1 $2 $3", ["6"]]], 0, 0, 0, 0, 0, 0, [0, ["6\\d{9}|[0-36-9]\\d{8}"]]], "882": ["882", 0, "[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5})", "$1 $2", ["16|342"]], ["(\\d{2})(\\d{6})", "$1 $2", ["49"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["1[36]|9"]], ["(\\d{2})(\\d{4})(\\d{3})", "$1 $2 $3", ["3[23]"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["16"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|23|3(?:[15]|4[57])|4|51"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["34"]], ["(\\d{2})(\\d{4,5})(\\d{5})", "$1 $2 $3", ["[1-35]"]]], 0, 0, 0, 0, 0, 0, [0, ["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}", [7, 8, 9, 10, 12]], 0, 0, 0, ["348[57]\\d{7}", [11]], 0, 0, ["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]], "883": ["883", 0, "(?:[1-4]\\d|51)\\d{6,10}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,8})", "$1 $2 $3", ["[14]|2[24-689]|3[02-689]|51[24-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["510"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["21"]], ["(\\d{4})(\\d{4})(\\d{4})", "$1 $2 $3", ["51[13]"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[235]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]], "888": ["888", 0, "\\d{11}", [11], [["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, ["\\d{11}"]]], "979": ["979", 0, "[1359]\\d{8}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, ["[1359]\\d{8}"]]] } };
- function withMetadataArgument$1(func, _arguments) {
- var args = Array.prototype.slice.call(_arguments);
- args.push(metadata$1);
- return func.apply(this, args);
- }
- function _typeof$1(obj) {
- "@babel/helpers - typeof";
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
- return typeof obj2;
- } : function(obj2) {
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
- }, _typeof$1(obj);
- }
- function _defineProperties$8(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$8(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$8(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$8(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- function _classCallCheck$8(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function");
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
- Object.defineProperty(subClass, "prototype", { writable: false });
- if (superClass)
- _setPrototypeOf(subClass, superClass);
- }
- function _createSuper(Derived) {
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
- return function _createSuperInternal() {
- var Super = _getPrototypeOf(Derived), result2;
- if (hasNativeReflectConstruct) {
- var NewTarget = _getPrototypeOf(this).constructor;
- result2 = Reflect.construct(Super, arguments, NewTarget);
- } else {
- result2 = Super.apply(this, arguments);
- }
- return _possibleConstructorReturn(this, result2);
- };
- }
- function _possibleConstructorReturn(self2, call) {
- if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
- return call;
- } else if (call !== void 0) {
- throw new TypeError("Derived constructors may only return object or undefined");
- }
- return _assertThisInitialized(self2);
- }
- function _assertThisInitialized(self2) {
- if (self2 === void 0) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return self2;
- }
- function _wrapNativeSuper(Class) {
- var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
- _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
- if (Class2 === null || !_isNativeFunction(Class2))
- return Class2;
- if (typeof Class2 !== "function") {
- throw new TypeError("Super expression must either be null or a function");
- }
- if (typeof _cache !== "undefined") {
- if (_cache.has(Class2))
- return _cache.get(Class2);
- _cache.set(Class2, Wrapper);
- }
- function Wrapper() {
- return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
- }
- Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
- return _setPrototypeOf(Wrapper, Class2);
- };
- return _wrapNativeSuper(Class);
- }
- function _construct(Parent, args, Class) {
- if (_isNativeReflectConstruct()) {
- _construct = Reflect.construct;
- } else {
- _construct = function _construct2(Parent2, args2, Class2) {
- var a2 = [null];
- a2.push.apply(a2, args2);
- var Constructor = Function.bind.apply(Parent2, a2);
- var instance = new Constructor();
- if (Class2)
- _setPrototypeOf(instance, Class2.prototype);
- return instance;
- };
- }
- return _construct.apply(null, arguments);
- }
- function _isNativeReflectConstruct() {
- if (typeof Reflect === "undefined" || !Reflect.construct)
- return false;
- if (Reflect.construct.sham)
- return false;
- if (typeof Proxy === "function")
- return true;
- try {
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
- }));
- return true;
- } catch (e2) {
- return false;
- }
- }
- function _isNativeFunction(fn) {
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
- }
- function _setPrototypeOf(o2, p2) {
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
- o3.__proto__ = p3;
- return o3;
- };
- return _setPrototypeOf(o2, p2);
- }
- function _getPrototypeOf(o2) {
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
- return o3.__proto__ || Object.getPrototypeOf(o3);
- };
- return _getPrototypeOf(o2);
- }
- var ParseError = /* @__PURE__ */ function(_Error) {
- _inherits(ParseError2, _Error);
- var _super = _createSuper(ParseError2);
- function ParseError2(code2) {
- var _this;
- _classCallCheck$8(this, ParseError2);
- _this = _super.call(this, code2);
- Object.setPrototypeOf(_assertThisInitialized(_this), ParseError2.prototype);
- _this.name = _this.constructor.name;
- return _this;
- }
- return _createClass$8(ParseError2);
- }(/* @__PURE__ */ _wrapNativeSuper(Error));
- var MIN_LENGTH_FOR_NSN = 2;
- var MAX_LENGTH_FOR_NSN = 17;
- var MAX_LENGTH_COUNTRY_CODE = 3;
- var VALID_DIGITS = "0-90-9٠-٩۰-۹";
- var DASHES = "-‐-―−ー-";
- var SLASHES = "//";
- var DOTS = "..";
- var WHITESPACE = " ";
- var BRACKETS = "()()[]\\[\\]";
- var TILDES = "~⁓∼~";
- var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
- var PLUS_CHARS = "++";
- function compare(a2, b2) {
- a2 = a2.split("-");
- b2 = b2.split("-");
- var pa = a2[0].split(".");
- var pb = b2[0].split(".");
- for (var i2 = 0; i2 < 3; i2++) {
- var na = Number(pa[i2]);
- var nb = Number(pb[i2]);
- if (na > nb)
- return 1;
- if (nb > na)
- return -1;
- if (!isNaN(na) && isNaN(nb))
- return 1;
- if (isNaN(na) && !isNaN(nb))
- return -1;
- }
- if (a2[1] && b2[1]) {
- return a2[1] > b2[1] ? 1 : a2[1] < b2[1] ? -1 : 0;
- }
- return !a2[1] && b2[1] ? 1 : a2[1] && !b2[1] ? -1 : 0;
- }
- var objectConstructor = {}.constructor;
- function isObject$2(object2) {
- return object2 !== void 0 && object2 !== null && object2.constructor === objectConstructor;
- }
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
- return typeof obj2;
- } : function(obj2) {
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
- }, _typeof(obj);
- }
- function _classCallCheck$7(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties$7(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$7(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$7(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$7(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var V3 = "1.2.0";
- var V4 = "1.7.35";
- var DEFAULT_EXT_PREFIX = " ext. ";
- var CALLING_CODE_REG_EXP = /^\d+$/;
- var Metadata = /* @__PURE__ */ function() {
- function Metadata2(metadata2) {
- _classCallCheck$7(this, Metadata2);
- validateMetadata(metadata2);
- this.metadata = metadata2;
- setVersion.call(this, metadata2);
- }
- _createClass$7(Metadata2, [{
- key: "getCountries",
- value: function getCountries() {
- return Object.keys(this.metadata.countries).filter(function(_2) {
- return _2 !== "001";
- });
- }
- }, {
- key: "getCountryMetadata",
- value: function getCountryMetadata(countryCode) {
- return this.metadata.countries[countryCode];
- }
- }, {
- key: "nonGeographic",
- value: function nonGeographic() {
- if (this.v1 || this.v2 || this.v3)
- return;
- return this.metadata.nonGeographic || this.metadata.nonGeographical;
- }
- }, {
- key: "hasCountry",
- value: function hasCountry(country) {
- return this.getCountryMetadata(country) !== void 0;
- }
- }, {
- key: "hasCallingCode",
- value: function hasCallingCode(callingCode) {
- if (this.getCountryCodesForCallingCode(callingCode)) {
- return true;
- }
- if (this.nonGeographic()) {
- if (this.nonGeographic()[callingCode]) {
- return true;
- }
- } else {
- var countryCodes = this.countryCallingCodes()[callingCode];
- if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
- return true;
- }
- }
- }
- }, {
- key: "isNonGeographicCallingCode",
- value: function isNonGeographicCallingCode(callingCode) {
- if (this.nonGeographic()) {
- return this.nonGeographic()[callingCode] ? true : false;
- } else {
- return this.getCountryCodesForCallingCode(callingCode) ? false : true;
- }
- }
- // Deprecated.
- }, {
- key: "country",
- value: function country(countryCode) {
- return this.selectNumberingPlan(countryCode);
- }
- }, {
- key: "selectNumberingPlan",
- value: function selectNumberingPlan(countryCode, callingCode) {
- if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {
- callingCode = countryCode;
- countryCode = null;
- }
- if (countryCode && countryCode !== "001") {
- if (!this.hasCountry(countryCode)) {
- throw new Error("Unknown country: ".concat(countryCode));
- }
- this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);
- } else if (callingCode) {
- if (!this.hasCallingCode(callingCode)) {
- throw new Error("Unknown calling code: ".concat(callingCode));
- }
- this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);
- } else {
- this.numberingPlan = void 0;
- }
- return this;
- }
- }, {
- key: "getCountryCodesForCallingCode",
- value: function getCountryCodesForCallingCode(callingCode) {
- var countryCodes = this.countryCallingCodes()[callingCode];
- if (countryCodes) {
- if (countryCodes.length === 1 && countryCodes[0].length === 3) {
- return;
- }
- return countryCodes;
- }
- }
- }, {
- key: "getCountryCodeForCallingCode",
- value: function getCountryCodeForCallingCode(callingCode) {
- var countryCodes = this.getCountryCodesForCallingCode(callingCode);
- if (countryCodes) {
- return countryCodes[0];
- }
- }
- }, {
- key: "getNumberingPlanMetadata",
- value: function getNumberingPlanMetadata(callingCode) {
- var countryCode = this.getCountryCodeForCallingCode(callingCode);
- if (countryCode) {
- return this.getCountryMetadata(countryCode);
- }
- if (this.nonGeographic()) {
- var metadata2 = this.nonGeographic()[callingCode];
- if (metadata2) {
- return metadata2;
- }
- } else {
- var countryCodes = this.countryCallingCodes()[callingCode];
- if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
- return this.metadata.countries["001"];
- }
- }
- }
- // Deprecated.
- }, {
- key: "countryCallingCode",
- value: function countryCallingCode() {
- return this.numberingPlan.callingCode();
- }
- // Deprecated.
- }, {
- key: "IDDPrefix",
- value: function IDDPrefix() {
- return this.numberingPlan.IDDPrefix();
- }
- // Deprecated.
- }, {
- key: "defaultIDDPrefix",
- value: function defaultIDDPrefix() {
- return this.numberingPlan.defaultIDDPrefix();
- }
- // Deprecated.
- }, {
- key: "nationalNumberPattern",
- value: function nationalNumberPattern() {
- return this.numberingPlan.nationalNumberPattern();
- }
- // Deprecated.
- }, {
- key: "possibleLengths",
- value: function possibleLengths() {
- return this.numberingPlan.possibleLengths();
- }
- // Deprecated.
- }, {
- key: "formats",
- value: function formats() {
- return this.numberingPlan.formats();
- }
- // Deprecated.
- }, {
- key: "nationalPrefixForParsing",
- value: function nationalPrefixForParsing() {
- return this.numberingPlan.nationalPrefixForParsing();
- }
- // Deprecated.
- }, {
- key: "nationalPrefixTransformRule",
- value: function nationalPrefixTransformRule() {
- return this.numberingPlan.nationalPrefixTransformRule();
- }
- // Deprecated.
- }, {
- key: "leadingDigits",
- value: function leadingDigits() {
- return this.numberingPlan.leadingDigits();
- }
- // Deprecated.
- }, {
- key: "hasTypes",
- value: function hasTypes() {
- return this.numberingPlan.hasTypes();
- }
- // Deprecated.
- }, {
- key: "type",
- value: function type(_type) {
- return this.numberingPlan.type(_type);
- }
- // Deprecated.
- }, {
- key: "ext",
- value: function ext() {
- return this.numberingPlan.ext();
- }
- }, {
- key: "countryCallingCodes",
- value: function countryCallingCodes() {
- if (this.v1)
- return this.metadata.country_phone_code_to_countries;
- return this.metadata.country_calling_codes;
- }
- // Deprecated.
- }, {
- key: "chooseCountryByCountryCallingCode",
- value: function chooseCountryByCountryCallingCode(callingCode) {
- return this.selectNumberingPlan(callingCode);
- }
- }, {
- key: "hasSelectedNumberingPlan",
- value: function hasSelectedNumberingPlan() {
- return this.numberingPlan !== void 0;
- }
- }]);
- return Metadata2;
- }();
- var NumberingPlan = /* @__PURE__ */ function() {
- function NumberingPlan2(metadata2, globalMetadataObject) {
- _classCallCheck$7(this, NumberingPlan2);
- this.globalMetadataObject = globalMetadataObject;
- this.metadata = metadata2;
- setVersion.call(this, globalMetadataObject.metadata);
- }
- _createClass$7(NumberingPlan2, [{
- key: "callingCode",
- value: function callingCode() {
- return this.metadata[0];
- }
- // Formatting information for regions which share
- // a country calling code is contained by only one region
- // for performance reasons. For example, for NANPA region
- // ("North American Numbering Plan Administration",
- // which includes USA, Canada, Cayman Islands, Bahamas, etc)
- // it will be contained in the metadata for `US`.
- }, {
- key: "getDefaultCountryMetadataForRegion",
- value: function getDefaultCountryMetadataForRegion() {
- return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
- }
- // Is always present.
- }, {
- key: "IDDPrefix",
- value: function IDDPrefix() {
- if (this.v1 || this.v2)
- return;
- return this.metadata[1];
- }
- // Is only present when a country supports multiple IDD prefixes.
- }, {
- key: "defaultIDDPrefix",
- value: function defaultIDDPrefix() {
- if (this.v1 || this.v2)
- return;
- return this.metadata[12];
- }
- }, {
- key: "nationalNumberPattern",
- value: function nationalNumberPattern() {
- if (this.v1 || this.v2)
- return this.metadata[1];
- return this.metadata[2];
- }
- // "possible length" data is always present in Google's metadata.
- }, {
- key: "possibleLengths",
- value: function possibleLengths() {
- if (this.v1)
- return;
- return this.metadata[this.v2 ? 2 : 3];
- }
- }, {
- key: "_getFormats",
- value: function _getFormats(metadata2) {
- return metadata2[this.v1 ? 2 : this.v2 ? 3 : 4];
- }
- // For countries of the same region (e.g. NANPA)
- // formats are all stored in the "main" country for that region.
- // E.g. "RU" and "KZ", "US" and "CA".
- }, {
- key: "formats",
- value: function formats() {
- var _this = this;
- var formats2 = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];
- return formats2.map(function(_2) {
- return new Format(_2, _this);
- });
- }
- }, {
- key: "nationalPrefix",
- value: function nationalPrefix() {
- return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
- }
- }, {
- key: "_getNationalPrefixFormattingRule",
- value: function _getNationalPrefixFormattingRule(metadata2) {
- return metadata2[this.v1 ? 4 : this.v2 ? 5 : 6];
- }
- // For countries of the same region (e.g. NANPA)
- // national prefix formatting rule is stored in the "main" country for that region.
- // E.g. "RU" and "KZ", "US" and "CA".
- }, {
- key: "nationalPrefixFormattingRule",
- value: function nationalPrefixFormattingRule() {
- return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());
- }
- }, {
- key: "_nationalPrefixForParsing",
- value: function _nationalPrefixForParsing() {
- return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
- }
- }, {
- key: "nationalPrefixForParsing",
- value: function nationalPrefixForParsing() {
- return this._nationalPrefixForParsing() || this.nationalPrefix();
- }
- }, {
- key: "nationalPrefixTransformRule",
- value: function nationalPrefixTransformRule() {
- return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
- }
- }, {
- key: "_getNationalPrefixIsOptionalWhenFormatting",
- value: function _getNationalPrefixIsOptionalWhenFormatting() {
- return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
- }
- // For countries of the same region (e.g. NANPA)
- // "national prefix is optional when formatting" flag is
- // stored in the "main" country for that region.
- // E.g. "RU" and "KZ", "US" and "CA".
- }, {
- key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
- value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
- return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());
- }
- }, {
- key: "leadingDigits",
- value: function leadingDigits() {
- return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
- }
- }, {
- key: "types",
- value: function types2() {
- return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
- }
- }, {
- key: "hasTypes",
- value: function hasTypes() {
- if (this.types() && this.types().length === 0) {
- return false;
- }
- return !!this.types();
- }
- }, {
- key: "type",
- value: function type(_type2) {
- if (this.hasTypes() && getType(this.types(), _type2)) {
- return new Type(getType(this.types(), _type2), this);
- }
- }
- }, {
- key: "ext",
- value: function ext() {
- if (this.v1 || this.v2)
- return DEFAULT_EXT_PREFIX;
- return this.metadata[13] || DEFAULT_EXT_PREFIX;
- }
- }]);
- return NumberingPlan2;
- }();
- var Format = /* @__PURE__ */ function() {
- function Format2(format2, metadata2) {
- _classCallCheck$7(this, Format2);
- this._format = format2;
- this.metadata = metadata2;
- }
- _createClass$7(Format2, [{
- key: "pattern",
- value: function pattern2() {
- return this._format[0];
- }
- }, {
- key: "format",
- value: function format2() {
- return this._format[1];
- }
- }, {
- key: "leadingDigitsPatterns",
- value: function leadingDigitsPatterns() {
- return this._format[2] || [];
- }
- }, {
- key: "nationalPrefixFormattingRule",
- value: function nationalPrefixFormattingRule() {
- return this._format[3] || this.metadata.nationalPrefixFormattingRule();
- }
- }, {
- key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
- value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
- return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
- }
- }, {
- key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
- value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
- return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
- }
- // Checks whether national prefix formatting rule contains national prefix.
- }, {
- key: "usesNationalPrefix",
- value: function usesNationalPrefix() {
- return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
- !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) ? true : false;
- }
- }, {
- key: "internationalFormat",
- value: function internationalFormat() {
- return this._format[5] || this.format();
- }
- }]);
- return Format2;
- }();
- var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
- var Type = /* @__PURE__ */ function() {
- function Type2(type, metadata2) {
- _classCallCheck$7(this, Type2);
- this.type = type;
- this.metadata = metadata2;
- }
- _createClass$7(Type2, [{
- key: "pattern",
- value: function pattern2() {
- if (this.metadata.v1)
- return this.type;
- return this.type[0];
- }
- }, {
- key: "possibleLengths",
- value: function possibleLengths() {
- if (this.metadata.v1)
- return;
- return this.type[1] || this.metadata.possibleLengths();
- }
- }]);
- return Type2;
- }();
- function getType(types2, type) {
- switch (type) {
- case "FIXED_LINE":
- return types2[0];
- case "MOBILE":
- return types2[1];
- case "TOLL_FREE":
- return types2[2];
- case "PREMIUM_RATE":
- return types2[3];
- case "PERSONAL_NUMBER":
- return types2[4];
- case "VOICEMAIL":
- return types2[5];
- case "UAN":
- return types2[6];
- case "PAGER":
- return types2[7];
- case "VOIP":
- return types2[8];
- case "SHARED_COST":
- return types2[9];
- }
- }
- function validateMetadata(metadata2) {
- if (!metadata2) {
- throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
- }
- if (!isObject$2(metadata2) || !isObject$2(metadata2.countries)) {
- throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(isObject$2(metadata2) ? "an object of shape: { " + Object.keys(metadata2).join(", ") + " }" : "a " + typeOf(metadata2) + ": " + metadata2, "."));
- }
- }
- var typeOf = function typeOf2(_2) {
- return _typeof(_2);
- };
- function getCountryCallingCode(country, metadata2) {
- metadata2 = new Metadata(metadata2);
- if (metadata2.hasCountry(country)) {
- return metadata2.country(country).countryCallingCode();
- }
- throw new Error("Unknown country: ".concat(country));
- }
- function isSupportedCountry(country, metadata2) {
- return metadata2.countries.hasOwnProperty(country);
- }
- function setVersion(metadata2) {
- var version = metadata2.version;
- if (typeof version === "number") {
- this.v1 = version === 1;
- this.v2 = version === 2;
- this.v3 = version === 3;
- this.v4 = version === 4;
- } else {
- if (!version) {
- this.v1 = true;
- } else if (compare(version, V3) === -1) {
- this.v2 = true;
- } else if (compare(version, V4) === -1) {
- this.v3 = true;
- } else {
- this.v4 = true;
- }
- }
- }
- var RFC3966_EXTN_PREFIX = ";ext=";
- var getExtensionDigitsPattern = function getExtensionDigitsPattern2(maxLength) {
- return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
- };
- function createExtensionPattern(purpose) {
- var extLimitAfterExplicitLabel = "20";
- var extLimitAfterLikelyLabel = "15";
- var extLimitAfterAmbiguousChar = "9";
- var extLimitWhenNotSure = "6";
- var possibleSeparatorsBetweenNumberAndExtLabel = "[ \\t,]*";
- var possibleCharsAfterExtLabel = "[:\\..]?[ \\t,-]*";
- var optionalExtnSuffix = "#?";
- var explicitExtLabels = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)";
- var ambiguousExtLabels = "(?:[xx##~~]|int|int)";
- var ambiguousSeparator = "[- ]+";
- var possibleSeparatorsNumberExtLabelNoComma = "[ \\t]*";
- var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
- var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
- var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
- var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
- var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
- var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
- var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
- return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
- }
- var MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" + VALID_DIGITS + "]{" + MIN_LENGTH_FOR_NSN + "}";
- var VALID_PHONE_NUMBER = "[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){3,}[" + VALID_PUNCTUATION + VALID_DIGITS + "]*";
- var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp("^[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){1,2}$", "i");
- var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions
- "(?:" + createExtensionPattern() + ")?";
- var VALID_PHONE_NUMBER_PATTERN = new RegExp(
- // Either a short two-digit-only phone number
- "^" + MIN_LENGTH_PHONE_NUMBER_PATTERN + "$|^" + VALID_PHONE_NUMBER_WITH_EXTENSION + "$",
- "i"
- );
- function isViablePhoneNumber(number2) {
- return number2.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number2);
- }
- function isViablePhoneNumberStart(number2) {
- return VALID_PHONE_NUMBER_START_REG_EXP.test(number2);
- }
- var EXTN_PATTERN = new RegExp("(?:" + createExtensionPattern() + ")$", "i");
- function extractExtension(number2) {
- var start = number2.search(EXTN_PATTERN);
- if (start < 0) {
- return {};
- }
- var numberWithoutExtension = number2.slice(0, start);
- var matches = number2.match(EXTN_PATTERN);
- var i2 = 1;
- while (i2 < matches.length) {
- if (matches[i2]) {
- return {
- number: numberWithoutExtension,
- ext: matches[i2]
- };
- }
- i2++;
- }
- }
- function _createForOfIteratorHelperLoose$8(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$b(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$b(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$b(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$b(o2, minLen);
- }
- function _arrayLikeToArray$b(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- var DIGITS = {
- "0": "0",
- "1": "1",
- "2": "2",
- "3": "3",
- "4": "4",
- "5": "5",
- "6": "6",
- "7": "7",
- "8": "8",
- "9": "9",
- "0": "0",
- // Fullwidth digit 0
- "1": "1",
- // Fullwidth digit 1
- "2": "2",
- // Fullwidth digit 2
- "3": "3",
- // Fullwidth digit 3
- "4": "4",
- // Fullwidth digit 4
- "5": "5",
- // Fullwidth digit 5
- "6": "6",
- // Fullwidth digit 6
- "7": "7",
- // Fullwidth digit 7
- "8": "8",
- // Fullwidth digit 8
- "9": "9",
- // Fullwidth digit 9
- "٠": "0",
- // Arabic-indic digit 0
- "١": "1",
- // Arabic-indic digit 1
- "٢": "2",
- // Arabic-indic digit 2
- "٣": "3",
- // Arabic-indic digit 3
- "٤": "4",
- // Arabic-indic digit 4
- "٥": "5",
- // Arabic-indic digit 5
- "٦": "6",
- // Arabic-indic digit 6
- "٧": "7",
- // Arabic-indic digit 7
- "٨": "8",
- // Arabic-indic digit 8
- "٩": "9",
- // Arabic-indic digit 9
- "۰": "0",
- // Eastern-Arabic digit 0
- "۱": "1",
- // Eastern-Arabic digit 1
- "۲": "2",
- // Eastern-Arabic digit 2
- "۳": "3",
- // Eastern-Arabic digit 3
- "۴": "4",
- // Eastern-Arabic digit 4
- "۵": "5",
- // Eastern-Arabic digit 5
- "۶": "6",
- // Eastern-Arabic digit 6
- "۷": "7",
- // Eastern-Arabic digit 7
- "۸": "8",
- // Eastern-Arabic digit 8
- "۹": "9"
- // Eastern-Arabic digit 9
- };
- function parseDigit(character) {
- return DIGITS[character];
- }
- function parseDigits(string) {
- var result2 = "";
- for (var _iterator = _createForOfIteratorHelperLoose$8(string.split("")), _step; !(_step = _iterator()).done; ) {
- var character = _step.value;
- var digit = parseDigit(character);
- if (digit) {
- result2 += digit;
- }
- }
- return result2;
- }
- function _createForOfIteratorHelperLoose$7(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$a(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$a(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$a(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$a(o2, minLen);
- }
- function _arrayLikeToArray$a(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function parseIncompletePhoneNumber(string) {
- var result2 = "";
- for (var _iterator = _createForOfIteratorHelperLoose$7(string.split("")), _step; !(_step = _iterator()).done; ) {
- var character = _step.value;
- result2 += parsePhoneNumberCharacter(character, result2) || "";
- }
- return result2;
- }
- function parsePhoneNumberCharacter(character, prevParsedCharacters, emitEvent) {
- if (character === "+") {
- if (prevParsedCharacters) {
- if (typeof emitEvent === "function") {
- emitEvent("end");
- }
- return;
- }
- return "+";
- }
- return parseDigit(character);
- }
- function _createForOfIteratorHelperLoose$6(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$9(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$9(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$9(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$9(o2, minLen);
- }
- function _arrayLikeToArray$9(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function mergeArrays(a2, b2) {
- var merged = a2.slice();
- for (var _iterator = _createForOfIteratorHelperLoose$6(b2), _step; !(_step = _iterator()).done; ) {
- var element = _step.value;
- if (a2.indexOf(element) < 0) {
- merged.push(element);
- }
- }
- return merged.sort(function(a3, b3) {
- return a3 - b3;
- });
- }
- function checkNumberLength(nationalNumber, metadata2) {
- return checkNumberLengthForType(nationalNumber, void 0, metadata2);
- }
- function checkNumberLengthForType(nationalNumber, type, metadata2) {
- var type_info = metadata2.type(type);
- var possible_lengths = type_info && type_info.possibleLengths() || metadata2.possibleLengths();
- if (!possible_lengths) {
- return "IS_POSSIBLE";
- }
- if (type === "FIXED_LINE_OR_MOBILE") {
- if (!metadata2.type("FIXED_LINE")) {
- return checkNumberLengthForType(nationalNumber, "MOBILE", metadata2);
- }
- var mobile_type = metadata2.type("MOBILE");
- if (mobile_type) {
- possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());
- }
- } else if (type && !type_info) {
- return "INVALID_LENGTH";
- }
- var actual_length = nationalNumber.length;
- var minimum_length = possible_lengths[0];
- if (minimum_length === actual_length) {
- return "IS_POSSIBLE";
- }
- if (minimum_length > actual_length) {
- return "TOO_SHORT";
- }
- if (possible_lengths[possible_lengths.length - 1] < actual_length) {
- return "TOO_LONG";
- }
- return possible_lengths.indexOf(actual_length, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
- }
- function isPossiblePhoneNumber(input, options2, metadata2) {
- if (options2 === void 0) {
- options2 = {};
- }
- metadata2 = new Metadata(metadata2);
- if (options2.v2) {
- if (!input.countryCallingCode) {
- throw new Error("Invalid phone number object passed");
- }
- metadata2.selectNumberingPlan(input.countryCallingCode);
- } else {
- if (!input.phone) {
- return false;
- }
- if (input.country) {
- if (!metadata2.hasCountry(input.country)) {
- throw new Error("Unknown country: ".concat(input.country));
- }
- metadata2.country(input.country);
- } else {
- if (!input.countryCallingCode) {
- throw new Error("Invalid phone number object passed");
- }
- metadata2.selectNumberingPlan(input.countryCallingCode);
- }
- }
- if (metadata2.possibleLengths()) {
- return isPossibleNumber(input.phone || input.nationalNumber, metadata2);
- } else {
- if (input.countryCallingCode && metadata2.isNonGeographicCallingCode(input.countryCallingCode)) {
- return true;
- } else {
- throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
- }
- }
- }
- function isPossibleNumber(nationalNumber, metadata2) {
- switch (checkNumberLength(nationalNumber, metadata2)) {
- case "IS_POSSIBLE":
- return true;
- default:
- return false;
- }
- }
- function matchesEntirely(text, regular_expression) {
- text = text || "";
- return new RegExp("^(?:" + regular_expression + ")$").test(text);
- }
- function _createForOfIteratorHelperLoose$5(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$8(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$8(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$8(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$8(o2, minLen);
- }
- function _arrayLikeToArray$8(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- var NON_FIXED_LINE_PHONE_TYPES = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"];
- function getNumberType(input, options2, metadata2) {
- options2 = options2 || {};
- if (!input.country && !input.countryCallingCode) {
- return;
- }
- metadata2 = new Metadata(metadata2);
- metadata2.selectNumberingPlan(input.country, input.countryCallingCode);
- var nationalNumber = options2.v2 ? input.nationalNumber : input.phone;
- if (!matchesEntirely(nationalNumber, metadata2.nationalNumberPattern())) {
- return;
- }
- if (isNumberTypeEqualTo(nationalNumber, "FIXED_LINE", metadata2)) {
- if (metadata2.type("MOBILE") && metadata2.type("MOBILE").pattern() === "") {
- return "FIXED_LINE_OR_MOBILE";
- }
- if (!metadata2.type("MOBILE")) {
- return "FIXED_LINE_OR_MOBILE";
- }
- if (isNumberTypeEqualTo(nationalNumber, "MOBILE", metadata2)) {
- return "FIXED_LINE_OR_MOBILE";
- }
- return "FIXED_LINE";
- }
- for (var _iterator = _createForOfIteratorHelperLoose$5(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done; ) {
- var type = _step.value;
- if (isNumberTypeEqualTo(nationalNumber, type, metadata2)) {
- return type;
- }
- }
- }
- function isNumberTypeEqualTo(nationalNumber, type, metadata2) {
- type = metadata2.type(type);
- if (!type || !type.pattern()) {
- return false;
- }
- if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {
- return false;
- }
- return matchesEntirely(nationalNumber, type.pattern());
- }
- function isValidNumber(input, options2, metadata2) {
- options2 = options2 || {};
- metadata2 = new Metadata(metadata2);
- metadata2.selectNumberingPlan(input.country, input.countryCallingCode);
- if (metadata2.hasTypes()) {
- return getNumberType(input, options2, metadata2.metadata) !== void 0;
- }
- var nationalNumber = options2.v2 ? input.nationalNumber : input.phone;
- return matchesEntirely(nationalNumber, metadata2.nationalNumberPattern());
- }
- function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata2) {
- var _metadata = new Metadata(metadata2);
- var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);
- if (!possibleCountries) {
- return [];
- }
- return possibleCountries.filter(function(country) {
- return couldNationalNumberBelongToCountry(nationalNumber, country, metadata2);
- });
- }
- function couldNationalNumberBelongToCountry(nationalNumber, country, metadata2) {
- var _metadata = new Metadata(metadata2);
- _metadata.selectNumberingPlan(country);
- if (_metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0) {
- return true;
- }
- return false;
- }
- function applyInternationalSeparatorStyle(formattedNumber) {
- return formattedNumber.replace(new RegExp("[".concat(VALID_PUNCTUATION, "]+"), "g"), " ").trim();
- }
- var FIRST_GROUP_PATTERN = /(\$\d)/;
- function formatNationalNumberUsingFormat(number2, format2, _ref) {
- var useInternationalFormat = _ref.useInternationalFormat, withNationalPrefix = _ref.withNationalPrefix;
- _ref.carrierCode;
- _ref.metadata;
- var formattedNumber = number2.replace(new RegExp(format2.pattern()), useInternationalFormat ? format2.internationalFormat() : (
- // This library doesn't use `domestic_carrier_code_formatting_rule`,
- // because that one is only used when formatting phone numbers
- // for dialing from a mobile phone, and this is not a dialing library.
- // carrierCode && format.domesticCarrierCodeFormattingRule()
- // // First, replace the $CC in the formatting rule with the desired carrier code.
- // // Then, replace the $FG in the formatting rule with the first group
- // // and the carrier code combined in the appropriate way.
- // ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))
- // : (
- // withNationalPrefix && format.nationalPrefixFormattingRule()
- // ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())
- // : format.format()
- // )
- withNationalPrefix && format2.nationalPrefixFormattingRule() ? format2.format().replace(FIRST_GROUP_PATTERN, format2.nationalPrefixFormattingRule()) : format2.format()
- ));
- if (useInternationalFormat) {
- return applyInternationalSeparatorStyle(formattedNumber);
- }
- return formattedNumber;
- }
- var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
- function getIddPrefix(country, callingCode, metadata2) {
- var countryMetadata = new Metadata(metadata2);
- countryMetadata.selectNumberingPlan(country, callingCode);
- if (countryMetadata.defaultIDDPrefix()) {
- return countryMetadata.defaultIDDPrefix();
- }
- if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {
- return countryMetadata.IDDPrefix();
- }
- }
- function formatRFC3966(_ref) {
- var number2 = _ref.number, ext = _ref.ext;
- if (!number2) {
- return "";
- }
- if (number2[0] !== "+") {
- throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');
- }
- return "tel:".concat(number2).concat(ext ? ";ext=" + ext : "");
- }
- function _createForOfIteratorHelperLoose$4(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$7(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$7(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$7(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$7(o2, minLen);
- }
- function _arrayLikeToArray$7(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function ownKeys$4(object2, enumerableOnly) {
- var keys = Object.keys(object2);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object2);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread$4(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys$4(Object(source), true).forEach(function(key) {
- _defineProperty$4(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty$4(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- var DEFAULT_OPTIONS = {
- formatExtension: function formatExtension(formattedNumber, extension, metadata2) {
- return "".concat(formattedNumber).concat(metadata2.ext()).concat(extension);
- }
- };
- function formatNumber(input, format2, options2, metadata2) {
- if (options2) {
- options2 = _objectSpread$4(_objectSpread$4({}, DEFAULT_OPTIONS), options2);
- } else {
- options2 = DEFAULT_OPTIONS;
- }
- metadata2 = new Metadata(metadata2);
- if (input.country && input.country !== "001") {
- if (!metadata2.hasCountry(input.country)) {
- throw new Error("Unknown country: ".concat(input.country));
- }
- metadata2.country(input.country);
- } else if (input.countryCallingCode) {
- metadata2.selectNumberingPlan(input.countryCallingCode);
- } else
- return input.phone || "";
- var countryCallingCode = metadata2.countryCallingCode();
- var nationalNumber = options2.v2 ? input.nationalNumber : input.phone;
- var number2;
- switch (format2) {
- case "NATIONAL":
- if (!nationalNumber) {
- return "";
- }
- number2 = formatNationalNumber$1(nationalNumber, input.carrierCode, "NATIONAL", metadata2, options2);
- return addExtension(number2, input.ext, metadata2, options2.formatExtension);
- case "INTERNATIONAL":
- if (!nationalNumber) {
- return "+".concat(countryCallingCode);
- }
- number2 = formatNationalNumber$1(nationalNumber, null, "INTERNATIONAL", metadata2, options2);
- number2 = "+".concat(countryCallingCode, " ").concat(number2);
- return addExtension(number2, input.ext, metadata2, options2.formatExtension);
- case "E.164":
- return "+".concat(countryCallingCode).concat(nationalNumber);
- case "RFC3966":
- return formatRFC3966({
- number: "+".concat(countryCallingCode).concat(nationalNumber),
- ext: input.ext
- });
- case "IDD":
- if (!options2.fromCountry) {
- return;
- }
- var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options2.fromCountry, metadata2);
- return addExtension(formattedNumber, input.ext, metadata2, options2.formatExtension);
- default:
- throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(format2, '"'));
- }
- }
- function formatNationalNumber$1(number2, carrierCode, formatAs, metadata2, options2) {
- var format2 = chooseFormatForNumber(metadata2.formats(), number2);
- if (!format2) {
- return number2;
- }
- return formatNationalNumberUsingFormat(number2, format2, {
- useInternationalFormat: formatAs === "INTERNATIONAL",
- withNationalPrefix: format2.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options2 && options2.nationalPrefix === false ? false : true,
- carrierCode,
- metadata: metadata2
- });
- }
- function chooseFormatForNumber(availableFormats, nationalNnumber) {
- for (var _iterator = _createForOfIteratorHelperLoose$4(availableFormats), _step; !(_step = _iterator()).done; ) {
- var format2 = _step.value;
- if (format2.leadingDigitsPatterns().length > 0) {
- var lastLeadingDigitsPattern = format2.leadingDigitsPatterns()[format2.leadingDigitsPatterns().length - 1];
- if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {
- continue;
- }
- }
- if (matchesEntirely(nationalNnumber, format2.pattern())) {
- return format2;
- }
- }
- }
- function addExtension(formattedNumber, ext, metadata2, formatExtension) {
- return ext ? formatExtension(formattedNumber, ext, metadata2) : formattedNumber;
- }
- function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata2) {
- var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata2.metadata);
- if (fromCountryCallingCode === countryCallingCode) {
- var formattedNumber = formatNationalNumber$1(nationalNumber, carrierCode, "NATIONAL", metadata2);
- if (countryCallingCode === "1") {
- return countryCallingCode + " " + formattedNumber;
- }
- return formattedNumber;
- }
- var iddPrefix = getIddPrefix(fromCountry, void 0, metadata2.metadata);
- if (iddPrefix) {
- return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber$1(nationalNumber, null, "INTERNATIONAL", metadata2));
- }
- }
- function ownKeys$3(object2, enumerableOnly) {
- var keys = Object.keys(object2);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object2);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread$3(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys$3(Object(source), true).forEach(function(key) {
- _defineProperty$3(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty$3(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _classCallCheck$6(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties$6(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$6(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$6(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$6(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var PhoneNumber = /* @__PURE__ */ function() {
- function PhoneNumber2(countryOrCountryCallingCode, nationalNumber, metadata2) {
- _classCallCheck$6(this, PhoneNumber2);
- if (!countryOrCountryCallingCode) {
- throw new TypeError("`country` or `countryCallingCode` not passed");
- }
- if (!nationalNumber) {
- throw new TypeError("`nationalNumber` not passed");
- }
- if (!metadata2) {
- throw new TypeError("`metadata` not passed");
- }
- var _getCountryAndCountry = getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadata2), country = _getCountryAndCountry.country, countryCallingCode = _getCountryAndCountry.countryCallingCode;
- this.country = country;
- this.countryCallingCode = countryCallingCode;
- this.nationalNumber = nationalNumber;
- this.number = "+" + this.countryCallingCode + this.nationalNumber;
- this.getMetadata = function() {
- return metadata2;
- };
- }
- _createClass$6(PhoneNumber2, [{
- key: "setExt",
- value: function setExt(ext) {
- this.ext = ext;
- }
- }, {
- key: "getPossibleCountries",
- value: function getPossibleCountries() {
- if (this.country) {
- return [this.country];
- }
- return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());
- }
- }, {
- key: "isPossible",
- value: function isPossible() {
- return isPossiblePhoneNumber(this, {
- v2: true
- }, this.getMetadata());
- }
- }, {
- key: "isValid",
- value: function isValid() {
- return isValidNumber(this, {
- v2: true
- }, this.getMetadata());
- }
- }, {
- key: "isNonGeographic",
- value: function isNonGeographic() {
- var metadata2 = new Metadata(this.getMetadata());
- return metadata2.isNonGeographicCallingCode(this.countryCallingCode);
- }
- }, {
- key: "isEqual",
- value: function isEqual(phoneNumber) {
- return this.number === phoneNumber.number && this.ext === phoneNumber.ext;
- }
- // This function was originally meant to be an equivalent for `validatePhoneNumberLength()`,
- // but later it was found out that it doesn't include the possible `TOO_SHORT` result
- // returned from `parsePhoneNumberWithError()` in the original `validatePhoneNumberLength()`,
- // so eventually I simply commented out this method from the `PhoneNumber` class
- // and just left the `validatePhoneNumberLength()` function, even though that one would require
- // and additional step to also validate the actual country / calling code of the phone number.
- // validateLength() {
- // const metadata = new Metadata(this.getMetadata())
- // metadata.selectNumberingPlan(this.countryCallingCode)
- // const result = checkNumberLength(this.nationalNumber, metadata)
- // if (result !== 'IS_POSSIBLE') {
- // return result
- // }
- // }
- }, {
- key: "getType",
- value: function getType2() {
- return getNumberType(this, {
- v2: true
- }, this.getMetadata());
- }
- }, {
- key: "format",
- value: function format2(_format, options2) {
- return formatNumber(this, _format, options2 ? _objectSpread$3(_objectSpread$3({}, options2), {}, {
- v2: true
- }) : {
- v2: true
- }, this.getMetadata());
- }
- }, {
- key: "formatNational",
- value: function formatNational(options2) {
- return this.format("NATIONAL", options2);
- }
- }, {
- key: "formatInternational",
- value: function formatInternational(options2) {
- return this.format("INTERNATIONAL", options2);
- }
- }, {
- key: "getURI",
- value: function getURI(options2) {
- return this.format("RFC3966", options2);
- }
- }]);
- return PhoneNumber2;
- }();
- var isCountryCode = function isCountryCode2(value) {
- return /^[A-Z]{2}$/.test(value);
- };
- function getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadataJson) {
- var country;
- var countryCallingCode;
- var metadata2 = new Metadata(metadataJson);
- if (isCountryCode(countryOrCountryCallingCode)) {
- country = countryOrCountryCallingCode;
- metadata2.selectNumberingPlan(country);
- countryCallingCode = metadata2.countryCallingCode();
- } else {
- countryCallingCode = countryOrCountryCallingCode;
- }
- return {
- country,
- countryCallingCode
- };
- }
- var CAPTURING_DIGIT_PATTERN = new RegExp("([" + VALID_DIGITS + "])");
- function stripIddPrefix(number2, country, callingCode, metadata2) {
- if (!country) {
- return;
- }
- var countryMetadata = new Metadata(metadata2);
- countryMetadata.selectNumberingPlan(country, callingCode);
- var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());
- if (number2.search(IDDPrefixPattern) !== 0) {
- return;
- }
- number2 = number2.slice(number2.match(IDDPrefixPattern)[0].length);
- var matchedGroups = number2.match(CAPTURING_DIGIT_PATTERN);
- if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
- if (matchedGroups[1] === "0") {
- return;
- }
- }
- return number2;
- }
- function extractNationalNumberFromPossiblyIncompleteNumber(number2, metadata2) {
- if (number2 && metadata2.numberingPlan.nationalPrefixForParsing()) {
- var prefixPattern = new RegExp("^(?:" + metadata2.numberingPlan.nationalPrefixForParsing() + ")");
- var prefixMatch = prefixPattern.exec(number2);
- if (prefixMatch) {
- var nationalNumber;
- var carrierCode;
- var capturedGroupsCount = prefixMatch.length - 1;
- var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];
- if (metadata2.nationalPrefixTransformRule() && hasCapturedGroups) {
- nationalNumber = number2.replace(prefixPattern, metadata2.nationalPrefixTransformRule());
- if (capturedGroupsCount > 1) {
- carrierCode = prefixMatch[1];
- }
- } else {
- var prefixBeforeNationalNumber = prefixMatch[0];
- nationalNumber = number2.slice(prefixBeforeNationalNumber.length);
- if (hasCapturedGroups) {
- carrierCode = prefixMatch[1];
- }
- }
- var nationalPrefix;
- if (hasCapturedGroups) {
- var possiblePositionOfTheFirstCapturedGroup = number2.indexOf(prefixMatch[1]);
- var possibleNationalPrefix = number2.slice(0, possiblePositionOfTheFirstCapturedGroup);
- if (possibleNationalPrefix === metadata2.numberingPlan.nationalPrefix()) {
- nationalPrefix = metadata2.numberingPlan.nationalPrefix();
- }
- } else {
- nationalPrefix = prefixMatch[0];
- }
- return {
- nationalNumber,
- nationalPrefix,
- carrierCode
- };
- }
- }
- return {
- nationalNumber: number2
- };
- }
- function extractNationalNumber(number2, metadata2) {
- var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number2, metadata2), carrierCode = _extractNationalNumbe.carrierCode, nationalNumber = _extractNationalNumbe.nationalNumber;
- if (nationalNumber !== number2) {
- if (!shouldHaveExtractedNationalPrefix(number2, nationalNumber, metadata2)) {
- return {
- nationalNumber: number2
- };
- }
- if (metadata2.possibleLengths()) {
- if (!isPossibleIncompleteNationalNumber(nationalNumber, metadata2)) {
- return {
- nationalNumber: number2
- };
- }
- }
- }
- return {
- nationalNumber,
- carrierCode
- };
- }
- function shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata2) {
- if (matchesEntirely(nationalNumberBefore, metadata2.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata2.nationalNumberPattern())) {
- return false;
- }
- return true;
- }
- function isPossibleIncompleteNationalNumber(nationalNumber, metadata2) {
- switch (checkNumberLength(nationalNumber, metadata2)) {
- case "TOO_SHORT":
- case "INVALID_LENGTH":
- return false;
- default:
- return true;
- }
- }
- function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number2, country, callingCode, metadata2) {
- var countryCallingCode = country ? getCountryCallingCode(country, metadata2) : callingCode;
- if (number2.indexOf(countryCallingCode) === 0) {
- metadata2 = new Metadata(metadata2);
- metadata2.selectNumberingPlan(country, callingCode);
- var possibleShorterNumber = number2.slice(countryCallingCode.length);
- var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata2), possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
- var _extractNationalNumbe2 = extractNationalNumber(number2, metadata2), nationalNumber = _extractNationalNumbe2.nationalNumber;
- if (!matchesEntirely(nationalNumber, metadata2.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata2.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata2) === "TOO_LONG") {
- return {
- countryCallingCode,
- number: possibleShorterNumber
- };
- }
- }
- return {
- number: number2
- };
- }
- function extractCountryCallingCode(number2, country, callingCode, metadata2) {
- if (!number2) {
- return {};
- }
- var isNumberWithIddPrefix;
- if (number2[0] !== "+") {
- var numberWithoutIDD = stripIddPrefix(number2, country, callingCode, metadata2);
- if (numberWithoutIDD && numberWithoutIDD !== number2) {
- isNumberWithIddPrefix = true;
- number2 = "+" + numberWithoutIDD;
- } else {
- if (country || callingCode) {
- var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number2, country, callingCode, metadata2), countryCallingCode = _extractCountryCallin.countryCallingCode, shorterNumber = _extractCountryCallin.number;
- if (countryCallingCode) {
- return {
- countryCallingCodeSource: "FROM_NUMBER_WITHOUT_PLUS_SIGN",
- countryCallingCode,
- number: shorterNumber
- };
- }
- }
- return {
- // No need to set it to `UNSPECIFIED`. It can be just `undefined`.
- // countryCallingCodeSource: 'UNSPECIFIED',
- number: number2
- };
- }
- }
- if (number2[1] === "0") {
- return {};
- }
- metadata2 = new Metadata(metadata2);
- var i2 = 2;
- while (i2 - 1 <= MAX_LENGTH_COUNTRY_CODE && i2 <= number2.length) {
- var _countryCallingCode = number2.slice(1, i2);
- if (metadata2.hasCallingCode(_countryCallingCode)) {
- metadata2.selectNumberingPlan(_countryCallingCode);
- return {
- countryCallingCodeSource: isNumberWithIddPrefix ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN",
- countryCallingCode: _countryCallingCode,
- number: number2.slice(i2)
- };
- }
- i2++;
- }
- return {};
- }
- function _createForOfIteratorHelperLoose$3(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$6(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$6(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$6(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$6(o2, minLen);
- }
- function _arrayLikeToArray$6(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function getCountryByNationalNumber(nationalPhoneNumber, _ref) {
- var countries = _ref.countries;
- _ref.defaultCountry;
- var metadata2 = _ref.metadata;
- metadata2 = new Metadata(metadata2);
- for (var _iterator = _createForOfIteratorHelperLoose$3(countries), _step; !(_step = _iterator()).done; ) {
- var country = _step.value;
- metadata2.country(country);
- if (metadata2.leadingDigits()) {
- if (nationalPhoneNumber && nationalPhoneNumber.search(metadata2.leadingDigits()) === 0) {
- return country;
- }
- } else if (getNumberType({
- phone: nationalPhoneNumber,
- country
- }, void 0, metadata2.metadata)) {
- return country;
- }
- }
- }
- var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
- function getCountryByCallingCode(callingCode, _ref) {
- var nationalPhoneNumber = _ref.nationalNumber, defaultCountry = _ref.defaultCountry, metadata2 = _ref.metadata;
- if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {
- if (metadata2.isNonGeographicCallingCode(callingCode)) {
- return "001";
- }
- }
- var possibleCountries = metadata2.getCountryCodesForCallingCode(callingCode);
- if (!possibleCountries) {
- return;
- }
- if (possibleCountries.length === 1) {
- return possibleCountries[0];
- }
- return getCountryByNationalNumber(nationalPhoneNumber, {
- countries: possibleCountries,
- defaultCountry,
- metadata: metadata2.metadata
- });
- }
- var PLUS_SIGN = "+";
- var RFC3966_VISUAL_SEPARATOR_ = "[\\-\\.\\(\\)]?";
- var RFC3966_PHONE_DIGIT_ = "([" + VALID_DIGITS + "]|" + RFC3966_VISUAL_SEPARATOR_ + ")";
- var RFC3966_GLOBAL_NUMBER_DIGITS_ = "^\\" + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + "*[" + VALID_DIGITS + "]" + RFC3966_PHONE_DIGIT_ + "*$";
- var RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, "g");
- var ALPHANUM_ = VALID_DIGITS;
- var RFC3966_DOMAINLABEL_ = "[" + ALPHANUM_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
- var VALID_ALPHA_ = "a-zA-Z";
- var RFC3966_TOPLABEL_ = "[" + VALID_ALPHA_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
- var RFC3966_DOMAINNAME_ = "^(" + RFC3966_DOMAINLABEL_ + "\\.)*" + RFC3966_TOPLABEL_ + "\\.?$";
- var RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, "g");
- var RFC3966_PREFIX_ = "tel:";
- var RFC3966_PHONE_CONTEXT_ = ";phone-context=";
- var RFC3966_ISDN_SUBADDRESS_ = ";isub=";
- function extractPhoneContext(numberToExtractFrom) {
- var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_);
- if (indexOfPhoneContext < 0) {
- return null;
- }
- var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length;
- if (phoneContextStart >= numberToExtractFrom.length) {
- return "";
- }
- var phoneContextEnd = numberToExtractFrom.indexOf(";", phoneContextStart);
- if (phoneContextEnd >= 0) {
- return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);
- } else {
- return numberToExtractFrom.substring(phoneContextStart);
- }
- }
- function isPhoneContextValid(phoneContext) {
- if (phoneContext === null) {
- return true;
- }
- if (phoneContext.length === 0) {
- return false;
- }
- return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);
- }
- function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {
- var extractFormattedPhoneNumber2 = _ref.extractFormattedPhoneNumber;
- var phoneContext = extractPhoneContext(numberToParse);
- if (!isPhoneContextValid(phoneContext)) {
- throw new ParseError("NOT_A_NUMBER");
- }
- var phoneNumberString;
- if (phoneContext === null) {
- phoneNumberString = extractFormattedPhoneNumber2(numberToParse) || "";
- } else {
- phoneNumberString = "";
- if (phoneContext.charAt(0) === PLUS_SIGN) {
- phoneNumberString += phoneContext;
- }
- var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);
- var indexOfNationalNumber;
- if (indexOfRfc3966Prefix >= 0) {
- indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;
- } else {
- indexOfNationalNumber = 0;
- }
- var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);
- phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);
- }
- var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);
- if (indexOfIsdn > 0) {
- phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);
- }
- if (phoneNumberString !== "") {
- return phoneNumberString;
- }
- }
- var MAX_INPUT_STRING_LENGTH = 250;
- var PHONE_NUMBER_START_PATTERN = new RegExp("[" + PLUS_CHARS + VALID_DIGITS + "]");
- var AFTER_PHONE_NUMBER_END_PATTERN = new RegExp("[^" + VALID_DIGITS + "#]+$");
- function parse(text, options2, metadata2) {
- options2 = options2 || {};
- metadata2 = new Metadata(metadata2);
- if (options2.defaultCountry && !metadata2.hasCountry(options2.defaultCountry)) {
- if (options2.v2) {
- throw new ParseError("INVALID_COUNTRY");
- }
- throw new Error("Unknown country: ".concat(options2.defaultCountry));
- }
- var _parseInput = parseInput(text, options2.v2, options2.extract), formattedPhoneNumber = _parseInput.number, ext = _parseInput.ext, error2 = _parseInput.error;
- if (!formattedPhoneNumber) {
- if (options2.v2) {
- if (error2 === "TOO_SHORT") {
- throw new ParseError("TOO_SHORT");
- }
- throw new ParseError("NOT_A_NUMBER");
- }
- return {};
- }
- var _parsePhoneNumber = parsePhoneNumber$4(formattedPhoneNumber, options2.defaultCountry, options2.defaultCallingCode, metadata2), country = _parsePhoneNumber.country, nationalNumber = _parsePhoneNumber.nationalNumber, countryCallingCode = _parsePhoneNumber.countryCallingCode, countryCallingCodeSource = _parsePhoneNumber.countryCallingCodeSource, carrierCode = _parsePhoneNumber.carrierCode;
- if (!metadata2.hasSelectedNumberingPlan()) {
- if (options2.v2) {
- throw new ParseError("INVALID_COUNTRY");
- }
- return {};
- }
- if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {
- if (options2.v2) {
- throw new ParseError("TOO_SHORT");
- }
- return {};
- }
- if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {
- if (options2.v2) {
- throw new ParseError("TOO_LONG");
- }
- return {};
- }
- if (options2.v2) {
- var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata2.metadata);
- if (country) {
- phoneNumber.country = country;
- }
- if (carrierCode) {
- phoneNumber.carrierCode = carrierCode;
- }
- if (ext) {
- phoneNumber.ext = ext;
- }
- phoneNumber.__countryCallingCodeSource = countryCallingCodeSource;
- return phoneNumber;
- }
- var valid = (options2.extended ? metadata2.hasSelectedNumberingPlan() : country) ? matchesEntirely(nationalNumber, metadata2.nationalNumberPattern()) : false;
- if (!options2.extended) {
- return valid ? result(country, nationalNumber, ext) : {};
- }
- return {
- country,
- countryCallingCode,
- carrierCode,
- valid,
- possible: valid ? true : options2.extended === true && metadata2.possibleLengths() && isPossibleNumber(nationalNumber, metadata2) ? true : false,
- phone: nationalNumber,
- ext
- };
- }
- function _extractFormattedPhoneNumber(text, extract, throwOnError) {
- if (!text) {
- return;
- }
- if (text.length > MAX_INPUT_STRING_LENGTH) {
- if (throwOnError) {
- throw new ParseError("TOO_LONG");
- }
- return;
- }
- if (extract === false) {
- return text;
- }
- var startsAt = text.search(PHONE_NUMBER_START_PATTERN);
- if (startsAt < 0) {
- return;
- }
- return text.slice(startsAt).replace(AFTER_PHONE_NUMBER_END_PATTERN, "");
- }
- function parseInput(text, v2, extract) {
- var number2 = extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(text, {
- extractFormattedPhoneNumber: function extractFormattedPhoneNumber2(text2) {
- return _extractFormattedPhoneNumber(text2, extract, v2);
- }
- });
- if (!number2) {
- return {};
- }
- if (!isViablePhoneNumber(number2)) {
- if (isViablePhoneNumberStart(number2)) {
- return {
- error: "TOO_SHORT"
- };
- }
- return {};
- }
- var withExtensionStripped = extractExtension(number2);
- if (withExtensionStripped.ext) {
- return withExtensionStripped;
- }
- return {
- number: number2
- };
- }
- function result(country, nationalNumber, ext) {
- var result2 = {
- country,
- phone: nationalNumber
- };
- if (ext) {
- result2.ext = ext;
- }
- return result2;
- }
- function parsePhoneNumber$4(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata2) {
- var _extractCountryCallin = extractCountryCallingCode(parseIncompletePhoneNumber(formattedPhoneNumber), defaultCountry, defaultCallingCode, metadata2.metadata), countryCallingCodeSource = _extractCountryCallin.countryCallingCodeSource, countryCallingCode = _extractCountryCallin.countryCallingCode, number2 = _extractCountryCallin.number;
- var country;
- if (countryCallingCode) {
- metadata2.selectNumberingPlan(countryCallingCode);
- } else if (number2 && (defaultCountry || defaultCallingCode)) {
- metadata2.selectNumberingPlan(defaultCountry, defaultCallingCode);
- if (defaultCountry) {
- country = defaultCountry;
- }
- countryCallingCode = defaultCallingCode || getCountryCallingCode(defaultCountry, metadata2.metadata);
- } else
- return {};
- if (!number2) {
- return {
- countryCallingCodeSource,
- countryCallingCode
- };
- }
- var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number2), metadata2), nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
- var exactCountry = getCountryByCallingCode(countryCallingCode, {
- nationalNumber,
- defaultCountry,
- metadata: metadata2
- });
- if (exactCountry) {
- country = exactCountry;
- if (exactCountry === "001")
- ;
- else {
- metadata2.country(country);
- }
- }
- return {
- country,
- countryCallingCode,
- countryCallingCodeSource,
- nationalNumber,
- carrierCode
- };
- }
- function ownKeys$2(object2, enumerableOnly) {
- var keys = Object.keys(object2);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object2);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread$2(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys$2(Object(source), true).forEach(function(key) {
- _defineProperty$2(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty$2(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function parsePhoneNumberWithError(text, options2, metadata2) {
- return parse(text, _objectSpread$2(_objectSpread$2({}, options2), {}, {
- v2: true
- }), metadata2);
- }
- function ownKeys$1(object2, enumerableOnly) {
- var keys = Object.keys(object2);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object2);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread$1(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys$1(Object(source), true).forEach(function(key) {
- _defineProperty$1(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty$1(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _slicedToArray$2(arr, i2) {
- return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i2) || _unsupportedIterableToArray$5(arr, i2) || _nonIterableRest$2();
- }
- function _nonIterableRest$2() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$5(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$5(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$5(o2, minLen);
- }
- function _arrayLikeToArray$5(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function _iterableToArrayLimit$2(arr, i2) {
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
- if (_i == null)
- return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s2, _e2;
- try {
- for (_i = _i.call(arr); !(_n = (_s2 = _i.next()).done); _n = true) {
- _arr.push(_s2.value);
- if (i2 && _arr.length === i2)
- break;
- }
- } catch (err) {
- _d = true;
- _e2 = err;
- } finally {
- try {
- if (!_n && _i["return"] != null)
- _i["return"]();
- } finally {
- if (_d)
- throw _e2;
- }
- }
- return _arr;
- }
- function _arrayWithHoles$2(arr) {
- if (Array.isArray(arr))
- return arr;
- }
- function normalizeArguments(args) {
- var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray$2(_Array$prototype$slic, 4), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3];
- var text;
- var options2;
- var metadata2;
- if (typeof arg_1 === "string") {
- text = arg_1;
- } else
- throw new TypeError("A text for parsing must be a string.");
- if (!arg_2 || typeof arg_2 === "string") {
- if (arg_4) {
- options2 = arg_3;
- metadata2 = arg_4;
- } else {
- options2 = void 0;
- metadata2 = arg_3;
- }
- if (arg_2) {
- options2 = _objectSpread$1({
- defaultCountry: arg_2
- }, options2);
- }
- } else if (isObject$2(arg_2)) {
- if (arg_3) {
- options2 = arg_2;
- metadata2 = arg_3;
- } else {
- metadata2 = arg_2;
- }
- } else
- throw new Error("Invalid second argument: ".concat(arg_2));
- return {
- text,
- options: options2,
- metadata: metadata2
- };
- }
- function ownKeys(object2, enumerableOnly) {
- var keys = Object.keys(object2);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object2);
- enumerableOnly && (symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
- })), keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread(target) {
- for (var i2 = 1; i2 < arguments.length; i2++) {
- var source = null != arguments[i2] ? arguments[i2] : {};
- i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) {
- _defineProperty(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- return target;
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function parsePhoneNumber$3(text, options2, metadata2) {
- if (options2 && options2.defaultCountry && !isSupportedCountry(options2.defaultCountry, metadata2)) {
- options2 = _objectSpread(_objectSpread({}, options2), {}, {
- defaultCountry: void 0
- });
- }
- try {
- return parsePhoneNumberWithError(text, options2, metadata2);
- } catch (error2) {
- if (error2 instanceof ParseError)
- ;
- else {
- throw error2;
- }
- }
- }
- function parsePhoneNumber$2() {
- var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options2 = _normalizeArguments.options, metadata2 = _normalizeArguments.metadata;
- return parsePhoneNumber$3(text, options2, metadata2);
- }
- function _classCallCheck$5(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties$5(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$5(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$5(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$5(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var AsYouTypeState = /* @__PURE__ */ function() {
- function AsYouTypeState2(_ref) {
- var onCountryChange = _ref.onCountryChange, onCallingCodeChange = _ref.onCallingCodeChange;
- _classCallCheck$5(this, AsYouTypeState2);
- this.onCountryChange = onCountryChange;
- this.onCallingCodeChange = onCallingCodeChange;
- }
- _createClass$5(AsYouTypeState2, [{
- key: "reset",
- value: function reset(_ref2) {
- var country = _ref2.country, callingCode = _ref2.callingCode;
- this.international = false;
- this.missingPlus = false;
- this.IDDPrefix = void 0;
- this.callingCode = void 0;
- this.digits = "";
- this.resetNationalSignificantNumber();
- this.initCountryAndCallingCode(country, callingCode);
- }
- }, {
- key: "resetNationalSignificantNumber",
- value: function resetNationalSignificantNumber() {
- this.nationalSignificantNumber = this.getNationalDigits();
- this.nationalSignificantNumberMatchesInput = true;
- this.nationalPrefix = void 0;
- this.carrierCode = void 0;
- this.complexPrefixBeforeNationalSignificantNumber = void 0;
- }
- }, {
- key: "update",
- value: function update(properties) {
- for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {
- var key = _Object$keys[_i];
- this[key] = properties[key];
- }
- }
- }, {
- key: "initCountryAndCallingCode",
- value: function initCountryAndCallingCode(country, callingCode) {
- this.setCountry(country);
- this.setCallingCode(callingCode);
- }
- }, {
- key: "setCountry",
- value: function setCountry(country) {
- this.country = country;
- this.onCountryChange(country);
- }
- }, {
- key: "setCallingCode",
- value: function setCallingCode(callingCode) {
- this.callingCode = callingCode;
- this.onCallingCodeChange(callingCode, this.country);
- }
- }, {
- key: "startInternationalNumber",
- value: function startInternationalNumber(country, callingCode) {
- this.international = true;
- this.initCountryAndCallingCode(country, callingCode);
- }
- }, {
- key: "appendDigits",
- value: function appendDigits(nextDigits) {
- this.digits += nextDigits;
- }
- }, {
- key: "appendNationalSignificantNumberDigits",
- value: function appendNationalSignificantNumberDigits(nextDigits) {
- this.nationalSignificantNumber += nextDigits;
- }
- /**
- * Returns the part of `this.digits` that corresponds to the national number.
- * Basically, all digits that have been input by the user, except for the
- * international prefix and the country calling code part
- * (if the number is an international one).
- * @return {string}
- */
- }, {
- key: "getNationalDigits",
- value: function getNationalDigits() {
- if (this.international) {
- return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));
- }
- return this.digits;
- }
- }, {
- key: "getDigitsWithoutInternationalPrefix",
- value: function getDigitsWithoutInternationalPrefix() {
- if (this.international) {
- if (this.IDDPrefix) {
- return this.digits.slice(this.IDDPrefix.length);
- }
- }
- return this.digits;
- }
- }]);
- return AsYouTypeState2;
- }();
- function _createForOfIteratorHelperLoose$2(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$4(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$4(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$4(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$4(o2, minLen);
- }
- function _arrayLikeToArray$4(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- var DIGIT_PLACEHOLDER = "x";
- var DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);
- function repeat(string, times2) {
- if (times2 < 1) {
- return "";
- }
- var result2 = "";
- while (times2 > 1) {
- if (times2 & 1) {
- result2 += string;
- }
- times2 >>= 1;
- string += string;
- }
- return result2 + string;
- }
- function cutAndStripNonPairedParens(string, cutBeforeIndex) {
- if (string[cutBeforeIndex] === ")") {
- cutBeforeIndex++;
- }
- return stripNonPairedParens(string.slice(0, cutBeforeIndex));
- }
- function stripNonPairedParens(string) {
- var dangling_braces = [];
- var i2 = 0;
- while (i2 < string.length) {
- if (string[i2] === "(") {
- dangling_braces.push(i2);
- } else if (string[i2] === ")") {
- dangling_braces.pop();
- }
- i2++;
- }
- var start = 0;
- var cleared_string = "";
- dangling_braces.push(string.length);
- for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) {
- var index2 = _dangling_braces[_i];
- cleared_string += string.slice(start, index2);
- start = index2 + 1;
- }
- return cleared_string;
- }
- function populateTemplateWithDigits(template, position, digits2) {
- for (var _iterator2 = _createForOfIteratorHelperLoose$2(digits2.split("")), _step2; !(_step2 = _iterator2()).done; ) {
- var digit = _step2.value;
- if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {
- return;
- }
- position = template.search(DIGIT_PLACEHOLDER_MATCHER);
- template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);
- }
- return [template, position];
- }
- function formatCompleteNumber(state, format2, _ref) {
- var metadata2 = _ref.metadata, shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;
- var matcher = new RegExp("^(?:".concat(format2.pattern(), ")$"));
- if (matcher.test(state.nationalSignificantNumber)) {
- return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format2, {
- metadata: metadata2,
- shouldTryNationalPrefixFormattingRule,
- getSeparatorAfterNationalPrefix
- });
- }
- }
- function canFormatCompleteNumber(nationalSignificantNumber, metadata2) {
- return checkNumberLength(nationalSignificantNumber, metadata2) === "IS_POSSIBLE";
- }
- function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format2, _ref2) {
- var metadata2 = _ref2.metadata, shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;
- state.nationalSignificantNumber;
- state.international;
- state.nationalPrefix;
- state.carrierCode;
- if (shouldTryNationalPrefixFormattingRule(format2)) {
- var formattedNumber = formatNationalNumber(state, format2, {
- useNationalPrefixFormattingRule: true,
- getSeparatorAfterNationalPrefix,
- metadata: metadata2
- });
- if (formattedNumber) {
- return formattedNumber;
- }
- }
- return formatNationalNumber(state, format2, {
- useNationalPrefixFormattingRule: false,
- getSeparatorAfterNationalPrefix,
- metadata: metadata2
- });
- }
- function formatNationalNumber(state, format2, _ref3) {
- var metadata2 = _ref3.metadata, useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;
- var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format2, {
- carrierCode: state.carrierCode,
- useInternationalFormat: state.international,
- withNationalPrefix: useNationalPrefixFormattingRule,
- metadata: metadata2
- });
- if (!useNationalPrefixFormattingRule) {
- if (state.nationalPrefix) {
- formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format2) + formattedNationalNumber;
- } else if (state.complexPrefixBeforeNationalSignificantNumber) {
- formattedNationalNumber = state.complexPrefixBeforeNationalSignificantNumber + " " + formattedNationalNumber;
- }
- }
- if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {
- return formattedNationalNumber;
- }
- }
- function isValidFormattedNationalNumber(formattedNationalNumber, state) {
- return parseDigits(formattedNationalNumber) === state.getNationalDigits();
- }
- function _classCallCheck$4(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties$4(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$4(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$4(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$4(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var PatternParser = /* @__PURE__ */ function() {
- function PatternParser2() {
- _classCallCheck$4(this, PatternParser2);
- }
- _createClass$4(PatternParser2, [{
- key: "parse",
- value: function parse2(pattern2) {
- this.context = [{
- or: true,
- instructions: []
- }];
- this.parsePattern(pattern2);
- if (this.context.length !== 1) {
- throw new Error("Non-finalized contexts left when pattern parse ended");
- }
- var _this$context$ = this.context[0], branches = _this$context$.branches, instructions = _this$context$.instructions;
- if (branches) {
- return {
- op: "|",
- args: branches.concat([expandSingleElementArray(instructions)])
- };
- }
- if (instructions.length === 0) {
- throw new Error("Pattern is required");
- }
- if (instructions.length === 1) {
- return instructions[0];
- }
- return instructions;
- }
- }, {
- key: "startContext",
- value: function startContext(context) {
- this.context.push(context);
- }
- }, {
- key: "endContext",
- value: function endContext() {
- this.context.pop();
- }
- }, {
- key: "getContext",
- value: function getContext() {
- return this.context[this.context.length - 1];
- }
- }, {
- key: "parsePattern",
- value: function parsePattern(pattern2) {
- if (!pattern2) {
- throw new Error("Pattern is required");
- }
- var match = pattern2.match(OPERATOR);
- if (!match) {
- if (ILLEGAL_CHARACTER_REGEXP.test(pattern2)) {
- throw new Error("Illegal characters found in a pattern: ".concat(pattern2));
- }
- this.getContext().instructions = this.getContext().instructions.concat(pattern2.split(""));
- return;
- }
- var operator = match[1];
- var before = pattern2.slice(0, match.index);
- var rightPart = pattern2.slice(match.index + operator.length);
- switch (operator) {
- case "(?:":
- if (before) {
- this.parsePattern(before);
- }
- this.startContext({
- or: true,
- instructions: [],
- branches: []
- });
- break;
- case ")":
- if (!this.getContext().or) {
- throw new Error('")" operator must be preceded by "(?:" operator');
- }
- if (before) {
- this.parsePattern(before);
- }
- if (this.getContext().instructions.length === 0) {
- throw new Error('No instructions found after "|" operator in an "or" group');
- }
- var _this$getContext = this.getContext(), branches = _this$getContext.branches;
- branches.push(expandSingleElementArray(this.getContext().instructions));
- this.endContext();
- this.getContext().instructions.push({
- op: "|",
- args: branches
- });
- break;
- case "|":
- if (!this.getContext().or) {
- throw new Error('"|" operator can only be used inside "or" groups');
- }
- if (before) {
- this.parsePattern(before);
- }
- if (!this.getContext().branches) {
- if (this.context.length === 1) {
- this.getContext().branches = [];
- } else {
- throw new Error('"branches" not found in an "or" group context');
- }
- }
- this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions));
- this.getContext().instructions = [];
- break;
- case "[":
- if (before) {
- this.parsePattern(before);
- }
- this.startContext({
- oneOfSet: true
- });
- break;
- case "]":
- if (!this.getContext().oneOfSet) {
- throw new Error('"]" operator must be preceded by "[" operator');
- }
- this.endContext();
- this.getContext().instructions.push({
- op: "[]",
- args: parseOneOfSet(before)
- });
- break;
- default:
- throw new Error("Unknown operator: ".concat(operator));
- }
- if (rightPart) {
- this.parsePattern(rightPart);
- }
- }
- }]);
- return PatternParser2;
- }();
- function parseOneOfSet(pattern2) {
- var values = [];
- var i2 = 0;
- while (i2 < pattern2.length) {
- if (pattern2[i2] === "-") {
- if (i2 === 0 || i2 === pattern2.length - 1) {
- throw new Error("Couldn't parse a one-of set pattern: ".concat(pattern2));
- }
- var prevValue = pattern2[i2 - 1].charCodeAt(0) + 1;
- var nextValue = pattern2[i2 + 1].charCodeAt(0) - 1;
- var value = prevValue;
- while (value <= nextValue) {
- values.push(String.fromCharCode(value));
- value++;
- }
- } else {
- values.push(pattern2[i2]);
- }
- i2++;
- }
- return values;
- }
- var ILLEGAL_CHARACTER_REGEXP = /[\(\)\[\]\?\:\|]/;
- var OPERATOR = new RegExp(
- // any of:
- "(\\||\\(\\?\\:|\\)|\\[|\\])"
- );
- function expandSingleElementArray(array2) {
- if (array2.length === 1) {
- return array2[0];
- }
- return array2;
- }
- function _createForOfIteratorHelperLoose$1(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$3(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$3(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$3(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$3(o2, minLen);
- }
- function _arrayLikeToArray$3(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function _classCallCheck$3(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties$3(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$3(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$3(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$3(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var PatternMatcher = /* @__PURE__ */ function() {
- function PatternMatcher2(pattern2) {
- _classCallCheck$3(this, PatternMatcher2);
- this.matchTree = new PatternParser().parse(pattern2);
- }
- _createClass$3(PatternMatcher2, [{
- key: "match",
- value: function match(string) {
- var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, allowOverflow = _ref.allowOverflow;
- if (!string) {
- throw new Error("String is required");
- }
- var result2 = _match(string.split(""), this.matchTree, true);
- if (result2 && result2.match) {
- delete result2.matchedChars;
- }
- if (result2 && result2.overflow) {
- if (!allowOverflow) {
- return;
- }
- }
- return result2;
- }
- }]);
- return PatternMatcher2;
- }();
- function _match(characters, tree, last) {
- if (typeof tree === "string") {
- var characterString = characters.join("");
- if (tree.indexOf(characterString) === 0) {
- if (characters.length === tree.length) {
- return {
- match: true,
- matchedChars: characters
- };
- }
- return {
- partialMatch: true
- // matchedChars: characters
- };
- }
- if (characterString.indexOf(tree) === 0) {
- if (last) {
- if (characters.length > tree.length) {
- return {
- overflow: true
- };
- }
- }
- return {
- match: true,
- matchedChars: characters.slice(0, tree.length)
- };
- }
- return;
- }
- if (Array.isArray(tree)) {
- var restCharacters = characters.slice();
- var i2 = 0;
- while (i2 < tree.length) {
- var subtree = tree[i2];
- var result2 = _match(restCharacters, subtree, last && i2 === tree.length - 1);
- if (!result2) {
- return;
- } else if (result2.overflow) {
- return result2;
- } else if (result2.match) {
- restCharacters = restCharacters.slice(result2.matchedChars.length);
- if (restCharacters.length === 0) {
- if (i2 === tree.length - 1) {
- return {
- match: true,
- matchedChars: characters
- };
- } else {
- return {
- partialMatch: true
- // matchedChars: characters
- };
- }
- }
- } else {
- if (result2.partialMatch) {
- return {
- partialMatch: true
- // matchedChars: characters
- };
- } else {
- throw new Error("Unsupported match result:\n".concat(JSON.stringify(result2, null, 2)));
- }
- }
- i2++;
- }
- if (last) {
- return {
- overflow: true
- };
- }
- return {
- match: true,
- matchedChars: characters.slice(0, characters.length - restCharacters.length)
- };
- }
- switch (tree.op) {
- case "|":
- var partialMatch;
- for (var _iterator = _createForOfIteratorHelperLoose$1(tree.args), _step; !(_step = _iterator()).done; ) {
- var branch = _step.value;
- var _result = _match(characters, branch, last);
- if (_result) {
- if (_result.overflow) {
- return _result;
- } else if (_result.match) {
- return {
- match: true,
- matchedChars: _result.matchedChars
- };
- } else {
- if (_result.partialMatch) {
- partialMatch = true;
- } else {
- throw new Error("Unsupported match result:\n".concat(JSON.stringify(_result, null, 2)));
- }
- }
- }
- }
- if (partialMatch) {
- return {
- partialMatch: true
- // matchedChars: ...
- };
- }
- return;
- case "[]":
- for (var _iterator2 = _createForOfIteratorHelperLoose$1(tree.args), _step2; !(_step2 = _iterator2()).done; ) {
- var _char = _step2.value;
- if (characters[0] === _char) {
- if (characters.length === 1) {
- return {
- match: true,
- matchedChars: characters
- };
- }
- if (last) {
- return {
- overflow: true
- };
- }
- return {
- match: true,
- matchedChars: [_char]
- };
- }
- }
- return;
- default:
- throw new Error("Unsupported instruction tree: ".concat(tree));
- }
- }
- function _createForOfIteratorHelperLoose(o2, allowArrayLike) {
- var it2 = typeof Symbol !== "undefined" && o2[Symbol.iterator] || o2["@@iterator"];
- if (it2)
- return (it2 = it2.call(o2)).next.bind(it2);
- if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray$2(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
- if (it2)
- o2 = it2;
- var i2 = 0;
- return function() {
- if (i2 >= o2.length)
- return { done: true };
- return { done: false, value: o2[i2++] };
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$2(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$2(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$2(o2, minLen);
- }
- function _arrayLikeToArray$2(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function _classCallCheck$2(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties$2(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$2(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$2(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$2(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var DUMMY_DIGIT = "9";
- var LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15;
- var LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH);
- var NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/;
- var CREATE_CHARACTER_CLASS_PATTERN = function() {
- return /\[([^\[\]])*\]/g;
- };
- var CREATE_STANDALONE_DIGIT_PATTERN = function() {
- return /\d(?=[^,}][^,}])/g;
- };
- var NON_ALTERING_FORMAT_REG_EXP = new RegExp("[" + VALID_PUNCTUATION + "]*\\$1[" + VALID_PUNCTUATION + "]*(\\$\\d[" + VALID_PUNCTUATION + "]*)*$");
- var MIN_LEADING_DIGITS_LENGTH = 3;
- var AsYouTypeFormatter = /* @__PURE__ */ function() {
- function AsYouTypeFormatter2(_ref) {
- _ref.state;
- var metadata2 = _ref.metadata;
- _classCallCheck$2(this, AsYouTypeFormatter2);
- this.metadata = metadata2;
- this.resetFormat();
- }
- _createClass$2(AsYouTypeFormatter2, [{
- key: "resetFormat",
- value: function resetFormat() {
- this.chosenFormat = void 0;
- this.template = void 0;
- this.nationalNumberTemplate = void 0;
- this.populatedNationalNumberTemplate = void 0;
- this.populatedNationalNumberTemplatePosition = -1;
- }
- }, {
- key: "reset",
- value: function reset(numberingPlan, state) {
- this.resetFormat();
- if (numberingPlan) {
- this.isNANP = numberingPlan.callingCode() === "1";
- this.matchingFormats = numberingPlan.formats();
- if (state.nationalSignificantNumber) {
- this.narrowDownMatchingFormats(state);
- }
- } else {
- this.isNANP = void 0;
- this.matchingFormats = [];
- }
- }
- /**
- * Formats an updated phone number.
- * @param {string} nextDigits — Additional phone number digits.
- * @param {object} state — `AsYouType` state.
- * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.
- */
- }, {
- key: "format",
- value: function format2(nextDigits, state) {
- var _this = this;
- if (canFormatCompleteNumber(state.nationalSignificantNumber, this.metadata)) {
- for (var _iterator = _createForOfIteratorHelperLoose(this.matchingFormats), _step; !(_step = _iterator()).done; ) {
- var format3 = _step.value;
- var formattedCompleteNumber = formatCompleteNumber(state, format3, {
- metadata: this.metadata,
- shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format4) {
- return _this.shouldTryNationalPrefixFormattingRule(format4, {
- international: state.international,
- nationalPrefix: state.nationalPrefix
- });
- },
- getSeparatorAfterNationalPrefix: function getSeparatorAfterNationalPrefix(format4) {
- return _this.getSeparatorAfterNationalPrefix(format4);
- }
- });
- if (formattedCompleteNumber) {
- this.resetFormat();
- this.chosenFormat = format3;
- this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\d/g, DIGIT_PLACEHOLDER), state);
- this.populatedNationalNumberTemplate = formattedCompleteNumber;
- this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);
- return formattedCompleteNumber;
- }
- }
- }
- return this.formatNationalNumberWithNextDigits(nextDigits, state);
- }
- // Formats the next phone number digits.
- }, {
- key: "formatNationalNumberWithNextDigits",
- value: function formatNationalNumberWithNextDigits(nextDigits, state) {
- var previouslyChosenFormat = this.chosenFormat;
- var newlyChosenFormat = this.chooseFormat(state);
- if (newlyChosenFormat) {
- if (newlyChosenFormat === previouslyChosenFormat) {
- return this.formatNextNationalNumberDigits(nextDigits);
- } else {
- return this.formatNextNationalNumberDigits(state.getNationalDigits());
- }
- }
- }
- }, {
- key: "narrowDownMatchingFormats",
- value: function narrowDownMatchingFormats(_ref2) {
- var _this2 = this;
- var nationalSignificantNumber = _ref2.nationalSignificantNumber, nationalPrefix = _ref2.nationalPrefix, international = _ref2.international;
- var leadingDigits = nationalSignificantNumber;
- var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;
- if (leadingDigitsPatternIndex < 0) {
- leadingDigitsPatternIndex = 0;
- }
- this.matchingFormats = this.matchingFormats.filter(function(format2) {
- return _this2.formatSuits(format2, international, nationalPrefix) && _this2.formatMatches(format2, leadingDigits, leadingDigitsPatternIndex);
- });
- if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {
- this.resetFormat();
- }
- }
- }, {
- key: "formatSuits",
- value: function formatSuits(format2, international, nationalPrefix) {
- if (nationalPrefix && !format2.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&
- !format2.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {
- return false;
- }
- if (!international && !nationalPrefix && format2.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {
- return false;
- }
- return true;
- }
- }, {
- key: "formatMatches",
- value: function formatMatches(format2, leadingDigits, leadingDigitsPatternIndex) {
- var leadingDigitsPatternsCount = format2.leadingDigitsPatterns().length;
- if (leadingDigitsPatternsCount === 0) {
- return true;
- }
- leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);
- var leadingDigitsPattern = format2.leadingDigitsPatterns()[leadingDigitsPatternIndex];
- if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {
- try {
- return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {
- allowOverflow: true
- }) !== void 0;
- } catch (error2) {
- formatAppLog("error", "at node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js:343", error2);
- return true;
- }
- }
- return new RegExp("^(".concat(leadingDigitsPattern, ")")).test(leadingDigits);
- }
- }, {
- key: "getFormatFormat",
- value: function getFormatFormat(format2, international) {
- return international ? format2.internationalFormat() : format2.format();
- }
- }, {
- key: "chooseFormat",
- value: function chooseFormat(state) {
- var _this3 = this;
- var _loop = function _loop2() {
- var format2 = _step2.value;
- if (_this3.chosenFormat === format2) {
- return "break";
- }
- if (!NON_ALTERING_FORMAT_REG_EXP.test(_this3.getFormatFormat(format2, state.international))) {
- return "continue";
- }
- if (!_this3.createTemplateForFormat(format2, state)) {
- _this3.matchingFormats = _this3.matchingFormats.filter(function(_2) {
- return _2 !== format2;
- });
- return "continue";
- }
- _this3.chosenFormat = format2;
- return "break";
- };
- for (var _iterator2 = _createForOfIteratorHelperLoose(this.matchingFormats.slice()), _step2; !(_step2 = _iterator2()).done; ) {
- var _ret = _loop();
- if (_ret === "break")
- break;
- if (_ret === "continue")
- continue;
- }
- if (!this.chosenFormat) {
- this.resetFormat();
- }
- return this.chosenFormat;
- }
- }, {
- key: "createTemplateForFormat",
- value: function createTemplateForFormat(format2, state) {
- if (format2.pattern().indexOf("|") >= 0) {
- return;
- }
- var template = this.getTemplateForFormat(format2, state);
- if (template) {
- this.setNationalNumberTemplate(template, state);
- return true;
- }
- }
- }, {
- key: "getSeparatorAfterNationalPrefix",
- value: function getSeparatorAfterNationalPrefix(format2) {
- if (this.isNANP) {
- return " ";
- }
- if (format2 && format2.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format2.nationalPrefixFormattingRule())) {
- return " ";
- }
- return "";
- }
- }, {
- key: "getInternationalPrefixBeforeCountryCallingCode",
- value: function getInternationalPrefixBeforeCountryCallingCode(_ref3, options2) {
- var IDDPrefix = _ref3.IDDPrefix, missingPlus = _ref3.missingPlus;
- if (IDDPrefix) {
- return options2 && options2.spacing === false ? IDDPrefix : IDDPrefix + " ";
- }
- if (missingPlus) {
- return "";
- }
- return "+";
- }
- }, {
- key: "getTemplate",
- value: function getTemplate(state) {
- if (!this.template) {
- return;
- }
- var index2 = -1;
- var i2 = 0;
- var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {
- spacing: false
- }) : "";
- while (i2 < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {
- index2 = this.template.indexOf(DIGIT_PLACEHOLDER, index2 + 1);
- i2++;
- }
- return cutAndStripNonPairedParens(this.template, index2 + 1);
- }
- }, {
- key: "setNationalNumberTemplate",
- value: function setNationalNumberTemplate(template, state) {
- this.nationalNumberTemplate = template;
- this.populatedNationalNumberTemplate = template;
- this.populatedNationalNumberTemplatePosition = -1;
- if (state.international) {
- this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\d\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + " " + template;
- } else {
- this.template = template;
- }
- }
- /**
- * Generates formatting template for a national phone number,
- * optionally containing a national prefix, for a format.
- * @param {Format} format
- * @param {string} nationalPrefix
- * @return {string}
- */
- }, {
- key: "getTemplateForFormat",
- value: function getTemplateForFormat(format2, _ref4) {
- var nationalSignificantNumber = _ref4.nationalSignificantNumber, international = _ref4.international, nationalPrefix = _ref4.nationalPrefix, complexPrefixBeforeNationalSignificantNumber = _ref4.complexPrefixBeforeNationalSignificantNumber;
- var pattern2 = format2.pattern();
- {
- pattern2 = pattern2.replace(CREATE_CHARACTER_CLASS_PATTERN(), "\\d").replace(CREATE_STANDALONE_DIGIT_PATTERN(), "\\d");
- }
- var digits2 = LONGEST_DUMMY_PHONE_NUMBER.match(pattern2)[0];
- if (nationalSignificantNumber.length > digits2.length) {
- return;
- }
- var strictPattern = new RegExp("^" + pattern2 + "$");
- var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\d/g, DUMMY_DIGIT);
- if (strictPattern.test(nationalNumberDummyDigits)) {
- digits2 = nationalNumberDummyDigits;
- }
- var numberFormat = this.getFormatFormat(format2, international);
- var nationalPrefixIncludedInTemplate;
- if (this.shouldTryNationalPrefixFormattingRule(format2, {
- international,
- nationalPrefix
- })) {
- var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format2.nationalPrefixFormattingRule());
- if (parseDigits(format2.nationalPrefixFormattingRule()) === (nationalPrefix || "") + parseDigits("$1")) {
- numberFormat = numberFormatWithNationalPrefix;
- nationalPrefixIncludedInTemplate = true;
- if (nationalPrefix) {
- var i2 = nationalPrefix.length;
- while (i2 > 0) {
- numberFormat = numberFormat.replace(/\d/, DIGIT_PLACEHOLDER);
- i2--;
- }
- }
- }
- }
- var template = digits2.replace(new RegExp(pattern2), numberFormat).replace(new RegExp(DUMMY_DIGIT, "g"), DIGIT_PLACEHOLDER);
- if (!nationalPrefixIncludedInTemplate) {
- if (complexPrefixBeforeNationalSignificantNumber) {
- template = repeat(DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.length) + " " + template;
- } else if (nationalPrefix) {
- template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format2) + template;
- }
- }
- if (international) {
- template = applyInternationalSeparatorStyle(template);
- }
- return template;
- }
- }, {
- key: "formatNextNationalNumberDigits",
- value: function formatNextNationalNumberDigits(digits2) {
- var result2 = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits2);
- if (!result2) {
- this.resetFormat();
- return;
- }
- this.populatedNationalNumberTemplate = result2[0];
- this.populatedNationalNumberTemplatePosition = result2[1];
- return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1);
- }
- }, {
- key: "shouldTryNationalPrefixFormattingRule",
- value: function shouldTryNationalPrefixFormattingRule(format2, _ref5) {
- var international = _ref5.international, nationalPrefix = _ref5.nationalPrefix;
- if (format2.nationalPrefixFormattingRule()) {
- var usesNationalPrefix = format2.usesNationalPrefix();
- if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {
- return true;
- }
- }
- }
- }]);
- return AsYouTypeFormatter2;
- }();
- function _slicedToArray$1(arr, i2) {
- return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i2) || _unsupportedIterableToArray$1(arr, i2) || _nonIterableRest$1();
- }
- function _nonIterableRest$1() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray$1(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray$1(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray$1(o2, minLen);
- }
- function _arrayLikeToArray$1(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function _iterableToArrayLimit$1(arr, i2) {
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
- if (_i == null)
- return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s2, _e2;
- try {
- for (_i = _i.call(arr); !(_n = (_s2 = _i.next()).done); _n = true) {
- _arr.push(_s2.value);
- if (i2 && _arr.length === i2)
- break;
- }
- } catch (err) {
- _d = true;
- _e2 = err;
- } finally {
- try {
- if (!_n && _i["return"] != null)
- _i["return"]();
- } finally {
- if (_d)
- throw _e2;
- }
- }
- return _arr;
- }
- function _arrayWithHoles$1(arr) {
- if (Array.isArray(arr))
- return arr;
- }
- function _classCallCheck$1(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties$1(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass$1(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties$1(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties$1(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = "[" + VALID_PUNCTUATION + VALID_DIGITS + "]+";
- var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp("^" + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + "$", "i");
- var VALID_FORMATTED_PHONE_NUMBER_PART = "(?:[" + PLUS_CHARS + "][" + VALID_PUNCTUATION + VALID_DIGITS + "]*|[" + VALID_PUNCTUATION + VALID_DIGITS + "]+)";
- var AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp("[^" + VALID_PUNCTUATION + VALID_DIGITS + "]+.*$");
- var COMPLEX_NATIONAL_PREFIX = /[^\d\[\]]/;
- var AsYouTypeParser = /* @__PURE__ */ function() {
- function AsYouTypeParser2(_ref) {
- var defaultCountry = _ref.defaultCountry, defaultCallingCode = _ref.defaultCallingCode, metadata2 = _ref.metadata, onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;
- _classCallCheck$1(this, AsYouTypeParser2);
- this.defaultCountry = defaultCountry;
- this.defaultCallingCode = defaultCallingCode;
- this.metadata = metadata2;
- this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;
- }
- _createClass$1(AsYouTypeParser2, [{
- key: "input",
- value: function input(text, state) {
- var _extractFormattedDigi = extractFormattedDigitsAndPlus(text), _extractFormattedDigi2 = _slicedToArray$1(_extractFormattedDigi, 2), formattedDigits = _extractFormattedDigi2[0], hasPlus = _extractFormattedDigi2[1];
- var digits2 = parseDigits(formattedDigits);
- var justLeadingPlus;
- if (hasPlus) {
- if (!state.digits) {
- state.startInternationalNumber();
- if (!digits2) {
- justLeadingPlus = true;
- }
- }
- }
- if (digits2) {
- this.inputDigits(digits2, state);
- }
- return {
- digits: digits2,
- justLeadingPlus
- };
- }
- /**
- * Inputs "next" phone number digits.
- * @param {string} digits
- * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage".
- */
- }, {
- key: "inputDigits",
- value: function inputDigits(nextDigits, state) {
- var digits2 = state.digits;
- var hasReceivedThreeLeadingDigits = digits2.length < 3 && digits2.length + nextDigits.length >= 3;
- state.appendDigits(nextDigits);
- if (hasReceivedThreeLeadingDigits) {
- this.extractIddPrefix(state);
- }
- if (this.isWaitingForCountryCallingCode(state)) {
- if (!this.extractCountryCallingCode(state)) {
- return;
- }
- } else {
- state.appendNationalSignificantNumberDigits(nextDigits);
- }
- if (!state.international) {
- if (!this.hasExtractedNationalSignificantNumber) {
- this.extractNationalSignificantNumber(state.getNationalDigits(), function(stateUpdate) {
- return state.update(stateUpdate);
- });
- }
- }
- }
- }, {
- key: "isWaitingForCountryCallingCode",
- value: function isWaitingForCountryCallingCode(_ref2) {
- var international = _ref2.international, callingCode = _ref2.callingCode;
- return international && !callingCode;
- }
- // Extracts a country calling code from a number
- // being entered in internatonal format.
- }, {
- key: "extractCountryCallingCode",
- value: function extractCountryCallingCode$1(state) {
- var _extractCountryCallin = extractCountryCallingCode("+" + state.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), countryCallingCode = _extractCountryCallin.countryCallingCode, number2 = _extractCountryCallin.number;
- if (countryCallingCode) {
- state.setCallingCode(countryCallingCode);
- state.update({
- nationalSignificantNumber: number2
- });
- return true;
- }
- }
- }, {
- key: "reset",
- value: function reset(numberingPlan) {
- if (numberingPlan) {
- this.hasSelectedNumberingPlan = true;
- var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();
- this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);
- } else {
- this.hasSelectedNumberingPlan = void 0;
- this.couldPossiblyExtractAnotherNationalSignificantNumber = void 0;
- }
- }
- /**
- * Extracts a national (significant) number from user input.
- * Google's library is different in that it only applies `national_prefix_for_parsing`
- * and doesn't apply `national_prefix_transform_rule` after that.
- * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539
- * @return {boolean} [extracted]
- */
- }, {
- key: "extractNationalSignificantNumber",
- value: function extractNationalSignificantNumber(nationalDigits, setState) {
- if (!this.hasSelectedNumberingPlan) {
- return;
- }
- var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe.nationalPrefix, nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
- if (nationalNumber === nationalDigits) {
- return;
- }
- this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
- return true;
- }
- /**
- * In Google's code this function is called "attempt to extract longer NDD".
- * "Some national prefixes are a substring of others", they say.
- * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.
- */
- }, {
- key: "extractAnotherNationalSignificantNumber",
- value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {
- if (!this.hasExtractedNationalSignificantNumber) {
- return this.extractNationalSignificantNumber(nationalDigits, setState);
- }
- if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {
- return;
- }
- var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe2.nationalPrefix, nationalNumber = _extractNationalNumbe2.nationalNumber, carrierCode = _extractNationalNumbe2.carrierCode;
- if (nationalNumber === prevNationalSignificantNumber) {
- return;
- }
- this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
- return true;
- }
- }, {
- key: "onExtractedNationalNumber",
- value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {
- var complexPrefixBeforeNationalSignificantNumber;
- var nationalSignificantNumberMatchesInput;
- var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber);
- if (nationalSignificantNumberIndex >= 0 && nationalSignificantNumberIndex === nationalDigits.length - nationalSignificantNumber.length) {
- nationalSignificantNumberMatchesInput = true;
- var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex);
- if (prefixBeforeNationalNumber !== nationalPrefix) {
- complexPrefixBeforeNationalSignificantNumber = prefixBeforeNationalNumber;
- }
- }
- setState({
- nationalPrefix,
- carrierCode,
- nationalSignificantNumber,
- nationalSignificantNumberMatchesInput,
- complexPrefixBeforeNationalSignificantNumber
- });
- this.hasExtractedNationalSignificantNumber = true;
- this.onNationalSignificantNumberChange();
- }
- }, {
- key: "reExtractNationalSignificantNumber",
- value: function reExtractNationalSignificantNumber(state) {
- if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, function(stateUpdate) {
- return state.update(stateUpdate);
- })) {
- return true;
- }
- if (this.extractIddPrefix(state)) {
- this.extractCallingCodeAndNationalSignificantNumber(state);
- return true;
- }
- if (this.fixMissingPlus(state)) {
- this.extractCallingCodeAndNationalSignificantNumber(state);
- return true;
- }
- }
- }, {
- key: "extractIddPrefix",
- value: function extractIddPrefix(state) {
- var international = state.international, IDDPrefix = state.IDDPrefix, digits2 = state.digits;
- state.nationalSignificantNumber;
- if (international || IDDPrefix) {
- return;
- }
- var numberWithoutIDD = stripIddPrefix(digits2, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);
- if (numberWithoutIDD !== void 0 && numberWithoutIDD !== digits2) {
- state.update({
- IDDPrefix: digits2.slice(0, digits2.length - numberWithoutIDD.length)
- });
- this.startInternationalNumber(state, {
- country: void 0,
- callingCode: void 0
- });
- return true;
- }
- }
- }, {
- key: "fixMissingPlus",
- value: function fixMissingPlus(state) {
- if (!state.international) {
- var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), newCallingCode = _extractCountryCallin2.countryCallingCode;
- _extractCountryCallin2.number;
- if (newCallingCode) {
- state.update({
- missingPlus: true
- });
- this.startInternationalNumber(state, {
- country: state.country,
- callingCode: newCallingCode
- });
- return true;
- }
- }
- }
- }, {
- key: "startInternationalNumber",
- value: function startInternationalNumber(state, _ref3) {
- var country = _ref3.country, callingCode = _ref3.callingCode;
- state.startInternationalNumber(country, callingCode);
- if (state.nationalSignificantNumber) {
- state.resetNationalSignificantNumber();
- this.onNationalSignificantNumberChange();
- this.hasExtractedNationalSignificantNumber = void 0;
- }
- }
- }, {
- key: "extractCallingCodeAndNationalSignificantNumber",
- value: function extractCallingCodeAndNationalSignificantNumber(state) {
- if (this.extractCountryCallingCode(state)) {
- this.extractNationalSignificantNumber(state.getNationalDigits(), function(stateUpdate) {
- return state.update(stateUpdate);
- });
- }
- }
- }]);
- return AsYouTypeParser2;
- }();
- function extractFormattedPhoneNumber(text) {
- var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);
- if (startsAt < 0) {
- return;
- }
- text = text.slice(startsAt);
- var hasPlus;
- if (text[0] === "+") {
- hasPlus = true;
- text = text.slice("+".length);
- }
- text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, "");
- if (hasPlus) {
- text = "+" + text;
- }
- return text;
- }
- function _extractFormattedDigitsAndPlus(text) {
- var extractedNumber = extractFormattedPhoneNumber(text) || "";
- if (extractedNumber[0] === "+") {
- return [extractedNumber.slice("+".length), true];
- }
- return [extractedNumber];
- }
- function extractFormattedDigitsAndPlus(text) {
- var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text), _extractFormattedDigi4 = _slicedToArray$1(_extractFormattedDigi3, 2), formattedDigits = _extractFormattedDigi4[0], hasPlus = _extractFormattedDigi4[1];
- if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {
- formattedDigits = "";
- }
- return [formattedDigits, hasPlus];
- }
- function _slicedToArray(arr, i2) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
- }
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- function _unsupportedIterableToArray(o2, minLen) {
- if (!o2)
- return;
- if (typeof o2 === "string")
- return _arrayLikeToArray(o2, minLen);
- var n2 = Object.prototype.toString.call(o2).slice(8, -1);
- if (n2 === "Object" && o2.constructor)
- n2 = o2.constructor.name;
- if (n2 === "Map" || n2 === "Set")
- return Array.from(o2);
- if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
- return _arrayLikeToArray(o2, minLen);
- }
- function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
- arr2[i2] = arr[i2];
- }
- return arr2;
- }
- function _iterableToArrayLimit(arr, i2) {
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
- if (_i == null)
- return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s2, _e2;
- try {
- for (_i = _i.call(arr); !(_n = (_s2 = _i.next()).done); _n = true) {
- _arr.push(_s2.value);
- if (i2 && _arr.length === i2)
- break;
- }
- } catch (err) {
- _d = true;
- _e2 = err;
- } finally {
- try {
- if (!_n && _i["return"] != null)
- _i["return"]();
- } finally {
- if (_d)
- throw _e2;
- }
- }
- return _arr;
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr))
- return arr;
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties(target, props) {
- for (var i2 = 0; i2 < props.length; i2++) {
- var descriptor = props[i2];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties(Constructor, staticProps);
- Object.defineProperty(Constructor, "prototype", { writable: false });
- return Constructor;
- }
- var AsYouType$1 = /* @__PURE__ */ function() {
- function AsYouType2(optionsOrDefaultCountry, metadata2) {
- _classCallCheck(this, AsYouType2);
- this.metadata = new Metadata(metadata2);
- var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry), _this$getCountryAndCa2 = _slicedToArray(_this$getCountryAndCa, 2), defaultCountry = _this$getCountryAndCa2[0], defaultCallingCode = _this$getCountryAndCa2[1];
- this.defaultCountry = defaultCountry;
- this.defaultCallingCode = defaultCallingCode;
- this.reset();
- }
- _createClass(AsYouType2, [{
- key: "getCountryAndCallingCode",
- value: function getCountryAndCallingCode(optionsOrDefaultCountry) {
- var defaultCountry;
- var defaultCallingCode;
- if (optionsOrDefaultCountry) {
- if (isObject$2(optionsOrDefaultCountry)) {
- defaultCountry = optionsOrDefaultCountry.defaultCountry;
- defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;
- } else {
- defaultCountry = optionsOrDefaultCountry;
- }
- }
- if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {
- defaultCountry = void 0;
- }
- return [defaultCountry, defaultCallingCode];
- }
- /**
- * Inputs "next" phone number characters.
- * @param {string} text
- * @return {string} Formatted phone number characters that have been input so far.
- */
- }, {
- key: "input",
- value: function input(text) {
- var _this$parser$input = this.parser.input(text, this.state), digits2 = _this$parser$input.digits, justLeadingPlus = _this$parser$input.justLeadingPlus;
- if (justLeadingPlus) {
- this.formattedOutput = "+";
- } else if (digits2) {
- this.determineTheCountryIfNeeded();
- if (this.state.nationalSignificantNumber) {
- this.formatter.narrowDownMatchingFormats(this.state);
- }
- var formattedNationalNumber;
- if (this.metadata.hasSelectedNumberingPlan()) {
- formattedNationalNumber = this.formatter.format(digits2, this.state);
- }
- if (formattedNationalNumber === void 0) {
- if (this.parser.reExtractNationalSignificantNumber(this.state)) {
- this.determineTheCountryIfNeeded();
- var nationalDigits = this.state.getNationalDigits();
- if (nationalDigits) {
- formattedNationalNumber = this.formatter.format(nationalDigits, this.state);
- }
- }
- }
- this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();
- }
- return this.formattedOutput;
- }
- }, {
- key: "reset",
- value: function reset() {
- var _this = this;
- this.state = new AsYouTypeState({
- onCountryChange: function onCountryChange(country) {
- _this.country = country;
- },
- onCallingCodeChange: function onCallingCodeChange(callingCode, country) {
- _this.metadata.selectNumberingPlan(country, callingCode);
- _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
- _this.parser.reset(_this.metadata.numberingPlan);
- }
- });
- this.formatter = new AsYouTypeFormatter({
- state: this.state,
- metadata: this.metadata
- });
- this.parser = new AsYouTypeParser({
- defaultCountry: this.defaultCountry,
- defaultCallingCode: this.defaultCallingCode,
- metadata: this.metadata,
- state: this.state,
- onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {
- _this.determineTheCountryIfNeeded();
- _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
- }
- });
- this.state.reset({
- country: this.defaultCountry,
- callingCode: this.defaultCallingCode
- });
- this.formattedOutput = "";
- return this;
- }
- /**
- * Returns `true` if the phone number is being input in international format.
- * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
- * @return {boolean}
- */
- }, {
- key: "isInternational",
- value: function isInternational() {
- return this.state.international;
- }
- /**
- * Returns the "calling code" part of the phone number when it's being input
- * in an international format.
- * If no valid calling code has been entered so far, returns `undefined`.
- * @return {string} [callingCode]
- */
- }, {
- key: "getCallingCode",
- value: function getCallingCode() {
- if (this.isInternational()) {
- return this.state.callingCode;
- }
- }
- // A legacy alias.
- }, {
- key: "getCountryCallingCode",
- value: function getCountryCallingCode2() {
- return this.getCallingCode();
- }
- /**
- * Returns a two-letter country code of the phone number.
- * Returns `undefined` for "non-geographic" phone numbering plans.
- * Returns `undefined` if no phone number has been input yet.
- * @return {string} [country]
- */
- }, {
- key: "getCountry",
- value: function getCountry() {
- var digits2 = this.state.digits;
- if (digits2) {
- return this._getCountry();
- }
- }
- /**
- * Returns a two-letter country code of the phone number.
- * Returns `undefined` for "non-geographic" phone numbering plans.
- * @return {string} [country]
- */
- }, {
- key: "_getCountry",
- value: function _getCountry() {
- var country = this.state.country;
- return country;
- }
- }, {
- key: "determineTheCountryIfNeeded",
- value: function determineTheCountryIfNeeded() {
- if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {
- this.determineTheCountry();
- }
- }
- // Prepends `+CountryCode ` in case of an international phone number
- }, {
- key: "getFullNumber",
- value: function getFullNumber(formattedNationalNumber) {
- var _this2 = this;
- if (this.isInternational()) {
- var prefix = function prefix2(text) {
- return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {
- spacing: text ? true : false
- }) + text;
- };
- var callingCode = this.state.callingCode;
- if (!callingCode) {
- return prefix("".concat(this.state.getDigitsWithoutInternationalPrefix()));
- }
- if (!formattedNationalNumber) {
- return prefix(callingCode);
- }
- return prefix("".concat(callingCode, " ").concat(formattedNationalNumber));
- }
- return formattedNationalNumber;
- }
- }, {
- key: "getNonFormattedNationalNumberWithPrefix",
- value: function getNonFormattedNationalNumberWithPrefix() {
- var _this$state = this.state, nationalSignificantNumber = _this$state.nationalSignificantNumber, complexPrefixBeforeNationalSignificantNumber = _this$state.complexPrefixBeforeNationalSignificantNumber, nationalPrefix = _this$state.nationalPrefix;
- var number2 = nationalSignificantNumber;
- var prefix = complexPrefixBeforeNationalSignificantNumber || nationalPrefix;
- if (prefix) {
- number2 = prefix + number2;
- }
- return number2;
- }
- }, {
- key: "getNonFormattedNumber",
- value: function getNonFormattedNumber() {
- var nationalSignificantNumberMatchesInput = this.state.nationalSignificantNumberMatchesInput;
- return this.getFullNumber(nationalSignificantNumberMatchesInput ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits());
- }
- }, {
- key: "getNonFormattedTemplate",
- value: function getNonFormattedTemplate() {
- var number2 = this.getNonFormattedNumber();
- if (number2) {
- return number2.replace(/[\+\d]/g, DIGIT_PLACEHOLDER);
- }
- }
- }, {
- key: "isCountryCallingCodeAmbiguous",
- value: function isCountryCallingCodeAmbiguous() {
- var callingCode = this.state.callingCode;
- var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);
- return countryCodes && countryCodes.length > 1;
- }
- // Determines the country of the phone number
- // entered so far based on the country phone code
- // and the national phone number.
- }, {
- key: "determineTheCountry",
- value: function determineTheCountry() {
- this.state.setCountry(getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {
- nationalNumber: this.state.nationalSignificantNumber,
- defaultCountry: this.defaultCountry,
- metadata: this.metadata
- }));
- }
- /**
- * Returns a E.164 phone number value for the user's input.
- *
- * For example, for country `"US"` and input `"(222) 333-4444"`
- * it will return `"+12223334444"`.
- *
- * For international phone number input, it will also auto-correct
- * some minor errors such as using a national prefix when writing
- * an international phone number. For example, if the user inputs
- * `"+44 0 7400 000000"` then it will return an auto-corrected
- * `"+447400000000"` phone number value.
- *
- * Will return `undefined` if no digits have been input,
- * or when inputting a phone number in national format and no
- * default country or default "country calling code" have been set.
- *
- * @return {string} [value]
- */
- }, {
- key: "getNumberValue",
- value: function getNumberValue() {
- var _this$state2 = this.state, digits2 = _this$state2.digits, callingCode = _this$state2.callingCode, country = _this$state2.country, nationalSignificantNumber = _this$state2.nationalSignificantNumber;
- if (!digits2) {
- return;
- }
- if (this.isInternational()) {
- if (callingCode) {
- return "+" + callingCode + nationalSignificantNumber;
- } else {
- return "+" + digits2;
- }
- } else {
- if (country || callingCode) {
- var callingCode_ = country ? this.metadata.countryCallingCode() : callingCode;
- return "+" + callingCode_ + nationalSignificantNumber;
- }
- }
- }
- /**
- * Returns an instance of `PhoneNumber` class.
- * Will return `undefined` if no national (significant) number
- * digits have been entered so far, or if no `defaultCountry` has been
- * set and the user enters a phone number not in international format.
- */
- }, {
- key: "getNumber",
- value: function getNumber() {
- var _this$state3 = this.state, nationalSignificantNumber = _this$state3.nationalSignificantNumber, carrierCode = _this$state3.carrierCode, callingCode = _this$state3.callingCode;
- var country = this._getCountry();
- if (!nationalSignificantNumber) {
- return;
- }
- if (!country && !callingCode) {
- return;
- }
- if (country) {
- if (country === this.defaultCountry) {
- var metadata2 = new Metadata(this.metadata.metadata);
- metadata2.selectNumberingPlan(country);
- var _callingCode = metadata2.numberingPlan.callingCode();
- var ambiguousCountries = this.metadata.getCountryCodesForCallingCode(_callingCode);
- if (ambiguousCountries.length > 1) {
- var exactCountry = getCountryByNationalNumber(nationalSignificantNumber, {
- countries: ambiguousCountries,
- defaultCountry: this.defaultCountry,
- metadata: this.metadata.metadata
- });
- if (exactCountry) {
- country = exactCountry;
- }
- }
- }
- }
- var phoneNumber = new PhoneNumber(country || callingCode, nationalSignificantNumber, this.metadata.metadata);
- if (carrierCode) {
- phoneNumber.carrierCode = carrierCode;
- }
- return phoneNumber;
- }
- /**
- * Returns `true` if the phone number is "possible".
- * Is just a shortcut for `PhoneNumber.isPossible()`.
- * @return {boolean}
- */
- }, {
- key: "isPossible",
- value: function isPossible() {
- var phoneNumber = this.getNumber();
- if (!phoneNumber) {
- return false;
- }
- return phoneNumber.isPossible();
- }
- /**
- * Returns `true` if the phone number is "valid".
- * Is just a shortcut for `PhoneNumber.isValid()`.
- * @return {boolean}
- */
- }, {
- key: "isValid",
- value: function isValid() {
- var phoneNumber = this.getNumber();
- if (!phoneNumber) {
- return false;
- }
- return phoneNumber.isValid();
- }
- /**
- * @deprecated
- * This method is used in `react-phone-number-input/source/input-control.js`
- * in versions before `3.0.16`.
- */
- }, {
- key: "getNationalNumber",
- value: function getNationalNumber() {
- return this.state.nationalSignificantNumber;
- }
- /**
- * Returns the phone number characters entered by the user.
- * @return {string}
- */
- }, {
- key: "getChars",
- value: function getChars() {
- return (this.state.international ? "+" : "") + this.state.digits;
- }
- /**
- * Returns the template for the formatted phone number.
- * @return {string}
- */
- }, {
- key: "getTemplate",
- value: function getTemplate() {
- return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || "";
- }
- }]);
- return AsYouType2;
- }();
- function parsePhoneNumber$1() {
- return withMetadataArgument$1(parsePhoneNumber$2, arguments);
- }
- function AsYouType(country) {
- return AsYouType$1.call(this, country, metadata$1);
- }
- AsYouType.prototype = Object.create(AsYouType$1.prototype, {});
- AsYouType.prototype.constructor = AsYouType;
- const metadata = { "version": 4, "country_calling_codes": { "1": ["US", "AG", "AI", "AS", "BB", "BM", "BS", "CA", "DM", "DO", "GD", "GU", "JM", "KN", "KY", "LC", "MP", "MS", "PR", "SX", "TC", "TT", "VC", "VG", "VI"], "7": ["RU", "KZ"], "20": ["EG"], "27": ["ZA"], "30": ["GR"], "31": ["NL"], "32": ["BE"], "33": ["FR"], "34": ["ES"], "36": ["HU"], "39": ["IT", "VA"], "40": ["RO"], "41": ["CH"], "43": ["AT"], "44": ["GB", "GG", "IM", "JE"], "45": ["DK"], "46": ["SE"], "47": ["NO", "SJ"], "48": ["PL"], "49": ["DE"], "51": ["PE"], "52": ["MX"], "53": ["CU"], "54": ["AR"], "55": ["BR"], "56": ["CL"], "57": ["CO"], "58": ["VE"], "60": ["MY"], "61": ["AU", "CC", "CX"], "62": ["ID"], "63": ["PH"], "64": ["NZ"], "65": ["SG"], "66": ["TH"], "81": ["JP"], "82": ["KR"], "84": ["VN"], "86": ["CN"], "90": ["TR"], "91": ["IN"], "92": ["PK"], "93": ["AF"], "94": ["LK"], "95": ["MM"], "98": ["IR"], "211": ["SS"], "212": ["MA", "EH"], "213": ["DZ"], "216": ["TN"], "218": ["LY"], "220": ["GM"], "221": ["SN"], "222": ["MR"], "223": ["ML"], "224": ["GN"], "225": ["CI"], "226": ["BF"], "227": ["NE"], "228": ["TG"], "229": ["BJ"], "230": ["MU"], "231": ["LR"], "232": ["SL"], "233": ["GH"], "234": ["NG"], "235": ["TD"], "236": ["CF"], "237": ["CM"], "238": ["CV"], "239": ["ST"], "240": ["GQ"], "241": ["GA"], "242": ["CG"], "243": ["CD"], "244": ["AO"], "245": ["GW"], "246": ["IO"], "247": ["AC"], "248": ["SC"], "249": ["SD"], "250": ["RW"], "251": ["ET"], "252": ["SO"], "253": ["DJ"], "254": ["KE"], "255": ["TZ"], "256": ["UG"], "257": ["BI"], "258": ["MZ"], "260": ["ZM"], "261": ["MG"], "262": ["RE", "YT"], "263": ["ZW"], "264": ["NA"], "265": ["MW"], "266": ["LS"], "267": ["BW"], "268": ["SZ"], "269": ["KM"], "290": ["SH", "TA"], "291": ["ER"], "297": ["AW"], "298": ["FO"], "299": ["GL"], "350": ["GI"], "351": ["PT"], "352": ["LU"], "353": ["IE"], "354": ["IS"], "355": ["AL"], "356": ["MT"], "357": ["CY"], "358": ["FI", "AX"], "359": ["BG"], "370": ["LT"], "371": ["LV"], "372": ["EE"], "373": ["MD"], "374": ["AM"], "375": ["BY"], "376": ["AD"], "377": ["MC"], "378": ["SM"], "380": ["UA"], "381": ["RS"], "382": ["ME"], "383": ["XK"], "385": ["HR"], "386": ["SI"], "387": ["BA"], "389": ["MK"], "420": ["CZ"], "421": ["SK"], "423": ["LI"], "500": ["FK"], "501": ["BZ"], "502": ["GT"], "503": ["SV"], "504": ["HN"], "505": ["NI"], "506": ["CR"], "507": ["PA"], "508": ["PM"], "509": ["HT"], "590": ["GP", "BL", "MF"], "591": ["BO"], "592": ["GY"], "593": ["EC"], "594": ["GF"], "595": ["PY"], "596": ["MQ"], "597": ["SR"], "598": ["UY"], "599": ["CW", "BQ"], "670": ["TL"], "672": ["NF"], "673": ["BN"], "674": ["NR"], "675": ["PG"], "676": ["TO"], "677": ["SB"], "678": ["VU"], "679": ["FJ"], "680": ["PW"], "681": ["WF"], "682": ["CK"], "683": ["NU"], "685": ["WS"], "686": ["KI"], "687": ["NC"], "688": ["TV"], "689": ["PF"], "690": ["TK"], "691": ["FM"], "692": ["MH"], "850": ["KP"], "852": ["HK"], "853": ["MO"], "855": ["KH"], "856": ["LA"], "880": ["BD"], "886": ["TW"], "960": ["MV"], "961": ["LB"], "962": ["JO"], "963": ["SY"], "964": ["IQ"], "965": ["KW"], "966": ["SA"], "967": ["YE"], "968": ["OM"], "970": ["PS"], "971": ["AE"], "972": ["IL"], "973": ["BH"], "974": ["QA"], "975": ["BT"], "976": ["MN"], "977": ["NP"], "992": ["TJ"], "993": ["TM"], "994": ["AZ"], "995": ["GE"], "996": ["KG"], "998": ["UZ"] }, "countries": { "AC": ["247", "00", "(?:[01589]\\d|[46])\\d{4}", [5, 6], 0, 0, 0, 0, 0, 0, 0, [0, ["4\\d{4}", [5]]]], "AD": ["376", "00", "(?:1|6\\d)\\d{7}|[135-9]\\d{5}", [6, 8, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["[135-9]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["1"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], 0, 0, 0, 0, 0, 0, [0, ["690\\d{6}|[356]\\d{5}", [6, 9]]]], "AE": ["971", "00", "(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{2,9})", "$1 $2", ["60|8"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[236]|[479][2-8]"], "0$1"], ["(\\d{3})(\\d)(\\d{5})", "$1 $2 $3", ["[479]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["5[024-68]\\d{7}", [9]]]], "AF": ["93", "00", "[2-7]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7\\d{8}"]]], "AG": ["1", "011", "(?:268|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([457]\\d{6})$|1", "268$1", 0, "268", [0, ["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"]]], "AI": ["1", "011", "(?:264|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2457]\\d{6})$|1", "264$1", 0, "264", [0, ["264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"]]], "AL": ["355", "00", "(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}", [6, 7, 8, 9], [["(\\d{3})(\\d{3,4})", "$1 $2", ["80|9"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["4[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2358][2-5]|4"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["[23578]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["6"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6(?:[78][2-9]|9\\d)\\d{6}", [9]]]], "AM": ["374", "00", "(?:[1-489]\\d|55|60|77)\\d{6}", [8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[89]0"], "0 $1"], ["(\\d{3})(\\d{5})", "$1 $2", ["2|3[12]"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["1|47"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[3-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"]]], "AO": ["244", "00", "[29]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[29]"]]], 0, 0, 0, 0, 0, 0, [0, ["9[1-79]\\d{7}"]]], "AR": ["54", "00", "(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}", [10, 11], [["(\\d{4})(\\d{2})(\\d{4})", "$1 $2-$3", ["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])", "2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["1"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[68]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2-$3", ["[23]"], "0$1", 1], ["(\\d)(\\d{4})(\\d{2})(\\d{4})", "$2 15-$3-$4", ["9(?:2[2-469]|3[3-578])", "9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))", "9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d)(\\d{2})(\\d{4})(\\d{4})", "$2 15-$3-$4", ["91"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d{3})(\\d{3})(\\d{5})", "$1-$2-$3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{4})", "$2 15-$3-$4", ["9"], "0$1", 0, "$1 $2 $3-$4"]], "0", 0, "0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?", "9$1", 0, 0, [0, ["93(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|9(?:2(?:657|9(?:54|66))|3(?:7(?:55|77)|865))[2-8]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:284|3(?:02|23)|920)|3(?:4(?:46|8[27]|92)|541|878))[2-7]\\d{5}|9(?:2(?:(?:26|62)2|320|477|9(?:42|83))|3(?:329|4(?:62|76|89)|564))[2-6]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|[17][2-6]|3[4-6]|5[3-6]|8[3-68]))))\\d{6}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|475|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:2(?:57|81)|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|35|5[17])))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[03-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[2-5]|8[26])|8(?:2[5-7]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}"]]], "AS": ["1", "011", "(?:[58]\\d\\d|684|900)\\d{7}", [10], 0, "1", 0, "([267]\\d{6})$|1", "684$1", 0, "684", [0, ["684(?:2(?:48|5[2468]|7[26])|7(?:3[13]|70|82))\\d{4}"]]], "AT": ["43", "00", "1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{3,12})", "$1 $2", ["1(?:11|[2-9])"], "0$1"], ["(\\d{3})(\\d{2})", "$1 $2", ["517"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["5[079]"], "0$1"], ["(\\d{3})(\\d{3,10})", "$1 $2", ["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"], "0$1"], ["(\\d{4})(\\d{3,9})", "$1 $2", ["[2-467]|5[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,7})", "$1 $2 $3", ["5"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}", [7, 8, 9, 10, 11, 12, 13]]]], "AU": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}", [5, 6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{3,4})", "$1 $2", ["16"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["16"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["14|4"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[2378]"], "(0$1)"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:30|[89])"]]], "0", 0, "(183[12])|0", 0, 0, 0, [0, ["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]]], "0011"], "AW": ["297", "00", "(?:[25-79]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[25-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}"]]], "AX": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}", [5, 6, 7, 8, 9, 10, 11, 12], 0, "0", 0, 0, 0, 0, "18", [0, ["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}", [6, 7, 8, 9, 10]]], "00"], "AZ": ["994", "00", "365\\d{6}|(?:[124579]\\d|60|88)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[28]|2|365|46", "1[28]|2|365[45]|46", "1[28]|2|365(?:4|5[02])|46"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[13-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}"]]], "BA": ["387", "00", "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[1-3]|[7-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2-$3", ["[3-5]|6[56]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["6"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"]]], "BB": ["1", "011", "(?:246|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "246$1", 0, "246", [0, ["246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}"]]], "BD": ["880", "00", "[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{4,6})", "$1-$2", ["31[5-8]|[459]1"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1-$2", ["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"], "0$1"], ["(\\d{4})(\\d{3,6})", "$1-$2", ["[13-9]|2[23]"], "0$1"], ["(\\d)(\\d{7,8})", "$1-$2", ["2"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}", [10]]]], "BE": ["32", "00", "4\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:80|9)0"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[239]|4[23]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[15-8]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["4[5-9]\\d{7}", [9]]]], "BF": ["226", "00", "[025-7]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[025-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:0[1-7]|5[0-8]|[67]\\d)\\d{6}"]]], "BG": ["359", "00", "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}", [6, 7, 8, 9, 12], [["(\\d)(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["43[1-6]|70[1-9]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:70|8)0"], "0$1"], ["(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3", ["43[1-7]|7"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[48]|9[08]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}", [8, 9]]]], "BH": ["973", "00", "[136-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[13679]|8[02-4679]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:3(?:[0-79]\\d|8[0-57-9])\\d|6(?:3(?:00|33|6[16])|441|6(?:3[03-9]|[69]\\d|7[0-689])))\\d{4}"]]], "BI": ["257", "00", "(?:[267]\\d|31)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2367]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:29|[67][125-9])\\d{6}"]]], "BJ": ["229", "00", "[24-689]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-689]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:4[0-8]|[56]\\d|9[013-9])\\d{6}"]]], "BL": ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [0, ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"]]], "BM": ["1", "011", "(?:441|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "441$1", 0, "441", [0, ["441(?:[2378]\\d|5[0-39]|9[02])\\d{5}"]]], "BN": ["673", "00", "[2-578]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-578]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:22[89]|[78]\\d\\d)\\d{4}"]]], "BO": ["591", "00(?:1\\d)?", "8001\\d{5}|(?:[2-467]\\d|50)\\d{6}", [8, 9], [["(\\d)(\\d{7})", "$1 $2", ["[235]|4[46]"]], ["(\\d{8})", "$1", ["[67]"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, "0(1\\d)?", 0, 0, 0, [0, ["[67]\\d{7}", [8]]]], "BQ": ["599", "00", "(?:[34]1|7\\d)\\d{5}", [7], 0, 0, 0, 0, 0, 0, "[347]", [0, ["(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}"]]], "BR": ["55", "00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)", "(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}", [8, 9, 10, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["300|4(?:0[02]|37)", "4(?:02|37)0|[34]00"]], ["(\\d{3})(\\d{2,3})(\\d{4})", "$1 $2 $3", ["(?:[358]|90)0"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"], "($1)"], ["(\\d{2})(\\d{5})(\\d{4})", "$1 $2-$3", ["[16][1-9]|[2-57-9]"], "($1)"]], "0", 0, "(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?", "$2", 0, 0, [0, ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}", [10, 11]]]], "BS": ["1", "011", "(?:242|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([3-8]\\d{6})$|1", "242$1", 0, "242", [0, ["242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|3[0-4]|[89]9))\\d{4}"]]], "BT": ["975", "00", "[17]\\d{7}|[2-8]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-68]|7[246]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|7"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:1[67]|77)\\d{6}", [8]]]], "BW": ["267", "00", "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:321|7[1-8]\\d)\\d{5}", [8]]]], "BY": ["375", "810", "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3})", "$1 $2", ["800"], "8 $1"], ["(\\d{3})(\\d{2})(\\d{2,4})", "$1 $2 $3", ["800"], "8 $1"], ["(\\d{4})(\\d{2})(\\d{3})", "$1 $2-$3", ["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])", "1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"], "8 0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["1(?:[56]|7[467])|2[1-3]"], "8 0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-4]"], "8 0$1"], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[89]"], "8 $1"]], "8", 0, "0|80?", 0, 0, 0, [0, ["(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}", [9]]], "8~10"], "BZ": ["501", "00", "(?:0800\\d|[2-8])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-8]"]], ["(\\d)(\\d{3})(\\d{4})(\\d{3})", "$1-$2-$3-$4", ["0"]]], 0, 0, 0, 0, 0, 0, [0, ["6[0-35-7]\\d{5}", [7]]]], "CA": ["1", "011", "(?:[2-8]\\d|90)\\d{8}|3\\d{6}", [7, 10], 0, "1", 0, 0, 0, 0, 0, [0, ["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|90[25])[2-9]\\d{6}", [10]]]], "CC": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [0, ["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]]], "0011"], "CD": ["243", "00", "(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[1-6]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["5"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["88\\d{5}|(?:8[0-69]|9[017-9])\\d{7}", [7, 9]]]], "CF": ["236", "00", "(?:[27]\\d{3}|8776)\\d{4}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[278]"]]], 0, 0, 0, 0, 0, 0, [0, ["7[024-7]\\d{6}"]]], "CG": ["242", "00", "222\\d{6}|(?:0\\d|80)\\d{7}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[02]"]]], 0, 0, 0, 0, 0, 0, [0, ["026(?:1[0-5]|6[6-9])\\d{4}|0(?:[14-6]\\d\\d|2(?:40|5[5-8]|6[07-9]))\\d{5}"]]], "CH": ["41", "00", "8\\d{11}|[2-9]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8[047]|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]|81"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6[89]|7[235-9])\\d{7}", [9]]]], "CI": ["225", "00", "[02]\\d{9}", [10], [["(\\d{2})(\\d{2})(\\d)(\\d{5})", "$1 $2 $3 $4", ["2"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3 $4", ["0"]]], 0, 0, 0, 0, 0, 0, [0, ["0[157]\\d{8}"]]], "CK": ["682", "00", "[2-578]\\d{4}", [5], [["(\\d{2})(\\d{3})", "$1 $2", ["[2-578]"]]], 0, 0, 0, 0, 0, 0, [0, ["[578]\\d{4}"]]], "CL": ["56", "(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0", "12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}", [9, 10, 11], [["(\\d{5})(\\d{4})", "$1 $2", ["219", "2196"], "($1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["44"]], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2[1-36]"], "($1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["9[2-9]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["60|8"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{3})(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["60"]]], 0, 0, 0, 0, 0, 0, [0, ["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:2\\d\\d|3(?:[03467]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|8[0-3])|600)|646[59])|80[1-9]\\d\\d|9(?:3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|7[1-9]\\d\\d|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}", [9]]]], "CM": ["237", "00", "[26]\\d{8}|88\\d{6,7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["88"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[26]|88"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:24[23]|6(?:[25-9]\\d|40))\\d{6}", [9]]]], "CN": ["86", "00|1(?:[12]\\d|79)\\d\\d00", "(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]", "(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"], "0$1"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]", "(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]", "85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])", "85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["(?:4|80)0"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|2(?:[02-57-9]|1[1-9])", "10|2(?:[02-57-9]|1[1-9])", "10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["80"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[3-578]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["1[3-9]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["[12]"], "0$1", 1]], "0", 0, "(1(?:[12]\\d|79)\\d\\d)|0", 0, 0, 0, [0, ["1740[0-5]\\d{6}|1(?:[38]\\d|4[57]|[59][0-35-9]|6[25-7]|7[0-35-8])\\d{8}", [11]]], "00"], "CO": ["57", "00(?:4(?:[14]4|56)|[579])", "(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["46"]], ["(\\d{3})(\\d{7})", "$1 $2", ["6|90"], "($1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3[0-357]|91"]], ["(\\d)(\\d{3})(\\d{7})", "$1-$2-$3", ["1"], "0$1", 0, "$1 $2 $3"]], "0", 0, "0([3579]|4(?:[14]4|56))?", 0, 0, 0, [0, ["333301[0-5]\\d{3}|3333(?:00|2[5-9]|[3-9]\\d)\\d{4}|(?:3(?:24[1-9]|3(?:00|3[0-24-9]))|9101)\\d{6}|3(?:0[0-5]|1\\d|2[0-3]|5[01]|70)\\d{7}", [10]]]], "CR": ["506", "00", "(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}", [8, 10], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[3-9]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[89]"]]], 0, 0, "(19(?:0[0-2468]|1[09]|20|66|77|99))", 0, 0, 0, [0, ["(?:3005\\d|6500[01])\\d{3}|(?:5[07]|6[0-4]|7[0-3]|8[3-9])\\d{6}", [8]]]], "CU": ["53", "119", "(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}", [6, 7, 8, 10], [["(\\d{2})(\\d{4,6})", "$1 $2", ["2[1-4]|[34]"], "(0$1)"], ["(\\d)(\\d{6,7})", "$1 $2", ["7"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["[56]"], "0$1"], ["(\\d{3})(\\d{7})", "$1 $2", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:5\\d|6[2-4])\\d{6}", [8]]]], "CV": ["238", "0", "(?:[2-59]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-589]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:36|5[1-389]|9\\d)\\d{5}"]]], "CW": ["599", "00", "(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[3467]"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["9[4-8]"]]], 0, 0, 0, 0, 0, "[69]", [0, ["953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}"]]], "CX": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [0, ["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}", [9]]], "0011"], "CY": ["357", "00", "(?:[279]\\d|[58]0)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[257-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["9(?:10|[4-79]\\d)\\d{5}"]]], "CZ": ["420", "00", "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}", [9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:60[1-8]\\d|7(?:0(?:[2-5]\\d|60)|19[01]|[2379]\\d\\d))\\d{5}", [9]]]], "DE": ["49", "00", "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [["(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"], ["(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"], ["(\\d{4})(\\d{2,11})", "$1 $2", ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"], ["(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"], ["(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"], ["(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"], ["(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"], ["(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|31)"], "0$1"], ["(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"], ["(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"], ["(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["16[023]\\d{7,8}|1(?:5310|7[0-57-9]\\d)\\d{6}|1(?:5[0-25-9]|76)\\d{8}", [10, 11]]]], "DJ": ["253", "00", "(?:2\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[27]"]]], 0, 0, 0, 0, 0, 0, [0, ["77\\d{6}"]]], "DK": ["45", "00", "[2-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[2-7]\\d|8[126-9]|9[1-46-9])\\d{6}"]]], "DM": ["1", "011", "(?:[58]\\d\\d|767|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "767$1", 0, "767", [0, ["767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-8]|70[1-6])\\d{4}"]]], "DO": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "8001|8[024]9", [0, ["8[024]9[2-9]\\d{6}"]]], "DZ": ["213", "00", "(?:[1-4]|[5-79]\\d|80)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["9"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-8]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:5(?:4[0-29]|5\\d|6[0-3])|6(?:[569]\\d|7[0-6])|7[7-9]\\d)\\d{6}", [9]]]], "EC": ["593", "00", "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}", [8, 9, 10, 11], [["(\\d)(\\d{3})(\\d{4})", "$1 $2-$3", ["[2-7]"], "(0$1)", 0, "$1-$2-$3"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["964[0-2]\\d{5}|9(?:39|[57][89]|6[0-36-9]|[89]\\d)\\d{6}", [9]]]], "EE": ["372", "00", "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88", "[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]], ["(\\d{4})(\\d{3,4})", "$1 $2", ["[45]|8(?:00|[1-49])", "[45]|8(?:00[1-9]|[1-49])"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:5\\d{5}|8(?:1(?:0(?:0(?:00|[178]\\d)|[3-9]\\d\\d)|(?:1(?:0[2-6]|1\\d)|(?:2[0-59]|[3-79]\\d)\\d)\\d)|2(?:0(?:0(?:00|4\\d)|(?:19|[2-7]\\d)\\d)|(?:(?:[124-69]\\d|3[5-9])\\d|7(?:[0-79]\\d|8[13-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}", [7, 8]]]], "EG": ["20", "00", "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}", [8, 9, 10], [["(\\d)(\\d{7,8})", "$1 $2", ["[23]"], "0$1"], ["(\\d{2})(\\d{6,7})", "$1 $2", ["1[35]|[4-6]|8[2468]|9[235-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{8})", "$1 $2", ["1"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["1[0-25]\\d{8}", [10]]]], "EH": ["212", "00", "[5-8]\\d{8}", [9], 0, "0", 0, 0, 0, 0, "528[89]", [0, ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"]]], "ER": ["291", "00", "[178]\\d{6}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[178]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:17[1-3]|7\\d\\d)\\d{4}"]]], "ES": ["34", "00", "[5-9]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]00"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:590[16]00\\d|9(?:6906(?:09|10)|7390\\d\\d))\\d\\d|(?:6\\d|7[1-48])\\d{7}"]]], "ET": ["251", "00", "(?:11|[2-579]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-579]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["700[1-9]\\d{5}|(?:7(?:0[1-9]|1[0-8]|22|77|86|99)|9\\d\\d)\\d{6}"]]], "FI": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{5})", "$1", ["20[2-59]"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1 $2", ["(?:[1-3]0|[68])0|70[07-9]"], "0$1"], ["(\\d{2})(\\d{4,8})", "$1 $2", ["[14]|2[09]|50|7[135]"], "0$1"], ["(\\d{2})(\\d{6,10})", "$1 $2", ["7"], "0$1"], ["(\\d)(\\d{4,9})", "$1 $2", ["(?:1[49]|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"], "0$1"]], "0", 0, 0, 0, 0, "1[03-79]|[2-9]", [0, ["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}", [6, 7, 8, 9, 10]]], "00"], "FJ": ["679", "0(?:0|52)", "45\\d{5}|(?:0800\\d|[235-9])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[235-9]|45"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[279]\\d|45|5[01568]|8[034679])\\d{5}", [7]]], "00"], "FK": ["500", "00", "[2-7]\\d{4}", [5], 0, 0, 0, 0, 0, 0, 0, [0, ["[56]\\d{4}"]]], "FM": ["691", "00", "(?:[39]\\d\\d|820)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[389]"]]], 0, 0, 0, 0, 0, 0, [0, ["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-7]\\d)\\d)\\d{3}"]]], "FO": ["298", "00", "[2-9]\\d{5}", [6], [["(\\d{6})", "$1", ["[2-9]"]]], 0, 0, "(10(?:01|[12]0|88))", 0, 0, 0, [0, ["(?:[27][1-9]|5\\d|9[16])\\d{4}"]]], "FR": ["33", "00", "[1-9]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0 $1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[1-79]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7[3-9]\\d)\\d{6}"]]], "GA": ["241", "00", "(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}", [7, 8], [["(\\d)(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-7]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["11|[67]"], "0$1"]], 0, 0, "0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})", "$1", 0, 0, [0, ["(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}"]]], "GB": ["44", "00", "[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}", [7, 9, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["800", "8001", "80011", "800111", "8001111"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["845", "8454", "84546", "845464"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["800"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["1(?:38|5[23]|69|76|94)", "1(?:(?:38|69)7|5(?:24|39)|768|946)", "1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["1(?:[2-69][02-9]|[78])"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[25]|7(?:0|6[02-9])", "[25]|7(?:0|6(?:[03-9]|2[356]))"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1389]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}", [10]]], 0, " x"], "GD": ["1", "011", "(?:473|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "473$1", 0, "473", [0, ["473(?:4(?:0[2-79]|1[04-9]|2[0-5]|49|5[68])|5(?:2[01]|3[3-8])|901)\\d{4}"]]], "GE": ["995", "00", "(?:[3-57]\\d\\d|800)\\d{6}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["32"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[57]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[348]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0[17]0|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|11|22|3[0-6]|44|5[05]|77|88|9[09])|111|22[02]|77\\d)|1(?:1(?:[03][01]|[124]\\d|5[2-6]|7[0-4])|4\\d\\d)|[23]555|4(?:4\\d\\d|555)|5(?:[0157-9]\\d\\d|200)|6[89]\\d\\d|7(?:[0147-9]\\d\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}"]]], "GF": ["594", "00", "[56]94\\d{6}|(?:80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[56]|9[47]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["694(?:[0-249]\\d|3[0-8])\\d{4}"]]], "GG": ["44", "00", "(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?", [7, 9, 10], 0, "0", 0, "([25-9]\\d{5})$|0", "1481$1", 0, 0, [0, ["7(?:(?:781|839)\\d|911[17])\\d{5}", [10]]]], "GH": ["233", "00", "(?:[235]\\d{3}|800)\\d{5}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[235]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:2(?:[0346-9]\\d|5[67])|5(?:[03-7]\\d|9[1-9]))\\d{6}", [9]]]], "GI": ["350", "00", "(?:[25]\\d|60)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["2"]]], 0, 0, 0, 0, 0, 0, [0, ["5251[0-4]\\d{3}|(?:5(?:[146-8]\\d\\d|250)|60(?:1[01]|6\\d))\\d{4}"]]], "GL": ["299", "00", "(?:19|[2-689]\\d|70)\\d{4}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["19|[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["[245]\\d{5}"]]], "GM": ["220", "00", "[2-9]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[23679]\\d|4[015]|5[0-489])\\d{5}"]]], "GN": ["224", "00", "722\\d{6}|(?:3|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["3"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[67]"]]], 0, 0, 0, 0, 0, 0, [0, ["6[0-356]\\d{7}", [9]]]], "GP": ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[569]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"]]], "GQ": ["240", "00", "222\\d{6}|(?:3\\d|55|[89]0)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235]"]], ["(\\d{3})(\\d{6})", "$1 $2", ["[89]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:222|55\\d)\\d{6}"]]], "GR": ["30", "00", "5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}", [10, 11, 12], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["21|7"]], ["(\\d{4})(\\d{6})", "$1 $2", ["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2689]"]], ["(\\d{3})(\\d{3,4})(\\d{5})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["68[57-9]\\d{7}|(?:69|94)\\d{8}", [10]]]], "GT": ["502", "00", "80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-8]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[3-5]\\d\\d|80[0-4])\\d{5}", [8]]]], "GU": ["1", "011", "(?:[58]\\d\\d|671|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "671$1", 0, "671", [0, ["671(?:2\\d\\d|3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[02-46-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}"]]], "GW": ["245", "00", "[49]\\d{8}|4\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["40"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"]]], 0, 0, 0, 0, 0, 0, [0, ["9(?:5\\d|6[569]|77)\\d{6}", [9]]]], "GY": ["592", "001", "(?:[2-8]\\d{3}|9008)\\d{3}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["510\\d{4}|(?:6\\d|7[0-5])\\d{5}"]]], "HK": ["852", "00(?:30|5[09]|[126-9]?)", "8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}", [5, 6, 7, 8, 9, 11], [["(\\d{3})(\\d{2,5})", "$1 $2", ["900", "9003"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{3})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:4(?:44[0-25-9]|6(?:1[0-7]|4[0-57-9]|6[0-4])|74[0-2])|5(?:73[0-6]|95[0-8])|6(?:26[013-8]|66[0-3])|70(?:7[1-8]|8[0-4])|84(?:4[0-2]|8[0-35-9])|9(?:29[013-9]|39[01]|59[0-4]|899))\\d{4}|(?:4(?:4[0-35-9]|6[02357-9]|7[05])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|70[1-49]|84[0-39]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}", [8]]], "00"], "HN": ["504", "00", "8\\d{10}|[237-9]\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["[237-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["[37-9]\\d{7}", [8]]]], "HR": ["385", "00", "(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}", [6, 7, 8, 9], [["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["6[01]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{4})(\\d{3})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6|7[245]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-57]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["9(?:(?:0[1-9]|[12589]\\d)\\d\\d|7(?:[0679]\\d\\d|5(?:[01]\\d|44|55|77|9[5-7])))\\d{4}|98\\d{6}", [8, 9]]]], "HT": ["509", "00", "(?:[2-489]\\d|55)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[2-589]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[34]\\d|55)\\d{6}"]]], "HU": ["36", "00", "[235-7]\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "06 $1"]], "06", 0, 0, 0, 0, 0, [0, ["(?:[257]0|3[01])\\d{7}", [9]]]], "ID": ["62", "00[89]", "00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}", [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["15"]], ["(\\d{2})(\\d{5,9})", "$1 $2", ["2[124]|[36]1"], "(0$1)"], ["(\\d{3})(\\d{5,7})", "$1 $2", ["800"], "0$1"], ["(\\d{3})(\\d{5,8})", "$1 $2", ["[2-79]"], "(0$1)"], ["(\\d{3})(\\d{3,4})(\\d{3})", "$1-$2-$3", ["8[1-35-9]"], "0$1"], ["(\\d{3})(\\d{6,8})", "$1 $2", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["804"], "0$1"], ["(\\d{3})(\\d)(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["80"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1-$2-$3", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["8[1-35-9]\\d{7,10}", [9, 10, 11, 12]]]], "IE": ["353", "00", "(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["2[24-9]|47|58|6[237-9]|9[35-9]"], "(0$1)"], ["(\\d{3})(\\d{5})", "$1 $2", ["[45]0"], "(0$1)"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2569]|4[1-69]|7[14]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["81"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["4"], "(0$1)"], ["(\\d{2})(\\d)(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["8(?:22|[35-9]\\d)\\d{6}", [9]]]], "IL": ["972", "0(?:0|1[2-9])", "1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}", [7, 8, 9, 10, 11, 12], [["(\\d{4})(\\d{3})", "$1-$2", ["125"]], ["(\\d{4})(\\d{2})(\\d{2})", "$1-$2-$3", ["121"]], ["(\\d)(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-489]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1-$2-$3", ["12"]], ["(\\d{4})(\\d{6})", "$1-$2", ["159"]], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3-$4", ["1[7-9]"]], ["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})", "$1-$2 $3-$4", ["15"]]], "0", 0, 0, 0, 0, 0, [0, ["55(?:410|57[0-289])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[34]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}", [9]]]], "IM": ["44", "00", "1624\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([25-8]\\d{5})$|0", "1624$1", 0, "74576|(?:16|7[56])24", [0, ["76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}"]]], "IN": ["91", "00", "(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}", [8, 9, 10, 11, 12, 13], [["(\\d{8})", "$1", ["5(?:0|2[23]|3[03]|[67]1|88)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"], 0, 1], ["(\\d{4})(\\d{4,5})", "$1 $2", ["180", "1800"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["140"], 0, 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["11|2[02]|33|4[04]|79[1-7]|80[2-46]", "11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"], "0$1", 1], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807", "1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]", "1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"], "0$1", 1], ["(\\d{5})(\\d{5})", "$1 $2", ["[6-9]"], "0$1", 1], ["(\\d{4})(\\d{2,4})(\\d{4})", "$1 $2 $3", ["1(?:6|8[06])", "1(?:6|8[06]0)"], 0, 1], ["(\\d{4})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["18"], 0, 1]], "0", 0, 0, 0, 0, 0, [0, ["(?:61279|7(?:887[02-9]|9(?:313|79[07-9]))|8(?:079[04-9]|(?:84|91)7[02-8]))\\d{5}|(?:6(?:12|[2-47]1|5[17]|6[13]|80)[0189]|7(?:1(?:2[0189]|9[0-5])|2(?:[14][017-9]|8[0-59])|3(?:2[5-8]|[34][017-9]|9[016-9])|4(?:1[015-9]|[29][89]|39|8[389])|5(?:[15][017-9]|2[04-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589])|70[0289]|88[089]|97[02-8])|8(?:0(?:6[67]|7[02-8])|70[017-9]|84[01489]|91[0-289]))\\d{6}|(?:7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[0189]\\d|7[02-8])\\d{5}|(?:6(?:[09]\\d|1[04679]|2[03689]|3[05-9]|4[0489]|50|6[069]|7[07]|8[7-9])|7(?:0\\d|2[0235-79]|3[05-8]|40|5[0346-8]|6[6-9]|7[1-9]|8[0-79]|9[089])|8(?:0[01589]|1[0-57-9]|2[235-9]|3[03-57-9]|[45]\\d|6[02457-9]|7[1-69]|8[0-25-9]|9[02-9])|9\\d\\d)\\d{7}|(?:6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|8[124-6])\\d|7(?:[235689]\\d|4[0189]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-5])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]|881))[0189]\\d{5}", [10]]]], "IO": ["246", "00", "3\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["3"]]], 0, 0, 0, 0, 0, 0, [0, ["38\\d{5}"]]], "IQ": ["964", "00", "(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-6]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7[3-9]\\d{8}", [10]]]], "IR": ["98", "00", "[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}", [4, 5, 6, 7, 10], [["(\\d{4,5})", "$1", ["96"], "0$1"], ["(\\d{2})(\\d{4,5})", "$1 $2", ["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[1-8]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["9(?:(?:0(?:[0-35]\\d|4[4-6])|(?:[13]\\d|2[0-3])\\d)\\d|9(?:[0-46]\\d\\d|5[15]0|8(?:[12]\\d|88)|9(?:0[0-3]|[19]\\d|21|69|77|8[7-9])))\\d{5}", [10]]]], "IS": ["354", "00|1(?:0(?:01|[12]0)|100)", "(?:38\\d|[4-9])\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[238]))\\d{4}"]], "00"], "IT": ["39", "00", "0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", [6, 7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], ["(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], ["(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], ["(\\d{4})(\\d{4})", "$1 $2", ["894"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1(?:44|[679])|[378]|43"]], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], ["(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, [0, ["3[2-9]\\d{7,8}|(?:31|43)\\d{8}", [9, 10]]]], "JE": ["44", "00", "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([0-24-8]\\d{5})$|0", "1534$1", 0, 0, [0, ["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"]]], "JM": ["1", "011", "(?:[58]\\d\\d|658|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "658|876", [0, ["(?:658295|876(?:2(?:0[1-9]|[13-9]\\d|2[013-9])|[348]\\d\\d|5(?:0[1-9]|[1-9]\\d)|6(?:4[89]|6[67])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}"]]], "JO": ["962", "00", "(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:[78][0-25-9]|9\\d)\\d{6}", [9]]]], "JP": ["81", "010", "00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}", [8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3", ["(?:12|57|99)0"], "0$1"], ["(\\d{4})(\\d)(\\d{4})", "$1-$2-$3", ["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2-$3", ["[36]|4(?:2[09]|7[01])", "[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3", ["[14]|[289][2-9]|5[3-9]|7[2-4679]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["800"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[257-9]"], "0$1"]], "0", 0, "(000[259]\\d{6})$|(?:(?:003768)0?)|0", "$1", 0, 0, [0, ["[7-9]0[1-9]\\d{7}", [10]]]], "KE": ["254", "000", "(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}", [7, 8, 9, 10], [["(\\d{2})(\\d{5,7})", "$1 $2", ["[24-6]"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[17]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:1(?:0[0-8]|1[0-7]|2[014]|30)|7\\d\\d)\\d{6}", [9]]]], "KG": ["996", "00", "8\\d{9}|[235-9]\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["3(?:1[346]|[24-79])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-79]|88"], "0$1"], ["(\\d{3})(\\d{3})(\\d)(\\d{2,3})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["312(?:58\\d|973)\\d{3}|(?:2(?:0[0-35]|2\\d)|5[0-24-7]\\d|600|7(?:[07]\\d|55)|88[08]|9(?:12|9[05-9]))\\d{6}", [9]]]], "KH": ["855", "00[14-9]", "1\\d{9}|[1-9]\\d{7,8}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}", [8, 9]]]], "KI": ["686", "00", "(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}", [5, 8], 0, "0", 0, 0, 0, 0, 0, [0, ["(?:6200[01]|7(?:310[1-9]|5(?:02[03-9]|12[0-47-9]|22[0-7]|[34](?:0[1-9]|8[02-9])|50[1-9])))\\d{3}|(?:63\\d\\d|7(?:(?:[0146-9]\\d|2[0-689])\\d|3(?:[02-9]\\d|1[1-9])|5(?:[0-2][013-9]|[34][1-79]|5[1-9]|[6-9]\\d)))\\d{4}", [8]]]], "KM": ["269", "00", "[3478]\\d{6}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[3478]"]]], 0, 0, 0, 0, 0, 0, [0, ["[34]\\d{6}"]]], "KN": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "869$1", 0, "869", [0, ["869(?:48[89]|55[6-8]|66\\d|76[02-7])\\d{4}"]]], "KP": ["850", "00|99", "85\\d{6}|(?:19\\d|[2-7])\\d{7}", [8, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["19[1-3]\\d{7}", [10]]]], "KR": ["82", "00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))", "00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}", [5, 6, 8, 9, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3,4})", "$1-$2", ["(?:3[1-3]|[46][1-4]|5[1-5])1"], "0$1"], ["(\\d{4})(\\d{4})", "$1-$2", ["1"]], ["(\\d)(\\d{3,4})(\\d{4})", "$1-$2-$3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[36]0|8"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1-$2-$3", ["[1346]|5[1-5]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{2})(\\d{5})(\\d{4})", "$1-$2-$3", ["5"], "0$1"]], "0", 0, "0(8(?:[1-46-8]|5\\d\\d))?", 0, 0, 0, [0, ["1(?:05(?:[0-8]\\d|9[0-6])|22[13]\\d)\\d{4,5}|1(?:0[0-46-9]|[16-9]\\d|2[013-9])\\d{6,7}", [9, 10]]]], "KW": ["965", "00", "18\\d{5}|(?:[2569]\\d|41)\\d{6}", [7, 8], [["(\\d{4})(\\d{3,4})", "$1 $2", ["[169]|2(?:[235]|4[1-35-9])|52"]], ["(\\d{3})(\\d{5})", "$1 $2", ["[245]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|1(?:00|11|6[16])|2[26]2|3[36]3|4[46]4|7(?:0[013-9]|[67]\\d)|8[68]8|9(?:[069]\\d|3[039]))|9(?:(?:[04679]\\d|8[057-9])\\d|1(?:1[01]|99)|2(?:00|2\\d)|3(?:00|3[03])|5(?:00|5\\d)))\\d{4}", [8]]]], "KY": ["1", "011", "(?:345|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "345$1", 0, "345", [0, ["345(?:32[1-9]|42[0-4]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}"]]], "KZ": ["7", "810", "(?:33622|8\\d{8})\\d{5}|[78]\\d{9}", [10, 14], 0, "8", 0, 0, 0, 0, "33|7", [0, ["7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}", [10]]], "8~10"], "LA": ["856", "00", "[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2[13]|3[14]|[4-8]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["30[0135-9]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["208[78]\\d{6}|(?:20[23579]|30[24])\\d{7}", [10]]]], "LB": ["961", "00", "[27-9]\\d{7}|[13-9]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27-9]"]]], "0", 0, 0, 0, 0, 0, [0, ["793(?:[01]\\d|2[0-4])\\d{3}|(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[89]|9[12]))\\d{5}"]]], "LC": ["1", "011", "(?:[58]\\d\\d|758|900)\\d{7}", [10], 0, "1", 0, "([2-8]\\d{6})$|1", "758$1", 0, "758", [0, ["758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[0-3])|812)\\d{4}"]]], "LI": ["423", "00", "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", [7, 9], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2379]|8(?:0[09]|7)", "[2379]|8(?:0(?:02|9)|7)"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["69"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], "0", 0, "(1001)|0", 0, 0, 0, [0, ["(?:6(?:(?:4[5-9]|5[0-469])\\d|6(?:[024-6]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}"]]], "LK": ["94", "00", "[1-9]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[1-689]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:[0-25-8]\\d|4[0-4])\\d{6}"]]], "LR": ["231", "00", "(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["4[67]|[56]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-578]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:(?:(?:22|33)0|555|(?:77|88)\\d)\\d|4(?:240|[67]))\\d{5}|[56]\\d{6}", [7, 9]]]], "LS": ["266", "00", "(?:[256]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2568]"]]], 0, 0, 0, 0, 0, 0, [0, ["[56]\\d{7}"]]], "LT": ["370", "00", "(?:[3469]\\d|52|[78]0)\\d{6}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["52[0-7]"], "(0-$1)", 1], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0 $1", 1], ["(\\d{2})(\\d{6})", "$1 $2", ["37|4(?:[15]|6[1-8])"], "(0-$1)", 1], ["(\\d{3})(\\d{5})", "$1 $2", ["[3-6]"], "(0-$1)", 1]], "0", 0, "[08]", 0, 0, 0, [0, ["6\\d{7}"]]], "LU": ["352", "00", "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}", [4, 5, 6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{3})", "$1 $2", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["20[2-689]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4", ["2(?:[0367]|4[3-8])"]], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["80[01]|90[015]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["2(?:[0367]|4[3-8])"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]], 0, 0, "(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)", 0, 0, 0, [0, ["6(?:[269][18]|5[1568]|7[189]|81)\\d{6}", [9]]]], "LV": ["371", "00", "(?:[268]\\d|90)\\d{6}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[269]|8[01]"]]], 0, 0, 0, 0, 0, 0, [0, ["23(?:23[0-57-9]|33[0238])\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[024-9]|3[0-24-9]))\\d{4}"]]], "LY": ["218", "00", "[2-9]\\d{8}", [9], [["(\\d{2})(\\d{7})", "$1-$2", ["[2-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["9[1-6]\\d{7}"]]], "MA": ["212", "00", "[5-8]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5[45]"], "0$1"], ["(\\d{4})(\\d{5})", "$1-$2", ["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"], "0$1"], ["(\\d{2})(\\d{7})", "$1-$2", ["8"], "0$1"], ["(\\d{3})(\\d{6})", "$1-$2", ["[5-7]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"]]], "MC": ["377", "00", "(?:[3489]|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[389]"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["6"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["4(?:[469]\\d|5[1-9])\\d{5}|(?:3|6\\d)\\d{7}"]]], "MD": ["373", "00", "(?:[235-7]\\d|[89]0)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["22|3"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[25-7]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["562\\d{5}|(?:6\\d|7[16-9])\\d{6}"]]], "ME": ["382", "00", "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}", [8]]]], "MF": ["590", "00", "590\\d{6}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [0, ["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"]]], "MG": ["261", "00", "[23]\\d{8}", [9], [["(\\d{2})(\\d{2})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, "([24-9]\\d{6})$|0", "20$1", 0, 0, [0, ["3[2-47-9]\\d{7}"]]], "MH": ["692", "011", "329\\d{4}|(?:[256]\\d|45)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-6]"]]], "1", 0, 0, 0, 0, 0, [0, ["(?:(?:23|54)5|329|45[35-8])\\d{4}"]]], "MK": ["389", "00", "[2-578]\\d{7}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2|34[47]|4(?:[37]7|5[47]|64)"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[347]"], "0$1"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[58]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-48]\\d|6[01]|7[01578])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}"]]], "ML": ["223", "00", "[24-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[01]|[679]\\d|8[2-49])\\d{6}"]]], "MM": ["95", "00", "1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}", [6, 7, 8, 9, 10], [["(\\d)(\\d{2})(\\d{3})", "$1 $2 $3", ["16|2"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]|452|678|86", "[12]|452|6788|86"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[4-7]|8[1-35]"], "0$1"], ["(\\d)(\\d{3})(\\d{4,6})", "$1 $2 $3", ["9(?:2[0-4]|[35-9]|4[137-9])"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["92"], "0$1"], ["(\\d)(\\d{5})(\\d{4})", "$1 $2 $3", ["9"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6\\d|8[89]|9[4-8])\\d|7(?:3|40|[5-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6])\\d)\\d{4}|9[69]1\\d{6}|9(?:[68]\\d|9[089])\\d{5}", [7, 8, 9, 10]]]], "MN": ["976", "001", "[12]\\d{7,9}|[5-9]\\d{7}", [8, 9, 10], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[12]1"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[5-9]"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[12]2[1-3]"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["[12](?:27|3[2-8]|4[2-68]|5[1-4689])", "[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["[12]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:83[01]|92[039])\\d{5}|(?:5[05]|6[069]|8[015689]|9[013-9])\\d{6}", [8]]]], "MO": ["853", "00", "0800\\d{3}|(?:28|[68]\\d)\\d{6}", [7, 8], [["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[268]"]]], 0, 0, 0, 0, 0, 0, [0, ["6800[0-79]\\d{3}|6(?:[235]\\d\\d|6(?:0[0-5]|[1-9]\\d)|8(?:0[1-9]|[14-8]\\d|2[5-9]|[39][0-4]))\\d{4}", [8]]]], "MP": ["1", "011", "[58]\\d{9}|(?:67|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "670$1", 0, "670", [0, ["670(?:2(?:3[3-7]|56|8[4-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}"]]], "MQ": ["596", "00", "596\\d{6}|(?:69|[89]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[569]|8(?:0[6-9]|[36])"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["69[67]\\d{6}"]]], "MR": ["222", "00", "(?:[2-4]\\d\\d|800)\\d{5}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-48]"]]], 0, 0, 0, 0, 0, 0, [0, ["[2-4][0-46-9]\\d{6}"]]], "MS": ["1", "011", "(?:[58]\\d\\d|664|900)\\d{7}", [10], 0, "1", 0, "([34]\\d{6})$|1", "664$1", 0, "664", [0, ["664(?:3(?:49|9[1-6])|49[2-6])\\d{4}"]]], "MT": ["356", "00", "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2357-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"]]], "MU": ["230", "0(?:0|[24-7]0|3[03])", "(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46]|8[013]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[57]"]], ["(\\d{5})(\\d{5})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|(?:5(?:2[5-9]|4[3-689]|[57]\\d|8[0-689]|9[0-8])|7(?:0[0-4]|3[013]))\\d{5}", [8]]], "020"], "MV": ["960", "0(?:0|19)", "(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}", [7, 10], [["(\\d{3})(\\d{4})", "$1-$2", ["[34679]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:46[46]|[79]\\d\\d)\\d{4}", [7]]], "00"], "MW": ["265", "00", "(?:[1289]\\d|31|77)\\d{7}|1\\d{6}", [7, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["1[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[137-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["111\\d{6}|(?:31|77|[89][89])\\d{7}", [9]]]], "MX": ["52", "0[09]", "[2-9]\\d{9}", [10], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["33|5[56]|81"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["657[12]\\d{6}|(?:2(?:2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"]], "00"], "MY": ["60", "00", "1\\d{8,9}|(?:3\\d|[4-9])\\d{7}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1-$2 $3", ["[4-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1-$2 $3", ["1(?:[02469]|[378][1-9]|53)|8", "1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2 $3", ["3"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3-$4", ["1(?:[367]|80)"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2 $3", ["15"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2 $3", ["1"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["1(?:1888[689]|4400|8(?:47|8[27])[0-4])\\d{4}|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d)|7(?:[0-4]\\d|5[0-7]))|(?:[269]\\d|[37][1-9]|4[235-9])\\d|5(?:31|9\\d\\d)|8(?:1[23]|[236]\\d|4[06]|5(?:46|[7-9])|7[016-9]|8[01]|9[0-8]))\\d{5}", [9, 10]]]], "MZ": ["258", "00", "(?:2|8\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2|8[2-79]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["8[2-79]\\d{7}", [9]]]], "NA": ["264", "00", "[68]\\d{7,8}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["87"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:60|8[1245])\\d{7}", [9]]]], "NC": ["687", "00", "(?:050|[2-57-9]\\d\\d)\\d{3}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1.$2.$3", ["[02-57-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:5[0-4]|[79]\\d|8[0-79])\\d{4}"]]], "NE": ["227", "00", "[027-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["08"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[089]|2[013]|7[0467]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:23|7[0467]|[89]\\d)\\d{6}"]]], "NF": ["672", "00", "[13]\\d{5}", [6], [["(\\d{2})(\\d{4})", "$1 $2", ["1[0-3]"]], ["(\\d)(\\d{5})", "$1 $2", ["[13]"]]], 0, 0, "([0-258]\\d{4})$", "3$1", 0, 0, [0, ["(?:14|3[58])\\d{4}"]]], "NG": ["234", "009", "38\\d{6}|[78]\\d{9,13}|(?:20|9\\d)\\d{8}", [8, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["3"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[7-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["20[129]"], "0$1"], ["(\\d{4})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{3})(\\d{5})(\\d{5,6})", "$1 $2 $3", ["[78]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:702[0-24-9]|819[01])\\d{6}|(?:7(?:0[13-9]|[12]\\d)|8(?:0[1-9]|1[0-8])|9(?:0[1-9]|1[1-6]))\\d{7}", [10]]]], "NI": ["505", "00", "(?:1800|[25-8]\\d{3})\\d{4}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[125-8]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}"]]], "NL": ["31", "00", "(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}", [5, 6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{4,7})", "$1 $2", ["[89]0"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["66"], "0$1"], ["(\\d)(\\d{8})", "$1 $2", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-578]|91"], "0$1"], ["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3", ["9"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6[1-58]|970\\d)\\d{7}", [9, 11]]]], "NO": ["47", "00", "(?:0|[2-9]\\d{3})\\d{4}", [5, 8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]"]]], 0, 0, 0, 0, 0, "[02-689]|7[0-8]", [0, ["(?:4[015-8]|9\\d)\\d{6}", [8]]]], "NP": ["977", "00", "(?:1\\d|9)\\d{9}|[1-9]\\d{7}", [8, 10, 11], [["(\\d)(\\d{7})", "$1-$2", ["1[2-6]"], "0$1"], ["(\\d{2})(\\d{6})", "$1-$2", ["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"], "0$1"], ["(\\d{3})(\\d{7})", "$1-$2", ["9"]]], "0", 0, 0, 0, 0, 0, [0, ["9(?:00|6[0-3]|7[024-6]|8[0-24-68])\\d{7}", [10]]]], "NR": ["674", "00", "(?:444|(?:55|8\\d)\\d|666)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-68]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:55[3-9]|666|8\\d\\d)\\d{4}"]]], "NU": ["683", "00", "(?:[4-7]|888\\d)\\d{3}", [4, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[56]|888[1-9])\\d{3}"]]], "NZ": ["64", "0(?:0|161)", "[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,8})", "$1 $2", ["8[1-79]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["50[036-8]|8|90", "50(?:[0367]|88)|8|90"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["24|[346]|7[2-57-9]|9[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:10|74)|[589]"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1|2[028]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,5})", "$1 $2 $3", ["2(?:[169]|7[0-35-9])|7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["2(?:[0-27-9]\\d|6)\\d{6,7}|2(?:1\\d|75)\\d{5}", [8, 9, 10]]], "00"], "OM": ["968", "00", "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", [7, 8, 9], [["(\\d{3})(\\d{4,6})", "$1 $2", ["[58]"]], ["(\\d{2})(\\d{6})", "$1 $2", ["2"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[179]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:1505|90[1-9]\\d)\\d{4}|(?:7[126-9]|9[1-9])\\d{6}", [8]]]], "PA": ["507", "00", "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", [7, 8, 10, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[1-57-9]"]], ["(\\d{4})(\\d{4})", "$1-$2", ["[68]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}", [7, 8]]]], "PE": ["51", "00|19(?:1[124]|77|90)00", "(?:[14-8]|9\\d)\\d{7}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["80"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["1"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[4-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"]]], "0", 0, 0, 0, 0, 0, [0, ["9\\d{8}", [9]]], "00", " Anexo "], "PF": ["689", "00", "4\\d{5}(?:\\d{2})?|8\\d{7,8}", [6, 8, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["44"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4|8[7-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["8[7-9]\\d{6}", [8]]]], "PG": ["675", "00|140[1-3]", "(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["18|[2-69]|85"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[78]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7\\d|8[1-38])\\d{6}", [8]]], "00"], "PH": ["63", "00", "(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}", [6, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{5})", "$1 $2", ["2"], "(0$1)"], ["(\\d{4})(\\d{4,6})", "$1 $2", ["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2", "3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"], "(0$1)"], ["(\\d{5})(\\d{4})", "$1 $2", ["346|4(?:27|9[35])|883", "3469|4(?:279|9(?:30|56))|8834"], "(0$1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|8[2-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["(?:8(?:1[37]|9[5-8])|9(?:0[5-9]|1[0-24-9]|[235-7]\\d|4[2-9]|8[135-9]|9[1-9]))\\d{7}", [10]]]], "PK": ["92", "00", "122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,7})", "$1 $2 $3", ["[89]0"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["1"]], ["(\\d{3})(\\d{6,7})", "$1 $2", ["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])", "9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"], "(0$1)"], ["(\\d{2})(\\d{7,8})", "$1 $2", ["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"], "(0$1)"], ["(\\d{5})(\\d{5})", "$1 $2", ["58"], "(0$1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[24-9]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, [0, ["3(?:[0-247]\\d|3[0-79]|55|64)\\d{7}", [10]]]], "PL": ["48", "00", "(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{5})", "$1", ["19"]], ["(\\d{3})(\\d{3})", "$1 $2", ["11|20|64"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1", "(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["64"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[2-8]|[2-7]|8[1-79]|9[145]"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["21(?:1[013-5]|2\\d)\\d{5}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}", [9]]]], "PM": ["508", "00", "[45]\\d{5}|(?:708|8\\d\\d)\\d{6}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[45]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:4[02-489]|5[02-9]|708[45][0-5])\\d{4}"]]], "PR": ["1", "011", "(?:[589]\\d\\d|787)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "787|939", [0, ["(?:787|939)[2-9]\\d{6}"]]], "PS": ["970", "00", "[2489]2\\d{6}|(?:1\\d|5)\\d{8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2489]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["5[69]\\d{7}", [9]]]], "PT": ["351", "00", "1693\\d{5}|(?:[26-9]\\d|30)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["2[12]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["16|[236-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["6(?:[06]92(?:30|9\\d)|[35]92(?:[049]\\d|3[034]))\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"]]], "PW": ["680", "01[12]", "(?:[24-8]\\d\\d|345|900)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:(?:46|83)[0-5]|6[2-4689]0)\\d{4}|(?:45|77|88)\\d{5}"]]], "PY": ["595", "00", "59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3,6})", "$1 $2", ["[2-9]0"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"], "(0$1)"], ["(\\d{3})(\\d{4,5})", "$1 $2", ["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["87"]], ["(\\d{3})(\\d{6})", "$1 $2", ["9(?:[5-79]|8[1-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"]]], "0", 0, 0, 0, 0, 0, [0, ["9(?:51|6[129]|7[1-6]|8[1-7]|9[1-5])\\d{6}", [9]]]], "QA": ["974", "00", "800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}", [7, 8, 9, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["2[16]|8"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[3-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["[35-7]\\d{7}", [8]]]], "RE": ["262", "00", "(?:26|[689]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2689]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))\\d{4}"]]], "RO": ["40", "00", "(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}", [6, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["2[3-6]", "2[3-6]\\d9"], "0$1"], ["(\\d{2})(\\d{4})", "$1 $2", ["219|31"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23]1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[236-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:630|702)0\\d{5}|(?:6(?:00|2\\d)|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[0-39]))\\d{6}", [9]]], 0, " int "], "RS": ["381", "00", "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}", [6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{3,9})", "$1 $2", ["(?:2[389]|39)0|[7-9]"], "0$1"], ["(\\d{2})(\\d{5,10})", "$1 $2", ["[1-36]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["6(?:[0-689]|7\\d)\\d{6,7}", [8, 9, 10]]]], "RU": ["7", "810", "8\\d{13}|[347-9]\\d{9}", [10, 14], [["(\\d{4})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-8]|2[1-9])", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"], "8 ($1)", 1], ["(\\d{5})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-68]|2[1-9])", "7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))", "7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[349]|8(?:[02-7]|1[1-8])"], "8 ($1)", 1], ["(\\d{4})(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["8"], "8 ($1)"]], "8", 0, 0, 0, 0, "3[04-689]|[489]", [0, ["9\\d{9}", [10]]], "8~10"], "RW": ["250", "00", "(?:06|[27]\\d\\d|[89]00)\\d{6}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7[237-9]\\d{7}", [9]]]], "SA": ["966", "00", "92\\d{7}|(?:[15]|8\\d)\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["9"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["81"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, 0, 0, 0, 0, [0, ["579[01]\\d{5}|5(?:[013-689]\\d|7[0-8])\\d{6}", [9]]]], "SB": ["677", "0[01]", "[6-9]\\d{6}|[1-6]\\d{4}", [5, 7], [["(\\d{2})(\\d{5})", "$1 $2", ["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]], 0, 0, 0, 0, 0, 0, [0, ["48\\d{3}|(?:(?:6[89]|7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}"]]], "SC": ["248", "010|0[0-2]", "(?:[2489]\\d|64)\\d{5}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[246]|9[57]"]]], 0, 0, 0, 0, 0, 0, [0, ["2[125-8]\\d{5}"]], "00"], "SD": ["249", "00", "[19]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[19]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:1[0-2]|9[0-3569])\\d{7}"]]], "SE": ["46", "00", "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}", [6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["20"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{4})", "$1-$2", ["9(?:00|39|44|9)"], "0$1", 0, "$1 $2"], ["(\\d{2})(\\d{3})(\\d{2})", "$1-$2 $3", ["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3"], ["(\\d)(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{2,3})(\\d{3})", "$1-$2 $3", ["9(?:00|39|44)"], "0$1", 0, "$1 $2 $3"], ["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["10|7"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{3})", "$1-$2 $3 $4", ["9"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4 $5", ["[26]"], "0$1", 0, "$1 $2 $3 $4 $5"]], "0", 0, 0, 0, 0, 0, [0, ["7[02369]\\d{7}", [9]]]], "SG": ["65", "0[0-3]\\d", "(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{4})(\\d{4})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, ["8(?:09[0-689]|96[0-2])\\d{4}|(?:8(?:0[1-8]|[1-8]\\d|9[0-5])|9[0-8]\\d)\\d{5}", [8]]]], "SH": ["290", "00", "(?:[256]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[256]", [0, ["[56]\\d{4}", [5]]]], "SI": ["386", "00|10(?:22|66|88|99)", "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}", [5, 6, 7, 8], [["(\\d{2})(\\d{3,6})", "$1 $2", ["8[09]|9"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["59|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37][01]|4[0139]|51|6"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-57]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, [0, ["65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[0139]|51|6[489])\\d{6}", [8]]], "00"], "SJ": ["47", "00", "0\\d{4}|(?:[489]\\d|79)\\d{6}", [5, 8], 0, 0, 0, 0, 0, 0, "79", [0, ["(?:4[015-8]|9\\d)\\d{6}", [8]]]], "SK": ["421", "00", "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}", [6, 7, 9], [["(\\d)(\\d{2})(\\d{3,4})", "$1 $2 $3", ["21"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["[3-5][1-8]1", "[3-5][1-8]1[67]"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1/$2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[689]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1/$2 $3 $4", ["[3-5]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}", [9]]]], "SL": ["232", "00", "(?:[237-9]\\d|66)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[236-9]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, [0, ["(?:25|3[0-5]|66|7[2-9]|8[08]|9[09])\\d{6}"]]], "SM": ["378", "00", "(?:0549|[5-7]\\d)\\d{6}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]"]], ["(\\d{4})(\\d{6})", "$1 $2", ["0"]]], 0, 0, "([89]\\d{5})$", "0549$1", 0, 0, [0, ["6[16]\\d{6}", [8]]]], "SN": ["221", "00", "(?:[378]\\d|93)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[379]"]]], 0, 0, 0, 0, 0, 0, [0, ["7(?:(?:[06-8]\\d|[19]0|21)\\d|5(?:0[01]|[19]0|2[25]|[38]3|[4-7]\\d))\\d{5}"]]], "SO": ["252", "00", "[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}", [6, 7, 8, 9], [["(\\d{2})(\\d{4})", "$1 $2", ["8[125]"]], ["(\\d{6})", "$1", ["[134]"]], ["(\\d)(\\d{6})", "$1 $2", ["[15]|2[0-79]|3[0-46-8]|4[0-7]"]], ["(\\d)(\\d{7})", "$1 $2", ["(?:2|90)4|[67]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[348]|64|79|90"]], ["(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|6[0-35-9]|77|9[2-9]"]]], "0", 0, 0, 0, 0, 0, [0, ["(?:(?:15|(?:3[59]|4[89]|6\\d|7[79]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}", [7, 8, 9]]]], "SR": ["597", "00", "(?:[2-5]|68|[78]\\d)\\d{5}", [6, 7], [["(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], ["(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], ["(\\d{3})(\\d{4})", "$1-$2", ["[6-8]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7[124-7]|8[124-9])\\d{5}", [7]]]], "SS": ["211", "00", "[19]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:12|9[1257-9])\\d{7}"]]], "ST": ["239", "00", "(?:22|9\\d)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]], 0, 0, 0, 0, 0, 0, [0, ["900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}"]]], "SV": ["503", "00", "[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", [7, 8, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[89]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[267]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, [0, ["[67]\\d{7}", [8]]]], "SX": ["1", "011", "7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "(5\\d{6})$|1", "721$1", 0, "721", [0, ["7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}"]]], "SY": ["963", "00", "[1-39]\\d{8}|[1-5]\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-5]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1", 1]], "0", 0, 0, 0, 0, 0, [0, ["9[1-689]\\d{7}", [9]]]], "SZ": ["268", "00", "0800\\d{4}|(?:[237]\\d|900)\\d{6}", [8, 9], [["(\\d{4})(\\d{4})", "$1 $2", ["[0237]"]], ["(\\d{5})(\\d{4})", "$1 $2", ["9"]]], 0, 0, 0, 0, 0, 0, [0, ["7[6-9]\\d{6}", [8]]]], "TA": ["290", "00", "8\\d{3}", [4], 0, 0, 0, 0, 0, 0, "8"], "TC": ["1", "011", "(?:[58]\\d\\d|649|900)\\d{7}", [10], 0, "1", 0, "([2-479]\\d{6})$|1", "649$1", 0, "649", [0, ["649(?:2(?:3[129]|4[1-79])|3\\d\\d|4[34][1-3])\\d{4}"]]], "TD": ["235", "00|16", "(?:22|[689]\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[69]\\d|77|8[56])\\d{6}"]], "00"], "TG": ["228", "00", "[279]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[279]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7[019]|9[0-36-9])\\d{6}"]]], "TH": ["66", "00[1-9]", "(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}", [8, 9, 10, 13], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[13-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0", 0, 0, 0, 0, 0, [0, ["67(?:1[0-8]|2[4-7])\\d{5}|(?:14|6[1-6]|[89]\\d)\\d{7}", [9]]]], "TJ": ["992", "810", "[0-57-9]\\d{8}", [9], [["(\\d{6})(\\d)(\\d{2})", "$1 $2 $3", ["331", "3317"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["44[02-479]|[34]7"]], ["(\\d{4})(\\d)(\\d{4})", "$1 $2 $3", ["3(?:[1245]|3[12])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[0-57-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:33[03-9]|4(?:1[18]|4[02-479])|81[1-9])\\d{6}|(?:[09]\\d|1[0178]|2[02]|[34]0|5[05]|7[01578]|8[078])\\d{7}"]], "8~10"], "TK": ["690", "00", "[2-47]\\d{3,6}", [4, 5, 6, 7], 0, 0, 0, 0, 0, 0, 0, [0, ["7[2-4]\\d{2,5}"]]], "TL": ["670", "00", "7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-489]|70"]], ["(\\d{4})(\\d{4})", "$1 $2", ["7"]]], 0, 0, 0, 0, 0, 0, [0, ["7[2-8]\\d{6}", [8]]]], "TM": ["993", "810", "(?:[1-6]\\d|71)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["12"], "(8 $1)"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-5]"], "(8 $1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[67]"], "8 $1"]], "8", 0, 0, 0, 0, 0, [0, ["(?:6\\d|71)\\d{6}"]], "8~10"], "TN": ["216", "00", "[2-57-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-57-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-8])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}"]]], "TO": ["676", "00", "(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}", [5, 7], [["(\\d{2})(\\d{3})", "$1-$2", ["[2-4]|50|6[09]|7[0-24-69]|8[05]"]], ["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[5-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:5(?:4[0-5]|5[4-6])|6(?:[09]\\d|3[02]|8[15-9])|(?:7\\d|8[46-9])\\d|999)\\d{4}", [7]]]], "TR": ["90", "00", "4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}", [7, 10, 12, 13], [["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["512|8[01589]|90"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5(?:[0-59]|61)", "5(?:[0-59]|61[06])", "5(?:[0-59]|61[06]1)"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24][1-8]|3[1-9]"], "(0$1)", 1], ["(\\d{3})(\\d{3})(\\d{6,7})", "$1 $2 $3", ["80"], "0$1", 1]], "0", 0, 0, 0, 0, 0, [0, ["561(?:011|61\\d)\\d{4}|5(?:0[15-7]|1[06]|24|[34]\\d|5[1-59]|9[46])\\d{7}", [10]]]], "TT": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-46-8]\\d{6})$|1", "868$1", 0, "868", [0, ["868(?:(?:2[5-9]|3\\d)\\d|4(?:3[0-6]|[6-9]\\d)|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}"]]], "TV": ["688", "00", "(?:2|7\\d\\d|90)\\d{4}", [5, 6, 7], [["(\\d{2})(\\d{3})", "$1 $2", ["2"]], ["(\\d{2})(\\d{4})", "$1 $2", ["90"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7[01]\\d|90)\\d{4}", [6, 7]]]], "TW": ["886", "0(?:0[25-79]|19)", "[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}", [7, 8, 9, 10, 11], [["(\\d{2})(\\d)(\\d{4})", "$1 $2 $3", ["202"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[258]0"], "0$1"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]", "[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:40001[0-2]|9[0-8]\\d{4})\\d{3}", [9]]], 0, "#"], "TZ": ["255", "00[056]", "(?:[25-8]\\d|41|90)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[24]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["5"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[67]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:6[125-9]|7[13-9])\\d{7}"]]], "UA": ["380", "00", "[89]\\d{9}|[3-9]\\d{8}", [9, 10], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]", "6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])", "3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|89|9[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["790\\d{6}|(?:39|50|6[36-8]|7[1-357]|9[1-9])\\d{7}", [9]]], "0~0"], "UG": ["256", "00[057]", "800\\d{6}|(?:[29]0|[347]\\d)\\d{7}", [9], [["(\\d{4})(\\d{5})", "$1 $2", ["202", "2024"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[27-9]|4(?:6[45]|[7-9])"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[34]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["72[48]0\\d{5}|7(?:[015-8]\\d|2[067]|36|4[0-6]|9[89])\\d{6}"]]], "US": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [10], [["(\\d{3})(\\d{4})", "$1-$2", ["310"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], 0, 1, "$1-$2-$3"]], "1", 0, 0, 0, 0, 0, [0, ["(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468])|7302[0-4]\\d)\\d{4}|(?:305[3-9]|472[24]|505[2-57-9]|7306|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013569]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"]]], "UY": ["598", "0(?:0|1[3-9]\\d)", "0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}", [6, 7, 8, 9, 10, 11, 12, 13], [["(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], ["(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], "0", 0, 0, 0, 0, 0, [0, ["9[1-9]\\d{6}", [8]]], "00", " int. "], "UZ": ["998", "00", "(?:20|33|[5-79]\\d|88)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:(?:[25]0|33|88|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}"]]], "VA": ["39", "00", "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", [6, 7, 8, 9, 10, 11, 12], 0, 0, 0, 0, 0, 0, "06698", [0, ["3[1-9]\\d{8}|3[2-9]\\d{7}", [9, 10]]]], "VC": ["1", "011", "(?:[58]\\d\\d|784|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "784$1", 0, "784", [0, ["784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4])|720)\\d{4}"]]], "VE": ["58", "00", "[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}", [10], [["(\\d{3})(\\d{7})", "$1-$2", ["[24-689]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["4(?:1[24-8]|2[46])\\d{7}"]]], "VG": ["1", "011", "(?:284|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-578]\\d{6})$|1", "284$1", 0, "284", [0, ["284(?:245|3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|9[69])|5(?:4[0-7]|68|9[69]))\\d{4}"]]], "VI": ["1", "011", "[58]\\d{9}|(?:34|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "340$1", 0, "340", [0, ["340(?:2(?:0\\d|10|2[06-8]|4[49]|77)|3(?:32|44)|4(?:2[23]|44|7[34]|89)|5(?:1[34]|55)|6(?:2[56]|4[23]|77|9[023])|7(?:1[2-57-9]|2[57]|7\\d)|884|998)\\d{4}"]]], "VN": ["84", "00", "[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["80"], "0$1", 1], ["(\\d{4})(\\d{4,6})", "$1 $2", ["1"], 0, 1], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["6"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[357-9]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["2[48]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["2"], "0$1", 1]], "0", 0, 0, 0, 0, 0, [0, ["(?:5(?:2[238]|59)|89[6-9]|99[013-9])\\d{6}|(?:3\\d|5[1689]|7[06-9]|8[1-8]|9[0-8])\\d{7}", [9]]]], "VU": ["678", "00", "[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}", [5, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["[57-9]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[58]\\d|7[013-7])\\d{5}", [7]]]], "WF": ["681", "00", "(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[47-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:72|8[23])\\d{4}", [6]]]], "WS": ["685", "0", "(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}", [5, 6, 7, 10], [["(\\d{5})", "$1", ["[2-5]|6[1-9]"]], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[68]"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:7[1-35-7]|8(?:[3-7]|9\\d{3}))\\d{5}", [7, 10]]]], "XK": ["383", "00", "2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2|39"], "0$1"], ["(\\d{2})(\\d{7,10})", "$1 $2", ["3"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["4[3-9]\\d{6}", [8]]]], "YE": ["967", "00", "(?:1|7\\d)\\d{7}|[1-7]\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-6]|7(?:[24-6]|8[0-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7[01378]\\d{7}", [9]]]], "YT": ["262", "00", "(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}", [9], 0, "0", 0, 0, 0, 0, 0, [0, ["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"]]], "ZA": ["27", "00", "[1-79]\\d{8}|8\\d{4,9}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,4})", "$1 $2", ["8[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["8[1-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["860"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:1(?:3492[0-25]|4495[0235]|549(?:20|5[01]))|4[34]492[01])\\d{3}|8[1-4]\\d{3,7}|(?:2[27]|47|54)4950\\d{3}|(?:1(?:049[2-4]|9[12]\\d\\d)|(?:6\\d\\d|7(?:[0-46-9]\\d|5[0-4]))\\d\\d|8(?:5\\d{3}|7(?:08[67]|158|28[5-9]|310)))\\d{4}|(?:1[6-8]|28|3[2-69]|4[025689]|5[36-8])4920\\d{3}|(?:12|[2-5]1)492\\d{4}", [5, 6, 7, 8, 9]]]], "ZM": ["260", "00", "800\\d{6}|(?:21|63|[79]\\d)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[28]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[79]"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["(?:7[5-79]|9[5-8])\\d{7}"]]], "ZW": ["263", "00", "2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}", [5, 6, 7, 8, 9, 10], [["(\\d{3})(\\d{3,5})", "$1 $2", ["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"], "0$1"], ["(\\d)(\\d{3})(\\d{2,4})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2", "2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)", "2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["29[013-9]|39|54"], "0$1"], ["(\\d{4})(\\d{3,5})", "$1 $2", ["(?:25|54)8", "258|5483"], "0$1"]], "0", 0, 0, 0, 0, 0, [0, ["7(?:[1278]\\d|3[1-9])\\d{6}", [9]]]] }, "nonGeographic": { "800": ["800", 0, "(?:00|[1-9]\\d)\\d{6}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["\\d"]]], 0, 0, 0, 0, 0, 0, [0, 0, ["(?:00|[1-9]\\d)\\d{6}"]]], "808": ["808", 0, "[1-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[1-9]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, ["[1-9]\\d{7}"]]], "870": ["870", 0, "7\\d{11}|[35-7]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[35-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]], "878": ["878", 0, "10\\d{10}", [12], [["(\\d{2})(\\d{5})(\\d{5})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["10\\d{10}"]]], "881": ["881", 0, "6\\d{9}|[0-36-9]\\d{8}", [9, 10], [["(\\d)(\\d{3})(\\d{5})", "$1 $2 $3", ["[0-37-9]"]], ["(\\d)(\\d{3})(\\d{5,6})", "$1 $2 $3", ["6"]]], 0, 0, 0, 0, 0, 0, [0, ["6\\d{9}|[0-36-9]\\d{8}"]]], "882": ["882", 0, "[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5})", "$1 $2", ["16|342"]], ["(\\d{2})(\\d{6})", "$1 $2", ["49"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["1[36]|9"]], ["(\\d{2})(\\d{4})(\\d{3})", "$1 $2 $3", ["3[23]"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["16"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|23|3(?:[15]|4[57])|4|51"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["34"]], ["(\\d{2})(\\d{4,5})(\\d{5})", "$1 $2 $3", ["[1-35]"]]], 0, 0, 0, 0, 0, 0, [0, ["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}", [7, 8, 9, 10, 12]], 0, 0, 0, ["348[57]\\d{7}", [11]], 0, 0, ["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]], "883": ["883", 0, "(?:[1-4]\\d|51)\\d{6,10}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,8})", "$1 $2 $3", ["[14]|2[24-689]|3[02-689]|51[24-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["510"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["21"]], ["(\\d{4})(\\d{4})(\\d{4})", "$1 $2 $3", ["51[13]"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[235]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]], "888": ["888", 0, "\\d{11}", [11], [["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, ["\\d{11}"]]], "979": ["979", 0, "[1359]\\d{8}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, ["[1359]\\d{8}"]]] } };
- function withMetadataArgument(func, _arguments) {
- var args = Array.prototype.slice.call(_arguments);
- args.push(metadata);
- return func.apply(this, args);
- }
- function parsePhoneNumber() {
- return withMetadataArgument(parsePhoneNumber$2, arguments);
- }
- const _imports_0$9 = "/static/icon/select-icon.png";
- const _sfc_main$34 = {
- __name: "phone-international-input",
- props: {
- verifyUsername: {
- type: Boolean
- }
- },
- emits: ["input"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const country = vue.ref(countryData);
- const selectedCode = vue.ref("");
- const selectedCountryCode = vue.ref("");
- const selectedIndex = vue.ref(0);
- const findIndexByCode = (code2) => {
- return country.value.findIndex((item) => item.phone_code == code2);
- };
- const pickChange = (e2) => {
- selectedIndex.value = e2.detail.value;
- selectedCode.value = country.value[selectedIndex.value].phone_code;
- selectedCountryCode.value = country.value[selectedIndex.value].country_code;
- };
- onLoad(() => {
- const chinaIndex = findIndexByCode("86");
- if (chinaIndex !== -1) {
- selectedIndex.value = chinaIndex;
- selectedCode.value = country.value[chinaIndex].phone_code;
- selectedCountryCode.value = country.value[chinaIndex].country_code;
- }
- });
- const props = __props;
- const emits = __emit;
- const verifyMobile = (e2) => {
- const phone = e2;
- if (phone == "") {
- emits("input", phone, t$6("account.phone_number"));
- } else {
- try {
- const phoneParseMobile = parsePhoneNumber(phone, selectedCountryCode.value);
- if (phoneParseMobile.isValid()) {
- emits("input", phone, "");
- } else {
- emits("input", phone, t$6("account.incorrect_phone_format"));
- }
- } catch (e3) {
- }
- }
- };
- const state = vue.reactive({
- codeText: t$6("account.get_verification_code"),
- model: {
- mobile: ""
- // 手机号
- }
- });
- const __returned__ = { country, selectedCode, selectedCountryCode, selectedIndex, findIndexByCode, pickChange, props, emits, verifyMobile, state, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get onLoad() {
- return onLoad;
- }, get countryData() {
- return countryData;
- }, get parsePhoneNumberFromString() {
- return parsePhoneNumber$1;
- }, get AsYouType() {
- return AsYouType;
- }, get parseMobile() {
- return parsePhoneNumber;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$33(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createElementVNode("picker", {
- mode: "selector",
- range: $setup.country.map((item) => item.chinese_name + " +" + item.phone_code),
- value: $setup.selectedIndex,
- onChange: $setup.pickChange,
- style: { "float": "left", "height": "100%", "width": "110rpx", "display": "flex", "align-items": "center" }
- }, [
- vue.createElementVNode("view", null, [
- vue.createTextVNode(
- "+" + vue.toDisplayString($setup.selectedCode) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode("image", {
- src: _imports_0$9,
- style: { "width": "20rpx", "height": "20rpx" }
- })
- ])
- ], 40, ["range", "value"]),
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.phone_number"),
- modelValue: $setup.state.model.mobile,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.mobile = $event),
- onInput: $setup.verifyMobile,
- inputBorder: false,
- type: "number",
- style: { "float": "left", "width": "calc(100% - 110rpx)" }
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button code-btn code-btn-start", { "disabled": !$props.verifyUsername || $setup.selectedCode != 86 }]),
- disabled: !$props.verifyUsername || $setup.selectedCode != 86,
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.getSmsCode("smsLogin", $setup.state.model.mobile))
- }, vue.toDisplayString($setup.getSmsTimer("smsLogin")), 11, ["disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["placeholder", "modelValue"])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const phoneInternationalInput = /* @__PURE__ */ _export_sfc(_sfc_main$34, [["render", _sfc_render$33], ["__scopeId", "data-v-5db53ad8"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/phone-international-input.vue"]]);
- const _sfc_main$33 = {
- __name: "sms-login",
- props: {
- agreeStatus: {
- type: Boolean,
- default: false
- }
- },
- emits: ["onConfirm"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const mobileInput = (mobile2, mobileError) => {
- state.model.mobile = mobile2;
- state.mobileErrorMsg = mobileError;
- };
- const smsLoginRef = vue.ref(null);
- const emits = __emit;
- const props = __props;
- const state = vue.reactive({
- verifyUsername: true,
- usernameErrorMsg: "",
- isMobileEnd: false,
- // 手机号输入完毕
- codeText: t$6("account.get_verification_code"),
- mobileErrorMsg: "",
- model: {
- username: "",
- mobile: "",
- // 手机号
- code: ""
- // 验证码
- },
- rules: {
- username,
- code,
- mobile
- }
- });
- let lastUsername = vue.ref("");
- async function verifyUsername(e2) {
- const username2 = e2.detail.value;
- if (username2 == "" || username2 == lastUsername.value) {
- return false;
- }
- lastUsername.value = username2;
- const { data } = await AuthUtil.verifyUsername(username2);
- if (data) {
- state.usernameErrorMsg = t$6("account.enter_valid_username");
- state.verifyUsername = data;
- } else {
- state.usernameErrorMsg = "";
- state.verifyUsername = data;
- }
- }
- async function smsLoginSubmit() {
- const linkId = uni.getStorageSync("linkId");
- if (linkId) {
- state.model.linkId = linkId;
- }
- const validate = await vue.unref(smsLoginRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/sms-login.vue:120", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- if (!props.agreeStatus) {
- emits("onConfirm", true);
- sheep$1.$helper.toast(t$6("account.please_agree"));
- return;
- }
- const {
- code: code2
- } = await AuthUtil.smsLogin(state.model);
- if (code2 === 0) {
- closeAuthModal();
- }
- }
- const __returned__ = { mobileInput, smsLoginRef, emits, props, state, get lastUsername() {
- return lastUsername;
- }, set lastUsername(v2) {
- lastUsername = v2;
- }, verifyUsername, smsLoginSubmit, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get code() {
- return code;
- }, get mobile() {
- return mobile;
- }, get username() {
- return username;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get AuthUtil() {
- return AuthUtil;
- }, phoneInternationalInput, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$32(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- ref: "smsLoginRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "160",
- labelAlign: "center",
- class: "loginUniForm"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- name: "username",
- label: $setup.t("account.username"),
- class: "loginUniFormItem",
- "error-message": $setup.state.usernameErrorMsg
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_username"),
- modelValue: $setup.state.model.username,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.username = $event),
- inputBorder: false,
- clearable: false,
- onBlur: $setup.verifyUsername
- }, {
- right: vue.withCtx(() => [
- $setup.state.verifyUsername ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- style: "",
- src: $setup.sheep.$url.static("/static/images/shibai.png")
- }, null, 8, ["src"])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/chenggong.png")
- }, null, 8, ["src"])
- ]))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "error-message"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("account.phone_number"),
- class: "mobile loginUniFormItem ss-p-t-10",
- "error-message": $setup.state.mobileErrorMsg
- }, {
- default: vue.withCtx(() => [
- vue.createVNode($setup["phoneInternationalInput"], {
- "verify-username": !$setup.state.verifyUsername,
- onInput: $setup.mobileInput
- }, null, 8, ["verify-username"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "error-message"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "code",
- label: $setup.t("account.verification_code"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_verification_code"),
- modelValue: $setup.state.model.code,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.code = $event),
- inputBorder: false,
- type: "number",
- maxlength: "4"
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- vue.createElementVNode("view", { style: { "display": "flex", "justify-content": "space-between", "margin-top": "20rpx" } }, [
- vue.createCommentVNode(` <button class="ss-reset-button forgot-btn" @tap="showAuthModal('resetPassword')">\r
- 忘记密码\r
- </button> `),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.smsLoginSubmit
- },
- vue.toDisplayString($setup.t("account.login")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const smsLogin = /* @__PURE__ */ _export_sfc(_sfc_main$33, [["render", _sfc_render$32], ["__scopeId", "data-v-7636e637"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/sms-login.vue"]]);
- const _sfc_main$32 = {
- __name: "register",
- props: {
- agreeStatus: {
- type: Boolean,
- default: false
- }
- },
- emits: ["onConfirm"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const mobileInput = (mobile2, mobileError) => {
- state.model.mobile = mobile2;
- state.mobileErrorMsg = mobileError;
- };
- const state = vue.reactive({
- verifyUsername: false,
- // 校验用户名是否可用
- codeText: "获取验证码",
- mobileErrorMsg: "",
- usernameErrorMsg: "",
- model: {
- username: "",
- // 用户名
- password: "",
- // 密码
- mobile: "",
- // 手机号
- code: ""
- // 验证码
- },
- rules: {
- username,
- password,
- code
- }
- });
- const smsLoginRef = vue.ref(null);
- const emits = __emit;
- const props = __props;
- let lastUsername = vue.ref("");
- async function verifyUsername(e2) {
- const username2 = e2.detail.value;
- if (username2 == "" || username2 == lastUsername.value) {
- return false;
- }
- lastUsername.value = username2;
- const { data } = await AuthUtil.verifyUsername(username2);
- if (data) {
- state.usernameErrorMsg = "";
- state.verifyUsername = data;
- } else {
- state.usernameErrorMsg = t$6("account.username_exists");
- state.verifyUsername = data;
- }
- }
- async function registerSubmit() {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/register.vue:117", state.model);
- const validate = await vue.unref(smsLoginRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/register.vue:122", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- if (!props.agreeStatus) {
- emits("onConfirm", true);
- sheep$1.$helper.toast(t$6("account.please_agree"));
- return;
- }
- const {
- code: code2
- } = await AuthUtil.register(state.model);
- if (code2 === 0) {
- closeAuthModal();
- }
- }
- const __returned__ = { mobileInput, state, smsLoginRef, emits, props, get lastUsername() {
- return lastUsername;
- }, set lastUsername(v2) {
- lastUsername = v2;
- }, verifyUsername, registerSubmit, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get code() {
- return code;
- }, get mobile() {
- return mobile;
- }, get username() {
- return username;
- }, get password() {
- return password;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get AuthUtil() {
- return AuthUtil;
- }, phoneInternationalInput, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$31(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- ref: "smsLoginRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "140",
- labelAlign: "center",
- class: "loginUniForm"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- name: "username",
- label: $setup.t("account.username"),
- class: "loginUniFormItem",
- "error-message": $setup.state.usernameErrorMsg
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_username"),
- modelValue: $setup.state.model.username,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.username = $event),
- inputBorder: false,
- clearable: false,
- onBlur: $setup.verifyUsername
- }, {
- right: vue.withCtx(() => [
- !$setup.state.verifyUsername ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- style: "",
- src: $setup.sheep.$url.static("/static/images/shibai.png")
- }, null, 8, ["src"])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/chenggong.png")
- }, null, 8, ["src"])
- ]))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "error-message"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "password",
- label: $setup.t("account.password"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- type: "password",
- placeholder: $setup.t("account.enter_password"),
- modelValue: $setup.state.model.password,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.password = $event),
- inputBorder: false
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("account.phone_number"),
- class: "mobile loginUniFormItem ss-p-t-10",
- "error-message": $setup.state.mobileErrorMsg
- }, {
- default: vue.withCtx(() => [
- vue.createVNode($setup["phoneInternationalInput"], {
- "verify-username": $setup.state.verifyUsername,
- onInput: $setup.mobileInput
- }, null, 8, ["verify-username"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "error-message"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "code",
- label: $setup.t("account.verification_code"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_verification_code"),
- modelValue: $setup.state.model.code,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.code = $event),
- inputBorder: false,
- type: "number",
- maxlength: "4"
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- vue.createElementVNode("view", { style: { "display": "flex", "justify-content": "space-between", "margin-top": "20rpx" } }, [
- vue.createCommentVNode(` <button class="ss-reset-button forgot-btn" @tap="showAuthModal('resetPassword')">
- 忘记密码
- </button> `),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.registerSubmit
- },
- vue.toDisplayString($setup.t("account.register")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const register = /* @__PURE__ */ _export_sfc(_sfc_main$32, [["render", _sfc_render$31], ["__scopeId", "data-v-5a48a10b"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/register.vue"]]);
- const _sfc_main$31 = {
- __name: "reset-password",
- setup(__props, { expose: __expose }) {
- __expose();
- const resetPasswordRef = vue.ref(null);
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- const state = vue.reactive({
- isMobileEnd: false,
- // 手机号输入完毕
- model: {
- mobile: "",
- // 手机号
- code: "",
- // 验证码
- password: ""
- // 密码
- },
- rules: {
- code,
- mobile,
- password
- }
- });
- const resetPasswordSubmit = async () => {
- const validate = await vue.unref(resetPasswordRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/reset-password.vue:102", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const { code: code2 } = await UserApi.resetUserPassword(state.model);
- if (code2 !== 0) {
- return;
- }
- showAuthModal("accountLogin");
- };
- const __returned__ = { resetPasswordRef, isLogin, state, resetPasswordSubmit, computed: vue.computed, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, get sheep() {
- return sheep$1;
- }, get code() {
- return code;
- }, get mobile() {
- return mobile;
- }, get password() {
- return password;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get UserApi() {
- return UserApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$30(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 标题栏 "),
- vue.createElementVNode("view", { class: "head-box ss-m-b-60" }, [
- vue.createElementVNode("view", { class: "head-title ss-m-b-20" }, "重置密码"),
- vue.createElementVNode("view", { class: "head-subtitle" }, "为了您的账号安全,设置密码前请先进行安全验证")
- ]),
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- ref: "resetPasswordRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "140",
- labelAlign: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: "手机号"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: "请输入手机号",
- modelValue: $setup.state.model.mobile,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.mobile = $event),
- type: "number",
- inputBorder: false
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button code-btn code-btn-start", { "code-btn-end": $setup.state.isMobileEnd }]),
- disabled: $setup.state.isMobileEnd,
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.getSmsCode("resetPassword", $setup.state.model.mobile))
- }, vue.toDisplayString($setup.getSmsTimer("resetPassword")), 11, ["disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "code",
- label: "验证码"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: "请输入验证码",
- modelValue: $setup.state.model.code,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.code = $event),
- type: "number",
- maxlength: "4",
- inputBorder: false
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "password",
- label: "密码"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- type: "password",
- placeholder: "请输入密码",
- modelValue: $setup.state.model.password,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model.password = $event),
- inputBorder: false
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.resetPasswordSubmit
- }, " 确认 ")
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- !$setup.isLogin ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "ss-reset-button type-btn",
- onClick: _cache[5] || (_cache[5] = ($event) => $setup.showAuthModal("accountLogin"))
- }, " 返回登录 ")) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const resetPassword = /* @__PURE__ */ _export_sfc(_sfc_main$31, [["render", _sfc_render$30], ["__scopeId", "data-v-859b5179"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/reset-password.vue"]]);
- const _sfc_main$30 = {
- __name: "change-mobile",
- setup(__props, { expose: __expose }) {
- __expose();
- const step = vue.ref(0);
- const changeMobileRef = vue.ref(null);
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const state = vue.reactive({
- isMobileEnd: false,
- // 手机号输入完毕
- model: {
- oldMobile: "",
- oldCode: "",
- mobile: "",
- // 手机号
- code: ""
- // 验证码
- },
- rules: {
- code,
- mobile
- }
- });
- async function nextStep() {
- const validate = await vue.unref(changeMobileRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/change-mobile.vue:113", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const {
- code: code2,
- data
- } = await AuthUtil.validatePhone(state.model.oldMobile, state.model.oldCode, 2);
- formatAppLog("log", "at sheep/components/s-auth-modal/components/change-mobile.vue:122", "下一步的请求校验", data);
- if (data) {
- step.value = 1;
- }
- }
- async function changeMobileSubmit() {
- const validate = await vue.unref(changeMobileRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/change-mobile.vue:133", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const {
- code: code2
- } = await UserApi.updateUserMobile({ "mobile": state.model.mobile, "code": state.model.code });
- if (code2 !== 0) {
- return;
- }
- uni.showToast({
- icon: "success",
- title: t$6("account.login_again")
- });
- setTimeout(function() {
- sheep$1.$store("user").logout();
- closeAuthModal();
- sheep$1.$router.go("/pages/index/user");
- }, 1e3);
- }
- async function getPhoneNumber(e2) {
- if (e2.detail.errMsg !== "getPhoneNumber:ok") {
- return;
- }
- const result2 = await sheep$1.$platform.useProvider().bindUserPhoneNumber(e2.detail);
- if (result2) {
- sheep$1.$store("user").getInfo();
- closeAuthModal();
- }
- }
- const __returned__ = { step, changeMobileRef, userInfo: userInfo2, state, nextStep, changeMobileSubmit, getPhoneNumber, computed: vue.computed, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, get sheep() {
- return sheep$1;
- }, get code() {
- return code;
- }, get mobile() {
- return mobile;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get UserApi() {
- return UserApi;
- }, get AuthUtil() {
- return AuthUtil;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2$(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 标题栏 "),
- vue.createElementVNode("view", { class: "head-box ss-m-b-60" }, [
- vue.createElementVNode(
- "view",
- { class: "head-title ss-m-b-20" },
- vue.toDisplayString($setup.userInfo.mobile ? $setup.t("account.change_phone_number") : $setup.t("account.bind_phone_number")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "head-subtitle" },
- vue.toDisplayString($setup.t("account.security_notice")),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 表单项 "),
- !$setup.step ? (vue.openBlock(), vue.createBlock(_component_uni_forms, {
- key: 0,
- ref: "changeMobileRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "140",
- labelAlign: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("account.old_phone_number")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_old_phone_number"),
- modelValue: $setup.state.model.oldMobile,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.oldMobile = $event),
- inputBorder: false,
- type: "number"
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button code-btn-start", { "code-btn-end": $setup.state.isMobileEnd }]),
- disabled: $setup.state.isMobileEnd,
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.getSmsCode("changeMobileOld", $setup.state.model.oldMobile))
- }, vue.toDisplayString($setup.getSmsTimer("changeMobileOld")), 11, ["disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "code",
- label: $setup.t("account.verification_code")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_verification_code"),
- modelValue: $setup.state.model.oldCode,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.oldCode = $event),
- inputBorder: false,
- type: "number",
- maxlength: "4"
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.nextStep
- },
- vue.toDisplayString($setup.t("common.next")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"])) : (vue.openBlock(), vue.createBlock(_component_uni_forms, {
- key: 1,
- ref: "changeMobileRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "140",
- labelAlign: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("account.new_phone_number")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_new_phone_number"),
- modelValue: $setup.state.model.mobile,
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $setup.state.model.mobile = $event),
- inputBorder: false,
- type: "number"
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button code-btn-start", { "code-btn-end": $setup.state.isMobileEnd }]),
- disabled: $setup.state.isMobileEnd,
- onClick: _cache[4] || (_cache[4] = ($event) => $setup.getSmsCode("changeMobileNew", $setup.state.model.mobile))
- }, vue.toDisplayString($setup.getSmsTimer("changeMobileNew")), 11, ["disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "code",
- label: $setup.t("account.verification_code")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_verification_code"),
- modelValue: $setup.state.model.code,
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.state.model.code = $event),
- inputBorder: false,
- type: "number",
- maxlength: "4"
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.changeMobileSubmit
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"])),
- vue.createCommentVNode(" 微信独有:读取手机号 "),
- vue.createCommentVNode(` <button
- v-if="'WechatMiniProgram' === sheep.$platform.name"
- class="ss-reset-button type-btn"
- open-type="getPhoneNumber"
- @getphonenumber="getPhoneNumber"
- >
- 使用微信手机号
- </button> `)
- ]);
- }
- const changeMobile = /* @__PURE__ */ _export_sfc(_sfc_main$30, [["render", _sfc_render$2$], ["__scopeId", "data-v-146b49fd"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/change-mobile.vue"]]);
- const _sfc_main$2$ = {
- __name: "change-password",
- setup(__props, { expose: __expose }) {
- __expose();
- const changePasswordRef = vue.ref(null);
- const state = vue.reactive({
- isMobileEnd: false,
- // 手机号输入完毕
- model: {
- mobile: "",
- // 手机号
- code: "",
- // 验证码
- password: ""
- // 密码
- },
- rules: {
- code,
- password
- }
- });
- async function changePasswordSubmit() {
- if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+\S{5,12}$/.test(state.model.password)) {
- uni.showToast({
- icon: "error",
- title: t$6("account.password_requirements")
- });
- }
- const validate = await vue.unref(changePasswordRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/change-password.vue:90", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const {
- code: code2
- } = await UserApi.updateUserPassword(state.model);
- if (code2 !== 0) {
- return;
- }
- uni.showToast({
- icon: "success",
- title: t$6("account.modification_successful")
- });
- setTimeout(function() {
- closeAuthModal();
- }, 1e3);
- }
- const __returned__ = { changePasswordRef, state, changePasswordSubmit, get sheep() {
- return sheep$1;
- }, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, get code() {
- return code;
- }, get password() {
- return password;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get UserApi() {
- return UserApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2_(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 标题栏 "),
- vue.createElementVNode("view", { class: "head-box ss-m-b-60" }, [
- vue.createElementVNode(
- "view",
- { class: "head-title ss-m-b-20" },
- vue.toDisplayString($setup.t("account.change_password")),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(' <view class="head-subtitle">如密码丢失或未设置,请点击忘记密码重新设置</view> ')
- ]),
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- ref: "changePasswordRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "140",
- labelAlign: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- name: "code",
- label: $setup.t("account.verification_code")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_verification_code"),
- modelValue: $setup.state.model.code,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.code = $event),
- type: "number",
- maxlength: "4",
- inputBorder: false
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button code-btn code-btn-start", { "code-btn-end": $setup.state.isMobileEnd }]),
- disabled: $setup.state.isMobileEnd,
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.getSmsCode("changePassword"))
- }, vue.toDisplayString($setup.getSmsTimer("changePassword")), 11, ["disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "reNewPassword",
- label: $setup.t("account.password")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- type: "password",
- placeholder: $setup.t("account.enter_password"),
- modelValue: $setup.state.model.password,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.password = $event),
- inputBorder: false
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.changePasswordSubmit
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button type-btn",
- onClick: _cache[4] || (_cache[4] = (...args) => $setup.closeAuthModal && $setup.closeAuthModal(...args))
- },
- vue.toDisplayString($setup.t("account.cancel_change")),
- 1
- /* TEXT */
- )
- ]);
- }
- const changePassword = /* @__PURE__ */ _export_sfc(_sfc_main$2$, [["render", _sfc_render$2_], ["__scopeId", "data-v-639aa0c2"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/change-password.vue"]]);
- const _sfc_main$2_ = {
- __name: "mp-authorization",
- props: {
- agreeStatus: {
- type: Boolean,
- default: false
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const accountLoginRef = vue.ref(null);
- const state = vue.reactive({
- model: {
- nickname: userInfo2.value.nickname,
- avatar: userInfo2.value.avatar
- },
- rules: {},
- disabledStyle: {
- color: "#999",
- disableColor: "#fff"
- }
- });
- function onChooseAvatar(e2) {
- const tempUrl = e2.detail.avatarUrl || "";
- uploadAvatar(tempUrl);
- }
- async function uploadAvatar(tempUrl) {
- if (!tempUrl) {
- return;
- }
- let { data } = await FileApi.uploadFile(tempUrl);
- state.model.avatar = data;
- }
- async function onConfirm() {
- const { model } = state;
- const { nickname, avatar } = model;
- if (!nickname) {
- sheep$1.$helper.toast(t$6("account.select_avatar"));
- return;
- }
- if (!avatar) {
- sheep$1.$helper.toast(t$6("account.enter_nickname"));
- return;
- }
- const { code: code2 } = await UserApi.updateUser({
- avatar: state.model.avatar,
- nickname: state.model.nickname
- });
- if (code2 === 0) {
- sheep$1.$helper.toast(t$6("account.authorization_successful"));
- await sheep$1.$store("user").getInfo();
- closeAuthModal();
- }
- }
- const __returned__ = { props, userInfo: userInfo2, accountLoginRef, state, onChooseAvatar, uploadAvatar, onConfirm, computed: vue.computed, ref: vue.ref, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get FileApi() {
- return FileApi;
- }, get UserApi() {
- return UserApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2Z(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 标题栏 "),
- vue.createElementVNode("view", { class: "head-box ss-m-b-60 ss-flex-col" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-m-b-20" }, [
- vue.createElementVNode(
- "view",
- { class: "head-title ss-m-r-40 head-title-animation" },
- vue.toDisplayString($setup.t("account.authorization_info")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "head-subtitle" },
- vue.toDisplayString($setup.t("account.complete_profile")),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- ref: "accountLoginRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "140",
- labelAlign: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 获取头像昵称:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/userProfile.html "),
- vue.createVNode(_component_uni_forms_item, {
- name: "avatar",
- label: $setup.t("account.avatar")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button avatar-btn",
- "open-type": "chooseAvatar",
- onChooseavatar: $setup.onChooseAvatar
- },
- [
- vue.createElementVNode("image", {
- class: "avatar-img",
- src: $setup.sheep.$url.cdn($setup.state.model.avatar),
- mode: "aspectFill",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/user/info"))
- }, null, 8, ["src"]),
- vue.createElementVNode("text", { class: "cicon-forward" })
- ],
- 32
- /* NEED_HYDRATION */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "nickname",
- label: $setup.t("account.nickname")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- type: "nickname",
- placeholder: $setup.t("account.enter_nickname"),
- modelValue: $setup.state.model.nickname,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.nickname = $event),
- inputBorder: false
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createElementVNode("view", { class: "foot-box" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button authorization-btn",
- onClick: $setup.onConfirm
- },
- vue.toDisplayString($setup.t("account.confirm_authorization")),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"])
- ]);
- }
- const mpAuthorization = /* @__PURE__ */ _export_sfc(_sfc_main$2_, [["render", _sfc_render$2Z], ["__scopeId", "data-v-bf1cb4c0"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/mp-authorization.vue"]]);
- const _sfc_main$2Z = {
- __name: "officialAccountFirstLogin",
- emits: ["onConfirm"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const smsLoginRef = vue.ref(null);
- const emits = __emit;
- const state = vue.reactive({
- isMobileEnd: false,
- // 手机号输入完毕
- codeText: "获取验证码",
- model: {
- mobile: "",
- // 手机号
- code: ""
- // 验证码
- },
- rules: {
- code,
- mobile
- }
- });
- async function OfficialEnterLogin() {
- const validate = await vue.unref(smsLoginRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/officialAccountFirstLogin.vue:85", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const {
- code: code2
- } = await AuthUtil.smsLogin(state.model);
- if (code2 === 0) {
- closeAuthModal();
- }
- }
- const __returned__ = { smsLoginRef, emits, state, OfficialEnterLogin, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get code() {
- return code;
- }, get mobile() {
- return mobile;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get AuthUtil() {
- return AuthUtil;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2Y(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createElementVNode("view", { class: "head-box" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-m-b-20" }, [
- vue.createElementVNode(
- "view",
- { class: "isActive head-title" },
- vue.toDisplayString($setup.t("account.first_time_login")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- ref: "smsLoginRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "140",
- labelAlign: "center",
- class: "loginUniForm"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("account.phone_number"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_phone_number"),
- modelValue: $setup.state.model.mobile,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.mobile = $event),
- inputBorder: false,
- type: "number"
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button code-btn code-btn-start", { "code-btn-end": $setup.state.isMobileEnd }]),
- disabled: $setup.state.isMobileEnd,
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.getSmsCode("smsLogin", $setup.state.model.mobile))
- }, vue.toDisplayString($setup.getSmsTimer("smsLogin")), 11, ["disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "code",
- label: $setup.t("account.verification_code"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_verification_code"),
- modelValue: $setup.state.model.code,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.code = $event),
- inputBorder: false,
- type: "number",
- maxlength: "4"
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- vue.createElementVNode("view", { style: { "display": "flex", "justify-content": "space-between", "margin-top": "20rpx" } }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.OfficialEnterLogin
- },
- vue.toDisplayString($setup.t("account.continue_login")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const officialAccountFirstLogin = /* @__PURE__ */ _export_sfc(_sfc_main$2Z, [["render", _sfc_render$2Y], ["__scopeId", "data-v-4de4e8c0"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/officialAccountFirstLogin.vue"]]);
- const _sfc_main$2Y = {
- __name: "alipay-account",
- props: {
- agreeStatus: {
- type: Boolean,
- default: false
- }
- },
- emits: ["onConfirm"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const alipayAccountRef = vue.ref(null);
- const emits = __emit;
- const props = __props;
- const state = vue.reactive({
- model: {
- alipayName: "",
- // 名称
- alipayAccount: ""
- // 账号
- },
- rules: {
- alipayAccount: alipayAccount$1
- }
- });
- async function submit() {
- if (!state.model.alipayName || !state.model.alipayAccount) {
- return false;
- }
- const validate = await vue.unref(alipayAccountRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/alipay-account.vue:87", "error: ", error2);
- });
- if (!validate)
- return;
- const {
- code: code2
- } = await UserApi.updateUserAlipayAccount({
- alipayName: state.model.alipayName,
- alipayAccount: state.model.alipayAccount
- });
- if (code2 === 0) {
- uni.showToast({
- icon: "success",
- title: t$6("account.change_password")
- });
- closeAuthModal();
- uni.$emit("alipayAccountChangeComplete");
- }
- }
- onLoad(async (options2) => {
- state.model.alipayName = userInfo2.value.alipayName;
- state.model.alipayAccount = userInfo2.value.alipayAccount;
- });
- const __returned__ = { userInfo: userInfo2, alipayAccountRef, emits, props, state, submit, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get alipayAccount() {
- return alipayAccount$1;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get AuthUtil() {
- return AuthUtil;
- }, get UserApi() {
- return UserApi;
- }, get onLoad() {
- return onLoad;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2X(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 标题栏 "),
- vue.createElementVNode("view", { class: "head-box ss-m-b-60" }, [
- vue.createElementVNode(
- "view",
- { class: "head-title ss-m-b-20" },
- vue.toDisplayString($setup.userInfo.alipayName && $setup.userInfo.alipayAccount ? $setup.t("account.change_alipay_account") : $setup.t("account.bind_alipay_account")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "head-subtitle" },
- vue.toDisplayString($setup.t("account.bind_realname_alipay")),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- ref: "alipayAccountRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "140",
- labelAlign: "center",
- class: "loginUniForm"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- label: $setup.t("account.name"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_name"),
- modelValue: $setup.state.model.alipayName,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.alipayName = $event),
- inputBorder: false
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "alipayAccount",
- label: $setup.t("account.account"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_account"),
- modelValue: $setup.state.model.alipayAccount,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.alipayAccount = $event),
- inputBorder: false
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- vue.createElementVNode("view", { style: { "display": "flex", "justify-content": "space-between", "margin-top": "20rpx" } }, [
- vue.createCommentVNode(` <button class="ss-reset-button forgot-btn" @tap="showAuthModal('resetPassword')">
- 忘记密码
- </button> `),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.submit
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const alipayAccount = /* @__PURE__ */ _export_sfc(_sfc_main$2Y, [["render", _sfc_render$2X], ["__scopeId", "data-v-754d55b7"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/alipay-account.vue"]]);
- const _sfc_main$2X = {
- __name: "bank-account",
- props: {
- agreeStatus: {
- type: Boolean,
- default: false
- }
- },
- emits: ["onConfirm"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const alipayAccountRef = vue.ref(null);
- const emits = __emit;
- const props = __props;
- const state = vue.reactive({
- model: {
- accountName: "",
- // 开户名
- bankName: "",
- // 开户行
- bankAccount: ""
- //银行账号
- },
- rules: {
- bankCode
- }
- });
- async function submit() {
- if (!state.model.accountName || !state.model.bankName || !state.model.bankAccount) {
- return false;
- }
- const validate = await vue.unref(alipayAccountRef).validate().catch((error2) => {
- formatAppLog("log", "at sheep/components/s-auth-modal/components/bank-account.vue:94", "error: ", error2);
- });
- if (!validate)
- return;
- const {
- code: code2
- } = await UserApi.updateUserBankAccount({
- accountName: state.model.accountName,
- bankName: state.model.bankName,
- bankAccount: state.model.bankAccount
- });
- if (code2 === 0) {
- uni.showToast({
- icon: "success",
- title: t$6("account.change_password")
- });
- closeAuthModal();
- uni.$emit("bankAccountChangeComplete");
- }
- }
- onLoad(async (options2) => {
- state.model.accountName = userInfo2.value.accountName;
- state.model.bankName = userInfo2.value.bankName;
- state.model.bankAccount = userInfo2.value.bankAccount;
- });
- const __returned__ = { userInfo: userInfo2, alipayAccountRef, emits, props, state, submit, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get bankCode() {
- return bankCode;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get AuthUtil() {
- return AuthUtil;
- }, get UserApi() {
- return UserApi;
- }, get onLoad() {
- return onLoad;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2W(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 标题栏 "),
- vue.createElementVNode("view", { class: "head-box ss-m-b-60" }, [
- vue.createElementVNode(
- "view",
- { class: "head-title ss-m-b-20" },
- vue.toDisplayString($setup.userInfo.bankName && $setup.userInfo.accountName && $setup.userInfo.bankAccount ? $setup.t("account.change_bank_card") : $setup.t("account.bind_bank_card")),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(' <view class="head-subtitle">请绑定已实名认证的支付宝开户行</view> ')
- ]),
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- ref: "alipayAccountRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "160",
- labelAlign: "left",
- class: "loginUniForm"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- label: $setup.t("account.bank_branch"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.bank_branch_example"),
- modelValue: $setup.state.model.bankName,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.bankName = $event),
- inputBorder: false
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- label: $setup.t("account.account_holder"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.account_holder_name"),
- modelValue: $setup.state.model.accountName,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.accountName = $event),
- inputBorder: false
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- label: $setup.t("account.bank_account_number"),
- name: "bankCode",
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.bank_account_number"),
- modelValue: $setup.state.model.bankAccount,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.bankAccount = $event),
- inputBorder: false
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- vue.createElementVNode("view", { style: { "display": "flex", "justify-content": "space-between", "margin-top": "20rpx" } }, [
- vue.createCommentVNode(` <button class="ss-reset-button forgot-btn" @tap="showAuthModal('resetPassword')">
- 忘记密码
- </button> `),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.submit
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const bankAccount = /* @__PURE__ */ _export_sfc(_sfc_main$2X, [["render", _sfc_render$2W], ["__scopeId", "data-v-e0d6f1a0"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/components/bank-account.vue"]]);
- const _sfc_main$2W = {
- __name: "s-auth-modal",
- setup(__props, { expose: __expose }) {
- __expose();
- const appInfo = vue.computed(() => sheep$1.$store("app").info);
- const linkId = uni.getStorageSync("linkId");
- const modalStore = sheep$1.$store("modal");
- const authType = vue.computed(() => modalStore.auth);
- const isActive = vue.computed(() => modalStore.isActive);
- const state = vue.reactive({
- protocol: false
- });
- const currentProtocol = vue.ref(false);
- function onChange() {
- state.protocol = !state.protocol;
- }
- function onProtocol(title) {
- closeAuthModal();
- sheep$1.$router.go("/pages/public/richtext", {
- title
- });
- }
- function onConfirm(e2) {
- currentProtocol.value = e2;
- setTimeout(() => {
- currentProtocol.value = false;
- }, 1e3);
- }
- const thirdLogin = async (provider2) => {
- if (!state.protocol) {
- currentProtocol.value = true;
- setTimeout(() => {
- currentProtocol.value = false;
- }, 1e3);
- sheep$1.$helper.toast(t$6("account.please_agree"));
- return;
- }
- const loginRes = await sheep$1.$platform.useProvider(provider2).login();
- if (loginRes) {
- closeAuthModal();
- }
- };
- const thirdRegister = async (provider2) => {
- if (!state.protocol) {
- currentProtocol.value = true;
- setTimeout(() => {
- currentProtocol.value = false;
- }, 1e3);
- sheep$1.$helper.toast(t$6("account.please_agree"));
- return;
- }
- const loginRes = await sheep$1.$platform.useProvider(provider2).register();
- if (loginRes) {
- closeAuthModal();
- }
- };
- const getPhoneNumber = async (e2) => {
- if (e2.detail.errMsg !== "getPhoneNumber:ok") {
- sheep$1.$helper.toast(t$6("account.quick_login_failed"));
- return;
- }
- let result2 = await sheep$1.$platform.useProvider().mobileLogin(e2.detail);
- if (result2) {
- closeAuthModal();
- }
- };
- const __returned__ = { appInfo, linkId, modalStore, authType, isActive, state, currentProtocol, onChange, onProtocol, onConfirm, thirdLogin, thirdRegister, getPhoneNumber, computed: vue.computed, reactive: vue.reactive, ref: vue.ref, get sheep() {
- return sheep$1;
- }, accountLogin, smsLogin, register, resetPassword, changeMobile, changePassword, mpAuthorization, get officialAccountFirstLogin() {
- return officialAccountFirstLogin;
- }, alipayAccount, bankAccount, get closeAuthModal() {
- return closeAuthModal;
- }, get showAuthModal() {
- return showAuthModal;
- }, get wx() {
- return wx$1;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2V(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 规格弹窗 "),
- vue.createVNode(_component_su_popup, {
- show: $setup.authType !== "",
- round: "10",
- showClose: true,
- onClose: $setup.closeAuthModal
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "login-wrap" }, [
- vue.createCommentVNode(" 标题栏 "),
- ["smsLogin", "accountLogin", "register"].includes($setup.authType) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "head-box"
- }, [
- vue.createElementVNode("view", { class: "ss-flex ss-m-b-20" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([$setup.isActive == "accountLogin" ? `head-title ss-m-r-40 head-title-animation` : `head-title-active ss-m-r-40`]),
- onClick: _cache[0] || (_cache[0] = ($event) => {
- $setup.isActive = "accountLogin";
- $setup.showAuthModal("accountLogin", "accountLogin");
- })
- },
- vue.toDisplayString($setup.t("account.account_login")),
- 3
- /* TEXT, CLASS */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([$setup.isActive == "smsLogin" ? `head-title head-title-line head-title-animation ss-m-r-40` : ` ss-m-r-40 head-title-active head-title-line`]),
- onClick: _cache[1] || (_cache[1] = ($event) => {
- $setup.isActive = "smsLogin";
- $setup.showAuthModal("smsLogin", "smsLogin");
- })
- },
- vue.toDisplayString($setup.t("account.sms_login")),
- 3
- /* TEXT, CLASS */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([$setup.isActive == "register" ? `head-title head-title-line head-title-animation` : `head-title-active head-title-line`]),
- onClick: _cache[2] || (_cache[2] = ($event) => {
- $setup.isActive = "register";
- $setup.showAuthModal("register", "register");
- })
- },
- [
- vue.createCommentVNode(' v-if="linkId" '),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.t("account.register")),
- 1
- /* TEXT */
- )
- ],
- 2
- /* CLASS */
- )
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 用户协议的勾选 "),
- ["smsLogin", "accountLogin", "register"].includes($setup.authType) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["agreement-box ss-flex ss-row-center", { shake: $setup.currentProtocol }])
- },
- [
- vue.createElementVNode("label", {
- class: "radio ss-flex ss-col-center",
- onClick: $setup.onChange
- }, [
- vue.createElementVNode("radio", {
- checked: $setup.state.protocol,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- onClick: vue.withModifiers($setup.onChange, ["stop"])
- }, null, 8, ["checked"]),
- vue.createElementVNode("view", { class: "agreement-text ss-flex ss-col-center ss-m-l-8" }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.t("account.read_and_agree")) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "tcp-text",
- onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => $setup.onProtocol("用户协议"), ["stop"]))
- },
- vue.toDisplayString($setup.t("account.user_agreement")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "agreement-text" },
- vue.toDisplayString($setup.t("account.and")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "tcp-text",
- onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => $setup.onProtocol("隐私协议"), ["stop"]))
- },
- vue.toDisplayString($setup.t("account.privacy_policy")),
- 1
- /* TEXT */
- )
- ])
- ])
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 微信公众号授权登陆 在验证码登录 账号登录中显示"),
- ["accountLogin", "smsLogin"].includes($setup.authType) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "auto-login-box ss-flex ss-flex-col ss-row-center ss-col-center"
- }, [
- ["WechatOfficialAccount", "WechatMiniProgram", "App"].includes($setup.sheep.$platform.name) && $setup.sheep.$platform.isWechatInstalled ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "wx-login-btn",
- onClick: _cache[5] || (_cache[5] = ($event) => $setup.thirdLogin("wechat"))
- }, [
- vue.createElementVNode("image", {
- class: "auto-login-img",
- src: $setup.sheep.$url.static("/static/images/wechat.png")
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.t("account.wechat_authorization_login")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 微信公众号授权登陆 在账号注册中显示 "),
- ["register"].includes($setup.authType) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 3,
- class: "auto-login-box ss-flex ss-flex-col ss-row-center ss-col-center"
- }, [
- ["WechatOfficialAccount", "WechatMiniProgram", "App"].includes($setup.sheep.$platform.name) && $setup.sheep.$platform.isWechatInstalled ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "wx-login-btn",
- onClick: _cache[6] || (_cache[6] = ($event) => $setup.thirdRegister("wechat"))
- }, [
- vue.createElementVNode("image", {
- class: "auto-login-img",
- src: $setup.sheep.$url.static("/static/images/wechat.png")
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.t("account.wechat_authorization_register")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 1. 微信公众号授权登录 第一次登陆时弹窗绑定手机号 accountLogin "),
- $setup.authType === "officialAccountFirstLogin" ? (vue.openBlock(), vue.createBlock($setup["officialAccountFirstLogin"], {
- key: 4,
- agreeStatus: $setup.state.protocol,
- onOnConfirm: $setup.onConfirm
- }, null, 8, ["agreeStatus"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 1. 账号密码登录 accountLogin "),
- $setup.authType === "accountLogin" ? (vue.openBlock(), vue.createBlock($setup["accountLogin"], {
- key: 5,
- agreeStatus: $setup.state.protocol,
- onOnConfirm: $setup.onConfirm
- }, null, 8, ["agreeStatus"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 2. 短信登录 smsLogin "),
- $setup.authType === "smsLogin" ? (vue.openBlock(), vue.createBlock($setup["smsLogin"], {
- key: 6,
- agreeStatus: $setup.state.protocol,
- onOnConfirm: $setup.onConfirm
- }, null, 8, ["agreeStatus"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 注册 "),
- $setup.authType === "register" ? (vue.openBlock(), vue.createBlock($setup["register"], {
- key: 7,
- agreeStatus: $setup.state.protocol,
- onOnConfirm: $setup.onConfirm
- }, null, 8, ["agreeStatus"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 3. 忘记密码 resetPassword"),
- vue.createCommentVNode(` <reset-password v-if="authType === 'resetPassword'" /> `),
- vue.createCommentVNode(" 4. 绑定手机号 changeMobile "),
- $setup.authType === "changeMobile" ? (vue.openBlock(), vue.createBlock($setup["changeMobile"], { key: 8 })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 5. 修改密码 changePassword"),
- $setup.authType === "changePassword" ? (vue.openBlock(), vue.createBlock($setup["changePassword"], { key: 9 })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 6. 微信小程序授权 "),
- $setup.authType === "mpAuthorization" ? (vue.openBlock(), vue.createBlock($setup["mpAuthorization"], { key: 10 })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 绑定支付宝账号 "),
- $setup.authType === "alipayAccount" ? (vue.openBlock(), vue.createBlock($setup["alipayAccount"], { key: 11 })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 绑定银行卡号 "),
- $setup.authType === "bankAccount" ? (vue.openBlock(), vue.createBlock($setup["bankAccount"], { key: 12 })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 7. 第三方登录 "),
- vue.createCommentVNode(` <view v-if="['accountLogin', 'smsLogin'].includes(authType)" class="auto-login-box ss-flex ss-flex-col ss-row-center ss-col-center"> `),
- vue.createCommentVNode(" 7.1 微信小程序的快捷登录 "),
- vue.createCommentVNode(` <view v-if="sheep.$platform.name === 'WechatMiniProgram'" class="ss-flex register-box">\r
- <view class="register-title">还没有账号?</view>\r
- <button class="ss-reset-button login-btn" open-type="getPhoneNumber"\r
- @getphonenumber="getPhoneNumber">\r
- 快捷登录\r
- </button>\r
- <view class="circle" />\r
- </view> `),
- vue.createCommentVNode(" 7.2 微信的公众号、App、小程序的登录,基于 openid + code "),
- vue.createCommentVNode(` <button\r
- v-if="\r
- ['WechatOfficialAccount', 'WechatMiniProgram', 'App'].includes(sheep.$platform.name) &&\r
- sheep.$platform.isWechatInstalled\r
- "\r
- @tap="thirdLogin('wechat')"\r
- class="ss-reset-button auto-login-btn"\r
- >\r
- <image\r
- class="auto-login-img"\r
- :src="sheep.$url.static('/static/images/wechat.png')"\r
- />\r
- </button> `),
- vue.createCommentVNode(" 7.3 iOS 登录 TODO 非繁人:等后面搞 App 再弄 "),
- vue.createCommentVNode(` <button v-if="sheep.$platform.os === 'ios' && sheep.$platform.name === 'App'" @tap="thirdLogin('apple')"\r
- class="ss-reset-button auto-login-btn">\r
- <image class="auto-login-img" :src="sheep.$url.static('/static/images/apple.png')" />\r
- </button> `),
- vue.createCommentVNode(" </view> "),
- vue.createElementVNode("view", { class: "safe-box" })
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show", "onClose"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const __easycom_7$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2W, [["render", _sfc_render$2V], ["__scopeId", "data-v-21181321"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-auth-modal/s-auth-modal.vue"]]);
- async function getImagePath$1(imagePath) {
- return new Promise((resolve, reject) => {
- const fullPath = window.location.origin + imagePath;
- resolve(fullPath);
- });
- }
- const user = async (poster) => {
- const width = poster.width;
- const userInfo2 = sheep$1.$store("user").userInfo;
- return {
- background: await getImagePath$1("/static/user-poster-bg.jpg"),
- // background: window.location.origin + '/static/user-poster-bg.jpg',
- list: [
- {
- name: "nickname",
- type: "text",
- val: userInfo2.nickname,
- x: width / 2,
- y: width * 0.4,
- paintbrushProps: {
- textAlign: "center",
- fillStyle: "#333",
- font: {
- fontSize: 14,
- fontFamily: "sans-serif"
- }
- }
- },
- {
- name: "avatar",
- type: "image",
- val: poster.avatar,
- x: width * 0.4,
- y: width * 0.16,
- width: width * 0.2,
- height: width * 0.2,
- d: width * 0.2
- },
- {
- name: "qrcode",
- type: "qrcode",
- val: poster.shareInfo.link,
- x: width * 0.35,
- y: width * 0.74,
- size: width * 0.3
- }
- ]
- };
- };
- async function getImagePath(imagePath) {
- return new Promise((resolve, reject) => {
- const fullPath = window.location.origin + imagePath;
- resolve(fullPath);
- });
- }
- const goods = async (poster) => {
- const width = poster.width;
- const userInfo2 = sheep$1.$store("user").userInfo;
- return {
- background: await getImagePath("/static/goods-poster-bg.jpg"),
- list: [
- {
- name: "nickname",
- type: "text",
- val: userInfo2.nickname,
- x: width * 0.21,
- y: width * 0.06,
- paintbrushProps: {
- fillStyle: "#333",
- font: {
- fontSize: 16,
- fontFamily: "sans-serif"
- }
- }
- },
- {
- name: "avatar",
- type: "image",
- val: poster.avatar,
- x: width * 0.04,
- y: width * 0.04,
- width: width * 0.14,
- height: width * 0.14,
- d: width * 0.14
- },
- {
- name: "goodsBg",
- type: "rect",
- x: width * 0.03,
- y: width * 0.3,
- width: width * 0.94,
- height: width * 0.75,
- r: 5
- },
- {
- name: "goodsImage",
- type: "image",
- val: poster.shareInfo.poster.image,
- x: width * 0.03,
- y: width * 0.3,
- width: width * 0.94,
- height: width * 0.5,
- r: 5
- },
- {
- name: "goodsTitle",
- type: "text",
- val: poster.shareInfo.poster.title,
- x: width * 0.05,
- y: width * 0.83,
- maxWidth: width * 0.91,
- line: 5,
- lineHeight: 10,
- paintbrushProps: {
- fillStyle: "#333",
- font: {
- fontSize: 16
- }
- }
- },
- {
- name: "goodsIntroduction",
- type: "text",
- val: poster.shareInfo.poster.introduction,
- x: width * 0.05,
- y: width * 0.89,
- maxWidth: width * 0.9,
- height: width * 0.1,
- line: 3,
- lineHeight: 4,
- paintbrushProps: {
- fillStyle: "#333",
- font: {
- fontSize: 12,
- fontFamily: "OPPOSANS"
- }
- }
- },
- {
- name: "goodsOriginalPrice",
- type: "text",
- val: poster.shareInfo.poster.original_price > 0 ? "¥" + poster.shareInfo.poster.original_price : "",
- x: width * 0.3,
- y: width * 1.32,
- paintbrushProps: {
- fillStyle: "#999",
- font: {
- fontSize: 10,
- fontFamily: "OPPOSANS"
- }
- },
- textDecoration: {
- line: "line-through",
- style: "solide"
- }
- },
- {
- name: "qrcode",
- type: "qrcode",
- val: poster.shareInfo.link,
- x: width * 0.75,
- y: width * 1.07,
- size: width * 0.2
- }
- ]
- };
- };
- const groupon = (poster) => {
- const width = poster.width;
- const userInfo2 = sheep$1.$store("user").userInfo;
- return {
- background: formatImageUrlProtocol(sheep$1.$url.cdn(sheep$1.$store("app").platform.share.posterInfo.groupon_bg)),
- list: [
- {
- name: "nickname",
- type: "text",
- val: userInfo2.nickname,
- x: width * 0.22,
- y: width * 0.06,
- paintbrushProps: {
- fillStyle: "#333",
- font: {
- fontSize: 16,
- fontFamily: "sans-serif"
- }
- }
- },
- {
- name: "avatar",
- type: "image",
- val: formatImageUrlProtocol(sheep$1.$url.cdn(userInfo2.avatar)),
- x: width * 0.04,
- y: width * 0.04,
- width: width * 0.14,
- height: width * 0.14,
- d: width * 0.14
- },
- {
- name: "goodsImage",
- type: "image",
- val: formatImageUrlProtocol(poster.shareInfo.poster.image),
- x: width * 0.03,
- y: width * 0.21,
- width: width * 0.94,
- height: width * 0.94,
- r: 10
- },
- {
- name: "goodsTitle",
- type: "text",
- val: poster.shareInfo.poster.title,
- x: width * 0.04,
- y: width * 1.18,
- maxWidth: width * 0.91,
- line: 2,
- lineHeight: 5,
- paintbrushProps: {
- fillStyle: "#333",
- font: {
- fontSize: 14
- }
- }
- },
- {
- name: "goodsPrice",
- type: "text",
- val: "¥" + poster.shareInfo.poster.price,
- x: width * 0.04,
- y: width * 1.3,
- paintbrushProps: {
- fillStyle: "#ff0000",
- font: {
- fontSize: 20,
- fontFamily: "OPPOSANS"
- }
- }
- },
- {
- name: "grouponNum",
- type: "text",
- val: "2人团",
- x: width * 0.3,
- y: width * 1.32,
- paintbrushProps: {
- fillStyle: "#ff0000",
- font: {
- fontSize: 10,
- fontFamily: "OPPOSANS"
- }
- }
- },
- {
- name: "qrcode",
- type: "qrcode",
- val: poster.shareInfo.link,
- x: width * 0.75,
- y: width * 1.3,
- size: width * 0.2
- }
- ]
- };
- };
- let locaImage = vue.ref("");
- async function getFileURL(file) {
- await FileApi.getFileIO(file).then((res) => {
- locaImage.value = window.URL.createObjectURL(res);
- });
- }
- async function getPosterData(options2) {
- const userInfo2 = sheep$1.$store("user").userInfo;
- let avatar = userInfo2.avatar;
- switch (options2.shareInfo.poster.type) {
- case "user":
- await getFileURL(avatar);
- options2.avatar = locaImage.value;
- return user(options2);
- case "goods":
- await getFileURL(avatar);
- options2.avatar = locaImage.value;
- await getFileURL(options2.shareInfo.poster.image);
- options2.shareInfo.poster.image = locaImage.value;
- return goods(options2);
- case "groupon":
- return groupon(options2);
- }
- }
- function formatImageUrlProtocol(url2) {
- return url2;
- }
- async function useCanvas(options2, vm) {
- const width = options2.width;
- const qsc = new QSCanvas(
- {
- canvasId: options2.canvasId,
- width: options2.width,
- height: options2.height,
- setCanvasWH: (canvas) => {
- options2.height = canvas.height;
- }
- },
- vm
- );
- let drawer = await getPosterData(options2);
- const background = await qsc.drawImg({
- type: "image",
- val: drawer.background,
- x: 0,
- y: 0,
- width,
- mode: "widthFix",
- zIndex: 0
- });
- await qsc.updateCanvasWH({
- width: background.width,
- height: background.bottom
- });
- let list = drawer.list;
- for (let i2 = 0; i2 < list.length; i2++) {
- let item = list[i2];
- if (item.type === "text") {
- formatAppLog("log", "at sheep/components/s-share-modal/canvas-poster/useCanvas.js:51", item);
- await qsc.drawText(item);
- }
- if (item.type === "image") {
- if (item.d) {
- qsc.setCircle({
- x: item.x,
- y: item.y,
- d: item.d,
- clip: true
- });
- }
- if (item.r) {
- qsc.setRect({
- x: item.x,
- y: item.y,
- height: item.height,
- width: item.width,
- r: item.r,
- clip: true
- });
- }
- try {
- await qsc.drawImg(item);
- } catch (error2) {
- formatAppLog("log", "at sheep/components/s-share-modal/canvas-poster/useCanvas.js:78", error2);
- }
- qsc.restore();
- }
- if (item.type === "rect") {
- if (item.r) {
- qsc.setRect({
- x: item.x,
- y: item.y,
- height: item.height,
- width: item.width,
- r: item.r,
- clip: true
- });
- }
- try {
- await qsc.draw(item);
- } catch (error2) {
- formatAppLog("log", "at sheep/components/s-share-modal/canvas-poster/useCanvas.js:97", error2);
- }
- qsc.restore();
- }
- if (item.type === "qrcode") {
- formatAppLog("log", "at sheep/components/s-share-modal/canvas-poster/useCanvas.js:104", item);
- await qsc.drawQrCode(item);
- }
- }
- await qsc.draw();
- setTimeout(async () => {
- options2.src = await qsc.toImage();
- }, 100);
- return options2;
- }
- const _sfc_main$2V = {
- __name: "index",
- props: {
- show: {
- type: Boolean,
- default: false
- },
- shareInfo: {
- type: Object,
- default() {
- }
- }
- },
- emits: ["success", "close"],
- setup(__props, { expose: __expose, emit: __emit }) {
- const props = __props;
- const poster = vue.reactive({
- canvasId: "canvasId",
- width: sheep$1.$platform.device.windowWidth * 0.9,
- height: 600,
- src: "",
- imgData: ""
- });
- const emits = __emit;
- const vm = vue.getCurrentInstance();
- const onClosePoster2 = () => {
- emits("close");
- };
- const onSavePoster = () => {
- if (["WechatOfficialAccount", "H5"].includes(sheep$1.$platform.name)) {
- sheep$1.$helper.toast(t$6("share.long_press_to_save"));
- return;
- }
- uni.saveImageToPhotosAlbum({
- filePath: poster.src,
- success: (res) => {
- onClosePoster2();
- sheep$1.$helper.toast(t$6("share.save_success"));
- },
- fail: (err) => {
- sheep$1.$helper.toast(t$6("share.save_failure"));
- formatAppLog("log", "at sheep/components/s-share-modal/canvas-poster/index.vue:85", "图片保存失败:", err);
- }
- });
- };
- const imageUrl = vue.ref("");
- async function getPoster(params) {
- poster.src = "";
- poster.shareInfo = props.shareInfo;
- poster.canvasId = "canvasId-" + (/* @__PURE__ */ new Date()).getTime();
- const canvas = await useCanvas(poster, vm);
- return canvas;
- }
- __expose({
- getPoster
- });
- const __returned__ = { props, poster, emits, vm, onClosePoster: onClosePoster2, onSavePoster, imageUrl, getPoster, reactive: vue.reactive, getCurrentInstance: vue.getCurrentInstance, ref: vue.ref, get sheep() {
- return sheep$1;
- }, get useCanvas() {
- return useCanvas;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2U(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createBlock(_component_su_popup, {
- show: $props.show,
- round: "10",
- onClose: $setup.onClosePoster,
- type: "center",
- class: "popup-box"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex-col ss-col-center ss-row-center" }, [
- vue.createCommentVNode(' <image class="poster-img" :src="imageUrl"/> '),
- $setup.poster.src === "" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "poster-title ss-flex ss-row-center",
- style: vue.normalizeStyle({
- height: $setup.poster.height + "px",
- width: $setup.poster.width + "px"
- })
- },
- vue.toDisplayString($setup.t("share.poster_loading")),
- 5
- /* TEXT, STYLE */
- )) : (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- class: "poster-img",
- src: $setup.poster.src,
- style: vue.normalizeStyle({
- height: $setup.poster.height + "px",
- width: $setup.poster.width + "px"
- }),
- "show-menu-by-longpress": true
- }, null, 12, ["src"])),
- vue.createElementVNode("canvas", {
- class: "hideCanvas",
- "canvas-id": $setup.poster.canvasId,
- id: $setup.poster.canvasId,
- style: vue.normalizeStyle({
- height: $setup.poster.height + "px",
- width: $setup.poster.width + "px"
- })
- }, null, 12, ["canvas-id", "id"]),
- $setup.poster.src !== "" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "poster-btn-box ss-m-t-20 ss-flex ss-row-between ss-col-center"
- }, [
- vue.createElementVNode(
- "button",
- {
- class: "cancel-btn ss-reset-button",
- onClick: $setup.onClosePoster
- },
- vue.toDisplayString($setup.t("common.cancel")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("button", {
- class: "save-btn ss-reset-button ui-BG-Main",
- onClick: $setup.onSavePoster
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.t("share.long_press_to_save")) + " ",
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(" {{\r\n ['wechatOfficialAccount', 'H5'].includes(sheep.$platform.name)\r\n ? '保存图片'\r\n : '长按图片保存'\r\n }} ")
- ])
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]);
- }
- const canvasPoster = /* @__PURE__ */ _export_sfc(_sfc_main$2V, [["render", _sfc_render$2U], ["__scopeId", "data-v-199e8f1d"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-share-modal/canvas-poster/index.vue"]]);
- const _sfc_main$2U = {
- __name: "s-share-modal",
- props: {
- shareInfo: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const show = vue.computed(() => sheep$1.$store("modal").share);
- const shareConfig = vue.computed(() => sheep$1.$store("app").platform.share);
- const SharePosterRef = vue.ref("");
- const props = __props;
- const state = vue.reactive({
- showShareGuide: false,
- // H5 的指引
- showPosterModal: false
- // 海报弹窗
- });
- let ShareInfo = vue.computed(() => {
- return {
- ...props.shareInfo
- };
- });
- const onShareByPoster = () => {
- const shareId = vue.computed(() => sheep$1.$store("modal").shareInfo.spuId);
- closeShareModal();
- if (!sheep$1.$store("user").isLogin) {
- showAuthModal();
- return;
- }
- if (shareId.value) {
- ShareApi.getLinkId(3, shareId.value).then((res) => {
- if (res.code !== 0) {
- return;
- }
- ShareInfo.value.link = ShareInfo.value.link.replace("0", res.data.linkId);
- ShareInfo.value.query = ShareInfo.value.query.replace("0", res.data.linkId);
- });
- }
- vue.unref(SharePosterRef).getPoster();
- state.showPosterModal = true;
- };
- const onShareByForward = () => {
- closeShareModal();
- uni.share({
- provider: "weixin",
- scene: "WXSceneSession",
- type: 0,
- href: props.shareInfo.link,
- title: props.shareInfo.title,
- summary: props.shareInfo.desc,
- imageUrl: props.shareInfo.image,
- success: (res) => {
- formatAppLog("log", "at sheep/components/s-share-modal/s-share-modal.vue:127", "success:" + JSON.stringify(res));
- },
- fail: (err) => {
- formatAppLog("log", "at sheep/components/s-share-modal/s-share-modal.vue:130", "fail:" + JSON.stringify(err));
- }
- });
- };
- const onShareByCopyLink = () => {
- closeShareModal();
- if (!sheep$1.$store("user").isLogin) {
- showAuthModal();
- return;
- }
- sheep$1.$helper.copyText(props.shareInfo.link);
- };
- function onCloseGuide() {
- state.showShareGuide = false;
- }
- const __returned__ = { show, shareConfig, SharePosterRef, props, state, get ShareInfo() {
- return ShareInfo;
- }, set ShareInfo(v2) {
- ShareInfo = v2;
- }, onShareByPoster, onShareByForward, onShareByCopyLink, onCloseGuide, ref: vue.ref, unref: vue.unref, reactive: vue.reactive, computed: vue.computed, get onLoad() {
- return onLoad;
- }, get sheep() {
- return sheep$1;
- }, canvasPoster, get closeShareModal() {
- return closeShareModal;
- }, get showAuthModal() {
- return showAuthModal;
- }, get ShareApi() {
- return ShareApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2T(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createVNode(_component_su_popup, {
- show: $setup.state.showShareGuide,
- showClose: false,
- onClose: $setup.onCloseGuide
- }, null, 8, ["show"]),
- $setup.state.showShareGuide ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "guide-wrap"
- }, [
- vue.createElementVNode("image", {
- class: "guide-image",
- src: $setup.sheep.$url.static("/static/images/share_guide.png")
- }, null, 8, ["src"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_su_popup, {
- show: $setup.show,
- round: "10",
- showClose: false,
- onClose: $setup.closeShareModal
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 分享 tools "),
- vue.createElementVNode("view", { class: "share-box" }, [
- vue.createElementVNode("view", { class: "share-list-box ss-flex" }, [
- vue.createCommentVNode(" 操作 ①:发送给微信好友 "),
- $setup.shareConfig.methods.includes("forward") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "share-item share-btn ss-flex-col ss-col-center",
- "open-type": "share",
- onClick: $setup.onShareByForward
- }, [
- vue.createElementVNode("image", {
- class: "share-img",
- src: $setup.sheep.$url.static("/static/images/share_wx.png"),
- mode: ""
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "text",
- { class: "share-title" },
- vue.toDisplayString($setup.t("pop.wechat_friend")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 操作 ②:生成海报图片 "),
- $setup.shareConfig.methods.includes("poster") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "share-item share-btn ss-flex-col ss-col-center",
- onClick: $setup.onShareByPoster
- }, [
- vue.createElementVNode("image", {
- class: "share-img",
- src: $setup.sheep.$url.static("/static/images/share_poster.png"),
- mode: ""
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "text",
- { class: "share-title" },
- vue.toDisplayString($setup.t("pop.create_poster")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 操作 ③:生成链接 "),
- vue.createCommentVNode(` <button v-if="shareConfig.methods.includes('link')"\r
- class="share-item share-btn ss-flex-col ss-col-center" @tap="onShareByCopyLink">\r
- <image class="share-img" :src="sheep.$url.static('/static/images/share_link.png')"\r
- mode="" />\r
- <text class="share-title">{{ t('pop.copy_link') }}</text>\r
- </button> `)
- ]),
- vue.createElementVNode(
- "view",
- {
- class: "share-foot ss-flex ss-row-center ss-col-center",
- onClick: _cache[0] || (_cache[0] = (...args) => $setup.closeShareModal && $setup.closeShareModal(...args))
- },
- vue.toDisplayString($setup.t("common.cancel")),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show", "onClose"]),
- vue.createCommentVNode(" 分享海报,对应操作 ② "),
- vue.createVNode($setup["canvasPoster"], {
- ref: "SharePosterRef",
- show: $setup.state.showPosterModal,
- shareInfo: $setup.ShareInfo,
- onClose: _cache[1] || (_cache[1] = ($event) => $setup.state.showPosterModal = false)
- }, null, 8, ["show", "shareInfo"])
- ]);
- }
- const __easycom_8 = /* @__PURE__ */ _export_sfc(_sfc_main$2U, [["render", _sfc_render$2T], ["__scopeId", "data-v-a2a58660"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-share-modal/s-share-modal.vue"]]);
- const _sfc_main$2T = {
- __name: "s-menu-tools",
- setup(__props, { expose: __expose }) {
- __expose();
- const show = vue.computed(() => sheep$1.$store("modal").menu);
- const {
- t: t2
- } = useI18n();
- function onClick(item) {
- closeMenuTools();
- if (item.url)
- sheep$1.$router.go(item.url);
- }
- const list = [
- {
- url: "/pages/index/index",
- icon: "/static/images/home.png",
- title: t2("common.home")
- },
- {
- url: "/pages/index/search",
- icon: "/static/images/search.png",
- title: t2("common.search")
- },
- {
- url: "/pages/index/user",
- icon: "/static/images/user.png",
- title: t2("menu.personal_center")
- },
- {
- url: "/pages/index/cart",
- icon: "/static/images/cart.png",
- title: t2("menu.shopping_cart")
- },
- {
- url: "/pages/user/goods-log",
- icon: "/static/images/browse.png",
- title: t2("menu.browsing_history")
- },
- {
- url: "/pages/user/goods-collect",
- icon: "/static/images/collect.png",
- title: t2("menu.my_favorites")
- }
- // {
- // url: '/pages/chat/index',
- // icon: '/static/images/service.png',
- // title: t('menu.customer_service'),
- // },
- ];
- const __returned__ = { show, t: t2, onClick, list, reactive: vue.reactive, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get showMenuTools() {
- return showMenuTools;
- }, get closeMenuTools() {
- return closeMenuTools;
- }, get useI18n() {
- return useI18n;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2S(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_status_bar = resolveEasycom(vue.resolveDynamicComponent("su-status-bar"), __easycom_0$q);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createBlock(_component_su_popup, {
- show: $setup.show,
- type: "top",
- round: "20",
- backgroundColor: "#F0F0F0",
- onClose: $setup.closeMenuTools
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_status_bar),
- vue.createElementVNode("view", { class: "tools-wrap ss-m-x-30 ss-m-b-16" }, [
- vue.createElementVNode(
- "view",
- { class: "title ss-m-b-34 ss-p-t-20" },
- vue.toDisplayString(_ctx.$t("menu.quick_menu")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "container-list ss-flex ss-flex-wrap" }, [
- (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.list, (item) => {
- return vue.createElementVNode("view", {
- class: "list-item ss-m-b-24",
- key: item.title
- }, [
- vue.createElementVNode("view", { class: "ss-flex-col ss-col-center" }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button list-image ss-flex ss-row-center ss-col-center",
- onClick: ($event) => $setup.onClick(item)
- }, [
- $setup.show ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: $setup.sheep.$url.static(item.icon),
- class: "list-icon"
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true)
- ], 8, ["onClick"]),
- vue.createElementVNode(
- "view",
- { class: "list-title ss-m-t-20" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- )
- ])
- ]);
- }),
- 64
- /* STABLE_FRAGMENT */
- ))
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show", "onClose"]);
- }
- const __easycom_9$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2T, [["render", _sfc_render$2S], ["__scopeId", "data-v-bbb37e35"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-menu-tools/s-menu-tools.vue"]]);
- const _sfc_main$2S = {
- __name: "s-layout",
- props: {
- title: {
- type: String,
- default: ""
- },
- navbar: {
- type: String,
- default: "normal"
- },
- opacityBgUi: {
- type: String,
- default: "bg-white"
- },
- color: {
- type: String,
- default: ""
- },
- tools: {
- type: String,
- default: "title"
- },
- keyword: {
- type: String,
- default: ""
- },
- navbarStyle: {
- type: Object,
- default: () => ({
- mode: "",
- type: "",
- color: "",
- src: "",
- list: [],
- alwaysShow: 0
- })
- },
- bgStyle: {
- type: Object,
- default: () => ({
- src: "",
- color: "var(--ui-BG-1)"
- })
- },
- tabbar: {
- type: [String, Boolean],
- default: ""
- },
- onShareAppMessage: {
- type: [Boolean, Object],
- default: true
- },
- leftWidth: {
- type: [Number, String],
- default: 100
- },
- rightWidth: {
- type: [Number, String],
- default: 100
- },
- defaultSearch: {
- type: String,
- default: ""
- },
- //展示返回按钮
- showLeftButton: {
- type: Boolean,
- default: false
- }
- },
- emits: ["search"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props = __props;
- const emits = __emit;
- const sysStore = sheep$1.$store("sys");
- const userStore = sheep$1.$store("user");
- const appStore = sheep$1.$store("app");
- const modalStore = sheep$1.$store("modal");
- const sys2 = vue.computed(() => sysStore);
- const navbarMode = vue.computed(() => {
- if (props.navbar === "normal" || props.navbarStyle.mode === "normal") {
- return "normal";
- }
- return "inner";
- });
- const bgMain = vue.computed(() => {
- if (navbarMode.value === "inner") {
- return {
- background: `${props.bgStyle.backgroundColor} url(${sheep$1.$url.cdn(
- props.bgStyle.backgroundImage
- )}) no-repeat top center / 100% auto`
- };
- }
- return {};
- });
- const bgBody = vue.computed(() => {
- if (navbarMode.value === "normal") {
- return {
- background: `${props.bgStyle.backgroundColor} url(${sheep$1.$url.cdn(
- props.bgStyle.backgroundImage
- )}) no-repeat top center / 100% auto`
- };
- }
- return {};
- });
- const shareInfo = vue.computed(() => {
- if (props.onShareAppMessage === true) {
- return sheep$1.$platform.share.getShareInfo();
- } else {
- if (!lodashExports.isEmpty(props.onShareAppMessage)) {
- sheep$1.$platform.share.updateShareInfo(props.onShareAppMessage);
- return props.onShareAppMessage;
- }
- }
- return {};
- });
- onShow(() => {
- if (!lodashExports.isEmpty(shareInfo.value)) {
- sheep$1.$platform.share.updateShareInfo(shareInfo.value);
- }
- });
- const __returned__ = { props, emits, sysStore, userStore, appStore, modalStore, sys: sys2, navbarMode, bgMain, bgBody, shareInfo, computed: vue.computed, reactive: vue.reactive, ref: vue.ref, get sheep() {
- return sheep$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, get onShow() {
- return onShow;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2R(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_navbar = resolveEasycom(vue.resolveDynamicComponent("su-navbar"), __easycom_0$o);
- const _component_s_custom_navbar = resolveEasycom(vue.resolveDynamicComponent("s-custom-navbar"), __easycom_1$a);
- const _component_su_inner_navbar = resolveEasycom(vue.resolveDynamicComponent("su-inner-navbar"), __easycom_2$8);
- const _component_s_tabbar = resolveEasycom(vue.resolveDynamicComponent("s-tabbar"), __easycom_3$7);
- const _component_s_wallet_modal = resolveEasycom(vue.resolveDynamicComponent("s-wallet-modal"), __easycom_4$2);
- const _component_s_signup_modal = resolveEasycom(vue.resolveDynamicComponent("s-signup-modal"), __easycom_5$2);
- const _component_s_follow_modal = resolveEasycom(vue.resolveDynamicComponent("s-follow-modal"), __easycom_6$1);
- const _component_s_auth_modal = resolveEasycom(vue.resolveDynamicComponent("s-auth-modal"), __easycom_7$1);
- const _component_s_share_modal = resolveEasycom(vue.resolveDynamicComponent("s-share-modal"), __easycom_8);
- const _component_s_menu_tools = resolveEasycom(vue.resolveDynamicComponent("s-menu-tools"), __easycom_9$1);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["page-app", ["theme-" + $setup.sys.mode, "main-" + $setup.sys.theme, "font-" + $setup.sys.fontSize]])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "page-main",
- style: vue.normalizeStyle([$setup.bgMain])
- },
- [
- vue.createCommentVNode(" 默认通用顶部导航栏 "),
- $props.navbar === "normal" ? (vue.openBlock(), vue.createBlock(_component_su_navbar, {
- key: 0,
- title: $props.title,
- statusBar: "",
- color: $props.color,
- tools: $props.tools,
- opacityBgUi: $props.opacityBgUi,
- onSearch: _cache[0] || (_cache[0] = (e2) => $setup.emits("search", e2)),
- defaultSearch: $props.defaultSearch
- }, null, 8, ["title", "color", "tools", "opacityBgUi", "defaultSearch"])) : $props.navbar === "custom" && $setup.navbarMode === "normal" ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 装修组件导航栏-普通 "),
- vue.createVNode(_component_s_custom_navbar, {
- data: $props.navbarStyle,
- showLeftButton: $props.showLeftButton
- }, null, 8, ["data", "showLeftButton"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "page-body",
- style: vue.normalizeStyle([$setup.bgBody])
- },
- [
- vue.createCommentVNode(" 沉浸式头部 "),
- $props.navbar === "inner" ? (vue.openBlock(), vue.createBlock(_component_su_inner_navbar, {
- key: 0,
- title: $props.title
- }, null, 8, ["title"])) : vue.createCommentVNode("v-if", true),
- $props.navbar === "inner" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- style: vue.normalizeStyle([{ paddingTop: $setup.sheep.$platform.navbar + "px" }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 装修组件导航栏-沉浸式 "),
- vue.createCommentVNode(` <s-custom-navbar v-if="navbar === 'custom' && navbarMode === 'inner'" :data="navbarStyle" :showLeftButton="showLeftButton" /> `),
- vue.createCommentVNode(" 页面内容插槽 "),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- vue.createCommentVNode(" 底部导航 "),
- $props.tabbar !== "" ? (vue.openBlock(), vue.createBlock(_component_s_tabbar, {
- key: 2,
- path: $props.tabbar
- }, null, 8, ["path"])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "page-modal" }, [
- vue.createCommentVNode(" 全局获得佣金提示弹窗 "),
- vue.createVNode(_component_s_wallet_modal),
- vue.createCommentVNode(" 全局自动签到弹窗 "),
- vue.createVNode(_component_s_signup_modal),
- vue.createCommentVNode(" 全局关注公众号弹窗 "),
- vue.createVNode(_component_s_follow_modal),
- vue.createCommentVNode(" 全局授权弹窗 "),
- vue.createVNode(_component_s_auth_modal),
- vue.createCommentVNode(" 全局分享弹窗 "),
- vue.createVNode(_component_s_share_modal, { shareInfo: $setup.shareInfo }, null, 8, ["shareInfo"]),
- vue.createCommentVNode(" 全局快捷入口 "),
- vue.createVNode(_component_s_menu_tools)
- ])
- ],
- 2
- /* CLASS */
- );
- }
- const __easycom_1$8 = /* @__PURE__ */ _export_sfc(_sfc_main$2S, [["render", _sfc_render$2R], ["__scopeId", "data-v-32d0115a"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-layout/s-layout.vue"]]);
- const _sfc_main$2R = {
- __name: "richtext",
- props: {
- title: {
- defautls: "",
- type: String
- },
- type: {
- defautls: "",
- type: String
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- title: "",
- content: ""
- });
- async function getRichTextContent(id, title) {
- formatAppLog("log", "at pages/public/richtext.vue:24", id, title);
- const { code: code2, data } = await ArticleApi.getArticle(id, title);
- if (code2 !== 0) {
- return;
- }
- state.content = data.content;
- if (state.title !== data.title) {
- state.title = data.title;
- uni.setNavigationBarTitle({
- title: state.title
- });
- }
- }
- const props = __props;
- onLoad((options2) => {
- if (options2.title || props.title) {
- state.title = options2.title || props.title;
- uni.setNavigationBarTitle({
- title: state.title || props.title
- });
- }
- getRichTextContent(options2.id, options2.title || props.title);
- });
- const __returned__ = { state, getRichTextContent, props, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, get ArticleApi() {
- return ArticleApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2Q(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_mp_html = resolveEasycom(vue.resolveDynamicComponent("mp-html"), __easycom_0$r);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return $setup.state.title && !$props.type ? (vue.openBlock(), vue.createBlock(_component_s_layout, {
- key: 0,
- class: "set-wrap",
- title: $setup.state.title,
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-p-30" }, [
- vue.createVNode(_component_mp_html, {
- class: "richtext",
- content: $setup.state.content
- }, null, 8, ["content"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"])) : (vue.openBlock(), vue.createBlock(_component_mp_html, {
- key: 1,
- class: "richtext",
- content: $setup.state.content
- }, null, 8, ["content"]));
- }
- const PagesPublicRichtext = /* @__PURE__ */ _export_sfc(_sfc_main$2R, [["render", _sfc_render$2Q], ["__scopeId", "data-v-bc551482"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/public/richtext.vue"]]);
- const _imports_0$8 = "/static/firstIndex/clcg.png";
- const _imports_1$4 = "/static/firstIndex/pt.svg";
- const _imports_2$2 = "/static/firstIndex/product.svg";
- const _imports_3$1 = "/static/firstIndex/news.svg";
- const _imports_4 = "/static/firstIndex/shop.svg";
- const _imports_0$7 = "/static/firstIndex/youjiantou.png";
- const _sfc_main$2Q = {
- __name: "FirstIndex",
- setup(__props, { expose: __expose }) {
- __expose();
- uni.hideTabBar();
- const appInfo = vue.computed(() => sheep$1.$store("app").info);
- const {
- safeArea
- } = sheep$1.$platform.device;
- const pageHeight = vue.computed(() => safeArea.height - 45);
- const tabbar = vue.ref({
- "theme": "red",
- "style": {
- "bgType": "color",
- "bgColor": "#323b4e",
- "color": "#e6e6e5",
- "activeColor": "#1fa380"
- },
- "items": [
- {
- "text": t$6("common.home"),
- "url": "/pages/index/FirstIndex",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/index.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/index-active.svg")
- },
- {
- "text": t$6("common.activities"),
- "url": "/pages/index/FirstActivity",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/activity.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/activity-active.svg")
- },
- {
- "text": t$6("common.videos"),
- "url": "/pages/index/FirstVideo",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/video.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/video-active.svg")
- },
- {
- "text": t$6("common.mall"),
- "url": "/pages/index/index",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/shop.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/shop-active.svg")
- }
- ]
- });
- const lunbo = vue.ref({
- "type": "default",
- "indicator": "dot",
- "autoplay": false,
- "interval": 3,
- "items": [],
- "style": {
- "bgType": "color",
- "bgColor": "#fff",
- "marginBottom": 8
- }
- });
- const gonggao = vue.ref({
- text: "",
- title: ""
- });
- const state = vue.ref({
- ptjj: {
- title: ""
- },
- cyjs: {
- title: ""
- },
- xwdt: {
- title: "",
- image: ""
- }
- });
- onLoad(async () => {
- const {
- code: code2,
- data
- } = await ArticleApi.getHomeList();
- formatAppLog("log", "at pages/index/FirstIndex.vue:160", data);
- lunbo.value.items = data.slideshowArticleList.map((article) => ({
- type: "img",
- imgUrl: article.picUrl,
- url: "/pages/public/richtext",
- urlParams: {
- title: article.title
- },
- videoUrl: "",
- title: article.title
- }));
- gonggao.value.text = data.announcement.content;
- gonggao.value.title = data.announcement.title;
- state.value.ptjj.title = data.ptBriefIntroduction.title;
- state.value.cyjs.title = data.industryIntroduction.title;
- state.value.xwdt.title = data.dynamicNews.title;
- state.value.xwdt.image = data.dynamicNews.picUrl;
- });
- const __returned__ = { appInfo, safeArea, pageHeight, tabbar, lunbo, gonggao, state, computed: vue.computed, ref: vue.ref, get onLoad() {
- return onLoad;
- }, get onPageScroll() {
- return onPageScroll;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get sheep() {
- return sheep$1;
- }, get $share() {
- return $share;
- }, get isAndroid() {
- return isAndroid;
- }, get getAndroidJiGuangId() {
- return getAndroidJiGuangId;
- }, get showWalletModal() {
- return showWalletModal;
- }, get colseWalletModal() {
- return colseWalletModal;
- }, get ArticleApi() {
- return ArticleApi;
- }, Richtext: PagesPublicRichtext, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2P(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_image_banner = resolveEasycom(vue.resolveDynamicComponent("s-image-banner"), __easycom_8$1);
- const _component_s_tabbar = resolveEasycom(vue.resolveDynamicComponent("s-tabbar"), __easycom_3$7);
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "page-body",
- style: { "background": "#111521" }
- }, [
- vue.createElementVNode("view", { class: "header" }, [
- vue.createElementVNode("view", { class: "logo" }, [
- vue.createElementVNode("image", {
- class: "",
- src: _imports_0$8,
- mode: "aspectFit"
- })
- ]),
- vue.createElementVNode("view", { class: "language" })
- ]),
- vue.createCommentVNode(" 轮播 "),
- vue.createVNode(_component_s_image_banner, {
- data: $setup.lunbo,
- styles: _ctx.styles,
- class: "lunbo",
- height: "300"
- }, null, 8, ["data", "styles"]),
- vue.createCommentVNode(` @click="sheep.$router.go('/pages/public/richtext', {title:gonggao.title});" `),
- vue.createElementVNode("view", { class: "gonggao" }, [
- vue.createElementVNode("view", { class: "gonggao-item" }, " 使命:共建平台,共创价值,共享利益。 "),
- vue.createElementVNode("view", { class: "gonggao-item" }, " 愿景:引领共享电商,三方共赢,推动创新。 "),
- vue.createElementVNode("view", { class: "gonggao-item" }, " 价值观:产品为王、诚信透明、共创共享共赢 ")
- ]),
- vue.createElementVNode("view", { class: "nav" }, [
- vue.createElementVNode("view", {
- class: "card",
- onClick: _cache[0] || (_cache[0] = ($event) => {
- $setup.sheep.$router.go("/pages/public/richtext", { title: $setup.state.ptjj.title });
- })
- }, [
- vue.createElementVNode("image", {
- src: _imports_1$4,
- mode: "aspectFit"
- }),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.t("common.platform_intro")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "card",
- onClick: _cache[1] || (_cache[1] = ($event) => {
- $setup.sheep.$router.go("/pages/public/richtext", { title: $setup.state.cyjs.title });
- })
- }, [
- vue.createElementVNode("image", {
- src: _imports_2$2,
- mode: "aspectFit"
- }),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.t("common.industry_intro")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "card",
- onClick: _cache[2] || (_cache[2] = ($event) => {
- $setup.sheep.$router.go("/pages/index/FirstList", { categoryId: 11 });
- })
- }, [
- vue.createElementVNode("image", {
- src: _imports_3$1,
- mode: "aspectFit"
- }),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.t("common.latest_news")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "card",
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.sheep.$router.go("/pages/index/index"))
- }, [
- vue.createElementVNode("image", {
- src: _imports_4,
- mode: "aspectFit"
- }),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.t("common.shared_mall")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode(
- "view",
- {
- class: "news",
- style: vue.normalizeStyle([{ backgroundImage: `url(${$setup.state.xwdt.image})` }, { "background-size": "cover" }]),
- onClick: _cache[5] || (_cache[5] = ($event) => {
- $setup.sheep.$router.go("/pages/public/richtext", { title: $setup.state.xwdt.title });
- })
- },
- [
- vue.createElementVNode("view", { class: "news-bottom" }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.state.xwdt.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", {
- onClick: _cache[4] || (_cache[4] = ($event) => {
- $setup.sheep.$router.go("/pages/index/FirstList", { categoryId: 6 });
- })
- }, [
- vue.createElementVNode("image", {
- src: _imports_0$7,
- mode: "aspectFit"
- })
- ])
- ])
- ],
- 4
- /* STYLE */
- ),
- vue.createVNode(_component_s_tabbar, {
- path: "/pages/index/FirstIndex",
- tabbar: $setup.tabbar
- }, null, 8, ["tabbar"])
- ]);
- }
- const PagesIndexFirstIndex = /* @__PURE__ */ _export_sfc(_sfc_main$2Q, [["render", _sfc_render$2P], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/FirstIndex.vue"]]);
- const _sfc_main$2P = {
- __name: "s-empty",
- props: {
- // 图标
- icon: {
- type: String,
- default: ""
- },
- // 描述
- text: {
- type: String,
- default: ""
- },
- // 是否显示button
- showAction: {
- type: Boolean,
- default: false
- },
- // button 文字
- actionText: {
- type: String,
- default: ""
- },
- // 链接
- actionUrl: {
- type: String,
- default: ""
- },
- // 间距
- paddingTop: {
- type: String,
- default: "260"
- },
- //主题色
- buttonColor: {
- type: String,
- default: "var(--ui-BG-Main)"
- }
- },
- emits: ["clickAction"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "5cc178a8-buttonColor": __props.buttonColor
- }));
- const props = __props;
- const emits = __emit;
- function clickAction() {
- if (props.actionUrl !== "") {
- sheep$1.$router.go(props.actionUrl);
- }
- emits("clickAction");
- }
- const __returned__ = { props, emits, clickAction, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2O(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "ss-flex-col ss-col-center ss-row-center empty-box",
- style: vue.normalizeStyle([{ paddingTop: $props.paddingTop + "rpx" }])
- },
- [
- vue.createElementVNode("view", { class: "" }, [
- vue.createElementVNode("image", {
- class: "empty-icon",
- src: $props.icon,
- mode: "widthFix"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "empty-text ss-m-t-28 ss-m-b-40" }, [
- $props.text !== "" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 0 },
- vue.toDisplayString($props.text),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- $props.showAction ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button empty-btn",
- onClick: $setup.clickAction
- },
- vue.toDisplayString($props.actionText),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_2$6 = /* @__PURE__ */ _export_sfc(_sfc_main$2P, [["render", _sfc_render$2O], ["__scopeId", "data-v-5cc178a8"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-empty/s-empty.vue"]]);
- const en$1 = {
- "uni-load-more.contentdown": "Pull up to show more",
- "uni-load-more.contentrefresh": "loading...",
- "uni-load-more.contentnomore": "No more data"
- };
- const zhHans$1 = {
- "uni-load-more.contentdown": "上拉显示更多",
- "uni-load-more.contentrefresh": "正在加载...",
- "uni-load-more.contentnomore": "没有更多数据了"
- };
- const zhHant$1 = {
- "uni-load-more.contentdown": "上拉顯示更多",
- "uni-load-more.contentrefresh": "正在加載...",
- "uni-load-more.contentnomore": "沒有更多數據了"
- };
- const messages$1 = {
- en: en$1,
- "zh-Hans": zhHans$1,
- "zh-Hant": zhHant$1
- };
- let platform$3;
- setTimeout(() => {
- platform$3 = uni.getSystemInfoSync().platform;
- }, 16);
- const {
- t: t$4
- } = initVueI18n(messages$1);
- const _sfc_main$2O = {
- name: "UniLoadMore",
- emits: ["clickLoadMore"],
- props: {
- status: {
- // 上拉的状态:more-loading前;loading-loading中;noMore-没有更多了
- type: String,
- default: "more"
- },
- showIcon: {
- type: Boolean,
- default: true
- },
- iconType: {
- type: String,
- default: "auto"
- },
- iconSize: {
- type: Number,
- default: 24
- },
- color: {
- type: String,
- default: "#777777"
- },
- contentText: {
- type: Object,
- default() {
- return {
- contentdown: "",
- contentrefresh: "",
- contentnomore: ""
- };
- }
- },
- showText: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {
- webviewHide: false,
- platform: platform$3,
- imgBase64: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QzlBMzU3OTlEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QzlBMzU3OUFEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDOUEzNTc5N0Q5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDOUEzNTc5OEQ5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pt+ALSwAAA6CSURBVHja1FsLkFZVHb98LM+F5bHL8khA1iSeiyQBCRM+YGqKUnnJTDLGI0BGZlKDIU2MMglUiDApEZvSsZnQtBRJtKwQNKQMFYeRDR10WOLd8ljYXdh+v8v5fR3Od+797t1dnOnO/Ofce77z+J//+b/P+ZqtXbs2sJ9MJhNUV1cHJ06cCJo3bx7EPc2aNcvpy7pWrVoF+/fvDyoqKoI2bdoE9fX1F7TjN8a+EXBn/fkfvw942Tf+wYMHg9mzZwfjxo0LDhw4EPa1x2MbFw/fOGfPng1qa2tzcCkILsLDydq2bRsunpOTMM7TD/W/tZDZhPdeKD+yGxHhdu3aBV27dg3OnDlzMVANMheLAO3btw8KCwuDmpoaX5OxbgUIMEq7K8IcPnw4KCsrC/r37x8cP378/4cAXAB3vqSkJMuiDhTkw+XcuXNhOWbMmKBly5YhUT8xArhyFvP0BfwRsAuwxJZJsm/nzp2DTp06he/OU+cZ64K6o0ePBkOHDg2GDx8e6gEbJ5Q/NHNuAJQ1hgBeHUDlR7nVTkY8rQAvAi4z34vR/mPs1FoRsaCgIJThI0eOBC1atEiFGGV+5MiRoS45efJkqFjJFXV1dQuA012m2WcwTw98fy6CqBdsaiIO4CScrGPHjvk4odhavPquRtFWXEC25VgkREKOCh/qDSq+vn37htzD/mZTOmOc5U7zKzBPEedygWshcDyWvs30igAbU+6oyMgJBCFhwQE0fccxN60Ay9iebbjoDh06hMowjQxT4fXq1SskArmHZpkArvixp/kWzHdMeArExSJEaiXIjjRjRJ4DaAGWpibLzXN3Fm1vA5teBgh3j1Rv3bp1YgKwPdmf2p9zcyNYYgPKMfY0T5f5nNYdw158nJ8QawW4CLKwiOBSEgO/hok2eBydR+3dYH+PLxA5J8Vv0KBBwenTp0P2JWAx6+yFEBfs8lMY+y0SWMBNI9E4ThKi58VKTg3FQZS1RQF1cz27eC0QHMu+3E0SkUowjhVt5VdaWhp07949ZHv2Qd1EjDXM2cla1M0nl3GxAs3J9yREzyTdFVKVFOaE9qRA8GM0WebRuo9JGZKA7Mv2SeS/Z8+eoQ9BArMfFrLGo6jvxbhHbJZnKX2Rzz1O7QhJJ9Cs2ZMaWIyq/zhdeqPNfIoHd58clIQD+JSXl4dKlyIAuBdVXZwFVWKspSSoxE++h8x4k3uCnEhE4I5KwRiFWGOU0QWKiCYLbdoRMRKAu2kQ9vkfLU6dOhX06NEjlH+yMRZSinnuyWnYosVcji8CEA/6Cg2JF+IIUBqnGKUTCNwtwBN4f89RiK1R96DEgO2o0NDmtEdvVFdVVYV+P3UAPUEs6GFwV3PHmXkD4vh74iDFJysVI/MlaQhwKeBNTLYX5VuA8T4/gZxA4MRGFxDB6R7OmYPfyykGRJbyie+XnGYnQIC/coH9+vULiYrxrkL9ZA9+0ykaHIfEpM7ge8TiJ2CsHYwyMfafAF1yCGBHYIbCVDjDjKt7BeB51D+LgQa6OkG7IDYEEtvQ7lnXLKLtLdLuJBpE4gPUXcW2+PkZwOex+4cGDhwYDBkyRL7/HFcEwUGPo/8uWRUpYnfxGHco8HkewLHLyYmAawAPuIFZxhOpDfJQ8gbUv41yORAptMWBNr6oqMhWird5+u+iHmBb2nhjDV7HWBNQTgK8y11l5NetWzc5ULscAtSj7nbNI0skhWeUZCc0W4nyH/jO4Vz0u1IeYhbk4AiwM6tjxIWByHsoZ9qcIBPJd/y+DwPfBESOmCa/QF3WiZHucLlEDpNxcNhmheEOPgdQNx6/VZFQzFZ5TN08AHXQt2Ii3EdyFuUsPtTcGPhW5iMiCNELvz+Gdn9huG4HUJaW/w3g0wxV0XaG7arG2WeKiUWYM4Y7GO5ezshTARbbWGw/DvXkpp/ivVvE0JVoMxN4rpGzJMhE5Pl+xlATsDIqikP9F9D2z3h9nOksEUFhK+qO4rcPkoalMQ/HqJLIyb3F3JdjrCcw1yZ8joyJLR5gCo54etlag7qIoeNh1N1BRYj3DTFJ0elotxPlVzkGuYAmL0VSJVGAJA41c4Z6A3BzTLfn0HYwYKEI6CUAMzZEWvLsIcQOo1AmmyyM72nHJCfYsogflGV6jEk9vyQZXSuq6w4c16NsGcGZbwOPr+H1RkOk2LEzjNepxQkihHSCQ4ynAYNRx2zMKV92CQMWqj8J0BRE8EShxRFN6YrfCRhC0x3r/Zm4IbQCcmJoV0kMamllccR6FjHqUC5F2R/wS2dcymOlfAKOS4KmzQb5cpNC2MC7JhVn5wjXoJ44rYhLh8n0eXOCorJxa7POjbSlCGVczr34/RsAmrcvo9s+wGp3tzVhntxiXiJ4nvEYb4FJkf0O8HocAePmLvCxnL0AORraVekJk6TYjDabRVXfRE2lCN1h6ZQRN1+InUbsCpKwoBZHh0dODN9JBCUffItXxEavTQkUtnfTVAplCWL3JISz29h4NjotnuSsQKJCk8dF+kJR6RARjrqFVmfPnj3ZbK8cIJ0msd6jgHPGtfVTQ8VLmlvh4mct9sobRmPic0DyDQQnx/NlfYUgyz59+oScsH379pAwXABD32nTpoUHIToESeI5mnbE/UqDdyLcafEBf2MCqgC7NwxIbMREJQ0g4D4sfJwnD+AmRrII05cfMWJE+L1169bQr+fip06dGp4oJ83lmYd5wj/EmMa4TaHivo4EeCguYZBnkB5g2aWA69OIEnUHOaGysjIYMGBAMGnSpODYsWPZwCpFmm4lNq+4gSLQA7jcX8DwtjEyRC8wjabnXEx9kfWnTJkSJkAo90xpJVV+FmcVNeYAF5zWngS4C4O91MBxmAv8blLEpbjI5sz9MTdAhcgkCT1RO8mZkAjfiYpTEvStAS53Uw1vAiUGgZ3GpuQEYvoiBqlIan7kSDHnTwJQFNiPu0+5VxCVYhcZIjNrdXUDdp+Eq5AZ3Gkg8QAyVZRZIk4Tl4QAbF9cXJxNYZMAtAokgs4BrNxEpCtteXg7DDTMDKYNSuQdKsnJBek7HxewvxaosWxLYXtw+cJp18217wql4aKCfBNoEu0O5VU+PhctJ0YeXD4C6JQpyrlpSLTojpGGGN5YwNziChdIZLk4lvLcFJ9jMX3QdiImY9bmGQU+TRUL5CHITTRlgF8D9ouD1MfmLoEPl5xokIumZ2cfgMpHt47IW9N64Hsh7wQYYjyIugWuF5fCqYncXRd5vPMWyizzvhi/32+nvG0dZc9vR6fZOu0md5e+uC408FvKSIOZwXlGvxPv95izA2Vtvg1xKFWARI+vMX66HUhpQQb643uW1bSjuTWyw2SBvDrBvjFic1eGGlz5esq3ko9uSIlBRqPuFcCv8F4WIcN12nVaBd0SaYwI6PDDImR11JkqgHcPmQssjxIn6bUshygDFJUTxPMpHk+jfjPgupgdnYV2R/g7xSjtpah8RJBewhwf0gGK6XI92u4wXFEU40afJ4DN4h5LcAd+40HI3JgJecuT0c062W0i2hQJUTcxan3/CMW1PF2K6bbA+Daz4xRs1D3Br1Cm0OihKCqizW78/nXAF/G5TXrEcVzaNMH6CyMswqsAHqDyDLEyou8lwOXnKF8DjI6KjV3KzMBiXkDH8ij/H214J5A596ekrZ3F0zXlWeL7+P5eUrNo3/QwC15uxthuzidy7DzKRwEDaAViiDgKbTbz7CJnzo0bN7pIfIiid8SuPwn25o3QCmpnyjlZkyxPP8EomCJzrGb7GJMx7tNsq4MT2xMUYaiErZOluTzKsnz3gwCeCZyVRZJfYplNEokEjwrPtxlxjeYAk+F1F74VAzPxQRNYYdtpOUvWs8J1sGhBJMNsb7igN8plJs1eSmLIhLKE4rvaCX27gOhLpLOsIzJ7qn/i+wZzcvSOZ23/du8TZjwV8zHIXoP4R3ifBxiFz1dcVpa3aPntPE+c6TmIWE9EtcMmAcPdWAhYhAXxcLOQi9L1WhD1Sc8p1d2oL7XGiRKp8F4A2i8K/nfI+y/gsTDJ/YC/8+AD5Uh04KHiGl+cIFPnBDDrPMjwRGkLXyxO4VGbfQWnDH2v0bVWE3C9QOXlepbgjEfIJQI6XDG3z5ahD9cw2pS78ipB85wyScNTvsVzlzzhL8/jRrnmVjfFJK/m3m4nj9vbgQTguT8XZTjsm672R5uJKEaQmBI/c58gyus8ZDagLpEVSJBIyHp4jn++xqPV71OgQgJYEWOtZ/haxRtKmWOBu8xdBLftWltsY84zE6WIEy/eIOWL+BaayMx+KHtL7EAkqdNDLiEXmEMUHniedtJqg9HmZtfvt26vNi0BdG3Ft3g8ZOf7PAu59TxtzivLNIekyi+wD1i8CuUiD9FXAa8C+/xS3JPmZnomyc7H+fb4/Se0bk41Fel621r4cgVxbq91V4jVqwB7HTe2M7jgB+QWHavZkDRPmZcASoZEmBx6i75bGjPcMdL4/VKGFAGWZkGzPG0XAbdL9A81G5LOmUnC9hHKJeO7dcUMjblSl12867ElFTtaGl20xvvLGPdVz/8TVuU7y0x1PG7vtNg24oz9Uo/Z412++VFWI7Fcog9tu9Lm6gvRmIPv9x1xmQAu6RDkXtbOtlGEmpgD5Nvnyc0dcv0EE6cfdi1HmhMf9wDF3k3gtRvEedhxjpgfqPb9PU9iEJHnyOUA7bQUXh6kq/D7l2iTjWv7XOD530BDr8jIrus+srXjt4MzumJMHuTsBa63YKE1+RR5lBjEikCCnWKWiHdzOgKO+nRIBAF88za/IFmJ3eMZov4CYxGBabcpGL8EYx+SeMXJeRwHNsV/h+vdxeuhEpN3ZyNY78Gm2fknJxVGhyjixPiQvVkNzT1elD9Py/aTAL64Hb9vcYmC9zfdXdT/C1LeGbg4rnBaAihDFJH12W5ulfNCNe/xTsP3bp8ikzJs5BF+5PNfAQYAPaseTdsEcaYAAAAASUVORK5CYII="
- };
- },
- computed: {
- iconSnowWidth() {
- return (Math.floor(this.iconSize / 24) || 1) * 2;
- },
- contentdownText() {
- return this.contentText.contentdown || t$4("uni-load-more.contentdown");
- },
- contentrefreshText() {
- return this.contentText.contentrefresh || t$4("uni-load-more.contentrefresh");
- },
- contentnomoreText() {
- return this.contentText.contentnomore || t$4("uni-load-more.contentnomore");
- }
- },
- mounted() {
- var pages2 = getCurrentPages();
- var page2 = pages2[pages2.length - 1];
- var currentWebview = page2.$getAppWebview();
- currentWebview.addEventListener("hide", () => {
- this.webviewHide = true;
- });
- currentWebview.addEventListener("show", () => {
- this.webviewHide = false;
- });
- },
- methods: {
- onClick() {
- this.$emit("clickLoadMore", {
- detail: {
- status: this.status
- }
- });
- }
- }
- };
- function _sfc_render$2N(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "uni-load-more",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
- }, [
- !$data.webviewHide && ($props.iconType === "circle" || $props.iconType === "auto" && $data.platform === "android") && $props.status === "loading" && $props.showIcon ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- style: vue.normalizeStyle({ width: $props.iconSize + "px", height: $props.iconSize + "px" }),
- class: "uni-load-more__img uni-load-more__img--android-MP"
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "uni-load-more__img-icon",
- style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "uni-load-more__img-icon",
- style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "uni-load-more__img-icon",
- style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )) : !$data.webviewHide && $props.status === "loading" && $props.showIcon ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- style: vue.normalizeStyle({ width: $props.iconSize + "px", height: $props.iconSize + "px" }),
- class: "uni-load-more__img uni-load-more__img--ios-H5"
- },
- [
- vue.createElementVNode("image", {
- src: $data.imgBase64,
- mode: "widthFix"
- }, null, 8, ["src"])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.showText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 2,
- class: "uni-load-more__text",
- style: vue.normalizeStyle({ color: $props.color })
- },
- vue.toDisplayString($props.status === "more" ? $options.contentdownText : $props.status === "loading" ? $options.contentrefreshText : $options.contentnomoreText),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_2$5 = /* @__PURE__ */ _export_sfc(_sfc_main$2O, [["render", _sfc_render$2N], ["__scopeId", "data-v-9245e42c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue"]]);
- const _sfc_main$2N = {
- __name: "FirstList",
- props: {
- // 是否显示tabbar
- tabbar: {
- type: Boolean,
- default: true
- },
- // 是否显示tabbar
- categoryId: {
- type: Number,
- default: 0
- },
- type: {
- type: String,
- default: "articleCard"
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- uni.hideTabBar();
- const appInfo = vue.computed(() => sheep$1.$store("app").info);
- const {
- safeArea
- } = sheep$1.$platform.device;
- const pageHeight = vue.computed(() => safeArea.height - 45);
- const props = __props;
- const tabbar = vue.ref({
- "theme": "red",
- "style": {
- "bgType": "color",
- "bgColor": "#323b4e",
- "color": "#e6e6e5",
- "activeColor": "#1fa380"
- },
- "items": [
- {
- "text": t$6("common.home"),
- "url": "/pages/index/FirstIndex",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/index.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/index-active.svg")
- },
- {
- "text": t$6("common.activities"),
- "url": "/pages/index/FirstActivity",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/activity.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/activity-active.svg")
- },
- {
- "text": t$6("common.videos"),
- "url": "/pages/index/FirstVideo",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/video.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/video-active.svg")
- },
- {
- "text": t$6("common.mall"),
- "url": "/pages/index/index",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/shop.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/shop-active.svg")
- }
- ]
- });
- const state = vue.reactive({
- categoryId: 0,
- pagination: {
- list: [],
- current_page: 1,
- total: 1,
- last_page: 1
- },
- loadStatus: ""
- });
- async function getArticleList(page2 = 1, list_rows = 5) {
- state.loadStatus = "loading";
- let { code: code2, data } = await ArticleApi.getArticleByCategory({ pageNo: page2, pageSize: list_rows, categoryId: state.categoryId });
- if (code2 !== 0) {
- return;
- }
- let articleList = _$1.concat(state.pagination.list, data.list);
- state.pagination.list = articleList;
- state.pagination.total = data.total;
- state.pagination.last_page = Math.ceil(data.total / 5);
- if (state.pagination.current_page < state.pagination.last_page) {
- state.loadStatus = "more";
- } else {
- state.loadStatus = "noMore";
- }
- }
- function loadMore() {
- if (state.loadStatus !== "noMore") {
- state.pagination.current_page += 1;
- getArticleList(state.pagination.current_page);
- }
- }
- onLoad(async (option) => {
- if (option && option.categoryId) {
- state.categoryId = option.categoryId;
- } else {
- state.categoryId = props.categoryId;
- }
- await getArticleList();
- });
- onReachBottom(() => {
- loadMore();
- });
- onPullDownRefresh(() => {
- state.pagination.list = [];
- state.pagination.current_page = 1;
- state.pagination.total = 1;
- state.pagination.last_page = 1;
- getArticleList();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 800);
- });
- const __returned__ = { appInfo, safeArea, pageHeight, props, tabbar, state, getArticleList, loadMore, computed: vue.computed, ref: vue.ref, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onShow() {
- return onShow;
- }, get onReachBottom() {
- return onReachBottom;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get sheep() {
- return sheep$1;
- }, get $share() {
- return $share;
- }, get _() {
- return _$1;
- }, get isAndroid() {
- return isAndroid;
- }, get getAndroidJiGuangId() {
- return getAndroidJiGuangId;
- }, get showWalletModal() {
- return showWalletModal;
- }, get colseWalletModal() {
- return colseWalletModal;
- }, get t() {
- return t$6;
- }, get ArticleApi() {
- return ArticleApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2M(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_tabbar = resolveEasycom(vue.resolveDynamicComponent("s-tabbar"), __easycom_3$7);
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "page-body",
- style: { "background": "#f6f6f6" }
- }, [
- vue.createCommentVNode(' <video src="https://jvod.300hu.com/vod/product/4c17d312-2039-4668-8460-fd71540fb465/f0db5965187f4178bb7ed745bbff143c.mp4?info=50793-1054733-h264-aac" controls="true"></video>\n <video src="http://192.168.3.158:80/static/firstIndex/f0db5965187f4178bb7ed745bbff143c.mp4"></video>\n <video control s src="https://zxpt.newfeifan.cn/admin-api/infra/file/23/get/03488f68d9c9269a3eac373ab5309d574ffdd67e6882ec8a2f86f9b4766c91e7.mp4"></video>'),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/data-empty.png",
- text: $setup.t("common.no_data")
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 && $props.type == "activityCard" ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "article ss-r-10",
- onClick: ($event) => {
- $setup.sheep.$router.go("/pages/public/richtext", { title: item.title });
- }
- }, [
- vue.createElementVNode(
- "view",
- { class: "title" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "content" }, [
- item.picUrl.trim() ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "image"
- }, [
- vue.createElementVNode("image", {
- src: item.picUrl,
- mode: "aspectFit",
- class: "image-content"
- }, null, 8, ["src"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- { class: "desc" },
- vue.toDisplayString(item.introduction),
- 1
- /* TEXT */
- )
- ])
- ], 8, ["onClick"]);
- }),
- 256
- /* UNKEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 && $props.type == "articleCard" ? (vue.openBlock(), vue.createElementBlock("view", { key: 2 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "activity ss-r-10",
- style: vue.normalizeStyle({ backgroundImage: `url(${item.picUrl})` }),
- onClick: ($event) => {
- $setup.sheep.$router.go("/pages/public/richtext", { title: item.title });
- }
- }, [
- vue.createElementVNode("view", { class: "activity-bottom" }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "" }, [
- vue.createElementVNode("image", {
- src: _imports_0$7,
- mode: "aspectFit"
- })
- ])
- ])
- ], 12, ["onClick"]);
- }),
- 256
- /* UNKEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 3,
- status: $setup.state.loadStatus,
- "content-text": { contentdown: "上拉加载更多" },
- onClick: _ctx.loadmore
- }, null, 8, ["status", "onClick"])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_s_tabbar, {
- path: "/pages/index/FirstIndex",
- tabbar: $setup.tabbar
- }, null, 8, ["tabbar"])
- ]);
- }
- const PagesIndexFirstList = /* @__PURE__ */ _export_sfc(_sfc_main$2N, [["render", _sfc_render$2M], ["__scopeId", "data-v-cb78936e"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/FirstList.vue"]]);
- const _sfc_main$2M = {
- __name: "FirstActivity",
- setup(__props, { expose: __expose }) {
- __expose();
- uni.hideTabBar();
- const tabbar = vue.ref({
- "theme": "red",
- "style": {
- "bgType": "color",
- "bgColor": "#323b4e",
- "color": "#e6e6e5",
- "activeColor": "#1fa380"
- },
- "items": [
- {
- "text": t$6("common.home"),
- "url": "/pages/index/FirstIndex",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/index.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/index-active.svg")
- },
- {
- "text": t$6("common.activities"),
- "url": "/pages/index/FirstActivity",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/activity.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/activity-active.svg")
- },
- {
- "text": t$6("common.videos"),
- "url": "/pages/index/FirstVideo",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/video.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/video-active.svg")
- },
- {
- "text": t$6("common.mall"),
- "url": "/pages/index/index",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/shop.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/shop-active.svg")
- }
- ]
- });
- onReachBottom(() => {
- });
- onPullDownRefresh(() => {
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 800);
- });
- const __returned__ = { tabbar, computed: vue.computed, ref: vue.ref, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onShow() {
- return onShow;
- }, get onReachBottom() {
- return onReachBottom;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get sheep() {
- return sheep$1;
- }, get t() {
- return t$6;
- }, get ArticleApi() {
- return ArticleApi;
- }, FirstList: PagesIndexFirstList };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2L(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_tabbar = resolveEasycom(vue.resolveDynamicComponent("s-tabbar"), __easycom_3$7);
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "page-body",
- style: { "background": "#f6f6f6" }
- }, [
- vue.createVNode($setup["FirstList"], {
- categoryId: 9,
- type: "activityCard"
- }),
- vue.createVNode(_component_s_tabbar, {
- path: "/pages/index/FirstActivity",
- tabbar: $setup.tabbar
- }, null, 8, ["tabbar"])
- ]);
- }
- const PagesIndexFirstActivity = /* @__PURE__ */ _export_sfc(_sfc_main$2M, [["render", _sfc_render$2L], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/FirstActivity.vue"]]);
- const _sfc_main$2L = {
- __name: "FirstVideo",
- setup(__props, { expose: __expose }) {
- __expose();
- uni.hideTabBar();
- const tabbar = vue.ref({
- "theme": "red",
- "style": {
- "bgType": "color",
- "bgColor": "#323b4e",
- "color": "#e6e6e5",
- "activeColor": "#1fa380"
- },
- "items": [
- {
- "text": t$6("common.home"),
- "url": "/pages/index/FirstIndex",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/index.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/index-active.svg")
- },
- {
- "text": t$6("common.activities"),
- "url": "/pages/index/FirstActivity",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/activity.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/activity-active.svg")
- },
- {
- "text": t$6("common.videos"),
- "url": "/pages/index/FirstVideo",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/video.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/video-active.svg")
- },
- {
- "text": t$6("common.mall"),
- "url": "/pages/index/index",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/shop.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/shop-active.svg")
- }
- ]
- });
- onReachBottom(() => {
- });
- onPullDownRefresh(() => {
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 800);
- });
- const __returned__ = { tabbar, computed: vue.computed, ref: vue.ref, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onShow() {
- return onShow;
- }, get onReachBottom() {
- return onReachBottom;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get sheep() {
- return sheep$1;
- }, get t() {
- return t$6;
- }, get ArticleApi() {
- return ArticleApi;
- }, FirstList: PagesIndexFirstList };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2K(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_tabbar = resolveEasycom(vue.resolveDynamicComponent("s-tabbar"), __easycom_3$7);
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "page-body",
- style: { "background": "#f6f6f6" }
- }, [
- vue.createVNode($setup["FirstList"], {
- categoryId: 10,
- type: "articleCard"
- }),
- vue.createVNode(_component_s_tabbar, {
- path: "/pages/index/FirstVideo",
- tabbar: $setup.tabbar
- }, null, 8, ["tabbar"])
- ]);
- }
- const PagesIndexFirstVideo = /* @__PURE__ */ _export_sfc(_sfc_main$2L, [["render", _sfc_render$2K], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/FirstVideo.vue"]]);
- const _sfc_main$2K = {
- name: "UniNoticeBar",
- emits: ["click", "getmore", "close"],
- props: {
- text: {
- type: String,
- default: ""
- },
- moreText: {
- type: String,
- default: ""
- },
- backgroundColor: {
- type: String,
- default: ""
- },
- speed: {
- // 默认1s滚动100px
- type: Number,
- default: 100
- },
- color: {
- type: String,
- default: "var(--ui-BG-Main)"
- },
- moreColor: {
- type: String,
- default: "#FF9A43"
- },
- single: {
- // 是否单行
- type: [Boolean, String],
- default: false
- },
- scrollable: {
- // 是否滚动,添加后控制单行效果取消
- type: [Boolean, String],
- default: false
- },
- showIcon: {
- // 是否显示左侧icon
- type: [Boolean, String],
- default: false
- },
- showGetMore: {
- // 是否显示右侧查看更多
- type: [Boolean, String],
- default: false
- },
- showClose: {
- // 是否显示左侧关闭按钮
- type: [Boolean, String],
- default: false
- }
- },
- data() {
- const elId = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
- const elIdBox = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
- return {
- textWidth: 0,
- boxWidth: 0,
- wrapWidth: "",
- webviewHide: false,
- elId,
- elIdBox,
- show: true,
- animationDuration: "none",
- animationPlayState: "paused",
- animationDelay: "0s"
- };
- },
- mounted() {
- var pages2 = getCurrentPages();
- var page2 = pages2[pages2.length - 1];
- var currentWebview = page2.$getAppWebview();
- currentWebview.addEventListener("hide", () => {
- this.webviewHide = true;
- });
- currentWebview.addEventListener("show", () => {
- this.webviewHide = false;
- });
- this.$nextTick(() => {
- this.initSize();
- });
- },
- methods: {
- initSize() {
- if (this.scrollable) {
- let query = [];
- let textQuery = new Promise((resolve, reject) => {
- uni.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((ret) => {
- this.textWidth = ret[0].width;
- resolve();
- });
- });
- let boxQuery = new Promise((resolve, reject) => {
- uni.createSelectorQuery().in(this).select(`#${this.elIdBox}`).boundingClientRect().exec((ret) => {
- this.boxWidth = ret[0].width;
- resolve();
- });
- });
- query.push(textQuery);
- query.push(boxQuery);
- Promise.all(query).then(() => {
- this.animationDuration = `${this.textWidth / this.speed}s`;
- this.animationDelay = `-${this.boxWidth / this.speed}s`;
- setTimeout(() => {
- this.animationPlayState = "running";
- }, 1e3);
- });
- }
- },
- loopAnimation() {
- },
- clickMore() {
- this.$emit("getmore");
- },
- close() {
- this.show = false;
- this.$emit("close");
- },
- onClick() {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$2J(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return $data.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "uni-noticebar",
- style: vue.normalizeStyle({ backgroundColor: $props.backgroundColor }),
- onClick: _cache[2] || (_cache[2] = (...args) => $options.onClick && $options.onClick(...args))
- },
- [
- vue.renderSlot(_ctx.$slots, "icon", {}, () => [
- $props.showIcon === true || $props.showIcon === "true" ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
- key: 0,
- class: "uni-noticebar-icon",
- type: "sound",
- color: $props.color,
- size: "22"
- }, null, 8, ["color"])) : vue.createCommentVNode("v-if", true)
- ], true),
- vue.createElementVNode(
- "view",
- {
- ref: "textBox",
- class: vue.normalizeClass(["uni-noticebar__content-wrapper", {
- "uni-noticebar__content-wrapper--scrollable": $props.scrollable,
- "uni-noticebar__content-wrapper--single": !$props.scrollable && ($props.single || $props.moreText)
- }])
- },
- [
- vue.createElementVNode("view", {
- id: $data.elIdBox,
- class: vue.normalizeClass(["uni-noticebar__content", {
- "uni-noticebar__content--scrollable": $props.scrollable,
- "uni-noticebar__content--single": !$props.scrollable && ($props.single || $props.moreText)
- }])
- }, [
- vue.createElementVNode("text", {
- id: $data.elId,
- ref: "animationEle",
- class: vue.normalizeClass(["uni-noticebar__content-text", {
- "uni-noticebar__content-text--scrollable": $props.scrollable,
- "uni-noticebar__content-text--single": !$props.scrollable && ($props.single || $props.showGetMore)
- }]),
- style: vue.normalizeStyle({
- color: $props.color,
- width: $data.wrapWidth + "px",
- animationDuration: $data.animationDuration,
- "-webkit-animationDuration": $data.animationDuration,
- animationPlayState: $data.webviewHide ? "paused" : $data.animationPlayState,
- "-webkit-animationPlayState": $data.webviewHide ? "paused" : $data.animationPlayState,
- animationDelay: $data.animationDelay,
- "-webkit-animationDelay": $data.animationDelay
- })
- }, vue.toDisplayString($props.text), 15, ["id"])
- ], 10, ["id"])
- ],
- 2
- /* CLASS */
- ),
- $props.showGetMore === true || $props.showGetMore === "true" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-noticebar__more uni-cursor-point",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickMore && $options.clickMore(...args))
- }, [
- $props.moreText.length > 0 ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- style: vue.normalizeStyle({ color: $props.moreColor }),
- class: "uni-noticebar__more-text"
- },
- vue.toDisplayString($props.moreText),
- 5
- /* TEXT, STYLE */
- )) : (vue.openBlock(), vue.createBlock(_component_uni_icons, {
- key: 1,
- type: "right",
- color: $props.moreColor,
- size: "16"
- }, null, 8, ["color"]))
- ])) : vue.createCommentVNode("v-if", true),
- ($props.showClose === true || $props.showClose === "true") && ($props.showGetMore === false || $props.showGetMore === "false") ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-noticebar-close uni-cursor-point"
- }, [
- vue.createElementVNode("view", {
- onClick: _cache[1] || (_cache[1] = (...args) => $options.close && $options.close(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "close", {}, () => [
- vue.createVNode(_component_uni_icons, {
- type: "closeempty",
- color: $props.color,
- size: "16"
- }, null, 8, ["color"])
- ], true)
- ])
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0$k = /* @__PURE__ */ _export_sfc(_sfc_main$2K, [["render", _sfc_render$2J], ["__scopeId", "data-v-8eee8640"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-notice-bar/su-notice-bar.vue"]]);
- const _sfc_main$2J = {
- __name: "s-notice-block",
- props: {
- data: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2I(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_notice_bar = resolveEasycom(vue.resolveDynamicComponent("su-notice-bar"), __easycom_0$k);
- return vue.openBlock(), vue.createElementBlock("view", { class: "ss-flex ss-col-center notice-wrap" }, [
- vue.createElementVNode("image", {
- class: "icon-img",
- src: $setup.sheep.$url.cdn($props.data.iconUrl),
- mode: "heightFix"
- }, null, 8, ["src"]),
- vue.createCommentVNode(" todo:@owen 暂时只支持一个公告 "),
- vue.createVNode(_component_su_notice_bar, {
- style: { "flex": "1" },
- showIcon: false,
- scrollable: "",
- single: "",
- text: $props.data.contents[0].text,
- speed: 50,
- color: $props.data.textColor,
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go($props.data.contents[0].url))
- }, null, 8, ["text", "color"])
- ]);
- }
- const __easycom_1$7 = /* @__PURE__ */ _export_sfc(_sfc_main$2J, [["render", _sfc_render$2I], ["__scopeId", "data-v-587c9010"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-notice-block/s-notice-block.vue"]]);
- const _sfc_main$2I = {
- __name: "s-menu-button",
- props: {
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- },
- circular: {
- type: Boolean,
- default: true
- },
- autoplay: {
- type: Boolean,
- default: false
- },
- interval: {
- type: Number,
- default: 5e3
- },
- duration: {
- type: Number,
- default: 500
- },
- ui: {
- type: String,
- default: ""
- },
- mode: {
- //default
- type: String,
- default: "default"
- },
- dotStyle: {
- type: String,
- default: "long"
- //default long tag
- },
- dotCur: {
- type: String,
- default: "ui-BG-Main"
- },
- bg: {
- type: String,
- default: "bg-none"
- },
- height: {
- type: Number,
- default: 300
- },
- // 是否有边框
- hasBorder: {
- type: Boolean,
- default: true
- },
- // 边框颜色
- borderColor: {
- type: String,
- default: "red"
- },
- background: {
- type: String,
- default: "blue"
- },
- hoverClass: {
- type: String,
- default: "ss-hover-class"
- //'none'为没有hover效果
- },
- // 一排宫格数
- col: {
- type: [Number, String],
- default: 3
- },
- iconSize: {
- type: Number,
- default: 80
- },
- color: {
- type: String,
- default: "#000"
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- cur: 0
- });
- const props = __props;
- const menuList = vue.computed(() => splitData(props.data.list, props.data.row * props.data.column));
- const swiperHeight = vue.computed(() => props.data.row * (props.data.layout === "iconText" ? 200 : 180));
- const windowWidth2 = sheep$1.$platform.device.windowWidth;
- const swiperChange = (e2) => {
- state.cur = e2.detail.current;
- };
- const splitData = (oArr = [], length = 1) => {
- let arr = [];
- let minArr = [];
- oArr.forEach((c2) => {
- if (minArr.length === length) {
- minArr = [];
- }
- if (minArr.length === 0) {
- arr.push(minArr);
- }
- minArr.push(c2);
- });
- return arr;
- };
- const __returned__ = { state, props, menuList, swiperHeight, windowWidth: windowWidth2, swiperChange, splitData, reactive: vue.reactive, computed: vue.computed, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2H(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 包裹层 "),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["ui-swiper", [$setup.props.mode, $setup.props.bg, $setup.props.ui]]),
- style: vue.normalizeStyle([{ height: $setup.swiperHeight + ($setup.menuList.length > 1 ? 50 : 0) + "rpx" }])
- },
- [
- vue.createCommentVNode(" 轮播 "),
- vue.createElementVNode("swiper", {
- circular: $setup.props.circular,
- current: $setup.state.cur,
- autoplay: $setup.props.autoplay,
- interval: $setup.props.interval,
- duration: $setup.props.duration,
- style: vue.normalizeStyle([{ height: $setup.swiperHeight + "rpx" }]),
- onChange: $setup.swiperChange
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.menuList, (arr, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "swiper-item",
- {
- key: index2,
- class: vue.normalizeClass({ cur: $setup.state.cur == index2 })
- },
- [
- vue.createCommentVNode(" 宫格 "),
- vue.createElementVNode("view", { class: "grid-wrap" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(arr, (item, index3) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index3,
- class: "grid-item ss-flex ss-flex-col ss-col-center ss-row-center",
- style: vue.normalizeStyle([{ width: `${100 * (1 / $props.data.column)}%`, height: "200rpx" }]),
- "hover-class": "ss-hover-btn",
- onClick: ($event) => $setup.sheep.$router.go(item.url)
- }, [
- vue.createElementVNode("view", { class: "menu-box ss-flex ss-flex-col ss-col-center ss-row-center" }, [
- item.badge.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "tag-box",
- style: vue.normalizeStyle([{ background: item.badge.bgColor, color: item.badge.textColor }])
- },
- vue.toDisplayString(item.badge.text),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- item.iconUrl ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- class: "menu-icon",
- style: vue.normalizeStyle([
- {
- width: $setup.props.iconSize + "rpx",
- height: $setup.props.iconSize + "rpx"
- }
- ]),
- src: $setup.sheep.$url.cdn(item.iconUrl),
- mode: "aspectFill"
- }, null, 12, ["src"])) : vue.createCommentVNode("v-if", true),
- $props.data.layout === "iconText" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "menu-title",
- style: vue.normalizeStyle([{ color: item.titleColor }])
- },
- vue.toDisplayString(item.title),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ], 12, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ],
- 2
- /* CLASS */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 44, ["circular", "current", "autoplay", "interval", "duration"]),
- vue.createCommentVNode(" 指示点 "),
- $setup.menuList.length > 1 ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- $setup.props.dotStyle != "tag" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["ui-swiper-dot", $setup.props.dotStyle])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.menuList.length, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["line-box", [$setup.state.cur == index2 ? "cur" : "", $setup.props.dotCur]]),
- key: index2
- },
- null,
- 2
- /* CLASS */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- $setup.props.dotStyle == "tag" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["ui-swiper-dot", $setup.props.dotStyle])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["ui-tag radius", [$setup.props.dotCur]]),
- style: { "pointer-events": "none" }
- },
- [
- vue.createElementVNode(
- "view",
- { style: { "transform": "scale(0.7)" } },
- vue.toDisplayString($setup.state.cur + 1) + " / " + vue.toDisplayString($setup.menuList.length),
- 1
- /* TEXT */
- )
- ],
- 2
- /* CLASS */
- )
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const __easycom_2$4 = /* @__PURE__ */ _export_sfc(_sfc_main$2I, [["render", _sfc_render$2H], ["__scopeId", "data-v-75f856ac"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-menu-button/s-menu-button.vue"]]);
- const _sfc_main$2H = {
- name: "UniBadge",
- emits: ["click"],
- props: {
- type: {
- type: String,
- default: "error"
- },
- inverted: {
- type: Boolean,
- default: false
- },
- isDot: {
- type: Boolean,
- default: false
- },
- maxNum: {
- type: Number,
- default: 99
- },
- absolute: {
- type: String,
- default: ""
- },
- offset: {
- type: Array,
- default() {
- return [0, 0];
- }
- },
- text: {
- type: [String, Number],
- default: ""
- },
- size: {
- type: String,
- default: "small"
- },
- customStyle: {
- type: Object,
- default() {
- return {};
- }
- }
- },
- data() {
- return {};
- },
- computed: {
- width() {
- return String(this.text).length * 8 + 12;
- },
- classNames() {
- const {
- inverted,
- type,
- size,
- absolute
- } = this;
- return [
- inverted ? "uni-badge--" + type + "-inverted" : "",
- "uni-badge--" + type,
- "uni-badge--" + size,
- absolute ? "uni-badge--absolute" : ""
- ].join(" ");
- },
- positionStyle() {
- if (!this.absolute)
- return {};
- let w2 = this.width / 2, h2 = 10;
- if (this.isDot) {
- w2 = 5;
- h2 = 5;
- }
- const x = `${-w2 + this.offset[0]}px`;
- const y2 = `${-h2 + this.offset[1]}px`;
- const whiteList = {
- rightTop: {
- right: x,
- top: y2
- },
- rightBottom: {
- right: x,
- bottom: y2
- },
- leftBottom: {
- left: x,
- bottom: y2
- },
- leftTop: {
- left: x,
- top: y2
- }
- };
- const match = whiteList[this.absolute];
- return match ? match : whiteList["rightTop"];
- },
- badgeWidth() {
- return {
- width: `${this.width}px`
- };
- },
- dotStyle() {
- if (!this.isDot)
- return {};
- return {
- width: "10px",
- height: "10px",
- borderRadius: "10px"
- };
- },
- displayValue() {
- const {
- isDot,
- text,
- maxNum
- } = this;
- return isDot ? "" : Number(text) > maxNum ? `${maxNum}+` : text;
- }
- },
- methods: {
- onClick() {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$2G(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-badge--x" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- $props.text ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass([$options.classNames, "uni-badge"]),
- style: vue.normalizeStyle([$options.badgeWidth, $options.positionStyle, $props.customStyle, $options.dotStyle]),
- onClick: _cache[0] || (_cache[0] = ($event) => $options.onClick())
- },
- vue.toDisplayString($options.displayValue),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_0$j = /* @__PURE__ */ _export_sfc(_sfc_main$2H, [["render", _sfc_render$2G], ["__scopeId", "data-v-c97cb896"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-badge/components/uni-badge/uni-badge.vue"]]);
- const _sfc_main$2G = {
- name: "UniListItem",
- emits: ["click", "switchChange"],
- props: {
- direction: {
- type: String,
- default: "row"
- },
- title: {
- type: String,
- default: ""
- },
- note: {
- type: String,
- default: ""
- },
- ellipsis: {
- type: [Number, String],
- default: 0
- },
- disabled: {
- type: [Boolean, String],
- default: false
- },
- clickable: {
- type: Boolean,
- default: false
- },
- showArrow: {
- type: [Boolean, String],
- default: false
- },
- link: {
- type: [Boolean, String],
- default: false
- },
- to: {
- type: String,
- default: ""
- },
- showBadge: {
- type: [Boolean, String],
- default: false
- },
- showSwitch: {
- type: [Boolean, String],
- default: false
- },
- switchChecked: {
- type: [Boolean, String],
- default: false
- },
- badgeText: {
- type: String,
- default: ""
- },
- badgeType: {
- type: String,
- default: "success"
- },
- badgeStyle: {
- type: Object,
- default() {
- return {};
- }
- },
- rightText: {
- type: String,
- default: ""
- },
- thumb: {
- type: String,
- default: ""
- },
- thumbSize: {
- type: String,
- default: "base"
- },
- showExtraIcon: {
- type: [Boolean, String],
- default: false
- },
- extraIcon: {
- type: Object,
- default() {
- return {
- type: "",
- color: "#000000",
- size: 20
- };
- }
- },
- border: {
- type: Boolean,
- default: true
- }
- },
- // inject: ['list'],
- data() {
- return {
- isFirstChild: false
- };
- },
- mounted() {
- this.list = this.getForm();
- if (this.list) {
- if (!this.list.firstChildAppend) {
- this.list.firstChildAppend = true;
- this.isFirstChild = true;
- }
- }
- },
- methods: {
- /**
- * 获取父元素实例
- */
- getForm(name2 = "uniList") {
- let parent2 = this.$parent;
- let parentName = parent2.$options.name;
- while (parentName !== name2) {
- parent2 = parent2.$parent;
- if (!parent2)
- return false;
- parentName = parent2.$options.name;
- }
- return parent2;
- },
- onClick() {
- if (this.to !== "") {
- this.openPage();
- return;
- }
- if (this.clickable || this.link) {
- this.$emit("click", {
- data: {}
- });
- }
- },
- onSwitchChange(e2) {
- this.$emit("switchChange", e2.detail);
- },
- openPage() {
- if (["navigateTo", "redirectTo", "reLaunch", "switchTab"].indexOf(this.link) !== -1) {
- this.pageApi(this.link);
- } else {
- this.pageApi("navigateTo");
- }
- },
- pageApi(api2) {
- let callback = {
- url: this.to,
- success: (res) => {
- this.$emit("click", {
- data: res
- });
- },
- fail: (err) => {
- this.$emit("click", {
- data: err
- });
- }
- };
- switch (api2) {
- case "navigateTo":
- uni.navigateTo(callback);
- break;
- case "redirectTo":
- uni.redirectTo(callback);
- break;
- case "reLaunch":
- uni.reLaunch(callback);
- break;
- case "switchTab":
- uni.switchTab(callback);
- break;
- default:
- uni.navigateTo(callback);
- }
- }
- }
- };
- function _sfc_render$2F(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- const _component_uni_badge = resolveEasycom(vue.resolveDynamicComponent("uni-badge"), __easycom_0$j);
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass([{ "uni-list-item--disabled": $props.disabled }, "uni-list-item"]),
- "hover-class": !$props.clickable && !$props.link || $props.disabled || $props.showSwitch ? "" : "uni-list-item--hover",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.onClick && $options.onClick(...args))
- }, [
- !$data.isFirstChild ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["border--left", { "uni-list--border": $props.border }])
- },
- null,
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-list-item__container", { "container--right": $props.showArrow || $props.link, "flex--direction": $props.direction === "column" }])
- },
- [
- vue.renderSlot(_ctx.$slots, "header", {}, () => [
- vue.createElementVNode("view", { class: "uni-list-item__header" }, [
- $props.thumb ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-list-item__icon"
- }, [
- vue.createElementVNode("image", {
- src: $props.thumb,
- class: vue.normalizeClass(["uni-list-item__icon-img", ["uni-list--" + $props.thumbSize]])
- }, null, 10, ["src"])
- ])) : $props.showExtraIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-list-item__icon"
- }, [
- vue.createVNode(_component_uni_icons, {
- color: $props.extraIcon.color,
- size: $props.extraIcon.size,
- type: $props.extraIcon.type
- }, null, 8, ["color", "size", "type"])
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ], true),
- vue.renderSlot(_ctx.$slots, "body", {}, () => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-list-item__content", { "uni-list-item__content--center": $props.thumb || $props.showExtraIcon || $props.showBadge || $props.showSwitch }])
- },
- [
- $props.title ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["uni-list-item__content-title", [$props.ellipsis !== 0 && $props.ellipsis <= 2 ? "uni-ellipsis-" + $props.ellipsis : ""]])
- },
- vue.toDisplayString($props.title),
- 3
- /* TEXT, CLASS */
- )) : vue.createCommentVNode("v-if", true),
- $props.note ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "uni-list-item__content-note"
- },
- vue.toDisplayString($props.note),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- )
- ], true),
- vue.renderSlot(_ctx.$slots, "footer", {}, () => [
- $props.rightText || $props.showBadge || $props.showSwitch ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uni-list-item__extra", { "flex--justify": $props.direction === "column" }])
- },
- [
- $props.rightText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "uni-list-item__extra-text"
- },
- vue.toDisplayString($props.rightText),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $props.showBadge ? (vue.openBlock(), vue.createBlock(_component_uni_badge, {
- key: 1,
- type: $props.badgeType,
- text: $props.badgeText,
- "custom-style": $props.badgeStyle
- }, null, 8, ["type", "text", "custom-style"])) : vue.createCommentVNode("v-if", true),
- $props.showSwitch ? (vue.openBlock(), vue.createElementBlock("switch", {
- key: 2,
- disabled: $props.disabled,
- checked: $props.switchChecked,
- onChange: _cache[0] || (_cache[0] = (...args) => $options.onSwitchChange && $options.onSwitchChange(...args))
- }, null, 40, ["disabled", "checked"])) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ],
- 2
- /* CLASS */
- ),
- $props.showArrow || $props.link ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
- key: 1,
- size: 16,
- class: "uni-icon-wrapper",
- color: "#bbb",
- type: "arrowright"
- })) : vue.createCommentVNode("v-if", true)
- ], 10, ["hover-class"]);
- }
- const __easycom_0$i = /* @__PURE__ */ _export_sfc(_sfc_main$2G, [["render", _sfc_render$2F], ["__scopeId", "data-v-c7524739"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue"]]);
- const _sfc_main$2F = {
- name: "uniList",
- "mp-weixin": {
- options: {
- multipleSlots: false
- }
- },
- props: {
- enableBackToTop: {
- type: [Boolean, String],
- default: false
- },
- scrollY: {
- type: [Boolean, String],
- default: false
- },
- border: {
- type: Boolean,
- default: true
- }
- },
- // provide() {
- // return {
- // list: this
- // };
- // },
- created() {
- this.firstChildAppend = false;
- },
- methods: {
- loadMore(e2) {
- this.$emit("scrolltolower");
- }
- }
- };
- function _sfc_render$2E(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-list uni-border-top-bottom" }, [
- $props.border ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-list--border-top"
- })) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- $props.border ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-list--border-bottom"
- })) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_1$6 = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["render", _sfc_render$2E], ["__scopeId", "data-v-c2f1266a"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-list/components/uni-list/uni-list.vue"]]);
- const _sfc_main$2E = {
- __name: "s-menu-list",
- props: {
- data: {
- type: Object,
- default: () => ({})
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2D(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_list_item = resolveEasycom(vue.resolveDynamicComponent("uni-list-item"), __easycom_0$i);
- const _component_uni_list = resolveEasycom(vue.resolveDynamicComponent("uni-list"), __easycom_1$6);
- return vue.openBlock(), vue.createElementBlock("view", { class: "menu-list-wrap" }, [
- vue.createVNode(_component_uni_list, { border: true }, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.data.list, (item, index2) => {
- return vue.openBlock(), vue.createBlock(_component_uni_list_item, {
- key: index2,
- showArrow: "",
- clickable: "",
- onClick: ($event) => $setup.sheep.$router.go(item.url)
- }, {
- header: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- item.iconUrl ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "list-icon",
- src: $setup.sheep.$url.cdn(item.iconUrl),
- mode: "aspectFit"
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "title-text ss-flex ss-row-center ss-col-center ss-m-l-20",
- style: vue.normalizeStyle([{ color: item.titleColor }])
- },
- vue.toDisplayString(item.title),
- 5
- /* TEXT, STYLE */
- )
- ])
- ]),
- footer: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "notice-text ss-flex ss-row-center ss-col-center",
- style: vue.normalizeStyle([{ color: item.subtitleColor }])
- },
- vue.toDisplayString(item.subtitle),
- 5
- /* TEXT, STYLE */
- )
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- })
- ]);
- }
- const __easycom_3$6 = /* @__PURE__ */ _export_sfc(_sfc_main$2E, [["render", _sfc_render$2D], ["__scopeId", "data-v-6033b256"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-menu-list/s-menu-list.vue"]]);
- const _sfc_main$2D = {
- name: "UniGridItem",
- inject: ["grid"],
- props: {
- index: {
- type: Number,
- default: 0
- }
- },
- data() {
- return {
- column: 0,
- showBorder: true,
- square: true,
- highlight: true,
- left: 0,
- top: 0,
- openNum: 2,
- width: 0,
- borderColor: "#e5e5e5"
- };
- },
- created() {
- this.column = this.grid.column;
- this.showBorder = this.grid.showBorder;
- this.square = this.grid.square;
- this.highlight = this.grid.highlight;
- this.top = this.hor === 0 ? this.grid.hor : this.hor;
- this.left = this.ver === 0 ? this.grid.ver : this.ver;
- this.borderColor = this.grid.borderColor;
- this.grid.children.push(this);
- this.width = this.grid.width;
- },
- beforeDestroy() {
- this.grid.children.forEach((item, index2) => {
- if (item === this) {
- this.grid.children.splice(index2, 1);
- }
- });
- },
- methods: {
- _onClick() {
- this.grid.change({
- detail: {
- index: this.index
- }
- });
- }
- }
- };
- function _sfc_render$2C(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle("width:" + $data.width + ";" + ($data.square ? "height:" + $data.width : "")),
- class: "uni-grid-item grid-item"
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([{
- "uni-grid-item--border": $data.showBorder,
- "uni-grid-item--border-top": $data.showBorder && $props.index < $data.column,
- "uni-highlight": $data.highlight
- }, "uni-grid-item__box"]),
- style: vue.normalizeStyle({
- "border-right-color": $data.borderColor,
- "border-bottom-color": $data.borderColor,
- "border-top-color": $data.borderColor
- }),
- onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- )
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_0$h = /* @__PURE__ */ _export_sfc(_sfc_main$2D, [["render", _sfc_render$2C], ["__scopeId", "data-v-7a807eb7"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue"]]);
- const _sfc_main$2C = {
- name: "UniGrid",
- emits: ["change"],
- props: {
- // 每列显示个数
- column: {
- type: Number,
- default: 3
- },
- // 是否显示边框
- showBorder: {
- type: Boolean,
- default: true
- },
- // 边框颜色
- borderColor: {
- type: String,
- default: "#D2D2D2"
- },
- // 是否正方形显示,默认为 true
- square: {
- type: Boolean,
- default: true
- },
- highlight: {
- type: Boolean,
- default: true
- }
- },
- provide() {
- return {
- grid: this
- };
- },
- data() {
- const elId = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
- return {
- elId,
- width: 0
- };
- },
- created() {
- this.children = [];
- },
- mounted() {
- this.$nextTick(() => {
- this.init();
- });
- },
- methods: {
- init() {
- setTimeout(() => {
- this._getSize((width) => {
- this.children.forEach((item, index2) => {
- item.width = width;
- });
- });
- }, 50);
- },
- change(e2) {
- this.$emit("change", e2);
- },
- _getSize(fn) {
- uni.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((ret) => {
- this.width = parseInt((ret[0].width - 1) / this.column) + "px";
- fn(this.width);
- });
- }
- }
- };
- function _sfc_render$2B(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-grid-wrap" }, [
- vue.createElementVNode("view", {
- id: $data.elId,
- ref: "uni-grid",
- class: vue.normalizeClass(["uni-grid", { "uni-grid--border": $props.showBorder }]),
- style: vue.normalizeStyle({ "border-left-color": $props.borderColor })
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ], 14, ["id"])
- ]);
- }
- const __easycom_1$5 = /* @__PURE__ */ _export_sfc(_sfc_main$2C, [["render", _sfc_render$2B], ["__scopeId", "data-v-07acefee"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-grid/components/uni-grid/uni-grid.vue"]]);
- const _sfc_main$2B = {
- __name: "s-menu-grid",
- props: {
- data: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const initData = vue.ref([]);
- vue.watch(
- () => props.data.list,
- (newList) => {
- if (Array.isArray(newList) && newList.length > 0) {
- initData.value = newList.map((item) => ({
- ...item,
- isVisible: item.title === "商户入驻" ? false : item.isVisible !== void 0 ? item.isVisible : true
- }));
- } else {
- initData.value = [];
- }
- },
- { immediate: true }
- );
- vue.onMounted(() => {
- try {
- UserApi.getUserInfo().then((res) => {
- const userInfo2 = res.data;
- if (userInfo2 == null ? void 0 : userInfo2.agent) {
- const targetIndex = initData.value.findIndex(
- (item) => item.title === "商户入驻"
- );
- if (targetIndex !== -1) {
- const updatedItem = {
- ...initData.value[targetIndex],
- isVisible: true
- };
- initData.value.splice(targetIndex, 1, updatedItem);
- }
- }
- }).catch((error2) => {
- formatAppLog("error", "at sheep/components/s-menu-grid/s-menu-grid.vue:92", "获取用户信息时发生错误:", error2);
- });
- } catch (error2) {
- formatAppLog("log", "at sheep/components/s-menu-grid/s-menu-grid.vue:95", error2);
- }
- });
- const __returned__ = { props, initData, get sheep() {
- return sheep$1;
- }, get UserApi() {
- return UserApi;
- }, ref: vue.ref, watch: vue.watch, onMounted: vue.onMounted };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2A(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_grid_item = resolveEasycom(vue.resolveDynamicComponent("uni-grid-item"), __easycom_0$h);
- const _component_uni_grid = resolveEasycom(vue.resolveDynamicComponent("uni-grid"), __easycom_1$5);
- return $setup.initData && $setup.initData.length > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_grid, {
- key: 0,
- showBorder: Boolean($props.data.border),
- column: $props.data.column
- }, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.initData, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- item.isVisible ? (vue.openBlock(), vue.createBlock(_component_uni_grid_item, {
- key: index2,
- onClick: ($event) => $setup.sheep.$router.go(item.url)
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "grid-item-box ss-flex ss-flex-col ss-row-center ss-col-center" }, [
- vue.createElementVNode("view", { class: "img-box" }, [
- item.badge.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "tag-box",
- style: vue.normalizeStyle([{ background: item.badge.bgColor, color: item.badge.textColor }])
- },
- vue.toDisplayString(item.badge.text),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("image", {
- class: "menu-image",
- src: $setup.sheep.$url.cdn(item.iconUrl)
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "title-box ss-flex ss-flex-col ss-row-center ss-col-center" }, [
- vue.createElementVNode(
- "view",
- {
- class: "grid-text",
- style: vue.normalizeStyle([{ color: item.titleColor }])
- },
- vue.toDisplayString(item.title),
- 5
- /* TEXT, STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "grid-tip",
- style: vue.normalizeStyle([{ color: item.subtitleColor }])
- },
- vue.toDisplayString(item.subtitle),
- 5
- /* TEXT, STYLE */
- )
- ])
- ])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }),
- 256
- /* UNKEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["showBorder", "column"])) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_4$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2B, [["render", _sfc_render$2A], ["__scopeId", "data-v-1aac7574"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-menu-grid/s-menu-grid.vue"]]);
- const _sfc_main$2A = {
- __name: "s-popup-image",
- props: {
- data: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const modalStore = JSON.parse(uni.getStorageSync("modal-store") || "{}");
- formatAppLog("log", "at sheep/components/s-popup-image/s-popup-image.vue:42", modalStore);
- const advHistory = modalStore.advHistory || [];
- const currentIndex = vue.ref(0);
- const popupList = vue.computed(() => {
- const list = props.data.list || [];
- const newList = [];
- if (list.length > 0) {
- list.forEach((adv) => {
- if (adv.showType === "once" && advHistory.includes(adv.imgUrl)) {
- adv.isShow = false;
- } else {
- adv.isShow = true;
- newList.push(adv);
- }
- saveAdvHistory(adv);
- });
- }
- return newList;
- });
- function onPopup(path) {
- sheep$1.$router.go(path);
- }
- function onClose(index2) {
- currentIndex.value = index2 + 1;
- popupList.value[index2].isShow = false;
- }
- const __returned__ = { props, modalStore, advHistory, currentIndex, popupList, onPopup, onClose, get sheep() {
- return sheep$1;
- }, computed: vue.computed, ref: vue.ref, get saveAdvHistory() {
- return saveAdvHistory;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2z(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.popupList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
- index2 === $setup.currentIndex ? (vue.openBlock(), vue.createBlock(_component_su_popup, {
- key: 0,
- show: item.isShow,
- type: "center",
- backgroundColor: "none",
- round: "0",
- showClose: true,
- isMaskClick: false,
- onClose: ($event) => $setup.onClose(index2)
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "img-box" }, [
- vue.createElementVNode("image", {
- class: "modal-img",
- src: $setup.sheep.$url.cdn(item.imgUrl),
- mode: "widthFix",
- onClick: vue.withModifiers(($event) => $setup.onPopup(item.url), ["stop"])
- }, null, 8, ["src", "onClick"])
- ])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["show", "onClose"])) : vue.createCommentVNode("v-if", true)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }
- const __easycom_5$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2A, [["render", _sfc_render$2z], ["__scopeId", "data-v-ef138843"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-popup-image/s-popup-image.vue"]]);
- sheep$1.$platform.device;
- let platform$2 = "other";
- const _sfc_main$2z = {
- name: "UniFab",
- emits: ["fabClick", "trigger"],
- props: {
- pattern: {
- type: Array,
- default() {
- return [];
- }
- },
- horizontal: {
- type: String,
- default: "left"
- },
- vertical: {
- type: String,
- default: "bottom"
- },
- direction: {
- type: String,
- default: "horizontal"
- },
- content: {
- type: Array,
- default() {
- return [];
- }
- },
- show: {
- type: Boolean,
- default: false
- },
- popMenu: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {
- fabShow: false,
- isShow: false,
- isAndroidNvue: platform$2 === "android",
- styles: [
- {
- // color: '#3c3e49',
- // selectedColor: '#007AFF',
- // backgroundColor: '#fff',
- // buttonColor: '#007AFF',
- // iconColor: '#fff'
- }
- ]
- };
- },
- computed: {
- contentWidth(e2) {
- return (this.content.length + 1) * 130 + "rpx";
- },
- contentWidthMin() {
- return "100rpx";
- },
- // 动态计算宽度
- boxWidth() {
- return this.getPosition(3, "horizontal");
- },
- // 动态计算高度
- boxHeight() {
- return this.getPosition(3, "vertical");
- },
- // 计算左下位置
- leftBottom() {
- return this.getPosition(0, "left", "bottom");
- },
- // 计算右下位置
- rightBottom() {
- return this.getPosition(0, "right", "bottom");
- },
- // 计算左上位置
- leftTop() {
- return this.getPosition(0, "left", "top");
- },
- rightTop() {
- return this.getPosition(0, "right", "top");
- },
- flexDirectionStart() {
- return this.getPosition(1, "vertical", "top");
- },
- flexDirectionEnd() {
- return this.getPosition(1, "vertical", "bottom");
- },
- horizontalLeft() {
- return this.getPosition(2, "horizontal", "left");
- },
- horizontalRight() {
- return this.getPosition(2, "horizontal", "right");
- }
- },
- watch: {
- // pattern: {
- // handler(val, oldVal) {
- // this.styles = Object.assign({}, this.styles, val)
- // },
- // deep: true
- // }
- },
- created() {
- this.isShow = this.show;
- if (this.top === 0) {
- this.fabShow = true;
- }
- },
- methods: {
- _onClick() {
- this.$emit("fabClick");
- if (!this.popMenu) {
- return;
- }
- this.isShow = !this.isShow;
- },
- open() {
- this.isShow = true;
- },
- close() {
- this.isShow = false;
- },
- /**
- * 按钮点击事件
- */
- _onItemClick(index2, item) {
- this.$emit("trigger", {
- index: index2,
- item
- });
- },
- /**
- * 获取 位置信息
- */
- getPosition(types2, paramA, paramB) {
- if (types2 === 0) {
- return this.horizontal === paramA && this.vertical === paramB;
- } else if (types2 === 1) {
- return this.direction === paramA && this.vertical === paramB;
- } else if (types2 === 2) {
- return this.direction === paramA && this.horizontal === paramB;
- } else {
- return this.isShow && this.direction === paramA ? this.contentWidth : this.contentWidthMin;
- }
- }
- }
- };
- function _sfc_render$2y(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-cursor-point" }, [
- $props.popMenu && ($options.leftBottom || $options.rightBottom || $options.leftTop || $options.rightTop) && $props.content.length > 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass([{
- "uni-fab--leftBottom": $options.leftBottom,
- "uni-fab--rightBottom": $options.rightBottom,
- "uni-fab--leftTop": $options.leftTop,
- "uni-fab--rightTop": $options.rightTop
- }, "uni-fab"])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([{
- "uni-fab__content--left": $props.horizontal === "left",
- "uni-fab__content--right": $props.horizontal === "right",
- "uni-fab__content--flexDirection": $props.direction === "vertical",
- "uni-fab__content--flexDirectionStart": $options.flexDirectionStart,
- "uni-fab__content--flexDirectionEnd": $options.flexDirectionEnd,
- "uni-fab__content--other-platform": !$data.isAndroidNvue
- }, "uni-fab__content"]),
- style: vue.normalizeStyle({ width: $options.boxWidth, height: $options.boxHeight }),
- elevation: "5"
- },
- [
- $options.flexDirectionStart || $options.horizontalLeft ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-fab__item uni-fab__item--first"
- })) : vue.createCommentVNode("v-if", true),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.content, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: vue.normalizeClass([{
- "uni-fab__item--active": $data.isShow,
- "horizontal-margin": $props.direction == "horizontal"
- }, "uni-fab__item"]),
- onClick: ($event) => $options._onItemClick(index2, item)
- }, [
- vue.createElementVNode("image", {
- src: item.active ? item.selectedIconPath : item.iconPath,
- class: "uni-fab__item-image",
- mode: "aspectFit"
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["uni-fab__item-text", { "vertical-margin": $props.direction == "vertical" }]),
- style: vue.normalizeStyle({ color: $props.pattern[index2].color })
- },
- vue.toDisplayString(item.text),
- 7
- /* TEXT, CLASS, STYLE */
- )
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- $options.flexDirectionEnd || $options.horizontalRight ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-fab__item uni-fab__item--first"
- })) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([{
- "uni-fab__circle--leftBottom": $options.leftBottom,
- "uni-fab__circle--rightBottom": $options.rightBottom,
- "uni-fab__circle--leftTop": $options.leftTop,
- "uni-fab__circle--rightTop": $options.rightTop,
- "uni-fab__content--other-platform": !$data.isAndroidNvue
- }, "uni-fab__circle uni-fab__plus"]),
- style: vue.normalizeStyle({ "background-color": "var(--ui-BG-Main)" }),
- onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
- },
- [
- vue.createVNode(_component_uni_icons, {
- class: vue.normalizeClass(["fab-circle-icon", { "uni-fab__plus--active": $data.isShow && $props.content.length > 0 }]),
- type: "plusempty",
- color: "#fff",
- size: "20"
- }, null, 8, ["class"]),
- vue.createCommentVNode(` <view class="fab-circle-v" :class="{'uni-fab__plus--active': isShow && content.length > 0}"></view>
- <view class="fab-circle-h" :class="{'uni-fab__plus--active': isShow && content.length > 0}"></view> `)
- ],
- 6
- /* CLASS, STYLE */
- )
- ]);
- }
- const __easycom_0$g = /* @__PURE__ */ _export_sfc(_sfc_main$2z, [["render", _sfc_render$2y], ["__scopeId", "data-v-85f34dfc"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-fab/components/uni-fab/uni-fab.vue"]]);
- const _sfc_main$2y = {
- __name: "s-float-menu",
- props: {
- data: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- var _a2;
- __expose();
- const props = __props;
- const state = vue.reactive({
- // 可选样式配置项
- pattern: [],
- // 展开菜单内容配置项
- content: [],
- // 展开菜单显示方式:horizontal-水平显示,vertical-垂直显示
- direction: ""
- });
- const fabRef = vue.ref(null);
- state.direction = props.data.direction;
- (_a2 = props.data) == null ? void 0 : _a2.list.forEach((item) => {
- var _a3;
- const text = ((_a3 = props.data) == null ? void 0 : _a3.showText) ? item.text : "";
- state.content.push({ iconPath: sheep$1.$url.cdn(item.imgUrl), url: item.url, text });
- state.pattern.push({ color: item.textColor });
- });
- function handleOpenLink(e2) {
- sheep$1.$router.go(e2.item.url);
- }
- function handleCollapseFab() {
- var _a3, _b2;
- if ((_a3 = vue.unref(fabRef)) == null ? void 0 : _a3.isShow) {
- (_b2 = vue.unref(fabRef)) == null ? void 0 : _b2.close();
- }
- }
- onBackPress(() => {
- var _a3, _b2;
- if ((_a3 = vue.unref(fabRef)) == null ? void 0 : _a3.isShow) {
- (_b2 = vue.unref(fabRef)) == null ? void 0 : _b2.close();
- return true;
- }
- return false;
- });
- const __returned__ = { props, state, fabRef, handleOpenLink, handleCollapseFab, get sheep() {
- return sheep$1;
- }, reactive: vue.reactive, ref: vue.ref, unref: vue.unref, get onBackPress() {
- return onBackPress;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2x(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2;
- const _component_uni_fab = resolveEasycom(vue.resolveDynamicComponent("uni-fab"), __easycom_0$g);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 模态背景:展开时显示,点击后折叠 "),
- ((_a2 = $setup.fabRef) == null ? void 0 : _a2.isShow) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "modal-bg",
- onClick: $setup.handleCollapseFab
- })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 悬浮按钮 "),
- vue.createVNode(_component_uni_fab, {
- ref: "fabRef",
- horizontal: "right",
- vertical: "bottom",
- direction: $setup.state.direction,
- pattern: $setup.state.pattern,
- content: $setup.state.content,
- onTrigger: $setup.handleOpenLink
- }, null, 8, ["direction", "pattern", "content"])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const __easycom_6 = /* @__PURE__ */ _export_sfc(_sfc_main$2y, [["render", _sfc_render$2x], ["__scopeId", "data-v-4cc25f94"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-float-menu/s-float-menu.vue"]]);
- const _sfc_main$2x = {
- __name: "su-image",
- props: {
- src: {
- type: String,
- default: ""
- },
- errorSrc: {
- type: String,
- default: "/static/img/shop/empty_network.png"
- },
- mode: {
- type: String,
- default: "widthFix"
- },
- isPreview: {
- type: Boolean,
- default: false
- },
- previewList: {
- type: Array,
- default() {
- return [];
- }
- },
- current: {
- type: Number,
- default: -1
- },
- height: {
- type: Number,
- default: 0
- },
- width: {
- type: Number,
- default: 0
- },
- radius: {
- type: Number,
- default: 0
- }
- },
- emits: ["load", "error"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const state = vue.reactive({
- isError: false,
- imgHeight: 600
- });
- const props = __props;
- const emits = __emit;
- const customStyle = vue.computed(() => {
- return {
- height: (props.height || state.imgHeight) + "rpx",
- width: props.width ? props.width + "rpx" : "100%",
- borderRadius: props.radius ? props.radius + "rpx" : ""
- };
- });
- function onImgLoad(e2) {
- if (props.height === 0) {
- state.imgHeight = e2.detail.height / e2.detail.width * 750;
- }
- }
- function onImgError(e2) {
- state.isError = true;
- emits("error", e2);
- }
- function onImgPreview() {
- if (!props.isPreview)
- return;
- uni.previewImage({
- urls: props.previewList.length < 1 ? [props.src] : props.previewList,
- current: props.current,
- longPressActions: {
- itemList: ["发送给朋友", "保存图片", "收藏"],
- success: function(data) {
- formatAppLog("log", "at sheep/ui/su-image/su-image.vue:113", "选中了第" + (data.tapIndex + 1) + "个按钮,第" + (data.index + 1) + "张图片");
- },
- fail: function(err) {
- formatAppLog("log", "at sheep/ui/su-image/su-image.vue:116", err.errMsg);
- }
- }
- });
- }
- const __returned__ = { state, props, emits, customStyle, onImgLoad, onImgError, onImgPreview, reactive: vue.reactive, computed: vue.computed, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2w(_ctx, _cache, $props, $setup, $data, $options) {
- return !$setup.state.isError ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "su-img",
- style: vue.normalizeStyle($setup.customStyle),
- draggable: false,
- mode: $props.mode,
- src: $setup.sheep.$url.cdn($props.src),
- onClick: $setup.onImgPreview,
- onLoad: $setup.onImgLoad,
- onError: $setup.onImgError
- }, null, 44, ["mode", "src"])) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0$f = /* @__PURE__ */ _export_sfc(_sfc_main$2x, [["render", _sfc_render$2w], ["__scopeId", "data-v-ed9e576c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-image/su-image.vue"]]);
- const _sfc_main$2w = {
- __name: "s-image-block",
- props: {
- data: {
- type: Object,
- default: () => ({})
- },
- styles: {
- type: Object,
- default: () => ({})
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2v(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_image = resolveEasycom(vue.resolveDynamicComponent("su-image"), __easycom_0$f);
- return vue.openBlock(), vue.createElementBlock("view", {
- onClick: _cache[0] || (_cache[0] = ($event) => {
- var _a2;
- return $setup.sheep.$router.go((_a2 = $props.data) == null ? void 0 : _a2.url);
- })
- }, [
- vue.createVNode(_component_su_image, {
- src: $setup.sheep.$url.cdn($props.data.imgUrl),
- mode: "widthFix"
- }, null, 8, ["src"])
- ]);
- }
- const __easycom_7 = /* @__PURE__ */ _export_sfc(_sfc_main$2w, [["render", _sfc_render$2v], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-image-block/s-image-block.vue"]]);
- const _sfc_main$2v = {
- __name: "s-title-block",
- props: {
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- typeMap: {
- left: "ss-row-left",
- center: "ss-row-center"
- }
- });
- const props = __props;
- const elStyles = {
- background: `url(${sheep$1.$url.cdn(props.data.bgImgUrl)}) no-repeat top center / 100% auto`,
- fontSize: `${props.data.titleSize}px`,
- fontWeight: `${props.data.titleWeight}px`
- };
- const titleStyles = {
- color: props.data.titleColor,
- fontSize: `${props.data.titleSize}px`,
- textAlign: props.data.textAlign
- };
- const descStyles = {
- color: props.data.descriptionColor,
- textAlign: props.data.textAlign,
- fontSize: `${props.data.descriptionSize}px`,
- fontWeight: `${props.data.descriptionWeight}px`
- };
- const __returned__ = { state, props, elStyles, titleStyles, descStyles, reactive: vue.reactive, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2u(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["ss-title-wrap ss-flex ss-col-center", [$setup.state.typeMap[$props.data.textAlign]]]),
- style: vue.normalizeStyle([$setup.elStyles])
- },
- [
- vue.createElementVNode("view", { class: "title-content" }, [
- vue.createCommentVNode(" 主标题 "),
- $props.data.title ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "title-text",
- style: vue.normalizeStyle([$setup.titleStyles])
- },
- vue.toDisplayString($props.data.title),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 副标题 "),
- $props.data.description ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- style: vue.normalizeStyle([$setup.descStyles]),
- class: "sub-title-text"
- },
- vue.toDisplayString($props.data.description),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createCommentVNode(" 查看更多 "),
- ((_a2 = $props.data.more) == null ? void 0 : _a2.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "more-box ss-flex ss-col-center",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go($props.data.more.url)),
- style: vue.normalizeStyle({ color: $props.data.descriptionColor })
- },
- [
- $props.data.more.type !== "icon" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "more-text"
- },
- vue.toDisplayString($props.data.more.text),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $props.data.more.type !== "text" ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- class: "_icon-forward"
- })) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_9 = /* @__PURE__ */ _export_sfc(_sfc_main$2v, [["render", _sfc_render$2u], ["__scopeId", "data-v-2879f4b7"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-title-block/s-title-block.vue"]]);
- const _sfc_main$2u = {
- __name: "s-image-cube",
- props: {
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const windowWidth2 = sheep$1.$platform.device.windowWidth;
- const cell = vue.computed(() => {
- return (windowWidth2 - ((props.styles.marginLeft || 0) + (props.styles.marginRight || 0) + (props.styles.padding || 0) * 2)) / 4;
- });
- const parseAdWrap = vue.computed(() => {
- var _a2, _b2, _c, _d;
- let heightArr = props.data.list.reduce(
- (prev, cur) => prev.includes(cur.height + cur.top) ? prev : [...prev, cur.height + cur.top],
- []
- );
- let heightMax = Math.max(...heightArr);
- return {
- height: heightMax * cell.value + "px",
- width: windowWidth2 - (((_b2 = (_a2 = props.data) == null ? void 0 : _a2.style) == null ? void 0 : _b2.marginLeft) + ((_d = (_c = props.data) == null ? void 0 : _c.style) == null ? void 0 : _d.marginRight) + props.styles.padding * 2) * 2 + "px"
- };
- });
- const parseImgStyle = (item) => {
- let obj = {
- width: item.width * cell.value - props.data.space + "px",
- height: item.height * cell.value - props.data.space + "px",
- left: item.left * cell.value + "px",
- top: item.top * cell.value + "px",
- "border-top-left-radius": props.data.borderRadiusTop + "px",
- "border-top-right-radius": props.data.borderRadiusTop + "px",
- "border-bottom-left-radius": props.data.borderRadiusBottom + "px",
- "border-bottom-right-radius": props.data.borderRadiusBottom + "px"
- };
- return obj;
- };
- const __returned__ = { props, windowWidth: windowWidth2, cell, parseAdWrap, parseImgStyle, computed: vue.computed, inject: vue.inject, unref: vue.unref, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2t(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "ss-cube-wrap",
- style: vue.normalizeStyle([$setup.parseAdWrap])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.data.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
- vue.createElementVNode("view", {
- class: "cube-img-wrap",
- style: vue.normalizeStyle([$setup.parseImgStyle(item), { margin: $props.data.space + "px" }]),
- onClick: ($event) => $setup.sheep.$router.go(item.url)
- }, [
- vue.createElementVNode("image", {
- class: "cube-img",
- src: $setup.sheep.$url.cdn(item.imgUrl),
- mode: "aspectFill"
- }, null, 8, ["src"])
- ], 12, ["onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_10 = /* @__PURE__ */ _export_sfc(_sfc_main$2u, [["render", _sfc_render$2t], ["__scopeId", "data-v-c67133d8"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-image-cube/s-image-cube.vue"]]);
- const _sfc_main$2t = {
- __name: "s-video-block",
- props: {
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- }, get guid() {
- return guid;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2s(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_video = resolveEasycom(vue.resolveDynamicComponent("su-video"), __easycom_0$t);
- return vue.openBlock(), vue.createBlock(_component_su_video, {
- class: "sss",
- uid: $setup.guid(),
- src: $setup.sheep.$url.cdn($props.data.videoUrl),
- poster: $setup.sheep.$url.cdn($props.data.posterUrl),
- height: $props.styles.height * 2,
- autoplay: $props.data.autoplay
- }, null, 8, ["uid", "src", "poster", "height", "autoplay"]);
- }
- const __easycom_11 = /* @__PURE__ */ _export_sfc(_sfc_main$2t, [["render", _sfc_render$2s], ["__scopeId", "data-v-33d06052"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-video-block/s-video-block.vue"]]);
- const _sfc_main$2s = {
- __name: "su-subline",
- props: {
- // 线条颜色
- lineColor: {
- type: String,
- default: "#000"
- },
- // 线条样式:'dotted', 'solid', 'double', 'dashed'
- borderType: {
- type: String,
- default: "dashed"
- },
- // 线条宽度
- lineWidth: {
- type: Number,
- default: 1
- },
- // 高度
- height: {
- type: [Number, String],
- default: "auto"
- },
- // 左右边距:none - 无边距,horizontal - 左右留边
- paddingType: {
- type: String,
- default: "none"
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const elStyle = vue.computed(() => {
- return {
- "border-top-width": `${props.lineWidth}px`,
- "border-top-color": props.lineColor,
- "border-top-style": props.borderType,
- margin: props.paddingType === "none" ? "0" : "0px 16px"
- };
- });
- const __returned__ = { props, elStyle, computed: vue.computed };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2r(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "wrap",
- style: vue.normalizeStyle({ height: `${$props.height}px` })
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "divider",
- style: vue.normalizeStyle([$setup.elStyle])
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_0$e = /* @__PURE__ */ _export_sfc(_sfc_main$2s, [["render", _sfc_render$2r], ["__scopeId", "data-v-b2944841"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-subline/su-subline.vue"]]);
- const _sfc_main$2r = {
- __name: "s-line-block",
- props: {
- data: {
- type: Object,
- default: {}
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2q(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_subline = resolveEasycom(vue.resolveDynamicComponent("su-subline"), __easycom_0$e);
- return vue.openBlock(), vue.createBlock(
- _component_su_subline,
- vue.normalizeProps(vue.guardReactiveProps($props.data)),
- null,
- 16
- /* FULL_PROPS */
- );
- }
- const __easycom_12 = /* @__PURE__ */ _export_sfc(_sfc_main$2r, [["render", _sfc_render$2q], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-line-block/s-line-block.vue"]]);
- const _sfc_main$2q = {
- __name: "s-hotzone-block",
- props: {
- data: {
- type: Object,
- default: () => ({})
- },
- styles: {
- type: Object,
- default: () => ({})
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2p(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "hotzone-wrap" }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.cdn($props.data.imgUrl),
- style: { "width": "100%" },
- mode: "widthFix"
- }, null, 8, ["src"]),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.data.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "hotzone-box",
- key: index2,
- style: vue.normalizeStyle([
- {
- top: `${item.top}px`,
- left: `${item.left}px`,
- width: `${item.width}px`,
- height: `${item.height}px`
- }
- ]),
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go(item.url), ["stop"])
- }, null, 12, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }
- const __easycom_13 = /* @__PURE__ */ _export_sfc(_sfc_main$2q, [["render", _sfc_render$2p], ["__scopeId", "data-v-3db3354a"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-hotzone-block/s-hotzone-block.vue"]]);
- const _imports_0$6 = "/static/icon/points.png";
- const _sfc_main$2p = {
- __name: "s-goods-item",
- props: {
- img: {
- type: String,
- default: "https://img1.baidu.com/it/u=1601695551,235775011&fm=26&fmt=auto"
- },
- title: {
- type: String,
- default: ""
- },
- titleWidth: {
- type: Number,
- default: 0
- },
- skuText: {
- type: [String, Array],
- default: ""
- },
- price: {
- type: [String, Number],
- default: ""
- },
- priceColor: {
- type: [String],
- default: ""
- },
- num: {
- type: [String, Number],
- default: 0
- },
- score: {
- type: [String, Number],
- default: ""
- },
- radius: {
- type: [String],
- default: ""
- },
- marginBottom: {
- type: [String],
- default: ""
- },
- virtualPirce: {
- type: [Boolean],
- default: false
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const skuString = vue.computed(() => {
- if (!props.skuText) {
- return "";
- }
- if (typeof props.skuText === "object") {
- return props.skuText.join(",");
- }
- return props.skuText;
- });
- const __returned__ = { props, skuString, get sheep() {
- return sheep$1;
- }, computed: vue.computed, get fen2yuan() {
- return fen2yuan;
- }, get fen2yuan6() {
- return fen2yuan6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2o(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createElementVNode("view", null, [
- vue.renderSlot(_ctx.$slots, "top", {}, void 0, true)
- ]),
- vue.createElementVNode(
- "view",
- {
- class: "ss-order-card-warp ss-flex ss-col-stretch ss-row-between bg-white",
- style: vue.normalizeStyle([{ borderRadius: $props.radius + "rpx", marginBottom: $props.marginBottom + "rpx" }])
- },
- [
- vue.createElementVNode("view", { class: "img-box ss-m-r-24" }, [
- vue.createElementVNode("image", {
- class: "order-img",
- src: $setup.sheep.$url.cdn($props.img),
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode(
- "view",
- {
- class: "box-right ss-flex-col ss-row-between",
- style: vue.normalizeStyle([{ width: $props.titleWidth ? $props.titleWidth + "rpx" : "" }])
- },
- [
- $props.title ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "title-text ss-line-2"
- },
- vue.toDisplayString($props.title),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.skuString ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "spec-text ss-m-t-8 ss-m-b-12"
- },
- vue.toDisplayString($setup.skuString),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "groupon-box" }, [
- vue.renderSlot(_ctx.$slots, "groupon", {}, void 0, true)
- ]),
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createCommentVNode(' v-if="price && Number(price) > 0" '),
- vue.createElementVNode(
- "view",
- {
- class: "price-text ss-flex ss-col-center",
- style: vue.normalizeStyle([{ color: $props.priceColor }])
- },
- [
- $props.virtualPirce ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createElementVNode("image", {
- src: _imports_0$6,
- style: { "width": "30rpx", "height": "30rpx" }
- }),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.fen2yuan6($props.price)),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createTextVNode(
- "¥" + vue.toDisplayString($setup.fen2yuan($props.price)),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- ),
- $props.num ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "total-text ss-flex ss-col-center"
- },
- "x " + vue.toDisplayString($props.num),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "priceSuffix", {}, void 0, true)
- ])
- ]),
- vue.createElementVNode("view", { class: "tool-box" }, [
- vue.renderSlot(_ctx.$slots, "tool", {}, void 0, true)
- ]),
- vue.createElementVNode("view", null, [
- vue.renderSlot(_ctx.$slots, "rightBottom", {}, void 0, true)
- ])
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )
- ]);
- }
- const __easycom_3$5 = /* @__PURE__ */ _export_sfc(_sfc_main$2p, [["render", _sfc_render$2o], ["__scopeId", "data-v-8a2df41e"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-goods-item/s-goods-item.vue"]]);
- const _sfc_main$2o = {
- __name: "goods-collect",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "28ee79e9-sys_navBar": vue.unref(sys_navBar)
- }));
- const sys_navBar = sheep$1.$platform.navbar;
- const state = vue.reactive({
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 6
- },
- loadStatus: "",
- editMode: false,
- selectedCollectList: [],
- // 选中的 SPU 数组
- selectAll: false
- });
- async function getData() {
- state.loadStatus = "loading";
- const { code: code2, data } = await FavoriteApi.getFavoritePage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- const onSelect = (spuId) => {
- if (!state.selectedCollectList.includes(spuId)) {
- state.selectedCollectList.push(spuId);
- } else {
- state.selectedCollectList.splice(state.selectedCollectList.indexOf(spuId), 1);
- }
- state.selectAll = state.selectedCollectList.length === state.pagination.list.length;
- };
- const onSelectAll = () => {
- state.selectAll = !state.selectAll;
- if (!state.selectAll) {
- state.selectedCollectList = [];
- } else {
- state.selectedCollectList = state.pagination.list.map((item) => item.spuId);
- }
- };
- async function onCancel() {
- if (!state.selectedCollectList) {
- return;
- }
- for (const spuId of state.selectedCollectList) {
- await FavoriteApi.deleteFavorite(spuId);
- }
- state.editMode = false;
- state.selectedCollectList = [];
- state.selectAll = false;
- resetPagination(state.pagination);
- await getData();
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getData();
- }
- onReachBottom(() => {
- loadMore();
- });
- onLoad(() => {
- getData();
- });
- const __returned__ = { sys_navBar, state, getData, onSelect, onSelectAll, onCancel, loadMore, get sheep() {
- return sheep$1;
- }, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get _() {
- return _$1;
- }, get FavoriteApi() {
- return FavoriteApi;
- }, get resetPagination() {
- return resetPagination;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2n(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("common.favorite")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "cart-box ss-flex ss-flex-col ss-row-between" }, [
- vue.createCommentVNode(" 头部 "),
- vue.createElementVNode("view", { class: "cart-header ss-flex ss-col-center ss-row-between ss-p-x-30" }, [
- vue.createElementVNode("view", { class: "header-left ss-flex ss-col-center ss-font-26" }, [
- vue.createElementVNode(
- "text",
- { class: "goods-number ui-TC-Main ss-flex" },
- vue.toDisplayString(_ctx.$t("common.total_goods", { number: $setup.state.pagination.total })),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "header-right" }, [
- $setup.state.editMode && $setup.state.pagination.total ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.editMode = false)
- },
- vue.toDisplayString(_ctx.$t("common.cancel")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- !$setup.state.editMode && $setup.state.pagination.total ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-reset-button ui-TC-Main",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.state.editMode = true)
- },
- vue.toDisplayString(_ctx.$t("common.edit")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- vue.createCommentVNode(" 内容 "),
- vue.createElementVNode("view", { class: "cart-content" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "goods-box ss-r-10",
- key: item.id
- }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- $setup.state.editMode ? (vue.openBlock(), vue.createElementBlock("label", {
- key: 0,
- class: "check-box ss-flex ss-col-center ss-p-l-10",
- onClick: ($event) => $setup.onSelect(item.spuId)
- }, [
- vue.createElementVNode("radio", {
- checked: $setup.state.selectedCollectList.includes(item.spuId),
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- onClick: vue.withModifiers(($event) => $setup.onSelect(item.spuId), ["stop"])
- }, null, 8, ["checked", "onClick"])
- ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_s_goods_item, {
- title: item.spuName,
- img: item.picUrl,
- price: item.price,
- priceColor: "#FF3000",
- titleWidth: 400,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", {
- id: item.spuId
- })
- }, null, 8, ["title", "img", "price", "onClick"])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createCommentVNode(" 底部 "),
- vue.withDirectives(vue.createVNode(
- _component_su_fixed,
- {
- bottom: "",
- val: 0,
- placeholder: ""
- },
- {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom" }, [
- vue.createElementVNode("view", { class: "footer-left ss-flex ss-col-center" }, [
- vue.createElementVNode("label", {
- class: "check-box ss-flex ss-col-center ss-p-r-30",
- onClick: $setup.onSelectAll
- }, [
- vue.createElementVNode("radio", {
- checked: $setup.state.selectAll,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.7)" },
- onClick: vue.withModifiers($setup.onSelectAll, ["stop"])
- }, null, 8, ["checked"]),
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString(_ctx.$t("common.all")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode("view", { class: "footer-right" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button ui-BG-Main-Gradient pay-btn ss-font-28 ui-Shadow-Main",
- onClick: $setup.onCancel
- },
- vue.toDisplayString(_ctx.$t("common.delete")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- },
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.editMode]
- ])
- ]),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 0,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: "暂无收藏",
- icon: "/static/collect-empty.png"
- })) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserGoodsCollect = /* @__PURE__ */ _export_sfc(_sfc_main$2o, [["render", _sfc_render$2n], ["__scopeId", "data-v-28ee79e9"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/goods-collect.vue"]]);
- const _imports_1$3 = "/static/img/shop/tabbar/category2.png";
- const _sfc_main$2n = {
- __name: "s-goods-column",
- props: {
- goodsFields: {
- type: [Array, Object],
- default() {
- return {
- // 商品价格
- price: {
- show: true
- },
- // 库存
- stock: {
- show: true
- },
- // 商品名称
- name: {
- show: true
- },
- // 商品介绍
- introduction: {
- show: true
- },
- // 市场价
- promotionFee: {
- show: true
- },
- // 销量
- salesCount: {
- show: true
- }
- };
- }
- },
- tagStyle: {
- type: Object,
- default: {}
- },
- data: {
- type: Object,
- default: {}
- },
- size: {
- type: String,
- default: "sl"
- },
- background: {
- type: String,
- default: ""
- },
- topRadius: {
- type: Number,
- default: 0
- },
- bottomRadius: {
- type: Number,
- default: 0
- },
- titleWidth: {
- type: Number,
- default: 0
- },
- titleColor: {
- type: String,
- default: "#333"
- },
- priceColor: {
- type: String,
- default: ""
- },
- originPriceColor: {
- type: String,
- default: "#C4C4C4"
- },
- priceUnit: {
- type: String,
- default: "¥"
- },
- subTitleColor: {
- type: String,
- default: "#999999"
- },
- subTitleBackground: {
- type: String,
- default: ""
- },
- buttonShow: {
- type: Boolean,
- default: true
- },
- seckillTag: {
- type: Boolean,
- default: false
- },
- grouponTag: {
- type: Boolean,
- default: false
- }
- },
- emits: ["click", "getHeight"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const state = vue.reactive({});
- const props = __props;
- const elStyles = vue.computed(() => {
- return {
- background: props.background,
- "border-top-left-radius": props.topRadius + "px",
- "border-top-right-radius": props.topRadius + "px",
- "border-bottom-left-radius": props.bottomRadius + "px",
- "border-bottom-right-radius": props.bottomRadius + "px"
- };
- });
- const salesAndStock = vue.computed(() => {
- var _a2, _b2;
- let text = [];
- if ((_a2 = props.goodsFields.salesCount) == null ? void 0 : _a2.show) {
- text.push(formatSales(props.data.sales_show_type, props.data.salesCount));
- }
- if ((_b2 = props.goodsFields.stock) == null ? void 0 : _b2.show) {
- text.push(formatStock(props.data.stock_show_type, props.data.stock));
- }
- return text.join(" | ");
- });
- const emits = __emit;
- const onClick = () => {
- emits("click");
- };
- const {
- proxy
- } = vue.getCurrentInstance();
- const elId = `sheep_${Math.ceil(Math.random() * 1e6).toString(36)}`;
- function getGoodsPriceCardWH() {
- if (props.size === "md") {
- const view = uni.createSelectorQuery().in(proxy);
- view.select(`#${elId}`).fields({
- size: true,
- scrollOffset: true
- });
- view.exec((data) => {
- let totalHeight = 0;
- const goodsPriceCard = data[0];
- if (props.data.image_wh) {
- totalHeight = goodsPriceCard.width / props.data.image_wh.w * props.data.image_wh.h + goodsPriceCard.height;
- } else {
- totalHeight = goodsPriceCard.width;
- }
- emits("getHeight", totalHeight);
- });
- }
- }
- vue.onMounted(() => {
- vue.nextTick(() => {
- getGoodsPriceCardWH();
- });
- });
- const __returned__ = { state, props, elStyles, salesAndStock, emits, onClick, proxy, elId, getGoodsPriceCardWH, computed: vue.computed, reactive: vue.reactive, getCurrentInstance: vue.getCurrentInstance, onMounted: vue.onMounted, nextTick: vue.nextTick, get sheep() {
- return sheep$1;
- }, get fen2yuan() {
- return fen2yuan;
- }, get formatSales() {
- return formatSales;
- }, get fen2yuan6() {
- return fen2yuan6;
- }, get formatStock() {
- return formatStock;
- }, goodsCollectVue: PagesUserGoodsCollect, get isArray() {
- return lodashExports.isArray;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2m(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2, _b2, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s2, _t2, _u, _v, _w, _x, _y, _z, _A;
- return vue.openBlock(), vue.createElementBlock("view", { class: "ss-goods-wrap" }, [
- vue.createCommentVNode(" xs卡片:横向紧凑型,一行放两个,图片左内容右边 "),
- $props.size === "xs" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "xs-goods-card ss-flex ss-col-stretch",
- style: vue.normalizeStyle([$setup.elStyles]),
- onClick: $setup.onClick
- },
- [
- $props.tagStyle.show ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "tag-icon-box"
- }, [
- vue.createElementVNode("image", {
- class: "tag-icon",
- src: $setup.sheep.$url.cdn($props.tagStyle.src || $props.tagStyle.imgUrl)
- }, null, 8, ["src"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("image", {
- class: "xs-img-box",
- src: $setup.sheep.$url.cdn($props.data.image || $props.data.picUrl),
- mode: "aspectFit"
- }, null, 8, ["src"]),
- ((_a2 = $props.goodsFields.title) == null ? void 0 : _a2.show) || ((_b2 = $props.goodsFields.name) == null ? void 0 : _b2.show) || ((_c = $props.goodsFields.price) == null ? void 0 : _c.show) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "xs-goods-content ss-flex-col ss-row-around"
- }, [
- ((_d = $props.goodsFields.title) == null ? void 0 : _d.show) || ((_e2 = $props.goodsFields.name) == null ? void 0 : _e2.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "xs-goods-title ss-line-1",
- style: vue.normalizeStyle([{ color: $props.titleColor, width: $props.titleWidth ? $props.titleWidth + "rpx" : "" }])
- },
- vue.toDisplayString($props.data.title || $props.data.name),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- ((_f = $props.goodsFields.price) == null ? void 0 : _f.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "xs-goods-price ss-flex",
- style: vue.normalizeStyle([{ color: $props.goodsFields.price.color }])
- },
- [
- $props.data.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- class: "ss-m-r-10",
- style: { "width": "40rpx", "height": "40rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- $props.data.highPrecision ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 2 },
- vue.toDisplayString($setup.isArray($props.data.highPrecisionPrice) ? $setup.fen2yuan6($props.data.highPrecisionPrice[0]) : $setup.fen2yuan6($props.data.highPrecisionPrice)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 3 },
- vue.toDisplayString($setup.isArray($props.data.price) ? $setup.fen2yuan($props.data.price[0]) : $setup.fen2yuan($props.data.price)),
- 1
- /* TEXT */
- )),
- vue.createCommentVNode(' <text class="price-unit ss-font-24">{{ priceUnit }}</text> ')
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", null, [
- $props.data.promotionFee >= 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "origin-price-text"
- },
- vue.toDisplayString(_ctx.$t("common.points")) + ":" + vue.toDisplayString($setup.fen2yuan($props.data.promotionFee)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" sm卡片:竖向紧凑,一行放三个,图上内容下 "),
- $props.size === "sm" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "sm-goods-card ss-flex-col",
- style: vue.normalizeStyle([$setup.elStyles]),
- onClick: $setup.onClick
- },
- [
- $props.tagStyle.show ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "tag-icon-box"
- }, [
- vue.createElementVNode("image", {
- class: "tag-icon",
- src: $setup.sheep.$url.cdn($props.tagStyle.src || $props.tagStyle.imgUrl)
- }, null, 8, ["src"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("image", {
- class: "sm-img-box",
- src: $setup.sheep.$url.cdn($props.data.image || $props.data.picUrl),
- mode: "aspectFill"
- }, null, 8, ["src"]),
- ((_g = $props.goodsFields.title) == null ? void 0 : _g.show) || ((_h = $props.goodsFields.name) == null ? void 0 : _h.show) || ((_i = $props.goodsFields.price) == null ? void 0 : _i.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "sm-goods-content",
- style: vue.normalizeStyle([{ color: $props.titleColor, width: $props.titleWidth ? $props.titleWidth + "rpx" : "" }])
- },
- [
- ((_j = $props.goodsFields.title) == null ? void 0 : _j.show) || ((_k = $props.goodsFields.name) == null ? void 0 : _k.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "sm-goods-title ss-line-1 ss-m-b-8"
- },
- vue.toDisplayString($props.data.title || $props.data.name),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- ((_l = $props.goodsFields.price) == null ? void 0 : _l.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "sm-goods-price ss-flex",
- style: vue.normalizeStyle([{ color: $props.goodsFields.price.color }])
- },
- [
- $props.data.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- class: "ss-m-r-10",
- style: { "width": "40rpx", "height": "40rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- vue.createCommentVNode(' <text class="price-unit ss-font-24">{{ priceUnit }}</text> '),
- $props.data.highPrecision ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 2 },
- vue.toDisplayString($setup.isArray($props.data.highPrecisionPrice) ? $setup.fen2yuan6($props.data.highPrecisionPrice[0]) : $setup.fen2yuan6($props.data.highPrecisionPrice)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 3 },
- vue.toDisplayString($setup.isArray($props.data.price) ? $setup.fen2yuan($props.data.price[0]) : $setup.fen2yuan($props.data.price)),
- 1
- /* TEXT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.data.promotionFee >= 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "origin-price-text"
- },
- vue.toDisplayString(_ctx.$t("common.points")) + ":" + vue.toDisplayString($setup.fen2yuan($props.data.promotionFee)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" md卡片:竖向,一行放两个,图上内容下 "),
- $props.size === "md" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "md-goods-card ss-flex-col",
- style: vue.normalizeStyle([$setup.elStyles]),
- onClick: $setup.onClick
- },
- [
- $props.tagStyle.show ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "tag-icon-box"
- }, [
- vue.createElementVNode("image", {
- class: "tag-icon",
- src: $setup.sheep.$url.cdn($props.tagStyle.src || $props.tagStyle.imgUrl)
- }, null, 8, ["src"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("image", {
- class: "md-img-box",
- src: $setup.sheep.$url.cdn($props.data.image || $props.data.picUrl),
- mode: "widthFix"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", {
- class: "md-goods-content ss-flex-col ss-row-around ss-p-b-20 ss-p-t-20 ss-p-x-16",
- id: $setup.elId
- }, [
- ((_m = $props.goodsFields.title) == null ? void 0 : _m.show) || ((_n = $props.goodsFields.name) == null ? void 0 : _n.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "md-goods-title ss-line-1",
- style: vue.normalizeStyle([{ color: $props.titleColor, width: $props.titleWidth ? $props.titleWidth + "rpx" : "" }])
- },
- vue.toDisplayString($props.data.title || $props.data.name),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- ((_o = $props.goodsFields.subtitle) == null ? void 0 : _o.show) || ((_p = $props.goodsFields.introduction) == null ? void 0 : _p.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "md-goods-subtitle ss-m-t-16 ss-line-1",
- style: vue.normalizeStyle([{ color: $props.subTitleColor, background: $props.subTitleBackground }])
- },
- vue.toDisplayString($props.data.subtitle || $props.data.introduction),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "activity", {}, () => {
- var _a3;
- return [
- ((_a3 = $props.data.promos) == null ? void 0 : _a3.length) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "tag-box ss-flex-wrap ss-flex ss-col-center"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.data.promos, (item) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "activity-tag ss-m-r-10 ss-m-t-16",
- key: item.id
- },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ];
- }, true),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-m-t-16" }, [
- ((_q = $props.goodsFields.price) == null ? void 0 : _q.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "md-goods-price ss-flex ss-m-r-10",
- style: vue.normalizeStyle([{ color: $props.goodsFields.price.color }])
- },
- [
- $props.data.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- class: "ss-m-r-10",
- style: { "width": "40rpx", "height": "40rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- vue.createCommentVNode(' <text class="price-unit ss-font-24">{{ priceUnit }}</text> '),
- $props.data.highPrecision ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 2 },
- vue.toDisplayString($setup.isArray($props.data.highPrecisionPrice) ? $setup.fen2yuan6($props.data.highPrecisionPrice[0]) : $setup.fen2yuan6($props.data.highPrecisionPrice)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 3 },
- vue.toDisplayString($setup.isArray($props.data.price) ? $setup.fen2yuan($props.data.price[0]) : $setup.fen2yuan($props.data.price)),
- 1
- /* TEXT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.data.promotionFee >= 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "origin-price-text"
- },
- vue.toDisplayString(_ctx.$t("common.points")) + ":" + vue.toDisplayString($setup.fen2yuan($props.data.promotionFee)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", { class: "ss-m-t-32 ss-flex ss-col-center ss-flex-wrap" }, [
- vue.createElementVNode(
- "view",
- { class: "sales-text" },
- vue.toDisplayString($setup.salesAndStock),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.renderSlot(_ctx.$slots, "cart", {}, () => [
- vue.createElementVNode("view", { class: "cart-box ss-flex ss-col-center ss-row-center" }, [
- vue.createElementVNode("image", {
- class: "cart-icon",
- src: _imports_1$3,
- mode: ""
- })
- ])
- ], true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" lg卡片:横向型,一行放一个,图片左内容右边 "),
- $props.size === "lg" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 3,
- class: "lg-goods-card ss-flex ss-col-stretch",
- style: vue.normalizeStyle([$setup.elStyles]),
- onClick: $setup.onClick
- },
- [
- $props.tagStyle.show ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "tag-icon-box"
- }, [
- vue.createElementVNode("image", {
- class: "tag-icon",
- src: $setup.sheep.$url.cdn($props.tagStyle.src || $props.tagStyle.imgUrl)
- }, null, 8, ["src"])
- ])) : vue.createCommentVNode("v-if", true),
- $props.seckillTag ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "seckill-tag ss-flex ss-row-center"
- }, " 秒杀 ")) : vue.createCommentVNode("v-if", true),
- $props.grouponTag ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "groupon-tag ss-flex ss-row-center"
- }, [
- vue.createElementVNode("view", { class: "tag-icon" }, "拼团")
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("image", {
- class: "lg-img-box",
- src: $setup.sheep.$url.cdn($props.data.image || $props.data.picUrl),
- mode: "aspectFill"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "lg-goods-content ss-flex-1 ss-flex-col ss-row-between ss-p-b-10 ss-p-t-20" }, [
- vue.createElementVNode("view", null, [
- ((_r = $props.goodsFields.title) == null ? void 0 : _r.show) || ((_s2 = $props.goodsFields.name) == null ? void 0 : _s2.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "lg-goods-title ss-line-2",
- style: vue.normalizeStyle([{ color: $props.titleColor }])
- },
- vue.toDisplayString($props.data.title || $props.data.name),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- ((_t2 = $props.goodsFields.subtitle) == null ? void 0 : _t2.show) || ((_u = $props.goodsFields.introduction) == null ? void 0 : _u.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "lg-goods-subtitle ss-m-t-10 ss-line-1",
- style: vue.normalizeStyle([{ color: $props.subTitleColor, background: $props.subTitleBackground }])
- },
- vue.toDisplayString($props.data.subtitle || $props.data.introduction),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", null, [
- vue.renderSlot(_ctx.$slots, "activity", {}, () => {
- var _a3;
- return [
- ((_a3 = $props.data.promos) == null ? void 0 : _a3.length) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "tag-box ss-flex ss-col-center"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.data.promos, (item) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "activity-tag ss-m-r-10",
- key: item.id
- },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ];
- }, true),
- vue.createElementVNode("view", { class: "ss-flex ss-col-bottom ss-m-b-10" }, [
- ((_v = $props.goodsFields.price) == null ? void 0 : _v.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "lg-goods-price ss-m-r-12 ss-flex ss-col-bottom ss-flex",
- style: vue.normalizeStyle([{ color: $props.goodsFields.price.color }])
- },
- [
- $props.data.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- class: "ss-m-r-10",
- style: { "width": "40rpx", "height": "40rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- vue.createCommentVNode(' <text class="ss-font-24">{{ priceUnit }}</text> '),
- $props.data.highPrecision ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 2 },
- vue.toDisplayString($setup.isArray($props.data.highPrecisionPrice) ? $setup.fen2yuan6($props.data.highPrecisionPrice[0]) : $setup.fen2yuan6($props.data.highPrecisionPrice)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 3 },
- vue.toDisplayString($setup.isArray($props.data.price) ? $setup.fen2yuan($props.data.price[0]) : $setup.fen2yuan($props.data.price)),
- 1
- /* TEXT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-col-bottom ss-m-b-10" }, [
- $props.data.promotionFee >= 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "origin-price-text"
- },
- vue.toDisplayString(_ctx.$t("common.points")) + ":" + vue.toDisplayString($setup.fen2yuan($props.data.promotionFee)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", { class: "ss-m-t-8 ss-flex ss-col-center ss-flex-wrap" }, [
- vue.createElementVNode(
- "view",
- { class: "sales-text" },
- vue.toDisplayString($setup.salesAndStock),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- vue.renderSlot(_ctx.$slots, "cart", {}, () => [
- $props.buttonShow ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "buy-box ss-flex ss-col-center ss-row-center"
- },
- vue.toDisplayString(_ctx.$t("common.go_buy")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" sl卡片:竖向型,一行放一个,图片上内容下边 "),
- $props.size === "sl" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 4,
- class: "sl-goods-card ss-flex-col",
- style: vue.normalizeStyle([$setup.elStyles]),
- onClick: $setup.onClick
- },
- [
- $props.tagStyle.show ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "tag-icon-box"
- }, [
- vue.createElementVNode("image", {
- class: "tag-icon",
- src: $setup.sheep.$url.cdn($props.tagStyle.src || $props.tagStyle.imgUrl)
- }, null, 8, ["src"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("image", {
- class: "sl-img-box",
- src: $setup.sheep.$url.cdn($props.data.image || $props.data.picUrl),
- mode: "aspectFill"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "sl-goods-content" }, [
- vue.createElementVNode("view", null, [
- ((_w = $props.goodsFields.title) == null ? void 0 : _w.show) || ((_x = $props.goodsFields.name) == null ? void 0 : _x.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "sl-goods-title ss-line-1",
- style: vue.normalizeStyle([{ color: $props.titleColor }])
- },
- vue.toDisplayString($props.data.title || $props.data.name),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- ((_y = $props.goodsFields.subtitle) == null ? void 0 : _y.show) || ((_z = $props.goodsFields.introduction) == null ? void 0 : _z.show) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "sl-goods-subtitle ss-m-t-16",
- style: vue.normalizeStyle([{ color: $props.subTitleColor, background: $props.subTitleBackground }])
- },
- vue.toDisplayString($props.data.subtitle || $props.data.introduction),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", null, [
- vue.renderSlot(_ctx.$slots, "activity", {}, () => {
- var _a3;
- return [
- ((_a3 = $props.data.promos) == null ? void 0 : _a3.length) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "tag-box ss-flex ss-col-center ss-flex-wrap"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.data.promos, (item) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "activity-tag ss-m-r-10 ss-m-t-16",
- key: item.id
- },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ];
- }, true),
- ((_A = $props.goodsFields.price) == null ? void 0 : _A.show) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "ss-flex ss-col-bottom ss-flex ss-m-t-10"
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "sl-goods-price ss-m-r-12",
- style: vue.normalizeStyle([{ color: $props.goodsFields.price.color }])
- },
- [
- $props.data.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- class: "ss-m-r-10",
- style: { "width": "40rpx", "height": "40rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- vue.createCommentVNode(' <text class="price-unit ss-font-24">{{ priceUnit }}</text> '),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.isArray($props.data.price) ? $setup.fen2yuan($props.data.price[0]) : $setup.fen2yuan($props.data.price)),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- ),
- $props.data.promotionFee >= 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "origin-price-text"
- },
- vue.toDisplayString(_ctx.$t("common.points")) + ":" + vue.toDisplayString($setup.fen2yuan($props.data.promotionFee)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "ss-m-t-16 ss-flex ss-flex-wrap" }, [
- vue.createElementVNode(
- "view",
- { class: "sales-text" },
- vue.toDisplayString($setup.salesAndStock),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- vue.renderSlot(_ctx.$slots, "cart", {}, () => [
- vue.createElementVNode(
- "view",
- { class: "buy-box ss-flex ss-col-center ss-row-center" },
- vue.toDisplayString(_ctx.$t("common.go_buy")),
- 1
- /* TEXT */
- )
- ], true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_1$4 = /* @__PURE__ */ _export_sfc(_sfc_main$2n, [["render", _sfc_render$2m], ["__scopeId", "data-v-1c3d9e07"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-goods-column/s-goods-column.vue"]]);
- const _sfc_main$2m = {
- __name: "s-goods-card",
- props: {
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const LayoutTypeEnum = {
- // 单列大图
- ONE_COL_BIG_IMG: "oneColBigImg",
- // 双列
- TWO_COL: "twoCol",
- // 单列小图
- ONE_COL_SMALL_IMG: "oneColSmallImg"
- };
- const state = vue.reactive({
- goodsList: [],
- leftGoodsList: [],
- rightGoodsList: []
- });
- const props = __props;
- const { layoutType, btnBuy, spuIds } = props.data ?? {};
- const { marginLeft, marginRight } = props.styles ?? {};
- const buyStyle = vue.computed(() => {
- if (btnBuy.type === "text") {
- return {
- background: `linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient))`
- };
- }
- if (btnBuy.type === "img") {
- return {
- width: "54rpx",
- height: "54rpx",
- background: `url(${sheep$1.$url.cdn(btnBuy.imgUrl)}) no-repeat`,
- backgroundSize: "100% 100%"
- };
- }
- });
- let count = 0;
- let leftHeight = 0;
- let rightHeight = 0;
- function calculateGoodsColumn(height = 0, where = "left") {
- if (!state.goodsList[count])
- return;
- if (where === "left")
- leftHeight += height;
- if (where === "right")
- rightHeight += height;
- if (leftHeight <= rightHeight) {
- state.leftGoodsList.push(state.goodsList[count]);
- } else {
- state.rightGoodsList.push(state.goodsList[count]);
- }
- count++;
- }
- async function getGoodsListByIds(ids) {
- const { data } = await SpuApi.getSpuListByIds(ids);
- return data;
- }
- vue.onMounted(async () => {
- state.goodsList = await getGoodsListByIds(spuIds.join(","));
- if (layoutType === LayoutTypeEnum.TWO_COL) {
- calculateGoodsColumn();
- }
- });
- const __returned__ = { LayoutTypeEnum, state, props, layoutType, btnBuy, spuIds, marginLeft, marginRight, buyStyle, get count() {
- return count;
- }, set count(v2) {
- count = v2;
- }, get leftHeight() {
- return leftHeight;
- }, set leftHeight(v2) {
- leftHeight = v2;
- }, get rightHeight() {
- return rightHeight;
- }, set rightHeight(v2) {
- rightHeight = v2;
- }, calculateGoodsColumn, getGoodsListByIds, computed: vue.computed, reactive: vue.reactive, onMounted: vue.onMounted, get sheep() {
- return sheep$1;
- }, get SpuApi() {
- return SpuApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2l(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 商品卡片 "),
- vue.createElementVNode("view", null, [
- vue.createCommentVNode(" 布局1. 单列大图(上图,下内容)"),
- $setup.layoutType === $setup.LayoutTypeEnum.ONE_COL_BIG_IMG && $setup.state.goodsList.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "goods-sl-box"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.goodsList, (item) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "goods-box",
- key: item.id,
- style: vue.normalizeStyle([{ marginBottom: $props.data.space * 2 + "rpx" }])
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "",
- size: "sl",
- goodsFields: $props.data.fields,
- tagStyle: $props.data.badge,
- data: item,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- subTitleColor: $props.data.fields.introduction.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id })
- }, {
- cart: vue.withCtx(() => [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button cart-btn",
- style: vue.normalizeStyle([$setup.buyStyle])
- },
- vue.toDisplayString($setup.btnBuy.type === "text" ? $setup.btnBuy.text : ""),
- 5
- /* TEXT, STYLE */
- )
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["goodsFields", "tagStyle", "data", "titleColor", "subTitleColor", "topRadius", "bottomRadius", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 布局2. 双列(每一列:上图,下内容)"),
- $setup.layoutType === $setup.LayoutTypeEnum.TWO_COL && $setup.state.goodsList.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "goods-md-wrap ss-flex ss-flex-wrap ss-col-top"
- }, [
- vue.createElementVNode("view", { class: "goods-list-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.leftGoodsList, (item) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "left-list",
- style: vue.normalizeStyle([{ paddingRight: $props.data.space + "rpx", marginBottom: $props.data.space + "px" }]),
- key: item.id
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-md-box",
- size: "md",
- goodsFields: $props.data.fields,
- tagStyle: $props.data.badge,
- data: item,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- subTitleColor: $props.data.fields.introduction.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- titleWidth: 330 - $setup.marginLeft - $setup.marginRight,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id }),
- onGetHeight: _cache[0] || (_cache[0] = ($event) => $setup.calculateGoodsColumn($event, "left"))
- }, {
- cart: vue.withCtx(() => [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button cart-btn",
- style: vue.normalizeStyle([$setup.buyStyle])
- },
- vue.toDisplayString($setup.btnBuy.type === "text" ? $setup.btnBuy.text : ""),
- 5
- /* TEXT, STYLE */
- )
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["goodsFields", "tagStyle", "data", "titleColor", "subTitleColor", "topRadius", "bottomRadius", "titleWidth", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("view", { class: "goods-list-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.rightGoodsList, (item) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "right-list",
- style: vue.normalizeStyle([{ paddingLeft: $props.data.space + "rpx", marginBottom: $props.data.space + "px" }]),
- key: item.id
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-md-box",
- size: "md",
- goodsFields: $props.data.fields,
- tagStyle: $props.data.badge,
- data: item,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- subTitleColor: $props.data.fields.introduction.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- titleWidth: 330 - $setup.marginLeft - $setup.marginRight,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id }),
- onGetHeight: _cache[1] || (_cache[1] = ($event) => $setup.calculateGoodsColumn($event, "right"))
- }, {
- cart: vue.withCtx(() => [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button cart-btn",
- style: vue.normalizeStyle([$setup.buyStyle])
- },
- vue.toDisplayString($setup.btnBuy.type === "text" ? $setup.btnBuy.text : ""),
- 5
- /* TEXT, STYLE */
- )
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["goodsFields", "tagStyle", "data", "titleColor", "subTitleColor", "topRadius", "bottomRadius", "titleWidth", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 布局3. 单列小图(左图,右内容) "),
- $setup.layoutType === $setup.LayoutTypeEnum.ONE_COL_SMALL_IMG && $setup.state.goodsList.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "goods-lg-box"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.goodsList, (item) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "goods-box",
- style: vue.normalizeStyle([{ marginBottom: $props.data.space + "px" }]),
- key: item.id
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-card",
- size: "lg",
- goodsFields: $props.data.fields,
- data: item,
- tagStyle: $props.data.badge,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- subTitleColor: $props.data.fields.introduction.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id })
- }, {
- cart: vue.withCtx(() => [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button cart-btn",
- style: vue.normalizeStyle([$setup.buyStyle])
- },
- vue.toDisplayString($setup.btnBuy.type === "text" ? $setup.btnBuy.text : ""),
- 5
- /* TEXT, STYLE */
- )
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["goodsFields", "data", "tagStyle", "titleColor", "subTitleColor", "topRadius", "bottomRadius", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const __easycom_14 = /* @__PURE__ */ _export_sfc(_sfc_main$2m, [["render", _sfc_render$2l], ["__scopeId", "data-v-edfbd448"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-goods-card/s-goods-card.vue"]]);
- const _sfc_main$2l = {
- __name: "s-goods-shelves",
- props: {
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const { layoutType, spuIds } = props.data;
- let { marginLeft, marginRight } = props.styles;
- const goodsList = vue.ref([]);
- vue.onMounted(async () => {
- if (spuIds.length > 0) {
- let { data } = await SpuApi.getSpuListByIds(spuIds.join(","));
- goodsList.value = data;
- }
- });
- const __returned__ = { props, layoutType, spuIds, get marginLeft() {
- return marginLeft;
- }, set marginLeft(v2) {
- marginLeft = v2;
- }, get marginRight() {
- return marginRight;
- }, set marginRight(v2) {
- marginRight = v2;
- }, goodsList, onMounted: vue.onMounted, ref: vue.ref, computed: vue.computed, get sheep() {
- return sheep$1;
- }, get SpuApi() {
- return SpuApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2k(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 布局1. 两列商品,图片左文案右 "),
- $setup.layoutType === "twoCol" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "goods-xs-box ss-flex ss-flex-wrap",
- style: vue.normalizeStyle([{ margin: "-" + $props.data.space + "rpx" }])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.goodsList, (item) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "goods-xs-list",
- key: item.id,
- style: vue.normalizeStyle([
- {
- padding: $props.data.space + "rpx"
- }
- ])
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-card",
- size: "xs",
- goodsFields: $props.data.fields,
- tagStyle: $props.data.badge,
- data: item,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- titleWidth: (454 - $setup.marginRight * 2 - $props.data.space * 2 - $setup.marginLeft * 2) / 2,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id })
- }, null, 8, ["goodsFields", "tagStyle", "data", "titleColor", "topRadius", "bottomRadius", "titleWidth", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 布局. 三列商品:图片上文案下 "),
- $setup.layoutType === "threeCol" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "goods-sm-box ss-flex ss-flex-wrap",
- style: vue.normalizeStyle([{ margin: "-" + $props.data.space + "rpx" }])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.goodsList, (item) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: item.id,
- class: "goods-card-box",
- style: vue.normalizeStyle([
- {
- padding: $props.data.space + "rpx"
- }
- ])
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-card",
- size: "sm",
- goodsFields: $props.data.fields,
- tagStyle: $props.data.badge,
- data: item,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id })
- }, null, 8, ["goodsFields", "tagStyle", "data", "titleColor", "topRadius", "bottomRadius", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 布局3. 一行商品,水平滑动 "),
- $setup.layoutType === "horizSwiper" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: ""
- }, [
- vue.createElementVNode("scroll-view", {
- class: "scroll-box goods-scroll-box",
- "scroll-x": "",
- "scroll-anchoring": ""
- }, [
- vue.createElementVNode("view", { class: "goods-box ss-flex" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.goodsList, (item) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "goods-card-box",
- key: item.id,
- style: vue.normalizeStyle([{ marginRight: $props.data.space * 2 + "rpx" }])
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-card",
- size: "sm",
- goodsFields: $props.data.fields,
- tagStyle: $props.data.badge,
- data: item,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- titleWidth: (750 - $setup.marginRight * 2 - $props.data.space * 4 - $setup.marginLeft * 2) / 3,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id })
- }, null, 8, ["goodsFields", "tagStyle", "data", "titleColor", "titleWidth", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_15 = /* @__PURE__ */ _export_sfc(_sfc_main$2l, [["render", _sfc_render$2k], ["__scopeId", "data-v-9630804b"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-goods-shelves/s-goods-shelves.vue"]]);
- const _sfc_main$2k = {
- __name: "s-groupon-block",
- props: {
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- let { layoutType, tagStyle, btnBuy, space } = props.data;
- let { marginLeft, marginRight } = props.styles;
- const buyStyle = vue.computed(() => {
- let btnBuy2 = props.data.btnBuy;
- if ((btnBuy2 == null ? void 0 : btnBuy2.type) === "text") {
- return {
- background: `linear-gradient(to right, ${btnBuy2.bgBeginColor}, ${btnBuy2.bgEndColor})`
- };
- }
- if ((btnBuy2 == null ? void 0 : btnBuy2.type) === "img") {
- return {
- width: "54rpx",
- height: "54rpx",
- background: `url(${sheep$1.$url.cdn(btnBuy2.imgUrl)}) no-repeat`,
- backgroundSize: "100% 100%"
- };
- }
- });
- const productList = vue.ref([]);
- vue.onMounted(async () => {
- const { data: activity } = await CombinationApi.getCombinationActivity(props.data.activityId);
- const { data: spu } = await SpuApi.getSpuDetail(activity.spuId);
- productList.value = [spu];
- });
- const __returned__ = { props, get layoutType() {
- return layoutType;
- }, set layoutType(v2) {
- layoutType = v2;
- }, get tagStyle() {
- return tagStyle;
- }, set tagStyle(v2) {
- tagStyle = v2;
- }, get btnBuy() {
- return btnBuy;
- }, set btnBuy(v2) {
- btnBuy = v2;
- }, get space() {
- return space;
- }, set space(v2) {
- space = v2;
- }, get marginLeft() {
- return marginLeft;
- }, set marginLeft(v2) {
- marginLeft = v2;
- }, get marginRight() {
- return marginRight;
- }, set marginRight(v2) {
- marginRight = v2;
- }, buyStyle, productList, computed: vue.computed, onMounted: vue.onMounted, ref: vue.ref, get sheep() {
- return sheep$1;
- }, get SpuApi() {
- return SpuApi;
- }, get CombinationApi() {
- return CombinationApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2j(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- $setup.layoutType === "threeCol" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "goods-sm-box ss-flex ss-flex-wrap",
- style: vue.normalizeStyle([{ margin: "-" + $props.data.space + "rpx" }])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.productList, (product) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: product.id,
- class: "goods-card-box",
- style: vue.normalizeStyle([
- {
- padding: $props.data.space + "rpx"
- }
- ])
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-card",
- size: "sm",
- goodsFields: $props.data.fields,
- tagStyle: $setup.tagStyle,
- data: product,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/groupon", {
- id: product.id,
- activity_id: $setup.props.data.activityId
- })
- }, null, 8, ["goodsFields", "tagStyle", "data", "titleColor", "topRadius", "bottomRadius", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 样式2 一行一个 图片左 文案右 "),
- $setup.layoutType === "oneCol" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "goods-box"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.productList, (product, index2) => {
- var _a2, _b2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "goods-list",
- key: index2,
- style: vue.normalizeStyle([{ marginBottom: $setup.space + "px" }])
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-card",
- size: "lg",
- goodsFields: $props.data.fields,
- tagStyle: $setup.tagStyle,
- data: product,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- subTitleColor: (_b2 = $props.data.fields.introduction) == null ? void 0 : _b2.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/groupon", {
- id: product.id,
- activity_id: $setup.props.data.activityId
- })
- }, {
- cart: vue.withCtx(() => {
- var _a3;
- return [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button cart-btn",
- style: vue.normalizeStyle([$setup.buyStyle])
- },
- vue.toDisplayString(((_a3 = $setup.btnBuy) == null ? void 0 : _a3.type) === "text" ? $setup.btnBuy.text : ""),
- 5
- /* TEXT, STYLE */
- )
- ];
- }),
- _: 2
- /* DYNAMIC */
- }, 1032, ["goodsFields", "tagStyle", "data", "titleColor", "subTitleColor", "topRadius", "bottomRadius", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_16 = /* @__PURE__ */ _export_sfc(_sfc_main$2k, [["render", _sfc_render$2j], ["__scopeId", "data-v-17051e0b"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-groupon-block/s-groupon-block.vue"]]);
- const _sfc_main$2j = {
- __name: "s-seckill-block",
- props: {
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- let { layoutType, tagStyle, btnBuy, space } = props.data;
- let { marginLeft, marginRight } = props.styles;
- const buyStyle = vue.computed(() => {
- let btnBuy2 = props.data.btnBuy;
- if ((btnBuy2 == null ? void 0 : btnBuy2.type) === "text") {
- return {
- background: `linear-gradient(to right, ${btnBuy2.bgBeginColor}, ${btnBuy2.bgEndColor})`
- };
- }
- if ((btnBuy2 == null ? void 0 : btnBuy2.type) === "img") {
- return {
- width: "54rpx",
- height: "54rpx",
- background: `url(${sheep$1.$url.cdn(btnBuy2.imgUrl)}) no-repeat`,
- backgroundSize: "100% 100%"
- };
- }
- });
- const productList = vue.ref([]);
- vue.onMounted(async () => {
- const { data: activity } = await SeckillApi.getSeckillActivity(props.data.activityId);
- const { data: spu } = await SpuApi.getSpuDetail(activity.spuId);
- productList.value = [spu];
- });
- const __returned__ = { props, get layoutType() {
- return layoutType;
- }, set layoutType(v2) {
- layoutType = v2;
- }, get tagStyle() {
- return tagStyle;
- }, set tagStyle(v2) {
- tagStyle = v2;
- }, get btnBuy() {
- return btnBuy;
- }, set btnBuy(v2) {
- btnBuy = v2;
- }, get space() {
- return space;
- }, set space(v2) {
- space = v2;
- }, get marginLeft() {
- return marginLeft;
- }, set marginLeft(v2) {
- marginLeft = v2;
- }, get marginRight() {
- return marginRight;
- }, set marginRight(v2) {
- marginRight = v2;
- }, buyStyle, productList, computed: vue.computed, onMounted: vue.onMounted, ref: vue.ref, get sheep() {
- return sheep$1;
- }, get SeckillApi() {
- return SeckillApi;
- }, get SpuApi() {
- return SpuApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2i(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 样式一:三列 - 上图下文 "),
- $setup.layoutType === "threeCol" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "goods-sm-box ss-flex ss-flex-wrap",
- style: vue.normalizeStyle([{ margin: "-" + $props.data.space + "rpx" }])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.productList, (product) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: product.id,
- class: "goods-card-box",
- style: vue.normalizeStyle([
- {
- padding: $props.data.space + "rpx"
- }
- ])
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-card",
- size: "sm",
- goodsFields: $props.data.fields,
- tagStyle: $setup.tagStyle,
- data: product,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/goods/seckill", {
- id: $setup.props.data.activityId
- }))
- }, null, 8, ["goodsFields", "tagStyle", "data", "titleColor", "topRadius", "bottomRadius"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 样式二:一列 - 左图右文 "),
- $setup.layoutType === "oneCol" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "goods-box"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.productList, (product, index2) => {
- var _a2, _b2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "goods-list",
- key: index2,
- style: vue.normalizeStyle([{ marginBottom: $setup.space + "px" }])
- },
- [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-card",
- size: "lg",
- goodsFields: $props.data.fields,
- tagStyle: $setup.tagStyle,
- data: product,
- titleColor: (_a2 = $props.data.fields.name) == null ? void 0 : _a2.color,
- subTitleColor: (_b2 = $props.data.fields.introduction) == null ? void 0 : _b2.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/goods/seckill", {
- id: $setup.props.data.activityId
- }))
- }, {
- cart: vue.withCtx(() => {
- var _a3;
- return [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button cart-btn",
- style: vue.normalizeStyle([$setup.buyStyle])
- },
- vue.toDisplayString(((_a3 = $setup.btnBuy) == null ? void 0 : _a3.type) === "text" ? $setup.btnBuy.text : ""),
- 5
- /* TEXT, STYLE */
- )
- ];
- }),
- _: 2
- /* DYNAMIC */
- }, 1032, ["goodsFields", "tagStyle", "data", "titleColor", "subTitleColor", "topRadius", "bottomRadius"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_17 = /* @__PURE__ */ _export_sfc(_sfc_main$2j, [["render", _sfc_render$2i], ["__scopeId", "data-v-073abe37"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-seckill-block/s-seckill-block.vue"]]);
- const _sfc_main$2i = {
- __name: "s-live-card",
- props: {
- goodsFields: {
- type: [Array, Object],
- default() {
- return {};
- }
- },
- tagStyle: {
- type: Object,
- default: {}
- },
- data: {
- type: Object,
- default: {}
- },
- size: {
- type: String,
- default: "sl"
- },
- background: {
- type: String,
- default: ""
- },
- topRadius: {
- type: Number,
- default: 0
- },
- bottomRadius: {
- type: Number,
- default: 0
- },
- titleColor: {
- type: String,
- default: "#333"
- },
- subTitleColor: {
- type: String,
- default: "#999999"
- }
- },
- emits: ["click", "getHeight"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props = __props;
- const elStyles = vue.computed(() => {
- return {
- background: props.background,
- "border-top-left-radius": props.topRadius + "px",
- "border-top-right-radius": props.topRadius + "px",
- "border-bottom-left-radius": props.bottomRadius + "px",
- "border-bottom-right-radius": props.bottomRadius + "px"
- };
- });
- const state = vue.reactive({
- liveStatus: {
- 101: {
- img: sheep$1.$url.static("/static/images/living.png"),
- title: "直播中"
- },
- 102: {
- img: sheep$1.$url.static("/static/images/start.png"),
- title: "未开始"
- },
- 103: {
- img: sheep$1.$url.static("/static/images/ended.png"),
- title: "已结束"
- }
- }
- });
- const emits = __emit;
- const onClick = () => {
- emits("click");
- };
- const __returned__ = { props, elStyles, state, emits, onClick, computed: vue.computed, reactive: vue.reactive, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2h(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" md卡片:竖向,一行放两个,图上内容下 "),
- $props.size === "md" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "md-goods-card ss-flex-col",
- style: vue.normalizeStyle([$setup.elStyles]),
- onClick: $setup.onClick
- },
- [
- vue.createElementVNode("view", { class: "icon-box ss-flex" }, [
- vue.createElementVNode("image", {
- class: "icon",
- src: $setup.state.liveStatus[$props.data.status].img
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "view",
- { class: "title ss-m-l-16" },
- vue.toDisplayString($setup.state.liveStatus[$props.data.status].title),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("image", {
- class: "md-img-box",
- src: $setup.sheep.$url.cdn($props.data.feeds_img),
- referrerpolicy: "no-referrer"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "md-goods-content" }, [
- vue.createElementVNode(
- "view",
- {
- class: "md-goods-title ss-line-1",
- style: vue.normalizeStyle([{ color: $props.titleColor }])
- },
- vue.toDisplayString($props.data.name),
- 5
- /* TEXT, STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "md-goods-subtitle ss-m-t-14 ss-line-1",
- style: vue.normalizeStyle([{ color: $props.subTitleColor }])
- },
- " 主播:" + vue.toDisplayString($props.data.anchor_name),
- 5
- /* TEXT, STYLE */
- )
- ])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" sl卡片:竖向型,一行放一个,图片上内容下边 "),
- $props.size === "sl" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "sl-goods-card ss-flex-col",
- style: vue.normalizeStyle([$setup.elStyles]),
- onClick: $setup.onClick
- },
- [
- vue.createElementVNode("view", { class: "icon-box ss-flex" }, [
- vue.createElementVNode("image", {
- class: "icon",
- src: $setup.state.liveStatus[$props.data.status].img
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "view",
- { class: "title ss-m-l-16" },
- vue.toDisplayString($setup.state.liveStatus[$props.data.status].title),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("image", {
- class: "sl-img-box",
- src: $setup.sheep.$url.cdn($props.data.feeds_img),
- referrerpolicy: "no-referrer"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "sl-goods-content" }, [
- vue.createElementVNode(
- "view",
- {
- class: "sl-goods-title ss-line-1",
- style: vue.normalizeStyle([{ color: $props.titleColor }])
- },
- vue.toDisplayString($props.data.name),
- 5
- /* TEXT, STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "sl-goods-subtitle ss-m-t-14 ss-line-1",
- style: vue.normalizeStyle([{ color: $props.subTitleColor }])
- },
- " 主播:" + vue.toDisplayString($props.data.anchor_name),
- 5
- /* TEXT, STYLE */
- )
- ])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_0$d = /* @__PURE__ */ _export_sfc(_sfc_main$2i, [["render", _sfc_render$2h], ["__scopeId", "data-v-e059c327"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-live-card/s-live-card.vue"]]);
- const _sfc_main$2h = {
- __name: "s-live-block",
- props: {
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- liveList: [],
- mpLink: ""
- });
- const props = __props;
- const { mode, goodsFields, mpliveIds } = props.data ?? {};
- const { marginLeft, marginRight } = props.styles ?? {};
- async function getLiveListByIds(ids) {
- const { data } = await sheep$1.$api.app.mplive.getRoomList(ids);
- return data;
- }
- function goRoom(id) {
- uni.showModal({
- title: "提示",
- confirmText: "允许",
- content: "将打开小程序访问",
- success: async function(res) {
- if (res.confirm) {
- getMpLink();
- }
- }
- });
- }
- function goMpLink() {
- plus.runtime.openURL(state.mpLink);
- }
- async function getMpLink() {
- if (state.mpLink === "") {
- const { error: error2, data } = await sheep$1.$api.app.mplive.getMpLink();
- if (error2 === 0) {
- state.mpLink = data;
- }
- }
- goMpLink();
- }
- vue.onMounted(async () => {
- state.liveList = await getLiveListByIds(mpliveIds);
- });
- const __returned__ = { state, props, mode, goodsFields, mpliveIds, marginLeft, marginRight, getLiveListByIds, goRoom, goMpLink, getMpLink, reactive: vue.reactive, onMounted: vue.onMounted, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2g(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_live_card = resolveEasycom(vue.resolveDynamicComponent("s-live-card"), __easycom_0$d);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- $setup.mode === 2 && $setup.state.liveList.length ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "goods-md-wrap ss-flex ss-flex-wrap ss-col-top",
- style: vue.normalizeStyle([{ margin: "-" + $props.data.space + "rpx" }])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.liveList, (item) => {
- var _a2, _b2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle([
- {
- padding: $props.data.space + "rpx"
- }
- ]),
- class: "goods-list-box",
- key: item.id
- },
- [
- vue.createVNode(_component_s_live_card, {
- class: "goods-md-box",
- size: "md",
- goodsFields: $setup.goodsFields,
- data: item,
- titleColor: (_a2 = $setup.goodsFields.name) == null ? void 0 : _a2.color,
- subTitleColor: (_b2 = $setup.goodsFields.anchor_name) == null ? void 0 : _b2.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- onClick: ($event) => $setup.goRoom(item.roomid)
- }, null, 8, ["goodsFields", "data", "titleColor", "subTitleColor", "topRadius", "bottomRadius", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $setup.mode === 1 && $setup.state.liveList.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "goods-lg-box"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.liveList, (item) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "goods-box",
- style: vue.normalizeStyle([{ marginBottom: $props.data.space + "px" }]),
- key: item.id
- },
- [
- vue.createVNode(_component_s_live_card, {
- class: "goods-card",
- size: "sl",
- goodsFields: $setup.goodsFields,
- data: item,
- titleColor: (_a2 = $setup.goodsFields.name) == null ? void 0 : _a2.color,
- subTitleColor: $setup.goodsFields.anchor_name.color,
- topRadius: $props.data.borderRadiusTop,
- bottomRadius: $props.data.borderRadiusBottom,
- onClick: ($event) => $setup.goRoom(item.roomid)
- }, null, 8, ["goodsFields", "data", "titleColor", "subTitleColor", "topRadius", "bottomRadius", "onClick"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_18 = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["render", _sfc_render$2g], ["__scopeId", "data-v-74052372"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-live-block/s-live-block.vue"]]);
- const _sfc_main$2g = {
- __name: "su-coupon",
- props: {
- size: {
- type: String,
- default: "lg"
- },
- textColor: {
- type: String,
- default: "#FF6000"
- },
- background: {
- type: String,
- default: "#FFC19C"
- },
- btnBg: {
- type: String,
- default: "#fff"
- },
- btnTextColor: {
- type: String,
- default: "#FF6000"
- },
- state: {
- type: Number,
- default: 0
- },
- couponId: {
- type: Number,
- default: 0
- },
- title: {
- type: String,
- default: "这是优惠券"
- },
- value: {
- type: [Number, String],
- default: 50
- },
- sellBy: {
- type: String,
- default: "2019.11.25至2019.12.25"
- },
- surplus: {
- type: [Number, String],
- default: 0
- },
- type: {
- type: String,
- default: ""
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "34099896-textColor": __props.textColor,
- "34099896-btnTextColor": __props.btnTextColor,
- "34099896-btnBg": __props.btnBg
- }));
- const state = vue.reactive({
- stateMap: {
- 0: "立即领取",
- 1: "去使用"
- }
- });
- const props = __props;
- const cardStyle = vue.computed(() => {
- return {
- background: props.background
- };
- });
- const __returned__ = { state, props, cardStyle, computed: vue.computed, reactive: vue.reactive, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2f(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "ui-coupon-wrap" }, [
- vue.createCommentVNode(" xs: 一行三个,竖向 "),
- $setup.props.size === "xs" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "xs-coupon-card ss-flex ss-flex-col ss-row-between",
- style: vue.normalizeStyle([$setup.cardStyle]),
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/coupon/detail", {
- id: $props.couponId
- }))
- },
- [
- vue.createElementVNode("view", { class: "ss-flex ss-flex-col ss-row-center ss-col-center" }, [
- vue.createElementVNode("view", { class: "face-value-box ss-flex ss-col-bottom ss-m-t-50 ss-m-b-28" }, [
- vue.createElementVNode(
- "view",
- { class: "value-text ss-m-r-4" },
- vue.toDisplayString($props.type === "reduce" ? $props.value : Number($props.value)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "value-unit" },
- vue.toDisplayString($props.type === "reduce" ? "元" : "折"),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "title-text" },
- vue.toDisplayString($setup.props.title),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "card-bottom ss-m-b-30 ss-flex ss-row-center" }, [
- vue.renderSlot(_ctx.$slots, "btn", {}, () => [
- vue.createElementVNode(
- "button",
- { class: "ss-reset-button card-btn" },
- vue.toDisplayString($setup.state.stateMap[$setup.props.state]),
- 1
- /* TEXT */
- )
- ], true)
- ])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" md: 一行两个,横向 "),
- $setup.props.size === "md" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "md-coupon-card ss-flex ss-row-between",
- style: vue.normalizeStyle([$setup.cardStyle]),
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/coupon/detail", {
- id: $props.couponId
- }))
- },
- [
- vue.createElementVNode("view", { class: "card-left ss-flex ss-flex-col ss-row-between ss-col-top ss-m-l-40" }, [
- vue.createElementVNode("view", { class: "face-value-box ss-flex ss-col-bottom ss-m-t-28" }, [
- vue.createElementVNode(
- "view",
- { class: "value-text ss-m-r-4" },
- vue.toDisplayString($props.type === "reduce" ? $props.value : Number($props.value)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "value-unit" },
- vue.toDisplayString($props.type === "reduce" ? "元" : "折"),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-m-b-28" }, [
- vue.createElementVNode(
- "view",
- { class: "title-text ss-m-b-10" },
- vue.toDisplayString($setup.props.title),
- 1
- /* TEXT */
- ),
- $setup.props.surplus ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "surplus-text"
- },
- "仅剩:" + vue.toDisplayString($setup.props.surplus) + "张",
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- vue.createElementVNode("view", { class: "card-right ss-flex ss-row-center" }, [
- vue.renderSlot(_ctx.$slots, "btn", {}, () => [
- vue.createElementVNode("button", { class: "ss-reset-button card-btn ss-flex ss-row-center ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "btn-text" },
- vue.toDisplayString($setup.state.stateMap[$setup.props.state]),
- 1
- /* TEXT */
- )
- ])
- ], true)
- ])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" lg: 一行一个,横向 "),
- $setup.props.size === "lg" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "lg-coupon-card ss-flex ss-row-between",
- style: vue.normalizeStyle([$setup.cardStyle]),
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.sheep.$router.go("/pages/coupon/detail", {
- id: $props.couponId
- }))
- },
- [
- vue.createElementVNode("view", { class: "card-left ss-flex ss-flex-col ss-row-between ss-col-top ss-m-l-40" }, [
- vue.createElementVNode("view", { class: "face-value-box ss-flex ss-col-bottom ss-m-t-28" }, [
- vue.createElementVNode(
- "view",
- { class: "value-text ss-m-r-4" },
- vue.toDisplayString($props.type === "reduce" ? $props.value : Number($props.value)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "value-unit" },
- vue.toDisplayString($props.type === "reduce" ? "元" : "折"),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-m-b-20" }, [
- vue.createElementVNode(
- "view",
- { class: "title-text ss-m-b-10" },
- vue.toDisplayString($setup.props.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "sellby-text" },
- "有效期:" + vue.toDisplayString($setup.props.sellBy),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode("view", { class: "card-right ss-flex ss-flex-col ss-col-center ss-row-center" }, [
- vue.renderSlot(_ctx.$slots, "btn", {}, () => [
- vue.createElementVNode(
- "button",
- { class: "ss-reset-button card-btn ss-flex ss-row-center ss-col-center" },
- vue.toDisplayString($setup.state.stateMap[$setup.props.state]),
- 1
- /* TEXT */
- )
- ], true),
- $setup.props.surplus ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "surplus-text ss-m-t-24"
- },
- "仅剩:" + vue.toDisplayString($setup.props.surplus) + "张",
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_0$c = /* @__PURE__ */ _export_sfc(_sfc_main$2g, [["render", _sfc_render$2f], ["__scopeId", "data-v-34099896"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-coupon/su-coupon.vue"]]);
- const PromotionDiscountTypeEnum = {
- PRICE: {
- type: 1,
- name: "满减"
- },
- PERCENT: {
- type: 2,
- name: "折扣"
- }
- };
- const CouponTemplateValidityTypeEnum = {
- DATE: {
- type: 1,
- name: "固定日期可用"
- },
- TERM: {
- type: 2,
- name: "领取之后可用"
- }
- };
- const TimeStatusEnum = {
- WAIT_START: "即将开始",
- STARTED: "进行中",
- END: "已结束"
- };
- const getTimeStatusEnum = (startTime, endTime) => {
- const now2 = dayjs();
- if (now2.isBefore(startTime)) {
- return TimeStatusEnum.WAIT_START;
- } else if (now2.isAfter(endTime)) {
- return TimeStatusEnum.END;
- } else {
- return TimeStatusEnum.STARTED;
- }
- };
- const _sfc_main$2f = {
- __name: "s-coupon-block",
- props: {
- data: {
- type: Object,
- default: () => ({})
- },
- styles: {
- type: Object,
- default: () => ({})
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const { columns, button } = props.data;
- const SIZE_LIST = ["lg", "md", "xs"];
- const couponBg = {
- background: `url(${sheep$1.$url.cdn(props.data.bgImg)}) no-repeat top center / 100% 100%`
- };
- const btnStyles = {
- background: button.bgColor,
- color: button.color
- };
- const formatCouponDiscountType = (coupon) => {
- if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {
- return "reduce";
- }
- if (coupon.discountType === PromotionDiscountTypeEnum.PERCENT.type) {
- return "percent";
- }
- return `未知【${coupon.discountType}】`;
- };
- const formatCouponDiscountValue = (coupon) => {
- if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {
- return floatToFixed2(coupon.discountPrice);
- }
- if (coupon.discountType === PromotionDiscountTypeEnum.PERCENT.type) {
- return coupon.discountPercent;
- }
- return `未知【${coupon.discountType}】`;
- };
- const formatValidityType = (row) => {
- if (row.validityType === CouponTemplateValidityTypeEnum.DATE.type) {
- return `${formatDate(row.validStartTime)} 至 ${formatDate(row.validEndTime)}`;
- }
- if (row.validityType === CouponTemplateValidityTypeEnum.TERM.type) {
- return `领取后第 ${row.fixedStartTerm} - ${row.fixedEndTerm} 天内可用`;
- }
- return "未知【" + row.validityType + "】";
- };
- const couponList = vue.ref([]);
- async function onGetCoupon(id) {
- const { error: error2, msg } = await CouponApi.takeCoupon(id);
- if (error2 === 0) {
- uni.showToast({
- title: msg,
- icon: "none"
- });
- return;
- }
- await getCouponTemplateList();
- }
- const getCouponTemplateList = async () => {
- const { data } = await CouponApi.getCouponTemplateListByIds(props.data.couponIds.join(","));
- couponList.value = data;
- };
- vue.onMounted(() => {
- getCouponTemplateList();
- });
- const __returned__ = { props, columns, button, SIZE_LIST, couponBg, btnStyles, formatCouponDiscountType, formatCouponDiscountValue, formatValidityType, couponList, onGetCoupon, getCouponTemplateList, get sheep() {
- return sheep$1;
- }, get CouponApi() {
- return CouponApi;
- }, ref: vue.ref, onMounted: vue.onMounted, get CouponTemplateValidityTypeEnum() {
- return CouponTemplateValidityTypeEnum;
- }, get PromotionDiscountTypeEnum() {
- return PromotionDiscountTypeEnum;
- }, get floatToFixed2() {
- return floatToFixed2;
- }, get formatDate() {
- return formatDate;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2e(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_coupon = resolveEasycom(vue.resolveDynamicComponent("su-coupon"), __easycom_0$c);
- return vue.openBlock(), vue.createElementBlock("scroll-view", {
- class: "scroll-box",
- "scroll-x": "",
- "scroll-anchoring": ""
- }, [
- vue.createElementVNode("view", { class: "coupon-box ss-flex" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.couponList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "coupon-item",
- style: vue.normalizeStyle([$setup.couponBg, { marginLeft: `${$props.data.space}px` }]),
- key: index2
- },
- [
- vue.createVNode(_component_su_coupon, {
- size: $setup.SIZE_LIST[$setup.columns - 1],
- textColor: $props.data.textColor,
- background: "",
- couponId: item.id,
- title: item.name,
- type: $setup.formatCouponDiscountType(item),
- value: $setup.formatCouponDiscountValue(item),
- sellBy: $setup.formatValidityType(item)
- }, {
- btn: vue.withCtx(() => [
- vue.createCommentVNode(" 两列时,领取按钮坚排 "),
- $setup.columns === 2 ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- onClick: vue.withModifiers(($event) => $setup.onGetCoupon(item.id), ["stop"]),
- class: "ss-reset-button card-btn vertical",
- style: vue.normalizeStyle([$setup.btnStyles])
- }, [
- vue.createElementVNode("view", { class: "btn-text" }, "立即领取")
- ], 12, ["onClick"])) : (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button card-btn",
- style: vue.normalizeStyle([$setup.btnStyles]),
- onClick: vue.withModifiers(($event) => $setup.onGetCoupon(item.id), ["stop"])
- }, " 立即领取 ", 12, ["onClick"]))
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["size", "textColor", "couponId", "title", "type", "value", "sellBy"])
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }
- const __easycom_19 = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["render", _sfc_render$2e], ["__scopeId", "data-v-6b61b8da"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-coupon-block/s-coupon-block.vue"]]);
- const _sfc_main$2e = {
- __name: "s-richtext-block",
- props: {
- data: {
- type: Object,
- default: {}
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const state = vue.reactive({
- content: ""
- });
- vue.onMounted(async () => {
- const { data } = await ArticleApi.getArticle(props.data.id);
- state.content = data.content;
- });
- const __returned__ = { props, state, reactive: vue.reactive, onMounted: vue.onMounted, get ArticleApi() {
- return ArticleApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2d(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_mp_html = resolveEasycom(vue.resolveDynamicComponent("mp-html"), __easycom_0$r);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle([
- {
- marginLeft: $props.styles.marginLeft + "px",
- marginRight: $props.styles.marginRight + "px",
- marginBottom: $props.styles.marginBottom + "px",
- marginTop: $props.styles.marginTop + "px",
- padding: $props.styles.padding + "px"
- }
- ])
- },
- [
- vue.createVNode(_component_mp_html, {
- class: "richtext",
- content: $setup.state.content
- }, null, 8, ["content"])
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_20 = /* @__PURE__ */ _export_sfc(_sfc_main$2e, [["render", _sfc_render$2d], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-richtext-block/s-richtext-block.vue"]]);
- const _imports_0$5 = "/static/icon/setting.png";
- const _sfc_main$2d = {
- __name: "s-user-card",
- props: {
- background: {
- type: String,
- default: ""
- },
- // 头像
- avatar: {
- type: String,
- default: ""
- },
- nickname: {
- type: String,
- default: () => {
- const {
- t: t2
- } = useI18n();
- return t2("user.please_login");
- }
- },
- username: {
- type: String,
- default: () => {
- const {
- t: t2
- } = useI18n();
- return t2("common.none");
- }
- },
- vip: {
- type: [String, Number],
- default: "1"
- },
- collectNum: {
- type: [String, Number],
- default: "1"
- },
- likeNum: {
- type: [String, Number],
- default: "1"
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- const props = __props;
- function onBind() {
- showAuthModal("changeMobile");
- }
- const __returned__ = { userInfo: userInfo2, isLogin, props, onBind, computed: vue.computed, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get showShareModal() {
- return showShareModal;
- }, get showAuthModal() {
- return showAuthModal;
- }, get useI18n() {
- return useI18n;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2c(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2, _b2;
- return vue.openBlock(), vue.createElementBlock("view", { class: "ss-user-info-wrap ss-p-t-50" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-row-between ss-m-b-20" }, [
- vue.createElementVNode("view", { class: "left-box ss-flex ss-col-center ss-m-l-36" }, [
- vue.createElementVNode("view", { class: "avatar-box ss-m-r-24" }, [
- vue.createElementVNode("image", {
- class: "avatar-img",
- src: $setup.isLogin ? $setup.sheep.$url.cdn($setup.userInfo.avatar) : $setup.sheep.$url.static("/static/images/default_avatar.png"),
- mode: "aspectFill",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/user/info"))
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", null, [
- vue.createElementVNode("view", { class: "nickname-box ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "nick-name ss-m-r-20" },
- vue.toDisplayString(((_a2 = $setup.userInfo) == null ? void 0 : _a2.username) || $props.username),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "user-name ss-m-t-5" },
- vue.toDisplayString(_ctx.$t("user.nickname")) + ":" + vue.toDisplayString(((_b2 = $setup.userInfo) == null ? void 0 : _b2.nickname) || $props.nickname),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode("view", { class: "right-box ss-m-r-30" }, [
- vue.createCommentVNode(` <button class="ss-reset-button" style="margin-right: 20rpx;"
- @tap="showAuthModal('officialAccountFirstLogin')">
- <text class="cicon-service-o"></text>
- </button> `),
- vue.createElementVNode("button", {
- class: "ss-reset-button",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/user/setting"))
- }, [
- vue.createElementVNode("image", {
- src: _imports_0$5,
- class: "audioPaly",
- style: { "width": "40rpx", "height": "40rpx" }
- })
- ])
- ])
- ]),
- vue.createCommentVNode(" 提示绑定手机号 先隐藏 yudao 需要再修改 "),
- vue.createCommentVNode(' <view class="bind-mobile-box ss-flex ss-row-between ss-col-center" v-if="isLogin && !userInfo.mobile">\n <view class="ss-flex">\n <text class="cicon-mobile-o" />\n <view class="mobile-title ss-m-l-20"> 点击绑定手机号确保账户安全 </view>\n </view>\n <button class="ss-reset-button bind-btn" @tap="onBind">去绑定</button>\n </view> ')
- ]);
- }
- const __easycom_21 = /* @__PURE__ */ _export_sfc(_sfc_main$2d, [["render", _sfc_render$2c], ["__scopeId", "data-v-e8581682"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-user-card/s-user-card.vue"]]);
- const _sfc_main$2c = {
- __name: "s-order-card",
- setup(__props, { expose: __expose }) {
- __expose();
- const {
- t: t2
- } = useI18n();
- const orderMap = [
- {
- title: t2("order.pending_payment"),
- value: "1",
- icon: "/static/images/no_pay.png",
- path: "/pages/order/list",
- type: "unpaid",
- count: "unpaidCount"
- },
- {
- title: t2("order.pending_shipment"),
- value: "2",
- icon: "/static/images/change_order.png",
- path: "/pages/order/list",
- type: "undelivered",
- count: "undeliveredCount"
- },
- {
- title: t2("order.pending_receipt"),
- value: "3",
- icon: "/static/images/no_take.png",
- path: "/pages/order/list",
- type: "noget",
- count: "deliveredCount"
- },
- {
- title: t2("order.pending_review"),
- value: "4",
- icon: "/static/images/no_comment.png",
- path: "/pages/order/list",
- type: "nocomment",
- count: "uncommentedCount"
- },
- {
- title: t2("order.all_orders"),
- value: "0",
- icon: "/static/images/all_order.png",
- path: "/pages/order/list"
- }
- ];
- const numData = vue.computed(() => sheep$1.$store("user").numData);
- const __returned__ = { t: t2, orderMap, numData, get sheep() {
- return sheep$1;
- }, computed: vue.computed, get useI18n() {
- return useI18n;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2b(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_badge = resolveEasycom(vue.resolveDynamicComponent("uni-badge"), __easycom_0$j);
- return vue.openBlock(), vue.createElementBlock("view", { class: "ss-order-menu-wrap ss-flex ss-col-center" }, [
- (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.orderMap, (item) => {
- return vue.createElementVNode("view", {
- class: "menu-item ss-flex-1 ss-flex-col ss-row-center ss-col-center",
- key: item.title,
- onClick: ($event) => $setup.sheep.$router.go(item.path, { type: item.value })
- }, [
- vue.createVNode(_component_uni_badge, {
- class: "uni-badge-left-margin",
- text: $setup.numData.orderCount[item.count],
- absolute: "rightTop",
- size: "small"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("image", {
- class: "item-icon",
- src: $setup.sheep.$url.static(item.icon),
- mode: "aspectFit"
- }, null, 8, ["src"])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["text"]),
- vue.createElementVNode(
- "view",
- { class: "menu-title ss-m-t-28" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"]);
- }),
- 64
- /* STABLE_FRAGMENT */
- ))
- ]);
- }
- const __easycom_22 = /* @__PURE__ */ _export_sfc(_sfc_main$2c, [["render", _sfc_render$2b], ["__scopeId", "data-v-85ba17ee"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-order-card/s-order-card.vue"]]);
- const _sfc_main$2b = {
- __name: "s-wallet-card",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- showProtocol: false,
- navIndex: 0
- });
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const numData = vue.computed(() => sheep$1.$store("user").numData);
- const progressWidth = vue.computed(() => {
- if (!userWallet.value.socialStatusPoint && !userWallet.value.socialStatusPoint) {
- return "0%";
- }
- const progress = userWallet.value.socialStatusPoint / (userWallet.value.socialStatusPoint + userWallet.value.socialUpNeed) * 100 + "%";
- return progress;
- });
- function onProtocol(title) {
- sheep$1.$router.go("/pages/public/richtext", {
- title
- });
- }
- const close = () => {
- state.showProtocol = false;
- };
- function checkIndex(index2) {
- state.navIndex = index2;
- }
- const __returned__ = { state, userWallet, userInfo: userInfo2, numData, progressWidth, onProtocol, close, checkIndex, computed: vue.computed, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get fen2yuan() {
- return fen2yuan;
- }, get points2point() {
- return points2point;
- }, Richtext: PagesPublicRichtext };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2a(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createElementVNode("view", {
- class: "progress-box",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.showProtocol = true)
- }, [
- vue.createElementVNode("view", { class: "progress-container" }, [
- vue.createElementVNode(
- "view",
- {
- class: "progress-bar",
- style: vue.normalizeStyle({ width: $setup.progressWidth })
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- { class: "progress-text" },
- vue.toDisplayString($setup.userWallet.socialStatusLevel || _ctx.$t("common.no_level")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(` <view class="ss-wallet-menu-wrap ss-flex ss-col-center">
- <view class="menu-item ss-flex-1 ss-flex-col ss-col-center">
- <view class="value-box ">
- <view class="value-text ">看点</view>
- </view>
- <view class="menu-title ss-m-t-15">*888</view>
- <view class="menu-title ss-m-t-15">看广告做任务得收益</view>
- </view>
- <view class="menu-item ss-flex-1 ss-flex-col ss-col-center"
- @tap="sheep.$router.go('/pages/user/wallet/score')">
- <view class="value-box ">
- <view class="value-text">佣金</view>
- </view>
- <view class="menu-title ss-m-t-15">#{{ userInfo.point || 0 }}</view>
- <view class="menu-title ss-m-t-15">=数字人民币:7263</view>
- 注释 <view class="menu-title ss-m-t-15">=NFR(数字资产):87263</view>
- <view class="menu-mini-title ss-m-t-15">[按32小时市场均值实时换算]</view>
- </view>
- <view class="menu-item ss-flex-1 ss-flex-col ss-col-center"
- @tap="sheep.$router.go('/pages/user/wallet/team')">
- <view class="value-box ">
- <view class="value-text">团队</view>
- </view>
- <view class="menu-title ss-m-t-15">88人</view>
- <view class="menu-title ss-m-t-15">直推人今日贡献#92</view>
- <view class="menu-title ss-m-t-15">直推人总贡献值#7692</view>
- </view>
- <view class="menu-item ss-flex-col ss-col-center menu-wallet">
- <view class="value-box ">
- <view class="value-text">NFR</view>
- </view>
- <view class="menu-title ss-m-t-15">8734枚</view>
- <view class="menu-title ss-m-t-15">历史转换数量</view>
- <view class="menu-title ss-m-t-15">点击跳转查看行情</view>
- </view>
- </view> `),
- vue.createElementVNode("view", { class: "ss-wallet-menu-wrap ss-flex ss-col-center" }, [
- vue.createElementVNode("view", {
- class: "menu-item ss-flex-1 ss-flex-col ss-col-center ss-row-center",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/score"))
- }, [
- vue.createElementVNode("view", { class: "value-box" }, [
- vue.createElementVNode(
- "view",
- { class: "value-text" },
- vue.toDisplayString(_ctx.$t("wallet.wallet")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "menu-title ss-m-t-15 text-center" },
- vue.toDisplayString(_ctx.$t("wallet.commission")) + ":" + vue.toDisplayString($setup.points2point($setup.userWallet.integralDO.currentQuota)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "menu-title ss-m-t-15 text-center" },
- vue.toDisplayString(_ctx.$t("wallet.consumption_points")) + ":" + vue.toDisplayString($setup.points2point($setup.userWallet.integralDO.consumptionPoints)),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(' <view class="menu-title ss-m-t-15">待确权:{{ points2point(userWallet.integralDO.freezeQuota) }}</view> ')
- ]),
- vue.createElementVNode("view", {
- class: "menu-item ss-flex-1 ss-flex-col ss-col-center ss-row-center",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/team"))
- }, [
- vue.createElementVNode("view", { class: "value-box" }, [
- vue.createElementVNode(
- "view",
- { class: "value-text" },
- vue.toDisplayString(_ctx.$t("wallet.team")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "menu-title ss-m-t-15" },
- vue.toDisplayString($setup.userWallet.descNo + " " + _ctx.$t("wallet.people")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(" 佣金确权 "),
- vue.createVNode(_component_su_popup, {
- show: $setup.state.showProtocol,
- type: "center",
- round: "10",
- isMaskClick: false,
- showClose: "",
- onClose: $setup.close
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "head-nav" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([$setup.state.navIndex == 0 ? "activite" : "", "ss-m-l-20"]),
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.checkIndex(0))
- },
- vue.toDisplayString(_ctx.$t("wallet.generation_rules")),
- 3
- /* TEXT, CLASS */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([$setup.state.navIndex == 1 ? "activite" : "", "ss-m-l-20"]),
- onClick: _cache[4] || (_cache[4] = ($event) => $setup.checkIndex(1))
- },
- vue.toDisplayString(_ctx.$t("wallet.benefits")),
- 3
- /* TEXT, CLASS */
- )
- ]),
- vue.createElementVNode("scroll-view", {
- class: "scroll-view_H",
- "scroll-y": "true"
- }, [
- $setup.state.navIndex == 0 ? (vue.openBlock(), vue.createBlock($setup["Richtext"], {
- key: 0,
- title: "身价产生规则",
- type: "tab"
- })) : vue.createCommentVNode("v-if", true),
- $setup.state.navIndex == 1 ? (vue.openBlock(), vue.createBlock($setup["Richtext"], {
- key: 1,
- title: "身价权益",
- type: "tab"
- })) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ]);
- }
- const __easycom_23 = /* @__PURE__ */ _export_sfc(_sfc_main$2b, [["render", _sfc_render$2a], ["__scopeId", "data-v-0aa1f5b2"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-wallet-card/s-wallet-card.vue"]]);
- const _sfc_main$2a = {
- __name: "s-coupon-card",
- props: {
- list: {
- type: Array,
- default() {
- return [
- {
- title: "已领取",
- value: "0",
- icon: "/static/images/nouse_coupon.png",
- path: "/pages/coupon/list",
- type: "geted"
- },
- {
- title: "已使用",
- value: "0",
- icon: "/static/images/useend_coupon.png",
- path: "/pages/coupon/list",
- type: "used"
- },
- {
- title: "已失效",
- value: "0",
- icon: "/static/images/out_coupon.png",
- path: "/pages/coupon/list",
- type: "expired"
- },
- {
- title: "领券中心",
- value: "0",
- icon: "/static/images/all_coupon.png",
- path: "/pages/coupon/list",
- type: "all"
- }
- ];
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$29(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "ss-coupon-menu-wrap ss-flex ss-col-center" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.props.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["menu-item ss-flex-col ss-row-center ss-col-center", item.type === "all" ? "menu-wallet" : "ss-flex-1"]),
- key: item.title,
- onClick: ($event) => $setup.sheep.$router.go(item.path, { type: item.type })
- }, [
- vue.createElementVNode("image", {
- class: "item-icon",
- src: $setup.sheep.$url.static(item.icon),
- mode: "aspectFit"
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "view",
- { class: "menu-title ss-m-t-28" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- )
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }
- const __easycom_24 = /* @__PURE__ */ _export_sfc(_sfc_main$2a, [["render", _sfc_render$29], ["__scopeId", "data-v-245dca84"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-coupon-card/s-coupon-card.vue"]]);
- const _sfc_main$29 = {
- __name: "s-block-item",
- props: {
- type: {
- type: String,
- default: ""
- },
- data: {
- type: Object,
- default() {
- }
- },
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- function onSearch() {
- }
- const __returned__ = { props, onSearch };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$28(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_search_block = resolveEasycom(vue.resolveDynamicComponent("s-search-block"), __easycom_0$n);
- const _component_s_notice_block = resolveEasycom(vue.resolveDynamicComponent("s-notice-block"), __easycom_1$7);
- const _component_s_menu_button = resolveEasycom(vue.resolveDynamicComponent("s-menu-button"), __easycom_2$4);
- const _component_s_menu_list = resolveEasycom(vue.resolveDynamicComponent("s-menu-list"), __easycom_3$6);
- const _component_s_menu_grid = resolveEasycom(vue.resolveDynamicComponent("s-menu-grid"), __easycom_4$1);
- const _component_s_popup_image = resolveEasycom(vue.resolveDynamicComponent("s-popup-image"), __easycom_5$1);
- const _component_s_float_menu = resolveEasycom(vue.resolveDynamicComponent("s-float-menu"), __easycom_6);
- const _component_s_image_block = resolveEasycom(vue.resolveDynamicComponent("s-image-block"), __easycom_7);
- const _component_s_image_banner = resolveEasycom(vue.resolveDynamicComponent("s-image-banner"), __easycom_8$1);
- const _component_s_title_block = resolveEasycom(vue.resolveDynamicComponent("s-title-block"), __easycom_9);
- const _component_s_image_cube = resolveEasycom(vue.resolveDynamicComponent("s-image-cube"), __easycom_10);
- const _component_s_video_block = resolveEasycom(vue.resolveDynamicComponent("s-video-block"), __easycom_11);
- const _component_s_line_block = resolveEasycom(vue.resolveDynamicComponent("s-line-block"), __easycom_12);
- const _component_s_hotzone_block = resolveEasycom(vue.resolveDynamicComponent("s-hotzone-block"), __easycom_13);
- const _component_s_goods_card = resolveEasycom(vue.resolveDynamicComponent("s-goods-card"), __easycom_14);
- const _component_s_goods_shelves = resolveEasycom(vue.resolveDynamicComponent("s-goods-shelves"), __easycom_15);
- const _component_s_groupon_block = resolveEasycom(vue.resolveDynamicComponent("s-groupon-block"), __easycom_16);
- const _component_s_seckill_block = resolveEasycom(vue.resolveDynamicComponent("s-seckill-block"), __easycom_17);
- const _component_s_live_block = resolveEasycom(vue.resolveDynamicComponent("s-live-block"), __easycom_18);
- const _component_s_coupon_block = resolveEasycom(vue.resolveDynamicComponent("s-coupon-block"), __easycom_19);
- const _component_s_richtext_block = resolveEasycom(vue.resolveDynamicComponent("s-richtext-block"), __easycom_20);
- const _component_s_user_card = resolveEasycom(vue.resolveDynamicComponent("s-user-card"), __easycom_21);
- const _component_s_order_card = resolveEasycom(vue.resolveDynamicComponent("s-order-card"), __easycom_22);
- const _component_s_wallet_card = resolveEasycom(vue.resolveDynamicComponent("s-wallet-card"), __easycom_23);
- const _component_s_coupon_card = resolveEasycom(vue.resolveDynamicComponent("s-coupon-card"), __easycom_24);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 基础组件:搜索框 "),
- $props.type === "SearchBar" ? (vue.openBlock(), vue.createBlock(_component_s_search_block, {
- key: 0,
- data: $props.data,
- styles: $props.styles,
- navbar: false
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 基础组件:公告栏 "),
- $props.type === "NoticeBar" ? (vue.openBlock(), vue.createBlock(_component_s_notice_block, {
- key: 1,
- data: $props.data
- }, null, 8, ["data"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 基础组件:菜单导航 "),
- $props.type === "MenuSwiper" ? (vue.openBlock(), vue.createBlock(_component_s_menu_button, {
- key: 2,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 基础组件:列表导航 "),
- $props.type === "MenuList" ? (vue.openBlock(), vue.createBlock(_component_s_menu_list, {
- key: 3,
- data: $props.data
- }, null, 8, ["data"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 基础组件:宫格导航 "),
- $props.type === "MenuGrid" ? (vue.openBlock(), vue.createBlock(_component_s_menu_grid, {
- key: 4,
- data: $props.data
- }, null, 8, ["data"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 基础组件:弹窗广告 "),
- $props.type === "Popover" ? (vue.openBlock(), vue.createBlock(_component_s_popup_image, {
- key: 5,
- data: $props.data
- }, null, 8, ["data"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 基础组件:悬浮按钮 "),
- $props.type === "FloatingActionButton" ? (vue.openBlock(), vue.createBlock(_component_s_float_menu, {
- key: 6,
- data: $props.data
- }, null, 8, ["data"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 图文组件:图片展示 "),
- $props.type === "ImageBar" ? (vue.openBlock(), vue.createBlock(_component_s_image_block, {
- key: 7,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 图文组件:图片轮播 "),
- $props.type === "Carousel" ? (vue.openBlock(), vue.createBlock(_component_s_image_banner, {
- key: 8,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 基础组件:标题栏 "),
- $props.type === "TitleBar" ? (vue.openBlock(), vue.createBlock(_component_s_title_block, {
- key: 9,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 图文组件:广告魔方 "),
- $props.type === "MagicCube" ? (vue.openBlock(), vue.createBlock(_component_s_image_cube, {
- key: 10,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 图文组件:视频播放 "),
- $props.type === "VideoPlayer" ? (vue.openBlock(), vue.createBlock(_component_s_video_block, {
- key: 11,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 基础组件:分割线 "),
- $props.type === "Divider" ? (vue.openBlock(), vue.createBlock(_component_s_line_block, {
- key: 12,
- data: $props.data
- }, null, 8, ["data"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 图文组件:热区 "),
- $props.type === "HotZone" ? (vue.openBlock(), vue.createBlock(_component_s_hotzone_block, {
- key: 13,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 商品组件:商品卡片 "),
- $props.type === "ProductCard" ? (vue.openBlock(), vue.createBlock(_component_s_goods_card, {
- key: 14,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 商品组件:商品栏 "),
- $props.type === "ProductList" ? (vue.openBlock(), vue.createBlock(_component_s_goods_shelves, {
- key: 15,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 营销组件:拼团 "),
- $props.type === "PromotionCombination" ? (vue.openBlock(), vue.createBlock(_component_s_groupon_block, {
- key: 16,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 营销组件:秒杀 "),
- $props.type === "PromotionSeckill" ? (vue.openBlock(), vue.createBlock(_component_s_seckill_block, {
- key: 17,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 营销组件:小程序直播(暂时没有这个功能) "),
- $props.type === "MpLive" ? (vue.openBlock(), vue.createBlock(_component_s_live_block, {
- key: 18,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 营销组件:优惠券 "),
- $props.type === "CouponCard" ? (vue.openBlock(), vue.createBlock(_component_s_coupon_block, {
- key: 19,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 营销组件:文章 "),
- $props.type === "PromotionArticle" ? (vue.openBlock(), vue.createBlock(_component_s_richtext_block, {
- key: 20,
- data: $props.data,
- styles: $props.styles
- }, null, 8, ["data", "styles"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 用户组件:用户卡片 "),
- $props.type === "UserCard" ? (vue.openBlock(), vue.createBlock(_component_s_user_card, { key: 21 })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 用户组件:用户订单 "),
- $props.type === "UserOrder" ? (vue.openBlock(), vue.createBlock(_component_s_order_card, {
- key: 22,
- data: $props.data
- }, null, 8, ["data"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 用户组件:用户资产 "),
- $props.type === "UserWallet" ? (vue.openBlock(), vue.createBlock(_component_s_wallet_card, { key: 23 })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 用户组件:用户卡券 "),
- $props.type === "UserCoupon" ? (vue.openBlock(), vue.createBlock(_component_s_coupon_card, { key: 24 })) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_1$3 = /* @__PURE__ */ _export_sfc(_sfc_main$29, [["render", _sfc_render$28], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-block-item/s-block-item.vue"]]);
- const _sfc_main$28 = {
- __name: "s-block",
- props: {
- styles: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const elBackground = vue.computed(() => {
- if (props.styles) {
- if (props.styles.bgType === "color")
- return { background: props.styles.bgColor };
- if (props.styles.bgType === "img")
- return {
- background: `url(${sheep$1.$url.cdn(
- props.styles.bgImage
- )}) no-repeat top center / 100% auto`
- };
- }
- });
- const elStyles = vue.computed(() => {
- if (props.styles) {
- return {
- marginTop: `${props.styles.marginTop || 0}px`,
- marginBottom: `${props.styles.marginBottom || 0}px`,
- marginLeft: `${props.styles.marginLeft || 0}px`,
- marginRight: `${props.styles.marginRight || 0}px`,
- paddingTop: `${props.styles.paddingTop || 0}px`,
- paddingRight: `${props.styles.paddingRight || 0}px`,
- paddingBottom: `${props.styles.paddingBottom || 0}px`,
- paddingLeft: `${props.styles.paddingLeft || 0}px`,
- borderTopLeftRadius: `${props.styles.borderTopLeftRadius || 0}px`,
- borderTopRightRadius: `${props.styles.borderTopRightRadius || 0}px`,
- borderBottomRightRadius: `${props.styles.borderBottomRightRadius || 0}px`,
- borderBottomLeftRadius: `${props.styles.borderBottomLeftRadius || 0}px`,
- overflow: "hidden"
- };
- }
- });
- const __returned__ = { props, elBackground, elStyles, computed: vue.computed, provide: vue.provide, unref: vue.unref, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$27(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle([$setup.elStyles, $setup.elBackground])
- },
- [
- vue.renderSlot(_ctx.$slots, "default")
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_2$3 = /* @__PURE__ */ _export_sfc(_sfc_main$28, [["render", _sfc_render$27], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-block/s-block.vue"]]);
- const _sfc_main$27 = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- uni.hideTabBar();
- const template = vue.computed(() => {
- var _a2;
- return (_a2 = sheep$1.$store("app").template) == null ? void 0 : _a2.home;
- });
- onLoad((options2) => {
- if (options2.templateId) {
- sheep$1.$store("app").init(options2.templateId);
- }
- if (options2.spm) {
- $share.decryptSpm(options2.spm);
- }
- if (options2.page) {
- sheep$1.$router.go(decodeURIComponent(options2.page));
- }
- if (options2.points !== void 0 || options2.scoialStatus !== void 0) {
- showWalletModal({ points: options2.points, socialStatus: options2.socialStatus });
- }
- });
- onPullDownRefresh(() => {
- sheep$1.$store("app").init();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 800);
- });
- onPageScroll(() => {
- });
- const __returned__ = { template, computed: vue.computed, get onLoad() {
- return onLoad;
- }, get onPageScroll() {
- return onPageScroll;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get sheep() {
- return sheep$1;
- }, get $share() {
- return $share;
- }, get isAndroid() {
- return isAndroid;
- }, get getAndroidJiGuangId() {
- return getAndroidJiGuangId;
- }, get showWalletModal() {
- return showWalletModal;
- }, get colseWalletModal() {
- return colseWalletModal;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$26(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2;
- const _component_s_block_item = resolveEasycom(vue.resolveDynamicComponent("s-block-item"), __easycom_1$3);
- const _component_s_block = resolveEasycom(vue.resolveDynamicComponent("s-block"), __easycom_2$3);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return $setup.template ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createVNode(_component_s_layout, {
- title: _ctx.$t("common.home"),
- navbar: "custom",
- tabbar: "/pages/index/index",
- bgStyle: $setup.template.page,
- navbarStyle: (_a2 = $setup.template.style) == null ? void 0 : _a2.navbar,
- onShareAppMessage: ""
- }, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.template.components, (item, index2) => {
- return vue.openBlock(), vue.createBlock(_component_s_block, {
- key: index2,
- styles: item.property.style
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_block_item, {
- type: item.id,
- data: item.property,
- styles: item.property.style
- }, null, 8, ["type", "data", "styles"])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["styles"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title", "bgStyle", "navbarStyle"])
- ])) : vue.createCommentVNode("v-if", true);
- }
- const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$27, [["render", _sfc_render$26], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/index.vue"]]);
- const _sfc_main$26 = {
- __name: "user",
- setup(__props, { expose: __expose }) {
- __expose();
- uni.hideTabBar();
- const template = vue.computed(() => sheep$1.$store("app").template.user);
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- onShow(() => {
- sheep$1.$store("user").updateUserData();
- });
- onPullDownRefresh(() => {
- sheep$1.$store("user").updateUserData();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 800);
- });
- onPageScroll(() => {
- });
- onLoad((options2) => {
- if (options2.linkId) {
- uni.setStorageSync("linkId", options2.linkId);
- if (!isLogin.value) {
- showAuthModal("register", "register");
- }
- }
- });
- const __returned__ = { template, isLogin, computed: vue.computed, get onShow() {
- return onShow;
- }, get onPageScroll() {
- return onPageScroll;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get onLoad() {
- return onLoad;
- }, get sheep() {
- return sheep$1;
- }, get closeShareModal() {
- return closeShareModal;
- }, get showAuthModal() {
- return showAuthModal;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$25(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2;
- const _component_s_block_item = resolveEasycom(vue.resolveDynamicComponent("s-block-item"), __easycom_1$3);
- const _component_s_block = resolveEasycom(vue.resolveDynamicComponent("s-block"), __easycom_2$3);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: "我的",
- tabbar: "/pages/index/user",
- navbar: "custom",
- bgStyle: $setup.template.page,
- navbarStyle: (_a2 = $setup.template.style) == null ? void 0 : _a2.navbar,
- onShareAppMessage: ""
- }, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.template.components, (item, index2) => {
- return vue.openBlock(), vue.createBlock(_component_s_block, {
- key: index2,
- styles: item.property.style
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_block_item, {
- type: item.id,
- data: item.property,
- styles: item.property.style
- }, null, 8, ["type", "data", "styles"])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["styles"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["bgStyle", "navbarStyle"]);
- }
- const PagesIndexUser = /* @__PURE__ */ _export_sfc(_sfc_main$26, [["render", _sfc_render$25], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/user.vue"]]);
- const _sfc_main$25 = {
- __name: "second-one",
- props: {
- data: {
- type: Object,
- default: () => ({})
- },
- activeMenu: [Number, String]
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$24(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 一级分类的名字 "),
- vue.createElementVNode("view", { class: "title-box ss-flex ss-col-center ss-row-center ss-p-b-30" }, [
- vue.createElementVNode("view", { class: "title-line-left" }),
- vue.createElementVNode(
- "view",
- { class: "title-text ss-p-x-20" },
- vue.toDisplayString($setup.props.data[$props.activeMenu].name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "title-line-right" })
- ]),
- vue.createCommentVNode(" 二级分类的名字 "),
- vue.createElementVNode("view", { class: "goods-item-box ss-flex ss-flex-wrap ss-p-b-20" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.props.data[$props.activeMenu].children, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "goods-item",
- key: item.id,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/list", {
- categoryId: item.id
- })
- }, [
- vue.createElementVNode("image", {
- class: "goods-img",
- src: item.picUrl,
- mode: "aspectFill"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "ss-p-10" }, [
- vue.createElementVNode(
- "view",
- { class: "goods-title ss-line-1" },
- vue.toDisplayString(item.name),
- 1
- /* TEXT */
- )
- ])
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }
- const secondOne = /* @__PURE__ */ _export_sfc(_sfc_main$25, [["render", _sfc_render$24], ["__scopeId", "data-v-c7b30c59"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/components/second-one.vue"]]);
- const _sfc_main$24 = {
- __name: "first-one",
- props: {
- pagination: Object
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$23(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock("view", { class: "ss-flex-col" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "goods-box",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_column, {
- size: "sl",
- data: item,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id })
- }, null, 8, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }
- const firstOne = /* @__PURE__ */ _export_sfc(_sfc_main$24, [["render", _sfc_render$23], ["__scopeId", "data-v-f8bc43e1"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/components/first-one.vue"]]);
- const _sfc_main$23 = {
- __name: "first-two",
- props: {
- pagination: Object
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- }, get fen2yuan() {
- return fen2yuan;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$22(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2;
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createElementVNode("view", { class: "ss-flex flex-wrap" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList((_a2 = $props.pagination) == null ? void 0 : _a2.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "goods-box",
- key: item.id
- }, [
- vue.createElementVNode("view", {
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id })
- }, [
- vue.createElementVNode("view", { class: "goods-img" }, [
- vue.createElementVNode("image", {
- class: "goods-img",
- src: item.picUrl,
- mode: "aspectFit"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "goods-content" }, [
- vue.createElementVNode(
- "view",
- { class: "goods-title ss-line-1 ss-m-b-28" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "goods-price" },
- "¥" + vue.toDisplayString($setup.fen2yuan(item.price)),
- 1
- /* TEXT */
- )
- ])
- ], 8, ["onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }
- const firstTwo = /* @__PURE__ */ _export_sfc(_sfc_main$23, [["render", _sfc_render$22], ["__scopeId", "data-v-80c21380"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/components/first-two.vue"]]);
- const _sfc_main$22 = {
- __name: "category",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- style: "second_one",
- // first_one(一级 - 样式一), first_two(二级 - 样式二), second_one(二级)
- categoryList: [],
- // 商品分类树
- activeMenu: 0,
- // 选中的一级菜单,在 categoryList 的下标
- pagination: {
- // 商品分页
- list: [],
- // 商品列表
- total: [],
- // 商品总数
- pageNo: 1,
- pageSize: 6
- },
- loadStatus: ""
- });
- const {
- safeArea
- } = sheep$1.$platform.device;
- const pageHeight = vue.computed(() => safeArea.height - 44 - 50);
- async function getList() {
- const {
- code: code2,
- data
- } = await CategoryApi.getCategoryList();
- if (code2 !== 0) {
- return;
- }
- state.categoryList = handleTree(data);
- }
- const onMenu = (val) => {
- state.activeMenu = val;
- if (state.style === "first_one" || state.style === "first_two") {
- state.pagination.pageNo = 1;
- state.pagination.list = [];
- state.pagination.total = 0;
- getGoodsList();
- }
- };
- async function getGoodsList() {
- state.loadStatus = "loading";
- const res = await SpuApi.getSpuPage({
- categoryId: state.categoryList[state.activeMenu].id,
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (res.code !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, res.data.list);
- state.pagination.total = res.data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getGoodsList();
- }
- onLoad(async () => {
- await getList();
- if (state.style === "first_one" || state.style === "first_two") {
- onMenu(0);
- }
- });
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { state, safeArea, pageHeight, getList, onMenu, getGoodsList, loadMore, secondOne, firstOne, firstTwo, get sheep() {
- return sheep$1;
- }, get CategoryApi() {
- return CategoryApi;
- }, get SpuApi() {
- return SpuApi;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get _() {
- return _$1;
- }, get handleTree() {
- return handleTree;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$21(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("common.category"),
- tabbar: "/pages/index/category",
- bgStyle: { color: "#fff" }
- }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createElementVNode("view", { class: "s-category" }, [
- vue.createElementVNode(
- "view",
- {
- class: "three-level-wrap ss-flex ss-col-top",
- style: vue.normalizeStyle([{ height: $setup.pageHeight + "px" }])
- },
- [
- vue.createCommentVNode(" 商品分类(左) "),
- vue.createElementVNode(
- "scroll-view",
- {
- class: "side-menu-wrap",
- "scroll-y": "",
- style: vue.normalizeStyle([{ height: $setup.pageHeight + "px" }])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.categoryList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["menu-item ss-flex", [{ "menu-item-active": index2 === $setup.state.activeMenu }]]),
- key: item.id,
- onClick: ($event) => $setup.onMenu(index2)
- }, [
- vue.createElementVNode(
- "view",
- { class: "menu-title ss-line-1" },
- vue.toDisplayString(item.name),
- 1
- /* TEXT */
- )
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 商品分类(右) "),
- ((_a2 = $setup.state.categoryList) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createElementBlock(
- "scroll-view",
- {
- key: 0,
- class: "goods-list-box",
- "scroll-y": "",
- style: vue.normalizeStyle([{ height: $setup.pageHeight + "px" }])
- },
- [
- $setup.state.categoryList[$setup.state.activeMenu].picUrl ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "banner-img",
- src: $setup.sheep.$url.cdn($setup.state.categoryList[$setup.state.activeMenu].picUrl),
- mode: "widthFix"
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- $setup.state.style === "first_one" ? (vue.openBlock(), vue.createBlock($setup["firstOne"], {
- key: 1,
- pagination: $setup.state.pagination
- }, null, 8, ["pagination"])) : vue.createCommentVNode("v-if", true),
- $setup.state.style === "first_two" ? (vue.openBlock(), vue.createBlock($setup["firstTwo"], {
- key: 2,
- pagination: $setup.state.pagination
- }, null, 8, ["pagination"])) : vue.createCommentVNode("v-if", true),
- $setup.state.style === "second_one" ? (vue.openBlock(), vue.createBlock($setup["secondOne"], {
- key: 3,
- data: $setup.state.categoryList,
- activeMenu: $setup.state.activeMenu
- }, null, 8, ["data", "activeMenu"])) : vue.createCommentVNode("v-if", true),
- ($setup.state.style === "first_one" || $setup.state.style === "first_two") && $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 4,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "点击查看更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesIndexCategory = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["render", _sfc_render$21], ["__scopeId", "data-v-1031f1cf"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/category.vue"]]);
- const _sfc_main$21 = {
- name: "UniNumberBox",
- emits: ["change", "input", "update:modelValue", "blur", "focus"],
- props: {
- value: {
- type: [Number, String],
- default: 1
- },
- modelValue: {
- type: [Number, String],
- default: 1
- },
- min: {
- type: Number,
- default: 0
- },
- max: {
- type: Number,
- default: 100
- },
- step: {
- type: Number,
- default: 1
- },
- background: {
- type: String,
- default: "#f5f5f5"
- },
- color: {
- type: String,
- default: "#333"
- },
- disabled: {
- type: Boolean,
- default: false
- },
- activity: {
- type: String,
- default: "none"
- }
- },
- data() {
- return {
- inputValue: 0
- };
- },
- watch: {
- value(val) {
- this.inputValue = +val;
- },
- modelValue(val) {
- this.inputValue = +val;
- }
- },
- created() {
- if (this.value === 1) {
- this.inputValue = +this.modelValue;
- }
- if (this.modelValue === 1) {
- this.inputValue = +this.value;
- }
- },
- methods: {
- _calcValue(type) {
- if (this.disabled) {
- return;
- }
- const scale = this._getDecimalScale();
- let value = this.inputValue * scale;
- let step = this.step * scale;
- if (type === "minus") {
- value -= step;
- if (value < this.min * scale) {
- return;
- }
- if (value > this.max * scale) {
- value = this.max * scale;
- }
- }
- if (type === "plus") {
- value += step;
- if (value > this.max * scale) {
- return;
- }
- if (value < this.min * scale) {
- value = this.min * scale;
- }
- }
- this.inputValue = (value / scale).toFixed(String(scale).length - 1);
- this.$emit("change", +this.inputValue);
- this.$emit("input", +this.inputValue);
- this.$emit("update:modelValue", +this.inputValue);
- },
- _getDecimalScale() {
- let scale = 1;
- if (~~this.step !== this.step) {
- scale = Math.pow(10, String(this.step).split(".")[1].length);
- }
- return scale;
- },
- _onBlur(event) {
- this.$emit("blur", event);
- let value = event.detail.value;
- if (!value) {
- return;
- }
- value = +value;
- if (value > this.max) {
- value = this.max;
- } else if (value < this.min) {
- value = this.min;
- }
- const scale = this._getDecimalScale();
- this.inputValue = value.toFixed(String(scale).length - 1);
- this.$emit("change", +this.inputValue);
- this.$emit("input", +this.inputValue);
- },
- _onFocus(event) {
- this.$emit("focus", event);
- }
- }
- };
- function _sfc_render$20(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-numbox" }, [
- vue.createCommentVNode(` <view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{ background }"> `),
- vue.createCommentVNode(` <text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }"
- :style="{ color }">
- -
- </text> `),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["cicon-move-round", {
- "uni-numbox--disabled": $data.inputValue <= $props.min || $props.disabled,
- "groupon-btn": $props.activity === "groupon",
- "seckill-btn": $props.activity === "seckill"
- }]),
- onClick: _cache[0] || (_cache[0] = ($event) => $options._calcValue("minus"))
- },
- null,
- 2
- /* CLASS */
- ),
- vue.createCommentVNode(" </view> "),
- vue.withDirectives(vue.createElementVNode("input", {
- disabled: $props.disabled,
- onFocus: _cache[1] || (_cache[1] = (...args) => $options._onFocus && $options._onFocus(...args)),
- onBlur: _cache[2] || (_cache[2] = (...args) => $options._onBlur && $options._onBlur(...args)),
- class: "uni-numbox__value",
- type: "number",
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.inputValue = $event),
- style: vue.normalizeStyle({ color: $props.color })
- }, null, 44, ["disabled"]), [
- [vue.vModelText, $data.inputValue]
- ]),
- vue.createCommentVNode(` <view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns">
- <text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }">+</text>
- </view> `),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["cicon-add-round", {
- "uni-numbox--disabled": $data.inputValue >= $props.max || $props.disabled,
- "groupon-btn": $props.activity === "groupon",
- "seckill-btn": $props.activity === "seckill"
- }]),
- onClick: _cache[4] || (_cache[4] = ($event) => $options._calcValue("plus"))
- },
- null,
- 2
- /* CLASS */
- )
- ]);
- }
- const __easycom_0$b = /* @__PURE__ */ _export_sfc(_sfc_main$21, [["render", _sfc_render$20], ["__scopeId", "data-v-5212235c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-number-box/su-number-box.vue"]]);
- const _sfc_main$20 = {
- __name: "cart",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "c30a4c2b-sys_navBar": vue.unref(sys_navBar)
- }));
- const sys_navBar = sheep$1.$platform.navbar;
- const cart2 = sheep$1.$store("cart");
- const state = vue.reactive({
- editMode: false,
- list: vue.computed(() => cart2.list),
- shopList: vue.computed(() => cart2.shopNameMap),
- skuList: vue.computed(() => cart2.shopSkuMap),
- selectedList: [],
- selectedIds: vue.computed(() => cart2.selectedIds),
- isAllSelected: vue.computed(() => cart2.isAllSelected),
- totalPriceSelected: vue.computed(() => cart2.totalPriceSelected)
- });
- const processedValidList = vue.computed(() => {
- const groups = {};
- state.list.forEach((item) => {
- const shopId = Object.keys(state.skuList).find((key) => state.skuList[key].includes(item.sku.id));
- const shopName = state.shopList[shopId] || "未知店铺";
- if (!groups[shopName]) {
- groups[shopName] = [];
- }
- groups[shopName].push(item);
- });
- return groups;
- });
- function onSelectSingle(id) {
- formatAppLog("log", "at pages/index/cart.vue:129", "单选");
- cart2.selectSingle(id);
- }
- function onSelectAll() {
- cart2.selectAll(!state.isAllSelected);
- }
- function onConfirm() {
- let items = [];
- let goods_list = [];
- state.selectedList = state.list.filter((item) => state.selectedIds.includes(item.id));
- state.selectedList.map((item) => {
- items.push({
- skuId: item.sku.id,
- count: item.count,
- cartId: item.id
- });
- goods_list.push({
- // goods_id: item.goods_id,
- goods_id: item.spu.id,
- // goods_num: item.goods_num,
- goods_num: item.count
- // 商品价格id真没有
- // goods_sku_price_id: item.goods_sku_price_id,
- });
- });
- if (goods_list.length === 0) {
- sheep$1.$helper.toast("请选择商品");
- return;
- }
- sheep$1.$router.go("/pages/order/confirm", {
- data: JSON.stringify({
- // order_type: 'goods',
- // goods_list,
- items,
- // from: 'cart',
- pointStatus: false,
- // 从购物车这里提交订单的 一定是实体商品和用人民币买的 所以可以直接写死
- deliveryType: 1,
- spuPayType: 1,
- spuType: 1
- })
- });
- }
- function onNumberChange(e2, cartItem) {
- if (e2 === 0) {
- cart2.delete(cartItem.id);
- return;
- }
- if (cartItem.goods_num === e2)
- return;
- cartItem.goods_num = e2;
- cart2.update({
- goods_id: cartItem.id,
- goods_num: e2,
- goods_sku_price_id: cartItem.goods_sku_price_id
- });
- }
- async function onDelete() {
- cart2.delete(state.selectedIds);
- }
- const __returned__ = { sys_navBar, cart: cart2, state, processedValidList, onSelectSingle, onSelectAll, onConfirm, onNumberChange, onDelete, get sheep() {
- return sheep$1;
- }, computed: vue.computed, reactive: vue.reactive, unref: vue.unref, get fen2yuan() {
- return fen2yuan;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1$(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_su_number_box = resolveEasycom(vue.resolveDynamicComponent("su-number-box"), __easycom_0$b);
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("common.cart"),
- tabbar: "/pages/index/cart",
- bgStyle: { color: "#fff" }
- }, {
- default: vue.withCtx(() => [
- $setup.state.list.length === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- text: _ctx.$t("common.empty_cart"),
- icon: "/static/cart-empty.png"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 头部 "),
- $setup.state.list.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "cart-box ss-flex ss-flex-col ss-row-between"
- }, [
- vue.createElementVNode("view", { class: "cart-header ss-flex ss-col-center ss-row-between ss-p-x-30" }, [
- vue.createElementVNode("view", { class: "header-left ss-flex ss-col-center ss-font-26" }, [
- vue.createElementVNode(
- "text",
- { class: "goods-number ui-TC-Main ss-flex" },
- vue.toDisplayString(_ctx.$t("common.total_goods", { number: $setup.state.list.length })),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "header-right" }, [
- $setup.state.editMode ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.editMode = false)
- },
- vue.toDisplayString(_ctx.$t("common.cancel")),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-reset-button ui-TC-Main",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.state.editMode = true)
- },
- vue.toDisplayString(_ctx.$t("common.edit")),
- 1
- /* TEXT */
- ))
- ])
- ]),
- vue.createElementVNode("view", { class: "ss-m-t-70" }),
- vue.createCommentVNode(" 内容 "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.processedValidList, (shopItems, shopName, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "cart-content ss-flex-1 ss-p-x-30",
- key: shopName
- }, [
- vue.createElementVNode("view", { class: "ss-m-b-14 bg-white goods-box" }, [
- vue.createElementVNode("view", { class: "title-text ss-p-x-10 ss-p-t-20 ss-flex ss-col-center" }, [
- vue.createCommentVNode(' <label class="check-box ss-flex ss-col-center" @tap="onSelectSingle()">\n <radio color="var(--ui-BG-Main)" style="transform: scale(0.8)" />\n </label> '),
- vue.createElementVNode(
- "text",
- { class: "ss-m-l-10" },
- vue.toDisplayString(shopName),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 注意这里v-for的对象是shopItems "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(shopItems, (product, productIndex) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "ss-r-10",
- key: product.id
- }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode("label", {
- class: "check-box ss-flex ss-col-center ss-p-l-10",
- onClick: ($event) => $setup.onSelectSingle(product.id)
- }, [
- vue.createElementVNode("radio", {
- checked: $setup.state.selectedIds.includes(product.id),
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- onClick: vue.withModifiers(($event) => $setup.onSelectSingle(product.id), ["stop"])
- }, null, 8, ["checked", "onClick"])
- ], 8, ["onClick"]),
- vue.createVNode(_component_s_goods_item, {
- title: product.spu.name,
- img: product.spu.picUrl || product.goods.image,
- price: product.sku.price,
- skuText: product.sku.properties.length > 1 ? product.sku.properties.reduce((items2, items) => items2.valueName + " " + items.valueName) : product.sku.properties[0].valueName,
- priceColor: "#FF3000",
- titleWidth: 400
- }, vue.createSlots({
- _: 2
- /* DYNAMIC */
- }, [
- !$setup.state.editMode ? {
- name: "tool",
- fn: vue.withCtx(() => [
- vue.createVNode(_component_su_number_box, {
- min: 0,
- max: product.sku.stock,
- step: 1,
- modelValue: product.count,
- "onUpdate:modelValue": ($event) => product.count = $event,
- onChange: ($event) => $setup.onNumberChange($event, product)
- }, null, 8, ["max", "modelValue", "onUpdate:modelValue", "onChange"])
- ]),
- key: "0"
- } : void 0
- ]), 1032, ["title", "img", "price", "skuText"])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createCommentVNode(" 底部 "),
- $setup.state.list.length > 0 ? (vue.openBlock(), vue.createBlock(_component_su_fixed, {
- key: 0,
- bottom: "",
- val: 48,
- placeholder: "",
- isInset: false
- }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createElementVNode("view", { class: "cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom" }, [
- vue.createElementVNode("view", { class: "footer-left ss-flex ss-col-center" }, [
- vue.createElementVNode("label", {
- class: "check-box ss-flex ss-col-center ss-p-r-30",
- onClick: $setup.onSelectAll
- }, [
- vue.createElementVNode("radio", {
- checked: $setup.state.isAllSelected,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- onClick: vue.withModifiers($setup.onSelectAll, ["stop"])
- }, null, 8, ["checked"]),
- vue.createElementVNode(
- "view",
- { class: "ss-m-l-8" },
- vue.toDisplayString(_ctx.$t("common.all")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString(_ctx.$t("common.total")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "text-price price-text" },
- vue.toDisplayString($setup.fen2yuan($setup.state.totalPriceSelected)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "footer-right" }, [
- $setup.state.editMode ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button ui-BG-Main-Gradient pay-btn ui-Shadow-Main",
- onClick: $setup.onDelete
- },
- vue.toDisplayString(_ctx.$t("common.delete")),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-reset-button ui-BG-Main-Gradient pay-btn ui-Shadow-Main",
- onClick: $setup.onConfirm
- },
- vue.toDisplayString(_ctx.$t("common.checkout")) + " " + vue.toDisplayString(((_a2 = $setup.state.selectedIds) == null ? void 0 : _a2.length) ? `(${$setup.state.selectedIds.length})` : ""),
- 1
- /* TEXT */
- ))
- ])
- ])
- ];
- }),
- _: 1
- /* STABLE */
- })) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesIndexCart = /* @__PURE__ */ _export_sfc(_sfc_main$20, [["render", _sfc_render$1$], ["__scopeId", "data-v-c30a4c2b"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/cart.vue"]]);
- const _sfc_main$1$ = {
- __name: "login",
- setup(__props, { expose: __expose }) {
- __expose();
- const mobileInput = (mobile2, mobileError) => {
- state.model.mobile = mobile2;
- state.mobileErrorMsg = mobileError;
- };
- const state = vue.reactive({
- verifyUsername: false,
- usernameErrorMsg: "",
- mobileErrorMsg: "",
- openid: "",
- socialUsers: [],
- registerReqVO: {
- type: 31,
- code: "",
- state: "",
- username: ""
- },
- isMobileEnd: false,
- // 手机号输入完毕
- codeText: "获取验证码",
- model: {
- mobile: "",
- // 手机号
- code: "",
- // 验证码
- scene: 1
- },
- rules: {
- code,
- mobile
- }
- });
- const isPopup = vue.ref(false);
- const selectSocialUsers = vue.ref(false);
- function updateIsPopup() {
- isPopup.value = true;
- }
- function updateSocialUsers(openid, socialUsers) {
- selectSocialUsers.value = true;
- state.openid = openid;
- state.socialUsers = socialUsers;
- formatAppLog("log", "at pages/index/login.vue:138", "updateSocialUsers条用了,这时state.socialUsers是", state.socialUsers);
- }
- function locationReplace(url2) {
- if (history.replaceState) {
- history.replaceState(null, document.title, url2);
- history.go(0);
- } else {
- location.replace(url2);
- }
- }
- async function selectUser(username2) {
- formatAppLog("log", "at pages/index/login.vue:150", username2);
- const {
- code: code2
- } = await AuthUtil.selectUsernameLogin({
- openId: state.openid,
- username: username2
- });
- if (code2 === 0) {
- let returnUrl = uni.getStorageSync("returnUrl");
- if (returnUrl) {
- formatAppLog("log", "at pages/index/login.vue:163", returnUrl);
- uni.removeStorage("returnUrl");
- locationReplace(returnUrl);
- } else {
- uni.switchTab({
- url: "/"
- });
- }
- }
- }
- let lastUsername = vue.ref("");
- async function verifyUsername(e2) {
- const username2 = e2.detail.value;
- if (username2 == "" || username2 == lastUsername.value) {
- return false;
- }
- lastUsername.value = username2;
- const {
- data
- } = await AuthUtil.verifyUsername(username2);
- formatAppLog("log", "at pages/index/login.vue:186", data);
- if (data) {
- state.usernameErrorMsg = "";
- state.verifyUsername = data;
- } else {
- state.usernameErrorMsg = t$6("account.username_exists");
- state.verifyUsername = data;
- }
- }
- async function officialRegister() {
- const linkId = uni.getStorageSync("linkId");
- state.registerReqVO.linkId = linkId;
- const {
- code: code2
- } = await AuthUtil.OfficialEnterLogin(state.model, state.registerReqVO);
- if (code2 === 0) {
- closeAuthModal();
- let returnUrl = uni.getStorageSync("returnUrl");
- if (returnUrl) {
- uni.removeStorage("returnUrl");
- locationReplace(returnUrl);
- } else {
- uni.switchTab({
- url: "/"
- });
- }
- }
- }
- vue.onBeforeMount(async () => {
- const options2 = {};
- new URLSearchParams(location.search).forEach((value, key) => {
- options2[key] = value;
- });
- state.registerReqVO.code = options2.code;
- state.registerReqVO.state = options2.state;
- });
- onLoad(async (options2) => {
- });
- const __returned__ = { mobileInput, state, isPopup, selectSocialUsers, updateIsPopup, updateSocialUsers, locationReplace, selectUser, get lastUsername() {
- return lastUsername;
- }, set lastUsername(v2) {
- lastUsername = v2;
- }, verifyUsername, officialRegister, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, computed: vue.computed, onBeforeMount: vue.onBeforeMount, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get code() {
- return code;
- }, get mobile() {
- return mobile;
- }, get AuthUtil() {
- return AuthUtil;
- }, phoneInternationalInput, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1_(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createElementVNode("view"),
- vue.createVNode(_component_su_popup, {
- show: $setup.selectSocialUsers,
- type: "center",
- round: "10",
- isMaskClick: false
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "head-nav" }, [
- vue.createElementVNode("view", { class: "head-box" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-m-b-20" }, [
- vue.createElementVNode(
- "view",
- { class: "isActive head-title" },
- vue.toDisplayString($setup.t("account.select_account_login")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- vue.createElementVNode("view", null, [
- vue.createElementVNode("scroll-view", {
- class: "side-menu-wrap",
- "scroll-y": "",
- style: { "height": "600rpx" }
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.socialUsers, (user2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: user2.username,
- class: "ss-flex",
- style: { "padding": "20rpx", "margin": "0 auto", "width": "520rpx" },
- onClick: ($event) => $setup.selectUser(user2.username)
- }, [
- vue.createElementVNode("image", {
- src: user2.avatar,
- style: { "width": "100rpx", "height": "100rpx", "border-radius": "50%", "margin-right": "20rpx" }
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString(user2.username),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- !$setup.state.socialUsers.length ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- style: { "padding": "20rpx", "width": "520rpx", "text-align": "center", "margin-top": "100rpx" }
- },
- vue.toDisplayString($setup.t("account.wechat_no_bind")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]),
- vue.createVNode(_component_su_popup, {
- show: $setup.isPopup,
- round: "10",
- isMaskClick: false
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", null, [
- vue.createElementVNode("view", { class: "head-box" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-m-b-20" }, [
- vue.createElementVNode(
- "view",
- { class: "isActive head-title" },
- vue.toDisplayString($setup.t("account.wechat_register")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(" 表单项 "),
- vue.createVNode(_component_uni_forms, {
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model = $event),
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelWidth: "140",
- labelAlign: "center",
- class: "loginUniForm"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms_item, {
- name: "username",
- label: $setup.t("account.username"),
- class: "loginUniFormItem",
- "error-message": $setup.state.usernameErrorMsg
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_username"),
- modelValue: $setup.state.registerReqVO.username,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.registerReqVO.username = $event),
- inputBorder: false,
- clearable: false,
- onBlur: $setup.verifyUsername
- }, {
- right: vue.withCtx(() => [
- !$setup.state.verifyUsername ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- style: "",
- src: $setup.sheep.$url.static("/static/images/shibai.png")
- }, null, 8, ["src"])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/chenggong.png")
- }, null, 8, ["src"])
- ]))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "error-message"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("account.phone_number"),
- class: "mobile loginUniFormItem ss-p-t-10",
- "error-message": $setup.state.mobileErrorMsg
- }, {
- default: vue.withCtx(() => [
- vue.createVNode($setup["phoneInternationalInput"], {
- "verify-username": $setup.state.verifyUsername,
- onInput: $setup.mobileInput
- }, null, 8, ["verify-username"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "error-message"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "code",
- label: $setup.t("account.verification_code"),
- class: "loginUniFormItem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- placeholder: $setup.t("account.enter_verification_code"),
- modelValue: $setup.state.model.code,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.code = $event),
- inputBorder: false,
- type: "number",
- maxlength: "4"
- }, null, 8, ["placeholder", "modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- vue.createElementVNode("view", { style: { "display": "flex", "justify-content": "space-between", "padding": "40rpx", "padding-bottom": "40rpx" } }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button login-btn-start",
- onClick: $setup.officialRegister
- },
- vue.toDisplayString($setup.t("account.register")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesIndexLogin = /* @__PURE__ */ _export_sfc(_sfc_main$1$, [["render", _sfc_render$1_], ["__scopeId", "data-v-fa14255b"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/login.vue"]]);
- const _sfc_main$1_ = {
- __name: "search",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- historyList: []
- });
- function onSearch(keyword) {
- if (!keyword) {
- return;
- }
- saveSearchHistory(keyword);
- sheep$1.$router.go("/pages/goods/list", { keyword });
- }
- function saveSearchHistory(keyword) {
- if (state.historyList.includes(keyword)) {
- state.historyList.splice(state.historyList.indexOf(keyword), 1);
- }
- state.historyList.unshift(keyword);
- if (state.historyList.length >= 10) {
- state.historyList.length = 10;
- }
- uni.setStorageSync("searchHistory", state.historyList);
- }
- function onDelete() {
- uni.showModal({
- title: "提示",
- content: "确认清除搜索历史吗?",
- success: function(res) {
- if (res.confirm) {
- state.historyTag = [];
- uni.removeStorageSync("searchHistory");
- }
- }
- });
- }
- onLoad(() => {
- state.historyList = uni.getStorageSync("searchHistory") || [];
- });
- const __returned__ = { state, onSearch, saveSearchHistory, onDelete, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1Z(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_search_bar = resolveEasycom(vue.resolveDynamicComponent("uni-search-bar"), __easycom_0$p);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "set-wrap",
- title: "搜索",
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-p-x-24" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createVNode(_component_uni_search_bar, {
- class: "ss-flex-1",
- radius: "33",
- placeholder: "请输入关键字",
- cancelButton: "none",
- focus: true,
- onConfirm: _cache[0] || (_cache[0] = ($event) => $setup.onSearch($event.value))
- })
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-col-center" }, [
- vue.createElementVNode("view", { class: "serach-history" }, "搜索历史"),
- vue.createElementVNode("button", {
- class: "clean-history ss-reset-button",
- onClick: $setup.onDelete
- }, " 清除搜索历史 ")
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-row-left ss-flex-wrap" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.historyList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("button", {
- class: "history-btn ss-reset-button",
- onClick: ($event) => $setup.onSearch(item),
- key: index2
- }, vue.toDisplayString(item), 9, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesIndexSearch = /* @__PURE__ */ _export_sfc(_sfc_main$1_, [["render", _sfc_render$1Z], ["__scopeId", "data-v-5aac7367"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/search.vue"]]);
- const _sfc_main$1Z = {
- __name: "page",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- name: "",
- components: [],
- navigationBar: {},
- page: {}
- });
- onLoad(async (options2) => {
- var _a2, _b2, _c;
- let id = options2.id;
- const { code: code2, data } = await DiyApi.getDiyPage(id);
- if (code2 === 0) {
- state.name = data.name;
- state.components = (_a2 = data.property) == null ? void 0 : _a2.components;
- state.navigationBar = (_b2 = data.property) == null ? void 0 : _b2.navigationBar;
- state.page = (_c = data.property) == null ? void 0 : _c.page;
- }
- });
- onPageScroll(() => {
- });
- const __returned__ = { state, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onPageScroll() {
- return onPageScroll;
- }, get DiyApi() {
- return DiyApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1Y(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_block_item = resolveEasycom(vue.resolveDynamicComponent("s-block-item"), __easycom_1$3);
- const _component_s_block = resolveEasycom(vue.resolveDynamicComponent("s-block"), __easycom_2$3);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.state.name,
- navbar: "custom",
- bgStyle: $setup.state.page,
- navbarStyle: $setup.state.navigationBar,
- onShareAppMessage: "",
- showLeftButton: ""
- }, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.components, (item, index2) => {
- return vue.openBlock(), vue.createBlock(_component_s_block, {
- key: index2,
- styles: item.property.style
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_block_item, {
- type: item.id,
- data: item.property,
- styles: item.property.style
- }, null, 8, ["type", "data", "styles"])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["styles"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title", "bgStyle", "navbarStyle"]);
- }
- const PagesIndexPage = /* @__PURE__ */ _export_sfc(_sfc_main$1Z, [["render", _sfc_render$1Y], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/index/page.vue"]]);
- const _sfc_main$1Y = {
- __name: "s-select-sku",
- props: {
- goodsInfo: {
- type: Object,
- default() {
- }
- },
- show: {
- type: Boolean,
- default: false
- }
- },
- emits: ["change", "addCart", "buy", "close"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const emits = __emit;
- const props = __props;
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const state = vue.reactive({
- selectedSku: {},
- // 选中的 SKU
- currentPropertyArray: []
- // 当前选中的属性,实际是个 Map。key 是 property 编号,value 是 value 编号
- });
- const propertyList = convertProductPropertyList(props.goodsInfo.skus);
- const skuList = vue.computed(() => {
- let skuPrices = props.goodsInfo.skus;
- for (let price of skuPrices) {
- price.value_id_array = price.properties.map((item) => item.valueId);
- }
- return skuPrices;
- });
- function calcNums() {
- if (props.goodsInfo.highPrecision) {
- state.selectedSku.goods_num = parseInt(state.selectedSku.use_points / (state.selectedSku.highPrecisionPrice / 100));
- } else {
- state.selectedSku.goods_num = parseInt(state.selectedSku.use_points / fen2yuan(state.selectedSku.price));
- }
- }
- async function useAllPonints() {
- const { code: code2, data } = await PayWalletApi.getDuserInfo();
- const userCanUsePoints = parseFloat(points2point(data.integralDO.currentQuota));
- formatAppLog("log", "at sheep/components/s-select-sku/s-select-sku.vue:169", userCanUsePoints);
- state.selectedSku.use_points = parseInt(userCanUsePoints);
- calcNums();
- }
- function inputPoints(e2) {
- const points = e2.detail.value;
- formatAppLog("log", "at sheep/components/s-select-sku/s-select-sku.vue:175", typeof points);
- if (points == "") {
- return false;
- }
- const userCanUsePoints = parseFloat(points2point(userWallet.value.integralDO.currentQuota));
- calcNums();
- vue.nextTick(() => {
- state.selectedSku.use_points = parseInt(points);
- calcNums();
- });
- if (points <= 0) {
- sheep$1.$helper.toast(t$6("selectSku.min_points_required"));
- if (userCanUsePoints >= 1) {
- vue.nextTick(() => {
- state.selectedSku.use_points = 1;
- calcNums();
- });
- } else {
- vue.nextTick(() => {
- state.selectedSku.use_points = 0;
- calcNums();
- });
- }
- }
- if (points > userCanUsePoints) {
- sheep$1.$helper.toast(t$6("selectSku.insufficient_points"));
- vue.nextTick(() => {
- state.selectedSku.use_points = parseInt(userCanUsePoints);
- calcNums();
- });
- }
- }
- vue.watch(
- () => state.selectedSku,
- (newVal) => {
- emits("change", newVal);
- },
- {
- immediate: true,
- // 立即执行
- deep: true
- // 深度监听
- }
- );
- function onNumberChange(e2) {
- if (e2 === 0)
- return;
- if (state.selectedSku.goods_num === e2)
- return;
- state.selectedSku.goods_num = e2;
- }
- function onAddCart() {
- if (state.selectedSku.id <= 0) {
- sheep$1.$helper.toast(t$6("selectSku.select_specification"));
- return;
- }
- if (state.selectedSku.stock <= 0) {
- sheep$1.$helper.toast(t$6("selectSku.insufficient_stock"));
- return;
- }
- emits("addCart", state.selectedSku);
- }
- async function onBuy() {
- if (props.goodsInfo.spuPayType == 2) {
- const { code: code2, data } = await PayWalletApi.getDuserInfo();
- const userCanUsePoints = parseFloat(points2point(data.integralDO.currentQuota));
- if (userCanUsePoints < state.selectedSku.use_points) {
- sheep$1.$helper.toast(t$6("selectSku.min_points_required"));
- return false;
- }
- if (state.selectedSku.goods_num < 1 || !state.selectedSku.use_points) {
- sheep$1.$helper.toast(t$6("selectSku.amount_less_than_min"));
- return;
- }
- if (state.selectedSku.goods_num > state.selectedSku.stock) {
- state.selectedSku.use_points = (state.selectedSku.stock * fen2yuan(state.selectedSku.price)).toFixed(2);
- state.selectedSku.goods_num = state.selectedSku.stock;
- }
- }
- if (state.selectedSku.id <= 0) {
- sheep$1.$helper.toast(t$6("selectSku.select_specification"));
- return;
- }
- if (state.selectedSku.stock <= 0) {
- sheep$1.$helper.toast(t$6("selectSku.insufficient_stock"));
- return;
- }
- emits("buy", state.selectedSku);
- state.selectedSku.use_points = 0;
- }
- function changeDisabled(isChecked = false, propertyId = 0, valueId = 0) {
- let newSkus = [];
- if (isChecked) {
- for (let price of skuList.value) {
- if (price.stock <= 0) {
- continue;
- }
- if (price.value_id_array.indexOf(valueId) >= 0) {
- newSkus.push(price);
- }
- }
- } else {
- newSkus = getCanUseSkuList();
- }
- let noChooseValueIds = [];
- for (let price of newSkus) {
- noChooseValueIds = noChooseValueIds.concat(price.value_id_array);
- }
- noChooseValueIds = Array.from(new Set(noChooseValueIds));
- if (isChecked) {
- let index2 = noChooseValueIds.indexOf(valueId);
- noChooseValueIds.splice(index2, 1);
- } else {
- state.currentPropertyArray.forEach((currentPropertyId) => {
- if (currentPropertyId.toString() !== "") {
- return;
- }
- let index2 = noChooseValueIds.indexOf(currentPropertyId);
- if (index2 >= 0) {
- noChooseValueIds.splice(index2, 1);
- }
- });
- }
- let choosePropertyIds = [];
- if (!isChecked) {
- state.currentPropertyArray.forEach((currentPropertyId, currentValueId) => {
- if (currentPropertyId !== "") {
- choosePropertyIds.push(currentValueId);
- }
- });
- } else {
- choosePropertyIds = [propertyId];
- }
- for (let propertyIndex in propertyList) {
- if (choosePropertyIds.indexOf(propertyList[propertyIndex]["id"]) >= 0) {
- continue;
- }
- for (let valueIndex in propertyList[propertyIndex]["values"]) {
- propertyList[propertyIndex]["values"][valueIndex]["disabled"] = noChooseValueIds.indexOf(
- propertyList[propertyIndex]["values"][valueIndex]["id"]
- ) < 0;
- }
- }
- }
- function getCanUseSkuList() {
- let newSkus = [];
- for (let sku of skuList.value) {
- if (sku.stock <= 0) {
- continue;
- }
- let isOk = true;
- state.currentPropertyArray.forEach((propertyId) => {
- if (propertyId.toString() !== "" && sku.value_id_array.indexOf(propertyId) < 0) {
- isOk = false;
- }
- });
- if (isOk) {
- newSkus.push(sku);
- }
- }
- return newSkus;
- }
- function onSelectSku(propertyId, valueId) {
- state.selectedSku.use_points = 0;
- let isChecked = true;
- if (state.currentPropertyArray[propertyId] !== void 0 && state.currentPropertyArray[propertyId] === valueId) {
- isChecked = false;
- state.currentPropertyArray.splice(propertyId, 1, "");
- } else {
- state.currentPropertyArray[propertyId] = valueId;
- }
- let choosePropertyId = [];
- state.currentPropertyArray.forEach((currentPropertyId) => {
- if (currentPropertyId !== "") {
- choosePropertyId.push(currentPropertyId);
- }
- });
- let newSkuList = getCanUseSkuList();
- if (choosePropertyId.length === propertyList.length && newSkuList.length) {
- newSkuList[0].goods_num = state.selectedSku.goods_num || 1;
- state.selectedSku = newSkuList[0];
- } else {
- state.selectedSku = {};
- }
- changeDisabled(isChecked, propertyId, valueId);
- }
- changeDisabled(false);
- vue.onMounted(() => {
- if (propertyList.length == 1 && propertyList[0].values.length == 1) {
- onSelectSku(0, 0);
- }
- });
- const __returned__ = { emits, props, userWallet, state, propertyList, skuList, calcNums, useAllPonints, inputPoints, onNumberChange, onAddCart, onBuy, changeDisabled, getCanUseSkuList, onSelectSku, computed: vue.computed, reactive: vue.reactive, watch: vue.watch, onMounted: vue.onMounted, nextTick: vue.nextTick, get sheep() {
- return sheep$1;
- }, get formatStock() {
- return formatStock;
- }, get convertProductPropertyList() {
- return convertProductPropertyList;
- }, get fen2yuan() {
- return fen2yuan;
- }, get points2point() {
- return points2point;
- }, get fen2yuan6() {
- return fen2yuan6;
- }, get PayWalletApi() {
- return PayWalletApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1X(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_number_box = resolveEasycom(vue.resolveDynamicComponent("su-number-box"), __easycom_0$b);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 规格弹窗 "),
- vue.createVNode(_component_su_popup, {
- show: $props.show,
- round: "10",
- onClose: _cache[4] || (_cache[4] = ($event) => $setup.emits("close"))
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" SKU 信息 "),
- vue.createCommentVNode(" {{state.selectedSku}} "),
- vue.createCommentVNode(" {{goodsInfo}} "),
- vue.createElementVNode("view", { class: "ss-modal-box bg-white ss-flex-col" }, [
- vue.createElementVNode("view", { class: "modal-header ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "header-left ss-m-r-30" }, [
- vue.createElementVNode("image", {
- class: "sku-image",
- src: $setup.state.selectedSku.picUrl || $props.goodsInfo.picUrl,
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "header-right ss-flex-col ss-row-between ss-flex-1" }, [
- vue.createElementVNode(
- "view",
- { class: "goods-title ss-line-2" },
- vue.toDisplayString($props.goodsInfo.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "header-right-bottom ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "price-text" }, [
- $props.goodsInfo.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- style: { "width": "30rpx", "height": "30rpx" }
- })) : vue.createCommentVNode("v-if", true),
- $props.goodsInfo.highPrecision ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 1 },
- vue.toDisplayString($setup.fen2yuan6($setup.state.selectedSku.highPrecisionPrice || $props.goodsInfo.highPrecisionPrice)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 2 },
- vue.toDisplayString($setup.fen2yuan($setup.state.selectedSku.price || $props.goodsInfo.price)),
- 1
- /* TEXT */
- )),
- vue.createCommentVNode(" {{ fen2yuan(state.selectedSku.price || goodsInfo.price) }} ")
- ]),
- $setup.state.selectedSku.promotionFee >= 0 || $props.goodsInfo.promotionFee >= 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "origin-price-text ss-m-l-10"
- },
- vue.toDisplayString(_ctx.$t("common.points")) + ":" + vue.toDisplayString($setup.fen2yuan(
- $setup.state.selectedSku.promotionFee || $props.goodsInfo.promotionFee
- )),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode(
- "view",
- { class: "stock-text ss-m-l-20" },
- vue.toDisplayString($setup.formatStock("exact", $setup.state.selectedSku.stock || $props.goodsInfo.stock)),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- vue.createCommentVNode(" 属性选择 "),
- vue.createElementVNode("view", { class: "modal-content ss-flex-1" }, [
- vue.createElementVNode(
- "scroll-view",
- {
- "scroll-y": "true",
- class: "modal-content-scroll",
- onTouchmove: _cache[3] || (_cache[3] = vue.withModifiers(() => {
- }, ["stop"]))
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.propertyList, (property) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "sku-item ss-m-b-20",
- key: property.id
- }, [
- vue.createElementVNode(
- "view",
- { class: "label-text ss-m-b-20" },
- vue.toDisplayString(property.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-flex-wrap" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(property.values, (value) => {
- return vue.openBlock(), vue.createElementBlock("button", {
- class: vue.normalizeClass(["ss-reset-button spec-btn", [
- {
- "ui-BG-Main-Gradient": $setup.state.currentPropertyArray[property.id] === value.id
- },
- {
- "disabled-btn": value.disabled === true
- }
- ]]),
- key: value.id,
- disabled: value.disabled === true,
- onClick: ($event) => $setup.onSelectSku(property.id, value.id)
- }, vue.toDisplayString(value.name), 11, ["disabled", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- $props.goodsInfo.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "buy-num-box ss-flex ss-col-center ss-row-between ss-m-b-40"
- }, [
- vue.createElementVNode(
- "view",
- { class: "label-text" },
- vue.toDisplayString(_ctx.$t("selectSku.purchase_amount")) + " " + vue.toDisplayString(_ctx.$t("selectSku.available_points", { points: $setup.points2point($setup.userWallet.integralDO.currentQuota) })),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button all-btn",
- onClick: $setup.useAllPonints
- },
- vue.toDisplayString(_ctx.$t("commmon.all")),
- 1
- /* TEXT */
- ),
- $props.goodsInfo.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- style: { "width": "30rpx", "height": "30rpx" }
- })) : vue.createCommentVNode("v-if", true),
- vue.withDirectives(vue.createElementVNode("input", {
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.selectedSku.use_points = $event),
- class: "uni-input input-points",
- style: { "width": "100rpx", "text-align": "center" },
- type: "number",
- placeholder: "0",
- onInput: $setup.inputPoints,
- disabled: !$setup.state.selectedSku.id
- }, null, 40, ["disabled"]), [
- [vue.vModelText, $setup.state.selectedSku.use_points]
- ])
- ])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "buy-num-box ss-flex ss-col-center ss-row-between ss-m-b-40"
- }, [
- vue.createElementVNode(
- "view",
- { class: "label-text" },
- vue.toDisplayString(_ctx.$t("selectSku.purchase_quantity")),
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_su_number_box, {
- min: 1,
- max: $setup.state.selectedSku.stock,
- step: 1,
- modelValue: $setup.state.selectedSku.goods_num,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.selectedSku.goods_num = $event),
- onChange: _cache[2] || (_cache[2] = ($event) => $setup.onNumberChange($event))
- }, null, 8, ["max", "modelValue"])
- ]))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ]),
- vue.createCommentVNode(" 操作区 "),
- vue.createElementVNode("view", { class: "modal-footer border-top" }, [
- $props.goodsInfo.spuType && $props.goodsInfo.spuPayType == 1 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "buy-box ss-flex ss-col-center ss-flex ss-col-center ss-row-center"
- }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button add-btn ui-Shadow-Main",
- onClick: $setup.onAddCart
- },
- vue.toDisplayString(_ctx.$t("common.add_to_cart")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button buy-btn ui-Shadow-Main",
- onClick: $setup.onBuy
- },
- vue.toDisplayString(_ctx.$t("common.buy_now")),
- 1
- /* TEXT */
- )
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "buy-box ss-flex ss-col-center ss-p-r-20"
- }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button disabled-btn one-buy-btn ui-Shadow-Main",
- onClick: $setup.onBuy
- }, [
- $props.goodsInfo.spuPayType != 1 && !$props.goodsInfo.spuType ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("common.redeem_now")),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : !$props.goodsInfo.spuType ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("common.buy_now")),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("common.redeem_now")),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ])
- ]))
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const __easycom_2$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1Y, [["render", _sfc_render$1X], ["__scopeId", "data-v-a43d1e2a"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-select-sku/s-select-sku.vue"]]);
- const _sfc_main$1X = {
- __name: "detail-navbar",
- props: {
- modelValue: {
- type: Object,
- default() {
- }
- },
- collectIcon: {
- type: Boolean,
- default: true
- },
- shareIcon: {
- type: Boolean,
- default: true
- }
- },
- emits: ["clickLeft"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- const sys_statusBar = sheep$1.$platform.device.statusBarHeight;
- const sys_navBar = sheep$1.$platform.navbar;
- const capsuleStyle = {
- width: sheep$1.$platform.capsule.width + "px",
- height: sheep$1.$platform.capsule.height + "px"
- };
- const state = vue.reactive({
- tabOpacityVal: 0,
- curTab: "goods",
- tabList: [
- {
- label: t$6("common.product"),
- value: "goods",
- to: "detail-swiper-selector"
- },
- {
- label: t$6("common.review"),
- value: "comment",
- to: "detail-comment-selector"
- },
- {
- label: t$6("common.detail"),
- value: "detail",
- to: "detail-content-selector"
- }
- ]
- });
- const props = __props;
- const emits = __emit;
- const hasHistory2 = sheep$1.$router.hasHistory();
- function onClickLeft() {
- if (hasHistory2) {
- sheep$1.$router.back();
- } else {
- sheep$1.$router.go("/pages/index/index");
- }
- emits("clickLeft");
- }
- function onClickRight() {
- showMenuTools();
- }
- let commentCard = {
- top: 0,
- bottom: 0
- };
- function getCommentCardNode() {
- return new Promise((res, rej) => {
- uni.createSelectorQuery().select(".detail-comment-selector").boundingClientRect((data) => {
- if (data) {
- commentCard.top = data.top;
- commentCard.bottom = data.top + data.height;
- res(data);
- } else {
- res(null);
- }
- }).exec();
- });
- }
- function onTab(tab) {
- let scrollTop = 0;
- if (tab.value === "comment") {
- scrollTop = commentCard.top - sys_navBar + 1;
- } else if (tab.value === "detail") {
- scrollTop = commentCard.bottom - sys_navBar + 1;
- }
- uni.pageScrollTo({
- scrollTop,
- duration: 200
- });
- }
- async function onFavorite() {
- if (!isLogin.value) {
- showAuthModal();
- return;
- }
- if (props.modelValue.favorite) {
- const {
- code: code2
- } = await FavoriteApi.deleteFavorite(props.modelValue.id);
- if (code2 !== 0) {
- return;
- }
- sheep$1.$helper.toast(t$6("common.unfavorite"));
- props.modelValue.favorite = false;
- } else {
- const {
- code: code2
- } = await FavoriteApi.createFavorite(props.modelValue.id);
- await FavoriteApi.createCollectBefore(props.modelValue.id);
- if (code2 !== 0) {
- return;
- }
- sheep$1.$helper.toast(t$6("common.favorite_success"));
- props.modelValue.favorite = true;
- }
- }
- onPageScroll((e2) => {
- state.tabOpacityVal = e2.scrollTop > sheep$1.$platform.navbar ? 1 : e2.scrollTop * 0.01;
- if (commentCard.top === 0) {
- throttle$1(() => {
- getCommentCardNode();
- }, 50);
- }
- if (e2.scrollTop < commentCard.top - sys_navBar) {
- state.curTab = "goods";
- } else if (e2.scrollTop >= commentCard.top - sys_navBar && e2.scrollTop <= commentCard.bottom - sys_navBar) {
- state.curTab = "comment";
- } else {
- state.curTab = "detail";
- }
- });
- const __returned__ = { isLogin, sys_statusBar, sys_navBar, capsuleStyle, state, props, emits, hasHistory: hasHistory2, onClickLeft, onClickRight, get commentCard() {
- return commentCard;
- }, set commentCard(v2) {
- commentCard = v2;
- }, getCommentCardNode, onTab, onFavorite, reactive: vue.reactive, computed: vue.computed, get onPageScroll() {
- return onPageScroll;
- }, get sheep() {
- return sheep$1;
- }, get throttle() {
- return throttle$1;
- }, get showMenuTools() {
- return showMenuTools;
- }, get closeMenuTools() {
- return closeMenuTools;
- }, get showShareModal() {
- return showShareModal;
- }, get t() {
- return t$6;
- }, get showAuthModal() {
- return showAuthModal;
- }, get FavoriteApi() {
- return FavoriteApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1W(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_status_bar = resolveEasycom(vue.resolveDynamicComponent("su-status-bar"), __easycom_0$q);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- return vue.openBlock(), vue.createBlock(_component_su_fixed, {
- alway: "",
- bgStyles: { background: "#fff" },
- val: 0,
- noNav: "",
- opacity: "",
- placeholder: false
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_status_bar),
- vue.createElementVNode(
- "view",
- {
- class: "ui-bar ss-flex ss-col-center ss-row-between ss-p-x-20",
- style: vue.normalizeStyle([{ height: $setup.sys_navBar - $setup.sys_statusBar + "px" }])
- },
- [
- vue.createCommentVNode(" 左 "),
- vue.createElementVNode("view", { class: "icon-box ss-flex" }, [
- vue.createElementVNode("view", {
- class: "icon-button icon-button-left ss-flex ss-row-center",
- onClick: $setup.onClickLeft
- }, [
- $setup.hasHistory ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "sicon-back"
- })) : (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- class: "sicon-home"
- }))
- ]),
- vue.createElementVNode("view", { class: "line" }),
- vue.createElementVNode("view", {
- class: "icon-button icon-button-right ss-flex ss-row-center",
- onClick: $setup.onClickRight
- }, [
- vue.createElementVNode("text", { class: "sicon-more" })
- ])
- ]),
- vue.createCommentVNode(" 中 "),
- vue.createElementVNode(
- "view",
- {
- class: "detail-tab-card ss-flex-1",
- style: vue.normalizeStyle([{ opacity: $setup.state.tabOpacityVal }])
- },
- [
- vue.createElementVNode("view", { class: "tab-box ss-flex ss-col-center ss-row-around" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.tabList, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "tab-item ss-flex-1 ss-flex ss-row-center ss-col-center",
- key: item.value,
- onClick: ($event) => $setup.onTab(item)
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["tab-title", $setup.state.curTab === item.value ? "cur-tab-title" : ""])
- },
- vue.toDisplayString(item.label),
- 3
- /* TEXT, CLASS */
- ),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "tab-line" },
- null,
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.curTab === item.value]
- ])
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 右 "),
- vue.createElementVNode(
- "view",
- {
- class: "ui-tabbar-box",
- style: vue.normalizeStyle([{ opacity: $setup.state.tabOpacityVal }])
- },
- [
- vue.createElementVNode("view", { class: "ui-tabbar ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-row-between" }, [
- $props.collectIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center",
- onClick: $setup.onFavorite
- }, [
- $props.modelValue.favorite ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createElementVNode("image", {
- class: "item-icon",
- src: $setup.sheep.$url.static("/static/images/collect_1.gif"),
- mode: "aspectFit"
- }, null, 8, ["src"]),
- vue.createCommentVNode(' <view class="item-title">已收藏</view> ')
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createElementVNode("image", {
- class: "item-icon",
- src: $setup.sheep.$url.static("/static/images/collect_0.png"),
- mode: "aspectFit"
- }, null, 8, ["src"]),
- vue.createCommentVNode(' <view class="item-title">收藏</view> ')
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- $props.shareIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.showShareModal($props.modelValue.id))
- }, [
- vue.createElementVNode("image", {
- class: "item-icon",
- src: $setup.sheep.$url.static("/static/images/share.png"),
- mode: "aspectFit"
- }, null, 8, ["src"]),
- vue.createCommentVNode(' <view class="item-title">分享</view> ')
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )
- ]),
- _: 1
- /* STABLE */
- });
- }
- const detailNavbar = /* @__PURE__ */ _export_sfc(_sfc_main$1X, [["render", _sfc_render$1W], ["__scopeId", "data-v-3e9ea950"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/detail-navbar.vue"]]);
- const _sfc_main$1W = {
- __name: "detail-cell",
- props: {
- label: {
- type: String,
- default: ""
- },
- value: {
- type: String,
- default: ""
- }
- },
- emits: ["click"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props = __props;
- const emits = __emit;
- const onClick = () => {
- emits("click");
- };
- const __returned__ = { props, emits, onClick };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1V(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "detail-cell-wrap ss-flex ss-col-center ss-row-between",
- onClick: $setup.onClick
- }, [
- vue.createElementVNode(
- "view",
- { class: "label-text" },
- vue.toDisplayString($props.label),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "cell-content ss-line-1 ss-flex-1" },
- vue.toDisplayString($props.value),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("button", { class: "ss-reset-button" }, [
- vue.createElementVNode("text", { class: "_icon-forward right-forwrad-icon" })
- ])
- ]);
- }
- const detailCell = /* @__PURE__ */ _export_sfc(_sfc_main$1W, [["render", _sfc_render$1V], ["__scopeId", "data-v-4e5c0150"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/detail-cell.vue"]]);
- const _sfc_main$1V = {
- __name: "detail-cell-sku",
- props: {
- modelValue: {
- type: Array,
- default() {
- return [];
- }
- },
- sku: {
- type: Object
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const value = vue.computed(() => {
- var _a2;
- if (!((_a2 = props.sku) == null ? void 0 : _a2.id)) {
- return t$6("common.select_product_specification");
- }
- let str = "";
- props.sku.properties.forEach((property) => {
- if (property.valueName === property.propertyName) {
- str += property.propertyName;
- } else {
- str += property.propertyName + ":" + property.valueName + " ";
- }
- });
- return str;
- });
- const __returned__ = { props, value, computed: vue.computed, detailCell, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1U(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" SKU 选择的提示框 "),
- vue.createVNode($setup["detailCell"], {
- label: _ctx.$t("common.select"),
- value: $setup.value
- }, null, 8, ["label", "value"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const detailCellSku = /* @__PURE__ */ _export_sfc(_sfc_main$1V, [["render", _sfc_render$1U], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/detail-cell-sku.vue"]]);
- const _imports_0$4 = "/static/icon/index.png";
- const _imports_1$2 = "/static/icon/shop.png";
- const _imports_2$1 = "/static/icon/cart.png";
- const _sfc_main$1U = {
- __name: "detail-tabbar",
- props: {
- modelValue: {
- type: Object,
- default() {
- }
- },
- bg: {
- type: String,
- default: "bg-white"
- },
- bgStyles: {
- type: Object,
- default() {
- }
- },
- ui: {
- type: String,
- default: ""
- },
- noFixed: {
- type: Boolean,
- default: false
- },
- topRadius: {
- type: Number,
- default: 0
- },
- collectIcon: {
- type: Boolean,
- default: true
- },
- serviceIcon: {
- type: Boolean,
- default: true
- },
- shareIcon: {
- type: Boolean,
- default: true
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({});
- const props = __props;
- const onShopIndex = () => {
- sheep$1.$router.go("/pages/shop/index", {
- shopId: props.modelValue.shopId,
- shopName: props.modelValue.shopName,
- merchantId: props.modelValue.merchantId
- });
- };
- const onChat = () => {
- sheep$1.$router.go("/pages/chat/index", {
- id: props.modelValue.id
- });
- };
- const onIndex = () => {
- sheep$1.$router.go("/pages/index/index");
- };
- const __returned__ = { state, props, onShopIndex, onChat, onIndex, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get showShareModal() {
- return showShareModal;
- }, get FavoriteApi() {
- return FavoriteApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1T(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- return vue.openBlock(), vue.createBlock(_component_su_fixed, {
- bottom: "",
- placeholder: "",
- bg: "bg-white"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ui-tabbar-box" }, [
- vue.createElementVNode("view", { class: "ui-tabbar ss-flex ss-col-center ss-row-between" }, [
- $props.serviceIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center",
- onClick: $setup.onIndex
- }, [
- vue.createElementVNode("image", {
- class: "item-icon",
- src: _imports_0$4,
- mode: "aspectFit"
- }),
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString(_ctx.$t("common.home")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- $props.serviceIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center",
- onClick: $setup.onShopIndex
- }, [
- vue.createElementVNode("image", {
- class: "item-icon",
- src: _imports_1$2,
- mode: "aspectFit"
- }),
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString(_ctx.$t("title.shop_home")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(' <view v-if="serviceIcon" class="detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center"\n @tap="onChat">\n <image class="item-icon" src="@/static/icon/service.png"\n mode="aspectFit" />\n <view class="item-title">客服</view>\n </view> '),
- $props.shareIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center",
- onClick: _cache[0] || (_cache[0] = ($event) => {
- $setup.sheep.$router.go("/pages/index/cart");
- })
- }, [
- vue.createElementVNode("image", {
- class: "item-icon",
- src: _imports_2$1,
- mode: "aspectFit"
- }),
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString(_ctx.$t("common.cart")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])
- ])
- ]),
- _: 3
- /* FORWARDED */
- });
- }
- const detailTabbar = /* @__PURE__ */ _export_sfc(_sfc_main$1U, [["render", _sfc_render$1T], ["__scopeId", "data-v-4c75f2f1"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/detail-tabbar.vue"]]);
- const _sfc_main$1T = {
- __name: "detail-skeleton",
- setup(__props, { expose: __expose }) {
- __expose();
- const sys2 = vue.computed(() => sheep$1.$store("sys"));
- const __returned__ = { sys: sys2, computed: vue.computed, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1S(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["skeleton-wrap", ["theme-" + $setup.sys.mode, "main-" + $setup.sys.theme, "font-" + $setup.sys.fontSize]])
- },
- [
- vue.createElementVNode("view", { class: "skeleton-banner" }),
- vue.createElementVNode("view", { class: "container-box" }, [
- vue.createElementVNode("view", { class: "container-box-strip title ss-m-b-58" }),
- vue.createElementVNode("view", { class: "container-box-strip ss-m-b-20" }),
- vue.createElementVNode("view", { class: "container-box-strip ss-m-b-20" }),
- vue.createElementVNode("view", { class: "container-box-strip w-364" })
- ]),
- vue.createElementVNode("view", { class: "container-box" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-m-b-34" }, [
- vue.createElementVNode("view", { class: "container-box-strip w-380" }),
- vue.createElementVNode("view", { class: "circle" })
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-m-b-34" }, [
- vue.createElementVNode("view", { class: "container-box-strip w-556" }),
- vue.createElementVNode("view", { class: "circle" })
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-between" }, [
- vue.createElementVNode("view", { class: "container-box-strip w-556" }),
- vue.createElementVNode("view", { class: "circle" })
- ])
- ]),
- vue.createElementVNode("view", { class: "container-box" }, [
- vue.createElementVNode("view", { class: "container-box-strip w-198 ss-m-b-42" }),
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "circle ss-m-r-12" }),
- vue.createElementVNode("view", { class: "container-box-strip w-252" })
- ])
- ]),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: "",
- bg: "bg-white"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ui-tabbar-box" }, [
- vue.createElementVNode("view", { class: "foot ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "ss-m-r-54 ss-m-l-32" }, [
- vue.createElementVNode("view", { class: "rec ss-m-b-8" }),
- vue.createElementVNode("view", { class: "oval" })
- ]),
- vue.createElementVNode("view", { class: "ss-m-r-54" }, [
- vue.createElementVNode("view", { class: "rec ss-m-b-8" }),
- vue.createElementVNode("view", { class: "oval" })
- ]),
- vue.createElementVNode("view", { class: "ss-m-r-50" }, [
- vue.createElementVNode("view", { class: "rec ss-m-b-8" }),
- vue.createElementVNode("view", { class: "oval" })
- ]),
- vue.createElementVNode("button", { class: "ss-reset-button add-btn ui-Shadow-Main" }),
- vue.createElementVNode("button", { class: "ss-reset-button buy-btn ui-Shadow-Main" })
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 2
- /* CLASS */
- );
- }
- const detailSkeleton = /* @__PURE__ */ _export_sfc(_sfc_main$1T, [["render", _sfc_render$1S], ["__scopeId", "data-v-929a32c8"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/detail-skeleton.vue"]]);
- const _sfc_main$1S = {
- name: "UniRate",
- props: {
- isFill: {
- // 星星的类型,是否镂空
- type: [Boolean, String],
- default: true
- },
- color: {
- // 星星未选中的颜色
- type: String,
- default: "#ececec"
- },
- activeColor: {
- // 星星选中状态颜色
- type: String,
- default: "#ffca3e"
- },
- disabledColor: {
- // 星星禁用状态颜色
- type: String,
- default: "#c0c0c0"
- },
- size: {
- // 星星的大小
- type: [Number, String],
- default: 24
- },
- value: {
- // 当前评分
- type: [Number, String],
- default: 0
- },
- modelValue: {
- // 当前评分
- type: [Number, String],
- default: 0
- },
- max: {
- // 最大评分
- type: [Number, String],
- default: 5
- },
- margin: {
- // 星星的间距
- type: [Number, String],
- default: 0
- },
- disabled: {
- // 是否可点击
- type: [Boolean, String],
- default: false
- },
- readonly: {
- // 是否只读
- type: [Boolean, String],
- default: false
- },
- allowHalf: {
- // 是否显示半星
- type: [Boolean, String],
- default: false
- },
- touchable: {
- // 是否支持滑动手势
- type: [Boolean, String],
- default: true
- }
- },
- data() {
- return {
- valueSync: "",
- userMouseFristMove: true,
- userRated: false,
- userLastRate: 1
- };
- },
- watch: {
- value(newVal) {
- this.valueSync = Number(newVal);
- },
- modelValue(newVal) {
- this.valueSync = Number(newVal);
- }
- },
- computed: {
- stars() {
- const value = this.valueSync ? this.valueSync : 0;
- const starList = [];
- const floorValue = Math.floor(value);
- const ceilValue = Math.ceil(value);
- for (let i2 = 0; i2 < this.max; i2++) {
- if (floorValue > i2) {
- starList.push({
- activeWitch: "100%"
- });
- } else if (ceilValue - 1 === i2) {
- starList.push({
- activeWitch: (value - floorValue) * 100 + "%"
- });
- } else {
- starList.push({
- activeWitch: "0"
- });
- }
- }
- return starList;
- },
- marginNumber() {
- return Number(this.margin);
- }
- },
- created() {
- this.valueSync = Number(this.value || this.modelValue);
- this._rateBoxLeft = 0;
- this._oldValue = null;
- },
- mounted() {
- setTimeout(() => {
- this._getSize();
- }, 100);
- },
- methods: {
- touchstart(e2) {
- if (this.readonly || this.disabled)
- return;
- const {
- clientX,
- screenX
- } = e2.changedTouches[0];
- this._getRateCount(clientX || screenX);
- },
- touchmove(e2) {
- if (this.readonly || this.disabled || !this.touchable)
- return;
- const {
- clientX,
- screenX
- } = e2.changedTouches[0];
- this._getRateCount(clientX || screenX);
- },
- /**
- * 兼容 PC @tian
- */
- mousedown(e2) {
- },
- mousemove(e2) {
- },
- mouseleave(e2) {
- },
- /**
- * 获取星星个数
- */
- _getRateCount(clientX) {
- this._getSize();
- const size = Number(this.size);
- if (isNaN(size)) {
- return new Error("size 属性只能设置为数字");
- }
- const rateMoveRange = clientX - this._rateBoxLeft;
- let index2 = parseInt(rateMoveRange / (size + this.marginNumber));
- index2 = index2 < 0 ? 0 : index2;
- index2 = index2 > this.max ? this.max : index2;
- const range2 = parseInt(rateMoveRange - (size + this.marginNumber) * index2);
- let value = 0;
- if (this._oldValue === index2 && !this.PC)
- return;
- this._oldValue = index2;
- if (this.allowHalf) {
- if (range2 > size / 2) {
- value = index2 + 1;
- } else {
- value = index2 + 0.5;
- }
- } else {
- value = index2 + 1;
- }
- value = Math.max(0.5, Math.min(value, this.max));
- this.valueSync = value;
- this._onChange();
- },
- /**
- * 触发动态修改
- */
- _onChange() {
- this.$emit("input", this.valueSync);
- this.$emit("update:modelValue", this.valueSync);
- this.$emit("change", {
- value: this.valueSync
- });
- },
- /**
- * 获取星星距离屏幕左侧距离
- */
- _getSize() {
- uni.createSelectorQuery().in(this).select(".uni-rate").boundingClientRect().exec((ret) => {
- if (ret) {
- this._rateBoxLeft = ret[0].left;
- }
- });
- }
- }
- };
- function _sfc_render$1R(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createElementVNode(
- "view",
- {
- ref: "uni-rate",
- class: "uni-rate"
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.stars, (star, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uni-rate__icon", { "uni-cursor-not-allowed": $props.disabled }]),
- style: vue.normalizeStyle({ "margin-right": $options.marginNumber + "px" }),
- key: index2,
- onTouchstart: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.touchstart && $options.touchstart(...args), ["stop"])),
- onTouchmove: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.touchmove && $options.touchmove(...args), ["stop"])),
- onMousedown: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.mousedown && $options.mousedown(...args), ["stop"])),
- onMousemove: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.mousemove && $options.mousemove(...args), ["stop"])),
- onMouseleave: _cache[4] || (_cache[4] = (...args) => $options.mouseleave && $options.mouseleave(...args))
- },
- [
- vue.createVNode(_component_uni_icons, {
- color: $props.color,
- size: $props.size,
- type: $props.isFill ? "star-filled" : "star"
- }, null, 8, ["color", "size", "type"]),
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle({ width: star.activeWitch }),
- class: "uni-rate__icon-on"
- },
- [
- vue.createVNode(_component_uni_icons, {
- color: $props.disabled ? $props.disabledColor : $props.activeColor,
- size: $props.size,
- type: "star-filled"
- }, null, 8, ["color", "size"])
- ],
- 4
- /* STYLE */
- )
- ],
- 38
- /* CLASS, STYLE, NEED_HYDRATION */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 512
- /* NEED_PATCH */
- )
- ]);
- }
- const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1S, [["render", _sfc_render$1R], ["__scopeId", "data-v-5c8fbdf3"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-rate/components/uni-rate/uni-rate.vue"]]);
- const _sfc_main$1R = {
- __name: "comment-item",
- props: {
- item: {
- type: Object,
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1Q(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2;
- const _component_uni_rate = resolveEasycom(vue.resolveDynamicComponent("uni-rate"), __easycom_1$2);
- const _component_su_image = resolveEasycom(vue.resolveDynamicComponent("su-image"), __easycom_0$f);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createCommentVNode(" 用户评论 "),
- vue.createElementVNode("view", { class: "user ss-flex ss-m-b-14" }, [
- vue.createElementVNode("view", { class: "ss-m-r-20 ss-flex" }, [
- vue.createElementVNode("image", {
- class: "avatar",
- src: $props.item.userAvatar
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode(
- "view",
- { class: "nickname ss-m-r-20" },
- vue.toDisplayString($props.item.userNickname),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "" }, [
- vue.createVNode(_component_uni_rate, {
- readonly: true,
- modelValue: $props.item.scores,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.item.scores = $event),
- size: "18"
- }, null, 8, ["modelValue"])
- ])
- ]),
- vue.createElementVNode(
- "view",
- { class: "content" },
- vue.toDisplayString($props.item.content),
- 1
- /* TEXT */
- ),
- ((_a2 = $props.item.picUrls) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "ss-m-t-24"
- }, [
- vue.createElementVNode("scroll-view", {
- class: "scroll-box",
- "scroll-x": "",
- "scroll-anchoring": ""
- }, [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.item.picUrls, (picUrl, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: picUrl,
- class: "ss-m-r-10"
- }, [
- vue.createVNode(_component_su_image, {
- class: "content-img",
- isPreview: "",
- previewList: $props.item.picUrls,
- current: index2,
- src: picUrl,
- height: 120,
- width: 120,
- mode: "aspectFill"
- }, null, 8, ["previewList", "current", "src"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 商家回复 "),
- $props.item.replyTime ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "ss-m-t-20 reply-box"
- }, [
- vue.createElementVNode("view", { class: "reply-title" }, "商家回复:"),
- vue.createElementVNode(
- "view",
- { class: "reply-content" },
- vue.toDisplayString($props.item.replyContent),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const commentItem = /* @__PURE__ */ _export_sfc(_sfc_main$1R, [["render", _sfc_render$1Q], ["__scopeId", "data-v-5629fc5e"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/comment-item.vue"]]);
- const _sfc_main$1Q = {
- __name: "detail-comment-card",
- props: {
- goodsId: {
- type: [Number, String],
- default: 0
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const state = vue.reactive({
- commentList: [],
- // 评论列表,只展示最近的 3 条
- total: 0
- // 总评论数
- });
- async function getComment(id) {
- const { data } = await CommentApi.getCommentPage(id, 1, 3, 0);
- state.commentList = data.list;
- state.total = data.total;
- }
- vue.onBeforeMount(() => {
- getComment(props.goodsId);
- });
- const __returned__ = { props, state, getComment, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, get sheep() {
- return sheep$1;
- }, get CommentApi() {
- return CommentApi;
- }, commentItem, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1P(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- return vue.openBlock(), vue.createElementBlock("view", { class: "detail-comment-card bg-white" }, [
- vue.createElementVNode("view", { class: "card-header ss-flex ss-col-center ss-row-between ss-p-b-30" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "line" }),
- vue.createElementVNode(
- "view",
- { class: "title ss-m-l-20 ss-m-r-10" },
- vue.toDisplayString(_ctx.$t("common.review")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "des" },
- "(" + vue.toDisplayString($setup.state.total) + ")",
- 1
- /* TEXT */
- )
- ]),
- $setup.state.commentList.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "ss-flex ss-col-center",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/goods/comment/list", { id: $props.goodsId }))
- }, [
- vue.createElementVNode(
- "button",
- { class: "ss-reset-button more-btn" },
- vue.toDisplayString(_ctx.$t("common.view_all")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "cicon-forward" })
- ])) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createCommentVNode(" 评论列表 "),
- vue.createElementVNode("view", { class: "card-content" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.commentList, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "comment-box ss-p-y-30",
- key: item.id
- }, [
- vue.createVNode($setup["commentItem"], { item }, null, 8, ["item"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- $setup.state.commentList.length === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- paddingTop: "0",
- icon: "/static/comment-empty.png",
- text: $setup.t("common.awaiting_your_first_review")
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
- ])
- ]);
- }
- const detailCommentCard = /* @__PURE__ */ _export_sfc(_sfc_main$1Q, [["render", _sfc_render$1P], ["__scopeId", "data-v-489ea6d9"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/detail-comment-card.vue"]]);
- const _sfc_main$1P = {
- __name: "detail-content-card",
- props: {
- content: {
- type: String,
- default: ""
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const { safeAreaInsets } = sheep$1.$platform.device;
- const props = __props;
- const __returned__ = { safeAreaInsets, props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1O(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_mp_html = resolveEasycom(vue.resolveDynamicComponent("mp-html"), __easycom_0$r);
- return vue.openBlock(), vue.createElementBlock("view", { class: "detail-content-card bg-white ss-m-x-20 ss-p-t-20" }, [
- vue.createElementVNode("view", { class: "card-header ss-flex ss-col-center ss-m-b-30 ss-m-l-20" }, [
- vue.createElementVNode("view", { class: "line" }),
- vue.createElementVNode(
- "view",
- { class: "title ss-m-l-20 ss-m-r-20" },
- vue.toDisplayString(_ctx.$t("common.detail")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "card-content" }, [
- vue.createVNode(_component_mp_html, { content: $props.content }, null, 8, ["content"])
- ])
- ]);
- }
- const detailContentCard = /* @__PURE__ */ _export_sfc(_sfc_main$1P, [["render", _sfc_render$1O], ["__scopeId", "data-v-cebfed36"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/detail-content-card.vue"]]);
- const _sfc_main$1O = {
- __name: "detail-activity-tip",
- props: {
- activityList: {
- type: Array,
- default() {
- return [];
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "8e741228-seckillBg": vue.unref(seckillBg),
- "8e741228-grouponBg": vue.unref(grouponBg)
- }));
- const seckillBg = sheep$1.$url.css("/static/images/seckill-tip-bg.png");
- const grouponBg = sheep$1.$url.css("/static/images/groupon-tip-bg.png");
- const props = __props;
- function onActivity(activity) {
- const type = activity.type;
- const typePath = type === 1 ? "seckill" : type === 2 ? "TODO 拼团" : "groupon";
- sheep$1.$router.go(`/pages/goods/${typePath}`, {
- id: activity.id
- });
- }
- const __returned__ = { seckillBg, grouponBg, props, onActivity, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1N(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- return vue.openBlock(), vue.createBlock(_component_su_fixed, {
- bottom: "",
- placeholder: "",
- val: 44
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.props.activityList, (activity) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: activity.id
- }, [
- vue.createCommentVNode(" TODO 非繁人:拼团 "),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["activity-box ss-p-x-38 ss-flex ss-row-between ss-col-center", activity.type === 1 ? "seckill-box" : "groupon-box"])
- },
- [
- vue.createElementVNode("view", { class: "activity-title ss-flex" }, [
- vue.createElementVNode("view", { class: "ss-m-r-16" }, [
- activity.type === 1 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: $setup.sheep.$url.static("/static/images/seckill-icon.png"),
- class: "activity-icon"
- }, null, 8, ["src"])) : activity.type === 3 ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" TODO 非繁人:拼团 "),
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/groupon-icon.png"),
- class: "activity-icon"
- }, null, 8, ["src"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode(
- "view",
- null,
- "该商品正在参与" + vue.toDisplayString(activity.name) + "活动",
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("button", {
- class: "ss-reset-button activity-go",
- onClick: ($event) => $setup.onActivity(activity)
- }, " GO ", 8, ["onClick"])
- ],
- 2
- /* CLASS */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const detailActivityTip = /* @__PURE__ */ _export_sfc(_sfc_main$1O, [["render", _sfc_render$1N], ["__scopeId", "data-v-8e741228"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/detail-activity-tip.vue"]]);
- const _sfc_main$1N = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- onPageScroll(() => {
- });
- const state = vue.reactive({
- goodsId: 0,
- skeletonLoading: true,
- // SPU 加载中
- goodsInfo: {},
- // SPU 信息
- showSelectSku: false,
- // 是否展示 SKU 选择弹窗
- selectedSku: {},
- // 选中的 SKU
- showModel: false,
- // 是否展示 Coupon 优惠劵的弹窗
- couponInfo: [],
- // 可领取的 Coupon 优惠劵的列表
- showActivityModel: false,
- // 【满减送/限时折扣】是否展示 Activity 营销活动的弹窗
- activityInfo: [],
- // 【满减送/限时折扣】可参与的 Activity 营销活动的列表
- activityList: [],
- // 【秒杀/拼团/砍价】可参与的 Activity 营销活动的列表
- linkId: 0
- // 分享时的id
- });
- function onSkuChange(e2) {
- state.selectedSku = e2;
- }
- function onAddCart(e2) {
- if (!e2.id) {
- sheep$1.$helper.toast(t$6("common.select_product_options"));
- return;
- }
- if (!isLogin.value) {
- showAuthModal();
- return;
- }
- sheep$1.$store("cart").add(e2);
- }
- function onBuy(e2) {
- if (!state.selectedSku.id) {
- sheep$1.$helper.toast(t$6("common.select_product_options"));
- return;
- }
- sheep$1.$router.go("/pages/order/confirm", {
- data: JSON.stringify({
- items: [{
- skuId: e2.id,
- count: e2.goods_num
- }],
- spuType: state.goodsInfo.spuType,
- spuPayType: state.goodsInfo.spuPayType,
- highPrecision: state.goodsInfo.highPrecision,
- // TODO 芋艿:后续清理掉这 2 参数
- deliveryType: 1,
- pointStatus: false
- })
- });
- }
- function onActivity() {
- state.showActivityModel = true;
- }
- async function onGet(id) {
- const {
- code: code2
- } = await CouponApi.takeCoupon(id);
- if (code2 !== 0) {
- return;
- }
- uni.showToast({
- title: "领取成功"
- });
- setTimeout(() => {
- getCoupon();
- }, 1e3);
- }
- const shareInfo = vue.computed(() => {
- if (lodashExports.isEmpty(state.goodsInfo))
- return {};
- return sheep$1.$platform.share.getShareInfo({
- title: state.goodsInfo.name,
- image: sheep$1.$url.cdn(state.goodsInfo.image),
- desc: state.goodsInfo.subtitle,
- params: {
- page: "2"
- // query: state.linkId,
- }
- }, {
- type: "goods",
- // 商品海报
- title: state.goodsInfo.name,
- // 商品标题
- introduction: state.goodsInfo.introduction,
- // image: sheep.$url.cdn(state.goodsInfo.image), // 商品主图
- image: sheep$1.$url.cdn(state.goodsInfo.picUrl),
- // 商品主图
- price: fen2yuan(state.goodsInfo.price),
- // 商品价格
- original_price: fen2yuan(state.goodsInfo.maretPrice)
- // 商品原价
- });
- });
- async function getCoupon() {
- const {
- code: code2,
- data
- } = await CouponApi.getCouponTemplateList(state.goodsId, 2, 10);
- if (code2 === 0) {
- state.couponInfo = data;
- }
- }
- async function getSpuDetail(id) {
- SpuApi.getSpuDetail(id).then((res) => {
- if (res.code !== 0 || !res.data) {
- state.goodsInfo = null;
- return;
- }
- state.skeletonLoading = false;
- state.goodsInfo = res.data;
- if (!isLogin.value) {
- return;
- }
- FavoriteApi.isFavoriteExists(state.goodsId, "goods").then((res2) => {
- if (res2.code !== 0) {
- return;
- }
- state.goodsInfo.favorite = res2.data;
- });
- });
- }
- async function getLink() {
- ShareApi.getLinkId(3, state.goodsId).then((res) => {
- if (res.code !== 0) {
- return;
- }
- state.linkId = res.data.linkId;
- });
- }
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- vue.watch(() => isLogin.value, (newVal) => {
- if (newVal) {
- getSpuDetail(state.goodsId);
- }
- });
- onLoad((options2) => {
- if (!options2.id && !options2.linkId) {
- state.goodsInfo = null;
- return;
- }
- state.goodsId = options2.id || 0;
- if (!options2.id && options2.linkId) {
- formatAppLog("log", "at pages/goods/index.vue:325", "如果只是没有spuId有linkId的话 要去linkId对应的spuId");
- const linkId = options2.linkId.toString();
- ShareApi.getObjectIdByLinkId(linkId).then((res) => {
- if (res.code !== 0) {
- return;
- }
- state.goodsId = res.data;
- getSpuDetail(state.goodsId);
- getLink();
- });
- uni.setStorageSync("linkId", options2.linkId);
- } else {
- getSpuDetail(state.goodsId);
- }
- ActivityApi.getActivityListBySpuId(state.goodsId).then((res) => {
- if (res.code !== 0) {
- return;
- }
- res.data.forEach((activity) => {
- if ([1, 2, 3].includes(activity.type)) {
- state.activityList.push(activity);
- } else if (activity.type === 5) {
- state.activityInfo.push(activity);
- } else
- ;
- });
- });
- });
- const __returned__ = { state, onSkuChange, onAddCart, onBuy, onActivity, onGet, shareInfo, getCoupon, getSpuDetail, getLink, isLogin, reactive: vue.reactive, computed: vue.computed, provide: vue.provide, watchEffect: vue.watchEffect, watch: vue.watch, get onLoad() {
- return onLoad;
- }, get onPageScroll() {
- return onPageScroll;
- }, get sheep() {
- return sheep$1;
- }, get CouponApi() {
- return CouponApi;
- }, get ActivityApi() {
- return ActivityApi;
- }, get FavoriteApi() {
- return FavoriteApi;
- }, get formatSales() {
- return formatSales;
- }, get formatGoodsSwiper() {
- return formatGoodsSwiper;
- }, get fen2yuan() {
- return fen2yuan;
- }, get fen2yuan6() {
- return fen2yuan6;
- }, detailNavbar, detailCellSku, detailTabbar, detailSkeleton, detailCommentCard, detailContentCard, detailActivityTip, get isEmpty() {
- return lodashExports.isEmpty;
- }, get SpuApi() {
- return SpuApi;
- }, get ShareApi() {
- return ShareApi;
- }, get showAuthModal() {
- return showAuthModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1M(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_su_swiper = resolveEasycom(vue.resolveDynamicComponent("su-swiper"), __easycom_1$d);
- const _component_s_select_sku = resolveEasycom(vue.resolveDynamicComponent("s-select-sku"), __easycom_2$2);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createVNode(_component_s_layout, {
- onShareAppMessage: $setup.shareInfo,
- navbar: "goods"
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 标题栏 "),
- vue.createVNode($setup["detailNavbar"], {
- modelValue: $setup.state.goodsInfo,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.goodsInfo = $event)
- }, null, 8, ["modelValue"]),
- vue.createCommentVNode(" 骨架屏 "),
- $setup.state.skeletonLoading ? (vue.openBlock(), vue.createBlock($setup["detailSkeleton"], { key: 0 })) : $setup.state.goodsInfo === null ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 下架/售罄提醒 "),
- vue.createVNode(_component_s_empty, {
- text: "商品不存在或已下架",
- icon: "/static/soldout-empty.png",
- showAction: "",
- actionText: "再逛逛",
- actionUrl: "/pages/goods/list"
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createElementVNode("view", { class: "detail-swiper-selector" }, [
- vue.createCommentVNode(" 商品轮播图 "),
- vue.createVNode(_component_su_swiper, {
- class: "ss-m-b-14",
- isPreview: "",
- list: $setup.formatGoodsSwiper($setup.state.goodsInfo.sliderPicUrls),
- otStyle: "tag",
- imageMode: "widthFix",
- dotCur: "bg-mask-40",
- seizeHeight: 750
- }, null, 8, ["list"]),
- vue.createCommentVNode(" 价格+标题 "),
- vue.createElementVNode("view", { class: "title-card detail-card ss-p-y-40 ss-p-x-20" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-col-center ss-m-b-26" }, [
- vue.createElementVNode("view", { class: "price-box ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "price-text ss-m-r-16 ss-flex ss-col-center" }, [
- $setup.state.goodsInfo.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- class: "ss-m-r-10",
- style: { "width": "40rpx", "height": "40rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- $setup.state.goodsInfo.highPrecision ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 2 },
- vue.toDisplayString($setup.fen2yuan6($setup.state.selectedSku.highPrecisionPrice || $setup.state.goodsInfo.highPrecisionPrice)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 3 },
- vue.toDisplayString($setup.fen2yuan($setup.state.selectedSku.price || $setup.state.goodsInfo.price)),
- 1
- /* TEXT */
- ))
- ]),
- $setup.state.goodsInfo.promotionFee >= 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "origin-price-text"
- },
- vue.toDisplayString(_ctx.$t("common.points")) + ":" + vue.toDisplayString($setup.fen2yuan($setup.state.selectedSku.promotionFee || $setup.state.goodsInfo.promotionFee)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode(
- "view",
- { class: "sales-text" },
- vue.toDisplayString($setup.formatSales("exact", $setup.state.goodsInfo.salesCount)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "discounts-box ss-flex ss-row-between ss-m-b-28" }, [
- vue.createCommentVNode(" 满减送/限时折扣活动的提示 "),
- vue.createElementVNode("div", { class: "tag-content" }, [
- vue.createElementVNode("view", { class: "tag-box ss-flex" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.activityInfo, (promos) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "tag ss-m-r-10",
- key: promos.id,
- onClick: $setup.onActivity
- },
- vue.toDisplayString(promos.name),
- 1
- /* TEXT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]),
- vue.createCommentVNode(" 优惠劵 "),
- $setup.state.couponInfo.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "get-coupon-box ss-flex ss-col-center ss-m-l-20",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.state.showModel = true)
- }, [
- vue.createElementVNode("view", { class: "discounts-title ss-m-r-8" }, "领券"),
- vue.createElementVNode("text", { class: "cicon-forward" })
- ])) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode(
- "view",
- { class: "title-text ss-line-2 ss-m-b-6" },
- vue.toDisplayString($setup.state.goodsInfo.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "subtitle-text ss-line-1" },
- vue.toDisplayString($setup.state.goodsInfo.introduction),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 功能卡片 "),
- vue.createElementVNode("view", { class: "detail-cell-card detail-card ss-flex-col" }, [
- vue.createVNode($setup["detailCellSku"], {
- modelValue: $setup.state.selectedSku.goods_sku_text,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.selectedSku.goods_sku_text = $event),
- sku: $setup.state.selectedSku,
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.state.showSelectSku = true)
- }, null, 8, ["modelValue", "sku"])
- ]),
- vue.createCommentVNode(" 规格与数量弹框 "),
- vue.createVNode(_component_s_select_sku, {
- goodsInfo: $setup.state.goodsInfo,
- show: $setup.state.showSelectSku,
- onAddCart: $setup.onAddCart,
- onBuy: $setup.onBuy,
- onChange: $setup.onSkuChange,
- onClose: _cache[4] || (_cache[4] = ($event) => $setup.state.showSelectSku = false)
- }, null, 8, ["goodsInfo", "show"])
- ]),
- vue.createCommentVNode(" 评价 "),
- vue.createVNode($setup["detailCommentCard"], {
- class: "detail-comment-selector",
- goodsId: $setup.state.goodsId
- }, null, 8, ["goodsId"]),
- vue.createCommentVNode(" 详情 "),
- vue.createVNode($setup["detailContentCard"], {
- class: "detail-content-selector",
- content: $setup.state.goodsInfo.description
- }, null, 8, ["content"]),
- vue.createCommentVNode(" 活动跳转:拼团/秒杀/砍价活动 "),
- vue.createCommentVNode(' <detail-activity-tip v-if="state.activityList.length > 0" :activity-list="state.activityList" /> '),
- vue.createCommentVNode(" 详情 tabbar "),
- vue.createVNode($setup["detailTabbar"], {
- modelValue: $setup.state.goodsInfo,
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $setup.state.goodsInfo = $event)
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" {{state.goodsInfo.spuType }} {{state.goodsInfo.spuPayType }} "),
- vue.createCommentVNode(" 如果有库存并且不是积分商品和虚拟商品 可以加入购物车和购买 "),
- $setup.state.goodsInfo.stock > 0 && $setup.state.goodsInfo.spuType && $setup.state.goodsInfo.spuPayType == 1 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "buy-box ss-flex ss-col-center ss-p-r-20"
- }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button add-btn ui-Shadow-Main",
- onClick: _cache[5] || (_cache[5] = ($event) => $setup.state.showSelectSku = true)
- },
- vue.toDisplayString(_ctx.$t("common.add_to_cart")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button buy-btn ui-Shadow-Main",
- onClick: _cache[6] || (_cache[6] = ($event) => $setup.state.showSelectSku = true)
- },
- vue.toDisplayString(_ctx.$t("common.buy_now")),
- 1
- /* TEXT */
- )
- ])) : $setup.state.goodsInfo.stock > 0 && $setup.state.goodsInfo.spuPayType != 1 || !$setup.state.goodsInfo.spuType ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "buy-box ss-flex ss-col-center ss-p-r-20"
- }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button disabled-btn buy-btn ui-Shadow-Main",
- onClick: _cache[7] || (_cache[7] = ($event) => $setup.state.showSelectSku = true)
- }, [
- $setup.state.goodsInfo.spuPayType != 1 && !$setup.state.goodsInfo.spuType ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("common.redeem_now")),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : !$setup.state.goodsInfo.spuType ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("common.buy_now")),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("common.redeem_now")),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "buy-box ss-flex ss-col-center ss-p-r-20"
- }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button disabled-btn",
- disabled: "",
- style: { "background": "#999999" }
- },
- vue.toDisplayString(_ctx.$t("common.sold_out")),
- 1
- /* TEXT */
- )
- ]))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue"]),
- vue.createCommentVNode(" 优惠劵弹窗 "),
- vue.createCommentVNode(' <s-coupon-get v-model="state.couponInfo" :show="state.showModel" @close="state.showModel = false"\n @get="onGet" /> '),
- vue.createCommentVNode(" 满减送/限时折扣活动弹窗 "),
- vue.createCommentVNode(' <s-activity-pop v-model="state.activityInfo" :show="state.showActivityModel"\n @close="state.showActivityModel = false" /> ')
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["onShareAppMessage"])
- ]);
- }
- const PagesGoodsIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1N, [["render", _sfc_render$1M], ["__scopeId", "data-v-24a31e85"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/index.vue"]]);
- const _sfc_main$1M = {
- __name: "s-select-groupon-sku",
- props: {
- show: {
- type: Boolean,
- default: false
- },
- goodsInfo: {
- type: Object,
- default() {
- }
- },
- grouponAction: {
- type: String,
- default: "create"
- },
- grouponNum: {
- type: [Number, String],
- default: 0
- }
- },
- emits: ["change", "addCart", "buy", "close", "ladder"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "f77ace9d-headerBg": vue.unref(headerBg)
- }));
- const headerBg = sheep$1.$url.css("/static/images/groupon-btn-long.png");
- const emits = __emit;
- const props = __props;
- const state = vue.reactive({
- selectedSku: {},
- // 选中的 SKU
- currentPropertyArray: [],
- // 当前选中的属性,实际是个 Map。key 是 property 编号,value 是 value 编号
- grouponNum: props.grouponNum
- });
- const propertyList = convertProductPropertyList(props.goodsInfo.skus);
- const skuList = vue.computed(() => {
- let skuPrices = props.goodsInfo.skus;
- for (let price of skuPrices) {
- price.value_id_array = price.properties.map((item) => item.valueId);
- }
- return skuPrices;
- });
- vue.watch(
- () => state.selectedSku,
- (newVal) => {
- emits("change", newVal);
- },
- {
- immediate: true,
- // 立即执行
- deep: true
- // 深度监听
- }
- );
- function onNumberChange(e2) {
- if (e2 === 0)
- return;
- if (state.selectedSku.count === e2)
- return;
- state.selectedSku.count = e2;
- }
- function onBuy() {
- if (!state.selectedSku.id || state.selectedSku.id <= 0) {
- sheep$1.$helper.toast("请选择规格");
- return;
- }
- if (state.selectedSku.stock <= 0) {
- sheep$1.$helper.toast("库存不足");
- return;
- }
- emits("buy", state.selectedSku);
- }
- function changeDisabled(isChecked = false, propertyId = 0, valueId = 0) {
- let newSkus = [];
- if (isChecked) {
- for (let price of skuList.value) {
- if (price.stock <= 0) {
- continue;
- }
- if (price.value_id_array.indexOf(valueId) >= 0) {
- newSkus.push(price);
- }
- }
- } else {
- newSkus = getCanUseSkuList();
- }
- let noChooseValueIds = [];
- for (let price of newSkus) {
- noChooseValueIds = noChooseValueIds.concat(price.value_id_array);
- }
- noChooseValueIds = Array.from(new Set(noChooseValueIds));
- if (isChecked) {
- let index2 = noChooseValueIds.indexOf(valueId);
- noChooseValueIds.splice(index2, 1);
- } else {
- state.currentPropertyArray.forEach((currentPropertyId) => {
- if (currentPropertyId.toString() !== "") {
- return;
- }
- let index2 = noChooseValueIds.indexOf(currentPropertyId);
- if (index2 >= 0) {
- noChooseValueIds.splice(index2, 1);
- }
- });
- }
- let choosePropertyIds = [];
- if (!isChecked) {
- state.currentPropertyArray.forEach((currentPropertyId, currentValueId) => {
- if (currentPropertyId !== "") {
- choosePropertyIds.push(currentValueId);
- }
- });
- } else {
- choosePropertyIds = [propertyId];
- }
- for (let propertyIndex in propertyList) {
- if (choosePropertyIds.indexOf(propertyList[propertyIndex]["id"]) >= 0) {
- continue;
- }
- for (let valueIndex in propertyList[propertyIndex]["values"]) {
- propertyList[propertyIndex]["values"][valueIndex]["disabled"] = noChooseValueIds.indexOf(propertyList[propertyIndex]["values"][valueIndex]["id"]) < 0;
- }
- }
- }
- function getCanUseSkuList() {
- let newSkus = [];
- for (let sku of skuList.value) {
- if (sku.stock <= 0) {
- continue;
- }
- let isOk = true;
- state.currentPropertyArray.forEach((propertyId) => {
- if (propertyId.toString() !== "" && sku.value_id_array.indexOf(propertyId) < 0) {
- isOk = false;
- }
- });
- if (isOk) {
- newSkus.push(sku);
- }
- }
- return newSkus;
- }
- function onSelectSku(propertyId, valueId) {
- let isChecked = true;
- if (state.currentPropertyArray[propertyId] !== void 0 && state.currentPropertyArray[propertyId] === valueId) {
- isChecked = false;
- state.currentPropertyArray.splice(propertyId, 1, "");
- } else {
- state.currentPropertyArray[propertyId] = valueId;
- }
- let choosePropertyId = [];
- state.currentPropertyArray.forEach((currentPropertyId) => {
- if (currentPropertyId !== "") {
- choosePropertyId.push(currentPropertyId);
- }
- });
- let newSkuList = getCanUseSkuList();
- if (choosePropertyId.length === propertyList.length && newSkuList.length) {
- newSkuList[0].count = state.selectedSku.count || 1;
- state.selectedSku = newSkuList[0];
- } else {
- state.selectedSku = {};
- }
- changeDisabled(isChecked, propertyId, valueId);
- }
- changeDisabled(false);
- const __returned__ = { headerBg, emits, props, state, propertyList, skuList, onNumberChange, onBuy, changeDisabled, getCanUseSkuList, onSelectSku, computed: vue.computed, reactive: vue.reactive, watch: vue.watch, get sheep() {
- return sheep$1;
- }, get convertProductPropertyList() {
- return convertProductPropertyList;
- }, get fen2yuan() {
- return fen2yuan;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1L(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_number_box = resolveEasycom(vue.resolveDynamicComponent("su-number-box"), __easycom_0$b);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 拼团商品规格弹窗 "),
- vue.createVNode(_component_su_popup, {
- show: $props.show,
- round: "10",
- onClose: _cache[2] || (_cache[2] = ($event) => $setup.emits("close"))
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" SKU 信息 "),
- vue.createElementVNode("view", { class: "ss-modal-box bg-white ss-flex-col" }, [
- vue.createElementVNode("view", { class: "modal-header ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "header-left ss-m-r-30" }, [
- vue.createElementVNode("image", {
- class: "sku-image",
- src: $setup.sheep.$url.cdn($setup.state.selectedSku.picUrl || $props.goodsInfo.picUrl),
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "header-right ss-flex-col ss-row-between ss-flex-1" }, [
- vue.createElementVNode("view", { class: "goods-title ss-line-2" }, [
- vue.createElementVNode("view", { class: "tig ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "tig-icon ss-flex ss-col-center ss-row-center" }, [
- vue.createElementVNode("view", { class: "groupon-tag" }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/groupon-tag-white.png")
- }, null, 8, ["src"])
- ])
- ]),
- vue.createElementVNode("view", { class: "tig-title" }, "拼团价")
- ]),
- vue.createElementVNode(
- "view",
- { class: "info-title" },
- vue.toDisplayString($props.goodsInfo.name),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "header-right-bottom ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode(
- "view",
- { class: "price-text" },
- vue.toDisplayString($setup.fen2yuan($props.goodsInfo.price)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "stock-text ss-m-l-20" },
- " 库存" + vue.toDisplayString($setup.state.selectedSku.stock || $props.goodsInfo.stock) + "件 ",
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- vue.createElementVNode("view", { class: "modal-content ss-flex-1" }, [
- vue.createElementVNode("scroll-view", {
- "scroll-y": "true",
- class: "modal-content-scroll"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.propertyList, (property) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "sku-item ss-m-b-20",
- key: property.id
- }, [
- vue.createElementVNode(
- "view",
- { class: "label-text ss-m-b-20" },
- vue.toDisplayString(property.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-flex-wrap" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(property.values, (value) => {
- return vue.openBlock(), vue.createElementBlock("button", {
- class: vue.normalizeClass(["ss-reset-button spec-btn", [
- {
- "checked-btn": $setup.state.currentPropertyArray[property.id] === value.id
- },
- {
- "disabled-btn": value.disabled === true
- }
- ]]),
- key: value.id,
- disabled: value.disabled === true,
- onClick: ($event) => $setup.onSelectSku(property.id, value.id)
- }, vue.toDisplayString(value.name), 11, ["disabled", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode("view", { class: "buy-num-box ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("view", { class: "label-text" }, "购买数量"),
- vue.createVNode(_component_su_number_box, {
- min: 1,
- max: $setup.state.selectedSku.stock,
- step: 1,
- modelValue: $setup.state.selectedSku.count,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.selectedSku.count = $event),
- onChange: _cache[1] || (_cache[1] = ($event) => $setup.onNumberChange($event)),
- activity: "groupon"
- }, null, 8, ["max", "modelValue"])
- ])
- ])
- ]),
- vue.createCommentVNode(" 操作区 "),
- vue.createElementVNode("view", { class: "modal-footer ss-p-y-20" }, [
- vue.createElementVNode("view", { class: "buy-box ss-flex ss-col-center ss-flex ss-col-center ss-row-center" }, [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("button", { class: "ss-reset-button origin-price-btn ss-flex-col" }, [
- vue.createElementVNode(
- "view",
- { class: "btn-title" },
- vue.toDisplayString($props.grouponNum + "人团"),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("button", {
- class: "ss-reset-button btn-tox ss-flex-col",
- onClick: $setup.onBuy
- }, [
- vue.createElementVNode(
- "view",
- { class: "btn-price" },
- vue.toDisplayString($setup.fen2yuan($props.goodsInfo.price)),
- 1
- /* TEXT */
- ),
- $props.grouponAction === "create" ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, "立即开团")) : $props.grouponAction === "join" ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, "参与拼团")) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1M, [["render", _sfc_render$1L], ["__scopeId", "data-v-f77ace9d"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-select-groupon-sku/s-select-groupon-sku.vue"]]);
- const _sfc_main$1L = {
- __name: "groupon-card-list",
- props: {
- modelValue: {
- type: Object,
- default() {
- }
- }
- },
- emits: ["join"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props = __props;
- const state = vue.reactive({
- list: []
- });
- const emits = __emit;
- function onJoinGroupon(record) {
- emits("join", record);
- }
- function endTime(time2) {
- const durationTime = useDurationTime(time2);
- if (durationTime.ms <= 0) {
- return "该团已解散";
- }
- let timeText = "剩余 ";
- timeText += `${durationTime.h}时`;
- timeText += `${durationTime.m}分`;
- timeText += `${durationTime.s}秒`;
- return timeText;
- }
- vue.onMounted(async () => {
- const { data } = await CombinationApi.getHeadCombinationRecordList(props.modelValue.id, 0, 10);
- state.list = data;
- });
- const __returned__ = { props, state, emits, onJoinGroupon, endTime, onMounted: vue.onMounted, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get useDurationTime() {
- return useDurationTime;
- }, get CombinationApi() {
- return CombinationApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1K(_ctx, _cache, $props, $setup, $data, $options) {
- return $setup.state.list.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "groupon-list detail-card ss-p-x-20"
- }, [
- vue.createElementVNode("view", { class: "join-activity ss-flex ss-row-between ss-m-t-30" }, [
- vue.createCommentVNode(" todo: 接口缺少总数 "),
- vue.createElementVNode(
- "view",
- { class: "" },
- "已有" + vue.toDisplayString($setup.state.list.length) + "人参与活动",
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "cicon-forward" })
- ]),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.list, (record, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- onClick: ($event) => $setup.sheep.$router.go("/pages/activity/groupon/detail", { id: record.id }),
- key: index2,
- class: "ss-m-t-40 ss-flex ss-row-between border-bottom ss-p-b-30"
- }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.cdn(record.avatar),
- class: "user-avatar"
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "view",
- { class: "user-nickname ss-m-l-20 ss-line-1" },
- vue.toDisplayString(record.nickname),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "ss-flex-col ss-col-bottom ss-m-r-20" }, [
- vue.createElementVNode("view", { class: "title ss-flex ss-m-b-14" }, [
- vue.createTextVNode(" 还差 "),
- vue.createElementVNode(
- "view",
- { class: "num" },
- vue.toDisplayString(record.userSize - record.userCount) + "人",
- 1
- /* TEXT */
- ),
- vue.createTextVNode(" 成团 ")
- ]),
- vue.createElementVNode(
- "view",
- { class: "end-time" },
- vue.toDisplayString($setup.endTime(record.expireTime)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "" }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button go-btn",
- onClick: vue.withModifiers(($event) => $setup.onJoinGroupon(record), ["stop"])
- }, " 去参团 ", 8, ["onClick"])
- ])
- ])
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true);
- }
- const grouponCardList = /* @__PURE__ */ _export_sfc(_sfc_main$1L, [["render", _sfc_render$1K], ["__scopeId", "data-v-2bb0fe2d"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/groupon/groupon-card-list.vue"]]);
- const _sfc_main$1K = {
- __name: "groupon",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "efe71281-headerBg": vue.unref(headerBg),
- "efe71281-btnBg": vue.unref(btnBg),
- "efe71281-disabledBtnBg": vue.unref(disabledBtnBg),
- "efe71281-grouponBg": vue.unref(grouponBg)
- }));
- const headerBg = sheep$1.$url.css("/static/images/groupon-bg.png");
- const btnBg = sheep$1.$url.css("/static/images/groupon-btn.png");
- const disabledBtnBg = sheep$1.$url.css(
- "/static/images/activity-btn-disabled.png"
- );
- const grouponBg = sheep$1.$url.css("/static/images/groupon-tip-bg.png");
- onPageScroll(() => {
- });
- const state = vue.reactive({
- skeletonLoading: true,
- // 骨架屏
- goodsId: 0,
- // 商品ID
- goodsInfo: {},
- // 商品信息
- goodsSwiper: [],
- // 商品轮播图
- showSelectSku: false,
- // 显示规格弹框
- selectedSkuPrice: {},
- // 选中的规格价格
- activity: {},
- // 团购活动
- grouponId: 0,
- // 团购ID
- grouponNum: 0,
- // 团购人数
- grouponAction: "create",
- // 团购操作
- combinationHeadId: null
- // 拼团团长编号
- });
- const endTime = vue.computed(() => {
- return useDurationTime(state.activity.endTime);
- });
- function onSkuChange(e2) {
- state.selectedSkuPrice = e2;
- }
- function onSkuClose() {
- state.showSelectSku = false;
- }
- function onCreateGroupon() {
- state.grouponAction = "create";
- state.grouponId = 0;
- state.showSelectSku = true;
- }
- function onJoinGroupon(record) {
- state.grouponAction = "join";
- state.grouponId = record.activityId;
- state.combinationHeadId = record.id;
- state.grouponNum = record.userSize;
- state.showSelectSku = true;
- }
- function onBuy(sku) {
- sheep$1.$router.go("/pages/order/confirm", {
- data: JSON.stringify({
- order_type: "goods",
- combinationActivityId: state.activity.id,
- combinationHeadId: state.combinationHeadId,
- items: [
- {
- skuId: sku.id,
- count: sku.count
- }
- ]
- })
- });
- }
- const shareInfo = vue.computed(() => {
- if (lodashExports.isEmpty(state.activity))
- return {};
- return sheep$1.$platform.share.getShareInfo(
- {
- title: state.activity.name,
- image: sheep$1.$url.cdn(state.goodsInfo.picUrl),
- params: {
- page: "3",
- query: state.activity.id
- }
- },
- {
- type: "goods",
- // 商品海报
- title: state.activity.name,
- // 商品标题
- image: sheep$1.$url.cdn(state.goodsInfo.picUrl),
- // 商品主图
- price: fen2yuan(state.goodsInfo.price),
- // 商品价格
- marketPrice: fen2yuan(state.goodsInfo.marketPrice)
- // 商品原价
- }
- );
- });
- onLoad(async (options2) => {
- if (!options2.id) {
- state.goodsInfo = null;
- return;
- }
- state.grouponId = options2.id;
- const { code: code2, data: activity } = await CombinationApi.getCombinationActivity(state.grouponId);
- state.activity = activity;
- const { data: spu } = await SpuApi.getSpuDetail(activity.spuId);
- state.goodsId = spu.id;
- activity.products.forEach((product) => {
- spu.price = Math.min(spu.price, product.combinationPrice);
- });
- state.skeletonLoading = false;
- if (code2 === 0) {
- state.goodsInfo = spu;
- state.grouponNum = activity.userSize;
- state.goodsSwiper = formatGoodsSwiper(state.goodsInfo.sliderPicUrls);
- } else {
- state.goodsInfo = null;
- }
- });
- const __returned__ = { headerBg, btnBg, disabledBtnBg, grouponBg, state, endTime, onSkuChange, onSkuClose, onCreateGroupon, onJoinGroupon, onBuy, shareInfo, reactive: vue.reactive, computed: vue.computed, get onLoad() {
- return onLoad;
- }, get onPageScroll() {
- return onPageScroll;
- }, get sheep() {
- return sheep$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, detailNavbar, detailCellSku, detailTabbar, detailSkeleton, detailCommentCard, detailContentCard, grouponCardList, get useDurationTime() {
- return useDurationTime;
- }, get formatGoodsSwiper() {
- return formatGoodsSwiper;
- }, get fen2yuan() {
- return fen2yuan;
- }, get CombinationApi() {
- return CombinationApi;
- }, get SpuApi() {
- return SpuApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1J(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_su_swiper = resolveEasycom(vue.resolveDynamicComponent("su-swiper"), __easycom_1$d);
- const _component_s_select_groupon_sku = resolveEasycom(vue.resolveDynamicComponent("s-select-groupon-sku"), __easycom_1$1);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- onShareAppMessage: $setup.shareInfo,
- navbar: "goods"
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 标题栏 "),
- vue.createVNode($setup["detailNavbar"]),
- vue.createCommentVNode(" 骨架屏 "),
- $setup.state.skeletonLoading ? (vue.openBlock(), vue.createBlock($setup["detailSkeleton"], { key: 0 })) : $setup.state.goodsInfo === null || $setup.state.activity.status !== 0 || $setup.state.activity.endTime < (/* @__PURE__ */ new Date()).getTime() ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 下架/售罄提醒 "),
- vue.createVNode(_component_s_empty, {
- text: "活动不存在或已结束",
- icon: "/static/soldout-empty.png",
- showAction: "",
- actionText: "返回上一页",
- onClickAction: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.back())
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createElementVNode("view", { class: "detail-swiper-selector" }, [
- vue.createCommentVNode(" 商品图轮播 "),
- vue.createVNode(_component_su_swiper, {
- class: "ss-m-b-14",
- isPreview: "",
- list: $setup.state.goodsSwiper,
- dotStyle: "tag",
- imageMode: "widthFix",
- dotCur: "bg-mask-40",
- seizeHeight: 750
- }, null, 8, ["list"]),
- vue.createCommentVNode(" 价格+标题 "),
- vue.createElementVNode("view", { class: "title-card detail-card ss-m-y-14 ss-m-x-20 ss-p-x-20 ss-p-y-34" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-m-b-60" }, [
- vue.createElementVNode("view", null, [
- vue.createElementVNode("view", { class: "price-box ss-flex ss-col-bottom ss-m-b-18" }, [
- vue.createElementVNode(
- "view",
- { class: "price-text ss-m-r-16" },
- vue.toDisplayString($setup.fen2yuan($setup.state.activity.price || $setup.state.goodsInfo.price)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "tig ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "tig-icon ss-flex ss-col-center ss-row-center" }, [
- vue.createElementVNode("view", { class: "groupon-tag" }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/groupon-tag.png")
- }, null, 8, ["src"])
- ])
- ]),
- vue.createElementVNode("view", { class: "tig-title" }, "拼团价")
- ])
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-between" }, [
- $setup.state.goodsInfo.price ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "origin-price ss-flex ss-col-center"
- }, [
- vue.createTextVNode(" 单买价: "),
- vue.createElementVNode(
- "view",
- { class: "origin-price-text" },
- vue.toDisplayString($setup.fen2yuan($setup.state.goodsInfo.price)),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- $setup.endTime.ms > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "countdown-box"
- }, [
- vue.createElementVNode("view", { class: "countdown-title ss-m-b-20" }, "距结束仅剩"),
- vue.createElementVNode("view", { class: "ss-flex countdown-time" }, [
- vue.createElementVNode(
- "view",
- { class: "ss-flex countdown-h" },
- vue.toDisplayString($setup.endTime.h),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-m-x-4" }, ":"),
- vue.createElementVNode(
- "view",
- { class: "countdown-num ss-flex ss-row-center" },
- vue.toDisplayString($setup.endTime.m),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-m-x-4" }, ":"),
- vue.createElementVNode(
- "view",
- { class: "countdown-num ss-flex ss-row-center" },
- vue.toDisplayString($setup.endTime.s),
- 1
- /* TEXT */
- )
- ])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "countdown-title"
- }, " 活动已结束 "))
- ]),
- vue.createElementVNode(
- "view",
- { class: "title-text ss-line-2 ss-m-b-6" },
- vue.toDisplayString($setup.state.goodsInfo.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "subtitle-text ss-line-1" },
- vue.toDisplayString($setup.state.goodsInfo.introduction),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 功能卡片 "),
- vue.createElementVNode("view", { class: "detail-cell-card detail-card ss-flex-col" }, [
- vue.createCommentVNode(" 规格 "),
- vue.createVNode($setup["detailCellSku"], {
- sku: $setup.state.selectedSkuPrice,
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.state.showSelectSku = true)
- }, null, 8, ["sku"])
- ]),
- vue.createCommentVNode(" 参团列表 "),
- vue.createVNode($setup["grouponCardList"], {
- modelValue: $setup.state.activity,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.activity = $event),
- onJoin: $setup.onJoinGroupon
- }, null, 8, ["modelValue"]),
- vue.createCommentVNode(" 规格与数量弹框 "),
- vue.createVNode(_component_s_select_groupon_sku, {
- show: $setup.state.showSelectSku,
- goodsInfo: $setup.state.goodsInfo,
- grouponAction: $setup.state.grouponAction,
- grouponNum: $setup.state.grouponNum,
- onBuy: $setup.onBuy,
- onChange: $setup.onSkuChange,
- onClose: $setup.onSkuClose
- }, null, 8, ["show", "goodsInfo", "grouponAction", "grouponNum"])
- ]),
- vue.createCommentVNode(" 评价 "),
- vue.createVNode($setup["detailCommentCard"], {
- class: "detail-comment-selector",
- goodsId: $setup.state.goodsId
- }, null, 8, ["goodsId"]),
- vue.createCommentVNode(" 详情 "),
- vue.createVNode($setup["detailContentCard"], {
- class: "detail-content-selector",
- content: $setup.state.goodsInfo.description
- }, null, 8, ["content"]),
- vue.createCommentVNode(" 商品tabbar "),
- vue.createCommentVNode(" TODO: 已售罄、预热 判断 设计"),
- vue.createVNode($setup["detailTabbar"], {
- modelValue: $setup.state.goodsInfo,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.state.goodsInfo = $event)
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "buy-box ss-flex ss-col-center ss-p-r-20" }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button origin-price-btn ss-flex-col",
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: $setup.state.goodsInfo.id }))
- }, [
- vue.createElementVNode(
- "view",
- { class: "btn-price" },
- vue.toDisplayString($setup.fen2yuan($setup.state.goodsInfo.marketPrice)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", null, "原价购买")
- ]),
- vue.createElementVNode("button", {
- class: vue.normalizeClass([
- "ss-reset-button btn-tox ss-flex-col",
- $setup.state.activity.status === 0 && $setup.state.goodsInfo.stock !== 0 ? "check-btn-box" : "disabled-btn-box"
- ]),
- onClick: $setup.onCreateGroupon,
- disabled: $setup.state.goodsInfo.stock === 0 || $setup.state.activity.status !== 0
- }, [
- vue.createElementVNode(
- "view",
- { class: "btn-price" },
- vue.toDisplayString($setup.fen2yuan($setup.state.activity.price || $setup.state.goodsInfo.price)),
- 1
- /* TEXT */
- ),
- $setup.state.activity.startTime > (/* @__PURE__ */ new Date()).getTime() ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, "未开始")) : $setup.state.activity.endTime <= (/* @__PURE__ */ new Date()).getTime() ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, "已结束")) : (vue.openBlock(), vue.createElementBlock("view", { key: 2 }, [
- $setup.state.goodsInfo.stock === 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, "已售罄")) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, "立即开团"))
- ]))
- ], 10, ["disabled"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue"])
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["onShareAppMessage"]);
- }
- const PagesGoodsGroupon = /* @__PURE__ */ _export_sfc(_sfc_main$1K, [["render", _sfc_render$1J], ["__scopeId", "data-v-efe71281"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/groupon.vue"]]);
- const _sfc_main$1J = {
- __name: "s-select-seckill-sku",
- props: {
- modelValue: {
- type: Object,
- default() {
- }
- },
- show: {
- type: Boolean,
- default: false
- },
- // 单次限购数量
- singleLimitCount: {
- type: Number,
- default: 1
- }
- },
- emits: ["change", "addCart", "buy", "close"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const emits = __emit;
- const props = __props;
- const state = vue.reactive({
- goodsInfo: vue.computed(() => props.modelValue),
- selectedSku: {},
- currentPropertyArray: []
- });
- const propertyList = convertProductPropertyList(state.goodsInfo.skus);
- const skuList = vue.computed(() => {
- let skuPrices = state.goodsInfo.skus;
- for (let price of skuPrices) {
- price.value_id_array = price.properties.map((item) => item.valueId);
- }
- return skuPrices;
- });
- if (!state.goodsInfo.is_sku) {
- state.selectedSku = state.goodsInfo.skus[0];
- }
- vue.watch(
- () => state.selectedSku,
- (newVal) => {
- emits("change", newVal);
- },
- {
- immediate: true,
- // 立即执行
- deep: true
- // 深度监听
- }
- );
- const onBuy = () => {
- if (state.selectedSku.id) {
- if (state.selectedSku.stock <= 0) {
- sheep$1.$helper.toast("库存不足");
- } else {
- emits("buy", state.selectedSku);
- }
- } else {
- sheep$1.$helper.toast("请选择规格");
- }
- };
- function onBuyCountChange(buyCount) {
- if (buyCount > 0 && state.selectedSku.count !== buyCount) {
- state.selectedSku.count = buyCount;
- }
- }
- const changeDisabled = (isChecked = false, propertyId = 0, valueId = 0) => {
- let newSkus = [];
- if (isChecked) {
- for (let price of skuList.value) {
- if (price.stock <= 0) {
- continue;
- }
- if (price.value_id_array.indexOf(valueId) >= 0) {
- newSkus.push(price);
- }
- }
- } else {
- newSkus = getCanUseSkuList();
- }
- let noChooseValueIds = [];
- for (let price of newSkus) {
- noChooseValueIds = noChooseValueIds.concat(price.value_id_array);
- }
- noChooseValueIds = Array.from(new Set(noChooseValueIds));
- if (isChecked) {
- let index2 = noChooseValueIds.indexOf(valueId);
- noChooseValueIds.splice(index2, 1);
- } else {
- state.currentPropertyArray.forEach((currentPropertyId) => {
- if (currentPropertyId.toString() !== "") {
- return;
- }
- let index2 = noChooseValueIds.indexOf(currentPropertyId);
- if (index2 >= 0) {
- noChooseValueIds.splice(index2, 1);
- }
- });
- }
- let choosePropertyIds = [];
- if (!isChecked) {
- state.currentPropertyArray.forEach((currentPropertyId, currentValueId) => {
- if (currentPropertyId !== "") {
- choosePropertyIds.push(currentValueId);
- }
- });
- } else {
- choosePropertyIds = [propertyId];
- }
- for (let propertyIndex in propertyList) {
- if (choosePropertyIds.indexOf(propertyList[propertyIndex]["id"]) >= 0) {
- continue;
- }
- for (let valueIndex in propertyList[propertyIndex]["values"]) {
- propertyList[propertyIndex]["values"][valueIndex]["disabled"] = noChooseValueIds.indexOf(propertyList[propertyIndex]["values"][valueIndex]["id"]) < 0;
- }
- }
- };
- const getCanUseSkuList = () => {
- let newSkus = [];
- for (let sku of skuList.value) {
- if (sku.stock <= 0) {
- continue;
- }
- let isOk = true;
- state.currentPropertyArray.forEach((propertyId) => {
- if (propertyId.toString() !== "" && sku.value_id_array.indexOf(propertyId) < 0) {
- isOk = false;
- }
- });
- if (isOk) {
- newSkus.push(sku);
- }
- }
- return newSkus;
- };
- const onSelectSku = (propertyId, valueId) => {
- let isChecked = true;
- if (state.currentPropertyArray[propertyId] !== void 0 && state.currentPropertyArray[propertyId] === valueId) {
- isChecked = false;
- state.currentPropertyArray.splice(propertyId, 1, "");
- } else {
- state.currentPropertyArray[propertyId] = valueId;
- }
- let choosePropertyId = [];
- state.currentPropertyArray.forEach((currentPropertyId) => {
- if (currentPropertyId !== "") {
- choosePropertyId.push(currentPropertyId);
- }
- });
- let newSkuList = getCanUseSkuList();
- if (choosePropertyId.length === propertyList.length && newSkuList.length) {
- newSkuList[0].count = state.selectedSku.count || 1;
- state.selectedSku = newSkuList[0];
- } else {
- state.selectedSku = {};
- }
- changeDisabled(isChecked, propertyId, valueId);
- };
- changeDisabled(false);
- const __returned__ = { emits, props, state, propertyList, skuList, onBuy, onBuyCountChange, changeDisabled, getCanUseSkuList, onSelectSku, computed: vue.computed, reactive: vue.reactive, watch: vue.watch, get sheep() {
- return sheep$1;
- }, get convertProductPropertyList() {
- return convertProductPropertyList;
- }, get fen2yuan() {
- return fen2yuan;
- }, get min() {
- return lodashExports.min;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1I(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_number_box = resolveEasycom(vue.resolveDynamicComponent("su-number-box"), __easycom_0$b);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 规格弹窗 "),
- vue.createVNode(_component_su_popup, {
- show: $props.show,
- round: "10",
- onClose: _cache[2] || (_cache[2] = ($event) => $setup.emits("close"))
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" SKU 信息 "),
- vue.createElementVNode("view", { class: "ss-modal-box bg-white ss-flex-col" }, [
- vue.createElementVNode("view", { class: "modal-header ss-flex ss-col-center" }, [
- vue.createCommentVNode(" 规格图 "),
- vue.createElementVNode("view", { class: "header-left ss-m-r-30" }, [
- vue.createElementVNode("image", {
- class: "sku-image",
- src: $setup.sheep.$url.cdn($setup.state.selectedSku.picUrl || $setup.state.goodsInfo.picUrl),
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "header-right ss-flex-col ss-row-between ss-flex-1" }, [
- vue.createCommentVNode(" 名称 "),
- vue.createElementVNode(
- "view",
- { class: "goods-title ss-line-2" },
- vue.toDisplayString($setup.state.goodsInfo.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "header-right-bottom ss-flex ss-col-center ss-row-between" }, [
- vue.createCommentVNode(" 价格 "),
- vue.createElementVNode(
- "view",
- { class: "price-text" },
- vue.toDisplayString($setup.fen2yuan($setup.state.selectedSku.price || $setup.state.goodsInfo.price)),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(" 秒杀价格标签 "),
- vue.createElementVNode("view", { class: "tig ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "tig-icon ss-flex ss-col-center ss-row-center" }, [
- vue.createElementVNode("text", { class: "cicon-alarm" })
- ]),
- vue.createElementVNode("view", { class: "tig-title" }, "秒杀价")
- ]),
- vue.createCommentVNode(" 库存 "),
- vue.createElementVNode(
- "view",
- { class: "stock-text ss-m-l-20" },
- " 库存" + vue.toDisplayString($setup.state.selectedSku.stock || $setup.state.goodsInfo.stock) + "件 ",
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- vue.createElementVNode("view", { class: "modal-content ss-flex-1" }, [
- vue.createElementVNode("scroll-view", {
- "scroll-y": "true",
- class: "modal-content-scroll"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.propertyList, (property) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "sku-item ss-m-b-20",
- key: property.id
- }, [
- vue.createElementVNode(
- "view",
- { class: "label-text ss-m-b-20" },
- vue.toDisplayString(property.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-flex-wrap" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(property.values, (value) => {
- return vue.openBlock(), vue.createElementBlock("button", {
- class: vue.normalizeClass(["ss-reset-button spec-btn", [
- {
- "checked-btn": $setup.state.currentPropertyArray[property.id] === value.id
- },
- {
- "disabled-btn": value.disabled === true
- }
- ]]),
- key: value.id,
- disabled: value.disabled === true,
- onClick: ($event) => $setup.onSelectSku(property.id, value.id)
- }, vue.toDisplayString(value.name), 11, ["disabled", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode("view", { class: "buy-num-box ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("view", { class: "label-text" }, "购买数量"),
- vue.createVNode(_component_su_number_box, {
- min: 1,
- max: $setup.min([$props.singleLimitCount, $setup.state.selectedSku.stock]),
- step: 1,
- modelValue: $setup.state.selectedSku.count,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.selectedSku.count = $event),
- onChange: _cache[1] || (_cache[1] = ($event) => $setup.onBuyCountChange($event)),
- activity: "seckill"
- }, null, 8, ["max", "modelValue"])
- ])
- ])
- ]),
- vue.createElementVNode("view", { class: "modal-footer" }, [
- vue.createElementVNode("view", { class: "buy-box ss-flex ss-col-center ss-flex ss-col-center ss-row-center" }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button buy-btn",
- onClick: $setup.onBuy
- }, "确认")
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const __easycom_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1J, [["render", _sfc_render$1I], ["__scopeId", "data-v-e3bc621c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-select-seckill-sku/s-select-seckill-sku.vue"]]);
- const _sfc_main$1I = {
- __name: "detail-progress",
- props: {
- percent: {
- type: Number,
- default: 0
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1H(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "progress-title ss-m-r-10" },
- " 已抢" + vue.toDisplayString($props.percent) + "% ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "progress-box ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- {
- class: "progerss-active",
- style: vue.normalizeStyle({ width: $props.percent < 10 ? "10%" : $props.percent + "%" })
- },
- null,
- 4
- /* STYLE */
- )
- ])
- ]);
- }
- const detailProgress = /* @__PURE__ */ _export_sfc(_sfc_main$1I, [["render", _sfc_render$1H], ["__scopeId", "data-v-af274eda"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/components/detail/detail-progress.vue"]]);
- const _sfc_main$1H = {
- __name: "seckill",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "960ccb8e-headerBg": vue.unref(headerBg),
- "960ccb8e-btnBg": vue.unref(btnBg),
- "960ccb8e-disabledBtnBg": vue.unref(disabledBtnBg),
- "960ccb8e-seckillBg": vue.unref(seckillBg),
- "960ccb8e-grouponBg": vue.unref(grouponBg)
- }));
- const headerBg = sheep$1.$url.css("/static/img/shop/goods/seckill-bg.png");
- const btnBg = sheep$1.$url.css("/static/img/shop/goods/seckill-btn.png");
- const disabledBtnBg = sheep$1.$url.css(
- "/static/img/shop/goods/activity-btn-disabled.png"
- );
- const seckillBg = sheep$1.$url.css("/static/img/shop/goods/seckill-tip-bg.png");
- const grouponBg = sheep$1.$url.css("/static/img/shop/goods/groupon-tip-bg.png");
- onPageScroll(() => {
- });
- const state = vue.reactive({
- skeletonLoading: true,
- goodsInfo: {},
- showSelectSku: false,
- goodsSwiper: [],
- selectedSku: {},
- showModel: false,
- total: 0,
- percent: 0,
- price: ""
- });
- const endTime = vue.computed(() => {
- return useDurationTime(activity.value.endTime);
- });
- function onSkuChange(e2) {
- state.selectedSku = e2;
- }
- function onBuy(sku) {
- sheep$1.$router.go("/pages/order/confirm", {
- data: JSON.stringify({
- order_type: "goods",
- buy_type: "seckill",
- seckillActivityId: activity.value.id,
- items: [
- {
- skuId: sku.id,
- count: sku.count
- }
- ]
- })
- });
- }
- const shareInfo = vue.computed(() => {
- if (lodashExports.isEmpty(activity))
- return {};
- return sheep$1.$platform.share.getShareInfo(
- {
- title: activity.value.name,
- image: sheep$1.$url.cdn(state.goodsInfo.picUrl),
- params: {
- page: "4",
- query: activity.value.id
- }
- },
- {
- type: "goods",
- // 商品海报
- title: activity.value.name,
- // 商品标题
- image: sheep$1.$url.cdn(state.goodsInfo.picUrl),
- // 商品主图
- price: state.goodsInfo.price,
- // 商品价格
- marketPrice: state.goodsInfo.marketPrice
- // 商品原价
- }
- );
- });
- const activity = vue.ref();
- const timeStatusEnum = vue.ref("");
- const getActivity = async (id) => {
- const { data } = await SeckillApi.getSeckillActivity(id);
- activity.value = data;
- timeStatusEnum.value = getTimeStatusEnum(activity.startTime, activity.endTime);
- await getSpu(data.spuId);
- };
- const getSpu = async (id) => {
- const { data } = await SpuApi.getSpuDetail(id);
- data.activity_type = "seckill";
- state.goodsInfo = data;
- state.goodsSwiper = formatGoodsSwiper(state.goodsInfo.sliderPicUrls);
- state.goodsInfo.price = lodashExports.min([state.goodsInfo.price, ...activity.value.products.map((spu) => spu.seckillPrice)]);
- data.skus.forEach((sku) => {
- const product = activity.value.products.find((product2) => product2.skuId === sku.id);
- if (product) {
- sku.price = product.seckillPrice;
- sku.stock = Math.min(sku.stock, product.stock);
- } else {
- sku.stock = 0;
- }
- if (activity.value.totalLimitCount > 0 && activity.value.singleLimitCount > 0) {
- sku.limitCount = Math.min(activity.value.totalLimitCount, activity.value.singleLimitCount);
- } else if (activity.value.totalLimitCount > 0) {
- sku.limitCount = activity.value.totalLimitCount;
- } else if (activity.value.singleLimitCount > 0) {
- sku.limitCount = activity.value.singleLimitCount;
- }
- });
- state.skeletonLoading = false;
- };
- onLoad((options2) => {
- if (!options2.id) {
- state.goodsInfo = null;
- return;
- }
- getActivity(options2.id);
- });
- const __returned__ = { headerBg, btnBg, disabledBtnBg, seckillBg, grouponBg, state, endTime, onSkuChange, onBuy, shareInfo, activity, timeStatusEnum, getActivity, getSpu, reactive: vue.reactive, computed: vue.computed, ref: vue.ref, get onLoad() {
- return onLoad;
- }, get onPageScroll() {
- return onPageScroll;
- }, get sheep() {
- return sheep$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, get min() {
- return lodashExports.min;
- }, get useDurationTime() {
- return useDurationTime;
- }, get formatGoodsSwiper() {
- return formatGoodsSwiper;
- }, get fen2yuan() {
- return fen2yuan;
- }, detailNavbar, detailCellSku, detailTabbar, detailSkeleton, detailCommentCard, detailContentCard, detailProgress, get SeckillApi() {
- return SeckillApi;
- }, get SpuApi() {
- return SpuApi;
- }, get getTimeStatusEnum() {
- return getTimeStatusEnum;
- }, get TimeStatusEnum() {
- return TimeStatusEnum;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1G(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_su_swiper = resolveEasycom(vue.resolveDynamicComponent("su-swiper"), __easycom_1$d);
- const _component_s_select_seckill_sku = resolveEasycom(vue.resolveDynamicComponent("s-select-seckill-sku"), __easycom_2$1);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- onShareAppMessage: $setup.shareInfo,
- navbar: "goods"
- }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createCommentVNode(" 标题栏 "),
- vue.createVNode($setup["detailNavbar"]),
- vue.createCommentVNode(" 骨架屏 "),
- $setup.state.skeletonLoading ? (vue.openBlock(), vue.createBlock($setup["detailSkeleton"], { key: 0 })) : $setup.state.goodsInfo === null || $setup.state.goodsInfo.activity_type !== "seckill" ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 下架/售罄提醒 "),
- vue.createVNode(_component_s_empty, {
- text: "活动不存在或已结束",
- icon: "/static/soldout-empty.png",
- showAction: "",
- actionText: "再逛逛",
- actionUrl: "/pages/goods/list"
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createElementVNode("view", { class: "detail-swiper-selector" }, [
- vue.createCommentVNode(" 商品图轮播 "),
- vue.createVNode(_component_su_swiper, {
- class: "ss-m-b-14",
- isPreview: "",
- list: $setup.state.goodsSwiper,
- dotStyle: "tag",
- imageMode: "widthFix",
- dotCur: "bg-mask-40",
- seizeHeight: 750
- }, null, 8, ["list"]),
- vue.createCommentVNode(" 价格+标题 "),
- vue.createElementVNode("view", { class: "title-card ss-m-y-14 ss-m-x-20 ss-p-x-20 ss-p-y-34" }, [
- vue.createElementVNode("view", { class: "price-box ss-flex ss-row-between ss-m-b-18" }, [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode(
- "view",
- { class: "price-text ss-m-r-16" },
- vue.toDisplayString($setup.fen2yuan($setup.state.selectedSku.price || $setup.state.goodsInfo.price)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "tig ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "tig-icon ss-flex ss-col-center ss-row-center" }, [
- vue.createElementVNode("text", { class: "cicon-alarm" })
- ]),
- vue.createElementVNode("view", { class: "tig-title" }, "秒杀价")
- ])
- ]),
- $setup.endTime.ms > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "countdown-box"
- }, [
- vue.createElementVNode("view", { class: "countdown-title ss-m-b-20" }, "距结束仅剩"),
- vue.createElementVNode("view", { class: "ss-flex countdown-time" }, [
- vue.createElementVNode(
- "view",
- { class: "ss-flex countdown-h" },
- vue.toDisplayString($setup.endTime.h),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-m-x-4" }, ":"),
- vue.createElementVNode(
- "view",
- { class: "countdown-num ss-flex ss-row-center" },
- vue.toDisplayString($setup.endTime.m),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-m-x-4" }, ":"),
- vue.createElementVNode(
- "view",
- { class: "countdown-num ss-flex ss-row-center" },
- vue.toDisplayString($setup.endTime.s),
- 1
- /* TEXT */
- )
- ])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "countdown-title"
- }, " 活动已结束 "))
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-m-b-60" }, [
- $setup.state.goodsInfo.marketPrice ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "origin-price ss-flex ss-col-center"
- }, [
- vue.createTextVNode(" 原价 "),
- vue.createElementVNode(
- "view",
- { class: "origin-price-text" },
- vue.toDisplayString($setup.fen2yuan($setup.state.selectedSku.marketPrice || $setup.state.goodsInfo.marketPrice)),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createVNode($setup["detailProgress"], {
- percent: $setup.state.percent
- }, null, 8, ["percent"])
- ]),
- vue.createElementVNode(
- "view",
- { class: "title-text ss-line-2 ss-m-b-6" },
- vue.toDisplayString((_a2 = $setup.state.goodsInfo) == null ? void 0 : _a2.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "subtitle-text ss-line-1" },
- vue.toDisplayString($setup.state.goodsInfo.introduction),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 功能卡片 "),
- vue.createElementVNode("view", { class: "detail-cell-card detail-card ss-flex-col" }, [
- vue.createVNode($setup["detailCellSku"], {
- sku: $setup.state.selectedSku,
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.showSelectSku = true)
- }, null, 8, ["sku"])
- ]),
- vue.createCommentVNode(" 规格与数量弹框 "),
- vue.createVNode(_component_s_select_seckill_sku, {
- modelValue: $setup.state.goodsInfo,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.goodsInfo = $event),
- show: $setup.state.showSelectSku,
- "single-limit-count": $setup.activity.singleLimitCount,
- onBuy: $setup.onBuy,
- onChange: $setup.onSkuChange,
- onClose: _cache[2] || (_cache[2] = ($event) => $setup.state.showSelectSku = false)
- }, null, 8, ["modelValue", "show", "single-limit-count"])
- ]),
- vue.createCommentVNode(" 评价 "),
- vue.createVNode($setup["detailCommentCard"], {
- class: "detail-comment-selector",
- goodsId: $setup.state.goodsInfo.id
- }, null, 8, ["goodsId"]),
- vue.createCommentVNode(" 详情 "),
- vue.createVNode($setup["detailContentCard"], {
- class: "detail-content-selector",
- content: $setup.state.goodsInfo.description
- }, null, 8, ["content"]),
- vue.createCommentVNode(" 详情tabbar "),
- vue.createVNode($setup["detailTabbar"], {
- modelValue: $setup.state.goodsInfo,
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $setup.state.goodsInfo = $event)
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" TODO: 缺货中 已售罄 判断 设计"),
- vue.createElementVNode("view", { class: "buy-box ss-flex ss-col-center ss-p-r-20" }, [
- $setup.state.goodsInfo.marketPrice ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "ss-reset-button origin-price-btn ss-flex-col",
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: $setup.state.goodsInfo.id }))
- }, [
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "view",
- { class: "btn-price" },
- vue.toDisplayString($setup.fen2yuan($setup.state.goodsInfo.marketPrice)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", null, "原价购买")
- ])
- ])) : (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button origin-price-btn ss-flex-col"
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["no-original", $setup.state.goodsInfo.stock === 0 || $setup.timeStatusEnum !== $setup.TimeStatusEnum.STARTED ? "" : ""])
- },
- " 秒杀价 ",
- 2
- /* CLASS */
- )
- ])),
- vue.createElementVNode("button", {
- class: vue.normalizeClass([
- "ss-reset-button btn-box ss-flex-col",
- $setup.timeStatusEnum === $setup.TimeStatusEnum.STARTED && $setup.state.goodsInfo.stock != 0 ? "check-btn-box" : "disabled-btn-box"
- ]),
- onClick: _cache[4] || (_cache[4] = ($event) => $setup.state.showSelectSku = true),
- disabled: $setup.state.goodsInfo.stock === 0 || $setup.timeStatusEnum !== $setup.TimeStatusEnum.STARTED
- }, [
- vue.createElementVNode(
- "view",
- { class: "btn-price" },
- vue.toDisplayString($setup.fen2yuan($setup.state.goodsInfo.price)),
- 1
- /* TEXT */
- ),
- $setup.timeStatusEnum === $setup.TimeStatusEnum.STARTED ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- $setup.state.goodsInfo.stock === 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, "已售罄")) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, "立即秒杀"))
- ])) : (vue.openBlock(), vue.createElementBlock(
- "view",
- { key: 1 },
- vue.toDisplayString($setup.timeStatusEnum),
- 1
- /* TEXT */
- ))
- ], 10, ["disabled"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue"])
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["onShareAppMessage"]);
- }
- const PagesGoodsSeckill = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["render", _sfc_render$1G], ["__scopeId", "data-v-960ccb8e"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/seckill.vue"]]);
- const _sfc_main$1G = {
- name: "su-tabs",
- data() {
- return {
- addStyle,
- addUnit,
- firstTime: true,
- scrollLeft: 0,
- scrollViewWidth: 0,
- lineOffsetLeft: 0,
- tabsRect: {
- left: 0
- },
- innerCurrent: 0,
- moving: false
- };
- },
- props: {
- // 滑块的移动过渡时间,单位ms
- duration: {
- type: Number,
- default: 300
- },
- // tabs标签数组
- list: {
- type: Array,
- default: []
- },
- badge: {
- type: Boolean,
- default: false
- },
- // 滑块颜色
- lineColor: {
- type: String,
- default: ""
- },
- // 菜单选择中时的样式
- activeStyle: {
- type: [String, Object],
- default() {
- return {
- color: "#303133"
- };
- }
- },
- // 菜单非选中时的样式
- inactiveStyle: {
- type: [String, Object],
- default() {
- return {
- color: "#606266"
- };
- }
- },
- // 滑块长度
- lineWidth: {
- type: [String, Number],
- default: 20
- },
- // 滑块高度
- lineHeight: {
- type: [String, Number],
- default: 3
- },
- // 滑块背景显示大小,当滑块背景设置为图片时使用
- lineBgSize: {
- type: String,
- default: "cover"
- },
- // 菜单item的样式
- itemStyle: {
- type: [String, Object],
- default() {
- return {
- height: "44px"
- };
- }
- },
- // 菜单是否可滚动
- scrollable: {
- type: Boolean,
- default: true
- },
- // 当前选中标签的索引
- current: {
- type: [Number, String],
- default: 0
- },
- // 默认读取的键名
- keyName: {
- type: String,
- default: "name"
- }
- },
- watch: {
- current: {
- immediate: true,
- handler(newValue, oldValue) {
- if (newValue !== this.innerCurrent) {
- this.innerCurrent = newValue;
- this.$nextTick(() => {
- this.resize();
- });
- }
- }
- },
- // list变化时,重新渲染list各项信息
- list() {
- this.$nextTick(() => {
- this.resize();
- });
- }
- },
- computed: {
- textStyle() {
- return (index2) => {
- const style = {};
- const customeStyle = index2 === this.innerCurrent ? addStyle(this.activeStyle) : addStyle(this.inactiveStyle);
- if (this.list[index2].disabled) {
- style.color = "#c8c9cc";
- }
- return deepMerge(customeStyle, style);
- };
- }
- },
- async mounted() {
- this.init();
- },
- methods: {
- $uGetRect(selector, all) {
- return new Promise((resolve) => {
- uni.createSelectorQuery().in(this)[all ? "selectAll" : "select"](selector).boundingClientRect((rect) => {
- if (all && Array.isArray(rect) && rect.length) {
- resolve(rect);
- }
- if (!all && rect) {
- resolve(rect);
- }
- }).exec();
- });
- },
- setLineLeft() {
- const tabItem = this.list[this.innerCurrent];
- if (!tabItem) {
- return;
- }
- let lineOffsetLeft = this.list.slice(0, this.innerCurrent).reduce((total, curr) => total + curr.rect.width, 0);
- const lineWidth = getPx(this.lineWidth);
- this.lineOffsetLeft = lineOffsetLeft + (tabItem.rect.width - lineWidth) / 2;
- if (this.firstTime) {
- setTimeout(() => {
- this.firstTime = false;
- }, 10);
- }
- },
- // nvue下设置滑块的位置
- animation(x, duration2 = 0) {
- },
- // 点击某一个标签
- clickHandler(item, index2) {
- this.$emit("click", {
- ...item,
- index: index2
- });
- if (item.disabled)
- return;
- this.innerCurrent = index2;
- this.resize();
- this.$emit("change", {
- ...item,
- index: index2
- });
- },
- init() {
- sleep().then(() => {
- this.resize();
- });
- },
- setScrollLeft() {
- const tabRect = this.list[this.innerCurrent];
- const offsetLeft = this.list.slice(0, this.innerCurrent).reduce((total, curr) => {
- return total + curr.rect.width;
- }, 0);
- const windowWidth2 = sys$1().windowWidth;
- let scrollLeft = offsetLeft - (this.tabsRect.width - tabRect.rect.width) / 2 - (windowWidth2 - this.tabsRect.right) / 2 + this.tabsRect.left / 2;
- scrollLeft = Math.min(scrollLeft, this.scrollViewWidth - this.tabsRect.width);
- this.scrollLeft = Math.max(0, scrollLeft);
- },
- // 获取所有标签的尺寸
- resize() {
- if (this.list.length === 0) {
- return;
- }
- Promise.all([this.getTabsRect(), this.getAllItemRect()]).then(
- ([tabsRect, itemRect = []]) => {
- this.tabsRect = tabsRect;
- this.scrollViewWidth = 0;
- itemRect.map((item, index2) => {
- this.scrollViewWidth += item.width;
- this.list[index2].rect = item;
- });
- this.setLineLeft();
- this.setScrollLeft();
- }
- );
- },
- // 获取导航菜单的尺寸
- getTabsRect() {
- return new Promise((resolve) => {
- this.queryRect("u-tabs__wrapper__scroll-view").then((size) => resolve(size));
- });
- },
- // 获取所有标签的尺寸
- getAllItemRect() {
- return new Promise((resolve) => {
- const promiseAllArr = this.list.map(
- (item, index2) => this.queryRect(`u-tabs__wrapper__nav__item-${index2}`, true)
- );
- Promise.all(promiseAllArr).then((sizes) => resolve(sizes));
- });
- },
- // 获取各个标签的尺寸
- queryRect(el, item) {
- return new Promise((resolve) => {
- this.$uGetRect(`.${el}`).then((size) => {
- resolve(size);
- });
- });
- }
- }
- };
- function _sfc_render$1F(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_badge = resolveEasycom(vue.resolveDynamicComponent("uni-badge"), __easycom_0$j);
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-tabs" }, [
- vue.createElementVNode("view", { class: "u-tabs__wrapper" }, [
- vue.renderSlot(_ctx.$slots, "left", {}, void 0, true),
- vue.createElementVNode("view", { class: "u-tabs__wrapper__scroll-view-wrapper" }, [
- vue.createElementVNode("scroll-view", {
- "scroll-x": $props.scrollable,
- "scroll-left": $data.scrollLeft,
- "scroll-with-animation": "",
- "enable-flex": "",
- class: "u-tabs__wrapper__scroll-view white-space",
- "show-scrollbar": false,
- ref: "u-tabs__wrapper__scroll-view"
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "u-tabs__wrapper__nav",
- ref: "u-tabs__wrapper__nav"
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["u-tabs__wrapper__nav__item", [
- `u-tabs__wrapper__nav__item-${index2}`,
- item.disabled && "u-tabs__wrapper__nav__item--disabled"
- ]]),
- key: index2,
- onClick: ($event) => $options.clickHandler(item, index2),
- ref_for: true,
- ref: `u-tabs__wrapper__nav__item-${index2}`,
- style: vue.normalizeStyle([$data.addStyle($props.itemStyle), { flex: $props.scrollable ? "" : 1 }])
- }, [
- $props.badge && item.isShow ? (vue.openBlock(), vue.createBlock(_component_uni_badge, {
- key: 0,
- class: "uni-badge-left-margin",
- text: item.num,
- absolute: "rightTop",
- size: "small"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass([[item.disabled && "u-tabs__wrapper__nav__item__text--disabled"], "u-tabs__wrapper__nav__item__text"]),
- style: vue.normalizeStyle([$options.textStyle(index2)])
- },
- vue.toDisplayString(item[$props.keyName]),
- 7
- /* TEXT, CLASS, STYLE */
- )
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["text"])) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: vue.normalizeClass([[item.disabled && "u-tabs__wrapper__nav__item__text--disabled"], "u-tabs__wrapper__nav__item__text"]),
- style: vue.normalizeStyle([$options.textStyle(index2)])
- },
- vue.toDisplayString(item[$props.keyName]),
- 7
- /* TEXT, CLASS, STYLE */
- ))
- ], 14, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode(
- "view",
- {
- class: "u-tabs__wrapper__nav__line",
- ref: "u-tabs__wrapper__nav__line",
- style: vue.normalizeStyle([
- {
- width: $data.addUnit($props.lineWidth),
- transform: `translate(${$data.lineOffsetLeft}px)`,
- transitionDuration: `${$data.firstTime ? 0 : $props.duration}ms`,
- height: $data.addUnit($props.lineHeight),
- background: $props.lineColor ? $props.lineColor : "var(--ui-BG-Main)",
- backgroundSize: $props.lineBgSize
- }
- ])
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 512
- /* NEED_PATCH */
- )
- ], 8, ["scroll-x", "scroll-left"])
- ]),
- vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
- ])
- ]);
- }
- const __easycom_0$a = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["render", _sfc_render$1F], ["__scopeId", "data-v-035e7744"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-tabs/su-tabs.vue"]]);
- const _sfc_main$1F = {
- name: "su-sticky",
- props: {
- // 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px
- offsetTop: {
- type: [String, Number],
- default: 0
- },
- // 自定义导航栏的高度
- customNavHeight: {
- type: [String, Number],
- default: sheep$1.$platform.navbar
- },
- // 是否开启吸顶功能
- stickyToTop: {
- type: Boolean,
- default: false
- },
- // 吸顶区域的背景颜色
- bgColor: {
- type: String,
- default: "transparent"
- },
- // z-index值
- zIndex: {
- type: [String, Number],
- default: ""
- },
- // 列表中的索引值
- index: {
- type: [String, Number],
- default: ""
- },
- customStyle: {
- type: [Object, String],
- default: () => ({})
- }
- },
- data() {
- return {
- cssSticky: false,
- // 是否使用css的sticky实现
- stickyTop: 0,
- // 吸顶的top值,因为可能受自定义导航栏影响,最终的吸顶值非offsetTop值
- elId: guid(),
- left: 0,
- // js模式时,吸顶的内容因为处于postition: fixed模式,为了和原来保持一致的样式,需要记录并重新设置它的left,height,width属性
- width: "auto",
- height: "auto",
- fixed: false
- // js模式时,是否处于吸顶模式
- };
- },
- computed: {
- style() {
- const style = {};
- if (!this.stickyToTop) {
- if (this.cssSticky) {
- style.position = "sticky";
- style.zIndex = this.uZindex;
- style.top = addUnit(this.stickyTop);
- } else {
- style.height = this.fixed ? this.height + "px" : "auto";
- }
- } else {
- style.position = "static";
- }
- style.backgroundColor = this.bgColor;
- return deepMerge(addStyle(this.customStyle), style);
- },
- // 吸顶内容的样式
- stickyContent() {
- const style = {};
- if (!this.cssSticky) {
- style.position = this.fixed ? "fixed" : "static";
- style.top = this.stickyTop + "px";
- style.left = this.left + "px";
- style.width = this.width == "auto" ? "auto" : this.width + "px";
- style.zIndex = this.uZindex;
- }
- return style;
- },
- uZindex() {
- return this.zIndex ? this.zIndex : 970;
- }
- },
- mounted() {
- this.init();
- },
- methods: {
- init() {
- this.getStickyTop();
- this.checkSupportCssSticky();
- if (!this.cssSticky) {
- !this.stickyToTop && this.initObserveContent();
- }
- },
- $uGetRect(selector, all) {
- return new Promise((resolve) => {
- uni.createSelectorQuery().in(this)[all ? "selectAll" : "select"](selector).boundingClientRect((rect) => {
- if (all && Array.isArray(rect) && rect.length) {
- resolve(rect);
- }
- if (!all && rect) {
- resolve(rect);
- }
- }).exec();
- });
- },
- initObserveContent() {
- this.$uGetRect("#" + this.elId).then((res) => {
- this.height = res.height;
- this.left = res.left;
- this.width = res.width;
- this.$nextTick(() => {
- this.observeContent();
- });
- });
- },
- observeContent() {
- this.disconnectObserver("contentObserver");
- const contentObserver = uni.createIntersectionObserver({
- // 检测的区间范围
- thresholds: [0.95, 0.98, 1]
- });
- contentObserver.relativeToViewport({
- top: -this.stickyTop
- });
- contentObserver.observe(`#${this.elId}`, (res) => {
- this.setFixed(res.boundingClientRect.top);
- });
- this.contentObserver = contentObserver;
- },
- setFixed(top) {
- const fixed = top <= this.stickyTop;
- this.fixed = fixed;
- },
- disconnectObserver(observerName) {
- const observer = this[observerName];
- observer && observer.disconnect();
- },
- getStickyTop() {
- this.stickyTop = getPx(this.offsetTop) + getPx(this.customNavHeight);
- },
- async checkSupportCssSticky() {
- if (os$2() === "android" && Number(sys$1().system) > 8) {
- this.cssSticky = true;
- }
- this.cssSticky = await this.checkComputedStyle();
- if (os$2() === "ios") {
- this.cssSticky = true;
- }
- },
- // 在APP和微信小程序上,通过uni.createSelectorQuery可以判断是否支持css sticky
- checkComputedStyle() {
- return new Promise((resolve) => {
- uni.createSelectorQuery().in(this).select(".u-sticky").fields({
- computedStyle: ["position"]
- }).exec((e2) => {
- resolve("sticky" === e2[0].position);
- });
- });
- },
- // H5通过创建元素的形式嗅探是否支持css sticky
- // 判断浏览器是否支持sticky属性
- checkCssStickyForH5() {
- }
- },
- beforeDestroy() {
- this.disconnectObserver("contentObserver");
- }
- };
- function _sfc_render$1E(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-sticky",
- id: $data.elId,
- style: vue.normalizeStyle([$options.style])
- }, [
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle([$options.stickyContent]),
- class: "u-sticky__content"
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 4
- /* STYLE */
- )
- ], 12, ["id"]);
- }
- const __easycom_0$9 = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["render", _sfc_render$1E], ["__scopeId", "data-v-453bc176"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-sticky/su-sticky.vue"]]);
- const _sfc_main$1E = {
- __name: "list",
- emits: ["close", "change"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const sys_navBar = sheep$1.$platform.navbar;
- const emits = __emit;
- const state = vue.reactive({
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 6
- },
- currentSort: void 0,
- currentOrder: void 0,
- currentTab: 0,
- // 当前选中的 tab
- curFilter: 0,
- // 当前选中的 list 筛选项
- showFilter: false,
- iconStatus: false,
- // true - 单列布局;false - 双列布局
- keyword: "",
- categoryId: 0,
- tabList: [
- {
- name: t$6("common.recommended"),
- list: [
- {
- label: t$6("common.recommended")
- },
- {
- label: t$6("common.price_asc"),
- sort: "price",
- order: true
- },
- {
- label: t$6("common.price_desc"),
- sort: "price",
- order: false
- }
- ]
- },
- {
- name: t$6("common.sales"),
- sort: "salesCount",
- order: false
- },
- {
- name: t$6("common.newest"),
- value: "createTime",
- order: false
- }
- ],
- loadStatus: "",
- leftGoodsList: [],
- // 双列布局 - 左侧商品
- rightGoodsList: []
- // 双列布局 - 右侧商品
- });
- let count = 0;
- let leftHeight = 0;
- let rightHeight = 0;
- function mountMasonry(height = 0, where = "left") {
- if (!state.pagination.list[count]) {
- return;
- }
- if (where === "left") {
- leftHeight += height;
- } else {
- rightHeight += height;
- }
- if (leftHeight <= rightHeight) {
- state.leftGoodsList.push(state.pagination.list[count]);
- } else {
- state.rightGoodsList.push(state.pagination.list[count]);
- }
- count++;
- }
- function emptyList() {
- resetPagination(state.pagination);
- state.leftGoodsList = [];
- state.rightGoodsList = [];
- count = 0;
- leftHeight = 0;
- rightHeight = 0;
- }
- function onSearch(e2) {
- state.keyword = e2;
- emptyList();
- getList(state.currentSort, state.currentOrder);
- }
- function onTabsChange(e2) {
- if (state.tabList[e2.index].list) {
- state.currentTab = e2.index;
- state.showFilter = !state.showFilter;
- return;
- }
- state.showFilter = false;
- if (e2.index === state.currentTab) {
- return;
- }
- state.currentTab = e2.index;
- state.currentSort = e2.sort;
- state.currentOrder = e2.order;
- emptyList();
- getList(e2.sort, e2.order);
- }
- const onFilterItem = (val) => {
- if (state.currentSort === state.tabList[0].list[val].sort && state.currentOrder === state.tabList[0].list[val].order) {
- state.showFilter = false;
- return;
- }
- state.showFilter = false;
- state.curFilter = val;
- state.tabList[0].name = state.tabList[0].list[val].label;
- state.currentSort = state.tabList[0].list[val].sort;
- state.currentOrder = state.tabList[0].list[val].order;
- emptyList();
- getList();
- };
- async function getList() {
- state.loadStatus = "loading";
- const { code: code2, data } = await SpuApi.getSpuPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- sortField: state.currentSort,
- sortAsc: state.currentOrder,
- categoryId: state.categoryId,
- keyword: state.keyword
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- mountMasonry();
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getList(state.currentSort, state.currentOrder);
- }
- onLoad((options2) => {
- state.categoryId = options2.categoryId;
- state.keyword = options2.keyword;
- getList(state.currentSort, state.currentOrder);
- });
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { sys_navBar, emits, state, get count() {
- return count;
- }, set count(v2) {
- count = v2;
- }, get leftHeight() {
- return leftHeight;
- }, set leftHeight(v2) {
- leftHeight = v2;
- }, get rightHeight() {
- return rightHeight;
- }, set rightHeight(v2) {
- rightHeight = v2;
- }, mountMasonry, emptyList, onSearch, onTabsChange, onFilterItem, getList, loadMore, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get sheep() {
- return sheep$1;
- }, get _() {
- return _$1;
- }, get resetPagination() {
- return resetPagination;
- }, get SpuApi() {
- return SpuApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1D(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- navbar: "normal",
- leftWidth: 0,
- rightWidth: 0,
- tools: "search",
- defaultSearch: $setup.state.keyword,
- onSearch: $setup.onSearch
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 筛选 "),
- vue.createVNode(_component_su_sticky, { bgColor: "#fff" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "ss-flex-1" }, [
- vue.createVNode(_component_su_tabs, {
- list: $setup.state.tabList,
- scrollable: false,
- onChange: $setup.onTabsChange,
- current: $setup.state.currentTab
- }, null, 8, ["list", "current"])
- ]),
- vue.createElementVNode("view", {
- class: "list-icon",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.iconStatus = !$setup.state.iconStatus)
- }, [
- $setup.state.iconStatus ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "sicon-goods-list"
- })) : (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- class: "sicon-goods-card"
- }))
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(" 弹窗 "),
- vue.createVNode(_component_su_popup, {
- show: $setup.state.showFilter,
- type: "top",
- round: "10",
- space: $setup.sys_navBar + 38,
- backgroundColor: "#F6F6F6",
- zIndex: 10,
- onClose: _cache[1] || (_cache[1] = ($event) => $setup.state.showFilter = false)
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "filter-list-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.tabList[$setup.state.currentTab].list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["filter-item", [{ "filter-item-active": index2 === $setup.state.curFilter }]]),
- key: item.value,
- onClick: ($event) => $setup.onFilterItem(index2)
- }, vue.toDisplayString(item.label), 11, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show", "space"]),
- vue.createCommentVNode(" 情况一:单列布局 "),
- $setup.state.iconStatus && $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "goods-list ss-m-t-20"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "ss-p-l-20 ss-p-r-20 ss-m-b-20",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_column, {
- class: "",
- size: "lg",
- data: item,
- topRadius: 10,
- bottomRadius: 10,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id })
- }, null, 8, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 情况二:双列布局 "),
- !$setup.state.iconStatus && $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "ss-flex ss-flex-wrap ss-p-x-20 ss-m-t-20 ss-col-top"
- }, [
- vue.createElementVNode("view", { class: "goods-list-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.leftGoodsList, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "left-list",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-md-box",
- size: "md",
- data: item,
- topRadius: 10,
- bottomRadius: 10,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id }),
- onGetHeight: _cache[2] || (_cache[2] = ($event) => $setup.mountMasonry($event, "left"))
- }, {
- cart: vue.withCtx(() => [
- vue.createElementVNode("button", { class: "ss-reset-button cart-btn" })
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("view", { class: "goods-list-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.rightGoodsList, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "right-list",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-md-box",
- size: "md",
- topRadius: 10,
- bottomRadius: 10,
- data: item,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id }),
- onGetHeight: _cache[3] || (_cache[3] = ($event) => $setup.mountMasonry($event, "right"))
- }, {
- cart: vue.withCtx(() => [
- vue.createElementVNode("button", { class: "ss-reset-button cart-btn" })
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 3,
- icon: "/static/soldout-empty.png",
- text: "暂无商品"
- })) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["defaultSearch"]);
- }
- const PagesGoodsList = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["render", _sfc_render$1D], ["__scopeId", "data-v-7f2f18c6"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/list.vue"]]);
- const easycom = {
- autoscan: true,
- custom: {
- "^s-(.*)": "@/sheep/components/s-$1/s-$1.vue",
- "^su-(.*)": "@/sheep/ui/su-$1/su-$1.vue"
- }
- };
- const pages = [
- {
- path: "pages/index/FirstIndex",
- aliasPath: "/",
- style: {
- navigationBarTitleText: "%title.home%",
- enablePullDownRefresh: true
- },
- meta: {
- auth: false,
- sync: true,
- title: "首页",
- group: "商城"
- }
- },
- {
- path: "pages/index/FirstActivity",
- style: {
- navigationBarTitleText: "%title.home%",
- enablePullDownRefresh: true
- },
- meta: {
- auth: false,
- sync: true,
- title: "活动",
- group: "商城"
- }
- },
- {
- path: "pages/index/FirstVideo",
- style: {
- navigationBarTitleText: "%title.home%",
- enablePullDownRefresh: true
- },
- meta: {
- auth: false,
- sync: true,
- title: "视频",
- group: "商城"
- }
- },
- {
- path: "pages/index/FirstList",
- style: {
- navigationBarTitleText: "%title.home%",
- enablePullDownRefresh: true
- },
- meta: {
- auth: false,
- sync: true,
- title: "列表",
- group: "商城"
- }
- },
- {
- path: "pages/index/index",
- style: {
- navigationBarTitleText: "%title.home%",
- enablePullDownRefresh: true
- },
- meta: {
- auth: false,
- sync: true,
- title: "首页",
- group: "商城"
- }
- },
- {
- path: "pages/index/user",
- style: {
- navigationBarTitleText: "%title.usercenter%",
- enablePullDownRefresh: true
- },
- meta: {
- sync: true,
- title: "个人中心",
- group: "商城"
- }
- },
- {
- path: "pages/index/category",
- style: {
- navigationBarTitleText: "商品分类"
- },
- meta: {
- sync: true,
- title: "商品分类",
- group: "商城"
- }
- },
- {
- path: "pages/index/cart",
- style: {
- navigationBarTitleText: "购物车"
- },
- meta: {
- sync: true,
- title: "购物车",
- group: "商城"
- }
- },
- {
- path: "pages/index/login"
- },
- {
- path: "pages/index/search",
- style: {
- navigationBarTitleText: "搜索"
- },
- meta: {
- sync: true,
- title: "搜索",
- group: "商城"
- }
- },
- {
- path: "pages/index/page",
- style: {
- navigationBarTitleText: ""
- },
- meta: {
- auth: false,
- sync: true,
- title: "自定义页面",
- group: "商城"
- }
- }
- ];
- const subPackages = [
- {
- root: "pages/goods",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "商品详情"
- },
- meta: {
- sync: true,
- title: "普通商品",
- group: "商品"
- }
- },
- {
- path: "groupon",
- style: {
- navigationBarTitleText: "拼团商品"
- },
- meta: {
- sync: true,
- title: "拼团商品",
- group: "商品"
- }
- },
- {
- path: "seckill",
- style: {
- navigationBarTitleText: "秒杀商品"
- },
- meta: {
- sync: true,
- title: "秒杀商品",
- group: "商品"
- }
- },
- {
- path: "list",
- style: {
- navigationBarTitleText: "商品列表"
- },
- meta: {
- sync: true,
- title: "商品列表",
- group: "商品"
- }
- },
- {
- path: "comment/add",
- style: {
- navigationBarTitleText: "评价商品"
- },
- meta: {
- auth: true
- }
- },
- {
- path: "comment/list",
- style: {
- navigationBarTitleText: "商品评价"
- }
- }
- ]
- },
- {
- root: "pages/order",
- pages: [
- {
- path: "detail",
- style: {
- navigationBarTitleText: "订单详情"
- },
- meta: {
- auth: true,
- title: "订单详情"
- }
- },
- {
- path: "confirm",
- style: {
- navigationBarTitleText: "确认订单"
- },
- meta: {
- auth: true,
- title: "确认订单"
- }
- },
- {
- path: "list",
- style: {
- navigationBarTitleText: "我的订单",
- enablePullDownRefresh: true
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户订单",
- group: "订单中心"
- }
- },
- {
- path: "aftersale/apply",
- style: {
- navigationBarTitleText: "申请售后"
- },
- meta: {
- auth: true,
- title: "申请售后"
- }
- },
- {
- path: "aftersale/return-delivery",
- style: {
- navigationBarTitleText: "退货物流"
- },
- meta: {
- auth: true,
- title: "退货物流"
- }
- },
- {
- path: "aftersale/list",
- style: {
- navigationBarTitleText: "售后列表"
- },
- meta: {
- auth: true,
- sync: true,
- title: "售后订单",
- group: "订单中心"
- }
- },
- {
- path: "aftersale/detail",
- style: {
- navigationBarTitleText: "售后详情"
- },
- meta: {
- auth: true,
- title: "售后详情"
- }
- },
- {
- path: "aftersale/log",
- style: {
- navigationBarTitleText: "售后进度"
- },
- meta: {
- auth: true,
- title: "售后进度"
- }
- },
- {
- path: "express/log",
- style: {
- navigationBarTitleText: "物流轨迹"
- },
- meta: {
- auth: true,
- title: "物流轨迹"
- }
- },
- {
- path: "otherlist",
- style: {
- navigationBarTitleText: "",
- enablePullDownRefresh: false
- }
- }
- ]
- },
- {
- root: "pages/user",
- pages: [
- {
- path: "info",
- style: {
- navigationBarTitleText: "%title.userinfo%"
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户信息",
- group: "用户中心"
- }
- },
- {
- path: "setting",
- style: {
- navigationBarTitleText: "%title.settings%"
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户设置",
- group: "用户中心"
- }
- },
- {
- path: "qrcode-share",
- style: {
- navigationBarTitleText: "我的二维码/分享页"
- },
- meta: {
- auth: true,
- sync: true,
- title: "我的二维码/分享页",
- group: "用户中心"
- }
- },
- {
- path: "goods-collect",
- style: {
- navigationBarTitleText: "我的收藏"
- },
- meta: {
- auth: true,
- sync: true,
- title: "商品收藏",
- group: "用户中心"
- }
- },
- {
- path: "goods-log",
- style: {
- navigationBarTitleText: "我的足迹"
- },
- meta: {
- auth: true,
- sync: true,
- title: "浏览记录",
- group: "用户中心"
- }
- },
- {
- path: "address/list",
- style: {
- navigationBarTitleText: "实体商品收货地址"
- },
- meta: {
- auth: true,
- sync: true,
- title: "地址管理",
- group: "用户中心"
- }
- },
- {
- path: "dummyAddress/list",
- style: {
- navigationBarTitleText: "虚拟商品收货地址"
- },
- meta: {
- auth: true,
- sync: true,
- title: "虚拟商品收货地址",
- group: "用户中心"
- }
- },
- {
- path: "invoice/edit",
- style: {
- navigationBarTitleText: "发票抬头编辑"
- },
- meta: {
- auth: true,
- title: "发票抬头"
- }
- },
- {
- path: "invoice/list",
- style: {
- navigationBarTitleText: "发票抬头管理"
- },
- meta: {
- auth: true,
- sync: true,
- title: "发票抬头管理",
- group: "用户中心"
- }
- },
- {
- path: "address/edit",
- style: {
- navigationBarTitleText: "编辑地址"
- },
- meta: {
- auth: true,
- title: "编辑地址"
- }
- },
- {
- path: "dummyAddress/edit",
- style: {
- navigationBarTitleText: "编辑地址"
- },
- meta: {
- auth: true,
- title: "编辑地址"
- }
- },
- {
- path: "wallet/money",
- style: {
- navigationBarTitleText: "我的余额"
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户余额",
- group: "用户中心"
- }
- },
- {
- path: "wallet/score",
- style: {
- navigationBarTitleText: "钱包"
- },
- meta: {
- auth: true,
- sync: true,
- title: "钱包",
- group: "用户中心"
- }
- },
- {
- path: "wallet/consumptionLog",
- style: {
- navigationBarTitleText: "消费分来源"
- },
- meta: {
- auth: true,
- sync: true,
- title: "消费分来源",
- group: "用户中心"
- }
- },
- {
- path: "wallet/topupConsumptionPoints",
- style: {
- navigationBarTitleText: "消费分充值"
- },
- meta: {
- auth: true,
- sync: true,
- title: "消费分充值",
- group: "用户中心"
- }
- },
- {
- path: "wallet/consumptionTransfersLog",
- style: {
- navigationBarTitleText: "消费分转账"
- },
- meta: {
- auth: true,
- sync: true,
- title: "消费分转账",
- group: "用户中心"
- }
- },
- {
- path: "wallet/consumptionTransfers",
- style: {
- navigationBarTitleText: "消费分转让"
- },
- meta: {
- auth: true,
- sync: true,
- title: "消费分转让",
- group: "用户中心"
- }
- },
- {
- path: "wallet/scoreToConsumption",
- style: {
- navigationBarTitleText: "佣金转消费分"
- },
- meta: {
- auth: true,
- sync: true,
- title: "佣金转消费分",
- group: "用户中心"
- }
- },
- {
- path: "wallet/withdraw",
- style: {
- navigationBarTitleText: "提现"
- },
- meta: {
- auth: true,
- sync: true,
- title: "提现",
- group: "提现"
- }
- },
- {
- path: "wallet/withdrawalLog",
- style: {
- navigationBarTitleText: "提现记录"
- },
- meta: {
- auth: true,
- sync: true,
- title: "提现记录",
- group: "提现记录"
- }
- },
- {
- path: "wallet/scoreToMoney",
- style: {
- navigationBarTitleText: "佣金兑换"
- },
- meta: {
- auth: true,
- sync: true,
- title: "佣金兑换",
- group: "用户中心"
- }
- },
- {
- path: "wallet/ScoreLog"
- },
- {
- path: "wallet/maxScoreLog"
- },
- {
- path: "wallet/team",
- style: {
- navigationBarTitleText: "团队"
- },
- meta: {
- auth: true,
- sync: true,
- title: "团队",
- group: "用户中心"
- }
- }
- ]
- },
- {
- root: "pages/commission",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "分销"
- },
- meta: {
- auth: true,
- sync: true,
- title: "分销中心",
- group: "分销商城"
- }
- },
- {
- path: "wallet",
- style: {
- navigationBarTitleText: "我的佣金"
- },
- meta: {
- auth: true,
- sync: true,
- title: "用户佣金",
- group: "分销中心"
- }
- },
- {
- path: "goods",
- style: {
- navigationBarTitleText: "推广商品"
- },
- meta: {
- auth: true,
- sync: true,
- title: "推广商品",
- group: "分销商城"
- }
- },
- {
- path: "order",
- style: {
- navigationBarTitleText: "分销订单"
- },
- meta: {
- auth: true,
- sync: true,
- title: "分销订单",
- group: "分销商城"
- }
- },
- {
- path: "team",
- style: {
- navigationBarTitleText: "我的团队"
- },
- meta: {
- auth: true,
- sync: true,
- title: "我的团队",
- group: "分销商城"
- }
- },
- {
- path: "promoter",
- style: {
- navigationBarTitleText: "推广人排行榜"
- },
- meta: {
- auth: true,
- sync: true,
- title: "推广人排行榜",
- group: "分销商城"
- }
- },
- {
- path: "commission-ranking",
- style: {
- navigationBarTitleText: "佣金排行榜"
- },
- meta: {
- auth: true,
- sync: true,
- title: "佣金排行榜",
- group: "分销商城"
- }
- },
- {
- path: "withdraw",
- style: {
- navigationBarTitleText: "申请提现"
- },
- meta: {
- auth: true,
- sync: true,
- title: "申请提现",
- group: "分销商城"
- }
- }
- ]
- },
- {
- root: "pages/app",
- pages: [
- {
- path: "sign",
- style: {
- navigationBarTitleText: "签到中心"
- },
- meta: {
- auth: true,
- sync: true,
- title: "签到中心",
- group: "应用"
- }
- }
- ]
- },
- {
- root: "pages/shop",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "店铺首页"
- },
- meta: {
- auth: true,
- sync: true,
- title: "店铺首页",
- group: "应用"
- }
- },
- {
- path: "category",
- style: {
- navigationBarTitleText: "店铺分类"
- },
- meta: {
- auth: true,
- sync: true,
- title: "店铺分类",
- group: "应用"
- }
- },
- {
- path: "allproduct",
- style: {
- navigationBarTitleText: "所有商品"
- },
- meta: {
- auth: true,
- sync: true,
- title: "所有商品",
- group: "应用"
- }
- }
- ]
- },
- {
- root: "pages/public",
- pages: [
- {
- path: "setting",
- style: {
- navigationBarTitleText: "系统设置"
- },
- meta: {
- sync: true,
- title: "系统设置",
- group: "通用"
- }
- },
- {
- path: "richtext",
- style: {
- navigationBarTitleText: "富文本"
- },
- meta: {
- sync: true,
- title: "富文本",
- group: "通用"
- }
- },
- {
- path: "faq",
- style: {
- navigationBarTitleText: "常见问题"
- },
- meta: {
- sync: true,
- title: "常见问题",
- group: "通用"
- }
- },
- {
- path: "error",
- style: {
- navigationBarTitleText: "错误页面"
- }
- },
- {
- path: "webview",
- style: {
- navigationBarTitleText: ""
- }
- },
- {
- path: "merchant",
- style: {
- navigationBarTitleText: "",
- enablePullDownRefresh: false
- }
- },
- {
- path: "merchantApplyList",
- style: {
- navigationBarTitleText: "",
- enablePullDownRefresh: false
- }
- }
- ]
- },
- {
- root: "pages/coupon",
- pages: [
- {
- path: "list",
- style: {
- navigationBarTitleText: "领券中心"
- },
- meta: {
- sync: true,
- title: "领券中心",
- group: "优惠券"
- }
- },
- {
- path: "detail",
- style: {
- navigationBarTitleText: "优惠券"
- },
- meta: {
- auth: false,
- sync: true,
- title: "优惠券详情",
- group: "优惠券"
- }
- }
- ]
- },
- {
- root: "pages/chat",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "客服"
- },
- meta: {
- auth: true,
- sync: true,
- title: "客服",
- group: "客服"
- }
- },
- {
- path: "speechtotext",
- style: {
- navigationBarTitleText: "语音转文字",
- enablePullDownRefresh: false
- },
- meta: {
- auth: true,
- sync: true,
- title: "语音转文字",
- group: "语音转文字"
- }
- }
- ]
- },
- {
- root: "pages/pay",
- pages: [
- {
- path: "index",
- style: {
- navigationBarTitleText: "收银台"
- }
- },
- {
- path: "result",
- style: {
- navigationBarTitleText: "富友支付结果"
- }
- },
- {
- path: "resultYuan",
- style: {
- navigationBarTitleText: "支付结果"
- }
- },
- {
- path: "recharge",
- style: {
- navigationBarTitleText: "充值余额"
- },
- meta: {
- auth: true,
- sync: true,
- title: "充值余额",
- group: "支付"
- }
- },
- {
- path: "recharge-log",
- style: {
- navigationBarTitleText: "充值记录"
- },
- meta: {
- auth: true,
- sync: true,
- title: "充值记录",
- group: "支付"
- }
- }
- ]
- },
- {
- root: "pages/activity",
- pages: [
- {
- path: "groupon/detail",
- style: {
- navigationBarTitleText: "拼团详情"
- }
- },
- {
- path: "groupon/order",
- style: {
- navigationBarTitleText: "我的拼团",
- enablePullDownRefresh: true
- },
- meta: {
- auth: true,
- sync: true,
- title: "拼团订单",
- group: "营销活动"
- }
- },
- {
- path: "index",
- style: {
- navigationBarTitleText: "营销商品"
- },
- meta: {
- sync: true,
- title: "营销商品",
- group: "营销活动"
- }
- },
- {
- path: "groupon/list",
- style: {
- navigationBarTitleText: "拼团活动"
- },
- meta: {
- sync: true,
- title: "拼团活动",
- group: "营销活动"
- }
- },
- {
- path: "seckill/list",
- style: {
- navigationBarTitleText: "秒杀活动"
- },
- meta: {
- sync: true,
- title: "秒杀活动",
- group: "营销活动"
- }
- },
- {
- path: "bargain/list",
- style: {
- navigationBarTitleText: "砍价列表"
- },
- meta: {
- sync: true,
- title: "砍价列表",
- group: "营销活动"
- }
- },
- {
- path: "bargain/detail",
- style: {
- navigationBarTitleText: "砍价详情"
- },
- meta: {
- sync: true,
- title: "砍价详情",
- group: "营销活动"
- }
- }
- ]
- }
- ];
- const globalStyle = {
- navigationBarTextStyle: "black",
- navigationBarTitleText: "常来此购",
- navigationBarBackgroundColor: "#FFFFFF",
- backgroundColor: "#FFFFFF",
- navigationStyle: "custom"
- };
- const tabBar = {
- list: [
- {
- pagePath: "pages/index/index"
- },
- {
- pagePath: "pages/index/cart"
- },
- {
- pagePath: "pages/index/user"
- }
- ]
- };
- const condition = {
- current: 0,
- list: [
- {
- name: "",
- path: "",
- query: ""
- }
- ]
- };
- const usingComponents = {
- richtext: "@/pages/public/richtext"
- };
- const e = {
- easycom,
- pages,
- subPackages,
- globalStyle,
- tabBar,
- condition,
- usingComponents
- };
- var define_process_env_UNI_SECURE_NETWORK_CONFIG_default = [];
- function t$3(e2) {
- return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
- }
- function n(e2, t2, n2) {
- return e2(n2 = { path: t2, exports: {}, require: function(e3, t3) {
- return function() {
- throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
- }(null == t3 && n2.path);
- } }, n2.exports), n2.exports;
- }
- var s = n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = n2 || function(e3, t3) {
- var n3 = Object.create || /* @__PURE__ */ function() {
- function e4() {
- }
- return function(t4) {
- var n4;
- return e4.prototype = t4, n4 = new e4(), e4.prototype = null, n4;
- };
- }(), s2 = {}, r2 = s2.lib = {}, i2 = r2.Base = { extend: function(e4) {
- var t4 = n3(this);
- return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") && this.init !== t4.init || (t4.init = function() {
- t4.$super.init.apply(this, arguments);
- }), t4.init.prototype = t4, t4.$super = this, t4;
- }, create: function() {
- var e4 = this.extend();
- return e4.init.apply(e4, arguments), e4;
- }, init: function() {
- }, mixIn: function(e4) {
- for (var t4 in e4)
- e4.hasOwnProperty(t4) && (this[t4] = e4[t4]);
- e4.hasOwnProperty("toString") && (this.toString = e4.toString);
- }, clone: function() {
- return this.init.prototype.extend(this);
- } }, o2 = r2.WordArray = i2.extend({ init: function(e4, n4) {
- e4 = this.words = e4 || [], this.sigBytes = n4 != t3 ? n4 : 4 * e4.length;
- }, toString: function(e4) {
- return (e4 || c2).stringify(this);
- }, concat: function(e4) {
- var t4 = this.words, n4 = e4.words, s3 = this.sigBytes, r3 = e4.sigBytes;
- if (this.clamp(), s3 % 4)
- for (var i3 = 0; i3 < r3; i3++) {
- var o3 = n4[i3 >>> 2] >>> 24 - i3 % 4 * 8 & 255;
- t4[s3 + i3 >>> 2] |= o3 << 24 - (s3 + i3) % 4 * 8;
- }
- else
- for (i3 = 0; i3 < r3; i3 += 4)
- t4[s3 + i3 >>> 2] = n4[i3 >>> 2];
- return this.sigBytes += r3, this;
- }, clamp: function() {
- var t4 = this.words, n4 = this.sigBytes;
- t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4);
- }, clone: function() {
- var e4 = i2.clone.call(this);
- return e4.words = this.words.slice(0), e4;
- }, random: function(t4) {
- for (var n4, s3 = [], r3 = function(t5) {
- t5 = t5;
- var n5 = 987654321, s4 = 4294967295;
- return function() {
- var r4 = ((n5 = 36969 * (65535 & n5) + (n5 >> 16) & s4) << 16) + (t5 = 18e3 * (65535 & t5) + (t5 >> 16) & s4) & s4;
- return r4 /= 4294967296, (r4 += 0.5) * (e3.random() > 0.5 ? 1 : -1);
- };
- }, i3 = 0; i3 < t4; i3 += 4) {
- var a3 = r3(4294967296 * (n4 || e3.random()));
- n4 = 987654071 * a3(), s3.push(4294967296 * a3() | 0);
- }
- return new o2.init(s3, t4);
- } }), a2 = s2.enc = {}, c2 = a2.Hex = { stringify: function(e4) {
- for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
- var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
- s3.push((i3 >>> 4).toString(16)), s3.push((15 & i3).toString(16));
- }
- return s3.join("");
- }, parse: function(e4) {
- for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3 += 2)
- n4[s3 >>> 3] |= parseInt(e4.substr(s3, 2), 16) << 24 - s3 % 8 * 4;
- return new o2.init(n4, t4 / 2);
- } }, u2 = a2.Latin1 = { stringify: function(e4) {
- for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
- var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
- s3.push(String.fromCharCode(i3));
- }
- return s3.join("");
- }, parse: function(e4) {
- for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3++)
- n4[s3 >>> 2] |= (255 & e4.charCodeAt(s3)) << 24 - s3 % 4 * 8;
- return new o2.init(n4, t4);
- } }, l2 = a2.Utf8 = { stringify: function(e4) {
- try {
- return decodeURIComponent(escape(u2.stringify(e4)));
- } catch (e5) {
- throw new Error("Malformed UTF-8 data");
- }
- }, parse: function(e4) {
- return u2.parse(unescape(encodeURIComponent(e4)));
- } }, h2 = r2.BufferedBlockAlgorithm = i2.extend({ reset: function() {
- this._data = new o2.init(), this._nDataBytes = 0;
- }, _append: function(e4) {
- "string" == typeof e4 && (e4 = l2.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes;
- }, _process: function(t4) {
- var n4 = this._data, s3 = n4.words, r3 = n4.sigBytes, i3 = this.blockSize, a3 = r3 / (4 * i3), c3 = (a3 = t4 ? e3.ceil(a3) : e3.max((0 | a3) - this._minBufferSize, 0)) * i3, u3 = e3.min(4 * c3, r3);
- if (c3) {
- for (var l3 = 0; l3 < c3; l3 += i3)
- this._doProcessBlock(s3, l3);
- var h3 = s3.splice(0, c3);
- n4.sigBytes -= u3;
- }
- return new o2.init(h3, u3);
- }, clone: function() {
- var e4 = i2.clone.call(this);
- return e4._data = this._data.clone(), e4;
- }, _minBufferSize: 0 });
- r2.Hasher = h2.extend({ cfg: i2.extend(), init: function(e4) {
- this.cfg = this.cfg.extend(e4), this.reset();
- }, reset: function() {
- h2.reset.call(this), this._doReset();
- }, update: function(e4) {
- return this._append(e4), this._process(), this;
- }, finalize: function(e4) {
- return e4 && this._append(e4), this._doFinalize();
- }, blockSize: 16, _createHelper: function(e4) {
- return function(t4, n4) {
- return new e4.init(n4).finalize(t4);
- };
- }, _createHmacHelper: function(e4) {
- return function(t4, n4) {
- return new d2.HMAC.init(e4, n4).finalize(t4);
- };
- } });
- var d2 = s2.algo = {};
- return s2;
- }(Math), n2);
- }), r = s, i = (n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = r, function(e3) {
- var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [];
- !function() {
- for (var t4 = 0; t4 < 64; t4++)
- a2[t4] = 4294967296 * e3.abs(e3.sin(t4 + 1)) | 0;
- }();
- var c2 = o2.MD5 = i2.extend({ _doReset: function() {
- this._hash = new r2.init([1732584193, 4023233417, 2562383102, 271733878]);
- }, _doProcessBlock: function(e4, t4) {
- for (var n3 = 0; n3 < 16; n3++) {
- var s3 = t4 + n3, r3 = e4[s3];
- e4[s3] = 16711935 & (r3 << 8 | r3 >>> 24) | 4278255360 & (r3 << 24 | r3 >>> 8);
- }
- var i3 = this._hash.words, o3 = e4[t4 + 0], c3 = e4[t4 + 1], p2 = e4[t4 + 2], f2 = e4[t4 + 3], g2 = e4[t4 + 4], m2 = e4[t4 + 5], y2 = e4[t4 + 6], _2 = e4[t4 + 7], w2 = e4[t4 + 8], v2 = e4[t4 + 9], I2 = e4[t4 + 10], S2 = e4[t4 + 11], b2 = e4[t4 + 12], k2 = e4[t4 + 13], A2 = e4[t4 + 14], C2 = e4[t4 + 15], P2 = i3[0], T2 = i3[1], x2 = i3[2], O2 = i3[3];
- P2 = u2(P2, T2, x2, O2, o3, 7, a2[0]), O2 = u2(O2, P2, T2, x2, c3, 12, a2[1]), x2 = u2(x2, O2, P2, T2, p2, 17, a2[2]), T2 = u2(T2, x2, O2, P2, f2, 22, a2[3]), P2 = u2(P2, T2, x2, O2, g2, 7, a2[4]), O2 = u2(O2, P2, T2, x2, m2, 12, a2[5]), x2 = u2(x2, O2, P2, T2, y2, 17, a2[6]), T2 = u2(T2, x2, O2, P2, _2, 22, a2[7]), P2 = u2(P2, T2, x2, O2, w2, 7, a2[8]), O2 = u2(O2, P2, T2, x2, v2, 12, a2[9]), x2 = u2(x2, O2, P2, T2, I2, 17, a2[10]), T2 = u2(T2, x2, O2, P2, S2, 22, a2[11]), P2 = u2(P2, T2, x2, O2, b2, 7, a2[12]), O2 = u2(O2, P2, T2, x2, k2, 12, a2[13]), x2 = u2(x2, O2, P2, T2, A2, 17, a2[14]), P2 = l2(P2, T2 = u2(T2, x2, O2, P2, C2, 22, a2[15]), x2, O2, c3, 5, a2[16]), O2 = l2(O2, P2, T2, x2, y2, 9, a2[17]), x2 = l2(x2, O2, P2, T2, S2, 14, a2[18]), T2 = l2(T2, x2, O2, P2, o3, 20, a2[19]), P2 = l2(P2, T2, x2, O2, m2, 5, a2[20]), O2 = l2(O2, P2, T2, x2, I2, 9, a2[21]), x2 = l2(x2, O2, P2, T2, C2, 14, a2[22]), T2 = l2(T2, x2, O2, P2, g2, 20, a2[23]), P2 = l2(P2, T2, x2, O2, v2, 5, a2[24]), O2 = l2(O2, P2, T2, x2, A2, 9, a2[25]), x2 = l2(x2, O2, P2, T2, f2, 14, a2[26]), T2 = l2(T2, x2, O2, P2, w2, 20, a2[27]), P2 = l2(P2, T2, x2, O2, k2, 5, a2[28]), O2 = l2(O2, P2, T2, x2, p2, 9, a2[29]), x2 = l2(x2, O2, P2, T2, _2, 14, a2[30]), P2 = h2(P2, T2 = l2(T2, x2, O2, P2, b2, 20, a2[31]), x2, O2, m2, 4, a2[32]), O2 = h2(O2, P2, T2, x2, w2, 11, a2[33]), x2 = h2(x2, O2, P2, T2, S2, 16, a2[34]), T2 = h2(T2, x2, O2, P2, A2, 23, a2[35]), P2 = h2(P2, T2, x2, O2, c3, 4, a2[36]), O2 = h2(O2, P2, T2, x2, g2, 11, a2[37]), x2 = h2(x2, O2, P2, T2, _2, 16, a2[38]), T2 = h2(T2, x2, O2, P2, I2, 23, a2[39]), P2 = h2(P2, T2, x2, O2, k2, 4, a2[40]), O2 = h2(O2, P2, T2, x2, o3, 11, a2[41]), x2 = h2(x2, O2, P2, T2, f2, 16, a2[42]), T2 = h2(T2, x2, O2, P2, y2, 23, a2[43]), P2 = h2(P2, T2, x2, O2, v2, 4, a2[44]), O2 = h2(O2, P2, T2, x2, b2, 11, a2[45]), x2 = h2(x2, O2, P2, T2, C2, 16, a2[46]), P2 = d2(P2, T2 = h2(T2, x2, O2, P2, p2, 23, a2[47]), x2, O2, o3, 6, a2[48]), O2 = d2(O2, P2, T2, x2, _2, 10, a2[49]), x2 = d2(x2, O2, P2, T2, A2, 15, a2[50]), T2 = d2(T2, x2, O2, P2, m2, 21, a2[51]), P2 = d2(P2, T2, x2, O2, b2, 6, a2[52]), O2 = d2(O2, P2, T2, x2, f2, 10, a2[53]), x2 = d2(x2, O2, P2, T2, I2, 15, a2[54]), T2 = d2(T2, x2, O2, P2, c3, 21, a2[55]), P2 = d2(P2, T2, x2, O2, w2, 6, a2[56]), O2 = d2(O2, P2, T2, x2, C2, 10, a2[57]), x2 = d2(x2, O2, P2, T2, y2, 15, a2[58]), T2 = d2(T2, x2, O2, P2, k2, 21, a2[59]), P2 = d2(P2, T2, x2, O2, g2, 6, a2[60]), O2 = d2(O2, P2, T2, x2, S2, 10, a2[61]), x2 = d2(x2, O2, P2, T2, p2, 15, a2[62]), T2 = d2(T2, x2, O2, P2, v2, 21, a2[63]), i3[0] = i3[0] + P2 | 0, i3[1] = i3[1] + T2 | 0, i3[2] = i3[2] + x2 | 0, i3[3] = i3[3] + O2 | 0;
- }, _doFinalize: function() {
- var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
- n3[r3 >>> 5] |= 128 << 24 - r3 % 32;
- var i3 = e3.floor(s3 / 4294967296), o3 = s3;
- n3[15 + (r3 + 64 >>> 9 << 4)] = 16711935 & (i3 << 8 | i3 >>> 24) | 4278255360 & (i3 << 24 | i3 >>> 8), n3[14 + (r3 + 64 >>> 9 << 4)] = 16711935 & (o3 << 8 | o3 >>> 24) | 4278255360 & (o3 << 24 | o3 >>> 8), t4.sigBytes = 4 * (n3.length + 1), this._process();
- for (var a3 = this._hash, c3 = a3.words, u3 = 0; u3 < 4; u3++) {
- var l3 = c3[u3];
- c3[u3] = 16711935 & (l3 << 8 | l3 >>> 24) | 4278255360 & (l3 << 24 | l3 >>> 8);
- }
- return a3;
- }, clone: function() {
- var e4 = i2.clone.call(this);
- return e4._hash = this._hash.clone(), e4;
- } });
- function u2(e4, t4, n3, s3, r3, i3, o3) {
- var a3 = e4 + (t4 & n3 | ~t4 & s3) + r3 + o3;
- return (a3 << i3 | a3 >>> 32 - i3) + t4;
- }
- function l2(e4, t4, n3, s3, r3, i3, o3) {
- var a3 = e4 + (t4 & s3 | n3 & ~s3) + r3 + o3;
- return (a3 << i3 | a3 >>> 32 - i3) + t4;
- }
- function h2(e4, t4, n3, s3, r3, i3, o3) {
- var a3 = e4 + (t4 ^ n3 ^ s3) + r3 + o3;
- return (a3 << i3 | a3 >>> 32 - i3) + t4;
- }
- function d2(e4, t4, n3, s3, r3, i3, o3) {
- var a3 = e4 + (n3 ^ (t4 | ~s3)) + r3 + o3;
- return (a3 << i3 | a3 >>> 32 - i3) + t4;
- }
- t3.MD5 = i2._createHelper(c2), t3.HmacMD5 = i2._createHmacHelper(c2);
- }(Math), n2.MD5);
- }), n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = r, void function() {
- var e3 = n2, t3 = e3.lib.Base, s2 = e3.enc.Utf8;
- e3.algo.HMAC = t3.extend({ init: function(e4, t4) {
- e4 = this._hasher = new e4.init(), "string" == typeof t4 && (t4 = s2.parse(t4));
- var n3 = e4.blockSize, r2 = 4 * n3;
- t4.sigBytes > r2 && (t4 = e4.finalize(t4)), t4.clamp();
- for (var i2 = this._oKey = t4.clone(), o2 = this._iKey = t4.clone(), a2 = i2.words, c2 = o2.words, u2 = 0; u2 < n3; u2++)
- a2[u2] ^= 1549556828, c2[u2] ^= 909522486;
- i2.sigBytes = o2.sigBytes = r2, this.reset();
- }, reset: function() {
- var e4 = this._hasher;
- e4.reset(), e4.update(this._iKey);
- }, update: function(e4) {
- return this._hasher.update(e4), this;
- }, finalize: function(e4) {
- var t4 = this._hasher, n3 = t4.finalize(e4);
- return t4.reset(), t4.finalize(this._oKey.clone().concat(n3));
- } });
- }());
- }), n(function(e2, t2) {
- e2.exports = r.HmacMD5;
- })), o = n(function(e2, t2) {
- e2.exports = r.enc.Utf8;
- }), a = n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = r, function() {
- var e3 = n2, t3 = e3.lib.WordArray;
- function s2(e4, n3, s3) {
- for (var r2 = [], i2 = 0, o2 = 0; o2 < n3; o2++)
- if (o2 % 4) {
- var a2 = s3[e4.charCodeAt(o2 - 1)] << o2 % 4 * 2, c2 = s3[e4.charCodeAt(o2)] >>> 6 - o2 % 4 * 2;
- r2[i2 >>> 2] |= (a2 | c2) << 24 - i2 % 4 * 8, i2++;
- }
- return t3.create(r2, i2);
- }
- e3.enc.Base64 = { stringify: function(e4) {
- var t4 = e4.words, n3 = e4.sigBytes, s3 = this._map;
- e4.clamp();
- for (var r2 = [], i2 = 0; i2 < n3; i2 += 3)
- for (var o2 = (t4[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255) << 16 | (t4[i2 + 1 >>> 2] >>> 24 - (i2 + 1) % 4 * 8 & 255) << 8 | t4[i2 + 2 >>> 2] >>> 24 - (i2 + 2) % 4 * 8 & 255, a2 = 0; a2 < 4 && i2 + 0.75 * a2 < n3; a2++)
- r2.push(s3.charAt(o2 >>> 6 * (3 - a2) & 63));
- var c2 = s3.charAt(64);
- if (c2)
- for (; r2.length % 4; )
- r2.push(c2);
- return r2.join("");
- }, parse: function(e4) {
- var t4 = e4.length, n3 = this._map, r2 = this._reverseMap;
- if (!r2) {
- r2 = this._reverseMap = [];
- for (var i2 = 0; i2 < n3.length; i2++)
- r2[n3.charCodeAt(i2)] = i2;
- }
- var o2 = n3.charAt(64);
- if (o2) {
- var a2 = e4.indexOf(o2);
- -1 !== a2 && (t4 = a2);
- }
- return s2(e4, t4, r2);
- }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
- }(), n2.enc.Base64);
- });
- const c = "FUNCTION", u = "OBJECT", l = "CLIENT_DB", h = "pending", d = "fulfilled", p = "rejected";
- function f(e2) {
- return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase();
- }
- function g(e2) {
- return "object" === f(e2);
- }
- function m(e2) {
- return "function" == typeof e2;
- }
- function y(e2) {
- return function() {
- try {
- return e2.apply(e2, arguments);
- } catch (e3) {
- console.error(e3);
- }
- };
- }
- const _ = "REJECTED", w = "NOT_PENDING";
- class v {
- constructor({ createPromise: e2, retryRule: t2 = _ } = {}) {
- this.createPromise = e2, this.status = null, this.promise = null, this.retryRule = t2;
- }
- get needRetry() {
- if (!this.status)
- return true;
- switch (this.retryRule) {
- case _:
- return this.status === p;
- case w:
- return this.status !== h;
- }
- }
- exec() {
- return this.needRetry ? (this.status = h, this.promise = this.createPromise().then((e2) => (this.status = d, Promise.resolve(e2)), (e2) => (this.status = p, Promise.reject(e2))), this.promise) : this.promise;
- }
- }
- function I(e2) {
- return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
- }
- const S = true, b = "app", A = I(define_process_env_UNI_SECURE_NETWORK_CONFIG_default), C = b, P = I(""), T = I("[]") || [];
- let O = "";
- try {
- O = "__UNI__7806143";
- } catch (e2) {
- }
- let E = {};
- function L(e2, t2 = {}) {
- var n2, s2;
- return n2 = E, s2 = e2, Object.prototype.hasOwnProperty.call(n2, s2) || (E[e2] = t2), E[e2];
- }
- E = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {};
- const R = ["invoke", "success", "fail", "complete"], U = L("_globalUniCloudInterceptor");
- function N(e2, t2) {
- U[e2] || (U[e2] = {}), g(t2) && Object.keys(t2).forEach((n2) => {
- R.indexOf(n2) > -1 && function(e3, t3, n3) {
- let s2 = U[e3][t3];
- s2 || (s2 = U[e3][t3] = []), -1 === s2.indexOf(n3) && m(n3) && s2.push(n3);
- }(e2, n2, t2[n2]);
- });
- }
- function D(e2, t2) {
- U[e2] || (U[e2] = {}), g(t2) ? Object.keys(t2).forEach((n2) => {
- R.indexOf(n2) > -1 && function(e3, t3, n3) {
- const s2 = U[e3][t3];
- if (!s2)
- return;
- const r2 = s2.indexOf(n3);
- r2 > -1 && s2.splice(r2, 1);
- }(e2, n2, t2[n2]);
- }) : delete U[e2];
- }
- function M(e2, t2) {
- return e2 && 0 !== e2.length ? e2.reduce((e3, n2) => e3.then(() => n2(t2)), Promise.resolve()) : Promise.resolve();
- }
- function q(e2, t2) {
- return U[e2] && U[e2][t2] || [];
- }
- function F(e2) {
- N("callObject", e2);
- }
- const K = L("_globalUniCloudListener"), j = "response", $ = "needLogin", B = "refreshToken", W = "clientdb", H = "cloudfunction", J = "cloudobject";
- function z(e2) {
- return K[e2] || (K[e2] = []), K[e2];
- }
- function V(e2, t2) {
- const n2 = z(e2);
- n2.includes(t2) || n2.push(t2);
- }
- function G(e2, t2) {
- const n2 = z(e2), s2 = n2.indexOf(t2);
- -1 !== s2 && n2.splice(s2, 1);
- }
- function Y(e2, t2) {
- const n2 = z(e2);
- for (let e3 = 0; e3 < n2.length; e3++) {
- (0, n2[e3])(t2);
- }
- }
- let Q, X = false;
- function Z() {
- return Q || (Q = new Promise((e2) => {
- X && e2(), function t2() {
- if ("function" == typeof getCurrentPages) {
- const t3 = getCurrentPages();
- t3 && t3[0] && (X = true, e2());
- }
- X || setTimeout(() => {
- t2();
- }, 30);
- }();
- }), Q);
- }
- function ee(e2) {
- const t2 = {};
- for (const n2 in e2) {
- const s2 = e2[n2];
- m(s2) && (t2[n2] = y(s2));
- }
- return t2;
- }
- class te extends Error {
- constructor(e2) {
- super(e2.message), this.errMsg = e2.message || e2.errMsg || "unknown system error", this.code = this.errCode = e2.code || e2.errCode || "SYSTEM_ERROR", this.errSubject = this.subject = e2.subject || e2.errSubject, this.cause = e2.cause, this.requestId = e2.requestId;
- }
- toJson(e2 = 0) {
- if (!(e2 >= 10))
- return e2++, { errCode: this.errCode, errMsg: this.errMsg, errSubject: this.errSubject, cause: this.cause && this.cause.toJson ? this.cause.toJson(e2) : this.cause };
- }
- }
- var ne = { request: (e2) => uni.request(e2), uploadFile: (e2) => uni.uploadFile(e2), setStorageSync: (e2, t2) => uni.setStorageSync(e2, t2), getStorageSync: (e2) => uni.getStorageSync(e2), removeStorageSync: (e2) => uni.removeStorageSync(e2), clearStorageSync: () => uni.clearStorageSync(), connectSocket: (e2) => uni.connectSocket(e2) };
- function se(e2) {
- return e2 && se(e2.__v_raw) || e2;
- }
- function re() {
- return { token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"), tokenExpired: ne.getStorageSync("uni_id_token_expired") };
- }
- function ie({ token: e2, tokenExpired: t2 } = {}) {
- e2 && ne.setStorageSync("uni_id_token", e2), t2 && ne.setStorageSync("uni_id_token_expired", t2);
- }
- let oe, ae;
- function ce() {
- return oe || (oe = uni.getSystemInfoSync()), oe;
- }
- function ue() {
- let e2, t2;
- try {
- if (uni.getLaunchOptionsSync) {
- if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1)
- return;
- const { scene: n2, channel: s2 } = uni.getLaunchOptionsSync();
- e2 = s2, t2 = n2;
- }
- } catch (e3) {
- }
- return { channel: e2, scene: t2 };
- }
- let le = {};
- function he() {
- const e2 = uni.getLocale && uni.getLocale() || "en";
- if (ae)
- return { ...le, ...ae, locale: e2, LOCALE: e2 };
- const t2 = ce(), { deviceId: n2, osName: s2, uniPlatform: r2, appId: i2 } = t2, o2 = ["appId", "appLanguage", "appName", "appVersion", "appVersionCode", "appWgtVersion", "browserName", "browserVersion", "deviceBrand", "deviceId", "deviceModel", "deviceType", "osName", "osVersion", "romName", "romVersion", "ua", "hostName", "hostVersion", "uniPlatform", "uniRuntimeVersion", "uniRuntimeVersionCode", "uniCompilerVersion", "uniCompilerVersionCode"];
- for (const e3 in t2)
- Object.hasOwnProperty.call(t2, e3) && -1 === o2.indexOf(e3) && delete t2[e3];
- return ae = { PLATFORM: r2, OS: s2, APPID: i2, DEVICEID: n2, ...ue(), ...t2 }, { ...le, ...ae, locale: e2, LOCALE: e2 };
- }
- var de = { sign: function(e2, t2) {
- let n2 = "";
- return Object.keys(e2).sort().forEach(function(t3) {
- e2[t3] && (n2 = n2 + "&" + t3 + "=" + e2[t3]);
- }), n2 = n2.slice(1), i(n2, t2).toString();
- }, wrappedRequest: function(e2, t2) {
- return new Promise((n2, s2) => {
- t2(Object.assign(e2, { complete(e3) {
- e3 || (e3 = {});
- const t3 = e3.data && e3.data.header && e3.data.header["x-serverless-request-id"] || e3.header && e3.header["request-id"];
- if (!e3.statusCode || e3.statusCode >= 400) {
- const n3 = e3.data && e3.data.error && e3.data.error.code || "SYS_ERR", r3 = e3.data && e3.data.error && e3.data.error.message || e3.errMsg || "request:fail";
- return s2(new te({ code: n3, message: r3, requestId: t3 }));
- }
- const r2 = e3.data;
- if (r2.error)
- return s2(new te({ code: r2.error.code, message: r2.error.message, requestId: t3 }));
- r2.result = r2.data, r2.requestId = t3, delete r2.data, n2(r2);
- } }));
- });
- }, toBase64: function(e2) {
- return a.stringify(o.parse(e2));
- } };
- var pe = class {
- constructor(e2) {
- ["spaceId", "clientSecret"].forEach((t2) => {
- if (!Object.prototype.hasOwnProperty.call(e2, t2))
- throw new Error(`${t2} required`);
- }), this.config = Object.assign({}, { endpoint: 0 === e2.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com" }, e2), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = ne, this._getAccessTokenPromiseHub = new v({ createPromise: () => this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then((e3) => {
- if (!e3.result || !e3.result.accessToken)
- throw new te({ code: "AUTH_FAILED", message: "获取accessToken失败" });
- this.setAccessToken(e3.result.accessToken);
- }), retryRule: w });
- }
- get hasAccessToken() {
- return !!this.accessToken;
- }
- setAccessToken(e2) {
- this.accessToken = e2;
- }
- requestWrapped(e2) {
- return de.wrappedRequest(e2, this.adapter.request);
- }
- requestAuth(e2) {
- return this.requestWrapped(e2);
- }
- request(e2, t2) {
- return Promise.resolve().then(() => this.hasAccessToken ? t2 ? this.requestWrapped(e2) : this.requestWrapped(e2).catch((t3) => new Promise((e3, n2) => {
- !t3 || "GATEWAY_INVALID_TOKEN" !== t3.code && "InvalidParameter.InvalidToken" !== t3.code ? n2(t3) : e3();
- }).then(() => this.getAccessToken()).then(() => {
- const t4 = this.rebuildRequest(e2);
- return this.request(t4, true);
- })) : this.getAccessToken().then(() => {
- const t3 = this.rebuildRequest(e2);
- return this.request(t3, true);
- }));
- }
- rebuildRequest(e2) {
- const t2 = Object.assign({}, e2);
- return t2.data.token = this.accessToken, t2.header["x-basement-token"] = this.accessToken, t2.header["x-serverless-sign"] = de.sign(t2.data, this.config.clientSecret), t2;
- }
- setupRequest(e2, t2) {
- const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
- return "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = de.sign(n2, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: s2 };
- }
- getAccessToken() {
- return this._getAccessTokenPromiseHub.exec();
- }
- async authorize() {
- await this.getAccessToken();
- }
- callFunction(e2) {
- const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
- return this.request({ ...this.setupRequest(t2), timeout: e2.timeout });
- }
- getOSSUploadOptionsFromPath(e2) {
- const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
- return this.request(this.setupRequest(t2));
- }
- uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
- return new Promise((o2, a2) => {
- const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, header: { "X-OSS-server-side-encrpytion": "AES256" }, success(e3) {
- e3 && e3.statusCode < 400 ? o2(e3) : a2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
- }, fail(e3) {
- a2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
- } });
- "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
- i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
- });
- });
- }
- reportOSSUpload(e2) {
- const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
- return this.request(this.setupRequest(t2));
- }
- async uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", cloudPathAsRealPath: s2 = false, onUploadProgress: r2, config: i2 }) {
- if ("string" !== f(t2))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
- if (!(t2 = t2.trim()))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
- if (/:\/\//.test(t2))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
- const o2 = i2 && i2.envType || this.config.envType;
- if (s2 && ("/" !== t2[0] && (t2 = "/" + t2), t2.indexOf("\\") > -1))
- throw new te({ code: "INVALID_PARAM", message: "使用cloudPath作为路径时,cloudPath不可包含“\\”" });
- const a2 = (await this.getOSSUploadOptionsFromPath({ env: o2, filename: s2 ? t2.split("/").pop() : t2, fileId: s2 ? t2 : void 0 })).result, c2 = "https://" + a2.cdnDomain + "/" + a2.ossPath, { securityToken: u2, accessKeyId: l2, signature: h2, host: d2, ossPath: p2, id: g2, policy: m2, ossCallbackUrl: y2 } = a2, _2 = { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: l2, Signature: h2, host: d2, id: g2, key: p2, policy: m2, success_action_status: 200 };
- if (u2 && (_2["x-oss-security-token"] = u2), y2) {
- const e3 = JSON.stringify({ callbackUrl: y2, callbackBody: JSON.stringify({ fileId: g2, spaceId: this.config.spaceId }), callbackBodyType: "application/json" });
- _2.callback = de.toBase64(e3);
- }
- const w2 = { url: "https://" + a2.host, formData: _2, fileName: "file", name: "file", filePath: e2, fileType: n2 };
- if (await this.uploadFileToOSS(Object.assign({}, w2, { onUploadProgress: r2 })), y2)
- return { success: true, filePath: e2, fileID: c2 };
- if ((await this.reportOSSUpload({ id: g2 })).success)
- return { success: true, filePath: e2, fileID: c2 };
- throw new te({ code: "UPLOAD_FAILED", message: "文件上传失败" });
- }
- getTempFileURL({ fileList: e2 } = {}) {
- return new Promise((t2, n2) => {
- Array.isArray(e2) && 0 !== e2.length || n2(new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t2({ fileList: e2.map((e3) => ({ fileID: e3, tempFileURL: e3 })) });
- });
- }
- async getFileInfo({ fileList: e2 } = {}) {
- if (!Array.isArray(e2) || 0 === e2.length)
- throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
- const t2 = { method: "serverless.file.resource.info", params: JSON.stringify({ id: e2.map((e3) => e3.split("?")[0]).join(",") }) };
- return { fileList: (await this.request(this.setupRequest(t2))).result };
- }
- };
- var fe = { init(e2) {
- const t2 = new pe(e2), n2 = { signInAnonymously: function() {
- return t2.authorize();
- }, getLoginState: function() {
- return Promise.resolve(false);
- } };
- return t2.auth = function() {
- return n2;
- }, t2.customAuth = t2.auth, t2;
- } };
- const ge = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
- var me;
- !function(e2) {
- e2.local = "local", e2.none = "none", e2.session = "session";
- }(me || (me = {}));
- var ye = function() {
- }, _e = n(function(e2, t2) {
- var n2;
- e2.exports = (n2 = r, function(e3) {
- var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [], c2 = [];
- !function() {
- function t4(t5) {
- for (var n4 = e3.sqrt(t5), s4 = 2; s4 <= n4; s4++)
- if (!(t5 % s4))
- return false;
- return true;
- }
- function n3(e4) {
- return 4294967296 * (e4 - (0 | e4)) | 0;
- }
- for (var s3 = 2, r3 = 0; r3 < 64; )
- t4(s3) && (r3 < 8 && (a2[r3] = n3(e3.pow(s3, 0.5))), c2[r3] = n3(e3.pow(s3, 1 / 3)), r3++), s3++;
- }();
- var u2 = [], l2 = o2.SHA256 = i2.extend({ _doReset: function() {
- this._hash = new r2.init(a2.slice(0));
- }, _doProcessBlock: function(e4, t4) {
- for (var n3 = this._hash.words, s3 = n3[0], r3 = n3[1], i3 = n3[2], o3 = n3[3], a3 = n3[4], l3 = n3[5], h2 = n3[6], d2 = n3[7], p2 = 0; p2 < 64; p2++) {
- if (p2 < 16)
- u2[p2] = 0 | e4[t4 + p2];
- else {
- var f2 = u2[p2 - 15], g2 = (f2 << 25 | f2 >>> 7) ^ (f2 << 14 | f2 >>> 18) ^ f2 >>> 3, m2 = u2[p2 - 2], y2 = (m2 << 15 | m2 >>> 17) ^ (m2 << 13 | m2 >>> 19) ^ m2 >>> 10;
- u2[p2] = g2 + u2[p2 - 7] + y2 + u2[p2 - 16];
- }
- var _2 = s3 & r3 ^ s3 & i3 ^ r3 & i3, w2 = (s3 << 30 | s3 >>> 2) ^ (s3 << 19 | s3 >>> 13) ^ (s3 << 10 | s3 >>> 22), v2 = d2 + ((a3 << 26 | a3 >>> 6) ^ (a3 << 21 | a3 >>> 11) ^ (a3 << 7 | a3 >>> 25)) + (a3 & l3 ^ ~a3 & h2) + c2[p2] + u2[p2];
- d2 = h2, h2 = l3, l3 = a3, a3 = o3 + v2 | 0, o3 = i3, i3 = r3, r3 = s3, s3 = v2 + (w2 + _2) | 0;
- }
- n3[0] = n3[0] + s3 | 0, n3[1] = n3[1] + r3 | 0, n3[2] = n3[2] + i3 | 0, n3[3] = n3[3] + o3 | 0, n3[4] = n3[4] + a3 | 0, n3[5] = n3[5] + l3 | 0, n3[6] = n3[6] + h2 | 0, n3[7] = n3[7] + d2 | 0;
- }, _doFinalize: function() {
- var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
- return n3[r3 >>> 5] |= 128 << 24 - r3 % 32, n3[14 + (r3 + 64 >>> 9 << 4)] = e3.floor(s3 / 4294967296), n3[15 + (r3 + 64 >>> 9 << 4)] = s3, t4.sigBytes = 4 * n3.length, this._process(), this._hash;
- }, clone: function() {
- var e4 = i2.clone.call(this);
- return e4._hash = this._hash.clone(), e4;
- } });
- t3.SHA256 = i2._createHelper(l2), t3.HmacSHA256 = i2._createHmacHelper(l2);
- }(Math), n2.SHA256);
- }), we = _e, ve = n(function(e2, t2) {
- e2.exports = r.HmacSHA256;
- });
- const Ie = () => {
- let e2;
- if (!Promise) {
- e2 = () => {
- }, e2.promise = {};
- const t3 = () => {
- throw new te({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });
- };
- return Object.defineProperty(e2.promise, "then", { get: t3 }), Object.defineProperty(e2.promise, "catch", { get: t3 }), e2;
- }
- const t2 = new Promise((t3, n2) => {
- e2 = (e3, s2) => e3 ? n2(e3) : t3(s2);
- });
- return e2.promise = t2, e2;
- };
- function Se(e2) {
- return void 0 === e2;
- }
- function be(e2) {
- return "[object Null]" === Object.prototype.toString.call(e2);
- }
- var ke;
- function Ae(e2) {
- const t2 = (n2 = e2, "[object Array]" === Object.prototype.toString.call(n2) ? e2 : [e2]);
- var n2;
- for (const e3 of t2) {
- const { isMatch: t3, genAdapter: n3, runtime: s2 } = e3;
- if (t3())
- return { adapter: n3(), runtime: s2 };
- }
- }
- !function(e2) {
- e2.WEB = "web", e2.WX_MP = "wx_mp";
- }(ke || (ke = {}));
- const Ce = { adapter: null, runtime: void 0 }, Pe = ["anonymousUuidKey"];
- class Te extends ye {
- constructor() {
- super(), Ce.adapter.root.tcbObject || (Ce.adapter.root.tcbObject = {});
- }
- setItem(e2, t2) {
- Ce.adapter.root.tcbObject[e2] = t2;
- }
- getItem(e2) {
- return Ce.adapter.root.tcbObject[e2];
- }
- removeItem(e2) {
- delete Ce.adapter.root.tcbObject[e2];
- }
- clear() {
- delete Ce.adapter.root.tcbObject;
- }
- }
- function xe(e2, t2) {
- switch (e2) {
- case "local":
- return t2.localStorage || new Te();
- case "none":
- return new Te();
- default:
- return t2.sessionStorage || new Te();
- }
- }
- class Oe {
- constructor(e2) {
- if (!this._storage) {
- this._persistence = Ce.adapter.primaryStorage || e2.persistence, this._storage = xe(this._persistence, Ce.adapter);
- const t2 = `access_token_${e2.env}`, n2 = `access_token_expire_${e2.env}`, s2 = `refresh_token_${e2.env}`, r2 = `anonymous_uuid_${e2.env}`, i2 = `login_type_${e2.env}`, o2 = `user_info_${e2.env}`;
- this.keys = { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2, anonymousUuidKey: r2, loginTypeKey: i2, userInfoKey: o2 };
- }
- }
- updatePersistence(e2) {
- if (e2 === this._persistence)
- return;
- const t2 = "local" === this._persistence;
- this._persistence = e2;
- const n2 = xe(e2, Ce.adapter);
- for (const e3 in this.keys) {
- const s2 = this.keys[e3];
- if (t2 && Pe.includes(e3))
- continue;
- const r2 = this._storage.getItem(s2);
- Se(r2) || be(r2) || (n2.setItem(s2, r2), this._storage.removeItem(s2));
- }
- this._storage = n2;
- }
- setStore(e2, t2, n2) {
- if (!this._storage)
- return;
- const s2 = { version: n2 || "localCachev1", content: t2 }, r2 = JSON.stringify(s2);
- try {
- this._storage.setItem(e2, r2);
- } catch (e3) {
- throw e3;
- }
- }
- getStore(e2, t2) {
- try {
- if (!this._storage)
- return;
- } catch (e3) {
- return "";
- }
- t2 = t2 || "localCachev1";
- const n2 = this._storage.getItem(e2);
- if (!n2)
- return "";
- if (n2.indexOf(t2) >= 0) {
- return JSON.parse(n2).content;
- }
- return "";
- }
- removeStore(e2) {
- this._storage.removeItem(e2);
- }
- }
- const Ee = {}, Le = {};
- function Re(e2) {
- return Ee[e2];
- }
- class Ue {
- constructor(e2, t2) {
- this.data = t2 || null, this.name = e2;
- }
- }
- class Ne extends Ue {
- constructor(e2, t2) {
- super("error", { error: e2, data: t2 }), this.error = e2;
- }
- }
- const De = new class {
- constructor() {
- this._listeners = {};
- }
- on(e2, t2) {
- return function(e3, t3, n2) {
- n2[e3] = n2[e3] || [], n2[e3].push(t3);
- }(e2, t2, this._listeners), this;
- }
- off(e2, t2) {
- return function(e3, t3, n2) {
- if (n2 && n2[e3]) {
- const s2 = n2[e3].indexOf(t3);
- -1 !== s2 && n2[e3].splice(s2, 1);
- }
- }(e2, t2, this._listeners), this;
- }
- fire(e2, t2) {
- if (e2 instanceof Ne)
- return console.error(e2.error), this;
- const n2 = "string" == typeof e2 ? new Ue(e2, t2 || {}) : e2;
- const s2 = n2.name;
- if (this._listens(s2)) {
- n2.target = this;
- const e3 = this._listeners[s2] ? [...this._listeners[s2]] : [];
- for (const t3 of e3)
- t3.call(this, n2);
- }
- return this;
- }
- _listens(e2) {
- return this._listeners[e2] && this._listeners[e2].length > 0;
- }
- }();
- function Me(e2, t2) {
- De.on(e2, t2);
- }
- function qe(e2, t2 = {}) {
- De.fire(e2, t2);
- }
- function Fe(e2, t2) {
- De.off(e2, t2);
- }
- const Ke = "loginStateChanged", je = "loginStateExpire", $e = "loginTypeChanged", Be = "anonymousConverted", We = "refreshAccessToken";
- var He;
- !function(e2) {
- e2.ANONYMOUS = "ANONYMOUS", e2.WECHAT = "WECHAT", e2.WECHAT_PUBLIC = "WECHAT-PUBLIC", e2.WECHAT_OPEN = "WECHAT-OPEN", e2.CUSTOM = "CUSTOM", e2.EMAIL = "EMAIL", e2.USERNAME = "USERNAME", e2.NULL = "NULL";
- }(He || (He = {}));
- const Je = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"], ze = { "X-SDK-Version": "1.3.5" };
- function Ve(e2, t2, n2) {
- const s2 = e2[t2];
- e2[t2] = function(t3) {
- const r2 = {}, i2 = {};
- n2.forEach((n3) => {
- const { data: s3, headers: o3 } = n3.call(e2, t3);
- Object.assign(r2, s3), Object.assign(i2, o3);
- });
- const o2 = t3.data;
- return o2 && (() => {
- var e3;
- if (e3 = o2, "[object FormData]" !== Object.prototype.toString.call(e3))
- t3.data = { ...o2, ...r2 };
- else
- for (const e4 in r2)
- o2.append(e4, r2[e4]);
- })(), t3.headers = { ...t3.headers || {}, ...i2 }, s2.call(e2, t3);
- };
- }
- function Ge() {
- const e2 = Math.random().toString(16).slice(2);
- return { data: { seqId: e2 }, headers: { ...ze, "x-seqid": e2 } };
- }
- class Ye {
- constructor(e2 = {}) {
- var t2;
- this.config = e2, this._reqClass = new Ce.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: `请求在${this.config.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] }), this._cache = Re(this.config.env), this._localCache = (t2 = this.config.env, Le[t2]), Ve(this._reqClass, "post", [Ge]), Ve(this._reqClass, "upload", [Ge]), Ve(this._reqClass, "download", [Ge]);
- }
- async post(e2) {
- return await this._reqClass.post(e2);
- }
- async upload(e2) {
- return await this._reqClass.upload(e2);
- }
- async download(e2) {
- return await this._reqClass.download(e2);
- }
- async refreshAccessToken() {
- let e2, t2;
- this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
- try {
- e2 = await this._refreshAccessTokenPromise;
- } catch (e3) {
- t2 = e3;
- }
- if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t2)
- throw t2;
- return e2;
- }
- async _refreshAccessToken() {
- const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2, loginTypeKey: s2, anonymousUuidKey: r2 } = this._cache.keys;
- this._cache.removeStore(e2), this._cache.removeStore(t2);
- let i2 = this._cache.getStore(n2);
- if (!i2)
- throw new te({ message: "未登录CloudBase" });
- const o2 = { refresh_token: i2 }, a2 = await this.request("auth.fetchAccessTokenWithRefreshToken", o2);
- if (a2.data.code) {
- const { code: e3 } = a2.data;
- if ("SIGN_PARAM_INVALID" === e3 || "REFRESH_TOKEN_EXPIRED" === e3 || "INVALID_REFRESH_TOKEN" === e3) {
- if (this._cache.getStore(s2) === He.ANONYMOUS && "INVALID_REFRESH_TOKEN" === e3) {
- const e4 = this._cache.getStore(r2), t3 = this._cache.getStore(n2), s3 = await this.send("auth.signInAnonymously", { anonymous_uuid: e4, refresh_token: t3 });
- return this.setRefreshToken(s3.refresh_token), this._refreshAccessToken();
- }
- qe(je), this._cache.removeStore(n2);
- }
- throw new te({ code: a2.data.code, message: `刷新access token失败:${a2.data.code}` });
- }
- if (a2.data.access_token)
- return qe(We), this._cache.setStore(e2, a2.data.access_token), this._cache.setStore(t2, a2.data.access_token_expire + Date.now()), { accessToken: a2.data.access_token, accessTokenExpire: a2.data.access_token_expire };
- a2.data.refresh_token && (this._cache.removeStore(n2), this._cache.setStore(n2, a2.data.refresh_token), this._refreshAccessToken());
- }
- async getAccessToken() {
- const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2 } = this._cache.keys;
- if (!this._cache.getStore(n2))
- throw new te({ message: "refresh token不存在,登录状态异常" });
- let s2 = this._cache.getStore(e2), r2 = this._cache.getStore(t2), i2 = true;
- return this._shouldRefreshAccessTokenHook && !await this._shouldRefreshAccessTokenHook(s2, r2) && (i2 = false), (!s2 || !r2 || r2 < Date.now()) && i2 ? this.refreshAccessToken() : { accessToken: s2, accessTokenExpire: r2 };
- }
- async request(e2, t2, n2) {
- const s2 = `x-tcb-trace_${this.config.env}`;
- let r2 = "application/x-www-form-urlencoded";
- const i2 = { action: e2, env: this.config.env, dataVersion: "2019-08-16", ...t2 };
- if (-1 === Je.indexOf(e2)) {
- const { refreshTokenKey: e3 } = this._cache.keys;
- this._cache.getStore(e3) && (i2.access_token = (await this.getAccessToken()).accessToken);
- }
- let o2;
- if ("storage.uploadFile" === e2) {
- o2 = new FormData();
- for (let e3 in o2)
- o2.hasOwnProperty(e3) && void 0 !== o2[e3] && o2.append(e3, i2[e3]);
- r2 = "multipart/form-data";
- } else {
- r2 = "application/json", o2 = {};
- for (let e3 in i2)
- void 0 !== i2[e3] && (o2[e3] = i2[e3]);
- }
- let a2 = { headers: { "content-type": r2 } };
- n2 && n2.timeout && (a2.timeout = n2.timeout), n2 && n2.onUploadProgress && (a2.onUploadProgress = n2.onUploadProgress);
- const c2 = this._localCache.getStore(s2);
- c2 && (a2.headers["X-TCB-Trace"] = c2);
- const { parse: u2, inQuery: l2, search: h2 } = t2;
- let d2 = { env: this.config.env };
- u2 && (d2.parse = true), l2 && (d2 = { ...l2, ...d2 });
- let p2 = function(e3, t3, n3 = {}) {
- const s3 = /\?/.test(t3);
- let r3 = "";
- for (let e4 in n3)
- "" === r3 ? !s3 && (t3 += "?") : r3 += "&", r3 += `${e4}=${encodeURIComponent(n3[e4])}`;
- return /^http(s)?\:\/\//.test(t3 += r3) ? t3 : `${e3}${t3}`;
- }(ge, "//tcb-api.tencentcloudapi.com/web", d2);
- h2 && (p2 += h2);
- const f2 = await this.post({ url: p2, data: o2, ...a2 }), g2 = f2.header && f2.header["x-tcb-trace"];
- if (g2 && this._localCache.setStore(s2, g2), 200 !== Number(f2.status) && 200 !== Number(f2.statusCode) || !f2.data)
- throw new te({ code: "NETWORK_ERROR", message: "network request error" });
- return f2;
- }
- async send(e2, t2 = {}, n2 = {}) {
- const s2 = await this.request(e2, t2, { ...n2, onUploadProgress: t2.onUploadProgress });
- if ("ACCESS_TOKEN_EXPIRED" === s2.data.code && -1 === Je.indexOf(e2)) {
- await this.refreshAccessToken();
- const s3 = await this.request(e2, t2, { ...n2, onUploadProgress: t2.onUploadProgress });
- if (s3.data.code)
- throw new te({ code: s3.data.code, message: s3.data.message });
- return s3.data;
- }
- if (s2.data.code)
- throw new te({ code: s2.data.code, message: s2.data.message });
- return s2.data;
- }
- setRefreshToken(e2) {
- const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
- this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
- }
- }
- const Qe = {};
- function Xe(e2) {
- return Qe[e2];
- }
- class Ze {
- constructor(e2) {
- this.config = e2, this._cache = Re(e2.env), this._request = Xe(e2.env);
- }
- setRefreshToken(e2) {
- const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
- this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
- }
- setAccessToken(e2, t2) {
- const { accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys;
- this._cache.setStore(n2, e2), this._cache.setStore(s2, t2);
- }
- async refreshUserInfo() {
- const { data: e2 } = await this._request.send("auth.getUserInfo", {});
- return this.setLocalUserInfo(e2), e2;
- }
- setLocalUserInfo(e2) {
- const { userInfoKey: t2 } = this._cache.keys;
- this._cache.setStore(t2, e2);
- }
- }
- class et {
- constructor(e2) {
- if (!e2)
- throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
- this._envId = e2, this._cache = Re(this._envId), this._request = Xe(this._envId), this.setUserInfo();
- }
- linkWithTicket(e2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "ticket must be string" });
- return this._request.send("auth.linkWithTicket", { ticket: e2 });
- }
- linkWithRedirect(e2) {
- e2.signInWithRedirect();
- }
- updatePassword(e2, t2) {
- return this._request.send("auth.updatePassword", { oldPassword: t2, newPassword: e2 });
- }
- updateEmail(e2) {
- return this._request.send("auth.updateEmail", { newEmail: e2 });
- }
- updateUsername(e2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
- return this._request.send("auth.updateUsername", { username: e2 });
- }
- async getLinkedUidList() {
- const { data: e2 } = await this._request.send("auth.getLinkedUidList", {});
- let t2 = false;
- const { users: n2 } = e2;
- return n2.forEach((e3) => {
- e3.wxOpenId && e3.wxPublicId && (t2 = true);
- }), { users: n2, hasPrimaryUid: t2 };
- }
- setPrimaryUid(e2) {
- return this._request.send("auth.setPrimaryUid", { uid: e2 });
- }
- unlink(e2) {
- return this._request.send("auth.unlink", { platform: e2 });
- }
- async update(e2) {
- const { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 } = e2, { data: a2 } = await this._request.send("auth.updateUserInfo", { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 });
- this.setLocalUserInfo(a2);
- }
- async refresh() {
- const { data: e2 } = await this._request.send("auth.getUserInfo", {});
- return this.setLocalUserInfo(e2), e2;
- }
- setUserInfo() {
- const { userInfoKey: e2 } = this._cache.keys, t2 = this._cache.getStore(e2);
- ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach((e3) => {
- this[e3] = t2[e3];
- }), this.location = { country: t2.country, province: t2.province, city: t2.city };
- }
- setLocalUserInfo(e2) {
- const { userInfoKey: t2 } = this._cache.keys;
- this._cache.setStore(t2, e2), this.setUserInfo();
- }
- }
- let tt$1 = class tt {
- constructor(e2) {
- if (!e2)
- throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
- this._cache = Re(e2);
- const { refreshTokenKey: t2, accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys, r2 = this._cache.getStore(t2), i2 = this._cache.getStore(n2), o2 = this._cache.getStore(s2);
- this.credential = { refreshToken: r2, accessToken: i2, accessTokenExpire: o2 }, this.user = new et(e2);
- }
- get isAnonymousAuth() {
- return this.loginType === He.ANONYMOUS;
- }
- get isCustomAuth() {
- return this.loginType === He.CUSTOM;
- }
- get isWeixinAuth() {
- return this.loginType === He.WECHAT || this.loginType === He.WECHAT_OPEN || this.loginType === He.WECHAT_PUBLIC;
- }
- get loginType() {
- return this._cache.getStore(this._cache.keys.loginTypeKey);
- }
- };
- class nt extends Ze {
- async signIn() {
- this._cache.updatePersistence("local");
- const { anonymousUuidKey: e2, refreshTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2) || void 0, s2 = this._cache.getStore(t2) || void 0, r2 = await this._request.send("auth.signInAnonymously", { anonymous_uuid: n2, refresh_token: s2 });
- if (r2.uuid && r2.refresh_token) {
- this._setAnonymousUUID(r2.uuid), this.setRefreshToken(r2.refresh_token), await this._request.refreshAccessToken(), qe(Ke), qe($e, { env: this.config.env, loginType: He.ANONYMOUS, persistence: "local" });
- const e3 = new tt$1(this.config.env);
- return await e3.user.refresh(), e3;
- }
- throw new te({ message: "匿名登录失败" });
- }
- async linkAndRetrieveDataWithTicket(e2) {
- const { anonymousUuidKey: t2, refreshTokenKey: n2 } = this._cache.keys, s2 = this._cache.getStore(t2), r2 = this._cache.getStore(n2), i2 = await this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: s2, refresh_token: r2, ticket: e2 });
- if (i2.refresh_token)
- return this._clearAnonymousUUID(), this.setRefreshToken(i2.refresh_token), await this._request.refreshAccessToken(), qe(Be, { env: this.config.env }), qe($e, { loginType: He.CUSTOM, persistence: "local" }), { credential: { refreshToken: i2.refresh_token } };
- throw new te({ message: "匿名转化失败" });
- }
- _setAnonymousUUID(e2) {
- const { anonymousUuidKey: t2, loginTypeKey: n2 } = this._cache.keys;
- this._cache.removeStore(t2), this._cache.setStore(t2, e2), this._cache.setStore(n2, He.ANONYMOUS);
- }
- _clearAnonymousUUID() {
- this._cache.removeStore(this._cache.keys.anonymousUuidKey);
- }
- }
- class st extends Ze {
- async signIn(e2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "ticket must be a string" });
- const { refreshTokenKey: t2 } = this._cache.keys, n2 = await this._request.send("auth.signInWithTicket", { ticket: e2, refresh_token: this._cache.getStore(t2) || "" });
- if (n2.refresh_token)
- return this.setRefreshToken(n2.refresh_token), await this._request.refreshAccessToken(), qe(Ke), qe($e, { env: this.config.env, loginType: He.CUSTOM, persistence: this.config.persistence }), await this.refreshUserInfo(), new tt$1(this.config.env);
- throw new te({ message: "自定义登录失败" });
- }
- }
- class rt extends Ze {
- async signIn(e2, t2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "email must be a string" });
- const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: "EMAIL", email: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token: i2, access_token_expire: o2 } = s2;
- if (r2)
- return this.setRefreshToken(r2), i2 && o2 ? this.setAccessToken(i2, o2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), qe(Ke), qe($e, { env: this.config.env, loginType: He.EMAIL, persistence: this.config.persistence }), new tt$1(this.config.env);
- throw s2.code ? new te({ code: s2.code, message: `邮箱登录失败: ${s2.message}` }) : new te({ message: "邮箱登录失败" });
- }
- async activate(e2) {
- return this._request.send("auth.activateEndUserMail", { token: e2 });
- }
- async resetPasswordWithToken(e2, t2) {
- return this._request.send("auth.resetPasswordWithToken", { token: e2, newPassword: t2 });
- }
- }
- class it extends Ze {
- async signIn(e2, t2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
- "string" != typeof t2 && (t2 = "", console.warn("password is empty"));
- const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: He.USERNAME, username: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token_expire: i2, access_token: o2 } = s2;
- if (r2)
- return this.setRefreshToken(r2), o2 && i2 ? this.setAccessToken(o2, i2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), qe(Ke), qe($e, { env: this.config.env, loginType: He.USERNAME, persistence: this.config.persistence }), new tt$1(this.config.env);
- throw s2.code ? new te({ code: s2.code, message: `用户名密码登录失败: ${s2.message}` }) : new te({ message: "用户名密码登录失败" });
- }
- }
- class ot {
- constructor(e2) {
- this.config = e2, this._cache = Re(e2.env), this._request = Xe(e2.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Me($e, this._onLoginTypeChanged);
- }
- get currentUser() {
- const e2 = this.hasLoginState();
- return e2 && e2.user || null;
- }
- get loginType() {
- return this._cache.getStore(this._cache.keys.loginTypeKey);
- }
- anonymousAuthProvider() {
- return new nt(this.config);
- }
- customAuthProvider() {
- return new st(this.config);
- }
- emailAuthProvider() {
- return new rt(this.config);
- }
- usernameAuthProvider() {
- return new it(this.config);
- }
- async signInAnonymously() {
- return new nt(this.config).signIn();
- }
- async signInWithEmailAndPassword(e2, t2) {
- return new rt(this.config).signIn(e2, t2);
- }
- signInWithUsernameAndPassword(e2, t2) {
- return new it(this.config).signIn(e2, t2);
- }
- async linkAndRetrieveDataWithTicket(e2) {
- this._anonymousAuthProvider || (this._anonymousAuthProvider = new nt(this.config)), Me(Be, this._onAnonymousConverted);
- return await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e2);
- }
- async signOut() {
- if (this.loginType === He.ANONYMOUS)
- throw new te({ message: "匿名用户不支持登出操作" });
- const { refreshTokenKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2 } = this._cache.keys, s2 = this._cache.getStore(e2);
- if (!s2)
- return;
- const r2 = await this._request.send("auth.logout", { refresh_token: s2 });
- return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.removeStore(n2), qe(Ke), qe($e, { env: this.config.env, loginType: He.NULL, persistence: this.config.persistence }), r2;
- }
- async signUpWithEmailAndPassword(e2, t2) {
- return this._request.send("auth.signUpWithEmailAndPassword", { email: e2, password: t2 });
- }
- async sendPasswordResetEmail(e2) {
- return this._request.send("auth.sendPasswordResetEmail", { email: e2 });
- }
- onLoginStateChanged(e2) {
- Me(Ke, () => {
- const t3 = this.hasLoginState();
- e2.call(this, t3);
- });
- const t2 = this.hasLoginState();
- e2.call(this, t2);
- }
- onLoginStateExpired(e2) {
- Me(je, e2.bind(this));
- }
- onAccessTokenRefreshed(e2) {
- Me(We, e2.bind(this));
- }
- onAnonymousConverted(e2) {
- Me(Be, e2.bind(this));
- }
- onLoginTypeChanged(e2) {
- Me($e, () => {
- const t2 = this.hasLoginState();
- e2.call(this, t2);
- });
- }
- async getAccessToken() {
- return { accessToken: (await this._request.getAccessToken()).accessToken, env: this.config.env };
- }
- hasLoginState() {
- const { refreshTokenKey: e2 } = this._cache.keys;
- return this._cache.getStore(e2) ? new tt$1(this.config.env) : null;
- }
- async isUsernameRegistered(e2) {
- if ("string" != typeof e2)
- throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
- const { data: t2 } = await this._request.send("auth.isUsernameRegistered", { username: e2 });
- return t2 && t2.isRegistered;
- }
- getLoginState() {
- return Promise.resolve(this.hasLoginState());
- }
- async signInWithTicket(e2) {
- return new st(this.config).signIn(e2);
- }
- shouldRefreshAccessToken(e2) {
- this._request._shouldRefreshAccessTokenHook = e2.bind(this);
- }
- getUserInfo() {
- return this._request.send("auth.getUserInfo", {}).then((e2) => e2.code ? e2 : { ...e2.data, requestId: e2.seqId });
- }
- getAuthHeader() {
- const { refreshTokenKey: e2, accessTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2);
- return { "x-cloudbase-credentials": this._cache.getStore(t2) + "/@@/" + n2 };
- }
- _onAnonymousConverted(e2) {
- const { env: t2 } = e2.data;
- t2 === this.config.env && this._cache.updatePersistence(this.config.persistence);
- }
- _onLoginTypeChanged(e2) {
- const { loginType: t2, persistence: n2, env: s2 } = e2.data;
- s2 === this.config.env && (this._cache.updatePersistence(n2), this._cache.setStore(this._cache.keys.loginTypeKey, t2));
- }
- }
- const at = function(e2, t2) {
- t2 = t2 || Ie();
- const n2 = Xe(this.config.env), { cloudPath: s2, filePath: r2, onUploadProgress: i2, fileType: o2 = "image" } = e2;
- return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
- const { data: { url: a2, authorization: c2, token: u2, fileId: l2, cosFileId: h2 }, requestId: d2 } = e3, p2 = { key: s2, signature: c2, "x-cos-meta-fileid": h2, success_action_status: "201", "x-cos-security-token": u2 };
- n2.upload({ url: a2, data: p2, file: r2, name: s2, fileType: o2, onUploadProgress: i2 }).then((e4) => {
- 201 === e4.statusCode ? t2(null, { fileID: l2, requestId: d2 }) : t2(new te({ code: "STORAGE_REQUEST_FAIL", message: `STORAGE_REQUEST_FAIL: ${e4.data}` }));
- }).catch((e4) => {
- t2(e4);
- });
- }).catch((e3) => {
- t2(e3);
- }), t2.promise;
- }, ct = function(e2, t2) {
- t2 = t2 || Ie();
- const n2 = Xe(this.config.env), { cloudPath: s2 } = e2;
- return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
- t2(null, e3);
- }).catch((e3) => {
- t2(e3);
- }), t2.promise;
- }, ut = function({ fileList: e2 }, t2) {
- if (t2 = t2 || Ie(), !e2 || !Array.isArray(e2))
- return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };
- for (let t3 of e2)
- if (!t3 || "string" != typeof t3)
- return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };
- const n2 = { fileid_list: e2 };
- return Xe(this.config.env).send("storage.batchDeleteFile", n2).then((e3) => {
- e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.delete_list, requestId: e3.requestId });
- }).catch((e3) => {
- t2(e3);
- }), t2.promise;
- }, lt = function({ fileList: e2 }, t2) {
- t2 = t2 || Ie(), e2 && Array.isArray(e2) || t2(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });
- let n2 = [];
- for (let s3 of e2)
- "object" == typeof s3 ? (s3.hasOwnProperty("fileID") && s3.hasOwnProperty("maxAge") || t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), n2.push({ fileid: s3.fileID, max_age: s3.maxAge })) : "string" == typeof s3 ? n2.push({ fileid: s3 }) : t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" });
- const s2 = { file_list: n2 };
- return Xe(this.config.env).send("storage.batchGetDownloadUrl", s2).then((e3) => {
- e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.download_list, requestId: e3.requestId });
- }).catch((e3) => {
- t2(e3);
- }), t2.promise;
- }, ht = async function({ fileID: e2 }, t2) {
- const n2 = (await lt.call(this, { fileList: [{ fileID: e2, maxAge: 600 }] })).fileList[0];
- if ("SUCCESS" !== n2.code)
- return t2 ? t2(n2) : new Promise((e3) => {
- e3(n2);
- });
- const s2 = Xe(this.config.env);
- let r2 = n2.download_url;
- if (r2 = encodeURI(r2), !t2)
- return s2.download({ url: r2 });
- t2(await s2.download({ url: r2 }));
- }, dt = function({ name: e2, data: t2, query: n2, parse: s2, search: r2, timeout: i2 }, o2) {
- const a2 = o2 || Ie();
- let c2;
- try {
- c2 = t2 ? JSON.stringify(t2) : "";
- } catch (e3) {
- return Promise.reject(e3);
- }
- if (!e2)
- return Promise.reject(new te({ code: "PARAM_ERROR", message: "函数名不能为空" }));
- const u2 = { inQuery: n2, parse: s2, search: r2, function_name: e2, request_data: c2 };
- return Xe(this.config.env).send("functions.invokeFunction", u2, { timeout: i2 }).then((e3) => {
- if (e3.code)
- a2(null, e3);
- else {
- let t3 = e3.data.response_data;
- if (s2)
- a2(null, { result: t3, requestId: e3.requestId });
- else
- try {
- t3 = JSON.parse(e3.data.response_data), a2(null, { result: t3, requestId: e3.requestId });
- } catch (e4) {
- a2(new te({ message: "response data must be json" }));
- }
- }
- return a2.promise;
- }).catch((e3) => {
- a2(e3);
- }), a2.promise;
- }, pt = { timeout: 15e3, persistence: "session" }, ft = {};
- class gt {
- constructor(e2) {
- this.config = e2 || this.config, this.authObj = void 0;
- }
- init(e2) {
- switch (Ce.adapter || (this.requestClient = new Ce.adapter.reqClass({ timeout: e2.timeout || 5e3, timeoutMsg: `请求在${(e2.timeout || 5e3) / 1e3}s内未完成,已中断` })), this.config = { ...pt, ...e2 }, true) {
- case this.config.timeout > 6e5:
- console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
- break;
- case this.config.timeout < 100:
- console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
- }
- return new gt(this.config);
- }
- auth({ persistence: e2 } = {}) {
- if (this.authObj)
- return this.authObj;
- const t2 = e2 || Ce.adapter.primaryStorage || pt.persistence;
- var n2;
- return t2 !== this.config.persistence && (this.config.persistence = t2), function(e3) {
- const { env: t3 } = e3;
- Ee[t3] = new Oe(e3), Le[t3] = new Oe({ ...e3, persistence: "local" });
- }(this.config), n2 = this.config, Qe[n2.env] = new Ye(n2), this.authObj = new ot(this.config), this.authObj;
- }
- on(e2, t2) {
- return Me.apply(this, [e2, t2]);
- }
- off(e2, t2) {
- return Fe.apply(this, [e2, t2]);
- }
- callFunction(e2, t2) {
- return dt.apply(this, [e2, t2]);
- }
- deleteFile(e2, t2) {
- return ut.apply(this, [e2, t2]);
- }
- getTempFileURL(e2, t2) {
- return lt.apply(this, [e2, t2]);
- }
- downloadFile(e2, t2) {
- return ht.apply(this, [e2, t2]);
- }
- uploadFile(e2, t2) {
- return at.apply(this, [e2, t2]);
- }
- getUploadMetadata(e2, t2) {
- return ct.apply(this, [e2, t2]);
- }
- registerExtension(e2) {
- ft[e2.name] = e2;
- }
- async invokeExtension(e2, t2) {
- const n2 = ft[e2];
- if (!n2)
- throw new te({ message: `扩展${e2} 必须先注册` });
- return await n2.invoke(t2, this);
- }
- useAdapters(e2) {
- const { adapter: t2, runtime: n2 } = Ae(e2) || {};
- t2 && (Ce.adapter = t2), n2 && (Ce.runtime = n2);
- }
- }
- var mt = new gt();
- function yt(e2, t2, n2) {
- void 0 === n2 && (n2 = {});
- var s2 = /\?/.test(t2), r2 = "";
- for (var i2 in n2)
- "" === r2 ? !s2 && (t2 += "?") : r2 += "&", r2 += i2 + "=" + encodeURIComponent(n2[i2]);
- return /^http(s)?:\/\//.test(t2 += r2) ? t2 : "" + e2 + t2;
- }
- class _t {
- post(e2) {
- const { url: t2, data: n2, headers: s2, timeout: r2 } = e2;
- return new Promise((e3, i2) => {
- ne.request({ url: yt("https:", t2), data: n2, method: "POST", header: s2, timeout: r2, success(t3) {
- e3(t3);
- }, fail(e4) {
- i2(e4);
- } });
- });
- }
- upload(e2) {
- return new Promise((t2, n2) => {
- const { url: s2, file: r2, data: i2, headers: o2, fileType: a2 } = e2, c2 = ne.uploadFile({ url: yt("https:", s2), name: "file", formData: Object.assign({}, i2), filePath: r2, fileType: a2, header: o2, success(e3) {
- const n3 = { statusCode: e3.statusCode, data: e3.data || {} };
- 200 === e3.statusCode && i2.success_action_status && (n3.statusCode = parseInt(i2.success_action_status, 10)), t2(n3);
- }, fail(e3) {
- n2(new Error(e3.errMsg || "uploadFile:fail"));
- } });
- "function" == typeof e2.onUploadProgress && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((t3) => {
- e2.onUploadProgress({ loaded: t3.totalBytesSent, total: t3.totalBytesExpectedToSend });
- });
- });
- }
- }
- const wt = { setItem(e2, t2) {
- ne.setStorageSync(e2, t2);
- }, getItem: (e2) => ne.getStorageSync(e2), removeItem(e2) {
- ne.removeStorageSync(e2);
- }, clear() {
- ne.clearStorageSync();
- } };
- var vt = { genAdapter: function() {
- return { root: {}, reqClass: _t, localStorage: wt, primaryStorage: "local" };
- }, isMatch: function() {
- return true;
- }, runtime: "uni_app" };
- mt.useAdapters(vt);
- const It = mt, St = It.init;
- It.init = function(e2) {
- e2.env = e2.spaceId;
- const t2 = St.call(this, e2);
- t2.config.provider = "tencent", t2.config.spaceId = e2.spaceId;
- const n2 = t2.auth;
- return t2.auth = function(e3) {
- const t3 = n2.call(this, e3);
- return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach((e4) => {
- var n3;
- t3[e4] = (n3 = t3[e4], function(e5) {
- e5 = e5 || {};
- const { success: t4, fail: s2, complete: r2 } = ee(e5);
- if (!(t4 || s2 || r2))
- return n3.call(this, e5);
- n3.call(this, e5).then((e6) => {
- t4 && t4(e6), r2 && r2(e6);
- }, (e6) => {
- s2 && s2(e6), r2 && r2(e6);
- });
- }).bind(t3);
- }), t3;
- }, t2.customAuth = t2.auth, t2;
- };
- var bt = It;
- async function kt(e2, t2) {
- const n2 = `http://${e2}:${t2}/system/ping`;
- try {
- const e3 = await (s2 = { url: n2, timeout: 500 }, new Promise((e4, t3) => {
- ne.request({ ...s2, success(t4) {
- e4(t4);
- }, fail(e5) {
- t3(e5);
- } });
- }));
- return !(!e3.data || 0 !== e3.data.code);
- } catch (e3) {
- return false;
- }
- var s2;
- }
- async function At(e2, t2) {
- let n2;
- for (let s2 = 0; s2 < e2.length; s2++) {
- const r2 = e2[s2];
- if (await kt(r2, t2)) {
- n2 = r2;
- break;
- }
- }
- return { address: n2, port: t2 };
- }
- const Ct = { "serverless.file.resource.generateProximalSign": "storage/generate-proximal-sign", "serverless.file.resource.report": "storage/report", "serverless.file.resource.delete": "storage/delete", "serverless.file.resource.getTempFileURL": "storage/get-temp-file-url" };
- var Pt = class {
- constructor(e2) {
- if (["spaceId", "clientSecret"].forEach((t2) => {
- if (!Object.prototype.hasOwnProperty.call(e2, t2))
- throw new Error(`${t2} required`);
- }), !e2.endpoint)
- throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");
- this.config = Object.assign({}, e2), this.config.provider = "dcloud", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.adapter = ne;
- }
- async request(e2, t2 = true) {
- const n2 = t2;
- return e2 = n2 ? await this.setupLocalRequest(e2) : this.setupRequest(e2), Promise.resolve().then(() => n2 ? this.requestLocal(e2) : de.wrappedRequest(e2, this.adapter.request));
- }
- requestLocal(e2) {
- return new Promise((t2, n2) => {
- this.adapter.request(Object.assign(e2, { complete(e3) {
- if (e3 || (e3 = {}), !e3.statusCode || e3.statusCode >= 400) {
- const t3 = e3.data && e3.data.code || "SYS_ERR", s2 = e3.data && e3.data.message || "request:fail";
- return n2(new te({ code: t3, message: s2 }));
- }
- t2({ success: true, result: e3.data });
- } }));
- });
- }
- setupRequest(e2) {
- const t2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), n2 = { "Content-Type": "application/json" };
- n2["x-serverless-sign"] = de.sign(t2, this.config.clientSecret);
- const s2 = he();
- n2["x-client-info"] = encodeURIComponent(JSON.stringify(s2));
- const { token: r2 } = re();
- return n2["x-client-token"] = r2, { url: this.config.requestUrl, method: "POST", data: t2, dataType: "json", header: JSON.parse(JSON.stringify(n2)) };
- }
- async setupLocalRequest(e2) {
- const t2 = he(), { token: n2 } = re(), s2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now(), clientInfo: t2, token: n2 }), { address: r2, servePort: i2 } = this.__dev__ && this.__dev__.debugInfo || {}, { address: o2 } = await At(r2, i2);
- return { url: `http://${o2}:${i2}/${Ct[e2.method]}`, method: "POST", data: s2, dataType: "json", header: JSON.parse(JSON.stringify({ "Content-Type": "application/json" })) };
- }
- callFunction(e2) {
- const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
- return this.request(t2, false);
- }
- getUploadFileOptions(e2) {
- const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
- return this.request(t2);
- }
- reportUploadFile(e2) {
- const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
- return this.request(t2);
- }
- uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", onUploadProgress: s2 }) {
- if (!t2)
- throw new te({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });
- let r2;
- return this.getUploadFileOptions({ cloudPath: t2 }).then((t3) => {
- const { url: i2, formData: o2, name: a2 } = t3.result;
- return r2 = t3.result.fileUrl, new Promise((t4, r3) => {
- const c2 = this.adapter.uploadFile({ url: i2, formData: o2, name: a2, filePath: e2, fileType: n2, success(e3) {
- e3 && e3.statusCode < 400 ? t4(e3) : r3(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
- }, fail(e3) {
- r3(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
- } });
- "function" == typeof s2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
- s2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
- });
- });
- }).then(() => this.reportUploadFile({ cloudPath: t2 })).then((t3) => new Promise((n3, s3) => {
- t3.success ? n3({ success: true, filePath: e2, fileID: r2 }) : s3(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
- }));
- }
- deleteFile({ fileList: e2 }) {
- const t2 = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e2 }) };
- return this.request(t2).then((e3) => {
- if (e3.success)
- return e3.result;
- throw new te({ code: "DELETE_FILE_FAILED", message: "删除文件失败" });
- });
- }
- getTempFileURL({ fileList: e2, maxAge: t2 } = {}) {
- if (!Array.isArray(e2) || 0 === e2.length)
- throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
- const n2 = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e2, maxAge: t2 }) };
- return this.request(n2).then((e3) => {
- if (e3.success)
- return { fileList: e3.result.fileList.map((e4) => ({ fileID: e4.fileID, tempFileURL: e4.tempFileURL })) };
- throw new te({ code: "GET_TEMP_FILE_URL_FAILED", message: "获取临时文件链接失败" });
- });
- }
- };
- var Tt = { init(e2) {
- const t2 = new Pt(e2), n2 = { signInAnonymously: function() {
- return Promise.resolve();
- }, getLoginState: function() {
- return Promise.resolve(false);
- } };
- return t2.auth = function() {
- return n2;
- }, t2.customAuth = t2.auth, t2;
- } }, xt = n(function(e2, t2) {
- e2.exports = r.enc.Hex;
- });
- function Ot() {
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e2) {
- var t2 = 16 * Math.random() | 0;
- return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
- });
- }
- function Et(e2 = "", t2 = {}) {
- const { data: n2, functionName: s2, method: r2, headers: i2, signHeaderKeys: o2 = [], config: a2 } = t2, c2 = Date.now(), u2 = Ot(), l2 = Object.assign({}, i2, { "x-from-app-id": a2.spaceAppId, "x-from-env-id": a2.spaceId, "x-to-env-id": a2.spaceId, "x-from-instance-id": c2, "x-from-function-name": s2, "x-client-timestamp": c2, "x-alipay-source": "client", "x-request-id": u2, "x-alipay-callid": u2, "x-trace-id": u2 }), h2 = ["x-from-app-id", "x-from-env-id", "x-to-env-id", "x-from-instance-id", "x-from-function-name", "x-client-timestamp"].concat(o2), [d2 = "", p2 = ""] = e2.split("?") || [], f2 = function(e3) {
- const t3 = e3.signedHeaders.join(";"), n3 = e3.signedHeaders.map((t4) => `${t4.toLowerCase()}:${e3.headers[t4]}
- `).join(""), s3 = we(e3.body).toString(xt), r3 = `${e3.method.toUpperCase()}
- ${e3.path}
- ${e3.query}
- ${n3}
- ${t3}
- ${s3}
- `, i3 = we(r3).toString(xt), o3 = `HMAC-SHA256
- ${e3.timestamp}
- ${i3}
- `, a3 = ve(o3, e3.secretKey).toString(xt);
- return `HMAC-SHA256 Credential=${e3.secretId}, SignedHeaders=${t3}, Signature=${a3}`;
- }({ path: d2, query: p2, method: r2, headers: l2, timestamp: c2, body: JSON.stringify(n2), secretId: a2.accessKey, secretKey: a2.secretKey, signedHeaders: h2.sort() });
- return { url: `${a2.endpoint}${e2}`, headers: Object.assign({}, l2, { Authorization: f2 }) };
- }
- function Lt({ url: e2, data: t2, method: n2 = "POST", headers: s2 = {}, timeout: r2 }) {
- return new Promise((i2, o2) => {
- ne.request({ url: e2, method: n2, data: "object" == typeof t2 ? JSON.stringify(t2) : t2, header: s2, dataType: "json", timeout: r2, complete: (e3 = {}) => {
- const t3 = s2["x-trace-id"] || "";
- if (!e3.statusCode || e3.statusCode >= 400) {
- const { message: n3, errMsg: s3, trace_id: r3 } = e3.data || {};
- return o2(new te({ code: "SYS_ERR", message: n3 || s3 || "request:fail", requestId: r3 || t3 }));
- }
- i2({ status: e3.statusCode, data: e3.data, headers: e3.header, requestId: t3 });
- } });
- });
- }
- function Rt(e2, t2) {
- const { path: n2, data: s2, method: r2 = "GET" } = e2, { url: i2, headers: o2 } = Et(n2, { functionName: "", data: s2, method: r2, headers: { "x-alipay-cloud-mode": "oss", "x-data-api-type": "oss", "x-expire-timestamp": Date.now() + 6e4 }, signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"], config: t2 });
- return Lt({ url: i2, data: s2, method: r2, headers: o2 }).then((e3) => {
- const t3 = e3.data || {};
- if (!t3.success)
- throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
- return t3.data || {};
- }).catch((e3) => {
- throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
- });
- }
- function Ut(e2 = "") {
- const t2 = e2.trim().replace(/^cloud:\/\//, ""), n2 = t2.indexOf("/");
- if (n2 <= 0)
- throw new te({ code: "INVALID_PARAM", message: "fileID不合法" });
- const s2 = t2.substring(0, n2), r2 = t2.substring(n2 + 1);
- return s2 !== this.config.spaceId && console.warn("file ".concat(e2, " does not belong to env ").concat(this.config.spaceId)), r2;
- }
- function Nt(e2 = "") {
- return "cloud://".concat(this.config.spaceId, "/").concat(e2.replace(/^\/+/, ""));
- }
- class Dt {
- constructor(e2) {
- this.config = e2;
- }
- signedURL(e2, t2 = {}) {
- const n2 = `/ws/function/${e2}`, s2 = this.config.wsEndpoint.replace(/^ws(s)?:\/\//, ""), r2 = Object.assign({}, t2, { accessKeyId: this.config.accessKey, signatureNonce: Ot(), timestamp: "" + Date.now() }), i2 = [n2, ["accessKeyId", "authorization", "signatureNonce", "timestamp"].sort().map(function(e3) {
- return r2[e3] ? "".concat(e3, "=").concat(r2[e3]) : null;
- }).filter(Boolean).join("&"), `host:${s2}`].join("\n"), o2 = ["HMAC-SHA256", we(i2).toString(xt)].join("\n"), a2 = ve(o2, this.config.secretKey).toString(xt), c2 = Object.keys(r2).map((e3) => `${e3}=${encodeURIComponent(r2[e3])}`).join("&");
- return `${this.config.wsEndpoint}${n2}?${c2}&signature=${a2}`;
- }
- }
- var Mt = class {
- constructor(e2) {
- if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach((t2) => {
- if (!Object.prototype.hasOwnProperty.call(e2, t2))
- throw new Error(`${t2} required`);
- }), e2.endpoint) {
- if ("string" != typeof e2.endpoint)
- throw new Error("endpoint must be string");
- if (!/^https:\/\//.test(e2.endpoint))
- throw new Error("endpoint must start with https://");
- e2.endpoint = e2.endpoint.replace(/\/$/, "");
- }
- this.config = Object.assign({}, e2, { endpoint: e2.endpoint || `https://${e2.spaceId}.api-hz.cloudbasefunction.cn`, wsEndpoint: e2.wsEndpoint || `wss://${e2.spaceId}.api-hz.cloudbasefunction.cn` }), this._websocket = new Dt(this.config);
- }
- callFunction(e2) {
- return function(e3, t2) {
- const { name: n2, data: s2, async: r2 = false, timeout: i2 } = e3, o2 = "POST", a2 = { "x-to-function-name": n2 };
- r2 && (a2["x-function-invoke-type"] = "async");
- const { url: c2, headers: u2 } = Et("/functions/invokeFunction", { functionName: n2, data: s2, method: o2, headers: a2, signHeaderKeys: ["x-to-function-name"], config: t2 });
- return Lt({ url: c2, data: s2, method: o2, headers: u2, timeout: i2 }).then((e4) => {
- let t3 = 0;
- if (r2) {
- const n3 = e4.data || {};
- t3 = "200" === n3.errCode ? 0 : n3.errCode, e4.data = n3.data || {}, e4.errMsg = n3.errMsg;
- }
- if (0 !== t3)
- throw new te({ code: t3, message: e4.errMsg, requestId: e4.requestId });
- return { errCode: t3, success: 0 === t3, requestId: e4.requestId, result: e4.data };
- }).catch((e4) => {
- throw new te({ code: e4.errCode, message: e4.errMsg, requestId: e4.requestId });
- });
- }(e2, this.config);
- }
- uploadFileToOSS({ url: e2, filePath: t2, fileType: n2, formData: s2, onUploadProgress: r2 }) {
- return new Promise((i2, o2) => {
- const a2 = ne.uploadFile({ url: e2, filePath: t2, fileType: n2, formData: s2, name: "file", success(e3) {
- e3 && e3.statusCode < 400 ? i2(e3) : o2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
- }, fail(e3) {
- o2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
- } });
- "function" == typeof r2 && a2 && "function" == typeof a2.onProgressUpdate && a2.onProgressUpdate((e3) => {
- r2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
- });
- });
- }
- async uploadFile({ filePath: e2, cloudPath: t2 = "", fileType: n2 = "image", onUploadProgress: s2 }) {
- if ("string" !== f(t2))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
- if (!(t2 = t2.trim()))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
- if (/:\/\//.test(t2))
- throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
- const r2 = await Rt({ path: "/".concat(t2.replace(/^\//, ""), "?post_url") }, this.config), { file_id: i2, upload_url: o2, form_data: a2 } = r2, c2 = a2 && a2.reduce((e3, t3) => (e3[t3.key] = t3.value, e3), {});
- return this.uploadFileToOSS({ url: o2, filePath: e2, fileType: n2, formData: c2, onUploadProgress: s2 }).then(() => ({ fileID: i2 }));
- }
- async getTempFileURL({ fileList: e2 }) {
- return new Promise((t2, n2) => {
- (!e2 || e2.length < 0) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList不能为空数组" })), e2.length > 50 && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList数组长度不能超过50" }));
- const s2 = [];
- for (const t3 of e2) {
- "string" !== f(t3) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList的元素必须是非空的字符串" }));
- const e3 = Ut.call(this, t3);
- s2.push({ file_id: e3, expire: 600 });
- }
- Rt({ path: "/?download_url", data: { file_list: s2 }, method: "POST" }, this.config).then((e3) => {
- const { file_list: n3 = [] } = e3;
- t2({ fileList: n3.map((e4) => ({ fileID: Nt.call(this, e4.file_id), tempFileURL: e4.download_url })) });
- }).catch((e3) => n2(e3));
- });
- }
- async connectWebSocket(e2) {
- const { name: t2, query: n2 } = e2;
- return ne.connectSocket({ url: this._websocket.signedURL(t2, n2), complete: () => {
- } });
- }
- };
- var qt = { init: (e2) => {
- e2.provider = "alipay";
- const t2 = new Mt(e2);
- return t2.auth = function() {
- return { signInAnonymously: function() {
- return Promise.resolve();
- }, getLoginState: function() {
- return Promise.resolve(true);
- } };
- }, t2;
- } };
- function Ft({ data: e2 }) {
- let t2;
- t2 = he();
- const n2 = JSON.parse(JSON.stringify(e2 || {}));
- if (Object.assign(n2, { clientInfo: t2 }), !n2.uniIdToken) {
- const { token: e3 } = re();
- e3 && (n2.uniIdToken = e3);
- }
- return n2;
- }
- async function Kt(e2 = {}) {
- await this.__dev__.initLocalNetwork();
- const { localAddress: t2, localPort: n2 } = this.__dev__, s2 = { aliyun: "aliyun", tencent: "tcb", alipay: "alipay", dcloud: "dcloud" }[this.config.provider], r2 = this.config.spaceId, i2 = `http://${t2}:${n2}/system/check-function`, o2 = `http://${t2}:${n2}/cloudfunctions/${e2.name}`;
- return new Promise((t3, n3) => {
- ne.request({ method: "POST", url: i2, data: { name: e2.name, platform: C, provider: s2, spaceId: r2 }, timeout: 3e3, success(e3) {
- t3(e3);
- }, fail() {
- t3({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });
- } });
- }).then(({ data: e3 } = {}) => {
- const { code: t3, message: n3 } = e3 || {};
- return { code: 0 === t3 ? 0 : t3 || "SYS_ERR", message: n3 || "SYS_ERR" };
- }).then(({ code: t3, message: n3 }) => {
- if (0 !== t3) {
- switch (t3) {
- case "MODULE_ENCRYPTED":
- console.error(`此云函数(${e2.name})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);
- break;
- case "FUNCTION_ENCRYPTED":
- console.error(`此云函数(${e2.name})已加密不可本地调试,自动切换为云端已部署的云函数`);
- break;
- case "ACTION_ENCRYPTED":
- console.error(n3 || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
- break;
- case "NETWORK_ERROR":
- console.error(n3 || "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下");
- break;
- case "SWITCH_TO_CLOUD":
- break;
- default: {
- const e3 = `检测本地调试服务出现错误:${n3},请检查网络环境或重启客户端再试`;
- throw console.error(e3), new Error(e3);
- }
- }
- return this._callCloudFunction(e2);
- }
- return new Promise((t4, n4) => {
- const r3 = Ft.call(this, { data: e2.data });
- ne.request({ method: "POST", url: o2, data: { provider: s2, platform: C, param: r3 }, timeout: e2.timeout, success: ({ statusCode: e3, data: s3 } = {}) => !e3 || e3 >= 400 ? n4(new te({ code: s3.code || "SYS_ERR", message: s3.message || "request:fail" })) : t4({ result: s3 }), fail(e3) {
- n4(new te({ code: e3.code || e3.errCode || "SYS_ERR", message: e3.message || e3.errMsg || "request:fail" }));
- } });
- });
- });
- }
- const jt = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];
- var $t = /[\\^$.*+?()[\]{}|]/g, Bt = RegExp($t.source);
- function Wt(e2, t2, n2) {
- return e2.replace(new RegExp((s2 = t2) && Bt.test(s2) ? s2.replace($t, "\\$&") : s2, "g"), n2);
- var s2;
- }
- const Jt = "request", zt = "response", Vt = "both";
- const En = { code: 2e4, message: "System error" }, Ln = { code: 20101, message: "Invalid client" };
- function Nn(e2) {
- const { errSubject: t2, subject: n2, errCode: s2, errMsg: r2, code: i2, message: o2, cause: a2 } = e2 || {};
- return new te({ subject: t2 || n2 || "uni-secure-network", code: s2 || i2 || En.code, message: r2 || o2, cause: a2 });
- }
- let Mn;
- function $n({ secretType: e2 } = {}) {
- return e2 === Jt || e2 === zt || e2 === Vt;
- }
- function Bn({ name: e2, data: t2 = {} } = {}) {
- return "DCloud-clientDB" === e2 && "encryption" === t2.redirectTo && "getAppClientKey" === t2.action;
- }
- function Wn({ provider: e2, spaceId: t2, functionName: n2 } = {}) {
- const { appId: s2, uniPlatform: r2, osName: i2 } = ce();
- let o2 = r2;
- "app" === r2 && (o2 = i2);
- const a2 = function({ provider: e3, spaceId: t3 } = {}) {
- const n3 = A;
- if (!n3)
- return {};
- e3 = /* @__PURE__ */ function(e4) {
- return "tencent" === e4 ? "tcb" : e4;
- }(e3);
- const s3 = n3.find((n4) => n4.provider === e3 && n4.spaceId === t3);
- return s3 && s3.config;
- }({ provider: e2, spaceId: t2 });
- if (!a2 || !a2.accessControl || !a2.accessControl.enable)
- return false;
- const c2 = a2.accessControl.function || {}, u2 = Object.keys(c2);
- if (0 === u2.length)
- return true;
- const l2 = function(e3, t3) {
- let n3, s3, r3;
- for (let i3 = 0; i3 < e3.length; i3++) {
- const o3 = e3[i3];
- o3 !== t3 ? "*" !== o3 ? o3.split(",").map((e4) => e4.trim()).indexOf(t3) > -1 && (s3 = o3) : r3 = o3 : n3 = o3;
- }
- return n3 || s3 || r3;
- }(u2, n2);
- if (!l2)
- return false;
- if ((c2[l2] || []).find((e3 = {}) => e3.appId === s2 && (e3.platform || "").toLowerCase() === o2.toLowerCase()))
- return true;
- throw console.error(`此应用[appId: ${s2}, platform: ${o2}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`), Nn(Ln);
- }
- function Hn({ functionName: e2, result: t2, logPvd: n2 }) {
- if (this.__dev__.debugLog && t2 && t2.requestId) {
- const s2 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e2, requestId: t2.requestId });
- console.log(`[${n2}-request]${s2}[/${n2}-request]`);
- }
- }
- function Jn(e2) {
- const t2 = e2.callFunction, n2 = function(n3) {
- const s2 = n3.name;
- n3.data = Ft.call(e2, { data: n3.data });
- const r2 = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb", alipay: "alipay", dcloud: "dcloud" }[this.config.provider], i2 = $n(n3), o2 = Bn(n3), a2 = i2 || o2;
- return t2.call(this, n3).then((e3) => (e3.errCode = 0, !a2 && Hn.call(this, { functionName: s2, result: e3, logPvd: r2 }), Promise.resolve(e3)), (e3) => (!a2 && Hn.call(this, { functionName: s2, result: e3, logPvd: r2 }), e3 && e3.message && (e3.message = function({ message: e4 = "", extraInfo: t3 = {}, formatter: n4 = [] } = {}) {
- for (let s3 = 0; s3 < n4.length; s3++) {
- const { rule: r3, content: i3, mode: o3 } = n4[s3], a3 = e4.match(r3);
- if (!a3)
- continue;
- let c2 = i3;
- for (let e5 = 1; e5 < a3.length; e5++)
- c2 = Wt(c2, `{$${e5}}`, a3[e5]);
- for (const e5 in t3)
- c2 = Wt(c2, `{${e5}}`, t3[e5]);
- return "replace" === o3 ? c2 : e4 + c2;
- }
- return e4;
- }({ message: `[${n3.name}]: ${e3.message}`, formatter: jt, extraInfo: { functionName: s2 } })), Promise.reject(e3)));
- };
- e2.callFunction = function(t3) {
- const { provider: s2, spaceId: r2 } = e2.config, i2 = t3.name;
- let o2, a2;
- if (t3.data = t3.data || {}, e2.__dev__.debugInfo && !e2.__dev__.debugInfo.forceRemote && T ? (e2._callCloudFunction || (e2._callCloudFunction = n2, e2._callLocalFunction = Kt), o2 = Kt) : o2 = n2, o2 = o2.bind(e2), Bn(t3))
- a2 = n2.call(e2, t3);
- else if ($n(t3)) {
- a2 = new Mn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapEncryptDataCallFunction(n2.bind(e2))(t3);
- } else if (Wn({ provider: s2, spaceId: r2, functionName: i2 })) {
- a2 = new Mn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapVerifyClientCallFunction(n2.bind(e2))(t3);
- } else
- a2 = o2(t3);
- return Object.defineProperty(a2, "result", { get: () => (console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {}) }), a2.then((e3) => ("undefined" != typeof UTSJSONObject && (e3.result = new UTSJSONObject(e3.result)), e3));
- };
- }
- Mn = class {
- constructor() {
- throw Nn({ message: `Platform ${C} is not enabled, please check whether secure network module is enabled in your manifest.json` });
- }
- };
- const zn = Symbol("CLIENT_DB_INTERNAL");
- function Vn(e2, t2) {
- return e2.then = "DoNotReturnProxyWithAFunctionNamedThen", e2._internalType = zn, e2.inspect = null, e2.__v_raw = void 0, new Proxy(e2, { get(e3, n2, s2) {
- if ("_uniClient" === n2)
- return null;
- if ("symbol" == typeof n2)
- return e3[n2];
- if (n2 in e3 || "string" != typeof n2) {
- const t3 = e3[n2];
- return "function" == typeof t3 ? t3.bind(e3) : t3;
- }
- return t2.get(e3, n2, s2);
- } });
- }
- function Gn(e2) {
- return { on: (t2, n2) => {
- e2[t2] = e2[t2] || [], e2[t2].indexOf(n2) > -1 || e2[t2].push(n2);
- }, off: (t2, n2) => {
- e2[t2] = e2[t2] || [];
- const s2 = e2[t2].indexOf(n2);
- -1 !== s2 && e2[t2].splice(s2, 1);
- } };
- }
- const Yn = ["db.Geo", "db.command", "command.aggregate"];
- function Qn(e2, t2) {
- return Yn.indexOf(`${e2}.${t2}`) > -1;
- }
- function Xn(e2) {
- switch (f(e2 = se(e2))) {
- case "array":
- return e2.map((e3) => Xn(e3));
- case "object":
- return e2._internalType === zn || Object.keys(e2).forEach((t2) => {
- e2[t2] = Xn(e2[t2]);
- }), e2;
- case "regexp":
- return { $regexp: { source: e2.source, flags: e2.flags } };
- case "date":
- return { $date: e2.toISOString() };
- default:
- return e2;
- }
- }
- function Zn(e2) {
- return e2 && e2.content && e2.content.$method;
- }
- class es {
- constructor(e2, t2, n2) {
- this.content = e2, this.prevStage = t2 || null, this.udb = null, this._database = n2;
- }
- toJSON() {
- let e2 = this;
- const t2 = [e2.content];
- for (; e2.prevStage; )
- e2 = e2.prevStage, t2.push(e2.content);
- return { $db: t2.reverse().map((e3) => ({ $method: e3.$method, $param: Xn(e3.$param) })) };
- }
- toString() {
- return JSON.stringify(this.toJSON());
- }
- getAction() {
- const e2 = this.toJSON().$db.find((e3) => "action" === e3.$method);
- return e2 && e2.$param && e2.$param[0];
- }
- getCommand() {
- return { $db: this.toJSON().$db.filter((e2) => "action" !== e2.$method) };
- }
- get isAggregate() {
- let e2 = this;
- for (; e2; ) {
- const t2 = Zn(e2), n2 = Zn(e2.prevStage);
- if ("aggregate" === t2 && "collection" === n2 || "pipeline" === t2)
- return true;
- e2 = e2.prevStage;
- }
- return false;
- }
- get isCommand() {
- let e2 = this;
- for (; e2; ) {
- if ("command" === Zn(e2))
- return true;
- e2 = e2.prevStage;
- }
- return false;
- }
- get isAggregateCommand() {
- let e2 = this;
- for (; e2; ) {
- const t2 = Zn(e2), n2 = Zn(e2.prevStage);
- if ("aggregate" === t2 && "command" === n2)
- return true;
- e2 = e2.prevStage;
- }
- return false;
- }
- getNextStageFn(e2) {
- const t2 = this;
- return function() {
- return ts({ $method: e2, $param: Xn(Array.from(arguments)) }, t2, t2._database);
- };
- }
- get count() {
- return this.isAggregate ? this.getNextStageFn("count") : function() {
- return this._send("count", Array.from(arguments));
- };
- }
- get remove() {
- return this.isCommand ? this.getNextStageFn("remove") : function() {
- return this._send("remove", Array.from(arguments));
- };
- }
- get() {
- return this._send("get", Array.from(arguments));
- }
- get add() {
- return this.isCommand ? this.getNextStageFn("add") : function() {
- return this._send("add", Array.from(arguments));
- };
- }
- update() {
- return this._send("update", Array.from(arguments));
- }
- end() {
- return this._send("end", Array.from(arguments));
- }
- get set() {
- return this.isCommand ? this.getNextStageFn("set") : function() {
- throw new Error("JQL禁止使用set方法");
- };
- }
- _send(e2, t2) {
- const n2 = this.getAction(), s2 = this.getCommand();
- if (s2.$db.push({ $method: e2, $param: Xn(t2) }), S) {
- const e3 = s2.$db.find((e4) => "collection" === e4.$method), t3 = e3 && e3.$param;
- t3 && 1 === t3.length && "string" == typeof e3.$param[0] && e3.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
- }
- return this._database._callCloudFunction({ action: n2, command: s2 });
- }
- }
- function ts(e2, t2, n2) {
- return Vn(new es(e2, t2, n2), { get(e3, t3) {
- let s2 = "db";
- return e3 && e3.content && (s2 = e3.content.$method), Qn(s2, t3) ? ts({ $method: t3 }, e3, n2) : function() {
- return ts({ $method: t3, $param: Xn(Array.from(arguments)) }, e3, n2);
- };
- } });
- }
- function ns({ path: e2, method: t2 }) {
- return class {
- constructor() {
- this.param = Array.from(arguments);
- }
- toJSON() {
- return { $newDb: [...e2.map((e3) => ({ $method: e3 })), { $method: t2, $param: this.param }] };
- }
- toString() {
- return JSON.stringify(this.toJSON());
- }
- };
- }
- function ss(e2, t2 = {}) {
- return Vn(new e2(t2), { get: (e3, t3) => Qn("db", t3) ? ts({ $method: t3 }, null, e3) : function() {
- return ts({ $method: t3, $param: Xn(Array.from(arguments)) }, null, e3);
- } });
- }
- class rs extends class {
- constructor({ uniClient: e2 = {}, isJQL: t2 = false } = {}) {
- this._uniClient = e2, this._authCallBacks = {}, this._dbCallBacks = {}, e2._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t2 || (this.auth = Gn(this._authCallBacks)), this._isJQL = t2, Object.assign(this, Gn(this._dbCallBacks)), this.env = Vn({}, { get: (e3, t3) => ({ $env: t3 }) }), this.Geo = Vn({}, { get: (e3, t3) => ns({ path: ["Geo"], method: t3 }) }), this.serverDate = ns({ path: [], method: "serverDate" }), this.RegExp = ns({ path: [], method: "RegExp" });
- }
- getCloudEnv(e2) {
- if ("string" != typeof e2 || !e2.trim())
- throw new Error("getCloudEnv参数错误");
- return { $env: e2.replace("$cloudEnv_", "") };
- }
- _callback(e2, t2) {
- const n2 = this._dbCallBacks;
- n2[e2] && n2[e2].forEach((e3) => {
- e3(...t2);
- });
- }
- _callbackAuth(e2, t2) {
- const n2 = this._authCallBacks;
- n2[e2] && n2[e2].forEach((e3) => {
- e3(...t2);
- });
- }
- multiSend() {
- const e2 = Array.from(arguments), t2 = e2.map((e3) => {
- const t3 = e3.getAction(), n2 = e3.getCommand();
- if ("getTemp" !== n2.$db[n2.$db.length - 1].$method)
- throw new Error("multiSend只支持子命令内使用getTemp");
- return { action: t3, command: n2 };
- });
- return this._callCloudFunction({ multiCommand: t2, queryList: e2 });
- }
- } {
- _parseResult(e2) {
- return this._isJQL ? e2.result : e2;
- }
- _callCloudFunction({ action: e2, command: t2, multiCommand: n2, queryList: s2 }) {
- function r2(e3, t3) {
- if (n2 && s2)
- for (let n3 = 0; n3 < s2.length; n3++) {
- const r3 = s2[n3];
- r3.udb && "function" == typeof r3.udb.setResult && (t3 ? r3.udb.setResult(t3) : r3.udb.setResult(e3.result.dataList[n3]));
- }
- }
- const i2 = this, o2 = this._isJQL ? "databaseForJQL" : "database";
- function a2(e3) {
- return i2._callback("error", [e3]), M(q(o2, "fail"), e3).then(() => M(q(o2, "complete"), e3)).then(() => (r2(null, e3), Y(j, { type: W, content: e3 }), Promise.reject(e3)));
- }
- const c2 = M(q(o2, "invoke")), u2 = this._uniClient;
- return c2.then(() => u2.callFunction({ name: "DCloud-clientDB", type: l, data: { action: e2, command: t2, multiCommand: n2 } })).then((e3) => {
- const { code: t3, message: n3, token: s3, tokenExpired: c3, systemInfo: u3 = [] } = e3.result;
- if (u3)
- for (let e4 = 0; e4 < u3.length; e4++) {
- const { level: t4, message: n4, detail: s4 } = u3[e4], r3 = console["warn" === t4 ? "error" : t4] || console.log;
- let i3 = "[System Info]" + n4;
- s4 && (i3 = `${i3}
- 详细信息:${s4}`), r3(i3);
- }
- if (t3) {
- return a2(new te({ code: t3, message: n3, requestId: e3.requestId }));
- }
- e3.result.errCode = e3.result.errCode || e3.result.code, e3.result.errMsg = e3.result.errMsg || e3.result.message, s3 && c3 && (ie({ token: s3, tokenExpired: c3 }), this._callbackAuth("refreshToken", [{ token: s3, tokenExpired: c3 }]), this._callback("refreshToken", [{ token: s3, tokenExpired: c3 }]), Y(B, { token: s3, tokenExpired: c3 }));
- const l2 = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];
- for (let t4 = 0; t4 < l2.length; t4++) {
- const { prop: n4, tips: s4 } = l2[t4];
- if (n4 in e3.result) {
- const t5 = e3.result[n4];
- Object.defineProperty(e3.result, n4, { get: () => (console.warn(s4), t5) });
- }
- }
- return function(e4) {
- return M(q(o2, "success"), e4).then(() => M(q(o2, "complete"), e4)).then(() => {
- r2(e4, null);
- const t4 = i2._parseResult(e4);
- return Y(j, { type: W, content: t4 }), Promise.resolve(t4);
- });
- }(e3);
- }, (e3) => {
- /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e3.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
- return a2(new te({ code: e3.code || "SYSTEM_ERROR", message: e3.message, requestId: e3.requestId }));
- });
- }
- }
- const is = "token无效,跳转登录页面", os = "token过期,跳转登录页面", as = { TOKEN_INVALID_TOKEN_EXPIRED: os, TOKEN_INVALID_INVALID_CLIENTID: is, TOKEN_INVALID: is, TOKEN_INVALID_WRONG_TOKEN: is, TOKEN_INVALID_ANONYMOUS_USER: is }, cs = { "uni-id-token-expired": os, "uni-id-check-token-failed": is, "uni-id-token-not-exist": is, "uni-id-check-device-feature-failed": is };
- function us(e2, t2) {
- let n2 = "";
- return n2 = e2 ? `${e2}/${t2}` : t2, n2.replace(/^\//, "");
- }
- function ls(e2 = [], t2 = "") {
- const n2 = [], s2 = [];
- return e2.forEach((e3) => {
- true === e3.needLogin ? n2.push(us(t2, e3.path)) : false === e3.needLogin && s2.push(us(t2, e3.path));
- }), { needLoginPage: n2, notNeedLoginPage: s2 };
- }
- function hs(e2) {
- return e2.split("?")[0].replace(/^\//, "");
- }
- function ds() {
- return function(e2) {
- let t2 = e2 && e2.$page && e2.$page.fullPath || "";
- return t2 ? ("/" !== t2.charAt(0) && (t2 = "/" + t2), t2) : t2;
- }(function() {
- const e2 = getCurrentPages();
- return e2[e2.length - 1];
- }());
- }
- function ps() {
- return hs(ds());
- }
- function fs(e2 = "", t2 = {}) {
- if (!e2)
- return false;
- if (!(t2 && t2.list && t2.list.length))
- return false;
- const n2 = t2.list, s2 = hs(e2);
- return n2.some((e3) => e3.pagePath === s2);
- }
- const gs = !!e.uniIdRouter;
- const { loginPage: ms, routerNeedLogin: ys, resToLogin: _s, needLoginPage: ws, notNeedLoginPage: vs, loginPageInTabBar: Is } = function({ pages: t2 = [], subPackages: n2 = [], uniIdRouter: s2 = {}, tabBar: r2 = {} } = e) {
- const { loginPage: i2, needLogin: o2 = [], resToLogin: a2 = true } = s2, { needLoginPage: c2, notNeedLoginPage: u2 } = ls(t2), { needLoginPage: l2, notNeedLoginPage: h2 } = function(e2 = []) {
- const t3 = [], n3 = [];
- return e2.forEach((e3) => {
- const { root: s3, pages: r3 = [] } = e3, { needLoginPage: i3, notNeedLoginPage: o3 } = ls(r3, s3);
- t3.push(...i3), n3.push(...o3);
- }), { needLoginPage: t3, notNeedLoginPage: n3 };
- }(n2);
- return { loginPage: i2, routerNeedLogin: o2, resToLogin: a2, needLoginPage: [...c2, ...l2], notNeedLoginPage: [...u2, ...h2], loginPageInTabBar: fs(i2, r2) };
- }();
- if (ws.indexOf(ms) > -1)
- throw new Error(`Login page [${ms}] should not be "needLogin", please check your pages.json`);
- function Ss(e2) {
- const t2 = ps();
- if ("/" === e2.charAt(0))
- return e2;
- const [n2, s2] = e2.split("?"), r2 = n2.replace(/^\//, "").split("/"), i2 = t2.split("/");
- i2.pop();
- for (let e3 = 0; e3 < r2.length; e3++) {
- const t3 = r2[e3];
- ".." === t3 ? i2.pop() : "." !== t3 && i2.push(t3);
- }
- return "" === i2[0] && i2.shift(), "/" + i2.join("/") + (s2 ? "?" + s2 : "");
- }
- function bs(e2) {
- const t2 = hs(Ss(e2));
- return !(vs.indexOf(t2) > -1) && (ws.indexOf(t2) > -1 || ys.some((t3) => function(e3, t4) {
- return new RegExp(t4).test(e3);
- }(e2, t3)));
- }
- function ks({ redirect: e2 }) {
- const t2 = hs(e2), n2 = hs(ms);
- return ps() !== n2 && t2 !== n2;
- }
- function As({ api: e2, redirect: t2 } = {}) {
- if (!t2 || !ks({ redirect: t2 }))
- return;
- const n2 = function(e3, t3) {
- return "/" !== e3.charAt(0) && (e3 = "/" + e3), t3 ? e3.indexOf("?") > -1 ? e3 + `&uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3 + `?uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3;
- }(ms, t2);
- Is ? "navigateTo" !== e2 && "redirectTo" !== e2 || (e2 = "switchTab") : "switchTab" === e2 && (e2 = "navigateTo");
- const s2 = { navigateTo: uni.navigateTo, redirectTo: uni.redirectTo, switchTab: uni.switchTab, reLaunch: uni.reLaunch };
- setTimeout(() => {
- s2[e2]({ url: n2 });
- }, 0);
- }
- function Cs({ url: e2 } = {}) {
- const t2 = { abortLoginPageJump: false, autoToLoginPage: false }, n2 = function() {
- const { token: e3, tokenExpired: t3 } = re();
- let n3;
- if (e3) {
- if (t3 < Date.now()) {
- const e4 = "uni-id-token-expired";
- n3 = { errCode: e4, errMsg: cs[e4] };
- }
- } else {
- const e4 = "uni-id-check-token-failed";
- n3 = { errCode: e4, errMsg: cs[e4] };
- }
- return n3;
- }();
- if (bs(e2) && n2) {
- n2.uniIdRedirectUrl = e2;
- if (z($).length > 0)
- return setTimeout(() => {
- Y($, n2);
- }, 0), t2.abortLoginPageJump = true, t2;
- t2.autoToLoginPage = true;
- }
- return t2;
- }
- function Ps() {
- !function() {
- const e3 = ds(), { abortLoginPageJump: t2, autoToLoginPage: n2 } = Cs({ url: e3 });
- t2 || n2 && As({ api: "redirectTo", redirect: e3 });
- }();
- const e2 = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
- for (let t2 = 0; t2 < e2.length; t2++) {
- const n2 = e2[t2];
- uni.addInterceptor(n2, { invoke(e3) {
- const { abortLoginPageJump: t3, autoToLoginPage: s2 } = Cs({ url: e3.url });
- return t3 ? e3 : s2 ? (As({ api: n2, redirect: Ss(e3.url) }), false) : e3;
- } });
- }
- }
- function Ts() {
- this.onResponse((e2) => {
- const { type: t2, content: n2 } = e2;
- let s2 = false;
- switch (t2) {
- case "cloudobject":
- s2 = function(e3) {
- if ("object" != typeof e3)
- return false;
- const { errCode: t3 } = e3 || {};
- return t3 in cs;
- }(n2);
- break;
- case "clientdb":
- s2 = function(e3) {
- if ("object" != typeof e3)
- return false;
- const { errCode: t3 } = e3 || {};
- return t3 in as;
- }(n2);
- }
- s2 && function(e3 = {}) {
- const t3 = z($);
- Z().then(() => {
- const n3 = ds();
- if (n3 && ks({ redirect: n3 }))
- return t3.length > 0 ? Y($, Object.assign({ uniIdRedirectUrl: n3 }, e3)) : void (ms && As({ api: "navigateTo", redirect: n3 }));
- });
- }(n2);
- });
- }
- function xs(e2) {
- !function(e3) {
- e3.onResponse = function(e4) {
- V(j, e4);
- }, e3.offResponse = function(e4) {
- G(j, e4);
- };
- }(e2), function(e3) {
- e3.onNeedLogin = function(e4) {
- V($, e4);
- }, e3.offNeedLogin = function(e4) {
- G($, e4);
- }, gs && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = true, Z().then(() => {
- Ps.call(e3);
- }), _s && Ts.call(e3)));
- }(e2), function(e3) {
- e3.onRefreshToken = function(e4) {
- V(B, e4);
- }, e3.offRefreshToken = function(e4) {
- G(B, e4);
- };
- }(e2);
- }
- let Os;
- const Es = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", Ls = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
- function Rs() {
- const e2 = re().token || "", t2 = e2.split(".");
- if (!e2 || 3 !== t2.length)
- return { uid: null, role: [], permission: [], tokenExpired: 0 };
- let n2;
- try {
- n2 = JSON.parse((s2 = t2[1], decodeURIComponent(Os(s2).split("").map(function(e3) {
- return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
- }).join(""))));
- } catch (e3) {
- throw new Error("获取当前用户信息出错,详细错误信息为:" + e3.message);
- }
- var s2;
- return n2.tokenExpired = 1e3 * n2.exp, delete n2.exp, delete n2.iat, n2;
- }
- Os = "function" != typeof atob ? function(e2) {
- if (e2 = String(e2).replace(/[\t\n\f\r ]+/g, ""), !Ls.test(e2))
- throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
- var t2;
- e2 += "==".slice(2 - (3 & e2.length));
- for (var n2, s2, r2 = "", i2 = 0; i2 < e2.length; )
- t2 = Es.indexOf(e2.charAt(i2++)) << 18 | Es.indexOf(e2.charAt(i2++)) << 12 | (n2 = Es.indexOf(e2.charAt(i2++))) << 6 | (s2 = Es.indexOf(e2.charAt(i2++))), r2 += 64 === n2 ? String.fromCharCode(t2 >> 16 & 255) : 64 === s2 ? String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255) : String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255, 255 & t2);
- return r2;
- } : atob;
- var Us = n(function(e2, t2) {
- Object.defineProperty(t2, "__esModule", { value: true });
- const n2 = "chooseAndUploadFile:ok", s2 = "chooseAndUploadFile:fail";
- function r2(e3, t3) {
- return e3.tempFiles.forEach((e4, n3) => {
- e4.name || (e4.name = e4.path.substring(e4.path.lastIndexOf("/") + 1)), t3 && (e4.fileType = t3), e4.cloudPath = Date.now() + "_" + n3 + e4.name.substring(e4.name.lastIndexOf("."));
- }), e3.tempFilePaths || (e3.tempFilePaths = e3.tempFiles.map((e4) => e4.path)), e3;
- }
- function i2(e3, t3, { onChooseFile: s3, onUploadProgress: r3 }) {
- return t3.then((e4) => {
- if (s3) {
- const t4 = s3(e4);
- if (void 0 !== t4)
- return Promise.resolve(t4).then((t5) => void 0 === t5 ? e4 : t5);
- }
- return e4;
- }).then((t4) => false === t4 ? { errMsg: n2, tempFilePaths: [], tempFiles: [] } : function(e4, t5, s4 = 5, r4) {
- (t5 = Object.assign({}, t5)).errMsg = n2;
- const i3 = t5.tempFiles, o2 = i3.length;
- let a2 = 0;
- return new Promise((n3) => {
- for (; a2 < s4; )
- c2();
- function c2() {
- const s5 = a2++;
- if (s5 >= o2)
- return void (!i3.find((e5) => !e5.url && !e5.errMsg) && n3(t5));
- const u2 = i3[s5];
- e4.uploadFile({ provider: u2.provider, filePath: u2.path, cloudPath: u2.cloudPath, fileType: u2.fileType, cloudPathAsRealPath: u2.cloudPathAsRealPath, onUploadProgress(e5) {
- e5.index = s5, e5.tempFile = u2, e5.tempFilePath = u2.path, r4 && r4(e5);
- } }).then((e5) => {
- u2.url = e5.fileID, s5 < o2 && c2();
- }).catch((e5) => {
- u2.errMsg = e5.errMsg || e5.message, s5 < o2 && c2();
- });
- }
- });
- }(e3, t4, 5, r3));
- }
- t2.initChooseAndUploadFile = function(e3) {
- return function(t3 = { type: "all" }) {
- return "image" === t3.type ? i2(e3, function(e4) {
- const { count: t4, sizeType: n3, sourceType: i3 = ["album", "camera"], extension: o2 } = e4;
- return new Promise((e5, a2) => {
- uni.chooseImage({ count: t4, sizeType: n3, sourceType: i3, extension: o2, success(t5) {
- e5(r2(t5, "image"));
- }, fail(e6) {
- a2({ errMsg: e6.errMsg.replace("chooseImage:fail", s2) });
- } });
- });
- }(t3), t3) : "video" === t3.type ? i2(e3, function(e4) {
- const { camera: t4, compressed: n3, maxDuration: i3, sourceType: o2 = ["album", "camera"], extension: a2 } = e4;
- return new Promise((e5, c2) => {
- uni.chooseVideo({ camera: t4, compressed: n3, maxDuration: i3, sourceType: o2, extension: a2, success(t5) {
- const { tempFilePath: n4, duration: s3, size: i4, height: o3, width: a3 } = t5;
- e5(r2({ errMsg: "chooseVideo:ok", tempFilePaths: [n4], tempFiles: [{ name: t5.tempFile && t5.tempFile.name || "", path: n4, size: i4, type: t5.tempFile && t5.tempFile.type || "", width: a3, height: o3, duration: s3, fileType: "video", cloudPath: "" }] }, "video"));
- }, fail(e6) {
- c2({ errMsg: e6.errMsg.replace("chooseVideo:fail", s2) });
- } });
- });
- }(t3), t3) : i2(e3, function(e4) {
- const { count: t4, extension: n3 } = e4;
- return new Promise((e5, i3) => {
- let o2 = uni.chooseFile;
- if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o2 = wx.chooseMessageFile), "function" != typeof o2)
- return i3({ errMsg: s2 + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });
- o2({ type: "all", count: t4, extension: n3, success(t5) {
- e5(r2(t5));
- }, fail(e6) {
- i3({ errMsg: e6.errMsg.replace("chooseFile:fail", s2) });
- } });
- });
- }(t3), t3);
- };
- };
- }), Ns = t$3(Us);
- const Ds = "manual";
- function Ms(e2) {
- return { props: { localdata: { type: Array, default: () => [] }, options: { type: [Object, Array], default: () => ({}) }, spaceInfo: { type: Object, default: () => ({}) }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: false }, gettree: { type: [Boolean, String], default: false }, gettreepath: { type: [Boolean, String], default: false }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: false }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: false } }, data: () => ({ mixinDatacomLoading: false, mixinDatacomHasMore: false, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {}, mixinDatacomError: null }), created() {
- this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(() => {
- var e3 = [];
- return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach((t2) => {
- e3.push(this[t2]);
- }), e3;
- }, (e3, t2) => {
- if (this.loadtime === Ds)
- return;
- let n2 = false;
- const s2 = [];
- for (let r2 = 2; r2 < e3.length; r2++)
- e3[r2] !== t2[r2] && (s2.push(e3[r2]), n2 = true);
- e3[0] !== t2[0] && (this.mixinDatacomPage.current = this.pageCurrent), this.mixinDatacomPage.size = this.pageSize, this.onMixinDatacomPropsChange(n2, s2);
- });
- }, methods: { onMixinDatacomPropsChange(e3, t2) {
- }, mixinDatacomEasyGet({ getone: e3 = false, success: t2, fail: n2 } = {}) {
- this.mixinDatacomLoading || (this.mixinDatacomLoading = true, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then((n3) => {
- this.mixinDatacomLoading = false;
- const { data: s2, count: r2 } = n3.result;
- this.getcount && (this.mixinDatacomPage.count = r2), this.mixinDatacomHasMore = s2.length < this.pageSize;
- const i2 = e3 ? s2.length ? s2[0] : void 0 : s2;
- this.mixinDatacomResData = i2, t2 && t2(i2);
- }).catch((e4) => {
- this.mixinDatacomLoading = false, this.mixinDatacomErrorMessage = e4, this.mixinDatacomError = e4, n2 && n2(e4);
- }));
- }, mixinDatacomGet(t2 = {}) {
- let n2;
- t2 = t2 || {}, n2 = "undefined" != typeof __uniX && __uniX ? e2.databaseForJQL(this.spaceInfo) : e2.database(this.spaceInfo);
- const s2 = t2.action || this.action;
- s2 && (n2 = n2.action(s2));
- const r2 = t2.collection || this.collection;
- n2 = Array.isArray(r2) ? n2.collection(...r2) : n2.collection(r2);
- const i2 = t2.where || this.where;
- i2 && Object.keys(i2).length && (n2 = n2.where(i2));
- const o2 = t2.field || this.field;
- o2 && (n2 = n2.field(o2));
- const a2 = t2.foreignKey || this.foreignKey;
- a2 && (n2 = n2.foreignKey(a2));
- const c2 = t2.groupby || this.groupby;
- c2 && (n2 = n2.groupBy(c2));
- const u2 = t2.groupField || this.groupField;
- u2 && (n2 = n2.groupField(u2));
- true === (void 0 !== t2.distinct ? t2.distinct : this.distinct) && (n2 = n2.distinct());
- const l2 = t2.orderby || this.orderby;
- l2 && (n2 = n2.orderBy(l2));
- const h2 = void 0 !== t2.pageCurrent ? t2.pageCurrent : this.mixinDatacomPage.current, d2 = void 0 !== t2.pageSize ? t2.pageSize : this.mixinDatacomPage.size, p2 = void 0 !== t2.getcount ? t2.getcount : this.getcount, f2 = void 0 !== t2.gettree ? t2.gettree : this.gettree, g2 = void 0 !== t2.gettreepath ? t2.gettreepath : this.gettreepath, m2 = { getCount: p2 }, y2 = { limitLevel: void 0 !== t2.limitlevel ? t2.limitlevel : this.limitlevel, startWith: void 0 !== t2.startwith ? t2.startwith : this.startwith };
- return f2 && (m2.getTree = y2), g2 && (m2.getTreePath = y2), n2 = n2.skip(d2 * (h2 - 1)).limit(d2).get(m2), n2;
- } } };
- }
- function qs(e2) {
- return function(t2, n2 = {}) {
- n2 = function(e3, t3 = {}) {
- return e3.customUI = t3.customUI || e3.customUI, e3.parseSystemError = t3.parseSystemError || e3.parseSystemError, Object.assign(e3.loadingOptions, t3.loadingOptions), Object.assign(e3.errorOptions, t3.errorOptions), "object" == typeof t3.secretMethods && (e3.secretMethods = t3.secretMethods), e3;
- }({ customUI: false, loadingOptions: { title: "加载中...", mask: true }, errorOptions: { type: "modal", retry: false } }, n2);
- const { customUI: s2, loadingOptions: r2, errorOptions: i2, parseSystemError: o2 } = n2, a2 = !s2;
- return new Proxy({}, { get(s3, c2) {
- switch (c2) {
- case "toString":
- return "[object UniCloudObject]";
- case "toJSON":
- return {};
- }
- return function({ fn: e3, interceptorName: t3, getCallbackArgs: n3 } = {}) {
- return async function(...s4) {
- const r3 = n3 ? n3({ params: s4 }) : {};
- let i3, o3;
- try {
- return await M(q(t3, "invoke"), { ...r3 }), i3 = await e3(...s4), await M(q(t3, "success"), { ...r3, result: i3 }), i3;
- } catch (e4) {
- throw o3 = e4, await M(q(t3, "fail"), { ...r3, error: o3 }), o3;
- } finally {
- await M(q(t3, "complete"), o3 ? { ...r3, error: o3 } : { ...r3, result: i3 });
- }
- };
- }({ fn: async function s4(...l2) {
- let h2;
- a2 && uni.showLoading({ title: r2.title, mask: r2.mask });
- const d2 = { name: t2, type: u, data: { method: c2, params: l2 } };
- "object" == typeof n2.secretMethods && function(e3, t3) {
- const n3 = t3.data.method, s5 = e3.secretMethods || {}, r3 = s5[n3] || s5["*"];
- r3 && (t3.secretType = r3);
- }(n2, d2);
- let p2 = false;
- try {
- h2 = await e2.callFunction(d2);
- } catch (e3) {
- p2 = true, h2 = { result: new te(e3) };
- }
- const { errSubject: f2, errCode: g2, errMsg: m2, newToken: y2 } = h2.result || {};
- if (a2 && uni.hideLoading(), y2 && y2.token && y2.tokenExpired && (ie(y2), Y(B, { ...y2 })), g2) {
- let e3 = m2;
- if (p2 && o2) {
- e3 = (await o2({ objectName: t2, methodName: c2, params: l2, errSubject: f2, errCode: g2, errMsg: m2 })).errMsg || m2;
- }
- if (a2)
- if ("toast" === i2.type)
- uni.showToast({ title: e3, icon: "none" });
- else {
- if ("modal" !== i2.type)
- throw new Error(`Invalid errorOptions.type: ${i2.type}`);
- {
- const { confirm: t3 } = await async function({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3 } = {}) {
- return new Promise((i3, o3) => {
- uni.showModal({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3, success(e5) {
- i3(e5);
- }, fail() {
- i3({ confirm: false, cancel: true });
- } });
- });
- }({ title: "提示", content: e3, showCancel: i2.retry, cancelText: "取消", confirmText: i2.retry ? "重试" : "确定" });
- if (i2.retry && t3)
- return s4(...l2);
- }
- }
- const n3 = new te({ subject: f2, code: g2, message: m2, requestId: h2.requestId });
- throw n3.detail = h2.result, Y(j, { type: J, content: n3 }), n3;
- }
- return Y(j, { type: J, content: h2.result }), h2.result;
- }, interceptorName: "callObject", getCallbackArgs: function({ params: e3 } = {}) {
- return { objectName: t2, methodName: c2, params: e3 };
- } });
- } });
- };
- }
- function Fs(e2) {
- return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e2.config.spaceId));
- }
- async function Ks({ openid: e2, callLoginByWeixin: t2 = false } = {}) {
- Fs(this);
- throw new Error(`[SecureNetwork] API \`initSecureNetworkByWeixin\` is not supported on platform \`${C}\``);
- }
- async function js(e2) {
- const t2 = Fs(this);
- return t2.initPromise || (t2.initPromise = Ks.call(this, e2).then((e3) => e3).catch((e3) => {
- throw delete t2.initPromise, e3;
- })), t2.initPromise;
- }
- function $s(e2) {
- return function({ openid: t2, callLoginByWeixin: n2 = false } = {}) {
- return js.call(e2, { openid: t2, callLoginByWeixin: n2 });
- };
- }
- function Bs(e2) {
- !function(e3) {
- le = e3;
- }(e2);
- }
- function Ws(e2) {
- const t2 = { getSystemInfo: uni.getSystemInfo, getPushClientId: uni.getPushClientId };
- return function(n2) {
- return new Promise((s2, r2) => {
- t2[e2]({ ...n2, success(e3) {
- s2(e3);
- }, fail(e3) {
- r2(e3);
- } });
- });
- };
- }
- class Hs extends class {
- constructor() {
- this._callback = {};
- }
- addListener(e2, t2) {
- this._callback[e2] || (this._callback[e2] = []), this._callback[e2].push(t2);
- }
- on(e2, t2) {
- return this.addListener(e2, t2);
- }
- removeListener(e2, t2) {
- if (!t2)
- throw new Error('The "listener" argument must be of type function. Received undefined');
- const n2 = this._callback[e2];
- if (!n2)
- return;
- const s2 = function(e3, t3) {
- for (let n3 = e3.length - 1; n3 >= 0; n3--)
- if (e3[n3] === t3)
- return n3;
- return -1;
- }(n2, t2);
- n2.splice(s2, 1);
- }
- off(e2, t2) {
- return this.removeListener(e2, t2);
- }
- removeAllListener(e2) {
- delete this._callback[e2];
- }
- emit(e2, ...t2) {
- const n2 = this._callback[e2];
- if (n2)
- for (let e3 = 0; e3 < n2.length; e3++)
- n2[e3](...t2);
- }
- } {
- constructor() {
- super(), this._uniPushMessageCallback = this._receivePushMessage.bind(this), this._currentMessageId = -1, this._payloadQueue = [];
- }
- init() {
- return Promise.all([Ws("getSystemInfo")(), Ws("getPushClientId")()]).then(([{ appId: e2 } = {}, { cid: t2 } = {}] = []) => {
- if (!e2)
- throw new Error("Invalid appId, please check the manifest.json file");
- if (!t2)
- throw new Error("Invalid push client id");
- this._appId = e2, this._pushClientId = t2, this._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), this.emit("open"), this._initMessageListener();
- }, (e2) => {
- throw this.emit("error", e2), this.close(), e2;
- });
- }
- async open() {
- return this.init();
- }
- _isUniCloudSSE(e2) {
- if ("receive" !== e2.type)
- return false;
- const t2 = e2 && e2.data && e2.data.payload;
- return !(!t2 || "UNI_CLOUD_SSE" !== t2.channel || t2.seqId !== this._seqId);
- }
- _receivePushMessage(e2) {
- if (!this._isUniCloudSSE(e2))
- return;
- const t2 = e2 && e2.data && e2.data.payload, { action: n2, messageId: s2, message: r2 } = t2;
- this._payloadQueue.push({ action: n2, messageId: s2, message: r2 }), this._consumMessage();
- }
- _consumMessage() {
- for (; ; ) {
- const e2 = this._payloadQueue.find((e3) => e3.messageId === this._currentMessageId + 1);
- if (!e2)
- break;
- this._currentMessageId++, this._parseMessagePayload(e2);
- }
- }
- _parseMessagePayload(e2) {
- const { action: t2, messageId: n2, message: s2 } = e2;
- "end" === t2 ? this._end({ messageId: n2, message: s2 }) : "message" === t2 && this._appendMessage({ messageId: n2, message: s2 });
- }
- _appendMessage({ messageId: e2, message: t2 } = {}) {
- this.emit("message", t2);
- }
- _end({ messageId: e2, message: t2 } = {}) {
- this.emit("end", t2), this.close();
- }
- _initMessageListener() {
- uni.onPushMessage(this._uniPushMessageCallback);
- }
- _destroy() {
- uni.offPushMessage(this._uniPushMessageCallback);
- }
- toJSON() {
- return { appId: this._appId, pushClientId: this._pushClientId, seqId: this._seqId };
- }
- close() {
- this._destroy(), this.emit("close");
- }
- }
- async function Js(e2) {
- {
- const { osName: e3, osVersion: t3 } = ce();
- "ios" === e3 && function(e4) {
- if (!e4 || "string" != typeof e4)
- return 0;
- const t4 = e4.match(/^(\d+)./);
- return t4 && t4[1] ? parseInt(t4[1]) : 0;
- }(t3) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发期间需要,发行后不需要)");
- }
- const t2 = e2.__dev__;
- if (!t2.debugInfo)
- return;
- const { address: n2, servePort: s2 } = t2.debugInfo, { address: r2 } = await At(n2, s2);
- if (r2)
- return t2.localAddress = r2, void (t2.localPort = s2);
- const i2 = console["error"];
- let o2 = "";
- if ("remote" === t2.debugInfo.initialLaunchType ? (t2.debugInfo.forceRemote = true, o2 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o2 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o2 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", 0 === C.indexOf("mp-") && (o2 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t2.debugInfo.forceRemote)
- throw new Error(o2);
- i2(o2);
- }
- function zs(e2) {
- e2._initPromiseHub || (e2._initPromiseHub = new v({ createPromise: function() {
- let t2 = Promise.resolve();
- var n2;
- n2 = 1, t2 = new Promise((e3) => {
- setTimeout(() => {
- e3();
- }, n2);
- });
- const s2 = e2.auth();
- return t2.then(() => s2.getLoginState()).then((e3) => e3 ? Promise.resolve() : s2.signInAnonymously());
- } }));
- }
- const Vs = { tcb: bt, tencent: bt, aliyun: fe, private: Tt, dcloud: Tt, alipay: qt };
- let Gs = new class {
- init(e2) {
- let t2 = {};
- const n2 = Vs[e2.provider];
- if (!n2)
- throw new Error("未提供正确的provider参数");
- t2 = n2.init(e2), function(e3) {
- const t3 = {};
- e3.__dev__ = t3, t3.debugLog = "app" === C;
- const n3 = P;
- n3 && !n3.code && (t3.debugInfo = n3);
- const s2 = new v({ createPromise: function() {
- return Js(e3);
- } });
- t3.initLocalNetwork = function() {
- return s2.exec();
- };
- }(t2), zs(t2), Jn(t2), function(e3) {
- const t3 = e3.uploadFile;
- e3.uploadFile = function(e4) {
- return t3.call(this, e4);
- };
- }(t2), function(e3) {
- e3.database = function(t3) {
- if (t3 && Object.keys(t3).length > 0)
- return e3.init(t3).database();
- if (this._database)
- return this._database;
- const n3 = ss(rs, { uniClient: e3 });
- return this._database = n3, n3;
- }, e3.databaseForJQL = function(t3) {
- if (t3 && Object.keys(t3).length > 0)
- return e3.init(t3).databaseForJQL();
- if (this._databaseForJQL)
- return this._databaseForJQL;
- const n3 = ss(rs, { uniClient: e3, isJQL: true });
- return this._databaseForJQL = n3, n3;
- };
- }(t2), function(e3) {
- e3.getCurrentUserInfo = Rs, e3.chooseAndUploadFile = Ns.initChooseAndUploadFile(e3), Object.assign(e3, { get mixinDatacom() {
- return Ms(e3);
- } }), e3.SSEChannel = Hs, e3.initSecureNetworkByWeixin = $s(e3), e3.setCustomClientInfo = Bs, e3.importObject = qs(e3);
- }(t2);
- return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach((e3) => {
- if (!t2[e3])
- return;
- const n3 = t2[e3];
- t2[e3] = function() {
- return n3.apply(t2, Array.from(arguments));
- }, t2[e3] = (/* @__PURE__ */ function(e4, t3) {
- return function(n4) {
- let s2 = false;
- if ("callFunction" === t3) {
- const e5 = n4 && n4.type || c;
- s2 = e5 !== c;
- }
- const r2 = "callFunction" === t3 && !s2, i2 = this._initPromiseHub.exec();
- n4 = n4 || {};
- const { success: o2, fail: a2, complete: u2 } = ee(n4), l2 = i2.then(() => s2 ? Promise.resolve() : M(q(t3, "invoke"), n4)).then(() => e4.call(this, n4)).then((e5) => s2 ? Promise.resolve(e5) : M(q(t3, "success"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (r2 && Y(j, { type: H, content: e5 }), Promise.resolve(e5))), (e5) => s2 ? Promise.reject(e5) : M(q(t3, "fail"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (Y(j, { type: H, content: e5 }), Promise.reject(e5))));
- if (!(o2 || a2 || u2))
- return l2;
- l2.then((e5) => {
- o2 && o2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
- }, (e5) => {
- a2 && a2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
- });
- };
- }(t2[e3], e3)).bind(t2);
- }), t2.init = this.init, t2;
- }
- }();
- (() => {
- const e2 = T;
- let t2 = {};
- if (e2 && 1 === e2.length)
- t2 = e2[0], Gs = Gs.init(t2), Gs._isDefault = true;
- else {
- const t3 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
- let n2;
- n2 = e2 && e2.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : "应用未关联服务空间,请在uniCloud目录右键关联服务空间", t3.forEach((e3) => {
- Gs[e3] = function() {
- return console.error(n2), Promise.reject(new te({ code: "SYS_ERR", message: n2 }));
- };
- });
- }
- Object.assign(Gs, { get mixinDatacom() {
- return Ms(Gs);
- } }), xs(Gs), Gs.addInterceptor = N, Gs.removeInterceptor = D, Gs.interceptObject = F;
- })();
- var Ys = Gs;
- const ERR_MSG_OK = "chooseAndUploadFile:ok";
- const ERR_MSG_FAIL = "chooseAndUploadFile:fail";
- function chooseImage(opts) {
- const {
- count,
- sizeType = ["original", "compressed"],
- sourceType = ["album", "camera"],
- extension
- } = opts;
- return new Promise((resolve, reject) => {
- uni.chooseImage({
- count,
- sizeType,
- sourceType,
- extension,
- success(res) {
- resolve(normalizeChooseAndUploadFileRes(res, "image"));
- },
- fail(res) {
- reject({
- errMsg: res.errMsg.replace("chooseImage:fail", ERR_MSG_FAIL)
- });
- }
- });
- });
- }
- function chooseVideo(opts) {
- const { camera, compressed, maxDuration, sourceType = ["album", "camera"], extension } = opts;
- return new Promise((resolve, reject) => {
- uni.chooseVideo({
- camera,
- compressed,
- maxDuration,
- sourceType,
- extension,
- success(res) {
- const { tempFilePath, duration: duration2, size, height, width } = res;
- resolve(
- normalizeChooseAndUploadFileRes(
- {
- errMsg: "chooseVideo:ok",
- tempFilePaths: [tempFilePath],
- tempFiles: [
- {
- name: res.tempFile && res.tempFile.name || "",
- path: tempFilePath,
- size,
- type: res.tempFile && res.tempFile.type || "",
- width,
- height,
- duration: duration2,
- fileType: "video",
- cloudPath: ""
- }
- ]
- },
- "video"
- )
- );
- },
- fail(res) {
- reject({
- errMsg: res.errMsg.replace("chooseVideo:fail", ERR_MSG_FAIL)
- });
- }
- });
- });
- }
- function chooseAll(opts) {
- const { count, extension } = opts;
- return new Promise((resolve, reject) => {
- let chooseFile = uni.chooseFile;
- if (typeof wx !== "undefined" && typeof wx.chooseMessageFile === "function") {
- chooseFile = wx.chooseMessageFile;
- }
- if (typeof chooseFile !== "function") {
- return reject({
- errMsg: ERR_MSG_FAIL + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
- });
- }
- chooseFile({
- type: "all",
- count,
- extension,
- success(res) {
- resolve(normalizeChooseAndUploadFileRes(res));
- },
- fail(res) {
- reject({
- errMsg: res.errMsg.replace("chooseFile:fail", ERR_MSG_FAIL)
- });
- }
- });
- });
- }
- function normalizeChooseAndUploadFileRes(res, fileType) {
- res.tempFiles.forEach((item, index2) => {
- if (!item.name) {
- item.name = item.path.substring(item.path.lastIndexOf("/") + 1);
- }
- if (fileType) {
- item.fileType = fileType;
- }
- item.cloudPath = Date.now() + "_" + index2 + item.name.substring(item.name.lastIndexOf("."));
- });
- if (!res.tempFilePaths) {
- res.tempFilePaths = res.tempFiles.map((file) => file.path);
- }
- return res;
- }
- function uploadCloudFiles(files2, max = 5, onUploadProgress) {
- files2 = JSON.parse(JSON.stringify(files2));
- const len = files2.length;
- let count = 0;
- let self2 = this;
- return new Promise((resolve) => {
- while (count < max) {
- next();
- }
- function next() {
- let cur = count++;
- if (cur >= len) {
- !files2.find((item) => !item.url && !item.errMsg) && resolve(files2);
- return;
- }
- const fileItem = files2[cur];
- const index2 = self2.files.findIndex((v2) => v2.uuid === fileItem.uuid);
- fileItem.url = "";
- delete fileItem.errMsg;
- Ys.uploadFile({
- filePath: fileItem.path,
- cloudPath: fileItem.cloudPath,
- fileType: fileItem.fileType,
- onUploadProgress: (res) => {
- res.index = index2;
- onUploadProgress && onUploadProgress(res);
- }
- }).then((res) => {
- fileItem.url = res.fileID;
- fileItem.index = index2;
- if (cur < len) {
- next();
- }
- }).catch((res) => {
- fileItem.errMsg = res.errMsg || res.message;
- fileItem.index = index2;
- if (cur < len) {
- next();
- }
- });
- }
- });
- }
- function uploadFiles(choosePromise, { onChooseFile, onUploadProgress }) {
- return choosePromise.then((res) => {
- if (onChooseFile) {
- const customChooseRes = onChooseFile(res);
- if (typeof customChooseRes !== "undefined") {
- return Promise.resolve(customChooseRes).then(
- (chooseRes) => typeof chooseRes === "undefined" ? res : chooseRes
- );
- }
- }
- return res;
- }).then((res) => {
- if (res === false) {
- return {
- errMsg: ERR_MSG_OK,
- tempFilePaths: [],
- tempFiles: []
- };
- }
- return res;
- }).then(async (files2) => {
- for (let file of files2.tempFiles) {
- const { data } = await FileApi.uploadFile(file.path);
- file.url = data;
- }
- return files2;
- });
- }
- function chooseAndUploadFile(opts = {
- type: "all"
- }) {
- if (opts.type === "image") {
- return uploadFiles(chooseImage(opts), opts);
- } else if (opts.type === "video") {
- return uploadFiles(chooseVideo(opts), opts);
- }
- return uploadFiles(chooseAll(opts), opts);
- }
- const get_file_ext = (name2) => {
- const last_len = name2.lastIndexOf(".");
- const len = name2.length;
- return {
- name: name2.substring(0, last_len),
- ext: name2.substring(last_len + 1, len)
- };
- };
- const get_extname = (fileExtname) => {
- if (!Array.isArray(fileExtname)) {
- let extname = fileExtname.replace(/(\[|\])/g, "");
- return extname.split(",");
- } else {
- return fileExtname;
- }
- };
- const get_files_and_is_max = (res, _extname) => {
- let filePaths = [];
- let files2 = [];
- if (!_extname || _extname.length === 0) {
- return {
- filePaths,
- files: files2
- };
- }
- res.tempFiles.forEach((v2) => {
- let fileFullName = get_file_ext(v2.name);
- const extname = fileFullName.ext.toLowerCase();
- if (_extname.indexOf(extname) !== -1) {
- files2.push(v2);
- filePaths.push(v2.path);
- }
- });
- if (files2.length !== res.tempFiles.length) {
- uni.showToast({
- title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files2.length} 个文件格式不正确`,
- icon: "none",
- duration: 5e3
- });
- }
- return {
- filePaths,
- files: files2
- };
- };
- const get_file_info = (filepath) => {
- return new Promise((resolve, reject) => {
- uni.getImageInfo({
- src: filepath,
- success(res) {
- resolve(res);
- },
- fail(err) {
- reject(err);
- }
- });
- });
- };
- const get_file_data = async (files2, type = "image") => {
- let fileFullName = get_file_ext(files2.name);
- const extname = fileFullName.ext.toLowerCase();
- let filedata = {
- name: files2.name,
- uuid: files2.uuid,
- extname: extname || "",
- cloudPath: files2.cloudPath,
- fileType: files2.fileType,
- url: files2.path || files2.path,
- size: files2.size,
- //单位是字节
- image: {},
- path: files2.path,
- video: {}
- };
- if (type === "image") {
- const imageinfo = await get_file_info(files2.path);
- delete filedata.video;
- filedata.image.width = imageinfo.width;
- filedata.image.height = imageinfo.height;
- filedata.image.location = imageinfo.path;
- } else {
- delete filedata.image;
- }
- return filedata;
- };
- const _sfc_main$1D = {
- name: "uploadImage",
- emits: ["uploadFiles", "choose", "delFile"],
- props: {
- filesList: {
- type: [Array, String],
- default() {
- return [];
- }
- },
- disabled: {
- type: Boolean,
- default: false
- },
- disablePreview: {
- type: Boolean,
- default: false
- },
- limit: {
- type: [Number, String],
- default: 9
- },
- imageStyles: {
- type: Object,
- default() {
- return {
- width: "auto",
- height: "auto",
- border: {}
- };
- }
- },
- delIcon: {
- type: Boolean,
- default: true
- },
- readonly: {
- type: Boolean,
- default: false
- }
- },
- computed: {
- list() {
- if (typeof this.filesList === "string") {
- if (this.filesList) {
- return [this.filesList];
- } else {
- return [];
- }
- }
- return this.filesList;
- },
- styles() {
- let styles = {
- width: "auto",
- height: "auto",
- border: {}
- };
- return Object.assign(styles, this.imageStyles);
- },
- boxStyle() {
- const { width = "auto", height = "auto" } = this.styles;
- let obj = {};
- if (height === "auto") {
- if (width !== "auto") {
- obj.height = this.value2px(width);
- obj["padding-top"] = 0;
- } else {
- obj.height = 0;
- }
- } else {
- obj.height = this.value2px(height);
- obj["padding-top"] = 0;
- }
- if (width === "auto") {
- if (height !== "auto") {
- obj.width = this.value2px(height);
- } else {
- obj.width = "33.3%";
- }
- } else {
- obj.width = this.value2px(width);
- }
- let classles = "";
- for (let i2 in obj) {
- classles += `${i2}:${obj[i2]};`;
- }
- return classles;
- },
- borderStyle() {
- let { border } = this.styles;
- let obj = {};
- const widthDefaultValue = 1;
- const radiusDefaultValue = 3;
- if (typeof border === "boolean") {
- obj.border = border ? "1px #eee solid" : "none";
- } else {
- let width = border && border.width || widthDefaultValue;
- width = this.value2px(width);
- let radius = border && border.radius || radiusDefaultValue;
- radius = this.value2px(radius);
- obj = {
- "border-width": width,
- "border-style": border && border.style || "solid",
- "border-color": border && border.color || "#eee",
- "border-radius": radius
- };
- }
- let classles = "";
- for (let i2 in obj) {
- classles += `${i2}:${obj[i2]};`;
- }
- return classles;
- }
- },
- methods: {
- getImageUrl(url2) {
- if ("blob:http:" === url2.substr(0, 10)) {
- return url2;
- } else {
- return sheep$1.$url.cdn(url2);
- }
- },
- uploadFiles(item, index2) {
- this.$emit("uploadFiles", item);
- },
- choose() {
- this.$emit("choose");
- },
- delFile(index2) {
- this.$emit("delFile", index2);
- },
- previewImage(img, index2) {
- let urls = [];
- if (Number(this.limit) === 1 && this.disablePreview && !this.disabled) {
- this.$emit("choose");
- }
- if (this.disablePreview)
- return;
- this.list.forEach((i2) => {
- urls.push(this.getImageUrl(i2));
- });
- uni.previewImage({
- urls,
- current: index2
- });
- },
- value2px(value) {
- if (typeof value === "number") {
- value += "px";
- } else {
- if (value.indexOf("%") === -1) {
- value = value.indexOf("px") !== -1 ? value : value + "px";
- }
- }
- return value;
- }
- }
- };
- function _sfc_render$1C(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-file-picker__container" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.list, (url2, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "file-picker__box",
- key: index2,
- style: vue.normalizeStyle($options.boxStyle)
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "file-picker__box-content",
- style: vue.normalizeStyle($options.borderStyle)
- },
- [
- vue.createElementVNode("image", {
- class: "file-image",
- src: $options.getImageUrl(url2),
- mode: "aspectFill",
- onClick: vue.withModifiers(($event) => $options.previewImage(url2, index2), ["stop"])
- }, null, 8, ["src", "onClick"]),
- $props.delIcon && !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "icon-del-box",
- onClick: vue.withModifiers(($event) => $options.delFile(index2), ["stop"])
- }, [
- vue.createElementVNode("view", { class: "icon-del" }),
- vue.createElementVNode("view", { class: "icon-del rotate" })
- ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(' <view v-if="item.errMsg" class="file-picker__mask" @click.stop="uploadFiles(item, index)">\n 点击重试\n </view> ')
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- $options.list.length < $props.limit && !$props.readonly ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "file-picker__box",
- style: vue.normalizeStyle($options.boxStyle)
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "file-picker__box-content is-add",
- style: vue.normalizeStyle($options.borderStyle),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.choose && $options.choose(...args))
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode("view", { class: "icon-add" }),
- vue.createElementVNode("view", { class: "icon-add rotate" })
- ], true)
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const uploadImage = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["render", _sfc_render$1C], ["__scopeId", "data-v-6bf78572"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-uploader/upload-image.vue"]]);
- const _sfc_main$1C = {
- name: "uploadFile",
- emits: ["uploadFiles", "choose", "delFile"],
- props: {
- filesList: {
- type: Array,
- default() {
- return [];
- }
- },
- delIcon: {
- type: Boolean,
- default: true
- },
- limit: {
- type: [Number, String],
- default: 9
- },
- showType: {
- type: String,
- default: ""
- },
- listStyles: {
- type: Object,
- default() {
- return {
- // 是否显示边框
- border: true,
- // 是否显示分隔线
- dividline: true,
- // 线条样式
- borderStyle: {}
- };
- }
- },
- readonly: {
- type: Boolean,
- default: false
- }
- },
- computed: {
- list() {
- let files2 = [];
- this.filesList.forEach((v2) => {
- files2.push(v2);
- });
- return files2;
- },
- styles() {
- let styles = {
- border: true,
- dividline: true,
- "border-style": {}
- };
- return Object.assign(styles, this.listStyles);
- },
- borderStyle() {
- let { borderStyle, border } = this.styles;
- let obj = {};
- if (!border) {
- obj.border = "none";
- } else {
- let width = borderStyle && borderStyle.width || 1;
- width = this.value2px(width);
- let radius = borderStyle && borderStyle.radius || 5;
- radius = this.value2px(radius);
- obj = {
- "border-width": width,
- "border-style": borderStyle && borderStyle.style || "solid",
- "border-color": borderStyle && borderStyle.color || "#eee",
- "border-radius": radius
- };
- }
- let classles = "";
- for (let i2 in obj) {
- classles += `${i2}:${obj[i2]};`;
- }
- return classles;
- },
- borderLineStyle() {
- let obj = {};
- let { borderStyle } = this.styles;
- if (borderStyle && borderStyle.color) {
- obj["border-color"] = borderStyle.color;
- }
- if (borderStyle && borderStyle.width) {
- let width = borderStyle && borderStyle.width || 1;
- let style = borderStyle && borderStyle.style || 0;
- if (typeof width === "number") {
- width += "px";
- } else {
- width = width.indexOf("px") ? width : width + "px";
- }
- obj["border-width"] = width;
- if (typeof style === "number") {
- style += "px";
- } else {
- style = style.indexOf("px") ? style : style + "px";
- }
- obj["border-top-style"] = style;
- }
- let classles = "";
- for (let i2 in obj) {
- classles += `${i2}:${obj[i2]};`;
- }
- return classles;
- }
- },
- methods: {
- uploadFiles(item, index2) {
- this.$emit("uploadFiles", {
- item,
- index: index2
- });
- },
- choose() {
- this.$emit("choose");
- },
- delFile(index2) {
- this.$emit("delFile", index2);
- },
- value2px(value) {
- if (typeof value === "number") {
- value += "px";
- } else {
- value = value.indexOf("px") !== -1 ? value : value + "px";
- }
- return value;
- }
- }
- };
- function _sfc_render$1B(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-file-picker__files" }, [
- !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "files-button",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.choose && $options.choose(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(` :class="{'is-text-box':showType === 'list'}" `),
- $options.list.length > 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "uni-file-picker__lists is-text-box",
- style: vue.normalizeStyle($options.borderStyle)
- },
- [
- vue.createCommentVNode(" ,'is-list-card':showType === 'list-card' "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uni-file-picker__lists-box", {
- "files-border": index2 !== 0 && $options.styles.dividline
- }]),
- key: index2,
- style: vue.normalizeStyle(index2 !== 0 && $options.styles.dividline && $options.borderLineStyle)
- },
- [
- vue.createElementVNode("view", { class: "uni-file-picker__item" }, [
- vue.createCommentVNode(` :class="{'is-text-image':showType === 'list'}" `),
- vue.createCommentVNode(' <view class="files__image is-text-image">\n <image class="header-image" :src="item.logo" mode="aspectFit"></image>\n </view> '),
- vue.createElementVNode(
- "view",
- { class: "files__name" },
- vue.toDisplayString(item.name),
- 1
- /* TEXT */
- ),
- $props.delIcon && !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "icon-del-box icon-files",
- onClick: ($event) => $options.delFile(index2)
- }, [
- vue.createElementVNode("view", { class: "icon-del icon-files" }),
- vue.createElementVNode("view", { class: "icon-del rotate" })
- ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ]),
- item.progress && item.progress !== 100 || item.progress === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "file-picker__progress"
- }, [
- vue.createElementVNode("progress", {
- class: "file-picker__progress-item",
- percent: item.progress === -1 ? 0 : item.progress,
- "stroke-width": "4",
- backgroundColor: item.errMsg ? "#ff5a5f" : "#EBEBEB"
- }, null, 8, ["percent", "backgroundColor"])
- ])) : vue.createCommentVNode("v-if", true),
- item.status === "error" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "file-picker__mask",
- onClick: vue.withModifiers(($event) => $options.uploadFiles(item, index2), ["stop"])
- }, " 点击重试 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const uploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["render", _sfc_render$1B], ["__scopeId", "data-v-1daeb5aa"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-uploader/upload-file.vue"]]);
- const _sfc_main$1B = {
- name: "sUploader",
- components: {
- uploadImage,
- uploadFile
- },
- options: {
- virtualHost: true
- },
- emits: ["select", "success", "fail", "progress", "delete", "update:modelValue", "update:url"],
- props: {
- modelValue: {
- type: [Array, Object],
- default() {
- return [];
- }
- },
- url: {
- type: [Array, String],
- default() {
- return [];
- }
- },
- disabled: {
- type: Boolean,
- default: false
- },
- disablePreview: {
- type: Boolean,
- default: false
- },
- delIcon: {
- type: Boolean,
- default: true
- },
- // 自动上传
- autoUpload: {
- type: Boolean,
- default: true
- },
- // 最大选择个数 ,h5只能限制单选或是多选
- limit: {
- type: [Number, String],
- default: 9
- },
- // 列表样式 grid | list | list-card
- mode: {
- type: String,
- default: "grid"
- },
- // 选择文件类型 image/video/all
- fileMediatype: {
- type: String,
- default: "image"
- },
- // 文件类型筛选
- fileExtname: {
- type: [Array, String],
- default() {
- return [];
- }
- },
- title: {
- type: String,
- default: ""
- },
- listStyles: {
- type: Object,
- default() {
- return {
- // 是否显示边框
- border: true,
- // 是否显示分隔线
- dividline: true,
- // 线条样式
- borderStyle: {}
- };
- }
- },
- imageStyles: {
- type: Object,
- default() {
- return {
- width: "auto",
- height: "auto"
- };
- }
- },
- readonly: {
- type: Boolean,
- default: false
- },
- sizeType: {
- type: Array,
- default() {
- return ["original", "compressed"];
- }
- },
- driver: {
- type: String,
- default: "local"
- // local=本地 | oss | unicloud
- },
- subtitle: {
- type: String,
- default: ""
- }
- },
- data() {
- return {
- files: [],
- localValue: [],
- imgsrc: sheep$1.$url.static("/static/images/add.png")
- };
- },
- watch: {
- modelValue: {
- handler(newVal, oldVal) {
- this.setValue(newVal, oldVal);
- },
- immediate: true
- },
- url: {
- handler(newUrl) {
- this.updateFilesFromUrl(newUrl);
- },
- immediate: true
- }
- },
- computed: {
- returnType() {
- if (this.limit > 1) {
- return "array";
- }
- return "object";
- },
- filesList() {
- let files2 = [];
- this.files.forEach((v2) => {
- files2.push(v2);
- });
- return files2;
- },
- showType() {
- if (this.fileMediatype === "image") {
- return this.mode;
- }
- return "list";
- },
- limitLength() {
- if (this.returnType === "object") {
- return 1;
- }
- if (!this.limit) {
- return 1;
- }
- if (this.limit >= 9) {
- return 9;
- }
- return this.limit;
- }
- },
- created() {
- if (this.driver === "local") {
- Ys.chooseAndUploadFile = chooseAndUploadFile;
- }
- this.form = this.getForm("uniForms");
- this.formItem = this.getForm("uniFormsItem");
- if (this.form && this.formItem) {
- if (this.formItem.name) {
- this.rename = this.formItem.name;
- this.form.inputChildrens.push(this);
- }
- }
- },
- methods: {
- updateFilesFromUrl(newUrl) {
- if (Array.isArray(newUrl)) {
- this.files = newUrl.map((url2) => ({
- url: url2,
- status: "success"
- }));
- } else {
- this.files = newUrl ? [{ url: newUrl, status: "success" }] : [];
- }
- },
- /**
- * 公开用户使用,清空文件
- * @param {Object} index
- */
- clearFiles(index2) {
- if (index2 !== 0 && !index2) {
- this.files = [];
- this.$nextTick(() => {
- this.setEmit();
- });
- } else {
- this.files.splice(index2, 1);
- }
- this.$nextTick(() => {
- this.setEmit();
- });
- },
- /**
- * 公开用户使用,继续上传
- */
- upload() {
- let files2 = [];
- this.files.forEach((v2, index2) => {
- if (v2.status === "ready" || v2.status === "error") {
- files2.push(Object.assign({}, v2));
- }
- });
- return this.uploadFiles(files2);
- },
- async setValue(newVal, oldVal) {
- const newData = async (v2) => {
- const reg = /cloud:\/\/([\w.]+\/?)\S*/;
- let url2 = "";
- if (v2.fileID) {
- url2 = v2.fileID;
- } else {
- url2 = v2.url;
- }
- if (reg.test(url2)) {
- v2.fileID = url2;
- v2.url = await this.getTempFileURL(url2);
- }
- if (v2.url)
- v2.path = v2.url;
- return v2;
- };
- if (this.returnType === "object") {
- if (newVal) {
- await newData(newVal);
- } else {
- newVal = {};
- }
- } else {
- if (!newVal)
- newVal = [];
- for (let i2 = 0; i2 < newVal.length; i2++) {
- let v2 = newVal[i2];
- await newData(v2);
- }
- }
- this.localValue = newVal;
- if (this.form && this.formItem && !this.is_reset) {
- this.is_reset = false;
- this.formItem.setValue(this.localValue);
- }
- let filesData = Object.keys(newVal).length > 0 ? newVal : [];
- this.files = [].concat(filesData);
- this.updateFilesFromUrl(this.url);
- },
- /**
- * 选择文件
- */
- choose() {
- if (this.disabled)
- return;
- if (this.files.length >= Number(this.limitLength) && this.showType !== "grid" && this.returnType === "array") {
- uni.showToast({
- title: `您最多选择 ${this.limitLength} 个文件`,
- icon: "none"
- });
- return;
- }
- this.chooseFiles();
- },
- /**
- * 选择文件并上传
- */
- chooseFiles() {
- const _extname = get_extname(this.fileExtname);
- Ys.chooseAndUploadFile({
- type: this.fileMediatype,
- compressed: false,
- sizeType: this.sizeType,
- // TODO 如果为空,video 有问题
- extension: _extname.length > 0 ? _extname : void 0,
- count: this.limitLength - this.files.length,
- //默认9
- onChooseFile: this.chooseFileCallback,
- onUploadProgress: (progressEvent) => {
- this.setProgress(progressEvent, progressEvent.index);
- }
- }).then((result2) => {
- this.setSuccessAndError(result2.tempFiles);
- }).catch((err) => {
- formatAppLog("log", "at sheep/components/s-uploader/s-uploader.vue:392", "选择失败", err);
- });
- },
- /**
- * 选择文件回调
- * @param {Object} res
- */
- async chooseFileCallback(res) {
- const _extname = get_extname(this.fileExtname);
- const is_one = Number(this.limitLength) === 1 && this.disablePreview && !this.disabled || this.returnType === "object";
- if (is_one) {
- this.files = [];
- }
- let { filePaths, files: files2 } = get_files_and_is_max(res, _extname);
- if (!(_extname && _extname.length > 0)) {
- filePaths = res.tempFilePaths;
- files2 = res.tempFiles;
- }
- let currentData = [];
- for (let i2 = 0; i2 < files2.length; i2++) {
- if (this.limitLength - this.files.length <= 0)
- break;
- files2[i2].uuid = Date.now();
- let filedata = await get_file_data(files2[i2], this.fileMediatype);
- filedata.progress = 0;
- filedata.status = "ready";
- this.files.push(filedata);
- currentData.push({
- ...filedata,
- file: files2[i2]
- });
- }
- this.$emit("select", {
- tempFiles: currentData,
- tempFilePaths: filePaths
- });
- res.tempFiles = files2;
- if (!this.autoUpload) {
- res.tempFiles = [];
- }
- },
- /**
- * 批传
- * @param {Object} e
- */
- uploadFiles(files2) {
- files2 = [].concat(files2);
- return uploadCloudFiles.call(this, files2, 5, (res) => {
- this.setProgress(res, res.index, true);
- }).then((result2) => {
- this.setSuccessAndError(result2);
- return result2;
- }).catch((err) => {
- formatAppLog("log", "at sheep/components/s-uploader/s-uploader.vue:455", err);
- });
- },
- /**
- * 成功或失败
- */
- async setSuccessAndError(res, fn) {
- let successData = [];
- let errorData = [];
- let tempFilePath = [];
- let errorTempFilePath = [];
- for (let i2 = 0; i2 < res.length; i2++) {
- const item = res[i2];
- const index2 = item.uuid ? this.files.findIndex((p2) => p2.uuid === item.uuid) : item.index;
- if (index2 === -1 || !this.files)
- break;
- if (item.errMsg === "request:fail") {
- this.files[index2].url = item.path;
- this.files[index2].status = "error";
- this.files[index2].errMsg = item.errMsg;
- errorData.push(this.files[index2]);
- errorTempFilePath.push(this.files[index2].url);
- } else {
- this.files[index2].errMsg = "";
- this.files[index2].fileID = item.url;
- const reg = /cloud:\/\/([\w.]+\/?)\S*/;
- if (reg.test(item.url)) {
- this.files[index2].url = await this.getTempFileURL(item.url);
- } else {
- this.files[index2].url = item.url;
- }
- this.files[index2].status = "success";
- this.files[index2].progress += 1;
- successData.push(this.files[index2]);
- tempFilePath.push(this.files[index2].fileID);
- }
- }
- if (successData.length > 0) {
- this.setEmit();
- this.$emit("success", {
- tempFiles: this.backObject(successData),
- tempFilePaths: tempFilePath
- });
- }
- if (errorData.length > 0) {
- this.$emit("fail", {
- tempFiles: this.backObject(errorData),
- tempFilePaths: errorTempFilePath
- });
- }
- },
- /**
- * 获取进度
- * @param {Object} progressEvent
- * @param {Object} index
- * @param {Object} type
- */
- setProgress(progressEvent, index2, type) {
- this.files.length;
- const percentCompleted = Math.round(progressEvent.loaded * 100 / progressEvent.total);
- let idx = index2;
- if (!type) {
- idx = this.files.findIndex((p2) => p2.uuid === progressEvent.tempFile.uuid);
- }
- if (idx === -1 || !this.files[idx])
- return;
- this.files[idx].progress = percentCompleted - 1;
- this.$emit("progress", {
- index: idx,
- progress: parseInt(percentCompleted),
- tempFile: this.files[idx]
- });
- },
- /**
- * 删除文件
- * @param {Object} index
- */
- delFile(index2) {
- formatAppLog("log", "at sheep/components/s-uploader/s-uploader.vue:543", this.files);
- this.$emit("delete", {
- tempFile: this.files[index2],
- tempFilePath: this.files[index2].url
- });
- this.files.splice(index2, 1);
- this.$nextTick(() => {
- this.setEmit();
- });
- },
- /**
- * 获取文件名和后缀
- * @param {Object} name
- */
- getFileExt(name2) {
- const last_len = name2.lastIndexOf(".");
- const len = name2.length;
- return {
- name: name2.substring(0, last_len),
- ext: name2.substring(last_len + 1, len)
- };
- },
- /**
- * 处理返回事件
- */
- setEmit() {
- let data = [];
- let updateUrl = [];
- if (this.returnType === "object") {
- data = this.backObject(this.files)[0];
- this.localValue = data ? data : null;
- updateUrl = data ? data.url : "";
- } else {
- data = this.backObject(this.files);
- if (!this.localValue) {
- this.localValue = [];
- }
- this.localValue = [...data];
- if (this.localValue.length > 0) {
- this.localValue.forEach((item) => {
- updateUrl.push(item.url);
- });
- }
- }
- this.$emit("update:modelValue", this.localValue);
- this.$emit("update:url", updateUrl);
- },
- /**
- * 处理返回参数
- * @param {Object} files
- */
- backObject(files2) {
- let newFilesData = [];
- files2.forEach((v2) => {
- newFilesData.push({
- extname: v2.extname,
- fileType: v2.fileType,
- image: v2.image,
- name: v2.name,
- path: v2.path,
- size: v2.size,
- fileID: v2.fileID,
- url: v2.url
- });
- });
- return newFilesData;
- },
- async getTempFileURL(fileList) {
- fileList = {
- fileList: [].concat(fileList)
- };
- const urls = await Ys.getTempFileURL(fileList);
- return urls.fileList[0].tempFileURL || "";
- },
- /**
- * 获取父元素实例
- */
- getForm(name2 = "uniForms") {
- let parent2 = this.$parent;
- let parentName = parent2.$options.name;
- while (parentName !== name2) {
- parent2 = parent2.$parent;
- if (!parent2)
- return false;
- parentName = parent2.$options.name;
- }
- return parent2;
- }
- }
- };
- function _sfc_render$1A(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_upload_image = vue.resolveComponent("upload-image");
- const _component_upload_file = vue.resolveComponent("upload-file");
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-file-picker" }, [
- $props.title ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-file-picker__header"
- }, [
- vue.createElementVNode(
- "text",
- { class: "file-title" },
- vue.toDisplayString($props.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "file-count" },
- vue.toDisplayString($options.filesList.length) + "/" + vue.toDisplayString($options.limitLength),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- $props.subtitle ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "file-subtitle"
- }, [
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString($props.subtitle),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- $props.fileMediatype === "image" && $options.showType === "grid" ? (vue.openBlock(), vue.createBlock(_component_upload_image, {
- key: 2,
- readonly: $props.readonly,
- "image-styles": $props.imageStyles,
- "files-list": $props.url,
- limit: $options.limitLength,
- disablePreview: $props.disablePreview,
- delIcon: $props.delIcon,
- onUploadFiles: $options.uploadFiles,
- onChoose: $options.choose,
- onDelFile: $options.delFile
- }, {
- default: vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode("view", { class: "is-add" }, [
- vue.createElementVNode("image", {
- src: $data.imgsrc,
- class: "add-icon"
- }, null, 8, ["src"])
- ])
- ], true)
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["readonly", "image-styles", "files-list", "limit", "disablePreview", "delIcon", "onUploadFiles", "onChoose", "onDelFile"])) : vue.createCommentVNode("v-if", true),
- $props.fileMediatype !== "image" || $options.showType !== "grid" ? (vue.openBlock(), vue.createBlock(_component_upload_file, {
- key: 3,
- readonly: $props.readonly,
- "list-styles": $props.listStyles,
- "files-list": $options.filesList,
- showType: $options.showType,
- delIcon: $props.delIcon,
- onUploadFiles: $options.uploadFiles,
- onChoose: $options.choose,
- onDelFile: $options.delFile
- }, {
- default: vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode("button", {
- type: "primary",
- size: "mini"
- }, "选择文件")
- ], true)
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["readonly", "list-styles", "files-list", "showType", "delIcon", "onUploadFiles", "onChoose", "onDelFile"])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_3$4 = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["render", _sfc_render$1A], ["__scopeId", "data-v-82f430bc"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-uploader/s-uploader.vue"]]);
- const _sfc_main$1A = {
- __name: "add",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- orderInfo: {},
- commentList: [],
- id: null
- });
- async function onSubmit() {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("order.confirm_post_review"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- for (const comment of state.commentList) {
- await OrderApi.createOrderItemComment(comment);
- }
- sheep$1.$router.back();
- }
- });
- }
- onLoad(async (options2) => {
- if (!options2.id) {
- sheep$1.$helper.toast(t$6("order.missing_order_info"));
- return;
- }
- state.id = options2.id;
- const {
- code: code2,
- data
- } = await OrderApi.getOrder(state.id);
- if (code2 !== 0) {
- sheep$1.$helper.toast(t$6("order.no_reviews_pending"));
- return;
- }
- data.items.forEach((item) => {
- state.commentList.push({
- anonymous: false,
- orderItemId: item.id,
- descriptionScores: 5,
- benefitScores: 5,
- content: "",
- picUrls: []
- });
- });
- state.orderInfo = data;
- });
- const __returned__ = { state, onSubmit, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, get OrderApi() {
- return OrderApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1z(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_uni_rate = resolveEasycom(vue.resolveDynamicComponent("uni-rate"), __easycom_1$2);
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_s_uploader = resolveEasycom(vue.resolveDynamicComponent("s-uploader"), __easycom_3$4);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("order.review_order")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.orderInfo.items, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: item.id
- }, [
- vue.createElementVNode("view", null, [
- vue.createElementVNode("view", { class: "commont-from-wrap" }, [
- vue.createCommentVNode(" 评价商品 "),
- vue.createVNode(_component_s_goods_item, {
- img: item.picUrl,
- title: item.spuName,
- skuText: item.properties.map((property) => property.valueName).join(" "),
- price: item.payPrice,
- num: item.count
- }, null, 8, ["img", "title", "skuText", "price", "num"])
- ]),
- vue.createElementVNode("view", { class: "form-item" }, [
- vue.createCommentVNode(" 评分 "),
- vue.createElementVNode("view", { class: "star-box ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "star-title ss-m-r-40" },
- vue.toDisplayString($setup.t("order.product_quality")),
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_uni_rate, {
- modelValue: $setup.state.commentList[index2].descriptionScores,
- "onUpdate:modelValue": ($event) => $setup.state.commentList[index2].descriptionScores = $event
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
- ]),
- vue.createElementVNode("view", { class: "star-box ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "star-title ss-m-r-40" },
- vue.toDisplayString($setup.t("order.service_attitude")),
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_uni_rate, {
- modelValue: $setup.state.commentList[index2].benefitScores,
- "onUpdate:modelValue": ($event) => $setup.state.commentList[index2].benefitScores = $event
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
- ]),
- vue.createCommentVNode(" 评价 "),
- vue.createElementVNode("view", { class: "area-box" }, [
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- type: "textarea",
- maxlength: "120",
- autoHeight: "",
- modelValue: $setup.state.commentList[index2].content,
- "onUpdate:modelValue": ($event) => $setup.state.commentList[index2].content = $event,
- placeholder: $setup.t("order.meet_expectations")
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"]),
- vue.createCommentVNode(" TODO 非繁人:文件上传 "),
- vue.createElementVNode("view", { class: "img-box" }, [
- vue.createVNode(_component_s_uploader, {
- url: $setup.state.commentList[index2].picUrls,
- "onUpdate:url": ($event) => $setup.state.commentList[index2].picUrls = $event,
- fileMediatype: "image",
- limit: "9",
- mode: "grid",
- imageStyles: { width: "168rpx", height: "168rpx" }
- }, null, 8, ["url", "onUpdate:url"])
- ])
- ])
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createCommentVNode(" TODO 非繁人:是否匿名 "),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: ""
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "foot_box ss-flex ss-row-center ss-col-center" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button post-btn ui-BG-Main-Gradient ui-Shadow-Main",
- onClick: $setup.onSubmit
- },
- vue.toDisplayString($setup.t("common.post")),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesGoodsCommentAdd = /* @__PURE__ */ _export_sfc(_sfc_main$1A, [["render", _sfc_render$1z], ["__scopeId", "data-v-c66153cb"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/comment/add.vue"]]);
- const _sfc_main$1z = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- id: 0,
- // 商品 SPU 编号
- type: [
- { type: 0, name: t$6("common.all") },
- { type: 1, name: t$6("review.positive") },
- { type: 2, name: t$6("review.neutral") },
- { type: 3, name: t$6("review.negative") }
- ],
- currentTab: 0,
- // 选中的 TAB
- loadStatus: "",
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 10
- }
- });
- function onTabsChange(e2) {
- state.currentTab = e2.index;
- state.pagination.pageNo = 1;
- state.pagination.list = [];
- state.pagination.total = 0;
- getList();
- }
- async function getList() {
- state.loadStatus = "loading";
- let res = await CommentApi.getCommentPage(
- state.id,
- state.pagination.pageNo,
- state.pagination.pageSize,
- state.type[state.currentTab].type
- );
- if (res.code !== 0) {
- return;
- }
- formatAppLog("log", "at pages/goods/comment/list.vue:77", res);
- state.pagination.list = _$1.concat(state.pagination.list, res.data.list);
- state.pagination.total = res.data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getList();
- }
- onLoad((options2) => {
- state.id = options2.id;
- getList();
- });
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { state, onTabsChange, getList, loadMore, get CommentApi() {
- return CommentApi;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, reactive: vue.reactive, get _() {
- return _$1;
- }, commentItem, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1y(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("review.all_reviews")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_tabs, {
- list: $setup.state.type,
- scrollable: false,
- onChange: $setup.onTabsChange,
- current: $setup.state.currentTab
- }, null, 8, ["list", "current"]),
- vue.createCommentVNode(" 评论列表 "),
- vue.createElementVNode("view", { class: "ss-m-t-20" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "list-item",
- key: item
- }, [
- vue.createVNode($setup["commentItem"], { item }, null, 8, ["item"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- text: "暂无数据",
- icon: "/static/data-empty.png"
- })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 下拉 "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 1,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesGoodsCommentList = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["render", _sfc_render$1y], ["__scopeId", "data-v-0df9e865"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/goods/comment/list.vue"]]);
- const _sfc_main$1y = {
- __name: "detail",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "6b23c96c-headerBg": vue.unref(headerBg)
- }));
- const userInfo2 = sheep$1.$store("user").userInfo;
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const headerBg = sheep$1.$url.css("/static/images/order_bg.png");
- const state = vue.reactive({
- orderInfo: {},
- merchantTradeNo: "",
- // 商户订单号
- comeinType: ""
- // 进入订单详情的来源类型
- });
- const onCopy = () => {
- sheep$1.$helper.copyText(state.orderInfo.no);
- };
- function onPay(id) {
- sheep$1.$router.go("/pages/pay/index", {
- id,
- openType: 2,
- type: 1
- });
- }
- function onGoodsDetail(id) {
- sheep$1.$router.go("/pages/goods/index", {
- id
- });
- }
- async function onCancel(orderId) {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("order.confirm_cancel_order"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await OrderApi.cancelOrder(orderId);
- if (code2 === 0) {
- await getOrderDetail(orderId);
- }
- }
- });
- }
- async function onExpress(id) {
- sheep$1.$router.go("/pages/order/express/log", {
- id
- });
- }
- async function onConfirm(orderId, ignore = false) {
- let isOpenBusinessView = true;
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("order.confirm_receipt_question"),
- success: async function(res) {
- if (res.confirm) {
- if (sheep$1.$platform.name === "WechatMiniProgram" && !lodashExports.isEmpty(state.orderInfo.wechat_extra_data) && isOpenBusinessView && !ignore) {
- mpConfirm(orderId);
- return;
- }
- const {
- code: code2
- } = await OrderApi.receiveOrder(orderId);
- if (code2 === 0) {
- await getOrderDetail(orderId);
- }
- }
- }
- });
- }
- function onComment(id) {
- sheep$1.$router.go("/pages/goods/comment/add", {
- id
- });
- }
- function onApply(id) {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("order.confirm_cancel_request"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await AfterSaleApi.cancelAfterSale(id);
- if (code2 === 0) {
- await getOrderDetail(id);
- }
- }
- });
- }
- async function getOrderDetail(id) {
- let res;
- if (state.comeinType === "wechat") {
- res = await OrderApi.getOrder(id, {
- merchant_trade_no: state.merchantTradeNo
- });
- } else {
- res = await OrderApi.getOrder(id);
- }
- if (res.code === 0) {
- state.orderInfo = res.data;
- handleOrderButtons(state.orderInfo);
- } else {
- sheep$1.$router.back();
- }
- }
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- vue.watch(
- () => isLogin.value,
- (newVal) => {
- if (newVal) {
- window.location.reload();
- }
- },
- {
- deep: true
- // 深度监听
- }
- );
- onLoad(async (options2) => {
- if (!isLogin.value) {
- showAuthModal();
- sheep$1.$helper.toast(t$6("order.not_logged_in", { user: options2.username }), 3e3);
- } else {
- if (options2.username) {
- formatAppLog("log", "at pages/order/detail.vue:434", JSON.parse(uni.getStorageSync("user-store")).userInfo.username);
- if (options2.username != JSON.parse(uni.getStorageSync("user-store")).userInfo.username) {
- sheep$1.$helper.toast(t$6("order.account_switch_needed", { user1: JSON.parse(uni.getStorageSync("user-store")).userInfo.username, user2: options2.username }), 3e3);
- }
- }
- }
- let id = 0;
- if (options2.id) {
- id = options2.id;
- }
- state.comeinType = options2.comein_type;
- if (state.comeinType === "wechat") {
- state.merchantTradeNo = options2.merchant_trade_no;
- }
- await getOrderDetail(id);
- });
- const __returned__ = { userInfo: userInfo2, statusBarHeight, headerBg, state, onCopy, onPay, onGoodsDetail, onCancel, onExpress, onConfirm, onComment, onApply, getOrderDetail, isLogin, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, computed: vue.computed, watch: vue.watch, get isEmpty() {
- return lodashExports.isEmpty;
- }, get fen2yuan() {
- return fen2yuan;
- }, get formatOrderStatus() {
- return formatOrderStatus;
- }, get formatOrderStatusDescription() {
- return formatOrderStatusDescription;
- }, get handleOrderButtons() {
- return handleOrderButtons;
- }, get points2point() {
- return points2point;
- }, get OrderApi() {
- return OrderApi;
- }, get AfterSaleApi() {
- return AfterSaleApi;
- }, get showAuthModal() {
- return showAuthModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1x(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("order.order_details"),
- class: "index-wrap",
- navbar: "inner"
- }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createCommentVNode(" 订单状态 TODO "),
- vue.createElementVNode(
- "view",
- {
- class: "state-box ss-flex-col ss-col-center ss-row-right",
- style: vue.normalizeStyle([
- {
- marginTop: "-" + Number($setup.statusBarHeight + 88) + "rpx",
- paddingTop: Number($setup.statusBarHeight + 88) + "rpx"
- }
- ])
- },
- [
- vue.createElementVNode("view", { class: "ss-flex ss-m-t-32 ss-m-b-20" }, [
- $setup.state.orderInfo.status_code == "unpaid" || $setup.state.orderInfo.status === 10 || // 待发货
- $setup.state.orderInfo.status_code == "nocomment" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "state-img",
- src: $setup.sheep.$url.static("/static/images/order_loading.png")
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- $setup.state.orderInfo.status_code == "completed" || $setup.state.orderInfo.status_code == "refund_agree" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- class: "state-img",
- src: $setup.sheep.$url.static("/static/images/order_success.png")
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- $setup.state.orderInfo.status_code == "cancel" || $setup.state.orderInfo.status_code == "closed" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 2,
- class: "state-img",
- src: $setup.sheep.$url.static("/static/images/order_close.png")
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- $setup.state.orderInfo.status_code == "noget" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 3,
- class: "state-img",
- src: $setup.sheep.$url.static("/static/images/order_express.png")
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- { class: "ss-font-30" },
- vue.toDisplayString($setup.formatOrderStatus($setup.state.orderInfo)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "ss-font-26 ss-m-x-20 ss-m-b-70" },
- vue.toDisplayString($setup.formatOrderStatusDescription($setup.state.orderInfo)),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 收货地址 "),
- $setup.state.orderInfo.receiverAreaId > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "order-address-box"
- }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "text",
- { class: "address-username" },
- vue.toDisplayString($setup.state.orderInfo.receiverName),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "address-phone" },
- vue.toDisplayString($setup.state.orderInfo.receiverMobile),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "address-detail" },
- vue.toDisplayString($setup.state.orderInfo.receiverAreaName) + " " + vue.toDisplayString($setup.state.orderInfo.receiverDetailAddress),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "detail-goods",
- style: vue.normalizeStyle([{ marginTop: $setup.state.orderInfo.receiverAreaId > 0 ? "0" : "-40rpx" }])
- },
- [
- vue.createCommentVNode(" 订单信息 TODO 非繁人: "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.orderInfo.items, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "order-list",
- key: item.goods_id
- }, [
- vue.createElementVNode("view", { class: "order-card" }, [
- vue.createVNode(_component_s_goods_item, {
- onClick: ($event) => $setup.onGoodsDetail(item.spuId),
- img: item.picUrl,
- title: item.spuName,
- skuText: item.properties.map((property) => property.valueName).join(" "),
- price: item.spuPayType === 2 ? item.highPrecisionPrice : item.price,
- num: item.count,
- virtualPirce: item.spuPayType === 2
- }, {
- tool: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- [30].includes($setup.state.orderInfo.status) && item.afterSaleStatus === 0 ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "ss-reset-button apply-btn",
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go("/pages/order/aftersale/apply", {
- orderId: $setup.state.orderInfo.id,
- itemId: item.id
- }), ["stop"])
- }, vue.toDisplayString($setup.t("order.apply_for_service")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- item.afterSaleStatus === 10 ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button apply-btn",
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go("/pages/order/aftersale/detail", {
- id: item.afterSaleId
- }), ["stop"])
- }, vue.toDisplayString($setup.t("order.refund_in_progress")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- item.afterSaleStatus === 20 ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 2,
- class: "ss-reset-button apply-btn",
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go("/pages/order/aftersale/detail", {
- id: item.afterSaleId
- }), ["stop"])
- }, vue.toDisplayString($setup.t("order.refund_successful")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- priceSuffix: vue.withCtx(() => [
- item.status_text ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button tag-btn"
- },
- vue.toDisplayString(item.status_text),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["onClick", "img", "title", "skuText", "price", "num", "virtualPirce"])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 订单信息 "),
- vue.createElementVNode("view", { class: "notice-box" }, [
- vue.createElementVNode("view", { class: "notice-box__content" }, [
- vue.createElementVNode("view", { class: "notice-item--center" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-flex-1" }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.order_number")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail" },
- vue.toDisplayString($setup.state.orderInfo.no),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button copy-btn",
- onClick: $setup.onCopy
- },
- vue.toDisplayString($setup.t("order.copy")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "notice-item" }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.customer_message")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail" },
- vue.toDisplayString($setup.state.orderInfo.userRemark || $setup.t("common.none")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "notice-item" }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.order_time")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat($setup.state.orderInfo.createTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ]),
- $setup.state.orderInfo.payTime ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "notice-item"
- }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.payment_time")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat($setup.state.orderInfo.payTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "notice-item" }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.payment_method")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail" },
- vue.toDisplayString($setup.state.orderInfo.payChannelName || "-"),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- vue.createCommentVNode(" 价格信息 "),
- vue.createElementVNode("view", { class: "order-price-box" }, [
- vue.createElementVNode("view", { class: "notice-item ss-flex ss-row-between" }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.total_amount")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode(
- "text",
- { class: "detail" },
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.totalPrice)),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode("view", { class: "notice-item ss-flex ss-row-between" }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.shipping_fee")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail" },
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.deliveryPrice)),
- 1
- /* TEXT */
- )
- ]),
- $setup.state.orderInfo.payIntegral > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "notice-item ss-flex ss-row-between"
- }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.use_commission")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail" },
- vue.toDisplayString($setup.points2point($setup.state.orderInfo.payIntegral)),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.orderInfo.payConsumptionPoints > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "notice-item ss-flex ss-row-between"
- }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.use_points")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail" },
- vue.toDisplayString($setup.points2point($setup.state.orderInfo.payConsumptionPoints)),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" TODO 非繁人:优惠劵抵扣、佣金抵扣 "),
- $setup.state.orderInfo.discountPrice > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "notice-item ss-flex ss-row-between"
- }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.discount_amount")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail" },
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.discountPrice)),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "notice-item all-rpice-item ss-flex ss-m-t-20" }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.state.orderInfo.payStatus ? $setup.t("order.paid") : $setup.t("order.amount_due")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail all-price" },
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.payPrice)),
- 1
- /* TEXT */
- )
- ]),
- $setup.state.orderInfo.refundPrice > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 3,
- class: "notice-item all-rpice-item ss-flex ss-m-t-20"
- }, [
- vue.createElementVNode(
- "text",
- { class: "title" },
- vue.toDisplayString($setup.t("order.refunded")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "detail all-price" },
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.refundPrice)),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createCommentVNode(" 底部按钮 "),
- vue.createCommentVNode(" TODO: 查看物流、等待成团、评价完后返回页面没刷新页面 "),
- ((_a2 = $setup.state.orderInfo.buttons) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createBlock(_component_su_fixed, {
- key: 1,
- bottom: "",
- placeholder: "",
- bg: "bg-white"
- }, {
- default: vue.withCtx(() => {
- var _a3, _b2, _c, _d, _e2, _f, _g, _h;
- return [
- vue.createElementVNode("view", { class: "footer-box ss-flex ss-col-center ss-row-right" }, [
- vue.createCommentVNode(" {{state.orderInfo.buttons}} "),
- ((_a3 = $setup.state.orderInfo.buttons) == null ? void 0 : _a3.includes("cancel")) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button cancel-btn",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.onCancel($setup.state.orderInfo.id))
- },
- vue.toDisplayString($setup.t("order.cancel_order")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- ((_b2 = $setup.state.orderInfo.buttons) == null ? void 0 : _b2.includes("pay")) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-reset-button pay-btn ui-BG-Main-Gradient",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.onPay($setup.state.orderInfo.payOrderId))
- },
- vue.toDisplayString($setup.t("order.continue_payment")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" TODO 非繁人:拼团接入 "),
- vue.createCommentVNode(` <button class="ss-reset-button cancel-btn" v-if="state.orderInfo.buttons?.includes('combination')" @tap="
- sheep.$router.go('/pages/activity/groupon/detail', {
- id: state.orderInfo.ext.groupon_id,
- })
- ">
- 拼团详情
-
- </button> `),
- vue.createCommentVNode(" 商家发货&&用户不售后就能看到物流 "),
- ((_c = $setup.state.orderInfo.buttons) == null ? void 0 : _c.includes("express")) && !((_d = $setup.state.orderInfo.items[0]) == null ? void 0 : _d.refundStatus) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 2,
- class: "ss-reset-button cancel-btn",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.onExpress($setup.state.orderInfo.id))
- },
- vue.toDisplayString($setup.t("order.view_logistics")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- ((_e2 = $setup.state.orderInfo.buttons) == null ? void 0 : _e2.includes("confirm")) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 3,
- class: "ss-reset-button cancel-btn",
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.onConfirm($setup.state.orderInfo.id))
- },
- vue.toDisplayString($setup.t("order.confirm_receipt")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- ((_f = $setup.state.orderInfo.buttons) == null ? void 0 : _f.includes("comment")) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 4,
- class: "ss-reset-button cancel-btn",
- onClick: _cache[4] || (_cache[4] = ($event) => $setup.onComment($setup.state.orderInfo.id))
- },
- vue.toDisplayString($setup.t("order.review_order")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 售后用户退货 "),
- ((_g = $setup.state.orderInfo.buttons) == null ? void 0 : _g.includes("aftersaleCancel")) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 5,
- class: "ss-reset-button cancel-btn",
- onClick: _cache[5] || (_cache[5] = ($event) => $setup.onApply($setup.state.orderInfo.items[0].afterSaleId))
- },
- vue.toDisplayString($setup.t("order.cancel_request")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- ((_h = $setup.state.orderInfo.buttons) == null ? void 0 : _h.includes("aftersaleDelivery")) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 6,
- class: "ss-reset-button cancel-btn",
- onClick: _cache[6] || (_cache[6] = ($event) => $setup.sheep.$router.go("/pages/order/aftersale/return-delivery", { id: $setup.state.orderInfo.items[0].afterSaleId }))
- },
- vue.toDisplayString($setup.t("order.fill_return")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ];
- }),
- _: 1
- /* STABLE */
- })) : vue.createCommentVNode("v-if", true)
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesOrderDetail = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["render", _sfc_render$1x], ["__scopeId", "data-v-6b23c96c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/detail.vue"]]);
- const _sfc_main$1x = {
- name: "UniTag",
- emits: ["click"],
- props: {
- type: {
- // 标签类型default、primary、success、warning、error、royal
- type: String,
- default: "default"
- },
- size: {
- // 标签大小 normal, small
- type: String,
- default: "normal"
- },
- // 标签内容
- text: {
- type: String,
- default: ""
- },
- disabled: {
- // 是否为禁用状态
- type: [Boolean, String],
- default: false
- },
- inverted: {
- // 是否为空心
- type: [Boolean, String],
- default: false
- },
- circle: {
- // 是否为圆角样式
- type: [Boolean, String],
- default: false
- },
- mark: {
- // 是否为标记样式
- type: [Boolean, String],
- default: false
- },
- customStyle: {
- type: String,
- default: ""
- }
- },
- computed: {
- classes() {
- const {
- type,
- disabled,
- inverted,
- circle,
- mark: mark2,
- size,
- isTrue
- } = this;
- const classArr = [
- "uni-tag--" + type,
- "uni-tag--" + size,
- isTrue(disabled) ? "uni-tag--disabled" : "",
- isTrue(inverted) ? "uni-tag--" + type + "--inverted" : "",
- isTrue(circle) ? "uni-tag--circle" : "",
- isTrue(mark2) ? "uni-tag--mark" : "",
- // type === 'default' ? 'uni-tag--default' : 'uni-tag-text',
- isTrue(inverted) ? "uni-tag--inverted uni-tag-text--" + type : "",
- size === "small" ? "uni-tag-text--small" : ""
- ];
- return classArr.join(" ");
- }
- },
- methods: {
- isTrue(value) {
- return value === true || value === "true";
- },
- onClick() {
- if (this.isTrue(this.disabled))
- return;
- this.$emit("click");
- }
- }
- };
- function _sfc_render$1w(_ctx, _cache, $props, $setup, $data, $options) {
- return $props.text ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["uni-tag", $options.classes]),
- style: vue.normalizeStyle($props.customStyle),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
- },
- vue.toDisplayString($props.text),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0$8 = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["render", _sfc_render$1w], ["__scopeId", "data-v-1f94d070"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-tag/components/uni-tag/uni-tag.vue"]]);
- const _sfc_main$1w = {
- __name: "s-address-item",
- props: {
- item: {
- type: Object,
- default() {
- }
- },
- hasBorderBottom: {
- type: Boolean,
- defult: true
- },
- spuType: {
- type: Number
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const onEdit = () => {
- if (props.spuType == 0) {
- sheep$1.$router.go("/pages/user/dummyAddress/edit", {
- id: props.item.id
- });
- } else {
- sheep$1.$router.go("/pages/user/address/edit", {
- id: props.item.id
- });
- }
- };
- const __returned__ = { props, onEdit, get sheep() {
- return sheep$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1v(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_tag = resolveEasycom(vue.resolveDynamicComponent("uni-tag"), __easycom_0$8);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["address-item ss-flex ss-row-between ss-col-center", [{ "border-bottom": $setup.props.hasBorderBottom }]])
- },
- [
- !$setup.isEmpty($setup.props.item) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "item-left"
- }, [
- vue.createElementVNode("view", { class: "area-text ss-flex ss-col-center" }, [
- $setup.props.item.defaultStatus ? (vue.openBlock(), vue.createBlock(_component_uni_tag, {
- key: 0,
- class: "ss-m-r-10",
- size: "small",
- "custom-style": "background-color: var(--ui-BG-Main); border-color: var(--ui-BG-Main); color: #fff;",
- text: _ctx.$t("common.default")
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.props.item.areaName),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "address-text" },
- vue.toDisplayString($setup.props.item.detailAddress),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "person-text" },
- vue.toDisplayString($setup.props.item.name) + " " + vue.toDisplayString($setup.props.item.mobile),
- 1
- /* TEXT */
- )
- ])) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- vue.createElementVNode(
- "view",
- { class: "address-text ss-m-b-10" },
- vue.toDisplayString(_ctx.$t("address.select_shipping_address")),
- 1
- /* TEXT */
- )
- ])),
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode("button", {
- class: "ss-reset-button edit-btn",
- onClick: vue.withModifiers($setup.onEdit, ["stop"])
- }, [
- vue.createElementVNode("view", { class: "edit-icon ss-flex ss-row-center ss-col-center" }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/edit.png")
- }, null, 8, ["src"])
- ])
- ])
- ], true)
- ],
- 2
- /* CLASS */
- );
- }
- const __easycom_0$7 = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["render", _sfc_render$1v], ["__scopeId", "data-v-bb7deb2b"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-address-item/s-address-item.vue"]]);
- const _sfc_main$1v = {
- __name: "s-points-pop",
- props: {
- modelValue: {
- type: Object,
- default() {
- }
- },
- show: {
- type: Boolean,
- default: false
- },
- currentMemberPoints: {
- type: Number,
- default: 0
- },
- currentTotalPrice: {
- type: Number,
- default: 0
- },
- currentDeliveryPrice: {
- type: Number,
- default: 0
- }
- },
- emits: ["confirm", "close"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props = __props;
- const emits = __emit;
- const state = vue.reactive({
- points: 0,
- disabled: false
- });
- const currentOrderMemberPoints = vue.computed(() => {
- return parseFloat(props.currentMemberPoints);
- });
- const currentOrderTotalPrice = vue.computed(() => {
- return parseFloat(props.currentTotalPrice);
- });
- const currentOrderDeliveryPrice = vue.computed(() => {
- return parseFloat(props.currentDeliveryPrice);
- });
- const canUesPoint = vue.computed(() => {
- if (!currentOrderTotalPrice.value)
- return currentOrderTotalPrice.value;
- return (currentOrderTotalPrice.value - currentOrderDeliveryPrice.value).toFixed(2);
- });
- vue.watchEffect(() => {
- const strPoints = state.points.toString();
- const [integerPart, decimalPart] = strPoints.split(".");
- if (decimalPart) {
- const points = parseFloat(`${integerPart}.${decimalPart.slice(0, 2)}`);
- vue.nextTick(() => {
- state.points = points;
- });
- }
- if (state.points > currentOrderMemberPoints.value) {
- vue.nextTick(() => {
- state.points = currentOrderMemberPoints.value;
- });
- }
- if (state.points > canUesPoint.value) {
- vue.nextTick(() => {
- state.points = canUesPoint.value;
- });
- }
- if (canUesPoint.value == 0 || canUesPoint.value < 0) {
- state.disabled = true;
- }
- if (canUesPoint.value > 0) {
- state.disabled = false;
- }
- });
- const onConfirm = () => {
- if (state.points === "") {
- state.points = 0;
- }
- emits("confirm", state.points);
- };
- const __returned__ = { props, emits, state, currentOrderMemberPoints, currentOrderTotalPrice, currentOrderDeliveryPrice, canUesPoint, onConfirm, computed: vue.computed, reactive: vue.reactive, ref: vue.ref, watch: vue.watch, nextTick: vue.nextTick, watchEffect: vue.watchEffect };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1u(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createBlock(_component_su_popup, {
- show: $props.show,
- type: "bottom",
- round: "10",
- onClose: _cache[2] || (_cache[2] = ($event) => $setup.emits("close")),
- showClose: "",
- backgroundColor: "#ffffff"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "title ss-m-t-16 ss-m-l-20 ss-flex" },
- vue.toDisplayString(_ctx.$t("pop.Commission.usingCommission")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "model-box ss-p-x-30" }, [
- vue.withDirectives(vue.createElementVNode("input", {
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.points = $event),
- class: "uni-input input-points ss-m-b-10",
- type: "number",
- placeholder: "请输入抵扣佣金",
- oninput: "this.value=this.value.replace(/\\D/g);",
- disabled: $setup.state.disabled
- }, null, 8, ["disabled"]), [
- [
- vue.vModelText,
- $setup.state.points,
- void 0,
- { number: true }
- ]
- ])
- ]),
- vue.createElementVNode("view", { class: "modal-footer text-center" }, [
- vue.createElementVNode("view", { class: "subtitle text-disabled" }, [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("pop.Commission.availableCommission")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text-red" },
- vue.toDisplayString($props.currentMemberPoints),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "subtitle text-disabled" }, [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("pop.Commission.currentOrderTotalPrice")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text-red" },
- "¥" + vue.toDisplayString($setup.currentOrderTotalPrice),
- 1
- /* TEXT */
- ),
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("pop.Commission.canUseMaxCommission")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text-red" },
- vue.toDisplayString($setup.canUesPoint),
- 1
- /* TEXT */
- ),
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("pop.Commission.commission")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-m-y-20 ss-col-center" }, [
- vue.createElementVNode(
- "button",
- {
- class: "confirm-btn ss-reset-button",
- onClick: _cache[1] || (_cache[1] = ($event) => {
- $setup.state.points = 0;
- $setup.emits("confirm", $setup.state.points);
- })
- },
- vue.toDisplayString(_ctx.$t("pop.cancel")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "button",
- {
- class: "confirm-btn ss-reset-button",
- onClick: $setup.onConfirm
- },
- vue.toDisplayString(_ctx.$t("pop.confirm")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]);
- }
- const __easycom_3$3 = /* @__PURE__ */ _export_sfc(_sfc_main$1v, [["render", _sfc_render$1u], ["__scopeId", "data-v-8dbeaa2a"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-points-pop/s-points-pop.vue"]]);
- const _sfc_main$1u = {
- __name: "s-consumptionPoints-pop",
- props: {
- modelValue: {
- // 优惠劵列表
- type: Object,
- default() {
- }
- },
- show: {
- type: Boolean,
- default: false
- },
- currentMemberConsumptionPoints: {
- type: Number,
- default: 0
- },
- currentTotalPrice: {
- type: Number,
- default: 0
- },
- currentDeliveryPrice: {
- type: Number,
- default: 0
- }
- },
- emits: ["confirm", "close"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props = __props;
- const emits = __emit;
- const state = vue.reactive({
- points: 0,
- disabled: false
- });
- const currentOrderMemberPoints = vue.computed(() => {
- return parseFloat(props.currentMemberConsumptionPoints);
- });
- const currentOrderTotalPrice = vue.computed(() => {
- return parseFloat(props.currentTotalPrice);
- });
- const currentOrderDeliveryPrice = vue.computed(() => {
- return parseFloat(props.currentDeliveryPrice);
- });
- const canUesPoint = vue.computed(() => {
- if (!currentOrderTotalPrice.value)
- return currentOrderTotalPrice.value;
- return (currentOrderTotalPrice.value - currentOrderDeliveryPrice.value).toFixed(2);
- });
- vue.watchEffect(() => {
- const strPoints = state.points.toString();
- const [integerPart, decimalPart] = strPoints.split(".");
- if (decimalPart) {
- const points = parseFloat(`${integerPart}.${decimalPart.slice(0, 2)}`);
- vue.nextTick(() => {
- state.points = points;
- });
- }
- if (state.points > currentOrderMemberPoints.value) {
- vue.nextTick(() => {
- state.points = currentOrderMemberPoints.value;
- });
- }
- if (state.points > canUesPoint.value) {
- vue.nextTick(() => {
- state.points = canUesPoint.value;
- });
- }
- if (canUesPoint.value == 0 || canUesPoint.value < 0) {
- state.disabled = true;
- }
- if (canUesPoint.value > 0) {
- state.disabled = false;
- }
- });
- const onConfirm = () => {
- if (state.points === "") {
- state.points = 0;
- }
- emits("confirm", state.points);
- };
- const __returned__ = { props, emits, state, currentOrderMemberPoints, currentOrderTotalPrice, currentOrderDeliveryPrice, canUesPoint, onConfirm, computed: vue.computed, reactive: vue.reactive, ref: vue.ref, watch: vue.watch, nextTick: vue.nextTick, watchEffect: vue.watchEffect };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1t(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createBlock(_component_su_popup, {
- show: $props.show,
- type: "bottom",
- round: "10",
- onClose: _cache[2] || (_cache[2] = ($event) => $setup.emits("close")),
- showClose: "",
- backgroundColor: "#ffffff"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "title ss-m-t-16 ss-m-l-20 ss-flex" },
- vue.toDisplayString(_ctx.$t("pop.ConsumptionPoints.usingPoints")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "model-box ss-p-x-30" }, [
- vue.withDirectives(vue.createElementVNode("input", {
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.points = $event),
- class: "uni-input input-points ss-m-b-10",
- type: "number",
- placeholder: "请输入抵扣消费分",
- oninput: "this.value=this.value.replace(/\\D/g);",
- disabled: $setup.state.disabled
- }, null, 8, ["disabled"]), [
- [
- vue.vModelText,
- $setup.state.points,
- void 0,
- { number: true }
- ]
- ])
- ]),
- vue.createElementVNode("view", { class: "modal-footer text-center" }, [
- vue.createElementVNode("view", { class: "subtitle text-disabled" }, [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("pop.ConsumptionPoints.availablePoints")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text-red" },
- vue.toDisplayString($props.currentMemberConsumptionPoints),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "subtitle text-disabled" }, [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("pop.ConsumptionPoints.currentOrderTotalPrice")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text-red" },
- "¥" + vue.toDisplayString($setup.currentOrderTotalPrice),
- 1
- /* TEXT */
- ),
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("pop.ConsumptionPoints.canUseMaxPoints")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text-red" },
- vue.toDisplayString($setup.canUesPoint),
- 1
- /* TEXT */
- ),
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("pop.ConsumptionPoints.points")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-m-y-20 ss-col-center" }, [
- vue.createElementVNode(
- "button",
- {
- class: "confirm-btn ss-reset-button",
- onClick: _cache[1] || (_cache[1] = ($event) => {
- $setup.state.points = 0;
- $setup.emits("confirm", $setup.state.points);
- })
- },
- vue.toDisplayString(_ctx.$t("pop.cancel")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "button",
- {
- class: "confirm-btn ss-reset-button",
- onClick: $setup.onConfirm
- },
- vue.toDisplayString(_ctx.$t("pop.confirm")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]);
- }
- const __easycom_4 = /* @__PURE__ */ _export_sfc(_sfc_main$1u, [["render", _sfc_render$1t], ["__scopeId", "data-v-062685a8"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-consumptionPoints-pop/s-consumptionPoints-pop.vue"]]);
- const _sfc_main$1t = {
- __name: "confirm",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- orderPayload: {},
- orderInfo: {
- items: [],
- // 商品项列表
- price: {}
- // 价格信息
- },
- addressInfo: {},
- // 选择的收货地址
- showPoints: false,
- // 是否佣金抵扣
- showConsumptionPoints: false,
- // 是否消费分抵扣
- couponInfo: [],
- // 优惠劵列表
- showDiscount: false,
- // 是否展示营销活动
- currentMemberPoints: 0,
- //用户当前可用佣金
- currentMemberConsumptionPoints: 0,
- //用户当前可用消费分
- usedPoint: 0,
- //用户使用的佣金
- usedConsumptionPoints: 0,
- //用户使用的消费分
- currentTotalPrice: 0,
- //当前的整个订单的总价格
- currentDeliveryPrice: 0
- // 当前订单的总运费
- });
- const shopsByNames = vue.computed(() => {
- const shops = {};
- try {
- Object.keys(state.orderInfo.shopRespVOMap).forEach((shopId) => {
- const shopName = state.orderInfo.shopNameMap[shopId];
- if (shopName) {
- shops[shopName] = state.orderInfo.shopRespVOMap[shopId];
- shops[shopName].remark = "";
- shops[shopName].shopId = shopId;
- }
- });
- } catch (e2) {
- }
- return shops;
- });
- const totalItemCount = vue.computed(() => {
- let totalCount = 0;
- Object.values(shopsByNames.value).forEach((shop) => {
- shop.items.forEach((item) => {
- totalCount += item.count;
- });
- });
- return totalCount;
- });
- function onSelectAddress() {
- uni.$once("SELECT_ADDRESS", (e2) => {
- changeConsignee(e2.addressInfo);
- });
- if (state.orderPayload.spuType) {
- sheep$1.$router.go("/pages/user/address/list");
- } else {
- sheep$1.$router.go("/pages/user/dummyAddress/list");
- }
- }
- async function changeConsignee(addressInfo = {}) {
- if (!lodashExports.isEmpty(addressInfo)) {
- state.addressInfo = addressInfo;
- }
- await getOrderInfo();
- }
- async function onInputPoints(points) {
- if (points == void 0) {
- points = 0;
- }
- const payprice = state.currentTotalPrice;
- formatAppLog("log", "at pages/order/confirm.vue:330", points, payprice);
- state.usedPoint = points;
- state.usedConsumptionPoints = 0;
- state.showPoints = false;
- }
- function onInputConsumptionPoints(points) {
- if (points == void 0) {
- points = 0;
- }
- state.currentTotalPrice;
- state.usedConsumptionPoints = points;
- state.usedPoint = 0;
- state.showConsumptionPoints = false;
- }
- function onConfirm() {
- if (!state.addressInfo.id) {
- sheep$1.$helper.toast(t$6("confirm.select_shipping_address"));
- return;
- }
- if (parseFloat(state.usedPoint) && parseFloat(state.usedPoint) > parseFloat(state.currentMemberPoints)) {
- sheep$1.$helper.toast(t$6("confirm.insufficient_commission"));
- return;
- }
- if (parseFloat(state.usedConsumptionPoints) && parseFloat(state.usedConsumptionPoints) > parseFloat(state.currentMemberConsumptionPoints)) {
- sheep$1.$helper.toast(t$6("confirm.insufficient_consumption_points"));
- return;
- }
- if (parseFloat(state.usedPoint) && parseFloat(state.usedConsumptionPoints)) {
- sheep$1.$helper.toast(t$6("confirm.commission_points_no_mix"));
- return;
- }
- submitOrder();
- }
- function customRound(number2, decimals) {
- let factor = Math.pow(10, decimals);
- let tempNumber = Math.floor(number2 * factor) / factor;
- return tempNumber.toFixed(decimals);
- }
- async function submitOrder() {
- const shops = shopsByNames.value;
- const shopRemarks = {};
- Object.keys(shops).forEach((shopName) => {
- const shop = shops[shopName];
- shopRemarks[shop.shopId] = shop.remark;
- });
- const usedPoint = state.orderPayload.highPrecision ? customRound(state.orderInfo.price.virtualPayPrice / 100, 2) : state.usedPoint;
- const {
- code: code2,
- data
- } = await OrderApi.createOrder({
- items: state.orderPayload.items,
- couponId: state.orderPayload.couponId,
- addressId: state.addressInfo.id,
- deliveryType: state.orderPayload.spuType == 1 ? 1 : 3,
- // TODO 非繁人:需要支持【门店自提】
- pointStatus: false,
- // TODO 非繁人:需要支持【佣金选择】
- combinationActivityId: state.orderPayload.combinationActivityId,
- combinationHeadId: state.orderPayload.combinationHeadId,
- seckillActivityId: state.orderPayload.seckillActivityId,
- payIntegral: usedPoint,
- payConsumptionPoints: state.usedConsumptionPoints,
- shopRemarks
- });
- if (code2 !== 0) {
- return;
- }
- if (state.orderPayload.items[0].cartId > 0) {
- sheep$1.$store("cart").getList();
- }
- sheep$1.$router.redirect("/pages/pay/index", {
- id: data.payOrderId,
- type: 1
- });
- }
- async function getOrderInfo() {
- const shops = shopsByNames.value;
- let shopRemarks = {};
- if (Object.keys(shops).length !== 0) {
- Object.keys(shops).forEach((shopName) => {
- const shop = shops[shopName];
- shopRemarks[shopName] = shop.remark;
- });
- }
- const {
- data,
- code: code2
- } = await OrderApi.settlementOrder({
- items: state.orderPayload.items,
- couponId: state.orderPayload.couponId,
- addressId: state.addressInfo.id,
- deliveryType: state.orderPayload.spuType == 1 ? 1 : 3,
- // TODO 非繁人:需要支持【门店自提】
- pointStatus: false,
- // TODO 非繁人:需要支持【佣金选择】
- combinationActivityId: state.orderPayload.combinationActivityId,
- combinationHeadId: state.orderPayload.combinationHeadId,
- seckillActivityId: state.orderPayload.seckillActivityId,
- usedPoint: state.usedPoint,
- addressType: state.orderPayload.spuType == 1 ? 1 : 2
- //如果是虚拟产品
- });
- if (code2 !== 0) {
- return;
- }
- state.orderInfo = data;
- if (Object.keys(shopRemarks).length !== 0) {
- Object.keys(shopRemarks).forEach((shopName) => {
- shopsByNames.value[shopName].remark = shopRemarks[shopName];
- });
- }
- if (state.orderInfo.address) {
- state.addressInfo = state.orderInfo.address;
- }
- state.currentMemberPoints = state.orderInfo.currentQuota > 0 ? points2point(state.orderInfo.currentQuota) : 0;
- state.currentMemberConsumptionPoints = state.orderInfo.consumePoints > 0 ? points2point(state.orderInfo.consumePoints) : 0;
- state.currentTotalPrice = fen2yuan(state.orderInfo.price.payPrice);
- state.currentDeliveryPrice = fen2yuan(state.orderInfo.price.deliveryPrice);
- if (state.orderPayload.spuPayType == 2) {
- state.usedPoint = state.currentTotalPrice - 0.01;
- }
- }
- onLoad(async (options2) => {
- if (!options2.data) {
- sheep$1.$helper.toast("参数不正确,请检查!");
- return;
- }
- state.orderPayload = JSON.parse(options2.data);
- await getOrderInfo();
- });
- const __returned__ = { state, shopsByNames, totalItemCount, onSelectAddress, changeConsignee, onInputPoints, onInputConsumptionPoints, onConfirm, customRound, submitOrder, getOrderInfo, reactive: vue.reactive, computed: vue.computed, get onLoad() {
- return onLoad;
- }, get sheep() {
- return sheep$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, get OrderApi() {
- return OrderApi;
- }, get CouponApi() {
- return CouponApi;
- }, get fen2yuan() {
- return fen2yuan;
- }, get points2point() {
- return points2point;
- }, get fen2yuan6() {
- return fen2yuan6;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1s(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_address_item = resolveEasycom(vue.resolveDynamicComponent("s-address-item"), __easycom_0$7);
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_s_points_pop = resolveEasycom(vue.resolveDynamicComponent("s-points-pop"), __easycom_3$3);
- const _component_s_consumptionPoints_pop = resolveEasycom(vue.resolveDynamicComponent("s-consumptionPoints-pop"), __easycom_4);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("confirm.confirm_order")
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(' TODO:这个判断先删除 v-if="state.orderInfo.need_address === 1" '),
- vue.createElementVNode("view", {
- class: "bg-white address-box ss-m-b-14 ss-r-b-10",
- onClick: $setup.onSelectAddress
- }, [
- vue.createVNode(_component_s_address_item, {
- item: $setup.state.addressInfo,
- spuType: $setup.state.orderPayload.spuType,
- hasBorderBottom: false
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-rest-button" }, [
- vue.createElementVNode("text", { class: "_icon-forward" })
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["item", "spuType"])
- ]),
- vue.createCommentVNode(" 商品信息 "),
- vue.createCommentVNode(" {{shopsByNames}} "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.shopsByNames, (items, name2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "order-card-box ss-m-b-14",
- key: name2
- }, [
- vue.createElementVNode(
- "view",
- { class: "title-text ss-p-x-20 ss-p-t-20" },
- vue.toDisplayString(name2),
- 1
- /* TEXT */
- ),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(items.items, (item) => {
- var _a2;
- return vue.openBlock(), vue.createBlock(_component_s_goods_item, {
- key: item == null ? void 0 : item.skuId,
- img: item == null ? void 0 : item.picUrl,
- title: item == null ? void 0 : item.spuName,
- skuText: (_a2 = item == null ? void 0 : item.properties) == null ? void 0 : _a2.map((property) => property.valueName).join(" "),
- price: item.highPrecisionPrice ? item == null ? void 0 : item.highPrecisionPrice : item == null ? void 0 : item.price,
- num: item == null ? void 0 : item.count,
- virtualPirce: item.highPrecisionPrice ? true : false
- }, null, 8, ["img", "title", "skuText", "price", "num", "virtualPirce"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode("view", { class: "order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("confirm.shipping_fee")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "ss-flex ss-col-center" },
- vue.toDisplayString(items.price.deliveryPrice ? "¥" + $setup.fen2yuan(items.price.deliveryPrice) : $setup.t("confirm.free_shipping")),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 暂不做开发票 "),
- vue.createCommentVNode(` <view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10">
- <view class="item-title">开具发票</view>
- <view class="ss-flex ss-col-center">
- <text class="item-value" :class="state.couponInfo.length > 0 ? 'text-red' : 'text-disabled'">
- {{
- state.couponInfo.length > 0 ? state.couponInfo.length + ' 张可用' : '不开具发票'
- }}
- </text>
- <text class="_icon-forward item-icon" />
- </view>
- </view> `),
- vue.createElementVNode("view", { class: "order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("confirm.order_note")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createVNode(_component_uni_easyinput, {
- maxlength: "20",
- placeholder: $setup.t("confirm.communication_advice"),
- modelValue: items.remark,
- "onUpdate:modelValue": ($event) => items.remark = $event,
- inputBorder: false,
- clearable: false
- }, null, 8, ["placeholder", "modelValue", "onUpdate:modelValue"])
- ])
- ]),
- $setup.state.orderPayload.spuType == 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10"
- }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("confirm.quantity")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "ss-flex ss-col-center" },
- vue.toDisplayString($setup.totalItemCount),
- 1
- /* TEXT */
- )
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10"
- }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("common.total")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- $setup.state.orderPayload.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- style: { "width": "30rpx", "height": "30rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.fen2yuan(items.price.payPrice)),
- 1
- /* TEXT */
- )
- ])
- ]))
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createCommentVNode(" 价格信息 "),
- vue.createElementVNode("view", { class: "bg-white total-card-box ss-p-20 ss-m-b-14 ss-r-10" }, [
- vue.createElementVNode(
- "view",
- { class: "title-text" },
- vue.toDisplayString($setup.t("confirm.price_details")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "total-box-content border-bottom" }, [
- vue.createElementVNode("view", { class: "order-item ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("confirm.total_price")) + " " + vue.toDisplayString($setup.t("confirm.total_items", { count: $setup.totalItemCount })),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode("text", { class: "item-value ss-m-r-24" }, [
- $setup.state.orderPayload.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- style: { "width": "30rpx", "height": "30rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- $setup.state.orderPayload.highPrecision ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 2 },
- vue.toDisplayString($setup.fen2yuan6($setup.state.orderInfo.price.virtualTotalPrice)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 3 },
- vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.price.totalPrice)),
- 1
- /* TEXT */
- ))
- ])
- ])
- ]),
- vue.createCommentVNode(" TODO 非繁人:接入佣金 "),
- vue.createElementVNode("view", { class: "order-item ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("confirm.shipping_fee")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode("text", { class: "item-value ss-m-r-24" }, [
- $setup.state.orderPayload.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- style: { "width": "30rpx", "height": "30rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.price.deliveryPrice)),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- $setup.state.orderPayload.spuPayType != 2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "order-item ss-flex ss-col-center ss-row-between"
- }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("confirm.commission_deduction")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.showPoints = true)
- }, [
- vue.createCommentVNode(' <text class="item-value text-red">\n \n </text> '),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["item-value", $setup.state.usedPoint > 0 ? "text-red" : "text-disabled"])
- },
- vue.toDisplayString($setup.state.usedPoint > 0 ? $setup.t("confirm.deduction", { count: $setup.state.usedPoint }) : $setup.t("confirm.no_commission")),
- 3
- /* TEXT, CLASS */
- ),
- vue.createElementVNode("text", { class: "_icon-forward item-icon" })
- ])
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.orderPayload.spuPayType != 2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "order-item ss-flex ss-col-center ss-row-between"
- }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("confirm.consumption_point_deduction")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.state.showConsumptionPoints = true)
- }, [
- vue.createCommentVNode(' <text class="item-value text-red">\n </text> '),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["item-value", $setup.state.usedConsumptionPoints > 0 ? "text-red" : "text-disabled"])
- },
- vue.toDisplayString($setup.state.usedConsumptionPoints > 0 ? $setup.t("confirm.deduction", { count: $setup.state.usedConsumptionPoints }) : $setup.t("confirm.no_consumption_points")),
- 3
- /* TEXT, CLASS */
- ),
- vue.createElementVNode("text", { class: "_icon-forward item-icon" })
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 优惠劵:只有 type = 0 普通订单(非拼团、秒杀、砍价),才可以使用优惠劵 "),
- vue.createCommentVNode(" 暂时隐藏优惠卷 "),
- vue.createCommentVNode(` <view
- class="order-item ss-flex ss-col-center ss-row-between"
- v-if="state.orderInfo.type === 0"
- >
- <view class="item-title">优惠券</view>
- <view class="ss-flex ss-col-center" @tap="state.showCoupon = true">
- <text class="item-value text-red" v-if="state.orderPayload.couponId > 0">
- -¥{{ fen2yuan(state.orderInfo.price.couponPrice) }}
- </text>
- <text
- class="item-value"
- :class="state.couponInfo.length > 0 ? 'text-red' : 'text-disabled'"
- v-else
- >
- {{
- state.couponInfo.length > 0 ? state.couponInfo.length + ' 张可用' : '暂无可用优惠券'
- }}
- </text>
- <text class="_icon-forward item-icon" />
- </view>
- </view> `),
- vue.createCommentVNode(' <view\n class="order-item ss-flex ss-col-center ss-row-between"\n v-if="state.orderInfo.price.discountPrice > 0"\n >\n <view class="item-title">活动优惠</view>\n <view class="ss-flex ss-col-center">\n @tap="state.showDiscount = true" TODO 非繁人:后续要把优惠信息打进去 \n <text class="item-value text-red">\n -¥{{ fen2yuan(state.orderInfo.price.discountPrice) }}\n </text>\n <text class="_icon-forward item-icon" />\n </view>\n </view> ')
- ]),
- vue.createElementVNode("view", { class: "total-box-footer ss-font-28 ss-flex ss-row-right ss-col-center ss-m-r-28" }, [
- vue.createElementVNode(
- "view",
- { class: "total-num ss-m-r-20" },
- vue.toDisplayString($setup.t("confirm.total_items_count", { count: $setup.totalItemCount })),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString($setup.t("common.total")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "total-num text-red ss-flex" }, [
- $setup.state.orderPayload.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- class: "ss-m-r-10",
- style: { "width": "30rpx", "height": "30rpx" }
- })) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "¥")),
- $setup.state.orderPayload.highPrecision ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 2 },
- vue.toDisplayString($setup.fen2yuan6($setup.state.orderInfo.price.virtualTotalPrice)),
- 1
- /* TEXT */
- )) : $setup.state.orderPayload.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 3 },
- vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.price.payPrice) - 0.01),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 4 },
- vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.price.payPrice)),
- 1
- /* TEXT */
- ))
- ])
- ])
- ]),
- vue.createCommentVNode(" 佣金"),
- vue.createVNode(_component_s_points_pop, {
- modelValue: $setup.state.couponInfo,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.couponInfo = $event),
- currentMemberPoints: $setup.state.currentMemberPoints,
- currentTotalPrice: $setup.state.currentTotalPrice,
- currentDeliveryPrice: $setup.state.currentDeliveryPrice,
- show: $setup.state.showPoints,
- onConfirm: $setup.onInputPoints,
- onClose: _cache[3] || (_cache[3] = ($event) => $setup.state.showPoints = false)
- }, null, 8, ["modelValue", "currentMemberPoints", "currentTotalPrice", "currentDeliveryPrice", "show"]),
- vue.createCommentVNode(" 消费分 "),
- vue.createVNode(_component_s_consumptionPoints_pop, {
- modelValue: $setup.state.couponInfo,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.state.couponInfo = $event),
- currentMemberConsumptionPoints: $setup.state.currentMemberConsumptionPoints,
- currentTotalPrice: $setup.state.currentTotalPrice,
- currentDeliveryPrice: $setup.state.currentDeliveryPrice,
- show: $setup.state.showConsumptionPoints,
- onConfirm: $setup.onInputConsumptionPoints,
- onClose: _cache[5] || (_cache[5] = ($event) => $setup.state.showConsumptionPoints = false)
- }, null, 8, ["modelValue", "currentMemberConsumptionPoints", "currentTotalPrice", "currentDeliveryPrice", "show"]),
- vue.createCommentVNode(" 满额折扣弹框 TODO 非繁人:后续要把优惠信息打进去 "),
- vue.createCommentVNode(' <s-discount-list\n v-model="state.orderInfo"\n :show="state.showDiscount"\n @close="state.showDiscount = false"\n /> '),
- vue.createCommentVNode(" 底部 "),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- opacity: false,
- bg: "bg-white",
- placeholder: "",
- noFixed: false,
- index: 200
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box border-top ss-flex ss-row-between ss-p-x-20 ss-col-center" }, [
- vue.createElementVNode("view", { class: "total-box-footer ss-flex ss-col-center" }, [
- $setup.state.orderPayload.highPrecision ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- $setup.state.orderPayload.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- style: { "width": "30rpx", "height": "30rpx" }
- })) : vue.createCommentVNode("v-if", true),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.fen2yuan6($setup.state.orderInfo.price.virtualPayPrice) - 0.01) + " ¥0.01 ",
- 1
- /* TEXT */
- )
- ])) : $setup.state.orderPayload.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "total-num ss-font-30 text-red"
- }, [
- $setup.state.orderPayload.spuPayType == 2 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _imports_0$6,
- style: { "width": "30rpx", "height": "30rpx" }
- })) : vue.createCommentVNode("v-if", true),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.state.usedPoint) + " ¥0.01 ",
- 1
- /* TEXT */
- )
- ])) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "total-num ss-font-30 text-red"
- },
- " ¥" + vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.price.payPrice - 100 * $setup.state.usedPoint - 100 * $setup.state.usedConsumptionPoints)),
- 1
- /* TEXT */
- ))
- ]),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button ui-BG-Main-Gradient ss-r-40 submit-btn ui-Shadow-Main",
- onClick: $setup.onConfirm
- },
- vue.toDisplayString($setup.t("confirm.submit_order")),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesOrderConfirm = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["render", _sfc_render$1s], ["__scopeId", "data-v-324e7894"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/confirm.vue"]]);
- const _sfc_main$1s = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- const pagination = {
- list: [],
- current_page: 1,
- total: 1,
- last_page: 1
- };
- const state = vue.reactive({
- currentTab: 0,
- // 选中的 tabMaps 下标
- pagination: {
- list: [],
- current_page: 1,
- total: 1,
- last_page: 1
- },
- loadStatus: ""
- });
- const tabMaps = vue.reactive([
- {
- name: t$6("order.all_orders"),
- num: 0,
- isShow: false
- },
- {
- name: t$6("order.pending_payment"),
- value: 0,
- num: 0,
- isShow: true
- },
- {
- name: t$6("order.pending_shipment"),
- value: 10,
- num: 0,
- isShow: true
- },
- {
- name: t$6("order.pending_receipt"),
- value: 20,
- num: 0,
- isShow: true
- },
- {
- name: t$6("order.pending_review"),
- value: 30,
- num: 0,
- isShow: true
- }
- ]);
- function onTabsChange(e2) {
- if (state.currentTab === e2.index) {
- return;
- }
- state.pagination.list = [];
- state.pagination.current_page = 1;
- state.pagination.total = 1;
- state.pagination.last_page = 1;
- state.currentTab = e2.index;
- getOrderList();
- }
- function onOrderDetail(id) {
- sheep$1.$router.go("/pages/order/detail", {
- id
- });
- }
- function onOrderGroupon(order2) {
- sheep$1.$router.go("/pages/activity/groupon/detail", {
- id: order2.ext.groupon_id
- });
- }
- function onPay(id) {
- sheep$1.$router.go("/pages/pay/index", {
- id,
- type: 1,
- openType: 2
- });
- }
- function onComment(id) {
- sheep$1.$router.go("/pages/goods/comment/add", {
- id
- });
- }
- async function onConfirm(order2, ignore = false) {
- let isOpenBusinessView = true;
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("order.confirm_receipt_question"),
- success: async function(res) {
- if (res.confirm) {
- if (sheep$1.$platform.name === "WechatMiniProgram" && !lodashExports.isEmpty(order2.wechat_extra_data) && isOpenBusinessView && !ignore) {
- mpConfirm(order2);
- return;
- }
- const {
- code: code2
- } = await OrderApi.receiveOrder(order2.id);
- if (code2 === 0) {
- state.pagination = pagination;
- await getOrderList();
- }
- }
- }
- });
- }
- async function onExpress(id) {
- sheep$1.$router.go("/pages/order/express/log", {
- id
- });
- }
- async function onCancel(orderId) {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("order.confirm_cancel_order"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await OrderApi.cancelOrder(orderId);
- if (code2 === 0) {
- let index2 = state.pagination.list.findIndex((order2) => order2.id === orderId);
- const orderInfo = state.pagination.list[index2];
- orderInfo.status = 40;
- handleOrderButtons(orderInfo);
- state.pagination = pagination;
- await getOrderList();
- }
- }
- });
- }
- function onDelete(orderId) {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("order.confirm_delete_order"),
- success: async function(res) {
- if (res.confirm) {
- const {
- code: code2
- } = await OrderApi.deleteOrder(orderId);
- if (code2 === 0) {
- let index2 = state.pagination.list.findIndex((order2) => order2.id === orderId);
- state.pagination.list.splice(index2, 1);
- await getOrderList();
- }
- }
- }
- });
- }
- async function getOrderCount() {
- let { data } = await OrderApi.getOrderCount();
- tabMaps[0].num = data.allCount;
- tabMaps[1].num = data.unpaidCount;
- tabMaps[2].num = data.undeliveredCount;
- tabMaps[3].num = data.deliveredCount;
- tabMaps[4].num = data.uncommentedCount;
- }
- async function getOrderList(page2 = 1, list_rows = 5) {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await OrderApi.getOrderPage({
- pageNo: page2,
- pageSize: list_rows,
- status: tabMaps[state.currentTab].value,
- commentStatus: tabMaps[state.currentTab].value === 30 ? false : null
- });
- getOrderCount();
- if (code2 !== 0) {
- return;
- }
- let orderList = _$1.concat(state.pagination.list, data.list);
- data.list.forEach((order2) => handleOrderButtons(order2));
- state.pagination.list = orderList;
- state.pagination.total = data.total;
- state.pagination.last_page = Math.ceil(data.total / 5);
- if (state.pagination.current_page < state.pagination.last_page) {
- state.loadStatus = "more";
- } else {
- state.loadStatus = "noMore";
- }
- }
- onLoad(async (options2) => {
- if (options2.points !== void 0 || options2.scoialStatus !== void 0) {
- showWalletModal({ points: options2.points, socialStatus: options2.socialStatus });
- }
- if (options2.type) {
- state.currentTab = options2.type;
- }
- await getOrderList();
- });
- onShow(async () => {
- if (state.loadStatus == "loading") {
- return;
- }
- state.pagination.list = [];
- state.pagination.current_page = 1;
- state.pagination.total = 1;
- state.pagination.last_page = 1;
- await getOrderList();
- });
- function loadMore() {
- if (state.loadStatus !== "noMore") {
- state.pagination.current_page += 1;
- getOrderList(state.pagination.current_page);
- }
- }
- onReachBottom(() => {
- loadMore();
- });
- onPullDownRefresh(() => {
- state.pagination.list = [];
- state.pagination.current_page = 1;
- state.pagination.total = 1;
- state.pagination.last_page = 1;
- getOrderList();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 800);
- });
- const __returned__ = { pagination, state, tabMaps, onTabsChange, onOrderDetail, onOrderGroupon, onPay, onComment, onConfirm, onExpress, onCancel, onDelete, getOrderCount, getOrderList, loadMore, reactive: vue.reactive, computed: vue.computed, watchEffect: vue.watchEffect, get onLoad() {
- return onLoad;
- }, get onShow() {
- return onShow;
- }, get onReachBottom() {
- return onReachBottom;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get fen2yuan() {
- return fen2yuan;
- }, get formatOrderColor() {
- return formatOrderColor;
- }, get formatOrderStatus() {
- return formatOrderStatus;
- }, get handleOrderButtons() {
- return handleOrderButtons;
- }, get sheep() {
- return sheep$1;
- }, get _() {
- return _$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, get OrderApi() {
- return OrderApi;
- }, get showWalletModal() {
- return showWalletModal;
- }, get colseWalletModal() {
- return colseWalletModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1r(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("order.my_orders")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_sticky, { bgColor: "#fff" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_tabs, {
- list: $setup.tabMaps,
- scrollable: false,
- onChange: $setup.onTabsChange,
- current: $setup.state.currentTab,
- badge: true
- }, null, 8, ["list", "current"])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/order-empty.png",
- text: $setup.t("order.no_orders")
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (order2, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20",
- key: order2.id,
- onClick: ($event) => $setup.onOrderDetail(order2.id)
- }, [
- vue.createElementVNode("view", { class: "order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20" }, [
- vue.createElementVNode(
- "view",
- { class: "order-no" },
- vue.toDisplayString($setup.t("order.order_number")) + ":" + vue.toDisplayString(order2.no),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["order-state ss-font-26", $setup.formatOrderColor(order2)])
- },
- vue.toDisplayString($setup.formatOrderStatus(order2)),
- 3
- /* TEXT, CLASS */
- )
- ]),
- vue.createCommentVNode(" {{order.deliveryType}} "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(order2.items, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "border-bottom",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_item, {
- img: item.picUrl,
- title: item.spuName,
- skuText: item.properties.map((property) => property.valueName).join(" "),
- price: item.spuPayType === 2 ? item.highPrecisionPrice : item.price,
- num: item.count,
- virtualPirce: item.spuPayType === 2
- }, null, 8, ["img", "title", "skuText", "price", "num", "virtualPirce"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode("view", { class: "pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "discounts-title pay-color" },
- vue.toDisplayString($setup.t("order.total_items", { count: order2.productCount })) + " ,",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "discounts-money pay-color" },
- vue.toDisplayString($setup.t("order.total_amount")) + ":¥" + vue.toDisplayString($setup.fen2yuan(order2.payPrice)),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["order-card-footer ss-flex ss-col-center ss-p-x-20", order2.buttons.length > 3 ? "ss-row-between" : "ss-row-right"])
- },
- [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- order2.buttons.includes("combination") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onOrderGroupon(order2), ["stop"])
- }, vue.toDisplayString($setup.t("order.group_details")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.buttons.length === 0 ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onOrderDetail(order2.id), ["stop"])
- }, vue.toDisplayString($setup.t("order.view_details")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.buttons.includes("express") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 2,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onExpress(order2.id), ["stop"])
- }, vue.toDisplayString($setup.t("order.view_logistics")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.buttons.includes("confirm") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 3,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onConfirm(order2), ["stop"])
- }, vue.toDisplayString($setup.t("order.confirm_receipt")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.buttons.includes("cancel") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 4,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onCancel(order2.id), ["stop"])
- }, vue.toDisplayString($setup.t("order.cancel_order")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.buttons.includes("comment") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 5,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onComment(order2.id), ["stop"])
- }, vue.toDisplayString($setup.t("order.review_order")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.buttons.includes("delete") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 6,
- class: "delete-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onDelete(order2.id), ["stop"])
- }, vue.toDisplayString($setup.t("order.delete_order")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.buttons.includes("pay") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 7,
- class: "tool-btn ss-reset-button ui-BG-Main-Gradient",
- onClick: vue.withModifiers(($event) => $setup.onPay(order2.payOrderId), ["stop"])
- }, vue.toDisplayString($setup.t("order.continue_payment")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 2
- /* CLASS */
- )
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 加载更多 "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: _ctx.loadmore
- }, null, 8, ["status", "onClick"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesOrderList = /* @__PURE__ */ _export_sfc(_sfc_main$1s, [["render", _sfc_render$1r], ["__scopeId", "data-v-456ecf67"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/list.vue"]]);
- const _sfc_main$1r = {
- __name: "apply",
- setup(__props, { expose: __expose }) {
- __expose();
- const form = vue.ref(null);
- const state = vue.reactive({
- orderId: 0,
- // 订单编号
- itemId: 0,
- // 订单项编号
- order: {},
- // 订单
- item: {},
- // 订单项
- config: {},
- // 交易配置
- // 售后类型
- wayList: [
- // {
- // text: t('order.refund_only')
- // value: '10',
- // },
- {
- text: t$6("order.refund_and_return"),
- value: "20"
- }
- ],
- reasonList: [],
- // 可选的申请原因数组
- showModal: false,
- // 是否显示申请原因弹窗
- currentValue: ""
- // 当前选择的售后原因
- });
- const formData = vue.reactive({
- way: "",
- applyReason: "",
- applyDescription: "",
- applyPicUrls: []
- });
- const rules2 = vue.reactive({});
- async function submit() {
- if (formData.way == "") {
- uni.showToast({
- title: t$6("order.select_after_sales_type"),
- icon: "error",
- duration: 1e3
- });
- return false;
- }
- if (state.currentValue == "") {
- uni.showToast({
- title: t$6("order.reason_for_application"),
- icon: "error",
- duration: 1e3
- });
- return false;
- }
- if (formData.applyDescription == "") {
- uni.showToast({
- title: t$6("order.please_fill_in_description"),
- icon: "error",
- duration: 1e3
- });
- return false;
- }
- let data = {
- orderItemId: state.itemId,
- refundPrice: state.item.payPrice,
- ...formData
- };
- const { code: code2 } = await AfterSaleApi.createAfterSale(data);
- if (code2 === 0) {
- uni.showToast({
- title: t$6("wallet.application_successful")
- });
- sheep$1.$router.go("/pages/order/aftersale/list");
- }
- }
- function onRefundChange(e2) {
- formData.way = e2.detail.value;
- state.reasonList = formData.way === "10" ? state.config.afterSaleRefundReasons || [] : state.config.afterSaleReturnReasons || [];
- formData.applyReason = "";
- state.currentValue = "";
- }
- function onChange(e2) {
- state.currentValue = e2.detail.value;
- }
- function onReason() {
- formData.applyReason = state.currentValue;
- state.showModal = false;
- }
- onLoad(async (options2) => {
- if (!options2.orderId || !options2.itemId) {
- sheep$1.$helper.toast(`缺少订单信息,请检查`);
- return;
- }
- state.orderId = options2.orderId;
- state.itemId = parseInt(options2.itemId);
- const { code: code2, data } = await OrderApi.getOrder(state.orderId);
- if (code2 !== 0) {
- return;
- }
- state.order = data;
- state.item = data.items.find((item) => item.id === state.itemId) || {};
- if (state.order.status === 10) {
- state.wayList.splice(1, 1);
- }
- state.config = (await TradeConfigApi.getTradeConfig()).data;
- formData.way = "20";
- formData.type = "20";
- state.reasonList = state.config.afterSaleReturnReasons || [];
- });
- const __returned__ = { form, state, formData, rules: rules2, submit, onRefundChange, onChange, onReason, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, ref: vue.ref, get OrderApi() {
- return OrderApi;
- }, get TradeConfigApi() {
- return TradeConfigApi;
- }, get fen2yuan() {
- return fen2yuan;
- }, get AfterSaleApi() {
- return AfterSaleApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1q(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_s_uploader = resolveEasycom(vue.resolveDynamicComponent("s-uploader"), __easycom_3$4);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("order.apply_for_after_sales")
- }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createCommentVNode(" 售后商品 "),
- vue.createElementVNode("view", { class: "goods-box" }, [
- vue.createVNode(_component_s_goods_item, {
- img: $setup.state.item.picUrl,
- title: $setup.state.item.spuName,
- skuText: (_a2 = $setup.state.item.properties) == null ? void 0 : _a2.map((property) => property.valueName).join(" "),
- price: $setup.state.item.price,
- num: $setup.state.item.count
- }, null, 8, ["img", "title", "skuText", "price", "num"])
- ]),
- vue.createVNode(_component_uni_forms, {
- ref: "form",
- modelValue: $setup.formData,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.formData = $event),
- rules: $setup.rules,
- "label-position": "top"
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 售后类型 "),
- vue.createElementVNode("view", { class: "refund-item" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title ss-m-b-20" },
- vue.toDisplayString($setup.t("order.after_sales_type")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex-col" }, [
- vue.createElementVNode(
- "radio-group",
- { onChange: $setup.onRefundChange },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.wayList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("label", {
- class: "ss-flex ss-col-center ss-p-y-10",
- key: index2
- }, [
- vue.createElementVNode("radio", {
- checked: $setup.formData.type === item.value,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- value: item.value
- }, null, 8, ["checked", "value"]),
- vue.createElementVNode(
- "view",
- { class: "item-value ss-m-l-8" },
- vue.toDisplayString(item.text),
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ]),
- vue.createCommentVNode(" 退款金额 "),
- vue.createElementVNode("view", {
- class: "refund-item ss-flex ss-col-center ss-row-between",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.showModal = true)
- }, [
- vue.createElementVNode(
- "text",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.refund_amount")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex refund-cause ss-col-center" }, [
- vue.createElementVNode(
- "text",
- { class: "ss-m-r-20" },
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.item.payPrice)),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(" 申请原因 "),
- vue.createElementVNode("view", {
- class: "refund-item ss-flex ss-col-center ss-row-between",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.state.showModal = true)
- }, [
- vue.createElementVNode(
- "text",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.application_reason")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex refund-cause ss-col-center" }, [
- $setup.formData.applyReason ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "ss-m-r-20"
- },
- vue.toDisplayString($setup.formData.applyReason),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "ss-m-r-20"
- },
- vue.toDisplayString($setup.t("order.select_reason_for_application")),
- 1
- /* TEXT */
- )),
- vue.createElementVNode("text", {
- class: "cicon-forward",
- style: { "height": "28rpx" }
- })
- ])
- ]),
- vue.createCommentVNode(" 留言 "),
- vue.createElementVNode("view", { class: "refund-item" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title ss-m-b-20" },
- vue.toDisplayString($setup.t("order.related_description")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "describe-box" }, [
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- class: "describe-content",
- type: "textarea",
- maxlength: "120",
- autoHeight: "",
- modelValue: $setup.formData.applyDescription,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.formData.applyDescription = $event),
- placeholder: $setup.t("order.customer_prompt")
- }, null, 8, ["modelValue", "placeholder"]),
- vue.createCommentVNode(" TODO 非繁人:上传的测试 "),
- vue.createElementVNode("view", { class: "upload-img" }, [
- vue.createVNode(_component_s_uploader, {
- url: $setup.formData.applyPicUrls,
- "onUpdate:url": _cache[3] || (_cache[3] = ($event) => $setup.formData.applyPicUrls = $event),
- fileMediatype: "image",
- limit: "9",
- mode: "grid",
- imageStyles: { width: "168rpx", height: "168rpx" }
- }, null, 8, ["url"])
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "rules"]),
- vue.createCommentVNode(" 底部按钮 "),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: ""
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "foot-wrap" }, [
- vue.createElementVNode("view", { class: "foot_box ss-flex ss-col-center ss-row-between ss-p-x-30" }, [
- vue.createCommentVNode(` <button class="ss-reset-button contcat-btn" @tap="sheep.$router.go('/pages/chat/index')">
- 联系客服
- </button> `),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button ui-BG-Main-Gradient sub-btn",
- onClick: $setup.submit
- },
- vue.toDisplayString($setup.t("common.submit")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(" 申请原因弹窗 "),
- vue.createVNode(_component_su_popup, {
- show: $setup.state.showModal,
- round: "10",
- showClose: true,
- onClose: _cache[5] || (_cache[5] = ($event) => $setup.state.showModal = false)
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "modal-box page_box" }, [
- vue.createElementVNode(
- "view",
- { class: "modal-head item-title head_box ss-flex ss-row-center ss-col-center" },
- vue.toDisplayString($setup.t("order.application_reason")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "modal-content content_box" }, [
- vue.createElementVNode(
- "radio-group",
- { onChange: $setup.onChange },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.reasonList, (item) => {
- return vue.openBlock(), vue.createElementBlock("label", {
- class: "radio ss-flex ss-col-center",
- key: item
- }, [
- vue.createElementVNode(
- "view",
- { class: "ss-flex-1 ss-p-20" },
- vue.toDisplayString(item),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("radio", {
- value: item,
- color: "var(--ui-BG-Main)",
- checked: item === $setup.state.currentValue
- }, null, 8, ["value", "checked"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ]),
- vue.createElementVNode("view", { class: "modal-foot foot_box ss-flex ss-row-center ss-col-center" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button close-btn ui-BG-Main-Gradient",
- onClick: $setup.onReason
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesOrderAftersaleApply = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["render", _sfc_render$1q], ["__scopeId", "data-v-5be4d0ee"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/aftersale/apply.vue"]]);
- const _sfc_main$1q = {
- __name: "return-delivery",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- id: 0,
- // 售后编号
- expressIndex: 0,
- // 选中的 expresses 下标
- expresses: []
- // 可选的快递列表
- });
- function bindPickerChange(e2) {
- state.expressIndex = e2.detail.value;
- }
- async function subRefund(e2) {
- if (!state.expresses[state.expressIndex].id) {
- sheep$1.$helper.toast(`请选择物流公司`);
- return false;
- }
- if (!e2.detail.value.logisticsNo) {
- sheep$1.$helper.toast(`请填写物流单号`);
- return false;
- }
- let data = {
- id: state.id,
- logisticsId: state.expresses[state.expressIndex].id,
- logisticsNo: e2.detail.value.logisticsNo
- };
- const {
- code: code2
- } = await AfterSaleApi.deliveryAfterSale(data);
- if (code2 !== 0) {
- return;
- }
- uni.showToast({
- title: "填写退货成功"
- });
- sheep$1.$router.go("/pages/order/aftersale/detail", {
- id: state.id
- });
- }
- async function getExpressList() {
- const {
- code: code2,
- data
- } = await DeliveryApi.getDeliveryExpressList();
- if (code2 !== 0) {
- return;
- }
- state.expresses = data;
- state.expresses.unshift({
- "id": 0,
- "name": "请选择"
- });
- }
- onLoad((options2) => {
- if (!options2.id) {
- sheep$1.$helper.toast(`缺少订单信息,请检查`);
- return;
- }
- state.id = options2.id;
- getExpressList();
- });
- const __returned__ = { state, bindPickerChange, subRefund, getExpressList, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get AfterSaleApi() {
- return AfterSaleApi;
- }, get DeliveryApi() {
- return DeliveryApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1p(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, { title: "退货物流" }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "form",
- {
- onSubmit: $setup.subRefund,
- "report-submit": "true"
- },
- [
- vue.createElementVNode("view", { class: "apply-return" }, [
- vue.createElementVNode("view", { class: "list borRadius14" }, [
- vue.createElementVNode("view", {
- class: "item acea-row row-between-wrapper",
- style: { "display": "flex", "align-items": "center" }
- }, [
- vue.createElementVNode("view", null, "物流公司"),
- vue.createElementVNode("picker", {
- mode: "selector",
- class: "num",
- onChange: $setup.bindPickerChange,
- value: $setup.state.expressIndex,
- range: $setup.state.expresses,
- "range-key": "name"
- }, [
- vue.createElementVNode("view", {
- class: "picker acea-row row-between-wrapper",
- style: { "display": "flex", "align-items": "center" }
- }, [
- vue.createElementVNode(
- "view",
- { class: "reason" },
- vue.toDisplayString((_a2 = $setup.state.expresses[$setup.state.expressIndex]) == null ? void 0 : _a2.name),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(" TODO 非繁人:这里样式有问题,少了 > 按钮 "),
- vue.createElementVNode("image", {
- src: _imports_0$9,
- class: "select-icon"
- })
- ])
- ], 40, ["value", "range"])
- ]),
- vue.createElementVNode("view", {
- class: "item textarea acea-row row-between",
- style: { "display": "flex", "align-items": "center" }
- }, [
- vue.createElementVNode("view", null, "物流单号"),
- vue.createElementVNode("input", {
- placeholder: "请填写物流单号",
- class: "num",
- name: "logisticsNo",
- "placeholder-class": "placeholder"
- })
- ]),
- vue.createElementVNode("button", {
- class: "returnBnt bg-color ss-reset-button ui-BG-Main-Gradient sub-btn",
- "form-type": "submit",
- style: { "background": "linear-gradient(90deg,var(--ui-BG-Main),var(--ui-BG-Main-gradient))!important" }
- }, "提交")
- ])
- ])
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ];
- }),
- _: 1
- /* STABLE */
- });
- }
- const PagesOrderAftersaleReturnDelivery = /* @__PURE__ */ _export_sfc(_sfc_main$1q, [["render", _sfc_render$1p], ["__scopeId", "data-v-e2252b3c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/aftersale/return-delivery.vue"]]);
- const _sfc_main$1p = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- const paginationNull = {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 10
- };
- const state = vue.reactive({
- currentTab: 0,
- showApply: false,
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 10
- },
- loadStatus: ""
- });
- const tabMaps = [
- {
- name: t$6("common.all"),
- value: "all"
- }
- // {
- // name: '申请中',
- // value: 'nooper',
- // },
- // {
- // name: '处理中',
- // value: 'ing',
- // },
- // {
- // name: '已完成',
- // value: 'completed',
- // },
- // {
- // name: '已拒绝',
- // value: 'refuse',
- // },
- ];
- function onTabsChange(e2) {
- state.pagination = paginationNull;
- state.currentTab = e2.index;
- getOrderList();
- }
- async function getOrderList() {
- state.loadStatus = "loading";
- let { data, code: code2 } = await AfterSaleApi.getAfterSalePage({
- // type: tabMaps[state.currentTab].value,
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- data.list.forEach((order2) => handleAfterSaleButtons(order2));
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- function onApply(orderId) {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("order.confirm_cancel_request"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const { code: code2 } = await AfterSaleApi.cancelAfterSale(orderId);
- if (code2 === 0) {
- state.pagination = paginationNull;
- await getOrderList();
- }
- }
- });
- }
- onLoad(async (options2) => {
- if (options2.type) {
- state.currentTab = options2.type;
- }
- await getOrderList();
- });
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getOrderList();
- }
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { paginationNull, state, tabMaps, onTabsChange, getOrderList, onApply, loadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, reactive: vue.reactive, get _() {
- return _$1;
- }, get formatAfterSaleStatus() {
- return formatAfterSaleStatus;
- }, get formatAfterSaleStatusDescription() {
- return formatAfterSaleStatusDescription;
- }, get handleAfterSaleButtons() {
- return handleAfterSaleButtons;
- }, get AfterSaleApi() {
- return AfterSaleApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1o(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("order.after_sales_list")
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" tab "),
- vue.createVNode(_component_su_sticky, { bgColor: "#fff" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_tabs, {
- list: $setup.tabMaps,
- scrollable: false,
- onChange: $setup.onTabsChange,
- current: $setup.state.currentTab
- }, null, 8, ["current"])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/data-empty.png",
- text: $setup.t("common.no_data")
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 列表 "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (order2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "list-box ss-m-y-20",
- key: order2.id,
- onClick: ($event) => $setup.sheep.$router.go("/pages/order/aftersale/detail", { id: order2.id })
- }, [
- vue.createElementVNode("view", { class: "order-head ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode(
- "text",
- { class: "no" },
- vue.toDisplayString($setup.t("order.service_order_number")) + ":" + vue.toDisplayString(order2.no),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "state" },
- vue.toDisplayString($setup.formatAfterSaleStatus(order2)),
- 1
- /* TEXT */
- )
- ]),
- vue.createVNode(_component_s_goods_item, {
- img: order2.picUrl,
- title: order2.spuName,
- skuText: order2.properties.map((property) => property.valueName).join(" "),
- price: order2.refundPrice
- }, null, 8, ["img", "title", "skuText", "price"]),
- vue.createElementVNode("view", { class: "apply-box ss-flex ss-col-center ss-row-between border-bottom ss-p-x-20" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "title ss-m-r-20" },
- vue.toDisplayString(order2.way === 10 ? $setup.t("order.refund_only") : $setup.t("order.refund_and_return")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "value" },
- vue.toDisplayString($setup.formatAfterSaleStatusDescription(order2)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("text", { class: "_icon-forward" })
- ]),
- vue.createElementVNode("view", { class: "tool-btn-box ss-flex ss-col-center ss-row-right ss-p-r-20" }, [
- vue.createCommentVNode(" TODO 功能缺失:填写退货信息 "),
- vue.createElementVNode("view", null, [
- (order2 == null ? void 0 : order2.buttons.includes("cancel")) ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "ss-reset-button tool-btn",
- onClick: vue.withModifiers(($event) => $setup.onApply(order2.id), ["stop"])
- }, vue.toDisplayString($setup.t("order.cancel_request")), 9, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesOrderAftersaleList = /* @__PURE__ */ _export_sfc(_sfc_main$1p, [["render", _sfc_render$1o], ["__scopeId", "data-v-c5e81116"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/aftersale/list.vue"]]);
- const _sfc_main$1o = {
- __name: "detail",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "915d84ff-headerBg": vue.unref(headerBg)
- }));
- const userInfo2 = sheep$1.$store("user").userInfo;
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const headerBg = sheep$1.$url.css("/static/img/shop/order/order_bg.png");
- const state = vue.reactive({
- id: 0,
- // 售后编号
- info: {},
- // 收货信息
- loading: false,
- active: 0,
- // 在 list 的激活位置
- list: [{
- title: t$6("order.submit_application")
- }, {
- title: t$6("order.processing")
- }, {
- title: t$6("order.completed")
- }]
- // 时间轴
- });
- function onApply(id) {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("order.confirm_cancel_request"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await AfterSaleApi.cancelAfterSale(id);
- if (code2 === 0) {
- await getDetail(id);
- }
- }
- });
- }
- const onCopy = () => {
- sheep$1.$helper.copyText(state.info.no);
- };
- async function getDetail(id) {
- state.loading = true;
- const {
- code: code2,
- data
- } = await AfterSaleApi.getAfterSale(id);
- if (code2 !== 0) {
- state.info = null;
- return;
- }
- state.info = data;
- handleAfterSaleButtons(state.info);
- if ([10].includes(state.info.status)) {
- state.active = 0;
- } else if ([20, 30, 40].includes(state.info.status)) {
- state.active = 1;
- } else if ([50].includes(state.info.status)) {
- state.active = 2;
- } else if ([61, 62, 63].includes(state.info.status)) {
- state.active = 2;
- }
- }
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- vue.watch(
- () => isLogin.value,
- (newVal) => {
- if (newVal) {
- window.location.reload();
- }
- }
- );
- onLoad((options2) => {
- if (!isLogin.value) {
- showAuthModal();
- sheep$1.$helper.toast(t$6("order.not_logged_in", { user: options2.username }), 3e3);
- } else {
- if (options2.username) {
- formatAppLog("log", "at pages/order/aftersale/detail.vue:236", JSON.parse(uni.getStorageSync("user-store")).userInfo.username);
- if (options2.username != JSON.parse(uni.getStorageSync("user-store")).userInfo.username) {
- sheep$1.$helper.toast(t$6("order.account_switch_needed", { user1: JSON.parse(uni.getStorageSync("user-store")).userInfo.username, user2: options2.username }), 3e3);
- }
- }
- }
- if (!options2.id) {
- sheep$1.$helper.toast(t$6("order.missing_order_info"));
- return;
- }
- state.id = options2.id;
- getDetail(options2.id);
- });
- const __returned__ = { userInfo: userInfo2, statusBarHeight, headerBg, state, onApply, onCopy, getDetail, isLogin, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, computed: vue.computed, watch: vue.watch, get isEmpty() {
- return lodashExports.isEmpty;
- }, get showAuthModal() {
- return showAuthModal;
- }, get fen2yuan() {
- return fen2yuan;
- }, get points2point() {
- return points2point;
- }, get formatAfterSaleStatusDescription() {
- return formatAfterSaleStatusDescription;
- }, get handleAfterSaleButtons() {
- return handleAfterSaleButtons;
- }, get AfterSaleApi() {
- return AfterSaleApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1n(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("order.after_sales_details"),
- navbar: !$setup.isEmpty($setup.state.info) && $setup.state.loading ? "inner" : "normal"
- }, {
- default: vue.withCtx(() => [
- !$setup.isEmpty($setup.state.info) && $setup.state.loading ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "content_box"
- }, [
- vue.createCommentVNode(" 步骤条 "),
- vue.createElementVNode(
- "view",
- {
- class: "steps-box ss-flex",
- style: vue.normalizeStyle([
- {
- marginTop: "-" + Number($setup.statusBarHeight + 88) + "rpx",
- paddingTop: Number($setup.statusBarHeight + 88) + "rpx"
- }
- ])
- },
- [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "steps-item",
- key: index2
- }, [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- $setup.state.list.length - 1 === index2 && [61, 62, 63].includes($setup.state.info.status) ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "sicon-circleclose"
- })) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: vue.normalizeClass(["sicon-circlecheck", $setup.state.active >= index2 ? "activity-color" : "info-color"])
- },
- null,
- 2
- /* CLASS */
- )),
- $setup.state.list.length - 1 !== index2 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: vue.normalizeClass(["line", $setup.state.active >= index2 ? "activity-bg" : "info-bg"])
- },
- null,
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["steps-item-title", $setup.state.active >= index2 ? "activity-color" : "info-color"])
- },
- vue.toDisplayString(item.title),
- 3
- /* TEXT, CLASS */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 服务状态 "),
- vue.createElementVNode("view", {
- class: "status-box ss-flex ss-col-center ss-row-between ss-m-x-20",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/order/aftersale/log", { id: $setup.state.id }))
- }, [
- vue.createElementVNode("view", { class: "" }, [
- vue.createElementVNode(
- "view",
- { class: "status-text" },
- vue.toDisplayString($setup.formatAfterSaleStatusDescription($setup.state.info)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "status-time" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat($setup.state.info.updateTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("text", {
- class: "ss-iconfont _icon-forward",
- style: { "color": "#666" }
- })
- ]),
- vue.createCommentVNode(" 退款金额 "),
- vue.createElementVNode("view", { class: "aftersale-content ss-m-y-20" }, [
- vue.createElementVNode("view", { class: "aftersale-item ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.total_refund")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "item-content" },
- " ¥" + vue.toDisplayString($setup.fen2yuan($setup.state.info.refundPriceTotal)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "aftersale-item ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.refund_amount")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "item-content" },
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.info.refundPrice)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "aftersale-item ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.refund_commission")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "item-content" },
- "¥" + vue.toDisplayString($setup.points2point($setup.state.info.refundIntegral)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "aftersale-item ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.refund_points")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "item-content" },
- "¥" + vue.toDisplayString($setup.points2point($setup.state.info.refundConsumptionPoints)),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(" 服务商品 "),
- vue.createElementVNode("view", { class: "order-shop" }, [
- vue.createVNode(_component_s_goods_item, {
- price: $setup.state.info.refundPriceTotal,
- img: $setup.state.info.picUrl,
- title: $setup.state.info.spuName,
- titleWidth: 480,
- skuText: $setup.state.info.properties.map((property) => property.valueName).join(" "),
- num: $setup.state.info.count
- }, null, 8, ["price", "img", "title", "skuText", "num"])
- ]),
- vue.createCommentVNode(" 服务内容 "),
- vue.createElementVNode("view", { class: "aftersale-content" }, [
- vue.createElementVNode("view", { class: "aftersale-item ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.service_order_number")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "item-content ss-m-r-16" },
- vue.toDisplayString($setup.state.info.no),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button copy-btn",
- onClick: $setup.onCopy
- },
- vue.toDisplayString($setup.t("order.copy")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "aftersale-item ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.application_time")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "item-content" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat($setup.state.info.createTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "aftersale-item ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.after_sales_type")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "item-content" },
- vue.toDisplayString($setup.state.info.way === 10 ? $setup.t("order.refund_only") : $setup.t("order.refund_and_return")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "aftersale-item ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.application_reason")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "item-content" },
- vue.toDisplayString($setup.state.info.applyReason),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "aftersale-item ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "item-title" },
- vue.toDisplayString($setup.t("order.related_description")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "item-content" },
- vue.toDisplayString($setup.state.info.applyDescription),
- 1
- /* TEXT */
- )
- ])
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 操作区 "),
- $setup.isEmpty($setup.state.info) && $setup.state.loading ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- icon: "/static/order-empty.png",
- text: $setup.t("order.no_after_sales_details")
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- !$setup.isEmpty($setup.state.info) ? (vue.openBlock(), vue.createBlock(_component_su_fixed, {
- key: 2,
- bottom: "",
- placeholder: "",
- bg: "bg-white"
- }, {
- default: vue.withCtx(() => {
- var _a2, _b2;
- return [
- vue.createElementVNode("view", { class: "foot_box" }, [
- ((_a2 = $setup.state.info.buttons) == null ? void 0 : _a2.includes("cancel")) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button btn",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.onApply($setup.state.info.id))
- },
- vue.toDisplayString($setup.t("order.cancel_request")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- ((_b2 = $setup.state.info.buttons) == null ? void 0 : _b2.includes("delivery")) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-reset-button btn",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.sheep.$router.go("/pages/order/aftersale/return-delivery", { id: $setup.state.info.id }))
- },
- vue.toDisplayString($setup.t("order.fill_return")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(` <button class="ss-reset-button contcat-btn btn" @tap="sheep.$router.go('/pages/chat/index')">
- 联系客服
- </button> `)
- ])
- ];
- }),
- _: 1
- /* STABLE */
- })) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title", "navbar"]);
- }
- const PagesOrderAftersaleDetail = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["render", _sfc_render$1n], ["__scopeId", "data-v-915d84ff"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/aftersale/detail.vue"]]);
- const _sfc_main$1n = {
- __name: "log-item",
- props: {
- item: {
- type: Object,
- // 当前日志
- default() {
- }
- },
- index: {
- type: Number,
- // item 在 data 的下标
- default: 0
- },
- data: {
- type: Object,
- // 日志列表
- default() {
- }
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1m(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "log-item ss-flex" }, [
- vue.createElementVNode("view", { class: "log-icon ss-flex-col ss-col-center ss-m-r-20" }, [
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["cicon-title", $props.index === 0 ? "activity-color" : ""])
- },
- null,
- 2
- /* CLASS */
- ),
- $props.data.length - 1 !== $props.index ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "line"
- })) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "view",
- { class: "text" },
- vue.toDisplayString($props.item.content),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "date" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat($props.item.createTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const logItem = /* @__PURE__ */ _export_sfc(_sfc_main$1n, [["render", _sfc_render$1m], ["__scopeId", "data-v-3a1a95e5"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/aftersale/log-item.vue"]]);
- const _sfc_main$1m = {
- __name: "log",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- list: []
- });
- async function getDetail(id) {
- const { data } = await AfterSaleApi.getAfterSaleLogList(id);
- state.list = data;
- }
- onLoad((options2) => {
- state.aftersaleId = options2.id;
- getDetail(options2.id);
- });
- const __returned__ = { state, getDetail, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, logItem, get AfterSaleApi() {
- return AfterSaleApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1l(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("order.after_sales_progress")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "log-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: item.id
- }, [
- vue.createVNode($setup["logItem"], {
- item,
- index: index2,
- data: $setup.state.list
- }, null, 8, ["item", "index", "data"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesOrderAftersaleLog = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["render", _sfc_render$1l], ["__scopeId", "data-v-2fedae8f"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/aftersale/log.vue"]]);
- const _sfc_main$1l = {
- name: "UniSwiperDot",
- emits: ["clickItem"],
- props: {
- info: {
- type: Array,
- default() {
- return [];
- }
- },
- current: {
- type: Number,
- default: 0
- },
- dotsStyles: {
- type: Object,
- default() {
- return {};
- }
- },
- // 类型 :default(默认) indexes long nav
- mode: {
- type: String,
- default: "default"
- },
- // 只在 nav 模式下生效,变量名称
- field: {
- type: String,
- default: ""
- }
- },
- data() {
- return {
- dots: {
- width: 6,
- height: 6,
- bottom: 10,
- color: "#fff",
- backgroundColor: "rgba(0, 0, 0, .3)",
- border: "1px rgba(0, 0, 0, .3) solid",
- selectedBackgroundColor: "#333",
- selectedBorder: "1px rgba(0, 0, 0, .9) solid"
- }
- };
- },
- watch: {
- dotsStyles(newVal) {
- this.dots = Object.assign(this.dots, this.dotsStyles);
- },
- mode(newVal) {
- if (newVal === "indexes") {
- this.dots.width = 14;
- this.dots.height = 14;
- } else {
- this.dots.width = 6;
- this.dots.height = 6;
- }
- }
- },
- created() {
- if (this.mode === "indexes") {
- this.dots.width = 12;
- this.dots.height = 12;
- }
- this.dots = Object.assign(this.dots, this.dotsStyles);
- },
- methods: {
- clickItem(index2) {
- this.$emit("clickItem", index2);
- }
- }
- };
- function _sfc_render$1k(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-swiper__warp" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- $props.mode === "default" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle({ "bottom": $data.dots.bottom + "px" }),
- class: "uni-swiper__dots-box",
- key: "default"
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.info, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- onClick: ($event) => $options.clickItem(index2),
- style: vue.normalizeStyle({
- "width": (index2 === $props.current ? $data.dots.width * 2 : $data.dots.width) + "px",
- "height": $data.dots.width / 2 + "px",
- "background-color": index2 !== $props.current ? $data.dots.backgroundColor : $data.dots.selectedBackgroundColor,
- "border-radius": "0px"
- }),
- key: index2,
- class: "uni-swiper__dots-item uni-swiper__dots-bar"
- }, null, 12, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.mode === "dot" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle({ "bottom": $data.dots.bottom + "px" }),
- class: "uni-swiper__dots-box",
- key: "dot"
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.info, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- onClick: ($event) => $options.clickItem(index2),
- style: vue.normalizeStyle({
- "width": $data.dots.width + "px",
- "height": $data.dots.height + "px",
- "background-color": index2 !== $props.current ? $data.dots.backgroundColor : $data.dots.selectedBackgroundColor,
- "border": index2 !== $props.current ? $data.dots.border : $data.dots.selectedBorder
- }),
- key: index2,
- class: "uni-swiper__dots-item"
- }, null, 12, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.mode === "round" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle({ "bottom": $data.dots.bottom + "px" }),
- class: "uni-swiper__dots-box",
- key: "round"
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.info, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- onClick: ($event) => $options.clickItem(index2),
- class: vue.normalizeClass([[index2 === $props.current && "uni-swiper__dots-long"], "uni-swiper__dots-item"]),
- style: vue.normalizeStyle({
- "width": (index2 === $props.current ? $data.dots.width * 3 : $data.dots.width) + "px",
- "height": $data.dots.height + "px",
- "background-color": index2 !== $props.current ? $data.dots.backgroundColor : $data.dots.selectedBackgroundColor,
- "border": index2 !== $props.current ? $data.dots.border : $data.dots.selectedBorder
- }),
- key: index2
- }, null, 14, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.mode === "nav" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: "nav",
- style: vue.normalizeStyle({ "background-color": $props.dotsStyles.backgroundColor, "bottom": "0" }),
- class: "uni-swiper__dots-box uni-swiper__dots-nav"
- },
- [
- vue.createElementVNode(
- "text",
- {
- style: vue.normalizeStyle({ "color": $props.dotsStyles.color }),
- class: "uni-swiper__dots-nav-item"
- },
- vue.toDisplayString($props.current + 1 + "/" + $props.info.length + " " + $props.info[$props.current][$props.field]),
- 5
- /* TEXT, STYLE */
- )
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.mode === "indexes" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: "indexes",
- style: vue.normalizeStyle({ "bottom": $data.dots.bottom + "px" }),
- class: "uni-swiper__dots-box"
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.info, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- onClick: ($event) => $options.clickItem(index2),
- style: vue.normalizeStyle({
- "width": $data.dots.width + "px",
- "height": $data.dots.height + "px",
- "color": index2 === $props.current ? $data.dots.selectedColor : $data.dots.color,
- "background-color": index2 !== $props.current ? $data.dots.backgroundColor : $data.dots.selectedBackgroundColor,
- "border": index2 !== $props.current ? $data.dots.border : $data.dots.selectedBorder
- }),
- key: index2,
- class: "uni-swiper__dots-item uni-swiper__dots-indexes"
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-swiper__dots-indexes-text" },
- vue.toDisplayString(index2 + 1),
- 1
- /* TEXT */
- )
- ], 12, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_0$6 = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["render", _sfc_render$1k], ["__scopeId", "data-v-0667e3db"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue"]]);
- const _sfc_main$1k = {
- __name: "log",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- info: [],
- tracks: []
- });
- const goodsImages = vue.computed(() => {
- let array2 = [];
- if (state.info.items) {
- state.info.items.forEach((item) => {
- array2.push({
- image: item.picUrl
- });
- });
- }
- return array2;
- });
- async function getExpressDetail(id) {
- const {
- data
- } = await OrderApi.getOrderExpressTrackList(id);
- state.tracks = data;
- }
- async function getOrderDetail(id) {
- const {
- data
- } = await OrderApi.getOrder(id);
- state.info = data;
- }
- onLoad((options2) => {
- getExpressDetail(options2.id);
- getOrderDetail(options2.id);
- });
- const __returned__ = { state, goodsImages, getExpressDetail, getOrderDetail, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, computed: vue.computed, reactive: vue.reactive, get OrderApi() {
- return OrderApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1j(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_swiper_dot = resolveEasycom(vue.resolveDynamicComponent("uni-swiper-dot"), __easycom_0$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("order.logistics_tracking")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "log-wrap" }, [
- vue.createCommentVNode(" 商品信息 "),
- $setup.goodsImages.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "log-card ss-flex ss-m-20 ss-r-10"
- }, [
- vue.createVNode(_component_uni_swiper_dot, {
- info: $setup.goodsImages,
- current: $setup.state.current,
- mode: "round"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("swiper", { class: "swiper-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.goodsImages, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("swiper-item", { key: index2 }, [
- vue.createElementVNode("view", {
- class: "image-container",
- style: { "width": "100%", "height": "100%" }
- }, [
- vue.createElementVNode("view", { style: { "width": "100%", "height": "106rpx", "padding-top": "15%" } }, [
- vue.createElementVNode("image", {
- class: "log-card-img",
- mode: "aspectFill",
- src: $setup.sheep.$url.static(item.image),
- style: { "width": "100%", "height": "100%", "object-fit": "cover" }
- }, null, 8, ["src"])
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["info", "current"]),
- vue.createElementVNode("view", { class: "log-card-msg" }, [
- vue.createCommentVNode(" TODO 非繁人:优化点:展示状态 "),
- vue.createCommentVNode(' <view class="ss-flex ss-m-b-8">'),
- vue.createCommentVNode(" <view>物流状态:</view>"),
- vue.createCommentVNode(' <view class="warning-color">{{ state.info.status_text }}</view>'),
- vue.createCommentVNode(" </view>"),
- vue.createElementVNode(
- "view",
- { class: "ss-m-b-16 TrackingNumber" },
- vue.toDisplayString(_ctx.$t("order.tracking_number") + ":" + $setup.state.info.logisticsNo),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "ss-m-b-16" },
- vue.toDisplayString(_ctx.$t("order.courier_company") + ":" + $setup.state.info.logisticsName),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString(_ctx.$t("order.shipping_time") + ":" + $setup.sheep.$helper.timeFormat($setup.state.info.deliveryTime, "yyyy-mm-dd hh:MM")),
- 1
- /* TEXT */
- )
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 物流轨迹 "),
- vue.createElementVNode("view", { class: "log-content ss-m-20 ss-r-10" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.tracks, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "log-content-box ss-flex",
- key: item.title
- }, [
- vue.createElementVNode("view", { class: "log-icon ss-flex-col ss-col-center ss-m-r-20" }, [
- vue.createElementVNode("text", { class: "cicon-title" }),
- $setup.state.tracks.length - 1 !== index2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "line"
- })) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", { class: "log-content-msg" }, [
- vue.createCommentVNode(" TODO 非繁人:优化点:展示状态 "),
- vue.createCommentVNode(' <view class="log-msg-title ss-m-b-20">'),
- vue.createCommentVNode(" {{ item.status_text }}"),
- vue.createCommentVNode(" </view>"),
- vue.createElementVNode(
- "view",
- { class: "log-msg-desc ss-m-b-16" },
- vue.toDisplayString(item.content),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "log-msg-date ss-m-b-40" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat(item.time, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesOrderExpressLog = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["render", _sfc_render$1j], ["__scopeId", "data-v-d9d25552"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/express/log.vue"]]);
- const _sfc_main$1j = {
- __name: "otherlist",
- setup(__props, { expose: __expose }) {
- __expose();
- const tradeManaged = vue.computed(() => sheep$1.$store("app").has_wechat_trade_managed);
- const pagination = {
- data: [],
- current_page: 1,
- total: 1,
- last_page: 1
- };
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- data: [],
- current_page: 1,
- total: 1,
- last_page: 1
- },
- loadStatus: "",
- deleteOrderId: 0,
- error: 0
- });
- const tabMaps = [
- {
- name: "全部",
- value: "all"
- },
- {
- name: "待付款",
- value: "unpaid"
- },
- {
- name: "待发货",
- value: "nosend"
- },
- {
- name: "待收货",
- value: "noget"
- },
- {
- name: "待评价",
- value: "nocomment"
- }
- ];
- function onTabsChange(e2) {
- if (state.currentTab === e2.index)
- return;
- state.pagination = pagination;
- state.currentTab = e2.index;
- getOrderList();
- }
- function onOrderDetail(orderSN) {
- sheep$1.$router.go("/pages/order/detail", {
- orderSN
- });
- }
- function onOrderGroupon(order2) {
- sheep$1.$router.go("/pages/activity/groupon/detail", {
- id: order2.ext.groupon_id
- });
- }
- function onOrderInvoice(invoiceId) {
- sheep$1.$router.go("/pages/order/invoice", {
- invoiceId
- });
- }
- function onPay(orderSN) {
- sheep$1.$router.go("/pages/pay/index", {
- orderSN
- });
- }
- function onComment(orderSN) {
- sheep$1.$router.go("/pages/goods/comment/add", {
- orderSN
- });
- }
- async function onConfirm(order2, ignore = false) {
- if (sheep$1.$platform.name === "WechatMiniProgram" && !lodashExports.isEmpty(order2.wechat_extra_data) && tradeManaged.value === 1 && !ignore) {
- mpConfirm(order2);
- return;
- }
- const { error: error2 } = await sheep$1.$api.order.confirm(order2.id);
- if (error2 === 0) {
- state.pagination = pagination;
- getOrderList();
- }
- }
- async function onExpress(orderId) {
- sheep$1.$router.go("/pages/order/express/list", {
- orderId
- });
- }
- async function onCancel(orderId) {
- uni.showModal({
- title: "提示",
- content: "确定要取消订单吗?",
- success: async function(res) {
- if (res.confirm) {
- const { error: error2, data } = await sheep$1.$api.order.cancel(orderId);
- if (error2 === 0) {
- let index2 = state.pagination.data.findIndex((order2) => order2.id === orderId);
- state.pagination.data[index2] = data;
- }
- }
- }
- });
- }
- function onDelete(orderId) {
- uni.showModal({
- title: "提示",
- content: "确定要删除订单吗?",
- success: async function(res) {
- if (res.confirm) {
- const { error: error2, data } = await sheep$1.$api.order.delete(orderId);
- if (error2 === 0) {
- let index2 = state.pagination.data.findIndex((order2) => order2.id === orderId);
- state.pagination.data.splice(index2, 1);
- }
- }
- }
- });
- }
- async function onRefund(orderId) {
- uni.showModal({
- title: "提示",
- content: "确定要申请退款吗?",
- success: async function(res) {
- if (res.confirm) {
- const { error: error2, data } = await sheep$1.$api.order.applyRefund(orderId);
- if (error2 === 0) {
- let index2 = state.pagination.data.findIndex((order2) => order2.id === orderId);
- state.pagination.data[index2] = data;
- }
- }
- }
- });
- }
- async function getOrderList(page2 = 1, list_rows = 5) {
- state.loadStatus = "loading";
- let res = await sheep$1.$api.order.list({
- type: tabMaps[state.currentTab].value,
- list_rows,
- page: page2
- });
- state.error = res.error;
- if (res.error === 0) {
- let orderList = _$1.concat(state.pagination.data, res.data.data);
- state.pagination = {
- ...res.data,
- data: orderList
- };
- if (state.pagination.current_page < state.pagination.last_page) {
- state.loadStatus = "more";
- } else {
- state.loadStatus = "noMore";
- }
- }
- }
- onLoad(async (options2) => {
- if (options2.type) {
- state.currentTab = options2.type;
- }
- getOrderList();
- });
- function loadmore() {
- if (state.loadStatus !== "noMore") {
- getOrderList(state.pagination.current_page + 1);
- }
- }
- onReachBottom(() => {
- loadmore();
- });
- onPullDownRefresh(() => {
- state.pagination = pagination;
- getOrderList();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 800);
- });
- const __returned__ = { tradeManaged, pagination, state, tabMaps, onTabsChange, onOrderDetail, onOrderGroupon, onOrderInvoice, onPay, onComment, onConfirm, onExpress, onCancel, onDelete, onRefund, getOrderList, loadmore, computed: vue.computed, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get formatOrderColor() {
- return formatOrderColor;
- }, get sheep() {
- return sheep$1;
- }, get _() {
- return _$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1i(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, { title: "我的订单" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_sticky, { bgColor: "#fff" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_tabs, {
- list: $setup.tabMaps,
- scrollable: false,
- onChange: $setup.onTabsChange,
- current: $setup.state.currentTab
- }, null, 8, ["current"])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/order-empty.png",
- text: "暂无订单"
- })) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.data, (order2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20",
- key: order2.id,
- onClick: ($event) => $setup.onOrderDetail(order2.order_sn)
- }, [
- vue.createElementVNode("view", { class: "order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20" }, [
- vue.createElementVNode(
- "view",
- { class: "order-no" },
- "订单号:" + vue.toDisplayString(order2.order_sn),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["order-state ss-font-26", $setup.formatOrderColor(order2.status_code)])
- },
- vue.toDisplayString(order2.status_text),
- 3
- /* TEXT, CLASS */
- )
- ]),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(order2.items, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "border-bottom",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_item, {
- img: item.goods_image,
- title: item.goods_title,
- skuText: item.goods_sku_text,
- price: item.goods_price,
- score: order2.score_amount,
- num: item.goods_num
- }, {
- tool: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- item.btns.includes("aftersale") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "ss-reset-button apply-btn",
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go("/pages/order/aftersale/apply", {
- item: JSON.stringify(item)
- }), ["stop"])
- }, " 申请售后 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- item.btns.includes("re_aftersale") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button apply-btn",
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go("/pages/order/aftersale/apply", {
- item: JSON.stringify(item)
- }), ["stop"])
- }, " 重新售后 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- item.btns.includes("aftersale_info") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 2,
- class: "ss-reset-button apply-btn",
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go("/pages/order/aftersale/detail", {
- id: item.ext.aftersale_id
- }), ["stop"])
- }, " 售后详情 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- item.btns.includes("buy_again") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 3,
- class: "ss-reset-button apply-btn",
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go("/pages/goods/index", {
- id: item.goods_id
- }), ["stop"])
- }, " 再次购买 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["img", "title", "skuText", "price", "score", "num"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode("view", { class: "pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20" }, [
- order2.total_discount_fee > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "ss-flex ss-col-center ss-m-r-8"
- }, [
- vue.createElementVNode("view", { class: "discounts-title" }, "优惠:¥"),
- vue.createElementVNode(
- "view",
- { class: "discounts-money" },
- vue.toDisplayString(order2.total_discount_fee),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-m-r-8" }, [
- vue.createElementVNode("view", { class: "discounts-title" }, "运费:¥"),
- vue.createElementVNode(
- "view",
- { class: "discounts-money" },
- vue.toDisplayString(order2.dispatch_amount),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "discounts-title pay-color" }, "总金额:"),
- vue.createElementVNode(
- "view",
- { class: "discounts-money pay-color" },
- "¥" + vue.toDisplayString(order2.order_amount),
- 1
- /* TEXT */
- ),
- order2.score_amount ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, "+")) : vue.createCommentVNode("v-if", true),
- order2.score_amount ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "discounts-money pay-color ss-flex ss-col-center"
- }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/score1.svg"),
- class: "score-img"
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString(order2.score_amount),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["order-card-footer ss-flex ss-col-center ss-p-x-20", order2.btns.length > 3 ? "ss-row-between" : "ss-row-right"])
- },
- [
- vue.createCommentVNode(' <su-popover>\n <button class="more-btn ss-reset-button" @click.stop>更多</button>\n <template #content>\n <view class="more-item-box">\n <view class="more-item ss-flex ss-col-center ss-reset-button">\n <view class="item-title">删除订单</view>\n </view>\n <view class="more-item ss-flex ss-col-center ss-reset-button">\n <view class="item-title">查看发票</view>\n </view>\n <view class="more-item ss-flex ss-col-center ss-reset-button">\n <view class="item-title">评价晒单</view>\n </view>\n </view>\n </template>\n </su-popover> '),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- order2.btns.includes("groupon") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onOrderGroupon(order2), ["stop"])
- }, vue.toDisplayString(order2.status_code === "groupon_ing" ? "邀请拼团" : "拼团详情"), 9, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.includes("invoice") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => {
- var _a2;
- return $setup.onOrderInvoice((_a2 = order2.invoice) == null ? void 0 : _a2.id);
- }, ["stop"])
- }, " 查看发票 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.length === 0 ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 2,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onOrderDetail(order2.order_sn), ["stop"])
- }, " 查看详情 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.includes("confirm") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 3,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onConfirm(order2), ["stop"])
- }, " 确认收货 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.includes("express") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 4,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onExpress(order2.id), ["stop"])
- }, " 查看物流 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.includes("apply_refund") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 5,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onRefund(order2.id), ["stop"])
- }, " 申请退款 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.includes("re_apply_refund") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 6,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onRefund(order2.id), ["stop"])
- }, " 重新退款 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.includes("cancel") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 7,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onCancel(order2.id), ["stop"])
- }, " 取消订单 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.includes("comment") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 8,
- class: "tool-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onComment(order2.order_sn), ["stop"])
- }, " 评价晒单 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.includes("delete") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 9,
- class: "delete-btn ss-reset-button",
- onClick: vue.withModifiers(($event) => $setup.onDelete(order2.id), ["stop"])
- }, " 删除订单 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- order2.btns.includes("pay") ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 10,
- class: "tool-btn ss-reset-button ui-BG-Main-Gradient",
- onClick: vue.withModifiers(($event) => $setup.onPay(order2.order_sn), ["stop"])
- }, " 继续支付 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 2
- /* CLASS */
- )
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 加载更多 "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadmore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesOrderOtherlist = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["render", _sfc_render$1i], ["__scopeId", "data-v-ad14ec43"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/order/otherlist.vue"]]);
- const _sfc_main$1i = {
- __name: "su-radio",
- props: {
- customStyle: {
- type: Object,
- default: () => ({})
- },
- ui: {
- type: String,
- default: "check"
- //check line
- },
- modelValue: {
- type: [String, Number, Boolean],
- default: false
- },
- disabled: {
- type: Boolean,
- default: false
- },
- bg: {
- type: String,
- default: "ui-BG-Main"
- },
- unbg: {
- type: String,
- default: "borderss"
- },
- src: {
- type: String,
- default: ""
- },
- label: {
- type: String,
- default: ""
- },
- labelStyle: {
- type: Object,
- default: () => ({})
- },
- none: {
- type: Boolean,
- default: false
- }
- },
- emits: ["change", "update:modelValue"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const vm = vue.getCurrentInstance();
- const state = vue.reactive({
- currentValue: false
- });
- const emits = __emit;
- const props = __props;
- vue.watchPostEffect(() => {
- state.currentValue = props.modelValue;
- emits("update:modelValue", state.currentValue);
- });
- const isChecked = vue.computed(() => state.currentValue);
- const onRaido = () => {
- if (props.disabled)
- return;
- state.currentValue = !state.currentValue;
- emits("update:modelValue", state.currentValue);
- emits("change", {
- label: props.label,
- value: state.currentValue
- });
- };
- const __returned__ = { vm, state, emits, props, isChecked, onRaido, computed: vue.computed, reactive: vue.reactive, watchPostEffect: vue.watchPostEffect, getCurrentInstance: vue.getCurrentInstance };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1h(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["ui-radio ss-flex ss-col-center", [{ disabled: $props.disabled }, { img: $props.src }, $props.ui]]),
- onClick: $setup.onRaido,
- style: vue.normalizeStyle([$props.customStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "leftLabel", {}, void 0, true),
- !$props.none ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["ui-radio-input", [$setup.isChecked ? "cur " + $props.bg : $props.unbg, $props.src ? "radius" : "round"]])
- },
- null,
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- $props.src ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- class: "ui-radio-img radius",
- src: $props.src,
- mode: "aspectFill"
- }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "ui-radio-content"
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode(
- "view",
- {
- class: "ui-label-text",
- style: vue.normalizeStyle([$props.labelStyle])
- },
- vue.toDisplayString($props.label),
- 5
- /* TEXT, STYLE */
- )
- ], true)
- ])),
- $props.ui.includes("card") ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 3,
- class: vue.normalizeClass(["ui-radio-bg round", [$setup.isChecked ? "cur " + $props.bg : ""]])
- },
- null,
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_3$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["render", _sfc_render$1h], ["__scopeId", "data-v-c395529d"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-radio/su-radio.vue"]]);
- const placeholderStyle$2 = "color:#BBBBBB;font-size:28rpx;line-height:normal";
- const _sfc_main$1h = {
- __name: "info",
- setup(__props, { expose: __expose }) {
- __expose();
- const { t: t2 } = useI18n();
- const state = vue.reactive({
- verifyUsername: true,
- usernameErrorMsg: "",
- model: {},
- // 个人信息
- rules: {},
- thirdInfo: {}
- // 社交用户的信息
- });
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sexRadioMap = [
- {
- name: t2("user.male"),
- value: "1"
- },
- {
- name: t2("user.female"),
- value: "2"
- }
- ];
- function onChangeGender(e2) {
- state.model.sex = e2.detail.value;
- }
- const onChangeMobile = () => {
- showAuthModal("changeMobile");
- };
- function onChooseAvatar(e2) {
- const tempUrl = e2.detail.avatarUrl || "";
- uploadAvatar(tempUrl);
- }
- function onChangeAvatar() {
- uni.chooseImage({
- success: async (chooseImageRes) => {
- const tempUrl = chooseImageRes.tempFilePaths[0];
- await uploadAvatar(tempUrl);
- }
- });
- }
- async function uploadAvatar(tempUrl) {
- if (!tempUrl) {
- return;
- }
- const compressedImage = await compressImage(tempUrl);
- let {
- data
- } = await FileApi.uploadFile(compressedImage);
- state.model.avatar = data;
- }
- function compressImage(imagePath, scale = 0.5) {
- return new Promise((resolve, reject) => {
- const canvas = document.createElement("canvas");
- const ctx = canvas.getContext("2d");
- const img = new Image();
- img.src = imagePath;
- img.onload = () => {
- const originalWidth = img.width;
- const originalHeight = img.height;
- const newWidth = originalWidth * scale;
- const newHeight = originalHeight * scale;
- canvas.width = newWidth;
- canvas.height = newHeight;
- ctx.drawImage(img, 0, 0, newWidth, newHeight);
- const compressedImage = canvas.toDataURL("image/jpeg", 0.7);
- resolve(compressedImage);
- };
- img.onerror = (err) => {
- reject(err);
- };
- });
- }
- function onSetPassword() {
- showAuthModal("changePassword");
- }
- async function bindThirdOauth() {
- let result2 = await sheep$1.$platform.useProvider("wechat").bind();
- if (result2) {
- await getUserInfo();
- }
- }
- function unBindThirdOauth() {
- uni.showModal({
- title: t2("rules.unbind_reminder"),
- content: t2("rules.unbind_warning"),
- cancelText: t2("common.cancel"),
- confirmText: t2("common.confirm"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const result2 = await sheep$1.$platform.useProvider("wechat").unbind(state.thirdInfo.openid);
- if (result2) {
- await getUserInfo();
- }
- }
- });
- }
- let lastUsername = vue.ref("");
- async function verifyUsername(e2) {
- const username2 = e2.detail.value;
- if (username2 == "" || username2 == lastUsername.value) {
- return false;
- } else if (username2 === state.username) {
- state.usernameErrorMsg = "";
- state.verifyUsername = true;
- return false;
- }
- lastUsername.value = username2;
- const {
- data
- } = await AuthUtil.verifyUsername(username2);
- if (!data) {
- state.usernameErrorMsg = t2("rules.username_taken");
- state.verifyUsername = data;
- } else {
- state.usernameErrorMsg = "";
- state.verifyUsername = data;
- }
- }
- async function onSubmit() {
- const {
- code: code2
- } = await UserApi.updateUser({
- avatar: state.model.avatar,
- nickname: state.model.nickname,
- username: state.model.username,
- sex: state.model.sex
- });
- if (code2 === 0 && state.model.username !== state.username) {
- uni.showToast({
- icon: "success",
- title: t2("rules.modify_success")
- });
- setTimeout(function() {
- sheep$1.$store("user").logout();
- closeAuthModal();
- sheep$1.$router.go("/pages/index/user");
- }, 1e3);
- }
- if (code2 === 0) {
- await getUserInfo();
- }
- }
- const getUserInfo = async () => {
- const userInfo3 = await sheep$1.$store("user").getInfo();
- state.model = lodashExports.clone(userInfo3);
- state.username = userInfo3.username;
- if (sheep$1.$platform.name !== "H5") {
- let result2 = await sheep$1.$platform.useProvider("wechat").getInfo();
- state.thirdInfo = result2 || {};
- }
- };
- onShow(async () => {
- await getUserInfo();
- });
- onLoad(async (options2) => {
- getUserInfo();
- });
- const __returned__ = { t: t2, state, userInfo: userInfo2, placeholderStyle: placeholderStyle$2, sexRadioMap, onChangeGender, onChangeMobile, onChooseAvatar, onChangeAvatar, uploadAvatar, compressImage, onSetPassword, bindThirdOauth, unBindThirdOauth, get lastUsername() {
- return lastUsername;
- }, set lastUsername(v2) {
- lastUsername = v2;
- }, verifyUsername, onSubmit, getUserInfo, computed: vue.computed, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, ref: vue.ref, get sheep() {
- return sheep$1;
- }, get clone() {
- return lodashExports.clone;
- }, get onLoad() {
- return onLoad;
- }, get onShow() {
- return onShow;
- }, get showAuthModal() {
- return showAuthModal;
- }, get FileApi() {
- return FileApi;
- }, get UserApi() {
- return UserApi;
- }, get AuthUtil() {
- return AuthUtil;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get useI18n() {
- return useI18n;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1g(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_image = resolveEasycom(vue.resolveDynamicComponent("su-image"), __easycom_0$f);
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_su_radio = resolveEasycom(vue.resolveDynamicComponent("su-radio"), __easycom_3$2);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("user.user_info"),
- class: "set-userinfo-wrap"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms, {
- model: $setup.state.model,
- rules: $setup.state.rules,
- labelPosition: "left",
- border: "",
- class: "form-box",
- labelWidth: "160"
- }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createCommentVNode(" 头像 "),
- vue.createElementVNode("view", { class: "ss-flex ss-row-center ss-col-center ss-p-t-60 ss-p-b-0 bg-white" }, [
- vue.createElementVNode("view", { class: "header-box-content" }, [
- vue.createVNode(_component_su_image, {
- class: "content-img",
- isPreview: "",
- current: 0,
- src: (_a2 = $setup.state.model) == null ? void 0 : _a2.avatar,
- height: 160,
- width: 160,
- radius: 80,
- mode: "scaleToFill"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "avatar-action" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button avatar-action-btn",
- onClick: $setup.onChangeAvatar
- },
- vue.toDisplayString(_ctx.$t("user.change")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- vue.createElementVNode("view", { class: "bg-white ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "username",
- label: _ctx.$t("user.username"),
- "error-message": $setup.state.usernameErrorMsg
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.username,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.username = $event),
- placeholder: _ctx.$t("rules.username"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- onBlur: $setup.verifyUsername,
- clearable: false
- }, {
- right: vue.withCtx(() => [
- !$setup.state.verifyUsername ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- style: "",
- src: $setup.sheep.$url.static("/static/images/shibai.png")
- }, null, 8, ["src"])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/chenggong.png")
- }, null, 8, ["src"])
- ]))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "error-message"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "nickname",
- label: _ctx.$t("user.nickname")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.nickname,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.nickname = $event),
- type: "nickname",
- placeholder: $setup.t("rules.nickname"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "sex",
- label: _ctx.$t("user.sex")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-h-100" }, [
- vue.createElementVNode(
- "radio-group",
- {
- onChange: $setup.onChangeGender,
- class: "ss-flex ss-col-center"
- },
- [
- (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.sexRadioMap, (item) => {
- var _a3;
- return vue.createElementVNode("label", {
- class: "radio",
- key: item.value
- }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-m-r-32" }, [
- vue.createElementVNode("radio", {
- value: item.value,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- checked: parseInt(item.value) === ((_a3 = $setup.state.model) == null ? void 0 : _a3.sex)
- }, null, 8, ["value", "checked"]),
- vue.createElementVNode(
- "view",
- { class: "gender-name" },
- vue.toDisplayString(item.name),
- 1
- /* TEXT */
- )
- ])
- ]);
- }),
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: _ctx.$t("user.phone"),
- onClick: $setup.onChangeMobile
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.userInfo.mobile,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.userInfo.mobile = $event),
- placeholder: $setup.t("user.bind_phone"),
- inputBorder: false,
- disabled: "",
- styles: { disableColor: "#fff" },
- placeholderStyle: $setup.placeholderStyle,
- clearable: false
- }, {
- right: vue.withCtx(() => {
- var _a3;
- return [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- ((_a3 = $setup.userInfo.verification) == null ? void 0 : _a3.mobile) ? (vue.openBlock(), vue.createBlock(_component_su_radio, {
- key: 0,
- modelValue: true
- })) : (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button ss-flex ss-col-center ss-row-center"
- }, [
- vue.createElementVNode("text", {
- class: "_icon-forward",
- style: { "color": "#bbbbbb", "font-size": "26rpx" }
- })
- ]))
- ])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "password",
- label: _ctx.$t("user.password"),
- onClick: $setup.onSetPassword
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.userInfo.password,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.userInfo.password = $event),
- placeholder: _ctx.$t("rules.click_change_password"),
- inputBorder: false,
- styles: { disableColor: "#fff" },
- disabled: "",
- placeholderStyle: "color:#BBBBBB;font-size:28rpx;line-height:normal",
- clearable: false
- }, {
- right: vue.withCtx(() => {
- var _a3;
- return [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- ((_a3 = $setup.userInfo.verification) == null ? void 0 : _a3.password) ? (vue.openBlock(), vue.createBlock(_component_su_radio, {
- key: 0,
- class: "ss-flex",
- modelValue: true
- })) : (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button ss-flex ss-col-center ss-row-center"
- }, [
- vue.createElementVNode("text", {
- class: "_icon-forward",
- style: { "color": "#bbbbbb", "font-size": "26rpx" }
- })
- ]))
- ])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"]),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: "",
- bg: "none"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-p-20" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-rest-button logout-btn",
- onClick: $setup.onSubmit
- },
- vue.toDisplayString(_ctx.$t("common.save")),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserInfo = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["render", _sfc_render$1g], ["__scopeId", "data-v-aab93774"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/info.vue"]]);
- const avatarWidth = 45;
- const _sfc_main$1g = {
- name: "UniListChat",
- emits: ["click"],
- props: {
- title: {
- type: String,
- default: ""
- },
- note: {
- type: String,
- default: ""
- },
- clickable: {
- type: Boolean,
- default: false
- },
- link: {
- type: [Boolean, String],
- default: false
- },
- to: {
- type: String,
- default: ""
- },
- badgeText: {
- type: [String, Number],
- default: ""
- },
- badgePositon: {
- type: String,
- default: "right"
- },
- time: {
- type: String,
- default: ""
- },
- avatarCircle: {
- type: Boolean,
- default: false
- },
- avatar: {
- type: String,
- default: ""
- },
- avatarList: {
- type: Array,
- default() {
- return [];
- }
- }
- },
- // inject: ['list'],
- computed: {
- isSingle() {
- if (this.badgeText === "dot") {
- return "uni-badge--dot";
- } else {
- const badgeText = this.badgeText.toString();
- if (badgeText.length > 1) {
- return "uni-badge--complex";
- } else {
- return "uni-badge--single";
- }
- }
- },
- computedAvatar() {
- if (this.avatarList.length > 4) {
- this.imageWidth = avatarWidth * 0.31;
- return "avatarItem--3";
- } else if (this.avatarList.length > 1) {
- this.imageWidth = avatarWidth * 0.47;
- return "avatarItem--2";
- } else {
- this.imageWidth = avatarWidth;
- return "avatarItem--1";
- }
- }
- },
- data() {
- return {
- isFirstChild: false,
- border: true,
- // avatarList: 3,
- imageWidth: 50
- };
- },
- mounted() {
- this.list = this.getForm();
- if (this.list) {
- if (!this.list.firstChildAppend) {
- this.list.firstChildAppend = true;
- this.isFirstChild = true;
- }
- this.border = this.list.border;
- }
- },
- methods: {
- /**
- * 获取父元素实例
- */
- getForm(name2 = "uniList") {
- let parent2 = this.$parent;
- let parentName = parent2.$options.name;
- while (parentName !== name2) {
- parent2 = parent2.$parent;
- if (!parent2)
- return false;
- parentName = parent2.$options.name;
- }
- return parent2;
- },
- onClick() {
- if (this.to !== "") {
- this.openPage();
- return;
- }
- if (this.clickable || this.link) {
- this.$emit("click", {
- data: {}
- });
- }
- },
- openPage() {
- if (["navigateTo", "redirectTo", "reLaunch", "switchTab"].indexOf(this.link) !== -1) {
- this.pageApi(this.link);
- } else {
- this.pageApi("navigateTo");
- }
- },
- pageApi(api2) {
- uni[api2]({
- url: this.to,
- success: (res) => {
- this.$emit("click", {
- data: res
- });
- },
- fail: (err) => {
- this.$emit("click", {
- data: err
- });
- formatAppLog("error", "at uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue:212", err.errMsg);
- }
- });
- }
- }
- };
- function _sfc_render$1f(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", {
- "hover-class": !$props.clickable && !$props.link ? "" : "uni-list-chat--hover",
- class: "uni-list-chat",
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.onClick && $options.onClick(...args), ["stop"]))
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass({ "uni-list--border": $data.border, "uni-list-chat--first": $data.isFirstChild })
- },
- null,
- 2
- /* CLASS */
- ),
- vue.createElementVNode("view", { class: "uni-list-chat__container" }, [
- vue.createElementVNode("view", { class: "uni-list-chat__header-warp" }, [
- $props.avatarCircle || $props.avatarList.length === 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uni-list-chat__header", { "header--circle": $props.avatarCircle }])
- },
- [
- vue.createElementVNode("image", {
- class: vue.normalizeClass(["uni-list-chat__header-image", { "header--circle": $props.avatarCircle }]),
- src: $props.avatar,
- mode: "aspectFill"
- }, null, 10, ["src"])
- ],
- 2
- /* CLASS */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 头像组 "),
- vue.createElementVNode("view", { class: "uni-list-chat__header" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.avatarList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: index2,
- class: vue.normalizeClass(["uni-list-chat__header-box", $options.computedAvatar]),
- style: vue.normalizeStyle({ width: $data.imageWidth + "px", height: $data.imageWidth + "px" })
- },
- [
- vue.createElementVNode("image", {
- class: "uni-list-chat__header-image",
- style: vue.normalizeStyle({ width: $data.imageWidth + "px", height: $data.imageWidth + "px" }),
- src: item.url,
- mode: "aspectFill"
- }, null, 12, ["src"])
- ],
- 6
- /* CLASS, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- ))
- ]),
- $props.badgeText && $props.badgePositon === "left" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uni-list-chat__badge uni-list-chat__badge-pos", [$options.isSingle]])
- },
- [
- vue.createElementVNode(
- "text",
- { class: "uni-list-chat__badge-text" },
- vue.toDisplayString($props.badgeText === "dot" ? "" : $props.badgeText),
- 1
- /* TEXT */
- )
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "uni-list-chat__content" }, [
- vue.createElementVNode("view", { class: "uni-list-chat__content-main" }, [
- vue.createElementVNode(
- "text",
- { class: "uni-list-chat__content-title uni-ellipsis" },
- vue.toDisplayString($props.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "uni-list-chat__content-note uni-ellipsis" },
- vue.toDisplayString($props.note),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "uni-list-chat__content-extra" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode(
- "text",
- { class: "uni-list-chat__content-extra-text" },
- vue.toDisplayString($props.time),
- 1
- /* TEXT */
- ),
- $props.badgeText && $props.badgePositon === "right" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uni-list-chat__badge", [$options.isSingle, $props.badgePositon === "right" ? "uni-list-chat--right" : ""]])
- },
- [
- vue.createElementVNode(
- "text",
- { class: "uni-list-chat__badge-text" },
- vue.toDisplayString($props.badgeText === "dot" ? "" : $props.badgeText),
- 1
- /* TEXT */
- )
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ])
- ])
- ])
- ], 8, ["hover-class"]);
- }
- const __easycom_0$5 = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["render", _sfc_render$1f], ["__scopeId", "data-v-20df4ef0"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue"]]);
- const placeholderStyle$1 = "color:#BBBBBB;font-size:28rpx;line-height:normal";
- const _sfc_main$1f = {
- __name: "setting",
- setup(__props, { expose: __expose }) {
- __expose();
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- const { t: t2 } = useI18n();
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const alipayAccount2 = vue.computed(() => {
- let account2 = userInfo2.value.alipayAccount;
- if (!account2) {
- return false;
- }
- if (/^\d{11}$/.test(account2)) {
- return `${account2.substring(0, 3)}****${account2.substring(7)}`;
- } else if (/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(account2)) {
- const atIndex = account2.indexOf("@");
- if (atIndex <= 3) {
- return account2;
- }
- const username2 = account2.substring(0, Math.ceil(atIndex / 2));
- const domain = account2.substring(atIndex);
- return `${username2}***${domain}`;
- }
- });
- const bankAccount2 = vue.computed(() => {
- let account2 = userInfo2.value.bankAccount;
- if (!account2) {
- return false;
- }
- if (account2.length === 8) {
- return account2.substring(0, 2) + "********" + account2.substr(-2);
- } else {
- return account2.substring(0, 4) + "******" + account2.substr(-4);
- }
- });
- const onChangeAlipayAccount = () => {
- showAuthModal("alipayAccount");
- };
- const onChangeBankAccount = () => {
- showAuthModal("bankAccount");
- };
- const state = vue.reactive({
- model: {},
- // 个人信息
- rules: {},
- thirdInfo: {}
- // 社交用户的信息
- });
- async function bindThirdOauth() {
- let result2 = await sheep$1.$platform.useProvider("wechat").bind();
- if (result2) {
- await getUserInfo();
- }
- }
- function unBindThirdOauth() {
- uni.showModal({
- title: t2("user.unbind_reminder"),
- content: t2("rules.unbind_warning"),
- cancelText: t2("common.cancel"),
- confirmText: t2("common.confirm"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const result2 = await sheep$1.$platform.useProvider("wechat").unbind(state.thirdInfo.openid);
- if (result2) {
- await getUserInfo();
- }
- }
- });
- }
- async function onSubmit() {
- const { code: code2 } = await UserApi.updateUser({
- avatar: state.model.avatar,
- nickname: state.model.nickname,
- sex: state.model.sex
- });
- if (code2 === 0) {
- await getUserInfo();
- }
- }
- const getUserInfo = async () => {
- const userInfo3 = await sheep$1.$store("user").getInfo();
- state.model = lodashExports.clone(userInfo3);
- if (sheep$1.$platform.name !== "H5") {
- const result2 = await sheep$1.$platform.useProvider("wechat").getInfo();
- state.thirdInfo = result2 || {};
- }
- };
- function onLogout() {
- uni.showModal({
- title: t2("setting.prompt"),
- content: t2("setting.confirm_logout"),
- cancelText: t2("common.cancel"),
- confirmText: t2("common.confirm"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await AuthUtil.logout();
- if (code2 !== 0) {
- return;
- }
- sheep$1.$store("user").logout();
- uni.removeStorageSync("linkId");
- sheep$1.$router.go("/pages/index/user");
- }
- });
- }
- async function goBackEnd(type) {
- const {
- code: code2,
- data
- } = await AuthUtil.getConsumerRedirectUrl();
- if (code2 === 0) {
- window.location.href = data;
- }
- }
- const currentLang = vue.computed(() => {
- return uni.getStorageSync("userLanguage");
- });
- const changeLanguage = async () => {
- formatAppLog("log", "at pages/user/setting.vue:363", currentLang.value);
- if (currentLang.value === "en") {
- await UserApi.updateUser({ language: "zh-Hans" });
- setLanguage("zh-Hans");
- } else {
- await UserApi.updateUser({ language: "en" });
- setLanguage("en");
- }
- };
- vue.onBeforeMount(() => {
- getUserInfo();
- });
- onLoad(() => {
- uni.$on("alipayAccountChangeComplete", getUserInfo);
- uni.$on("bankAccountChangeComplete", getUserInfo);
- });
- const __returned__ = { isLogin, t: t2, userInfo: userInfo2, userWallet, alipayAccount: alipayAccount2, bankAccount: bankAccount2, onChangeAlipayAccount, onChangeBankAccount, state, placeholderStyle: placeholderStyle$1, bindThirdOauth, unBindThirdOauth, onSubmit, getUserInfo, onLogout, goBackEnd, currentLang, changeLanguage, computed: vue.computed, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, get sheep() {
- return sheep$1;
- }, get clone() {
- return lodashExports.clone;
- }, get showAuthModal() {
- return showAuthModal;
- }, get showShareModal() {
- return showShareModal;
- }, get FileApi() {
- return FileApi;
- }, get UserApi() {
- return UserApi;
- }, get AuthUtil() {
- return AuthUtil;
- }, get isBetaUser() {
- return isBetaUser;
- }, get onLoad() {
- return onLoad;
- }, get setLanguage() {
- return setLanguage;
- }, get useI18n() {
- return useI18n;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1e(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_list_chat = resolveEasycom(vue.resolveDynamicComponent("uni-list-chat"), __easycom_0$5);
- const _component_uni_list_item = resolveEasycom(vue.resolveDynamicComponent("uni-list-item"), __easycom_0$i);
- const _component_su_image = resolveEasycom(vue.resolveDynamicComponent("su-image"), __easycom_0$f);
- const _component_uni_list = resolveEasycom(vue.resolveDynamicComponent("uni-list"), __easycom_1$6);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("setting.set"),
- class: "set-userinfo-wrap"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms, {
- model: $setup.state.model,
- rules: $setup.state.rules,
- labelPosition: "left",
- border: "",
- class: "form-box"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white" }, [
- vue.createVNode(_component_uni_list, {
- border: false,
- class: ""
- }, {
- default: vue.withCtx(() => {
- var _a2, _b2;
- return [
- vue.createVNode(_component_uni_list_chat, {
- clickable: "",
- "avatar-circle": true,
- title: (_a2 = $setup.state.model) == null ? void 0 : _a2.nickname,
- avatar: (_b2 = $setup.state.model) == null ? void 0 : _b2.avatar,
- note: _ctx.$t("setting.signature"),
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/user/info"))
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "chat-custom-right" }, [
- vue.createElementVNode("text", {
- class: "_icon-forward",
- style: { "color": "#bbbbbb", "font-size": "32rpx" }
- })
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title", "avatar", "note"]),
- vue.createVNode(_component_uni_list_item, {
- clickable: "",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/user/address/list")),
- title: _ctx.$t("setting.physical_address_management"),
- showArrow: "",
- border: false
- }, null, 8, ["title"]),
- vue.createVNode(_component_uni_list_item, {
- clickable: "",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.sheep.$router.go("/pages/user/dummyAddress/list")),
- title: _ctx.$t("setting.virtual_address_management"),
- showArrow: "",
- border: false
- }, null, 8, ["title"]),
- vue.createVNode(_component_uni_list_item, {
- title: "支付宝账号",
- showArrow: "",
- clickable: "",
- border: false,
- onClick: $setup.onChangeAlipayAccount
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString(_ctx.$t("setting.alipay_account")) + " " + vue.toDisplayString($setup.alipayAccount ? $setup.alipayAccount : "未绑定"),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_list_item, {
- title: "银行卡",
- showArrow: "",
- clickable: "",
- border: false,
- onClick: $setup.onChangeBankAccount
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString(_ctx.$t("setting.bank_card")) + " " + vue.toDisplayString($setup.bankAccount ? $setup.bankAccount : "未绑定"),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(` <uni-list-item
- clickable
- @tap="sheep.$router.go('/pages/user/invoice/list')"
- title="发票抬头管理"
- showArrow
- :border="false"
- /> `),
- vue.createCommentVNode(` <uni-list-item
- :clickable="!userInfo.mobile"
- @tap="sheep.$router.go('/pages/user/address/list')"
- title="实名认证"
- showArrow
- :border="false"
- >
- <template v-slot:body>
- <p style="width: 100%"
- >实名认证 未认证
- </p>
- </template>
- </uni-list-item> `),
- $setup.userWallet.isPtSystemUser ? (vue.openBlock(), vue.createBlock(_component_uni_list_item, {
- key: 0,
- clickable: true,
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.goBackEnd("pt")),
- title: "进入平台",
- showArrow: "",
- border: false
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString(_ctx.$t("setting.enter_platform")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })) : vue.createCommentVNode("v-if", true),
- $setup.userWallet.isShSystemUser ? (vue.openBlock(), vue.createBlock(_component_uni_list_item, {
- key: 1,
- clickable: true,
- onClick: _cache[4] || (_cache[4] = ($event) => $setup.goBackEnd("sh")),
- title: "进入商家后台",
- showArrow: "",
- border: false
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString(_ctx.$t("setting.enter_merchant_backend")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })) : vue.createCommentVNode("v-if", true),
- $setup.isBetaUser() ? (vue.openBlock(), vue.createBlock(_component_uni_list_item, {
- key: 2,
- clickable: true,
- onClick: _cache[5] || (_cache[5] = ($event) => $setup.changeLanguage()),
- title: "切换语言",
- showArrow: "",
- border: false
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString($setup.currentLang === "en" ? "Switch to Chinese" : "切换为英文"),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_uni_list_item, {
- title: "我的二维码",
- clickable: "",
- onClick: _cache[6] || (_cache[6] = ($event) => $setup.sheep.$router.go("/pages/user/qrcode-share")),
- border: false
- }, {
- body: vue.withCtx(() => {
- var _a3;
- return [
- vue.createElementVNode("p", { style: { "width": "100%", "display": "flex", "align-items": "center" } }, [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("setting.enter_merchant_backend")) + " ",
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_su_image, {
- class: "content-img",
- style: { "border": "1px solid #f4f4f4" },
- current: 0,
- src: (_a3 = $setup.state.model) == null ? void 0 : _a3.avatar,
- height: 100,
- width: 100,
- radius: 0,
- mode: "scaleToFill"
- }, null, 8, ["src"])
- ])
- ];
- }),
- _: 1
- /* STABLE */
- })
- ];
- }),
- _: 1
- /* STABLE */
- })
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"]),
- vue.createCommentVNode(" 当前社交平台的绑定关系,只处理 wechat 微信场景 "),
- $setup.sheep.$platform.name !== "H5" ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createElementVNode(
- "view",
- { class: "title-box ss-p-l-30" },
- vue.toDisplayString(_ctx.$t("setting.third_party_account_binding")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "account-list ss-flex ss-row-between" }, [
- "WechatOfficialAccount" === $setup.sheep.$platform.name ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "ss-flex ss-col-center"
- }, [
- vue.createElementVNode("image", {
- class: "list-img",
- src: $setup.sheep.$url.static("/static/images/WechatOfficialAccount.png")
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "text",
- { class: "list-name" },
- vue.toDisplayString(_ctx.$t("setting.wechat_public_account")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- "WechatMiniProgram" === $setup.sheep.$platform.name ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "ss-flex ss-col-center"
- }, [
- vue.createElementVNode("image", {
- class: "list-img",
- src: $setup.sheep.$url.static("/static/images/WechatMiniProgram.png")
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "text",
- { class: "list-name" },
- vue.toDisplayString(_ctx.$t("setting.wechat_mini_program")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- "App" === $setup.sheep.$platform.name ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "ss-flex ss-col-center"
- }, [
- vue.createElementVNode("image", {
- class: "list-img",
- src: $setup.sheep.$url.static("/static/images/wechat.png")
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "text",
- { class: "list-name" },
- vue.toDisplayString(_ctx.$t("setting.wechat_open_platform")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- $setup.state.thirdInfo ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "info ss-flex ss-col-center"
- }, [
- vue.createElementVNode("image", {
- class: "avatar ss-m-r-20",
- src: $setup.sheep.$url.cdn($setup.state.thirdInfo.avatar)
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "text",
- { class: "name" },
- vue.toDisplayString($setup.state.thirdInfo.nickname),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "bind-box ss-m-l-20" }, [
- $setup.state.thirdInfo.openid ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button relieve-btn",
- onClick: $setup.unBindThirdOauth
- },
- vue.toDisplayString(_ctx.$t("setting.unbind")),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-reset-button bind-btn",
- onClick: $setup.bindThirdOauth
- },
- vue.toDisplayString(_ctx.$t("setting.bind")),
- 1
- /* TEXT */
- ))
- ])
- ])
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: ""
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-p-x-20 ss-p-b-40" }, [
- $setup.isLogin ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "loginout-btn ss-reset-button",
- onClick: $setup.onLogout
- },
- vue.toDisplayString(_ctx.$t("user.log_out")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(' <su-fixed bottom placeholder bg="none">\n <view class="footer-box ss-p-20">\n <button class="ss-rest-button logout-btn ui-Shadow-Main" @tap="onSubmit">保存</button>\n </view>\n </su-fixed> ')
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserSetting = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["render", _sfc_render$1e], ["__scopeId", "data-v-806b15dc"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/setting.vue"]]);
- const _sfc_main$1e = {
- __name: "qrcode-share",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- linkId: 0
- });
- const poster = vue.reactive({
- canvasId: "canvasId",
- width: sheep$1.$platform.device.windowWidth * 0.9,
- height: 600,
- src: ""
- });
- const vm = vue.getCurrentInstance();
- async function getPoster(params) {
- poster.src = "";
- poster.shareInfo = {
- "title": "",
- "desc": "",
- "image": "",
- "path": "",
- "link": "https://zxgz.newfeifan.cn/#/pages/index/user?linkId=" + state.linkId,
- "poster": {
- "type": "user"
- }
- };
- poster.canvasId = "canvasId-" + (/* @__PURE__ */ new Date()).getTime();
- const canvas = await useCanvas(poster, vm);
- return canvas;
- }
- async function getLink() {
- ShareApi.getLinkId(1).then((res) => {
- if (res.code !== 0) {
- return;
- }
- state.linkId = res.data.linkId;
- getPoster();
- });
- }
- const onSavePoster = () => {
- if (["WechatOfficialAccount", "H5"].includes(sheep$1.$platform.name)) {
- sheep$1.$helper.toast(t$6("share.long_press_to_save"));
- return;
- }
- uni.saveImageToPhotosAlbum({
- filePath: poster.src,
- success: (res) => {
- onClosePoster();
- sheep$1.$helper.toast(t$6("share.save_success"));
- },
- fail: (err) => {
- sheep$1.$helper.toast(t$6("share.save_failure"));
- formatAppLog("log", "at pages/user/qrcode-share.vue:106", "图片保存失败:", err);
- }
- });
- };
- onLoad(async () => {
- await getLink();
- });
- const __returned__ = { state, poster, vm, getPoster, getLink, onSavePoster, computed: vue.computed, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, getCurrentInstance: vue.getCurrentInstance, get onLoad() {
- return onLoad;
- }, get sheep() {
- return sheep$1;
- }, get useCanvas() {
- return useCanvas;
- }, get showAuthModal() {
- return showAuthModal;
- }, get showShareModal() {
- return showShareModal;
- }, get ShareApi() {
- return ShareApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1d(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("share.share"),
- class: "set-userinfo-wrap"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex-col ss-col-center ss-row-center" }, [
- $setup.poster.src === "" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "poster-title ss-flex ss-row-center",
- style: vue.normalizeStyle({
- height: $setup.poster.height + "px",
- width: $setup.poster.width + "px"
- })
- },
- vue.toDisplayString($setup.t("share.poster_loading")),
- 5
- /* TEXT, STYLE */
- )) : (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- class: "poster-img ss-m-20",
- src: $setup.poster.src,
- style: vue.normalizeStyle({
- height: $setup.poster.height + "px",
- width: $setup.poster.width + "px"
- }),
- "show-menu-by-longpress": true
- }, null, 12, ["src"])),
- vue.createElementVNode("canvas", {
- class: "hideCanvas",
- "canvas-id": $setup.poster.canvasId,
- id: $setup.poster.canvasId,
- style: vue.normalizeStyle({
- height: $setup.poster.height + "px",
- width: $setup.poster.width + "px"
- })
- }, null, 12, ["canvas-id", "id"])
- ]),
- vue.createElementVNode("view", { class: "modal-footer ss-flex ss-p-x-20" }, [
- vue.createElementVNode(
- "button",
- {
- class: "confirm-btn",
- onClick: $setup.onSavePoster
- },
- vue.toDisplayString(["wechatOfficialAccount", "H5"].includes($setup.sheep.$platform.name) ? $setup.t("share.long_press_to_save") : $setup.t("share.long_press_to_save")),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(' <button class="confirm-btn" @tap="showShareModal">分享</button> ')
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserQrcodeShare = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["render", _sfc_render$1d], ["__scopeId", "data-v-845d3787"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/qrcode-share.vue"]]);
- function isArray$1(value) {
- if (typeof Array.isArray === "function") {
- return Array.isArray(value);
- } else {
- return Object.prototype.toString.call(value) === "[object Array]";
- }
- }
- function isObject$1(value) {
- return Object.prototype.toString.call(value) === "[object Object]";
- }
- function cloneDeep(obj) {
- const d2 = isArray$1(obj) ? obj : {};
- if (isObject$1(obj)) {
- for (const key in obj) {
- if (obj[key]) {
- if (obj[key] && typeof obj[key] === "object") {
- d2[key] = cloneDeep(obj[key]);
- } else {
- d2[key] = obj[key];
- }
- }
- }
- }
- return d2;
- }
- const _sfc_main$1d = {
- __name: "goods-log",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "e113b195-sys_navBar": vue.unref(sys_navBar)
- }));
- const sys_navBar = sheep$1.$platform.navbar;
- const pagination = {
- list: [],
- pageNo: 1,
- total: 1,
- pageSize: 10
- };
- const state = vue.reactive({
- pagination: cloneDeep(pagination),
- loadStatus: "",
- editMode: false,
- selectedSpuIdList: [],
- selectAll: false
- });
- async function getList() {
- state.loadStatus = "loading";
- const { code: code2, data } = await SpuHistoryApi.getBrowseHistoryPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- const onSelect = (id) => {
- if (!state.selectedSpuIdList.includes(id)) {
- state.selectedSpuIdList.push(id);
- } else {
- state.selectedSpuIdList.splice(state.selectedSpuIdList.indexOf(id), 1);
- }
- state.selectAll = state.selectedSpuIdList.length === state.pagination.list.length;
- };
- const onSelectAll = () => {
- state.selectAll = !state.selectAll;
- if (!state.selectAll) {
- state.selectedSpuIdList = [];
- } else {
- state.pagination.list.forEach((item) => {
- if (state.selectedSpuIdList.includes(item.spuId)) {
- state.selectedSpuIdList.splice(state.selectedSpuIdList.indexOf(item.spuId), 1);
- }
- state.selectedSpuIdList.push(item.spuId);
- });
- }
- };
- async function onDelete() {
- if (state.selectedSpuIdList.length <= 0) {
- return;
- }
- const { code: code2 } = await SpuHistoryApi.deleteBrowseHistory(state.selectedSpuIdList);
- if (code2 === 0) {
- reload();
- }
- }
- async function onClean() {
- const { code: code2 } = await SpuHistoryApi.cleanBrowseHistory();
- if (code2 === 0) {
- reload();
- }
- }
- function reload() {
- state.editMode = false;
- state.selectedSpuIdList = [];
- state.selectAll = false;
- state.pagination = pagination;
- getList();
- }
- function loadMore() {
- if (state.loadStatus !== "noMore") {
- state.pagination.pageNo += 1;
- getList();
- }
- }
- onReachBottom(() => {
- loadMore();
- });
- onLoad(() => {
- getList();
- });
- const __returned__ = { sys_navBar, pagination, state, getList, onSelect, onSelectAll, onDelete, onClean, reload, loadMore, get sheep() {
- return sheep$1;
- }, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get _() {
- return _$1;
- }, get SpuHistoryApi() {
- return SpuHistoryApi;
- }, get cloneDeep() {
- return cloneDeep;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1c(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("common.delete_footprint"),
- bgStyle: { color: "#f2f2f2" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "cart-box ss-flex ss-flex-col ss-row-between" }, [
- vue.createCommentVNode(" 头部 "),
- vue.createElementVNode("view", { class: "cart-header ss-flex ss-col-center ss-row-between ss-p-x-30" }, [
- vue.createElementVNode("view", { class: "header-left ss-flex ss-col-center ss-font-26" }, [
- vue.createCommentVNode(" 共 "),
- vue.createElementVNode("text", { class: "goods-number ui-TC-Main ss-flex" }, [
- vue.createCommentVNode(" {{ state.pagination.total }} "),
- vue.createTextVNode(
- " " + vue.toDisplayString(_ctx.$t("common.total_goods", { number: $setup.state.pagination.total })),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 件商品 ")
- ]),
- vue.createElementVNode("view", { class: "header-right" }, [
- $setup.state.editMode && $setup.state.pagination.total ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.editMode = false)
- },
- vue.toDisplayString(_ctx.$t("common.cancel")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- !$setup.state.editMode && $setup.state.pagination.total ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-reset-button ui-TC-Main",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.state.editMode = true)
- },
- vue.toDisplayString(_ctx.$t("common.edit")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- vue.createCommentVNode(" 内容 "),
- vue.createElementVNode("view", { class: "cart-content" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "goods-box ss-r-10 ss-m-b-14",
- key: item.id
- }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- $setup.state.editMode ? (vue.openBlock(), vue.createElementBlock("label", {
- key: 0,
- class: "check-box ss-flex ss-col-center ss-p-l-10",
- onClick: ($event) => $setup.onSelect(item.spuId)
- }, [
- vue.createElementVNode("radio", {
- checked: $setup.state.selectedSpuIdList.includes(item.spuId),
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- onClick: vue.withModifiers(($event) => $setup.onSelect(item.spuId), ["stop"])
- }, null, 8, ["checked", "onClick"])
- ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_s_goods_item, {
- title: item.spuName,
- img: item.picUrl,
- price: item.price,
- skuText: item.introduction,
- priceColor: "#FF3000",
- titleWidth: 400,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", {
- id: item.spuId
- })
- }, null, 8, ["title", "img", "price", "skuText", "onClick"])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createCommentVNode(" 底部 "),
- vue.withDirectives(vue.createVNode(
- _component_su_fixed,
- {
- bottom: "",
- val: 0,
- placeholder: ""
- },
- {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom" }, [
- vue.createElementVNode("view", { class: "footer-left ss-flex ss-col-center" }, [
- vue.createElementVNode("label", {
- class: "check-box ss-flex ss-col-center ss-p-r-30",
- onClick: $setup.onSelectAll
- }, [
- vue.createElementVNode("radio", {
- checked: $setup.state.selectAll,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.7)" },
- onClick: vue.withModifiers($setup.onSelectAll, ["stop"])
- }, null, 8, ["checked"]),
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString(_ctx.$t("common.select_all")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode("view", { class: "footer-right ss-flex" }, [
- vue.createElementVNode(
- "button",
- {
- class: vue.normalizeClass([
- "ss-reset-button pay-btn ss-font-28 ",
- {
- "ui-BG-Main-Gradient": $setup.state.selectedSpuIdList.length > 0,
- "ui-Shadow-Main": $setup.state.selectedSpuIdList.length > 0
- }
- ]),
- onClick: $setup.onDelete
- },
- vue.toDisplayString(_ctx.$t("common.delete_footprint")),
- 3
- /* TEXT, CLASS */
- ),
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button ui-BG-Main-Gradient pay-btn ss-font-28 ui-Shadow-Main ml-2",
- onClick: $setup.onClean
- },
- vue.toDisplayString(_ctx.$t("common.clear")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- },
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.editMode]
- ])
- ]),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 0,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: "暂无浏览记录",
- icon: "/static/collect-empty.png"
- })) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserGoodsLog = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["render", _sfc_render$1c], ["__scopeId", "data-v-e113b195"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/goods-log.vue"]]);
- const _sfc_main$1c = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- list: [],
- // 地址列表
- loading: true
- });
- const onSelect = (addressInfo) => {
- uni.$emit("SELECT_ADDRESS", {
- addressInfo
- });
- sheep$1.$router.back();
- };
- function importWechatAddress() {
- }
- onShow(async () => {
- state.list = (await AddressApi.getAddressList()).data;
- state.loading = false;
- });
- vue.onBeforeMount(() => {
- if (!!uni.getStorageSync("areaData")) {
- return;
- }
- AreaApi.getAreaTree().then((res) => {
- if (res.code === 0) {
- uni.setStorageSync("areaData", res.data);
- }
- });
- });
- const __returned__ = { state, onSelect, importWechatAddress, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, get onShow() {
- return onShow;
- }, get sheep() {
- return sheep$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, get AreaApi() {
- return AreaApi;
- }, get AddressApi() {
- return AddressApi;
- }, get $helper() {
- return $helper;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1b(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_address_item = resolveEasycom(vue.resolveDynamicComponent("s-address-item"), __easycom_0$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("address.shipping_address"),
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- $setup.state.list.length ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.list, (item) => {
- return vue.openBlock(), vue.createBlock(_component_s_address_item, {
- hasBorderBottom: "",
- key: item.id,
- item,
- onClick: ($event) => $setup.onSelect(item)
- }, null, 8, ["item", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: ""
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-flex ss-row-between ss-p-20" }, [
- vue.createCommentVNode(" 微信小程序和微信H5 "),
- ["WechatMiniProgram", "WechatOfficialAccount"].includes($setup.sheep.$platform.name) ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- onClick: $setup.importWechatAddress,
- class: "border ss-reset-button sync-wxaddress ss-m-20 ss-flex ss-row-center ss-col-center"
- }, [
- vue.createElementVNode("text", {
- class: "cicon-weixin ss-p-r-10",
- style: { "color": "#09bb07", "font-size": "40rpx" }
- }),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.t("address.import_wechat_address")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "button",
- {
- class: "add-btn ss-reset-button ui-Shadow-Main",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/user/address/edit"))
- },
- vue.toDisplayString($setup.t("address.add_new_shipping_address")),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.list.length === 0 && !$setup.state.loading ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: $setup.t("no_shipping_address"),
- icon: "/static/data-empty.png"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserAddressList = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["render", _sfc_render$1b], ["__scopeId", "data-v-5a5957ad"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/address/list.vue"]]);
- const _sfc_main$1b = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- list: [],
- // 地址列表
- loading: true
- });
- const onSelect = (addressInfo) => {
- uni.$emit("SELECT_ADDRESS", {
- addressInfo
- });
- sheep$1.$router.back();
- };
- function importWechatAddress() {
- }
- onShow(async () => {
- state.list = (await AddressApi.getAddressList(2)).data;
- state.loading = false;
- });
- vue.onBeforeMount(() => {
- if (!!uni.getStorageSync("areaData")) {
- return;
- }
- AreaApi.getAreaTree().then((res) => {
- if (res.code === 0) {
- uni.setStorageSync("areaData", res.data);
- }
- });
- });
- const __returned__ = { state, onSelect, importWechatAddress, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, get onShow() {
- return onShow;
- }, get sheep() {
- return sheep$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, get AreaApi() {
- return AreaApi;
- }, get AddressApi() {
- return AddressApi;
- }, get $helper() {
- return $helper;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1a(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_address_item = resolveEasycom(vue.resolveDynamicComponent("s-address-item"), __easycom_0$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("address.virtual_goods_address"),
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- $setup.state.list.length ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.list, (item) => {
- return vue.openBlock(), vue.createBlock(_component_s_address_item, {
- spuType: "0",
- hasBorderBottom: "",
- key: item.id,
- item,
- onClick: ($event) => $setup.onSelect(item)
- }, null, 8, ["item", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: ""
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-flex ss-row-between ss-p-20" }, [
- vue.createCommentVNode(" 微信小程序和微信H5 "),
- vue.createElementVNode(
- "button",
- {
- class: "add-btn ss-reset-button ui-Shadow-Main",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/user/dummyAddress/edit"))
- },
- vue.toDisplayString($setup.t("address.add_new_shipping_address")),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.list.length === 0 && !$setup.state.loading ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: $setup.t("address.no_shipping_address"),
- icon: "/static/data-empty.png"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserDummyAddressList = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["render", _sfc_render$1a], ["__scopeId", "data-v-d0cb4d27"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/dummyAddress/list.vue"]]);
- const _sfc_main$1a = {
- __name: "edit",
- setup(__props, { expose: __expose }) {
- __expose();
- const invoiceFormRef = vue.ref(null);
- const currentProtocol = vue.ref(false);
- const state = vue.reactive({
- showRegion: false,
- model: {
- invoiceType: 1,
- invoiceTitleType: 1,
- invoiceTitle: "",
- taxIDNumber: ""
- },
- rules: {},
- protocol: false
- });
- function onChange() {
- state.protocol = !state.protocol;
- }
- function onProtocol(title) {
- sheep$1.$router.go("/pages/public/richtext", {
- title
- });
- }
- const rules2 = {
- invoiceType: {
- rules: [{
- required: true,
- errorMessage: "请选择发票类型"
- }]
- },
- invoiceTitleType: {
- rules: [{
- required: true,
- errorMessage: "请选择抬头类型"
- }]
- },
- invoiceTitle: {
- rules: [{
- required: true,
- errorMessage: "请输入发票抬头"
- }]
- },
- taxIDNumber: {
- rules: [{
- required: true,
- errorMessage: "请输入单位税号"
- }]
- }
- };
- const invoiceType = (e2) => {
- state.model.invoiceType = e2.detail.value;
- state.model.invoiceTitleType = 1;
- };
- const invoiceTitleType = (e2) => {
- state.model.invoiceTitleType = e2.detail.value;
- };
- const onSave = async () => {
- const validate = await vue.unref(invoiceFormRef).validate().catch((error2) => {
- formatAppLog("log", "at pages/user/invoice/edit.vue:207", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- if (!state.protocol) {
- currentProtocol.value = true;
- setTimeout(function() {
- currentProtocol.value = false;
- }, 500);
- return;
- }
- const formData = {
- ...state.model
- };
- const {
- code: code2
- } = state.model.id > 0 ? await AddressApi.updateAddress(formData) : await AddressApi.createAddress(formData);
- if (code2 === 0) {
- sheep$1.$router.back();
- }
- };
- const onDelete = () => {
- uni.showModal({
- title: "提示",
- content: "确认删除此收货地址吗?",
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await AddressApi.deleteAddress(state.model.id);
- if (code2 === 0) {
- sheep$1.$router.back();
- }
- }
- });
- };
- onLoad(async (options2) => {
- });
- const __returned__ = { invoiceFormRef, currentProtocol, state, onChange, onProtocol, rules: rules2, invoiceType, invoiceTitleType, onSave, onDelete, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get _() {
- return _$1;
- }, get mobile() {
- return mobile;
- }, get AreaApi() {
- return AreaApi;
- }, get AddressApi() {
- return AddressApi;
- }, get $helper() {
- return $helper;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$19(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" {{ru}} "),
- vue.createVNode(_component_s_layout, {
- title: $setup.state.model.id ? "编辑发票抬头" : "新增发票抬头"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms, {
- ref: "invoiceFormRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $setup.state.model = $event),
- rules: $setup.rules,
- validateTrigger: "bind",
- labelWidth: "160",
- labelAlign: "left",
- border: "",
- labelStyle: { fontWeight: "bold" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white form-box ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceType",
- label: "发票类型"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "radio-group",
- { onChange: $setup.invoiceType },
- [
- vue.createElementVNode("radio", {
- value: "1",
- checked: $setup.state.model.invoiceType == 1,
- color: "var(--ui-BG-Main)",
- class: "radio ss-m-r-30",
- style: { "transform": "scale(0.9)" }
- }, "纸质普票 ", 8, ["checked"]),
- vue.createElementVNode("radio", {
- value: "2",
- checked: $setup.state.model.invoiceType == 2,
- color: "var(--ui-BG-Main)",
- class: "radio",
- style: { "transform": "scale(0.9)" }
- }, "专用发票", 8, ["checked"])
- ],
- 32
- /* NEED_HYDRATION */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(" 当为专用发票时,不用选择抬头类型 "),
- $setup.state.model.invoiceType == 1 ? (vue.openBlock(), vue.createBlock(_component_uni_forms_item, {
- key: 0,
- name: "invoiceTitleType",
- label: "抬头类型",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "radio-group",
- {
- class: "uni-flex uni-row radio-group",
- onChange: $setup.invoiceTitleType
- },
- [
- vue.createElementVNode("radio", {
- value: "1",
- checked: $setup.state.model.invoiceTitleType == 1,
- color: "var(--ui-BG-Main)",
- class: "radio ss-m-r-30",
- style: { "transform": "scale(0.9)" }
- }, "个人 ", 8, ["checked"]),
- vue.createElementVNode("radio", {
- value: "2",
- checked: $setup.state.model.invoiceTitleType == 2,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.9)" },
- class: "radio"
- }, "单位", 8, ["checked"])
- ],
- 32
- /* NEED_HYDRATION */
- )
- ]),
- _: 1
- /* STABLE */
- })) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceTitle",
- label: "发票抬头",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.invoiceTitle,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.invoiceTitle = $event),
- placeholder: "请输入发票抬头",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.model.invoiceTitleType == 2 ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createVNode(_component_uni_forms_item, {
- name: "taxIDNumber",
- label: "单位税号",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.taxIDNumber,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.taxIDNumber = $event),
- type: "number",
- placeholder: "请输入单位税号",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceTitle",
- label: "注册地址",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.invoiceTitle,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.invoiceTitle = $event),
- type: "number",
- placeholder: "选填",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceTitle",
- label: "注册电话",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.invoiceTitle,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model.invoiceTitle = $event),
- type: "number",
- placeholder: "选填",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceTitle",
- label: "开户银行",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.invoiceTitle,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.state.model.invoiceTitle = $event),
- type: "number",
- placeholder: "选填",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceTitle",
- label: "银行账号",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.invoiceTitle,
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $setup.state.model.invoiceTitle = $event),
- type: "number",
- placeholder: "选填",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.state.model.invoiceType == 2 ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createVNode(_component_uni_forms_item, {
- name: "taxIDNumber",
- label: "单位税号",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.taxIDNumber,
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.state.model.taxIDNumber = $event),
- type: "number",
- placeholder: "请输入单位税号",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceTitle",
- label: "注册地址",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.invoiceTitle,
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $setup.state.model.invoiceTitle = $event),
- type: "number",
- placeholder: "必填",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceTitle",
- label: "注册电话",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.invoiceTitle,
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $setup.state.model.invoiceTitle = $event),
- type: "number",
- placeholder: "必填",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceTitle",
- label: "开户银行",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.invoiceTitle,
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $setup.state.model.invoiceTitle = $event),
- type: "number",
- placeholder: "必填",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "invoiceTitle",
- label: "银行账号",
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.invoiceTitle,
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $setup.state.model.invoiceTitle = $event),
- type: "number",
- placeholder: "必填",
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- $setup.state.model.invoiceType == 2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "ss-m-y-20 bg-white ss-p-x-30 ss-flex ss-row-between ss-col-center default-box"
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["default-box-title", { shake: $setup.currentProtocol }])
- },
- [
- vue.createElementVNode("label", {
- class: "radio ss-flex ss-col-center",
- onClick: $setup.onChange
- }, [
- vue.createElementVNode("radio", {
- checked: $setup.state.protocol,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- onClick: vue.withModifiers($setup.onChange, ["stop"])
- }, null, 8, ["checked"]),
- vue.createElementVNode("view", { class: "agreement-text ss-flex ss-col-center ss-m-l-8" }, [
- vue.createTextVNode(" 我已阅读并同意 "),
- vue.createElementVNode("view", {
- class: "tcp-text",
- onClick: _cache[11] || (_cache[11] = vue.withModifiers(($event) => $setup.onProtocol("专用发票抬头确认书"), ["stop"]))
- }, " 《专用发票抬头确认书》 ")
- ])
- ])
- ],
- 2
- /* CLASS */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue"]),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- opacity: false,
- bg: "",
- placeholder: "",
- noFixed: false,
- index: 10
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-flex-col ss-row-between ss-p-20" }, [
- vue.createElementVNode("view", { class: "ss-m-b-20" }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button save-btn ui-Shadow-Main",
- onClick: $setup.onSave
- }, "保存")
- ]),
- $setup.state.model.id ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "ss-reset-button cancel-btn",
- onClick: $setup.onDelete
- }, " 删除 ")) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesUserInvoiceEdit = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["render", _sfc_render$19], ["__scopeId", "data-v-1891008f"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/invoice/edit.vue"]]);
- const _sfc_main$19 = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- list: [],
- // 地址列表
- loading: true
- });
- const onSelect = (addressInfo) => {
- uni.$emit("SELECT_ADDRESS", {
- addressInfo
- });
- sheep$1.$router.back();
- };
- function importWechatAddress() {
- }
- onShow(async () => {
- state.list = (await AddressApi.getAddressList()).data;
- state.loading = false;
- });
- vue.onBeforeMount(() => {
- if (!!uni.getStorageSync("areaData")) {
- return;
- }
- AreaApi.getAreaTree().then((res) => {
- if (res.code === 0) {
- uni.setStorageSync("areaData", res.data);
- }
- });
- });
- const __returned__ = { state, onSelect, importWechatAddress, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, get onShow() {
- return onShow;
- }, get sheep() {
- return sheep$1;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, get AreaApi() {
- return AreaApi;
- }, get AddressApi() {
- return AddressApi;
- }, get $helper() {
- return $helper;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$18(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_address_item = resolveEasycom(vue.resolveDynamicComponent("s-address-item"), __easycom_0$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: "发票抬头管理",
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- $setup.state.list.length ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.list, (item) => {
- return vue.openBlock(), vue.createBlock(_component_s_address_item, {
- hasBorderBottom: "",
- key: item.id,
- item,
- onClick: ($event) => $setup.onSelect(item)
- }, null, 8, ["item", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: ""
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-flex ss-row-between ss-p-20" }, [
- vue.createCommentVNode(" 微信小程序和微信H5 "),
- vue.createCommentVNode(` <button v-if="['WechatMiniProgram', 'WechatOfficialAccount'].includes(sheep.$platform.name)"
- @tap="importWechatAddress"
- class="border ss-reset-button sync-wxaddress ss-m-20 ss-flex ss-row-center ss-col-center">
- <text class="cicon-weixin ss-p-r-10" style="color: #09bb07; font-size: 40rpx"></text>
- 导入微信地址
- </button> `),
- vue.createElementVNode("button", {
- class: "add-btn ss-reset-button ui-Shadow-Main",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/user/invoice/edit"))
- }, " 新增发票抬头 ")
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.list.length === 0 && !$setup.state.loading ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: "暂无发票抬头",
- icon: "/static/data-empty.png"
- })) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesUserInvoiceList = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["render", _sfc_render$18], ["__scopeId", "data-v-17d2e25a"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/invoice/list.vue"]]);
- const __default__ = {
- name: "UiSwitch"
- };
- const _sfc_main$18 = /* @__PURE__ */ Object.assign(__default__, {
- props: {
- modelValue: {
- type: [Boolean, Number],
- default: false
- },
- ui: {
- type: String,
- default: ""
- },
- bg: {
- type: String,
- default: "ui-BG-Main"
- },
- text: {
- type: String,
- default: ""
- },
- size: {
- type: String,
- default: "sm"
- },
- disabled: {
- type: Boolean,
- default: false
- }
- },
- emits: ["update:modelValue"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props = __props;
- const emits = __emit;
- const change = () => {
- emits("update:modelValue", !props.modelValue);
- };
- const __returned__ = { props, emits, change };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- });
- function _sfc_render$17(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["ui-switch", [{ disabled: $setup.props.disabled }, $setup.props.ui]])
- },
- [
- vue.createElementVNode("view", {
- class: "ui-switch-wrapper",
- onClick: $setup.change
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["ui-switch-input", [
- { "ui-switch-input-checked": $setup.props.modelValue },
- $setup.props.modelValue ? $setup.props.bg : "",
- $setup.props.text,
- $setup.props.size
- ]])
- },
- null,
- 2
- /* CLASS */
- )
- ])
- ],
- 2
- /* CLASS */
- );
- }
- const __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["render", _sfc_render$17], ["__scopeId", "data-v-8eb57d65"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-switch/su-switch.vue"]]);
- const _sfc_main$17 = {
- name: "SuToolbar",
- props: {
- // 是否展示工具条
- show: {
- type: Boolean,
- default: true
- },
- // 取消按钮的文字
- cancelText: {
- type: String,
- default: "取消"
- },
- // 确认按钮的文字
- confirmText: {
- type: String,
- default: "确认"
- },
- // 取消按钮的颜色
- cancelColor: {
- type: String,
- default: "#909193"
- },
- // 确认按钮的颜色
- confirmColor: {
- type: String,
- default: "#3c9cff"
- },
- // 标题文字
- title: {
- type: String,
- default: ""
- }
- },
- methods: {
- // 点击取消按钮
- cancel() {
- this.$emit("cancel");
- },
- // 点击确定按钮
- confirm() {
- this.$emit("confirm");
- },
- // 阻止事件冒泡
- preventEvent(e2) {
- e2 && typeof e2.stopPropagation === "function" && e2.stopPropagation();
- },
- // 空操作
- noop(e2) {
- this.preventEvent(e2);
- }
- }
- };
- function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
- return $props.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-toolbar",
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.noop && $options.noop(...args), ["stop", "prevent"]))
- },
- [
- vue.createElementVNode("view", {
- class: "u-toolbar__cancel__wrapper",
- "hover-class": "u-hover-class"
- }, [
- vue.createElementVNode(
- "text",
- {
- class: "u-toolbar__wrapper__cancel",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.cancel && $options.cancel(...args)),
- style: vue.normalizeStyle({
- color: $props.cancelColor
- })
- },
- vue.toDisplayString($props.cancelText),
- 5
- /* TEXT, STYLE */
- )
- ]),
- $props.title ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-toolbar__title u-line-1"
- },
- vue.toDisplayString($props.title),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", {
- class: "u-toolbar__confirm__wrapper",
- "hover-class": "u-hover-class"
- }, [
- vue.createElementVNode(
- "text",
- {
- class: "u-toolbar__wrapper__confirm",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.confirm && $options.confirm(...args)),
- style: vue.normalizeStyle({
- color: $props.confirmColor
- })
- },
- vue.toDisplayString($props.confirmText),
- 5
- /* TEXT, STYLE */
- )
- ])
- ],
- 32
- /* NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0$4 = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$16], ["__scopeId", "data-v-2c641e39"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-toolbar/su-toolbar.vue"]]);
- const _sfc_main$16 = {
- __name: "su-region-picker",
- props: {
- show: {
- type: Boolean,
- default: false
- },
- // "取消"按钮的颜色
- cancelColor: {
- type: String,
- default: "#6666"
- },
- // "确定"按钮的颜色
- confirmColor: {
- type: String,
- default: "var(--ui-BG-Main)"
- },
- // 取消按钮的文字
- cancelText: {
- type: String,
- default: t$6("common.cancel")
- },
- // 确认按钮的文字
- confirmText: {
- type: String,
- default: t$6("common.confirm")
- }
- },
- emits: ["confirm", "cancel", "change"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props = __props;
- const areaData = uni.getStorageSync("areaData");
- const getSizeByNameLength = (name2) => {
- let length = name2.length;
- if (length <= 7)
- return "";
- if (length < 9) {
- return "font-size:28rpx";
- } else {
- return "font-size: 24rpx";
- }
- };
- const state = vue.reactive({
- currentIndex: [0, 0, 0],
- moving: false
- // 列是否还在滑动中,微信小程序如果在滑动中就点确定,结果可能不准确
- });
- const emits = __emit;
- const provinceList = areaData;
- const cityList = vue.computed(() => {
- return areaData[state.currentIndex[0]].children;
- });
- const districtList = vue.computed(() => {
- var _a2;
- return (_a2 = cityList.value[state.currentIndex[1]]) == null ? void 0 : _a2.children;
- });
- const pickstart = () => {
- };
- const pickend = () => {
- };
- const init = () => {
- };
- const onCancel = () => {
- emits("cancel");
- };
- const change = (e2) => {
- if (state.currentIndex[0] === e2.detail.value[0] && state.currentIndex[1] === e2.detail.value[1]) {
- state.currentIndex[2] = e2.detail.value[2];
- return;
- } else {
- if (state.currentIndex[0] !== e2.detail.value[0]) {
- e2.detail.value[1] = 0;
- }
- e2.detail.value[2] = 0;
- state.currentIndex = e2.detail.value;
- }
- emits("change", state.currentIndex);
- };
- const onConfirm = (event = null) => {
- let index2 = state.currentIndex;
- let province = provinceList[index2[0]];
- let city = cityList.value[index2[1]];
- let district = districtList.value[index2[2]];
- let result2 = {
- province_name: province.name,
- province_id: province.id,
- city_name: city.name,
- city_id: city.id,
- district_name: district.name,
- district_id: district.id
- };
- if (event)
- emits(event, result2);
- };
- const __returned__ = { props, areaData, getSizeByNameLength, state, emits, provinceList, cityList, districtList, pickstart, pickend, init, onCancel, change, onConfirm, computed: vue.computed, reactive: vue.reactive, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$15(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_toolbar = resolveEasycom(vue.resolveDynamicComponent("su-toolbar"), __easycom_0$4);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createBlock(_component_su_popup, {
- show: $props.show,
- onClose: $setup.onCancel,
- round: "20"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ui-region-picker" }, [
- vue.createVNode(_component_su_toolbar, {
- cancelColor: $props.cancelColor,
- confirmColor: $props.confirmColor,
- cancelText: $props.cancelText,
- confirmText: $props.confirmText,
- title: $setup.t("common.select_area"),
- onCancel: $setup.onCancel,
- onConfirm: _cache[0] || (_cache[0] = ($event) => $setup.onConfirm("confirm"))
- }, null, 8, ["cancelColor", "confirmColor", "cancelText", "confirmText", "title"]),
- vue.createElementVNode("view", { class: "ui-picker-body" }, [
- vue.createElementVNode("picker-view", {
- value: $setup.state.currentIndex,
- onChange: $setup.change,
- class: "ui-picker-view",
- onPickstart: $setup.pickstart,
- onPickend: $setup.pickend
- }, [
- vue.createElementVNode("picker-view-column", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.provinceList, (province) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "ui-column-item",
- key: province.id
- }, [
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle($setup.getSizeByNameLength(province.name))
- },
- vue.toDisplayString(province.name),
- 5
- /* TEXT, STYLE */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("picker-view-column", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.cityList, (city) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "ui-column-item",
- key: city.id
- }, [
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle($setup.getSizeByNameLength(city.name))
- },
- vue.toDisplayString(city.name),
- 5
- /* TEXT, STYLE */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("picker-view-column", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.districtList, (district) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "ui-column-item",
- key: district.id
- }, [
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle($setup.getSizeByNameLength(district.name))
- },
- vue.toDisplayString(district.name),
- 5
- /* TEXT, STYLE */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ], 40, ["value"])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]);
- }
- const __easycom_5 = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["render", _sfc_render$15], ["__scopeId", "data-v-124df58f"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-region-picker/su-region-picker.vue"]]);
- const _sfc_main$15 = {
- __name: "edit",
- setup(__props, { expose: __expose }) {
- __expose();
- const addressFormRef = vue.ref(null);
- const state = vue.reactive({
- showRegion: false,
- model: {
- name: "",
- mobile: "",
- detailAddress: "",
- defaultStatus: false,
- areaName: ""
- },
- rules: {}
- });
- const rules2 = {
- name: {
- rules: [{
- required: true,
- errorMessage: t$6("address.enter_recipient_name")
- }]
- },
- mobile,
- detailAddress: {
- rules: [{
- required: true,
- errorMessage: t$6("address.enter_detailed_address")
- }]
- },
- areaName: {
- rules: [{
- required: true,
- errorMessage: t$6("address.select_province_city_district")
- }]
- }
- };
- const onRegionConfirm = (e2) => {
- state.model.areaName = `${e2.province_name} ${e2.city_name} ${e2.district_name}`;
- state.model.areaId = e2.district_id;
- state.showRegion = false;
- };
- const getAreaData = () => {
- if (_$1.isEmpty(uni.getStorageSync("areaData"))) {
- AreaApi.getAreaTree().then((res) => {
- if (res.code === 0) {
- uni.setStorageSync("areaData", res.data);
- }
- });
- }
- };
- const onSave = async () => {
- formatAppLog("log", "at pages/user/address/edit.vue:128", state);
- const validate = await vue.unref(addressFormRef).validate().catch((error2) => {
- formatAppLog("log", "at pages/user/address/edit.vue:133", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const formData = {
- ...state.model
- };
- const {
- code: code2
- } = state.model.id > 0 ? await AddressApi.updateAddress(formData) : await AddressApi.createAddress(formData);
- if (code2 === 0) {
- sheep$1.$router.back();
- }
- };
- const onDelete = () => {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("address.confirm_delete_address"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await AddressApi.deleteAddress(state.model.id);
- if (code2 === 0) {
- sheep$1.$router.back();
- }
- }
- });
- };
- onLoad(async (options2) => {
- getAreaData();
- if (options2.id) {
- let {
- code: code2,
- data
- } = await AddressApi.getAddress(options2.id);
- if (code2 !== 0) {
- return;
- }
- state.model = data;
- }
- if (options2.data) {
- let data = JSON.parse(options2.data);
- const areaData = uni.getStorageSync("areaData");
- let provinceArr = areaData.filter((item) => item.name == data.province_name);
- data.province_id = provinceArr[0].id;
- let provinceArr2 = provinceArr[0].children.filter((item) => item.name == data.city_name);
- data.city_id = provinceArr2[0].id;
- let provinceArr3 = provinceArr2[0].children.filter((item) => item.name == data.district_name);
- data.district_id = provinceArr3[0].id;
- state.model = {
- name: data.consignee,
- mobile: data.mobile,
- detailAddress: data.address,
- defaultStatus: data.is_default,
- areaName: data.province_name + " " + data.city_name + " " + data.district_name,
- areaId: data.district_id
- };
- }
- });
- const __returned__ = { addressFormRef, state, rules: rules2, onRegionConfirm, getAreaData, onSave, onDelete, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get _() {
- return _$1;
- }, get mobile() {
- return mobile;
- }, get AreaApi() {
- return AreaApi;
- }, get AddressApi() {
- return AddressApi;
- }, get $helper() {
- return $helper;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$14(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- const _component_su_switch = resolveEasycom(vue.resolveDynamicComponent("su-switch"), __easycom_2);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_su_region_picker = resolveEasycom(vue.resolveDynamicComponent("su-region-picker"), __easycom_5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.state.model.id ? $setup.t("address.edit_address") : $setup.t("address.add_address")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms, {
- ref: "addressFormRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.state.model = $event),
- rules: $setup.rules,
- validateTrigger: "bind",
- labelWidth: "160",
- labelAlign: "left",
- border: "",
- labelStyle: { fontWeight: "bold" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white form-box ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "name",
- label: $setup.t("address.recipient"),
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.name,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.name = $event),
- placeholder: $setup.t("address.enter_recipient_name"),
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal",
- maxlength: 10
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("account.phone_number"),
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.mobile,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.mobile = $event),
- type: "number",
- placeholder: $setup.t("account.enter_phone_number"),
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "areaName",
- label: $setup.t("address.province_city_district"),
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.state.showRegion = true),
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.areaName,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.areaName = $event),
- disabled: "",
- inputBorder: false,
- styles: { disableColor: "#fff", color: "#333" },
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal",
- placeholder: $setup.t("address.select_province_city_district")
- }, {
- right: vue.withCtx(() => [
- vue.createVNode(_component_uni_icons, { type: "right" })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "detailAddress",
- label: $setup.t("address.detailed_address"),
- formItemStyle: { alignItems: "flex-start" },
- labelStyle: { lineHeight: "5em" },
- class: "textarea-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- type: "textarea",
- modelValue: $setup.state.model.detailAddress,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.state.model.detailAddress = $event),
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal",
- placeholder: $setup.t("address.enter_detailed_address"),
- clearable: ""
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- vue.createElementVNode("view", { class: "ss-m-y-20 bg-white ss-p-x-30 ss-flex ss-row-between ss-col-center default-box" }, [
- vue.createElementVNode(
- "view",
- { class: "default-box-title" },
- vue.toDisplayString($setup.t("address.set_as_default_address")),
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_su_switch, {
- style: { "transform": "scale(0.8)" },
- modelValue: $setup.state.model.defaultStatus,
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $setup.state.model.defaultStatus = $event)
- }, null, 8, ["modelValue"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue"]),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- opacity: false,
- bg: "",
- placeholder: "",
- noFixed: false,
- index: 10
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-flex-col ss-row-between ss-p-20" }, [
- vue.createElementVNode("view", { class: "ss-m-b-20" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button save-btn ui-Shadow-Main",
- onClick: $setup.onSave
- },
- vue.toDisplayString($setup.t("common.save")),
- 1
- /* TEXT */
- )
- ]),
- $setup.state.model.id ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button cancel-btn",
- onClick: $setup.onDelete
- },
- vue.toDisplayString($setup.t("common.delete")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(" 省市区弹窗 "),
- vue.createVNode(_component_su_region_picker, {
- show: $setup.state.showRegion,
- onCancel: _cache[7] || (_cache[7] = ($event) => $setup.state.showRegion = false),
- onConfirm: $setup.onRegionConfirm
- }, null, 8, ["show"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserAddressEdit = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["render", _sfc_render$14], ["__scopeId", "data-v-e04c42e1"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/address/edit.vue"]]);
- const _sfc_main$14 = {
- __name: "edit",
- setup(__props, { expose: __expose }) {
- __expose();
- const addressFormRef = vue.ref(null);
- const state = vue.reactive({
- showRegion: false,
- model: {
- name: "",
- mobile: "",
- detailAddress: "",
- defaultStatus: false,
- areaName: "",
- addressType: 2
- },
- rules: {}
- });
- const rules2 = {
- name: {
- rules: [{
- required: true,
- errorMessage: t$6("address.enter_recipient_name")
- }]
- },
- mobile,
- detailAddress: {
- rules: [{
- required: true,
- errorMessage: t$6("address.enter_detailed_address")
- }]
- }
- };
- const onRegionConfirm = (e2) => {
- state.model.areaName = `${e2.province_name} ${e2.city_name} ${e2.district_name}`;
- state.model.areaId = e2.district_id;
- state.showRegion = false;
- };
- const getAreaData = () => {
- if (_$1.isEmpty(uni.getStorageSync("areaData"))) {
- AreaApi.getAreaTree().then((res) => {
- if (res.code === 0) {
- uni.setStorageSync("areaData", res.data);
- }
- });
- }
- };
- const onSave = async () => {
- formatAppLog("log", "at pages/user/dummyAddress/edit.vue:116", state);
- const validate = await vue.unref(addressFormRef).validate().catch((error2) => {
- formatAppLog("log", "at pages/user/dummyAddress/edit.vue:121", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const formData = {
- ...state.model
- };
- const {
- code: code2
- } = state.model.id > 0 ? await AddressApi.updateAddress(formData) : await AddressApi.createAddress(formData);
- if (code2 === 0) {
- sheep$1.$router.back();
- }
- };
- const onDelete = () => {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("address.confirm_delete_address"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await AddressApi.deleteAddress(state.model.id, 2);
- if (code2 === 0) {
- sheep$1.$router.back();
- }
- }
- });
- };
- onLoad(async (options2) => {
- getAreaData();
- if (options2.id) {
- let {
- code: code2,
- data
- } = await AddressApi.getAddress(options2.id, 2);
- if (code2 !== 0) {
- return;
- }
- state.model = data;
- }
- if (options2.data) {
- let data = JSON.parse(options2.data);
- const areaData = uni.getStorageSync("areaData");
- let provinceArr = areaData.filter((item) => item.name == data.province_name);
- data.province_id = provinceArr[0].id;
- let provinceArr2 = provinceArr[0].children.filter((item) => item.name == data.city_name);
- data.city_id = provinceArr2[0].id;
- let provinceArr3 = provinceArr2[0].children.filter((item) => item.name == data.district_name);
- data.district_id = provinceArr3[0].id;
- state.model = {
- name: data.consignee,
- mobile: data.mobile,
- detailAddress: data.address,
- defaultStatus: data.is_default,
- areaName: data.province_name + " " + data.city_name + " " + data.district_name,
- areaId: data.district_id
- };
- }
- });
- const __returned__ = { addressFormRef, state, rules: rules2, onRegionConfirm, getAreaData, onSave, onDelete, ref: vue.ref, reactive: vue.reactive, unref: vue.unref, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get _() {
- return _$1;
- }, get mobile() {
- return mobile;
- }, get AreaApi() {
- return AreaApi;
- }, get AddressApi() {
- return AddressApi;
- }, get $helper() {
- return $helper;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$13(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_su_switch = resolveEasycom(vue.resolveDynamicComponent("su-switch"), __easycom_2);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_su_region_picker = resolveEasycom(vue.resolveDynamicComponent("su-region-picker"), __easycom_5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" {{ru}} "),
- vue.createVNode(_component_s_layout, {
- title: $setup.state.model.id ? $setup.t("address.edit_virtual_address") : $setup.t("address.add_virtual_address")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms, {
- ref: "addressFormRef",
- modelValue: $setup.state.model,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.state.model = $event),
- rules: $setup.rules,
- validateTrigger: "bind",
- labelWidth: "160",
- labelAlign: "left",
- border: "",
- labelStyle: { fontWeight: "bold" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white form-box ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "name",
- label: $setup.t("address.recipient"),
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.name,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.name = $event),
- placeholder: $setup.t("address.enter_recipient_name"),
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal",
- maxlength: 10
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("account.phone_number"),
- class: "form-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.mobile,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.mobile = $event),
- type: "number",
- placeholder: $setup.t("account.enter_phone_number"),
- inputBorder: false,
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "detailAddress",
- label: $setup.t("address.detailed_address"),
- formItemStyle: { alignItems: "flex-start" },
- labelStyle: { lineHeight: "5em" },
- class: "textarea-item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- type: "textarea",
- modelValue: $setup.state.model.detailAddress,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.detailAddress = $event),
- placeholderStyle: "color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal",
- placeholder: $setup.t("address.enter_detailed_address"),
- clearable: ""
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ]),
- vue.createElementVNode("view", { class: "ss-m-y-20 bg-white ss-p-x-30 ss-flex ss-row-between ss-col-center default-box" }, [
- vue.createElementVNode(
- "view",
- { class: "default-box-title" },
- vue.toDisplayString($setup.t("address.set_as_default_virtual_address")),
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_su_switch, {
- style: { "transform": "scale(0.8)" },
- modelValue: $setup.state.model.defaultStatus,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model.defaultStatus = $event)
- }, null, 8, ["modelValue"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue"]),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- opacity: false,
- bg: "",
- placeholder: "",
- noFixed: false,
- index: 10
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-flex-col ss-row-between ss-p-20" }, [
- vue.createElementVNode("view", { class: "ss-m-b-20" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button save-btn ui-Shadow-Main",
- onClick: $setup.onSave
- },
- vue.toDisplayString($setup.t("common.save")),
- 1
- /* TEXT */
- )
- ]),
- $setup.state.model.id ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button cancel-btn",
- onClick: $setup.onDelete
- },
- vue.toDisplayString($setup.t("common.delete")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(" 省市区弹窗 "),
- vue.createVNode(_component_su_region_picker, {
- show: $setup.state.showRegion,
- onCancel: _cache[5] || (_cache[5] = ($event) => $setup.state.showRegion = false),
- onConfirm: $setup.onRegionConfirm
- }, null, 8, ["show"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesUserDummyAddressEdit = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["render", _sfc_render$13], ["__scopeId", "data-v-bc658567"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/dummyAddress/edit.vue"]]);
- class Calendar {
- constructor({
- date: date2,
- selected,
- startDate,
- endDate,
- range: range2
- // multipleStatus
- } = {}) {
- this.date = this.getDate(/* @__PURE__ */ new Date());
- this.selected = selected || [];
- this.startDate = startDate;
- this.endDate = endDate;
- this.range = range2;
- this.cleanMultipleStatus();
- this.weeks = {};
- this.lastHover = false;
- }
- /**
- * 设置日期
- * @param {Object} date
- */
- setDate(date2) {
- this.selectDate = this.getDate(date2);
- this._getWeek(this.selectDate.fullDate);
- }
- /**
- * 清理多选状态
- */
- cleanMultipleStatus() {
- this.multipleStatus = {
- before: "",
- after: "",
- data: []
- };
- }
- /**
- * 重置开始日期
- */
- resetSatrtDate(startDate) {
- this.startDate = startDate;
- }
- /**
- * 重置结束日期
- */
- resetEndDate(endDate) {
- this.endDate = endDate;
- }
- /**
- * 获取任意时间
- */
- getDate(date2, AddDayCount = 0, str = "day") {
- if (!date2) {
- date2 = /* @__PURE__ */ new Date();
- }
- if (typeof date2 !== "object") {
- date2 = date2.replace(/-/g, "/");
- }
- const dd = new Date(date2);
- switch (str) {
- case "day":
- dd.setDate(dd.getDate() + AddDayCount);
- break;
- case "month":
- if (dd.getDate() === 31) {
- dd.setDate(dd.getDate() + AddDayCount);
- } else {
- dd.setMonth(dd.getMonth() + AddDayCount);
- }
- break;
- case "year":
- dd.setFullYear(dd.getFullYear() + AddDayCount);
- break;
- }
- const y2 = dd.getFullYear();
- const m2 = dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1;
- const d2 = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();
- return {
- fullDate: y2 + "-" + m2 + "-" + d2,
- year: y2,
- month: m2,
- date: d2,
- day: dd.getDay()
- };
- }
- /**
- * 获取上月剩余天数
- */
- _getLastMonthDays(firstDay, full) {
- let dateArr = [];
- for (let i2 = firstDay; i2 > 0; i2--) {
- const beforeDate = new Date(full.year, full.month - 1, -i2 + 1).getDate();
- dateArr.push({
- date: beforeDate,
- month: full.month - 1,
- disable: true
- });
- }
- return dateArr;
- }
- /**
- * 获取本月天数
- */
- _currentMonthDys(dateData, full) {
- let dateArr = [];
- let fullDate = this.date.fullDate;
- for (let i2 = 1; i2 <= dateData; i2++) {
- let nowDate = full.year + "-" + (full.month < 10 ? full.month : full.month) + "-" + (i2 < 10 ? "0" + i2 : i2);
- let isDay = fullDate === nowDate;
- let info = this.selected && this.selected.find((item) => {
- if (this.dateEqual(nowDate, item.date)) {
- return item;
- }
- });
- let disableBefore = true;
- let disableAfter = true;
- if (this.startDate) {
- disableBefore = this.dateCompare(this.startDate, nowDate);
- }
- if (this.endDate) {
- disableAfter = this.dateCompare(nowDate, this.endDate);
- }
- let multiples = this.multipleStatus.data;
- let checked = false;
- let multiplesStatus = -1;
- if (this.range) {
- if (multiples) {
- multiplesStatus = multiples.findIndex((item) => {
- return this.dateEqual(item, nowDate);
- });
- }
- if (multiplesStatus !== -1) {
- checked = true;
- }
- }
- let data = {
- fullDate: nowDate,
- year: full.year,
- date: i2,
- multiple: this.range ? checked : false,
- beforeMultiple: this.isLogicBefore(nowDate, this.multipleStatus.before, this.multipleStatus.after),
- afterMultiple: this.isLogicAfter(nowDate, this.multipleStatus.before, this.multipleStatus.after),
- month: full.month,
- disable: !(disableBefore && disableAfter),
- isDay,
- userChecked: false
- };
- if (info) {
- data.extraInfo = info;
- }
- dateArr.push(data);
- }
- return dateArr;
- }
- /**
- * 获取下月天数
- */
- _getNextMonthDays(surplus, full) {
- let dateArr = [];
- for (let i2 = 1; i2 < surplus + 1; i2++) {
- dateArr.push({
- date: i2,
- month: Number(full.month) + 1,
- disable: true
- });
- }
- return dateArr;
- }
- /**
- * 获取当前日期详情
- * @param {Object} date
- */
- getInfo(date2) {
- if (!date2) {
- date2 = /* @__PURE__ */ new Date();
- }
- const dateInfo = this.canlender.find((item) => item.fullDate === this.getDate(date2).fullDate);
- return dateInfo;
- }
- /**
- * 比较时间大小
- */
- dateCompare(startDate, endDate) {
- startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
- endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
- if (startDate <= endDate) {
- return true;
- } else {
- return false;
- }
- }
- /**
- * 比较时间是否相等
- */
- dateEqual(before, after) {
- before = new Date(before.replace("-", "/").replace("-", "/"));
- after = new Date(after.replace("-", "/").replace("-", "/"));
- if (before.getTime() - after.getTime() === 0) {
- return true;
- } else {
- return false;
- }
- }
- /**
- * 比较真实起始日期
- */
- isLogicBefore(currentDay, before, after) {
- let logicBefore = before;
- if (before && after) {
- logicBefore = this.dateCompare(before, after) ? before : after;
- }
- return this.dateEqual(logicBefore, currentDay);
- }
- isLogicAfter(currentDay, before, after) {
- let logicAfter = after;
- if (before && after) {
- logicAfter = this.dateCompare(before, after) ? after : before;
- }
- return this.dateEqual(logicAfter, currentDay);
- }
- /**
- * 获取日期范围内所有日期
- * @param {Object} begin
- * @param {Object} end
- */
- geDateAll(begin, end) {
- var arr = [];
- var ab = begin.split("-");
- var ae2 = end.split("-");
- var db = /* @__PURE__ */ new Date();
- db.setFullYear(ab[0], ab[1] - 1, ab[2]);
- var de2 = /* @__PURE__ */ new Date();
- de2.setFullYear(ae2[0], ae2[1] - 1, ae2[2]);
- var unixDb = db.getTime() - 24 * 60 * 60 * 1e3;
- var unixDe = de2.getTime() - 24 * 60 * 60 * 1e3;
- for (var k = unixDb; k <= unixDe; ) {
- k = k + 24 * 60 * 60 * 1e3;
- arr.push(this.getDate(new Date(parseInt(k))).fullDate);
- }
- return arr;
- }
- /**
- * 获取多选状态
- */
- setMultiple(fullDate) {
- let {
- before,
- after
- } = this.multipleStatus;
- if (!this.range)
- return;
- if (before && after) {
- if (!this.lastHover) {
- this.lastHover = true;
- return;
- }
- this.multipleStatus.before = fullDate;
- this.multipleStatus.after = "";
- this.multipleStatus.data = [];
- this.multipleStatus.fulldate = "";
- this.lastHover = false;
- } else {
- if (!before) {
- this.multipleStatus.before = fullDate;
- this.lastHover = false;
- } else {
- this.multipleStatus.after = fullDate;
- if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
- } else {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
- }
- this.lastHover = true;
- }
- }
- this._getWeek(fullDate);
- }
- /**
- * 鼠标 hover 更新多选状态
- */
- setHoverMultiple(fullDate) {
- let {
- before,
- after
- } = this.multipleStatus;
- if (!this.range)
- return;
- if (this.lastHover)
- return;
- if (!before) {
- this.multipleStatus.before = fullDate;
- } else {
- this.multipleStatus.after = fullDate;
- if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
- } else {
- this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
- }
- }
- this._getWeek(fullDate);
- }
- /**
- * 更新默认值多选状态
- */
- setDefaultMultiple(before, after) {
- this.multipleStatus.before = before;
- this.multipleStatus.after = after;
- if (before && after) {
- if (this.dateCompare(before, after)) {
- this.multipleStatus.data = this.geDateAll(before, after);
- this._getWeek(after);
- } else {
- this.multipleStatus.data = this.geDateAll(after, before);
- this._getWeek(before);
- }
- }
- }
- /**
- * 获取每周数据
- * @param {Object} dateData
- */
- _getWeek(dateData) {
- const {
- fullDate,
- year,
- month,
- date: date2,
- day
- } = this.getDate(dateData);
- let firstDay = new Date(year, month - 1, 1).getDay();
- let currentDay = new Date(year, month, 0).getDate();
- let dates = {
- lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)),
- // 上个月末尾几天
- currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)),
- // 本月天数
- nextMonthDays: [],
- // 下个月开始几天
- weeks: []
- };
- let canlender = [];
- const surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length);
- dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData));
- canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays);
- let weeks = {};
- for (let i2 = 0; i2 < canlender.length; i2++) {
- if (i2 % 7 === 0) {
- weeks[parseInt(i2 / 7)] = new Array(7);
- }
- weeks[parseInt(i2 / 7)][i2 % 7] = canlender[i2];
- }
- this.canlender = canlender;
- this.weeks = weeks;
- }
- //静态方法
- // static init(date) {
- // if (!this.instance) {
- // this.instance = new Calendar(date);
- // }
- // return this.instance;
- // }
- }
- const _sfc_main$13 = {
- props: {
- weeks: {
- type: Object,
- default() {
- return {};
- }
- },
- calendar: {
- type: Object,
- default: () => {
- return {};
- }
- },
- selected: {
- type: Array,
- default: () => {
- return [];
- }
- },
- lunar: {
- type: Boolean,
- default: false
- },
- checkHover: {
- type: Boolean,
- default: false
- }
- },
- methods: {
- choiceDate(weeks) {
- this.$emit("change", weeks);
- },
- handleMousemove(weeks) {
- this.$emit("handleMouse", weeks);
- }
- }
- };
- function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uni-calendar-item__weeks-box", {
- "uni-calendar-item--disable": $props.weeks.disable,
- "uni-calendar-item--before-checked-x": $props.weeks.beforeMultiple,
- "uni-calendar-item--multiple": $props.weeks.multiple,
- "uni-calendar-item--after-checked-x": $props.weeks.afterMultiple
- }]),
- onClick: _cache[0] || (_cache[0] = ($event) => $options.choiceDate($props.weeks)),
- onMouseenter: _cache[1] || (_cache[1] = ($event) => $options.handleMousemove($props.weeks))
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-calendar-item__weeks-box-item", {
- "uni-calendar-item--checked": $props.calendar.fullDate === $props.weeks.fullDate && ($props.calendar.userChecked || !$props.checkHover),
- "uni-calendar-item--checked-range-text": $props.checkHover,
- "uni-calendar-item--before-checked": $props.weeks.beforeMultiple,
- "uni-calendar-item--multiple": $props.weeks.multiple,
- "uni-calendar-item--after-checked": $props.weeks.afterMultiple,
- "uni-calendar-item--disable": $props.weeks.disable
- }])
- },
- [
- $props.selected && $props.weeks.extraInfo ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "uni-calendar-item__weeks-box-circle"
- })) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- { class: "uni-calendar-item__weeks-box-text uni-calendar-item__weeks-box-text-disable uni-calendar-item--checked-text" },
- vue.toDisplayString($props.weeks.date),
- 1
- /* TEXT */
- )
- ],
- 2
- /* CLASS */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass({ "uni-calendar-item--isDay": $props.weeks.isDay })
- },
- null,
- 2
- /* CLASS */
- )
- ],
- 34
- /* CLASS, NEED_HYDRATION */
- );
- }
- const calendarItem = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["render", _sfc_render$12], ["__scopeId", "data-v-3c762a01"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue"]]);
- const en = {
- "uni-datetime-picker.selectDate": "select date",
- "uni-datetime-picker.selectTime": "select time",
- "uni-datetime-picker.selectDateTime": "select datetime",
- "uni-datetime-picker.startDate": "start date",
- "uni-datetime-picker.endDate": "end date",
- "uni-datetime-picker.startTime": "start time",
- "uni-datetime-picker.endTime": "end time",
- "uni-datetime-picker.ok": "ok",
- "uni-datetime-picker.clear": "clear",
- "uni-datetime-picker.cancel": "cancel",
- "uni-calender.MON": "MON",
- "uni-calender.TUE": "TUE",
- "uni-calender.WED": "WED",
- "uni-calender.THU": "THU",
- "uni-calender.FRI": "FRI",
- "uni-calender.SAT": "SAT",
- "uni-calender.SUN": "SUN"
- };
- const zhHans = {
- "uni-datetime-picker.selectDate": "选择日期",
- "uni-datetime-picker.selectTime": "选择时间",
- "uni-datetime-picker.selectDateTime": "选择日期时间",
- "uni-datetime-picker.startDate": "开始日期",
- "uni-datetime-picker.endDate": "结束日期",
- "uni-datetime-picker.startTime": "开始时间",
- "uni-datetime-picker.endTime": "结束时间",
- "uni-datetime-picker.ok": "确定",
- "uni-datetime-picker.clear": "清除",
- "uni-datetime-picker.cancel": "取消",
- "uni-calender.SUN": "日",
- "uni-calender.MON": "一",
- "uni-calender.TUE": "二",
- "uni-calender.WED": "三",
- "uni-calender.THU": "四",
- "uni-calender.FRI": "五",
- "uni-calender.SAT": "六"
- };
- const zhHant = {
- "uni-datetime-picker.selectDate": "選擇日期",
- "uni-datetime-picker.selectTime": "選擇時間",
- "uni-datetime-picker.selectDateTime": "選擇日期時間",
- "uni-datetime-picker.startDate": "開始日期",
- "uni-datetime-picker.endDate": "結束日期",
- "uni-datetime-picker.startTime": "開始时间",
- "uni-datetime-picker.endTime": "結束时间",
- "uni-datetime-picker.ok": "確定",
- "uni-datetime-picker.clear": "清除",
- "uni-datetime-picker.cancel": "取消",
- "uni-calender.SUN": "日",
- "uni-calender.MON": "一",
- "uni-calender.TUE": "二",
- "uni-calender.WED": "三",
- "uni-calender.THU": "四",
- "uni-calender.FRI": "五",
- "uni-calender.SAT": "六"
- };
- const messages = {
- en,
- "zh-Hans": zhHans,
- "zh-Hant": zhHant
- };
- const { t: t$2 } = initVueI18n(messages);
- const _sfc_main$12 = {
- name: "UniDatetimePicker",
- components: {},
- data() {
- return {
- indicatorStyle: `height: 50px;`,
- visible: false,
- fixNvueBug: {},
- dateShow: true,
- timeShow: true,
- title: "日期和时间",
- // 输入框当前时间
- time: "",
- // 当前的年月日时分秒
- year: 1920,
- month: 0,
- day: 0,
- hour: 0,
- minute: 0,
- second: 0,
- // 起始时间
- startYear: 1920,
- startMonth: 1,
- startDay: 1,
- startHour: 0,
- startMinute: 0,
- startSecond: 0,
- // 结束时间
- endYear: 2120,
- endMonth: 12,
- endDay: 31,
- endHour: 23,
- endMinute: 59,
- endSecond: 59
- };
- },
- props: {
- type: {
- type: String,
- default: "datetime"
- },
- value: {
- type: [String, Number],
- default: ""
- },
- modelValue: {
- type: [String, Number],
- default: ""
- },
- start: {
- type: [Number, String],
- default: ""
- },
- end: {
- type: [Number, String],
- default: ""
- },
- returnType: {
- type: String,
- default: "string"
- },
- disabled: {
- type: [Boolean, String],
- default: false
- },
- border: {
- type: [Boolean, String],
- default: true
- },
- hideSecond: {
- type: [Boolean, String],
- default: false
- }
- },
- watch: {
- value: {
- handler(newVal, oldVal) {
- if (newVal) {
- this.parseValue(this.fixIosDateFormat(newVal));
- this.initTime(false);
- } else {
- this.time = "";
- this.parseValue(Date.now());
- }
- },
- immediate: true
- },
- type: {
- handler(newValue) {
- if (newValue === "date") {
- this.dateShow = true;
- this.timeShow = false;
- this.title = "日期";
- } else if (newValue === "time") {
- this.dateShow = false;
- this.timeShow = true;
- this.title = "时间";
- } else {
- this.dateShow = true;
- this.timeShow = true;
- this.title = "日期和时间";
- }
- },
- immediate: true
- },
- start: {
- handler(newVal) {
- this.parseDatetimeRange(this.fixIosDateFormat(newVal), "start");
- },
- immediate: true
- },
- end: {
- handler(newVal) {
- this.parseDatetimeRange(this.fixIosDateFormat(newVal), "end");
- },
- immediate: true
- },
- // 月、日、时、分、秒可选范围变化后,检查当前值是否在范围内,不在则当前值重置为可选范围第一项
- months(newVal) {
- this.checkValue("month", this.month, newVal);
- },
- days(newVal) {
- this.checkValue("day", this.day, newVal);
- },
- hours(newVal) {
- this.checkValue("hour", this.hour, newVal);
- },
- minutes(newVal) {
- this.checkValue("minute", this.minute, newVal);
- },
- seconds(newVal) {
- this.checkValue("second", this.second, newVal);
- }
- },
- computed: {
- // 当前年、月、日、时、分、秒选择范围
- years() {
- return this.getCurrentRange("year");
- },
- months() {
- return this.getCurrentRange("month");
- },
- days() {
- return this.getCurrentRange("day");
- },
- hours() {
- return this.getCurrentRange("hour");
- },
- minutes() {
- return this.getCurrentRange("minute");
- },
- seconds() {
- return this.getCurrentRange("second");
- },
- // picker 当前值数组
- ymd() {
- return [this.year - this.minYear, this.month - this.minMonth, this.day - this.minDay];
- },
- hms() {
- return [this.hour - this.minHour, this.minute - this.minMinute, this.second - this.minSecond];
- },
- // 当前 date 是 start
- currentDateIsStart() {
- return this.year === this.startYear && this.month === this.startMonth && this.day === this.startDay;
- },
- // 当前 date 是 end
- currentDateIsEnd() {
- return this.year === this.endYear && this.month === this.endMonth && this.day === this.endDay;
- },
- // 当前年、月、日、时、分、秒的最小值和最大值
- minYear() {
- return this.startYear;
- },
- maxYear() {
- return this.endYear;
- },
- minMonth() {
- if (this.year === this.startYear) {
- return this.startMonth;
- } else {
- return 1;
- }
- },
- maxMonth() {
- if (this.year === this.endYear) {
- return this.endMonth;
- } else {
- return 12;
- }
- },
- minDay() {
- if (this.year === this.startYear && this.month === this.startMonth) {
- return this.startDay;
- } else {
- return 1;
- }
- },
- maxDay() {
- if (this.year === this.endYear && this.month === this.endMonth) {
- return this.endDay;
- } else {
- return this.daysInMonth(this.year, this.month);
- }
- },
- minHour() {
- if (this.type === "datetime") {
- if (this.currentDateIsStart) {
- return this.startHour;
- } else {
- return 0;
- }
- }
- if (this.type === "time") {
- return this.startHour;
- }
- },
- maxHour() {
- if (this.type === "datetime") {
- if (this.currentDateIsEnd) {
- return this.endHour;
- } else {
- return 23;
- }
- }
- if (this.type === "time") {
- return this.endHour;
- }
- },
- minMinute() {
- if (this.type === "datetime") {
- if (this.currentDateIsStart && this.hour === this.startHour) {
- return this.startMinute;
- } else {
- return 0;
- }
- }
- if (this.type === "time") {
- if (this.hour === this.startHour) {
- return this.startMinute;
- } else {
- return 0;
- }
- }
- },
- maxMinute() {
- if (this.type === "datetime") {
- if (this.currentDateIsEnd && this.hour === this.endHour) {
- return this.endMinute;
- } else {
- return 59;
- }
- }
- if (this.type === "time") {
- if (this.hour === this.endHour) {
- return this.endMinute;
- } else {
- return 59;
- }
- }
- },
- minSecond() {
- if (this.type === "datetime") {
- if (this.currentDateIsStart && this.hour === this.startHour && this.minute === this.startMinute) {
- return this.startSecond;
- } else {
- return 0;
- }
- }
- if (this.type === "time") {
- if (this.hour === this.startHour && this.minute === this.startMinute) {
- return this.startSecond;
- } else {
- return 0;
- }
- }
- },
- maxSecond() {
- if (this.type === "datetime") {
- if (this.currentDateIsEnd && this.hour === this.endHour && this.minute === this.endMinute) {
- return this.endSecond;
- } else {
- return 59;
- }
- }
- if (this.type === "time") {
- if (this.hour === this.endHour && this.minute === this.endMinute) {
- return this.endSecond;
- } else {
- return 59;
- }
- }
- },
- /**
- * for i18n
- */
- selectTimeText() {
- return t$2("uni-datetime-picker.selectTime");
- },
- okText() {
- return t$2("uni-datetime-picker.ok");
- },
- clearText() {
- return t$2("uni-datetime-picker.clear");
- },
- cancelText() {
- return t$2("uni-datetime-picker.cancel");
- }
- },
- mounted() {
- },
- methods: {
- /**
- * @param {Object} item
- * 小于 10 在前面加个 0
- */
- lessThanTen(item) {
- return item < 10 ? "0" + item : item;
- },
- /**
- * 解析时分秒字符串,例如:00:00:00
- * @param {String} timeString
- */
- parseTimeType(timeString) {
- if (timeString) {
- let timeArr = timeString.split(":");
- this.hour = Number(timeArr[0]);
- this.minute = Number(timeArr[1]);
- this.second = Number(timeArr[2]);
- }
- },
- /**
- * 解析选择器初始值,类型可以是字符串、时间戳,例如:2000-10-02、'08:30:00'、 1610695109000
- * @param {String | Number} datetime
- */
- initPickerValue(datetime2) {
- let defaultValue = null;
- if (datetime2) {
- defaultValue = this.compareValueWithStartAndEnd(datetime2, this.start, this.end);
- } else {
- defaultValue = Date.now();
- defaultValue = this.compareValueWithStartAndEnd(defaultValue, this.start, this.end);
- }
- this.parseValue(defaultValue);
- },
- /**
- * 初始值规则:
- * - 用户设置初始值 value
- * - 设置了起始时间 start、终止时间 end,并 start < value < end,初始值为 value, 否则初始值为 start
- * - 只设置了起始时间 start,并 start < value,初始值为 value,否则初始值为 start
- * - 只设置了终止时间 end,并 value < end,初始值为 value,否则初始值为 end
- * - 无起始终止时间,则初始值为 value
- * - 无初始值 value,则初始值为当前本地时间 Date.now()
- * @param {Object} value
- * @param {Object} dateBase
- */
- compareValueWithStartAndEnd(value, start, end) {
- let winner = null;
- value = this.superTimeStamp(value);
- start = this.superTimeStamp(start);
- end = this.superTimeStamp(end);
- if (start && end) {
- if (value < start) {
- winner = new Date(start);
- } else if (value > end) {
- winner = new Date(end);
- } else {
- winner = new Date(value);
- }
- } else if (start && !end) {
- winner = start <= value ? new Date(value) : new Date(start);
- } else if (!start && end) {
- winner = value <= end ? new Date(value) : new Date(end);
- } else {
- winner = new Date(value);
- }
- return winner;
- },
- /**
- * 转换为可比较的时间戳,接受日期、时分秒、时间戳
- * @param {Object} value
- */
- superTimeStamp(value) {
- let dateBase = "";
- if (this.type === "time" && value && typeof value === "string") {
- const now2 = /* @__PURE__ */ new Date();
- const year = now2.getFullYear();
- const month = now2.getMonth() + 1;
- const day = now2.getDate();
- dateBase = year + "/" + month + "/" + day + " ";
- }
- if (Number(value) && typeof value !== NaN) {
- value = parseInt(value);
- dateBase = 0;
- }
- return this.createTimeStamp(dateBase + value);
- },
- /**
- * 解析默认值 value,字符串、时间戳
- * @param {Object} defaultTime
- */
- parseValue(value) {
- if (!value) {
- return;
- }
- if (this.type === "time" && typeof value === "string") {
- this.parseTimeType(value);
- } else {
- let defaultDate = null;
- defaultDate = new Date(value);
- if (this.type !== "time") {
- this.year = defaultDate.getFullYear();
- this.month = defaultDate.getMonth() + 1;
- this.day = defaultDate.getDate();
- }
- if (this.type !== "date") {
- this.hour = defaultDate.getHours();
- this.minute = defaultDate.getMinutes();
- this.second = defaultDate.getSeconds();
- }
- }
- if (this.hideSecond) {
- this.second = 0;
- }
- },
- /**
- * 解析可选择时间范围 start、end,年月日字符串、时间戳
- * @param {Object} defaultTime
- */
- parseDatetimeRange(point, pointType) {
- if (!point) {
- if (pointType === "start") {
- this.startYear = 1920;
- this.startMonth = 1;
- this.startDay = 1;
- this.startHour = 0;
- this.startMinute = 0;
- this.startSecond = 0;
- }
- if (pointType === "end") {
- this.endYear = 2120;
- this.endMonth = 12;
- this.endDay = 31;
- this.endHour = 23;
- this.endMinute = 59;
- this.endSecond = 59;
- }
- return;
- }
- if (this.type === "time") {
- const pointArr = point.split(":");
- this[pointType + "Hour"] = Number(pointArr[0]);
- this[pointType + "Minute"] = Number(pointArr[1]);
- this[pointType + "Second"] = Number(pointArr[2]);
- } else {
- if (!point) {
- pointType === "start" ? this.startYear = this.year - 60 : this.endYear = this.year + 60;
- return;
- }
- if (Number(point) && Number(point) !== NaN) {
- point = parseInt(point);
- }
- const hasTime = /[0-9]:[0-9]/;
- if (this.type === "datetime" && pointType === "end" && typeof point === "string" && !hasTime.test(
- point
- )) {
- point = point + " 23:59:59";
- }
- const pointDate = new Date(point);
- this[pointType + "Year"] = pointDate.getFullYear();
- this[pointType + "Month"] = pointDate.getMonth() + 1;
- this[pointType + "Day"] = pointDate.getDate();
- if (this.type === "datetime") {
- this[pointType + "Hour"] = pointDate.getHours();
- this[pointType + "Minute"] = pointDate.getMinutes();
- this[pointType + "Second"] = pointDate.getSeconds();
- }
- }
- },
- // 获取 年、月、日、时、分、秒 当前可选范围
- getCurrentRange(value) {
- const range2 = [];
- for (let i2 = this["min" + this.capitalize(value)]; i2 <= this["max" + this.capitalize(value)]; i2++) {
- range2.push(i2);
- }
- return range2;
- },
- // 字符串首字母大写
- capitalize(str) {
- return str.charAt(0).toUpperCase() + str.slice(1);
- },
- // 检查当前值是否在范围内,不在则当前值重置为可选范围第一项
- checkValue(name2, value, values) {
- if (values.indexOf(value) === -1) {
- this[name2] = values[0];
- }
- },
- // 每个月的实际天数
- daysInMonth(year, month) {
- return new Date(year, month, 0).getDate();
- },
- //兼容 iOS、safari 日期格式
- fixIosDateFormat(value) {
- if (typeof value === "string") {
- value = value.replace(/-/g, "/");
- }
- return value;
- },
- /**
- * 生成时间戳
- * @param {Object} time
- */
- createTimeStamp(time2) {
- if (!time2)
- return;
- if (typeof time2 === "number") {
- return time2;
- } else {
- time2 = time2.replace(/-/g, "/");
- if (this.type === "date") {
- time2 = time2 + " 00:00:00";
- }
- return Date.parse(time2);
- }
- },
- /**
- * 生成日期或时间的字符串
- */
- createDomSting() {
- const yymmdd = this.year + "-" + this.lessThanTen(this.month) + "-" + this.lessThanTen(this.day);
- let hhmmss = this.lessThanTen(this.hour) + ":" + this.lessThanTen(this.minute);
- if (!this.hideSecond) {
- hhmmss = hhmmss + ":" + this.lessThanTen(this.second);
- }
- if (this.type === "date") {
- return yymmdd;
- } else if (this.type === "time") {
- return hhmmss;
- } else {
- return yymmdd + " " + hhmmss;
- }
- },
- /**
- * 初始化返回值,并抛出 change 事件
- */
- initTime(emit = true) {
- this.time = this.createDomSting();
- if (!emit)
- return;
- if (this.returnType === "timestamp" && this.type !== "time") {
- this.$emit("change", this.createTimeStamp(this.time));
- this.$emit("input", this.createTimeStamp(this.time));
- this.$emit("update:modelValue", this.createTimeStamp(this.time));
- } else {
- this.$emit("change", this.time);
- this.$emit("input", this.time);
- this.$emit("update:modelValue", this.time);
- }
- },
- /**
- * 用户选择日期或时间更新 data
- * @param {Object} e
- */
- bindDateChange(e2) {
- const val = e2.detail.value;
- this.year = this.years[val[0]];
- this.month = this.months[val[1]];
- this.day = this.days[val[2]];
- },
- bindTimeChange(e2) {
- const val = e2.detail.value;
- this.hour = this.hours[val[0]];
- this.minute = this.minutes[val[1]];
- this.second = this.seconds[val[2]];
- },
- /**
- * 初始化弹出层
- */
- initTimePicker() {
- if (this.disabled)
- return;
- const value = this.fixIosDateFormat(this.value);
- this.initPickerValue(value);
- this.visible = !this.visible;
- },
- /**
- * 触发或关闭弹框
- */
- tiggerTimePicker(e2) {
- this.visible = !this.visible;
- },
- /**
- * 用户点击“清空”按钮,清空当前值
- */
- clearTime() {
- this.time = "";
- this.$emit("change", this.time);
- this.$emit("input", this.time);
- this.$emit("update:modelValue", this.time);
- this.tiggerTimePicker();
- },
- /**
- * 用户点击“确定”按钮
- */
- setTime() {
- this.initTime();
- this.tiggerTimePicker();
- }
- }
- };
- function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-datetime-picker" }, [
- vue.createElementVNode("view", {
- onClick: _cache[0] || (_cache[0] = (...args) => $options.initTimePicker && $options.initTimePicker(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-datetime-picker-timebox-pointer", { "uni-datetime-picker-disabled": $props.disabled, "uni-datetime-picker-timebox": $props.border }])
- },
- [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-text" },
- vue.toDisplayString($data.time),
- 1
- /* TEXT */
- ),
- !$data.time ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-datetime-picker-time"
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-text" },
- vue.toDisplayString($options.selectTimeText),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- )
- ], true)
- ]),
- $data.visible ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- id: "mask",
- class: "uni-datetime-picker-mask",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args))
- })) : vue.createCommentVNode("v-if", true),
- $data.visible ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["uni-datetime-picker-popup", [$data.dateShow && $data.timeShow ? "" : "fix-nvue-height"]]),
- style: vue.normalizeStyle($data.fixNvueBug)
- },
- [
- vue.createElementVNode("view", { class: "uni-title" }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-text" },
- vue.toDisplayString($options.selectTimeText),
- 1
- /* TEXT */
- )
- ]),
- $data.dateShow ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-datetime-picker__container-box"
- }, [
- vue.createElementVNode("picker-view", {
- class: "uni-datetime-picker-view",
- "indicator-style": $data.indicatorStyle,
- value: $options.ymd,
- onChange: _cache[2] || (_cache[2] = (...args) => $options.bindDateChange && $options.bindDateChange(...args))
- }, [
- vue.createElementVNode("picker-view-column", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.years, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "uni-datetime-picker-item",
- key: index2
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-item" },
- vue.toDisplayString($options.lessThanTen(item)),
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("picker-view-column", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.months, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "uni-datetime-picker-item",
- key: index2
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-item" },
- vue.toDisplayString($options.lessThanTen(item)),
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("picker-view-column", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.days, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "uni-datetime-picker-item",
- key: index2
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-item" },
- vue.toDisplayString($options.lessThanTen(item)),
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ], 40, ["indicator-style", "value"]),
- vue.createCommentVNode(" 兼容 nvue 不支持伪类 "),
- vue.createElementVNode("text", { class: "uni-datetime-picker-sign sign-left" }, "-"),
- vue.createElementVNode("text", { class: "uni-datetime-picker-sign sign-right" }, "-")
- ])) : vue.createCommentVNode("v-if", true),
- $data.timeShow ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-datetime-picker__container-box"
- }, [
- vue.createElementVNode("picker-view", {
- class: vue.normalizeClass(["uni-datetime-picker-view", [$props.hideSecond ? "time-hide-second" : ""]]),
- "indicator-style": $data.indicatorStyle,
- value: $options.hms,
- onChange: _cache[3] || (_cache[3] = (...args) => $options.bindTimeChange && $options.bindTimeChange(...args))
- }, [
- vue.createElementVNode("picker-view-column", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.hours, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "uni-datetime-picker-item",
- key: index2
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-item" },
- vue.toDisplayString($options.lessThanTen(item)),
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("picker-view-column", null, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.minutes, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "uni-datetime-picker-item",
- key: index2
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-item" },
- vue.toDisplayString($options.lessThanTen(item)),
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- !$props.hideSecond ? (vue.openBlock(), vue.createElementBlock("picker-view-column", { key: 0 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.seconds, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "uni-datetime-picker-item",
- key: index2
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-item" },
- vue.toDisplayString($options.lessThanTen(item)),
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ], 42, ["indicator-style", "value"]),
- vue.createCommentVNode(" 兼容 nvue 不支持伪类 "),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["uni-datetime-picker-sign", [$props.hideSecond ? "sign-center" : "sign-left"]])
- },
- ":",
- 2
- /* CLASS */
- ),
- !$props.hideSecond ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "uni-datetime-picker-sign sign-right"
- }, ":")) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "uni-datetime-picker-btn" }, [
- vue.createElementVNode("view", {
- onClick: _cache[4] || (_cache[4] = (...args) => $options.clearTime && $options.clearTime(...args))
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-btn-text" },
- vue.toDisplayString($options.clearText),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "uni-datetime-picker-btn-group" }, [
- vue.createElementVNode("view", {
- class: "uni-datetime-picker-cancel",
- onClick: _cache[5] || (_cache[5] = (...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args))
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-btn-text" },
- vue.toDisplayString($options.cancelText),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- onClick: _cache[6] || (_cache[6] = (...args) => $options.setTime && $options.setTime(...args))
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-datetime-picker-btn-text" },
- vue.toDisplayString($options.okText),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const timePicker = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$11], ["__scopeId", "data-v-1d532b70"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue"]]);
- const {
- t: t$1
- } = initVueI18n(messages);
- const _sfc_main$11 = {
- components: {
- calendarItem,
- timePicker
- },
- props: {
- date: {
- type: String,
- default: ""
- },
- defTime: {
- type: [String, Object],
- default: ""
- },
- selectableTimes: {
- type: [Object],
- default() {
- return {};
- }
- },
- selected: {
- type: Array,
- default() {
- return [];
- }
- },
- lunar: {
- type: Boolean,
- default: false
- },
- startDate: {
- type: String,
- default: ""
- },
- endDate: {
- type: String,
- default: ""
- },
- range: {
- type: Boolean,
- default: false
- },
- typeHasTime: {
- type: Boolean,
- default: false
- },
- insert: {
- type: Boolean,
- default: true
- },
- showMonth: {
- type: Boolean,
- default: true
- },
- clearDate: {
- type: Boolean,
- default: true
- },
- left: {
- type: Boolean,
- default: true
- },
- right: {
- type: Boolean,
- default: true
- },
- checkHover: {
- type: Boolean,
- default: true
- },
- hideSecond: {
- type: [Boolean],
- default: false
- },
- pleStatus: {
- type: Object,
- default() {
- return {
- before: "",
- after: "",
- data: [],
- fulldate: ""
- };
- }
- }
- },
- data() {
- return {
- show: false,
- weeks: [],
- calendar: {},
- nowDate: "",
- aniMaskShow: false,
- firstEnter: true,
- time: "",
- timeRange: {
- startTime: "",
- endTime: ""
- },
- tempSingleDate: "",
- tempRange: {
- before: "",
- after: ""
- }
- };
- },
- watch: {
- date: {
- immediate: true,
- handler(newVal, oldVal) {
- if (!this.range) {
- this.tempSingleDate = newVal;
- setTimeout(() => {
- this.init(newVal);
- }, 100);
- }
- }
- },
- defTime: {
- immediate: true,
- handler(newVal, oldVal) {
- if (!this.range) {
- this.time = newVal;
- } else {
- this.timeRange.startTime = newVal.start;
- this.timeRange.endTime = newVal.end;
- }
- }
- },
- startDate(val) {
- this.cale.resetSatrtDate(val);
- this.cale.setDate(this.nowDate.fullDate);
- this.weeks = this.cale.weeks;
- },
- endDate(val) {
- this.cale.resetEndDate(val);
- this.cale.setDate(this.nowDate.fullDate);
- this.weeks = this.cale.weeks;
- },
- selected(newVal) {
- this.cale.setSelectInfo(this.nowDate.fullDate, newVal);
- this.weeks = this.cale.weeks;
- },
- pleStatus: {
- immediate: true,
- handler(newVal, oldVal) {
- const {
- before,
- after,
- fulldate,
- which
- } = newVal;
- this.tempRange.before = before;
- this.tempRange.after = after;
- setTimeout(() => {
- if (fulldate) {
- this.cale.setHoverMultiple(fulldate);
- if (before && after) {
- this.cale.lastHover = true;
- if (this.rangeWithinMonth(after, before))
- return;
- this.setDate(before);
- } else {
- this.cale.setMultiple(fulldate);
- this.setDate(this.nowDate.fullDate);
- this.calendar.fullDate = "";
- this.cale.lastHover = false;
- }
- } else {
- this.cale.setDefaultMultiple(before, after);
- if (which === "left") {
- this.setDate(before);
- this.weeks = this.cale.weeks;
- } else {
- this.setDate(after);
- this.weeks = this.cale.weeks;
- }
- this.cale.lastHover = true;
- }
- }, 16);
- }
- }
- },
- computed: {
- reactStartTime() {
- const activeDate = this.range ? this.tempRange.before : this.calendar.fullDate;
- const res = activeDate === this.startDate ? this.selectableTimes.start : "";
- return res;
- },
- reactEndTime() {
- const activeDate = this.range ? this.tempRange.after : this.calendar.fullDate;
- const res = activeDate === this.endDate ? this.selectableTimes.end : "";
- return res;
- },
- /**
- * for i18n
- */
- selectDateText() {
- return t$1("uni-datetime-picker.selectDate");
- },
- startDateText() {
- return this.startPlaceholder || t$1("uni-datetime-picker.startDate");
- },
- endDateText() {
- return this.endPlaceholder || t$1("uni-datetime-picker.endDate");
- },
- okText() {
- return t$1("uni-datetime-picker.ok");
- },
- monText() {
- return t$1("uni-calender.MON");
- },
- TUEText() {
- return t$1("uni-calender.TUE");
- },
- WEDText() {
- return t$1("uni-calender.WED");
- },
- THUText() {
- return t$1("uni-calender.THU");
- },
- FRIText() {
- return t$1("uni-calender.FRI");
- },
- SATText() {
- return t$1("uni-calender.SAT");
- },
- SUNText() {
- return t$1("uni-calender.SUN");
- }
- },
- created() {
- this.cale = new Calendar({
- // date: new Date(),
- selected: this.selected,
- startDate: this.startDate,
- endDate: this.endDate,
- range: this.range
- // multipleStatus: this.pleStatus
- });
- this.init(this.date);
- },
- methods: {
- leaveCale() {
- this.firstEnter = true;
- },
- handleMouse(weeks) {
- if (weeks.disable)
- return;
- if (this.cale.lastHover)
- return;
- let {
- before,
- after
- } = this.cale.multipleStatus;
- if (!before)
- return;
- this.calendar = weeks;
- this.cale.setHoverMultiple(this.calendar.fullDate);
- this.weeks = this.cale.weeks;
- if (this.firstEnter) {
- this.$emit("firstEnterCale", this.cale.multipleStatus);
- this.firstEnter = false;
- }
- },
- rangeWithinMonth(A2, B2) {
- const [yearA, monthA] = A2.split("-");
- const [yearB, monthB] = B2.split("-");
- return yearA === yearB && monthA === monthB;
- },
- // 取消穿透
- clean() {
- this.close();
- },
- clearCalender() {
- if (this.range) {
- this.timeRange.startTime = "";
- this.timeRange.endTime = "";
- this.tempRange.before = "";
- this.tempRange.after = "";
- this.cale.multipleStatus.before = "";
- this.cale.multipleStatus.after = "";
- this.cale.multipleStatus.data = [];
- this.cale.lastHover = false;
- } else {
- this.time = "";
- this.tempSingleDate = "";
- }
- this.calendar.fullDate = "";
- this.setDate();
- },
- bindDateChange(e2) {
- const value = e2.detail.value + "-1";
- this.init(value);
- },
- /**
- * 初始化日期显示
- * @param {Object} date
- */
- init(date2) {
- this.cale.setDate(date2);
- this.weeks = this.cale.weeks;
- this.nowDate = this.calendar = this.cale.getInfo(date2);
- },
- // choiceDate(weeks) {
- // if (weeks.disable) return
- // this.calendar = weeks
- // // 设置多选
- // this.cale.setMultiple(this.calendar.fullDate, true)
- // this.weeks = this.cale.weeks
- // this.tempSingleDate = this.calendar.fullDate
- // this.tempRange.before = this.cale.multipleStatus.before
- // this.tempRange.after = this.cale.multipleStatus.after
- // this.change()
- // },
- /**
- * 打开日历弹窗
- */
- open() {
- if (this.clearDate && !this.insert) {
- this.cale.cleanMultipleStatus();
- this.init(this.date);
- }
- this.show = true;
- this.$nextTick(() => {
- setTimeout(() => {
- this.aniMaskShow = true;
- }, 50);
- });
- },
- /**
- * 关闭日历弹窗
- */
- close() {
- this.aniMaskShow = false;
- this.$nextTick(() => {
- setTimeout(() => {
- this.show = false;
- this.$emit("close");
- }, 300);
- });
- },
- /**
- * 确认按钮
- */
- confirm() {
- this.setEmit("confirm");
- this.close();
- },
- /**
- * 变化触发
- */
- change() {
- if (!this.insert)
- return;
- this.setEmit("change");
- },
- /**
- * 选择月份触发
- */
- monthSwitch() {
- let {
- year,
- month
- } = this.nowDate;
- this.$emit("monthSwitch", {
- year,
- month: Number(month)
- });
- },
- /**
- * 派发事件
- * @param {Object} name
- */
- setEmit(name2) {
- let {
- year,
- month,
- date: date2,
- fullDate,
- lunar,
- extraInfo
- } = this.calendar;
- this.$emit(name2, {
- range: this.cale.multipleStatus,
- year,
- month,
- date: date2,
- time: this.time,
- timeRange: this.timeRange,
- fulldate: fullDate,
- lunar,
- extraInfo: extraInfo || {}
- });
- },
- /**
- * 选择天触发
- * @param {Object} weeks
- */
- choiceDate(weeks) {
- if (weeks.disable)
- return;
- this.calendar = weeks;
- this.calendar.userChecked = true;
- this.cale.setMultiple(this.calendar.fullDate, true);
- this.weeks = this.cale.weeks;
- this.tempSingleDate = this.calendar.fullDate;
- this.tempRange.before = this.cale.multipleStatus.before;
- this.tempRange.after = this.cale.multipleStatus.after;
- this.change();
- },
- /**
- * 回到今天
- */
- backtoday() {
- let date2 = this.cale.getDate(/* @__PURE__ */ new Date()).fullDate;
- this.init(date2);
- this.change();
- },
- /**
- * 比较时间大小
- */
- dateCompare(startDate, endDate) {
- startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
- endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
- if (startDate <= endDate) {
- return true;
- } else {
- return false;
- }
- },
- /**
- * 上个月
- */
- pre() {
- const preDate = this.cale.getDate(this.nowDate.fullDate, -1, "month").fullDate;
- this.setDate(preDate);
- this.monthSwitch();
- },
- /**
- * 下个月
- */
- next() {
- const nextDate = this.cale.getDate(this.nowDate.fullDate, 1, "month").fullDate;
- this.setDate(nextDate);
- this.monthSwitch();
- },
- /**
- * 设置日期
- * @param {Object} date
- */
- setDate(date2) {
- this.cale.setDate(date2);
- this.weeks = this.cale.weeks;
- this.nowDate = this.cale.getInfo(date2);
- }
- }
- };
- function _sfc_render$10(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_calendar_item = vue.resolveComponent("calendar-item");
- const _component_time_picker = vue.resolveComponent("time-picker");
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "uni-calendar",
- onMouseleave: _cache[9] || (_cache[9] = (...args) => $options.leaveCale && $options.leaveCale(...args))
- },
- [
- !$props.insert && $data.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uni-calendar__mask", { "uni-calendar--mask-show": $data.aniMaskShow }]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clean && $options.clean(...args))
- },
- null,
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- $props.insert || $data.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["uni-calendar__content", { "uni-calendar--fixed": !$props.insert, "uni-calendar--ani-show": $data.aniMaskShow, "uni-calendar__content-mobile": $data.aniMaskShow }])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-calendar__header", { "uni-calendar__header-mobile": !$props.insert }])
- },
- [
- $props.left ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-calendar__header-btn-box",
- onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.pre && $options.pre(...args), ["stop"]))
- }, [
- vue.createElementVNode("view", { class: "uni-calendar__header-btn uni-calendar--left" })
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("picker", {
- mode: "date",
- value: $props.date,
- fields: "month",
- onChange: _cache[2] || (_cache[2] = (...args) => $options.bindDateChange && $options.bindDateChange(...args))
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-calendar__header-text" },
- vue.toDisplayString(($data.nowDate.year || "") + " 年 " + ($data.nowDate.month || "") + " 月"),
- 1
- /* TEXT */
- )
- ], 40, ["value"]),
- $props.right ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-calendar__header-btn-box",
- onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.next && $options.next(...args), ["stop"]))
- }, [
- vue.createElementVNode("view", { class: "uni-calendar__header-btn uni-calendar--right" })
- ])) : vue.createCommentVNode("v-if", true),
- !$props.insert ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "dialog-close",
- onClick: _cache[4] || (_cache[4] = (...args) => $options.clean && $options.clean(...args))
- }, [
- vue.createElementVNode("view", {
- class: "dialog-close-plus",
- "data-id": "close"
- }),
- vue.createElementVNode("view", {
- class: "dialog-close-plus dialog-close-rotate",
- "data-id": "close"
- })
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(' <text class="uni-calendar__backtoday" @click="backtoday">回到今天</text> ')
- ],
- 2
- /* CLASS */
- ),
- vue.createElementVNode("view", { class: "uni-calendar__box" }, [
- $props.showMonth ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-calendar__box-bg"
- }, [
- vue.createElementVNode(
- "text",
- { class: "uni-calendar__box-bg-text" },
- vue.toDisplayString($data.nowDate.month),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", {
- class: "uni-calendar__weeks",
- style: { "padding-bottom": "7px" }
- }, [
- vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
- vue.createElementVNode(
- "text",
- { class: "uni-calendar__weeks-day-text" },
- vue.toDisplayString($options.SUNText),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
- vue.createElementVNode(
- "text",
- { class: "uni-calendar__weeks-day-text" },
- vue.toDisplayString($options.monText),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
- vue.createElementVNode(
- "text",
- { class: "uni-calendar__weeks-day-text" },
- vue.toDisplayString($options.TUEText),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
- vue.createElementVNode(
- "text",
- { class: "uni-calendar__weeks-day-text" },
- vue.toDisplayString($options.WEDText),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
- vue.createElementVNode(
- "text",
- { class: "uni-calendar__weeks-day-text" },
- vue.toDisplayString($options.THUText),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
- vue.createElementVNode(
- "text",
- { class: "uni-calendar__weeks-day-text" },
- vue.toDisplayString($options.FRIText),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
- vue.createElementVNode(
- "text",
- { class: "uni-calendar__weeks-day-text" },
- vue.toDisplayString($options.SATText),
- 1
- /* TEXT */
- )
- ])
- ]),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.weeks, (item, weekIndex) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "uni-calendar__weeks",
- key: weekIndex
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(item, (weeks, weeksIndex) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "uni-calendar__weeks-item",
- key: weeksIndex
- }, [
- vue.createVNode(_component_calendar_item, {
- class: "uni-calendar-item--hook",
- weeks,
- calendar: $data.calendar,
- selected: $props.selected,
- lunar: $props.lunar,
- checkHover: $props.range,
- onChange: $options.choiceDate,
- onHandleMouse: $options.handleMouse
- }, null, 8, ["weeks", "calendar", "selected", "lunar", "checkHover", "onChange", "onHandleMouse"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- !$props.insert && !$props.range && $props.typeHasTime ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-date-changed uni-calendar--fixed-top",
- style: { "padding": "0 80px" }
- }, [
- vue.createElementVNode(
- "view",
- { class: "uni-date-changed--time-date" },
- vue.toDisplayString($data.tempSingleDate ? $data.tempSingleDate : $options.selectDateText),
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_time_picker, {
- type: "time",
- start: $options.reactStartTime,
- end: $options.reactEndTime,
- modelValue: $data.time,
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.time = $event),
- disabled: !$data.tempSingleDate,
- border: false,
- "hide-second": $props.hideSecond,
- class: "time-picker-style"
- }, null, 8, ["start", "end", "modelValue", "disabled", "hide-second"])
- ])) : vue.createCommentVNode("v-if", true),
- !$props.insert && $props.range && $props.typeHasTime ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-date-changed uni-calendar--fixed-top"
- }, [
- vue.createElementVNode("view", { class: "uni-date-changed--time-start" }, [
- vue.createElementVNode(
- "view",
- { class: "uni-date-changed--time-date" },
- vue.toDisplayString($data.tempRange.before ? $data.tempRange.before : $options.startDateText),
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_time_picker, {
- type: "time",
- start: $options.reactStartTime,
- modelValue: $data.timeRange.startTime,
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.timeRange.startTime = $event),
- border: false,
- "hide-second": $props.hideSecond,
- disabled: !$data.tempRange.before,
- class: "time-picker-style"
- }, null, 8, ["start", "modelValue", "hide-second", "disabled"])
- ]),
- vue.createVNode(_component_uni_icons, {
- type: "arrowthinright",
- color: "#999",
- style: { "line-height": "50px" }
- }),
- vue.createElementVNode("view", { class: "uni-date-changed--time-end" }, [
- vue.createElementVNode(
- "view",
- { class: "uni-date-changed--time-date" },
- vue.toDisplayString($data.tempRange.after ? $data.tempRange.after : $options.endDateText),
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_time_picker, {
- type: "time",
- end: $options.reactEndTime,
- modelValue: $data.timeRange.endTime,
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.timeRange.endTime = $event),
- border: false,
- "hide-second": $props.hideSecond,
- disabled: !$data.tempRange.after,
- class: "time-picker-style"
- }, null, 8, ["end", "modelValue", "hide-second", "disabled"])
- ])
- ])) : vue.createCommentVNode("v-if", true),
- !$props.insert ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "uni-date-changed uni-date-btn--ok"
- }, [
- vue.createCommentVNode(' <view class="uni-calendar__header-btn-box">\n <text class="uni-calendar__button-text uni-calendar--fixed-width">{{okText}}</text>\n </view> '),
- vue.createElementVNode("view", {
- class: "uni-datetime-picker--btn",
- onClick: _cache[8] || (_cache[8] = (...args) => $options.confirm && $options.confirm(...args))
- }, "确认")
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 32
- /* NEED_HYDRATION */
- );
- }
- const calendar = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$10], ["__scopeId", "data-v-1d379219"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue"]]);
- const {
- t
- } = initVueI18n(messages);
- const _sfc_main$10 = {
- name: "UniDatetimePicker",
- components: {
- calendar,
- timePicker
- },
- data() {
- return {
- isRange: false,
- hasTime: false,
- mobileRange: false,
- // 单选
- singleVal: "",
- tempSingleDate: "",
- defSingleDate: "",
- time: "",
- // 范围选
- caleRange: {
- startDate: "",
- startTime: "",
- endDate: "",
- endTime: ""
- },
- range: {
- startDate: "",
- // startTime: '',
- endDate: ""
- // endTime: ''
- },
- tempRange: {
- startDate: "",
- startTime: "",
- endDate: "",
- endTime: ""
- },
- // 左右日历同步数据
- startMultipleStatus: {
- before: "",
- after: "",
- data: [],
- fulldate: ""
- },
- endMultipleStatus: {
- before: "",
- after: "",
- data: [],
- fulldate: ""
- },
- visible: false,
- popup: false,
- popover: null,
- isEmitValue: false,
- isPhone: false,
- isFirstShow: true
- };
- },
- props: {
- type: {
- type: String,
- default: "datetime"
- },
- value: {
- type: [String, Number, Array, Date],
- default: ""
- },
- modelValue: {
- type: [String, Number, Array, Date],
- default: ""
- },
- start: {
- type: [Number, String],
- default: ""
- },
- end: {
- type: [Number, String],
- default: ""
- },
- returnType: {
- type: String,
- default: "string"
- },
- placeholder: {
- type: String,
- default: ""
- },
- startPlaceholder: {
- type: String,
- default: ""
- },
- endPlaceholder: {
- type: String,
- default: ""
- },
- rangeSeparator: {
- type: String,
- default: "-"
- },
- border: {
- type: [Boolean],
- default: true
- },
- disabled: {
- type: [Boolean],
- default: false
- },
- clearIcon: {
- type: [Boolean],
- default: true
- },
- hideSecond: {
- type: [Boolean],
- default: false
- }
- },
- watch: {
- type: {
- immediate: true,
- handler(newVal, oldVal) {
- if (newVal.indexOf("time") !== -1) {
- this.hasTime = true;
- } else {
- this.hasTime = false;
- }
- if (newVal.indexOf("range") !== -1) {
- this.isRange = true;
- } else {
- this.isRange = false;
- }
- }
- },
- modelValue: {
- immediate: true,
- handler(newVal, oldVal) {
- if (this.isEmitValue) {
- this.isEmitValue = false;
- return;
- }
- this.initPicker(newVal);
- }
- },
- start: {
- immediate: true,
- handler(newVal, oldVal) {
- if (!newVal)
- return;
- const {
- defDate,
- defTime
- } = this.parseDate(newVal);
- this.caleRange.startDate = defDate;
- if (this.hasTime) {
- this.caleRange.startTime = defTime;
- }
- }
- },
- end: {
- immediate: true,
- handler(newVal, oldVal) {
- if (!newVal)
- return;
- const {
- defDate,
- defTime
- } = this.parseDate(newVal);
- this.caleRange.endDate = defDate;
- if (this.hasTime) {
- this.caleRange.endTime = defTime;
- }
- }
- }
- },
- computed: {
- reactStartTime() {
- const activeDate = this.isRange ? this.tempRange.startDate : this.tempSingleDate;
- const res = activeDate === this.caleRange.startDate ? this.caleRange.startTime : "";
- return res;
- },
- reactEndTime() {
- const activeDate = this.isRange ? this.tempRange.endDate : this.tempSingleDate;
- const res = activeDate === this.caleRange.endDate ? this.caleRange.endTime : "";
- return res;
- },
- reactMobDefTime() {
- const times2 = {
- start: this.tempRange.startTime,
- end: this.tempRange.endTime
- };
- return this.isRange ? times2 : this.time;
- },
- mobSelectableTime() {
- return {
- start: this.caleRange.startTime,
- end: this.caleRange.endTime
- };
- },
- datePopupWidth() {
- return this.isRange ? 653 : 301;
- },
- /**
- * for i18n
- */
- singlePlaceholderText() {
- return this.placeholder || (this.type === "date" ? this.selectDateText : t(
- "uni-datetime-picker.selectDateTime"
- ));
- },
- startPlaceholderText() {
- return this.startPlaceholder || this.startDateText;
- },
- endPlaceholderText() {
- return this.endPlaceholder || this.endDateText;
- },
- selectDateText() {
- return t("uni-datetime-picker.selectDate");
- },
- selectTimeText() {
- return t("uni-datetime-picker.selectTime");
- },
- startDateText() {
- return this.startPlaceholder || t("uni-datetime-picker.startDate");
- },
- startTimeText() {
- return t("uni-datetime-picker.startTime");
- },
- endDateText() {
- return this.endPlaceholder || t("uni-datetime-picker.endDate");
- },
- endTimeText() {
- return t("uni-datetime-picker.endTime");
- },
- okText() {
- return t("uni-datetime-picker.ok");
- },
- clearText() {
- return t("uni-datetime-picker.clear");
- },
- showClearIcon() {
- const {
- clearIcon,
- disabled,
- singleVal,
- range: range2
- } = this;
- const bool = clearIcon && !disabled && (singleVal || range2.startDate && range2.endDate);
- return bool;
- }
- },
- created() {
- this.form = this.getForm("uniForms");
- this.formItem = this.getForm("uniFormsItem");
- },
- mounted() {
- this.platform();
- },
- methods: {
- /**
- * 获取父元素实例
- */
- getForm(name2 = "uniForms") {
- let parent2 = this.$parent;
- let parentName = parent2.$options.name;
- while (parentName !== name2) {
- parent2 = parent2.$parent;
- if (!parent2)
- return false;
- parentName = parent2.$options.name;
- }
- return parent2;
- },
- initPicker(newVal) {
- if (!newVal || Array.isArray(newVal) && !newVal.length) {
- this.$nextTick(() => {
- this.clear(false);
- });
- return;
- }
- if (!Array.isArray(newVal) && !this.isRange) {
- const {
- defDate,
- defTime
- } = this.parseDate(newVal);
- this.singleVal = defDate;
- this.tempSingleDate = defDate;
- this.defSingleDate = defDate;
- if (this.hasTime) {
- this.singleVal = defDate + " " + defTime;
- this.time = defTime;
- }
- } else {
- const [before, after] = newVal;
- if (!before && !after)
- return;
- const defBefore = this.parseDate(before);
- const defAfter = this.parseDate(after);
- const startDate = defBefore.defDate;
- const endDate = defAfter.defDate;
- this.range.startDate = this.tempRange.startDate = startDate;
- this.range.endDate = this.tempRange.endDate = endDate;
- if (this.hasTime) {
- this.range.startDate = defBefore.defDate + " " + defBefore.defTime;
- this.range.endDate = defAfter.defDate + " " + defAfter.defTime;
- this.tempRange.startTime = defBefore.defTime;
- this.tempRange.endTime = defAfter.defTime;
- }
- const defaultRange = {
- before: defBefore.defDate,
- after: defAfter.defDate
- };
- this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, defaultRange, {
- which: "right"
- });
- this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, defaultRange, {
- which: "left"
- });
- }
- },
- updateLeftCale(e2) {
- const left = this.$refs.left;
- left.cale.setHoverMultiple(e2.after);
- left.setDate(this.$refs.left.nowDate.fullDate);
- },
- updateRightCale(e2) {
- const right = this.$refs.right;
- right.cale.setHoverMultiple(e2.after);
- right.setDate(this.$refs.right.nowDate.fullDate);
- },
- platform() {
- const systemInfo = uni.getSystemInfoSync();
- this.isPhone = systemInfo.windowWidth <= 500;
- this.windowWidth = systemInfo.windowWidth;
- },
- show(event) {
- if (this.disabled) {
- return;
- }
- this.platform();
- if (this.isPhone) {
- this.$refs.mobile.open();
- return;
- }
- this.popover = {
- top: "10px"
- };
- const dateEditor = uni.createSelectorQuery().in(this).select(".uni-date-editor");
- dateEditor.boundingClientRect((rect) => {
- if (this.windowWidth - rect.left < this.datePopupWidth) {
- this.popover.right = 0;
- }
- }).exec();
- setTimeout(() => {
- this.popup = !this.popup;
- if (!this.isPhone && this.isRange && this.isFirstShow) {
- this.isFirstShow = false;
- const {
- startDate,
- endDate
- } = this.range;
- if (startDate && endDate) {
- if (this.diffDate(startDate, endDate) < 30) {
- this.$refs.right.next();
- }
- } else {
- this.$refs.right.next();
- this.$refs.right.cale.lastHover = false;
- }
- }
- }, 50);
- },
- close() {
- setTimeout(() => {
- this.popup = false;
- this.$emit("maskClick", this.value);
- }, 20);
- },
- setEmit(value) {
- if (this.returnType === "timestamp" || this.returnType === "date") {
- if (!Array.isArray(value)) {
- if (!this.hasTime) {
- value = value + " 00:00:00";
- }
- value = this.createTimestamp(value);
- if (this.returnType === "date") {
- value = new Date(value);
- }
- } else {
- if (!this.hasTime) {
- value[0] = value[0] + " 00:00:00";
- value[1] = value[1] + " 00:00:00";
- }
- value[0] = this.createTimestamp(value[0]);
- value[1] = this.createTimestamp(value[1]);
- if (this.returnType === "date") {
- value[0] = new Date(value[0]);
- value[1] = new Date(value[1]);
- }
- }
- }
- this.formItem && this.formItem.setValue(value);
- this.$emit("change", value);
- this.$emit("input", value);
- this.$emit("update:modelValue", value);
- this.isEmitValue = true;
- },
- createTimestamp(date2) {
- date2 = this.fixIosDateFormat(date2);
- return Date.parse(new Date(date2));
- },
- singleChange(e2) {
- this.tempSingleDate = e2.fulldate;
- if (this.hasTime)
- return;
- this.confirmSingleChange();
- },
- confirmSingleChange() {
- if (!this.tempSingleDate) {
- this.popup = false;
- return;
- }
- if (this.hasTime) {
- this.singleVal = this.tempSingleDate + " " + (this.time ? this.time : "00:00:00");
- } else {
- this.singleVal = this.tempSingleDate;
- }
- this.setEmit(this.singleVal);
- this.popup = false;
- },
- leftChange(e2) {
- const {
- before,
- after
- } = e2.range;
- this.rangeChange(before, after);
- const obj = {
- before: e2.range.before,
- after: e2.range.after,
- data: e2.range.data,
- fulldate: e2.fulldate
- };
- this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, obj);
- },
- rightChange(e2) {
- const {
- before,
- after
- } = e2.range;
- this.rangeChange(before, after);
- const obj = {
- before: e2.range.before,
- after: e2.range.after,
- data: e2.range.data,
- fulldate: e2.fulldate
- };
- this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, obj);
- },
- mobileChange(e2) {
- if (this.isRange) {
- const {
- before,
- after
- } = e2.range;
- this.handleStartAndEnd(before, after, true);
- if (this.hasTime) {
- const {
- startTime,
- endTime
- } = e2.timeRange;
- this.tempRange.startTime = startTime;
- this.tempRange.endTime = endTime;
- }
- this.confirmRangeChange();
- } else {
- if (this.hasTime) {
- this.singleVal = e2.fulldate + " " + e2.time;
- } else {
- this.singleVal = e2.fulldate;
- }
- this.setEmit(this.singleVal);
- }
- this.$refs.mobile.close();
- },
- rangeChange(before, after) {
- if (!(before && after))
- return;
- this.handleStartAndEnd(before, after, true);
- if (this.hasTime)
- return;
- this.confirmRangeChange();
- },
- confirmRangeChange() {
- if (!this.tempRange.startDate && !this.tempRange.endDate) {
- this.popup = false;
- return;
- }
- let start, end;
- if (!this.hasTime) {
- start = this.range.startDate = this.tempRange.startDate;
- end = this.range.endDate = this.tempRange.endDate;
- } else {
- start = this.range.startDate = this.tempRange.startDate + " " + (this.tempRange.startTime ? this.tempRange.startTime : "00:00:00");
- end = this.range.endDate = this.tempRange.endDate + " " + (this.tempRange.endTime ? this.tempRange.endTime : "00:00:00");
- }
- const displayRange = [start, end];
- this.setEmit(displayRange);
- this.popup = false;
- },
- handleStartAndEnd(before, after, temp = false) {
- if (!(before && after))
- return;
- const type = temp ? "tempRange" : "range";
- if (this.dateCompare(before, after)) {
- this[type].startDate = before;
- this[type].endDate = after;
- } else {
- this[type].startDate = after;
- this[type].endDate = before;
- }
- },
- /**
- * 比较时间大小
- */
- dateCompare(startDate, endDate) {
- startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
- endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
- if (startDate <= endDate) {
- return true;
- } else {
- return false;
- }
- },
- /**
- * 比较时间差
- */
- diffDate(startDate, endDate) {
- startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
- endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
- const diff = (endDate - startDate) / (24 * 60 * 60 * 1e3);
- return Math.abs(diff);
- },
- clear(needEmit = true) {
- if (!this.isRange) {
- this.singleVal = "";
- this.tempSingleDate = "";
- this.time = "";
- if (this.isPhone) {
- this.$refs.mobile && this.$refs.mobile.clearCalender();
- } else {
- this.$refs.pcSingle && this.$refs.pcSingle.clearCalender();
- }
- if (needEmit) {
- this.formItem && this.formItem.setValue("");
- this.$emit("change", "");
- this.$emit("input", "");
- this.$emit("update:modelValue", "");
- }
- } else {
- this.range.startDate = "";
- this.range.endDate = "";
- this.tempRange.startDate = "";
- this.tempRange.startTime = "";
- this.tempRange.endDate = "";
- this.tempRange.endTime = "";
- if (this.isPhone) {
- this.$refs.mobile && this.$refs.mobile.clearCalender();
- } else {
- this.$refs.left && this.$refs.left.clearCalender();
- this.$refs.right && this.$refs.right.clearCalender();
- this.$refs.right && this.$refs.right.next();
- }
- if (needEmit) {
- this.formItem && this.formItem.setValue([]);
- this.$emit("change", []);
- this.$emit("input", []);
- this.$emit("update:modelValue", []);
- }
- }
- },
- parseDate(date2) {
- date2 = this.fixIosDateFormat(date2);
- const defVal = new Date(date2);
- const year = defVal.getFullYear();
- const month = defVal.getMonth() + 1;
- const day = defVal.getDate();
- const hour = defVal.getHours();
- const minute = defVal.getMinutes();
- const second = defVal.getSeconds();
- const defDate = year + "-" + this.lessTen(month) + "-" + this.lessTen(day);
- const defTime = this.lessTen(hour) + ":" + this.lessTen(minute) + (this.hideSecond ? "" : ":" + this.lessTen(second));
- return {
- defDate,
- defTime
- };
- },
- lessTen(item) {
- return item < 10 ? "0" + item : item;
- },
- //兼容 iOS、safari 日期格式
- fixIosDateFormat(value) {
- if (typeof value === "string") {
- value = value.replace(/-/g, "/");
- }
- return value;
- },
- leftMonthSwitch(e2) {
- },
- rightMonthSwitch(e2) {
- }
- }
- };
- function _sfc_render$$(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- const _component_time_picker = vue.resolveComponent("time-picker");
- const _component_calendar = vue.resolveComponent("calendar");
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-date" }, [
- vue.createElementVNode("view", {
- class: "uni-date-editor",
- onClick: _cache[4] || (_cache[4] = (...args) => $options.show && $options.show(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-date-editor--x", {
- "uni-date-editor--x__disabled": $props.disabled,
- "uni-date-x--border": $props.border
- }])
- },
- [
- !$data.isRange ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-date-x uni-date-single"
- }, [
- vue.createVNode(_component_uni_icons, {
- type: "calendar",
- color: "#e1e1e1",
- size: "22"
- }),
- vue.withDirectives(vue.createElementVNode("input", {
- class: "uni-date__x-input",
- type: "text",
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.singleVal = $event),
- placeholder: $options.singlePlaceholderText,
- disabled: true
- }, null, 8, ["placeholder"]), [
- [vue.vModelText, $data.singleVal]
- ])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-date-x uni-date-range"
- }, [
- vue.createVNode(_component_uni_icons, {
- type: "calendar",
- color: "#e1e1e1",
- size: "22"
- }),
- vue.withDirectives(vue.createElementVNode("input", {
- class: "uni-date__x-input t-c",
- type: "text",
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.range.startDate = $event),
- placeholder: $options.startPlaceholderText,
- disabled: true
- }, null, 8, ["placeholder"]), [
- [vue.vModelText, $data.range.startDate]
- ]),
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode(
- "view",
- { class: "" },
- vue.toDisplayString($props.rangeSeparator),
- 1
- /* TEXT */
- )
- ], true),
- vue.withDirectives(vue.createElementVNode("input", {
- class: "uni-date__x-input t-c",
- type: "text",
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.range.endDate = $event),
- placeholder: $options.endPlaceholderText,
- disabled: true
- }, null, 8, ["placeholder"]), [
- [vue.vModelText, $data.range.endDate]
- ])
- ])),
- $options.showClearIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "uni-date__icon-clear",
- onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop"]))
- }, [
- vue.createVNode(_component_uni_icons, {
- type: "clear",
- color: "#e1e1e1",
- size: "18"
- })
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- )
- ], true)
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- {
- class: "uni-date-mask",
- onClick: _cache[5] || (_cache[5] = (...args) => $options.close && $options.close(...args))
- },
- null,
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $data.popup]
- ]),
- !$data.isPhone ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- ref: "datePicker",
- class: "uni-date-picker__container"
- },
- [
- !$data.isRange ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "uni-date-single--x",
- style: vue.normalizeStyle($data.popover)
- },
- [
- vue.createElementVNode("view", { class: "uni-popper__arrow" }),
- $data.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-date-changed popup-x-header"
- }, [
- vue.withDirectives(vue.createElementVNode("input", {
- class: "uni-date__input t-c",
- type: "text",
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.tempSingleDate = $event),
- placeholder: $options.selectDateText
- }, null, 8, ["placeholder"]), [
- [vue.vModelText, $data.tempSingleDate]
- ]),
- vue.createVNode(_component_time_picker, {
- type: "time",
- modelValue: $data.time,
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.time = $event),
- border: false,
- disabled: !$data.tempSingleDate,
- start: $options.reactStartTime,
- end: $options.reactEndTime,
- hideSecond: $props.hideSecond,
- style: { "width": "100%" }
- }, {
- default: vue.withCtx(() => [
- vue.withDirectives(vue.createElementVNode("input", {
- class: "uni-date__input t-c",
- type: "text",
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.time = $event),
- placeholder: $options.selectTimeText,
- disabled: !$data.tempSingleDate
- }, null, 8, ["placeholder", "disabled"]), [
- [vue.vModelText, $data.time]
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "disabled", "start", "end", "hideSecond"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_calendar, {
- ref: "pcSingle",
- showMonth: false,
- "start-date": $data.caleRange.startDate,
- "end-date": $data.caleRange.endDate,
- date: $data.defSingleDate,
- onChange: $options.singleChange,
- style: { "padding": "0 8px" }
- }, null, 8, ["start-date", "end-date", "date", "onChange"]),
- $data.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "popup-x-footer"
- }, [
- vue.createCommentVNode(' <text class="">此刻</text> '),
- vue.createElementVNode(
- "text",
- {
- class: "confirm",
- onClick: _cache[9] || (_cache[9] = (...args) => $options.confirmSingleChange && $options.confirmSingleChange(...args))
- },
- vue.toDisplayString($options.okText),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "uni-date-popper__arrow" })
- ],
- 4
- /* STYLE */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "uni-date-range--x",
- style: vue.normalizeStyle($data.popover)
- },
- [
- vue.createElementVNode("view", { class: "uni-popper__arrow" }),
- $data.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "popup-x-header uni-date-changed"
- }, [
- vue.createElementVNode("view", { class: "popup-x-header--datetime" }, [
- vue.withDirectives(vue.createElementVNode("input", {
- class: "uni-date__input uni-date-range__input",
- type: "text",
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $data.tempRange.startDate = $event),
- placeholder: $options.startDateText
- }, null, 8, ["placeholder"]), [
- [vue.vModelText, $data.tempRange.startDate]
- ]),
- vue.createVNode(_component_time_picker, {
- type: "time",
- modelValue: $data.tempRange.startTime,
- "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.tempRange.startTime = $event),
- start: $options.reactStartTime,
- border: false,
- disabled: !$data.tempRange.startDate,
- hideSecond: $props.hideSecond
- }, {
- default: vue.withCtx(() => [
- vue.withDirectives(vue.createElementVNode("input", {
- class: "uni-date__input uni-date-range__input",
- type: "text",
- "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.tempRange.startTime = $event),
- placeholder: $options.startTimeText,
- disabled: !$data.tempRange.startDate
- }, null, 8, ["placeholder", "disabled"]), [
- [vue.vModelText, $data.tempRange.startTime]
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "start", "disabled", "hideSecond"])
- ]),
- vue.createVNode(_component_uni_icons, {
- type: "arrowthinright",
- color: "#999",
- style: { "line-height": "40px" }
- }),
- vue.createElementVNode("view", { class: "popup-x-header--datetime" }, [
- vue.withDirectives(vue.createElementVNode("input", {
- class: "uni-date__input uni-date-range__input",
- type: "text",
- "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.tempRange.endDate = $event),
- placeholder: $options.endDateText
- }, null, 8, ["placeholder"]), [
- [vue.vModelText, $data.tempRange.endDate]
- ]),
- vue.createVNode(_component_time_picker, {
- type: "time",
- modelValue: $data.tempRange.endTime,
- "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.tempRange.endTime = $event),
- end: $options.reactEndTime,
- border: false,
- disabled: !$data.tempRange.endDate,
- hideSecond: $props.hideSecond
- }, {
- default: vue.withCtx(() => [
- vue.withDirectives(vue.createElementVNode("input", {
- class: "uni-date__input uni-date-range__input",
- type: "text",
- "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.tempRange.endTime = $event),
- placeholder: $options.endTimeText,
- disabled: !$data.tempRange.endDate
- }, null, 8, ["placeholder", "disabled"]), [
- [vue.vModelText, $data.tempRange.endTime]
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "end", "disabled", "hideSecond"])
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "popup-x-body" }, [
- vue.createVNode(_component_calendar, {
- ref: "left",
- showMonth: false,
- "start-date": $data.caleRange.startDate,
- "end-date": $data.caleRange.endDate,
- range: true,
- onChange: $options.leftChange,
- pleStatus: $data.endMultipleStatus,
- onFirstEnterCale: $options.updateRightCale,
- onMonthSwitch: $options.leftMonthSwitch,
- style: { "padding": "0 8px" }
- }, null, 8, ["start-date", "end-date", "onChange", "pleStatus", "onFirstEnterCale", "onMonthSwitch"]),
- vue.createVNode(_component_calendar, {
- ref: "right",
- showMonth: false,
- "start-date": $data.caleRange.startDate,
- "end-date": $data.caleRange.endDate,
- range: true,
- onChange: $options.rightChange,
- pleStatus: $data.startMultipleStatus,
- onFirstEnterCale: $options.updateLeftCale,
- onMonthSwitch: $options.rightMonthSwitch,
- style: { "padding": "0 8px", "border-left": "1px solid #F1F1F1" }
- }, null, 8, ["start-date", "end-date", "onChange", "pleStatus", "onFirstEnterCale", "onMonthSwitch"])
- ]),
- $data.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "popup-x-footer"
- }, [
- vue.createElementVNode(
- "text",
- {
- class: "",
- onClick: _cache[16] || (_cache[16] = (...args) => $options.clear && $options.clear(...args))
- },
- vue.toDisplayString($options.clearText),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "confirm",
- onClick: _cache[17] || (_cache[17] = (...args) => $options.confirmRangeChange && $options.confirmRangeChange(...args))
- },
- vue.toDisplayString($options.okText),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- ))
- ],
- 512
- /* NEED_PATCH */
- )), [
- [vue.vShow, $data.popup]
- ]) : vue.createCommentVNode("v-if", true),
- vue.withDirectives(vue.createVNode(_component_calendar, {
- ref: "mobile",
- clearDate: false,
- date: $data.defSingleDate,
- defTime: $options.reactMobDefTime,
- "start-date": $data.caleRange.startDate,
- "end-date": $data.caleRange.endDate,
- selectableTimes: $options.mobSelectableTime,
- pleStatus: $data.endMultipleStatus,
- showMonth: false,
- range: $data.isRange,
- typeHasTime: $data.hasTime,
- insert: false,
- hideSecond: $props.hideSecond,
- onConfirm: $options.mobileChange
- }, null, 8, ["date", "defTime", "start-date", "end-date", "selectableTimes", "pleStatus", "range", "typeHasTime", "hideSecond", "onConfirm"]), [
- [vue.vShow, $data.isPhone]
- ])
- ]);
- }
- const __easycom_0$3 = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$$], ["__scopeId", "data-v-9802168a"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue"]]);
- const _sfc_main$$ = {
- __name: "money",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "69f29528-headerBg": vue.unref(headerBg)
- }));
- const headerBg = sheep$1.$url.css("/static/img/shop/user/wallet_card_bg.png");
- const state = vue.reactive({
- showMoney: false,
- date: [],
- // 筛选的时间段
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 8
- },
- summary: {
- totalIncome: 0,
- totalExpense: 0
- },
- loadStatus: "",
- today: ""
- });
- const tabMaps = [
- {
- name: "全部",
- value: ""
- },
- {
- name: "收入",
- value: "1"
- },
- {
- name: "支出",
- value: "2"
- }
- ];
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const dateFilterText = vue.computed(() => {
- if (state.date[0] === state.date[1]) {
- return state.date[0];
- } else {
- return state.date.join("~");
- }
- });
- async function getLogList() {
- state.loadStatus = "loading";
- const { data, code: code2 } = await PayWalletApi.getWalletTransactionPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- type: tabMaps[state.currentTab].value,
- "createTime[0]": state.date[0] + " 00:00:00",
- "createTime[1]": state.date[1] + " 23:59:59"
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- async function getSummary() {
- const { data, code: code2 } = await PayWalletApi.getWalletTransactionSummary({
- "createTime": [state.date[0] + " 00:00:00", state.date[1] + " 23:59:59"]
- });
- if (code2 !== 0) {
- return;
- }
- state.summary = data;
- }
- onLoad(() => {
- state.today = dayjs().format("YYYY-MM-DD");
- state.date = [state.today, state.today];
- getLogList();
- getSummary();
- sheep$1.$store("user").getWallet();
- });
- function onChange(e2) {
- state.currentTab = e2.index;
- resetPagination(state.pagination);
- getLogList();
- getSummary();
- }
- function onChangeTime(e2) {
- state.date[0] = e2[0];
- state.date[1] = e2[e2.length - 1];
- resetPagination(state.pagination);
- getLogList();
- getSummary();
- }
- onReachBottom(() => {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList();
- });
- const __returned__ = { headerBg, state, tabMaps, userWallet, dateFilterText, getLogList, getSummary, onChange, onChangeTime, computed: vue.computed, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get sheep() {
- return sheep$1;
- }, get dayjs() {
- return dayjs;
- }, get _() {
- return _$1;
- }, get PayWalletApi() {
- return PayWalletApi;
- }, get fen2yuan() {
- return fen2yuan;
- }, get resetPagination() {
- return resetPagination;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$_(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_datetime_picker = resolveEasycom(vue.resolveDynamicComponent("uni-datetime-picker"), __easycom_0$3);
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "wallet-wrap",
- title: "钱包"
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 钱包卡片 "),
- vue.createElementVNode("view", { class: "header-box ss-flex ss-row-center ss-col-center" }, [
- vue.createElementVNode("view", { class: "card-box ui-BG-Main ui-Shadow-Main" }, [
- vue.createElementVNode("view", { class: "card-head ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "card-title ss-m-r-10" }, "钱包余额(元)"),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.showMoney = !$setup.state.showMoney),
- class: vue.normalizeClass(["ss-eye-icon", $setup.state.showMoney ? "cicon-eye" : "cicon-eye-off"])
- },
- null,
- 2
- /* CLASS */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-col-center ss-m-t-64" }, [
- vue.createElementVNode(
- "view",
- { class: "money-num" },
- vue.toDisplayString($setup.state.showMoney ? $setup.fen2yuan($setup.userWallet.balance) : "*****"),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("button", {
- class: "ss-reset-button topup-btn",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/pay/recharge"))
- }, " 充值 ")
- ])
- ])
- ]),
- vue.createVNode(_component_su_sticky, null, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 统计 "),
- vue.createElementVNode("view", { class: "filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between" }, [
- vue.createVNode(_component_uni_datetime_picker, {
- modelValue: $setup.state.data,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.data = $event),
- type: "daterange",
- onChange: $setup.onChangeTime,
- end: $setup.state.today
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("button", { class: "ss-reset-button date-btn" }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.dateFilterText),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "cicon-drop-down ss-seldate-icon" })
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "end"]),
- vue.createElementVNode("view", { class: "total-box" }, [
- vue.createElementVNode(
- "view",
- { class: "ss-m-b-10" },
- "总收入¥" + vue.toDisplayString($setup.fen2yuan($setup.state.summary.totalIncome)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- null,
- "总支出¥" + vue.toDisplayString($setup.fen2yuan($setup.state.summary.totalExpense)),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createVNode(_component_su_tabs, {
- list: $setup.tabMaps,
- onChange: $setup.onChange,
- scrollable: false,
- current: $setup.state.currentTab
- }, null, 8, ["current"])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- text: "暂无数据",
- icon: "/static/data-empty.png"
- })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 钱包记录 "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "wallet-list ss-flex border-bottom",
- key: item.id
- }, [
- vue.createElementVNode("view", { class: "list-content" }, [
- vue.createElementVNode("view", { class: "title-box ss-flex ss-row-between ss-m-b-20" }, [
- vue.createElementVNode(
- "text",
- { class: "title ss-line-1" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "money" }, [
- item.price >= 0 ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "add"
- },
- "+" + vue.toDisplayString($setup.fen2yuan(item.price)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "minus"
- },
- vue.toDisplayString($setup.fen2yuan(item.price)),
- 1
- /* TEXT */
- ))
- ])
- ]),
- vue.createElementVNode(
- "text",
- { class: "time" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat($setup.state.createTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- }
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesUserWalletMoney = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["render", _sfc_render$_], ["__scopeId", "data-v-69f29528"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/money.vue"]]);
- const _sfc_main$_ = {
- __name: "ScoreLog",
- props: {
- isFreeze: {
- type: String,
- default: ""
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sys_navBar = sheep$1.$platform.navbar;
- const props = __props;
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageSize: 10,
- pageNo: 1
- },
- loadStatus: "",
- showModel: false,
- showQueModel: false
- });
- async function getLogList(isFreeze) {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await ScoreApi.getScoreApi({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- isFreeze
- });
- if (code2 !== 0) {
- return;
- }
- let list = _$1.concat(state.pagination.list, data.list);
- state.pagination.list = list;
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- const title = (item) => {
- let title2 = item.profitStatusName + "";
- if (item.username) {
- title2 += "(" + item.username + ")";
- }
- if ([3].includes(item.profitStatus) && props.isFreeze == "false" && item.ancestorQuotaAmount) {
- title2 += "(" + t$6("wallet.exceed_limit") + ":" + points2point(item.ancestorQuotaAmount) + ")";
- }
- if ([22].includes(item.profitStatus) && props.isFreeze == "false" && item.accumulatedQuotaAmount) {
- title2 += "(" + t$6("wallet.exceed_limit") + ":" + points2point(item.accumulatedQuotaAmount) + ")";
- }
- return title2;
- };
- function onLoadMore(isFreeze) {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList(props.isFreeze);
- }
- onReachBottom(() => {
- onLoadMore();
- });
- onLoad(() => {
- getLogList(props.isFreeze);
- });
- const __returned__ = { userWallet, statusBarHeight, userInfo: userInfo2, sys_navBar, props, state, getLogList, title, onLoadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get points2point() {
- return points2point;
- }, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get PointApi() {
- return PointApi;
- }, get resetPagination() {
- return resetPagination;
- }, get ScoreApi() {
- return ScoreApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$Z(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 佣金确权 "),
- vue.createVNode(_component_s_layout, {
- class: "wallet-wrap",
- bgStyle: { "backgroundColor": "#ffffff" },
- title: "",
- navbar: "normal"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- vue.createElementVNode(
- "scroll-view",
- {
- class: "list-box",
- "scroll-y": "true",
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers(() => {
- }, ["stop"]))
- },
- [
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- style: { "padding": "20rpx" }
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "list-item ss-flex ss-col-center ss-row-between",
- key: item.id,
- style: { "padding": "20rpx 0", "border-bottom": "1px solid #c4c4c4" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-m-t-10",
- style: { "flex-direction": "column", "align-items": "flex-start", "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "name",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.title(item)) + " ",
- 1
- /* TEXT */
- ),
- $props.isFreeze == "true" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- style: { "float": "right" },
- class: vue.normalizeClass(["color-red", { "color-green": item.freezeAmount < 0 }])
- },
- vue.toDisplayString(item.freezeAmount > 0 ? "+" + $setup.points2point(item.freezeAmount) : $setup.points2point(item.freezeAmount)),
- 3
- /* TEXT, CLASS */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- style: { "float": "right" },
- class: vue.normalizeClass(["color-red", { "color-green": item.amount < 0 }])
- },
- vue.toDisplayString(item.amount > 0 ? "+" + $setup.points2point(item.amount) : $setup.points2point(item.amount)),
- 3
- /* TEXT, CLASS */
- ))
- ]),
- vue.createElementVNode("view", {
- class: "time",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.sheep.$helper.timeFormat(item.createTime, "yyyy-mm-dd hh:MM")) + " ",
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(" 冻结佣金 "),
- $props.isFreeze == "true" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- style: { "float": "right" }
- },
- vue.toDisplayString($setup.t("wallet.balance")) + ":" + vue.toDisplayString($setup.points2point(item.afterFreezeAmount)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- style: { "float": "right" }
- },
- vue.toDisplayString($setup.t("wallet.balance")) + ":" + vue.toDisplayString($setup.points2point(item.afterAmount)),
- 1
- /* TEXT */
- ))
- ])
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: "暂无数据",
- paddingTop: "200",
- icon: "/static/data-empty.png"
- })),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: $setup.t("common.click_to_load_more")
- },
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.onLoadMore(true)),
- onScrolltolower: _cache[1] || (_cache[1] = ($event) => $setup.onLoadMore(true))
- }, null, 8, ["status", "content-text"])) : vue.createCommentVNode("v-if", true)
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesUserWalletScoreLog = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$Z], ["__scopeId", "data-v-ccce11dc"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/ScoreLog.vue"]]);
- const _sfc_main$Z = {
- __name: "score",
- setup(__props, { expose: __expose }) {
- __expose();
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sys_navBar = sheep$1.$platform.navbar;
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageSize: 10,
- pageNo: 1
- },
- loadStatus: "",
- showModel: false
- });
- function close() {
- state.showModel = false;
- }
- const pointsPercentage = vue.computed(() => {
- const currentQuota = parseFloat(points2point(userWallet.value.integralDO.accumulatedQuota + userWallet.value.integralDO.ancestorQuota));
- const highQuotaTotal = parseFloat(points2point(userWallet.value.integralDO.highQuotaTotal));
- const percentage = currentQuota / highQuotaTotal * 100;
- return Math.min(percentage, 100);
- });
- const percentageColor = vue.computed(() => {
- if (pointsPercentage.value >= 90) {
- return "#fe0000";
- } else if (pointsPercentage.value >= 75) {
- return "#d8b800";
- } else {
- return "#0c912f";
- }
- });
- const circleStyle = vue.computed(() => {
- return {
- // background: `conic-gradient(${percentageColor.value} ${pointsPercentage.value}%, #ddd ${pointsPercentage.value}%)`
- background: percentageColor.value
- };
- });
- onLoad((options2) => {
- uni.$on("createWithDrawComplete", sheep$1.$store("user").getWallet);
- uni.$on("consumptionTransfersComplete", sheep$1.$store("user").getWallet);
- });
- const __returned__ = { userWallet, statusBarHeight, userInfo: userInfo2, sys_navBar, state, close, pointsPercentage, percentageColor, circleStyle, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get points2point() {
- return points2point;
- }, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get PointApi() {
- return PointApi;
- }, get resetPagination() {
- return resetPagination;
- }, get ScoreApi() {
- return ScoreApi;
- }, get ScoreLog() {
- return PagesUserWalletScoreLog;
- }, get richtext() {
- return PagesPublicRichtext;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$Y(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_list_item = resolveEasycom(vue.resolveDynamicComponent("uni-list-item"), __easycom_0$i);
- const _component_uni_list = resolveEasycom(vue.resolveDynamicComponent("uni-list"), __easycom_1$6);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "wallet-wrap",
- bgStyle: { "backgroundColor": "#ffffff" },
- title: $setup.t("wallet.wallet"),
- navbar: "normal"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "score-box bg-white ss-flex-col ss-row-center ss-col-center" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-m-y-30 w-100" }, [
- vue.createElementVNode("view", {
- class: "ss-flex",
- style: { "flex-direction": "column", "flex": "1", "border-right": "1px solid #f6f6f6" }
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "ss-m-b-10 circle value-box ss-flex ss-row-center",
- style: vue.normalizeStyle($setup.circleStyle)
- },
- [
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString($setup.t("wallet.commission")),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "ss-m-b-30 ss-font-40",
- style: vue.normalizeStyle({ color: $setup.percentageColor })
- },
- [
- vue.createElementVNode(
- "text",
- { class: "all-title ss-m-r-8" },
- vue.toDisplayString($setup.points2point($setup.userWallet.integralDO.currentQuota)),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "all-title ss-m-r-8" }, [
- vue.createElementVNode(
- "button",
- {
- class: "btn ss-reset-button",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/withdraw"))
- },
- vue.toDisplayString($setup.t("wallet.withdraw")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "all-title ss-m-r-8" }, [
- vue.createElementVNode(
- "button",
- {
- class: "btn ss-reset-button",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/scoreToConsumption"))
- },
- vue.toDisplayString($setup.t("wallet.transfer_points")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- vue.createElementVNode("view", {
- class: "ss-flex",
- style: { "flex-direction": "column", "flex": "1" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-m-b-10 circle value-box ss-flex ss-row-center",
- style: { "background": "#0c912f" }
- }, [
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString($setup.t("wallet.consumption_points")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "ss-m-b-30 ss-font-40",
- style: { "color": "#0c912f" }
- }, [
- vue.createElementVNode(
- "text",
- { class: "all-title ss-m-r-8" },
- vue.toDisplayString($setup.points2point($setup.userWallet.integralDO.consumptionPoints)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "all-title ss-m-x-8" }, [
- vue.createElementVNode(
- "button",
- {
- class: "btn ss-reset-button",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/topupConsumptionPoints"))
- },
- vue.toDisplayString($setup.t("wallet.recharge")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "all-title ss-m-x-8" }, [
- vue.createElementVNode(
- "button",
- {
- class: "btn ss-reset-button",
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/consumptionTransfers"))
- },
- vue.toDisplayString($setup.t("wallet.points_transfer")),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]),
- vue.createCommentVNode(" 分割线 "),
- vue.createElementVNode("view", { style: { "width": "100%", "height": "20rpx", "background-color": "#ececec" } }),
- vue.createVNode(_component_uni_list, {
- border: false,
- class: "ss-p-t-10 ss-w-100"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_list_item, {
- clickable: "",
- onClick: _cache[4] || (_cache[4] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/maxScoreLog")),
- title: "当前可获得峰值",
- showArrow: "",
- border: false
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString($setup.t("wallet.current_peak") + $setup.points2point($setup.userWallet.integralDO.accumulatedQuota + $setup.userWallet.integralDO.ancestorQuota)) + "/" + vue.toDisplayString($setup.points2point($setup.userWallet.integralDO.highQuotaTotal)),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(` <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/ScoreLog', {isFreeze: true})"
- title="待确权" showArrow :border="false">
- <template v-slot:body>
- <p style="width: 100%">待确权:{{points2point(userWallet.integralDO.freezeQuota)}}</p>
- </template>
- </uni-list-item> `),
- vue.createVNode(_component_uni_list_item, {
- clickable: "",
- onClick: _cache[5] || (_cache[5] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/ScoreLog", { isFreeze: false })),
- title: "佣金记录",
- showArrow: "",
- border: false
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString($setup.t("wallet.commission_record")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_list_item, {
- clickable: "",
- onClick: _cache[6] || (_cache[6] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/consumptionLog")),
- title: "消费分记录",
- showArrow: "",
- border: false
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString($setup.t("wallet.points_record")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(` <uni-list-item clickable @tap="sheep.$router.go('/pages/user/wallet/consumptionTransfersLog')"
- title="消费分转账" showArrow :border="false">
- <template v-slot:body>
- <p style="width: 100%">消费分转账</p>
- </template>
- </uni-list-item> `),
- vue.createVNode(_component_uni_list_item, {
- clickable: "",
- onClick: _cache[7] || (_cache[7] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/withdrawalLog")),
- title: "提现记录",
- showArrow: "",
- border: false
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString($setup.t("wallet.withdrawal")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_list_item, {
- clickable: "",
- onClick: _cache[8] || (_cache[8] = ($event) => $setup.state.showModel = true),
- title: "佣金计算规则",
- border: false
- }, {
- body: vue.withCtx(() => [
- vue.createElementVNode(
- "p",
- { style: { "width": "100%" } },
- vue.toDisplayString($setup.t("wallet.commission_rules")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- vue.createCommentVNode(" 佣金计算规则 "),
- vue.createVNode(_component_su_popup, {
- show: $setup.state.showModel,
- type: "center",
- round: "10",
- isMaskClick: false,
- showClose: "",
- onClose: $setup.close
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "head-nav" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([$setup.state.navIndex == 0 ? "activite" : "", "ss-m-l-20"]),
- onClick: _cache[9] || (_cache[9] = ($event) => _ctx.checkIndex(0))
- },
- vue.toDisplayString($setup.t("wallet.commission_rules")),
- 3
- /* TEXT, CLASS */
- )
- ]),
- vue.createElementVNode("scroll-view", {
- class: "scroll-view_H",
- "scroll-y": "true"
- }, [
- vue.createVNode($setup["richtext"], {
- title: "佣金计算规则",
- type: "tab"
- })
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserWalletScore = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$Y], ["__scopeId", "data-v-aa108703"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/score.vue"]]);
- const _sfc_main$Y = {
- __name: "consumptionLog",
- setup(__props, { expose: __expose }) {
- __expose();
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sys_navBar = sheep$1.$platform.navbar;
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageSize: 10,
- pageNo: 1
- },
- loadStatus: "",
- showModel: false,
- showQueModel: false
- });
- async function getLogList() {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await ConsumptionApi.getConsumptionLog({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- let list = _$1.concat(state.pagination.list, data.list);
- state.pagination.list = list;
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- const title = (item) => {
- let title2 = item.profitStatusName + "";
- if (item.username) {
- title2 += "(" + item.username + ")";
- }
- return title2;
- };
- function onLoadMore(isFreeze) {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList();
- }
- onReachBottom(() => {
- onLoadMore();
- });
- onLoad(() => {
- getLogList();
- });
- const __returned__ = { userWallet, statusBarHeight, userInfo: userInfo2, sys_navBar, state, getLogList, title, onLoadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get points2point() {
- return points2point;
- }, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get PointApi() {
- return PointApi;
- }, get resetPagination() {
- return resetPagination;
- }, get ConsumptionApi() {
- return ConsumptionApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$X(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 消费分来源 "),
- vue.createVNode(_component_s_layout, {
- class: "wallet-wrap",
- bgStyle: { "backgroundColor": "#ffffff" },
- title: "",
- navbar: "normal"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- vue.createElementVNode(
- "scroll-view",
- {
- class: "list-box",
- "scroll-y": "true",
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers(() => {
- }, ["stop"]))
- },
- [
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- style: { "padding": "20rpx" }
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "list-item ss-flex ss-col-center ss-row-between",
- key: item.id,
- style: { "padding": "20rpx 0", "border-bottom": "1px solid #c4c4c4" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-m-t-10",
- style: { "flex-direction": "column", "align-items": "flex-start", "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "name",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString(item.consumptionStatusName) + vue.toDisplayString([3, 4].includes(item.consumptionStatus) ? "(" + item.generateUserName + ")" : "") + " " + vue.toDisplayString(item.consumptionStatus === 1 ? "(" + $setup.t("wallet.balance") + ":" + $setup.points2point(item.practicalConsumptionPoints) + ")" : "") + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- style: { "float": "right" },
- class: vue.normalizeClass(["color-red", { "color-green": item.consumptionPoints < 0 }])
- },
- vue.toDisplayString(item.consumptionPoints > 0 ? "+" + $setup.points2point(item.consumptionPoints) : $setup.points2point(item.consumptionPoints)),
- 3
- /* TEXT, CLASS */
- )
- ]),
- vue.createElementVNode("view", {
- class: "time",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.sheep.$helper.timeFormat(item.createTime, "yyyy-mm-dd hh:MM")) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { style: { "float": "right" } },
- vue.toDisplayString($setup.t("wallet.balance")) + ":" + vue.toDisplayString($setup.points2point(item.afterConsumptionPoints)),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: "暂无数据",
- paddingTop: "200",
- icon: "/static/data-empty.png"
- })),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: $setup.t("common.click_to_load_more")
- },
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.onLoadMore(true)),
- onScrolltolower: _cache[1] || (_cache[1] = ($event) => $setup.onLoadMore(true))
- }, null, 8, ["status", "content-text"])) : vue.createCommentVNode("v-if", true)
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesUserWalletConsumptionLog = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$X], ["__scopeId", "data-v-663b1435"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/consumptionLog.vue"]]);
- var md5$1 = { exports: {} };
- (function(module) {
- (function($2) {
- function safeAdd(x, y2) {
- var lsw = (x & 65535) + (y2 & 65535);
- var msw = (x >> 16) + (y2 >> 16) + (lsw >> 16);
- return msw << 16 | lsw & 65535;
- }
- function bitRotateLeft(num, cnt) {
- return num << cnt | num >>> 32 - cnt;
- }
- function md5cmn(q2, a2, b2, x, s2, t2) {
- return safeAdd(bitRotateLeft(safeAdd(safeAdd(a2, q2), safeAdd(x, t2)), s2), b2);
- }
- function md5ff(a2, b2, c2, d2, x, s2, t2) {
- return md5cmn(b2 & c2 | ~b2 & d2, a2, b2, x, s2, t2);
- }
- function md5gg(a2, b2, c2, d2, x, s2, t2) {
- return md5cmn(b2 & d2 | c2 & ~d2, a2, b2, x, s2, t2);
- }
- function md5hh(a2, b2, c2, d2, x, s2, t2) {
- return md5cmn(b2 ^ c2 ^ d2, a2, b2, x, s2, t2);
- }
- function md5ii(a2, b2, c2, d2, x, s2, t2) {
- return md5cmn(c2 ^ (b2 | ~d2), a2, b2, x, s2, t2);
- }
- function binlMD5(x, len) {
- x[len >> 5] |= 128 << len % 32;
- x[(len + 64 >>> 9 << 4) + 14] = len;
- var i2;
- var olda;
- var oldb;
- var oldc;
- var oldd;
- var a2 = 1732584193;
- var b2 = -271733879;
- var c2 = -1732584194;
- var d2 = 271733878;
- for (i2 = 0; i2 < x.length; i2 += 16) {
- olda = a2;
- oldb = b2;
- oldc = c2;
- oldd = d2;
- a2 = md5ff(a2, b2, c2, d2, x[i2], 7, -680876936);
- d2 = md5ff(d2, a2, b2, c2, x[i2 + 1], 12, -389564586);
- c2 = md5ff(c2, d2, a2, b2, x[i2 + 2], 17, 606105819);
- b2 = md5ff(b2, c2, d2, a2, x[i2 + 3], 22, -1044525330);
- a2 = md5ff(a2, b2, c2, d2, x[i2 + 4], 7, -176418897);
- d2 = md5ff(d2, a2, b2, c2, x[i2 + 5], 12, 1200080426);
- c2 = md5ff(c2, d2, a2, b2, x[i2 + 6], 17, -1473231341);
- b2 = md5ff(b2, c2, d2, a2, x[i2 + 7], 22, -45705983);
- a2 = md5ff(a2, b2, c2, d2, x[i2 + 8], 7, 1770035416);
- d2 = md5ff(d2, a2, b2, c2, x[i2 + 9], 12, -1958414417);
- c2 = md5ff(c2, d2, a2, b2, x[i2 + 10], 17, -42063);
- b2 = md5ff(b2, c2, d2, a2, x[i2 + 11], 22, -1990404162);
- a2 = md5ff(a2, b2, c2, d2, x[i2 + 12], 7, 1804603682);
- d2 = md5ff(d2, a2, b2, c2, x[i2 + 13], 12, -40341101);
- c2 = md5ff(c2, d2, a2, b2, x[i2 + 14], 17, -1502002290);
- b2 = md5ff(b2, c2, d2, a2, x[i2 + 15], 22, 1236535329);
- a2 = md5gg(a2, b2, c2, d2, x[i2 + 1], 5, -165796510);
- d2 = md5gg(d2, a2, b2, c2, x[i2 + 6], 9, -1069501632);
- c2 = md5gg(c2, d2, a2, b2, x[i2 + 11], 14, 643717713);
- b2 = md5gg(b2, c2, d2, a2, x[i2], 20, -373897302);
- a2 = md5gg(a2, b2, c2, d2, x[i2 + 5], 5, -701558691);
- d2 = md5gg(d2, a2, b2, c2, x[i2 + 10], 9, 38016083);
- c2 = md5gg(c2, d2, a2, b2, x[i2 + 15], 14, -660478335);
- b2 = md5gg(b2, c2, d2, a2, x[i2 + 4], 20, -405537848);
- a2 = md5gg(a2, b2, c2, d2, x[i2 + 9], 5, 568446438);
- d2 = md5gg(d2, a2, b2, c2, x[i2 + 14], 9, -1019803690);
- c2 = md5gg(c2, d2, a2, b2, x[i2 + 3], 14, -187363961);
- b2 = md5gg(b2, c2, d2, a2, x[i2 + 8], 20, 1163531501);
- a2 = md5gg(a2, b2, c2, d2, x[i2 + 13], 5, -1444681467);
- d2 = md5gg(d2, a2, b2, c2, x[i2 + 2], 9, -51403784);
- c2 = md5gg(c2, d2, a2, b2, x[i2 + 7], 14, 1735328473);
- b2 = md5gg(b2, c2, d2, a2, x[i2 + 12], 20, -1926607734);
- a2 = md5hh(a2, b2, c2, d2, x[i2 + 5], 4, -378558);
- d2 = md5hh(d2, a2, b2, c2, x[i2 + 8], 11, -2022574463);
- c2 = md5hh(c2, d2, a2, b2, x[i2 + 11], 16, 1839030562);
- b2 = md5hh(b2, c2, d2, a2, x[i2 + 14], 23, -35309556);
- a2 = md5hh(a2, b2, c2, d2, x[i2 + 1], 4, -1530992060);
- d2 = md5hh(d2, a2, b2, c2, x[i2 + 4], 11, 1272893353);
- c2 = md5hh(c2, d2, a2, b2, x[i2 + 7], 16, -155497632);
- b2 = md5hh(b2, c2, d2, a2, x[i2 + 10], 23, -1094730640);
- a2 = md5hh(a2, b2, c2, d2, x[i2 + 13], 4, 681279174);
- d2 = md5hh(d2, a2, b2, c2, x[i2], 11, -358537222);
- c2 = md5hh(c2, d2, a2, b2, x[i2 + 3], 16, -722521979);
- b2 = md5hh(b2, c2, d2, a2, x[i2 + 6], 23, 76029189);
- a2 = md5hh(a2, b2, c2, d2, x[i2 + 9], 4, -640364487);
- d2 = md5hh(d2, a2, b2, c2, x[i2 + 12], 11, -421815835);
- c2 = md5hh(c2, d2, a2, b2, x[i2 + 15], 16, 530742520);
- b2 = md5hh(b2, c2, d2, a2, x[i2 + 2], 23, -995338651);
- a2 = md5ii(a2, b2, c2, d2, x[i2], 6, -198630844);
- d2 = md5ii(d2, a2, b2, c2, x[i2 + 7], 10, 1126891415);
- c2 = md5ii(c2, d2, a2, b2, x[i2 + 14], 15, -1416354905);
- b2 = md5ii(b2, c2, d2, a2, x[i2 + 5], 21, -57434055);
- a2 = md5ii(a2, b2, c2, d2, x[i2 + 12], 6, 1700485571);
- d2 = md5ii(d2, a2, b2, c2, x[i2 + 3], 10, -1894986606);
- c2 = md5ii(c2, d2, a2, b2, x[i2 + 10], 15, -1051523);
- b2 = md5ii(b2, c2, d2, a2, x[i2 + 1], 21, -2054922799);
- a2 = md5ii(a2, b2, c2, d2, x[i2 + 8], 6, 1873313359);
- d2 = md5ii(d2, a2, b2, c2, x[i2 + 15], 10, -30611744);
- c2 = md5ii(c2, d2, a2, b2, x[i2 + 6], 15, -1560198380);
- b2 = md5ii(b2, c2, d2, a2, x[i2 + 13], 21, 1309151649);
- a2 = md5ii(a2, b2, c2, d2, x[i2 + 4], 6, -145523070);
- d2 = md5ii(d2, a2, b2, c2, x[i2 + 11], 10, -1120210379);
- c2 = md5ii(c2, d2, a2, b2, x[i2 + 2], 15, 718787259);
- b2 = md5ii(b2, c2, d2, a2, x[i2 + 9], 21, -343485551);
- a2 = safeAdd(a2, olda);
- b2 = safeAdd(b2, oldb);
- c2 = safeAdd(c2, oldc);
- d2 = safeAdd(d2, oldd);
- }
- return [a2, b2, c2, d2];
- }
- function binl2rstr(input) {
- var i2;
- var output = "";
- var length32 = input.length * 32;
- for (i2 = 0; i2 < length32; i2 += 8) {
- output += String.fromCharCode(input[i2 >> 5] >>> i2 % 32 & 255);
- }
- return output;
- }
- function rstr2binl(input) {
- var i2;
- var output = [];
- output[(input.length >> 2) - 1] = void 0;
- for (i2 = 0; i2 < output.length; i2 += 1) {
- output[i2] = 0;
- }
- var length8 = input.length * 8;
- for (i2 = 0; i2 < length8; i2 += 8) {
- output[i2 >> 5] |= (input.charCodeAt(i2 / 8) & 255) << i2 % 32;
- }
- return output;
- }
- function rstrMD5(s2) {
- return binl2rstr(binlMD5(rstr2binl(s2), s2.length * 8));
- }
- function rstrHMACMD5(key, data) {
- var i2;
- var bkey = rstr2binl(key);
- var ipad = [];
- var opad = [];
- var hash;
- ipad[15] = opad[15] = void 0;
- if (bkey.length > 16) {
- bkey = binlMD5(bkey, key.length * 8);
- }
- for (i2 = 0; i2 < 16; i2 += 1) {
- ipad[i2] = bkey[i2] ^ 909522486;
- opad[i2] = bkey[i2] ^ 1549556828;
- }
- hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
- return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));
- }
- function rstr2hex(input) {
- var hexTab = "0123456789abcdef";
- var output = "";
- var x;
- var i2;
- for (i2 = 0; i2 < input.length; i2 += 1) {
- x = input.charCodeAt(i2);
- output += hexTab.charAt(x >>> 4 & 15) + hexTab.charAt(x & 15);
- }
- return output;
- }
- function str2rstrUTF8(input) {
- return unescape(encodeURIComponent(input));
- }
- function rawMD5(s2) {
- return rstrMD5(str2rstrUTF8(s2));
- }
- function hexMD5(s2) {
- return rstr2hex(rawMD5(s2));
- }
- function rawHMACMD5(k, d2) {
- return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d2));
- }
- function hexHMACMD5(k, d2) {
- return rstr2hex(rawHMACMD5(k, d2));
- }
- function md52(string, key, raw) {
- if (!key) {
- if (!raw) {
- return hexMD5(string);
- }
- return rawMD5(string);
- }
- if (!raw) {
- return hexHMACMD5(key, string);
- }
- return rawHMACMD5(key, string);
- }
- if (module.exports) {
- module.exports = md52;
- } else {
- $2.md5 = md52;
- }
- })(commonjsGlobal);
- })(md5$1);
- var md5Exports = md5$1.exports;
- const md5 = /* @__PURE__ */ getDefaultExportFromCjs(md5Exports);
- const _sfc_main$X = {
- __name: "topupConsumptionPoints",
- setup(__props, { expose: __expose }) {
- __expose();
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const state = vue.reactive({
- model: {},
- payPrice: void 0,
- percentage: {
- consumptionMagnification: 0,
- userTopUpConsumptionPoints: 0,
- triggerMagnificationPoints: 0
- }
- });
- const consumption = vue.computed(() => {
- if (!state.payPrice) {
- return 0;
- }
- let result2;
- if (state.payPrice >= parseFloat(state.percentage.triggerMagnificationPoints)) {
- result2 = (parseFloat(state.percentage.consumptionMagnification) * state.payPrice).toFixed(2);
- } else {
- result2 = state.payPrice;
- }
- return result2;
- });
- async function validateInput(value) {
- const strPoints = value.toString();
- const [integerPart, decimalPart] = strPoints.split(".");
- if (decimalPart) {
- vue.nextTick(() => {
- });
- }
- }
- const submit = async () => {
- if (!state.payPrice) {
- sheep$1.$helper.toast(t$6("wallet.enter_recharge_amount"));
- return;
- }
- if (parseFloat(state.payPrice) < state.percentage.userTopUpConsumptionPoints) {
- sheep$1.$helper.toast(t$6("wallet.recharge_amount_less_than", { point: state.percentage.userTopUpConsumptionPoints }));
- return;
- }
- let {
- code: code2,
- data
- } = await PayWalletApi.topupConsumptionPointsCreate({
- payPrice: state.payPrice,
- topUpConsumptionPoints: state.payPrice,
- userName: userInfo2.value.username
- });
- if (code2 === 0) {
- sheep$1.$router.redirect("/pages/pay/index", {
- id: data.payOrderId,
- type: 2
- });
- }
- };
- const getpercentage = async () => {
- const {
- code: code2,
- data
- } = await WithdrawalApi.getWithdrawalPercentage();
- if (code2 === 0) {
- state.percentage = data;
- }
- };
- onLoad(async (options2) => {
- await getpercentage();
- });
- const __returned__ = { userWallet, userInfo: userInfo2, state, consumption, validateInput, submit, getpercentage, computed: vue.computed, reactive: vue.reactive, watchEffect: vue.watchEffect, nextTick: vue.nextTick, onUnmounted: vue.onUnmounted, get onLoad() {
- return onLoad;
- }, get sheep() {
- return sheep$1;
- }, get clone() {
- return lodashExports.clone;
- }, get fen2yuan() {
- return fen2yuan;
- }, get points2point() {
- return points2point;
- }, get md5() {
- return md5;
- }, get PayWalletApi() {
- return PayWalletApi;
- }, get WithdrawalApi() {
- return WithdrawalApi;
- }, get showAuthModal() {
- return showAuthModal;
- }, get showShareModal() {
- return showShareModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("wallet.points_recharge")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white ss-modal-box ss-flex-col" }, [
- vue.createCommentVNode(" 提现金额 "),
- vue.createElementVNode("view", { class: "modal-content ss-m-t-30" }, [
- vue.createVNode(_component_uni_forms, {
- model: $setup.state.model,
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelPosition: "left",
- border: "",
- class: "form-box",
- labelWidth: "200",
- ref: "FormRef"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "quota",
- label: $setup.t("wallet.recharge_amount"),
- required: true
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.payPrice,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.payPrice = $event),
- type: "number",
- placeholder: $setup.t("wallet.enter_recharge_amount"),
- inputBorder: false,
- clearable: false,
- onInput: $setup.validateInput,
- maxlength: 9
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "quota",
- label: $setup.t("wallet.actual_points_received")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "ss-flex ss-h-100" },
- vue.toDisplayString($setup.consumption),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"]),
- vue.createElementVNode(
- "view",
- { class: "ss-flex ss-row-center ss-col-center ss-m-t-30 text-red text-center" },
- vue.toDisplayString($setup.t("wallet.note_recharge_bonus", { amount: $setup.state.percentage.triggerMagnificationPoints, multiplier: parseFloat($setup.state.percentage.consumptionMagnification) })),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40 ss-flex-5" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button save-btn",
- onClick: $setup.submit
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserWalletTopupConsumptionPoints = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["render", _sfc_render$W], ["__scopeId", "data-v-b526252b"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/topupConsumptionPoints.vue"]]);
- const _sfc_main$W = {
- __name: "consumptionTransfersLog",
- setup(__props, { expose: __expose }) {
- __expose();
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sys_navBar = sheep$1.$platform.navbar;
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageSize: 10,
- pageNo: 1
- },
- loadStatus: "",
- showModel: false,
- showQueModel: false
- });
- async function getLogList() {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await ConsumptionApi.getConsumptionTransfersLog({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- let list = _$1.concat(state.pagination.list, data.list);
- state.pagination.list = list;
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- const currentUserId = userWallet.value.integralDO.userId;
- const formatChangeValue = (item) => {
- if (currentUserId === item.recipientUserId) {
- return points2point(item.recipientPoints);
- } else {
- return points2point(item.consumptionPoints);
- }
- };
- const formatValue = (item) => {
- if (currentUserId === item.recipientUserId) {
- return points2point(item.afterRecipientConsumptionPoints);
- } else {
- return points2point(item.afterTransferConsumptionPoints);
- }
- };
- function onLoadMore(isFreeze) {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList();
- }
- onReachBottom(() => {
- onLoadMore();
- });
- onLoad(() => {
- getLogList();
- });
- const __returned__ = { userWallet, statusBarHeight, userInfo: userInfo2, sys_navBar, state, getLogList, currentUserId, formatChangeValue, formatValue, onLoadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get points2point() {
- return points2point;
- }, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get PointApi() {
- return PointApi;
- }, get resetPagination() {
- return resetPagination;
- }, get ConsumptionApi() {
- return ConsumptionApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$V(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 消费分转账 "),
- vue.createVNode(_component_s_layout, {
- class: "wallet-wrap",
- bgStyle: { "backgroundColor": "#ffffff" },
- title: "",
- navbar: "normal"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- vue.createElementVNode(
- "scroll-view",
- {
- class: "list-box",
- "scroll-y": "true",
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers(() => {
- }, ["stop"]))
- },
- [
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- style: { "padding": "20rpx" }
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "list-item ss-flex ss-col-center ss-row-between",
- key: item.id,
- style: { "padding": "20rpx 0", "border-bottom": "1px solid #c4c4c4" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-m-t-10",
- style: { "flex-direction": "column", "align-items": "flex-start", "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "name",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString(item.transferUserName + " > " + item.recipientUserName) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- style: { "float": "right" },
- class: vue.normalizeClass(["color-red", { "color-green": $setup.formatChangeValue(item) < 0 }])
- },
- vue.toDisplayString($setup.formatChangeValue(item)),
- 3
- /* TEXT, CLASS */
- )
- ]),
- vue.createElementVNode("view", {
- class: "time",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.sheep.$helper.timeFormat(item.createTime, "yyyy-mm-dd hh:MM")) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { style: { "float": "right" } },
- "余额:" + vue.toDisplayString($setup.formatValue(item)),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: "暂无数据",
- paddingTop: "200",
- icon: "/static/data-empty.png"
- })),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "点击加载更多"
- },
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.onLoadMore(true)),
- onScrolltolower: _cache[1] || (_cache[1] = ($event) => $setup.onLoadMore(true))
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesUserWalletConsumptionTransfersLog = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$V], ["__scopeId", "data-v-3ab7db52"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/consumptionTransfersLog.vue"]]);
- const _sfc_main$V = {
- __name: "consumptionTransfers",
- setup(__props, { expose: __expose }) {
- __expose();
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const state = vue.reactive({
- verifyUsername: true,
- verifyMobile: true,
- usernameErrorMsg: "",
- mobileErrorMsg: "",
- model: {
- recipientUserName: void 0,
- recipientUserId: void 0,
- recipientUserPhone: void 0,
- consumptionPoints: void 0,
- smsCodeUseReqDTO: {
- mobile: void 0,
- scene: 11,
- code: void 0
- }
- },
- rules: {
- recipientUserName: {
- rules: [{
- required: true,
- errorMessage: t$6("wallet.recipient_cannot_be_empty")
- }]
- },
- recipientUserPhone: {
- rules: [{
- required: true,
- errorMessage: t$6("wallet.recipient_phone_cannot_be_empty")
- }]
- },
- "smsCodeUseReqDTO.code": {
- rules: [{
- required: true,
- errorMessage: t$6("wallet.verification_code_cannot_be_empty")
- }]
- },
- consumptionPoints: {
- rules: [
- {
- required: true,
- errorMessage: t$6("wallet.transfer_amount_cannot_be_empty")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- if (value <= 0) {
- callback(t$6("wallet.transfer_amount_less_than_zero"));
- }
- return true;
- }
- }
- ]
- }
- }
- });
- const canUseConsumptionPoints = vue.computed(() => points2point(userWallet.value.integralDO.consumptionPoints));
- let lastUsername = vue.ref("");
- async function verifyUsername(e2) {
- const username2 = e2.detail.value;
- if (username2 == lastUsername.value)
- return;
- if (username2 == "") {
- state.verifyUsername = true;
- return false;
- } else if (username2 === userInfo2.value.username) {
- state.usernameErrorMsg = t$6("wallet.recipient_cannot_be_self");
- return false;
- }
- lastUsername.value = username2;
- const {
- data
- } = await AuthUtil.verifyUsername(username2);
- if (data) {
- state.usernameErrorMsg = t$6("wallet.user_does_not_exist");
- } else {
- state.usernameErrorMsg = "";
- }
- state.verifyUsername = data;
- }
- async function verifyPhone(e2) {
- const phone = e2.detail.value;
- if (phone == "" || !state.model.recipientUserName) {
- state.verifyMobile = true;
- return false;
- }
- const {
- data
- } = await AuthUtil.verifyPhone(state.model.recipientUserName, phone);
- if (!data || data.mobile !== phone) {
- state.mobileErrorMsg = t$6("wallet.username_phone_mismatch");
- state.verifyMobile = true;
- } else {
- state.mobileErrorMsg = "";
- state.model.recipientUserId = data.id;
- state.verifyMobile = false;
- }
- }
- async function validateInput(value) {
- const intValue = parseInt(value);
- const strPoints = value.toString();
- const [integerPart, decimalPart] = strPoints.split(".");
- if (decimalPart) {
- parseFloat(`${integerPart}.${decimalPart.slice(0, 2)}`);
- vue.nextTick(() => {
- state.model.consumptionPoints = integerPart;
- });
- }
- if (intValue > parseInt(canUseConsumptionPoints.value)) {
- vue.nextTick(() => {
- state.model.consumptionPoints = parseInt(canUseConsumptionPoints.value);
- });
- } else {
- vue.nextTick(() => {
- state.model.consumptionPoints = intValue;
- });
- }
- }
- const FormRef = vue.ref(null);
- const onSubmit = async () => {
- if (state.model.recipientUserName === userInfo2.value.username) {
- uni.showToast({
- title: t$6("wallet.cannot_transfer_to_self"),
- icon: "none",
- duration: 2e3
- });
- return;
- } else if (state.verifyUsername) {
- return;
- } else if (state.verifyMobile) {
- return;
- }
- const validate = await vue.unref(FormRef).validate().catch((error2) => {
- formatAppLog("log", "at pages/user/wallet/consumptionTransfers.vue:259", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const {
- data,
- code: code2
- } = await ConsumptionApi.createConsumptionLog(state.model);
- if (code2 === 0) {
- showWalletModal({ msg: t$6("wallet.transfer_successful") });
- uni.$emit("consumptionTransfersComplete");
- sheep$1.$router.redirect("/pages/user/wallet/score");
- }
- };
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- vue.watch(
- () => isLogin.value,
- (newVal) => {
- if (newVal) {
- window.location.reload();
- }
- },
- {
- deep: true
- // 深度监听
- }
- );
- onLoad(async (options2) => {
- if (!isLogin.value) {
- showAuthModal();
- }
- state.model.smsCodeUseReqDTO.mobile = userInfo2.value.mobile;
- });
- const __returned__ = { userInfo: userInfo2, userWallet, state, canUseConsumptionPoints, get lastUsername() {
- return lastUsername;
- }, set lastUsername(v2) {
- lastUsername = v2;
- }, verifyUsername, verifyPhone, validateInput, FormRef, onSubmit, isLogin, computed: vue.computed, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, ref: vue.ref, unref: vue.unref, watch: vue.watch, nextTick: vue.nextTick, get sheep() {
- return sheep$1;
- }, get clone() {
- return lodashExports.clone;
- }, get onLoad() {
- return onLoad;
- }, get points2point() {
- return points2point;
- }, get email() {
- return email;
- }, get AuthUtil() {
- return AuthUtil;
- }, get ConsumptionApi() {
- return ConsumptionApi;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get showWalletModal() {
- return showWalletModal;
- }, get colseWalletModal() {
- return colseWalletModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$U(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "set-wrap",
- title: $setup.t("wallet.points_transfer"),
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms, {
- model: $setup.state.model,
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelPosition: "left",
- border: "",
- class: "form-box",
- labelWidth: "200",
- ref: "FormRef"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "recipientUserName",
- label: $setup.t("wallet.recipient"),
- required: true,
- "error-message": $setup.state.usernameErrorMsg
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.recipientUserName,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.recipientUserName = $event),
- type: "recipientUserName",
- placeholder: $setup.t("wallet.enter_recipient_username"),
- inputBorder: false,
- clearable: false,
- onBlur: $setup.verifyUsername
- }, {
- right: vue.withCtx(() => [
- $setup.state.verifyUsername ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- style: "",
- src: $setup.sheep.$url.static("/static/images/shibai.png")
- }, null, 8, ["src"])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/chenggong.png")
- }, null, 8, ["src"])
- ]))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "error-message"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "recipientUserPhone",
- label: $setup.t("wallet.recipient_phone"),
- required: true,
- "error-message": $setup.state.mobileErrorMsg
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.recipientUserPhone,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.recipientUserPhone = $event),
- type: "number",
- placeholder: $setup.t("wallet.enter_recipient_phone"),
- inputBorder: false,
- clearable: false,
- onBlur: $setup.verifyPhone
- }, {
- right: vue.withCtx(() => [
- $setup.state.verifyMobile ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- style: "",
- src: $setup.sheep.$url.static("/static/images/shibai.png")
- }, null, 8, ["src"])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "icon"
- }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/chenggong.png")
- }, null, 8, ["src"])
- ]))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "error-message"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("account.phone_number"),
- class: "mobile loginUniFormItem ss-p-t-10"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.smsCodeUseReqDTO.mobile,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model.smsCodeUseReqDTO.mobile = $event),
- type: "smsCodeUseReqDTO",
- placeholder: $setup.t("account.enter_phone_number"),
- inputBorder: false,
- clearable: false,
- disabled: true
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button code-btn code-btn-start", { "disabled": $setup.verifyUsername == true || $setup.state.verifyMobile == true }]),
- disabled: $setup.verifyUsername == true || $setup.state.verifyMobile == true,
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.getSmsCode("consumptionTransfers", $setup.state.model.smsCodeUseReqDTO.mobile))
- }, vue.toDisplayString($setup.getSmsTimer("consumptionTransfers")), 11, ["disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "smsCodeUseReqDTO.code",
- label: $setup.t("account.verification_code"),
- required: true
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.smsCodeUseReqDTO.code,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.state.model.smsCodeUseReqDTO.code = $event),
- type: "number",
- placeholder: $setup.t("account.enter_verification_code"),
- inputBorder: false,
- clearable: false
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "consumptionPoints",
- label: $setup.t("wallet.transfer_amount"),
- required: true
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.consumptionPoints,
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $setup.state.model.consumptionPoints = $event),
- type: "number",
- placeholder: $setup.t("wallet.enter_transfer_amount"),
- inputBorder: false,
- clearable: false,
- onInput: $setup.validateInput
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-center ss-col-center ss-m-t-30" }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.t("wallet.current_transferable_amount")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text-red" },
- vue.toDisplayString($setup.canUseConsumptionPoints),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(` <button class="ss-m-l-10 all-btn " @click="useAllPonints">{{t('common.all')}}</button> `)
- ]),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: "",
- bg: "none"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-p-20 ss-flex" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-rest-button btn",
- onClick: $setup.onSubmit
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserWalletConsumptionTransfers = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$U], ["__scopeId", "data-v-889a76b8"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/consumptionTransfers.vue"]]);
- const _sfc_main$U = {
- __name: "scoreToConsumption",
- setup(__props, { expose: __expose }) {
- __expose();
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const state = vue.reactive({
- model: {
- quota: void 0
- },
- rules: {
- quota: {
- rules: [
- {
- required: true,
- errorMessage: t$6("wallet.transfer_amount_cannot_be_empty")
- },
- {
- validateFunction: function(rule, value, data, callback) {
- if (value <= 0) {
- callback(t$6("wallet.transfer_amount_cannot_be_zero"));
- }
- return true;
- }
- }
- ]
- }
- }
- });
- const currentQuota = vue.computed(() => points2point(userWallet.value.integralDO.currentQuota));
- async function validateInput(value) {
- const intValue = parseInt(value);
- const strPoints = value.toString();
- const [integerPart, decimalPart] = strPoints.split(".");
- if (decimalPart) {
- vue.nextTick(() => {
- state.model.quota = integerPart;
- });
- }
- if (intValue > parseInt(currentQuota.value)) {
- vue.nextTick(() => {
- state.model.quota = parseInt(currentQuota.value);
- });
- } else {
- vue.nextTick(() => {
- state.model.quota = intValue;
- });
- }
- }
- const FormRef = vue.ref(null);
- const onSubmit = async () => {
- const validate = await vue.unref(FormRef).validate().catch((error2) => {
- formatAppLog("log", "at pages/user/wallet/scoreToConsumption.vue:116", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("wallet.commission_to_points_irreversible"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- data,
- code: code2
- } = await ConsumptionApi.quotaTransition(state.model.quota);
- if (code2 === 0) {
- uni.showToast({
- title: t$6("wallet.conversion_successful"),
- icon: "none",
- duration: 2e3
- });
- uni.$emit("consumptionTransfersComplete");
- sheep$1.$router.redirect("/pages/user/wallet/score");
- }
- }
- });
- };
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- vue.watch(
- () => isLogin.value,
- (newVal) => {
- if (newVal) {
- window.location.reload();
- }
- },
- {
- deep: true
- // 深度监听
- }
- );
- onLoad(async (options2) => {
- if (!isLogin.value) {
- showAuthModal();
- }
- });
- const __returned__ = { userInfo: userInfo2, userWallet, state, currentQuota, validateInput, FormRef, onSubmit, isLogin, computed: vue.computed, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, ref: vue.ref, unref: vue.unref, watch: vue.watch, nextTick: vue.nextTick, get sheep() {
- return sheep$1;
- }, get clone() {
- return lodashExports.clone;
- }, get onLoad() {
- return onLoad;
- }, get points2point() {
- return points2point;
- }, get email() {
- return email;
- }, get AuthUtil() {
- return AuthUtil;
- }, get ConsumptionApi() {
- return ConsumptionApi;
- }, get showAuthModal() {
- return showAuthModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$T(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "set-wrap",
- title: $setup.t("wallet.commission_to_points"),
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_forms, {
- model: $setup.state.model,
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelPosition: "left",
- border: "",
- class: "form-box",
- labelWidth: "200",
- ref: "FormRef"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "quota",
- label: $setup.t("wallet.consumption_points"),
- required: true
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.quota,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.quota = $event),
- type: "number",
- placeholder: $setup.t("wallet.enter_transfer_amount"),
- inputBorder: false,
- clearable: false,
- onInput: $setup.validateInput
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-center ss-col-center ss-m-t-30" }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.t("wallet.current_commission_available")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text-red" },
- vue.toDisplayString($setup.currentQuota),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(' <button class="ss-m-l-10 all-btn " @click="useAllPonints">全部</button> ')
- ]),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: "",
- bg: "none"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-p-20 ss-flex" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-rest-button btn",
- onClick: $setup.onSubmit
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserWalletScoreToConsumption = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["render", _sfc_render$T], ["__scopeId", "data-v-27522d6e"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/scoreToConsumption.vue"]]);
- const _sfc_main$T = {
- __name: "withdraw",
- setup(__props, { expose: __expose }) {
- __expose();
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const canUseMoney = vue.computed(() => points2point(userWallet.value.integralDO.currentQuota));
- const alipayAccount2 = (account2) => {
- if (!account2) {
- return false;
- }
- if (/^\d{11}$/.test(account2)) {
- return `${account2.substring(0, 3)}****${account2.substring(7)}`;
- } else if (/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(account2)) {
- const atIndex = account2.indexOf("@");
- if (atIndex <= 3) {
- return account2;
- }
- const username2 = account2.substring(0, Math.ceil(atIndex / 2));
- const domain = account2.substring(atIndex);
- return `${username2}***${domain}`;
- }
- };
- const bankAccount2 = (account2) => {
- if (!account2) {
- return false;
- }
- if (account2.length === 8) {
- return account2.substring(0, 2) + "********" + account2.substr(-2);
- } else {
- return account2.substring(0, 4) + "******" + account2.substr(-4);
- }
- };
- const state = vue.reactive({
- model: {},
- orderType: "goods",
- // 订单类型; goods - 商品订单, recharge - 充值订单
- outMent: "",
- outMoney: void 0,
- disabled: true,
- withdrawalPercentage: {
- withdrawCommission: 0,
- withdrawConsumption: 0
- },
- outMethods: [
- // {
- // title: t('wallet.withdraw_to_wechat'),
- // value: '1'
- // },
- {
- title: t$6("wallet.withdraw_to_alipay"),
- value: "2",
- account: ""
- },
- {
- title: t$6("wallet.withdraw_to_bank_card"),
- value: "3",
- account: ""
- }
- ]
- });
- const withdrawCommission = vue.computed(() => {
- return state.withdrawalPercentage.withdrawCommission * 100 + "%";
- });
- const withdrawConsumption = vue.computed(() => {
- return state.withdrawalPercentage.withdrawConsumption * 100 + "%";
- });
- const commission = vue.computed(() => {
- if (!state.outMoney) {
- return 0;
- }
- let result2 = parseFloat(state.withdrawalPercentage.withdrawCommission) * state.outMoney;
- result2 = Math.floor(result2 * 100) / 100;
- return result2;
- });
- const consumption = vue.computed(() => {
- if (!state.outMoney) {
- return 0;
- }
- let result2 = parseFloat(state.withdrawalPercentage.withdrawConsumption) * state.outMoney;
- result2 = Math.floor(result2 * 100) / 100;
- return result2;
- });
- const handleBind = async (type) => {
- if (type === "2") {
- showAuthModal("alipayAccount");
- } else if (type === "3") {
- showAuthModal("bankAccount");
- }
- };
- const submit = async () => {
- if (state.outMent === "") {
- sheep$1.$helper.toast(t$6("wallet.please_select_withdrawal_method"));
- return;
- }
- if (!state.outMoney) {
- sheep$1.$helper.toast(t$6("wallet.enter_withdrawal_amount"));
- return;
- }
- if (state.outMent === "2" && !userInfo2.value.alipayAccount) {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("wallet.alipay_not_bound"),
- confirmText: t$6("wallet.go_bind"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- showAuthModal("alipayAccount");
- }
- });
- return;
- }
- if (state.outMent === "3" && !userInfo2.value.bankAccount) {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("wallet.bank_card_not_bound"),
- confirmText: t$6("wallet.go_bind"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- showAuthModal("bankAccount");
- }
- });
- return;
- }
- let {
- code: code2,
- data
- } = await PayWalletApi.createWithdrawal({
- amountTotal: state.outMoney,
- withdrawalType: state.outMent
- });
- if (code2 === 0) {
- uni.showToast({
- icon: "success",
- title: t$6("wallet.application_successful")
- });
- sheep$1.$router.redirect("/pages/user/wallet/withdrawalLog");
- uni.$emit("createWithDrawComplete");
- }
- };
- function onTapOut(e2) {
- state.outMent = e2.detail.value;
- }
- async function useAllPonints() {
- const { code: code2, data } = await PayWalletApi.getDuserInfo();
- const userCanUsePoints = parseFloat(points2point(data.integralDO.currentQuota));
- state.outMoney = parseInt(userCanUsePoints);
- state.disable = false;
- }
- vue.watchEffect(() => {
- if (parseFloat(state.outMoney) > parseFloat(canUseMoney.value)) {
- vue.nextTick(() => {
- state.outMoney = parseInt(canUseMoney.value);
- });
- }
- if (canUseMoney.value == 0 || canUseMoney.value < 0) {
- state.disabled = true;
- }
- if (canUseMoney.value > 0) {
- state.disabled = false;
- }
- });
- const getUserInfo = async () => {
- const userInfo3 = await sheep$1.$store("user").getInfo();
- state.model = lodashExports.clone(userInfo3);
- state.outMethods.forEach((item) => {
- if (item.value === "2") {
- item.account = alipayAccount2(state.model.alipayAccount);
- } else if (item.value === "3") {
- item.account = bankAccount2(state.model.bankAccount);
- }
- });
- };
- const getWithdrawalPercentage = async () => {
- const { code: code2, data } = await WithdrawalApi.getWithdrawalPercentage();
- if (code2 === 0) {
- state.withdrawalPercentage = data;
- }
- };
- onLoad(async (options2) => {
- await getUserInfo();
- await getWithdrawalPercentage();
- uni.$on("alipayAccountChangeComplete", getUserInfo);
- uni.$on("bankAccountChangeComplete", getUserInfo);
- });
- const __returned__ = { userWallet, userInfo: userInfo2, canUseMoney, alipayAccount: alipayAccount2, bankAccount: bankAccount2, state, withdrawCommission, withdrawConsumption, commission, consumption, handleBind, submit, onTapOut, useAllPonints, getUserInfo, getWithdrawalPercentage, computed: vue.computed, reactive: vue.reactive, watchEffect: vue.watchEffect, nextTick: vue.nextTick, onUnmounted: vue.onUnmounted, get onLoad() {
- return onLoad;
- }, get sheep() {
- return sheep$1;
- }, get clone() {
- return lodashExports.clone;
- }, get fen2yuan() {
- return fen2yuan;
- }, get points2point() {
- return points2point;
- }, get md5() {
- return md5;
- }, get PayWalletApi() {
- return PayWalletApi;
- }, get WithdrawalApi() {
- return WithdrawalApi;
- }, get showAuthModal() {
- return showAuthModal;
- }, get showShareModal() {
- return showShareModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$S(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("wallet.withdraw")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white ss-modal-box ss-flex-col" }, [
- vue.createCommentVNode(" 提现方式 "),
- vue.createElementVNode("view", { class: "modal-content" }, [
- vue.createElementVNode(
- "view",
- { class: "out-title ss-p-l-30 ss-m-y-30" },
- vue.toDisplayString($setup.t("wallet.select_withdrawal_method")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "radio-group",
- { onChange: $setup.onTapOut },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.outMethods, (item) => {
- return vue.openBlock(), vue.createElementBlock("label", {
- class: "out-type-item",
- key: item.title
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["out-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom", { "disabled-out-item": item.disabled }])
- },
- [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "check-box ss-flex ss-col-center ss-p-l-10" }, [
- vue.createElementVNode("radio", {
- value: item.value,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- disabled: item.disabled,
- checked: $setup.state.payment === item.value
- }, null, 8, ["value", "disabled", "checked"])
- ]),
- vue.createElementVNode(
- "text",
- { class: "out-title" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- )
- ]),
- item.account ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- style: { "float": "right" }
- },
- vue.toDisplayString(item.account),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- style: { "float": "right" },
- onClick: ($event) => $setup.handleBind(item.value)
- }, vue.toDisplayString($setup.t("wallet.not_bound_click_to_bind")) + " >", 9, ["onClick"]))
- ],
- 2
- /* CLASS */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ]),
- vue.createCommentVNode(" 提现金额 "),
- vue.createElementVNode("view", { class: "modal-content ss-m-t-30" }, [
- vue.createVNode(_component_uni_forms, {
- model: $setup.state.model,
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelPosition: "left",
- border: "",
- class: "form-box",
- labelWidth: "200",
- ref: "FormRef"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "quota",
- label: $setup.t("wallet.withdrawal_amount"),
- required: true
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.outMoney,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.outMoney = $event),
- type: "number",
- placeholder: $setup.t("wallet.enter_withdrawal_amount"),
- inputBorder: false,
- clearable: false
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "quota",
- label: $setup.t("wallet.actual_amount_received")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "ss-flex ss-h-100" },
- vue.toDisplayString($setup.commission),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "quota",
- label: $setup.t("wallet.consumption_points")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "ss-flex ss-h-100" },
- vue.toDisplayString($setup.consumption),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"]),
- vue.createCommentVNode(' <view class="out-title ss-p-l-30 ss-m-y-30">提现金额</view>\n <view class="ss-flex ss-row-left ss-col-center input-money ss-m-y-30" >\n ¥\n <input v-model.number="state.outMoney" class="uni-input " type="number"\n placeholder="请输入金额" />\n </view> '),
- vue.createElementVNode("view", { class: "ss-flex ss-row-center ss-col-center ss-m-t-30" }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.t("wallet.current_exchangeable_amount")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text-red" },
- vue.toDisplayString($setup.canUseMoney),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "button",
- {
- class: "ss-m-l-10 all-btn",
- onClick: $setup.useAllPonints
- },
- vue.toDisplayString($setup.t("common.all")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "ss-flex ss-row-center ss-col-center ss-m-t-30 text-red text-center" },
- vue.toDisplayString($setup.t("wallet.note", { commission: $setup.withdrawCommission, consumption: $setup.withdrawConsumption })),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 工具 "),
- vue.createElementVNode("view", { class: "modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40 ss-flex-5" }, [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button save-btn", { "disabled-btn": $setup.state.disabled }]),
- onClick: $setup.submit,
- disabled: $setup.state.disabled
- }, vue.toDisplayString($setup.t("common.confirm")), 11, ["disabled"])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesUserWalletWithdraw = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$S], ["__scopeId", "data-v-2fe623b9"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/withdraw.vue"]]);
- const _sfc_main$S = {
- __name: "withdrawalLog",
- setup(__props, { expose: __expose }) {
- __expose();
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sys_navBar = sheep$1.$platform.navbar;
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageSize: 10,
- pageNo: 1
- },
- loadStatus: ""
- });
- async function getLogList() {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await WithdrawalApi.getWithdrawalPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- let list = _$1.concat(state.pagination.list, data.list);
- state.pagination.list = list;
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- onLoad(() => {
- getLogList();
- });
- function onLoadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList();
- }
- onReachBottom(() => {
- onLoadMore();
- });
- const __returned__ = { userWallet, statusBarHeight, userInfo: userInfo2, sys_navBar, state, getLogList, onLoadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get points2point() {
- return points2point;
- }, get fen2yuan() {
- return fen2yuan;
- }, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get PointApi() {
- return PointApi;
- }, get resetPagination() {
- return resetPagination;
- }, get WithdrawalApi() {
- return WithdrawalApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 提现记录 "),
- vue.createVNode(_component_s_layout, {
- class: "wallet-wrap",
- bgStyle: { "backgroundColor": "#ffffff" },
- title: $setup.t("wallet.withdrawal_records"),
- navbar: "normal"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- vue.createElementVNode(
- "scroll-view",
- {
- class: "list-box",
- "scroll-y": "true",
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers(() => {
- }, ["stop"]))
- },
- [
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- style: { "padding": "20rpx" }
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "list-item ss-flex ss-col-center ss-row-between",
- key: item.id,
- style: { "padding": "20rpx 0", "border-bottom": "1px solid #c4c4c4" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-m-t-10",
- style: { "flex-direction": "column", "align-items": "flex-start", "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "name",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString(item.withdrawalType === 1 ? $setup.t("wallet.wechat") : item.withdrawalType === 2 ? $setup.t("wallet.alipay") : $setup.t("wallet.bank_card")) + " (" + vue.toDisplayString(item.withdrawalAccount) + ") ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- style: { "float": "right" },
- class: "color-red"
- },
- " ¥" + vue.toDisplayString($setup.fen2yuan(item.amount)) + " (" + vue.toDisplayString($setup.t("wallet.consumption_points") + $setup.points2point(item.withdrawConsumption)) + ") ",
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "time",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.sheep.$helper.timeFormat(item.createTime, "yyyy-mm-dd hh:MM")) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { style: { "float": "right" } },
- vue.toDisplayString(item.status ? item.status === 1 ? $setup.t("wallet.credited") : $setup.t("wallet.withdrawal_failed") : $setup.t("wallet.withdrawing")),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: "暂无数据",
- paddingTop: "200",
- icon: "/static/data-empty.png"
- })),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: $setup.t("common.click_to_load_more")
- },
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.onLoadMore(true)),
- onScrolltolower: _cache[1] || (_cache[1] = ($event) => $setup.onLoadMore(true))
- }, null, 8, ["status", "content-text"])) : vue.createCommentVNode("v-if", true)
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesUserWalletWithdrawalLog = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$R], ["__scopeId", "data-v-fa4881f2"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/withdrawalLog.vue"]]);
- const _sfc_main$R = {
- __name: "scoreToMoney",
- setup(__props, { expose: __expose }) {
- __expose();
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sys_navBar = sheep$1.$platform.navbar;
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: 0,
- total: 0,
- pageSize: 6,
- pageNo: 1
- },
- loadStatus: "",
- date: [],
- today: "",
- showModel: false,
- showQueModel: false
- });
- const close = () => {
- state.showModel = false;
- state.showQueModel = false;
- };
- const tabMaps = [
- {
- name: "全部",
- value: "all"
- },
- {
- name: "收入",
- value: "true"
- },
- {
- name: "支出",
- value: "false"
- }
- ];
- const dateFilterText = vue.computed(() => {
- if (state.date[0] === state.date[1]) {
- return state.date[0];
- } else {
- return state.date.join("~");
- }
- });
- async function getLogList() {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await PointApi.getPointRecordPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- addStatus: state.currentTab > 0 ? tabMaps[state.currentTab].value : void 0,
- "createTime[0]": state.date[0] + " 00:00:00",
- "createTime[1]": state.date[1] + " 23:59:59"
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = data.list;
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- onLoad(() => {
- state.today = dayjs().format("YYYY-MM-DD");
- state.date = [state.today, state.today];
- getLogList();
- });
- function onChange(e2) {
- state.currentTab = e2.index;
- resetPagination(state.pagination);
- getLogList();
- }
- function onChangeTime(e2) {
- state.date[0] = e2[0];
- state.date[1] = e2[e2.length - 1];
- resetPagination(state.pagination);
- getLogList();
- }
- function onLoadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList();
- }
- onReachBottom(() => {
- onLoadMore();
- });
- const __returned__ = { statusBarHeight, userInfo: userInfo2, sys_navBar, state, close, tabMaps, dateFilterText, getLogList, onChange, onChangeTime, onLoadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get PointApi() {
- return PointApi;
- }, get resetPagination() {
- return resetPagination;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "wallet-wrap",
- bgStyle: { "backgroundColor": "#ffffff" },
- title: "佣金兑换",
- navbar: "normal"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "score-box bg-white ss-flex-col ss-row-center" }, [
- vue.createElementVNode("view", null, [
- vue.createElementVNode("view", {
- class: "all-title ss-m-r-8",
- style: { "border": "4rpx solid var(--ui-BG-Main)", "width": "100%", "box-sizing": "border-box", "height": "120rpx", "text-indent": "20rpx", "border-radius": "20rpx", "line-height": "120rpx" }
- }, "到数字人民币钱包:钱包地址/未绑定---->")
- ]),
- vue.createElementVNode("view", { class: "ss-m-y-80" }, [
- vue.createElementVNode("view", { class: "all-title ss-m-r-8 ss-m-b-10" }, "提现金额"),
- vue.createElementVNode("view", { class: "all-title ss-m-r-8 ss-m-y-30" }, [
- vue.createElementVNode("input", {
- class: "uni-input",
- style: { "border": "4rpx solid var(--ui-BG-Main)", "width": "100%", "box-sizing": "border-box", "height": "100rpx", "text-indent": "20rpx", "border-radius": "20rpx" },
- type: "number",
- placeholder: "请输入金额"
- })
- ]),
- vue.createElementVNode("view", { class: "all-title ss-m-r-8 ss-m-b-10 text-center" }, "您当前可兑换金额:¥0")
- ]),
- vue.createElementVNode("view", { class: "ss-m-b-40 ss-flex ss-row-center" }, [
- vue.createElementVNode("view", {
- class: "all-title ss-m-r-80",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.back("/pages/user/wallet/score"))
- }, [
- vue.createElementVNode("button", { class: "btn ss-reset-button ui-Shadow-Main" }, " 取消 ")
- ]),
- vue.createElementVNode("view", { class: "all-title ss-m-r-8" }, [
- vue.createElementVNode("button", { class: "btn ss-reset-button ui-Shadow-Main" }, " 确定 ")
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesUserWalletScoreToMoney = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$Q], ["__scopeId", "data-v-ece509b1"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/scoreToMoney.vue"]]);
- const _sfc_main$Q = {
- __name: "maxScoreLog",
- props: {
- isFreeze: {
- type: Boolean
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sys_navBar = sheep$1.$platform.navbar;
- const props = __props;
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageSize: 10,
- pageNo: 1
- },
- loadStatus: "",
- showModel: false,
- showQueModel: false
- });
- const title = (item) => {
- let title2 = item.profitStatusName + "";
- if (item.username) {
- title2 += "(" + item.username + ")";
- }
- return title2;
- };
- const changeValue = (item) => {
- let value = "";
- if (item.freezeHighQuota > 0 || item.maxAvailablePointsAmount > 0) {
- value = "+";
- }
- value += points2point(item.maxAvailablePointsAmount);
- return value;
- };
- const balance = (item) => {
- let value = "";
- value += t$6("wallet.balance") + ":";
- value += points2point(item.afterMaxAvailablePointsAmount);
- return value;
- };
- async function getLogList(isFreeze) {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await ScoreApi.getMaxScoreList({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- let list = _$1.concat(state.pagination.list, data.list);
- state.pagination.list = list;
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- onLoad(() => {
- getLogList(props.isFreeze);
- });
- function onLoadMore(isFreeze) {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList();
- }
- onReachBottom(() => {
- onLoadMore();
- });
- const __returned__ = { userWallet, statusBarHeight, userInfo: userInfo2, sys_navBar, props, state, title, changeValue, balance, getLogList, onLoadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get points2point() {
- return points2point;
- }, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get PointApi() {
- return PointApi;
- }, get resetPagination() {
- return resetPagination;
- }, get ScoreApi() {
- return ScoreApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 佣金确权 "),
- vue.createVNode(_component_s_layout, {
- class: "wallet-wrap",
- bgStyle: { "backgroundColor": "#ffffff" },
- title: "",
- navbar: "normal"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- vue.createElementVNode(
- "scroll-view",
- {
- class: "list-box",
- "scroll-y": "true",
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers(() => {
- }, ["stop"]))
- },
- [
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- style: { "padding": "20rpx" }
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "list-item ss-flex ss-col-center ss-row-between",
- key: item.id,
- style: { "padding": "20rpx 0", "border-bottom": "1px solid #c4c4c4" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-m-t-10",
- style: { "flex-direction": "column", "align-items": "flex-start", "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "name",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.title(item)) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- style: { "float": "right" },
- class: vue.normalizeClass(["color-red", { "color-green": item.maxAvailablePointsAmount < 0 || _ctx.freezeHighQuota < 0 }])
- },
- vue.toDisplayString($setup.changeValue(item)),
- 3
- /* TEXT, CLASS */
- )
- ]),
- vue.createElementVNode("view", {
- class: "time",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.sheep.$helper.timeFormat(item.createTime, "yyyy-mm-dd hh:MM")) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { style: { "float": "right" } },
- vue.toDisplayString($setup.balance(item)),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: "暂无数据",
- paddingTop: "200",
- icon: "/static/data-empty.png"
- })),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: $setup.t("common.click_to_load_more")
- },
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.onLoadMore(true)),
- onScrolltolower: _cache[1] || (_cache[1] = ($event) => $setup.onLoadMore(true))
- }, null, 8, ["status", "content-text"])) : vue.createCommentVNode("v-if", true)
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesUserWalletMaxScoreLog = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["render", _sfc_render$P], ["__scopeId", "data-v-4bc02433"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/maxScoreLog.vue"]]);
- const _sfc_main$P = {
- __name: "team",
- setup(__props, { expose: __expose }) {
- __expose();
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sys_navBar = sheep$1.$platform.navbar;
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: 0,
- total: 0,
- pageSize: 10,
- pageNo: 1
- },
- loadStatus: "",
- descendants: {
- total: 0,
- list: []
- },
- teamCount: 0,
- ancestor: {}
- });
- const dateFilterText = vue.computed(() => {
- if (state.date[0] === state.date[1]) {
- return state.date[0];
- } else {
- return state.date.join("~");
- }
- });
- async function getTeam() {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await TeamApi.getTeam({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- state.teamCount = data.teamCount;
- state.ancestor = data.ancestor;
- let descendantsList = _$1.concat(state.descendants.list, data.descendants.list);
- state.descendants.list = descendantsList;
- state.descendants.total = data.descendants.total;
- state.pagination.total = data.descendants.total;
- state.loadStatus = state.descendants.list.length < state.descendants.total ? "more" : "noMore";
- }
- onLoad(() => {
- state.today = dayjs().format("YYYY-MM-DD");
- state.date = [state.today, state.today];
- getTeam();
- });
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getTeam();
- }
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { statusBarHeight, userInfo: userInfo2, sys_navBar, state, dateFilterText, getTeam, loadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get TeamApi() {
- return TeamApi;
- }, get resetPagination() {
- return resetPagination;
- }, get points2point() {
- return points2point;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "wallet-wrap",
- bgStyle: { "backgroundColor": "#ffffff" },
- title: "",
- navbar: "normal"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- vue.createElementVNode("view", { class: "all-title ss-p-x-45 ss-p-t-30" }, [
- vue.createElementVNode(
- "text",
- { style: { "float": "right" } },
- vue.toDisplayString($setup.t("team.total_people", { count: $setup.state.teamCount })),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "list-box",
- style: { "width": "100%", "padding": "0", "height": "calc(100vh - 7.5rem)" }
- }, [
- vue.createCommentVNode(" 推荐人 "),
- vue.createElementVNode("view", null, [
- vue.createElementVNode("view", {
- class: "list-item ss-flex ss-col-center ss-row-between",
- style: { "padding-top": "30rpx", "padding-bottom": "0" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- style: { "width": "100%", "border-bottom": "1px solid #ededed", "padding-bottom": "30rpx" }
- }, [
- vue.createElementVNode("view", null, " "),
- vue.createCommentVNode(" 头像 "),
- vue.createElementVNode("view", { class: "avatar-box ss-m-x-20" }, [
- vue.createElementVNode("image", {
- class: "avatar-img",
- src: $setup.state.ancestor.avatar,
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", {
- class: "ss-flex ss-m-t-10",
- style: { "flex-direction": "column", "align-items": "flex-start", "width": "calc(100% - 5.5rem)" }
- }, [
- vue.createElementVNode("view", {
- class: "name",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode(
- "text",
- { style: { "width": "50%", "display": "inline-block" } },
- vue.toDisplayString($setup.state.ancestor.username || "昵称:" + $setup.state.ancestor.descNickName),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "time",
- style: { "float": "right", "color": "#666666" }
- },
- vue.toDisplayString($setup.t("team.retain_performance")) + ":" + vue.toDisplayString($setup.points2point($setup.state.ancestor.residueSocial)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "time",
- style: { "width": "100%", "color": "#999" }
- }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.state.ancestor.socialStatusLevel || "等级1"),
- 1
- /* TEXT */
- ),
- vue.createTextVNode(" / "),
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.t("team.referrer")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { style: { "float": "right" } },
- vue.toDisplayString($setup.t("team.team_count", { count: $setup.state.ancestor.descendantsCount })),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ])
- ]),
- vue.createCommentVNode(" 直推人和后代 "),
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "scroll-view",
- {
- style: { "width": "100%" },
- "scroll-y": "true",
- onTouchmove: _cache[0] || (_cache[0] = vue.withModifiers(() => {
- }, ["stop"]))
- },
- [
- $setup.state.descendants.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.descendants.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "list-item ss-flex ss-col-center ss-row-between",
- key: item.id,
- style: { "padding-top": "30rpx", "padding-bottom": "0" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- style: { "width": "100%", "border-bottom": "1px solid #ededed", "padding-bottom": "30rpx" }
- }, [
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString(item.sort),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(" 头像 "),
- vue.createElementVNode("view", { class: "avatar-box ss-m-x-20" }, [
- vue.createElementVNode("image", {
- class: "avatar-img",
- src: item.avatar || $setup.sheep.$url.static("/static/images/default_avatar.png"),
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", {
- class: "ss-flex ss-m-t-10",
- style: { "flex-direction": "column", "align-items": "flex-start", "width": "calc(100% - 5.5rem)" }
- }, [
- vue.createElementVNode("view", {
- class: "name",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode(
- "text",
- { style: { "width": "50%", "display": "inline-block" } },
- vue.toDisplayString(item.username || "昵称:" + item.descNickName),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "time",
- style: { "float": "right", "color": "#666666" }
- },
- vue.toDisplayString($setup.t("team.new_performance_value")) + ":" + vue.toDisplayString($setup.points2point(item.residueSocial)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "time",
- style: { "width": "100%", "color": "#999" }
- }, [
- vue.createTextVNode(
- vue.toDisplayString(item.socialStatusLevel) + " / ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString(item.depth == 1 ? $setup.t("team.direct_referral") : ""),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { style: { "float": "right" } },
- vue.toDisplayString($setup.t("team.team_count", { count: item.descendantsCount })),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: $setup.t("team.no_team_members"),
- icon: "/static/data-empty.png"
- }, null, 8, ["text"]))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ])
- ]),
- $setup.state.descendants.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 0,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: $setup.t("common.click_to_load_more")
- },
- onClick: $setup.loadMore
- }, null, 8, ["status", "content-text"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesUserWalletTeam = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$O], ["__scopeId", "data-v-f08f8293"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/user/wallet/team.vue"]]);
- const _sfc_main$O = {
- __name: "commission-info",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "2ef4f675-headerBg": vue.unref(headerBg)
- }));
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const headerBg = sheep$1.$url.css("/static/img/shop/commission/background.png");
- const state = vue.reactive({
- showMoney: false
- });
- const __returned__ = { userInfo: userInfo2, headerBg, state, get sheep() {
- return sheep$1;
- }, computed: vue.computed, reactive: vue.reactive };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$N(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 用户资料 "),
- vue.createElementVNode("view", { class: "user-card ss-flex ss-col-bottom" }, [
- vue.createElementVNode("view", { class: "card-top ss-flex ss-row-between" }, [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "head-img-box" }, [
- vue.createElementVNode("image", {
- class: "head-img",
- src: $setup.sheep.$url.cdn($setup.userInfo.avatar),
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "ss-flex-col" }, [
- vue.createElementVNode(
- "view",
- { class: "user-name" },
- vue.toDisplayString($setup.userInfo.nickname),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const commissionInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$N], ["__scopeId", "data-v-2ef4f675"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/components/commission-info.vue"]]);
- const _sfc_main$N = {
- __name: "account-info",
- setup(__props, { expose: __expose }) {
- __expose();
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const state = vue.reactive({
- showMoney: false,
- summary: {}
- });
- vue.onMounted(async () => {
- let { code: code2, data } = await BrokerageApi.getBrokerageUserSummary();
- if (code2 === 0) {
- state.summary = data || {};
- }
- });
- const __returned__ = { userInfo: userInfo2, state, get sheep() {
- return sheep$1;
- }, computed: vue.computed, reactive: vue.reactive, onMounted: vue.onMounted, get BrokerageApi() {
- return BrokerageApi;
- }, get fen2yuan() {
- return fen2yuan;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return vue.openBlock(), vue.createElementBlock("view", { class: "account-card" }, [
- vue.createElementVNode("view", { class: "account-card-box" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-row-between card-box-header" }, [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "header-title ss-m-r-16" }, "账户信息"),
- vue.createElementVNode("button", {
- class: "ss-reset-button look-btn ss-flex",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.showMoney = !$setup.state.showMoney)
- }, [
- vue.createVNode(_component_uni_icons, {
- type: $setup.state.showMoney ? "eye-filled" : "eye-slash-filled",
- color: "#A57A55",
- size: "20"
- }, null, 8, ["type"])
- ])
- ]),
- vue.createElementVNode("view", {
- class: "ss-flex",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/user/wallet/commission"))
- }, [
- vue.createElementVNode("view", { class: "header-title ss-m-r-4" }, "查看明细"),
- vue.createElementVNode("text", { class: "cicon-play-arrow" })
- ])
- ]),
- vue.createCommentVNode(" 收益 "),
- vue.createElementVNode("view", { class: "card-content ss-flex" }, [
- vue.createElementVNode("view", { class: "ss-flex-1 ss-flex-col ss-col-center" }, [
- vue.createElementVNode("view", { class: "item-title" }, "当前佣金(元)"),
- vue.createElementVNode(
- "view",
- { class: "item-detail" },
- vue.toDisplayString($setup.state.showMoney ? $setup.fen2yuan($setup.state.summary.brokeragePrice || 0) : "***"),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex-1 ss-flex-col ss-col-center" }, [
- vue.createElementVNode("view", { class: "item-title" }, "昨天的佣金(元)"),
- vue.createElementVNode(
- "view",
- { class: "item-detail" },
- vue.toDisplayString($setup.state.showMoney ? $setup.fen2yuan($setup.state.summary.yesterdayPrice || 0) : "***"),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex-1 ss-flex-col ss-col-center" }, [
- vue.createElementVNode("view", { class: "item-title" }, "累计已提(元)"),
- vue.createElementVNode(
- "view",
- { class: "item-detail" },
- vue.toDisplayString($setup.state.showMoney ? $setup.fen2yuan($setup.state.summary.withdrawPrice || 0) : "***"),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]);
- }
- const accountInfo = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$M], ["__scopeId", "data-v-12734ec3"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/components/account-info.vue"]]);
- const _sfc_main$M = {
- __name: "commission-log",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- loadStatus: "",
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 1
- }
- });
- async function getLog() {
- state.loadStatus = "loading";
- const { code: code2, data } = await BrokerageApi.getBrokerageRecordPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- getLog();
- function loadmore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLog();
- }
- const __returned__ = { state, getLog, loadmore, get sheep() {
- return sheep$1;
- }, reactive: vue.reactive, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get BrokerageApi() {
- return BrokerageApi;
- }, get fen2yuan() {
- return fen2yuan;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- return vue.openBlock(), vue.createElementBlock("view", { class: "distribution-log-wrap" }, [
- vue.createElementVNode("view", { class: "header-box" }, [
- vue.createElementVNode("image", {
- class: "header-bg",
- src: $setup.sheep.$url.static("/static/images/title2.png")
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "ss-flex header-title" }, [
- vue.createElementVNode("view", { class: "title" }, "实时动态"),
- vue.createElementVNode("text", { class: "cicon-forward" })
- ])
- ]),
- vue.createElementVNode(
- "scroll-view",
- {
- "scroll-y": "true",
- onScrolltolower: $setup.loadmore,
- class: "scroll-box log-scroll",
- "scroll-with-animation": "true"
- },
- [
- $setup.state.pagination.list ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "log-item-box ss-flex ss-row-between",
- key: item.id
- }, [
- vue.createElementVNode("view", { class: "log-item-wrap" }, [
- vue.createElementVNode("view", { class: "log-item ss-flex ss-ellipsis-1 ss-col-center" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- vue.createElementVNode("image", {
- class: "log-img",
- src: $setup.sheep.$url.static("/static/images/notice.png"),
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode(
- "view",
- { class: "log-text ss-ellipsis-1" },
- vue.toDisplayString(item.title) + " " + vue.toDisplayString($setup.fen2yuan(item.price)) + " 元 ",
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode(
- "text",
- { class: "log-time" },
- vue.toDisplayString($setup.dayjs(item.createTime).fromNow()),
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 加载更多 "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 1,
- status: $setup.state.loadStatus,
- color: "#333333",
- onClick: $setup.loadmore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ],
- 32
- /* NEED_HYDRATION */
- )
- ]);
- }
- const commissionLog = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$L], ["__scopeId", "data-v-8c54e688"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/components/commission-log.vue"]]);
- const _sfc_main$L = {
- __name: "commission-menu",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- menuList: [
- {
- img: "/static/images/commission_icon1.png",
- title: "我的团队",
- path: "/pages/commission/team"
- },
- {
- img: "/static/images/commission_icon2.png",
- title: "佣金明细",
- path: "/pages/commission/wallet"
- },
- {
- img: "/static/images/commission_icon3.png",
- title: "分销订单",
- path: "/pages/commission/order"
- },
- {
- img: "/static/images/commission_icon4.png",
- title: "推广商品",
- path: "/pages/commission/goods"
- },
- // {
- // img: '/static/images/commission_icon5.png',
- // title: '我的资料',
- // path: '/pages/commission/apply',
- // isAgentFrom: true,
- // },
- // todo @非繁人:邀请海报需要登录后的个人数据
- {
- img: "/static/images/commission_icon7.png",
- title: "邀请海报",
- path: "action:showShareModal"
- },
- // TODO @非繁人:缺少 icon
- {
- // img: '/static/images/commission_icon7.png',
- title: "推广排行",
- path: "/pages/commission/promoter"
- },
- {
- // img: '/static/images/commission_icon7.png',
- title: "佣金排行",
- path: "/pages/commission/commission-ranking"
- }
- ]
- });
- const __returned__ = { state, get sheep() {
- return sheep$1;
- }, reactive: vue.reactive };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "menu-box ss-flex-col" }, [
- vue.createElementVNode("view", { class: "header-box" }, [
- vue.createElementVNode("image", {
- class: "header-bg",
- src: $setup.sheep.$url.static("/static/images/title1.png")
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "ss-flex header-title" }, [
- vue.createElementVNode("view", { class: "title" }, "功能专区"),
- vue.createElementVNode("text", { class: "cicon-forward" })
- ])
- ]),
- vue.createElementVNode("view", { class: "menu-list ss-flex ss-flex-wrap" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.menuList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: "item-box ss-flex-col ss-col-center",
- onClick: ($event) => $setup.sheep.$router.go(item.path)
- }, [
- vue.createElementVNode("image", {
- class: "menu-icon ss-m-b-10",
- src: $setup.sheep.$url.static(item.img),
- mode: "aspectFill"
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }
- const commissionMenu = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$K], ["__scopeId", "data-v-a53c0bfa"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/components/commission-menu.vue"]]);
- const _sfc_main$K = {
- __name: "commission-auth",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- show: false
- });
- onShow(async () => {
- const { code: code2, data } = await BrokerageApi.getBrokerageUser();
- if (code2 === 0 && !(data == null ? void 0 : data.brokerageEnabled)) {
- state.show = true;
- }
- });
- const __returned__ = { state, get onShow() {
- return onShow;
- }, get sheep() {
- return sheep$1;
- }, reactive: vue.reactive, get BrokerageApi() {
- return BrokerageApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createBlock(_component_su_popup, {
- show: $setup.state.show,
- type: "center",
- round: "10",
- onClose: _cache[2] || (_cache[2] = ($event) => $setup.state.show = false),
- isMaskClick: false,
- maskBackgroundColor: "rgba(0, 0, 0, 0.7)"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "notice-box" }, [
- vue.createElementVNode("view", { class: "img-wrap" }, [
- vue.createElementVNode("image", {
- class: "notice-img",
- src: $setup.sheep.$url.static("/static/images/forbidden.png"),
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "notice-title" }, " 抱歉!您没有分销权限 "),
- vue.createElementVNode("view", { class: "notice-detail" }, " 该功能暂不可用 "),
- vue.createElementVNode("button", {
- class: "ss-reset-button notice-btn ui-Shadow-Main ui-BG-Main-Gradient",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.back())
- }, " 知道了 "),
- vue.createElementVNode("button", {
- class: "ss-reset-button back-btn",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.back())
- }, " 返回 ")
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]);
- }
- const commissionAuth = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$J], ["__scopeId", "data-v-ec55d95e"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/components/commission-auth.vue"]]);
- const _sfc_main$J = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({});
- const bgStyle = {
- color: "#F7D598"
- };
- const __returned__ = { state, bgStyle, reactive: vue.reactive, commissionInfo, accountInfo, commissionLog, commissionMenu, commissionAuth };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- navbar: "inner",
- class: "index-wrap",
- title: "分销中心",
- bgStyle: $setup.bgStyle,
- onShareAppMessage: ""
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 分销商信息 "),
- vue.createVNode($setup["commissionInfo"]),
- vue.createCommentVNode(" 账户信息 "),
- vue.createVNode($setup["accountInfo"]),
- vue.createCommentVNode(" 菜单栏 "),
- vue.createVNode($setup["commissionMenu"]),
- vue.createCommentVNode(" 分销记录 "),
- vue.createVNode($setup["commissionLog"]),
- vue.createCommentVNode(" 权限弹窗 "),
- vue.createVNode($setup["commissionAuth"])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesCommissionIndex = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$I], ["__scopeId", "data-v-a5d04a00"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/index.vue"]]);
- const _sfc_main$I = {
- __name: "wallet",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "52afd294-headerBg": vue.unref(headerBg)
- }));
- const headerBg = sheep$1.$url.css("/static/img/shop/user/wallet_card_bg.png");
- const state = vue.reactive({
- showMoney: false,
- summary: {},
- // 分销信息
- today: "",
- date: [],
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 1
- },
- loadStatus: "",
- price: void 0,
- showModal: false
- });
- const tabMaps = [
- {
- name: "分佣",
- value: "1"
- // BrokerageRecordBizTypeEnum.ORDER
- },
- {
- name: "提现",
- value: "2"
- // BrokerageRecordBizTypeEnum.WITHDRAW
- }
- ];
- const dateFilterText = vue.computed(() => {
- if (state.date[0] === state.date[1]) {
- return state.date[0];
- } else {
- return state.date.join("~");
- }
- });
- async function getLogList() {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await BrokerageApi.getBrokerageRecordPage({
- pageSize: state.pagination.pageSize,
- pageNo: state.pagination.pageNo,
- bizType: tabMaps[state.currentTab].value,
- "createTime[0]": state.date[0] + " 00:00:00",
- "createTime[1]": state.date[1] + " 23:59:59"
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- function onChangeTab(e2) {
- resetPagination(state.pagination);
- state.currentTab = e2.index;
- getLogList();
- }
- function onChangeTime(e2) {
- state.date[0] = e2[0];
- state.date[1] = e2[e2.length - 1];
- resetPagination(state.pagination);
- getLogList();
- }
- async function onConfirm() {
- if (state.price <= 0) {
- sheep$1.$helper.toast("请输入正确的金额");
- return;
- }
- uni.showModal({
- title: "提示",
- content: "确认把您的佣金转入到余额钱包中?",
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await BrokerageApi.createBrokerageWithdraw({
- type: 1,
- // 钱包
- price: state.price * 100
- });
- if (code2 === 0) {
- state.showModal = false;
- await getAgentInfo();
- onChangeTab({
- index: 1
- });
- }
- }
- });
- }
- async function getAgentInfo() {
- const {
- code: code2,
- data
- } = await BrokerageApi.getBrokerageUserSummary();
- if (code2 !== 0) {
- return;
- }
- state.summary = data;
- }
- onLoad(async (options2) => {
- state.today = dayjs().format("YYYY-MM-DD");
- state.date = [state.today, state.today];
- if (options2.type === 2) {
- state.currentTab = 1;
- }
- getLogList();
- getAgentInfo();
- });
- onReachBottom(() => {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList();
- });
- const __returned__ = { headerBg, state, tabMaps, dateFilterText, getLogList, onChangeTab, onChangeTime, onConfirm, getAgentInfo, computed: vue.computed, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get sheep() {
- return sheep$1;
- }, get dayjs() {
- return dayjs;
- }, get _() {
- return _$1;
- }, get BrokerageApi() {
- return BrokerageApi;
- }, get fen2yuan() {
- return fen2yuan;
- }, get resetPagination() {
- return resetPagination;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_datetime_picker = resolveEasycom(vue.resolveDynamicComponent("uni-datetime-picker"), __easycom_0$3);
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "wallet-wrap",
- title: "佣金"
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 钱包卡片 "),
- vue.createElementVNode("view", { class: "header-box ss-flex ss-row-center ss-col-center" }, [
- vue.createElementVNode("view", { class: "card-box ui-BG-Main ui-Shadow-Main" }, [
- vue.createElementVNode("view", { class: "card-head ss-flex ss-col-center" }, [
- vue.createElementVNode("view", { class: "card-title ss-m-r-10" }, "当前佣金(元)"),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.state.showMoney = !$setup.state.showMoney),
- class: vue.normalizeClass(["ss-eye-icon", $setup.state.showMoney ? "cicon-eye" : "cicon-eye-off"])
- },
- null,
- 2
- /* CLASS */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-col-center ss-m-t-30" }, [
- vue.createElementVNode(
- "view",
- { class: "money-num" },
- vue.toDisplayString($setup.state.showMoney ? $setup.fen2yuan($setup.state.summary.withdrawPrice || 0) : "*****"),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "ss-m-r-20" }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button withdraw-btn",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/commission/withdraw"))
- }, " 提现 ")
- ]),
- vue.createElementVNode("button", {
- class: "ss-reset-button balance-btn ss-m-l-20",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.state.showModal = true)
- }, " 转余额 ")
- ])
- ]),
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode("view", { class: "loading-money" }, [
- vue.createElementVNode("view", { class: "loading-money-title" }, "冻结佣金"),
- vue.createElementVNode(
- "view",
- { class: "loading-money-num" },
- vue.toDisplayString($setup.state.showMoney ? $setup.fen2yuan($setup.state.summary.frozenPrice || 0) : "*****"),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "loading-money ss-m-l-100" }, [
- vue.createElementVNode("view", { class: "loading-money-title" }, "可提现佣金"),
- vue.createElementVNode(
- "view",
- { class: "loading-money-num" },
- vue.toDisplayString($setup.state.showMoney ? $setup.fen2yuan($setup.state.summary.brokeragePrice || 0) : "*****"),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]),
- vue.createVNode(_component_su_sticky, null, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 统计 "),
- vue.createElementVNode("view", { class: "filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between" }, [
- vue.createVNode(_component_uni_datetime_picker, {
- modelValue: $setup.state.date,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.date = $event),
- type: "daterange",
- onChange: $setup.onChangeTime,
- end: $setup.state.today
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("button", { class: "ss-reset-button date-btn" }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.dateFilterText),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "cicon-drop-down ss-seldate-icon" })
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "end"]),
- vue.createElementVNode("view", { class: "total-box" }, [
- vue.createCommentVNode(" TODO 非繁人:这里暂时不考虑做 "),
- vue.createCommentVNode(' <view class="ss-m-b-10">总收入¥{{ state.pagination.income.toFixed(2) }}</view> '),
- vue.createCommentVNode(" <view>总支出¥{{ (-state.pagination.expense).toFixed(2) }}</view> ")
- ])
- ]),
- vue.createVNode(_component_su_tabs, {
- list: $setup.tabMaps,
- onChange: $setup.onChangeTab,
- scrollable: false,
- current: $setup.state.currentTab
- }, null, 8, ["current"])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/data-empty.png",
- text: "暂无数据"
- })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 转余额弹框 "),
- vue.createVNode(_component_su_popup, {
- show: $setup.state.showModal,
- type: "bottom",
- round: "20",
- onClose: _cache[5] || (_cache[5] = ($event) => $setup.state.showModal = false),
- showClose: ""
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-p-x-20 ss-p-y-30" }, [
- vue.createElementVNode("view", { class: "model-title ss-m-b-30 ss-m-l-20" }, "转余额"),
- vue.createElementVNode("view", { class: "model-subtitle ss-m-b-100 ss-m-l-20" }, "将您的佣金转到余额中继续消费"),
- vue.createElementVNode("view", { class: "input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20" }, [
- vue.createElementVNode("view", { class: "unit" }, "¥"),
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- class: "ss-flex-1 ss-p-l-10",
- modelValue: $setup.state.price,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.state.price = $event),
- type: "number",
- placeholder: "请输入金额"
- }, null, 8, ["modelValue"])
- ]),
- vue.createElementVNode("button", {
- class: "ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main",
- onClick: $setup.onConfirm
- }, " 确定 ")
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]),
- vue.createCommentVNode(" 钱包记录 "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "wallet-list ss-flex border-bottom",
- key: item.id
- }, [
- vue.createElementVNode("view", { class: "list-content" }, [
- vue.createElementVNode("view", { class: "title-box ss-flex ss-row-between ss-m-b-20" }, [
- vue.createElementVNode(
- "text",
- { class: "title ss-line-1" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "money" }, [
- item.price >= 0 ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "add"
- },
- "+" + vue.toDisplayString($setup.fen2yuan(item.price)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "minus"
- },
- vue.toDisplayString($setup.fen2yuan(item.price)),
- 1
- /* TEXT */
- ))
- ])
- ]),
- vue.createElementVNode(
- "text",
- { class: "time" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat(item.createTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" <u-gap></u-gap> "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- }
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesCommissionWallet = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$H], ["__scopeId", "data-v-52afd294"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/wallet.vue"]]);
- const _sfc_main$H = {
- __name: "goods",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 1
- },
- loadStatus: "",
- shareInfo: {}
- });
- function onShareGoods(goodsInfo) {
- state.shareInfo = $share.getShareInfo(
- {
- title: goodsInfo.title,
- image: sheep$1.$url.cdn(goodsInfo.image),
- desc: goodsInfo.subtitle,
- params: {
- page: "2",
- query: goodsInfo.id
- }
- },
- {
- type: "goods",
- // 商品海报
- title: goodsInfo.title,
- // 商品标题
- image: sheep$1.$url.cdn(goodsInfo.image),
- // 商品主图
- price: goodsInfo.price[0],
- // 商品价格
- original_price: goodsInfo.original_price
- // 商品原价
- }
- );
- showShareModal();
- }
- async function getGoodsList() {
- state.loadStatus = "loading";
- let { code: code2, data } = await SpuApi.getSpuPage({
- pageSize: state.pagination.pageSize,
- pageNo: state.pagination.pageNo
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- data.list.forEach((item) => {
- BrokerageApi.getProductBrokeragePrice(item.id).then((res) => {
- item.brokerageMinPrice = res.data.brokerageMinPrice;
- item.brokerageMaxPrice = res.data.brokerageMaxPrice;
- });
- });
- }
- onLoad(() => {
- getGoodsList();
- });
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getGoodsList();
- }
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { state, onShareGoods, getGoodsList, loadMore, get sheep() {
- return sheep$1;
- }, get $share() {
- return $share;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, reactive: vue.reactive, get _() {
- return _$1;
- }, get showShareModal() {
- return showShareModal;
- }, get SpuApi() {
- return SpuApi;
- }, get BrokerageApi() {
- return BrokerageApi;
- }, get fen2yuan() {
- return fen2yuan;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: "推广商品",
- onShareAppMessage: $setup.state.shareInfo
- }, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "goods-item ss-m-20",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_item, {
- size: "lg",
- img: item.picUrl,
- title: item.name,
- subTitle: item.introduction,
- price: item.price,
- originPrice: item.marketPrice,
- priceColor: "#333",
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id })
- }, {
- rightBottom: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex ss-row-between" }, [
- item.brokerageMinPrice === void 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "commission-num"
- }, "预计佣金:计算中")) : item.brokerageMinPrice === item.brokerageMaxPrice ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "commission-num"
- },
- " 预计佣金:" + vue.toDisplayString($setup.fen2yuan(item.brokerageMinPrice)),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "commission-num"
- },
- " 预计佣金:" + vue.toDisplayString($setup.fen2yuan(item.brokerageMinPrice)) + " ~ " + vue.toDisplayString($setup.fen2yuan(item.brokerageMaxPrice)),
- 1
- /* TEXT */
- )),
- vue.createElementVNode("button", {
- class: "ss-reset-button share-btn ui-BG-Main-Gradient",
- onClick: vue.withModifiers(($event) => $setup.onShareGoods(item), ["stop"])
- }, " 分享赚 ", 8, ["onClick"])
- ])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["img", "title", "subTitle", "price", "originPrice", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/goods-empty.png",
- text: "暂无推广商品"
- })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 加载更多 "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 1,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["onShareAppMessage"]);
- }
- const PagesCommissionGoods = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$G], ["__scopeId", "data-v-1b0a4b5d"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/goods.vue"]]);
- const _sfc_main$G = {
- __name: "order",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "3971f30d-headerBg": vue.unref(headerBg)
- }));
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const headerBg = sheep$1.$url.css("/static/img/shop/user/withdraw_bg.png");
- onPageScroll((e2) => {
- state.scrollTop = e2.scrollTop <= 100;
- });
- const state = vue.reactive({
- totals: 0,
- // 累计推广订单(单)
- scrollTop: false,
- currentTab: 0,
- loadStatus: "",
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 1
- }
- });
- const tabMaps = [
- {
- name: "全部",
- value: "all"
- },
- {
- name: "待结算",
- value: "0"
- // 待结算
- },
- {
- name: "已结算",
- value: "1"
- // 已结算
- }
- ];
- function onTabsChange(e2) {
- resetPagination(state.pagination);
- state.currentTab = e2.index;
- getOrderList();
- }
- async function getOrderList() {
- state.loadStatus = "loading";
- let { code: code2, data } = await BrokerageApi.getBrokerageRecordPage({
- pageSize: state.pagination.pageSize,
- pageNo: state.pagination.pageSize,
- bizType: 1,
- // 获得推广佣金
- status: state.currentTab > 0 ? state.currentTab : void 0
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- if (state.currentTab === 0) {
- state.totals = data.total;
- }
- }
- onLoad(() => {
- getOrderList();
- });
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getOrderList();
- }
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { statusBarHeight, headerBg, state, tabMaps, onTabsChange, getOrderList, loadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, reactive: vue.reactive, get _() {
- return _$1;
- }, get onPageScroll() {
- return onPageScroll;
- }, get resetPagination() {
- return resetPagination;
- }, get BrokerageApi() {
- return BrokerageApi;
- }, get fen2yuan() {
- return fen2yuan;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: "分销订单",
- class: vue.normalizeClass($setup.state.scrollTop ? "order-warp" : ""),
- navbar: "inner"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "header-box",
- style: vue.normalizeStyle([
- {
- marginTop: "-" + Number($setup.statusBarHeight + 88) + "rpx",
- paddingTop: Number($setup.statusBarHeight + 108) + "rpx"
- }
- ])
- },
- [
- vue.createCommentVNode(" 团队数据总览 "),
- vue.createElementVNode("view", {
- class: "team-data-box ss-flex ss-col-center ss-row-between",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "data-card",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "total-item",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "item-title",
- style: { "text-align": "center" }
- }, "累计推广订单(单)"),
- vue.createElementVNode(
- "view",
- {
- class: "total-num",
- style: { "text-align": "center" }
- },
- vue.toDisplayString($setup.state.totals),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" tab "),
- vue.createVNode(_component_su_sticky, { bgColor: "#fff" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_tabs, {
- list: $setup.tabMaps,
- scrollable: false,
- current: $setup.state.currentTab,
- onChange: $setup.onTabsChange
- }, null, 8, ["current"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(" 订单 "),
- vue.createElementVNode("view", { class: "order-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "order-item",
- key: item
- }, [
- vue.createElementVNode("view", { class: "order-header" }, [
- vue.createElementVNode("view", { class: "no-box ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode(
- "text",
- { class: "order-code" },
- "订单编号:" + vue.toDisplayString(item.bizId),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "order-state" },
- vue.toDisplayString(item.status === 0 ? "待结算" : item.status === 1 ? "已结算" : "已取消") + " ( 佣金 " + vue.toDisplayString($setup.fen2yuan(item.price)) + " 元 ) ",
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "order-from ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("view", { class: "from-user ss-flex ss-col-center" }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "order-time" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat(item.createTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createCommentVNode(" 数据为空 "),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/order-empty.png",
- text: "暂无订单"
- })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 加载更多 "),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 1,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["class"]);
- }
- const PagesCommissionOrder = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$F], ["__scopeId", "data-v-3971f30d"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/order.vue"]]);
- const _imports_0$3 = "/static/images/search.png";
- const _imports_1$1 = "/static/images/sort1.png";
- const _imports_2 = "/static/images/sort3.png";
- const _imports_3 = "/static/images/sort2.png";
- const _sfc_main$F = {
- __name: "team",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "42603af6-headerBg": vue.unref(headerBg)
- }));
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const headerBg = sheep$1.$url.css("/static/img/shop/user/withdraw_bg.png");
- onPageScroll((e2) => {
- state.scrollTop = e2.scrollTop <= 100;
- });
- let sort = vue.ref();
- const state = vue.reactive({
- summary: {},
- pagination: {
- pageNo: 1,
- pageSize: 8,
- list: [],
- total: 0
- },
- loadStatus: "",
- // ↓ 新 ui 逻辑
- level: 1,
- nickname: vue.ref(""),
- sortKey: "",
- isAsc: ""
- });
- function filterUserNum(num) {
- if (_$1.isNil(num)) {
- return "";
- }
- return `下级团队${num}人`;
- }
- function submitForm() {
- state.pagination.list = [];
- getTeamList();
- }
- async function getTeamList() {
- state.loadStatus = "loading";
- let { code: code2, data } = await BrokerageApi.getBrokerageUserChildSummaryPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- level: state.level,
- "sortingField.order": state.isAsc,
- "sortingField.field": state.sortKey,
- nickname: state.nickname
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- function setType(e2) {
- state.pagination.list = [];
- state.level = e2 + "";
- getTeamList();
- }
- function setSort(sortKey, isAsc) {
- state.pagination.list = [];
- sort = sortKey + isAsc.toUpperCase();
- state.isAsc = isAsc;
- state.sortKey = sortKey;
- getTeamList();
- }
- onLoad(async () => {
- await getTeamList();
- let { data } = await BrokerageApi.getBrokerageUserSummary();
- state.summary = data;
- });
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getTeamList();
- }
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { statusBarHeight, userInfo: userInfo2, headerBg, get sort() {
- return sort;
- }, set sort(v2) {
- sort = v2;
- }, state, filterUserNum, submitForm, getTeamList, setType, setSort, loadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, ref: vue.ref, get _() {
- return _$1;
- }, get onPageScroll() {
- return onPageScroll;
- }, get BrokerageApi() {
- return BrokerageApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: "我的团队",
- class: vue.normalizeClass($setup.state.scrollTop ? "team-wrap" : ""),
- navbar: "inner"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "promoter-list" }, [
- vue.createElementVNode("view", {
- class: "promoterHeader bg-color",
- style: { "backgroundcolor": "#e93323 !important", "height": "218rpx", "color": "#fff" }
- }, [
- vue.createElementVNode("view", {
- class: "headerCon acea-row row-between",
- style: { "padding": "28px 29px 0 29px" }
- }, [
- vue.createElementVNode("view", null, [
- vue.createElementVNode("view", {
- class: "name",
- style: { "color": "#fff" }
- }, "推广人数"),
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "text",
- {
- class: "num",
- style: { "color": "#fff" }
- },
- vue.toDisplayString($setup.state.summary.firstBrokerageUserCount + $setup.state.summary.secondBrokerageUserCount || 0),
- 1
- /* TEXT */
- ),
- vue.createTextVNode(" 人 ")
- ])
- ]),
- vue.createElementVNode("view", { class: "iconfont icon-tuandui" })
- ])
- ]),
- vue.createElementVNode("view", { style: { "padding": "0 30rpx" } }, [
- vue.createElementVNode("view", { class: "nav acea-row row-around l1" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass($setup.state.level == 1 ? "item on" : "item"),
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.setType(1))
- },
- " 一级(" + vue.toDisplayString($setup.state.summary.firstBrokerageUserCount || 0) + ") ",
- 3
- /* TEXT, CLASS */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass($setup.state.level == 2 ? "item on" : "item"),
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.setType(2))
- },
- " 二级(" + vue.toDisplayString($setup.state.summary.secondBrokerageUserCount || 0) + ") ",
- 3
- /* TEXT, CLASS */
- )
- ]),
- vue.createElementVNode("view", {
- class: "search acea-row row-between-wrapper",
- style: { "display": "flex", "height": "100rpx", "align-items": "center" }
- }, [
- vue.createElementVNode("view", { class: "input" }, [
- vue.withDirectives(vue.createElementVNode(
- "input",
- {
- placeholder: "点击搜索会员名称",
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.nickname = $event),
- "confirm-type": "search",
- name: "search",
- onConfirm: $setup.submitForm
- },
- null,
- 544
- /* NEED_HYDRATION, NEED_PATCH */
- ), [
- [vue.vModelText, $setup.state.nickname]
- ])
- ]),
- vue.createElementVNode("image", {
- src: _imports_0$3,
- mode: "",
- style: { "width": "60rpx", "height": "64rpx" },
- onClick: $setup.submitForm
- })
- ]),
- vue.createElementVNode("view", { class: "list" }, [
- vue.createElementVNode("view", {
- class: "sortNav acea-row row-middle",
- style: { "display": "flex", "align-items": "center" }
- }, [
- $setup.sort === "userCountDESC" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "sortItem",
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.setSort("userCount", "asc"))
- }, [
- vue.createTextVNode(" 团队排序 "),
- vue.createCommentVNode(" TODO 非繁人:看看怎么从项目里拿出去 "),
- vue.createElementVNode("image", { src: _imports_1$1 })
- ])) : $setup.sort === "userCountASC" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "sortItem",
- onClick: _cache[4] || (_cache[4] = ($event) => $setup.setSort("userCount", "desc"))
- }, [
- vue.createTextVNode(" 团队排序 "),
- vue.createElementVNode("image", { src: _imports_2 })
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "sortItem",
- onClick: _cache[5] || (_cache[5] = ($event) => $setup.setSort("userCount", "desc"))
- }, [
- vue.createTextVNode(" 团队排序 "),
- vue.createElementVNode("image", { src: _imports_3 })
- ])),
- $setup.sort === "priceDESC" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 3,
- class: "sortItem",
- onClick: _cache[6] || (_cache[6] = ($event) => $setup.setSort("price", "asc"))
- }, [
- vue.createTextVNode(" 金额排序 "),
- vue.createElementVNode("image", { src: _imports_1$1 })
- ])) : $setup.sort === "priceASC" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 4,
- class: "sortItem",
- onClick: _cache[7] || (_cache[7] = ($event) => $setup.setSort("price", "desc"))
- }, [
- vue.createTextVNode(" 金额排序 "),
- vue.createElementVNode("image", { src: _imports_2 })
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 5,
- class: "sortItem",
- onClick: _cache[8] || (_cache[8] = ($event) => $setup.setSort("price", "desc"))
- }, [
- vue.createTextVNode(" 金额排序 "),
- vue.createElementVNode("image", { src: _imports_3 })
- ])),
- $setup.sort === "orderCountDESC" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 6,
- class: "sortItem",
- onClick: _cache[9] || (_cache[9] = ($event) => $setup.setSort("orderCount", "asc"))
- }, [
- vue.createTextVNode(" 订单排序 "),
- vue.createElementVNode("image", { src: _imports_1$1 })
- ])) : $setup.sort === "orderCountASC" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 7,
- class: "sortItem",
- onClick: _cache[10] || (_cache[10] = ($event) => $setup.setSort("orderCount", "desc"))
- }, [
- vue.createTextVNode(" 订单排序 "),
- vue.createElementVNode("image", { src: _imports_2 })
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 8,
- class: "sortItem",
- onClick: _cache[11] || (_cache[11] = ($event) => $setup.setSort("orderCount", "desc"))
- }, [
- vue.createTextVNode(" 订单排序 "),
- vue.createElementVNode("image", { src: _imports_3 })
- ]))
- ]),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: "item acea-row row-between-wrapper",
- style: { "display": "flex" }
- }, [
- vue.createElementVNode("view", {
- class: "picTxt acea-row row-between-wrapper",
- style: { "display": "flex", "align-items": "center" }
- }, [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: item.avatar
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "text" }, [
- vue.createElementVNode(
- "view",
- { class: "name line1" },
- vue.toDisplayString(item.nickname),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- null,
- " 加入时间: " + vue.toDisplayString($setup.sheep.$helper.timeFormat(item.brokerageTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode("view", {
- class: "right",
- style: { "justify-content": "center", "flex-direction": "column", "display": "flex", "margin-left": "auto" }
- }, [
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "text",
- { class: "num font-color" },
- vue.toDisplayString(item.brokerageUserCount || 0),
- 1
- /* TEXT */
- ),
- vue.createTextVNode("人 ")
- ]),
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "text",
- { class: "num" },
- vue.toDisplayString(item.orderCount || 0),
- 1
- /* TEXT */
- ),
- vue.createTextVNode("单")
- ]),
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "text",
- { class: "num" },
- vue.toDisplayString(item.brokeragePrice || 0),
- 1
- /* TEXT */
- ),
- vue.createTextVNode("元 ")
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- $setup.state.pagination.list.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- style: { "text-align": "center" }
- }, "暂无推广人数")) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ]),
- vue.createCommentVNode(" <home></home> "),
- vue.createCommentVNode(` <view class="header-box" :style="[
- {
- marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
- paddingTop: Number(statusBarHeight + 108) + 'rpx',
- },
- ]">
- <view v-if="userInfo.parent_user" class="referrer-box ss-flex ss-col-center">
- 推荐人:
- <image class="referrer-avatar ss-m-r-10" :src="sheep.$url.cdn(userInfo.parent_user.avatar)"
- mode="aspectFill">
- </image>
- {{ userInfo.parent_user.nickname }}
- </view>
- <view class="team-data-box ss-flex ss-col-center ss-row-between">
- <view class="data-card">
- <view class="total-item">
- <view class="item-title">团队总人数(人)</view>
- <view class="total-num">
- {{ (state.summary.firstBrokerageUserCount+ state.summary.secondBrokerageUserCount)|| 0 }}
- </view>
- </view>
- <view class="category-item ss-flex">
- <view class="ss-flex-1">
- <view class="item-title">一级成员</view>
- <view class="category-num">{{ state.summary.firstBrokerageUserCount || 0 }}</view>
- </view>
- <view class="ss-flex-1">
- <view class="item-title">二级成员</view>
- <view class="category-num">{{ state.summary.secondBrokerageUserCount || 0 }}</view>
- </view>
- </view>
- </view>
- <view class="data-card">
- <view class="total-item">
- <view class="item-title">团队分销商人数(人)</view>
- <view class="total-num">{{ agentInfo?.child_agent_count_all || 0 }}</view>
- </view>
- <view class="category-item ss-flex">
- <view class="ss-flex-1">
- <view class="item-title">一级分销商</view>
- <view class="category-num">{{ agentInfo?.child_agent_count_1 || 0 }}</view>
- </view>
- <view class="ss-flex-1">
- <view class="item-title">二级分销商</view>
- <view class="category-num">{{ agentInfo?.child_agent_count_2 || 0 }}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="list-box">
- <uni-list :border="false">
- <uni-list-chat v-for="item in state.pagination.data" :key="item.id" :avatar-circle="true"
- :title="item.nickname" :avatar="sheep.$url.cdn(item.avatar)"
- :note="filterUserNum(item.agent?.child_user_count_1)">
- <view class="chat-custom-right">
- <view v-if="item.avatar" class="tag-box ss-flex ss-col-center">
- <image class="tag-img" :src="sheep.$url.cdn(item.avatar)" mode="aspectFill">
- </image>
- <text class="tag-title">{{ item.nickname }}</text>
- </view>
- <text
- class="time-text">{{ sheep.$helper.timeFormat(item.brokerageTime, 'yyyy-mm-dd hh:MM:ss') }}</text>
- </view>
- </uni-list-chat>
- </uni-list>
- </view>
- <s-empty v-if="state.pagination.total === 0" icon="/static/data-empty.png" text="暂无团队信息">
- </s-empty> `)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["class"]);
- }
- const PagesCommissionTeam = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$E], ["__scopeId", "data-v-42603af6"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/team.vue"]]);
- const _sfc_main$E = {
- __name: "promoter",
- setup(__props, { expose: __expose }) {
- __expose();
- const tabMaps = ["周排行", "月排行"];
- const state = vue.reactive({
- currentTab: 0,
- rankList: [],
- times: [],
- one: {},
- // 排名第一
- two: {},
- // 排名第二
- three: {}
- // 排名第三
- });
- function switchTap(index2) {
- if (state.currentTab === index2) {
- return;
- }
- state.currentTab = index2;
- calculateTimes();
- getRankList();
- }
- async function getRankList() {
- state.one = {};
- state.two = {};
- state.three = {};
- state.rankList = [];
- const { code: code2, data } = await BrokerageApi.getBrokerageUserRankPageByUserCount({
- pageNo: 1,
- pageSize: 10,
- "times[0]": state.times[0],
- "times[1]": state.times[1]
- });
- if (code2 !== 0) {
- return;
- }
- state.rankList = data.list;
- state.one = state.rankList.shift() || {};
- state.two = state.rankList.shift() || {};
- state.trhee = state.rankList.shift() || {};
- }
- function calculateTimes() {
- let times2;
- if (state.currentTab === 0) {
- times2 = getWeekTimes();
- } else {
- times2 = getMonthTimes();
- }
- state.times = [formatDate2(times2[0]), formatDate2(times2[1])];
- }
- onLoad(function() {
- calculateTimes();
- getRankList();
- });
- function formatDate2(date2) {
- return sheep$1.$helper.timeFormat(date2, "yyyy-mm-dd hh:MM:ss");
- }
- function getWeekTimes() {
- const today = /* @__PURE__ */ new Date();
- const dayOfWeek = today.getDay();
- return [
- new Date(today.getFullYear(), today.getMonth(), today.getDate() - dayOfWeek, 0, 0, 0),
- new Date(today.getFullYear(), today.getMonth(), today.getDate() + (6 - dayOfWeek), 23, 59, 59)
- ];
- }
- function getMonthTimes() {
- const today = /* @__PURE__ */ new Date();
- const year = today.getFullYear();
- const month = today.getMonth();
- const startDate = new Date(year, month, 1, 0, 0, 0);
- const nextMonth = new Date(year, month + 1, 1);
- const endDate = new Date(nextMonth.getTime() - 1);
- return [startDate, endDate];
- }
- const __returned__ = { tabMaps, state, switchTap, getRankList, calculateTimes, formatDate: formatDate2, getWeekTimes, getMonthTimes, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, get BrokerageApi() {
- return BrokerageApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, { title: "推广人排行榜" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", {
- class: "PromoterRank",
- style: { "backgroundColor": "red" }
- }, [
- vue.createElementVNode("view", { class: "redBg bg-color" }, [
- vue.createElementVNode("view", { class: "header" }, [
- vue.createElementVNode("view", {
- class: "nav acea-row row-center-wrapper",
- style: { "display": "flex" }
- }, [
- (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.tabMaps, (item, index2) => {
- return vue.createElementVNode("view", {
- class: vue.normalizeClass(["item", $setup.state.currentTab === index2 ? "font-color" : ""]),
- key: index2,
- onClick: ($event) => $setup.switchTap(index2)
- }, vue.toDisplayString(item), 11, ["onClick"]);
- }),
- 64
- /* STABLE_FRAGMENT */
- ))
- ]),
- vue.createCommentVNode(" top3 排名 "),
- vue.createElementVNode("view", { class: "rank acea-row row-bottom row-around" }, [
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "item" },
- [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: $setup.state.two.avatar
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode(
- "view",
- { class: "name line1" },
- vue.toDisplayString($setup.state.two.nickname),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "num" },
- vue.toDisplayString($setup.state.two.brokerageUserCount) + "人",
- 1
- /* TEXT */
- )
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.two.id]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "item" },
- [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: $setup.state.one.avatar
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode(
- "view",
- { class: "name line1" },
- vue.toDisplayString($setup.state.one.nickname),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "num" },
- vue.toDisplayString($setup.state.one.brokerageUserCount) + "人",
- 1
- /* TEXT */
- )
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.one.id]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "item" },
- [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: $setup.state.three.avatar
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode(
- "view",
- { class: "name line1" },
- vue.toDisplayString($setup.state.three.nickname),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "num" },
- vue.toDisplayString($setup.state.three.brokerageUserCount) + "人",
- 1
- /* TEXT */
- )
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.three.id]
- ])
- ])
- ])
- ]),
- vue.createCommentVNode(" 其它排名 "),
- $setup.state.rankList.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "list"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.rankList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "item acea-row row-between-wrapper",
- key: index2
- }, [
- vue.createElementVNode(
- "view",
- { class: "num" },
- vue.toDisplayString(index2 + 4),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "picTxt acea-row row-between-wrapper" }, [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: item.avatar
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode(
- "view",
- { class: "text line1" },
- vue.toDisplayString(item.nickname),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "people font-color" },
- vue.toDisplayString(item.brokerageUserCount) + "人",
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesCommissionPromoter = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$D], ["__scopeId", "data-v-fe20a205"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/promoter.vue"]]);
- const _sfc_main$D = {
- __name: "commission-ranking",
- setup(__props, { expose: __expose }) {
- __expose();
- const tabMaps = ["周排行", "月排行"];
- const state = vue.reactive({
- currentTab: 0,
- position: 0,
- // 排名
- rankList: []
- });
- async function switchTap(index2) {
- state.currentTab = index2;
- state.rankList = [];
- calculateTimes();
- getBrokerageRankList();
- getBrokerageRankNumber();
- }
- async function getBrokerageRankList() {
- const {
- code: code2,
- data
- } = await BrokerageApi.getBrokerageUserChildSummaryPageByPrice({
- pageNo: 1,
- pageSize: 10,
- "times[0]": state.times[0],
- "times[1]": state.times[1]
- });
- if (code2 !== 0) {
- return;
- }
- state.rankList = data.list;
- }
- async function getBrokerageRankNumber() {
- const {
- code: code2,
- data
- } = await BrokerageApi.getRankByPrice({
- times: state.times
- });
- if (code2 !== 0) {
- return;
- }
- state.position = data;
- }
- function formatDate2(date2) {
- return sheep$1.$helper.timeFormat(date2, "yyyy-mm-dd hh:MM:ss");
- }
- function calculateTimes() {
- let times2;
- if (state.currentTab === 0) {
- times2 = getWeekTimes();
- } else {
- times2 = getMonthTimes();
- }
- state.times = [formatDate2(times2[0]), formatDate2(times2[1])];
- }
- onLoad(function() {
- calculateTimes();
- getBrokerageRankList();
- getBrokerageRankNumber();
- });
- function getWeekTimes() {
- const today = /* @__PURE__ */ new Date();
- const dayOfWeek = today.getDay();
- return [
- new Date(today.getFullYear(), today.getMonth(), today.getDate() - dayOfWeek, 0, 0, 0),
- new Date(
- today.getFullYear(),
- today.getMonth(),
- today.getDate() + (6 - dayOfWeek),
- 23,
- 59,
- 59
- )
- ];
- }
- function getMonthTimes() {
- const today = /* @__PURE__ */ new Date();
- const year = today.getFullYear();
- const month = today.getMonth();
- const startDate = new Date(year, month, 1, 0, 0, 0);
- const nextMonth = new Date(year, month + 1, 1);
- const endDate = new Date(nextMonth.getTime() - 1);
- return [startDate, endDate];
- }
- const __returned__ = { tabMaps, state, switchTap, getBrokerageRankList, getBrokerageRankNumber, formatDate: formatDate2, calculateTimes, getWeekTimes, getMonthTimes, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, get BrokerageApi() {
- return BrokerageApi;
- }, get fen2yuan() {
- return fen2yuan;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_emptyPage = vue.resolveComponent("emptyPage");
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, { title: "佣金排行榜" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "CommissionRank" }, [
- vue.createElementVNode("view", { class: "header" }, [
- $setup.state.position ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "rank"
- }, [
- vue.createTextVNode(" 您目前的排名 "),
- vue.createElementVNode(
- "text",
- { class: "num" },
- vue.toDisplayString($setup.state.position),
- 1
- /* TEXT */
- ),
- vue.createTextVNode(" 名 ")
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "rank"
- }, "您目前暂无排名"))
- ]),
- vue.createElementVNode("view", { class: "wrapper" }, [
- vue.createElementVNode("view", {
- class: "nav acea-row row-around",
- style: { "justify-content": "space-around", "display": "flex" }
- }, [
- (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.tabMaps, (item, index2) => {
- return vue.createElementVNode("view", {
- class: vue.normalizeClass(["item", $setup.state.currentTab === index2 ? "font-color" : ""]),
- key: index2,
- onClick: ($event) => $setup.switchTap(index2)
- }, vue.toDisplayString(item), 11, ["onClick"]);
- }),
- 64
- /* STABLE_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("view", { class: "list" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.rankList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "item acea-row row-between-wrapper",
- key: index2
- }, [
- index2 <= 2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "num"
- }, [
- vue.createElementVNode("image", {
- src: "/static/images/medal0" + (index2 + 1) + ".png"
- }, null, 8, ["src"])
- ])) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "num"
- },
- vue.toDisplayString(index2 + 1),
- 1
- /* TEXT */
- )),
- vue.createElementVNode("view", { class: "picTxt acea-row row-between-wrapper" }, [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: item.avatar
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode(
- "view",
- { class: "text line1" },
- vue.toDisplayString(item.nickname),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "people font-color" },
- "¥" + vue.toDisplayString($setup.fen2yuan(item.brokeragePrice)),
- 1
- /* TEXT */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- $setup.state.rankList.length === 0 && ($setup.state.page !== 1 || $setup.state.active === 0) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "noCommodity"
- }, [
- vue.createVNode(_component_emptyPage, { title: "暂无排行~" })
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesCommissionCommissionRanking = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$C], ["__scopeId", "data-v-4b4e4229"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/commission-ranking.vue"]]);
- const _sfc_main$C = {
- __name: "account-type-select",
- props: {
- modelValue: {
- type: Object,
- default() {
- }
- },
- show: {
- type: Boolean,
- default: false
- },
- methods: {
- // 开启的提现方式
- type: Array,
- default: []
- }
- },
- emits: ["update:modelValue", "change", "close"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props = __props;
- const emits = __emit;
- const state = vue.reactive({
- currentValue: ""
- });
- const typeList = [
- {
- // icon: '/static/img/shop/pay/wechat.png', // TODO 非繁人:后续给个 icon
- title: "钱包余额",
- value: "1"
- },
- {
- icon: "/static/img/shop/pay/wechat.png",
- title: "微信零钱",
- value: "2"
- },
- {
- icon: "/static/img/shop/pay/alipay.png",
- title: "支付宝账户",
- value: "3"
- },
- {
- icon: "/static/img/shop/pay/bank.png",
- title: "银行卡转账",
- value: "4"
- }
- ];
- function onChange(e2) {
- state.currentValue = e2.detail.value;
- }
- const onConfirm = async () => {
- if (state.currentValue === "") {
- sheep$1.$helper.toast("请选择提现方式");
- return;
- }
- emits("update:modelValue", {
- type: state.currentValue
- });
- emits("close");
- };
- const hideModal = () => {
- emits("close");
- };
- const __returned__ = { props, emits, state, typeList, onChange, onConfirm, hideModal, reactive: vue.reactive, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createBlock(_component_su_popup, {
- show: $props.show,
- class: "ss-checkout-counter-wrap",
- onClose: $setup.hideModal
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-modal-box bg-white ss-flex-col" }, [
- vue.createElementVNode("view", { class: "modal-header ss-flex-col ss-col-left" }, [
- vue.createElementVNode("text", { class: "modal-title ss-m-b-20" }, "选择提现方式")
- ]),
- vue.createElementVNode("view", { class: "modal-content ss-flex-1 ss-p-b-100" }, [
- vue.createElementVNode(
- "radio-group",
- { onChange: $setup.onChange },
- [
- (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.typeList, (item, index2) => {
- return vue.createElementVNode("label", {
- class: "container-list ss-p-l-34 ss-p-r-24 ss-flex ss-col-center ss-row-center",
- key: index2
- }, [
- vue.createElementVNode("view", { class: "container-icon ss-flex ss-m-r-20" }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static(item.icon)
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode(
- "view",
- { class: "ss-flex-1" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("radio", {
- value: item.value,
- color: "var(--ui-BG-Main)",
- checked: item.value === $setup.state.currentValue,
- disabled: !$props.methods.includes(parseInt(item.value))
- }, null, 8, ["value", "checked", "disabled"])
- ]);
- }),
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ]),
- vue.createElementVNode("view", { class: "modal-footer ss-flex ss-row-center ss-col-center" }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button save-btn",
- onClick: $setup.onConfirm
- }, "确定")
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]);
- }
- const accountTypeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$B], ["__scopeId", "data-v-a5da3655"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/components/account-type-select.vue"]]);
- const _sfc_main$B = {
- __name: "withdraw",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "cf14c8af-headerBg": vue.unref(headerBg)
- }));
- const headerBg = sheep$1.$url.css("/static/img/shop/user/withdraw_bg.png");
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userStore = sheep$1.$store("user");
- const userInfo2 = vue.computed(() => userStore.userInfo);
- const state = vue.reactive({
- accountInfo: {
- // 提现表单
- type: void 0,
- accountNo: void 0,
- accountQrCodeUrl: void 0,
- name: void 0,
- bankName: void 0,
- bankAddress: void 0
- },
- accountSelect: false,
- brokerageInfo: {},
- // 分销信息
- frozenDays: 0,
- // 冻结天数
- minPrice: 0,
- // 最低提现金额
- withdrawTypes: []
- // 提现方式
- });
- const onAccountSelect = (e2) => {
- state.accountSelect = e2;
- };
- const onConfirm = async () => {
- debugger;
- if (!state.accountInfo.price || state.accountInfo.price > state.brokerageInfo.price || state.accountInfo.price <= 0) {
- sheep$1.$helper.toast("请输入正确的提现金额");
- return;
- }
- if (!state.accountInfo.type) {
- sheep$1.$helper.toast("请选择提现方式");
- return;
- }
- let { code: code2 } = await BrokerageApi.createBrokerageWithdraw({
- ...state.accountInfo,
- price: state.accountInfo.price * 100
- });
- if (code2 !== 0) {
- return;
- }
- uni.showModal({
- title: "操作成功",
- content: "您的提现申请已成功提交",
- cancelText: "继续提现",
- confirmText: "查看记录",
- success: (res) => {
- if (res.confirm) {
- sheep$1.$router.go("/pages/commission/wallet", { type: 2 });
- return;
- }
- getBrokerageUser();
- state.accountInfo = {};
- }
- });
- };
- async function getWithdrawRules() {
- let { code: code2, data } = await TradeConfigApi.getTradeConfig();
- if (code2 !== 0) {
- return;
- }
- if (data) {
- state.minPrice = data.brokerageWithdrawMinPrice || 0;
- state.frozenDays = data.brokerageFrozenDays || 0;
- state.withdrawTypes = data.brokerageWithdrawTypes;
- }
- }
- async function getBrokerageUser() {
- const { data, code: code2 } = await BrokerageApi.getBrokerageUser();
- if (code2 === 0) {
- state.brokerageInfo = data;
- }
- }
- vue.onBeforeMount(() => {
- getWithdrawRules();
- getBrokerageUser();
- });
- const __returned__ = { headerBg, statusBarHeight, userStore, userInfo: userInfo2, state, onAccountSelect, onConfirm, getWithdrawRules, getBrokerageUser, computed: vue.computed, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, get sheep() {
- return sheep$1;
- }, accountTypeSelect, get fen2yuan() {
- return fen2yuan;
- }, get TradeConfigApi() {
- return TradeConfigApi;
- }, get BrokerageApi() {
- return BrokerageApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_s_uploader = resolveEasycom(vue.resolveDynamicComponent("s-uploader"), __easycom_3$4);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: "申请提现",
- class: "withdraw-wrap",
- navbar: "inner"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "page-bg" }),
- vue.createElementVNode(
- "view",
- {
- class: "wallet-num-box ss-flex ss-col-center ss-row-between",
- style: vue.normalizeStyle([
- {
- marginTop: "-" + Number($setup.statusBarHeight + 88) + "rpx",
- paddingTop: Number($setup.statusBarHeight + 108) + "rpx"
- }
- ])
- },
- [
- vue.createElementVNode("view", { class: "" }, [
- vue.createElementVNode("view", { class: "num-title" }, "可提现金额(元)"),
- vue.createElementVNode(
- "view",
- { class: "wallet-num" },
- vue.toDisplayString($setup.fen2yuan($setup.state.brokerageInfo.brokeragePrice)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("button", {
- class: "ss-reset-button log-btn",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/commission/wallet", { type: 2 }))
- }, " 提现记录 ")
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 提现输入卡片"),
- vue.createElementVNode("view", { class: "draw-card" }, [
- vue.createElementVNode("view", { class: "bank-box ss-flex ss-col-center ss-row-between ss-m-b-30" }, [
- vue.createElementVNode("view", { class: "name" }, "提现至"),
- vue.createElementVNode("view", {
- class: "bank-list ss-flex ss-col-center",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.onAccountSelect(true))
- }, [
- !$setup.state.accountInfo.type ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "empty-text"
- }, "请选择提现方式")) : vue.createCommentVNode("v-if", true),
- $setup.state.accountInfo.type === "1" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "empty-text"
- }, "钱包余额")) : vue.createCommentVNode("v-if", true),
- $setup.state.accountInfo.type === "2" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "empty-text"
- }, "微信零钱")) : vue.createCommentVNode("v-if", true),
- $setup.state.accountInfo.type === "3" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 3,
- class: "empty-text"
- }, "支付宝账户")) : vue.createCommentVNode("v-if", true),
- $setup.state.accountInfo.type === "4" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 4,
- class: "empty-text"
- }, "银行卡转账")) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("text", { class: "cicon-forward" })
- ])
- ]),
- vue.createCommentVNode(" 提现金额 "),
- vue.createElementVNode("view", { class: "card-title" }, "提现金额"),
- vue.createElementVNode("view", { class: "input-box ss-flex ss-col-center border-bottom" }, [
- vue.createElementVNode("view", { class: "unit" }, "¥"),
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- class: "ss-flex-1 ss-p-l-10",
- modelValue: $setup.state.accountInfo.price,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.accountInfo.price = $event),
- type: "number",
- placeholder: "请输入提现金额"
- }, null, 8, ["modelValue"])
- ]),
- vue.createCommentVNode(" 提现账号 "),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "card-title" },
- " 提现账号 ",
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, ["2", "3", "4"].includes($setup.state.accountInfo.type)]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "input-box ss-flex ss-col-center border-bottom" },
- [
- vue.createElementVNode("view", { class: "unit" }),
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- class: "ss-flex-1 ss-p-l-10",
- modelValue: $setup.state.accountInfo.accountNo,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.accountInfo.accountNo = $event),
- placeholder: "请输入提现账号"
- }, null, 8, ["modelValue"])
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, ["2", "3", "4"].includes($setup.state.accountInfo.type)]
- ]),
- vue.createCommentVNode(" 收款码 "),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "card-title" },
- "收款码",
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, ["2", "3"].includes($setup.state.accountInfo.type)]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "input-box ss-flex ss-col-center" },
- [
- vue.createElementVNode("view", { class: "unit" }),
- vue.createElementVNode("view", { class: "upload-img" }, [
- vue.createVNode(_component_s_uploader, {
- url: $setup.state.accountInfo.accountQrCodeUrl,
- "onUpdate:url": _cache[4] || (_cache[4] = ($event) => $setup.state.accountInfo.accountQrCodeUrl = $event),
- fileMediatype: "image",
- limit: "1",
- mode: "grid",
- imageStyles: { width: "168rpx", height: "168rpx" }
- }, null, 8, ["url"])
- ])
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, ["2", "3"].includes($setup.state.accountInfo.type)]
- ]),
- vue.createCommentVNode(" 持卡人姓名 "),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "card-title" },
- "持卡人",
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.accountInfo.type === "4"]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "input-box ss-flex ss-col-center border-bottom" },
- [
- vue.createElementVNode("view", { class: "unit" }),
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- class: "ss-flex-1 ss-p-l-10",
- modelValue: $setup.state.accountInfo.name,
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $setup.state.accountInfo.name = $event),
- placeholder: "请输入持卡人姓名"
- }, null, 8, ["modelValue"])
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.accountInfo.type === "4"]
- ]),
- vue.createCommentVNode(" 提现银行 "),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "card-title" },
- "提现银行",
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.accountInfo.type === "4"]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "input-box ss-flex ss-col-center border-bottom" },
- [
- vue.createElementVNode("view", { class: "unit" }),
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- class: "ss-flex-1 ss-p-l-10",
- modelValue: $setup.state.accountInfo.bankName,
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.state.accountInfo.bankName = $event),
- placeholder: "请输入提现银行"
- }, null, 8, ["modelValue"])
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.accountInfo.type === "4"]
- ]),
- vue.createCommentVNode(" 开户地址 "),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "card-title" },
- "开户地址",
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.accountInfo.type === "4"]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "input-box ss-flex ss-col-center border-bottom" },
- [
- vue.createElementVNode("view", { class: "unit" }),
- vue.createVNode(_component_uni_easyinput, {
- inputBorder: false,
- class: "ss-flex-1 ss-p-l-10",
- modelValue: $setup.state.accountInfo.bankAddress,
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $setup.state.accountInfo.bankAddress = $event),
- placeholder: "请输入开户地址"
- }, null, 8, ["modelValue"])
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.state.accountInfo.type === "4"]
- ]),
- vue.createElementVNode("button", {
- class: "ss-reset-button save-btn ui-BG-Main-Gradient ui-Shadow-Main",
- onClick: $setup.onConfirm
- }, " 确认提现 ")
- ]),
- vue.createCommentVNode(" 提现说明 "),
- vue.createElementVNode("view", { class: "draw-notice" }, [
- vue.createElementVNode("view", { class: "title ss-m-b-30" }, "提现说明"),
- vue.createElementVNode(
- "view",
- { class: "draw-list" },
- " 最低提现金额 " + vue.toDisplayString($setup.fen2yuan($setup.state.minPrice)) + " 元 ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "draw-list" }, [
- vue.createTextVNode(" 冻结佣金:"),
- vue.createElementVNode(
- "text",
- null,
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.brokerageInfo.frozenPrice)),
- 1
- /* TEXT */
- ),
- vue.createTextVNode(
- " (每笔佣金的冻结期为 " + vue.toDisplayString($setup.state.frozenDays) + " 天,到期后可提现) ",
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(" 选择提现账户 "),
- vue.createVNode($setup["accountTypeSelect"], {
- show: $setup.state.accountSelect,
- onClose: _cache[8] || (_cache[8] = ($event) => $setup.onAccountSelect(false)),
- round: "10",
- modelValue: $setup.state.accountInfo,
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $setup.state.accountInfo = $event),
- methods: $setup.state.withdrawTypes
- }, null, 8, ["show", "modelValue", "methods"])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesCommissionWithdraw = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$A], ["__scopeId", "data-v-cf14c8af"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/commission/withdraw.vue"]]);
- const _sfc_main$A = {
- __name: "sign",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "964858d2-headerBg": vue.unref(headerBg)
- }));
- const headerBg = sheep$1.$url.css("/static/images/sign.png");
- const state = vue.reactive({
- data: {
- days: [],
- //日历
- rules: {}
- //规则
- },
- cur_year: 0,
- //当前选的年
- cur_month: 0,
- //当前选的月
- cur_day: 0,
- //当前选择的天
- weeks_ch: [
- {
- title: t$6("sign.sunday"),
- value: "0"
- },
- {
- title: t$6("sign.monday"),
- value: "1"
- },
- {
- title: t$6("sign.tuesday"),
- value: "2"
- },
- {
- title: t$6("sign.wednesday"),
- value: "3"
- },
- {
- title: t$6("sign.thursday"),
- value: "4"
- },
- {
- title: t$6("sign.friday"),
- value: "5"
- },
- {
- title: t$6("sign.saturday"),
- value: "6"
- }
- ],
- //星期
- showModel: false,
- //签到弹框
- continue_days: 0,
- //连续签到天数
- signin: {},
- // 签到
- showRetroactive: false,
- //补签弹框
- date: "",
- //补签选中日期
- isSign: 0,
- //今天是否签到
- loading: true
- });
- async function onSign2() {
- const {
- code: code2,
- data
- } = await SignInApi.createSignInRecord();
- if (code2 === 0) {
- state.showModel = true;
- state.signin = data;
- state.isSign = 1;
- uni.setStorageSync("isSign", true);
- }
- }
- function onShowRetroactive(e2) {
- state.showRetroactive = true;
- state.date = e2;
- }
- vue.watch(() => state.showModel, (newValue) => {
- if (newValue) {
- setTimeout(onConfirm, 3e3);
- }
- });
- function onConfirm() {
- state.showModel = false;
- getData({
- month: formatDate2(/* @__PURE__ */ new Date()).substring(0, 7)
- });
- }
- function formatDate2(t2) {
- let date2 = new Date(t2);
- let year = date2.getFullYear();
- let month = String(date2.getMonth() + 1).padStart(2, "0");
- let day = String(date2.getDate()).padStart(2, "0");
- let dateString = `${year}-${month}-${day}`;
- return dateString;
- }
- async function getData(mouth) {
- const {
- code: code2,
- data
- } = await SignInApi.getOwnSignInMoon(mouth);
- if (code2 === 0) {
- data.days.forEach((i2, index2) => {
- if (i2.week == "SUNDAY") {
- i2.week = 0;
- } else if (i2.week == "MONDAY") {
- i2.week = 1;
- } else if (i2.week == "TUESDAY") {
- i2.week = 2;
- } else if (i2.week == "WEDNESDAY") {
- i2.week = 3;
- } else if (i2.week == "THURSDAY") {
- i2.week = 4;
- } else if (i2.week == "FRIDAY") {
- i2.week = 5;
- } else if (i2.week == "SATURDAY") {
- i2.week = 6;
- }
- i2.date = formatDate2(i2.date);
- });
- state.data = data;
- } else {
- state.data = null;
- }
- state.loading = false;
- if (state.data) {
- state.data.days.forEach((i2, index2) => {
- if (index2 < i2.week) {
- index2++;
- var obj = {
- day: null,
- isSign: false
- };
- state.data.days.unshift(obj);
- }
- if (index2 == 1) {
- let arr = i2.date.split("-");
- state.cur_year = arr[0];
- state.cur_month = arr[1];
- }
- });
- if (state.data.days[0].day == null) {
- state.data.days.forEach((i2, index2) => {
- if (i2.current == "today") {
- state.isSign = i2.isSign;
- }
- });
- }
- state.continue_days = data.continueDays;
- }
- }
- onReady(() => {
- getData({
- month: formatDate2(/* @__PURE__ */ new Date()).substring(0, 7)
- });
- });
- const handleCalendar = (type) => {
- const cur_year = parseInt(state.cur_year);
- const cur_month = parseInt(state.cur_month);
- var newMonth;
- var newYear = cur_year;
- if (type === 0) {
- newMonth = cur_month - 1;
- if (newMonth < 1) {
- newYear = cur_year - 1;
- newMonth = 12;
- } else if (newMonth < 10) {
- newMonth = "0" + newMonth;
- }
- } else {
- newMonth = cur_month + 1;
- if (newMonth > 12) {
- newYear = cur_year + 1;
- newMonth = "01";
- } else if (newMonth < 10) {
- newMonth = "0" + newMonth;
- }
- }
- getData({
- month: newYear + "-" + newMonth
- });
- };
- const __returned__ = { headerBg, state, onSign: onSign2, onShowRetroactive, onConfirm, formatDate: formatDate2, getData, handleCalendar, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReady() {
- return onReady;
- }, computed: vue.computed, reactive: vue.reactive, watchEffect: vue.watchEffect, watch: vue.watch, onMounted: vue.onMounted, get SignInApi() {
- return SignInApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("sign.check_in_gift")
- }, {
- default: vue.withCtx(() => [
- $setup.state.loading ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 })) : $setup.state.data && !$setup.state.loading ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "sign-wrap"
- }, [
- vue.createCommentVNode(" 签到日历 "),
- vue.createElementVNode("view", { class: "content-box calendar" }, [
- vue.createElementVNode("view", { class: "sign-everyday ss-flex ss-col-center ss-row-between ss-p-x-30" }, [
- vue.createElementVNode(
- "text",
- { class: "sign-everyday-title" },
- vue.toDisplayString($setup.t("sign.check_in")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "sign-num-box" }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.t("sign.consecutive_check_ins")) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "sign-num" },
- vue.toDisplayString($setup.state.continue_days),
- 1
- /* TEXT */
- ),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.t("sign.days")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(" 切换年月 "),
- vue.createElementVNode("view", { class: "bar ss-flex ss-col-center ss-row-center" }, [
- vue.createElementVNode("view", {
- class: "previous",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.handleCalendar(0))
- }, [
- vue.createElementVNode("text", { class: "cicon-back" })
- ]),
- vue.createElementVNode(
- "view",
- { class: "date ss-m-x-20" },
- vue.toDisplayString($setup.t("sign.month_year", { year: $setup.state.cur_year || "--", month: $setup.state.cur_month || "--" })),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", {
- class: "next",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.handleCalendar(1))
- }, [
- vue.createElementVNode("text", { class: "cicon-forward" })
- ])
- ]),
- vue.createCommentVNode(" 显示星期 "),
- vue.createElementVNode("view", { class: "week ss-flex" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.weeks_ch, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "week-item ss-flex ss-row-center",
- key: index2
- },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createCommentVNode(" 日历表 "),
- vue.createElementVNode("view", { class: "myDateTable" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.data.days, (item, j2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: j2,
- class: "dateCell ss-flex ss-row-center ss-col-center"
- }, [
- vue.createCommentVNode(" 空格 "),
- vue.createElementVNode("view", { class: "ss-flex ss-row-center ss-col-center" }, [
- vue.createElementVNode("text", { decode: true }, " ")
- ]),
- vue.createElementVNode("view", null, [
- vue.createCommentVNode(" 已签到日期 "),
- item.isSign ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "is-sign ss-flex ss-row-center"
- }, [
- vue.createElementVNode(
- "view",
- { class: "is-sign-num" },
- vue.toDisplayString(item.day < 10 ? "0" + item.day : item.day),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("image", {
- class: "is-sign-image",
- src: $setup.sheep.$url.static("/static/images/correct.png")
- }, null, 8, ["src"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 未签到日期 "),
- vue.createCommentVNode(' <view class="is-sign ss-flex ss-row-center" v-if="item.isReplenish == 1"\r\n @tap="onShowRetroactive(item.date)"> '),
- item.isReplenish == 1 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "is-sign ss-flex ss-row-center"
- }, [
- vue.createElementVNode(
- "view",
- { class: "cell-num" },
- vue.toDisplayString(item.day < 10 ? "0" + item.day : item.day),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "cicon-title" })
- ])) : vue.createCommentVNode("v-if", true),
- item.isReplenish == 0 && !item.isSign ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "is-sign ss-flex ss-row-center"
- }, [
- vue.createElementVNode(
- "view",
- { class: "cell-num" },
- vue.toDisplayString(item.day < 10 ? "0" + item.day : item.day),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createCommentVNode(" 签到按钮 "),
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-row-center sign-box ss-m-y-40" }, [
- $setup.state.isSign === 0 ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button sign-btn",
- onClick: $setup.onSign
- },
- vue.toDisplayString($setup.t("sign.check_in")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.state.isSign === 1 ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-reset-button already-btn",
- disabled: ""
- },
- vue.toDisplayString($setup.t("sign.already_checked_in")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ]),
- vue.createElementVNode("view", { class: "bg-white ss-m-t-16 ss-p-t-30 ss-p-b-60 ss-p-x-40" }, [
- vue.createElementVNode(
- "view",
- { class: "activity-title ss-m-b-30" },
- vue.toDisplayString($setup.t("sign.check_in_description")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "activity-des" }, [
- vue.createTextVNode(
- " 1." + vue.toDisplayString($setup.t("sign.daily_check_in_fixed", { social: $setup.state.data.signInSocialStatus })) + " ",
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(` <text v-if="state.data.rules.is_inc == '1'">\r
- ,次日递增奖励 {{ state.data.rules.inc_num }} 身价,直到\r
- {{ state.data.rules.until_day }} 天之后不再增加\r
- </text> `)
- ]),
- vue.createCommentVNode(' <view class="activity-des" v-if="state.data.rules.discounts?.length > 0">\r\n 2、<text class="" v-for="i in state.data.rules.discounts" :key="i">\r\n 连续签到 {{ i.full }} 天,奖励 {{ i.value }} 身价;\r\n </text>\r\n </view> '),
- vue.createCommentVNode(` <view class="activity-des" v-if="state.data.rules.is_replenish == '1'">\r
- {{ state.data.rules.discounts?.length > 0 ? '3' : '2' }}、用户在\r
- {{ state.data.rules.replenish_limit }} 天内,可补签\r
- {{ state.data.rules.replenish_days }} 天,每次补签消耗\r
- {{ state.data.rules.replenish_num }}身价\r
- </view> `)
- ])
- ])) : !$setup.state.data && !$setup.state.loading ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 2,
- icon: "/static/data-empty.png",
- text: $setup.t("sign.check_in_not_started")
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_su_popup, {
- show: $setup.state.showModel,
- type: "center",
- round: "10",
- isMaskClick: false
- }, {
- default: vue.withCtx(() => {
- var _a2, _b2;
- return [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- vue.createElementVNode("view", { class: "ss-m-t-56 ss-flex-col ss-col-center" }, [
- vue.createElementVNode("text", { class: "cicon-check-round" }),
- vue.createElementVNode(
- "view",
- { class: "score-title" },
- vue.toDisplayString($setup.t("sign.congratulations_on_check_in")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "model-title ss-flex ss-col-center ss-m-t-22 ss-m-b-30" },
- vue.toDisplayString($setup.t("sign.daily_check_in_reward", { social: $setup.state.signin.social })),
- 1
- /* TEXT */
- ),
- ((_a2 = $setup.state) == null ? void 0 : _a2.upgradeOrNot) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "model-title ss-flex ss-col-center ss-m-b-30"
- },
- vue.toDisplayString($setup.t("sign.level_upgraded", { level: (_b2 = $setup.state) == null ? void 0 : _b2.socialStatusName })),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", { class: "model-bg ss-flex-col ss-col-center ss-row-right" }, [
- vue.createCommentVNode(' <view class="title ss-m-b-64">签到成功</view> '),
- vue.createElementVNode("view", { class: "ss-m-b-40" }, [
- vue.createElementVNode(
- "button",
- {
- class: "ss-reset-button confirm-btn",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.onConfirm())
- },
- vue.toDisplayString($setup.t("common.confirm")),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["show"]),
- vue.createCommentVNode('<su-popup :show="state.showRetroactive" type="center" round="10" :isMaskClick="false">\r\n <view class="model-box ss-flex-col">\r\n <view class="ss-m-t-56 ss-flex-col ss-col-center">\r\n <text class="cicon-check-round"></text>\r\n <view class="score-title">消耗{{ state.data?.rules.replenish_num }}身价</view>\r\n <view class="model-title ss-flex ss-col-center ss-m-t-22 ss-m-b-30">\r\n 已连续打卡{{ state.continue_days }}天\r\n </view>\r\n </view>\r\n <view class="model-bg ss-flex-col ss-col-center ss-row-right">\r\n <view class="title ss-m-b-64">确认补签</view>\r\n <view class="ss-m-b-40 ss-flex">\r\n <button class="ss-reset-button cancel-btn" @tap="state.showRetroactive = false">取消</button>\r\n <button class="ss-reset-button confirm-btn" @tap="onRetroactive">确认</button>\r\n </view>\r\n </view> \r\n </view>\r\n </su-popup>')
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesAppSign = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$z], ["__scopeId", "data-v-964858d2"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/app/sign.vue"]]);
- const _sfc_main$z = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- uni.hideTabBar();
- const template = vue.ref({});
- const shopName = vue.ref("");
- const state = vue.reactive({
- shopName: "",
- merchantId: 0,
- shopId: 0
- });
- const tabbar = vue.ref({
- "theme": "red",
- "style": {
- "bgType": "color",
- "bgColor": "#323b4e",
- "color": "#e6e6e5",
- "activeColor": "#1fa380"
- },
- "items": [
- {
- "text": t$6("common.shop_index"),
- "url": "/pages/shop/index",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/index.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/index-active.svg")
- },
- {
- "text": t$6("common.shop_category"),
- "url": "/pages/shop/category",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/activity.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/activity-active.svg")
- },
- {
- "text": t$6("common.all_product"),
- "url": "/pages/shop/allproduct",
- "iconUrl": sheep$1.$url.static("/static/firstIndex/video.svg"),
- "activeIconUrl": sheep$1.$url.static("/static/firstIndex/video-active.svg")
- }
- ]
- });
- onLoad(async (options2) => {
- if (options2.templateId) {
- sheep$1.$store("app").init(options2.templateId);
- }
- if (options2.spm) {
- $share.decryptSpm(options2.spm);
- }
- if (options2.page) {
- sheep$1.$router.go(decodeURIComponent(options2.page));
- }
- state.merchantId = options2.merchantId;
- state.shopId = options2.shopId;
- state.shopName = options2.shopName;
- tabbar.value.items = tabbar.value.items.map((item) => {
- item.url = `${item.url}?shopId=${state.shopId}&shopName=${encodeURIComponent(state.shopName)}&merchantId=${state.merchantId}`;
- return item;
- });
- const { code: code2, data } = await PageApi.getPage({ shopId: options2.shopId, merchantId: options2.merchantId });
- template.value = data.property;
- });
- onPageScroll(() => {
- });
- const __returned__ = { template, shopName, state, tabbar, computed: vue.computed, reactive: vue.reactive, ref: vue.ref, get onLoad() {
- return onLoad;
- }, get onPageScroll() {
- return onPageScroll;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get sheep() {
- return sheep$1;
- }, get $share() {
- return $share;
- }, get PageApi() {
- return PageApi;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_navbar = resolveEasycom(vue.resolveDynamicComponent("su-navbar"), __easycom_0$o);
- const _component_s_block_item = resolveEasycom(vue.resolveDynamicComponent("s-block-item"), __easycom_1$3);
- const _component_s_block = resolveEasycom(vue.resolveDynamicComponent("s-block"), __easycom_2$3);
- const _component_s_tabbar = resolveEasycom(vue.resolveDynamicComponent("s-tabbar"), __easycom_3$7);
- return $setup.template ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createVNode(_component_su_navbar, {
- title: $setup.state.shopName,
- statusBar: "",
- color: _ctx.color,
- tools: _ctx.tools,
- opacityBgUi: _ctx.opacityBgUi,
- onSearch: _cache[0] || (_cache[0] = (e2) => _ctx.emits("search", e2)),
- defaultSearch: _ctx.defaultSearch
- }, null, 8, ["title", "color", "tools", "opacityBgUi", "defaultSearch"]),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.template.components, (item, index2) => {
- return vue.openBlock(), vue.createBlock(_component_s_block, {
- key: index2,
- styles: item.property.style
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_block_item, {
- type: item.id,
- data: item.property,
- styles: item.property.style
- }, null, 8, ["type", "data", "styles"])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["styles"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createVNode(_component_s_tabbar, {
- path: "/pages/shop/index",
- tabbar: $setup.tabbar
- }, null, 8, ["tabbar"])
- ])) : vue.createCommentVNode("v-if", true);
- }
- const PagesShopIndex = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$y], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/shop/index.vue"]]);
- const _sfc_main$y = {
- __name: "category",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- style: "second_one",
- // first_one(一级 - 样式一), first_two(二级 - 样式二), second_one(二级)
- categoryList: [],
- // 商品分类树
- activeMenu: 0,
- // 选中的一级菜单,在 categoryList 的下标
- pagination: {
- // 商品分页
- list: [],
- // 商品列表
- total: [],
- // 商品总数
- pageNo: 1,
- pageSize: 6
- },
- loadStatus: ""
- });
- const {
- safeArea
- } = sheep$1.$platform.device;
- const pageHeight = vue.computed(() => safeArea.height - 44 - 50);
- async function getList() {
- const {
- code: code2,
- data
- } = await CategoryApi.getCategoryList();
- if (code2 !== 0) {
- return;
- }
- state.categoryList = handleTree(data);
- }
- const onMenu = (val) => {
- state.activeMenu = val;
- if (state.style === "first_one" || state.style === "first_two") {
- state.pagination.pageNo = 1;
- state.pagination.list = [];
- state.pagination.total = 0;
- getGoodsList();
- }
- };
- async function getGoodsList() {
- state.loadStatus = "loading";
- const res = await SpuApi.getSpuPage({
- categoryId: state.categoryList[state.activeMenu].id,
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (res.code !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, res.data.list);
- state.pagination.total = res.data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getGoodsList();
- }
- onLoad(async () => {
- await getList();
- if (state.style === "first_one" || state.style === "first_two") {
- onMenu(0);
- }
- });
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { state, safeArea, pageHeight, getList, onMenu, getGoodsList, loadMore, get sheep() {
- return sheep$1;
- }, get CategoryApi() {
- return CategoryApi;
- }, get SpuApi() {
- return SpuApi;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get _() {
- return _$1;
- }, get handleTree() {
- return handleTree;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_first_one = vue.resolveComponent("first-one");
- const _component_first_two = vue.resolveComponent("first-two");
- const _component_second_one = vue.resolveComponent("second-one");
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("common.category"),
- tabbar: "/pages/index/category",
- bgStyle: { color: "#fff" }
- }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createElementVNode("view", { class: "s-category" }, [
- vue.createElementVNode(
- "view",
- {
- class: "three-level-wrap ss-flex ss-col-top",
- style: vue.normalizeStyle([{ height: $setup.pageHeight + "px" }])
- },
- [
- vue.createCommentVNode(" 商品分类(左) "),
- vue.createElementVNode(
- "scroll-view",
- {
- class: "side-menu-wrap",
- "scroll-y": "",
- style: vue.normalizeStyle([{ height: $setup.pageHeight + "px" }])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.categoryList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["menu-item ss-flex", [{ "menu-item-active": index2 === $setup.state.activeMenu }]]),
- key: item.id,
- onClick: ($event) => $setup.onMenu(index2)
- }, [
- vue.createElementVNode(
- "view",
- { class: "menu-title ss-line-1" },
- vue.toDisplayString(item.name),
- 1
- /* TEXT */
- )
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 商品分类(右) "),
- ((_a2 = $setup.state.categoryList) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createElementBlock(
- "scroll-view",
- {
- key: 0,
- class: "goods-list-box",
- "scroll-y": "",
- style: vue.normalizeStyle([{ height: $setup.pageHeight + "px" }])
- },
- [
- $setup.state.categoryList[$setup.state.activeMenu].picUrl ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "banner-img",
- src: $setup.sheep.$url.cdn($setup.state.categoryList[$setup.state.activeMenu].picUrl),
- mode: "widthFix"
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- $setup.state.style === "first_one" ? (vue.openBlock(), vue.createBlock(_component_first_one, {
- key: 1,
- pagination: $setup.state.pagination
- }, null, 8, ["pagination"])) : vue.createCommentVNode("v-if", true),
- $setup.state.style === "first_two" ? (vue.openBlock(), vue.createBlock(_component_first_two, {
- key: 2,
- pagination: $setup.state.pagination
- }, null, 8, ["pagination"])) : vue.createCommentVNode("v-if", true),
- $setup.state.style === "second_one" ? (vue.openBlock(), vue.createBlock(_component_second_one, {
- key: 3,
- data: $setup.state.categoryList,
- activeMenu: $setup.state.activeMenu
- }, null, 8, ["data", "activeMenu"])) : vue.createCommentVNode("v-if", true),
- ($setup.state.style === "first_one" || $setup.state.style === "first_two") && $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 4,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "点击查看更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesShopCategory = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$x], ["__scopeId", "data-v-cb6343c4"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/shop/category.vue"]]);
- const _sfc_main$x = {
- __name: "allproduct",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- style: "second_one",
- // first_one(一级 - 样式一), first_two(二级 - 样式二), second_one(二级)
- categoryList: [],
- // 商品分类树
- activeMenu: 0,
- // 选中的一级菜单,在 categoryList 的下标
- pagination: {
- // 商品分页
- list: [],
- // 商品列表
- total: [],
- // 商品总数
- pageNo: 1,
- pageSize: 6
- },
- loadStatus: ""
- });
- const {
- safeArea
- } = sheep$1.$platform.device;
- const pageHeight = vue.computed(() => safeArea.height - 44 - 50);
- async function getList() {
- const {
- code: code2,
- data
- } = await CategoryApi.getCategoryList();
- if (code2 !== 0) {
- return;
- }
- state.categoryList = handleTree(data);
- }
- const onMenu = (val) => {
- state.activeMenu = val;
- if (state.style === "first_one" || state.style === "first_two") {
- state.pagination.pageNo = 1;
- state.pagination.list = [];
- state.pagination.total = 0;
- getGoodsList();
- }
- };
- async function getGoodsList() {
- state.loadStatus = "loading";
- const res = await SpuApi.getSpuPage({
- categoryId: state.categoryList[state.activeMenu].id,
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (res.code !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, res.data.list);
- state.pagination.total = res.data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getGoodsList();
- }
- onLoad(async () => {
- await getList();
- if (state.style === "first_one" || state.style === "first_two") {
- onMenu(0);
- }
- });
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { state, safeArea, pageHeight, getList, onMenu, getGoodsList, loadMore, get sheep() {
- return sheep$1;
- }, get CategoryApi() {
- return CategoryApi;
- }, get SpuApi() {
- return SpuApi;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get _() {
- return _$1;
- }, get handleTree() {
- return handleTree;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_first_one = vue.resolveComponent("first-one");
- const _component_first_two = vue.resolveComponent("first-two");
- const _component_second_one = vue.resolveComponent("second-one");
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: _ctx.$t("common.category"),
- tabbar: "/pages/index/category",
- bgStyle: { color: "#fff" }
- }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createElementVNode("view", { class: "s-category" }, [
- vue.createElementVNode(
- "view",
- {
- class: "three-level-wrap ss-flex ss-col-top",
- style: vue.normalizeStyle([{ height: $setup.pageHeight + "px" }])
- },
- [
- vue.createCommentVNode(" 商品分类(左) "),
- vue.createElementVNode(
- "scroll-view",
- {
- class: "side-menu-wrap",
- "scroll-y": "",
- style: vue.normalizeStyle([{ height: $setup.pageHeight + "px" }])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.categoryList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["menu-item ss-flex", [{ "menu-item-active": index2 === $setup.state.activeMenu }]]),
- key: item.id,
- onClick: ($event) => $setup.onMenu(index2)
- }, [
- vue.createElementVNode(
- "view",
- { class: "menu-title ss-line-1" },
- vue.toDisplayString(item.name),
- 1
- /* TEXT */
- )
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 商品分类(右) "),
- ((_a2 = $setup.state.categoryList) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createElementBlock(
- "scroll-view",
- {
- key: 0,
- class: "goods-list-box",
- "scroll-y": "",
- style: vue.normalizeStyle([{ height: $setup.pageHeight + "px" }])
- },
- [
- $setup.state.categoryList[$setup.state.activeMenu].picUrl ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "banner-img",
- src: $setup.sheep.$url.cdn($setup.state.categoryList[$setup.state.activeMenu].picUrl),
- mode: "widthFix"
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- $setup.state.style === "first_one" ? (vue.openBlock(), vue.createBlock(_component_first_one, {
- key: 1,
- pagination: $setup.state.pagination
- }, null, 8, ["pagination"])) : vue.createCommentVNode("v-if", true),
- $setup.state.style === "first_two" ? (vue.openBlock(), vue.createBlock(_component_first_two, {
- key: 2,
- pagination: $setup.state.pagination
- }, null, 8, ["pagination"])) : vue.createCommentVNode("v-if", true),
- $setup.state.style === "second_one" ? (vue.openBlock(), vue.createBlock(_component_second_one, {
- key: 3,
- data: $setup.state.categoryList,
- activeMenu: $setup.state.activeMenu
- }, null, 8, ["data", "activeMenu"])) : vue.createCommentVNode("v-if", true),
- ($setup.state.style === "first_one" || $setup.state.style === "first_two") && $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 4,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "点击查看更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesShopAllproduct = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$w], ["__scopeId", "data-v-d2ae9314"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/shop/allproduct.vue"]]);
- const _imports_0$2 = "/static/zxlogo.png";
- const _sfc_main$w = {
- __name: "setting",
- setup(__props, { expose: __expose }) {
- __expose();
- const appInfo = vue.computed(() => sheep$1.$store("app").info);
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- const storageSize = uni.getStorageInfoSync().currentSize + "Kb";
- const state = vue.reactive({
- showModal: false
- });
- function onCheckUpdate() {
- sheep$1.$platform.checkUpdate();
- }
- function onLogoff() {
- uni.showModal({
- title: t$6("setting.prompt"),
- content: t$6("common.confirm_logout"),
- success: async function(res) {
- if (!res.confirm) {
- return;
- }
- const {
- code: code2
- } = await AuthUtil.logout();
- if (code2 !== 0) {
- return;
- }
- sheep$1.$store("user").logout();
- sheep$1.$router.go("/pages/index/user");
- }
- });
- }
- const __returned__ = { appInfo, isLogin, storageSize, state, onCheckUpdate, onLogoff, get sheep() {
- return sheep$1;
- }, computed: vue.computed, reactive: vue.reactive, get AuthUtil() {
- return AuthUtil;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_list_item = resolveEasycom(vue.resolveDynamicComponent("uni-list-item"), __easycom_0$i);
- const _component_uni_list = resolveEasycom(vue.resolveDynamicComponent("uni-list"), __easycom_1$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "set-wrap",
- title: $setup.t("common.system"),
- bgStyle: { color: "#fff" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "header-box ss-flex-col ss-row-center ss-col-center" }, [
- vue.createElementVNode("image", {
- class: "logo-img ss-m-b-46",
- src: _imports_0$2,
- mode: "aspectFit"
- }),
- vue.createElementVNode(
- "view",
- { class: "name ss-m-b-24" },
- vue.toDisplayString($setup.appInfo.name),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "container-list" }, [
- vue.createVNode(_component_uni_list, { border: false }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_list_item, {
- title: $setup.t("common.current_version"),
- rightText: $setup.appInfo.version,
- showArrow: "",
- clickable: "",
- border: false,
- class: "list-border",
- onClick: $setup.onCheckUpdate
- }, null, 8, ["title", "rightText"]),
- vue.createVNode(_component_uni_list_item, {
- title: $setup.t("common.local_cache"),
- rightText: $setup.storageSize,
- showArrow: "",
- border: false,
- class: "list-border"
- }, null, 8, ["title"]),
- vue.createVNode(_component_uni_list_item, {
- title: $setup.t("common.about_us"),
- showArrow: "",
- clickable: "",
- border: false,
- class: "list-border",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/public/richtext", {
- title: "关于我们"
- }))
- }, null, 8, ["title"]),
- vue.createCommentVNode(" 为了过审 只有 iOS-App 有注销账号功能 "),
- $setup.isLogin && $setup.sheep.$platform.os === "ios" && $setup.sheep.$platform.name === "App" ? (vue.openBlock(), vue.createBlock(_component_uni_list_item, {
- key: 0,
- title: $setup.t("common.logout_account"),
- rightText: "",
- showArrow: "",
- clickable: "",
- border: false,
- class: "list-border",
- onClick: $setup.onLogoff
- }, null, 8, ["title"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- vue.createElementVNode("view", { class: "set-footer ss-flex-col ss-row-center ss-col-center" }, [
- vue.createElementVNode("view", { class: "agreement-box ss-flex ss-col-center ss-m-b-40" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center ss-m-b-10" }, [
- vue.createElementVNode(
- "view",
- {
- class: "tcp-text",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.go("/pages/public/richtext", {
- title: "用户协议"
- }))
- },
- vue.toDisplayString($setup.t("account.user_agreement")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "agreement-text" },
- " " + vue.toDisplayString($setup.t("account.and")) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "tcp-text",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.sheep.$router.go("/pages/public/richtext", {
- title: "隐私协议"
- }))
- },
- vue.toDisplayString($setup.t("account.privacy_policy")),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(' <view class="copyright-text ss-m-b-10">{{ appInfo.copyright }}</view> '),
- vue.createCommentVNode(' <view class="copyright-text">{{ appInfo.copytime }}</view> ')
- ]),
- vue.createCommentVNode(' <su-fixed bottom placeholder>\r\n <view class="ss-p-x-20 ss-p-b-40">\r\n <button class="loginout-btn ss-reset-button ui-BG-Main ui-Shadow-Main" @tap="onLogout" v-if="isLogin">\r\n 退出登录\r\n </button>\r\n </view>\r\n </su-fixed> ')
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesPublicSetting = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$v], ["__scopeId", "data-v-5fed78fb"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/public/setting.vue"]]);
- const _sfc_main$v = {
- name: "uniCollapseItem",
- props: {
- // 列表标题
- title: {
- type: String,
- default: ""
- },
- name: {
- type: [Number, String],
- default: ""
- },
- // 是否禁用
- disabled: {
- type: Boolean,
- default: false
- },
- // 是否显示动画,app 端默认不开启动画,卡顿严重
- showAnimation: {
- type: Boolean,
- default: false
- },
- // 是否展开
- open: {
- type: Boolean,
- default: false
- },
- // 缩略图
- thumb: {
- type: String,
- default: ""
- },
- // 标题分隔线显示类型
- titleBorder: {
- type: String,
- default: "auto"
- },
- border: {
- type: Boolean,
- default: true
- },
- showArrow: {
- type: Boolean,
- default: true
- }
- },
- data() {
- const elId = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
- return {
- isOpen: false,
- isheight: null,
- height: 0,
- elId,
- nameSync: 0
- };
- },
- watch: {
- open(val) {
- this.isOpen = val;
- this.onClick(val, "init");
- }
- },
- updated(e2) {
- this.$nextTick(() => {
- this.init(true);
- });
- },
- created() {
- this.collapse = this.getCollapse();
- this.oldHeight = 0;
- this.onClick(this.open, "init");
- },
- // TODO vue3
- unmounted() {
- this.__isUnmounted = true;
- this.uninstall();
- },
- mounted() {
- if (!this.collapse)
- return;
- if (this.name !== "") {
- this.nameSync = this.name;
- } else {
- this.nameSync = this.collapse.childrens.length + "";
- }
- if (this.collapse.names.indexOf(this.nameSync) === -1) {
- this.collapse.names.push(this.nameSync);
- } else {
- formatAppLog("warn", "at uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue:154", `name 值 ${this.nameSync} 重复`);
- }
- if (this.collapse.childrens.indexOf(this) === -1) {
- this.collapse.childrens.push(this);
- }
- this.init();
- },
- methods: {
- init(type) {
- this.getCollapseHeight(type);
- },
- uninstall() {
- if (this.collapse) {
- this.collapse.childrens.forEach((item, index2) => {
- if (item === this) {
- this.collapse.childrens.splice(index2, 1);
- }
- });
- this.collapse.names.forEach((item, index2) => {
- if (item === this.nameSync) {
- this.collapse.names.splice(index2, 1);
- }
- });
- }
- },
- onClick(isOpen, type) {
- if (this.disabled)
- return;
- this.isOpen = isOpen;
- if (this.isOpen && this.collapse) {
- this.collapse.setAccordion(this);
- }
- if (type !== "init") {
- this.collapse.onChange(isOpen, this);
- }
- },
- getCollapseHeight(type, index2 = 0) {
- const views = uni.createSelectorQuery().in(this);
- views.select(`#${this.elId}`).fields({
- size: true
- }, (data) => {
- if (index2 >= 10)
- return;
- if (!data) {
- index2++;
- this.getCollapseHeight(false, index2);
- return;
- }
- this.height = data.height;
- this.isheight = true;
- if (type)
- return;
- this.onClick(this.isOpen, "init");
- }).exec();
- },
- getNvueHwight(type) {
- dom.getComponentRect(this.$refs["collapse--hook"], (option) => {
- if (option && option.result && option.size) {
- this.height = option.size.height;
- this.isheight = true;
- if (type)
- return;
- this.onClick(this.open, "init");
- }
- });
- },
- /**
- * 获取父元素实例
- */
- getCollapse(name2 = "uniCollapse") {
- let parent2 = this.$parent;
- let parentName = parent2.$options.name;
- while (parentName !== name2) {
- parent2 = parent2.$parent;
- if (!parent2)
- return false;
- parentName = parent2.$options.name;
- }
- return parent2;
- }
- }
- };
- function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-collapse-item" }, [
- vue.createCommentVNode(" onClick(!isOpen) "),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[0] || (_cache[0] = ($event) => $options.onClick(!$data.isOpen)),
- class: vue.normalizeClass(["uni-collapse-item__title", { "is-open": $data.isOpen && $props.titleBorder === "auto", "uni-collapse-item-border": $props.titleBorder !== "none" }])
- },
- [
- vue.createElementVNode("view", { class: "uni-collapse-item__title-wrap" }, [
- vue.renderSlot(_ctx.$slots, "title", {}, () => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-collapse-item__title-box", { "is-disabled": $props.disabled }])
- },
- [
- $props.thumb ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: $props.thumb,
- class: "uni-collapse-item__title-img"
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- { class: "uni-collapse-item__title-text" },
- vue.toDisplayString($props.title),
- 1
- /* TEXT */
- )
- ],
- 2
- /* CLASS */
- )
- ], true)
- ]),
- $props.showArrow ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass([{ "uni-collapse-item__title-arrow-active": $data.isOpen, "uni-collapse-item--animation": $props.showAnimation === true }, "uni-collapse-item__title-arrow"])
- },
- [
- vue.createVNode(_component_uni_icons, {
- color: $props.disabled ? "#ddd" : "#bbb",
- size: "14",
- type: "bottom"
- }, null, 8, ["color"])
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uni-collapse-item__wrap", { "is--transition": $props.showAnimation }]),
- style: vue.normalizeStyle({ height: ($data.isOpen ? $data.height : 0) + "px" })
- },
- [
- vue.createElementVNode("view", {
- id: $data.elId,
- ref: "collapse--hook",
- class: vue.normalizeClass(["uni-collapse-item__wrap-content", { open: $data.isheight, "uni-collapse-item--border": $props.border && $data.isOpen }])
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ], 10, ["id"])
- ],
- 6
- /* CLASS, STYLE */
- )
- ]);
- }
- const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$u], ["__scopeId", "data-v-3d2dde9f"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue"]]);
- const _sfc_main$u = {
- name: "uniCollapse",
- emits: ["change", "activeItem", "input", "update:modelValue"],
- props: {
- value: {
- type: [String, Array],
- default: ""
- },
- modelValue: {
- type: [String, Array],
- default: ""
- },
- accordion: {
- // 是否开启手风琴效果
- type: [Boolean, String],
- default: false
- }
- },
- data() {
- return {};
- },
- computed: {
- // TODO 兼容 vue2 和 vue3
- dataValue() {
- let value = typeof this.value === "string" && this.value === "" || Array.isArray(this.value) && this.value.length === 0;
- let modelValue = typeof this.modelValue === "string" && this.modelValue === "" || Array.isArray(this.modelValue) && this.modelValue.length === 0;
- if (value) {
- return this.modelValue;
- }
- if (modelValue) {
- return this.value;
- }
- return this.value;
- }
- },
- watch: {
- dataValue(val) {
- this.setOpen(val);
- }
- },
- created() {
- this.childrens = [];
- this.names = [];
- },
- mounted() {
- this.$nextTick(() => {
- this.setOpen(this.dataValue);
- });
- },
- methods: {
- setOpen(val) {
- let str = typeof val === "string";
- let arr = Array.isArray(val);
- this.childrens.forEach((vm, index2) => {
- if (str) {
- if (val === vm.nameSync) {
- if (!this.accordion) {
- formatAppLog("warn", "at uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue:75", "accordion 属性为 false ,v-model 类型应该为 array");
- return;
- }
- vm.isOpen = true;
- }
- }
- if (arr) {
- val.forEach((v2) => {
- if (v2 === vm.nameSync) {
- if (this.accordion) {
- formatAppLog("warn", "at uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue:85", "accordion 属性为 true ,v-model 类型应该为 string");
- return;
- }
- vm.isOpen = true;
- }
- });
- }
- });
- this.emit(val);
- },
- setAccordion(self2) {
- if (!this.accordion)
- return;
- this.childrens.forEach((vm, index2) => {
- if (self2 !== vm) {
- vm.isOpen = false;
- }
- });
- },
- resize() {
- this.childrens.forEach((vm, index2) => {
- vm.getCollapseHeight();
- });
- },
- onChange(isOpen, self2) {
- let activeItem = [];
- if (this.accordion) {
- activeItem = isOpen ? self2.nameSync : "";
- } else {
- this.childrens.forEach((vm, index2) => {
- if (vm.isOpen) {
- activeItem.push(vm.nameSync);
- }
- });
- }
- this.$emit("change", activeItem);
- this.emit(activeItem);
- },
- emit(val) {
- this.$emit("input", val);
- this.$emit("update:modelValue", val);
- }
- }
- };
- function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-collapse" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ]);
- }
- const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t], ["__scopeId", "data-v-3f050360"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue"]]);
- const _sfc_main$t = {
- __name: "faq",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- list: [],
- loading: true
- });
- async function getFaqList() {
- const { error: error2, data } = await sheep$1.$api.data.faq();
- if (error2 === 0) {
- state.list = data;
- state.loading = false;
- }
- }
- onLoad(() => {
- {
- sheep$1.$router.go("/pages/public/richtext", {
- title: "常见问题"
- });
- return;
- }
- });
- const __returned__ = { state, getFaqList, get onLoad() {
- return onLoad;
- }, reactive: vue.reactive, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_collapse_item = resolveEasycom(vue.resolveDynamicComponent("uni-collapse-item"), __easycom_0$2);
- const _component_uni_collapse = resolveEasycom(vue.resolveDynamicComponent("uni-collapse"), __easycom_1);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "set-wrap",
- title: "常见问题",
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_collapse, null, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.list, (item, index2) => {
- return vue.openBlock(), vue.createBlock(
- _component_uni_collapse_item,
- { key: item },
- {
- title: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center header" }, [
- vue.createElementVNode("view", { class: "ss-m-l-20 ss-m-r-20 icon" }, [
- vue.createElementVNode("view", { class: "rectangle" }, [
- vue.createElementVNode(
- "view",
- { class: "num ss-flex ss-row-center ss-col-center" },
- vue.toDisplayString(index2 + 1 < 10 ? "0" + (index2 + 1) : index2 + 1),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "triangle" })
- ]),
- vue.createElementVNode(
- "view",
- { class: "title ss-m-t-36 ss-m-b-36" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- )
- ])
- ]),
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "content ss-p-l-78 ss-p-r-40 ss-p-b-50 ss-p-t-20" }, [
- vue.createElementVNode(
- "text",
- { class: "text" },
- vue.toDisplayString(item.content),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.list.length === 0 && !$setup.state.loading ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- text: "暂无常见问题",
- icon: "/static/collect-empty.png"
- })) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesPublicFaq = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s], ["__scopeId", "data-v-b3a79332"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/public/faq.vue"]]);
- const _sfc_main$s = {
- __name: "error",
- setup(__props, { expose: __expose }) {
- __expose();
- const errCode = vue.ref("");
- const errMsg = vue.ref("");
- onLoad((options2) => {
- errCode.value = options2.errCode;
- errMsg.value = options2.errMsg;
- });
- async function onReconnect() {
- uni.reLaunch({
- url: "/pages/index/index"
- });
- await ShoproInit();
- }
- const __returned__ = { errCode, errMsg, onReconnect, get onLoad() {
- return onLoad;
- }, ref: vue.ref, get ShoproInit() {
- return ShoproInit;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- return vue.openBlock(), vue.createElementBlock("view", { class: "error-page" }, [
- $setup.errCode === "NetworkError" ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/internet-empty.png",
- text: "网络连接失败",
- showAction: "",
- actionText: "重新连接",
- onClickAction: $setup.onReconnect,
- buttonColor: "#132b85"
- })) : $setup.errCode === "TemplateError" ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- icon: "/static/internet-empty.png",
- text: "未找到模板",
- showAction: "",
- actionText: "重新加载",
- onClickAction: $setup.onReconnect,
- buttonColor: "#132b85"
- })) : $setup.errCode !== "" ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 2,
- icon: "/static/internet-empty.png",
- text: $setup.errMsg,
- showAction: "",
- actionText: "重新加载",
- onClickAction: $setup.onReconnect,
- buttonColor: "#132b85"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const PagesPublicError = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r], ["__scopeId", "data-v-8e014bcf"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/public/error.vue"]]);
- const _sfc_main$r = {
- __name: "webview",
- setup(__props, { expose: __expose }) {
- __expose();
- const url2 = vue.ref("");
- onLoad((options2) => {
- url2.value = decodeURIComponent(options2.url);
- });
- const __returned__ = { url: url2, get onLoad() {
- return onLoad;
- }, ref: vue.ref };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createElementVNode("web-view", { src: $setup.url }, null, 8, ["src"])
- ]);
- }
- const PagesPublicWebview = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/public/webview.vue"]]);
- const dataPicker = {
- props: {
- localdata: {
- type: [Array, Object],
- default() {
- return [];
- }
- },
- spaceInfo: {
- type: Object,
- default() {
- return {};
- }
- },
- collection: {
- type: String,
- default: ""
- },
- action: {
- type: String,
- default: ""
- },
- field: {
- type: String,
- default: ""
- },
- orderby: {
- type: String,
- default: ""
- },
- where: {
- type: [String, Object],
- default: ""
- },
- pageData: {
- type: String,
- default: "add"
- },
- pageCurrent: {
- type: Number,
- default: 1
- },
- pageSize: {
- type: Number,
- default: 20
- },
- getcount: {
- type: [Boolean, String],
- default: false
- },
- getone: {
- type: [Boolean, String],
- default: false
- },
- gettree: {
- type: [Boolean, String],
- default: false
- },
- manual: {
- type: Boolean,
- default: false
- },
- value: {
- type: [Array, String, Number],
- default() {
- return [];
- }
- },
- modelValue: {
- type: [Array, String, Number],
- default() {
- return [];
- }
- },
- preload: {
- type: Boolean,
- default: false
- },
- stepSearh: {
- type: Boolean,
- default: true
- },
- selfField: {
- type: String,
- default: ""
- },
- parentField: {
- type: String,
- default: ""
- },
- multiple: {
- type: Boolean,
- default: false
- },
- map: {
- type: Object,
- default() {
- return {
- text: "text",
- value: "value"
- };
- }
- }
- },
- data() {
- return {
- loading: false,
- errorMessage: "",
- loadMore: {
- contentdown: "",
- contentrefresh: "",
- contentnomore: ""
- },
- dataList: [],
- selected: [],
- selectedIndex: 0,
- page: {
- current: this.pageCurrent,
- size: this.pageSize,
- count: 0
- }
- };
- },
- computed: {
- isLocaldata() {
- return !this.collection.length;
- },
- postField() {
- let fields = [this.field];
- if (this.parentField) {
- fields.push(`${this.parentField} as parent_value`);
- }
- return fields.join(",");
- },
- dataValue() {
- let isModelValue = Array.isArray(this.modelValue) ? this.modelValue.length > 0 : this.modelValue !== null || this.modelValue !== void 0;
- return isModelValue ? this.modelValue : this.value;
- },
- hasValue() {
- if (typeof this.dataValue === "number") {
- return true;
- }
- return this.dataValue != null && this.dataValue.length > 0;
- }
- },
- created() {
- this.$watch(() => {
- var al = [];
- [
- "pageCurrent",
- "pageSize",
- "spaceInfo",
- "value",
- "modelValue",
- "localdata",
- "collection",
- "action",
- "field",
- "orderby",
- "where",
- "getont",
- "getcount",
- "gettree"
- ].forEach((key) => {
- al.push(this[key]);
- });
- return al;
- }, (newValue, oldValue) => {
- for (let i2 = 2; i2 < newValue.length; i2++) {
- if (newValue[i2] != oldValue[i2]) {
- break;
- }
- }
- if (newValue[0] != oldValue[0]) {
- this.page.current = this.pageCurrent;
- }
- this.page.size = this.pageSize;
- this.onPropsChange();
- });
- this._treeData = [];
- },
- methods: {
- onPropsChange() {
- this._treeData = [];
- },
- getCommand(options2 = {}) {
- let db = Ys.database(this.spaceInfo);
- const action = options2.action || this.action;
- if (action) {
- db = db.action(action);
- }
- const collection = options2.collection || this.collection;
- db = db.collection(collection);
- const where = options2.where || this.where;
- if (!(!where || !Object.keys(where).length)) {
- db = db.where(where);
- }
- const field = options2.field || this.field;
- if (field) {
- db = db.field(field);
- }
- const orderby = options2.orderby || this.orderby;
- if (orderby) {
- db = db.orderBy(orderby);
- }
- const current = options2.pageCurrent !== void 0 ? options2.pageCurrent : this.page.current;
- const size = options2.pageSize !== void 0 ? options2.pageSize : this.page.size;
- const getCount = options2.getcount !== void 0 ? options2.getcount : this.getcount;
- const getTree = options2.gettree !== void 0 ? options2.gettree : this.gettree;
- const getOptions = {
- getCount,
- getTree
- };
- if (options2.getTreePath) {
- getOptions.getTreePath = options2.getTreePath;
- }
- db = db.skip(size * (current - 1)).limit(size).get(getOptions);
- return db;
- },
- getNodeData(callback) {
- if (this.loading) {
- return;
- }
- this.loading = true;
- this.getCommand({
- field: this.postField,
- where: this._pathWhere()
- }).then((res) => {
- this.loading = false;
- this.selected = res.result.data;
- callback && callback();
- }).catch((err) => {
- this.loading = false;
- this.errorMessage = err;
- });
- },
- getTreePath(callback) {
- if (this.loading) {
- return;
- }
- this.loading = true;
- this.getCommand({
- field: this.postField,
- getTreePath: {
- startWith: `${this.selfField}=='${this.dataValue}'`
- }
- }).then((res) => {
- this.loading = false;
- let treePath = [];
- this._extractTreePath(res.result.data, treePath);
- this.selected = treePath;
- callback && callback();
- }).catch((err) => {
- this.loading = false;
- this.errorMessage = err;
- });
- },
- loadData() {
- if (this.isLocaldata) {
- this._processLocalData();
- return;
- }
- if (this.dataValue != null) {
- this._loadNodeData((data) => {
- this._treeData = data;
- this._updateBindData();
- this._updateSelected();
- });
- return;
- }
- if (this.stepSearh) {
- this._loadNodeData((data) => {
- this._treeData = data;
- this._updateBindData();
- });
- } else {
- this._loadAllData((data) => {
- this._treeData = [];
- this._extractTree(data, this._treeData, null);
- this._updateBindData();
- });
- }
- },
- _loadAllData(callback) {
- if (this.loading) {
- return;
- }
- this.loading = true;
- this.getCommand({
- field: this.postField,
- gettree: true,
- startwith: `${this.selfField}=='${this.dataValue}'`
- }).then((res) => {
- this.loading = false;
- callback(res.result.data);
- this.onDataChange();
- }).catch((err) => {
- this.loading = false;
- this.errorMessage = err;
- });
- },
- _loadNodeData(callback, pw) {
- if (this.loading) {
- return;
- }
- this.loading = true;
- this.getCommand({
- field: this.postField,
- where: pw || this._postWhere(),
- pageSize: 500
- }).then((res) => {
- this.loading = false;
- callback(res.result.data);
- this.onDataChange();
- }).catch((err) => {
- this.loading = false;
- this.errorMessage = err;
- });
- },
- _pathWhere() {
- let result2 = [];
- let where_field = this._getParentNameByField();
- if (where_field) {
- result2.push(`${where_field} == '${this.dataValue}'`);
- }
- if (this.where) {
- return `(${this.where}) && (${result2.join(" || ")})`;
- }
- return result2.join(" || ");
- },
- _postWhere() {
- let result2 = [];
- let selected = this.selected;
- let parentField = this.parentField;
- if (parentField) {
- result2.push(`${parentField} == null || ${parentField} == ""`);
- }
- if (selected.length) {
- for (var i2 = 0; i2 < selected.length - 1; i2++) {
- result2.push(`${parentField} == '${selected[i2].value}'`);
- }
- }
- let where = [];
- if (this.where) {
- where.push(`(${this.where})`);
- }
- if (result2.length) {
- where.push(`(${result2.join(" || ")})`);
- }
- return where.join(" && ");
- },
- _nodeWhere() {
- let result2 = [];
- let selected = this.selected;
- if (selected.length) {
- result2.push(`${this.parentField} == '${selected[selected.length - 1].value}'`);
- }
- if (this.where) {
- return `(${this.where}) && (${result2.join(" || ")})`;
- }
- return result2.join(" || ");
- },
- _getParentNameByField() {
- const fields = this.field.split(",");
- let where_field = null;
- for (let i2 = 0; i2 < fields.length; i2++) {
- const items = fields[i2].split("as");
- if (items.length < 2) {
- continue;
- }
- if (items[1].trim() === "value") {
- where_field = items[0].trim();
- break;
- }
- }
- return where_field;
- },
- _isTreeView() {
- return this.parentField && this.selfField;
- },
- _updateSelected() {
- var dl = this.dataList;
- var sl = this.selected;
- let textField = this.map.text;
- let valueField = this.map.value;
- for (var i2 = 0; i2 < sl.length; i2++) {
- var value = sl[i2].value;
- var dl2 = dl[i2];
- for (var j2 = 0; j2 < dl2.length; j2++) {
- var item2 = dl2[j2];
- if (item2[valueField] === value) {
- sl[i2].text = item2[textField];
- break;
- }
- }
- }
- },
- _updateBindData(node2) {
- const {
- dataList,
- hasNodes
- } = this._filterData(this._treeData, this.selected);
- let isleaf = this._stepSearh === false && !hasNodes;
- if (node2) {
- node2.isleaf = isleaf;
- }
- this.dataList = dataList;
- this.selectedIndex = dataList.length - 1;
- if (!isleaf && this.selected.length < dataList.length) {
- this.selected.push({
- value: null,
- text: "请选择"
- });
- }
- return {
- isleaf,
- hasNodes
- };
- },
- _filterData(data, paths) {
- let dataList = [];
- let hasNodes = true;
- dataList.push(data.filter((item) => {
- return item.parent_value === null || item.parent_value === void 0 || item.parent_value === "";
- }));
- for (let i2 = 0; i2 < paths.length; i2++) {
- var value = paths[i2].value;
- var nodes = data.filter((item) => {
- return item.parent_value === value;
- });
- if (nodes.length) {
- dataList.push(nodes);
- } else {
- hasNodes = false;
- }
- }
- return {
- dataList,
- hasNodes
- };
- },
- _extractTree(nodes, result2, parent_value) {
- let valueField = this.map.value;
- for (let i2 = 0; i2 < nodes.length; i2++) {
- let node2 = nodes[i2];
- let child = {};
- for (let key in node2) {
- if (key !== "children") {
- child[key] = node2[key];
- }
- }
- if (parent_value !== null && parent_value !== void 0 && parent_value !== "") {
- child.parent_value = parent_value;
- }
- result2.push(child);
- let children = node2.children;
- if (children) {
- this._extractTree(children, result2, node2[valueField]);
- }
- }
- },
- _extractTreePath(nodes, result2) {
- for (let i2 = 0; i2 < nodes.length; i2++) {
- let node2 = nodes[i2];
- let child = {};
- for (let key in node2) {
- if (key !== "children") {
- child[key] = node2[key];
- }
- }
- result2.push(child);
- let children = node2.children;
- if (children) {
- this._extractTreePath(children, result2);
- }
- }
- },
- _findNodePath(key, nodes, path = []) {
- let textField = this.map.text;
- let valueField = this.map.value;
- for (let i2 = 0; i2 < nodes.length; i2++) {
- let node2 = nodes[i2];
- let children = node2.children;
- let text = node2[textField];
- let value = node2[valueField];
- path.push({
- value,
- text
- });
- if (value === key) {
- return path;
- }
- if (children) {
- const p2 = this._findNodePath(key, children, path);
- if (p2.length) {
- return p2;
- }
- }
- path.pop();
- }
- return [];
- },
- _processLocalData() {
- this._treeData = [];
- this._extractTree(this.localdata, this._treeData);
- var inputValue = this.dataValue;
- if (inputValue === void 0) {
- return;
- }
- if (Array.isArray(inputValue)) {
- inputValue = inputValue[inputValue.length - 1];
- if (typeof inputValue === "object" && inputValue[this.map.value]) {
- inputValue = inputValue[this.map.value];
- }
- }
- this.selected = this._findNodePath(inputValue, this.localdata);
- }
- }
- };
- const _sfc_main$q = {
- name: "UniDataPickerView",
- emits: ["nodeclick", "change", "datachange", "update:modelValue"],
- mixins: [dataPicker],
- props: {
- managedMode: {
- type: Boolean,
- default: false
- },
- ellipsis: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {};
- },
- created() {
- if (this.managedMode) {
- return;
- }
- this.$nextTick(() => {
- this.load();
- });
- },
- methods: {
- onPropsChange() {
- this._treeData = [];
- this.selectedIndex = 0;
- this.load();
- },
- load() {
- if (this.isLocaldata) {
- this.loadData();
- } else if (this.dataValue.length) {
- this.getTreePath((res) => {
- this.loadData();
- });
- }
- },
- handleSelect(index2) {
- this.selectedIndex = index2;
- },
- handleNodeClick(item, i2, j2) {
- if (item.disable) {
- return;
- }
- const node2 = this.dataList[i2][j2];
- const text = node2[this.map.text];
- const value = node2[this.map.value];
- if (i2 < this.selected.length - 1) {
- this.selected.splice(i2, this.selected.length - i2);
- this.selected.push({
- text,
- value
- });
- } else if (i2 === this.selected.length - 1) {
- this.selected.splice(i2, 1, {
- text,
- value
- });
- }
- if (node2.isleaf) {
- this.onSelectedChange(node2, node2.isleaf);
- return;
- }
- const {
- isleaf,
- hasNodes
- } = this._updateBindData();
- if (!this._isTreeView() && !hasNodes) {
- this.onSelectedChange(node2, true);
- return;
- }
- if (this.isLocaldata && (!hasNodes || isleaf)) {
- this.onSelectedChange(node2, true);
- return;
- }
- if (!isleaf && !hasNodes) {
- this._loadNodeData((data) => {
- if (!data.length) {
- node2.isleaf = true;
- } else {
- this._treeData.push(...data);
- this._updateBindData(node2);
- }
- this.onSelectedChange(node2, node2.isleaf);
- }, this._nodeWhere());
- return;
- }
- this.onSelectedChange(node2, false);
- },
- updateData(data) {
- this._treeData = data.treeData;
- this.selected = data.selected;
- if (!this._treeData.length) {
- this.loadData();
- } else {
- this._updateBindData();
- }
- },
- onDataChange() {
- this.$emit("datachange");
- },
- onSelectedChange(node2, isleaf) {
- if (isleaf) {
- this._dispatchEvent();
- }
- if (node2) {
- this.$emit("nodeclick", node2);
- }
- },
- _dispatchEvent() {
- this.$emit("change", this.selected.slice(0));
- }
- }
- };
- function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-data-pickerview" }, [
- vue.createElementVNode("scroll-view", {
- class: "selected-area",
- "scroll-x": "true",
- "scroll-y": "false",
- "show-scrollbar": false
- }, [
- vue.createElementVNode("view", { class: "selected-list" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.selected, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- item.text ? (vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["selected-item", { "selected-item-active": index2 == _ctx.selectedIndex, "selected-item-text-overflow": $props.ellipsis }]),
- key: index2,
- onClick: ($event) => $options.handleSelect(index2)
- }, [
- vue.createElementVNode(
- "text",
- { class: "" },
- vue.toDisplayString(item.text),
- 1
- /* TEXT */
- )
- ], 10, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }),
- 256
- /* UNKEYED_FRAGMENT */
- ))
- ])
- ]),
- vue.createElementVNode("view", { class: "tab-c" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.dataList, (child, i2) => {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- i2 == _ctx.selectedIndex ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
- class: "list",
- key: i2,
- "scroll-y": true
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(child, (item, j2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["item", { "is-disabled": !!item.disable }]),
- key: j2,
- onClick: ($event) => $options.handleNodeClick(item, i2, j2)
- }, [
- vue.createElementVNode(
- "text",
- { class: "item-text item-text-overflow" },
- vue.toDisplayString(item[_ctx.map.text]),
- 1
- /* TEXT */
- ),
- _ctx.selected.length > i2 && item[_ctx.map.value] == _ctx.selected[i2].value ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "check"
- })) : vue.createCommentVNode("v-if", true)
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }),
- 256
- /* UNKEYED_FRAGMENT */
- )),
- _ctx.loading ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "loading-cover"
- }, [
- vue.createVNode(_component_uni_load_more, {
- class: "load-more",
- contentText: _ctx.loadMore,
- status: "loading"
- }, null, 8, ["contentText"])
- ])) : vue.createCommentVNode("v-if", true),
- _ctx.errorMessage ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "error-message"
- }, [
- vue.createElementVNode(
- "text",
- { class: "error-text" },
- vue.toDisplayString(_ctx.errorMessage),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]);
- }
- const DataPickerView = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p], ["__scopeId", "data-v-91ec6a82"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue"]]);
- const _sfc_main$p = {
- name: "UniDataPicker",
- emits: ["popupopened", "popupclosed", "nodeclick", "input", "change", "update:modelValue"],
- mixins: [dataPicker],
- components: {
- DataPickerView
- },
- props: {
- options: {
- type: [Object, Array],
- default() {
- return {};
- }
- },
- popupTitle: {
- type: String,
- default: "请选择"
- },
- placeholder: {
- type: String,
- default: "请选择"
- },
- heightMobile: {
- type: String,
- default: ""
- },
- readonly: {
- type: Boolean,
- default: false
- },
- clearIcon: {
- type: Boolean,
- default: true
- },
- border: {
- type: Boolean,
- default: true
- },
- split: {
- type: String,
- default: "/"
- },
- ellipsis: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {
- isOpened: false,
- inputSelected: []
- };
- },
- created() {
- this.form = this.getForm("uniForms");
- this.formItem = this.getForm("uniFormsItem");
- if (this.formItem) {
- if (this.formItem.name) {
- this.rename = this.formItem.name;
- this.form.inputChildrens.push(this);
- }
- }
- this.$nextTick(() => {
- this.load();
- });
- },
- methods: {
- clear() {
- this.inputSelected.splice(0);
- this._dispatchEvent([]);
- },
- onPropsChange() {
- this._treeData = [];
- this.selectedIndex = 0;
- this.load();
- },
- load() {
- if (this.readonly) {
- this._processReadonly(this.localdata, this.dataValue);
- return;
- }
- if (this.isLocaldata) {
- this.loadData();
- this.inputSelected = this.selected.slice(0);
- } else if (!this.parentField && !this.selfField && this.hasValue) {
- this.getNodeData(() => {
- this.inputSelected = this.selected.slice(0);
- });
- } else if (this.hasValue) {
- this.getTreePath(() => {
- this.inputSelected = this.selected.slice(0);
- });
- }
- },
- getForm(name2 = "uniForms") {
- let parent2 = this.$parent;
- let parentName = parent2.$options.name;
- while (parentName !== name2) {
- parent2 = parent2.$parent;
- if (!parent2)
- return false;
- parentName = parent2.$options.name;
- }
- return parent2;
- },
- show() {
- this.isOpened = true;
- setTimeout(() => {
- this.$refs.pickerView.updateData({
- treeData: this._treeData,
- selected: this.selected,
- selectedIndex: this.selectedIndex
- });
- }, 200);
- this.$emit("popupopened");
- },
- hide() {
- this.isOpened = false;
- this.$emit("popupclosed");
- },
- handleInput() {
- if (this.readonly) {
- return;
- }
- this.show();
- },
- handleClose(e2) {
- this.hide();
- },
- onnodeclick(e2) {
- this.$emit("nodeclick", e2);
- },
- ondatachange(e2) {
- this._treeData = this.$refs.pickerView._treeData;
- },
- onchange(e2) {
- this.hide();
- this.inputSelected = e2;
- this._dispatchEvent(e2);
- },
- _processReadonly(dataList, value) {
- var isTree = dataList.findIndex((item2) => {
- return item2.children;
- });
- if (isTree > -1) {
- let inputValue;
- if (Array.isArray(value)) {
- inputValue = value[value.length - 1];
- if (typeof inputValue === "object" && inputValue.value) {
- inputValue = inputValue.value;
- }
- } else {
- inputValue = value;
- }
- this.inputSelected = this._findNodePath(inputValue, this.localdata);
- return;
- }
- if (!this.hasValue) {
- this.inputSelected = [];
- return;
- }
- let result2 = [];
- for (let i2 = 0; i2 < value.length; i2++) {
- var val = value[i2];
- var item = dataList.find((v2) => {
- return v2.value == val;
- });
- if (item) {
- result2.push(item);
- }
- }
- if (result2.length) {
- this.inputSelected = result2;
- }
- },
- _filterForArray(data, valueArray) {
- var result2 = [];
- for (let i2 = 0; i2 < valueArray.length; i2++) {
- var value = valueArray[i2];
- var found = data.find((item) => {
- return item.value == value;
- });
- if (found) {
- result2.push(found);
- }
- }
- return result2;
- },
- _dispatchEvent(selected) {
- let item = {};
- if (selected.length) {
- var value = new Array(selected.length);
- for (var i2 = 0; i2 < selected.length; i2++) {
- value[i2] = selected[i2].value;
- }
- item = selected[selected.length - 1];
- } else {
- item.value = "";
- }
- if (this.formItem) {
- this.formItem.setValue(item.value);
- }
- this.$emit("input", item.value);
- this.$emit("update:modelValue", item.value);
- this.$emit("change", {
- detail: {
- value: selected
- }
- });
- }
- }
- };
- function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$b);
- const _component_data_picker_view = vue.resolveComponent("data-picker-view");
- return vue.openBlock(), vue.createElementBlock("view", { class: "uni-data-tree" }, [
- vue.createElementVNode("view", {
- class: "uni-data-tree-input",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.handleInput && $options.handleInput(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default", {
- options: $props.options,
- data: $data.inputSelected,
- error: _ctx.errorMessage
- }, () => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["input-value", { "input-value-border": $props.border }])
- },
- [
- _ctx.errorMessage ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "selected-area error-text"
- },
- vue.toDisplayString(_ctx.errorMessage),
- 1
- /* TEXT */
- )) : _ctx.loading && !$data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "selected-area"
- }, [
- vue.createVNode(_component_uni_load_more, {
- class: "load-more",
- contentText: _ctx.loadMore,
- status: "loading"
- }, null, 8, ["contentText"])
- ])) : $data.inputSelected.length ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
- key: 2,
- class: "selected-area",
- "scroll-x": "true"
- }, [
- vue.createElementVNode("view", { class: "selected-list" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.inputSelected, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "selected-item",
- key: index2
- }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString(item.text),
- 1
- /* TEXT */
- ),
- index2 < $data.inputSelected.length - 1 ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "input-split-line"
- },
- vue.toDisplayString($props.split),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 3,
- class: "selected-area placeholder"
- },
- vue.toDisplayString($props.placeholder),
- 1
- /* TEXT */
- )),
- $props.clearIcon && !$props.readonly && $data.inputSelected.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 4,
- class: "icon-clear",
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop"]))
- }, [
- vue.createVNode(_component_uni_icons, {
- type: "clear",
- color: "#e1e1e1",
- size: "14"
- })
- ])) : vue.createCommentVNode("v-if", true),
- (!$props.clearIcon || !$data.inputSelected.length) && !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 5,
- class: "arrow-area"
- }, [
- vue.createElementVNode("view", { class: "input-arrow" })
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- )
- ], true)
- ]),
- $data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uni-data-tree-cover",
- onClick: _cache[2] || (_cache[2] = (...args) => $options.handleClose && $options.handleClose(...args))
- })) : vue.createCommentVNode("v-if", true),
- $data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uni-data-tree-dialog"
- }, [
- vue.createElementVNode("view", { class: "uni-popper__arrow" }),
- vue.createElementVNode("view", { class: "dialog-caption" }, [
- vue.createElementVNode("view", { class: "title-area" }, [
- vue.createElementVNode(
- "text",
- { class: "dialog-title" },
- vue.toDisplayString($props.popupTitle),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "dialog-close",
- onClick: _cache[3] || (_cache[3] = (...args) => $options.handleClose && $options.handleClose(...args))
- }, [
- vue.createElementVNode("view", {
- class: "dialog-close-plus",
- "data-id": "close"
- }),
- vue.createElementVNode("view", {
- class: "dialog-close-plus dialog-close-rotate",
- "data-id": "close"
- })
- ])
- ]),
- vue.createVNode(_component_data_picker_view, {
- class: "picker-view",
- ref: "pickerView",
- modelValue: _ctx.dataValue,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.dataValue = $event),
- localdata: _ctx.localdata,
- preload: _ctx.preload,
- collection: _ctx.collection,
- field: _ctx.field,
- orderby: _ctx.orderby,
- where: _ctx.where,
- "step-searh": _ctx.stepSearh,
- "self-field": _ctx.selfField,
- "parent-field": _ctx.parentField,
- "managed-mode": true,
- map: _ctx.map,
- ellipsis: $props.ellipsis,
- onChange: $options.onchange,
- onDatachange: $options.ondatachange,
- onNodeclick: $options.onnodeclick
- }, null, 8, ["modelValue", "localdata", "preload", "collection", "field", "orderby", "where", "step-searh", "self-field", "parent-field", "map", "ellipsis", "onChange", "onDatachange", "onNodeclick"])
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_3$1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__scopeId", "data-v-2653531e"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue"]]);
- const placeholderStyle = "color:#BBBBBB;font-size:28rpx;line-height:normal";
- const _sfc_main$o = {
- __name: "merchant",
- setup(__props, { expose: __expose }) {
- __expose();
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const state = vue.reactive({
- canUse: true,
- //用户是否可以打开页面true 可以,false不行
- userApplyStatus: false,
- //用户是否已经申请过false未无 true为有
- formStatus: false,
- // 当前表单是否可以修改
- changeIng: false,
- //当前是否在修改
- model: {
- checkStatus: void 0,
- id: void 0,
- name: void 0,
- status: void 0,
- description: void 0,
- contact: void 0,
- address: void 0,
- contactNumber: void 0,
- website: void 0,
- createTime: void 0,
- complaintsHotline: void 0,
- customerServiceHotline: void 0,
- email: void 0,
- businessLicensePicture: void 0,
- expireTime: void 0,
- areaId: void 0,
- accountName: void 0,
- accountNumber: void 0,
- bankName: void 0,
- logoUrl: void 0,
- brandLicensing: void 0,
- otherCertificate: [],
- legalPerson: void 0,
- legalPersonNumber: void 0,
- identityCardFront: void 0,
- identityCardReverseSide: void 0
- },
- areaIdError: "",
- businessLicensePictureError: "",
- brandLicensingError: "",
- identityCardFrontError: "",
- identityCardReverseSideError: "",
- rules: {
- name: {
- rules: [{
- required: true,
- errorMessage: t$6("merchant.merchant_name_required")
- }]
- },
- // description: {
- // rules: [{
- // required: true,
- // errorMessage: t('merchant.introduction_required'),
- // }, ],
- // },
- contact: {
- rules: [{
- required: true,
- errorMessage: t$6("merchant.contact_required")
- }]
- },
- contactNumber: {
- rules: [{
- required: true,
- errorMessage: t$6("merchant.contact_phone_required")
- }]
- },
- // customerServiceHotline: {
- // rules: [{
- // required: true,
- // errorMessage: t('merchant.customer_service_phone_required'),
- // }, ],
- // },
- // email,
- // legalPerson: {
- // rules: [{
- // required: true,
- // errorMessage: t('merchant.legal_person_required'),
- // }, ],
- // },
- // legalPersonNumber: {
- // rules: [{
- // required: true,
- // errorMessage: t('merchant.legal_person_phone_required'),
- // }, ],
- // },
- accountName: {
- rules: [{
- required: true,
- errorMessage: t$6("merchant.account_name_required")
- }]
- },
- accountNumber: {
- rules: [{
- required: true,
- errorMessage: t$6("merchant.account_number_required")
- }]
- },
- bankName: {
- rules: [{
- required: true,
- errorMessage: t$6("merchant.bank_required")
- }]
- }
- }
- });
- const statusName = vue.computed(() => {
- const status = state.model.checkStatus;
- if (status === 0) {
- return t$6("merchant.under_review");
- } else if (status === 1) {
- return t$6("merchant.approved");
- } else if (status === 2) {
- return t$6("merchant.rejected");
- } else {
- return "";
- }
- });
- const downloadTemplate = () => {
- const fileUrl = "https://zxgz.newfeifan.cn/static/file/%E9%9D%9E%E7%8B%AC%E5%AE%B6%E5%93%81%E7%89%8C%E6%8E%88%E6%9D%83%E4%B9%A6.docx";
- const a2 = document.createElement("a");
- a2.href = fileUrl;
- a2.download = t$6("merchant.non_exclusive_authorization") + ".docx";
- document.body.appendChild(a2);
- a2.click();
- document.body.removeChild(a2);
- };
- const checkNumber = () => {
- SaleApi.checkContactNumber({
- mobile: state.model.contactNumber
- });
- };
- const merchantFormRef = vue.ref(null);
- const onSubmit = async () => {
- const validate = await vue.unref(merchantFormRef).validate().catch((error2) => {
- formatAppLog("log", "at pages/public/merchant.vue:341", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- if (!state.model.businessLicensePicture) {
- state.businessLicensePictureError = t$6("merchant.upload_business_license");
- return;
- }
- if (!state.model.brandLicensing) {
- state.brandLicensingError = t$6("merchant.upload_brand_authorization");
- return;
- }
- const {
- data,
- code: code2
- } = await SaleApi.createMerchant(state.model);
- if (code2 === 0) {
- await getInfo2();
- }
- };
- const onChange = () => {
- state.formStatus = false;
- state.changeIng = true;
- };
- const onCancel = () => {
- state.formStatus = true;
- state.changeIng = false;
- };
- const openList = () => {
- sheep$1.$router.go("/pages/public/merchantApplyList", {
- merchantApplyId: state.model.id
- });
- };
- const onSave = async () => {
- const validate = await vue.unref(merchantFormRef).validate().catch((error2) => {
- formatAppLog("log", "at pages/public/merchant.vue:398", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const {
- data,
- code: code2
- } = await SaleApi.updateMerchant(state.model);
- if (code2 === 0) {
- state.formStatus = true;
- state.changeIng = false;
- await getInfo2();
- }
- };
- const areaTree = vue.ref([]);
- function format2(data) {
- return data.map((item) => ({
- text: item.name,
- // 显示的文本
- value: item.id,
- // 值
- children: item.children.length ? format2(item.children) : null
- // 子项
- }));
- }
- const getInfo2 = async () => {
- const {
- data,
- code: code2
- } = await SaleApi.getMerchant();
- if (code2 === 0 && data) {
- state.model = data;
- state.userApplyStatus = true;
- state.formStatus = true;
- } else {
- state.userApplyStatus = false;
- state.formStatus = false;
- }
- };
- const isLogin = vue.computed(() => sheep$1.$store("user").isLogin);
- vue.watch(
- () => isLogin.value,
- (newVal) => {
- if (newVal) {
- window.location.reload();
- }
- },
- {
- deep: true
- // 深度监听
- }
- );
- onLoad(async (options2) => {
- if (!isLogin.value) {
- showAuthModal();
- } else {
- await SaleApi.checkSystemUser().then((res) => {
- formatAppLog("log", "at pages/public/merchant.vue:463", !res.data);
- state.canUse = !res.data;
- });
- await AreaApi.getAreaTree().then((res) => {
- areaTree.value = format2(res.data);
- });
- await getInfo2();
- }
- });
- const __returned__ = { userInfo: userInfo2, state, placeholderStyle, statusName, downloadTemplate, checkNumber, merchantFormRef, onSubmit, onChange, onCancel, openList, onSave, areaTree, format: format2, getInfo: getInfo2, isLogin, computed: vue.computed, reactive: vue.reactive, onBeforeMount: vue.onBeforeMount, ref: vue.ref, unref: vue.unref, watch: vue.watch, get sheep() {
- return sheep$1;
- }, get clone() {
- return lodashExports.clone;
- }, get onLoad() {
- return onLoad;
- }, get SaleApi() {
- return SaleApi;
- }, get AreaApi() {
- return AreaApi;
- }, get email() {
- return email;
- }, get showAuthModal() {
- return showAuthModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_s_uploader = resolveEasycom(vue.resolveDynamicComponent("s-uploader"), __easycom_3$4);
- const _component_uni_data_picker = resolveEasycom(vue.resolveDynamicComponent("uni-data-picker"), __easycom_3$1);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "set-wrap",
- title: $setup.t("merchant.merchant_registration"),
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- $setup.state.canUse ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createVNode(_component_uni_forms, {
- model: $setup.state.model,
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelPosition: "left",
- border: "",
- class: "form-box",
- labelWidth: "200",
- ref: "merchantFormRef"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "name",
- label: $setup.t("merchant.merchant_name"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.name,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.state.model.name = $event),
- type: "name",
- ":placeholder": $setup.t("merchant.merchant_name"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", ":placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "contact",
- label: $setup.t("merchant.contact_person"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.contact,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.contact = $event),
- type: "contact",
- placeholder: $setup.t("merchant.enter_contact_person"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "contactNumber",
- label: $setup.t("merchant.contact_phone"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.contactNumber,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.contactNumber = $event),
- type: "contactNumber",
- placeholder: $setup.t("merchant.enter_contact_phone"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "legalPerson",
- label: $setup.t("merchant.legal_person"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.legalPerson,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.state.model.legalPerson = $event),
- type: "legalPerson",
- placeholder: $setup.t("merchant.enter_legal_person"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "legalPersonNumber",
- label: $setup.t("merchant.legal_person_phone"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.legalPersonNumber,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.state.model.legalPersonNumber = $event),
- type: "legalPersonNumber",
- placeholder: $setup.t("merchant.enter_legal_person_phone"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "identityCardFront",
- label: $setup.t("merchant.legal_person_id_front"),
- required: !$setup.state.formStatus,
- errorMessage: $setup.state.identityCardFrontError
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_uploader, {
- url: $setup.state.model.identityCardFront,
- "onUpdate:url": _cache[5] || (_cache[5] = ($event) => $setup.state.model.identityCardFront = $event),
- fileMediatype: "image",
- limit: "1",
- mode: "grid",
- imageStyles: { width: "299rpx", height: "168rpx" },
- readonly: $setup.state.formStatus
- }, null, 8, ["url", "readonly"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required", "errorMessage"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "identityCardReverseSide",
- label: $setup.t("merchant.legal_person_id_back"),
- required: !$setup.state.formStatus,
- errorMessage: _ctx.identityCardReverseSideError
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_uploader, {
- url: $setup.state.model.identityCardReverseSide,
- "onUpdate:url": _cache[6] || (_cache[6] = ($event) => $setup.state.model.identityCardReverseSide = $event),
- fileMediatype: "image",
- limit: "1",
- mode: "grid",
- imageStyles: { width: "299rpx", height: "168rpx" },
- readonly: $setup.state.formStatus
- }, null, 8, ["url", "readonly"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required", "errorMessage"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "areaId",
- label: $setup.t("merchant.location"),
- required: !$setup.state.formStatus,
- errorMessage: $setup.state.areaIdError
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_data_picker, {
- modelValue: $setup.state.model.areaId,
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $setup.state.model.areaId = $event),
- localdata: $setup.areaTree,
- readonly: $setup.state.formStatus
- }, null, 8, ["modelValue", "localdata", "readonly"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required", "errorMessage"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "email",
- label: $setup.t("merchant.email"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.email,
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $setup.state.model.email = $event),
- type: "email",
- placeholder: $setup.t("merchant.enter_email"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "address",
- label: $setup.t("merchant.office_address")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.address,
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $setup.state.model.address = $event),
- type: "address",
- placeholder: $setup.t("merchant.office_address"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "complaintsHotline",
- label: $setup.t("merchant.rights_phone")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.complaintsHotline,
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $setup.state.model.complaintsHotline = $event),
- type: "complaintsHotline",
- placeholder: $setup.t("merchant.enter_rights_phone"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "customerServiceHotline",
- label: $setup.t("merchant.customer_service_phone"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.customerServiceHotline,
- "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $setup.state.model.customerServiceHotline = $event),
- type: "customerServiceHotline",
- placeholder: $setup.t("merchant.enter_customer_service_phone"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "website",
- label: $setup.t("merchant.website")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.website,
- "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $setup.state.model.website = $event),
- type: "website",
- placeholder: $setup.t("merchant.enter_website"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "bankName",
- label: $setup.t("merchant.bank"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.bankName,
- "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $setup.state.model.bankName = $event),
- type: "bankName",
- placeholder: $setup.t("merchant.enter_bank"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "accountName",
- label: $setup.t("merchant.account_name"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.accountName,
- "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $setup.state.model.accountName = $event),
- type: "accountName",
- placeholder: $setup.t("merchant.enter_account_name"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "accountNumber",
- label: $setup.t("merchant.account_number"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.accountNumber,
- "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $setup.state.model.accountNumber = $event),
- type: "number",
- placeholder: $setup.t("merchant.enter_account_number"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "logoUrl",
- label: "Logo"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_uploader, {
- url: $setup.state.model.logoUrl,
- "onUpdate:url": _cache[16] || (_cache[16] = ($event) => $setup.state.model.logoUrl = $event),
- fileMediatype: "image",
- limit: "1",
- mode: "grid",
- imageStyles: { width: "299rpx", height: "168rpx" },
- readonly: $setup.state.formStatus
- }, null, 8, ["url", "readonly"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uni_forms_item, {
- name: "businessLicensePicture",
- label: $setup.t("merchant.business_license"),
- required: !$setup.state.formStatus,
- errorMessage: $setup.state.businessLicensePictureError
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_uploader, {
- url: $setup.state.model.businessLicensePicture,
- "onUpdate:url": _cache[17] || (_cache[17] = ($event) => $setup.state.model.businessLicensePicture = $event),
- fileMediatype: "image",
- limit: "1",
- mode: "grid",
- imageStyles: { width: "299rpx", height: "168rpx" },
- readonly: $setup.state.formStatus
- }, null, 8, ["url", "readonly"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required", "errorMessage"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "brandLicensing",
- label: $setup.t("merchant.brand_authorization"),
- required: !$setup.state.formStatus,
- errorMessage: $setup.state.brandLicensingError
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_uploader, {
- url: $setup.state.model.brandLicensing,
- "onUpdate:url": _cache[18] || (_cache[18] = ($event) => $setup.state.model.brandLicensing = $event),
- fileMediatype: "image",
- limit: "1",
- mode: "grid",
- imageStyles: { width: "299rpx", height: "168rpx" },
- readonly: $setup.state.formStatus
- }, null, 8, ["url", "readonly"]),
- !$setup.state.model.brandLicensing ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "ss-m-t-20",
- style: { "color": "var(--ui-BG-Main)" },
- onClick: $setup.downloadTemplate
- },
- vue.toDisplayString($setup.t("merchant.download_template")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required", "errorMessage"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "otherCertificate",
- label: $setup.t("merchant.other_certificates")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_s_uploader, {
- url: $setup.state.model.otherCertificate,
- "onUpdate:url": _cache[19] || (_cache[19] = ($event) => $setup.state.model.otherCertificate = $event),
- fileMediatype: "image",
- limit: "9",
- mode: "grid",
- imageStyles: { width: "299rpx", height: "168rpx" },
- readonly: $setup.state.formStatus
- }, null, 8, ["url", "readonly"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "description",
- label: $setup.t("merchant.introduction"),
- required: !$setup.state.formStatus
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.description,
- "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $setup.state.model.description = $event),
- type: "description",
- placeholder: $setup.t("merchant.enter_introduction"),
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: $setup.state.formStatus
- }, null, 8, ["modelValue", "placeholder", "disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label", "required"]),
- $setup.state.userApplyStatus ? (vue.openBlock(), vue.createBlock(_component_uni_forms_item, {
- key: 0,
- name: "description",
- label: $setup.t("merchant.status")
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.statusName,
- "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $setup.statusName = $event),
- type: "description",
- inputBorder: false,
- placeholderStyle: $setup.placeholderStyle,
- clearable: false,
- disabled: true
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"]),
- vue.createVNode(_component_su_fixed, {
- bottom: "",
- placeholder: "",
- bg: "none"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "footer-box ss-p-20 ss-flex" }, [
- vue.createCommentVNode(" 审核中不允许改 "),
- vue.createCommentVNode(" 通过后 变动 "),
- vue.createCommentVNode(' {{"用户是否申请过:"+state.userApplyStatus}}\n {{"当前状态"+state.model.checkStatus}}\n {{"当前状态是否能改动:" + !state.formStatus}} '),
- !$setup.state.userApplyStatus ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-rest-button btn",
- onClick: $setup.onSubmit
- },
- vue.toDisplayString($setup.t("common.submit")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- [0].includes($setup.state.model.checkStatus) ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-rest-button btn"
- },
- vue.toDisplayString($setup.t("merchant.review_in_progress")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- [1, 2].includes($setup.state.model.checkStatus) ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- !$setup.state.changeIng ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createElementVNode(
- "button",
- {
- class: "ss-rest-button btn-two",
- onClick: $setup.openList
- },
- vue.toDisplayString($setup.t("merchant.review_records")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "button",
- {
- class: "ss-rest-button btn-two",
- onClick: $setup.onChange
- },
- vue.toDisplayString($setup.t("merchant.changes")),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createElementVNode(
- "button",
- {
- class: "ss-rest-button btn-two",
- onClick: $setup.onCancel
- },
- vue.toDisplayString($setup.t("common.cancel")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "button",
- {
- class: "ss-rest-button btn-two",
- onClick: $setup.onSave
- },
- vue.toDisplayString($setup.t("merchant.save_and_submit")),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true),
- !$setup.state.canUse ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- style: { "position": "fixed", "top": "50%", "left": "50%", "transform": "translate(-50%,-50%)", "text-align": "center" }
- },
- vue.toDisplayString($setup.t("merchant.existing_merchant_alert", { user: $setup.userInfo.mobile })),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesPublicMerchant = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__scopeId", "data-v-72155725"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/public/merchant.vue"]]);
- const _sfc_main$n = {
- __name: "merchantApplyList",
- props: {
- merchantApplyId: {
- type: Number,
- default: ""
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const sys_navBar = sheep$1.$platform.navbar;
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageSize: 10,
- pageNo: 1
- },
- loadStatus: ""
- });
- async function getLogList() {
- state.loadStatus = "loading";
- let {
- code: code2,
- data
- } = await SaleApi.getMerchantPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- merchantApplyId: props.merchantApplyId
- });
- if (code2 !== 0) {
- return;
- }
- let list = _$1.concat(state.pagination.list, data.list);
- state.pagination.list = list;
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- onLoad(() => {
- getLogList();
- });
- function onLoadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList();
- }
- onReachBottom(() => {
- onLoadMore();
- });
- const __returned__ = { props, userWallet, statusBarHeight, userInfo: userInfo2, sys_navBar, state, getLogList, onLoadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, computed: vue.computed, reactive: vue.reactive, get points2point() {
- return points2point;
- }, get _() {
- return _$1;
- }, get dayjs() {
- return dayjs;
- }, get PointApi() {
- return PointApi;
- }, get resetPagination() {
- return resetPagination;
- }, get SaleApi() {
- return SaleApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" 商家申请审核记录 "),
- vue.createVNode(_component_s_layout, {
- class: "wallet-wrap",
- bgStyle: { "backgroundColor": "#ffffff" },
- title: "审核记录",
- navbar: "normal"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "model-box ss-flex-col" }, [
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- style: { "padding": "0 20rpx" }
- }, [
- vue.createElementVNode("view", {
- class: "list-item ss-flex ss-col-center ss-row-between",
- style: { "padding": "20rpx 0", "border-bottom": "1px solid #c4c4c4" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-m-t-10",
- style: { "flex-direction": "column", "align-items": "flex-start", "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "name",
- style: { "width": "100%" }
- }, [
- vue.createTextVNode(" 商户登陆地址: "),
- vue.createElementVNode("text", {
- class: "color-red",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$helper.copyText("https://sh.letcgo.com"))
- }, "https://sh.letcgo.com")
- ]),
- vue.createElementVNode("view", {
- class: "time",
- style: { "width": "100%" }
- }, " 默认管理员账号: 联络人手机号 "),
- vue.createElementVNode("view", {
- class: "time",
- style: { "width": "100%" }
- }, " 默认管理员密码: zxpt@联络人手机号 ")
- ])
- ])
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "scroll-view",
- {
- class: "list-box",
- "scroll-y": "true",
- onTouchmove: _cache[3] || (_cache[3] = vue.withModifiers(() => {
- }, ["stop"]))
- },
- [
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- style: { "padding": "20rpx", "padding-top": "0" }
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "list-item ss-flex ss-col-center ss-row-between",
- key: item.id,
- style: { "padding": "20rpx 0", "border-bottom": "1px solid #c4c4c4" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-col-center",
- style: { "width": "100%" }
- }, [
- vue.createElementVNode("view", {
- class: "ss-flex ss-m-t-10",
- style: { "flex-direction": "column", "align-items": "flex-start", "width": "100%" }
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "name",
- style: { "width": "100%" }
- },
- vue.toDisplayString(item.status === 1 ? "通过" : "拒绝"),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "time",
- style: { "width": "100%" }
- },
- " 审核时间:" + vue.toDisplayString($setup.sheep.$helper.timeFormat(item.createTime, "yyyy-mm-dd hh:MM")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "time",
- style: { "width": "100%" }
- },
- " 描述:" + vue.toDisplayString(item.checkComment),
- 1
- /* TEXT */
- )
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 1,
- text: "暂无数据",
- paddingTop: "200",
- icon: "/static/data-empty.png"
- })),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "点击加载更多"
- },
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.onLoadMore(true)),
- onScrolltolower: _cache[2] || (_cache[2] = ($event) => $setup.onLoadMore(true))
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesPublicMerchantApplyList = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m], ["__scopeId", "data-v-3c232040"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/public/merchantApplyList.vue"]]);
- const _sfc_main$m = {
- __name: "s-coupon-list",
- props: {
- data: {
- type: Object,
- default: {}
- },
- disabled: {
- type: Boolean,
- default: false
- },
- type: {
- type: String,
- default: "coupon"
- // coupon 优惠劵模版;user 用户优惠劵
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({});
- const isDisable = vue.computed(() => {
- if (props.type === "coupon") {
- return false;
- }
- return props.data.status !== 1;
- });
- const props = __props;
- const __returned__ = { state, isDisable, props, computed: vue.computed, reactive: vue.reactive, get fen2yuan() {
- return fen2yuan;
- }, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "ss-m-20",
- style: vue.normalizeStyle({ opacity: $props.disabled ? "0.5" : "1" })
- },
- [
- vue.createElementVNode("view", { class: "content" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["tag ss-flex ss-row-center", $setup.isDisable ? "disabled-bg-color" : "info-bg-color"])
- },
- vue.toDisplayString($props.data.discountType === 1 ? "满减券" : "折扣券"),
- 3
- /* TEXT, CLASS */
- ),
- vue.createElementVNode("view", { class: "title ss-m-x-30 ss-p-t-18" }, [
- vue.createElementVNode("view", { class: "ss-flex ss-row-between" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["value-text ss-flex-1 ss-m-r-10", $setup.isDisable ? "disabled-color" : "info-color"])
- },
- vue.toDisplayString($props.data.name),
- 3
- /* TEXT, CLASS */
- ),
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["ss-flex ss-col-bottom", $setup.isDisable ? "disabled-color" : "price-text"])
- },
- [
- $props.data.discountType === 1 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "value-reduce ss-m-b-10"
- }, "¥")) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- { class: "value-price" },
- vue.toDisplayString($props.data.discountType === 1 ? $setup.fen2yuan($props.data.discountPrice) : $props.data.discountPercent / 10),
- 1
- /* TEXT */
- ),
- $props.data.discountType === 2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "value-discount ss-m-b-10 ss-m-l-4"
- }, "折")) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- )
- ])
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-m-t-16" }, [
- $props.data.validityType === 2 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["sellby-text", $setup.isDisable ? "disabled-color" : "subtitle-color"])
- },
- " 有效期:领取后 " + vue.toDisplayString($props.data.fixedEndTerm) + " 天内可用 ",
- 3
- /* TEXT, CLASS */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["sellby-text", $setup.isDisable ? "disabled-color" : "subtitle-color"])
- },
- " 有效期: " + vue.toDisplayString($setup.sheep.$helper.timeFormat($props.data.validStartTime, "yyyy-mm-dd")) + " 至 " + vue.toDisplayString($setup.sheep.$helper.timeFormat($props.data.validEndTime, "yyyy-mm-dd")),
- 3
- /* TEXT, CLASS */
- )),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["value-enough", $setup.isDisable ? "disabled-color" : "subtitle-color"])
- },
- " 满 " + vue.toDisplayString($setup.fen2yuan($props.data.usePrice)) + " 可用 ",
- 3
- /* TEXT, CLASS */
- )
- ])
- ])
- ]),
- vue.createCommentVNode(" TODO 非繁人:可优化,增加优惠劵的描述 "),
- vue.createElementVNode("view", { class: "desc ss-flex ss-row-between" }, [
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "view",
- { class: "desc-title" },
- vue.toDisplayString($props.data.description),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", null, [
- vue.renderSlot(_ctx.$slots, "reason", {}, void 0, true)
- ])
- ]),
- vue.createElementVNode("view", null, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])
- ])
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_3 = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__scopeId", "data-v-81b7b3dc"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-coupon-list/s-coupon-list.vue"]]);
- const _sfc_main$l = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- currentTab: 0,
- // 当前 tab
- type: "1",
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 5
- },
- loadStatus: ""
- });
- const tabMaps = [
- {
- name: "领券中心",
- value: "all"
- },
- {
- name: "已领取",
- value: "1"
- },
- {
- name: "已使用",
- value: "2"
- },
- {
- name: "已失效",
- value: "3"
- }
- ];
- function onTabsChange(e2) {
- state.currentTab = e2.index;
- state.type = e2.value;
- resetPagination(state.pagination);
- if (state.currentTab === 0) {
- getData();
- } else {
- getCoupon();
- }
- }
- async function getData() {
- state.loadStatus = "loading";
- const { data, code: code2 } = await CouponApi.getCouponTemplatePage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- async function getCoupon() {
- state.loadStatus = "loading";
- const { data, code: code2 } = await CouponApi.getCouponPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- status: state.type
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- async function getBuy(id) {
- const { code: code2 } = await CouponApi.takeCoupon(id);
- if (code2 !== 0) {
- return;
- }
- uni.showToast({
- title: "领取成功"
- });
- setTimeout(() => {
- resetPagination(state.pagination);
- getData();
- }, 1e3);
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- if (state.currentTab === 0) {
- getData();
- } else {
- getCoupon();
- }
- }
- onLoad((Option) => {
- if (Option.type === "all" || !Option.type) {
- getData();
- } else {
- Option.type === "geted" ? state.currentTab = 1 : Option.type === "used" ? state.currentTab = 2 : state.currentTab = 3;
- state.type = state.currentTab;
- getCoupon();
- }
- });
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { state, tabMaps, onTabsChange, getData, getCoupon, getBuy, loadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, reactive: vue.reactive, get _() {
- return _$1;
- }, get resetPagination() {
- return resetPagination;
- }, get CouponApi() {
- return CouponApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_coupon_list = resolveEasycom(vue.resolveDynamicComponent("s-coupon-list"), __easycom_3);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: "优惠券",
- bgStyle: { color: "#f2f2f2" }
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_sticky, { bgColor: "#fff" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_tabs, {
- list: $setup.tabMaps,
- scrollable: false,
- onChange: $setup.onTabsChange,
- current: $setup.state.currentTab
- }, null, 8, ["current"])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/coupon-empty.png",
- text: "暂无优惠券"
- })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 情况一:领劵中心 "),
- $setup.state.currentTab === 0 ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: item.id
- }, [
- vue.createVNode(_component_s_coupon_list, {
- data: item,
- onClick: ($event) => $setup.sheep.$router.go("/pages/coupon/detail", { id: item.id })
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button card-btn ss-flex ss-row-center ss-col-center", !item.canTake ? "border-btn" : ""]),
- onClick: vue.withModifiers(($event) => $setup.getBuy(item.id), ["stop"]),
- disabled: !item.canTake
- }, vue.toDisplayString(item.canTake ? "立即领取" : "已领取"), 11, ["onClick", "disabled"])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createCommentVNode(" 情况二:我的优惠劵 "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: item.id
- }, [
- vue.createVNode(_component_s_coupon_list, {
- data: item,
- type: "user",
- onClick: ($event) => $setup.sheep.$router.go("/pages/coupon/detail", { couponId: item.id })
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button card-btn ss-flex ss-row-center ss-col-center", item.status !== 1 ? "disabled-btn" : ""]),
- disabled: item.status !== 1,
- onClick: vue.withModifiers(($event) => $setup.sheep.$router.go("/pages/coupon/detail", { couponId: item.id }), ["stop"])
- }, vue.toDisplayString(item.status === 1 ? "立即使用" : item.status === 2 ? "已使用" : "已过期"), 11, ["disabled", "onClick"])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- )),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 3,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesCouponList = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$k], ["__scopeId", "data-v-019d569f"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/coupon/list.vue"]]);
- const _sfc_main$k = {
- __name: "detail",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- id: 0,
- // 优惠劵模版编号 templateId
- couponId: 0,
- // 用户优惠劵编号 couponId
- coupon: {},
- // 优惠劵信息
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 1
- },
- categoryId: 0,
- // 选中的商品分类编号
- tabMaps: [],
- // 指定分类时,每个分类构成一个 tab
- currentTab: 0,
- // 选中的 tabMaps 下标
- loadStatus: ""
- });
- function onTabsChange(e2) {
- resetPagination(state.pagination);
- state.currentTab = e2.index;
- state.categoryId = e2.value;
- getGoodsListByCategory();
- }
- async function getGoodsListByCategory() {
- state.loadStatus = "loading";
- const { code: code2, data } = await SpuApi.getSpuPage({
- categoryId: state.categoryId,
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- async function getGoodsListById() {
- const { data, code: code2 } = await SpuApi.getSpuListByIds(state.coupon.productScopeValues.join(","));
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = data;
- }
- async function getCategoryList() {
- const { data, code: code2 } = await CategoryApi.getCategoryListByIds(state.coupon.productScopeValues.join(","));
- if (code2 !== 0) {
- return;
- }
- state.tabMaps = data.map((category) => ({ name: category.name, value: category.id }));
- if (state.tabMaps.length > 0) {
- state.categoryId = state.tabMaps[0].value;
- await getGoodsListByCategory();
- }
- }
- async function getCoupon() {
- const { code: code2 } = await CouponApi.takeCoupon(state.id);
- if (code2 !== 0) {
- return;
- }
- uni.showToast({
- title: "领取成功"
- });
- setTimeout(() => {
- getCouponContent();
- }, 1e3);
- }
- async function getCouponContent() {
- const { code: code2, data } = state.id > 0 ? await CouponApi.getCouponTemplate(state.id) : await CouponApi.getCoupon(state.couponId);
- if (code2 !== 0) {
- return;
- }
- state.coupon = data;
- if (state.coupon.productScope === 2) {
- await getGoodsListById();
- } else if (state.coupon.productScope === 3) {
- await getCategoryList();
- }
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getGoodsListByCategory();
- }
- onLoad((options2) => {
- state.id = options2.id;
- state.couponId = options2.couponId;
- getCouponContent(state.id, state.couponId);
- });
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { state, onTabsChange, getGoodsListByCategory, getGoodsListById, getCategoryList, getCoupon, getCouponContent, loadMore, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, reactive: vue.reactive, get _() {
- return _$1;
- }, get CouponApi() {
- return CouponApi;
- }, get fen2yuan() {
- return fen2yuan;
- }, get SpuApi() {
- return SpuApi;
- }, get CategoryApi() {
- return CategoryApi;
- }, get resetPagination() {
- return resetPagination;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_collapse_item = resolveEasycom(vue.resolveDynamicComponent("uni-collapse-item"), __easycom_0$2);
- const _component_uni_collapse = resolveEasycom(vue.resolveDynamicComponent("uni-collapse"), __easycom_1);
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, { title: "优惠券详情" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white" }, [
- vue.createCommentVNode(" 详情卡片 "),
- vue.createElementVNode("view", { class: "detail-wrap ss-p-20" }, [
- vue.createElementVNode("view", { class: "detail-box" }, [
- vue.createElementVNode("view", { class: "tag-box ss-flex ss-col-center ss-row-center" }, [
- vue.createElementVNode("image", {
- class: "tag-image",
- src: $setup.sheep.$url.static("/static/images/coupon_icon.png"),
- mode: "aspectFit"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "top ss-flex-col ss-col-center" }, [
- vue.createElementVNode(
- "view",
- { class: "title ss-m-t-50 ss-m-b-20 ss-m-x-20" },
- vue.toDisplayString($setup.state.coupon.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "subtitle ss-m-b-50" },
- " 满 " + vue.toDisplayString($setup.fen2yuan($setup.state.coupon.usePrice)) + " 元, " + vue.toDisplayString($setup.state.coupon.discountType === 1 ? "减 " + $setup.fen2yuan($setup.state.coupon.discountPrice) + " 元" : "打 " + $setup.state.coupon.discountPercent / 10 + " 折"),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("button", {
- class: vue.normalizeClass([
- "ss-reset-button ss-m-b-30",
- $setup.state.coupon.canTake || $setup.state.coupon.status === 1 ? "use-btn" : "disable-btn"
- ]),
- disabled: !$setup.state.coupon.canTake,
- onClick: $setup.getCoupon
- }, [
- $setup.state.id > 0 ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 0 },
- vue.toDisplayString($setup.state.coupon.canTake ? "立即领取" : "已领取"),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 1 },
- vue.toDisplayString($setup.state.coupon.status === 1 ? "立即使用" : $setup.state.coupon.status === 2 ? "已使用" : "已过期"),
- 1
- /* TEXT */
- ))
- ], 10, ["disabled"]),
- $setup.state.coupon.validityType === 2 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "time ss-m-y-30"
- },
- " 有效期:领取后 " + vue.toDisplayString($setup.state.coupon.fixedEndTerm) + " 天内可用 ",
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "time ss-m-y-30"
- },
- " 有效期: " + vue.toDisplayString($setup.sheep.$helper.timeFormat($setup.state.coupon.validStartTime, "yyyy-mm-dd")) + " 至 " + vue.toDisplayString($setup.sheep.$helper.timeFormat($setup.state.coupon.validEndTime, "yyyy-mm-dd")),
- 1
- /* TEXT */
- )),
- vue.createElementVNode("view", { class: "coupon-line ss-m-t-14" })
- ]),
- vue.createElementVNode("view", { class: "bottom" }, [
- vue.createElementVNode("view", { class: "type ss-flex ss-col-center ss-row-between ss-p-x-30" }, [
- vue.createElementVNode("view", null, "优惠券类型"),
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString($setup.state.coupon.discountType === 1 ? "满减券" : "折扣券"),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" TODO 非繁人:可优化,增加优惠劵的描述 "),
- vue.createVNode(_component_uni_collapse, null, {
- default: vue.withCtx(() => [
- $setup.state.coupon.description ? (vue.openBlock(), vue.createBlock(_component_uni_collapse_item, {
- key: 0,
- title: "优惠券说明"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "content ss-p-b-20" }, [
- vue.createElementVNode(
- "text",
- { class: "des ss-p-l-30" },
- vue.toDisplayString($setup.state.coupon.description),
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- })) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- })
- ])
- ])
- ]),
- vue.createCommentVNode(" 适用商品 "),
- $setup.state.coupon.productScope === 1 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "all-user ss-flex ss-row-center ss-col-center"
- }, " 全场通用 ")) : (vue.openBlock(), vue.createBlock(_component_su_sticky, {
- key: 1,
- bgColor: "#fff"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "goods-title ss-p-20" },
- vue.toDisplayString($setup.state.coupon.productScope === 2 ? "指定商品可用" : "指定分类可用"),
- 1
- /* TEXT */
- ),
- $setup.state.coupon.productScope === 3 ? (vue.openBlock(), vue.createBlock(_component_su_tabs, {
- key: 0,
- scrollable: true,
- list: $setup.state.tabMaps,
- onChange: $setup.onTabsChange,
- current: $setup.state.currentTab
- }, null, 8, ["list", "current"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- })),
- vue.createCommentVNode(" 指定商品 "),
- $setup.state.coupon.productScope === 2 ? (vue.openBlock(), vue.createElementBlock("view", { key: 2 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
- vue.createVNode(_component_s_goods_column, {
- class: "ss-m-20",
- size: "lg",
- data: item,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id }),
- goodsFields: {
- title: { show: true },
- subtitle: { show: true },
- price: { show: true },
- original_price: { show: true },
- sales: { show: true },
- stock: { show: false }
- }
- }, null, 8, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 指定分类 "),
- $setup.state.coupon.productScope === 3 ? (vue.openBlock(), vue.createElementBlock("view", { key: 3 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
- vue.createVNode(_component_s_goods_column, {
- class: "ss-m-20",
- size: "lg",
- data: item,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id }),
- goodsFields: {
- title: { show: true },
- subtitle: { show: true },
- price: { show: true },
- original_price: { show: true },
- sales: { show: true },
- stock: { show: false }
- }
- }, null, 8, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 && $setup.state.coupon.productScope === 3 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 4,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true),
- $setup.state.coupon.productScope === 3 && $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 5,
- paddingTop: "0",
- icon: "/static/soldout-empty.png",
- text: "暂无商品"
- })) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesCouponDetail = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$j], ["__scopeId", "data-v-2d1fcfdf"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/coupon/detail.vue"]]);
- const emojiList = [
- { name: "[笑掉牙]", file: "xiaodiaoya.png" },
- { name: "[可爱]", file: "keai.png" },
- { name: "[冷酷]", file: "lengku.png" },
- { name: "[闭嘴]", file: "bizui.png" },
- { name: "[生气]", file: "shengqi.png" },
- { name: "[惊恐]", file: "jingkong.png" },
- { name: "[瞌睡]", file: "keshui.png" },
- { name: "[大笑]", file: "daxiao.png" },
- { name: "[爱心]", file: "aixin.png" },
- { name: "[坏笑]", file: "huaixiao.png" },
- { name: "[飞吻]", file: "feiwen.png" },
- { name: "[疑问]", file: "yiwen.png" },
- { name: "[开心]", file: "kaixin.png" },
- { name: "[发呆]", file: "fadai.png" },
- { name: "[流泪]", file: "liulei.png" },
- { name: "[汗颜]", file: "hanyan.png" },
- { name: "[惊悚]", file: "jingshu.png" },
- { name: "[困~]", file: "kun.png" },
- { name: "[心碎]", file: "xinsui.png" },
- { name: "[天使]", file: "tianshi.png" },
- { name: "[晕]", file: "yun.png" },
- { name: "[啊]", file: "a.png" },
- { name: "[愤怒]", file: "fennu.png" },
- { name: "[睡着]", file: "shuizhuo.png" },
- { name: "[面无表情]", file: "mianwubiaoqing.png" },
- { name: "[难过]", file: "nanguo.png" },
- { name: "[犯困]", file: "fankun.png" },
- { name: "[好吃]", file: "haochi.png" },
- { name: "[呕吐]", file: "outu.png" },
- { name: "[龇牙]", file: "ziya.png" },
- { name: "[懵比]", file: "mengbi.png" },
- { name: "[白眼]", file: "baiyan.png" },
- { name: "[饿死]", file: "esi.png" },
- { name: "[凶]", file: "xiong.png" },
- { name: "[感冒]", file: "ganmao.png" },
- { name: "[流汗]", file: "liuhan.png" },
- { name: "[笑哭]", file: "xiaoku.png" },
- { name: "[流口水]", file: "liukoushui.png" },
- { name: "[尴尬]", file: "ganga.png" },
- { name: "[惊讶]", file: "jingya.png" },
- { name: "[大惊]", file: "dajing.png" },
- { name: "[不好意思]", file: "buhaoyisi.png" },
- { name: "[大闹]", file: "danao.png" },
- { name: "[不可思议]", file: "bukesiyi.png" },
- { name: "[爱你]", file: "aini.png" },
- { name: "[红心]", file: "hongxin.png" },
- { name: "[点赞]", file: "dianzan.png" },
- { name: "[恶魔]", file: "emo.png" }
- ];
- let emojiPage = {};
- emojiList.forEach((item, index2) => {
- if (!emojiPage[Math.floor(index2 / 30) + 1]) {
- emojiPage[Math.floor(index2 / 30) + 1] = [];
- }
- emojiPage[Math.floor(index2 / 30) + 1].push(item);
- });
- const _sfc_main$j = {
- __name: "goods",
- props: {
- goodsData: {
- type: Object,
- default: {}
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- }, get isArray() {
- return lodashExports.isArray;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "goods ss-flex" }, [
- vue.createElementVNode("image", {
- class: "image",
- src: $setup.sheep.$url.cdn($props.goodsData.image),
- mode: "aspectFill"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "ss-flex-1" }, [
- vue.createElementVNode(
- "view",
- { class: "title ss-line-2" },
- vue.toDisplayString($props.goodsData.title),
- 1
- /* TEXT */
- ),
- $props.goodsData.subtitle ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "subtitle ss-line-1"
- },
- vue.toDisplayString($props.goodsData.subtitle),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- { class: "price ss-m-t-8" },
- " ¥" + vue.toDisplayString($setup.isArray($props.goodsData.price) ? $props.goodsData.price[0] : $props.goodsData.price),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const GoodsItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i], ["__scopeId", "data-v-820d22a6"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/chat/components/goods.vue"]]);
- const _sfc_main$i = {
- __name: "order",
- props: {
- from: String,
- orderData: {
- type: Object,
- default: {}
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props = __props;
- const __returned__ = { props, get sheep() {
- return sheep$1;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "order" }, [
- vue.createElementVNode("view", { class: "top ss-flex ss-row-between" }, [
- vue.createElementVNode(
- "span",
- null,
- vue.toDisplayString($props.orderData.order_sn),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "span",
- null,
- vue.toDisplayString($props.orderData.create_time.split(" ")[1]),
- 1
- /* TEXT */
- )
- ]),
- $props.from != "msg" ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList($props.orderData.items, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "bottom ss-flex",
- key: item
- }, [
- vue.createElementVNode("image", {
- class: "image",
- src: $setup.sheep.$url.cdn(item.goods_image),
- mode: "aspectFill"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "ss-flex-1" }, [
- vue.createElementVNode(
- "view",
- { class: "title ss-line-2" },
- vue.toDisplayString(item.goods_title),
- 1
- /* TEXT */
- ),
- item.goods_num ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "num ss-m-b-10"
- },
- " 数量:" + vue.toDisplayString(item.goods_num),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "ss-flex ss-row-between ss-m-t-8" }, [
- vue.createElementVNode(
- "span",
- { class: "price" },
- "¥" + vue.toDisplayString(item.goods_price),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "span",
- { class: "status" },
- vue.toDisplayString($props.orderData.status_text),
- 1
- /* TEXT */
- )
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- vue.renderList([$props.orderData.items[0]], (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "bottom ss-flex",
- key: item
- }, [
- vue.createElementVNode("image", {
- class: "image",
- src: $setup.sheep.$url.cdn(item.goods_image),
- mode: "aspectFill"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "ss-flex-1" }, [
- vue.createElementVNode(
- "view",
- { class: "title title-1 ss-line-1" },
- vue.toDisplayString(item.goods_title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "order-total ss-flex ss-row-between ss-m-t-8" }, [
- vue.createElementVNode(
- "span",
- null,
- "共" + vue.toDisplayString($props.orderData.items.length) + "件商品",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "span",
- null,
- "合计 ¥" + vue.toDisplayString($props.orderData.pay_fee),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "ss-flex ss-row-right ss-m-t-8" }, [
- vue.createElementVNode(
- "span",
- { class: "status" },
- vue.toDisplayString($props.orderData.status_text),
- 1
- /* TEXT */
- )
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }
- const OrderItem = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__scopeId", "data-v-a458419c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/chat/components/order.vue"]]);
- const _sfc_main$h = {
- __name: "select-popup",
- props: {
- mode: {
- type: String,
- default: "goods"
- },
- show: {
- type: Boolean,
- default: false
- }
- },
- emits: ["select", "close"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const emits = __emit;
- const props = __props;
- vue.watch(
- () => props.mode,
- () => {
- state.pagination.data = [];
- if (props.mode) {
- getList(state.pagination.page);
- }
- }
- );
- const state = vue.reactive({
- loadStatus: "",
- pagination: {
- data: [],
- current_page: 1,
- total: 1,
- last_page: 1
- }
- });
- async function getList(page2, list_rows = 5) {
- state.loadStatus = "loading";
- const res = props.mode == "goods" ? await SpuHistoryApi.getBrowseHistoryPage({
- page: page2,
- list_rows
- }) : await OrderApi.getOrderPage({
- page: page2,
- list_rows
- });
- let orderList = _$1.concat(state.pagination.data, res.data.data);
- state.pagination = {
- ...res.data,
- data: orderList
- };
- if (state.pagination.current_page < state.pagination.last_page) {
- state.loadStatus = "more";
- } else {
- state.loadStatus = "noMore";
- }
- }
- function loadmore() {
- if (state.loadStatus !== "noMore") {
- getList(state.pagination.current_page + 1);
- }
- }
- const __returned__ = { emits, props, state, getList, loadmore, reactive: vue.reactive, watch: vue.watch, get sheep() {
- return sheep$1;
- }, get _() {
- return _$1;
- }, GoodsItem, OrderItem, get OrderApi() {
- return OrderApi;
- }, get SpuHistoryApi() {
- return SpuHistoryApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- return vue.openBlock(), vue.createBlock(_component_su_popup, {
- show: $props.show,
- showClose: "",
- round: "10",
- backgroundColor: "#eee",
- onClose: _cache[0] || (_cache[0] = ($event) => $setup.emits("close"))
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "select-popup" }, [
- vue.createElementVNode("view", { class: "title" }, [
- vue.createElementVNode(
- "span",
- null,
- vue.toDisplayString($props.mode == "goods" ? "我的浏览" : "我的订单"),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "scroll-view",
- {
- class: "scroll-box",
- "scroll-y": "true",
- "scroll-with-animation": true,
- "show-scrollbar": false,
- onScrolltolower: $setup.loadmore
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.data, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "item",
- key: item,
- onClick: ($event) => $setup.emits("select", { type: $props.mode, data: item })
- }, [
- $props.mode == "goods" ? (vue.openBlock(), vue.createBlock($setup["GoodsItem"], {
- key: 0,
- goodsData: item.goods
- }, null, 8, ["goodsData"])) : vue.createCommentVNode("v-if", true),
- $props.mode == "order" ? (vue.openBlock(), vue.createBlock($setup["OrderItem"], {
- key: 1,
- orderData: item
- }, null, 8, ["orderData"])) : vue.createCommentVNode("v-if", true)
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createVNode(_component_uni_load_more, {
- status: $setup.state.loadStatus,
- "content-text": { contentdown: "上拉加载更多" }
- }, null, 8, ["status"])
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]);
- }
- const SelectPopup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g], ["__scopeId", "data-v-878522b0"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/chat/components/select-popup.vue"]]);
- var uniSocket_io = { exports: {} };
- (function(module, exports) {
- !function(t2, e2) {
- module.exports = e2();
- }(window, function() {
- return function(t2) {
- var e2 = {};
- function r2(n2) {
- if (e2[n2])
- return e2[n2].exports;
- var o2 = e2[n2] = { i: n2, l: false, exports: {} };
- return t2[n2].call(o2.exports, o2, o2.exports, r2), o2.l = true, o2.exports;
- }
- return r2.m = t2, r2.c = e2, r2.d = function(t3, e3, n2) {
- r2.o(t3, e3) || Object.defineProperty(t3, e3, { enumerable: true, get: n2 });
- }, r2.r = function(t3) {
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t3, "__esModule", { value: true });
- }, r2.t = function(t3, e3) {
- if (1 & e3 && (t3 = r2(t3)), 8 & e3)
- return t3;
- if (4 & e3 && "object" == typeof t3 && t3 && t3.__esModule)
- return t3;
- var n2 = /* @__PURE__ */ Object.create(null);
- if (r2.r(n2), Object.defineProperty(n2, "default", { enumerable: true, value: t3 }), 2 & e3 && "string" != typeof t3)
- for (var o2 in t3)
- r2.d(n2, o2, (function(e4) {
- return t3[e4];
- }).bind(null, o2));
- return n2;
- }, r2.n = function(t3) {
- var e3 = t3 && t3.__esModule ? function() {
- return t3.default;
- } : function() {
- return t3;
- };
- return r2.d(e3, "a", e3), e3;
- }, r2.o = function(t3, e3) {
- return Object.prototype.hasOwnProperty.call(t3, e3);
- }, r2.p = "", r2(r2.s = 22);
- }([function(t2, e2) {
- t2.exports = function() {
- return function() {
- };
- };
- }, function(t2, e2, r2) {
- function n2(t3) {
- if (t3)
- return function(t4) {
- for (var e3 in n2.prototype)
- t4[e3] = n2.prototype[e3];
- return t4;
- }(t3);
- }
- t2.exports = n2, n2.prototype.on = n2.prototype.addEventListener = function(t3, e3) {
- return this._callbacks = this._callbacks || {}, (this._callbacks["$" + t3] = this._callbacks["$" + t3] || []).push(e3), this;
- }, n2.prototype.once = function(t3, e3) {
- function r3() {
- this.off(t3, r3), e3.apply(this, arguments);
- }
- return r3.fn = e3, this.on(t3, r3), this;
- }, n2.prototype.off = n2.prototype.removeListener = n2.prototype.removeAllListeners = n2.prototype.removeEventListener = function(t3, e3) {
- if (this._callbacks = this._callbacks || {}, 0 == arguments.length)
- return this._callbacks = {}, this;
- var r3, n3 = this._callbacks["$" + t3];
- if (!n3)
- return this;
- if (1 == arguments.length)
- return delete this._callbacks["$" + t3], this;
- for (var o2 = 0; o2 < n3.length; o2++)
- if ((r3 = n3[o2]) === e3 || r3.fn === e3) {
- n3.splice(o2, 1);
- break;
- }
- return this;
- }, n2.prototype.emit = function(t3) {
- this._callbacks = this._callbacks || {};
- var e3 = [].slice.call(arguments, 1), r3 = this._callbacks["$" + t3];
- if (r3)
- for (var n3 = 0, o2 = (r3 = r3.slice(0)).length; n3 < o2; ++n3)
- r3[n3].apply(this, e3);
- return this;
- }, n2.prototype.listeners = function(t3) {
- return this._callbacks = this._callbacks || {}, this._callbacks["$" + t3] || [];
- }, n2.prototype.hasListeners = function(t3) {
- return !!this.listeners(t3).length;
- };
- }, function(t2, e2, r2) {
- var n2, o2 = r2(33), i2 = r2(16), s2 = r2(35), a2 = r2(36), c2 = r2(37);
- "undefined" != typeof ArrayBuffer && (n2 = r2(38));
- var h2 = "undefined" != typeof navigator && /Android/i.test(navigator.userAgent), u2 = "undefined" != typeof navigator && /PhantomJS/i.test(navigator.userAgent), f2 = h2 || u2;
- e2.protocol = 3;
- var p2 = e2.packets = { open: 0, close: 1, ping: 2, pong: 3, message: 4, upgrade: 5, noop: 6 }, l2 = o2(p2), d2 = { type: "error", data: "parser error" }, y2 = r2(39);
- function g2(t3, e3, r3) {
- for (var n3 = new Array(t3.length), o3 = a2(t3.length, r3), i3 = function(t4, r4, o4) {
- e3(r4, function(e4, r5) {
- n3[t4] = r5, o4(e4, n3);
- });
- }, s3 = 0; s3 < t3.length; s3++)
- i3(s3, t3[s3], o3);
- }
- e2.encodePacket = function(t3, r3, n3, o3) {
- "function" == typeof r3 && (o3 = r3, r3 = false), "function" == typeof n3 && (o3 = n3, n3 = null);
- var i3 = void 0 === t3.data ? void 0 : t3.data.buffer || t3.data;
- if ("undefined" != typeof ArrayBuffer && i3 instanceof ArrayBuffer)
- return function(t4, r4, n4) {
- if (!r4)
- return e2.encodeBase64Packet(t4, n4);
- var o4 = t4.data, i4 = new Uint8Array(o4), s4 = new Uint8Array(1 + o4.byteLength);
- s4[0] = p2[t4.type];
- for (var a3 = 0; a3 < i4.length; a3++)
- s4[a3 + 1] = i4[a3];
- return n4(s4.buffer);
- }(t3, r3, o3);
- if (void 0 !== y2 && i3 instanceof y2)
- return function(t4, r4, n4) {
- if (!r4)
- return e2.encodeBase64Packet(t4, n4);
- if (f2)
- return function(t5, r5, n5) {
- if (!r5)
- return e2.encodeBase64Packet(t5, n5);
- var o5 = new FileReader();
- return o5.onload = function() {
- e2.encodePacket({ type: t5.type, data: o5.result }, r5, true, n5);
- }, o5.readAsArrayBuffer(t5.data);
- }(t4, r4, n4);
- var o4 = new Uint8Array(1);
- o4[0] = p2[t4.type];
- var i4 = new y2([o4.buffer, t4.data]);
- return n4(i4);
- }(t3, r3, o3);
- if (i3 && i3.base64)
- return function(t4, r4) {
- var n4 = "b" + e2.packets[t4.type] + t4.data.data;
- return r4(n4);
- }(t3, o3);
- var s3 = p2[t3.type];
- return void 0 !== t3.data && (s3 += n3 ? c2.encode(String(t3.data), { strict: false }) : String(t3.data)), o3("" + s3);
- }, e2.encodeBase64Packet = function(t3, r3) {
- var n3, o3 = "b" + e2.packets[t3.type];
- if (void 0 !== y2 && t3.data instanceof y2) {
- var i3 = new FileReader();
- return i3.onload = function() {
- var t4 = i3.result.split(",")[1];
- r3(o3 + t4);
- }, i3.readAsDataURL(t3.data);
- }
- try {
- n3 = String.fromCharCode.apply(null, new Uint8Array(t3.data));
- } catch (e3) {
- for (var s3 = new Uint8Array(t3.data), a3 = new Array(s3.length), c3 = 0; c3 < s3.length; c3++)
- a3[c3] = s3[c3];
- n3 = String.fromCharCode.apply(null, a3);
- }
- return o3 += btoa(n3), r3(o3);
- }, e2.decodePacket = function(t3, r3, n3) {
- if (void 0 === t3)
- return d2;
- if ("string" == typeof t3) {
- if ("b" === t3.charAt(0))
- return e2.decodeBase64Packet(t3.substr(1), r3);
- if (n3 && false === (t3 = function(t4) {
- try {
- t4 = c2.decode(t4, { strict: false });
- } catch (t5) {
- return false;
- }
- return t4;
- }(t3)))
- return d2;
- var o3 = t3.charAt(0);
- return Number(o3) == o3 && l2[o3] ? t3.length > 1 ? { type: l2[o3], data: t3.substring(1) } : { type: l2[o3] } : d2;
- }
- o3 = new Uint8Array(t3)[0];
- var i3 = s2(t3, 1);
- return y2 && "blob" === r3 && (i3 = new y2([i3])), { type: l2[o3], data: i3 };
- }, e2.decodeBase64Packet = function(t3, e3) {
- var r3 = l2[t3.charAt(0)];
- if (!n2)
- return { type: r3, data: { base64: true, data: t3.substr(1) } };
- var o3 = n2.decode(t3.substr(1));
- return "blob" === e3 && y2 && (o3 = new y2([o3])), { type: r3, data: o3 };
- }, e2.encodePayload = function(t3, r3, n3) {
- "function" == typeof r3 && (n3 = r3, r3 = null);
- var o3 = i2(t3);
- if (r3 && o3)
- return y2 && !f2 ? e2.encodePayloadAsBlob(t3, n3) : e2.encodePayloadAsArrayBuffer(t3, n3);
- if (!t3.length)
- return n3("0:");
- g2(t3, function(t4, n4) {
- e2.encodePacket(t4, !!o3 && r3, false, function(t5) {
- n4(null, function(t6) {
- return t6.length + ":" + t6;
- }(t5));
- });
- }, function(t4, e3) {
- return n3(e3.join(""));
- });
- }, e2.decodePayload = function(t3, r3, n3) {
- if ("string" != typeof t3)
- return e2.decodePayloadAsBinary(t3, r3, n3);
- var o3;
- if ("function" == typeof r3 && (n3 = r3, r3 = null), "" === t3)
- return n3(d2, 0, 1);
- for (var i3, s3, a3 = "", c3 = 0, h3 = t3.length; c3 < h3; c3++) {
- var u3 = t3.charAt(c3);
- if (":" === u3) {
- if ("" === a3 || a3 != (i3 = Number(a3)))
- return n3(d2, 0, 1);
- if (a3 != (s3 = t3.substr(c3 + 1, i3)).length)
- return n3(d2, 0, 1);
- if (s3.length) {
- if (o3 = e2.decodePacket(s3, r3, false), d2.type === o3.type && d2.data === o3.data)
- return n3(d2, 0, 1);
- if (false === n3(o3, c3 + i3, h3))
- return;
- }
- c3 += i3, a3 = "";
- } else
- a3 += u3;
- }
- return "" !== a3 ? n3(d2, 0, 1) : void 0;
- }, e2.encodePayloadAsArrayBuffer = function(t3, r3) {
- if (!t3.length)
- return r3(new ArrayBuffer(0));
- g2(t3, function(t4, r4) {
- e2.encodePacket(t4, true, true, function(t5) {
- return r4(null, t5);
- });
- }, function(t4, e3) {
- var n3 = e3.reduce(function(t5, e4) {
- var r4;
- return t5 + (r4 = "string" == typeof e4 ? e4.length : e4.byteLength).toString().length + r4 + 2;
- }, 0), o3 = new Uint8Array(n3), i3 = 0;
- return e3.forEach(function(t5) {
- var e4 = "string" == typeof t5, r4 = t5;
- if (e4) {
- for (var n4 = new Uint8Array(t5.length), s3 = 0; s3 < t5.length; s3++)
- n4[s3] = t5.charCodeAt(s3);
- r4 = n4.buffer;
- }
- o3[i3++] = e4 ? 0 : 1;
- var a3 = r4.byteLength.toString();
- for (s3 = 0; s3 < a3.length; s3++)
- o3[i3++] = parseInt(a3[s3]);
- o3[i3++] = 255;
- for (n4 = new Uint8Array(r4), s3 = 0; s3 < n4.length; s3++)
- o3[i3++] = n4[s3];
- }), r3(o3.buffer);
- });
- }, e2.encodePayloadAsBlob = function(t3, r3) {
- g2(t3, function(t4, r4) {
- e2.encodePacket(t4, true, true, function(t5) {
- var e3 = new Uint8Array(1);
- if (e3[0] = 1, "string" == typeof t5) {
- for (var n3 = new Uint8Array(t5.length), o3 = 0; o3 < t5.length; o3++)
- n3[o3] = t5.charCodeAt(o3);
- t5 = n3.buffer, e3[0] = 0;
- }
- var i3 = (t5 instanceof ArrayBuffer ? t5.byteLength : t5.size).toString(), s3 = new Uint8Array(i3.length + 1);
- for (o3 = 0; o3 < i3.length; o3++)
- s3[o3] = parseInt(i3[o3]);
- if (s3[i3.length] = 255, y2) {
- var a3 = new y2([e3.buffer, s3.buffer, t5]);
- r4(null, a3);
- }
- });
- }, function(t4, e3) {
- return r3(new y2(e3));
- });
- }, e2.decodePayloadAsBinary = function(t3, r3, n3) {
- "function" == typeof r3 && (n3 = r3, r3 = null);
- for (var o3 = t3, i3 = []; o3.byteLength > 0; ) {
- for (var a3 = new Uint8Array(o3), c3 = 0 === a3[0], h3 = "", u3 = 1; 255 !== a3[u3]; u3++) {
- if (h3.length > 310)
- return n3(d2, 0, 1);
- h3 += a3[u3];
- }
- o3 = s2(o3, 2 + h3.length), h3 = parseInt(h3);
- var f3 = s2(o3, 0, h3);
- if (c3)
- try {
- f3 = String.fromCharCode.apply(null, new Uint8Array(f3));
- } catch (t4) {
- var p3 = new Uint8Array(f3);
- f3 = "";
- for (u3 = 0; u3 < p3.length; u3++)
- f3 += String.fromCharCode(p3[u3]);
- }
- i3.push(f3), o3 = s2(o3, h3);
- }
- var l3 = i3.length;
- i3.forEach(function(t4, o4) {
- n3(e2.decodePacket(t4, r3, true), o4, l3);
- });
- };
- }, function(t2, e2) {
- e2.encode = function(t3) {
- var e3 = "";
- for (var r2 in t3)
- t3.hasOwnProperty(r2) && (e3.length && (e3 += "&"), e3 += encodeURIComponent(r2) + "=" + encodeURIComponent(t3[r2]));
- return e3;
- }, e2.decode = function(t3) {
- for (var e3 = {}, r2 = t3.split("&"), n2 = 0, o2 = r2.length; n2 < o2; n2++) {
- var i2 = r2[n2].split("=");
- e3[decodeURIComponent(i2[0])] = decodeURIComponent(i2[1]);
- }
- return e3;
- };
- }, function(t2, e2) {
- t2.exports = function(t3, e3) {
- var r2 = function() {
- };
- r2.prototype = e3.prototype, t3.prototype = new r2(), t3.prototype.constructor = t3;
- };
- }, function(t2, e2, r2) {
- var n2 = r2(0)("socket.io-parser"), o2 = r2(1), i2 = r2(25), s2 = r2(10), a2 = r2(11);
- function c2() {
- }
- e2.protocol = 4, e2.types = ["CONNECT", "DISCONNECT", "EVENT", "ACK", "ERROR", "BINARY_EVENT", "BINARY_ACK"], e2.CONNECT = 0, e2.DISCONNECT = 1, e2.EVENT = 2, e2.ACK = 3, e2.ERROR = 4, e2.BINARY_EVENT = 5, e2.BINARY_ACK = 6, e2.Encoder = c2, e2.Decoder = f2;
- var h2 = e2.ERROR + '"encode error"';
- function u2(t3) {
- var r3 = "" + t3.type;
- if (e2.BINARY_EVENT !== t3.type && e2.BINARY_ACK !== t3.type || (r3 += t3.attachments + "-"), t3.nsp && "/" !== t3.nsp && (r3 += t3.nsp + ","), null != t3.id && (r3 += t3.id), null != t3.data) {
- var o3 = function(t4) {
- try {
- return JSON.stringify(t4);
- } catch (t5) {
- return false;
- }
- }(t3.data);
- if (false === o3)
- return h2;
- r3 += o3;
- }
- return n2("encoded %j as %s", t3, r3), r3;
- }
- function f2() {
- this.reconstructor = null;
- }
- function p2(t3) {
- this.reconPack = t3, this.buffers = [];
- }
- function l2(t3) {
- return { type: e2.ERROR, data: "parser error: " + t3 };
- }
- c2.prototype.encode = function(t3, r3) {
- (n2("encoding packet %j", t3), e2.BINARY_EVENT === t3.type || e2.BINARY_ACK === t3.type) ? function(t4, e3) {
- i2.removeBlobs(t4, function(t5) {
- var r4 = i2.deconstructPacket(t5), n3 = u2(r4.packet), o3 = r4.buffers;
- o3.unshift(n3), e3(o3);
- });
- }(t3, r3) : r3([u2(t3)]);
- }, o2(f2.prototype), f2.prototype.add = function(t3) {
- var r3;
- if ("string" == typeof t3)
- r3 = function(t4) {
- var r4 = 0, o3 = { type: Number(t4.charAt(0)) };
- if (null == e2.types[o3.type])
- return l2("unknown packet type " + o3.type);
- if (e2.BINARY_EVENT === o3.type || e2.BINARY_ACK === o3.type) {
- for (var i3 = ""; "-" !== t4.charAt(++r4) && (i3 += t4.charAt(r4), r4 != t4.length); )
- ;
- if (i3 != Number(i3) || "-" !== t4.charAt(r4))
- throw new Error("Illegal attachments");
- o3.attachments = Number(i3);
- }
- if ("/" === t4.charAt(r4 + 1))
- for (o3.nsp = ""; ++r4; ) {
- if ("," === (c3 = t4.charAt(r4)))
- break;
- if (o3.nsp += c3, r4 === t4.length)
- break;
- }
- else
- o3.nsp = "/";
- var a3 = t4.charAt(r4 + 1);
- if ("" !== a3 && Number(a3) == a3) {
- for (o3.id = ""; ++r4; ) {
- var c3;
- if (null == (c3 = t4.charAt(r4)) || Number(c3) != c3) {
- --r4;
- break;
- }
- if (o3.id += t4.charAt(r4), r4 === t4.length)
- break;
- }
- o3.id = Number(o3.id);
- }
- if (t4.charAt(++r4)) {
- var h3 = function(t5) {
- try {
- return JSON.parse(t5);
- } catch (t6) {
- return false;
- }
- }(t4.substr(r4));
- if (!(false !== h3 && (o3.type === e2.ERROR || s2(h3))))
- return l2("invalid payload");
- o3.data = h3;
- }
- return n2("decoded %s as %j", t4, o3), o3;
- }(t3), e2.BINARY_EVENT === r3.type || e2.BINARY_ACK === r3.type ? (this.reconstructor = new p2(r3), 0 === this.reconstructor.reconPack.attachments && this.emit("decoded", r3)) : this.emit("decoded", r3);
- else {
- if (!a2(t3) && !t3.base64)
- throw new Error("Unknown type: " + t3);
- if (!this.reconstructor)
- throw new Error("got binary data when not reconstructing a packet");
- (r3 = this.reconstructor.takeBinaryData(t3)) && (this.reconstructor = null, this.emit("decoded", r3));
- }
- }, f2.prototype.destroy = function() {
- this.reconstructor && this.reconstructor.finishedReconstruction();
- }, p2.prototype.takeBinaryData = function(t3) {
- if (this.buffers.push(t3), this.buffers.length === this.reconPack.attachments) {
- var e3 = i2.reconstructPacket(this.reconPack, this.buffers);
- return this.finishedReconstruction(), e3;
- }
- return null;
- }, p2.prototype.finishedReconstruction = function() {
- this.reconPack = null, this.buffers = [];
- };
- }, function(t2, e2, r2) {
- (function(t3) {
- /*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <http://feross.org>
- * @license MIT
- */
- var n2 = r2(26), o2 = r2(27), i2 = r2(28);
- function s2() {
- return c2.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
- }
- function a2(t4, e3) {
- if (s2() < e3)
- throw new RangeError("Invalid typed array length");
- return c2.TYPED_ARRAY_SUPPORT ? (t4 = new Uint8Array(e3)).__proto__ = c2.prototype : (null === t4 && (t4 = new c2(e3)), t4.length = e3), t4;
- }
- function c2(t4, e3, r3) {
- if (!(c2.TYPED_ARRAY_SUPPORT || this instanceof c2))
- return new c2(t4, e3, r3);
- if ("number" == typeof t4) {
- if ("string" == typeof e3)
- throw new Error("If encoding is specified then the first argument must be a string");
- return f2(this, t4);
- }
- return h2(this, t4, e3, r3);
- }
- function h2(t4, e3, r3, n3) {
- if ("number" == typeof e3)
- throw new TypeError('"value" argument must not be a number');
- return "undefined" != typeof ArrayBuffer && e3 instanceof ArrayBuffer ? function(t5, e4, r4, n4) {
- if (e4.byteLength, r4 < 0 || e4.byteLength < r4)
- throw new RangeError("'offset' is out of bounds");
- if (e4.byteLength < r4 + (n4 || 0))
- throw new RangeError("'length' is out of bounds");
- e4 = void 0 === r4 && void 0 === n4 ? new Uint8Array(e4) : void 0 === n4 ? new Uint8Array(e4, r4) : new Uint8Array(e4, r4, n4);
- c2.TYPED_ARRAY_SUPPORT ? (t5 = e4).__proto__ = c2.prototype : t5 = p2(t5, e4);
- return t5;
- }(t4, e3, r3, n3) : "string" == typeof e3 ? function(t5, e4, r4) {
- "string" == typeof r4 && "" !== r4 || (r4 = "utf8");
- if (!c2.isEncoding(r4))
- throw new TypeError('"encoding" must be a valid string encoding');
- var n4 = 0 | d2(e4, r4), o3 = (t5 = a2(t5, n4)).write(e4, r4);
- o3 !== n4 && (t5 = t5.slice(0, o3));
- return t5;
- }(t4, e3, r3) : function(t5, e4) {
- if (c2.isBuffer(e4)) {
- var r4 = 0 | l2(e4.length);
- return 0 === (t5 = a2(t5, r4)).length || e4.copy(t5, 0, 0, r4), t5;
- }
- if (e4) {
- if ("undefined" != typeof ArrayBuffer && e4.buffer instanceof ArrayBuffer || "length" in e4)
- return "number" != typeof e4.length || (n4 = e4.length) != n4 ? a2(t5, 0) : p2(t5, e4);
- if ("Buffer" === e4.type && i2(e4.data))
- return p2(t5, e4.data);
- }
- var n4;
- throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
- }(t4, e3);
- }
- function u2(t4) {
- if ("number" != typeof t4)
- throw new TypeError('"size" argument must be a number');
- if (t4 < 0)
- throw new RangeError('"size" argument must not be negative');
- }
- function f2(t4, e3) {
- if (u2(e3), t4 = a2(t4, e3 < 0 ? 0 : 0 | l2(e3)), !c2.TYPED_ARRAY_SUPPORT)
- for (var r3 = 0; r3 < e3; ++r3)
- t4[r3] = 0;
- return t4;
- }
- function p2(t4, e3) {
- var r3 = e3.length < 0 ? 0 : 0 | l2(e3.length);
- t4 = a2(t4, r3);
- for (var n3 = 0; n3 < r3; n3 += 1)
- t4[n3] = 255 & e3[n3];
- return t4;
- }
- function l2(t4) {
- if (t4 >= s2())
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + s2().toString(16) + " bytes");
- return 0 | t4;
- }
- function d2(t4, e3) {
- if (c2.isBuffer(t4))
- return t4.length;
- if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t4) || t4 instanceof ArrayBuffer))
- return t4.byteLength;
- "string" != typeof t4 && (t4 = "" + t4);
- var r3 = t4.length;
- if (0 === r3)
- return 0;
- for (var n3 = false; ; )
- switch (e3) {
- case "ascii":
- case "latin1":
- case "binary":
- return r3;
- case "utf8":
- case "utf-8":
- case void 0:
- return q2(t4).length;
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return 2 * r3;
- case "hex":
- return r3 >>> 1;
- case "base64":
- return Y2(t4).length;
- default:
- if (n3)
- return q2(t4).length;
- e3 = ("" + e3).toLowerCase(), n3 = true;
- }
- }
- function y2(t4, e3, r3) {
- var n3 = false;
- if ((void 0 === e3 || e3 < 0) && (e3 = 0), e3 > this.length)
- return "";
- if ((void 0 === r3 || r3 > this.length) && (r3 = this.length), r3 <= 0)
- return "";
- if ((r3 >>>= 0) <= (e3 >>>= 0))
- return "";
- for (t4 || (t4 = "utf8"); ; )
- switch (t4) {
- case "hex":
- return C2(this, e3, r3);
- case "utf8":
- case "utf-8":
- return x(this, e3, r3);
- case "ascii":
- return R2(this, e3, r3);
- case "latin1":
- case "binary":
- return S2(this, e3, r3);
- case "base64":
- return _2(this, e3, r3);
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return P2(this, e3, r3);
- default:
- if (n3)
- throw new TypeError("Unknown encoding: " + t4);
- t4 = (t4 + "").toLowerCase(), n3 = true;
- }
- }
- function g2(t4, e3, r3) {
- var n3 = t4[e3];
- t4[e3] = t4[r3], t4[r3] = n3;
- }
- function v2(t4, e3, r3, n3, o3) {
- if (0 === t4.length)
- return -1;
- if ("string" == typeof r3 ? (n3 = r3, r3 = 0) : r3 > 2147483647 ? r3 = 2147483647 : r3 < -2147483648 && (r3 = -2147483648), r3 = +r3, isNaN(r3) && (r3 = o3 ? 0 : t4.length - 1), r3 < 0 && (r3 = t4.length + r3), r3 >= t4.length) {
- if (o3)
- return -1;
- r3 = t4.length - 1;
- } else if (r3 < 0) {
- if (!o3)
- return -1;
- r3 = 0;
- }
- if ("string" == typeof e3 && (e3 = c2.from(e3, n3)), c2.isBuffer(e3))
- return 0 === e3.length ? -1 : m2(t4, e3, r3, n3, o3);
- if ("number" == typeof e3)
- return e3 &= 255, c2.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? o3 ? Uint8Array.prototype.indexOf.call(t4, e3, r3) : Uint8Array.prototype.lastIndexOf.call(t4, e3, r3) : m2(t4, [e3], r3, n3, o3);
- throw new TypeError("val must be string, number or Buffer");
- }
- function m2(t4, e3, r3, n3, o3) {
- var i3, s3 = 1, a3 = t4.length, c3 = e3.length;
- if (void 0 !== n3 && ("ucs2" === (n3 = String(n3).toLowerCase()) || "ucs-2" === n3 || "utf16le" === n3 || "utf-16le" === n3)) {
- if (t4.length < 2 || e3.length < 2)
- return -1;
- s3 = 2, a3 /= 2, c3 /= 2, r3 /= 2;
- }
- function h3(t5, e4) {
- return 1 === s3 ? t5[e4] : t5.readUInt16BE(e4 * s3);
- }
- if (o3) {
- var u3 = -1;
- for (i3 = r3; i3 < a3; i3++)
- if (h3(t4, i3) === h3(e3, -1 === u3 ? 0 : i3 - u3)) {
- if (-1 === u3 && (u3 = i3), i3 - u3 + 1 === c3)
- return u3 * s3;
- } else
- -1 !== u3 && (i3 -= i3 - u3), u3 = -1;
- } else
- for (r3 + c3 > a3 && (r3 = a3 - c3), i3 = r3; i3 >= 0; i3--) {
- for (var f3 = true, p3 = 0; p3 < c3; p3++)
- if (h3(t4, i3 + p3) !== h3(e3, p3)) {
- f3 = false;
- break;
- }
- if (f3)
- return i3;
- }
- return -1;
- }
- function b2(t4, e3, r3, n3) {
- r3 = Number(r3) || 0;
- var o3 = t4.length - r3;
- n3 ? (n3 = Number(n3)) > o3 && (n3 = o3) : n3 = o3;
- var i3 = e3.length;
- if (i3 % 2 != 0)
- throw new TypeError("Invalid hex string");
- n3 > i3 / 2 && (n3 = i3 / 2);
- for (var s3 = 0; s3 < n3; ++s3) {
- var a3 = parseInt(e3.substr(2 * s3, 2), 16);
- if (isNaN(a3))
- return s3;
- t4[r3 + s3] = a3;
- }
- return s3;
- }
- function w2(t4, e3, r3, n3) {
- return H2(q2(e3, t4.length - r3), t4, r3, n3);
- }
- function A2(t4, e3, r3, n3) {
- return H2(function(t5) {
- for (var e4 = [], r4 = 0; r4 < t5.length; ++r4)
- e4.push(255 & t5.charCodeAt(r4));
- return e4;
- }(e3), t4, r3, n3);
- }
- function k(t4, e3, r3, n3) {
- return A2(t4, e3, r3, n3);
- }
- function E2(t4, e3, r3, n3) {
- return H2(Y2(e3), t4, r3, n3);
- }
- function B2(t4, e3, r3, n3) {
- return H2(function(t5, e4) {
- for (var r4, n4, o3, i3 = [], s3 = 0; s3 < t5.length && !((e4 -= 2) < 0); ++s3)
- r4 = t5.charCodeAt(s3), n4 = r4 >> 8, o3 = r4 % 256, i3.push(o3), i3.push(n4);
- return i3;
- }(e3, t4.length - r3), t4, r3, n3);
- }
- function _2(t4, e3, r3) {
- return 0 === e3 && r3 === t4.length ? n2.fromByteArray(t4) : n2.fromByteArray(t4.slice(e3, r3));
- }
- function x(t4, e3, r3) {
- r3 = Math.min(t4.length, r3);
- for (var n3 = [], o3 = e3; o3 < r3; ) {
- var i3, s3, a3, c3, h3 = t4[o3], u3 = null, f3 = h3 > 239 ? 4 : h3 > 223 ? 3 : h3 > 191 ? 2 : 1;
- if (o3 + f3 <= r3)
- switch (f3) {
- case 1:
- h3 < 128 && (u3 = h3);
- break;
- case 2:
- 128 == (192 & (i3 = t4[o3 + 1])) && (c3 = (31 & h3) << 6 | 63 & i3) > 127 && (u3 = c3);
- break;
- case 3:
- i3 = t4[o3 + 1], s3 = t4[o3 + 2], 128 == (192 & i3) && 128 == (192 & s3) && (c3 = (15 & h3) << 12 | (63 & i3) << 6 | 63 & s3) > 2047 && (c3 < 55296 || c3 > 57343) && (u3 = c3);
- break;
- case 4:
- i3 = t4[o3 + 1], s3 = t4[o3 + 2], a3 = t4[o3 + 3], 128 == (192 & i3) && 128 == (192 & s3) && 128 == (192 & a3) && (c3 = (15 & h3) << 18 | (63 & i3) << 12 | (63 & s3) << 6 | 63 & a3) > 65535 && c3 < 1114112 && (u3 = c3);
- }
- null === u3 ? (u3 = 65533, f3 = 1) : u3 > 65535 && (u3 -= 65536, n3.push(u3 >>> 10 & 1023 | 55296), u3 = 56320 | 1023 & u3), n3.push(u3), o3 += f3;
- }
- return function(t5) {
- var e4 = t5.length;
- if (e4 <= 4096)
- return String.fromCharCode.apply(String, t5);
- var r4 = "", n4 = 0;
- for (; n4 < e4; )
- r4 += String.fromCharCode.apply(String, t5.slice(n4, n4 += 4096));
- return r4;
- }(n3);
- }
- e2.Buffer = c2, e2.SlowBuffer = function(t4) {
- +t4 != t4 && (t4 = 0);
- return c2.alloc(+t4);
- }, e2.INSPECT_MAX_BYTES = 50, c2.TYPED_ARRAY_SUPPORT = void 0 !== t3.TYPED_ARRAY_SUPPORT ? t3.TYPED_ARRAY_SUPPORT : function() {
- try {
- var t4 = new Uint8Array(1);
- return t4.__proto__ = { __proto__: Uint8Array.prototype, foo: function() {
- return 42;
- } }, 42 === t4.foo() && "function" == typeof t4.subarray && 0 === t4.subarray(1, 1).byteLength;
- } catch (t5) {
- return false;
- }
- }(), e2.kMaxLength = s2(), c2.poolSize = 8192, c2._augment = function(t4) {
- return t4.__proto__ = c2.prototype, t4;
- }, c2.from = function(t4, e3, r3) {
- return h2(null, t4, e3, r3);
- }, c2.TYPED_ARRAY_SUPPORT && (c2.prototype.__proto__ = Uint8Array.prototype, c2.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && c2[Symbol.species] === c2 && Object.defineProperty(c2, Symbol.species, { value: null, configurable: true })), c2.alloc = function(t4, e3, r3) {
- return function(t5, e4, r4, n3) {
- return u2(e4), e4 <= 0 ? a2(t5, e4) : void 0 !== r4 ? "string" == typeof n3 ? a2(t5, e4).fill(r4, n3) : a2(t5, e4).fill(r4) : a2(t5, e4);
- }(null, t4, e3, r3);
- }, c2.allocUnsafe = function(t4) {
- return f2(null, t4);
- }, c2.allocUnsafeSlow = function(t4) {
- return f2(null, t4);
- }, c2.isBuffer = function(t4) {
- return !(null == t4 || !t4._isBuffer);
- }, c2.compare = function(t4, e3) {
- if (!c2.isBuffer(t4) || !c2.isBuffer(e3))
- throw new TypeError("Arguments must be Buffers");
- if (t4 === e3)
- return 0;
- for (var r3 = t4.length, n3 = e3.length, o3 = 0, i3 = Math.min(r3, n3); o3 < i3; ++o3)
- if (t4[o3] !== e3[o3]) {
- r3 = t4[o3], n3 = e3[o3];
- break;
- }
- return r3 < n3 ? -1 : n3 < r3 ? 1 : 0;
- }, c2.isEncoding = function(t4) {
- switch (String(t4).toLowerCase()) {
- case "hex":
- case "utf8":
- case "utf-8":
- case "ascii":
- case "latin1":
- case "binary":
- case "base64":
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return true;
- default:
- return false;
- }
- }, c2.concat = function(t4, e3) {
- if (!i2(t4))
- throw new TypeError('"list" argument must be an Array of Buffers');
- if (0 === t4.length)
- return c2.alloc(0);
- var r3;
- if (void 0 === e3)
- for (e3 = 0, r3 = 0; r3 < t4.length; ++r3)
- e3 += t4[r3].length;
- var n3 = c2.allocUnsafe(e3), o3 = 0;
- for (r3 = 0; r3 < t4.length; ++r3) {
- var s3 = t4[r3];
- if (!c2.isBuffer(s3))
- throw new TypeError('"list" argument must be an Array of Buffers');
- s3.copy(n3, o3), o3 += s3.length;
- }
- return n3;
- }, c2.byteLength = d2, c2.prototype._isBuffer = true, c2.prototype.swap16 = function() {
- var t4 = this.length;
- if (t4 % 2 != 0)
- throw new RangeError("Buffer size must be a multiple of 16-bits");
- for (var e3 = 0; e3 < t4; e3 += 2)
- g2(this, e3, e3 + 1);
- return this;
- }, c2.prototype.swap32 = function() {
- var t4 = this.length;
- if (t4 % 4 != 0)
- throw new RangeError("Buffer size must be a multiple of 32-bits");
- for (var e3 = 0; e3 < t4; e3 += 4)
- g2(this, e3, e3 + 3), g2(this, e3 + 1, e3 + 2);
- return this;
- }, c2.prototype.swap64 = function() {
- var t4 = this.length;
- if (t4 % 8 != 0)
- throw new RangeError("Buffer size must be a multiple of 64-bits");
- for (var e3 = 0; e3 < t4; e3 += 8)
- g2(this, e3, e3 + 7), g2(this, e3 + 1, e3 + 6), g2(this, e3 + 2, e3 + 5), g2(this, e3 + 3, e3 + 4);
- return this;
- }, c2.prototype.toString = function() {
- var t4 = 0 | this.length;
- return 0 === t4 ? "" : 0 === arguments.length ? x(this, 0, t4) : y2.apply(this, arguments);
- }, c2.prototype.equals = function(t4) {
- if (!c2.isBuffer(t4))
- throw new TypeError("Argument must be a Buffer");
- return this === t4 || 0 === c2.compare(this, t4);
- }, c2.prototype.inspect = function() {
- var t4 = "", r3 = e2.INSPECT_MAX_BYTES;
- return this.length > 0 && (t4 = this.toString("hex", 0, r3).match(/.{2}/g).join(" "), this.length > r3 && (t4 += " ... ")), "<Buffer " + t4 + ">";
- }, c2.prototype.compare = function(t4, e3, r3, n3, o3) {
- if (!c2.isBuffer(t4))
- throw new TypeError("Argument must be a Buffer");
- if (void 0 === e3 && (e3 = 0), void 0 === r3 && (r3 = t4 ? t4.length : 0), void 0 === n3 && (n3 = 0), void 0 === o3 && (o3 = this.length), e3 < 0 || r3 > t4.length || n3 < 0 || o3 > this.length)
- throw new RangeError("out of range index");
- if (n3 >= o3 && e3 >= r3)
- return 0;
- if (n3 >= o3)
- return -1;
- if (e3 >= r3)
- return 1;
- if (this === t4)
- return 0;
- for (var i3 = (o3 >>>= 0) - (n3 >>>= 0), s3 = (r3 >>>= 0) - (e3 >>>= 0), a3 = Math.min(i3, s3), h3 = this.slice(n3, o3), u3 = t4.slice(e3, r3), f3 = 0; f3 < a3; ++f3)
- if (h3[f3] !== u3[f3]) {
- i3 = h3[f3], s3 = u3[f3];
- break;
- }
- return i3 < s3 ? -1 : s3 < i3 ? 1 : 0;
- }, c2.prototype.includes = function(t4, e3, r3) {
- return -1 !== this.indexOf(t4, e3, r3);
- }, c2.prototype.indexOf = function(t4, e3, r3) {
- return v2(this, t4, e3, r3, true);
- }, c2.prototype.lastIndexOf = function(t4, e3, r3) {
- return v2(this, t4, e3, r3, false);
- }, c2.prototype.write = function(t4, e3, r3, n3) {
- if (void 0 === e3)
- n3 = "utf8", r3 = this.length, e3 = 0;
- else if (void 0 === r3 && "string" == typeof e3)
- n3 = e3, r3 = this.length, e3 = 0;
- else {
- if (!isFinite(e3))
- throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
- e3 |= 0, isFinite(r3) ? (r3 |= 0, void 0 === n3 && (n3 = "utf8")) : (n3 = r3, r3 = void 0);
- }
- var o3 = this.length - e3;
- if ((void 0 === r3 || r3 > o3) && (r3 = o3), t4.length > 0 && (r3 < 0 || e3 < 0) || e3 > this.length)
- throw new RangeError("Attempt to write outside buffer bounds");
- n3 || (n3 = "utf8");
- for (var i3 = false; ; )
- switch (n3) {
- case "hex":
- return b2(this, t4, e3, r3);
- case "utf8":
- case "utf-8":
- return w2(this, t4, e3, r3);
- case "ascii":
- return A2(this, t4, e3, r3);
- case "latin1":
- case "binary":
- return k(this, t4, e3, r3);
- case "base64":
- return E2(this, t4, e3, r3);
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return B2(this, t4, e3, r3);
- default:
- if (i3)
- throw new TypeError("Unknown encoding: " + n3);
- n3 = ("" + n3).toLowerCase(), i3 = true;
- }
- }, c2.prototype.toJSON = function() {
- return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
- };
- function R2(t4, e3, r3) {
- var n3 = "";
- r3 = Math.min(t4.length, r3);
- for (var o3 = e3; o3 < r3; ++o3)
- n3 += String.fromCharCode(127 & t4[o3]);
- return n3;
- }
- function S2(t4, e3, r3) {
- var n3 = "";
- r3 = Math.min(t4.length, r3);
- for (var o3 = e3; o3 < r3; ++o3)
- n3 += String.fromCharCode(t4[o3]);
- return n3;
- }
- function C2(t4, e3, r3) {
- var n3 = t4.length;
- (!e3 || e3 < 0) && (e3 = 0), (!r3 || r3 < 0 || r3 > n3) && (r3 = n3);
- for (var o3 = "", i3 = e3; i3 < r3; ++i3)
- o3 += M2(t4[i3]);
- return o3;
- }
- function P2(t4, e3, r3) {
- for (var n3 = t4.slice(e3, r3), o3 = "", i3 = 0; i3 < n3.length; i3 += 2)
- o3 += String.fromCharCode(n3[i3] + 256 * n3[i3 + 1]);
- return o3;
- }
- function T2(t4, e3, r3) {
- if (t4 % 1 != 0 || t4 < 0)
- throw new RangeError("offset is not uint");
- if (t4 + e3 > r3)
- throw new RangeError("Trying to access beyond buffer length");
- }
- function O2(t4, e3, r3, n3, o3, i3) {
- if (!c2.isBuffer(t4))
- throw new TypeError('"buffer" argument must be a Buffer instance');
- if (e3 > o3 || e3 < i3)
- throw new RangeError('"value" argument is out of bounds');
- if (r3 + n3 > t4.length)
- throw new RangeError("Index out of range");
- }
- function N2(t4, e3, r3, n3) {
- e3 < 0 && (e3 = 65535 + e3 + 1);
- for (var o3 = 0, i3 = Math.min(t4.length - r3, 2); o3 < i3; ++o3)
- t4[r3 + o3] = (e3 & 255 << 8 * (n3 ? o3 : 1 - o3)) >>> 8 * (n3 ? o3 : 1 - o3);
- }
- function L2(t4, e3, r3, n3) {
- e3 < 0 && (e3 = 4294967295 + e3 + 1);
- for (var o3 = 0, i3 = Math.min(t4.length - r3, 4); o3 < i3; ++o3)
- t4[r3 + o3] = e3 >>> 8 * (n3 ? o3 : 3 - o3) & 255;
- }
- function U2(t4, e3, r3, n3, o3, i3) {
- if (r3 + n3 > t4.length)
- throw new RangeError("Index out of range");
- if (r3 < 0)
- throw new RangeError("Index out of range");
- }
- function I2(t4, e3, r3, n3, i3) {
- return i3 || U2(t4, 0, r3, 4), o2.write(t4, e3, r3, n3, 23, 4), r3 + 4;
- }
- function j2(t4, e3, r3, n3, i3) {
- return i3 || U2(t4, 0, r3, 8), o2.write(t4, e3, r3, n3, 52, 8), r3 + 8;
- }
- c2.prototype.slice = function(t4, e3) {
- var r3, n3 = this.length;
- if ((t4 = ~~t4) < 0 ? (t4 += n3) < 0 && (t4 = 0) : t4 > n3 && (t4 = n3), (e3 = void 0 === e3 ? n3 : ~~e3) < 0 ? (e3 += n3) < 0 && (e3 = 0) : e3 > n3 && (e3 = n3), e3 < t4 && (e3 = t4), c2.TYPED_ARRAY_SUPPORT)
- (r3 = this.subarray(t4, e3)).__proto__ = c2.prototype;
- else {
- var o3 = e3 - t4;
- r3 = new c2(o3, void 0);
- for (var i3 = 0; i3 < o3; ++i3)
- r3[i3] = this[i3 + t4];
- }
- return r3;
- }, c2.prototype.readUIntLE = function(t4, e3, r3) {
- t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
- for (var n3 = this[t4], o3 = 1, i3 = 0; ++i3 < e3 && (o3 *= 256); )
- n3 += this[t4 + i3] * o3;
- return n3;
- }, c2.prototype.readUIntBE = function(t4, e3, r3) {
- t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
- for (var n3 = this[t4 + --e3], o3 = 1; e3 > 0 && (o3 *= 256); )
- n3 += this[t4 + --e3] * o3;
- return n3;
- }, c2.prototype.readUInt8 = function(t4, e3) {
- return e3 || T2(t4, 1, this.length), this[t4];
- }, c2.prototype.readUInt16LE = function(t4, e3) {
- return e3 || T2(t4, 2, this.length), this[t4] | this[t4 + 1] << 8;
- }, c2.prototype.readUInt16BE = function(t4, e3) {
- return e3 || T2(t4, 2, this.length), this[t4] << 8 | this[t4 + 1];
- }, c2.prototype.readUInt32LE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), (this[t4] | this[t4 + 1] << 8 | this[t4 + 2] << 16) + 16777216 * this[t4 + 3];
- }, c2.prototype.readUInt32BE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), 16777216 * this[t4] + (this[t4 + 1] << 16 | this[t4 + 2] << 8 | this[t4 + 3]);
- }, c2.prototype.readIntLE = function(t4, e3, r3) {
- t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
- for (var n3 = this[t4], o3 = 1, i3 = 0; ++i3 < e3 && (o3 *= 256); )
- n3 += this[t4 + i3] * o3;
- return n3 >= (o3 *= 128) && (n3 -= Math.pow(2, 8 * e3)), n3;
- }, c2.prototype.readIntBE = function(t4, e3, r3) {
- t4 |= 0, e3 |= 0, r3 || T2(t4, e3, this.length);
- for (var n3 = e3, o3 = 1, i3 = this[t4 + --n3]; n3 > 0 && (o3 *= 256); )
- i3 += this[t4 + --n3] * o3;
- return i3 >= (o3 *= 128) && (i3 -= Math.pow(2, 8 * e3)), i3;
- }, c2.prototype.readInt8 = function(t4, e3) {
- return e3 || T2(t4, 1, this.length), 128 & this[t4] ? -1 * (255 - this[t4] + 1) : this[t4];
- }, c2.prototype.readInt16LE = function(t4, e3) {
- e3 || T2(t4, 2, this.length);
- var r3 = this[t4] | this[t4 + 1] << 8;
- return 32768 & r3 ? 4294901760 | r3 : r3;
- }, c2.prototype.readInt16BE = function(t4, e3) {
- e3 || T2(t4, 2, this.length);
- var r3 = this[t4 + 1] | this[t4] << 8;
- return 32768 & r3 ? 4294901760 | r3 : r3;
- }, c2.prototype.readInt32LE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), this[t4] | this[t4 + 1] << 8 | this[t4 + 2] << 16 | this[t4 + 3] << 24;
- }, c2.prototype.readInt32BE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), this[t4] << 24 | this[t4 + 1] << 16 | this[t4 + 2] << 8 | this[t4 + 3];
- }, c2.prototype.readFloatLE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), o2.read(this, t4, true, 23, 4);
- }, c2.prototype.readFloatBE = function(t4, e3) {
- return e3 || T2(t4, 4, this.length), o2.read(this, t4, false, 23, 4);
- }, c2.prototype.readDoubleLE = function(t4, e3) {
- return e3 || T2(t4, 8, this.length), o2.read(this, t4, true, 52, 8);
- }, c2.prototype.readDoubleBE = function(t4, e3) {
- return e3 || T2(t4, 8, this.length), o2.read(this, t4, false, 52, 8);
- }, c2.prototype.writeUIntLE = function(t4, e3, r3, n3) {
- (t4 = +t4, e3 |= 0, r3 |= 0, n3) || O2(this, t4, e3, r3, Math.pow(2, 8 * r3) - 1, 0);
- var o3 = 1, i3 = 0;
- for (this[e3] = 255 & t4; ++i3 < r3 && (o3 *= 256); )
- this[e3 + i3] = t4 / o3 & 255;
- return e3 + r3;
- }, c2.prototype.writeUIntBE = function(t4, e3, r3, n3) {
- (t4 = +t4, e3 |= 0, r3 |= 0, n3) || O2(this, t4, e3, r3, Math.pow(2, 8 * r3) - 1, 0);
- var o3 = r3 - 1, i3 = 1;
- for (this[e3 + o3] = 255 & t4; --o3 >= 0 && (i3 *= 256); )
- this[e3 + o3] = t4 / i3 & 255;
- return e3 + r3;
- }, c2.prototype.writeUInt8 = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 1, 255, 0), c2.TYPED_ARRAY_SUPPORT || (t4 = Math.floor(t4)), this[e3] = 255 & t4, e3 + 1;
- }, c2.prototype.writeUInt16LE = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 2, 65535, 0), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = 255 & t4, this[e3 + 1] = t4 >>> 8) : N2(this, t4, e3, true), e3 + 2;
- }, c2.prototype.writeUInt16BE = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 2, 65535, 0), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = t4 >>> 8, this[e3 + 1] = 255 & t4) : N2(this, t4, e3, false), e3 + 2;
- }, c2.prototype.writeUInt32LE = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 4, 4294967295, 0), c2.TYPED_ARRAY_SUPPORT ? (this[e3 + 3] = t4 >>> 24, this[e3 + 2] = t4 >>> 16, this[e3 + 1] = t4 >>> 8, this[e3] = 255 & t4) : L2(this, t4, e3, true), e3 + 4;
- }, c2.prototype.writeUInt32BE = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 4, 4294967295, 0), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = t4 >>> 24, this[e3 + 1] = t4 >>> 16, this[e3 + 2] = t4 >>> 8, this[e3 + 3] = 255 & t4) : L2(this, t4, e3, false), e3 + 4;
- }, c2.prototype.writeIntLE = function(t4, e3, r3, n3) {
- if (t4 = +t4, e3 |= 0, !n3) {
- var o3 = Math.pow(2, 8 * r3 - 1);
- O2(this, t4, e3, r3, o3 - 1, -o3);
- }
- var i3 = 0, s3 = 1, a3 = 0;
- for (this[e3] = 255 & t4; ++i3 < r3 && (s3 *= 256); )
- t4 < 0 && 0 === a3 && 0 !== this[e3 + i3 - 1] && (a3 = 1), this[e3 + i3] = (t4 / s3 >> 0) - a3 & 255;
- return e3 + r3;
- }, c2.prototype.writeIntBE = function(t4, e3, r3, n3) {
- if (t4 = +t4, e3 |= 0, !n3) {
- var o3 = Math.pow(2, 8 * r3 - 1);
- O2(this, t4, e3, r3, o3 - 1, -o3);
- }
- var i3 = r3 - 1, s3 = 1, a3 = 0;
- for (this[e3 + i3] = 255 & t4; --i3 >= 0 && (s3 *= 256); )
- t4 < 0 && 0 === a3 && 0 !== this[e3 + i3 + 1] && (a3 = 1), this[e3 + i3] = (t4 / s3 >> 0) - a3 & 255;
- return e3 + r3;
- }, c2.prototype.writeInt8 = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 1, 127, -128), c2.TYPED_ARRAY_SUPPORT || (t4 = Math.floor(t4)), t4 < 0 && (t4 = 255 + t4 + 1), this[e3] = 255 & t4, e3 + 1;
- }, c2.prototype.writeInt16LE = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 2, 32767, -32768), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = 255 & t4, this[e3 + 1] = t4 >>> 8) : N2(this, t4, e3, true), e3 + 2;
- }, c2.prototype.writeInt16BE = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 2, 32767, -32768), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = t4 >>> 8, this[e3 + 1] = 255 & t4) : N2(this, t4, e3, false), e3 + 2;
- }, c2.prototype.writeInt32LE = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 4, 2147483647, -2147483648), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = 255 & t4, this[e3 + 1] = t4 >>> 8, this[e3 + 2] = t4 >>> 16, this[e3 + 3] = t4 >>> 24) : L2(this, t4, e3, true), e3 + 4;
- }, c2.prototype.writeInt32BE = function(t4, e3, r3) {
- return t4 = +t4, e3 |= 0, r3 || O2(this, t4, e3, 4, 2147483647, -2147483648), t4 < 0 && (t4 = 4294967295 + t4 + 1), c2.TYPED_ARRAY_SUPPORT ? (this[e3] = t4 >>> 24, this[e3 + 1] = t4 >>> 16, this[e3 + 2] = t4 >>> 8, this[e3 + 3] = 255 & t4) : L2(this, t4, e3, false), e3 + 4;
- }, c2.prototype.writeFloatLE = function(t4, e3, r3) {
- return I2(this, t4, e3, true, r3);
- }, c2.prototype.writeFloatBE = function(t4, e3, r3) {
- return I2(this, t4, e3, false, r3);
- }, c2.prototype.writeDoubleLE = function(t4, e3, r3) {
- return j2(this, t4, e3, true, r3);
- }, c2.prototype.writeDoubleBE = function(t4, e3, r3) {
- return j2(this, t4, e3, false, r3);
- }, c2.prototype.copy = function(t4, e3, r3, n3) {
- if (r3 || (r3 = 0), n3 || 0 === n3 || (n3 = this.length), e3 >= t4.length && (e3 = t4.length), e3 || (e3 = 0), n3 > 0 && n3 < r3 && (n3 = r3), n3 === r3)
- return 0;
- if (0 === t4.length || 0 === this.length)
- return 0;
- if (e3 < 0)
- throw new RangeError("targetStart out of bounds");
- if (r3 < 0 || r3 >= this.length)
- throw new RangeError("sourceStart out of bounds");
- if (n3 < 0)
- throw new RangeError("sourceEnd out of bounds");
- n3 > this.length && (n3 = this.length), t4.length - e3 < n3 - r3 && (n3 = t4.length - e3 + r3);
- var o3, i3 = n3 - r3;
- if (this === t4 && r3 < e3 && e3 < n3)
- for (o3 = i3 - 1; o3 >= 0; --o3)
- t4[o3 + e3] = this[o3 + r3];
- else if (i3 < 1e3 || !c2.TYPED_ARRAY_SUPPORT)
- for (o3 = 0; o3 < i3; ++o3)
- t4[o3 + e3] = this[o3 + r3];
- else
- Uint8Array.prototype.set.call(t4, this.subarray(r3, r3 + i3), e3);
- return i3;
- }, c2.prototype.fill = function(t4, e3, r3, n3) {
- if ("string" == typeof t4) {
- if ("string" == typeof e3 ? (n3 = e3, e3 = 0, r3 = this.length) : "string" == typeof r3 && (n3 = r3, r3 = this.length), 1 === t4.length) {
- var o3 = t4.charCodeAt(0);
- o3 < 256 && (t4 = o3);
- }
- if (void 0 !== n3 && "string" != typeof n3)
- throw new TypeError("encoding must be a string");
- if ("string" == typeof n3 && !c2.isEncoding(n3))
- throw new TypeError("Unknown encoding: " + n3);
- } else
- "number" == typeof t4 && (t4 &= 255);
- if (e3 < 0 || this.length < e3 || this.length < r3)
- throw new RangeError("Out of range index");
- if (r3 <= e3)
- return this;
- var i3;
- if (e3 >>>= 0, r3 = void 0 === r3 ? this.length : r3 >>> 0, t4 || (t4 = 0), "number" == typeof t4)
- for (i3 = e3; i3 < r3; ++i3)
- this[i3] = t4;
- else {
- var s3 = c2.isBuffer(t4) ? t4 : q2(new c2(t4, n3).toString()), a3 = s3.length;
- for (i3 = 0; i3 < r3 - e3; ++i3)
- this[i3 + e3] = s3[i3 % a3];
- }
- return this;
- };
- var D2 = /[^+\/0-9A-Za-z-_]/g;
- function M2(t4) {
- return t4 < 16 ? "0" + t4.toString(16) : t4.toString(16);
- }
- function q2(t4, e3) {
- var r3;
- e3 = e3 || 1 / 0;
- for (var n3 = t4.length, o3 = null, i3 = [], s3 = 0; s3 < n3; ++s3) {
- if ((r3 = t4.charCodeAt(s3)) > 55295 && r3 < 57344) {
- if (!o3) {
- if (r3 > 56319) {
- (e3 -= 3) > -1 && i3.push(239, 191, 189);
- continue;
- }
- if (s3 + 1 === n3) {
- (e3 -= 3) > -1 && i3.push(239, 191, 189);
- continue;
- }
- o3 = r3;
- continue;
- }
- if (r3 < 56320) {
- (e3 -= 3) > -1 && i3.push(239, 191, 189), o3 = r3;
- continue;
- }
- r3 = 65536 + (o3 - 55296 << 10 | r3 - 56320);
- } else
- o3 && (e3 -= 3) > -1 && i3.push(239, 191, 189);
- if (o3 = null, r3 < 128) {
- if ((e3 -= 1) < 0)
- break;
- i3.push(r3);
- } else if (r3 < 2048) {
- if ((e3 -= 2) < 0)
- break;
- i3.push(r3 >> 6 | 192, 63 & r3 | 128);
- } else if (r3 < 65536) {
- if ((e3 -= 3) < 0)
- break;
- i3.push(r3 >> 12 | 224, r3 >> 6 & 63 | 128, 63 & r3 | 128);
- } else {
- if (!(r3 < 1114112))
- throw new Error("Invalid code point");
- if ((e3 -= 4) < 0)
- break;
- i3.push(r3 >> 18 | 240, r3 >> 12 & 63 | 128, r3 >> 6 & 63 | 128, 63 & r3 | 128);
- }
- }
- return i3;
- }
- function Y2(t4) {
- return n2.toByteArray(function(t5) {
- if ((t5 = function(t6) {
- return t6.trim ? t6.trim() : t6.replace(/^\s+|\s+$/g, "");
- }(t5).replace(D2, "")).length < 2)
- return "";
- for (; t5.length % 4 != 0; )
- t5 += "=";
- return t5;
- }(t4));
- }
- function H2(t4, e3, r3, n3) {
- for (var o3 = 0; o3 < n3 && !(o3 + r3 >= e3.length || o3 >= t4.length); ++o3)
- e3[o3 + r3] = t4[o3];
- return o3;
- }
- }).call(this, r2(12));
- }, function(t2, e2, r2) {
- var n2 = r2(31);
- t2.exports = function(t3) {
- var e3 = t3.xdomain, r3 = t3.xscheme, o2 = t3.enablesXDR;
- try {
- if ("undefined" != typeof XMLHttpRequest && (!e3 || n2))
- return new XMLHttpRequest();
- } catch (t4) {
- }
- try {
- if ("undefined" != typeof XDomainRequest && !r3 && o2)
- return new XDomainRequest();
- } catch (t4) {
- }
- if (!e3)
- try {
- return new self[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
- } catch (t4) {
- }
- };
- }, function(t2, e2, r2) {
- var n2 = r2(2), o2 = r2(1);
- function i2(t3) {
- this.path = t3.path, this.hostname = t3.hostname, this.port = t3.port, this.secure = t3.secure, this.query = t3.query, this.timestampParam = t3.timestampParam, this.timestampRequests = t3.timestampRequests, this.readyState = "", this.agent = t3.agent || false, this.socket = t3.socket, this.enablesXDR = t3.enablesXDR, this.withCredentials = t3.withCredentials, this.pfx = t3.pfx, this.key = t3.key, this.passphrase = t3.passphrase, this.cert = t3.cert, this.ca = t3.ca, this.ciphers = t3.ciphers, this.rejectUnauthorized = t3.rejectUnauthorized, this.forceNode = t3.forceNode, this.isReactNative = t3.isReactNative, this.extraHeaders = t3.extraHeaders, this.localAddress = t3.localAddress;
- }
- t2.exports = i2, o2(i2.prototype), i2.prototype.onError = function(t3, e3) {
- var r3 = new Error(t3);
- return r3.type = "TransportError", r3.description = e3, this.emit("error", r3), this;
- }, i2.prototype.open = function() {
- return "closed" !== this.readyState && "" !== this.readyState || (this.readyState = "opening", this.doOpen()), this;
- }, i2.prototype.close = function() {
- return "opening" !== this.readyState && "open" !== this.readyState || (this.doClose(), this.onClose()), this;
- }, i2.prototype.send = function(t3) {
- if ("open" !== this.readyState)
- throw new Error("Transport not open");
- this.write(t3);
- }, i2.prototype.onOpen = function() {
- this.readyState = "open", this.writable = true, this.emit("open");
- }, i2.prototype.onData = function(t3) {
- var e3 = n2.decodePacket(t3, this.socket.binaryType);
- this.onPacket(e3);
- }, i2.prototype.onPacket = function(t3) {
- this.emit("packet", t3);
- }, i2.prototype.onClose = function() {
- this.readyState = "closed", this.emit("close");
- };
- }, function(t2, e2) {
- var r2 = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, n2 = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"];
- t2.exports = function(t3) {
- var e3 = t3, o2 = t3.indexOf("["), i2 = t3.indexOf("]");
- -1 != o2 && -1 != i2 && (t3 = t3.substring(0, o2) + t3.substring(o2, i2).replace(/:/g, ";") + t3.substring(i2, t3.length));
- for (var s2 = r2.exec(t3 || ""), a2 = {}, c2 = 14; c2--; )
- a2[n2[c2]] = s2[c2] || "";
- return -1 != o2 && -1 != i2 && (a2.source = e3, a2.host = a2.host.substring(1, a2.host.length - 1).replace(/;/g, ":"), a2.authority = a2.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), a2.ipv6uri = true), a2;
- };
- }, function(t2, e2) {
- var r2 = {}.toString;
- t2.exports = Array.isArray || function(t3) {
- return "[object Array]" == r2.call(t3);
- };
- }, function(t2, e2, r2) {
- (function(e3) {
- t2.exports = function(t3) {
- return r3 && e3.isBuffer(t3) || n2 && (t3 instanceof ArrayBuffer || function(t4) {
- return "function" == typeof ArrayBuffer.isView ? ArrayBuffer.isView(t4) : t4.buffer instanceof ArrayBuffer;
- }(t3));
- };
- var r3 = "function" == typeof e3 && "function" == typeof e3.isBuffer, n2 = "function" == typeof ArrayBuffer;
- }).call(this, r2(6).Buffer);
- }, function(t2, e2) {
- var r2;
- r2 = /* @__PURE__ */ function() {
- return this;
- }();
- try {
- r2 = r2 || new Function("return this")();
- } catch (t3) {
- "object" == typeof window && (r2 = window);
- }
- t2.exports = r2;
- }, function(t2, e2, r2) {
- var n2 = r2(29), o2 = r2(19), i2 = r2(1), s2 = r2(5), a2 = r2(20), c2 = r2(21), h2 = r2(0)("socket.io-client:manager"), u2 = r2(18), f2 = r2(46), p2 = Object.prototype.hasOwnProperty;
- function l2(t3, e3) {
- if (!(this instanceof l2))
- return new l2(t3, e3);
- t3 && "object" == typeof t3 && (e3 = t3, t3 = void 0), (e3 = e3 || {}).path = e3.path || "/socket.io", this.nsps = {}, this.subs = [], this.opts = e3, this.reconnection(false !== e3.reconnection), this.reconnectionAttempts(e3.reconnectionAttempts || 1 / 0), this.reconnectionDelay(e3.reconnectionDelay || 1e3), this.reconnectionDelayMax(e3.reconnectionDelayMax || 5e3), this.randomizationFactor(e3.randomizationFactor || 0.5), this.backoff = new f2({ min: this.reconnectionDelay(), max: this.reconnectionDelayMax(), jitter: this.randomizationFactor() }), this.timeout(null == e3.timeout ? 2e4 : e3.timeout), this.readyState = "closed", this.uri = t3, this.connecting = [], this.lastPing = null, this.encoding = false, this.packetBuffer = [];
- var r3 = e3.parser || s2;
- this.encoder = new r3.Encoder(), this.decoder = new r3.Decoder(), this.autoConnect = false !== e3.autoConnect, this.autoConnect && this.open();
- }
- t2.exports = l2, l2.prototype.emitAll = function() {
- for (var t3 in this.emit.apply(this, arguments), this.nsps)
- p2.call(this.nsps, t3) && this.nsps[t3].emit.apply(this.nsps[t3], arguments);
- }, l2.prototype.updateSocketIds = function() {
- for (var t3 in this.nsps)
- p2.call(this.nsps, t3) && (this.nsps[t3].id = this.generateId(t3));
- }, l2.prototype.generateId = function(t3) {
- return ("/" === t3 ? "" : t3 + "#") + this.engine.id;
- }, i2(l2.prototype), l2.prototype.reconnection = function(t3) {
- return arguments.length ? (this._reconnection = !!t3, this) : this._reconnection;
- }, l2.prototype.reconnectionAttempts = function(t3) {
- return arguments.length ? (this._reconnectionAttempts = t3, this) : this._reconnectionAttempts;
- }, l2.prototype.reconnectionDelay = function(t3) {
- return arguments.length ? (this._reconnectionDelay = t3, this.backoff && this.backoff.setMin(t3), this) : this._reconnectionDelay;
- }, l2.prototype.randomizationFactor = function(t3) {
- return arguments.length ? (this._randomizationFactor = t3, this.backoff && this.backoff.setJitter(t3), this) : this._randomizationFactor;
- }, l2.prototype.reconnectionDelayMax = function(t3) {
- return arguments.length ? (this._reconnectionDelayMax = t3, this.backoff && this.backoff.setMax(t3), this) : this._reconnectionDelayMax;
- }, l2.prototype.timeout = function(t3) {
- return arguments.length ? (this._timeout = t3, this) : this._timeout;
- }, l2.prototype.maybeReconnectOnOpen = function() {
- !this.reconnecting && this._reconnection && 0 === this.backoff.attempts && this.reconnect();
- }, l2.prototype.open = l2.prototype.connect = function(t3, e3) {
- if (h2("readyState %s", this.readyState), ~this.readyState.indexOf("open"))
- return this;
- h2("opening %s", this.uri), this.engine = n2(this.uri, this.opts);
- var r3 = this.engine, o3 = this;
- this.readyState = "opening", this.skipReconnect = false;
- var i3 = a2(r3, "open", function() {
- o3.onopen(), t3 && t3();
- }), s3 = a2(r3, "error", function(e4) {
- if (h2("connect_error"), o3.cleanup(), o3.readyState = "closed", o3.emitAll("connect_error", e4), t3) {
- var r4 = new Error("Connection error");
- r4.data = e4, t3(r4);
- } else
- o3.maybeReconnectOnOpen();
- });
- if (false !== this._timeout) {
- var c3 = this._timeout;
- h2("connect attempt will timeout after %d", c3);
- var u3 = setTimeout(function() {
- h2("connect attempt timed out after %d", c3), i3.destroy(), r3.close(), r3.emit("error", "timeout"), o3.emitAll("connect_timeout", c3);
- }, c3);
- this.subs.push({ destroy: function() {
- clearTimeout(u3);
- } });
- }
- return this.subs.push(i3), this.subs.push(s3), this;
- }, l2.prototype.onopen = function() {
- h2("open"), this.cleanup(), this.readyState = "open", this.emit("open");
- var t3 = this.engine;
- this.subs.push(a2(t3, "data", c2(this, "ondata"))), this.subs.push(a2(t3, "ping", c2(this, "onping"))), this.subs.push(a2(t3, "pong", c2(this, "onpong"))), this.subs.push(a2(t3, "error", c2(this, "onerror"))), this.subs.push(a2(t3, "close", c2(this, "onclose"))), this.subs.push(a2(this.decoder, "decoded", c2(this, "ondecoded")));
- }, l2.prototype.onping = function() {
- this.lastPing = /* @__PURE__ */ new Date(), this.emitAll("ping");
- }, l2.prototype.onpong = function() {
- this.emitAll("pong", /* @__PURE__ */ new Date() - this.lastPing);
- }, l2.prototype.ondata = function(t3) {
- this.decoder.add(t3);
- }, l2.prototype.ondecoded = function(t3) {
- this.emit("packet", t3);
- }, l2.prototype.onerror = function(t3) {
- h2("error", t3), this.emitAll("error", t3);
- }, l2.prototype.socket = function(t3, e3) {
- var r3 = this.nsps[t3];
- if (!r3) {
- r3 = new o2(this, t3, e3), this.nsps[t3] = r3;
- var n3 = this;
- r3.on("connecting", i3), r3.on("connect", function() {
- r3.id = n3.generateId(t3);
- }), this.autoConnect && i3();
- }
- function i3() {
- ~u2(n3.connecting, r3) || n3.connecting.push(r3);
- }
- return r3;
- }, l2.prototype.destroy = function(t3) {
- var e3 = u2(this.connecting, t3);
- ~e3 && this.connecting.splice(e3, 1), this.connecting.length || this.close();
- }, l2.prototype.packet = function(t3) {
- h2("writing packet %j", t3);
- var e3 = this;
- t3.query && 0 === t3.type && (t3.nsp += "?" + t3.query), e3.encoding ? e3.packetBuffer.push(t3) : (e3.encoding = true, this.encoder.encode(t3, function(r3) {
- for (var n3 = 0; n3 < r3.length; n3++)
- e3.engine.write(r3[n3], t3.options);
- e3.encoding = false, e3.processPacketQueue();
- }));
- }, l2.prototype.processPacketQueue = function() {
- if (this.packetBuffer.length > 0 && !this.encoding) {
- var t3 = this.packetBuffer.shift();
- this.packet(t3);
- }
- }, l2.prototype.cleanup = function() {
- h2("cleanup");
- for (var t3 = this.subs.length, e3 = 0; e3 < t3; e3++) {
- this.subs.shift().destroy();
- }
- this.packetBuffer = [], this.encoding = false, this.lastPing = null, this.decoder.destroy();
- }, l2.prototype.close = l2.prototype.disconnect = function() {
- h2("disconnect"), this.skipReconnect = true, this.reconnecting = false, "opening" === this.readyState && this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.engine && this.engine.close();
- }, l2.prototype.onclose = function(t3) {
- h2("onclose"), this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.emit("close", t3), this._reconnection && !this.skipReconnect && this.reconnect();
- }, l2.prototype.reconnect = function() {
- if (this.reconnecting || this.skipReconnect)
- return this;
- var t3 = this;
- if (this.backoff.attempts >= this._reconnectionAttempts)
- h2("reconnect failed"), this.backoff.reset(), this.emitAll("reconnect_failed"), this.reconnecting = false;
- else {
- var e3 = this.backoff.duration();
- h2("will wait %dms before reconnect attempt", e3), this.reconnecting = true;
- var r3 = setTimeout(function() {
- t3.skipReconnect || (h2("attempting reconnect"), t3.emitAll("reconnect_attempt", t3.backoff.attempts), t3.emitAll("reconnecting", t3.backoff.attempts), t3.skipReconnect || t3.open(function(e4) {
- e4 ? (h2("reconnect attempt error"), t3.reconnecting = false, t3.reconnect(), t3.emitAll("reconnect_error", e4.data)) : (h2("reconnect success"), t3.onreconnect());
- }));
- }, e3);
- this.subs.push({ destroy: function() {
- clearTimeout(r3);
- } });
- }
- }, l2.prototype.onreconnect = function() {
- var t3 = this.backoff.attempts;
- this.reconnecting = false, this.backoff.reset(), this.updateSocketIds(), this.emitAll("reconnect", t3);
- };
- }, function(t2, e2, r2) {
- var n2 = r2(7), o2 = r2(32), i2 = r2(40), s2 = r2(41);
- e2.polling = function(t3) {
- var e3 = false, r3 = false, s3 = false !== t3.jsonp;
- if ("undefined" != typeof location) {
- var a2 = "https:" === location.protocol, c2 = location.port;
- c2 || (c2 = a2 ? 443 : 80), e3 = t3.hostname !== location.hostname || c2 !== t3.port, r3 = t3.secure !== a2;
- }
- if (t3.xdomain = e3, t3.xscheme = r3, "open" in new n2(t3) && !t3.forceJSONP)
- return new o2(t3);
- if (!s3)
- throw new Error("JSONP disabled");
- return new i2(t3);
- }, e2.websocket = s2;
- }, function(t2, e2, r2) {
- var n2 = r2(8), o2 = r2(3), i2 = r2(2), s2 = r2(4), a2 = r2(17), c2 = r2(0)("engine.io-client:polling");
- t2.exports = u2;
- var h2 = null != new (r2(7))({ xdomain: false }).responseType;
- function u2(t3) {
- var e3 = t3 && t3.forceBase64;
- h2 && !e3 || (this.supportsBinary = false), n2.call(this, t3);
- }
- s2(u2, n2), u2.prototype.name = "polling", u2.prototype.doOpen = function() {
- this.poll();
- }, u2.prototype.pause = function(t3) {
- var e3 = this;
- function r3() {
- c2("paused"), e3.readyState = "paused", t3();
- }
- if (this.readyState = "pausing", this.polling || !this.writable) {
- var n3 = 0;
- this.polling && (c2("we are currently polling - waiting to pause"), n3++, this.once("pollComplete", function() {
- c2("pre-pause polling complete"), --n3 || r3();
- })), this.writable || (c2("we are currently writing - waiting to pause"), n3++, this.once("drain", function() {
- c2("pre-pause writing complete"), --n3 || r3();
- }));
- } else
- r3();
- }, u2.prototype.poll = function() {
- c2("polling"), this.polling = true, this.doPoll(), this.emit("poll");
- }, u2.prototype.onData = function(t3) {
- var e3 = this;
- c2("polling got data %s", t3);
- i2.decodePayload(t3, this.socket.binaryType, function(t4, r3, n3) {
- if ("opening" === e3.readyState && e3.onOpen(), "close" === t4.type)
- return e3.onClose(), false;
- e3.onPacket(t4);
- }), "closed" !== this.readyState && (this.polling = false, this.emit("pollComplete"), "open" === this.readyState ? this.poll() : c2('ignoring poll - transport state "%s"', this.readyState));
- }, u2.prototype.doClose = function() {
- var t3 = this;
- function e3() {
- c2("writing close packet"), t3.write([{ type: "close" }]);
- }
- "open" === this.readyState ? (c2("transport open - closing"), e3()) : (c2("transport not open - deferring close"), this.once("open", e3));
- }, u2.prototype.write = function(t3) {
- var e3 = this;
- this.writable = false;
- var r3 = function() {
- e3.writable = true, e3.emit("drain");
- };
- i2.encodePayload(t3, this.supportsBinary, function(t4) {
- e3.doWrite(t4, r3);
- });
- }, u2.prototype.uri = function() {
- var t3 = this.query || {}, e3 = this.secure ? "https" : "http", r3 = "";
- return false !== this.timestampRequests && (t3[this.timestampParam] = a2()), this.supportsBinary || t3.sid || (t3.b64 = 1), t3 = o2.encode(t3), this.port && ("https" === e3 && 443 !== Number(this.port) || "http" === e3 && 80 !== Number(this.port)) && (r3 = ":" + this.port), t3.length && (t3 = "?" + t3), e3 + "://" + (-1 !== this.hostname.indexOf(":") ? "[" + this.hostname + "]" : this.hostname) + r3 + this.path + t3;
- };
- }, function(t2, e2, r2) {
- (function(e3) {
- var n2 = r2(34), o2 = Object.prototype.toString, i2 = "function" == typeof Blob || "undefined" != typeof Blob && "[object BlobConstructor]" === o2.call(Blob), s2 = "function" == typeof File || "undefined" != typeof File && "[object FileConstructor]" === o2.call(File);
- t2.exports = function t3(r3) {
- if (!r3 || "object" != typeof r3)
- return false;
- if (n2(r3)) {
- for (var o3 = 0, a2 = r3.length; o3 < a2; o3++)
- if (t3(r3[o3]))
- return true;
- return false;
- }
- if ("function" == typeof e3 && e3.isBuffer && e3.isBuffer(r3) || "function" == typeof ArrayBuffer && r3 instanceof ArrayBuffer || i2 && r3 instanceof Blob || s2 && r3 instanceof File)
- return true;
- if (r3.toJSON && "function" == typeof r3.toJSON && 1 === arguments.length)
- return t3(r3.toJSON(), true);
- for (var c2 in r3)
- if (Object.prototype.hasOwnProperty.call(r3, c2) && t3(r3[c2]))
- return true;
- return false;
- };
- }).call(this, r2(6).Buffer);
- }, function(t2, e2, r2) {
- var n2, o2 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""), i2 = {}, s2 = 0, a2 = 0;
- function c2(t3) {
- var e3 = "";
- do {
- e3 = o2[t3 % 64] + e3, t3 = Math.floor(t3 / 64);
- } while (t3 > 0);
- return e3;
- }
- function h2() {
- var t3 = c2(+/* @__PURE__ */ new Date());
- return t3 !== n2 ? (s2 = 0, n2 = t3) : t3 + "." + c2(s2++);
- }
- for (; a2 < 64; a2++)
- i2[o2[a2]] = a2;
- h2.encode = c2, h2.decode = function(t3) {
- var e3 = 0;
- for (a2 = 0; a2 < t3.length; a2++)
- e3 = 64 * e3 + i2[t3.charAt(a2)];
- return e3;
- }, t2.exports = h2;
- }, function(t2, e2) {
- var r2 = [].indexOf;
- t2.exports = function(t3, e3) {
- if (r2)
- return t3.indexOf(e3);
- for (var n2 = 0; n2 < t3.length; ++n2)
- if (t3[n2] === e3)
- return n2;
- return -1;
- };
- }, function(t2, e2, r2) {
- var n2 = r2(5), o2 = r2(1), i2 = r2(45), s2 = r2(20), a2 = r2(21), c2 = r2(0)("socket.io-client:socket"), h2 = r2(3), u2 = r2(16);
- t2.exports = l2;
- var f2 = { connect: 1, connect_error: 1, connect_timeout: 1, connecting: 1, disconnect: 1, error: 1, reconnect: 1, reconnect_attempt: 1, reconnect_failed: 1, reconnect_error: 1, reconnecting: 1, ping: 1, pong: 1 }, p2 = o2.prototype.emit;
- function l2(t3, e3, r3) {
- this.io = t3, this.nsp = e3, this.json = this, this.ids = 0, this.acks = {}, this.receiveBuffer = [], this.sendBuffer = [], this.connected = false, this.disconnected = true, this.flags = {}, r3 && r3.query && (this.query = r3.query), this.io.autoConnect && this.open();
- }
- o2(l2.prototype), l2.prototype.subEvents = function() {
- if (!this.subs) {
- var t3 = this.io;
- this.subs = [s2(t3, "open", a2(this, "onopen")), s2(t3, "packet", a2(this, "onpacket")), s2(t3, "close", a2(this, "onclose"))];
- }
- }, l2.prototype.open = l2.prototype.connect = function() {
- return this.connected || (this.subEvents(), this.io.open(), "open" === this.io.readyState && this.onopen(), this.emit("connecting")), this;
- }, l2.prototype.send = function() {
- var t3 = i2(arguments);
- return t3.unshift("message"), this.emit.apply(this, t3), this;
- }, l2.prototype.emit = function(t3) {
- if (f2.hasOwnProperty(t3))
- return p2.apply(this, arguments), this;
- var e3 = i2(arguments), r3 = { type: (void 0 !== this.flags.binary ? this.flags.binary : u2(e3)) ? n2.BINARY_EVENT : n2.EVENT, data: e3, options: {} };
- return r3.options.compress = !this.flags || false !== this.flags.compress, "function" == typeof e3[e3.length - 1] && (c2("emitting packet with ack id %d", this.ids), this.acks[this.ids] = e3.pop(), r3.id = this.ids++), this.connected ? this.packet(r3) : this.sendBuffer.push(r3), this.flags = {}, this;
- }, l2.prototype.packet = function(t3) {
- t3.nsp = this.nsp, this.io.packet(t3);
- }, l2.prototype.onopen = function() {
- if (c2("transport is open - connecting"), "/" !== this.nsp)
- if (this.query) {
- var t3 = "object" == typeof this.query ? h2.encode(this.query) : this.query;
- c2("sending connect packet with query %s", t3), this.packet({ type: n2.CONNECT, query: t3 });
- } else
- this.packet({ type: n2.CONNECT });
- }, l2.prototype.onclose = function(t3) {
- c2("close (%s)", t3), this.connected = false, this.disconnected = true, delete this.id, this.emit("disconnect", t3);
- }, l2.prototype.onpacket = function(t3) {
- var e3 = t3.nsp === this.nsp, r3 = t3.type === n2.ERROR && "/" === t3.nsp;
- if (e3 || r3)
- switch (t3.type) {
- case n2.CONNECT:
- this.onconnect();
- break;
- case n2.EVENT:
- case n2.BINARY_EVENT:
- this.onevent(t3);
- break;
- case n2.ACK:
- case n2.BINARY_ACK:
- this.onack(t3);
- break;
- case n2.DISCONNECT:
- this.ondisconnect();
- break;
- case n2.ERROR:
- this.emit("error", t3.data);
- }
- }, l2.prototype.onevent = function(t3) {
- var e3 = t3.data || [];
- c2("emitting event %j", e3), null != t3.id && (c2("attaching ack callback to event"), e3.push(this.ack(t3.id))), this.connected ? p2.apply(this, e3) : this.receiveBuffer.push(e3);
- }, l2.prototype.ack = function(t3) {
- var e3 = this, r3 = false;
- return function() {
- if (!r3) {
- r3 = true;
- var o3 = i2(arguments);
- c2("sending ack %j", o3), e3.packet({ type: u2(o3) ? n2.BINARY_ACK : n2.ACK, id: t3, data: o3 });
- }
- };
- }, l2.prototype.onack = function(t3) {
- var e3 = this.acks[t3.id];
- "function" == typeof e3 ? (c2("calling ack %s with %j", t3.id, t3.data), e3.apply(this, t3.data), delete this.acks[t3.id]) : c2("bad ack %s", t3.id);
- }, l2.prototype.onconnect = function() {
- this.connected = true, this.disconnected = false, this.emit("connect"), this.emitBuffered();
- }, l2.prototype.emitBuffered = function() {
- var t3;
- for (t3 = 0; t3 < this.receiveBuffer.length; t3++)
- p2.apply(this, this.receiveBuffer[t3]);
- for (this.receiveBuffer = [], t3 = 0; t3 < this.sendBuffer.length; t3++)
- this.packet(this.sendBuffer[t3]);
- this.sendBuffer = [];
- }, l2.prototype.ondisconnect = function() {
- c2("server disconnect (%s)", this.nsp), this.destroy(), this.onclose("io server disconnect");
- }, l2.prototype.destroy = function() {
- if (this.subs) {
- for (var t3 = 0; t3 < this.subs.length; t3++)
- this.subs[t3].destroy();
- this.subs = null;
- }
- this.io.destroy(this);
- }, l2.prototype.close = l2.prototype.disconnect = function() {
- return this.connected && (c2("performing disconnect (%s)", this.nsp), this.packet({ type: n2.DISCONNECT })), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
- }, l2.prototype.compress = function(t3) {
- return this.flags.compress = t3, this;
- }, l2.prototype.binary = function(t3) {
- return this.flags.binary = t3, this;
- };
- }, function(t2, e2) {
- t2.exports = function(t3, e3, r2) {
- return t3.on(e3, r2), { destroy: function() {
- t3.removeListener(e3, r2);
- } };
- };
- }, function(t2, e2) {
- var r2 = [].slice;
- t2.exports = function(t3, e3) {
- if ("string" == typeof e3 && (e3 = t3[e3]), "function" != typeof e3)
- throw new Error("bind() requires a function");
- var n2 = r2.call(arguments, 2);
- return function() {
- return e3.apply(t3, n2.concat(r2.call(arguments)));
- };
- };
- }, function(t2, e2, r2) {
- t2.exports = r2(23);
- }, function(t2, e2, r2) {
- var n2 = r2(24), o2 = r2(5), i2 = r2(13), s2 = r2(0)("socket.io-client");
- t2.exports = e2 = c2;
- var a2 = e2.managers = {};
- function c2(t3, e3) {
- "object" == typeof t3 && (e3 = t3, t3 = void 0), e3 = e3 || {};
- var r3, o3 = n2(t3), c3 = o3.source, h2 = o3.id, u2 = o3.path, f2 = a2[h2] && u2 in a2[h2].nsps;
- return e3.forceNew || e3["force new connection"] || false === e3.multiplex || f2 ? (s2("ignoring socket cache for %s", c3), r3 = i2(c3, e3)) : (a2[h2] || (s2("new io instance for %s", c3), a2[h2] = i2(c3, e3)), r3 = a2[h2]), o3.query && !e3.query && (e3.query = o3.query), r3.socket(o3.path, e3);
- }
- e2.protocol = o2.protocol, e2.connect = c2, e2.Manager = r2(13), e2.Socket = r2(19);
- }, function(t2, e2, r2) {
- var n2 = r2(9), o2 = r2(0)("socket.io-client:url");
- t2.exports = function(t3, e3) {
- var r3 = t3;
- e3 = e3 || "undefined" != typeof location && location, null == t3 && (t3 = e3.protocol + "//" + e3.host);
- "string" == typeof t3 && ("/" === t3.charAt(0) && (t3 = "/" === t3.charAt(1) ? e3.protocol + t3 : e3.host + t3), /^(https?|wss?):\/\//.test(t3) || (o2("protocol-less url %s", t3), t3 = void 0 !== e3 ? e3.protocol + "//" + t3 : "https://" + t3), o2("parse %s", t3), r3 = n2(t3));
- r3.port || (/^(http|ws)$/.test(r3.protocol) ? r3.port = "80" : /^(http|ws)s$/.test(r3.protocol) && (r3.port = "443"));
- r3.path = r3.path || "/";
- var i2 = -1 !== r3.host.indexOf(":") ? "[" + r3.host + "]" : r3.host;
- return r3.id = r3.protocol + "://" + i2 + ":" + r3.port, r3.href = r3.protocol + "://" + i2 + (e3 && e3.port === r3.port ? "" : ":" + r3.port), r3;
- };
- }, function(t2, e2, r2) {
- var n2 = r2(10), o2 = r2(11), i2 = Object.prototype.toString, s2 = "function" == typeof Blob || "undefined" != typeof Blob && "[object BlobConstructor]" === i2.call(Blob), a2 = "function" == typeof File || "undefined" != typeof File && "[object FileConstructor]" === i2.call(File);
- e2.deconstructPacket = function(t3) {
- var e3 = [], r3 = t3.data, i3 = t3;
- return i3.data = function t4(e4, r4) {
- if (!e4)
- return e4;
- if (o2(e4)) {
- var i4 = { _placeholder: true, num: r4.length };
- return r4.push(e4), i4;
- }
- if (n2(e4)) {
- for (var s3 = new Array(e4.length), a3 = 0; a3 < e4.length; a3++)
- s3[a3] = t4(e4[a3], r4);
- return s3;
- }
- if ("object" == typeof e4 && !(e4 instanceof Date)) {
- s3 = {};
- for (var c2 in e4)
- s3[c2] = t4(e4[c2], r4);
- return s3;
- }
- return e4;
- }(r3, e3), i3.attachments = e3.length, { packet: i3, buffers: e3 };
- }, e2.reconstructPacket = function(t3, e3) {
- return t3.data = function t4(e4, r3) {
- if (!e4)
- return e4;
- if (e4 && e4._placeholder)
- return r3[e4.num];
- if (n2(e4))
- for (var o3 = 0; o3 < e4.length; o3++)
- e4[o3] = t4(e4[o3], r3);
- else if ("object" == typeof e4)
- for (var i3 in e4)
- e4[i3] = t4(e4[i3], r3);
- return e4;
- }(t3.data, e3), t3.attachments = void 0, t3;
- }, e2.removeBlobs = function(t3, e3) {
- var r3 = 0, i3 = t3;
- !function t4(c2, h2, u2) {
- if (!c2)
- return c2;
- if (s2 && c2 instanceof Blob || a2 && c2 instanceof File) {
- r3++;
- var f2 = new FileReader();
- f2.onload = function() {
- u2 ? u2[h2] = this.result : i3 = this.result, --r3 || e3(i3);
- }, f2.readAsArrayBuffer(c2);
- } else if (n2(c2))
- for (var p2 = 0; p2 < c2.length; p2++)
- t4(c2[p2], p2, c2);
- else if ("object" == typeof c2 && !o2(c2))
- for (var l2 in c2)
- t4(c2[l2], l2, c2);
- }(i3), r3 || e3(i3);
- };
- }, function(t2, e2, r2) {
- e2.byteLength = function(t3) {
- var e3 = h2(t3), r3 = e3[0], n3 = e3[1];
- return 3 * (r3 + n3) / 4 - n3;
- }, e2.toByteArray = function(t3) {
- var e3, r3, n3 = h2(t3), s3 = n3[0], a3 = n3[1], c3 = new i2(function(t4, e4, r4) {
- return 3 * (e4 + r4) / 4 - r4;
- }(0, s3, a3)), u3 = 0, f2 = a3 > 0 ? s3 - 4 : s3;
- for (r3 = 0; r3 < f2; r3 += 4)
- e3 = o2[t3.charCodeAt(r3)] << 18 | o2[t3.charCodeAt(r3 + 1)] << 12 | o2[t3.charCodeAt(r3 + 2)] << 6 | o2[t3.charCodeAt(r3 + 3)], c3[u3++] = e3 >> 16 & 255, c3[u3++] = e3 >> 8 & 255, c3[u3++] = 255 & e3;
- 2 === a3 && (e3 = o2[t3.charCodeAt(r3)] << 2 | o2[t3.charCodeAt(r3 + 1)] >> 4, c3[u3++] = 255 & e3);
- 1 === a3 && (e3 = o2[t3.charCodeAt(r3)] << 10 | o2[t3.charCodeAt(r3 + 1)] << 4 | o2[t3.charCodeAt(r3 + 2)] >> 2, c3[u3++] = e3 >> 8 & 255, c3[u3++] = 255 & e3);
- return c3;
- }, e2.fromByteArray = function(t3) {
- for (var e3, r3 = t3.length, o3 = r3 % 3, i3 = [], s3 = 0, a3 = r3 - o3; s3 < a3; s3 += 16383)
- i3.push(u2(t3, s3, s3 + 16383 > a3 ? a3 : s3 + 16383));
- 1 === o3 ? (e3 = t3[r3 - 1], i3.push(n2[e3 >> 2] + n2[e3 << 4 & 63] + "==")) : 2 === o3 && (e3 = (t3[r3 - 2] << 8) + t3[r3 - 1], i3.push(n2[e3 >> 10] + n2[e3 >> 4 & 63] + n2[e3 << 2 & 63] + "="));
- return i3.join("");
- };
- for (var n2 = [], o2 = [], i2 = "undefined" != typeof Uint8Array ? Uint8Array : Array, s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a2 = 0, c2 = s2.length; a2 < c2; ++a2)
- n2[a2] = s2[a2], o2[s2.charCodeAt(a2)] = a2;
- function h2(t3) {
- var e3 = t3.length;
- if (e3 % 4 > 0)
- throw new Error("Invalid string. Length must be a multiple of 4");
- var r3 = t3.indexOf("=");
- return -1 === r3 && (r3 = e3), [r3, r3 === e3 ? 0 : 4 - r3 % 4];
- }
- function u2(t3, e3, r3) {
- for (var o3, i3, s3 = [], a3 = e3; a3 < r3; a3 += 3)
- o3 = (t3[a3] << 16 & 16711680) + (t3[a3 + 1] << 8 & 65280) + (255 & t3[a3 + 2]), s3.push(n2[(i3 = o3) >> 18 & 63] + n2[i3 >> 12 & 63] + n2[i3 >> 6 & 63] + n2[63 & i3]);
- return s3.join("");
- }
- o2["-".charCodeAt(0)] = 62, o2["_".charCodeAt(0)] = 63;
- }, function(t2, e2) {
- e2.read = function(t3, e3, r2, n2, o2) {
- var i2, s2, a2 = 8 * o2 - n2 - 1, c2 = (1 << a2) - 1, h2 = c2 >> 1, u2 = -7, f2 = r2 ? o2 - 1 : 0, p2 = r2 ? -1 : 1, l2 = t3[e3 + f2];
- for (f2 += p2, i2 = l2 & (1 << -u2) - 1, l2 >>= -u2, u2 += a2; u2 > 0; i2 = 256 * i2 + t3[e3 + f2], f2 += p2, u2 -= 8)
- ;
- for (s2 = i2 & (1 << -u2) - 1, i2 >>= -u2, u2 += n2; u2 > 0; s2 = 256 * s2 + t3[e3 + f2], f2 += p2, u2 -= 8)
- ;
- if (0 === i2)
- i2 = 1 - h2;
- else {
- if (i2 === c2)
- return s2 ? NaN : 1 / 0 * (l2 ? -1 : 1);
- s2 += Math.pow(2, n2), i2 -= h2;
- }
- return (l2 ? -1 : 1) * s2 * Math.pow(2, i2 - n2);
- }, e2.write = function(t3, e3, r2, n2, o2, i2) {
- var s2, a2, c2, h2 = 8 * i2 - o2 - 1, u2 = (1 << h2) - 1, f2 = u2 >> 1, p2 = 23 === o2 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, l2 = n2 ? 0 : i2 - 1, d2 = n2 ? 1 : -1, y2 = e3 < 0 || 0 === e3 && 1 / e3 < 0 ? 1 : 0;
- for (e3 = Math.abs(e3), isNaN(e3) || e3 === 1 / 0 ? (a2 = isNaN(e3) ? 1 : 0, s2 = u2) : (s2 = Math.floor(Math.log(e3) / Math.LN2), e3 * (c2 = Math.pow(2, -s2)) < 1 && (s2--, c2 *= 2), (e3 += s2 + f2 >= 1 ? p2 / c2 : p2 * Math.pow(2, 1 - f2)) * c2 >= 2 && (s2++, c2 /= 2), s2 + f2 >= u2 ? (a2 = 0, s2 = u2) : s2 + f2 >= 1 ? (a2 = (e3 * c2 - 1) * Math.pow(2, o2), s2 += f2) : (a2 = e3 * Math.pow(2, f2 - 1) * Math.pow(2, o2), s2 = 0)); o2 >= 8; t3[r2 + l2] = 255 & a2, l2 += d2, a2 /= 256, o2 -= 8)
- ;
- for (s2 = s2 << o2 | a2, h2 += o2; h2 > 0; t3[r2 + l2] = 255 & s2, l2 += d2, s2 /= 256, h2 -= 8)
- ;
- t3[r2 + l2 - d2] |= 128 * y2;
- };
- }, function(t2, e2) {
- var r2 = {}.toString;
- t2.exports = Array.isArray || function(t3) {
- return "[object Array]" == r2.call(t3);
- };
- }, function(t2, e2, r2) {
- t2.exports = r2(30), t2.exports.parser = r2(2);
- }, function(t2, e2, r2) {
- var n2 = r2(14), o2 = r2(1), i2 = r2(0)("engine.io-client:socket"), s2 = r2(18), a2 = r2(2), c2 = r2(9), h2 = r2(3);
- function u2(t3, e3) {
- if (!(this instanceof u2))
- return new u2(t3, e3);
- e3 = e3 || {}, t3 && "object" == typeof t3 && (e3 = t3, t3 = null), t3 ? (t3 = c2(t3), e3.hostname = t3.host, e3.secure = "https" === t3.protocol || "wss" === t3.protocol, e3.port = t3.port, t3.query && (e3.query = t3.query)) : e3.host && (e3.hostname = c2(e3.host).host), this.secure = null != e3.secure ? e3.secure : "undefined" != typeof location && "https:" === location.protocol, e3.hostname && !e3.port && (e3.port = this.secure ? "443" : "80"), this.agent = e3.agent || false, this.hostname = e3.hostname || ("undefined" != typeof location ? location.hostname : "localhost"), this.port = e3.port || ("undefined" != typeof location && location.port ? location.port : this.secure ? 443 : 80), this.query = e3.query || {}, "string" == typeof this.query && (this.query = h2.decode(this.query)), this.upgrade = false !== e3.upgrade, this.path = (e3.path || "/engine.io").replace(/\/$/, "") + "/", this.forceJSONP = !!e3.forceJSONP, this.jsonp = false !== e3.jsonp, this.forceBase64 = !!e3.forceBase64, this.enablesXDR = !!e3.enablesXDR, this.withCredentials = false !== e3.withCredentials, this.timestampParam = e3.timestampParam || "t", this.timestampRequests = e3.timestampRequests, this.transports = e3.transports || ["polling", "websocket"], this.transportOptions = e3.transportOptions || {}, this.readyState = "", this.writeBuffer = [], this.prevBufferLen = 0, this.policyPort = e3.policyPort || 843, this.rememberUpgrade = e3.rememberUpgrade || false, this.binaryType = null, this.onlyBinaryUpgrades = e3.onlyBinaryUpgrades, this.perMessageDeflate = false !== e3.perMessageDeflate && (e3.perMessageDeflate || {}), true === this.perMessageDeflate && (this.perMessageDeflate = {}), this.perMessageDeflate && null == this.perMessageDeflate.threshold && (this.perMessageDeflate.threshold = 1024), this.pfx = e3.pfx || null, this.key = e3.key || null, this.passphrase = e3.passphrase || null, this.cert = e3.cert || null, this.ca = e3.ca || null, this.ciphers = e3.ciphers || null, this.rejectUnauthorized = void 0 === e3.rejectUnauthorized || e3.rejectUnauthorized, this.forceNode = !!e3.forceNode, this.isReactNative = "undefined" != typeof navigator && "string" == typeof navigator.product && "reactnative" === navigator.product.toLowerCase(), ("undefined" == typeof self || this.isReactNative) && (e3.extraHeaders && Object.keys(e3.extraHeaders).length > 0 && (this.extraHeaders = e3.extraHeaders), e3.localAddress && (this.localAddress = e3.localAddress)), this.id = null, this.upgrades = null, this.pingInterval = null, this.pingTimeout = null, this.pingIntervalTimer = null, this.pingTimeoutTimer = null, this.open();
- }
- t2.exports = u2, u2.priorWebsocketSuccess = false, o2(u2.prototype), u2.protocol = a2.protocol, u2.Socket = u2, u2.Transport = r2(8), u2.transports = r2(14), u2.parser = r2(2), u2.prototype.createTransport = function(t3) {
- i2('creating transport "%s"', t3);
- var e3 = function(t4) {
- var e4 = {};
- for (var r4 in t4)
- t4.hasOwnProperty(r4) && (e4[r4] = t4[r4]);
- return e4;
- }(this.query);
- e3.EIO = a2.protocol, e3.transport = t3;
- var r3 = this.transportOptions[t3] || {};
- return this.id && (e3.sid = this.id), new n2[t3]({ query: e3, socket: this, agent: r3.agent || this.agent, hostname: r3.hostname || this.hostname, port: r3.port || this.port, secure: r3.secure || this.secure, path: r3.path || this.path, forceJSONP: r3.forceJSONP || this.forceJSONP, jsonp: r3.jsonp || this.jsonp, forceBase64: r3.forceBase64 || this.forceBase64, enablesXDR: r3.enablesXDR || this.enablesXDR, withCredentials: r3.withCredentials || this.withCredentials, timestampRequests: r3.timestampRequests || this.timestampRequests, timestampParam: r3.timestampParam || this.timestampParam, policyPort: r3.policyPort || this.policyPort, pfx: r3.pfx || this.pfx, key: r3.key || this.key, passphrase: r3.passphrase || this.passphrase, cert: r3.cert || this.cert, ca: r3.ca || this.ca, ciphers: r3.ciphers || this.ciphers, rejectUnauthorized: r3.rejectUnauthorized || this.rejectUnauthorized, perMessageDeflate: r3.perMessageDeflate || this.perMessageDeflate, extraHeaders: r3.extraHeaders || this.extraHeaders, forceNode: r3.forceNode || this.forceNode, localAddress: r3.localAddress || this.localAddress, requestTimeout: r3.requestTimeout || this.requestTimeout, protocols: r3.protocols || void 0, isReactNative: this.isReactNative });
- }, u2.prototype.open = function() {
- var t3;
- if (this.rememberUpgrade && u2.priorWebsocketSuccess && -1 !== this.transports.indexOf("websocket"))
- t3 = "websocket";
- else {
- if (0 === this.transports.length) {
- var e3 = this;
- return void setTimeout(function() {
- e3.emit("error", "No transports available");
- }, 0);
- }
- t3 = this.transports[0];
- }
- this.readyState = "opening";
- try {
- t3 = this.createTransport(t3);
- } catch (t4) {
- return this.transports.shift(), void this.open();
- }
- t3.open(), this.setTransport(t3);
- }, u2.prototype.setTransport = function(t3) {
- i2("setting transport %s", t3.name);
- var e3 = this;
- this.transport && (i2("clearing existing transport %s", this.transport.name), this.transport.removeAllListeners()), this.transport = t3, t3.on("drain", function() {
- e3.onDrain();
- }).on("packet", function(t4) {
- e3.onPacket(t4);
- }).on("error", function(t4) {
- e3.onError(t4);
- }).on("close", function() {
- e3.onClose("transport close");
- });
- }, u2.prototype.probe = function(t3) {
- i2('probing transport "%s"', t3);
- var e3 = this.createTransport(t3, { probe: 1 }), r3 = false, n3 = this;
- function o3() {
- if (n3.onlyBinaryUpgrades) {
- var o4 = !this.supportsBinary && n3.transport.supportsBinary;
- r3 = r3 || o4;
- }
- r3 || (i2('probe transport "%s" opened', t3), e3.send([{ type: "ping", data: "probe" }]), e3.once("packet", function(o5) {
- if (!r3)
- if ("pong" === o5.type && "probe" === o5.data) {
- if (i2('probe transport "%s" pong', t3), n3.upgrading = true, n3.emit("upgrading", e3), !e3)
- return;
- u2.priorWebsocketSuccess = "websocket" === e3.name, i2('pausing current transport "%s"', n3.transport.name), n3.transport.pause(function() {
- r3 || "closed" !== n3.readyState && (i2("changing transport and sending upgrade packet"), p2(), n3.setTransport(e3), e3.send([{ type: "upgrade" }]), n3.emit("upgrade", e3), e3 = null, n3.upgrading = false, n3.flush());
- });
- } else {
- i2('probe transport "%s" failed', t3);
- var s4 = new Error("probe error");
- s4.transport = e3.name, n3.emit("upgradeError", s4);
- }
- }));
- }
- function s3() {
- r3 || (r3 = true, p2(), e3.close(), e3 = null);
- }
- function a3(r4) {
- var o4 = new Error("probe error: " + r4);
- o4.transport = e3.name, s3(), i2('probe transport "%s" failed because of error: %s', t3, r4), n3.emit("upgradeError", o4);
- }
- function c3() {
- a3("transport closed");
- }
- function h3() {
- a3("socket closed");
- }
- function f2(t4) {
- e3 && t4.name !== e3.name && (i2('"%s" works - aborting "%s"', t4.name, e3.name), s3());
- }
- function p2() {
- e3.removeListener("open", o3), e3.removeListener("error", a3), e3.removeListener("close", c3), n3.removeListener("close", h3), n3.removeListener("upgrading", f2);
- }
- u2.priorWebsocketSuccess = false, e3.once("open", o3), e3.once("error", a3), e3.once("close", c3), this.once("close", h3), this.once("upgrading", f2), e3.open();
- }, u2.prototype.onOpen = function() {
- if (i2("socket open"), this.readyState = "open", u2.priorWebsocketSuccess = "websocket" === this.transport.name, this.emit("open"), this.flush(), "open" === this.readyState && this.upgrade && this.transport.pause) {
- i2("starting upgrade probes");
- for (var t3 = 0, e3 = this.upgrades.length; t3 < e3; t3++)
- this.probe(this.upgrades[t3]);
- }
- }, u2.prototype.onPacket = function(t3) {
- if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState)
- switch (i2('socket receive: type "%s", data "%s"', t3.type, t3.data), this.emit("packet", t3), this.emit("heartbeat"), t3.type) {
- case "open":
- this.onHandshake(JSON.parse(t3.data));
- break;
- case "pong":
- this.setPing(), this.emit("pong");
- break;
- case "error":
- var e3 = new Error("server error");
- e3.code = t3.data, this.onError(e3);
- break;
- case "message":
- this.emit("data", t3.data), this.emit("message", t3.data);
- }
- else
- i2('packet received with socket readyState "%s"', this.readyState);
- }, u2.prototype.onHandshake = function(t3) {
- this.emit("handshake", t3), this.id = t3.sid, this.transport.query.sid = t3.sid, this.upgrades = this.filterUpgrades(t3.upgrades), this.pingInterval = t3.pingInterval, this.pingTimeout = t3.pingTimeout, this.onOpen(), "closed" !== this.readyState && (this.setPing(), this.removeListener("heartbeat", this.onHeartbeat), this.on("heartbeat", this.onHeartbeat));
- }, u2.prototype.onHeartbeat = function(t3) {
- clearTimeout(this.pingTimeoutTimer);
- var e3 = this;
- e3.pingTimeoutTimer = setTimeout(function() {
- "closed" !== e3.readyState && e3.onClose("ping timeout");
- }, t3 || e3.pingInterval + e3.pingTimeout);
- }, u2.prototype.setPing = function() {
- var t3 = this;
- clearTimeout(t3.pingIntervalTimer), t3.pingIntervalTimer = setTimeout(function() {
- i2("writing ping packet - expecting pong within %sms", t3.pingTimeout), t3.ping(), t3.onHeartbeat(t3.pingTimeout);
- }, t3.pingInterval);
- }, u2.prototype.ping = function() {
- var t3 = this;
- this.sendPacket("ping", function() {
- t3.emit("ping");
- });
- }, u2.prototype.onDrain = function() {
- this.writeBuffer.splice(0, this.prevBufferLen), this.prevBufferLen = 0, 0 === this.writeBuffer.length ? this.emit("drain") : this.flush();
- }, u2.prototype.flush = function() {
- "closed" !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length && (i2("flushing %d packets in socket", this.writeBuffer.length), this.transport.send(this.writeBuffer), this.prevBufferLen = this.writeBuffer.length, this.emit("flush"));
- }, u2.prototype.write = u2.prototype.send = function(t3, e3, r3) {
- return this.sendPacket("message", t3, e3, r3), this;
- }, u2.prototype.sendPacket = function(t3, e3, r3, n3) {
- if ("function" == typeof e3 && (n3 = e3, e3 = void 0), "function" == typeof r3 && (n3 = r3, r3 = null), "closing" !== this.readyState && "closed" !== this.readyState) {
- (r3 = r3 || {}).compress = false !== r3.compress;
- var o3 = { type: t3, data: e3, options: r3 };
- this.emit("packetCreate", o3), this.writeBuffer.push(o3), n3 && this.once("flush", n3), this.flush();
- }
- }, u2.prototype.close = function() {
- if ("opening" === this.readyState || "open" === this.readyState) {
- this.readyState = "closing";
- var t3 = this;
- this.writeBuffer.length ? this.once("drain", function() {
- this.upgrading ? n3() : e3();
- }) : this.upgrading ? n3() : e3();
- }
- function e3() {
- t3.onClose("forced close"), i2("socket closing - telling transport to close"), t3.transport.close();
- }
- function r3() {
- t3.removeListener("upgrade", r3), t3.removeListener("upgradeError", r3), e3();
- }
- function n3() {
- t3.once("upgrade", r3), t3.once("upgradeError", r3);
- }
- return this;
- }, u2.prototype.onError = function(t3) {
- i2("socket error %j", t3), u2.priorWebsocketSuccess = false, this.emit("error", t3), this.onClose("transport error", t3);
- }, u2.prototype.onClose = function(t3, e3) {
- if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
- i2('socket close with reason: "%s"', t3);
- clearTimeout(this.pingIntervalTimer), clearTimeout(this.pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), this.readyState = "closed", this.id = null, this.emit("close", t3, e3), this.writeBuffer = [], this.prevBufferLen = 0;
- }
- }, u2.prototype.filterUpgrades = function(t3) {
- for (var e3 = [], r3 = 0, n3 = t3.length; r3 < n3; r3++)
- ~s2(this.transports, t3[r3]) && e3.push(t3[r3]);
- return e3;
- };
- }, function(t2, e2) {
- try {
- t2.exports = "undefined" != typeof XMLHttpRequest && "withCredentials" in new XMLHttpRequest();
- } catch (e3) {
- t2.exports = false;
- }
- }, function(t2, e2, r2) {
- var n2 = r2(7), o2 = r2(15), i2 = r2(1), s2 = r2(4), a2 = r2(0)("engine.io-client:polling-xhr");
- function c2() {
- }
- function h2(t3) {
- if (o2.call(this, t3), this.requestTimeout = t3.requestTimeout, this.extraHeaders = t3.extraHeaders, "undefined" != typeof location) {
- var e3 = "https:" === location.protocol, r3 = location.port;
- r3 || (r3 = e3 ? 443 : 80), this.xd = "undefined" != typeof location && t3.hostname !== location.hostname || r3 !== t3.port, this.xs = t3.secure !== e3;
- }
- }
- function u2(t3) {
- this.method = t3.method || "GET", this.uri = t3.uri, this.xd = !!t3.xd, this.xs = !!t3.xs, this.async = false !== t3.async, this.data = void 0 !== t3.data ? t3.data : null, this.agent = t3.agent, this.isBinary = t3.isBinary, this.supportsBinary = t3.supportsBinary, this.enablesXDR = t3.enablesXDR, this.withCredentials = t3.withCredentials, this.requestTimeout = t3.requestTimeout, this.pfx = t3.pfx, this.key = t3.key, this.passphrase = t3.passphrase, this.cert = t3.cert, this.ca = t3.ca, this.ciphers = t3.ciphers, this.rejectUnauthorized = t3.rejectUnauthorized, this.extraHeaders = t3.extraHeaders, this.create();
- }
- if (t2.exports = h2, t2.exports.Request = u2, s2(h2, o2), h2.prototype.supportsBinary = true, h2.prototype.request = function(t3) {
- return (t3 = t3 || {}).uri = this.uri(), t3.xd = this.xd, t3.xs = this.xs, t3.agent = this.agent || false, t3.supportsBinary = this.supportsBinary, t3.enablesXDR = this.enablesXDR, t3.withCredentials = this.withCredentials, t3.pfx = this.pfx, t3.key = this.key, t3.passphrase = this.passphrase, t3.cert = this.cert, t3.ca = this.ca, t3.ciphers = this.ciphers, t3.rejectUnauthorized = this.rejectUnauthorized, t3.requestTimeout = this.requestTimeout, t3.extraHeaders = this.extraHeaders, new u2(t3);
- }, h2.prototype.doWrite = function(t3, e3) {
- var r3 = "string" != typeof t3 && void 0 !== t3, n3 = this.request({ method: "POST", data: t3, isBinary: r3 }), o3 = this;
- n3.on("success", e3), n3.on("error", function(t4) {
- o3.onError("xhr post error", t4);
- }), this.sendXhr = n3;
- }, h2.prototype.doPoll = function() {
- a2("xhr poll");
- var t3 = this.request(), e3 = this;
- t3.on("data", function(t4) {
- e3.onData(t4);
- }), t3.on("error", function(t4) {
- e3.onError("xhr poll error", t4);
- }), this.pollXhr = t3;
- }, i2(u2.prototype), u2.prototype.create = function() {
- var t3 = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
- t3.pfx = this.pfx, t3.key = this.key, t3.passphrase = this.passphrase, t3.cert = this.cert, t3.ca = this.ca, t3.ciphers = this.ciphers, t3.rejectUnauthorized = this.rejectUnauthorized;
- var e3 = this.xhr = new n2(t3), r3 = this;
- try {
- a2("xhr open %s: %s", this.method, this.uri), e3.open(this.method, this.uri, this.async);
- try {
- if (this.extraHeaders)
- for (var o3 in e3.setDisableHeaderCheck && e3.setDisableHeaderCheck(true), this.extraHeaders)
- this.extraHeaders.hasOwnProperty(o3) && e3.setRequestHeader(o3, this.extraHeaders[o3]);
- } catch (t4) {
- }
- if ("POST" === this.method)
- try {
- this.isBinary ? e3.setRequestHeader("Content-type", "application/octet-stream") : e3.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
- } catch (t4) {
- }
- try {
- e3.setRequestHeader("Accept", "*/*");
- } catch (t4) {
- }
- "withCredentials" in e3 && (e3.withCredentials = this.withCredentials), this.requestTimeout && (e3.timeout = this.requestTimeout), this.hasXDR() ? (e3.onload = function() {
- r3.onLoad();
- }, e3.onerror = function() {
- r3.onError(e3.responseText);
- }) : e3.onreadystatechange = function() {
- if (2 === e3.readyState)
- try {
- var t4 = e3.getResponseHeader("Content-Type");
- (r3.supportsBinary && "application/octet-stream" === t4 || "application/octet-stream; charset=UTF-8" === t4) && (e3.responseType = "arraybuffer");
- } catch (t5) {
- }
- 4 === e3.readyState && (200 === e3.status || 1223 === e3.status ? r3.onLoad() : setTimeout(function() {
- r3.onError("number" == typeof e3.status ? e3.status : 0);
- }, 0));
- }, a2("xhr data %s", this.data), e3.send(this.data);
- } catch (t4) {
- return void setTimeout(function() {
- r3.onError(t4);
- }, 0);
- }
- "undefined" != typeof document && (this.index = u2.requestsCount++, u2.requests[this.index] = this);
- }, u2.prototype.onSuccess = function() {
- this.emit("success"), this.cleanup();
- }, u2.prototype.onData = function(t3) {
- this.emit("data", t3), this.onSuccess();
- }, u2.prototype.onError = function(t3) {
- this.emit("error", t3), this.cleanup(true);
- }, u2.prototype.cleanup = function(t3) {
- if (void 0 !== this.xhr && null !== this.xhr) {
- if (this.hasXDR() ? this.xhr.onload = this.xhr.onerror = c2 : this.xhr.onreadystatechange = c2, t3)
- try {
- this.xhr.abort();
- } catch (t4) {
- }
- "undefined" != typeof document && delete u2.requests[this.index], this.xhr = null;
- }
- }, u2.prototype.onLoad = function() {
- var t3;
- try {
- var e3;
- try {
- e3 = this.xhr.getResponseHeader("Content-Type");
- } catch (t4) {
- }
- t3 = ("application/octet-stream" === e3 || "application/octet-stream; charset=UTF-8" === e3) && this.xhr.response || this.xhr.responseText;
- } catch (t4) {
- this.onError(t4);
- }
- null != t3 && this.onData(t3);
- }, u2.prototype.hasXDR = function() {
- return "undefined" != typeof XDomainRequest && !this.xs && this.enablesXDR;
- }, u2.prototype.abort = function() {
- this.cleanup();
- }, u2.requestsCount = 0, u2.requests = {}, "undefined" != typeof document) {
- if ("function" == typeof attachEvent)
- attachEvent("onunload", p2);
- else if ("function" == typeof addEventListener) {
- var f2 = "onpagehide" in self ? "pagehide" : "unload";
- addEventListener(f2, p2, false);
- }
- }
- function p2() {
- for (var t3 in u2.requests)
- u2.requests.hasOwnProperty(t3) && u2.requests[t3].abort();
- }
- }, function(t2, e2) {
- t2.exports = Object.keys || function(t3) {
- var e3 = [], r2 = Object.prototype.hasOwnProperty;
- for (var n2 in t3)
- r2.call(t3, n2) && e3.push(n2);
- return e3;
- };
- }, function(t2, e2) {
- var r2 = {}.toString;
- t2.exports = Array.isArray || function(t3) {
- return "[object Array]" == r2.call(t3);
- };
- }, function(t2, e2) {
- t2.exports = function(t3, e3, r2) {
- var n2 = t3.byteLength;
- if (e3 = e3 || 0, r2 = r2 || n2, t3.slice)
- return t3.slice(e3, r2);
- if (e3 < 0 && (e3 += n2), r2 < 0 && (r2 += n2), r2 > n2 && (r2 = n2), e3 >= n2 || e3 >= r2 || 0 === n2)
- return new ArrayBuffer(0);
- for (var o2 = new Uint8Array(t3), i2 = new Uint8Array(r2 - e3), s2 = e3, a2 = 0; s2 < r2; s2++, a2++)
- i2[a2] = o2[s2];
- return i2.buffer;
- };
- }, function(t2, e2) {
- function r2() {
- }
- t2.exports = function(t3, e3, n2) {
- var o2 = false;
- return n2 = n2 || r2, i2.count = t3, 0 === t3 ? e3() : i2;
- function i2(t4, r3) {
- if (i2.count <= 0)
- throw new Error("after called too many times");
- --i2.count, t4 ? (o2 = true, e3(t4), e3 = n2) : 0 !== i2.count || o2 || e3(null, r3);
- }
- };
- }, function(t2, e2) {
- /*! https://mths.be/utf8js v2.1.2 by @mathias */
- var r2, n2, o2, i2 = String.fromCharCode;
- function s2(t3) {
- for (var e3, r3, n3 = [], o3 = 0, i3 = t3.length; o3 < i3; )
- (e3 = t3.charCodeAt(o3++)) >= 55296 && e3 <= 56319 && o3 < i3 ? 56320 == (64512 & (r3 = t3.charCodeAt(o3++))) ? n3.push(((1023 & e3) << 10) + (1023 & r3) + 65536) : (n3.push(e3), o3--) : n3.push(e3);
- return n3;
- }
- function a2(t3, e3) {
- if (t3 >= 55296 && t3 <= 57343) {
- if (e3)
- throw Error("Lone surrogate U+" + t3.toString(16).toUpperCase() + " is not a scalar value");
- return false;
- }
- return true;
- }
- function c2(t3, e3) {
- return i2(t3 >> e3 & 63 | 128);
- }
- function h2(t3, e3) {
- if (0 == (4294967168 & t3))
- return i2(t3);
- var r3 = "";
- return 0 == (4294965248 & t3) ? r3 = i2(t3 >> 6 & 31 | 192) : 0 == (4294901760 & t3) ? (a2(t3, e3) || (t3 = 65533), r3 = i2(t3 >> 12 & 15 | 224), r3 += c2(t3, 6)) : 0 == (4292870144 & t3) && (r3 = i2(t3 >> 18 & 7 | 240), r3 += c2(t3, 12), r3 += c2(t3, 6)), r3 += i2(63 & t3 | 128);
- }
- function u2() {
- if (o2 >= n2)
- throw Error("Invalid byte index");
- var t3 = 255 & r2[o2];
- if (o2++, 128 == (192 & t3))
- return 63 & t3;
- throw Error("Invalid continuation byte");
- }
- function f2(t3) {
- var e3, i3;
- if (o2 > n2)
- throw Error("Invalid byte index");
- if (o2 == n2)
- return false;
- if (e3 = 255 & r2[o2], o2++, 0 == (128 & e3))
- return e3;
- if (192 == (224 & e3)) {
- if ((i3 = (31 & e3) << 6 | u2()) >= 128)
- return i3;
- throw Error("Invalid continuation byte");
- }
- if (224 == (240 & e3)) {
- if ((i3 = (15 & e3) << 12 | u2() << 6 | u2()) >= 2048)
- return a2(i3, t3) ? i3 : 65533;
- throw Error("Invalid continuation byte");
- }
- if (240 == (248 & e3) && (i3 = (7 & e3) << 18 | u2() << 12 | u2() << 6 | u2()) >= 65536 && i3 <= 1114111)
- return i3;
- throw Error("Invalid UTF-8 detected");
- }
- t2.exports = { version: "2.1.2", encode: function(t3, e3) {
- for (var r3 = false !== (e3 = e3 || {}).strict, n3 = s2(t3), o3 = n3.length, i3 = -1, a3 = ""; ++i3 < o3; )
- a3 += h2(n3[i3], r3);
- return a3;
- }, decode: function(t3, e3) {
- var a3 = false !== (e3 = e3 || {}).strict;
- r2 = s2(t3), n2 = r2.length, o2 = 0;
- for (var c3, h3 = []; false !== (c3 = f2(a3)); )
- h3.push(c3);
- return function(t4) {
- for (var e4, r3 = t4.length, n3 = -1, o3 = ""; ++n3 < r3; )
- (e4 = t4[n3]) > 65535 && (o3 += i2((e4 -= 65536) >>> 10 & 1023 | 55296), e4 = 56320 | 1023 & e4), o3 += i2(e4);
- return o3;
- }(h3);
- } };
- }, function(t2, e2) {
- !function() {
- for (var t3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r2 = new Uint8Array(256), n2 = 0; n2 < t3.length; n2++)
- r2[t3.charCodeAt(n2)] = n2;
- e2.encode = function(e3) {
- var r3, n3 = new Uint8Array(e3), o2 = n3.length, i2 = "";
- for (r3 = 0; r3 < o2; r3 += 3)
- i2 += t3[n3[r3] >> 2], i2 += t3[(3 & n3[r3]) << 4 | n3[r3 + 1] >> 4], i2 += t3[(15 & n3[r3 + 1]) << 2 | n3[r3 + 2] >> 6], i2 += t3[63 & n3[r3 + 2]];
- return o2 % 3 == 2 ? i2 = i2.substring(0, i2.length - 1) + "=" : o2 % 3 == 1 && (i2 = i2.substring(0, i2.length - 2) + "=="), i2;
- }, e2.decode = function(t4) {
- var e3, n3, o2, i2, s2, a2 = 0.75 * t4.length, c2 = t4.length, h2 = 0;
- "=" === t4[t4.length - 1] && (a2--, "=" === t4[t4.length - 2] && a2--);
- var u2 = new ArrayBuffer(a2), f2 = new Uint8Array(u2);
- for (e3 = 0; e3 < c2; e3 += 4)
- n3 = r2[t4.charCodeAt(e3)], o2 = r2[t4.charCodeAt(e3 + 1)], i2 = r2[t4.charCodeAt(e3 + 2)], s2 = r2[t4.charCodeAt(e3 + 3)], f2[h2++] = n3 << 2 | o2 >> 4, f2[h2++] = (15 & o2) << 4 | i2 >> 2, f2[h2++] = (3 & i2) << 6 | 63 & s2;
- return u2;
- };
- }();
- }, function(t2, e2) {
- var r2 = void 0 !== r2 ? r2 : "undefined" != typeof WebKitBlobBuilder ? WebKitBlobBuilder : "undefined" != typeof MSBlobBuilder ? MSBlobBuilder : "undefined" != typeof MozBlobBuilder && MozBlobBuilder, n2 = function() {
- try {
- return 2 === new Blob(["hi"]).size;
- } catch (t3) {
- return false;
- }
- }(), o2 = n2 && function() {
- try {
- return 2 === new Blob([new Uint8Array([1, 2])]).size;
- } catch (t3) {
- return false;
- }
- }(), i2 = r2 && r2.prototype.append && r2.prototype.getBlob;
- function s2(t3) {
- return t3.map(function(t4) {
- if (t4.buffer instanceof ArrayBuffer) {
- var e3 = t4.buffer;
- if (t4.byteLength !== e3.byteLength) {
- var r3 = new Uint8Array(t4.byteLength);
- r3.set(new Uint8Array(e3, t4.byteOffset, t4.byteLength)), e3 = r3.buffer;
- }
- return e3;
- }
- return t4;
- });
- }
- function a2(t3, e3) {
- e3 = e3 || {};
- var n3 = new r2();
- return s2(t3).forEach(function(t4) {
- n3.append(t4);
- }), e3.type ? n3.getBlob(e3.type) : n3.getBlob();
- }
- function c2(t3, e3) {
- return new Blob(s2(t3), e3 || {});
- }
- "undefined" != typeof Blob && (a2.prototype = Blob.prototype, c2.prototype = Blob.prototype), t2.exports = n2 ? o2 ? Blob : c2 : i2 ? a2 : void 0;
- }, function(t2, e2, r2) {
- (function(e3) {
- var n2 = r2(15), o2 = r2(4);
- t2.exports = u2;
- var i2, s2 = /\n/g, a2 = /\\n/g;
- function c2() {
- }
- function h2() {
- return "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== e3 ? e3 : {};
- }
- function u2(t3) {
- if (n2.call(this, t3), this.query = this.query || {}, !i2) {
- var e4 = h2();
- i2 = e4.___eio = e4.___eio || [];
- }
- this.index = i2.length;
- var r3 = this;
- i2.push(function(t4) {
- r3.onData(t4);
- }), this.query.j = this.index, "function" == typeof addEventListener && addEventListener("beforeunload", function() {
- r3.script && (r3.script.onerror = c2);
- }, false);
- }
- o2(u2, n2), u2.prototype.supportsBinary = false, u2.prototype.doClose = function() {
- this.script && (this.script.parentNode.removeChild(this.script), this.script = null), this.form && (this.form.parentNode.removeChild(this.form), this.form = null, this.iframe = null), n2.prototype.doClose.call(this);
- }, u2.prototype.doPoll = function() {
- var t3 = this, e4 = document.createElement("script");
- this.script && (this.script.parentNode.removeChild(this.script), this.script = null), e4.async = true, e4.src = this.uri(), e4.onerror = function(e5) {
- t3.onError("jsonp poll error", e5);
- };
- var r3 = document.getElementsByTagName("script")[0];
- r3 ? r3.parentNode.insertBefore(e4, r3) : (document.head || document.body).appendChild(e4), this.script = e4, "undefined" != typeof navigator && /gecko/i.test(navigator.userAgent) && setTimeout(function() {
- var t4 = document.createElement("iframe");
- document.body.appendChild(t4), document.body.removeChild(t4);
- }, 100);
- }, u2.prototype.doWrite = function(t3, e4) {
- var r3 = this;
- if (!this.form) {
- var n3, o3 = document.createElement("form"), i3 = document.createElement("textarea"), c3 = this.iframeId = "eio_iframe_" + this.index;
- o3.className = "socketio", o3.style.position = "absolute", o3.style.top = "-1000px", o3.style.left = "-1000px", o3.target = c3, o3.method = "POST", o3.setAttribute("accept-charset", "utf-8"), i3.name = "d", o3.appendChild(i3), document.body.appendChild(o3), this.form = o3, this.area = i3;
- }
- function h3() {
- u3(), e4();
- }
- function u3() {
- if (r3.iframe)
- try {
- r3.form.removeChild(r3.iframe);
- } catch (t5) {
- r3.onError("jsonp polling iframe removal error", t5);
- }
- try {
- var t4 = '<iframe src="javascript:0" name="' + r3.iframeId + '">';
- n3 = document.createElement(t4);
- } catch (t5) {
- (n3 = document.createElement("iframe")).name = r3.iframeId, n3.src = "javascript:0";
- }
- n3.id = r3.iframeId, r3.form.appendChild(n3), r3.iframe = n3;
- }
- this.form.action = this.uri(), u3(), t3 = t3.replace(a2, "\\\n"), this.area.value = t3.replace(s2, "\\n");
- try {
- this.form.submit();
- } catch (t4) {
- }
- this.iframe.attachEvent ? this.iframe.onreadystatechange = function() {
- "complete" === r3.iframe.readyState && h3();
- } : this.iframe.onload = h3;
- };
- }).call(this, r2(12));
- }, function(t2, e2, r2) {
- (function(e3) {
- var n2, o2, i2 = r2(8), s2 = r2(2), a2 = r2(3), c2 = r2(4), h2 = r2(17), u2 = r2(0)("engine.io-client:websocket");
- if ("undefined" != typeof WebSocket ? n2 = WebSocket : "undefined" != typeof self && (n2 = self.WebSocket || self.MozWebSocket), "undefined" == typeof window)
- try {
- o2 = r2(42);
- } catch (t3) {
- }
- var f2 = n2 || o2;
- function p2(t3) {
- t3 && t3.forceBase64 && (this.supportsBinary = false), this.perMessageDeflate = t3.perMessageDeflate, this.usingBrowserWebSocket = n2 && !t3.forceNode, this.protocols = t3.protocols, this.usingBrowserWebSocket || (f2 = o2), i2.call(this, t3);
- }
- t2.exports = p2, c2(p2, i2), p2.prototype.name = "websocket", p2.prototype.supportsBinary = true, p2.prototype.doOpen = function() {
- if (this.check()) {
- var t3 = this.uri(), e4 = this.protocols, r3 = { agent: this.agent, perMessageDeflate: this.perMessageDeflate };
- r3.pfx = this.pfx, r3.key = this.key, r3.passphrase = this.passphrase, r3.cert = this.cert, r3.ca = this.ca, r3.ciphers = this.ciphers, r3.rejectUnauthorized = this.rejectUnauthorized, this.extraHeaders && (r3.headers = this.extraHeaders), this.localAddress && (r3.localAddress = this.localAddress);
- try {
- this.ws = this.usingBrowserWebSocket && !this.isReactNative ? e4 ? new f2(t3, e4) : new f2(t3) : new f2(t3, e4, r3);
- } catch (t4) {
- return this.emit("error", t4);
- }
- void 0 === this.ws.binaryType && (this.supportsBinary = false), this.ws.supports && this.ws.supports.binary ? (this.supportsBinary = true, this.ws.binaryType = "nodebuffer") : this.ws.binaryType = "arraybuffer", this.addEventListeners();
- }
- }, p2.prototype.addEventListeners = function() {
- var t3 = this;
- this.ws.onopen = function() {
- t3.onOpen();
- }, this.ws.onclose = function() {
- t3.onClose();
- }, this.ws.onmessage = function(e4) {
- t3.onData(e4.data);
- }, this.ws.onerror = function(e4) {
- t3.onError("websocket error", e4);
- };
- }, p2.prototype.write = function(t3) {
- var r3 = this;
- this.writable = false;
- for (var n3 = t3.length, o3 = 0, i3 = n3; o3 < i3; o3++)
- !function(t4) {
- s2.encodePacket(t4, r3.supportsBinary, function(o4) {
- if (!r3.usingBrowserWebSocket) {
- var i4 = {};
- if (t4.options && (i4.compress = t4.options.compress), r3.perMessageDeflate)
- ("string" == typeof o4 ? e3.byteLength(o4) : o4.length) < r3.perMessageDeflate.threshold && (i4.compress = false);
- }
- try {
- r3.usingBrowserWebSocket ? r3.ws.send(o4) : r3.ws.send(o4, i4);
- } catch (t5) {
- u2("websocket closed before onclose event");
- }
- --n3 || a3();
- });
- }(t3[o3]);
- function a3() {
- r3.emit("flush"), setTimeout(function() {
- r3.writable = true, r3.emit("drain");
- }, 0);
- }
- }, p2.prototype.onClose = function() {
- i2.prototype.onClose.call(this);
- }, p2.prototype.doClose = function() {
- void 0 !== this.ws && this.ws.close();
- }, p2.prototype.uri = function() {
- var t3 = this.query || {}, e4 = this.secure ? "wss" : "ws", r3 = "";
- return this.port && ("wss" === e4 && 443 !== Number(this.port) || "ws" === e4 && 80 !== Number(this.port)) && (r3 = ":" + this.port), this.timestampRequests && (t3[this.timestampParam] = h2()), this.supportsBinary || (t3.b64 = 1), (t3 = a2.encode(t3)).length && (t3 = "?" + t3), e4 + "://" + (-1 !== this.hostname.indexOf(":") ? "[" + this.hostname + "]" : this.hostname) + r3 + this.path + t3;
- }, p2.prototype.check = function() {
- return !(!f2 || "__initialize" in f2 && this.name === p2.prototype.name);
- };
- }).call(this, r2(6).Buffer);
- }, function(t2, e2, r2) {
- const n2 = r2(43), o2 = r2(44), i2 = r2(0)("@hyoga/uni-socket:"), s2 = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"], a2 = uni || wx;
- class c2 extends n2 {
- constructor(t3, e3, r3) {
- super(), this.readyState = c2.CONNECTING, this.protocol = "", this._socket = null, null !== t3 && (Array.isArray(e3) ? e3 = e3.join(", ") : "object" == typeof e3 && null !== e3 && (r3 = e3, e3 = void 0), h2.call(this, t3, e3, r3));
- }
- get CONNECTING() {
- return c2.CONNECTING;
- }
- get CLOSING() {
- return c2.CLOSING;
- }
- get CLOSED() {
- return c2.CLOSED;
- }
- get OPEN() {
- return c2.OPEN;
- }
- addSocketEventListeners() {
- this._socket.onOpen(() => {
- this.readyState = c2.OPEN, this.onopen();
- }), this._socket.onClose((t3) => {
- i2("onclose: ", t3), this.readyState = c2.CLOSED, this.onclose(t3.code, t3.reason);
- }), this._socket.onError((t3) => {
- i2("onerror: ", t3), this.onerror(t3);
- }), this._socket.onMessage((t3) => {
- this.onmessage(t3);
- });
- }
- send(t3) {
- i2("send data: ", t3, this.readyState), this.readyState === c2.OPEN && this._socket.send({ data: t3 });
- }
- close(t3, e3) {
- i2("close socket: ", t3, e3), this.readyState = c2.CLOSING, this._socket.close({ code: t3, reason: e3 });
- }
- }
- function h2(t3, e3, r3) {
- Object.assign(r3, { url: t3, header: { "content-type": "application/json" }, protocols: e3, method: "GET" }), this._socket = function(t4) {
- const e4 = a2.connectSocket({ complete: () => {
- }, ...t4 });
- if (e4)
- return e4;
- return { onClose: a2.onSocketClose, onOpen: a2.onSocketOpen, onError: a2.onSocketError, onMessage: a2.onSocketMessage, send: a2.sendSocketMessage, close: a2.closeSocket };
- }(r3), this.addSocketEventListeners();
- }
- s2.forEach((t3, e3) => {
- c2[s2[e3]] = e3;
- });
- ["open", "error", "close", "message"].forEach((t3) => {
- Object.defineProperty(c2.prototype, `on${t3}`, { get() {
- const e3 = this.listeners(t3);
- for (var r3 = 0; r3 < e3.length; r3++)
- if (e3[r3]._listener)
- return e3[r3]._listener;
- }, set(e3) {
- const r3 = this.listeners(t3);
- for (var n3 = 0; n3 < r3.length; n3++)
- r3[n3]._listener && this.removeListener(t3, r3[n3]);
- this.addEventListener(t3, e3);
- } });
- }), c2.prototype.addEventListener = o2.addEventListener, c2.prototype.removeEventListener = o2.removeEventListener, t2.exports = c2;
- }, function(t2, e2, r2) {
- var n2, o2 = "object" == typeof Reflect ? Reflect : null, i2 = o2 && "function" == typeof o2.apply ? o2.apply : function(t3, e3, r3) {
- return Function.prototype.apply.call(t3, e3, r3);
- };
- n2 = o2 && "function" == typeof o2.ownKeys ? o2.ownKeys : Object.getOwnPropertySymbols ? function(t3) {
- return Object.getOwnPropertyNames(t3).concat(Object.getOwnPropertySymbols(t3));
- } : function(t3) {
- return Object.getOwnPropertyNames(t3);
- };
- var s2 = Number.isNaN || function(t3) {
- return t3 != t3;
- };
- function a2() {
- a2.init.call(this);
- }
- t2.exports = a2, a2.EventEmitter = a2, a2.prototype._events = void 0, a2.prototype._eventsCount = 0, a2.prototype._maxListeners = void 0;
- var c2 = 10;
- function h2(t3) {
- if ("function" != typeof t3)
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t3);
- }
- function u2(t3) {
- return void 0 === t3._maxListeners ? a2.defaultMaxListeners : t3._maxListeners;
- }
- function f2(t3, e3, r3, n3) {
- var o3, i3, s3, a3;
- if (h2(r3), void 0 === (i3 = t3._events) ? (i3 = t3._events = /* @__PURE__ */ Object.create(null), t3._eventsCount = 0) : (void 0 !== i3.newListener && (t3.emit("newListener", e3, r3.listener ? r3.listener : r3), i3 = t3._events), s3 = i3[e3]), void 0 === s3)
- s3 = i3[e3] = r3, ++t3._eventsCount;
- else if ("function" == typeof s3 ? s3 = i3[e3] = n3 ? [r3, s3] : [s3, r3] : n3 ? s3.unshift(r3) : s3.push(r3), (o3 = u2(t3)) > 0 && s3.length > o3 && !s3.warned) {
- s3.warned = true;
- var c3 = new Error("Possible EventEmitter memory leak detected. " + s3.length + " " + String(e3) + " listeners added. Use emitter.setMaxListeners() to increase limit");
- c3.name = "MaxListenersExceededWarning", c3.emitter = t3, c3.type = e3, c3.count = s3.length, a3 = c3, console && console.warn && formatAppLog("warn", "at node_modules/@hyoga/uni-socket.io/dist/uni-socket.io.js:10", a3);
- }
- return t3;
- }
- function p2() {
- if (!this.fired)
- return this.target.removeListener(this.type, this.wrapFn), this.fired = true, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
- }
- function l2(t3, e3, r3) {
- var n3 = { fired: false, wrapFn: void 0, target: t3, type: e3, listener: r3 }, o3 = p2.bind(n3);
- return o3.listener = r3, n3.wrapFn = o3, o3;
- }
- function d2(t3, e3, r3) {
- var n3 = t3._events;
- if (void 0 === n3)
- return [];
- var o3 = n3[e3];
- return void 0 === o3 ? [] : "function" == typeof o3 ? r3 ? [o3.listener || o3] : [o3] : r3 ? function(t4) {
- for (var e4 = new Array(t4.length), r4 = 0; r4 < e4.length; ++r4)
- e4[r4] = t4[r4].listener || t4[r4];
- return e4;
- }(o3) : g2(o3, o3.length);
- }
- function y2(t3) {
- var e3 = this._events;
- if (void 0 !== e3) {
- var r3 = e3[t3];
- if ("function" == typeof r3)
- return 1;
- if (void 0 !== r3)
- return r3.length;
- }
- return 0;
- }
- function g2(t3, e3) {
- for (var r3 = new Array(e3), n3 = 0; n3 < e3; ++n3)
- r3[n3] = t3[n3];
- return r3;
- }
- Object.defineProperty(a2, "defaultMaxListeners", { enumerable: true, get: function() {
- return c2;
- }, set: function(t3) {
- if ("number" != typeof t3 || t3 < 0 || s2(t3))
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t3 + ".");
- c2 = t3;
- } }), a2.init = function() {
- void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
- }, a2.prototype.setMaxListeners = function(t3) {
- if ("number" != typeof t3 || t3 < 0 || s2(t3))
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t3 + ".");
- return this._maxListeners = t3, this;
- }, a2.prototype.getMaxListeners = function() {
- return u2(this);
- }, a2.prototype.emit = function(t3) {
- for (var e3 = [], r3 = 1; r3 < arguments.length; r3++)
- e3.push(arguments[r3]);
- var n3 = "error" === t3, o3 = this._events;
- if (void 0 !== o3)
- n3 = n3 && void 0 === o3.error;
- else if (!n3)
- return false;
- if (n3) {
- var s3;
- if (e3.length > 0 && (s3 = e3[0]), s3 instanceof Error)
- throw s3;
- var a3 = new Error("Unhandled error." + (s3 ? " (" + s3.message + ")" : ""));
- throw a3.context = s3, a3;
- }
- var c3 = o3[t3];
- if (void 0 === c3)
- return false;
- if ("function" == typeof c3)
- i2(c3, this, e3);
- else {
- var h3 = c3.length, u3 = g2(c3, h3);
- for (r3 = 0; r3 < h3; ++r3)
- i2(u3[r3], this, e3);
- }
- return true;
- }, a2.prototype.addListener = function(t3, e3) {
- return f2(this, t3, e3, false);
- }, a2.prototype.on = a2.prototype.addListener, a2.prototype.prependListener = function(t3, e3) {
- return f2(this, t3, e3, true);
- }, a2.prototype.once = function(t3, e3) {
- return h2(e3), this.on(t3, l2(this, t3, e3)), this;
- }, a2.prototype.prependOnceListener = function(t3, e3) {
- return h2(e3), this.prependListener(t3, l2(this, t3, e3)), this;
- }, a2.prototype.removeListener = function(t3, e3) {
- var r3, n3, o3, i3, s3;
- if (h2(e3), void 0 === (n3 = this._events))
- return this;
- if (void 0 === (r3 = n3[t3]))
- return this;
- if (r3 === e3 || r3.listener === e3)
- 0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : (delete n3[t3], n3.removeListener && this.emit("removeListener", t3, r3.listener || e3));
- else if ("function" != typeof r3) {
- for (o3 = -1, i3 = r3.length - 1; i3 >= 0; i3--)
- if (r3[i3] === e3 || r3[i3].listener === e3) {
- s3 = r3[i3].listener, o3 = i3;
- break;
- }
- if (o3 < 0)
- return this;
- 0 === o3 ? r3.shift() : function(t4, e4) {
- for (; e4 + 1 < t4.length; e4++)
- t4[e4] = t4[e4 + 1];
- t4.pop();
- }(r3, o3), 1 === r3.length && (n3[t3] = r3[0]), void 0 !== n3.removeListener && this.emit("removeListener", t3, s3 || e3);
- }
- return this;
- }, a2.prototype.off = a2.prototype.removeListener, a2.prototype.removeAllListeners = function(t3) {
- var e3, r3, n3;
- if (void 0 === (r3 = this._events))
- return this;
- if (void 0 === r3.removeListener)
- return 0 === arguments.length ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : void 0 !== r3[t3] && (0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : delete r3[t3]), this;
- if (0 === arguments.length) {
- var o3, i3 = Object.keys(r3);
- for (n3 = 0; n3 < i3.length; ++n3)
- "removeListener" !== (o3 = i3[n3]) && this.removeAllListeners(o3);
- return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
- }
- if ("function" == typeof (e3 = r3[t3]))
- this.removeListener(t3, e3);
- else if (void 0 !== e3)
- for (n3 = e3.length - 1; n3 >= 0; n3--)
- this.removeListener(t3, e3[n3]);
- return this;
- }, a2.prototype.listeners = function(t3) {
- return d2(this, t3, true);
- }, a2.prototype.rawListeners = function(t3) {
- return d2(this, t3, false);
- }, a2.listenerCount = function(t3, e3) {
- return "function" == typeof t3.listenerCount ? t3.listenerCount(e3) : y2.call(t3, e3);
- }, a2.prototype.listenerCount = y2, a2.prototype.eventNames = function() {
- return this._eventsCount > 0 ? n2(this._events) : [];
- };
- }, function(t2, e2, r2) {
- class n2 {
- constructor(t3, e3) {
- this.target = e3, this.type = t3;
- }
- }
- class o2 extends n2 {
- constructor(t3, e3) {
- super("message", e3), this.data = t3;
- }
- }
- class i2 extends n2 {
- constructor(t3, e3, r3) {
- super("close", r3), this.wasClean = r3._closeFrameReceived && r3._closeFrameSent, this.reason = e3, this.code = t3;
- }
- }
- class s2 extends n2 {
- constructor(t3) {
- super("open", t3);
- }
- }
- class a2 extends n2 {
- constructor(t3, e3) {
- super("error", e3), this.message = t3.message, this.error = t3;
- }
- }
- const c2 = { addEventListener(t3, e3) {
- function r3(t4) {
- e3.call(this, new o2(t4, this));
- }
- function n3(t4, r4) {
- e3.call(this, new i2(t4, r4, this));
- }
- function c3(t4) {
- e3.call(this, new a2(t4, this));
- }
- function h2() {
- e3.call(this, new s2(this));
- }
- "function" == typeof e3 && ("message" === t3 ? (r3._listener = e3, this.on(t3, r3)) : "close" === t3 ? (n3._listener = e3, this.on(t3, n3)) : "error" === t3 ? (c3._listener = e3, this.on(t3, c3)) : "open" === t3 ? (h2._listener = e3, this.on(t3, h2)) : this.on(t3, e3));
- }, removeEventListener(t3, e3) {
- const r3 = this.listeners(t3);
- for (var n3 = 0; n3 < r3.length; n3++)
- r3[n3] !== e3 && r3[n3]._listener !== e3 || this.removeListener(t3, r3[n3]);
- } };
- t2.exports = c2;
- }, function(t2, e2) {
- t2.exports = function(t3, e3) {
- for (var r2 = [], n2 = (e3 = e3 || 0) || 0; n2 < t3.length; n2++)
- r2[n2 - e3] = t3[n2];
- return r2;
- };
- }, function(t2, e2) {
- function r2(t3) {
- t3 = t3 || {}, this.ms = t3.min || 100, this.max = t3.max || 1e4, this.factor = t3.factor || 2, this.jitter = t3.jitter > 0 && t3.jitter <= 1 ? t3.jitter : 0, this.attempts = 0;
- }
- t2.exports = r2, r2.prototype.duration = function() {
- var t3 = this.ms * Math.pow(this.factor, this.attempts++);
- if (this.jitter) {
- var e3 = Math.random(), r3 = Math.floor(e3 * this.jitter * t3);
- t3 = 0 == (1 & Math.floor(10 * e3)) ? t3 - r3 : t3 + r3;
- }
- return 0 | Math.min(t3, this.max);
- }, r2.prototype.reset = function() {
- this.attempts = 0;
- }, r2.prototype.setMin = function(t3) {
- this.ms = t3;
- }, r2.prototype.setMax = function(t3) {
- this.max = t3;
- }, r2.prototype.setJitter = function(t3) {
- this.jitter = t3;
- };
- }]);
- });
- })(uniSocket_io);
- var uniSocket_ioExports = uniSocket_io.exports;
- const io = /* @__PURE__ */ getDefaultExportFromCjs(uniSocket_ioExports);
- function useChatWebSocket(socketConfig) {
- let SocketIo = null;
- const state = vue.reactive({
- chatDotNum: 0,
- //总状态红点
- chatList: [],
- //会话信息
- customerUserInfo: {},
- //用户信息
- customerServerInfo: {
- //客服信息
- title: "连接中...",
- state: "connecting",
- avatar: null,
- nickname: ""
- },
- socketState: {
- isConnect: true,
- //是否连接成功
- isConnecting: false,
- //重连中,不允许新的socket开启。
- tip: ""
- },
- chatHistoryPagination: {
- page: 0,
- //当前页
- list_rows: 10,
- //每页条数
- last_id: 0,
- //最后条ID
- lastPage: 0,
- //总共多少页
- loadStatus: "loadmore"
- //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
- },
- templateChatList: [],
- //猜你想问
- chatConfig: {},
- // 配置信息
- isSendSucces: -1
- // 是否发送成功 -1=发送中|0=发送成功|1发送失败
- });
- const socketInit = (config2, callBack) => {
- state.chatConfig = config2;
- if (SocketIo && SocketIo.connected)
- return;
- if (state.socketState.isConnecting)
- return;
- SocketIo = io(config2.chat_domain, {
- reconnection: true,
- // 默认 true 是否断线重连
- reconnectionAttempts: 5,
- // 默认无限次 断线尝试次数
- reconnectionDelay: 1e3,
- // 默认 1000,进行下一次重连的间隔。
- reconnectionDelayMax: 5e3,
- // 默认 5000, 重新连接等待的最长时间 默认 5000
- randomizationFactor: 0.5,
- // 默认 0.5 [0-1],随机重连延迟时间
- timeout: 2e4,
- // 默认 20s
- transports: ["websocket", "polling"],
- // websocket | polling,
- ...config2
- });
- SocketIo.on("connect", async (res) => {
- socketReset(callBack);
- formatAppLog("log", "at pages/chat/socket.js:69", "socket:connect");
- });
- SocketIo.on("message", (res) => {
- if (res.error === 0) {
- res.data;
- state.chatList.push(formatMessage2(res.data.message));
- callBack && callBack();
- }
- });
- SocketIo.on("customer_service_access", (res) => {
- if (res.error === 0) {
- editCustomerServerInfo({
- title: res.data.customer_service.name,
- state: "online",
- avatar: res.data.customer_service.avatar
- });
- state.chatList.push(formatMessage2(res.data.message));
- }
- });
- SocketIo.on("waiting_queue", (res) => {
- if (res.error === 0) {
- editCustomerServerInfo({
- title: res.data.title,
- state: "waiting",
- avatar: ""
- });
- }
- });
- SocketIo.on("no_customer_service", (res) => {
- if (res.error === 0) {
- editCustomerServerInfo({
- title: "暂无客服在线...",
- state: "waiting",
- avatar: ""
- });
- }
- state.chatList.push(formatMessage2(res.data.message));
- });
- SocketIo.on("customer_service_online", (res) => {
- if (res.error === 0) {
- editCustomerServerInfo({
- title: res.data.customer_service.name,
- state: "online",
- avatar: res.data.customer_service.avatar
- });
- }
- });
- SocketIo.on("customer_service_offline", (res) => {
- if (res.error === 0) {
- editCustomerServerInfo({
- title: res.data.customer_service.name,
- state: "offline",
- avatar: res.data.customer_service.avatar
- });
- }
- });
- SocketIo.on("customer_service_busy", (res) => {
- if (res.error === 0) {
- editCustomerServerInfo({
- title: res.data.customer_service.name,
- state: "busy",
- avatar: res.data.customer_service.avatar
- });
- }
- });
- SocketIo.on("customer_service_break", (res) => {
- if (res.error === 0) {
- editCustomerServerInfo({
- title: "客服服务结束",
- state: "offline",
- avatar: ""
- });
- state.socketState.isConnect = false;
- state.socketState.tip = "当前服务已结束";
- }
- state.chatList.push(formatMessage2(res.data.message));
- });
- SocketIo.on("custom_error", (error2) => {
- editCustomerServerInfo({
- title: error2.msg,
- state: "offline",
- avatar: ""
- });
- formatAppLog("log", "at pages/chat/socket.js:170", "custom_error:", error2);
- });
- SocketIo.on("error", (error2) => {
- formatAppLog("log", "at pages/chat/socket.js:174", "error:", error2);
- });
- SocketIo.on("connect_error", (error2) => {
- formatAppLog("log", "at pages/chat/socket.js:178", "connect_error");
- });
- SocketIo.on("connect_timeout", (error2) => {
- formatAppLog("log", "at pages/chat/socket.js:182", error2, "connect_timeout");
- });
- SocketIo.on("disconnect", (error2) => {
- formatAppLog("log", "at pages/chat/socket.js:186", error2, "disconnect");
- });
- SocketIo.on("reconnect", (error2) => {
- formatAppLog("log", "at pages/chat/socket.js:190", error2, "reconnect");
- });
- SocketIo.on("reconnect_attempt", (error2) => {
- state.socketState.isConnect = false;
- state.socketState.isConnecting = true;
- editCustomerServerInfo({
- title: `重连中,第${error2}次尝试...`,
- state: "waiting",
- avatar: ""
- });
- formatAppLog("log", "at pages/chat/socket.js:201", error2, "reconnect_attempt");
- });
- SocketIo.on("reconnecting", (error2) => {
- formatAppLog("log", "at pages/chat/socket.js:205", error2, "reconnecting");
- });
- SocketIo.on("reconnect_error", (error2) => {
- formatAppLog("log", "at pages/chat/socket.js:209", "reconnect_error");
- });
- SocketIo.on("reconnect_failed", (error2) => {
- state.socketState.isConnecting = false;
- editCustomerServerInfo({
- title: `重连失败,请刷新重试~`,
- state: "waiting",
- avatar: ""
- });
- formatAppLog("log", "at pages/chat/socket.js:219", error2, "reconnect_failed");
- state.isSendSucces = 1;
- });
- };
- const socketReset = (callBack) => {
- state.chatList = [];
- state.chatHistoryList = [];
- state.chatHistoryPagination = {
- page: 0,
- per_page: 10,
- last_id: 0,
- totalPage: 0
- };
- socketConnection(callBack);
- };
- const socketClose = () => {
- SocketIo.emit("customer_logout", {}, (res) => {
- formatAppLog("log", "at pages/chat/socket.js:243", "socket:退出", res);
- });
- };
- const socketTest = () => {
- SocketIo.emit("test", {}, (res) => {
- formatAppLog("log", "at pages/chat/socket.js:250", "test:test", res);
- });
- };
- const socketSendMsg = (data, sendMsgCallBack) => {
- state.isSendSucces = -1;
- state.chatList.push(data);
- sendMsgCallBack && sendMsgCallBack();
- SocketIo.emit(
- "message",
- {
- message: formatInput(data),
- ...data.customData
- },
- (res) => {
- state.isSendSucces = res.error;
- }
- );
- };
- const socketConnection = (callBack) => {
- SocketIo.emit(
- "connection",
- {
- auth: "user",
- token: uni.getStorageSync("socketUserToken") || "",
- session_id: uni.getStorageSync("socketSessionId") || ""
- },
- (res) => {
- if (res.error === 0) {
- socketCustomerLogin(callBack);
- uni.setStorageSync("socketSessionId", res.data.session_id);
- state.customerUserInfo = res.data.chat_user;
- state.socketState.isConnect = true;
- } else {
- editCustomerServerInfo({
- title: `服务器异常!`,
- state: "waiting",
- avatar: ""
- });
- state.socketState.isConnect = false;
- }
- }
- );
- };
- const getUserToken = async (id) => {
- const res = await chat.unifiedToken();
- if (res.error === 0) {
- uni.setStorageSync("socketUserToken", res.data.token);
- }
- return res;
- };
- const socketCustomerLogin = (callBack) => {
- SocketIo.emit(
- "customer_login",
- {
- room_id: state.chatConfig.room_id
- },
- (res) => {
- state.templateChatList = res.data.questions.length ? res.data.questions : [];
- state.chatList.push({
- from: "customer_service",
- // 用户customer右 | 顾客customer_service左 | 系统system中间
- mode: "template",
- // goods,order,image,text,system
- date: (/* @__PURE__ */ new Date()).getTime(),
- //时间
- content: {
- //内容
- list: state.templateChatList
- }
- });
- res.error === 0 && socketHistoryList(callBack);
- }
- );
- };
- const socketHistoryList = (historyCallBack) => {
- state.chatHistoryPagination.loadStatus = "loading";
- state.chatHistoryPagination.page += 1;
- SocketIo.emit("messages", state.chatHistoryPagination, (res) => {
- if (res.error === 0) {
- state.chatHistoryPagination.total = res.data.messages.total;
- state.chatHistoryPagination.lastPage = res.data.messages.last_page;
- state.chatHistoryPagination.page = res.data.messages.current_page;
- res.data.messages.data.forEach((item) => {
- item.message_type && state.chatList.unshift(formatMessage2(item));
- });
- state.chatHistoryPagination.loadStatus = state.chatHistoryPagination.page < state.chatHistoryPagination.lastPage ? "loadmore" : "nomore";
- if (state.chatHistoryPagination.last_id == 0) {
- state.chatHistoryPagination.last_id = res.data.messages.data.length ? res.data.messages.data[0].id : 0;
- }
- state.chatHistoryPagination.page === 1 && historyCallBack && historyCallBack();
- }
- });
- };
- const editCustomerServerInfo = (data) => {
- state.customerServerInfo = {
- ...state.customerServerInfo,
- ...data
- };
- };
- const showTime = (item, index2) => {
- if (vue.unref(state.chatList)[index2 + 1]) {
- let dateString = dayjs(vue.unref(state.chatList)[index2 + 1].date).fromNow();
- if (dateString === dayjs(vue.unref(item).date).fromNow()) {
- return false;
- } else {
- dateString = dayjs(vue.unref(item).date).fromNow();
- return true;
- }
- }
- return false;
- };
- const formatTime = (time2) => {
- let diffTime = (/* @__PURE__ */ new Date()).getTime() - time2;
- if (diffTime > 28 * 24 * 60 * 1e3) {
- return dayjs(time2).format("MM/DD HH:mm");
- }
- if (diffTime > 360 * 28 * 24 * 60 * 1e3) {
- return dayjs(time2).format("YYYY/MM/DD HH:mm");
- }
- return dayjs(time2).fromNow();
- };
- const getFocus = (virtualNode) => {
- if (window.getSelection) {
- let chatInput2 = vue.unref(virtualNode);
- chatInput2.focus();
- let range2 = window.getSelection();
- range2.selectAllChildren(chatInput2);
- range2.collapseToEnd();
- } else if (document.selection) {
- let range2 = document.selection.createRange();
- range2.moveToElementText(chatInput);
- range2.collapse(false);
- range2.select();
- }
- };
- const upload = (name2, file) => {
- return new Promise((resolve, reject) => {
- let data = new FormData();
- data.append("file", file, name2);
- data.append("group", "chat");
- ajax({
- url: "/upload",
- method: "post",
- headers: {
- "Content-Type": "multipart/form-data"
- },
- data,
- success: function(res) {
- resolve(res);
- },
- error: function(err) {
- reject(err);
- }
- });
- });
- };
- const onPaste = async (e2) => {
- let paste = e2.clipboardData || window.clipboardData;
- let filesArr = Array.from(paste.files);
- filesArr.forEach(async (child) => {
- if (child && child.type.includes("image")) {
- e2.preventDefault();
- let file = child;
- const img = await readImg(file);
- const blob = await compressImg(img, file.type);
- const { data } = await upload(file.name, blob);
- let image = `<img class="full-url" src='${data.fullurl}'>`;
- document.execCommand("insertHTML", false, image);
- } else {
- document.execCommand("insertHTML", false, paste.getData("text"));
- }
- });
- };
- const onDrop = async (e2) => {
- e2.preventDefault();
- let filesArr = Array.from(e2.dataTransfer.files);
- filesArr.forEach(async (child) => {
- if (child && child.type.includes("image")) {
- let file = child;
- const img = await readImg(file);
- const blob = await compressImg(img, file.type);
- const { data } = await upload(file.name, blob);
- let image = `<img class="full-url" src='${data.fullurl}' >`;
- document.execCommand("insertHTML", false, image);
- } else {
- ElMessage({
- message: "禁止拖拽非图片资源",
- type: "warning"
- });
- }
- });
- };
- const formatChatInput = (virtualNode, formatInputCallBack) => {
- let res = "";
- let elemArr = Array.from(virtualNode.childNodes);
- elemArr.forEach((child, index2) => {
- if (child.nodeName === "#text") {
- res += child.nodeValue;
- if (
- //文本节点的后面是图片,并且不是emoji,分开发送。输入框中的图片和文本表情分开。
- elemArr[index2 + 1] && elemArr[index2 + 1].nodeName === "IMG" && elemArr[index2 + 1] && elemArr[index2 + 1].name !== "emoji"
- ) {
- const data = {
- from: "customer",
- mode: "text",
- date: (/* @__PURE__ */ new Date()).getTime(),
- content: {
- text: filterXSS(res)
- }
- };
- formatInputCallBack && formatInputCallBack(data);
- res = "";
- }
- } else if (child.nodeName === "BR") {
- res += "<br/>";
- } else if (child.nodeName === "IMG") {
- if (child.name !== "emoji") {
- let srcReg = /src=[\'\']?([^\'\']*)[\'\']?/i;
- let src = child.outerHTML.match(srcReg);
- const data = {
- from: "customer",
- mode: "image",
- date: (/* @__PURE__ */ new Date()).getTime(),
- content: {
- url: src[1],
- path: src[1].replace(/http:\/\/[^\/]*/, "")
- }
- };
- formatInputCallBack && formatInputCallBack(data);
- } else {
- res += child.outerHTML;
- }
- } else if (child.nodeName === "DIV") {
- res += `<div style='width:200px; white-space: nowrap;'>${child.outerHTML}</div>`;
- }
- });
- if (res) {
- const data = {
- from: "customer",
- mode: "text",
- date: (/* @__PURE__ */ new Date()).getTime(),
- content: {
- text: filterXSS(res)
- }
- };
- formatInputCallBack && formatInputCallBack(data);
- }
- vue.unref(virtualNode).innerHTML = "";
- };
- const callBackNotice = (res) => {
- ElNotification({
- title: "socket",
- message: res.msg,
- showClose: true,
- type: res.error === 0 ? "success" : "warning",
- duration: 1200
- });
- };
- const formatInput = (message) => {
- let obj = {};
- switch (message.mode) {
- case "text":
- obj = {
- message_type: "text",
- message: message.content.text
- };
- break;
- case "image":
- obj = {
- message_type: "image",
- message: message.content.path
- };
- break;
- case "goods":
- obj = {
- message_type: "goods",
- message: message.content.item
- };
- break;
- case "order":
- obj = {
- message_type: "order",
- message: message.content.item
- };
- break;
- }
- return obj;
- };
- const formatMessage2 = (message) => {
- let obj = {};
- switch (message.message_type) {
- case "system":
- obj = {
- from: "system",
- // 用户customer左 | 顾客customer_service右 | 系统system中间
- mode: "system",
- // goods,order,image,text,system
- date: message.create_time * 1e3,
- //时间
- content: {
- //内容
- text: message.message
- }
- };
- break;
- case "text":
- obj = {
- from: message.sender_identify,
- mode: message.message_type,
- date: message.create_time * 1e3,
- //时间
- sender: message.sender,
- content: {
- text: message.message,
- messageId: message.id
- }
- };
- break;
- case "image":
- obj = {
- from: message.sender_identify,
- mode: message.message_type,
- date: message.create_time * 1e3,
- //时间
- sender: message.sender,
- content: {
- url: sheep$1.$url.cdn(message.message),
- messageId: message.id
- }
- };
- break;
- case "goods":
- obj = {
- from: message.sender_identify,
- mode: message.message_type,
- date: message.create_time * 1e3,
- //时间
- sender: message.sender,
- content: {
- item: message.message,
- messageId: message.id
- }
- };
- break;
- case "order":
- obj = {
- from: message.sender_identify,
- mode: message.message_type,
- date: message.create_time * 1e3,
- //时间
- sender: message.sender,
- content: {
- item: message.message,
- messageId: message.id
- }
- };
- break;
- }
- return obj;
- };
- const readImg = (file) => {
- return new Promise((resolve, reject) => {
- const img = new Image();
- const reader = new FileReader();
- reader.onload = function(e2) {
- img.src = e2.target.result;
- };
- reader.onerror = function(e2) {
- reject(e2);
- };
- reader.readAsDataURL(file);
- img.onload = function() {
- resolve(img);
- };
- img.onerror = function(e2) {
- reject(e2);
- };
- });
- };
- const compressImg = (img, type = "image/jpeg", mx = 1e3, mh = 1e3, quality = 1) => {
- return new Promise((resolve, reject) => {
- const canvas = document.createElement("canvas");
- const context = canvas.getContext("2d");
- const { width: originWidth, height: originHeight } = img;
- const maxWidth = mx;
- const maxHeight = mh;
- let targetWidth = originWidth;
- let targetHeight = originHeight;
- if (originWidth > maxWidth || originHeight > maxHeight) {
- if (originWidth / originHeight > 1) {
- targetWidth = maxWidth;
- targetHeight = Math.round(maxWidth * (originHeight / originWidth));
- } else {
- targetHeight = maxHeight;
- targetWidth = Math.round(maxHeight * (originWidth / originHeight));
- }
- }
- canvas.width = targetWidth;
- canvas.height = targetHeight;
- context.clearRect(0, 0, targetWidth, targetHeight);
- context.drawImage(img, 0, 0, targetWidth, targetHeight);
- canvas.toBlob(
- function(blob) {
- resolve(blob);
- },
- type,
- quality
- );
- });
- };
- return {
- compressImg,
- readImg,
- formatMessage: formatMessage2,
- formatInput,
- callBackNotice,
- socketInit,
- socketSendMsg,
- socketClose,
- socketHistoryList,
- getFocus,
- formatChatInput,
- onDrop,
- onPaste,
- upload,
- getUserToken,
- state,
- socketTest,
- showTime,
- formatTime
- };
- }
- const _sfc_main$g = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- const {
- socketInit,
- state: chatData,
- socketSendMsg,
- formatChatInput,
- socketHistoryList,
- onDrop,
- onPaste,
- getFocus,
- // upload,
- getUserToken,
- // socketTest,
- showTime,
- formatTime
- } = useChatWebSocket();
- const chatList = vue.toRefs(chatData).chatList;
- const customerServiceInfo = vue.toRefs(chatData).customerServerInfo;
- const chatHistoryPagination = vue.toRefs(chatData).chatHistoryPagination;
- const customerUserInfo = vue.toRefs(chatData).customerUserInfo;
- const socketState = vue.toRefs(chatData).socketState;
- const sys_navBar = sheep$1.$platform.navbar;
- const chatConfig = vue.computed(() => sheep$1.$store("app").chat);
- const { screenHeight, safeAreaInsets, safeArea, screenWidth } = sheep$1.$platform.device;
- const pageHeight = safeArea.height - 44 - 35 - 50;
- const chatStatus = {
- online: {
- text: "在线",
- colorVariate: "#46c55f"
- },
- offline: {
- text: "离线",
- colorVariate: "#b5b5b5"
- },
- busy: {
- text: "忙碌",
- colorVariate: "#ff0e1b"
- }
- };
- const loadingMap = {
- loadmore: {
- title: "查看更多",
- icon: "el-icon-d-arrow-left"
- },
- nomore: {
- title: "没有更多了",
- icon: ""
- },
- loading: {
- title: "加载中... ",
- icon: "el-icon-loading"
- }
- };
- const onLoadMore = () => {
- chatHistoryPagination.value.page < chatHistoryPagination.value.lastPage && socketHistoryList();
- };
- const chat2 = vue.reactive({
- msg: "",
- scrollInto: "",
- showTools: false,
- toolsMode: "",
- showSelect: false,
- selectMode: "",
- chatStyle: {
- mode: "inner",
- color: "#F8270F",
- type: "color",
- alwaysShow: 1,
- src: "",
- list: {}
- }
- });
- function onTools(mode) {
- if (!socketState.value.isConnect) {
- sheep$1.$helper.toast(socketState.value.tip || "您已掉线!请返回重试");
- return;
- }
- if (!chat2.toolsMode || chat2.toolsMode === mode) {
- chat2.showTools = !chat2.showTools;
- }
- chat2.toolsMode = mode;
- if (!chat2.showTools) {
- chat2.toolsMode = "";
- }
- }
- function onShowSelect(mode) {
- chat2.showTools = false;
- chat2.showSelect = true;
- chat2.selectMode = mode;
- }
- async function onSelect({ type, data }) {
- let msg = "";
- switch (type) {
- case "image":
- const { path, fullurl } = await sheep$1.$api.app.upload(data.tempFiles[0].path, "default");
- msg = {
- from: "customer",
- mode: "image",
- date: (/* @__PURE__ */ new Date()).getTime(),
- content: {
- url: fullurl,
- path
- }
- };
- break;
- case "goods":
- msg = {
- from: "customer",
- mode: "goods",
- date: (/* @__PURE__ */ new Date()).getTime(),
- content: {
- item: {
- id: data.goods.id,
- title: data.goods.title,
- image: data.goods.image,
- price: data.goods.price,
- stock: data.goods.stock
- }
- }
- };
- break;
- case "order":
- msg = {
- from: "customer",
- mode: "order",
- date: (/* @__PURE__ */ new Date()).getTime(),
- content: {
- item: {
- id: data.id,
- order_sn: data.order_sn,
- create_time: data.create_time,
- pay_fee: data.pay_fee,
- items: data.items.filter((item) => ({
- goods_id: item.goods_id,
- goods_title: item.goods_title,
- goods_image: item.goods_image,
- goods_price: item.goods_price
- })),
- status_text: data.status_text
- }
- }
- };
- break;
- }
- if (msg) {
- socketSendMsg(msg, () => {
- scrollBottom();
- });
- chat2.showTools = false;
- chat2.showSelect = false;
- chat2.selectMode = "";
- }
- }
- function onAgainSendMessage(item) {
- if (!socketState.value.isConnect) {
- sheep$1.$helper.toast(socketState.value.tip || "您已掉线!请返回重试");
- return;
- }
- if (!item)
- return;
- const data = {
- from: "customer",
- mode: "text",
- date: (/* @__PURE__ */ new Date()).getTime(),
- content: item.content
- };
- socketSendMsg(data, () => {
- scrollBottom();
- });
- }
- function onSendMessage() {
- if (!socketState.value.isConnect) {
- sheep$1.$helper.toast(socketState.value.tip || "您已掉线!请返回重试");
- return;
- }
- if (!chat2.msg)
- return;
- const data = {
- from: "customer",
- mode: "text",
- date: (/* @__PURE__ */ new Date()).getTime(),
- content: {
- text: chat2.msg
- }
- };
- socketSendMsg(data, () => {
- scrollBottom();
- });
- chat2.showTools = false;
- setTimeout(() => {
- chat2.msg = "";
- }, 100);
- }
- function onTemplateList(e2) {
- if (!socketState.value.isConnect) {
- sheep$1.$helper.toast(socketState.value.tip || "您已掉线!请返回重试");
- return;
- }
- const data = {
- from: "customer",
- mode: "text",
- date: (/* @__PURE__ */ new Date()).getTime(),
- content: {
- text: e2.title
- },
- customData: {
- question_id: e2.id
- }
- };
- socketSendMsg(data, () => {
- scrollBottom();
- });
- }
- function onEmoji(item) {
- chat2.msg += item.name;
- }
- function selEmojiFile(name2) {
- for (let index2 in emojiList) {
- if (emojiList[index2].name === name2) {
- return emojiList[index2].file;
- }
- }
- return false;
- }
- function replaceEmoji(data) {
- let newData = data;
- if (typeof newData !== "object") {
- let reg = /\[(.+?)\]/g;
- let zhEmojiName = newData.match(reg);
- if (zhEmojiName) {
- zhEmojiName.forEach((item) => {
- let emojiFile = selEmojiFile(item);
- newData = newData.replace(
- item,
- `<image class="chat-img" style="width: 24px;height: 24px;margin: 0 3px;" src="${sheep$1.$url.cdn(
- "/static/img/chat/emoji/" + emojiFile
- )}"/></image>`
- );
- });
- }
- }
- return newData;
- }
- function scrollBottom() {
- let timeout = null;
- chat2.scrollInto = "";
- clearTimeout(timeout);
- timeout = setTimeout(() => {
- chat2.scrollInto = "scrollBottom";
- }, 100);
- }
- onLoad(async () => {
- const { error: error2 } = await getUserToken();
- if (error2 === 0) {
- socketInit(chatConfig.value, () => {
- scrollBottom();
- });
- } else {
- socketState.value.isConnect = false;
- }
- });
- const __returned__ = { socketInit, chatData, socketSendMsg, formatChatInput, socketHistoryList, onDrop, onPaste, getFocus, getUserToken, showTime, formatTime, chatList, customerServiceInfo, chatHistoryPagination, customerUserInfo, socketState, sys_navBar, chatConfig, screenHeight, safeAreaInsets, safeArea, screenWidth, pageHeight, chatStatus, loadingMap, onLoadMore, chat: chat2, onTools, onShowSelect, onSelect, onAgainSendMessage, onSendMessage, onTemplateList, onEmoji, selEmojiFile, replaceEmoji, scrollBottom, get sheep() {
- return sheep$1;
- }, computed: vue.computed, reactive: vue.reactive, toRefs: vue.toRefs, get onLoad() {
- return onLoad;
- }, get emojiList() {
- return emojiList;
- }, get emojiPage() {
- return emojiPage;
- }, SelectPopup, GoodsItem, OrderItem, get useChatWebSocket() {
- return useChatWebSocket;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_image = resolveEasycom(vue.resolveDynamicComponent("su-image"), __easycom_0$f);
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_su_fixed = resolveEasycom(vue.resolveDynamicComponent("su-fixed"), __easycom_2$9);
- const _component_s_uploader = resolveEasycom(vue.resolveDynamicComponent("s-uploader"), __easycom_3$4);
- const _component_su_popup = resolveEasycom(vue.resolveDynamicComponent("su-popup"), __easycom_4$3);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "chat-wrap",
- title: "客服",
- navbar: "inner"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "div",
- { class: "status" },
- vue.toDisplayString($setup.socketState.isConnect ? $setup.customerServiceInfo.title : "网络已断开,请检查网络后刷新重试"),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "div",
- {
- class: "page-bg",
- style: vue.normalizeStyle({ height: $setup.sys_navBar + "px" })
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "chat-box",
- style: vue.normalizeStyle({ height: $setup.pageHeight + "px" })
- },
- [
- vue.createElementVNode("scroll-view", {
- style: vue.normalizeStyle({ height: $setup.pageHeight + "px" }),
- "scroll-y": "true",
- "scroll-with-animation": false,
- "enable-back-to-top": true,
- "scroll-into-view": $setup.chat.scrollInto
- }, [
- $setup.chatList.length && $setup.chatHistoryPagination.lastPage > 1 && $setup.loadingMap[$setup.chatHistoryPagination.loadStatus].title ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "loadmore-btn ss-reset-button",
- onClick: $setup.onLoadMore
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.loadingMap[$setup.chatHistoryPagination.loadStatus].title) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "i",
- {
- class: vue.normalizeClass(["loadmore-icon sa-m-l-6", $setup.loadingMap[$setup.chatHistoryPagination.loadStatus].icon])
- },
- null,
- 2
- /* CLASS */
- )
- ])) : vue.createCommentVNode("v-if", true),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.chatList, (item, index2) => {
- var _a2;
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "message-item ss-flex-col",
- key: index2
- }, [
- vue.createElementVNode("view", { class: "ss-flex ss-row-center ss-col-center" }, [
- vue.createCommentVNode(" 日期 "),
- item.from !== "system" && $setup.showTime(item, index2) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "date-message"
- },
- vue.toDisplayString($setup.formatTime(item.date)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 系统消息 "),
- item.from === "system" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "system-message"
- },
- vue.toDisplayString(item.content.text),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createCommentVNode(" 常见问题 "),
- item.mode === "template" && item.content.list.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "template-wrap"
- }, [
- vue.createElementVNode("view", { class: "title" }, "猜你想问"),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(item.content.list, (item2, index3) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "item",
- key: index3,
- onClick: ($event) => $setup.onTemplateList(item2)
- }, " * " + vue.toDisplayString(item2.title), 9, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- item.from === "customer_service" && item.mode !== "template" || item.from === "customer" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["ss-flex ss-col-top", [
- item.from === "customer_service" ? `ss-row-left` : item.from === "customer" ? `ss-row-right` : ""
- ]])
- },
- [
- vue.createCommentVNode(" 客服头像 "),
- vue.withDirectives(vue.createElementVNode("image", {
- class: "chat-avatar ss-m-r-24",
- src: $setup.sheep.$url.cdn((_a2 = item == null ? void 0 : item.sender) == null ? void 0 : _a2.avatar) || $setup.sheep.$url.static("/static/images/default.png"),
- mode: "aspectFill"
- }, null, 8, ["src"]), [
- [vue.vShow, item.from === "customer_service"]
- ]),
- vue.createCommentVNode(" 发送状态 "),
- item.from === "customer" && index2 == $setup.chatData.chatList.length - 1 && $setup.chatData.isSendSucces !== 0 ? (vue.openBlock(), vue.createElementBlock("span", {
- key: 0,
- class: "send-status"
- }, [
- $setup.chatData.isSendSucces == -1 ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "loading",
- src: $setup.sheep.$url.static("/static/images/loading.png"),
- mode: "aspectFill"
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(` <image
- v-if="chatData.isSendSucces == 1"
- class="warning"
- :src="sheep.$url.static('/static/images/warning.png')"
- mode="aspectFill"
- @click="onAgainSendMessage(item)"
- ></image> `)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 内容 "),
- item.mode === "text" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["message-box", [item.from]])
- },
- [
- vue.createElementVNode("div", {
- class: "message-text ss-flex ss-flex-wrap",
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onRichtext && _ctx.onRichtext(...args)),
- innerHTML: $setup.replaceEmoji(item.content.text)
- }, null, 8, ["innerHTML"])
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- item.mode === "image" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: vue.normalizeClass(["message-box", [item.from]]),
- style: { width: "200rpx" }
- },
- [
- vue.createVNode(_component_su_image, {
- class: "message-img",
- isPreview: "",
- previewList: [$setup.sheep.$url.cdn(item.content.url)],
- current: 0,
- src: $setup.sheep.$url.cdn(item.content.url),
- height: 200,
- width: 200,
- mode: "aspectFill"
- }, null, 8, ["previewList", "src"])
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- item.mode === "goods" ? (vue.openBlock(), vue.createBlock($setup["GoodsItem"], {
- key: 3,
- goodsData: item.content.item,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", {
- id: item.content.item.id
- })
- }, null, 8, ["goodsData", "onClick"])) : vue.createCommentVNode("v-if", true),
- item.mode === "order" ? (vue.openBlock(), vue.createBlock($setup["OrderItem"], {
- key: 4,
- from: "msg",
- orderData: item.content.item,
- onClick: ($event) => $setup.sheep.$router.go("/pages/order/detail", {
- id: item.content.item.id
- })
- }, null, 8, ["orderData", "onClick"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" user头像 "),
- vue.withDirectives(vue.createElementVNode("image", {
- class: "chat-avatar ss-m-l-24",
- src: $setup.sheep.$url.cdn($setup.customerUserInfo.avatar),
- mode: "aspectFill"
- }, null, 8, ["src"]), [
- [vue.vShow, item.from === "customer"]
- ])
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode("view", { id: "scrollBottom" })
- ], 12, ["scroll-into-view"])
- ],
- 4
- /* STYLE */
- ),
- vue.createVNode(_component_su_fixed, { bottom: "" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "send-wrap ss-flex" }, [
- vue.createElementVNode("view", { class: "left ss-flex ss-flex-1" }, [
- vue.createVNode(_component_uni_easyinput, {
- class: "ss-flex-1 ss-p-l-22",
- inputBorder: false,
- clearable: false,
- modelValue: $setup.chat.msg,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.chat.msg = $event),
- placeholder: "请输入你要咨询的问题"
- }, null, 8, ["modelValue"])
- ]),
- vue.createElementVNode("text", {
- class: "sicon-basic bq",
- onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => $setup.onTools("emoji"), ["stop"]))
- }),
- !$setup.chat.msg ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["sicon-edit", { "is-active": $setup.chat.toolsMode == "tools" }]),
- onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => $setup.onTools("tools"), ["stop"]))
- },
- null,
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- $setup.chat.msg ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button send-btn",
- onClick: $setup.onSendMessage
- }, " 发送 ")) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_su_popup, {
- show: $setup.chat.showTools,
- onClose: _cache[10] || (_cache[10] = ($event) => {
- $setup.chat.showTools = false;
- $setup.chat.toolsMode = "";
- })
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-modal-box ss-flex-col" }, [
- vue.createElementVNode("view", { class: "send-wrap ss-flex" }, [
- vue.createElementVNode("view", { class: "left ss-flex ss-flex-1" }, [
- vue.createVNode(_component_uni_easyinput, {
- class: "ss-flex-1 ss-p-l-22",
- inputBorder: false,
- clearable: false,
- modelValue: $setup.chat.msg,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.chat.msg = $event),
- placeholder: "请输入你要咨询的问题"
- }, null, 8, ["modelValue"])
- ]),
- vue.createElementVNode("text", {
- class: "sicon-basic bq",
- onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => $setup.onTools("emoji"), ["stop"]))
- }),
- vue.createElementVNode("text"),
- !$setup.chat.msg ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["sicon-edit", { "is-active": $setup.chat.toolsMode == "tools" }]),
- onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => $setup.onTools("tools"), ["stop"]))
- },
- null,
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- $setup.chat.msg ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button send-btn",
- onClick: $setup.onSendMessage
- }, " 发送 ")) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", { class: "content ss-flex ss-flex-1" }, [
- $setup.chat.toolsMode == "emoji" ? (vue.openBlock(), vue.createElementBlock("swiper", {
- key: 0,
- class: "emoji-swiper",
- "indicator-dots": true,
- circular: "",
- "indicator-active-color": "#7063D2",
- "indicator-color": "rgba(235, 231, 255, 1)",
- autoplay: false,
- interval: 3e3,
- duration: 1e3
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.emojiPage, (emoji) => {
- return vue.openBlock(), vue.createElementBlock("swiper-item", { key: emoji }, [
- vue.createElementVNode("view", { class: "ss-flex ss-flex-wrap" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(emoji, (item) => {
- return vue.openBlock(), vue.createElementBlock("image", {
- key: item,
- class: "emoji-img",
- src: $setup.sheep.$url.cdn(`/static/img/chat/emoji/${item.file}`),
- onClick: ($event) => $setup.onEmoji(item)
- }, null, 8, ["src", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createElementVNode("view", { class: "image" }, [
- vue.createVNode(_component_s_uploader, {
- "file-mediatype": "image",
- imageStyles: { width: 50, height: 50, border: false },
- onSelect: _cache[7] || (_cache[7] = ($event) => $setup.onSelect({ type: "image", data: $event }))
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("image", {
- class: "icon",
- src: $setup.sheep.$url.static("/static/images/image.png"),
- mode: "aspectFill"
- }, null, 8, ["src"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createElementVNode("view", null, "图片")
- ]),
- vue.createElementVNode("view", {
- class: "goods",
- onClick: _cache[8] || (_cache[8] = ($event) => $setup.onShowSelect("goods"))
- }, [
- vue.createElementVNode("image", {
- class: "icon",
- src: $setup.sheep.$url.static("/static/images/goods.png"),
- mode: "aspectFill"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", null, "商品")
- ]),
- vue.createElementVNode("view", {
- class: "order",
- onClick: _cache[9] || (_cache[9] = ($event) => $setup.onShowSelect("order"))
- }, [
- vue.createElementVNode("image", {
- class: "icon",
- src: $setup.sheep.$url.static("/static/images/order.png"),
- mode: "aspectFill"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", null, "订单")
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]),
- vue.createVNode($setup["SelectPopup"], {
- mode: $setup.chat.selectMode,
- show: $setup.chat.showSelect,
- onSelect: $setup.onSelect,
- onClose: _cache[11] || (_cache[11] = ($event) => $setup.chat.showSelect = false)
- }, null, 8, ["mode", "show"])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesChatIndex = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f], ["__scopeId", "data-v-5a559478"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/chat/index.vue"]]);
- const _imports_0$1 = "/static/icon/audioPaly.png";
- const minRecordingTime = 500;
- const cancelOffset = 280;
- const _sfc_main$f = {
- __name: "speechtotext",
- setup(__props, { expose: __expose }) {
- __expose();
- const {
- safeAreaInsets,
- safeArea
- } = sheep$1.$platform.device;
- const sysNavBar = sheep$1.$platform.navbar;
- const messagesHeight = safeArea.height - sysNavBar - 20 - 60;
- const messages2 = vue.ref([]);
- const isRecording = vue.ref(false);
- let startTime = vue.ref(null);
- const recordingDuration = vue.ref("");
- let intervalId = null;
- const startTouchY = vue.ref(0);
- let mediaRecorder = null;
- let audioChunks = [];
- let isCancelled = vue.ref(false);
- vue.onMounted(() => {
- navigator.mediaDevices.getUserMedia({
- audio: true
- }).then((stream) => {
- mediaRecorder = new MediaRecorder(stream);
- mediaRecorder.ondataavailable = (event) => {
- audioChunks.push(event.data);
- };
- mediaRecorder.onstop = () => {
- if (!isCancelled.value) {
- sendDuration();
- }
- audioChunks = [];
- };
- }).catch((error2) => {
- formatAppLog("error", "at pages/chat/speechtotext.vue:76", "Error accessing media devices.", error2);
- });
- });
- async function sendAudioToServer(audioBlob, audioUrl, duration2, messageIndex) {
- const formData = new FormData();
- formData.append("audio_file", audioBlob);
- try {
- const response = await fetch("https://zxgz.newfeifan.cn/voice2text/", {
- method: "POST",
- body: formData
- });
- const data = await response.json();
- if (data.success) {
- messages2.value[messageIndex].transcription = data.transcription;
- }
- formatAppLog("log", "at pages/chat/speechtotext.vue:91", "Server response:", data);
- } catch (error2) {
- formatAppLog("error", "at pages/chat/speechtotext.vue:93", "Error sending audio file:", error2);
- }
- }
- const sendDuration = () => {
- const audioBlob = new Blob(audioChunks, {
- type: "audio/mpeg"
- });
- const audioUrl = URL.createObjectURL(audioBlob);
- const duration2 = Math.max(Math.floor((/* @__PURE__ */ new Date() - startTime.value) / 1e3), 1);
- const messageIndex = messages2.value.push({
- duration: duration2,
- audioUrl,
- transcription: ""
- // 初始为空
- }) - 1;
- sendAudioToServer(audioBlob, audioUrl, duration2, messageIndex);
- vue.nextTick(() => {
- let messagesElement = document.getElementById("messages");
- messagesElement.scrollTop = messagesElement.scrollHeight;
- });
- };
- const updateDuration = () => {
- const currentDuration = Math.floor((/* @__PURE__ */ new Date() - startTime.value) / 1e3);
- recordingDuration.value = currentDuration + "s";
- if (currentDuration >= 60) {
- stopRecording(new Event("mouseup"));
- }
- };
- const startRecording = (event) => {
- if (!isRecording.value && (event.type === "mousedown" || event.type === "touchstart")) {
- startTime.value = /* @__PURE__ */ new Date();
- isRecording.value = true;
- intervalId = setInterval(updateDuration, 1e3);
- recordingDuration.value = "1s";
- event.preventDefault();
- startTouchY.value = event.touches ? event.touches[0].clientY : 0;
- audioChunks = [];
- isCancelled.value = false;
- mediaRecorder.start();
- }
- };
- const stopRecording = (event) => {
- if (isRecording.value && (event.type === "mouseup" || event.type === "touchend" || event.type === "mouseleave" || event.type === "touchcancel")) {
- clearInterval(intervalId);
- isRecording.value = false;
- recordingDuration.value = "";
- if (/* @__PURE__ */ new Date() - startTime.value >= minRecordingTime) {
- mediaRecorder.stop();
- } else {
- formatAppLog("log", "at pages/chat/speechtotext.vue:150", "录音时间太短,不保存");
- }
- }
- };
- const cancelRecording = () => {
- if (isRecording.value) {
- clearInterval(intervalId);
- formatAppLog("log", "at pages/chat/speechtotext.vue:159", "录音取消");
- isCancelled.value = true;
- mediaRecorder.stop();
- resetRecording();
- }
- };
- const resetRecording = () => {
- isRecording.value = false;
- recordingDuration.value = 0;
- startTime.value = null;
- audioChunks = [];
- };
- const handleTouchMove = (event) => {
- const currentTouchY = event.touches[0].clientY;
- if (startTouchY.value - currentTouchY > cancelOffset) {
- cancelRecording();
- }
- };
- const playRecording = (index2) => {
- const message = messages2.value[index2];
- const audio = new Audio(message.audioUrl);
- audio.play();
- };
- const __returned__ = { safeAreaInsets, safeArea, sysNavBar, messagesHeight, messages: messages2, isRecording, get startTime() {
- return startTime;
- }, set startTime(v2) {
- startTime = v2;
- }, recordingDuration, minRecordingTime, get intervalId() {
- return intervalId;
- }, set intervalId(v2) {
- intervalId = v2;
- }, cancelOffset, startTouchY, get mediaRecorder() {
- return mediaRecorder;
- }, set mediaRecorder(v2) {
- mediaRecorder = v2;
- }, get audioChunks() {
- return audioChunks;
- }, set audioChunks(v2) {
- audioChunks = v2;
- }, get isCancelled() {
- return isCancelled;
- }, set isCancelled(v2) {
- isCancelled = v2;
- }, sendAudioToServer, sendDuration, updateDuration, startRecording, stopRecording, cancelRecording, resetRecording, handleTouchMove, playRecording, ref: vue.ref, nextTick: vue.nextTick, onMounted: vue.onMounted, get sheep() {
- return sheep$1;
- }, get VoiceApi() {
- return VoiceApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "chat-wrap",
- title: "语音转文字"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "chat-container" }, [
- vue.createElementVNode(
- "view",
- {
- class: "messages",
- style: vue.normalizeStyle({ height: $setup.messagesHeight + "px" }),
- id: "messages"
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.messages, (message, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: "message",
- onClick: ($event) => $setup.playRecording(index2)
- }, [
- vue.createElementVNode("view", { class: "bubble" }, [
- vue.createElementVNode(
- "text",
- { class: "duration" },
- vue.toDisplayString(message.duration) + '" ',
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "ss-m-l-10" }, [
- vue.createElementVNode("image", {
- src: _imports_0$1,
- class: "audioPaly"
- })
- ])
- ]),
- message.transcription != null && message.transcription != "" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "text"
- },
- vue.toDisplayString(message.transcription),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "input-area" }, [
- vue.createElementVNode(
- "button",
- {
- onMousedown: $setup.startRecording,
- onMouseup: $setup.stopRecording,
- onMouseleave: $setup.cancelRecording,
- onTouchstart: $setup.startRecording,
- onTouchend: $setup.stopRecording,
- onTouchcancel: $setup.cancelRecording,
- onTouchmove: $setup.handleTouchMove
- },
- " 按住 说话 ",
- 32
- /* NEED_HYDRATION */
- ),
- $setup.isRecording ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "recording-overlay"
- }, [
- vue.createElementVNode(
- "view",
- null,
- vue.toDisplayString($setup.recordingDuration),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", null, "上滑至此取消")
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesChatSpeechtotext = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e], ["__scopeId", "data-v-c5c3bce2"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/chat/speechtotext.vue"]]);
- const _sfc_main$e = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const userInfo2 = vue.computed(() => sheep$1.$store("user").userInfo);
- const state = vue.reactive({
- orderType: "goods",
- // 订单类型; goods - 商品订单, recharge - 充值订单
- orderInfo: {},
- // 支付单信息
- payStatus: 0,
- // 0=检测支付环境, -2=未查询到支付单信息, -1=支付已过期, 1=待支付,2=订单已支付
- payMethods: [],
- // 可选的支付方式
- payment: "",
- // 选中的支付方式
- model: {
- id: "",
- smsCodeUseReqDTO: {
- mobile: "",
- code: "",
- scene: 12
- },
- orderType: 0
- },
- rules: {
- "smsCodeUseReqDTO.code": {
- rules: [{
- required: true,
- errorMessage: t$6("cashier.verification_code_cannot_be_empty")
- }]
- }
- }
- });
- const onPay = () => {
- if (state.payment === "") {
- sheep$1.$helper.toast(t$6("cashier.choose_payment_method"));
- return;
- }
- sheep$1.$platform.pay(state.payment, state.orderType, state.orderInfo.id, state.model.type);
- };
- const FormRef = vue.ref(null);
- const onZeroPay = async () => {
- const validate = await vue.unref(FormRef).validate().catch((error2) => {
- formatAppLog("log", "at pages/pay/index.vue:158", "error: ", error2);
- });
- if (!validate) {
- return;
- }
- const { code: code2, data } = await PayOrderApi.ZeroPurchaseSubmit(state.model);
- if (data) {
- sheep$1.$router.redirect("/pages/pay/resultYuan", {
- id: state.model.id,
- orderType: state.orderType,
- payState: "success",
- payRes: JSON.stringify(data)
- });
- }
- };
- const payDescText = vue.computed(() => {
- if (state.payStatus === 2) {
- return t$6("cashier.order_paid");
- }
- if (state.payStatus === 1) {
- const time2 = useDurationTime(state.orderInfo.expireTime);
- if (time2.ms <= 0) {
- state.payStatus = -1;
- return "";
- }
- return t$6("cashier.remaining_payment_time", { h: time2.h, m: time2.m, s: time2.s });
- }
- if (state.payStatus === -2) {
- return t$6("cashier.no_payment_order_found");
- }
- return "";
- });
- function checkPayStatus() {
- if (state.orderInfo.status === 10 || state.orderInfo.status === 20) {
- state.payStatus = 2;
- return;
- }
- if (state.orderInfo.status === 30) {
- state.payStatus = -1;
- return;
- }
- state.payStatus = 1;
- }
- function onTapPay(e2) {
- state.payment = e2.detail.value;
- }
- async function setOrder(id) {
- const {
- data,
- code: code2
- } = await PayOrderApi.getOrder(id);
- if (code2 !== 0 || !data) {
- state.payStatus = -2;
- return;
- }
- state.orderInfo = data;
- await setPayMethods();
- checkPayStatus();
- }
- async function setPayOrder(id) {
- const {
- data,
- code: code2
- } = await PayOrderApi.getPayOrder(id);
- if (code2 !== 0 || !data) {
- state.payStatus = -2;
- return;
- }
- state.orderInfo = data;
- await setPayMethods();
- checkPayStatus();
- }
- async function setPayMethods() {
- const {
- data,
- code: code2
- } = await PayChannelApi.getEnableChannelCodeList(state.orderInfo.appId);
- if (code2 !== 0) {
- return;
- }
- state.payMethods = getPayMethods(data);
- }
- onLoad((options2) => {
- if (sheep$1.$platform.name === "WechatOfficialAccount" && sheep$1.$platform.os === "ios" && !sheep$1.$platform.landingPage.includes("pages/pay/index")) {
- location.reload();
- return;
- }
- let id = options2.id;
- options2.type;
- state.model.id = options2.id;
- state.model.type = options2.type;
- if (options2.orderType) {
- state.orderType = options2.orderType;
- }
- setOrder(id);
- sheep$1.$store("user").getWallet();
- state.model.smsCodeUseReqDTO.mobile = userInfo2.value.mobile;
- });
- const __returned__ = { userWallet, userInfo: userInfo2, state, onPay, FormRef, onZeroPay, payDescText, checkPayStatus, onTapPay, setOrder, setPayOrder, setPayMethods, computed: vue.computed, reactive: vue.reactive, ref: vue.ref, unref: vue.unref, get onLoad() {
- return onLoad;
- }, get sheep() {
- return sheep$1;
- }, get fen2yuan() {
- return fen2yuan;
- }, get useDurationTime() {
- return useDurationTime;
- }, get PayOrderApi() {
- return PayOrderApi;
- }, get PayChannelApi() {
- return PayChannelApi;
- }, get getPayMethods() {
- return getPayMethods;
- }, get md5() {
- return md5;
- }, get showAuthModal() {
- return showAuthModal;
- }, get closeAuthModal() {
- return closeAuthModal;
- }, get getSmsCode() {
- return getSmsCode;
- }, get getSmsTimer() {
- return getSmsTimer;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$9);
- const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$7);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("cashier.cashier")
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white ss-modal-box ss-flex-col" }, [
- vue.createCommentVNode(" 订单信息 "),
- vue.createElementVNode("view", { class: "modal-header ss-flex-col ss-col-center ss-row-center" }, [
- vue.createElementVNode("view", { class: "money-box ss-m-b-20" }, [
- vue.createElementVNode(
- "text",
- { class: "money-text" },
- vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.price)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "time-text" }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.payDescText),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createCommentVNode(" 支付方式 "),
- $setup.state.orderInfo.price ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "modal-content ss-flex-1"
- }, [
- vue.createElementVNode(
- "view",
- { class: "pay-title ss-p-l-30 ss-m-y-30" },
- vue.toDisplayString($setup.t("cashier.select_payment_method")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "radio-group",
- { onChange: $setup.onTapPay },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.payMethods, (item) => {
- return vue.openBlock(), vue.createElementBlock("label", {
- class: "pay-type-item",
- key: item.title
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["pay-item ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom", { "disabled-pay-item": item.disabled }])
- },
- [
- vue.createElementVNode("view", { class: "ss-flex ss-col-center" }, [
- item.disabled ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "pay-icon",
- src: $setup.sheep.$url.static("/static/img/shop/pay/cod_disabled.png"),
- mode: "aspectFit"
- }, null, 8, ["src"])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" @/static/icon/cart.png "),
- vue.createElementVNode("image", {
- class: "pay-icon",
- src: item.icon,
- mode: "aspectFit"
- }, null, 8, ["src"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )),
- vue.createElementVNode(
- "text",
- { class: "pay-title" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "check-box ss-flex ss-col-center ss-p-l-10" }, [
- vue.createElementVNode("radio", {
- value: item.value,
- color: "var(--ui-BG-Main)",
- style: { "transform": "scale(0.8)" },
- disabled: item.disabled,
- checked: $setup.state.payment === item.value
- }, null, 8, ["value", "disabled", "checked"])
- ])
- ],
- 2
- /* CLASS */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 如果是0元,被佣金或者消费分抵扣完了 走验证码 "),
- vue.createElementVNode("view", { class: "" }, [
- vue.createVNode(_component_uni_forms, {
- model: $setup.state.model,
- rules: $setup.state.rules,
- validateTrigger: "bind",
- labelPosition: "left",
- border: "",
- class: "form-box",
- labelWidth: "200",
- ref: "FormRef"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bg-white ss-p-x-30" }, [
- vue.createVNode(_component_uni_forms_item, {
- name: "mobile",
- label: $setup.t("cashier.phone_number"),
- class: "mobile loginUniFormItem ss-p-t-10"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.smsCodeUseReqDTO.mobile,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.model.smsCodeUseReqDTO.mobile = $event),
- type: "smsCodeUseReqDTO",
- placeholder: $setup.t("cashier.enter_phone_number"),
- inputBorder: false,
- clearable: false,
- disabled: true
- }, {
- right: vue.withCtx(() => [
- vue.createElementVNode("button", {
- class: "ss-reset-button code-btn code-btn-start",
- disabled: $setup.state.payStatus !== 1,
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.getSmsCode("zeroBuy", $setup.state.model.smsCodeUseReqDTO.mobile))
- }, vue.toDisplayString($setup.getSmsTimer("zeroBuy")), 9, ["disabled"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"]),
- vue.createVNode(_component_uni_forms_item, {
- name: "smsCodeUseReqDTO.code",
- label: $setup.t("cashier.verification_code"),
- required: true
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.model.smsCodeUseReqDTO.code,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.state.model.smsCodeUseReqDTO.code = $event),
- type: "number",
- placeholder: $setup.t("cashier.enter_verification_code"),
- inputBorder: false,
- clearable: false
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["label"])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"])
- ])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )),
- vue.createCommentVNode(" 工具 "),
- vue.createElementVNode("view", { class: "modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40" }, [
- $setup.state.payStatus === 0 ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "ss-reset-button past-due-btn"
- },
- vue.toDisplayString($setup.t("cashier.checking_payment_environment")),
- 1
- /* TEXT */
- )) : $setup.state.payStatus === -1 ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "ss-reset-button past-due-btn",
- disabled: ""
- },
- vue.toDisplayString($setup.t("cashier.payment_expired")),
- 1
- /* TEXT */
- )) : $setup.state.payStatus === 1 && $setup.state.orderInfo.price ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createCommentVNode(" 支付状态没过期,并且支付金额不为0 "),
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button save-btn", { "disabled-btn": $setup.state.payStatus !== 1 }]),
- onClick: $setup.onPay,
- disabled: $setup.state.payStatus !== 1
- }, vue.toDisplayString($setup.t("cashier.pay_now")), 11, ["disabled"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 3 },
- [
- vue.createCommentVNode(" 支付状态没过期,并且支付金额为0 "),
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["ss-reset-button save-btn", { "disabled-btn": $setup.state.payStatus !== 1 }]),
- onClick: $setup.onZeroPay,
- disabled: $setup.state.payStatus !== 1
- }, vue.toDisplayString($setup.t("cashier.pay_now")), 11, ["disabled"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- ))
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesPayIndex = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d], ["__scopeId", "data-v-d7fd7b38"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/pay/index.vue"]]);
- function bind(fn, thisArg) {
- return function wrap() {
- return fn.apply(thisArg, arguments);
- };
- }
- const { toString } = Object.prototype;
- const { getPrototypeOf } = Object;
- const kindOf = /* @__PURE__ */ ((cache2) => (thing) => {
- const str = toString.call(thing);
- return cache2[str] || (cache2[str] = str.slice(8, -1).toLowerCase());
- })(/* @__PURE__ */ Object.create(null));
- const kindOfTest = (type) => {
- type = type.toLowerCase();
- return (thing) => kindOf(thing) === type;
- };
- const typeOfTest = (type) => (thing) => typeof thing === type;
- const { isArray } = Array;
- const isUndefined = typeOfTest("undefined");
- function isBuffer(val) {
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
- }
- const isArrayBuffer = kindOfTest("ArrayBuffer");
- function isArrayBufferView(val) {
- let result2;
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
- result2 = ArrayBuffer.isView(val);
- } else {
- result2 = val && val.buffer && isArrayBuffer(val.buffer);
- }
- return result2;
- }
- const isString = typeOfTest("string");
- const isFunction = typeOfTest("function");
- const isNumber = typeOfTest("number");
- const isObject = (thing) => thing !== null && typeof thing === "object";
- const isBoolean = (thing) => thing === true || thing === false;
- const isPlainObject = (val) => {
- if (kindOf(val) !== "object") {
- return false;
- }
- const prototype2 = getPrototypeOf(val);
- return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
- };
- const isDate = kindOfTest("Date");
- const isFile = kindOfTest("File");
- const isBlob = kindOfTest("Blob");
- const isFileList = kindOfTest("FileList");
- const isStream = (val) => isObject(val) && isFunction(val.pipe);
- const isFormData = (thing) => {
- let kind;
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
- kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
- };
- const isURLSearchParams = kindOfTest("URLSearchParams");
- const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
- const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
- if (obj === null || typeof obj === "undefined") {
- return;
- }
- let i2;
- let l2;
- if (typeof obj !== "object") {
- obj = [obj];
- }
- if (isArray(obj)) {
- for (i2 = 0, l2 = obj.length; i2 < l2; i2++) {
- fn.call(null, obj[i2], i2, obj);
- }
- } else {
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
- const len = keys.length;
- let key;
- for (i2 = 0; i2 < len; i2++) {
- key = keys[i2];
- fn.call(null, obj[key], key, obj);
- }
- }
- }
- function findKey(obj, key) {
- key = key.toLowerCase();
- const keys = Object.keys(obj);
- let i2 = keys.length;
- let _key;
- while (i2-- > 0) {
- _key = keys[i2];
- if (key === _key.toLowerCase()) {
- return _key;
- }
- }
- return null;
- }
- const _global = (() => {
- if (typeof globalThis !== "undefined")
- return globalThis;
- return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
- })();
- const isContextDefined = (context) => !isUndefined(context) && context !== _global;
- function merge() {
- const { caseless } = isContextDefined(this) && this || {};
- const result2 = {};
- const assignValue = (val, key) => {
- const targetKey = caseless && findKey(result2, key) || key;
- if (isPlainObject(result2[targetKey]) && isPlainObject(val)) {
- result2[targetKey] = merge(result2[targetKey], val);
- } else if (isPlainObject(val)) {
- result2[targetKey] = merge({}, val);
- } else if (isArray(val)) {
- result2[targetKey] = val.slice();
- } else {
- result2[targetKey] = val;
- }
- };
- for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) {
- arguments[i2] && forEach(arguments[i2], assignValue);
- }
- return result2;
- }
- const extend = (a2, b2, thisArg, { allOwnKeys } = {}) => {
- forEach(b2, (val, key) => {
- if (thisArg && isFunction(val)) {
- a2[key] = bind(val, thisArg);
- } else {
- a2[key] = val;
- }
- }, { allOwnKeys });
- return a2;
- };
- const stripBOM = (content) => {
- if (content.charCodeAt(0) === 65279) {
- content = content.slice(1);
- }
- return content;
- };
- const inherits = (constructor, superConstructor, props, descriptors2) => {
- constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
- constructor.prototype.constructor = constructor;
- Object.defineProperty(constructor, "super", {
- value: superConstructor.prototype
- });
- props && Object.assign(constructor.prototype, props);
- };
- const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
- let props;
- let i2;
- let prop;
- const merged = {};
- destObj = destObj || {};
- if (sourceObj == null)
- return destObj;
- do {
- props = Object.getOwnPropertyNames(sourceObj);
- i2 = props.length;
- while (i2-- > 0) {
- prop = props[i2];
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
- destObj[prop] = sourceObj[prop];
- merged[prop] = true;
- }
- }
- sourceObj = filter !== false && getPrototypeOf(sourceObj);
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
- return destObj;
- };
- const endsWith = (str, searchString, position) => {
- str = String(str);
- if (position === void 0 || position > str.length) {
- position = str.length;
- }
- position -= searchString.length;
- const lastIndex = str.indexOf(searchString, position);
- return lastIndex !== -1 && lastIndex === position;
- };
- const toArray = (thing) => {
- if (!thing)
- return null;
- if (isArray(thing))
- return thing;
- let i2 = thing.length;
- if (!isNumber(i2))
- return null;
- const arr = new Array(i2);
- while (i2-- > 0) {
- arr[i2] = thing[i2];
- }
- return arr;
- };
- const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
- return (thing) => {
- return TypedArray && thing instanceof TypedArray;
- };
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
- const forEachEntry = (obj, fn) => {
- const generator = obj && obj[Symbol.iterator];
- const iterator = generator.call(obj);
- let result2;
- while ((result2 = iterator.next()) && !result2.done) {
- const pair = result2.value;
- fn.call(obj, pair[0], pair[1]);
- }
- };
- const matchAll = (regExp, str) => {
- let matches;
- const arr = [];
- while ((matches = regExp.exec(str)) !== null) {
- arr.push(matches);
- }
- return arr;
- };
- const isHTMLForm = kindOfTest("HTMLFormElement");
- const toCamelCase = (str) => {
- return str.toLowerCase().replace(
- /[-_\s]([a-z\d])(\w*)/g,
- function replacer(m2, p1, p2) {
- return p1.toUpperCase() + p2;
- }
- );
- };
- const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
- const isRegExp = kindOfTest("RegExp");
- const reduceDescriptors = (obj, reducer) => {
- const descriptors2 = Object.getOwnPropertyDescriptors(obj);
- const reducedDescriptors = {};
- forEach(descriptors2, (descriptor, name2) => {
- let ret;
- if ((ret = reducer(descriptor, name2, obj)) !== false) {
- reducedDescriptors[name2] = ret || descriptor;
- }
- });
- Object.defineProperties(obj, reducedDescriptors);
- };
- const freezeMethods = (obj) => {
- reduceDescriptors(obj, (descriptor, name2) => {
- if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name2) !== -1) {
- return false;
- }
- const value = obj[name2];
- if (!isFunction(value))
- return;
- descriptor.enumerable = false;
- if ("writable" in descriptor) {
- descriptor.writable = false;
- return;
- }
- if (!descriptor.set) {
- descriptor.set = () => {
- throw Error("Can not rewrite read-only method '" + name2 + "'");
- };
- }
- });
- };
- const toObjectSet = (arrayOrString, delimiter) => {
- const obj = {};
- const define = (arr) => {
- arr.forEach((value) => {
- obj[value] = true;
- });
- };
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
- return obj;
- };
- const noop = () => {
- };
- const toFiniteNumber = (value, defaultValue) => {
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
- };
- const ALPHA = "abcdefghijklmnopqrstuvwxyz";
- const DIGIT = "0123456789";
- const ALPHABET = {
- DIGIT,
- ALPHA,
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
- };
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
- let str = "";
- const { length } = alphabet;
- while (size--) {
- str += alphabet[Math.random() * length | 0];
- }
- return str;
- };
- function isSpecCompliantForm(thing) {
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
- }
- const toJSONObject = (obj) => {
- const stack = new Array(10);
- const visit = (source, i2) => {
- if (isObject(source)) {
- if (stack.indexOf(source) >= 0) {
- return;
- }
- if (!("toJSON" in source)) {
- stack[i2] = source;
- const target = isArray(source) ? [] : {};
- forEach(source, (value, key) => {
- const reducedValue = visit(value, i2 + 1);
- !isUndefined(reducedValue) && (target[key] = reducedValue);
- });
- stack[i2] = void 0;
- return target;
- }
- }
- return source;
- };
- return visit(obj, 0);
- };
- const isAsyncFn = kindOfTest("AsyncFunction");
- const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
- const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
- if (setImmediateSupported) {
- return setImmediate;
- }
- return postMessageSupported ? ((token, callbacks) => {
- _global.addEventListener("message", ({ source, data }) => {
- if (source === _global && data === token) {
- callbacks.length && callbacks.shift()();
- }
- }, false);
- return (cb) => {
- callbacks.push(cb);
- _global.postMessage(token, "*");
- };
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
- })(
- typeof setImmediate === "function",
- isFunction(_global.postMessage)
- );
- const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
- const utils$1 = {
- isArray,
- isArrayBuffer,
- isBuffer,
- isFormData,
- isArrayBufferView,
- isString,
- isNumber,
- isBoolean,
- isObject,
- isPlainObject,
- isReadableStream,
- isRequest,
- isResponse,
- isHeaders,
- isUndefined,
- isDate,
- isFile,
- isBlob,
- isRegExp,
- isFunction,
- isStream,
- isURLSearchParams,
- isTypedArray,
- isFileList,
- forEach,
- merge,
- extend,
- trim,
- stripBOM,
- inherits,
- toFlatObject,
- kindOf,
- kindOfTest,
- endsWith,
- toArray,
- forEachEntry,
- matchAll,
- isHTMLForm,
- hasOwnProperty,
- hasOwnProp: hasOwnProperty,
- // an alias to avoid ESLint no-prototype-builtins detection
- reduceDescriptors,
- freezeMethods,
- toObjectSet,
- toCamelCase,
- noop,
- toFiniteNumber,
- findKey,
- global: _global,
- isContextDefined,
- ALPHABET,
- generateString,
- isSpecCompliantForm,
- toJSONObject,
- isAsyncFn,
- isThenable,
- setImmediate: _setImmediate,
- asap
- };
- function AxiosError(message, code2, config2, request2, response) {
- Error.call(this);
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
- } else {
- this.stack = new Error().stack;
- }
- this.message = message;
- this.name = "AxiosError";
- code2 && (this.code = code2);
- config2 && (this.config = config2);
- request2 && (this.request = request2);
- if (response) {
- this.response = response;
- this.status = response.status ? response.status : null;
- }
- }
- utils$1.inherits(AxiosError, Error, {
- toJSON: function toJSON() {
- return {
- // Standard
- message: this.message,
- name: this.name,
- // Microsoft
- description: this.description,
- number: this.number,
- // Mozilla
- fileName: this.fileName,
- lineNumber: this.lineNumber,
- columnNumber: this.columnNumber,
- stack: this.stack,
- // Axios
- config: utils$1.toJSONObject(this.config),
- code: this.code,
- status: this.status
- };
- }
- });
- const prototype$1 = AxiosError.prototype;
- const descriptors = {};
- [
- "ERR_BAD_OPTION_VALUE",
- "ERR_BAD_OPTION",
- "ECONNABORTED",
- "ETIMEDOUT",
- "ERR_NETWORK",
- "ERR_FR_TOO_MANY_REDIRECTS",
- "ERR_DEPRECATED",
- "ERR_BAD_RESPONSE",
- "ERR_BAD_REQUEST",
- "ERR_CANCELED",
- "ERR_NOT_SUPPORT",
- "ERR_INVALID_URL"
- // eslint-disable-next-line func-names
- ].forEach((code2) => {
- descriptors[code2] = { value: code2 };
- });
- Object.defineProperties(AxiosError, descriptors);
- Object.defineProperty(prototype$1, "isAxiosError", { value: true });
- AxiosError.from = (error2, code2, config2, request2, response, customProps) => {
- const axiosError = Object.create(prototype$1);
- utils$1.toFlatObject(error2, axiosError, function filter(obj) {
- return obj !== Error.prototype;
- }, (prop) => {
- return prop !== "isAxiosError";
- });
- AxiosError.call(axiosError, error2.message, code2, config2, request2, response);
- axiosError.cause = error2;
- axiosError.name = error2.name;
- customProps && Object.assign(axiosError, customProps);
- return axiosError;
- };
- const httpAdapter = null;
- function isVisitable(thing) {
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
- }
- function removeBrackets(key) {
- return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
- }
- function renderKey(path, key, dots) {
- if (!path)
- return key;
- return path.concat(key).map(function each(token, i2) {
- token = removeBrackets(token);
- return !dots && i2 ? "[" + token + "]" : token;
- }).join(dots ? "." : "");
- }
- function isFlatArray(arr) {
- return utils$1.isArray(arr) && !arr.some(isVisitable);
- }
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
- return /^is[A-Z]/.test(prop);
- });
- function toFormData(obj, formData, options2) {
- if (!utils$1.isObject(obj)) {
- throw new TypeError("target must be an object");
- }
- formData = formData || new FormData();
- options2 = utils$1.toFlatObject(options2, {
- metaTokens: true,
- dots: false,
- indexes: false
- }, false, function defined(option, source) {
- return !utils$1.isUndefined(source[option]);
- });
- const metaTokens = options2.metaTokens;
- const visitor = options2.visitor || defaultVisitor;
- const dots = options2.dots;
- const indexes = options2.indexes;
- const _Blob = options2.Blob || typeof Blob !== "undefined" && Blob;
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
- if (!utils$1.isFunction(visitor)) {
- throw new TypeError("visitor must be a function");
- }
- function convertValue(value) {
- if (value === null)
- return "";
- if (utils$1.isDate(value)) {
- return value.toISOString();
- }
- if (!useBlob && utils$1.isBlob(value)) {
- throw new AxiosError("Blob is not supported. Use a Buffer instead.");
- }
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
- return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
- }
- return value;
- }
- function defaultVisitor(value, key, path) {
- let arr = value;
- if (value && !path && typeof value === "object") {
- if (utils$1.endsWith(key, "{}")) {
- key = metaTokens ? key : key.slice(0, -2);
- value = JSON.stringify(value);
- } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
- key = removeBrackets(key);
- arr.forEach(function each(el, index2) {
- !(utils$1.isUndefined(el) || el === null) && formData.append(
- // eslint-disable-next-line no-nested-ternary
- indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]",
- convertValue(el)
- );
- });
- return false;
- }
- }
- if (isVisitable(value)) {
- return true;
- }
- formData.append(renderKey(path, key, dots), convertValue(value));
- return false;
- }
- const stack = [];
- const exposedHelpers = Object.assign(predicates, {
- defaultVisitor,
- convertValue,
- isVisitable
- });
- function build(value, path) {
- if (utils$1.isUndefined(value))
- return;
- if (stack.indexOf(value) !== -1) {
- throw Error("Circular reference detected in " + path.join("."));
- }
- stack.push(value);
- utils$1.forEach(value, function each(el, key) {
- const result2 = !(utils$1.isUndefined(el) || el === null) && visitor.call(
- formData,
- el,
- utils$1.isString(key) ? key.trim() : key,
- path,
- exposedHelpers
- );
- if (result2 === true) {
- build(el, path ? path.concat(key) : [key]);
- }
- });
- stack.pop();
- }
- if (!utils$1.isObject(obj)) {
- throw new TypeError("data must be an object");
- }
- build(obj);
- return formData;
- }
- function encode$1(str) {
- const charMap = {
- "!": "%21",
- "'": "%27",
- "(": "%28",
- ")": "%29",
- "~": "%7E",
- "%20": "+",
- "%00": "\0"
- };
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
- return charMap[match];
- });
- }
- function AxiosURLSearchParams(params, options2) {
- this._pairs = [];
- params && toFormData(params, this, options2);
- }
- const prototype = AxiosURLSearchParams.prototype;
- prototype.append = function append(name2, value) {
- this._pairs.push([name2, value]);
- };
- prototype.toString = function toString2(encoder) {
- const _encode = encoder ? function(value) {
- return encoder.call(this, value, encode$1);
- } : encode$1;
- return this._pairs.map(function each(pair) {
- return _encode(pair[0]) + "=" + _encode(pair[1]);
- }, "").join("&");
- };
- function encode(val) {
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
- }
- function buildURL(url2, params, options2) {
- if (!params) {
- return url2;
- }
- const _encode = options2 && options2.encode || encode;
- const serializeFn = options2 && options2.serialize;
- let serializedParams;
- if (serializeFn) {
- serializedParams = serializeFn(params, options2);
- } else {
- serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options2).toString(_encode);
- }
- if (serializedParams) {
- const hashmarkIndex = url2.indexOf("#");
- if (hashmarkIndex !== -1) {
- url2 = url2.slice(0, hashmarkIndex);
- }
- url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
- }
- return url2;
- }
- class InterceptorManager {
- constructor() {
- this.handlers = [];
- }
- /**
- * Add a new interceptor to the stack
- *
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
- * @param {Function} rejected The function to handle `reject` for a `Promise`
- *
- * @return {Number} An ID used to remove interceptor later
- */
- use(fulfilled, rejected, options2) {
- this.handlers.push({
- fulfilled,
- rejected,
- synchronous: options2 ? options2.synchronous : false,
- runWhen: options2 ? options2.runWhen : null
- });
- return this.handlers.length - 1;
- }
- /**
- * Remove an interceptor from the stack
- *
- * @param {Number} id The ID that was returned by `use`
- *
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
- */
- eject(id) {
- if (this.handlers[id]) {
- this.handlers[id] = null;
- }
- }
- /**
- * Clear all interceptors from the stack
- *
- * @returns {void}
- */
- clear() {
- if (this.handlers) {
- this.handlers = [];
- }
- }
- /**
- * Iterate over all the registered interceptors
- *
- * This method is particularly useful for skipping over any
- * interceptors that may have become `null` calling `eject`.
- *
- * @param {Function} fn The function to call for each interceptor
- *
- * @returns {void}
- */
- forEach(fn) {
- utils$1.forEach(this.handlers, function forEachHandler(h2) {
- if (h2 !== null) {
- fn(h2);
- }
- });
- }
- }
- const transitionalDefaults = {
- silentJSONParsing: true,
- forcedJSONParsing: true,
- clarifyTimeoutError: false
- };
- const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
- const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
- const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
- const platform$1 = {
- isBrowser: true,
- classes: {
- URLSearchParams: URLSearchParams$1,
- FormData: FormData$1,
- Blob: Blob$1
- },
- protocols: ["http", "https", "file", "blob", "url", "data"]
- };
- const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
- const _navigator = typeof navigator === "object" && navigator || void 0;
- const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
- const hasStandardBrowserWebWorkerEnv = (() => {
- return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
- self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
- })();
- const origin = hasBrowserEnv && window.location.href || "http://localhost";
- const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- hasBrowserEnv,
- hasStandardBrowserEnv,
- hasStandardBrowserWebWorkerEnv,
- navigator: _navigator,
- origin
- }, Symbol.toStringTag, { value: "Module" }));
- const platform = {
- ...utils,
- ...platform$1
- };
- function toURLEncodedForm(data, options2) {
- return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
- visitor: function(value, key, path, helpers) {
- if (platform.isNode && utils$1.isBuffer(value)) {
- this.append(key, value.toString("base64"));
- return false;
- }
- return helpers.defaultVisitor.apply(this, arguments);
- }
- }, options2));
- }
- function parsePropPath(name2) {
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name2).map((match) => {
- return match[0] === "[]" ? "" : match[1] || match[0];
- });
- }
- function arrayToObject(arr) {
- const obj = {};
- const keys = Object.keys(arr);
- let i2;
- const len = keys.length;
- let key;
- for (i2 = 0; i2 < len; i2++) {
- key = keys[i2];
- obj[key] = arr[key];
- }
- return obj;
- }
- function formDataToJSON(formData) {
- function buildPath(path, value, target, index2) {
- let name2 = path[index2++];
- if (name2 === "__proto__")
- return true;
- const isNumericKey = Number.isFinite(+name2);
- const isLast = index2 >= path.length;
- name2 = !name2 && utils$1.isArray(target) ? target.length : name2;
- if (isLast) {
- if (utils$1.hasOwnProp(target, name2)) {
- target[name2] = [target[name2], value];
- } else {
- target[name2] = value;
- }
- return !isNumericKey;
- }
- if (!target[name2] || !utils$1.isObject(target[name2])) {
- target[name2] = [];
- }
- const result2 = buildPath(path, value, target[name2], index2);
- if (result2 && utils$1.isArray(target[name2])) {
- target[name2] = arrayToObject(target[name2]);
- }
- return !isNumericKey;
- }
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
- const obj = {};
- utils$1.forEachEntry(formData, (name2, value) => {
- buildPath(parsePropPath(name2), value, obj, 0);
- });
- return obj;
- }
- return null;
- }
- function stringifySafely(rawValue, parser, encoder) {
- if (utils$1.isString(rawValue)) {
- try {
- (parser || JSON.parse)(rawValue);
- return utils$1.trim(rawValue);
- } catch (e2) {
- if (e2.name !== "SyntaxError") {
- throw e2;
- }
- }
- }
- return (encoder || JSON.stringify)(rawValue);
- }
- const defaults = {
- transitional: transitionalDefaults,
- adapter: ["xhr", "http", "fetch"],
- transformRequest: [function transformRequest(data, headers) {
- const contentType = headers.getContentType() || "";
- const hasJSONContentType = contentType.indexOf("application/json") > -1;
- const isObjectPayload = utils$1.isObject(data);
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
- data = new FormData(data);
- }
- const isFormData2 = utils$1.isFormData(data);
- if (isFormData2) {
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
- }
- if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
- return data;
- }
- if (utils$1.isArrayBufferView(data)) {
- return data.buffer;
- }
- if (utils$1.isURLSearchParams(data)) {
- headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
- return data.toString();
- }
- let isFileList2;
- if (isObjectPayload) {
- if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
- return toURLEncodedForm(data, this.formSerializer).toString();
- }
- if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
- const _FormData = this.env && this.env.FormData;
- return toFormData(
- isFileList2 ? { "files[]": data } : data,
- _FormData && new _FormData(),
- this.formSerializer
- );
- }
- }
- if (isObjectPayload || hasJSONContentType) {
- headers.setContentType("application/json", false);
- return stringifySafely(data);
- }
- return data;
- }],
- transformResponse: [function transformResponse(data) {
- const transitional = this.transitional || defaults.transitional;
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
- const JSONRequested = this.responseType === "json";
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
- return data;
- }
- if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
- try {
- return JSON.parse(data);
- } catch (e2) {
- if (strictJSONParsing) {
- if (e2.name === "SyntaxError") {
- throw AxiosError.from(e2, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
- }
- throw e2;
- }
- }
- }
- return data;
- }],
- /**
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
- * timeout is not created.
- */
- timeout: 0,
- xsrfCookieName: "XSRF-TOKEN",
- xsrfHeaderName: "X-XSRF-TOKEN",
- maxContentLength: -1,
- maxBodyLength: -1,
- env: {
- FormData: platform.classes.FormData,
- Blob: platform.classes.Blob
- },
- validateStatus: function validateStatus(status) {
- return status >= 200 && status < 300;
- },
- headers: {
- common: {
- "Accept": "application/json, text/plain, */*",
- "Content-Type": void 0
- }
- }
- };
- utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
- defaults.headers[method] = {};
- });
- const defaults$1 = defaults;
- const ignoreDuplicateOf = utils$1.toObjectSet([
- "age",
- "authorization",
- "content-length",
- "content-type",
- "etag",
- "expires",
- "from",
- "host",
- "if-modified-since",
- "if-unmodified-since",
- "last-modified",
- "location",
- "max-forwards",
- "proxy-authorization",
- "referer",
- "retry-after",
- "user-agent"
- ]);
- const parseHeaders = (rawHeaders) => {
- const parsed = {};
- let key;
- let val;
- let i2;
- rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
- i2 = line.indexOf(":");
- key = line.substring(0, i2).trim().toLowerCase();
- val = line.substring(i2 + 1).trim();
- if (!key || parsed[key] && ignoreDuplicateOf[key]) {
- return;
- }
- if (key === "set-cookie") {
- if (parsed[key]) {
- parsed[key].push(val);
- } else {
- parsed[key] = [val];
- }
- } else {
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
- }
- });
- return parsed;
- };
- const $internals = Symbol("internals");
- function normalizeHeader(header) {
- return header && String(header).trim().toLowerCase();
- }
- function normalizeValue(value) {
- if (value === false || value == null) {
- return value;
- }
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
- }
- function parseTokens(str) {
- const tokens = /* @__PURE__ */ Object.create(null);
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
- let match;
- while (match = tokensRE.exec(str)) {
- tokens[match[1]] = match[2];
- }
- return tokens;
- }
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
- if (utils$1.isFunction(filter)) {
- return filter.call(this, value, header);
- }
- if (isHeaderNameFilter) {
- value = header;
- }
- if (!utils$1.isString(value))
- return;
- if (utils$1.isString(filter)) {
- return value.indexOf(filter) !== -1;
- }
- if (utils$1.isRegExp(filter)) {
- return filter.test(value);
- }
- }
- function formatHeader(header) {
- return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w2, char, str) => {
- return char.toUpperCase() + str;
- });
- }
- function buildAccessors(obj, header) {
- const accessorName = utils$1.toCamelCase(" " + header);
- ["get", "set", "has"].forEach((methodName) => {
- Object.defineProperty(obj, methodName + accessorName, {
- value: function(arg1, arg2, arg3) {
- return this[methodName].call(this, header, arg1, arg2, arg3);
- },
- configurable: true
- });
- });
- }
- class AxiosHeaders {
- constructor(headers) {
- headers && this.set(headers);
- }
- set(header, valueOrRewrite, rewrite) {
- const self2 = this;
- function setHeader(_value, _header, _rewrite) {
- const lHeader = normalizeHeader(_header);
- if (!lHeader) {
- throw new Error("header name must be a non-empty string");
- }
- const key = utils$1.findKey(self2, lHeader);
- if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
- self2[key || _header] = normalizeValue(_value);
- }
- }
- const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
- setHeaders(header, valueOrRewrite);
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
- setHeaders(parseHeaders(header), valueOrRewrite);
- } else if (utils$1.isHeaders(header)) {
- for (const [key, value] of header.entries()) {
- setHeader(value, key, rewrite);
- }
- } else {
- header != null && setHeader(valueOrRewrite, header, rewrite);
- }
- return this;
- }
- get(header, parser) {
- header = normalizeHeader(header);
- if (header) {
- const key = utils$1.findKey(this, header);
- if (key) {
- const value = this[key];
- if (!parser) {
- return value;
- }
- if (parser === true) {
- return parseTokens(value);
- }
- if (utils$1.isFunction(parser)) {
- return parser.call(this, value, key);
- }
- if (utils$1.isRegExp(parser)) {
- return parser.exec(value);
- }
- throw new TypeError("parser must be boolean|regexp|function");
- }
- }
- }
- has(header, matcher) {
- header = normalizeHeader(header);
- if (header) {
- const key = utils$1.findKey(this, header);
- return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
- }
- return false;
- }
- delete(header, matcher) {
- const self2 = this;
- let deleted = false;
- function deleteHeader(_header) {
- _header = normalizeHeader(_header);
- if (_header) {
- const key = utils$1.findKey(self2, _header);
- if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
- delete self2[key];
- deleted = true;
- }
- }
- }
- if (utils$1.isArray(header)) {
- header.forEach(deleteHeader);
- } else {
- deleteHeader(header);
- }
- return deleted;
- }
- clear(matcher) {
- const keys = Object.keys(this);
- let i2 = keys.length;
- let deleted = false;
- while (i2--) {
- const key = keys[i2];
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
- delete this[key];
- deleted = true;
- }
- }
- return deleted;
- }
- normalize(format2) {
- const self2 = this;
- const headers = {};
- utils$1.forEach(this, (value, header) => {
- const key = utils$1.findKey(headers, header);
- if (key) {
- self2[key] = normalizeValue(value);
- delete self2[header];
- return;
- }
- const normalized = format2 ? formatHeader(header) : String(header).trim();
- if (normalized !== header) {
- delete self2[header];
- }
- self2[normalized] = normalizeValue(value);
- headers[normalized] = true;
- });
- return this;
- }
- concat(...targets) {
- return this.constructor.concat(this, ...targets);
- }
- toJSON(asStrings) {
- const obj = /* @__PURE__ */ Object.create(null);
- utils$1.forEach(this, (value, header) => {
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
- });
- return obj;
- }
- [Symbol.iterator]() {
- return Object.entries(this.toJSON())[Symbol.iterator]();
- }
- toString() {
- return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
- }
- get [Symbol.toStringTag]() {
- return "AxiosHeaders";
- }
- static from(thing) {
- return thing instanceof this ? thing : new this(thing);
- }
- static concat(first, ...targets) {
- const computed = new this(first);
- targets.forEach((target) => computed.set(target));
- return computed;
- }
- static accessor(header) {
- const internals = this[$internals] = this[$internals] = {
- accessors: {}
- };
- const accessors = internals.accessors;
- const prototype2 = this.prototype;
- function defineAccessor(_header) {
- const lHeader = normalizeHeader(_header);
- if (!accessors[lHeader]) {
- buildAccessors(prototype2, _header);
- accessors[lHeader] = true;
- }
- }
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
- return this;
- }
- }
- AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
- let mapped = key[0].toUpperCase() + key.slice(1);
- return {
- get: () => value,
- set(headerValue) {
- this[mapped] = headerValue;
- }
- };
- });
- utils$1.freezeMethods(AxiosHeaders);
- const AxiosHeaders$1 = AxiosHeaders;
- function transformData(fns, response) {
- const config2 = this || defaults$1;
- const context = response || config2;
- const headers = AxiosHeaders$1.from(context.headers);
- let data = context.data;
- utils$1.forEach(fns, function transform(fn) {
- data = fn.call(config2, data, headers.normalize(), response ? response.status : void 0);
- });
- headers.normalize();
- return data;
- }
- function isCancel(value) {
- return !!(value && value.__CANCEL__);
- }
- function CanceledError(message, config2, request2) {
- AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config2, request2);
- this.name = "CanceledError";
- }
- utils$1.inherits(CanceledError, AxiosError, {
- __CANCEL__: true
- });
- function settle(resolve, reject, response) {
- const validateStatus = response.config.validateStatus;
- if (!response.status || !validateStatus || validateStatus(response.status)) {
- resolve(response);
- } else {
- reject(new AxiosError(
- "Request failed with status code " + response.status,
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
- response.config,
- response.request,
- response
- ));
- }
- }
- function parseProtocol(url2) {
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
- return match && match[1] || "";
- }
- function speedometer(samplesCount, min) {
- samplesCount = samplesCount || 10;
- const bytes = new Array(samplesCount);
- const timestamps = new Array(samplesCount);
- let head = 0;
- let tail = 0;
- let firstSampleTS;
- min = min !== void 0 ? min : 1e3;
- return function push(chunkLength) {
- const now2 = Date.now();
- const startedAt = timestamps[tail];
- if (!firstSampleTS) {
- firstSampleTS = now2;
- }
- bytes[head] = chunkLength;
- timestamps[head] = now2;
- let i2 = tail;
- let bytesCount = 0;
- while (i2 !== head) {
- bytesCount += bytes[i2++];
- i2 = i2 % samplesCount;
- }
- head = (head + 1) % samplesCount;
- if (head === tail) {
- tail = (tail + 1) % samplesCount;
- }
- if (now2 - firstSampleTS < min) {
- return;
- }
- const passed = startedAt && now2 - startedAt;
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
- };
- }
- function throttle(fn, freq) {
- let timestamp = 0;
- let threshold = 1e3 / freq;
- let lastArgs;
- let timer2;
- const invoke = (args, now2 = Date.now()) => {
- timestamp = now2;
- lastArgs = null;
- if (timer2) {
- clearTimeout(timer2);
- timer2 = null;
- }
- fn.apply(null, args);
- };
- const throttled = (...args) => {
- const now2 = Date.now();
- const passed = now2 - timestamp;
- if (passed >= threshold) {
- invoke(args, now2);
- } else {
- lastArgs = args;
- if (!timer2) {
- timer2 = setTimeout(() => {
- timer2 = null;
- invoke(lastArgs);
- }, threshold - passed);
- }
- }
- };
- const flush = () => lastArgs && invoke(lastArgs);
- return [throttled, flush];
- }
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
- let bytesNotified = 0;
- const _speedometer = speedometer(50, 250);
- return throttle((e2) => {
- const loaded = e2.loaded;
- const total = e2.lengthComputable ? e2.total : void 0;
- const progressBytes = loaded - bytesNotified;
- const rate = _speedometer(progressBytes);
- const inRange = loaded <= total;
- bytesNotified = loaded;
- const data = {
- loaded,
- total,
- progress: total ? loaded / total : void 0,
- bytes: progressBytes,
- rate: rate ? rate : void 0,
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
- event: e2,
- lengthComputable: total != null,
- [isDownloadStream ? "download" : "upload"]: true
- };
- listener(data);
- }, freq);
- };
- const progressEventDecorator = (total, throttled) => {
- const lengthComputable = total != null;
- return [(loaded) => throttled[0]({
- lengthComputable,
- total,
- loaded
- }), throttled[1]];
- };
- const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
- const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
- // Standard browser envs have full support of the APIs needed to test
- // whether the request URL is of the same origin as current location.
- function standardBrowserEnv() {
- const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
- const urlParsingNode = document.createElement("a");
- let originURL;
- function resolveURL(url2) {
- let href = url2;
- if (msie) {
- urlParsingNode.setAttribute("href", href);
- href = urlParsingNode.href;
- }
- urlParsingNode.setAttribute("href", href);
- return {
- href: urlParsingNode.href,
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
- host: urlParsingNode.host,
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
- hostname: urlParsingNode.hostname,
- port: urlParsingNode.port,
- pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
- };
- }
- originURL = resolveURL(window.location.href);
- return function isURLSameOrigin2(requestURL) {
- const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
- return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
- };
- }()
- ) : (
- // Non standard browser envs (web workers, react-native) lack needed support.
- /* @__PURE__ */ function nonStandardBrowserEnv() {
- return function isURLSameOrigin2() {
- return true;
- };
- }()
- );
- const cookies = platform.hasStandardBrowserEnv ? (
- // Standard browser envs support document.cookie
- {
- write(name2, value, expires, path, domain, secure) {
- const cookie = [name2 + "=" + encodeURIComponent(value)];
- utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
- utils$1.isString(path) && cookie.push("path=" + path);
- utils$1.isString(domain) && cookie.push("domain=" + domain);
- secure === true && cookie.push("secure");
- document.cookie = cookie.join("; ");
- },
- read(name2) {
- const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)"));
- return match ? decodeURIComponent(match[3]) : null;
- },
- remove(name2) {
- this.write(name2, "", Date.now() - 864e5);
- }
- }
- ) : (
- // Non-standard browser env (web workers, react-native) lack needed support.
- {
- write() {
- },
- read() {
- return null;
- },
- remove() {
- }
- }
- );
- function isAbsoluteURL(url2) {
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
- }
- function combineURLs(baseURL, relativeURL) {
- return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
- }
- function buildFullPath(baseURL, requestedURL) {
- if (baseURL && !isAbsoluteURL(requestedURL)) {
- return combineURLs(baseURL, requestedURL);
- }
- return requestedURL;
- }
- const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
- function mergeConfig(config1, config2) {
- config2 = config2 || {};
- const config3 = {};
- function getMergedValue(target, source, caseless) {
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
- return utils$1.merge.call({ caseless }, target, source);
- } else if (utils$1.isPlainObject(source)) {
- return utils$1.merge({}, source);
- } else if (utils$1.isArray(source)) {
- return source.slice();
- }
- return source;
- }
- function mergeDeepProperties(a2, b2, caseless) {
- if (!utils$1.isUndefined(b2)) {
- return getMergedValue(a2, b2, caseless);
- } else if (!utils$1.isUndefined(a2)) {
- return getMergedValue(void 0, a2, caseless);
- }
- }
- function valueFromConfig2(a2, b2) {
- if (!utils$1.isUndefined(b2)) {
- return getMergedValue(void 0, b2);
- }
- }
- function defaultToConfig2(a2, b2) {
- if (!utils$1.isUndefined(b2)) {
- return getMergedValue(void 0, b2);
- } else if (!utils$1.isUndefined(a2)) {
- return getMergedValue(void 0, a2);
- }
- }
- function mergeDirectKeys(a2, b2, prop) {
- if (prop in config2) {
- return getMergedValue(a2, b2);
- } else if (prop in config1) {
- return getMergedValue(void 0, a2);
- }
- }
- const mergeMap = {
- url: valueFromConfig2,
- method: valueFromConfig2,
- data: valueFromConfig2,
- baseURL: defaultToConfig2,
- transformRequest: defaultToConfig2,
- transformResponse: defaultToConfig2,
- paramsSerializer: defaultToConfig2,
- timeout: defaultToConfig2,
- timeoutMessage: defaultToConfig2,
- withCredentials: defaultToConfig2,
- withXSRFToken: defaultToConfig2,
- adapter: defaultToConfig2,
- responseType: defaultToConfig2,
- xsrfCookieName: defaultToConfig2,
- xsrfHeaderName: defaultToConfig2,
- onUploadProgress: defaultToConfig2,
- onDownloadProgress: defaultToConfig2,
- decompress: defaultToConfig2,
- maxContentLength: defaultToConfig2,
- maxBodyLength: defaultToConfig2,
- beforeRedirect: defaultToConfig2,
- transport: defaultToConfig2,
- httpAgent: defaultToConfig2,
- httpsAgent: defaultToConfig2,
- cancelToken: defaultToConfig2,
- socketPath: defaultToConfig2,
- responseEncoding: defaultToConfig2,
- validateStatus: mergeDirectKeys,
- headers: (a2, b2) => mergeDeepProperties(headersToObject(a2), headersToObject(b2), true)
- };
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
- const merge2 = mergeMap[prop] || mergeDeepProperties;
- const configValue = merge2(config1[prop], config2[prop], prop);
- utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config3[prop] = configValue);
- });
- return config3;
- }
- const resolveConfig = (config2) => {
- const newConfig = mergeConfig({}, config2);
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config2.params, config2.paramsSerializer);
- if (auth) {
- headers.set(
- "Authorization",
- "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
- );
- }
- let contentType;
- if (utils$1.isFormData(data)) {
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
- headers.setContentType(void 0);
- } else if ((contentType = headers.getContentType()) !== false) {
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
- headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
- }
- }
- if (platform.hasStandardBrowserEnv) {
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
- if (xsrfValue) {
- headers.set(xsrfHeaderName, xsrfValue);
- }
- }
- }
- return newConfig;
- };
- const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
- const xhrAdapter = isXHRAdapterSupported && function(config2) {
- return new Promise(function dispatchXhrRequest(resolve, reject) {
- const _config = resolveConfig(config2);
- let requestData = _config.data;
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
- let { responseType, onUploadProgress, onDownloadProgress } = _config;
- let onCanceled;
- let uploadThrottled, downloadThrottled;
- let flushUpload, flushDownload;
- function done() {
- flushUpload && flushUpload();
- flushDownload && flushDownload();
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
- _config.signal && _config.signal.removeEventListener("abort", onCanceled);
- }
- let request2 = new XMLHttpRequest();
- request2.open(_config.method.toUpperCase(), _config.url, true);
- request2.timeout = _config.timeout;
- function onloadend() {
- if (!request2) {
- return;
- }
- const responseHeaders = AxiosHeaders$1.from(
- "getAllResponseHeaders" in request2 && request2.getAllResponseHeaders()
- );
- const responseData = !responseType || responseType === "text" || responseType === "json" ? request2.responseText : request2.response;
- const response = {
- data: responseData,
- status: request2.status,
- statusText: request2.statusText,
- headers: responseHeaders,
- config: config2,
- request: request2
- };
- settle(function _resolve(value) {
- resolve(value);
- done();
- }, function _reject(err) {
- reject(err);
- done();
- }, response);
- request2 = null;
- }
- if ("onloadend" in request2) {
- request2.onloadend = onloadend;
- } else {
- request2.onreadystatechange = function handleLoad() {
- if (!request2 || request2.readyState !== 4) {
- return;
- }
- if (request2.status === 0 && !(request2.responseURL && request2.responseURL.indexOf("file:") === 0)) {
- return;
- }
- setTimeout(onloadend);
- };
- }
- request2.onabort = function handleAbort() {
- if (!request2) {
- return;
- }
- reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config2, request2));
- request2 = null;
- };
- request2.onerror = function handleError() {
- reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config2, request2));
- request2 = null;
- };
- request2.ontimeout = function handleTimeout() {
- let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
- const transitional = _config.transitional || transitionalDefaults;
- if (_config.timeoutErrorMessage) {
- timeoutErrorMessage = _config.timeoutErrorMessage;
- }
- reject(new AxiosError(
- timeoutErrorMessage,
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
- config2,
- request2
- ));
- request2 = null;
- };
- requestData === void 0 && requestHeaders.setContentType(null);
- if ("setRequestHeader" in request2) {
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
- request2.setRequestHeader(key, val);
- });
- }
- if (!utils$1.isUndefined(_config.withCredentials)) {
- request2.withCredentials = !!_config.withCredentials;
- }
- if (responseType && responseType !== "json") {
- request2.responseType = _config.responseType;
- }
- if (onDownloadProgress) {
- [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
- request2.addEventListener("progress", downloadThrottled);
- }
- if (onUploadProgress && request2.upload) {
- [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
- request2.upload.addEventListener("progress", uploadThrottled);
- request2.upload.addEventListener("loadend", flushUpload);
- }
- if (_config.cancelToken || _config.signal) {
- onCanceled = (cancel) => {
- if (!request2) {
- return;
- }
- reject(!cancel || cancel.type ? new CanceledError(null, config2, request2) : cancel);
- request2.abort();
- request2 = null;
- };
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
- if (_config.signal) {
- _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
- }
- }
- const protocol = parseProtocol(_config.url);
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
- reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config2));
- return;
- }
- request2.send(requestData || null);
- });
- };
- const composeSignals = (signals, timeout) => {
- const { length } = signals = signals ? signals.filter(Boolean) : [];
- if (timeout || length) {
- let controller = new AbortController();
- let aborted;
- const onabort = function(reason) {
- if (!aborted) {
- aborted = true;
- unsubscribe();
- const err = reason instanceof Error ? reason : this.reason;
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
- }
- };
- let timer2 = timeout && setTimeout(() => {
- timer2 = null;
- onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
- }, timeout);
- const unsubscribe = () => {
- if (signals) {
- timer2 && clearTimeout(timer2);
- timer2 = null;
- signals.forEach((signal2) => {
- signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
- });
- signals = null;
- }
- };
- signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
- const { signal } = controller;
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
- return signal;
- }
- };
- const composeSignals$1 = composeSignals;
- const streamChunk = function* (chunk, chunkSize) {
- let len = chunk.byteLength;
- if (!chunkSize || len < chunkSize) {
- yield chunk;
- return;
- }
- let pos = 0;
- let end;
- while (pos < len) {
- end = pos + chunkSize;
- yield chunk.slice(pos, end);
- pos = end;
- }
- };
- const readBytes = async function* (iterable, chunkSize) {
- for await (const chunk of readStream(iterable)) {
- yield* streamChunk(chunk, chunkSize);
- }
- };
- const readStream = async function* (stream) {
- if (stream[Symbol.asyncIterator]) {
- yield* stream;
- return;
- }
- const reader = stream.getReader();
- try {
- for (; ; ) {
- const { done, value } = await reader.read();
- if (done) {
- break;
- }
- yield value;
- }
- } finally {
- await reader.cancel();
- }
- };
- const trackStream = (stream, chunkSize, onProgress, onFinish) => {
- const iterator = readBytes(stream, chunkSize);
- let bytes = 0;
- let done;
- let _onFinish = (e2) => {
- if (!done) {
- done = true;
- onFinish && onFinish(e2);
- }
- };
- return new ReadableStream({
- async pull(controller) {
- try {
- const { done: done2, value } = await iterator.next();
- if (done2) {
- _onFinish();
- controller.close();
- return;
- }
- let len = value.byteLength;
- if (onProgress) {
- let loadedBytes = bytes += len;
- onProgress(loadedBytes);
- }
- controller.enqueue(new Uint8Array(value));
- } catch (err) {
- _onFinish(err);
- throw err;
- }
- },
- cancel(reason) {
- _onFinish(reason);
- return iterator.return();
- }
- }, {
- highWaterMark: 2
- });
- };
- const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
- const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
- const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
- const test = (fn, ...args) => {
- try {
- return !!fn(...args);
- } catch (e2) {
- return false;
- }
- };
- const supportsRequestStream = isReadableStreamSupported && test(() => {
- let duplexAccessed = false;
- const hasContentType = new Request(platform.origin, {
- body: new ReadableStream(),
- method: "POST",
- get duplex() {
- duplexAccessed = true;
- return "half";
- }
- }).headers.has("Content-Type");
- return duplexAccessed && !hasContentType;
- });
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
- const supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
- const resolvers = {
- stream: supportsResponseStream && ((res) => res.body)
- };
- isFetchSupported && ((res) => {
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
- !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_2, config2) => {
- throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config2);
- });
- });
- })(new Response());
- const getBodyLength = async (body) => {
- if (body == null) {
- return 0;
- }
- if (utils$1.isBlob(body)) {
- return body.size;
- }
- if (utils$1.isSpecCompliantForm(body)) {
- const _request = new Request(platform.origin, {
- method: "POST",
- body
- });
- return (await _request.arrayBuffer()).byteLength;
- }
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
- return body.byteLength;
- }
- if (utils$1.isURLSearchParams(body)) {
- body = body + "";
- }
- if (utils$1.isString(body)) {
- return (await encodeText(body)).byteLength;
- }
- };
- const resolveBodyLength = async (headers, body) => {
- const length = utils$1.toFiniteNumber(headers.getContentLength());
- return length == null ? getBodyLength(body) : length;
- };
- const fetchAdapter = isFetchSupported && (async (config2) => {
- let {
- url: url2,
- method,
- data,
- signal,
- cancelToken,
- timeout,
- onDownloadProgress,
- onUploadProgress,
- responseType,
- headers,
- withCredentials = "same-origin",
- fetchOptions
- } = resolveConfig(config2);
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
- let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
- let request2;
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
- composedSignal.unsubscribe();
- });
- let requestContentLength;
- try {
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
- let _request = new Request(url2, {
- method: "POST",
- body: data,
- duplex: "half"
- });
- let contentTypeHeader;
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
- headers.setContentType(contentTypeHeader);
- }
- if (_request.body) {
- const [onProgress, flush] = progressEventDecorator(
- requestContentLength,
- progressEventReducer(asyncDecorator(onUploadProgress))
- );
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
- }
- }
- if (!utils$1.isString(withCredentials)) {
- withCredentials = withCredentials ? "include" : "omit";
- }
- const isCredentialsSupported = "credentials" in Request.prototype;
- request2 = new Request(url2, {
- ...fetchOptions,
- signal: composedSignal,
- method: method.toUpperCase(),
- headers: headers.normalize().toJSON(),
- body: data,
- duplex: "half",
- credentials: isCredentialsSupported ? withCredentials : void 0
- });
- let response = await fetch(request2);
- const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
- const options2 = {};
- ["status", "statusText", "headers"].forEach((prop) => {
- options2[prop] = response[prop];
- });
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
- responseContentLength,
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
- ) || [];
- response = new Response(
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
- flush && flush();
- unsubscribe && unsubscribe();
- }),
- options2
- );
- }
- responseType = responseType || "text";
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config2);
- !isStreamResponse && unsubscribe && unsubscribe();
- return await new Promise((resolve, reject) => {
- settle(resolve, reject, {
- data: responseData,
- headers: AxiosHeaders$1.from(response.headers),
- status: response.status,
- statusText: response.statusText,
- config: config2,
- request: request2
- });
- });
- } catch (err) {
- unsubscribe && unsubscribe();
- if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
- throw Object.assign(
- new AxiosError("Network Error", AxiosError.ERR_NETWORK, config2, request2),
- {
- cause: err.cause || err
- }
- );
- }
- throw AxiosError.from(err, err && err.code, config2, request2);
- }
- });
- const knownAdapters = {
- http: httpAdapter,
- xhr: xhrAdapter,
- fetch: fetchAdapter
- };
- utils$1.forEach(knownAdapters, (fn, value) => {
- if (fn) {
- try {
- Object.defineProperty(fn, "name", { value });
- } catch (e2) {
- }
- Object.defineProperty(fn, "adapterName", { value });
- }
- });
- const renderReason = (reason) => `- ${reason}`;
- const isResolvedHandle = (adapter2) => utils$1.isFunction(adapter2) || adapter2 === null || adapter2 === false;
- const adapters = {
- getAdapter: (adapters2) => {
- adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
- const { length } = adapters2;
- let nameOrAdapter;
- let adapter2;
- const rejectedReasons = {};
- for (let i2 = 0; i2 < length; i2++) {
- nameOrAdapter = adapters2[i2];
- let id;
- adapter2 = nameOrAdapter;
- if (!isResolvedHandle(nameOrAdapter)) {
- adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
- if (adapter2 === void 0) {
- throw new AxiosError(`Unknown adapter '${id}'`);
- }
- }
- if (adapter2) {
- break;
- }
- rejectedReasons[id || "#" + i2] = adapter2;
- }
- if (!adapter2) {
- const reasons = Object.entries(rejectedReasons).map(
- ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
- );
- let s2 = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
- throw new AxiosError(
- `There is no suitable adapter to dispatch the request ` + s2,
- "ERR_NOT_SUPPORT"
- );
- }
- return adapter2;
- },
- adapters: knownAdapters
- };
- function throwIfCancellationRequested(config2) {
- if (config2.cancelToken) {
- config2.cancelToken.throwIfRequested();
- }
- if (config2.signal && config2.signal.aborted) {
- throw new CanceledError(null, config2);
- }
- }
- function dispatchRequest(config2) {
- throwIfCancellationRequested(config2);
- config2.headers = AxiosHeaders$1.from(config2.headers);
- config2.data = transformData.call(
- config2,
- config2.transformRequest
- );
- if (["post", "put", "patch"].indexOf(config2.method) !== -1) {
- config2.headers.setContentType("application/x-www-form-urlencoded", false);
- }
- const adapter2 = adapters.getAdapter(config2.adapter || defaults$1.adapter);
- return adapter2(config2).then(function onAdapterResolution(response) {
- throwIfCancellationRequested(config2);
- response.data = transformData.call(
- config2,
- config2.transformResponse,
- response
- );
- response.headers = AxiosHeaders$1.from(response.headers);
- return response;
- }, function onAdapterRejection(reason) {
- if (!isCancel(reason)) {
- throwIfCancellationRequested(config2);
- if (reason && reason.response) {
- reason.response.data = transformData.call(
- config2,
- config2.transformResponse,
- reason.response
- );
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
- }
- }
- return Promise.reject(reason);
- });
- }
- const VERSION = "1.7.7";
- const validators$1 = {};
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i2) => {
- validators$1[type] = function validator2(thing) {
- return typeof thing === type || "a" + (i2 < 1 ? "n " : " ") + type;
- };
- });
- const deprecatedWarnings = {};
- validators$1.transitional = function transitional(validator2, version, message) {
- function formatMessage2(opt, desc) {
- return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
- }
- return (value, opt, opts) => {
- if (validator2 === false) {
- throw new AxiosError(
- formatMessage2(opt, " has been removed" + (version ? " in " + version : "")),
- AxiosError.ERR_DEPRECATED
- );
- }
- if (version && !deprecatedWarnings[opt]) {
- deprecatedWarnings[opt] = true;
- formatAppLog(
- "warn",
- "at node_modules/axios/lib/helpers/validator.js:43",
- formatMessage2(
- opt,
- " has been deprecated since v" + version + " and will be removed in the near future"
- )
- );
- }
- return validator2 ? validator2(value, opt, opts) : true;
- };
- };
- function assertOptions(options2, schema, allowUnknown) {
- if (typeof options2 !== "object") {
- throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
- }
- const keys = Object.keys(options2);
- let i2 = keys.length;
- while (i2-- > 0) {
- const opt = keys[i2];
- const validator2 = schema[opt];
- if (validator2) {
- const value = options2[opt];
- const result2 = value === void 0 || validator2(value, opt, options2);
- if (result2 !== true) {
- throw new AxiosError("option " + opt + " must be " + result2, AxiosError.ERR_BAD_OPTION_VALUE);
- }
- continue;
- }
- if (allowUnknown !== true) {
- throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
- }
- }
- }
- const validator = {
- assertOptions,
- validators: validators$1
- };
- const validators = validator.validators;
- class Axios {
- constructor(instanceConfig) {
- this.defaults = instanceConfig;
- this.interceptors = {
- request: new InterceptorManager(),
- response: new InterceptorManager()
- };
- }
- /**
- * Dispatch a request
- *
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
- * @param {?Object} config
- *
- * @returns {Promise} The Promise to be fulfilled
- */
- async request(configOrUrl, config2) {
- try {
- return await this._request(configOrUrl, config2);
- } catch (err) {
- if (err instanceof Error) {
- let dummy;
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
- try {
- if (!err.stack) {
- err.stack = stack;
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
- err.stack += "\n" + stack;
- }
- } catch (e2) {
- }
- }
- throw err;
- }
- }
- _request(configOrUrl, config2) {
- if (typeof configOrUrl === "string") {
- config2 = config2 || {};
- config2.url = configOrUrl;
- } else {
- config2 = configOrUrl || {};
- }
- config2 = mergeConfig(this.defaults, config2);
- const { transitional, paramsSerializer, headers } = config2;
- if (transitional !== void 0) {
- validator.assertOptions(transitional, {
- silentJSONParsing: validators.transitional(validators.boolean),
- forcedJSONParsing: validators.transitional(validators.boolean),
- clarifyTimeoutError: validators.transitional(validators.boolean)
- }, false);
- }
- if (paramsSerializer != null) {
- if (utils$1.isFunction(paramsSerializer)) {
- config2.paramsSerializer = {
- serialize: paramsSerializer
- };
- } else {
- validator.assertOptions(paramsSerializer, {
- encode: validators.function,
- serialize: validators.function
- }, true);
- }
- }
- config2.method = (config2.method || this.defaults.method || "get").toLowerCase();
- let contextHeaders = headers && utils$1.merge(
- headers.common,
- headers[config2.method]
- );
- headers && utils$1.forEach(
- ["delete", "get", "head", "post", "put", "patch", "common"],
- (method) => {
- delete headers[method];
- }
- );
- config2.headers = AxiosHeaders$1.concat(contextHeaders, headers);
- const requestInterceptorChain = [];
- let synchronousRequestInterceptors = true;
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) {
- return;
- }
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
- });
- const responseInterceptorChain = [];
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
- });
- let promise;
- let i2 = 0;
- let len;
- if (!synchronousRequestInterceptors) {
- const chain = [dispatchRequest.bind(this), void 0];
- chain.unshift.apply(chain, requestInterceptorChain);
- chain.push.apply(chain, responseInterceptorChain);
- len = chain.length;
- promise = Promise.resolve(config2);
- while (i2 < len) {
- promise = promise.then(chain[i2++], chain[i2++]);
- }
- return promise;
- }
- len = requestInterceptorChain.length;
- let newConfig = config2;
- i2 = 0;
- while (i2 < len) {
- const onFulfilled = requestInterceptorChain[i2++];
- const onRejected = requestInterceptorChain[i2++];
- try {
- newConfig = onFulfilled(newConfig);
- } catch (error2) {
- onRejected.call(this, error2);
- break;
- }
- }
- try {
- promise = dispatchRequest.call(this, newConfig);
- } catch (error2) {
- return Promise.reject(error2);
- }
- i2 = 0;
- len = responseInterceptorChain.length;
- while (i2 < len) {
- promise = promise.then(responseInterceptorChain[i2++], responseInterceptorChain[i2++]);
- }
- return promise;
- }
- getUri(config2) {
- config2 = mergeConfig(this.defaults, config2);
- const fullPath = buildFullPath(config2.baseURL, config2.url);
- return buildURL(fullPath, config2.params, config2.paramsSerializer);
- }
- }
- utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
- Axios.prototype[method] = function(url2, config2) {
- return this.request(mergeConfig(config2 || {}, {
- method,
- url: url2,
- data: (config2 || {}).data
- }));
- };
- });
- utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
- function generateHTTPMethod(isForm) {
- return function httpMethod(url2, data, config2) {
- return this.request(mergeConfig(config2 || {}, {
- method,
- headers: isForm ? {
- "Content-Type": "multipart/form-data"
- } : {},
- url: url2,
- data
- }));
- };
- }
- Axios.prototype[method] = generateHTTPMethod();
- Axios.prototype[method + "Form"] = generateHTTPMethod(true);
- });
- const Axios$1 = Axios;
- class CancelToken {
- constructor(executor) {
- if (typeof executor !== "function") {
- throw new TypeError("executor must be a function.");
- }
- let resolvePromise;
- this.promise = new Promise(function promiseExecutor(resolve) {
- resolvePromise = resolve;
- });
- const token = this;
- this.promise.then((cancel) => {
- if (!token._listeners)
- return;
- let i2 = token._listeners.length;
- while (i2-- > 0) {
- token._listeners[i2](cancel);
- }
- token._listeners = null;
- });
- this.promise.then = (onfulfilled) => {
- let _resolve;
- const promise = new Promise((resolve) => {
- token.subscribe(resolve);
- _resolve = resolve;
- }).then(onfulfilled);
- promise.cancel = function reject() {
- token.unsubscribe(_resolve);
- };
- return promise;
- };
- executor(function cancel(message, config2, request2) {
- if (token.reason) {
- return;
- }
- token.reason = new CanceledError(message, config2, request2);
- resolvePromise(token.reason);
- });
- }
- /**
- * Throws a `CanceledError` if cancellation has been requested.
- */
- throwIfRequested() {
- if (this.reason) {
- throw this.reason;
- }
- }
- /**
- * Subscribe to the cancel signal
- */
- subscribe(listener) {
- if (this.reason) {
- listener(this.reason);
- return;
- }
- if (this._listeners) {
- this._listeners.push(listener);
- } else {
- this._listeners = [listener];
- }
- }
- /**
- * Unsubscribe from the cancel signal
- */
- unsubscribe(listener) {
- if (!this._listeners) {
- return;
- }
- const index2 = this._listeners.indexOf(listener);
- if (index2 !== -1) {
- this._listeners.splice(index2, 1);
- }
- }
- toAbortSignal() {
- const controller = new AbortController();
- const abort = (err) => {
- controller.abort(err);
- };
- this.subscribe(abort);
- controller.signal.unsubscribe = () => this.unsubscribe(abort);
- return controller.signal;
- }
- /**
- * Returns an object that contains a new `CancelToken` and a function that, when called,
- * cancels the `CancelToken`.
- */
- static source() {
- let cancel;
- const token = new CancelToken(function executor(c2) {
- cancel = c2;
- });
- return {
- token,
- cancel
- };
- }
- }
- const CancelToken$1 = CancelToken;
- function spread(callback) {
- return function wrap(arr) {
- return callback.apply(null, arr);
- };
- }
- function isAxiosError(payload) {
- return utils$1.isObject(payload) && payload.isAxiosError === true;
- }
- const HttpStatusCode = {
- Continue: 100,
- SwitchingProtocols: 101,
- Processing: 102,
- EarlyHints: 103,
- Ok: 200,
- Created: 201,
- Accepted: 202,
- NonAuthoritativeInformation: 203,
- NoContent: 204,
- ResetContent: 205,
- PartialContent: 206,
- MultiStatus: 207,
- AlreadyReported: 208,
- ImUsed: 226,
- MultipleChoices: 300,
- MovedPermanently: 301,
- Found: 302,
- SeeOther: 303,
- NotModified: 304,
- UseProxy: 305,
- Unused: 306,
- TemporaryRedirect: 307,
- PermanentRedirect: 308,
- BadRequest: 400,
- Unauthorized: 401,
- PaymentRequired: 402,
- Forbidden: 403,
- NotFound: 404,
- MethodNotAllowed: 405,
- NotAcceptable: 406,
- ProxyAuthenticationRequired: 407,
- RequestTimeout: 408,
- Conflict: 409,
- Gone: 410,
- LengthRequired: 411,
- PreconditionFailed: 412,
- PayloadTooLarge: 413,
- UriTooLong: 414,
- UnsupportedMediaType: 415,
- RangeNotSatisfiable: 416,
- ExpectationFailed: 417,
- ImATeapot: 418,
- MisdirectedRequest: 421,
- UnprocessableEntity: 422,
- Locked: 423,
- FailedDependency: 424,
- TooEarly: 425,
- UpgradeRequired: 426,
- PreconditionRequired: 428,
- TooManyRequests: 429,
- RequestHeaderFieldsTooLarge: 431,
- UnavailableForLegalReasons: 451,
- InternalServerError: 500,
- NotImplemented: 501,
- BadGateway: 502,
- ServiceUnavailable: 503,
- GatewayTimeout: 504,
- HttpVersionNotSupported: 505,
- VariantAlsoNegotiates: 506,
- InsufficientStorage: 507,
- LoopDetected: 508,
- NotExtended: 510,
- NetworkAuthenticationRequired: 511
- };
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
- HttpStatusCode[value] = key;
- });
- const HttpStatusCode$1 = HttpStatusCode;
- function createInstance(defaultConfig) {
- const context = new Axios$1(defaultConfig);
- const instance = bind(Axios$1.prototype.request, context);
- utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
- utils$1.extend(instance, context, null, { allOwnKeys: true });
- instance.create = function create(instanceConfig) {
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
- };
- return instance;
- }
- const axios = createInstance(defaults$1);
- axios.Axios = Axios$1;
- axios.CanceledError = CanceledError;
- axios.CancelToken = CancelToken$1;
- axios.isCancel = isCancel;
- axios.VERSION = VERSION;
- axios.toFormData = toFormData;
- axios.AxiosError = AxiosError;
- axios.Cancel = axios.CanceledError;
- axios.all = function all(promises) {
- return Promise.all(promises);
- };
- axios.spread = spread;
- axios.isAxiosError = isAxiosError;
- axios.mergeConfig = mergeConfig;
- axios.AxiosHeaders = AxiosHeaders$1;
- axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
- axios.getAdapter = adapters.getAdapter;
- axios.HttpStatusCode = HttpStatusCode$1;
- axios.default = axios;
- const axios$1 = axios;
- const _sfc_main$d = {
- __name: "result",
- setup(__props, { expose: __expose }) {
- __expose();
- const order2 = vue.ref({});
- const result2 = vue.ref({});
- const url2 = vue.ref("https://payapp.weixin.qq.com");
- const getQueryVal = () => {
- const queryStr = window.location.href.split("?")[1];
- const strArr = queryStr.split("&");
- if (strArr.length) {
- strArr.forEach((val) => {
- const subStrArr = val.split("=");
- result2.value[subStrArr[0]] = subStrArr[1];
- });
- }
- };
- const showCustomPage = () => {
- formatAppLog("log", "at pages/pay/result.vue:101", "showCustomPage");
- const customData = JSON.stringify({
- action: "onIframeReady",
- displayStyle: "SHOW_CUSTOM_PAGE"
- // height: 900
- });
- parent.postMessage(customData, url2.value);
- };
- const state = vue.reactive({
- id: 0,
- // 支付单号
- orderType: "goods",
- // 订单类型
- result: "unpaid",
- // 支付状态
- orderInfo: {},
- // 支付订单信息
- tradeOrder: {},
- // 商品订单信息,只有在 orderType 为 goods 才会请求。目的:【我的拼团】按钮的展示
- counter: 0
- // 获取结果次数
- });
- const payResult = vue.computed(() => {
- if (state.result === "unpaid") {
- return "waiting";
- }
- if (state.result === "paid") {
- return "success";
- }
- if (state.result === "failed") {
- return "failed";
- }
- if (state.result === "closed") {
- return "closed";
- }
- });
- const isTopUp = vue.computed(() => {
- return result2.value.out_trade_no.includes("top-up");
- });
- async function getOrderInfo(payOrderNo) {
- state.counter++;
- const {
- data,
- code: code2
- } = await PayOrderApi.getFuYouPayOrderByStatus(payOrderNo);
- if (code2 === 0) {
- state.orderInfo = data;
- if (!state.orderInfo || state.orderInfo.status === 30) {
- state.result = "closed";
- return;
- }
- if (state.orderInfo.status !== 0) {
- state.result = "paid";
- return;
- }
- }
- if (state.counter < 3 && state.result === "unpaid") {
- setTimeout(() => {
- getOrderInfo(payOrderNo);
- }, 1500);
- }
- if (state.counter >= 3) {
- state.result = "failed";
- }
- }
- vue.onMounted(async () => {
- await showCustomPage();
- await getQueryVal();
- await getOrderInfo(result2.value.out_trade_no);
- });
- const goBack = () => {
- const mchData = {
- action: "jumpOut",
- jumpOutUrl: `${location.origin}/#/pages/index/index?points=${state.orderInfo.jf}&socialStatus=${state.orderInfo.sj}`
- };
- formatAppLog("log", "at pages/pay/result.vue:212", mchData.jumpOutUrl);
- const postData = JSON.stringify(mchData);
- parent.postMessage(postData, url2.value);
- };
- const goOrderList = () => {
- formatAppLog("log", "at pages/pay/result.vue:218", state.orderInfo);
- const mchData = {
- action: "jumpOut",
- jumpOutUrl: `${location.origin}/#/pages/order/list?type=2&points=${state.orderInfo.jf}&socialStatus=${state.orderInfo.sj}`
- };
- formatAppLog("log", "at pages/pay/result.vue:223", mchData.jumpOutUrl);
- const postData = JSON.stringify(mchData);
- parent.postMessage(postData, url2.value);
- };
- const goWallet = () => {
- const mchData = {
- action: "jumpOut",
- jumpOutUrl: `${location.origin}/#/pages/user/wallet/score`
- };
- const postData = JSON.stringify(mchData);
- parent.postMessage(postData, url2.value);
- };
- const __returned__ = { order: order2, result: result2, url: url2, getQueryVal, showCustomPage, state, payResult, isTopUp, getOrderInfo, goBack, goOrderList, goWallet, ref: vue.ref, onMounted: vue.onMounted, reactive: vue.reactive, computed: vue.computed, watchEffect: vue.watchEffect, get axios() {
- return axios$1;
- }, get onLoad() {
- return onLoad;
- }, get onHide() {
- return onHide;
- }, get onShow() {
- return onShow;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, get sheep() {
- return sheep$1;
- }, get PayOrderApi() {
- return PayOrderApi;
- }, get fen2yuan() {
- return fen2yuan;
- }, get OrderApi() {
- return OrderApi;
- }, get showWalletModal() {
- return showWalletModal;
- }, get colseWalletModal() {
- return colseWalletModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" result:{{result}} "),
- vue.createElementVNode("view", { class: "pay-result-box ss-flex-col ss-row-center ss-col-center" }, [
- vue.createCommentVNode(" 信息展示 "),
- $setup.payResult === "waiting" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "pay-waiting ss-m-b-30"
- })) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "success" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- class: "pay-img ss-m-b-30",
- src: $setup.sheep.$url.static("/static/images/order_pay_success.gif")
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- ["failed", "closed"].includes($setup.payResult) ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 2,
- class: "pay-img ss-m-b-30",
- src: $setup.sheep.$url.static("/static/images/order_paty_fail.gif")
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "success" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 3,
- class: "tip-text ss-m-b-30"
- },
- vue.toDisplayString($setup.t("order.payment_successful")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "failed" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 4,
- class: "tip-text ss-m-b-30"
- },
- vue.toDisplayString($setup.t("order.payment_failed")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "closed" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 5,
- class: "tip-text ss-m-b-30"
- },
- vue.toDisplayString($setup.t("order.order_closed")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "waiting" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 6,
- class: "tip-text ss-m-b-30"
- },
- vue.toDisplayString($setup.t("order.checking_payment_result")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "success" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 7,
- class: "pay-total-num ss-flex"
- }, [
- vue.createElementVNode(
- "view",
- null,
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.price)),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 操作区 "),
- vue.createElementVNode("view", { class: "btn-box ss-flex ss-row-center ss-m-t-50" }, [
- vue.createElementVNode(
- "button",
- {
- class: "back-btn ss-reset-button",
- onClick: $setup.goBack
- },
- vue.toDisplayString($setup.t("order.return_home")),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(` <button class="check-btn ss-reset-button" v-if="payResult === 'failed'" @tap="
- sheep.$router.redirect('/pages/pay/index', { id: state.id, orderType: state.orderType })
- ">
- {{ t('order.retry_payment') }}
- </button> `),
- $setup.payResult === "success" && !$setup.isTopUp ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "check-btn ss-reset-button",
- onClick: $setup.goOrderList
- },
- vue.toDisplayString($setup.t("order.view_order")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "success" && $setup.isTopUp ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "check-btn ss-reset-button",
- onClick: $setup.goWallet
- },
- vue.toDisplayString($setup.t("order.view_wallet")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" TODO 非繁人:拼团接入 "),
- vue.createCommentVNode(` <button class="check-btn ss-reset-button" v-if="payResult === 'success' && state.tradeOrder.type === 3"
- @tap="sheep.$router.redirect('/pages/activity/groupon/order')">
- {{ t('order.my_group_buying') }}
- </button> `)
- ]),
- vue.createCommentVNode(" TODO 非繁人:订阅 ")
- ])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesPayResult = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c], ["__scopeId", "data-v-42b1ec48"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/pay/result.vue"]]);
- const _sfc_main$c = {
- __name: "resultYuan",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- id: 0,
- // 支付单号
- orderType: "goods",
- // 订单类型
- result: "unpaid",
- // 支付状态
- orderInfo: {},
- // 支付订单信息
- tradeOrder: {},
- // 商品订单信息,只有在 orderType 为 goods 才会请求。目的:【我的拼团】按钮的展示
- counter: 0
- // 获取结果次数
- });
- const payResult = vue.computed(() => {
- if (state.result === "unpaid") {
- return "waiting";
- }
- if (state.result === "paid") {
- return "success";
- }
- if (state.result === "failed") {
- return "failed";
- }
- if (state.result === "closed") {
- return "closed";
- }
- });
- vue.watchEffect(() => {
- if (payResult.value == "success") {
- showWalletModal({ points: state.orderInfo.jf, socialStatus: state.orderInfo.sj });
- }
- });
- async function getOrderInfo(id) {
- state.counter++;
- const {
- data,
- code: code2
- } = await PayOrderApi.getByStatus2(id);
- if (code2 === 0) {
- state.orderInfo = data;
- if (!state.orderInfo || state.orderInfo.status === 30) {
- state.result = "closed";
- return;
- }
- if (state.orderInfo.status !== 0) {
- state.result = "paid";
- return;
- }
- }
- if (state.counter < 3 && state.result === "unpaid") {
- setTimeout(() => {
- getOrderInfo(id);
- }, 1500);
- }
- if (state.counter >= 3) {
- state.result = "failed";
- }
- }
- function onOrder() {
- if (state.orderType === "recharge") {
- sheep$1.$router.redirect("/pages/pay/recharge-log");
- } else {
- sheep$1.$router.redirect("/pages/order/list", { type: 2 });
- }
- }
- const isTopUp = vue.computed(() => {
- return state.orderInfo.no.includes("top-up");
- });
- onLoad(async (options2) => {
- if (options2.id) {
- state.id = options2.id;
- }
- if (options2.orderType) {
- state.orderType = options2.orderType;
- }
- if (options2.payRes) {
- state.payState = "success";
- state.orderInfo = JSON.parse(options2.payRes);
- state.result = "paid";
- } else {
- await getOrderInfo(state.id);
- }
- });
- onShow(() => {
- if (lodashExports.isEmpty(state.orderInfo) || state.payState === "success") {
- return;
- }
- getOrderInfo(state.id);
- });
- onHide(() => {
- state.result = "unpaid";
- state.counter = 0;
- });
- const __returned__ = { state, payResult, getOrderInfo, onOrder, isTopUp, get onLoad() {
- return onLoad;
- }, get onHide() {
- return onHide;
- }, get onShow() {
- return onShow;
- }, reactive: vue.reactive, computed: vue.computed, watchEffect: vue.watchEffect, get isEmpty() {
- return lodashExports.isEmpty;
- }, get sheep() {
- return sheep$1;
- }, get PayOrderApi() {
- return PayOrderApi;
- }, get fen2yuan() {
- return fen2yuan;
- }, get OrderApi() {
- return OrderApi;
- }, get showWalletModal() {
- return showWalletModal;
- }, get colseWalletModal() {
- return colseWalletModal;
- }, get t() {
- return t$6;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: $setup.t("order.payment_result"),
- bgStyle: { color: "#FFF" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "pay-result-box ss-flex-col ss-row-center ss-col-center" }, [
- vue.createCommentVNode(" 信息展示 "),
- $setup.payResult === "waiting" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "pay-waiting ss-m-b-30"
- })) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "success" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- class: "pay-img ss-m-b-30",
- src: $setup.sheep.$url.static("/static/images/order_pay_success.gif")
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- ["failed", "closed"].includes($setup.payResult) ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 2,
- class: "pay-img ss-m-b-30",
- src: $setup.sheep.$url.static("/static/images/order_paty_fail.gif")
- }, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "success" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 3,
- class: "tip-text ss-m-b-30"
- },
- vue.toDisplayString($setup.t("order.payment_successful")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "failed" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 4,
- class: "tip-text ss-m-b-30"
- },
- vue.toDisplayString($setup.t("order.payment_failed")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "closed" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 5,
- class: "tip-text ss-m-b-30"
- },
- vue.toDisplayString($setup.t("order.order_closed")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "waiting" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 6,
- class: "tip-text ss-m-b-30"
- },
- vue.toDisplayString($setup.t("order.checking_payment_result")) + "...",
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "success" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 7,
- class: "pay-total-num ss-flex"
- }, [
- vue.createElementVNode(
- "view",
- null,
- "¥" + vue.toDisplayString($setup.fen2yuan($setup.state.orderInfo.price)),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 操作区 "),
- vue.createElementVNode("view", { class: "btn-box ss-flex ss-row-center ss-m-t-50" }, [
- vue.createElementVNode(
- "button",
- {
- class: "back-btn ss-reset-button",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/index/index"))
- },
- vue.toDisplayString($setup.t("order.return_home")),
- 1
- /* TEXT */
- ),
- $setup.payResult === "failed" ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 0,
- class: "check-btn ss-reset-button",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.sheep.$router.redirect("/pages/pay/index", { id: $setup.state.id, orderType: $setup.state.orderType }))
- },
- vue.toDisplayString($setup.t("order.retry_payment")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "success" && !$setup.isTopUp ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 1,
- class: "check-btn ss-reset-button",
- onClick: $setup.onOrder
- },
- vue.toDisplayString($setup.t("order.view_order")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.payResult === "success" && $setup.isTopUp ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 2,
- class: "check-btn ss-reset-button",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.sheep.$router.redirect("/pages/user/wallet/score"))
- },
- vue.toDisplayString($setup.t("order.view_wallet")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" TODO 非繁人:拼团接入 "),
- $setup.payResult === "success" && $setup.state.tradeOrder.type === 3 ? (vue.openBlock(), vue.createElementBlock(
- "button",
- {
- key: 3,
- class: "check-btn ss-reset-button",
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.sheep.$router.redirect("/pages/activity/groupon/order"))
- },
- vue.toDisplayString($setup.t("order.my_group_buying")),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createCommentVNode(" TODO 非繁人:订阅 ")
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesPayResultYuan = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b], ["__scopeId", "data-v-67cd5b50"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/pay/resultYuan.vue"]]);
- const _sfc_main$b = {
- __name: "recharge",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "b0187d83-headerBg": vue.unref(headerBg)
- }));
- const userWallet = vue.computed(() => sheep$1.$store("user").userWallet);
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const headerBg = sheep$1.$url.css("/static/img/shop/user/withdraw_bg.png");
- const state = vue.reactive({
- recharge_money: "",
- // 输入的充值金额
- packageList: []
- });
- function onCard(e2) {
- state.recharge_money = fen2yuan(e2);
- }
- async function getRechargeTabs() {
- const { code: code2, data } = await PayWalletApi.getWalletRechargePackageList();
- if (code2 !== 0) {
- return;
- }
- state.packageList = data;
- }
- async function onConfirm() {
- var _a2;
- const { code: code2, data } = await PayWalletApi.createWalletRecharge({
- packageId: (_a2 = state.packageList.find((item) => fen2yuan(item.payPrice) === state.recharge_money)) == null ? void 0 : _a2.id,
- payPrice: state.recharge_money * 100
- });
- if (code2 !== 0) {
- return;
- }
- sheep$1.$router.go("/pages/pay/index", {
- id: data.payOrderId,
- orderType: "recharge"
- });
- }
- onLoad(() => {
- getRechargeTabs();
- });
- const __returned__ = { userWallet, statusBarHeight, headerBg, state, onCard, getRechargeTabs, onConfirm, computed: vue.computed, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get fen2yuan() {
- return fen2yuan;
- }, get PayWalletApi() {
- return PayWalletApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$l);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: "充值",
- class: "withdraw-wrap",
- navbar: "inner"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "wallet-num-box ss-flex ss-col-center ss-row-between",
- style: vue.normalizeStyle([
- {
- marginTop: "-" + Number($setup.statusBarHeight + 88) + "rpx",
- paddingTop: Number($setup.statusBarHeight + 108) + "rpx"
- }
- ])
- },
- [
- vue.createElementVNode("view", { class: "" }, [
- vue.createElementVNode("view", { class: "num-title" }, "当前余额(元)"),
- vue.createElementVNode(
- "view",
- { class: "wallet-num" },
- vue.toDisplayString($setup.fen2yuan($setup.userWallet.balance)),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("button", {
- class: "ss-reset-button log-btn",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/pay/recharge-log"))
- }, " 充值记录 ")
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "recharge-box" }, [
- vue.createElementVNode("view", { class: "recharge-card-box" }, [
- vue.createElementVNode("view", { class: "input-label ss-m-b-50" }, "充值金额"),
- vue.createElementVNode("view", { class: "input-box ss-flex border-bottom ss-p-b-20" }, [
- vue.createElementVNode("view", { class: "unit" }, "¥"),
- vue.createVNode(_component_uni_easyinput, {
- modelValue: $setup.state.recharge_money,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.state.recharge_money = $event),
- type: "digit",
- placeholder: "请输入充值金额",
- inputBorder: false
- }, null, 8, ["modelValue"])
- ]),
- vue.createElementVNode("view", { class: "face-value-box ss-flex ss-flex-wrap ss-m-y-40" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.packageList, (item) => {
- return vue.openBlock(), vue.createElementBlock("button", {
- class: vue.normalizeClass(["ss-reset-button face-value-btn", [{ "btn-active": $setup.state.recharge_money === $setup.fen2yuan(item.payPrice) }]]),
- key: item.money,
- onClick: ($event) => $setup.onCard(item.payPrice)
- }, [
- vue.createElementVNode(
- "text",
- { class: "face-value-title" },
- vue.toDisplayString($setup.fen2yuan(item.payPrice)),
- 1
- /* TEXT */
- ),
- item.bonusPrice ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "face-value-tag"
- },
- " 送 " + vue.toDisplayString($setup.fen2yuan(item.bonusPrice)) + " 元 ",
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("button", {
- class: "ss-reset-button save-btn ui-BG-Main-Gradient ss-m-t-60 ui-Shadow-Main",
- onClick: $setup.onConfirm
- }, " 确认充值 ")
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesPayRecharge = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a], ["__scopeId", "data-v-b0187d83"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/pay/recharge.vue"]]);
- const _sfc_main$a = {
- __name: "recharge-log",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 5
- },
- loadStatus: ""
- });
- async function getLogList(page2 = 1, list_rows = 5) {
- const { code: code2, data } = await PayWalletApi.getWalletRechargePage({
- pageNo: page2,
- pageSize: list_rows
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getLogList();
- }
- onLoad(() => {
- getLogList();
- });
- onReachBottom(() => {
- loadMore();
- });
- const __returned__ = { state, getLogList, loadMore, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get _() {
- return _$1;
- }, get PayWalletApi() {
- return PayWalletApi;
- }, get sheep() {
- return sheep$1;
- }, get fen2yuan() {
- return fen2yuan;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "widthdraw-log-wrap",
- title: "充值记录"
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 记录卡片 "),
- vue.createElementVNode("view", { class: "wallet-log-box ss-p-b-30" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "log-list",
- key: item
- }, [
- vue.createElementVNode("view", { class: "head ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("view", { class: "title" }, "充值金额"),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["num", item.refundStatus === 10 ? "danger-color" : "success-color"])
- },
- [
- vue.createTextVNode(
- vue.toDisplayString($setup.fen2yuan(item.payPrice)) + " 元 ",
- 1
- /* TEXT */
- ),
- item.bonusPrice > 0 ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 0 },
- "(赠送 " + vue.toDisplayString($setup.fen2yuan(item.bonusPrice)) + " 元)",
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- )
- ]),
- vue.createElementVNode("view", { class: "status-box item ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("view", { class: "item-title" }, "支付状态"),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["status-text", item.refundStatus === 10 ? "danger-color" : "success-color"])
- },
- vue.toDisplayString(item.refundStatus === 10 ? "已退款" : "已支付"),
- 3
- /* TEXT, CLASS */
- )
- ]),
- vue.createElementVNode("view", { class: "time-box item ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("text", { class: "item-title" }, "充值渠道"),
- vue.createElementVNode(
- "view",
- { class: "time ss-ellipsis-1" },
- vue.toDisplayString(item.payChannelName),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "time-box item ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("text", { class: "item-title" }, "充值单号"),
- vue.createElementVNode(
- "view",
- { class: "time" },
- vue.toDisplayString(item.payOrderChannelOrderNo),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "time-box item ss-flex ss-col-center ss-row-between" }, [
- vue.createElementVNode("text", { class: "item-title" }, "充值时间"),
- vue.createElementVNode(
- "view",
- { class: "time" },
- vue.toDisplayString($setup.sheep.$helper.timeFormat(item.payTime, "yyyy-mm-dd hh:MM:ss")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/comment-empty.png",
- text: "暂无充值记录"
- })) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 1,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesPayRechargeLog = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__scopeId", "data-v-fcfe0364"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/pay/recharge-log.vue"]]);
- const _sfc_main$9 = {
- __name: "detail",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "f4b0e588-headerBg": vue.unref(headerBg)
- }));
- const headerBg = sheep$1.$url.css("/static/img/shop/user/withdraw_bg.png");
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const state = vue.reactive({
- data: {},
- // 拼团详情
- loading: true,
- grouponAction: "create",
- showSelectSku: false,
- grouponNum: 0,
- number: 0,
- activity: {},
- combinationHeadId: null
- // 拼团团长编号
- });
- const shareInfo = vue.computed(() => {
- var _a2, _b2, _c;
- if (lodashExports.isEmpty(state.data))
- return {};
- return sheep$1.$platform.share.getShareInfo(
- {
- title: state.data.headRecord.spuName,
- image: sheep$1.$url.cdn(state.data.headRecord.picUrl),
- desc: (_a2 = state.data.goods) == null ? void 0 : _a2.subtitle,
- params: {
- page: "5",
- query: state.data.id
- }
- },
- {
- type: "groupon",
- // 邀请拼团海报
- title: state.data.headRecord.spuName,
- // 商品标题
- image: sheep$1.$url.cdn(state.data.headRecord.picUrl),
- // 商品主图
- price: (_b2 = state.data.goods) == null ? void 0 : _b2.price,
- // 商品价格
- original_price: (_c = state.data.goods) == null ? void 0 : _c.original_price
- // 商品原价
- }
- );
- });
- function onDetail(orderId) {
- sheep$1.$router.go("/pages/order/detail", {
- id: orderId
- });
- }
- function onCreateGroupon() {
- state.grouponAction = "create";
- state.grouponId = 0;
- state.showSelectSku = true;
- }
- function onSkuChange(e2) {
- state.selectedSkuPrice = e2;
- }
- function onJoinGroupon() {
- state.grouponAction = "join";
- state.grouponId = state.data.activityId;
- state.combinationHeadId = state.data.id;
- state.grouponNum = state.data.num;
- state.showSelectSku = true;
- }
- function onBuy(sku) {
- sheep$1.$router.go("/pages/order/confirm", {
- data: JSON.stringify({
- order_type: "goods",
- combinationActivityId: state.data.activity.id,
- combinationHeadId: state.combinationHeadId,
- items: [
- {
- skuId: sku.id,
- count: sku.count
- }
- ]
- })
- });
- }
- const endTime = vue.computed(() => {
- return useDurationTime(state.data.headRecord.expireTime);
- });
- async function getGrouponDetail(id) {
- const { code: code2, data } = await CombinationApi.getCombinationRecordDetail(id);
- if (code2 === 0) {
- state.data = data;
- const remainNumber = Number(state.data.headRecord.userSize - state.data.headRecord.userCount);
- state.remainNumber = remainNumber > 0 ? remainNumber : 0;
- const { data: activity } = await CombinationApi.getCombinationActivity(data.headRecord.activityId);
- state.activity = activity;
- } else {
- state.data = null;
- }
- state.loading = false;
- }
- function onShare() {
- showShareModal();
- }
- onLoad((options2) => {
- getGrouponDetail(options2.id);
- });
- const __returned__ = { headerBg, statusBarHeight, state, shareInfo, onDetail, onCreateGroupon, onSkuChange, onJoinGroupon, onBuy, endTime, getGrouponDetail, onShare, computed: vue.computed, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get useDurationTime() {
- return useDurationTime;
- }, get showShareModal() {
- return showShareModal;
- }, get isEmpty() {
- return lodashExports.isEmpty;
- }, get CombinationApi() {
- return CombinationApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_s_select_groupon_sku = resolveEasycom(vue.resolveDynamicComponent("s-select-groupon-sku"), __easycom_1$1);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- title: "拼团详情",
- class: "detail-wrap",
- navbar: $setup.state.data && !$setup.state.loading ? "inner" : "normal",
- onShareAppMessage: $setup.shareInfo
- }, {
- default: vue.withCtx(() => [
- $setup.state.loading ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 })) : vue.createCommentVNode("v-if", true),
- $setup.state.data && !$setup.state.loading ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- vue.createCommentVNode(" 团长信息 + 活动信息 "),
- $setup.state.data.headRecord ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "recharge-box",
- style: vue.normalizeStyle([
- {
- marginTop: "-" + Number($setup.statusBarHeight + 88) + "rpx",
- paddingTop: Number($setup.statusBarHeight + 108) + "rpx"
- }
- ])
- },
- [
- vue.createVNode(_component_s_goods_item, {
- class: "goods-box",
- img: $setup.state.data.headRecord.picUrl,
- title: $setup.state.data.headRecord.spuName,
- price: $setup.state.data.headRecord.combinationPrice,
- priceColor: "#E1212B",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.sheep.$router.go("/pages/goods/groupon", {
- id: $setup.state.data.headRecord.activityId
- })),
- style: vue.normalizeStyle([{ top: Number($setup.statusBarHeight + 108) + "rpx" }])
- }, {
- groupon: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode(
- "view",
- { class: "sales-title" },
- vue.toDisplayString($setup.state.data.headRecord.userSize) + "人团",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "num-title ss-m-l-20" },
- "已拼" + vue.toDisplayString($setup.state.data.headRecord.userCount) + "件",
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["img", "title", "price", "style"])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "countdown-box detail-card ss-p-t-44 ss-flex-col ss-col-center" }, [
- vue.createCommentVNode(" 情况一:拼团成功 "),
- $setup.state.data.headRecord.status === 1 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- $setup.state.data.orderId ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createElementVNode("view", { class: "countdown-title ss-flex" }, [
- vue.createElementVNode("text", { class: "cicon-check-round" }),
- vue.createTextVNode(" 恭喜您~拼团成功 ")
- ])
- ])) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- vue.createElementVNode("view", { class: "countdown-title ss-flex" }, [
- vue.createElementVNode("text", { class: "cicon-info" }),
- vue.createTextVNode(" 抱歉~该团已满员 ")
- ])
- ]))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 情况二:拼团失败 "),
- $setup.state.data.headRecord.status === 2 ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- vue.createElementVNode("view", { class: "countdown-title ss-flex" }, [
- vue.createElementVNode("text", { class: "cicon-info" }),
- vue.createTextVNode(
- " " + vue.toDisplayString($setup.state.data.orderId ? "拼团超时,已自动退款" : "该团已解散"),
- 1
- /* TEXT */
- )
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 情况三:拼团进行中 "),
- $setup.state.data.headRecord.status === 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 2 }, [
- $setup.state.data.headRecord.expireTime <= (/* @__PURE__ */ new Date()).getTime() ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createElementVNode("view", { class: "countdown-title ss-flex" }, [
- vue.createElementVNode("text", { class: "cicon-info" }),
- vue.createTextVNode(" 拼团已结束,请关注下次活动 ")
- ])
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "countdown-title ss-flex"
- }, [
- vue.createTextVNode(" 还差 "),
- vue.createElementVNode(
- "view",
- { class: "num" },
- vue.toDisplayString($setup.state.data.headRecord.userSize - $setup.state.data.headRecord.userCount) + "人",
- 1
- /* TEXT */
- ),
- vue.createTextVNode(" 拼团成功 "),
- vue.createElementVNode("view", { class: "ss-flex countdown-time" }, [
- vue.createElementVNode(
- "view",
- { class: "countdown-h ss-flex ss-row-center" },
- vue.toDisplayString($setup.endTime.h),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-m-x-4" }, ":"),
- vue.createElementVNode(
- "view",
- { class: "countdown-num ss-flex ss-row-center" },
- vue.toDisplayString($setup.endTime.m),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-m-x-4" }, ":"),
- vue.createElementVNode(
- "view",
- { class: "countdown-num ss-flex ss-row-center" },
- vue.toDisplayString($setup.endTime.s),
- 1
- /* TEXT */
- )
- ])
- ]))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 拼团的记录列表,展示每个参团人 "),
- vue.createElementVNode("view", { class: "ss-m-t-60 ss-flex ss-flex-wrap ss-row-center" }, [
- vue.createCommentVNode(" 团长 "),
- vue.createElementVNode("view", { class: "header-avatar ss-m-r-24 ss-m-b-20" }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.cdn($setup.state.data.headRecord.avatar),
- class: "avatar-img"
- }, null, 8, ["src"]),
- vue.createElementVNode("view", { class: "header-tag ss-flex ss-col-center ss-row-center" }, "团长")
- ]),
- vue.createCommentVNode(" 团员 "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.data.memberRecords, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "header-avatar ss-m-r-24 ss-m-b-20",
- key: item.id
- }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.cdn(item.avatar),
- class: "avatar-img"
- }, null, 8, ["src"]),
- item.is_leader == "1" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "header-tag ss-flex ss-col-center ss-row-center"
- }, " 团长 ")) : vue.createCommentVNode("v-if", true)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createCommentVNode(" 还有几个坑位 "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.remainNumber, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "default-avatar ss-m-r-24 ss-m-b-20",
- key: item
- }, [
- vue.createElementVNode("image", {
- src: $setup.sheep.$url.static("/static/images/unknown.png"),
- class: "avatar-img"
- }, null, 8, ["src"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]),
- vue.createCommentVNode(" 情况一:拼团成功;情况二:拼团失败 "),
- $setup.state.data.headRecord.status === 1 || $setup.state.data.headRecord.status === 2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "ss-m-t-40 ss-flex ss-row-center"
- }, [
- $setup.state.data.orderId ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "ss-reset-button order-btn",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.onDetail($setup.state.data.orderId))
- }, " 查看订单 ")) : (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button join-btn",
- onClick: $setup.onCreateGroupon
- }, " 我要开团 "))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 情况三:拼团进行中,查看订单或参加或邀请好友或参加 "),
- $setup.state.data.headRecord.status === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "ss-m-t-40 ss-flex ss-row-center"
- }, [
- $setup.state.data.headRecord.expireTime <= (/* @__PURE__ */ new Date()).getTime() ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- $setup.state.data.orderId ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 0,
- class: "ss-reset-button join-btn",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.onDetail($setup.state.data.orderId))
- }, " 查看订单 ")) : (vue.openBlock(), vue.createElementBlock("button", {
- key: 1,
- class: "ss-reset-button disabled-btn",
- disabled: "",
- onClick: _cache[3] || (_cache[3] = ($event) => $setup.onDetail($setup.state.data.orderId))
- }, " 去参团 "))
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "ss-flex ss-row-center"
- }, [
- $setup.state.data.orderId ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button join-btn",
- disabled: $setup.endTime.ms <= 0,
- onClick: $setup.onShare
- }, " 邀请好友来拼团 ", 8, ["disabled"])
- ])) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- vue.createElementVNode("button", {
- class: "ss-reset-button join-btn",
- disabled: $setup.endTime.ms <= 0,
- onClick: _cache[4] || (_cache[4] = ($event) => $setup.onJoinGroupon())
- }, " 立即参团 ", 8, ["disabled"])
- ]))
- ]))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" TODO 非繁人:这里暂时没接入 "),
- $setup.state.data.goods ? (vue.openBlock(), vue.createElementBlock("view", { key: 3 }, [
- vue.createVNode(_component_s_select_groupon_sku, {
- show: $setup.state.showSelectSku,
- goodsInfo: $setup.state.data.goods,
- grouponAction: $setup.state.grouponAction,
- grouponNum: $setup.state.grouponNum,
- onBuy: $setup.onBuy,
- onChange: $setup.onSkuChange,
- onClose: _cache[5] || (_cache[5] = ($event) => $setup.state.showSelectSku = false)
- }, null, 8, ["show", "goodsInfo", "grouponAction", "grouponNum"])
- ])) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true),
- !$setup.state.data && !$setup.state.loading ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 2,
- icon: "/static/goods-empty.png"
- })) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["navbar", "onShareAppMessage"]);
- }
- const PagesActivityGrouponDetail = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__scopeId", "data-v-f4b0e588"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/activity/groupon/detail.vue"]]);
- const _sfc_main$8 = {
- __name: "order",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- currentTab: 0,
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 5
- },
- loadStatus: "",
- deleteOrderId: 0
- });
- const tabMaps = [
- {
- name: "全部"
- },
- {
- name: "进行中",
- value: 0
- },
- {
- name: "拼团成功",
- value: 1
- },
- {
- name: "拼团失败",
- value: 2
- }
- ];
- function onTabsChange(e2) {
- resetPagination(state.pagination);
- state.currentTab = e2.index;
- getGrouponList();
- }
- async function getGrouponList() {
- state.loadStatus = "loading";
- const { code: code2, data } = await CombinationApi.getCombinationRecordPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- status: tabMaps[state.currentTab].value
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- onLoad((options2) => {
- if (options2.type) {
- state.currentTab = options2.type;
- }
- getGrouponList();
- });
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getGrouponList();
- }
- onReachBottom(() => {
- loadMore();
- });
- onPullDownRefresh(() => {
- getGrouponList();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 800);
- });
- const __returned__ = { state, tabMaps, onTabsChange, getGrouponList, loadMore, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get onPullDownRefresh() {
- return onPullDownRefresh;
- }, get sheep() {
- return sheep$1;
- }, get _() {
- return _$1;
- }, get formatOrderColor() {
- return formatOrderColor;
- }, get resetPagination() {
- return resetPagination;
- }, get CombinationApi() {
- return CombinationApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_tabs = resolveEasycom(vue.resolveDynamicComponent("su-tabs"), __easycom_0$a);
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_empty = resolveEasycom(vue.resolveDynamicComponent("s-empty"), __easycom_2$6);
- const _component_s_goods_item = resolveEasycom(vue.resolveDynamicComponent("s-goods-item"), __easycom_3$5);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, { title: "我的拼团" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_sticky, { bgColor: "#fff" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_su_tabs, {
- list: $setup.tabMaps,
- scrollable: false,
- onChange: $setup.onTabsChange,
- current: $setup.state.currentTab
- }, null, 8, ["current"])
- ]),
- _: 1
- /* STABLE */
- }),
- $setup.state.pagination.total === 0 ? (vue.openBlock(), vue.createBlock(_component_s_empty, {
- key: 0,
- icon: "/static/goods-empty.png"
- })) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (record) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "order-list-card-box bg-white ss-r-10 ss-m-t-14 ss-m-20",
- key: record.id
- }, [
- vue.createElementVNode("view", { class: "order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20" }, [
- vue.createElementVNode(
- "view",
- { class: "order-no" },
- "拼团编号:" + vue.toDisplayString(record.id),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["ss-font-26", $setup.formatOrderColor(record)])
- },
- vue.toDisplayString($setup.tabMaps.find((item) => item.value === record.status).name),
- 3
- /* TEXT, CLASS */
- )
- ]),
- vue.createElementVNode("view", { class: "border-bottom" }, [
- vue.createVNode(_component_s_goods_item, {
- img: record.picUrl,
- title: record.spuName,
- price: record.combinationPrice
- }, {
- groupon: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex" }, [
- vue.createElementVNode(
- "view",
- { class: "sales-title" },
- vue.toDisplayString(record.userSize) + " 人团 ",
- 1
- /* TEXT */
- )
- ])
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["img", "title", "price"])
- ]),
- vue.createElementVNode("view", { class: "order-card-footer ss-flex ss-row-right ss-p-x-20" }, [
- vue.createElementVNode("button", {
- class: "detail-btn ss-reset-button",
- onClick: ($event) => $setup.sheep.$router.go("/pages/order/detail", { id: record.orderId })
- }, " 订单详情 ", 8, ["onClick"]),
- vue.createElementVNode("button", {
- class: vue.normalizeClass(["tool-btn ss-reset-button", { "ui-BG-Main-Gradient": record.status === 0 }]),
- onClick: ($event) => $setup.sheep.$router.go("/pages/activity/groupon/detail", { id: record.id })
- }, vue.toDisplayString(record.status === 0 ? "邀请拼团" : "拼团详情"), 11, ["onClick"])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 2,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesActivityGrouponOrder = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__scopeId", "data-v-5be50f68"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/activity/groupon/order.vue"]]);
- const _imports_0 = "/static/activity-left.png";
- const _imports_1 = "/static/activity-right.png";
- const _sfc_main$7 = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- activityId: 0,
- // 获得编号
- activityInfo: {},
- // 获得信息
- pagination: {
- list: [],
- total: 1,
- pageNo: 1,
- pageSize: 8
- },
- loadStatus: "",
- leftGoodsList: [],
- rightGoodsList: []
- });
- let count = 0;
- let leftHeight = 0;
- let rightHeight = 0;
- function mountMasonry(height = 0, where = "left") {
- if (!state.pagination.list[count])
- return;
- if (where === "left") {
- leftHeight += height;
- } else {
- rightHeight += height;
- }
- if (leftHeight <= rightHeight) {
- state.leftGoodsList.push(state.pagination.list[count]);
- } else {
- state.rightGoodsList.push(state.pagination.list[count]);
- }
- count++;
- }
- async function getList() {
- const params = {};
- if (state.activityInfo.productScope === 2) {
- params.ids = state.activityInfo.productSpuIds.join(",");
- } else if (state.activityInfo.productScope === 3) {
- params.categoryIds = state.activityInfo.productSpuIds.join(",");
- }
- state.loadStatus = "loading";
- const { code: code2, data } = await SpuApi.getSpuPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize,
- ...params
- });
- if (code2 !== 0) {
- return;
- }
- state.pagination.list = _$1.concat(state.pagination.list, data.list);
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- mountMasonry();
- }
- async function getActivity(id) {
- const { code: code2, data } = await RewardActivityApi.getRewardActivity(id);
- if (code2 === 0) {
- state.activityInfo = data;
- }
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getList();
- }
- onReachBottom(() => {
- loadMore();
- });
- onLoad(async (options2) => {
- state.activityId = options2.activityId;
- await getActivity(state.activityId);
- await getList(state.activityId);
- });
- const __returned__ = { state, get count() {
- return count;
- }, set count(v2) {
- count = v2;
- }, get leftHeight() {
- return leftHeight;
- }, set leftHeight(v2) {
- leftHeight = v2;
- }, get rightHeight() {
- return rightHeight;
- }, set rightHeight(v2) {
- rightHeight = v2;
- }, mountMasonry, getList, getActivity, loadMore, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get sheep() {
- return sheep$1;
- }, get _() {
- return _$1;
- }, get RewardActivityApi() {
- return RewardActivityApi;
- }, get formatRewardActivityRule() {
- return formatRewardActivityRule;
- }, get SpuApi() {
- return SpuApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_sticky = resolveEasycom(vue.resolveDynamicComponent("su-sticky"), __easycom_0$9);
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- class: "activity-wrap",
- title: $setup.state.activityInfo.title
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" 活动信息 "),
- vue.createVNode(_component_su_sticky, { bgColor: "#fff" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "ss-flex ss-col-top tip-box" }, [
- vue.createElementVNode("view", { class: "type-text ss-flex ss-row-center" }, "满减:"),
- vue.createElementVNode("view", { class: "ss-flex-1" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.activityInfo.rules, (item) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "tip-content",
- key: item
- },
- vue.toDisplayString($setup.formatRewardActivityRule($setup.state.activityInfo, item)),
- 1
- /* TEXT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("image", {
- class: "activity-left-image",
- src: _imports_0
- }),
- vue.createElementVNode("image", {
- class: "activity-right-image",
- src: _imports_1
- })
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(" 商品信息 "),
- vue.createElementVNode("view", { class: "ss-flex ss-flex-wrap ss-p-x-20 ss-m-t-20 ss-col-top" }, [
- vue.createElementVNode("view", { class: "goods-list-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.leftGoodsList, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "left-list",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-md-box",
- size: "md",
- data: item,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id }),
- onGetHeight: _cache[0] || (_cache[0] = ($event) => $setup.mountMasonry($event, "left"))
- }, {
- cart: vue.withCtx(() => [
- vue.createElementVNode("button", { class: "ss-reset-button cart-btn" })
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("view", { class: "goods-list-box" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.rightGoodsList, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "right-list",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_column, {
- class: "goods-md-box",
- size: "md",
- data: item,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/index", { id: item.id }),
- onGetHeight: _cache[1] || (_cache[1] = ($event) => $setup.mountMasonry($event, "right"))
- }, {
- cart: vue.withCtx(() => [
- vue.createElementVNode("button", { class: "ss-reset-button cart-btn" })
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 0,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["title"]);
- }
- const PagesActivityIndex = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__scopeId", "data-v-2c61ebca"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/activity/index.vue"]]);
- const _sfc_main$6 = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "628ec892-headerBg": vue.unref(headerBg)
- }));
- const { safeAreaInsets, safeArea } = sheep$1.$platform.device;
- const sysNavBar = sheep$1.$platform.navbar;
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const pageHeight = (safeArea.height + safeAreaInsets.bottom) * 2 + statusBarHeight - sysNavBar - 350;
- const headerBg = sheep$1.$url.css("/static/img/shop/goods/groupon-header.png");
- const state = vue.reactive({
- pagination: {
- list: [],
- total: 0,
- pageNo: 1,
- pageSize: 10
- },
- loadStatus: "",
- summaryData: {}
- });
- const getSummary = async () => {
- const { data } = await CombinationApi.getCombinationRecordSummary();
- state.summaryData = data;
- };
- async function getList() {
- state.loadStatus = "loading";
- const { data } = await CombinationApi.getCombinationActivityPage({
- pageNo: state.pagination.pageNo,
- pageSize: state.pagination.pageSize
- });
- data.list.forEach((activity) => {
- state.pagination.list.push({ ...activity, price: activity.combinationPrice });
- });
- state.pagination.total = data.total;
- state.loadStatus = state.pagination.list.length < state.pagination.total ? "more" : "noMore";
- }
- function loadMore() {
- if (state.loadStatus === "noMore") {
- return;
- }
- state.pagination.pageNo++;
- getList();
- }
- onReachBottom(() => loadMore());
- onLoad(() => {
- getSummary();
- getList();
- });
- const __returned__ = { safeAreaInsets, safeArea, sysNavBar, statusBarHeight, pageHeight, headerBg, state, getSummary, getList, loadMore, reactive: vue.reactive, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get sheep() {
- return sheep$1;
- }, get CombinationApi() {
- return CombinationApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- navbar: "inner",
- bgStyle: { color: "#FE832A" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "page-bg",
- style: vue.normalizeStyle([{ marginTop: "-" + Number($setup.statusBarHeight + 88) + "rpx" }])
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "list-content" }, [
- vue.createCommentVNode(" 参团会员统计 "),
- vue.createElementVNode("view", { class: "content-header ss-flex-col ss-col-center ss-row-center" }, [
- vue.createElementVNode("view", { class: "content-header-title ss-flex ss-row-center" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.summaryData.avatars, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: index2,
- class: "picture",
- style: vue.normalizeStyle(index2 === 6 ? "position: relative" : "position: static")
- },
- [
- vue.createElementVNode(
- "span",
- {
- class: "avatar",
- style: vue.normalizeStyle(`background-image: url(${item})`)
- },
- null,
- 4
- /* STYLE */
- ),
- index2 === 6 && $setup.state.summaryData.avatars.length > 3 ? (vue.openBlock(), vue.createElementBlock("span", {
- key: 0,
- class: "mengceng"
- }, [
- vue.createElementVNode("i", null, "···")
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode(
- "text",
- { class: "pic_count" },
- vue.toDisplayString($setup.state.summaryData.userCount || 0) + "人参与",
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode(
- "scroll-view",
- {
- class: "scroll-box",
- style: vue.normalizeStyle({ height: $setup.pageHeight + "rpx" }),
- "scroll-y": "true",
- "scroll-with-animation": false,
- "enable-back-to-top": true
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.pagination.list, (item) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "goods-box ss-m-b-20",
- key: item.id
- }, [
- vue.createVNode(_component_s_goods_column, {
- class: "",
- size: "lg",
- data: item,
- grouponTag: true,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/groupon", { id: item.id })
- }, {
- cart: vue.withCtx(() => [
- vue.createElementVNode("button", { class: "ss-reset-button cart-btn" }, "去拼团")
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- $setup.state.pagination.total > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 0,
- status: $setup.state.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ])
- ]),
- _: 1
- /* STABLE */
- });
- }
- const PagesActivityGrouponList = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__scopeId", "data-v-628ec892"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/activity/groupon/list.vue"]]);
- const _sfc_main$5 = {
- name: "AiProgress",
- components: {},
- props: {
- // 进度条的值
- percentage: {
- type: [Number, String],
- required: true
- },
- // 是否内联显示数据
- textInside: {
- type: Boolean,
- default: false
- },
- // 进度条高度
- strokeWidth: {
- type: [Number, String],
- default: 6
- },
- // 默认动画时长
- duration: {
- type: [Number, String],
- default: 2e3
- },
- // 是否有动画
- isAnimate: {
- type: Boolean,
- default: false
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: "linear-gradient(90deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%)"
- },
- // 是否不显示数据
- noData: {
- type: Boolean,
- default: false
- },
- // 是否自定义显示内容
- lineData: {
- type: Boolean,
- default: false
- },
- // 自定义底色
- inBgColor: {
- type: String,
- default: "#ebeef5"
- }
- },
- data() {
- return {
- width: 0,
- timer: null,
- containerWidth: 0,
- contentWidth: 0
- };
- },
- methods: {
- start() {
- if (this.isAnimate) {
- const container = uni.createSelectorQuery().in(this).selectAll("#container");
- uni.createSelectorQuery().in(this).selectAll("#content");
- container.boundingClientRect().exec((res1) => {
- this.contentWidth = res1[0][0].width * 1 * (this.percentage * 1 / 100).toFixed(2) + "px";
- });
- }
- }
- },
- mounted() {
- this.$nextTick(() => {
- this.start();
- });
- },
- created() {
- },
- filters: {},
- computed: {},
- watch: {},
- directives: {}
- };
- function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", null, [
- $props.lineData ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "flex a-center content"
- }, [
- vue.createElementVNode("view", null, [
- vue.renderSlot(_ctx.$slots, "content", {}, void 0, true)
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", {
- class: "flex a-center",
- style: { "padding-right": "10rpx" }
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "progress-container",
- id: "container",
- ref: "progressContainer",
- style: vue.normalizeStyle({ background: $props.inBgColor })
- },
- [
- $props.isAnimate ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "progress-content flex j-end",
- id: "content",
- ref: "progressContent",
- style: vue.normalizeStyle({
- height: $props.strokeWidth + "px",
- background: $props.bgColor,
- width: $data.contentWidth,
- transition: `width ${$props.duration / 1e3}s ease`
- })
- },
- [
- $props.textInside && !$props.noData ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "textInside flex a-center j-center"
- }, [
- vue.createElementVNode(
- "view",
- { class: "text" },
- vue.toDisplayString($props.percentage) + "%",
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- !$props.isAnimate ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "progress-content flex j-end",
- style: vue.normalizeStyle({ width: $props.percentage + "%", height: $props.strokeWidth + "px", background: $props.bgColor })
- },
- [
- $props.textInside && !$props.noData ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "textInside flex a-center j-center"
- }, [
- vue.createElementVNode(
- "view",
- { class: "text" },
- vue.toDisplayString($props.percentage) + "%",
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", null, [
- !$props.textInside && !$props.lineData && !$props.noData && !$props.isAnimate ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "percentage"
- },
- vue.toDisplayString($props.percentage) + "% ",
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ]);
- }
- const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-e717a0ca"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/ui/su-progress/su-progress.vue"]]);
- const _sfc_main$4 = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- vue.useCssVars((_ctx) => ({
- "de8354c5-headerBg": vue.unref(headerBg)
- }));
- const { safeAreaInsets, safeArea } = sheep$1.$platform.device;
- const statusBarHeight = sheep$1.$platform.device.statusBarHeight * 2;
- const pageHeight = (safeArea.height + safeAreaInsets.bottom) * 2 + statusBarHeight - sheep$1.$platform.navbar - 350;
- const headerBg = sheep$1.$url.css("/static/img/shop/goods/seckill-header.png");
- const goodsFields = {
- name: { show: true },
- introduction: { show: true },
- price: { show: true },
- marketPrice: { show: true }
- };
- const timeConfigList = vue.ref([]);
- const getSeckillConfigList = async () => {
- const { data } = await SeckillApi.getSeckillConfigList();
- const now2 = dayjs();
- const today = now2.format("YYYY-MM-DD");
- data.forEach((config2, index2) => {
- const startTime = dayjs(`${today} ${config2.startTime}`);
- const endTime = dayjs(`${today} ${config2.endTime}`);
- if (now2.isBefore(startTime)) {
- config2.status = TimeStatusEnum.WAIT_START;
- } else if (now2.isAfter(endTime)) {
- config2.status = TimeStatusEnum.END;
- } else {
- config2.status = TimeStatusEnum.STARTED;
- activeTimeIndex.value = index2;
- }
- });
- timeConfigList.value = data;
- handleChangeTimeConfig(activeTimeIndex.value);
- scrollToTimeConfig(activeTimeIndex.value);
- };
- const activeTimeElId = vue.ref("");
- const scrollToTimeConfig = (index2) => {
- vue.nextTick(() => activeTimeElId.value = `timeItem${index2}`);
- };
- const activeTimeIndex = vue.ref(0);
- const activeTimeConfig = vue.computed(() => timeConfigList.value[activeTimeIndex.value]);
- const handleChangeTimeConfig = (index2) => {
- activeTimeIndex.value = index2;
- activityPageParams.pageNo = 1;
- activityList.value = [];
- getActivityList();
- };
- const countDown = vue.computed(() => {
- var _a2;
- const endTime = (_a2 = activeTimeConfig.value) == null ? void 0 : _a2.endTime;
- if (endTime) {
- return useDurationTime(`${dayjs().format("YYYY-MM-DD")} ${endTime}`);
- }
- });
- const activityPageParams = vue.reactive({
- id: 0,
- // 时间段 ID
- pageNo: 1,
- // 页码
- pageSize: 5
- // 每页数量
- });
- const activityTotal = vue.ref(0);
- const activityList = vue.ref([]);
- const loadStatus = vue.ref("");
- async function getActivityList() {
- loadStatus.value = "loading";
- const { data } = await SeckillApi.getSeckillActivityPage(activityPageParams);
- data.list.forEach((activity) => {
- activity.percent = parseInt(100 * (activity.totalStock - activity.stock) / activity.totalStock);
- });
- activityList.value = activityList.value.concat(...data.list);
- activityTotal.value = data.total;
- loadStatus.value = activityList.value.length < activityTotal.value ? "more" : "noMore";
- }
- function loadMore() {
- if (loadStatus.value !== "noMore") {
- activityPageParams.pageNo += 1;
- getActivityList();
- }
- }
- onReachBottom(() => loadMore());
- onLoad(async () => {
- await getSeckillConfigList();
- });
- const __returned__ = { safeAreaInsets, safeArea, statusBarHeight, pageHeight, headerBg, goodsFields, timeConfigList, getSeckillConfigList, activeTimeElId, scrollToTimeConfig, activeTimeIndex, activeTimeConfig, handleChangeTimeConfig, countDown, activityPageParams, activityTotal, activityList, loadStatus, getActivityList, loadMore, reactive: vue.reactive, computed: vue.computed, ref: vue.ref, nextTick: vue.nextTick, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get sheep() {
- return sheep$1;
- }, get useDurationTime() {
- return useDurationTime;
- }, get SeckillApi() {
- return SeckillApi;
- }, get dayjs() {
- return dayjs;
- }, get TimeStatusEnum() {
- return TimeStatusEnum;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_su_progress = resolveEasycom(vue.resolveDynamicComponent("su-progress"), __easycom_0$1);
- const _component_s_goods_column = resolveEasycom(vue.resolveDynamicComponent("s-goods-column"), __easycom_1$4);
- const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_2$5);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createBlock(_component_s_layout, {
- navbar: "inner",
- bgStyle: { color: "rgb(245,28,19)" }
- }, {
- default: vue.withCtx(() => {
- var _a2, _b2, _c, _d;
- return [
- vue.createCommentVNode("顶部背景图"),
- vue.createElementVNode(
- "view",
- {
- class: "page-bg",
- style: vue.normalizeStyle([{ marginTop: "-" + Number($setup.statusBarHeight + 88) + "rpx" }])
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 时间段轮播图 "),
- ((_b2 = (_a2 = $setup.activeTimeConfig) == null ? void 0 : _a2.sliderPicUrls) == null ? void 0 : _b2.length) > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "header"
- }, [
- vue.createElementVNode("swiper", {
- "indicator-dots": "true",
- autoplay: "true",
- circular: true,
- interval: "3000",
- duration: "1500",
- "indicator-color": "rgba(255,255,255,0.6)",
- "indicator-active-color": "#fff"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.activeTimeConfig.sliderPicUrls, (picUrl, index2) => {
- return vue.openBlock(), vue.createElementBlock("swiper-item", {
- key: index2,
- class: "borRadius14"
- }, [
- vue.createElementVNode("image", {
- src: picUrl,
- class: "slide-image borRadius14",
- "lazy-load": ""
- }, null, 8, ["src"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 时间段列表 "),
- vue.createElementVNode("view", { class: "flex align-center justify-between ss-p-25" }, [
- vue.createCommentVNode(" 左侧图标 "),
- vue.createElementVNode("view", { class: "time-icon" }, [
- vue.createCommentVNode(" TODO 非繁人:图片统一维护 "),
- vue.createElementVNode("image", {
- class: "ss-w-100 ss-h-100",
- src: "http://mall.yudao.iocoder.cn/static/images/priceTag.png"
- })
- ]),
- vue.createElementVNode("scroll-view", {
- class: "time-list",
- "scroll-into-view": $setup.activeTimeElId,
- "scroll-x": "",
- "scroll-with-animation": ""
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.timeConfigList, (config2, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: vue.normalizeClass(["item", { active: $setup.activeTimeIndex === index2 }]),
- id: `timeItem${index2}`,
- onClick: ($event) => $setup.handleChangeTimeConfig(index2)
- }, [
- vue.createCommentVNode(" 活动起始时间 "),
- vue.createElementVNode(
- "view",
- { class: "time" },
- vue.toDisplayString(config2.startTime),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(" 活动状态 "),
- vue.createElementVNode(
- "view",
- { class: "status" },
- vue.toDisplayString(config2.status),
- 1
- /* TEXT */
- )
- ], 10, ["id", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 8, ["scroll-into-view"])
- ]),
- vue.createCommentVNode(" 内容区 "),
- vue.createElementVNode("view", { class: "list-content" }, [
- vue.createCommentVNode(" 活动倒计时 "),
- vue.createElementVNode("view", { class: "content-header ss-flex-col ss-col-center ss-row-center" }, [
- vue.createElementVNode("view", { class: "content-header-box ss-flex ss-row-center" }, [
- ((_c = $setup.activeTimeConfig) == null ? void 0 : _c.status) === $setup.TimeStatusEnum.STARTED ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "countdown-box ss-flex"
- }, [
- vue.createElementVNode("view", { class: "countdown-title ss-m-r-12" }, "距结束"),
- vue.createElementVNode("view", { class: "ss-flex countdown-time" }, [
- vue.createElementVNode(
- "view",
- { class: "ss-flex countdown-h" },
- vue.toDisplayString($setup.countDown.h),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-m-x-4" }, ":"),
- vue.createElementVNode(
- "view",
- { class: "countdown-num ss-flex ss-row-center" },
- vue.toDisplayString($setup.countDown.m),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "ss-m-x-4" }, ":"),
- vue.createElementVNode(
- "view",
- { class: "countdown-num ss-flex ss-row-center" },
- vue.toDisplayString($setup.countDown.s),
- 1
- /* TEXT */
- )
- ])
- ])) : (vue.openBlock(), vue.createElementBlock(
- "view",
- { key: 1 },
- vue.toDisplayString((_d = $setup.activeTimeConfig) == null ? void 0 : _d.status),
- 1
- /* TEXT */
- ))
- ])
- ]),
- vue.createCommentVNode(" 活动列表 "),
- vue.createElementVNode(
- "scroll-view",
- {
- class: "scroll-box",
- style: vue.normalizeStyle({ height: $setup.pageHeight + "rpx" }),
- "scroll-y": "true",
- "scroll-with-animation": false,
- "enable-back-to-top": true
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.activityList, (activity) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "goods-box ss-m-b-20",
- key: activity.id
- }, [
- vue.createVNode(_component_s_goods_column, {
- size: "lg",
- data: { ...activity, price: activity.seckillPrice },
- goodsFields: $setup.goodsFields,
- seckillTag: true,
- onClick: ($event) => $setup.sheep.$router.go("/pages/goods/seckill", { id: activity.id })
- }, {
- activity: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "limit" }, [
- vue.createTextVNode("限量 "),
- vue.createElementVNode(
- "text",
- { class: "ss-m-l-5" },
- vue.toDisplayString(activity.stock) + " " + vue.toDisplayString(activity.unitName),
- 1
- /* TEXT */
- )
- ]),
- vue.createVNode(_component_su_progress, {
- percentage: activity.percent,
- strokeWidth: "10",
- textInside: "",
- isAnimate: ""
- }, null, 8, ["percentage"])
- ]),
- cart: vue.withCtx(() => {
- var _a3, _b3;
- return [
- vue.createElementVNode(
- "button",
- {
- class: vue.normalizeClass(["ss-reset-button cart-btn", { disabled: $setup.activeTimeConfig.status === $setup.TimeStatusEnum.END }])
- },
- [
- ((_a3 = $setup.activeTimeConfig) == null ? void 0 : _a3.status) === $setup.TimeStatusEnum.WAIT_START ? (vue.openBlock(), vue.createElementBlock("span", { key: 0 }, "未开始")) : ((_b3 = $setup.activeTimeConfig) == null ? void 0 : _b3.status) === $setup.TimeStatusEnum.STARTED ? (vue.openBlock(), vue.createElementBlock("span", { key: 1 }, "马上抢")) : (vue.openBlock(), vue.createElementBlock("span", { key: 2 }, "已结束"))
- ],
- 2
- /* CLASS */
- )
- ];
- }),
- _: 2
- /* DYNAMIC */
- }, 1032, ["data", "onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- $setup.activityTotal > 0 ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
- key: 0,
- status: $setup.loadStatus,
- "content-text": {
- contentdown: "上拉加载更多"
- },
- onClick: $setup.loadMore
- }, null, 8, ["status"])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ])
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["bgStyle"]);
- }
- const PagesActivitySeckillList = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-de8354c5"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/activity/seckill/list.vue"]]);
- const _sfc_main$3 = {
- name: "countDown",
- props: {
- justifyLeft: {
- type: String,
- default: ""
- },
- //距离开始提示文字
- tipText: {
- type: String,
- default: "倒计时"
- },
- dayText: {
- type: String,
- default: "天"
- },
- hourText: {
- type: String,
- default: "时"
- },
- minuteText: {
- type: String,
- default: "分"
- },
- secondText: {
- type: String,
- default: "秒"
- },
- datatime: {
- type: Number,
- default: 0
- },
- isDay: {
- type: Boolean,
- default: true
- },
- isCol: {
- type: Boolean,
- default: false
- },
- bgColor: {
- type: Object,
- default: null
- }
- },
- data: function() {
- return {
- day: "00",
- hour: "00",
- minute: "00",
- second: "00"
- };
- },
- created: function() {
- this.show_time();
- },
- mounted: function() {
- },
- methods: {
- show_time: function() {
- let that = this;
- function runTime() {
- let intDiff = that.datatime - Date.parse(/* @__PURE__ */ new Date()) / 1e3;
- let day = 0, hour = 0, minute = 0, second = 0;
- if (intDiff > 0) {
- if (that.isDay === true) {
- day = Math.floor(intDiff / (60 * 60 * 24));
- } else {
- day = 0;
- }
- hour = Math.floor(intDiff / (60 * 60)) - day * 24;
- minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
- second = Math.floor(intDiff) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60;
- if (hour <= 9)
- hour = "0" + hour;
- if (minute <= 9)
- minute = "0" + minute;
- if (second <= 9)
- second = "0" + second;
- that.day = day;
- that.hour = hour;
- that.minute = minute;
- that.second = second;
- } else {
- that.day = "00";
- that.hour = "00";
- that.minute = "00";
- that.second = "00";
- }
- }
- runTime();
- setInterval(runTime, 1e3);
- }
- }
- };
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "time",
- style: vue.normalizeStyle($props.justifyLeft)
- },
- [
- $props.tipText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: ""
- },
- vue.toDisplayString($props.tipText),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $props.isDay === true ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "styleAll p6",
- style: vue.normalizeStyle({ background: $props.bgColor.bgColor, color: $props.bgColor.Color })
- },
- vue.toDisplayString(_ctx.day) + vue.toDisplayString($props.bgColor.isDay ? "天" : ""),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.dayText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 2,
- class: "timeTxt",
- style: vue.normalizeStyle({ width: $props.bgColor.timeTxtwidth, color: $props.bgColor.bgColor })
- },
- vue.toDisplayString($props.dayText),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["styleAll", $props.isCol ? "timeCol" : ""]),
- style: vue.normalizeStyle({ background: $props.bgColor.bgColor, color: $props.bgColor.Color, width: $props.bgColor.width })
- },
- vue.toDisplayString(_ctx.hour),
- 7
- /* TEXT, CLASS, STYLE */
- ),
- $props.hourText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 3,
- class: vue.normalizeClass(["timeTxt", $props.isCol ? "whit" : ""]),
- style: vue.normalizeStyle({ width: $props.bgColor.timeTxtwidth, color: $props.bgColor.bgColor })
- },
- vue.toDisplayString($props.hourText),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["styleAll", $props.isCol ? "timeCol" : ""]),
- style: vue.normalizeStyle({ background: $props.bgColor.bgColor, color: $props.bgColor.Color, width: $props.bgColor.width })
- },
- vue.toDisplayString(_ctx.minute),
- 7
- /* TEXT, CLASS, STYLE */
- ),
- $props.minuteText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 4,
- class: vue.normalizeClass(["timeTxt", $props.isCol ? "whit" : ""]),
- style: vue.normalizeStyle({ width: $props.bgColor.timeTxtwidth, color: $props.bgColor.bgColor })
- },
- vue.toDisplayString($props.minuteText),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["styleAll", $props.isCol ? "timeCol" : ""]),
- style: vue.normalizeStyle({ background: $props.bgColor.bgColor, color: $props.bgColor.Color, width: $props.bgColor.width })
- },
- vue.toDisplayString(_ctx.second),
- 7
- /* TEXT, CLASS, STYLE */
- ),
- $props.secondText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 5,
- class: "timeTxt"
- },
- vue.toDisplayString($props.secondText),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-39f8fd44"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/sheep/components/s-count-down/s-count-down.vue"]]);
- const _sfc_main$2 = {
- __name: "list",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- navH: "",
- returnShow: true,
- // ========== 砍价记录概要的相关变量 ==========
- bargainTotal: 0,
- bargainSuccessList: [],
- // ========== 砍价活动的相关变量 ==========
- bargainList: [],
- page: 1,
- limit: 10,
- loading: false,
- loadend: false,
- bgColor: {
- "bgColor": "#E93323",
- "Color": "#fff",
- "width": "44rpx",
- "timeTxtwidth": "16rpx",
- "isDay": true
- },
- loadTitle: "加载更多"
- });
- async function getBargainHeader() {
- let {
- code: code2,
- data
- } = await BargainApi.getBargainRecordSummary();
- if (code2 == 0) {
- state.bargainTotal = data.successUserCount;
- state.bargainSuccessList = data.successList;
- } else {
- state.$util.Tips({
- title: data
- });
- }
- }
- async function getBargainList() {
- if (state.loadend || state.loading) {
- return;
- }
- state.loading = true;
- state.loadTitle = "";
- let {
- data,
- code: code2
- } = await BargainApi.getBargainActivityPage({
- pageNo: state.page,
- pageSize: state.limit
- });
- if (code2 == 0) {
- const list = data.list;
- _$1.concat(state.bargainList, list);
- const loadend = list.length < state.limit;
- state.loadend = loadend;
- state.loading = false;
- state.loadTitle = loadend ? "已全部加载" : "加载更多";
- state.bargainList = data.list;
- state.page = state.page + 1;
- } else {
- state.loading = false;
- state.loadTitle = "加载更多";
- }
- }
- function openSubscribe(e2) {
- formatAppLog("log", "at pages/activity/bargain/list.vue:158", "跳转");
- formatAppLog("log", "at pages/activity/bargain/list.vue:159", e2);
- sheep$1.$router.go(e2);
- return;
- }
- onLoad(function() {
- getBargainHeader();
- getBargainList();
- });
- onReachBottom(() => {
- getBargainList();
- });
- const __returned__ = { state, getBargainHeader, getBargainList, openSubscribe, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get _() {
- return _$1;
- }, get onLoad() {
- return onLoad;
- }, get onReachBottom() {
- return onReachBottom;
- }, get fen2yuan() {
- return fen2yuan;
- }, get BargainApi() {
- return BargainApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_count_down = resolveEasycom(vue.resolveDynamicComponent("s-count-down"), __easycom_0);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" TODO @科举:参考 groupon/list.vue 和 seckill/list.vue 界面,调整下头部,就是从 5 到 11 行的 "),
- vue.createVNode(_component_s_layout, {
- navbar: "inner",
- title: "砍价列表"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { style: { "background-color": "red", "height": "100vh" } }, [
- vue.createElementVNode("view", { class: "bargain-list" }, [
- vue.createCommentVNode(" 砍价记录的概要 "),
- vue.createElementVNode("view", { class: "header" }, [
- vue.createElementVNode("view", { class: "pic" }, [
- vue.createElementVNode("view", { class: "swipers" }, [
- vue.createElementVNode("swiper", {
- "indicator-dots": "true",
- autoplay: "true",
- interval: "2500",
- duration: "500",
- vertical: "true",
- circular: "true"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.bargainSuccessList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("swiper-item", { key: index2 }, [
- vue.createElementVNode("view", {
- class: "acea-row row-middle",
- style: { "display": "flex" }
- }, [
- vue.createElementVNode("image", {
- src: item.avatar,
- class: "mr9"
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "view",
- { class: "mr9 nickName" },
- vue.toDisplayString(item.nickname),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "mr9" }, "拿了"),
- vue.createElementVNode(
- "view",
- { class: "line1" },
- vue.toDisplayString(item.activityName),
- 1
- /* TEXT */
- )
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])
- ]),
- vue.createElementVNode(
- "view",
- { class: "tit" },
- "已有" + vue.toDisplayString($setup.state.bargainTotal) + "人砍成功",
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 砍价活动列表 "),
- vue.createElementVNode("view", { class: "list" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.state.bargainList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- style: { "display": "flex" },
- class: "item acea-row row-between-wrapper",
- onClick: ($event) => $setup.openSubscribe("/pages/activity/bargain/detail?id=" + item.id)
- }, [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: item.picUrl
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "text acea-row row-column-around" }, [
- vue.createElementVNode(
- "view",
- { class: "name line2" },
- vue.toDisplayString(item.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", {
- class: "acea-row",
- style: { "margin-bottom": "14rpx", "display": "flex" }
- }, [
- vue.createVNode(_component_s_count_down, {
- tipText: " ",
- bgColor: $setup.state.bgColor,
- dayText: ":",
- hourText: ":",
- minuteText: ":",
- secondText: " ",
- datatime: item.endTime / 1e3,
- isDay: true
- }, null, 8, ["bgColor", "datatime"]),
- vue.createElementVNode("text", { class: "txt" }, "后结束")
- ]),
- item.stock === 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createElementVNode("view", {
- style: { "font-size": "22rpx" },
- onClick: ($event) => $setup.openSubscribe("/pages/activity/goods_bargain_details/index?id=" + item.id + "&startBargainUid=" + _ctx.uid)
- }, " 已售罄", 8, ["onClick"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "money font-color" }, [
- vue.createTextVNode("最低: ¥"),
- vue.createElementVNode(
- "text",
- { class: "price" },
- vue.toDisplayString($setup.fen2yuan(item.bargainMinPrice)),
- 1
- /* TEXT */
- )
- ])
- ]),
- item.stock > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "cutBnt bg-color"
- }, "参与砍价")) : vue.createCommentVNode("v-if", true),
- item.stock === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "cutBnt bg-color-hui"
- }, "已售罄")) : vue.createCommentVNode("v-if", true)
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- $setup.state.bargainList.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "loadingicon acea-row row-center-wrapper",
- style: { "text-align": "center" }
- }, [
- vue.createElementVNode("text", {
- class: "loading iconfont icon-jiazai",
- hidden: !_ctx.loading
- }, null, 8, ["hidden"]),
- vue.createTextVNode(
- vue.toDisplayString($setup.state.loadTitle),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesActivityBargainList = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-7572db9c"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/activity/bargain/list.vue"]]);
- const _sfc_main$1 = {
- __name: "detail",
- setup(__props, { expose: __expose }) {
- __expose();
- const state = vue.reactive({
- id: "",
- buyPrice: "",
- bargainInfo: {},
- bgColor: {
- "bgColor": "#333333",
- "Color": "#fff",
- "width": "44rpx",
- "timeTxtwidth": "16rpx",
- "isDay": true
- },
- bargainUserHelpList: [],
- couponsHidden: true
- });
- async function getBargainDetails() {
- let {
- data,
- code: code2
- } = await BargainApi.getBargainActivityDetail({
- id: state.id
- });
- if (code2 == 0) {
- state.bargainInfo = data;
- state.buyPrice = state.bargainInfo.bargainFirstPrice;
- }
- }
- onLoad(function(options2) {
- if (options2.hasOwnProperty("id")) {
- options2.id ? state.id = options2.id : state.id = "";
- }
- getBargainDetails();
- });
- function fen2yuan2(price) {
- return (price / 100).toFixed(2);
- }
- const __returned__ = { state, getBargainDetails, fen2yuan: fen2yuan2, reactive: vue.reactive, get sheep() {
- return sheep$1;
- }, get onLoad() {
- return onLoad;
- }, get BargainApi() {
- return BargainApi;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_s_count_down = resolveEasycom(vue.resolveDynamicComponent("s-count-down"), __easycom_0);
- const _component_s_layout = resolveEasycom(vue.resolveDynamicComponent("s-layout"), __easycom_1$8);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(" TODO @科举:按照项目的代码风格,调整下这个界面 "),
- vue.createCommentVNode(" TODO @科举:挪到 bargain/detail.vue 里 "),
- vue.createCommentVNode(" TODO @科举:尽量都迁移完;依赖数据的部分,通过直接在 state 写死状态,不用后端返回,跑通整个界面;不追求 100% 对,但是至少自己观感是 ok 的 "),
- vue.createVNode(_component_s_layout, { title: "砍价详情" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "bargain" }, [
- vue.createCommentVNode(` :class="startBargainUid !== userInfo.uid ? 'on' : ''" `),
- vue.createElementVNode("view", { class: "header" }, [
- vue.createElementVNode("navigator", {
- url: "/pages/activity/bargainingList",
- "hover-class": "none"
- }, [
- vue.createElementVNode("view", {
- class: "back",
- style: { "width": "234rpx", "height": "54rpx", "background": "linear-gradient(233deg,#ffd169,#fe960f)", "opacity": "1", "border-radius": "0 26rpx 26rpx 0", "line-height": "54rpx", "text-align": "center", "color": "#6e3f00", "font-size": "25rpx" }
- }, [
- vue.createElementVNode("text", { class: "iconfont icon-xiangzuo" }),
- vue.createTextVNode(" 返回砍价列表 ")
- ])
- ])
- ]),
- vue.createElementVNode("view", {
- class: "pad30",
- style: { "padding-bottom": "30rpx" }
- }, [
- vue.createElementVNode("view", { class: "wrapper" }, [
- vue.createElementVNode("view", {
- class: "pictxt acea-row row-between",
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.goProduct && _ctx.goProduct(...args)),
- style: { "display": "flex", "box-sizing": "border-box" }
- }, [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: $setup.state.bargainInfo.picUrl
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", {
- class: "text acea-row row-column-around",
- style: { "margin-left": "10rpx" }
- }, [
- vue.createElementVNode(
- "view",
- { class: "line1" },
- vue.toDisplayString($setup.state.bargainInfo.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "surplus" },
- "最低价:¥" + vue.toDisplayString($setup.fen2yuan($setup.state.bargainInfo.bargainMinPrice)),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "surplus" },
- "剩余:" + vue.toDisplayString($setup.state.bargainInfo.stock) + " " + vue.toDisplayString($setup.state.bargainInfo.unitName),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", {
- class: "money font-color-red",
- style: { "color": "red" }
- }, [
- vue.createTextVNode(" 当前: ¥ "),
- vue.createElementVNode(
- "text",
- { class: "num" },
- vue.toDisplayString($setup.fen2yuan($setup.state.buyPrice)),
- 1
- /* TEXT */
- )
- ]),
- $setup.state.bargainInfo.endTime > (/* @__PURE__ */ new Date()).getTime() && $setup.state.bargainInfo.stock > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "acea-row",
- style: { "display": "flex" }
- }, [
- vue.createVNode(_component_s_count_down, {
- tipText: " ",
- bgColor: $setup.state.bgColor,
- dayText: ":",
- hourText: ":",
- minuteText: ":",
- secondText: " ",
- datatime: $setup.state.bargainInfo.endTime / 1e3,
- isDay: true
- }, null, 8, ["bgColor", "datatime"]),
- vue.createElementVNode("text", { style: { "font-size": "22rpx", "margin-left": "4rpx", "line-height": "36rpx" } }, "后结束")
- ])) : $setup.state.bargainInfo.endTime <= (/* @__PURE__ */ new Date()).getTime() ? (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- vue.createElementVNode("view", {
- style: { "font-size": "22rpx" },
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.currentBargainUser && _ctx.currentBargainUser(...args))
- }, "已结束")
- ])) : $setup.state.bargainInfo.stock <= 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 2 }, [
- vue.createElementVNode("view", {
- style: { "font-size": "22rpx" },
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.currentBargainUser && _ctx.currentBargainUser(...args))
- }, "已售罄")
- ])) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("text", { class: "iconfont icon-jiantou iconfonts" })
- ])
- ]),
- vue.createCommentVNode(" 砍价记录 "),
- vue.createElementVNode("view", { class: "title font-color acea-row row-center-wrapper" }, [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createCommentVNode(" TODO 芋艿:暂时不支持砍价功能,后续换到 cdn 加载图片 "),
- vue.createCommentVNode(" <image src='../static/zuo2.png'></image>")
- ]),
- vue.createElementVNode("view", { class: "tits" }, [
- vue.createElementVNode("view", { class: "titleCon" }, "砍价记录"),
- vue.createElementVNode("view", { class: "line" })
- ]),
- vue.createElementVNode("view", { class: "pictrue on" }, [
- vue.createCommentVNode(" TODO 芋艿:暂时不支持砍价功能,后续换到 cdn 加载图片 "),
- vue.createCommentVNode(" <image src='../static/you2.png'></image>")
- ])
- ]),
- vue.createElementVNode("view", { class: "bargainGang borRadius14" }, [
- $setup.state.bargainUserHelpList.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "list"
- }, [
- _ctx.index < 3 || !$setup.state.couponsHidden ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList($setup.state.bargainUserHelpList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: "item acea-row row-between-wrapper"
- }, [
- vue.createElementVNode("view", { class: "pictxt acea-row row-between-wrapper" }, [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: item.avatar
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "text" }, [
- vue.createElementVNode(
- "view",
- { class: "name line1" },
- vue.toDisplayString(item.nickname),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "line1" },
- vue.toDisplayString(_ctx.formatDate(item.createTime)),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode("view", { class: "money" }, [
- vue.createTextVNode(" 已砍 "),
- vue.createElementVNode(
- "text",
- { class: "font-color-red" },
- vue.toDisplayString($setup.fen2yuan(item.reducePrice)),
- 1
- /* TEXT */
- ),
- vue.createTextVNode("元 ")
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true),
- $setup.state.bargainUserHelpList.length > 3 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "open acea-row row-center-wrapper",
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.openTap && _ctx.openTap(...args))
- }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.state.couponsHidden ? "展开更多" : "关闭展开") + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["iconfont", $setup.state.couponsHidden ? "icon-xiangxia" : "icon-xiangshang"])
- },
- null,
- 2
- /* CLASS */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true),
- $setup.state.bargainUserHelpList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "contentNo"
- }, [
- vue.createElementVNode("text", { class: "iconfont icon-xiaolian mr8" }),
- vue.createTextVNode(" 暂无助力记录 ")
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- );
- }
- const PagesActivityBargainDetail = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-6d33792e"], ["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/pages/activity/bargain/detail.vue"]]);
- __definePage("pages/index/FirstIndex", PagesIndexFirstIndex);
- __definePage("pages/index/FirstActivity", PagesIndexFirstActivity);
- __definePage("pages/index/FirstVideo", PagesIndexFirstVideo);
- __definePage("pages/index/FirstList", PagesIndexFirstList);
- __definePage("pages/index/index", PagesIndexIndex);
- __definePage("pages/index/user", PagesIndexUser);
- __definePage("pages/index/category", PagesIndexCategory);
- __definePage("pages/index/cart", PagesIndexCart);
- __definePage("pages/index/login", PagesIndexLogin);
- __definePage("pages/index/search", PagesIndexSearch);
- __definePage("pages/index/page", PagesIndexPage);
- __definePage("pages/goods/index", PagesGoodsIndex);
- __definePage("pages/goods/groupon", PagesGoodsGroupon);
- __definePage("pages/goods/seckill", PagesGoodsSeckill);
- __definePage("pages/goods/list", PagesGoodsList);
- __definePage("pages/goods/comment/add", PagesGoodsCommentAdd);
- __definePage("pages/goods/comment/list", PagesGoodsCommentList);
- __definePage("pages/order/detail", PagesOrderDetail);
- __definePage("pages/order/confirm", PagesOrderConfirm);
- __definePage("pages/order/list", PagesOrderList);
- __definePage("pages/order/aftersale/apply", PagesOrderAftersaleApply);
- __definePage("pages/order/aftersale/return-delivery", PagesOrderAftersaleReturnDelivery);
- __definePage("pages/order/aftersale/list", PagesOrderAftersaleList);
- __definePage("pages/order/aftersale/detail", PagesOrderAftersaleDetail);
- __definePage("pages/order/aftersale/log", PagesOrderAftersaleLog);
- __definePage("pages/order/express/log", PagesOrderExpressLog);
- __definePage("pages/order/otherlist", PagesOrderOtherlist);
- __definePage("pages/user/info", PagesUserInfo);
- __definePage("pages/user/setting", PagesUserSetting);
- __definePage("pages/user/qrcode-share", PagesUserQrcodeShare);
- __definePage("pages/user/goods-collect", PagesUserGoodsCollect);
- __definePage("pages/user/goods-log", PagesUserGoodsLog);
- __definePage("pages/user/address/list", PagesUserAddressList);
- __definePage("pages/user/dummyAddress/list", PagesUserDummyAddressList);
- __definePage("pages/user/invoice/edit", PagesUserInvoiceEdit);
- __definePage("pages/user/invoice/list", PagesUserInvoiceList);
- __definePage("pages/user/address/edit", PagesUserAddressEdit);
- __definePage("pages/user/dummyAddress/edit", PagesUserDummyAddressEdit);
- __definePage("pages/user/wallet/money", PagesUserWalletMoney);
- __definePage("pages/user/wallet/score", PagesUserWalletScore);
- __definePage("pages/user/wallet/consumptionLog", PagesUserWalletConsumptionLog);
- __definePage("pages/user/wallet/topupConsumptionPoints", PagesUserWalletTopupConsumptionPoints);
- __definePage("pages/user/wallet/consumptionTransfersLog", PagesUserWalletConsumptionTransfersLog);
- __definePage("pages/user/wallet/consumptionTransfers", PagesUserWalletConsumptionTransfers);
- __definePage("pages/user/wallet/scoreToConsumption", PagesUserWalletScoreToConsumption);
- __definePage("pages/user/wallet/withdraw", PagesUserWalletWithdraw);
- __definePage("pages/user/wallet/withdrawalLog", PagesUserWalletWithdrawalLog);
- __definePage("pages/user/wallet/scoreToMoney", PagesUserWalletScoreToMoney);
- __definePage("pages/user/wallet/ScoreLog", PagesUserWalletScoreLog);
- __definePage("pages/user/wallet/maxScoreLog", PagesUserWalletMaxScoreLog);
- __definePage("pages/user/wallet/team", PagesUserWalletTeam);
- __definePage("pages/commission/index", PagesCommissionIndex);
- __definePage("pages/commission/wallet", PagesCommissionWallet);
- __definePage("pages/commission/goods", PagesCommissionGoods);
- __definePage("pages/commission/order", PagesCommissionOrder);
- __definePage("pages/commission/team", PagesCommissionTeam);
- __definePage("pages/commission/promoter", PagesCommissionPromoter);
- __definePage("pages/commission/commission-ranking", PagesCommissionCommissionRanking);
- __definePage("pages/commission/withdraw", PagesCommissionWithdraw);
- __definePage("pages/app/sign", PagesAppSign);
- __definePage("pages/shop/index", PagesShopIndex);
- __definePage("pages/shop/category", PagesShopCategory);
- __definePage("pages/shop/allproduct", PagesShopAllproduct);
- __definePage("pages/public/setting", PagesPublicSetting);
- __definePage("pages/public/richtext", PagesPublicRichtext);
- __definePage("pages/public/faq", PagesPublicFaq);
- __definePage("pages/public/error", PagesPublicError);
- __definePage("pages/public/webview", PagesPublicWebview);
- __definePage("pages/public/merchant", PagesPublicMerchant);
- __definePage("pages/public/merchantApplyList", PagesPublicMerchantApplyList);
- __definePage("pages/coupon/list", PagesCouponList);
- __definePage("pages/coupon/detail", PagesCouponDetail);
- __definePage("pages/chat/index", PagesChatIndex);
- __definePage("pages/chat/speechtotext", PagesChatSpeechtotext);
- __definePage("pages/pay/index", PagesPayIndex);
- __definePage("pages/pay/result", PagesPayResult);
- __definePage("pages/pay/resultYuan", PagesPayResultYuan);
- __definePage("pages/pay/recharge", PagesPayRecharge);
- __definePage("pages/pay/recharge-log", PagesPayRechargeLog);
- __definePage("pages/activity/groupon/detail", PagesActivityGrouponDetail);
- __definePage("pages/activity/groupon/order", PagesActivityGrouponOrder);
- __definePage("pages/activity/index", PagesActivityIndex);
- __definePage("pages/activity/groupon/list", PagesActivityGrouponList);
- __definePage("pages/activity/seckill/list", PagesActivitySeckillList);
- __definePage("pages/activity/bargain/list", PagesActivityBargainList);
- __definePage("pages/activity/bargain/detail", PagesActivityBargainDetail);
- const _sfc_main = {
- __name: "App",
- setup(__props, { expose: __expose }) {
- __expose();
- onShow((options2) => {
- autoSign();
- plus.runtime.arguments;
- uni.getClipboardData({
- success: (res) => {
- }
- });
- });
- onHide(() => {
- cancelAutoSign();
- });
- onLaunch(() => {
- uni.hideTabBar();
- ShoproInit();
- resetSignStatusIfNeeded();
- });
- onError((err) => {
- formatAppLog("log", "at App.vue:53", "AppOnError:", err);
- });
- const __returned__ = { get onLaunch() {
- return onLaunch;
- }, get onShow() {
- return onShow;
- }, get onError() {
- return onError;
- }, get onHide() {
- return onHide;
- }, get ShoproInit() {
- return ShoproInit;
- }, get autoSign() {
- return autoSign;
- }, get cancelAutoSign() {
- return cancelAutoSign;
- }, get resetSignStatusIfNeeded() {
- return resetSignStatusIfNeeded;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/xuruhua/Desktop/zx/mall-newfeifan-zx-app/App.vue"]]);
- function clearLinkId() {
- uni.removeStorageSync("linkId");
- }
- setInterval(clearLinkId, 3e5);
- function createApp() {
- const app2 = vue.createVueApp(App);
- app2.use(i18n);
- setupPinia(app2);
- return {
- app: app2
- };
- }
- const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
- uni.Vuex = __Vuex__;
- uni.Pinia = __Pinia__;
- __app__.provide("__globalStyles", __uniConfig.styles);
- __app__._component.mpType = "app";
- __app__._component.render = () => {
- };
- __app__.mount("#app");
- })(Vue);
|