| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245 |
- var __defProp = Object.defineProperty;
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
- var __publicField = (obj, key, value) => {
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, 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";
- var _a;
- const _export_sfc = (sfc, props2) => {
- const target = sfc.__vccOpts || sfc;
- for (const [key, val] of props2) {
- target[key] = val;
- }
- return target;
- };
- const _sfc_main$2k = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- const downloadFrom = (source) => {
- uni.getSystemInfoSync();
- window.location.href = "https://a.app.qq.com/o/simple.jsp?pkgname=com.lucky.luckyclient";
- };
- const __returned__ = { downloadFrom };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2j(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { id: "app" }, [
- vue.createElementVNode("view", { class: "container" }, [
- vue.createCommentVNode(" 应用头部信息 "),
- vue.createElementVNode("view", { class: "app-header" }, [
- vue.createElementVNode("view", { class: "app-icon" }, [
- vue.createElementVNode("text", { class: "fas fa-book" }, "水贝商城"),
- vue.createElementVNode("view", { class: "official-badge" }, "官方")
- ]),
- vue.createCommentVNode(' <view class="app-info">\r\n <view class="app-title">\r\n <view class="app-name">水贝商城</view>\r\n \r\n </view>\r\n <view class="app-stats">\r\n <view class="rating">\r\n \r\n 4.56分\r\n </view>\r\n <view>1.9亿次下载</view>\r\n </view>\r\n <view class="app-stats">\r\n 124.55MB\r\n </view>\r\n </view> ')
- ]),
- vue.createCommentVNode(" 下载选项 "),
- vue.createElementVNode("view", { class: "download-options" }, [
- vue.createElementVNode("view", {
- class: "download-option option-primary",
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.downloadFrom("应用宝"))
- }, [
- vue.createElementVNode("view", { class: "option-icon" }, [
- vue.createElementVNode("text", { class: "fas fa-shield-alt" })
- ]),
- vue.createElementVNode("view", { class: "option-content" }, [
- vue.createElementVNode("view", { class: "option-title" }, "通过应用宝下载"),
- vue.createElementVNode("view", { class: "option-desc" }, "腾讯应用宝下载,人工智能保证安全"),
- vue.createElementVNode("view", { class: "option-tag" }, "无病毒"),
- vue.createElementVNode("view", { class: "option-tag" }, "免广告骚扰")
- ])
- ]),
- vue.createElementVNode("view", {
- class: "download-option",
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.downloadFrom("第三方浏览器"))
- }, [
- vue.createElementVNode("view", { class: "option-icon" }, [
- vue.createElementVNode("text", { class: "fas fa-globe" })
- ]),
- vue.createElementVNode("view", { class: "option-content" }, [
- vue.createElementVNode("view", { class: "option-title" }, "通过第三方浏览器下载"),
- vue.createElementVNode("view", { class: "option-desc" }, "无法确认是否存在安全隐患"),
- vue.createElementVNode("view", { class: "option-warning" }, "请注意安全风险")
- ])
- ])
- ]),
- vue.createCommentVNode(" 应用详情 "),
- vue.createElementVNode("view", { class: "app-details" }, [
- vue.createElementVNode("view", { class: "detail-item" }, [
- vue.createElementVNode("view", { class: "detail-label" }, "运营者:"),
- vue.createElementVNode("view", { class: "detail-value" }, "神州通誉软件")
- ]),
- vue.createElementVNode("view", { class: "detail-item" }, [
- vue.createElementVNode("view", { class: "detail-label" }, "开发者:"),
- vue.createElementVNode("view", { class: "detail-value" }, "神州通誉软件")
- ]),
- vue.createElementVNode("view", { class: "detail-item" }, [
- vue.createElementVNode("view", { class: "detail-label" }, "版本:"),
- vue.createElementVNode("view", { class: "detail-value" }, "1.0.0")
- ])
- ]),
- vue.createCommentVNode(" 底部信息 "),
- vue.createElementVNode("view", { class: "footer" }, [
- vue.createElementVNode("view", { class: "footer-links" }, [
- vue.createElementVNode("span", { class: "footer-link" }, "权限"),
- vue.createElementVNode("span", { class: "footer-link" }, "隐私"),
- vue.createElementVNode("span", { class: "footer-link" }, "功能"),
- vue.createElementVNode("span", { class: "footer-link" }, "备案")
- ]),
- vue.createElementVNode("view", null, "腾讯应用宝"),
- vue.createElementVNode("view", null, "该服务由应用宝技术提供")
- ])
- ])
- ]);
- }
- const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$2k, [["render", _sfc_render$2j], ["__scopeId", "data-v-1cf27b2a"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/pages/index/index.vue"]]);
- const ON_SHOW = "onShow";
- const ON_HIDE = "onHide";
- const ON_LOAD = "onLoad";
- const ON_READY = "onReady";
- const ON_PAGE_SCROLL = "onPageScroll";
- const ON_REACH_BOTTOM = "onReachBottom";
- const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
- function formatAppLog(type2, filename, ...args) {
- if (uni.__log__) {
- uni.__log__(type2, filename, ...args);
- } else {
- console[type2].apply(console, [...args, filename]);
- }
- }
- function resolveEasycom(component, easycom) {
- return typeof component === "string" ? easycom : component;
- }
- const createLifeCycleHook = (lifecycle, flag2 = 0) => (hook, target = vue.getCurrentInstance()) => {
- !vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
- };
- const onShow = /* @__PURE__ */ createLifeCycleHook(
- ON_SHOW,
- 1 | 2
- /* HookFlags.PAGE */
- );
- const onHide = /* @__PURE__ */ createLifeCycleHook(
- ON_HIDE,
- 1 | 2
- /* HookFlags.PAGE */
- );
- const onLoad = /* @__PURE__ */ createLifeCycleHook(
- ON_LOAD,
- 2
- /* HookFlags.PAGE */
- );
- const onReady = /* @__PURE__ */ createLifeCycleHook(
- ON_READY,
- 2
- /* HookFlags.PAGE */
- );
- const onPageScroll = /* @__PURE__ */ createLifeCycleHook(
- ON_PAGE_SCROLL,
- 2
- /* HookFlags.PAGE */
- );
- const onReachBottom = /* @__PURE__ */ createLifeCycleHook(
- ON_REACH_BOTTOM,
- 2
- /* HookFlags.PAGE */
- );
- const onPullDownRefresh = /* @__PURE__ */ createLifeCycleHook(
- ON_PULL_DOWN_REFRESH,
- 2
- /* HookFlags.PAGE */
- );
- const fontData = [
- {
- "font_class": "arrow-down",
- "unicode": ""
- },
- {
- "font_class": "arrow-left",
- "unicode": ""
- },
- {
- "font_class": "arrow-right",
- "unicode": ""
- },
- {
- "font_class": "arrow-up",
- "unicode": ""
- },
- {
- "font_class": "auth",
- "unicode": ""
- },
- {
- "font_class": "auth-filled",
- "unicode": ""
- },
- {
- "font_class": "back",
- "unicode": ""
- },
- {
- "font_class": "bars",
- "unicode": ""
- },
- {
- "font_class": "calendar",
- "unicode": ""
- },
- {
- "font_class": "calendar-filled",
- "unicode": ""
- },
- {
- "font_class": "camera",
- "unicode": ""
- },
- {
- "font_class": "camera-filled",
- "unicode": ""
- },
- {
- "font_class": "cart",
- "unicode": ""
- },
- {
- "font_class": "cart-filled",
- "unicode": ""
- },
- {
- "font_class": "chat",
- "unicode": ""
- },
- {
- "font_class": "chat-filled",
- "unicode": ""
- },
- {
- "font_class": "chatboxes",
- "unicode": ""
- },
- {
- "font_class": "chatboxes-filled",
- "unicode": ""
- },
- {
- "font_class": "chatbubble",
- "unicode": ""
- },
- {
- "font_class": "chatbubble-filled",
- "unicode": ""
- },
- {
- "font_class": "checkbox",
- "unicode": ""
- },
- {
- "font_class": "checkbox-filled",
- "unicode": ""
- },
- {
- "font_class": "checkmarkempty",
- "unicode": ""
- },
- {
- "font_class": "circle",
- "unicode": ""
- },
- {
- "font_class": "circle-filled",
- "unicode": ""
- },
- {
- "font_class": "clear",
- "unicode": ""
- },
- {
- "font_class": "close",
- "unicode": ""
- },
- {
- "font_class": "closeempty",
- "unicode": ""
- },
- {
- "font_class": "cloud-download",
- "unicode": ""
- },
- {
- "font_class": "cloud-download-filled",
- "unicode": ""
- },
- {
- "font_class": "cloud-upload",
- "unicode": ""
- },
- {
- "font_class": "cloud-upload-filled",
- "unicode": ""
- },
- {
- "font_class": "color",
- "unicode": ""
- },
- {
- "font_class": "color-filled",
- "unicode": ""
- },
- {
- "font_class": "compose",
- "unicode": ""
- },
- {
- "font_class": "contact",
- "unicode": ""
- },
- {
- "font_class": "contact-filled",
- "unicode": ""
- },
- {
- "font_class": "down",
- "unicode": ""
- },
- {
- "font_class": "bottom",
- "unicode": ""
- },
- {
- "font_class": "download",
- "unicode": ""
- },
- {
- "font_class": "download-filled",
- "unicode": ""
- },
- {
- "font_class": "email",
- "unicode": ""
- },
- {
- "font_class": "email-filled",
- "unicode": ""
- },
- {
- "font_class": "eye",
- "unicode": ""
- },
- {
- "font_class": "eye-filled",
- "unicode": ""
- },
- {
- "font_class": "eye-slash",
- "unicode": ""
- },
- {
- "font_class": "eye-slash-filled",
- "unicode": ""
- },
- {
- "font_class": "fire",
- "unicode": ""
- },
- {
- "font_class": "fire-filled",
- "unicode": ""
- },
- {
- "font_class": "flag",
- "unicode": ""
- },
- {
- "font_class": "flag-filled",
- "unicode": ""
- },
- {
- "font_class": "folder-add",
- "unicode": ""
- },
- {
- "font_class": "folder-add-filled",
- "unicode": ""
- },
- {
- "font_class": "font",
- "unicode": ""
- },
- {
- "font_class": "forward",
- "unicode": ""
- },
- {
- "font_class": "gear",
- "unicode": ""
- },
- {
- "font_class": "gear-filled",
- "unicode": ""
- },
- {
- "font_class": "gift",
- "unicode": ""
- },
- {
- "font_class": "gift-filled",
- "unicode": ""
- },
- {
- "font_class": "hand-down",
- "unicode": ""
- },
- {
- "font_class": "hand-down-filled",
- "unicode": ""
- },
- {
- "font_class": "hand-up",
- "unicode": ""
- },
- {
- "font_class": "hand-up-filled",
- "unicode": ""
- },
- {
- "font_class": "headphones",
- "unicode": ""
- },
- {
- "font_class": "heart",
- "unicode": ""
- },
- {
- "font_class": "heart-filled",
- "unicode": ""
- },
- {
- "font_class": "help",
- "unicode": ""
- },
- {
- "font_class": "help-filled",
- "unicode": ""
- },
- {
- "font_class": "home",
- "unicode": ""
- },
- {
- "font_class": "home-filled",
- "unicode": ""
- },
- {
- "font_class": "image",
- "unicode": ""
- },
- {
- "font_class": "image-filled",
- "unicode": ""
- },
- {
- "font_class": "images",
- "unicode": ""
- },
- {
- "font_class": "images-filled",
- "unicode": ""
- },
- {
- "font_class": "info",
- "unicode": ""
- },
- {
- "font_class": "info-filled",
- "unicode": ""
- },
- {
- "font_class": "left",
- "unicode": ""
- },
- {
- "font_class": "link",
- "unicode": ""
- },
- {
- "font_class": "list",
- "unicode": ""
- },
- {
- "font_class": "location",
- "unicode": ""
- },
- {
- "font_class": "location-filled",
- "unicode": ""
- },
- {
- "font_class": "locked",
- "unicode": ""
- },
- {
- "font_class": "locked-filled",
- "unicode": ""
- },
- {
- "font_class": "loop",
- "unicode": ""
- },
- {
- "font_class": "mail-open",
- "unicode": ""
- },
- {
- "font_class": "mail-open-filled",
- "unicode": ""
- },
- {
- "font_class": "map",
- "unicode": ""
- },
- {
- "font_class": "map-filled",
- "unicode": ""
- },
- {
- "font_class": "map-pin",
- "unicode": ""
- },
- {
- "font_class": "map-pin-ellipse",
- "unicode": ""
- },
- {
- "font_class": "medal",
- "unicode": ""
- },
- {
- "font_class": "medal-filled",
- "unicode": ""
- },
- {
- "font_class": "mic",
- "unicode": ""
- },
- {
- "font_class": "mic-filled",
- "unicode": ""
- },
- {
- "font_class": "micoff",
- "unicode": ""
- },
- {
- "font_class": "micoff-filled",
- "unicode": ""
- },
- {
- "font_class": "minus",
- "unicode": ""
- },
- {
- "font_class": "minus-filled",
- "unicode": ""
- },
- {
- "font_class": "more",
- "unicode": ""
- },
- {
- "font_class": "more-filled",
- "unicode": ""
- },
- {
- "font_class": "navigate",
- "unicode": ""
- },
- {
- "font_class": "navigate-filled",
- "unicode": ""
- },
- {
- "font_class": "notification",
- "unicode": ""
- },
- {
- "font_class": "notification-filled",
- "unicode": ""
- },
- {
- "font_class": "paperclip",
- "unicode": ""
- },
- {
- "font_class": "paperplane",
- "unicode": ""
- },
- {
- "font_class": "paperplane-filled",
- "unicode": ""
- },
- {
- "font_class": "person",
- "unicode": ""
- },
- {
- "font_class": "person-filled",
- "unicode": ""
- },
- {
- "font_class": "personadd",
- "unicode": ""
- },
- {
- "font_class": "personadd-filled",
- "unicode": ""
- },
- {
- "font_class": "personadd-filled-copy",
- "unicode": ""
- },
- {
- "font_class": "phone",
- "unicode": ""
- },
- {
- "font_class": "phone-filled",
- "unicode": ""
- },
- {
- "font_class": "plus",
- "unicode": ""
- },
- {
- "font_class": "plus-filled",
- "unicode": ""
- },
- {
- "font_class": "plusempty",
- "unicode": ""
- },
- {
- "font_class": "pulldown",
- "unicode": ""
- },
- {
- "font_class": "pyq",
- "unicode": ""
- },
- {
- "font_class": "qq",
- "unicode": ""
- },
- {
- "font_class": "redo",
- "unicode": ""
- },
- {
- "font_class": "redo-filled",
- "unicode": ""
- },
- {
- "font_class": "refresh",
- "unicode": ""
- },
- {
- "font_class": "refresh-filled",
- "unicode": ""
- },
- {
- "font_class": "refreshempty",
- "unicode": ""
- },
- {
- "font_class": "reload",
- "unicode": ""
- },
- {
- "font_class": "right",
- "unicode": ""
- },
- {
- "font_class": "scan",
- "unicode": ""
- },
- {
- "font_class": "search",
- "unicode": ""
- },
- {
- "font_class": "settings",
- "unicode": ""
- },
- {
- "font_class": "settings-filled",
- "unicode": ""
- },
- {
- "font_class": "shop",
- "unicode": ""
- },
- {
- "font_class": "shop-filled",
- "unicode": ""
- },
- {
- "font_class": "smallcircle",
- "unicode": ""
- },
- {
- "font_class": "smallcircle-filled",
- "unicode": ""
- },
- {
- "font_class": "sound",
- "unicode": ""
- },
- {
- "font_class": "sound-filled",
- "unicode": ""
- },
- {
- "font_class": "spinner-cycle",
- "unicode": ""
- },
- {
- "font_class": "staff",
- "unicode": ""
- },
- {
- "font_class": "staff-filled",
- "unicode": ""
- },
- {
- "font_class": "star",
- "unicode": ""
- },
- {
- "font_class": "star-filled",
- "unicode": ""
- },
- {
- "font_class": "starhalf",
- "unicode": ""
- },
- {
- "font_class": "trash",
- "unicode": ""
- },
- {
- "font_class": "trash-filled",
- "unicode": ""
- },
- {
- "font_class": "tune",
- "unicode": ""
- },
- {
- "font_class": "tune-filled",
- "unicode": ""
- },
- {
- "font_class": "undo",
- "unicode": ""
- },
- {
- "font_class": "undo-filled",
- "unicode": ""
- },
- {
- "font_class": "up",
- "unicode": ""
- },
- {
- "font_class": "top",
- "unicode": ""
- },
- {
- "font_class": "upload",
- "unicode": ""
- },
- {
- "font_class": "upload-filled",
- "unicode": ""
- },
- {
- "font_class": "videocam",
- "unicode": ""
- },
- {
- "font_class": "videocam-filled",
- "unicode": ""
- },
- {
- "font_class": "vip",
- "unicode": ""
- },
- {
- "font_class": "vip-filled",
- "unicode": ""
- },
- {
- "font_class": "wallet",
- "unicode": ""
- },
- {
- "font_class": "wallet-filled",
- "unicode": ""
- },
- {
- "font_class": "weibo",
- "unicode": ""
- },
- {
- "font_class": "weixin",
- "unicode": ""
- }
- ];
- const getVal = (val) => {
- const reg = /^[0-9]*$/g;
- return typeof val === "number" || reg.test(val) ? val + "px" : val;
- };
- const _sfc_main$2j = {
- name: "UniIcons",
- emits: ["click"],
- props: {
- type: {
- type: String,
- default: ""
- },
- color: {
- type: String,
- default: "#333333"
- },
- size: {
- type: [Number, String],
- default: 16
- },
- customPrefix: {
- type: String,
- default: ""
- },
- fontFamily: {
- type: String,
- default: ""
- }
- },
- data() {
- return {
- icons: fontData
- };
- },
- computed: {
- unicode() {
- let code2 = this.icons.find((v2) => v2.font_class === this.type);
- if (code2) {
- return code2.unicode;
- }
- return "";
- },
- iconSize() {
- return getVal(this.size);
- },
- styleObj() {
- if (this.fontFamily !== "") {
- return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`;
- }
- return `color: ${this.color}; font-size: ${this.iconSize};`;
- }
- },
- methods: {
- _onClick(e2) {
- this.$emit("click", e2);
- }
- }
- };
- function _sfc_render$2i(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "text",
- {
- style: vue.normalizeStyle($options.styleObj),
- 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))
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_0$g = /* @__PURE__ */ _export_sfc(_sfc_main$2j, [["render", _sfc_render$2i], ["__scopeId", "data-v-d31e1c47"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uni-icons/components/uni-icons/uni-icons.vue"]]);
- function useToast() {
- const tipTitle = vue.ref("");
- const tipIcon = vue.ref("none");
- const tipEndtime = vue.ref(2e3);
- function Toast2(opt, to_url) {
- formatAppLog("log", "at hooks/useToast.js:31", "Toast", opt, to_url);
- if (typeof opt == "string") {
- to_url = opt;
- opt = {};
- }
- tipTitle.value = opt.title || "";
- tipIcon.value = opt.icon || "none";
- tipEndtime.value = opt.endtime || 1e3;
- let success = opt.success;
- if (tipTitle.value)
- uni.showToast({
- title: tipTitle.value,
- icon: tipIcon.value,
- duration: tipEndtime.value,
- success
- });
- if (to_url != void 0) {
- if (typeof to_url == "object") {
- let tab = to_url.tab || 1, url2 = to_url.url || "";
- formatAppLog("log", "at hooks/useToast.js:59", "tab", tab);
- switch (tab) {
- case 1:
- setTimeout(() => uni.switchTab({ url: url2 }), tipEndtime.value);
- break;
- case 2:
- setTimeout(() => uni.navigateTo({ url: url2 }), tipEndtime.value);
- break;
- case 3:
- setTimeout(() => {
- uni.navigateBack({ delta: 1 });
- }, tipEndtime.value);
- break;
- case 4:
- setTimeout(() => uni.reLaunch({ url: url2 }), tipEndtime.value);
- break;
- case 5:
- setTimeout(() => uni.redirectTo({ url: url2 }), tipEndtime.value);
- break;
- }
- } else if (typeof to_url == "function") {
- setTimeout(() => to_url && to_url(), tipEndtime.value);
- } else {
- setTimeout(
- () => uni.navigateTo({ url: to_url }),
- tipTitle.value ? tipEndtime.value : 0
- );
- }
- }
- }
- return {
- tipTitle,
- tipIcon,
- tipEndtime,
- Toast: Toast2
- };
- }
- let domain = "http://192.168.100.199:8081";
- const HTTP_REQUEST_URL = domain;
- const HEADER = {
- "content-type": "application/json"
- };
- const HEADERPARAMS = {
- "content-type": "application/x-www-form-urlencoded"
- };
- function baseRequest(url2, method, data, { noAuth = false, noVerify = false }, params2) {
- const { Toast: Toast2 } = useToast();
- let Url = HTTP_REQUEST_URL, header = HEADER;
- if (params2 != void 0) {
- header = HEADERPARAMS;
- }
- return new Promise((reslove, reject) => {
- Url = HTTP_REQUEST_URL;
- uni.request({
- url: Url + "/api/front/" + url2,
- method: method || "GET",
- header,
- timeout: 3e4,
- data: data || {},
- success: (res) => {
- if (noVerify)
- reslove(res.data, res);
- else if (res.data.code == 200)
- reslove(res.data, res);
- else if ([41e4, 410001, 410002, 401].indexOf(res.data.code) !== -1) {
- reject(res.data);
- } else
- Toast2({ title: res.data.message || "系统错误" });
- reject(res.data.message || "系统错误");
- },
- fail: (msg) => {
- Toast2({ title: "请求失败" });
- reject("请求失败");
- }
- });
- });
- }
- const request = {};
- ["options", "get", "post", "put", "head", "delete", "trace", "connect"].forEach(
- (method) => {
- request[method] = (api, data, opt, params2) => baseRequest(api, method, data, opt || {}, params2);
- }
- );
- function getGoodDetailId(data) {
- return request.get(`book/detail/${data}`);
- }
- function getArticleDetailId(data) {
- return request.get(`product/detail/${data}`);
- }
- const zStatic = {
- base64Arrow: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAD1BMVEVHcExRUVFMTExRUVFRUVE9CdWsAAAABHRSTlMAjjrY9ZnUjwAAAQFJREFUWMPt2MsNgzAMgGEEE1B1gKJmAIRYoCH7z9RCXrabh33iYktcIv35EEg5ZBh07pvxJU6MFSPOSRnjnBUjUsaciRUjMsb4xIoRCWNiYsUInzE5sWKEyxiYWDbyefqHx1zIeiYTk7mQYziTYecxHvEJjwmIT3hMQELCYSISEg4TkZj0mYTEpM8kJCU9JiMp6TEZyUmbAUhO2gxAQNJiIAKSFgMRmNQZhMCkziAEJTUGIyipMRjBSZkhCE7KDEFIUmTeGCHJxWz0zXaE0GTCG8ZFtEaS347r/1fe11YyHYVfubxayfjoHmc0YYwmmmiiiSaaaKLJ7ckyz5ve+dw3Xw2emdwm9xSbAAAAAElFTkSuQmCC",
- base64ArrowWhite: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEVHcEz///////////////////+IGTx/AAAABnRSTlMA/dAkXZOhASU/AAABYElEQVRYw+2YwXLCIBCGsdAHWGbyAKZ4zxi9O017rxLf/1UaWFAgA1m8dcpedNSPf/l/Vh0Ya/Wn6hN0JcGvoCqRM4C8VBFiDwBqqNuJKV0rAnCgy3AUqZE57x0iqTL8Br4U3WBf/YWaIlTKfAcELU/h9w72CSVPa3C3OCDvhpHbRp/s2vq4fHhCeiCl2A3m4Qd71DQR257mFBlMcTlbFnFWzNtHxewYEfSiaLS4el8d8nyhmKJd1CF4eOS0keLMAuSxubLBIeIGQW8YHCFFo7EH9+YDcQt9FMZEswTheaNxTHwHT8SZorJjMrEVwo4Zo0U8HSEyZvJMOg4RjnmmRr8nDYeIz3OMkbfE/QhBo+U9RnZJxjGCRh/WKmHEMWLNkfPKsGh/CWJk1JjG0kcuJggTt34VDP8aWAFhp4nybVb5+9qQhjSkIQ1pSEMa8k+Q5U9rV3dF8MpFBK+/7miVq1/HZ2qmo9D+pAAAAABJRU5ErkJggg==",
- base64Flower: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAKlBMVEVHcEzDw8Ovr6+pqamUlJTCwsKenp61tbWxsbGysrLNzc2bm5u5ubmjo6MpovhuAAAACnRSTlMA/P79/sHDhiZS0DxZowAABBBJREFUWMPtl89rE0EUx7ctTXatB3MI1SWnDbUKPUgXqh4ED8Uf7KUVSm3ooVSpSii0Fn/gD4j4o+APiEoVmos9FO2celiqZVgwgaKHPQiCCkv+F99kM7Ozm5kxq1dfD91k9pPve9/3ZjbRNHHok/mKli4eIPNgSuRObuN9SqSEzM20iGnm0yIbqCuV7NSSSIV7uyPM6JMBYdeTOanh/QihJYZsUCSby+VkMj2AvOt0rAeQAwqE3lfKMZVlQCZk1QOCKkkVPadITCfIRNKxfoJI5+0OIFtJx14CMSg1mRSDko7VAfksRQzEbGYqxOJcVTWMCH2I1/IACNW0PWU2M8cmAVHtnH5mM1VRWtwKZjOd5JbF6s1IbaYqaotjNlPHgDAnlAizubTR6ovMYn052g/U5qcmOpi0WL8xTS/3IfSet5m8MEr5ajjF5le6dq/OJpobrdY0t3i9QgefWrxW9/1BLhk0E9m8FeUMhhXal499iD0eQRfDF+ts/tttORRerfp+oV7f4xJj82iUYm1Yzod+ZQEAlS/8mMBwKebVmCVp1f0JLS6zKd17+iwRKTARVg2SHtz3iEbBH+Q+U28zW2Jiza8Tjb1YFoYZMsJyjDqp3M9XBQdSdPLFdxEpvOB37JrHcmR/y9+LgoTlCFGZEa2sc6d4PGlweEa2JSVPoVm+IfGG3ZL037iV9oH+P+Jxc4HGVflNq1M0pivao/EopO4b/ojVCP9GjmiXOeS0DOn1o/iiccT4ORnyvBGF3yUywkQajW4Ti0SGuiy/wVSg/L8w+X/8Q+hvUx8Xd90z4oV5a1i88MbFWHz0WZZ1UrTwBGPX3Rat9AFiXRMRjoMdIdJLEOt2h7jrYOzgOamKZSWSNspOS0X8SAqRYmxRL7sg4eLzYmNehcxh3uoyud/BH2Udux4ywxFTc1xC7Mgf4vMhc5S+kSH3Y7yj+qpwIWSoPTVCOOPVthGx9FbGqrwFw6wSFxJr+17zeKcztt3u+2roAEVgUjDd+AHGuxHy2rZHaa8JMkTHEeyi85ANPO9j9BVuBRD2FY5LDMo/Sz/2hReqGIs/KiFin+CsPsYO/yvM3jL2vE8EbX7/Bf8ejtr2GLN65bioAdgLd8Bis/mD5GmP2qeqyo2ZwQEOtAjRIDH7mBKpUcMoApbZJ5UIxkEwxyMZyMxW/uKFvHCFR3SSmerHyDNQ2dF4JG6zIMpBgLfjSF9x1D6smFcYnGApjmSLICO3ecCDWrQ48geba9DI3STy2i7ax6WIB62fSyIZIiO3GFQqSURp8wCo7GhJBGwuSovJBNjb7kT6FPVnIa9qJ2Ko+l9mefGIdinaMp0yC1URYiwsdfNE45EuA5Cx9EhalfvN5s+UyItm81vaB3p4joniN+SCP7Qc1hblAAAAAElFTkSuQmCC",
- base64FlowerWhite: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEX///9HcEz///////////////84chYNAAAABnRSTlP/AGzCOYZj5g1nAAACfklEQVRYw+2YTVPDIBCGtza9Jw25a0bvcax30o73OOr//yvma2F3YWlpPTijXNpAHrK8LLALVPFium2vNIFSbwGKTGQA2GUiHcD29yDNy3sMIdUBQl7r2H8mOEVqAHgPkYZUS6Qc2zYhQqtjyDZEximCZwWZLIBeIgYShs2NzxKpSUehYpMJhURGb+O+w5BpMCAREKPnCDHbIY20SzhM5yxziAXpOiBXydrekT9i5XDEq4NIIHHgyU5mRGqviII4mREJJA4QJzMiILwlRJzpKxJKvCBm8OsBBbLux0tsPl4RKYm5aPu6jw1U4mGxEUR9g8M1PcqBEp/WJliNgYOXueBzS4jZSIcgY5lCtevgDSgyzE+rAfuOTQMq0yzvoGH18qju27Mayzs4fPyMziCx81NJa5RNfW7vPYK9KOfDiVkBxFHG8hAj9txuoBuSWORsFfkpBf7xKFLSeaOefEojh5jz22DJEqMP8fUyaKdQx+RnG+yXMpe8Aars8ueR1pVH/bW3FyyvPRw90upLDHwpgBDtg4aUBNkxRLXMAi03IhcZtr1m+FeI/O/JNyDmmL1djLOauSlNflBpW18RQ2bPqXI22MXXEk75KRHTnkPkYbESbdKP2ZFk0r5sIwffAjy1lx+vx7NLjB6/E7Jfv5ERKhzpN0w8IDE8IGFDv5dhz10s7GFiXRZcUeLCEG5P5nDq9k4PFDcoMpE3GY4OuxuCXhmuyNB6k0RsLIAvqp9NE5r8ZCSS8gxnUp7ODdYhZTqxuiJ9uyJJtPmpqJ7wVj+XVieS903iViHziqAhchLEJAyb7jWU647EpUofQ0ziUuXXXhDddtlllSwjgSQu7r4BRWhQqfDPMVwAAAAASUVORK5CYII=",
- base64Success: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAElBMVEVRUVFHcExTU1NRUVFRUVFRUVFOSlSUAAAABnRSTlP/AI6+VySB3ZENAAACcElEQVRYw+2YyYKCMAyGI8hdpdxdZu7gcpdZ7jL6/s8yYheSNi0aPdqbwOffpGmaFOYPD3gj4bisN7vddv17N/JVgxn5x12IWgIaWTuO/IE3PseQbwjGPo2cgRmHFLJwdm/X643zwiqOKPPJ1nj3sjEP2iiifZWj5bhopSyGaEO2HX5fbQJzwJ+W7x/jw5ZFjsEU0PMph9xE8i5EqprKALW95eJQURkgzw98uJ/JvwGecR7bIjWWsUgVrrIfFZ2HlLy3sKETD1mmRLRMRhGVssRa0xJkdn3SpJBymBkM8+pSSDXMDNyDaToVHd2fgpNt0sjwiUZO19+jGQ+gQEg9Oq+bufmAVGihomNmjQG7UG3020vrlm7lkFnKFGU3kZ0KGAdmKe821pipQ+qEKcrZeTL2g5FsUks4cStjEZWwXg0b0n4GxmEpkWwIs5VBynjgK7xZaz1/0D7OxkVuLpsY5BQNFyLS84VBjjbg0iL2r2EQHBOxBhikuUOkdxODVF1cxHoWtPPsiyXO455Iv34hssCO8EV4ZIYTjS8SR4qYSHRiTiYQ4ZFbHi0iIhhBTi6dTCgSWRcnw4h4yGTuyTAiOGBIWGoZTgSHJQl+LcOJ4OCnW6yX2bMnJ9pidCOXtkTkTrIGpYuOynAiOF14SamMiOCk5Ke+mq8BcOrrvym8d0zKIQnWT+M1WwOQNO4fFiWb18hhERxJPx2fblbPHHyC41VyiAtKBUFBIih7JMWVoIQTFIr3lKPN80WvoLSWFPC653ioTZA0I0FrQ7qU6asaK0H7JmkSJa2ooOGVtNUsc3j9FYHkIkJy3SG6VHnfXKXGP9t4N9Q4Ye98AAAAAElFTkSuQmCC",
- base64SuccessWhite: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAGFBMVEVHcEz///////////////////////////8dS1W+AAAAB3RSTlMAiVYk6KvDHLfaegAAAo1JREFUWMPtWEtzmzAQNhCTq910ytXpiyvxTNOr60zrayepx9d02gnX4sTm7xcEiJX2gdnkGJ1A4tOnfWqXyeR1vMRYzrcPD9v5h5MBl3/Ldvx4cxIg/FWC8X0xjLjalM54uhhCfCrRuJURX0pi3EmIqZV7O59vrRZmguStHL9b7S7ftfLwOtiZDw7AHMtmquAQ12b5Wwbnordm8g9zLLO49qc/m2n6aKnhwPOGZ08hAiNHhheiHae1lOUPGZpQkPKa3q0mOUjaRzSRaGUjpy/mmWSwySSpllcEteBKAT52KEnSbblA51pJEPxBQoiH1FP4E3s5+FJv07h6/ylD6ui7B+9fq/ehrFB98ghec9EoVtyjK8pqCHLmCBOwMWSCeWFNN4MbPAk55NhsvoFHSSVR0k5TCTTEzlUGcqV/nVp7n9oIVkmtaqbAEqEgfdgHJPwsEAyZ9r4VAZXFjpEwyaw3+H2v42KYxKhs1XvY/gSSGv+IHyUSuHXCeZhLAgVI3EjgSGo1Fb3xO0tGGU9S2/KAIbtjxpJASG73qox6w5LUq0cEOa+iIONIWIilQSQ0pPa2jgaRQAgQP7c0mITRWGxpMAmEQFN2NAQJNCV0mI6GIIEO47hlQ0ORQLd0nL+hoUjg1m6I1TRr8uYEAriBHLcVFQ5UEMiBe3XkTBEG04WXlGKGxPnMS305XQPA1Ocn2JiuAZwE66fxnKwBnDTuXxZTMq85lwW6kt5ndLqZPefiU1yvmktcUSooChJF2aMprhQlnKJQ5FxRKkcVRa+itNYU8Io2oVkY14w0NMWYlqft91Bj9VHq+ca3b43BxjWJmla0sfKohlfTVpPN+93L/yLQ/IjQ/O5Q/VR5HdL4D7mlxmjwVdELAAAAAElFTkSuQmCC",
- base64Empty: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAMAAAAL34HQAAALeGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDIgNzkuMTY0NDg4LCAyMDIwLzA3LzEwLTIyOjA2OjUzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIiB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDIyLTAyLTIyVDIxOjIxOjQ1KzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDI0LTAxLTEzVDE5OjA5OjQwKzA4OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyNC0wMS0xM1QxOTowOTo0MCswODowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ZWQwMWYzNWQtOWRjOC00MDBiLWEyMmQtNjM5OGZiNzVhNGRiIiB4bXBNTTpEb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6ZDhlMzQ3ZmEtMDY2My1jYTRiLTgzNTctNTk4YjBkNGIzOTU2IiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6ZDA4MDI4MDItMzUyYS04NTRhLTkxYjctNmRlNmQ1MmViM2QwIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiBwaG90b3Nob3A6SUNDUHJvZmlsZT0ic1JHQiBJRUM2MTk2Ni0yLjEiIHRpZmY6T3JpZW50YXRpb249IjEiIHRpZmY6WFJlc29sdXRpb249IjMwMDAwMDAvMTAwMDAiIHRpZmY6WVJlc29sdXRpb249IjMwMDAwMDAvMTAwMDAiIHRpZmY6UmVzb2x1dGlvblVuaXQ9IjIiIGV4aWY6Q29sb3JTcGFjZT0iMSIgZXhpZjpQaXhlbFhEaW1lbnNpb249IjMwMCIgZXhpZjpQaXhlbFlEaW1lbnNpb249IjMwMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZDA4MDI4MDItMzUyYS04NTRhLTkxYjctNmRlNmQ1MmViM2QwIiBzdEV2dDp3aGVuPSIyMDIyLTAyLTIyVDIxOjIxOjQ1KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjQwNjg2NzJkLWY5NDMtOTU0Mi1iMDBiLTVlMDExNmE1NmIzZSIgc3RFdnQ6d2hlbj0iMjAyNC0wMS0xM1QxMDoyNjoxNiswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDphYmJkZmUyZC0xY2Q2LTJiNDgtYjUyNS05YzlhZjdlNjA4NDMiIHN0RXZ0OndoZW49IjIwMjQtMDEtMTNUMTE6MjM6NDArMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE5IChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY29udmVydGVkIiBzdEV2dDpwYXJhbWV0ZXJzPSJmcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJkZXJpdmVkIiBzdEV2dDpwYXJhbWV0ZXJzPSJjb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZyIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6YTQ5MjM5MDAtNDhiZC03YTQ1LWI4NGItYmVlZTVjOWUxYTM1IiBzdEV2dDp3aGVuPSIyMDI0LTAxLTEzVDExOjIzOjQwKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOmVkMDFmMzVkLTlkYzgtNDAwYi1hMjJkLTYzOThmYjc1YTRkYiIgc3RFdnQ6d2hlbj0iMjAyNC0wMS0xM1QxOTowOTo0MCswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIyLjAgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmFiYmRmZTJkLTFjZDYtMmI0OC1iNTI1LTljOWFmN2U2MDg0MyIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjM2ZGQ4NTQxLWQ0MWEtYmY0Yy1iZjA3LWNmNjZhNjZhMDg2MSIgc3RSZWY6b3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmQwODAyODAyLTM1MmEtODU0YS05MWI3LTZkZTZkNTJlYjNkMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pm30U/gAAAAJcEhZcwAALiMAAC4jAXilP3YAAAA/UExURUdwTODg4O3t7e7u7unp6d7e3uTk5M/Pz8nJyePj4+jo6Pj4+MrKyszMzO7u7unp6fb29vLy8vr6+v7+/sHBweag3xAAAAAOdFJOUwAxia5pF0n+/vzX3KbULQ2DYQAACG1JREFUeNrtm4l2o7gShi20IWFrAd7/WUc7EosDWKZ976Hc7WTmdMKXv0qlqpLyeNx222233Xbbbbfddtv/mOHn8xexSNsiRH5PrbFtW4p+DetpsF4v8Gs+HA3WEwOAfwzriYxaLTVsP8X1QK0z+vqQCzewYogi60aL9SEX5oyxphYVCFTGjfSJCTmN1jBruN5KTGCUS8bhySQGHRaohmW4glwtldbOeYJYKlgvbyUuA8aFFEKc++aIM4hrRnyiMnIZKq1PrihcM3GNKboMF1Naa9X9+8T1KrxIlVbGjv3cAEHOYYMqqgUsVuJqqehV3+sjDwB+DTJp0lYtMCyZpxqjF4e+74+sRcQSFZO8UonUSEFzuUY+DKo59A2kZDatGCjzCauy/2AmhSyCq0WHEj0KTNJDmVeNhErMt1Q8W4xti4/FwMJ4jaxl05TKFiNtD3kBGrHnhiph9V0eXQc6DkyE2xX830AlKshFTErXeuCZXK/9m41wFsGSfZ4lcGeyZ98PrylJ7MWCojQZ3qSukL2QslgdngqJnTEPdTJhXvbNBoR/+7wabIxWduN/Ja5dWEivm4XSZ2uQckNzmRlHrn2lc6eiafvS4V2Hd12tesau8toZW0CtWoZYb9t+OqxdCYKYjVPF16pVbILIy/gR7MVaWMHYPCoa2VkzkX4Iry2rirXbumGyAjGC1h62YLw6ApsNKZph3fpIWHt08JovRWD62sejpXhTrhWrPpl6zZ6PW2oTG5ltlvgtF6weNYCWKeJJSfg4W6PNJlj3sVZgOXV4lc8n4RlkMTLEBDVoYc3nI09kpyzzfgWsjyzBZSNDKF2/wjh+sxYvn8Y1scxlfLF9T1RBO3wVHsnq8Fk4oGkEh/0KJPSa8T2CeWE5X9BPmgLsaRIGeNL2kshCsWoLBmdPJW5Wbz1ndAKUXjPwxXYAUpSV3fy5BJg1aa1tyVXHHMgVH31ewDVrleHr9XqC684SUF4mecR3+wW5SC2QNvxUizRv98mLDhPgYiMDb+v8g0OADxqxcnf9w01mZYJF0fUVP5LcdswbsMmy1DVs5PlE5NpNiTR8M8qAWZkOy6aN13VcoOF2/s3xn3Mes8Xza05tgR/BuNz69nlNzMR0fH45p+G4R9oxh2mKt9MF4J7K/lvWUojwF5nCgCpuRUptnZMQ3au0nSo2UsHgV3xpmeLYzGml3ZFBBzYGPCpOQRwXs1/GG1J74dlZc6JKUOtjBAz9XjVxucGWHbZVJDPJQGYDRl1Qmf1ovk2Sbghb6MQlnF7mBzM1bgOqJAPpoOQaVe+4Skcit3uqHMyG/Sh1rHNN0gAfM0nnPrmulfLVBSm20TSZSdWa0LJl2ukVyE4vTYCgP3uQkwv1TKtQWgxDzBSg80OQjCs4klKvuUzHLCfIbDKIE/S5VIGqD1iD2819pkAqTWdmeina+oZABi7X5B1MGoTJqJSchuk6JNHcgUPAcsVFk0+N0oDN68Vo7FQSmCXjx46OEtUk1lpY2ZFQGr/AcpqVato4wPUD+RhfAeyQI5sJ6l2sDwnKqNFSJvpiyJbFl3kTOjZ2ievwCR7hkUoWeV2vOLAXvB39AJoyqYa81A5cvaAidXYTFTycKDBcalVK5f3XS89kzLVl9txfL+K+p6NUnitz5KkKm7D3DrRPNq4bk7l20aFRppNilmuQI+uzTtj9wPBkTsVwM7HbJ5pwGgujyRyZDzQLNoiRFluRtQ+GzEguqRxUL+ZMFqulMzIfaP3ARj2k/txB8c+2HyjmDizCaVWtNoE5MvMlKs/4VQ7HUJZCrU6qCKcNJ2aSWUZhJZu4VI0LB4CHFdj77DRuGi28WKAxoRyZyzGVrmc0jmk1nP5QaxZo1puqq1YIAqgZb8e/rABZJWNCNxV7DSTpOO7Aail9J9nYHtua/4ouE/aS0X1qtXQzwGx+rnbi2vhF/TfZG52oc6DPo1WCi3RTDnRk7TEntoEp38gg+DjYs2opkR3JW5EpL9rU0XSK5/6LOTAVS+72x7pm60zSf5HMdldjhzJqw1FRcxXdS3ZNZp0s92FiyluUvBPoD9ynZNkBiu2NF11ofnlnQbZgKqvusj9R/f6DOzgVsahbNlXxlsxU8y7qrbTupitRyxFBKG6H3aEPUqj7YrzAymq41FXlZLlO4WLbvG2Kg4vYB+wPfWS2B5Rq8TW9ROpAZbiF6MmCTsx1NLLsx7NOoOiZup2CNbZ36xc96ErcxzuILGrmmFhimjtwKo/yTm7feTVwB61IzbnW4967Kt3cDDotGt8JKrTiUyO3Uy2PZZt9tapXEfXhWmTgcoB+JchFWsiCKvYnhmn/tKuJDbgly897FnFfkE1rQLKy810OU7xW3bEJHCD5gERtuTGuxoJqA6qI9TNMa6MbvZomsiubbPYx78YXDaaRqqsyqfSaLZdjYGHLu65rDgydXCWm1P5EvcQ828f9pcBapTILSMv1nZCAc0WzFIFsGfUi/kmAxc6cFqDSYuPSMIbs1OVrwITTQM9HVRFJ5JL56qcoFzzT1uVcd2v9jFw8BHlcWtmEI86hp5Dy/zOlK8cUp/rVseRUBqawz6kmAcPLM9l5m8h4V53Iz/2mFJaTCvF8JbsMvPjU/7crbUXart0v4WyE0LnDPcAX95Knj4VUE8HCdNdUP8BDcOXKdPl4uSWbh4LfOV0HDdfipOmu+eIRrDsNPkIT7np/8ZAzVdOd1u8wHIqeXt8VqtgiO50ePeNaGG+uO9rHiKdL71pnIun8jxEKXv2r2HYBzO/mz96vFKoMM5WLk7tQXS9U5kwCu5lk7n6++kdCFWRaTUzm0/5fClWGWTrM/AGhCrJO/ZBQhTPFLwmV7ebgcdttt91222233Xbbbf+H9h+2WEtdHVinLAAAAABJRU5ErkJggg==",
- base64Error: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAMAAAAL34HQAAALeGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDIgNzkuMTY0NDg4LCAyMDIwLzA3LzEwLTIyOjA2OjUzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIiB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDIyLTAyLTIyVDIxOjIxOjQ1KzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDI0LTAxLTEzVDE5OjEwOjEwKzA4OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyNC0wMS0xM1QxOToxMDoxMCswODowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTQ3NTExNjAtZDY5MC00ZTkzLWFhNGUtNGMwYTViNGU1ZGFjIiB4bXBNTTpEb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YzRiNzlkYWMtZTJmYS1iNzQ0LWIxM2ItOWU1N2VjMDhhM2YwIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6ZDA4MDI4MDItMzUyYS04NTRhLTkxYjctNmRlNmQ1MmViM2QwIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiBwaG90b3Nob3A6SUNDUHJvZmlsZT0ic1JHQiBJRUM2MTk2Ni0yLjEiIHRpZmY6T3JpZW50YXRpb249IjEiIHRpZmY6WFJlc29sdXRpb249IjMwMDAwMDAvMTAwMDAiIHRpZmY6WVJlc29sdXRpb249IjMwMDAwMDAvMTAwMDAiIHRpZmY6UmVzb2x1dGlvblVuaXQ9IjIiIGV4aWY6Q29sb3JTcGFjZT0iMSIgZXhpZjpQaXhlbFhEaW1lbnNpb249IjMwMCIgZXhpZjpQaXhlbFlEaW1lbnNpb249IjMwMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZDA4MDI4MDItMzUyYS04NTRhLTkxYjctNmRlNmQ1MmViM2QwIiBzdEV2dDp3aGVuPSIyMDIyLTAyLTIyVDIxOjIxOjQ1KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjQwNjg2NzJkLWY5NDMtOTU0Mi1iMDBiLTVlMDExNmE1NmIzZSIgc3RFdnQ6d2hlbj0iMjAyNC0wMS0xM1QxMDoyNjoxNiswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpjZjk1NTE1OC04MjFiLTA4NDUtYWJmNS05YTE1NGM1ZTY4NjEiIHN0RXZ0OndoZW49IjIwMjQtMDEtMTNUMTE6MDQ6MDQrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE5IChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY29udmVydGVkIiBzdEV2dDpwYXJhbWV0ZXJzPSJmcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJkZXJpdmVkIiBzdEV2dDpwYXJhbWV0ZXJzPSJjb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZyIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZGM1Y2IyNWItZDZlNC0yZjQ2LTgyODQtZmUwOTNlY2M2ZTkxIiBzdEV2dDp3aGVuPSIyMDI0LTAxLTEzVDExOjA0OjA0KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjE0NzUxMTYwLWQ2OTAtNGU5My1hYTRlLTRjMGE1YjRlNWRhYyIgc3RFdnQ6d2hlbj0iMjAyNC0wMS0xM1QxOToxMDoxMCswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIyLjAgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmNmOTU1MTU4LTgyMWItMDg0NS1hYmY1LTlhMTU0YzVlNjg2MSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjM2ZGQ4NTQxLWQ0MWEtYmY0Yy1iZjA3LWNmNjZhNjZhMDg2MSIgc3RSZWY6b3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmQwODAyODAyLTM1MmEtODU0YS05MWI3LTZkZTZkNTJlYjNkMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ph2LDQsAAAAJcEhZcwAACxMAAAsTAQCanBgAAAA5UExURUdwTNra2s7Ozq2tre3t7dPT087OzuPj4+3t7dbW1u/v79bW1vz8/MrKytDQ0Nzc3MPDw/X19bi4uMZQDnEAAAAKdFJOUwBqEPywotz+wzqApqiTAAAHW0lEQVR42u1b25akIAwcbx2UFoj//7HLTQVBRcSZfTDnbM/uTl/KSlEkwf75eeONN95444033njjjTduR9/0/yOsbqoevObL7101tYX1HFs9QFtfZalRP+rpQVgdAFx990ZnT8L6eZItUl99jeGpf1DxdV/VP9fV1f/PFlF1bYHoVFSRC60IyVjrFRnuB8IoxpExSrstsErKHpJw1eqybNLbAQvAYkKjUrjoBgKRqAaeIjG5+qaps6hKcMWmcdSwqAJWBbAgCZZaIYbsqggqqlHNbFFa5yVR4jKvrKEErOEjNCqNSwHrfE8lpLsod/u+cOPPMPBJ+Gz5dM0cXNgclre+pSxhYI1WW5Tf9ENSMIdLCiWs6q9hwQprBVYKFqyPlx4WtoSvrT9lC/wkGt8qlkQooC3hi6sgW3Bb8gtdpSV/za/mn49pC0oYhONbfyd5hzDLFivKFpTS1gKM0we0tQCEncfgQn7Rt+DC/299i1MSRJcBC0r7VviG5KZvwV5WIUobxHyrJKy8VRjXVgFYsPu5kOtbxdhycCDuihziXVLoW7xwEiUmDgd544B46luWLW+nugMLB2BimmC3cxTNxCDg8xFtuUSNqoFsDKzY8psa+XtBNWXr74N6qxwsS5T6VL5robKl10+ZRu5S9qBvUYuJwVHzjwjrE3G33qKh+WXBgmkmCvHYquTvZ8oo7rLFA4PJgYW0MdePIRQIGUPNbSMw5lubJMKtJI6+Wk6cVFMmACO+VVryeL7ZgI8MhwS2fnNPPK0geHBRd11eJSiyL4KjrL2umm1XIpRii1MKB/mU/iCZwF+pt5z3UJ7UiF3nQqadAXC3T3xEW2IyuDBe3yDTe0+A64it2WTyYSGVHymUI/EduvSWKJ80Dtv2NbYSoQxbMkVC7yzNGIWFvDF7gRD79RYrWW/BDGti4wwLtgvO7gWKUZ8Mt94qX8vLJE70+xVNwzDm9ghNM+FX7p/jlZUId2HJD+Tf79hMe3WNrAK/30E+C8/6xOCqbqxE5JNMYrNbnaLUvJAewfCg8zF0Ba/tbviWLvPYfsGFA1PVD8ZdnjlVc/DS/o7LK4NHjOjKKbfCTSCo5XmwKbaZM4jlc9NGEYd9Ijd0QS5ZGaOR2O+DPlGyRb2nXZzgnI1GdFWF+0gh3ifyTRqvzpXI2eElk58FeHziCF5hY+hSMV9Ge/mohUTGuQ4vzHYe8bW5sNdFQ58St22Vcf5zzJbtcGT4iYQ7iz8dFuxoWRYMjAM7KCnypHOTLSqdUwYIFpndOD/6B2FBzNQxYmW/zxYE4j8yLHga1s2Rbm/O5PXtGcuNDIW1dTj5hpjGsO+7z2Kk9NP1JWDlnWKAM4H6zCUNM05KyVPHBclYzUbgjE3N3tP2JWHBmbqD4GLeCs2jhMT13lMVljwcEbetwZgtHUxVQ21ho3fE7inf2s8vzMWq0EWpfOBg5hcDSGwaF2+LaysRIzNFqRgBv2sMhi/Ix0WiW8rBKNBv4ExBI7eorx9ANazsPCb5FkSNH+Reacos+AYxaFzX76KMH65c8ytzZ40YvpFAqtgC/otn1eCmMI5K8yVRQVVwq3aVtU+jJktwjyP7x+BKv8vtoH098vXYSJcrWGJcAW11r8WVRxe5vgcuFbXqwnaEZejS6mrLwYKUg1ch2RJswTFYgMOwoau+AQsSp/FuDhVZi7J402ifgGla/GJIzGLYG5H4rnKMCUydL9wcsmZSuPikR2QmjQbWqaV2ob2RdMvaLEvFlRiXpYeTwqVOtMZF+qi0dS4uEjJKMvWuYK3S0jHZwaq7BylYp/O2uu3q04lNqudLWEJQd/3paTBz12IaLIPtzE5P1AUuW9TB8NVzaG9/TIfV+eXsWeezz6HWlptEbo4SIAeWur/Y/RZC/gmZTiLzUY2j5ct6fjKsFvxqgyQxE9sbmfYtnJMIciEKo6+FL0wziJmtkzspIcUl0PgWrL7VCKP7hl61U4WLeN+7Ieli2vZhmq0VgjDOgIyhJ62sSpDkWNZa1wiB8WoLlxzy29XpGVPgn1ut5VYcGyRLK7OCiJaDYMrAneJUkZWdw0yDgNm5nDowqLc0Kp581FO7QS4pC9S/YRW9xkVdNOj0ZHCp9anEZw3VEK/fopiDrkMObkcdJtT1g6+uzQ60bIdUPztdWZWy53m+v/zFYPOGHO4AZsalmtJNkyHrCAx1RXX7mt5g1L1pDezpkXv8wJwpVRSSaf2c26Y0rrXXxyWBptu/ovdak+VhkqjGBZUdvKygqANKA/MqZ/36kcGwFn90RnWp66ksKuHgitLFY8BU+F2ZvqpxpMY9qR3YwOUJ12fc0KUHVKdswcKXuwetErCnwvMKuXxfc/3RVJ2yFc+iosQd3X+WGSVz1UiuN2J156FyVyHbsOUp3krezaPUT/VxXqdfwvknb/Zgp+idTxTbrkLqYuKreRnhy65Gf4W0NsDoYiqf6uZsvr8V9eo6XWc5+3TVf/3N1TfeeOONN95444033njjjTfeSI1/IeOYOeO4fGAAAAAASUVORK5CYII=",
- base64BackToTop: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAAElBMVEVRUVH+/v5HcEyZmZlRUVFRUVGm1ByOAAAABnRSTlPMzADMTZAJBBGsAAAEnElEQVR42t2cS27jMAyGf7/2U+QCQeDsbeQCgZDujaC5/1UmkzaJn+JDFGcw3LdfflKibJkkDnxrL7dbg7sNt6+L4O8OYBM+B0ys+QrGkHZG+OEEQ8g6go8Bx1GIGMdpNOQyIG6XdMgnSPtKhLQDGEZFBgYMkhKFtGBb0EIEjDgFRowoBVaMGAWpMedEfxMiZtwpUsgZCqtlkCNUdpVAWigtCCCDFtLwIWeoreZCWiRYYEKGFEjDg+yRZCUH0iLRAgNyToXUNCRZyMqWhGnUN2IPm3wSlwJ7IUspyCBkIQUZhCykIIeQuRTkEDKXAuM9srrtYbrZN7Y98giZSoFd+t1OxmMITG0dcrSFXFchZ1tIvQZpYWxhBbK3hpQrkMEa0iwh5t4a+QvZvDXyF7J5a+Qv5PPW21/I5623v5DPW29/IaO3Xv5Clrw1y1/Ikrdm+Qs5svw83yNnSJ5BQb4F/F7EIEJSnThGBAXxkFQfLOviQUE8JAUPsosHBfGQfDAtHhREQ1JxIV00KIgmrnRI84S0yAd5BAXxxJUck0f6Qnwr9qmr6xF5xLMjcwn/iudIEAdWnyjkEXlQKZiRVzoqRyLbgeUKKR8Q4alY7cSnoxzSf2ggsqehKr6YVpcXpOd7H93f60cKhOd7Re2LteUF4eLqiVS1mr0ge4io6C2+soaFkJ7MuuuQs1yITEp9hwwKISIpzR2iESKSIoT0rLNwuVHQqoSIpAQJpGce60vIUSdEIuUqgPTsJ5QFZK8UIpBS8iG94GFrDjlrhfCl8CG96Llxmle4kEr6vKWBPIVo9kqDQSRk9/3cWoikcCFPAd33v4dIChPyEvLzBA6RlEYWke4JEUnhKXkLeUEKxRHJFfKCQHGucIW8IdZSRkLeEGMpYyEjiK2UsZARxFTKRMgYYillImQMMZQyFTKB2EmZCplAuFLIHT8TMoWwpQwiIVMIUwqpZP5bp5CCvCTiQKr5f5lCQN+tPCBn2ZvVDFJwIDUP0m1BYAfZYRNSsCB7BqTbhoARePIxtZ9tgwWkoJcwCalmv3MBAemtO4R6dah2HaKQqj8Zvp9sQDjvJ21+SPCBHPJDDk6QITekEV7gqCC19CpKAym9IMfckKv4olMBCeIrWwVEfvkshzQekO9r9P1/ALk+IG1eSPCDiCJfyG+FyU+A6ZCa/piZDinpz7LpkCv5gdkAEshP5emQhv7onw6pGeULyZCSUYiRDAmMkpJkCKs4JhFSq8p8hJBSVbAkhARV6ZUQoisik0FqXTmcDHLVFfbJIEFXoiiCNMpiSxGkVJaNiiBBWQArgTTaUl4JpNQWJUsgQVteXQg+AKkLxQWFGKW+5J2+eVp4S168X3CF1CltCKdTJ8lb84YK2bUBO+wZW0Pqv9nk4tKu49N45NJC5dMM5tLW5tOg59Jq6NM06dL+abFXwr/RkuvTXJwae1abtE/Dt0/ruksTvs84AZ/BCC4jHnyGVfiM3VBQFANEXEah+Ax18RlP4zNox2dkkM/wI58xTn8yDCXGYCDV3W5RGSajtXyGhG1jbpbjzpwGt/0MJft8jqC7iUbQ/QZaxdnKqcIftwAAAABJRU5ErkJggg=="
- };
- const _sfc_main$2i = {
- name: "z-paging-empty-view",
- data() {
- return {};
- },
- props: {
- // 空数据描述文字
- emptyViewText: {
- type: String,
- default: "没有数据哦~"
- },
- // 空数据图片
- emptyViewImg: {
- type: String,
- default: ""
- },
- // 是否显示空数据图重新加载按钮
- showEmptyViewReload: {
- type: Boolean,
- default: false
- },
- // 空数据点击重新加载文字
- emptyViewReloadText: {
- type: String,
- default: "重新加载"
- },
- // 是否是加载失败
- isLoadFailed: {
- type: Boolean,
- default: false
- },
- // 空数据图样式
- emptyViewStyle: {
- type: Object,
- default: function() {
- return {};
- }
- },
- // 空数据图img样式
- emptyViewImgStyle: {
- type: Object,
- default: function() {
- return {};
- }
- },
- // 空数据图描述文字样式
- emptyViewTitleStyle: {
- type: Object,
- default: function() {
- return {};
- }
- },
- // 空数据图重新加载按钮样式
- emptyViewReloadStyle: {
- type: Object,
- default: function() {
- return {};
- }
- },
- // 空数据图z-index
- emptyViewZIndex: {
- type: Number,
- default: 9
- },
- // 空数据图片是否使用fixed布局并铺满z-paging
- emptyViewFixed: {
- type: Boolean,
- default: true
- },
- // 空数据图中布局的单位,默认为rpx
- unit: {
- type: String,
- default: "rpx"
- }
- },
- computed: {
- emptyImg() {
- return this.isLoadFailed ? zStatic.base64Error : zStatic.base64Empty;
- },
- finalEmptyViewStyle() {
- this.emptyViewStyle["z-index"] = this.emptyViewZIndex;
- return this.emptyViewStyle;
- }
- },
- methods: {
- // 点击了reload按钮
- reloadClick() {
- this.$emit("reload");
- },
- // 点击了空数据view
- emptyViewClick() {
- this.$emit("viewClick");
- }
- }
- };
- function _sfc_render$2h(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass({ "zp-container": true, "zp-container-fixed": $props.emptyViewFixed }),
- style: vue.normalizeStyle([$options.finalEmptyViewStyle]),
- onClick: _cache[1] || (_cache[1] = (...args) => $options.emptyViewClick && $options.emptyViewClick(...args))
- },
- [
- vue.createElementVNode("view", { class: "zp-main" }, [
- !$props.emptyViewImg.length ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: vue.normalizeClass({ "zp-main-image-rpx": $props.unit === "rpx", "zp-main-image-px": $props.unit === "px" }),
- style: vue.normalizeStyle([$props.emptyViewImgStyle]),
- src: $options.emptyImg
- }, null, 14, ["src"])) : (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- class: vue.normalizeClass({ "zp-main-image-rpx": $props.unit === "rpx", "zp-main-image-px": $props.unit === "px" }),
- mode: "aspectFit",
- style: vue.normalizeStyle([$props.emptyViewImgStyle]),
- src: $props.emptyViewImg
- }, null, 14, ["src"])),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["zp-main-title", { "zp-main-title-rpx": $props.unit === "rpx", "zp-main-title-px": $props.unit === "px" }]),
- style: vue.normalizeStyle([$props.emptyViewTitleStyle])
- },
- vue.toDisplayString($props.emptyViewText),
- 7
- /* TEXT, CLASS, STYLE */
- ),
- $props.showEmptyViewReload ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 2,
- class: vue.normalizeClass({ "zp-main-error-btn": true, "zp-main-error-btn-rpx": $props.unit === "rpx", "zp-main-error-btn-px": $props.unit === "px" }),
- style: vue.normalizeStyle([$props.emptyViewReloadStyle]),
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.reloadClick && $options.reloadClick(...args), ["stop"]))
- },
- vue.toDisplayString($props.emptyViewReloadText),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_0$f = /* @__PURE__ */ _export_sfc(_sfc_main$2i, [["render", _sfc_render$2h], ["__scopeId", "data-v-b7999e14"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/z-paging/components/z-paging-empty-view/z-paging-empty-view.vue"]]);
- const c$1 = {
- // 当前版本号
- version: "2.8.7",
- // 延迟操作的通用时间
- delayTime: 100,
- // 请求失败时候全局emit使用的key
- errorUpdateKey: "z-paging-error-emit",
- // 全局emit complete的key
- completeUpdateKey: "z-paging-complete-emit",
- // z-paging缓存的前缀key
- cachePrefixKey: "z-paging-cache",
- // 虚拟列表中列表index的key
- listCellIndexKey: "zp_index",
- // 虚拟列表中列表的唯一key
- listCellIndexUniqueKey: "zp_unique_index"
- };
- const zLocalConfig = {};
- const storageKey = "Z-PAGING-REFRESHER-TIME-STORAGE-KEY";
- let config$2 = null;
- let configLoaded = false;
- let cachedSystemInfo = null;
- const timeoutMap = {};
- function gc(key, defaultValue) {
- return () => {
- _handleDefaultConfig();
- if (!config$2)
- return defaultValue;
- const value2 = config$2[key];
- return value2 === void 0 ? defaultValue : value2;
- };
- }
- function getTouch(e2) {
- let touch = null;
- if (e2.touches && e2.touches.length) {
- touch = e2.touches[0];
- } else if (e2.changedTouches && e2.changedTouches.length) {
- touch = e2.changedTouches[0];
- } else if (e2.datail && e2.datail != {}) {
- touch = e2.datail;
- } else {
- return { touchX: 0, touchY: 0 };
- }
- return {
- touchX: touch.clientX,
- touchY: touch.clientY
- };
- }
- function getTouchFromZPaging(target) {
- if (target && target.tagName && target.tagName !== "BODY" && target.tagName !== "UNI-PAGE-BODY") {
- const classList = target.classList;
- if (classList && classList.contains("z-paging-content")) {
- return {
- isFromZp: true,
- isPageScroll: classList.contains("z-paging-content-page"),
- isReachedTop: classList.contains("z-paging-reached-top"),
- isUseChatRecordMode: classList.contains("z-paging-use-chat-record-mode")
- };
- } else {
- return getTouchFromZPaging(target.parentNode);
- }
- } else {
- return { isFromZp: false };
- }
- }
- function getParent(parent) {
- if (!parent)
- return null;
- if (parent.$refs.paging)
- return parent;
- return getParent(parent.$parent);
- }
- function consoleErr(err) {
- formatAppLog("error", "at uni_modules/z-paging/components/z-paging/js/z-paging-utils.js:73", `[z-paging]${err}`);
- }
- function delay(callback, ms = c$1.delayTime, key) {
- const timeout2 = setTimeout(callback, ms);
- if (!!key) {
- timeoutMap[key] && clearTimeout(timeoutMap[key]);
- timeoutMap[key] = timeout2;
- }
- return timeout2;
- }
- function setRefesrherTime(time, key) {
- const datas = getRefesrherTime() || {};
- datas[key] = time;
- uni.setStorageSync(storageKey, datas);
- }
- function getRefesrherTime() {
- return uni.getStorageSync(storageKey);
- }
- function getRefesrherTimeByKey(key) {
- const datas = getRefesrherTime();
- return datas && datas[key] ? datas[key] : null;
- }
- function getRefesrherFormatTimeByKey(key, textMap) {
- const time = getRefesrherTimeByKey(key);
- const timeText = time ? _timeFormat(time, textMap) : textMap.none;
- return `${textMap.title}${timeText}`;
- }
- function convertToPx(text) {
- const dataType = Object.prototype.toString.call(text);
- if (dataType === "[object Number]")
- return text;
- let isRpx = false;
- if (text.indexOf("rpx") !== -1 || text.indexOf("upx") !== -1) {
- text = text.replace("rpx", "").replace("upx", "");
- isRpx = true;
- } else if (text.indexOf("px") !== -1) {
- text = text.replace("px", "");
- }
- if (!isNaN(text)) {
- if (isRpx)
- return Number(rpx2px(text));
- return Number(text);
- }
- return 0;
- }
- function rpx2px(rpx) {
- return uni.upx2px(rpx);
- }
- function getSystemInfoSync(useCache = false) {
- if (useCache && cachedSystemInfo) {
- return cachedSystemInfo;
- }
- const infoTypes = ["DeviceInfo", "AppBaseInfo", "WindowInfo"];
- const { deviceInfo, appBaseInfo, windowInfo } = infoTypes.reduce((acc, key) => {
- const method = `get${key}`;
- if (uni[method] && uni.canIUse(method)) {
- acc[key.charAt(0).toLowerCase() + key.slice(1)] = uni[method]();
- }
- return acc;
- }, {});
- if (deviceInfo && appBaseInfo && windowInfo) {
- cachedSystemInfo = { ...deviceInfo, ...appBaseInfo, ...windowInfo };
- } else {
- cachedSystemInfo = uni.getSystemInfoSync();
- }
- return cachedSystemInfo;
- }
- function getTime() {
- return (/* @__PURE__ */ new Date()).getTime();
- }
- function getInstanceId() {
- const s2 = [];
- const hexDigits = "0123456789abcdef";
- for (let i2 = 0; i2 < 10; i2++) {
- s2[i2] = hexDigits.substr(Math.floor(Math.random() * 16), 1);
- }
- return s2.join("") + getTime();
- }
- function wait(ms) {
- return new Promise((resolve) => {
- setTimeout(resolve, ms);
- });
- }
- function isPromise(func2) {
- return Object.prototype.toString.call(func2) === "[object Promise]";
- }
- function addUnit$1(value2, unit) {
- if (Object.prototype.toString.call(value2) === "[object String]") {
- let tempValue = value2;
- tempValue = tempValue.replace("rpx", "").replace("upx", "").replace("px", "");
- if (value2.indexOf("rpx") === -1 && value2.indexOf("upx") === -1 && value2.indexOf("px") !== -1) {
- tempValue = parseFloat(tempValue) * 2;
- }
- value2 = tempValue;
- }
- return unit === "rpx" ? value2 + "rpx" : value2 / 2 + "px";
- }
- function deepCopy(obj) {
- if (typeof obj !== "object" || obj === null)
- return obj;
- let newObj = Array.isArray(obj) ? [] : {};
- for (let key in obj) {
- if (obj.hasOwnProperty(key)) {
- newObj[key] = deepCopy(obj[key]);
- }
- }
- return newObj;
- }
- function useBufferedInsert(fn, delay2 = 50) {
- let buffer = [];
- let timer = null;
- let latestArgs = [];
- return function insertBuffered(data, ...args) {
- const newData = Object.prototype.toString.call(data) !== "[object Array]" ? [data] : data;
- buffer.push(...newData);
- latestArgs = args;
- if (!timer) {
- timer = setTimeout(() => {
- fn(buffer.length === 1 ? buffer[0] : buffer, ...latestArgs);
- buffer = [];
- timer = null;
- }, buffer.length === 1 ? 10 : delay2);
- }
- };
- }
- function _handleDefaultConfig() {
- if (configLoaded)
- return;
- if (zLocalConfig && Object.keys(zLocalConfig).length) {
- config$2 = zLocalConfig;
- }
- if (!config$2 && uni.$zp) {
- config$2 = uni.$zp.config;
- }
- config$2 = config$2 ? Object.keys(config$2).reduce((result, key) => {
- result[_toCamelCase(key)] = config$2[key];
- return result;
- }, {}) : null;
- configLoaded = true;
- }
- function _timeFormat(time, textMap) {
- const date3 = new Date(time);
- const currentDate = /* @__PURE__ */ new Date();
- const dateDay = new Date(time).setHours(0, 0, 0, 0);
- const currentDateDay = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
- const disTime = dateDay - currentDateDay;
- let dayStr = "";
- const timeStr = _dateTimeFormat(date3);
- if (disTime === 0) {
- dayStr = textMap.today;
- } else if (disTime === -864e5) {
- dayStr = textMap.yesterday;
- } else {
- dayStr = _dateDayFormat(date3, date3.getFullYear() !== currentDate.getFullYear());
- }
- return `${dayStr} ${timeStr}`;
- }
- function _dateDayFormat(date3, showYear = true) {
- const year = date3.getFullYear();
- const month = date3.getMonth() + 1;
- const day = date3.getDate();
- return showYear ? `${year}-${_fullZeroToTwo(month)}-${_fullZeroToTwo(day)}` : `${_fullZeroToTwo(month)}-${_fullZeroToTwo(day)}`;
- }
- function _dateTimeFormat(date3) {
- const hour = date3.getHours();
- const minute = date3.getMinutes();
- return `${_fullZeroToTwo(hour)}:${_fullZeroToTwo(minute)}`;
- }
- function _fullZeroToTwo(str) {
- str = str.toString();
- return str.length === 1 ? "0" + str : str;
- }
- function _toCamelCase(value2) {
- return value2.replace(/-([a-z])/g, (_2, group1) => group1.toUpperCase());
- }
- const u$1 = {
- gc,
- setRefesrherTime,
- getRefesrherFormatTimeByKey,
- getTouch,
- getTouchFromZPaging,
- getParent,
- convertToPx,
- getTime,
- getInstanceId,
- consoleErr,
- delay,
- wait,
- isPromise,
- addUnit: addUnit$1,
- deepCopy,
- rpx2px,
- getSystemInfoSync,
- useBufferedInsert
- };
- const Enum = {
- // 当前加载类型 refresher:下拉刷新 load-more:上拉加载更多
- LoadingType: {
- Refresher: "refresher",
- LoadMore: "load-more"
- },
- // 下拉刷新状态 default:默认状态 release-to-refresh:松手立即刷新 loading:刷新中 complete:刷新结束 go-f2:松手进入二楼
- Refresher: {
- Default: "default",
- ReleaseToRefresh: "release-to-refresh",
- Loading: "loading",
- Complete: "complete",
- GoF2: "go-f2"
- },
- // 底部加载更多状态 default:默认状态 loading:加载中 no-more:没有更多数据 fail:加载失败
- More: {
- Default: "default",
- Loading: "loading",
- NoMore: "no-more",
- Fail: "fail"
- },
- // @query触发来源 user-pull-down:用户主动下拉刷新 reload:通过reload触发 refresh:通过refresh触发 load-more:通过滚动到底部加载更多或点击底部加载更多触发
- QueryFrom: {
- UserPullDown: "user-pull-down",
- Reload: "reload",
- Refresh: "refresh",
- LoadMore: "load-more"
- },
- // 虚拟列表cell高度模式
- CellHeightMode: {
- // 固定高度
- Fixed: "fixed",
- // 动态高度
- Dynamic: "dynamic"
- },
- // 列表缓存模式
- CacheMode: {
- // 默认模式,只会缓存一次
- Default: "default",
- // 总是缓存,每次列表刷新(下拉刷新、调用reload等)都会更新缓存
- Always: "always"
- }
- };
- const _sfc_main$2h = {
- name: "z-paging-refresh",
- data() {
- return {
- R: Enum.Refresher,
- refresherTimeText: "",
- zTheme: {
- title: { white: "#efefef", black: "#555555" },
- arrow: { white: zStatic.base64ArrowWhite, black: zStatic.base64Arrow },
- flower: { white: zStatic.base64FlowerWhite, black: zStatic.base64Flower },
- success: { white: zStatic.base64SuccessWhite, black: zStatic.base64Success },
- indicator: { white: "#eeeeee", black: "#777777" }
- }
- };
- },
- props: [
- "status",
- "defaultThemeStyle",
- "defaultText",
- "pullingText",
- "refreshingText",
- "completeText",
- "goF2Text",
- "defaultImg",
- "pullingImg",
- "refreshingImg",
- "completeImg",
- "refreshingAnimated",
- "showUpdateTime",
- "updateTimeKey",
- "imgStyle",
- "titleStyle",
- "updateTimeStyle",
- "updateTimeTextMap",
- "unit",
- "isIos"
- ],
- computed: {
- ts() {
- return this.defaultThemeStyle;
- },
- // 当前状态Map
- statusTextMap() {
- this.updateTime();
- const { R: R2, defaultText, pullingText, refreshingText, completeText, goF2Text } = this;
- return {
- [R2.Default]: defaultText,
- [R2.ReleaseToRefresh]: pullingText,
- [R2.Loading]: refreshingText,
- [R2.Complete]: completeText,
- [R2.GoF2]: goF2Text
- };
- },
- // 当前状态文字
- currentTitle() {
- return this.statusTextMap[this.status] || this.defaultText;
- },
- // 左侧图片class
- leftImageClass() {
- const preSizeClass = `zp-r-left-image-pre-size-${this.unit}`;
- if (this.status === this.R.Complete)
- return preSizeClass;
- return `zp-r-left-image ${preSizeClass} ${this.status === this.R.Default ? "zp-r-arrow-down" : "zp-r-arrow-top"}`;
- },
- // 左侧图片style
- leftImageStyle() {
- const showUpdateTime = this.showUpdateTime;
- const size = showUpdateTime ? u$1.addUnit(36, this.unit) : u$1.addUnit(34, this.unit);
- return { width: size, height: size, "margin-right": showUpdateTime ? u$1.addUnit(20, this.unit) : u$1.addUnit(9, this.unit) };
- },
- // 左侧图片src
- leftImageSrc() {
- const R2 = this.R;
- const status = this.status;
- if (status === R2.Default) {
- if (!!this.defaultImg)
- return this.defaultImg;
- return this.zTheme.arrow[this.ts];
- } else if (status === R2.ReleaseToRefresh) {
- if (!!this.pullingImg)
- return this.pullingImg;
- if (!!this.defaultImg)
- return this.defaultImg;
- return this.zTheme.arrow[this.ts];
- } else if (status === R2.Loading) {
- if (!!this.refreshingImg)
- return this.refreshingImg;
- return this.zTheme.flower[this.ts];
- } else if (status === R2.Complete) {
- if (!!this.completeImg)
- return this.completeImg;
- return this.zTheme.success[this.ts];
- } else if (status === R2.GoF2) {
- return this.zTheme.arrow[this.ts];
- }
- return "";
- },
- // 右侧文字style
- rightTextStyle() {
- let stl = {};
- stl["color"] = this.zTheme.title[this.ts];
- stl["font-size"] = u$1.addUnit(30, this.unit);
- return stl;
- }
- },
- methods: {
- // 添加单位
- addUnit(value2, unit) {
- return u$1.addUnit(value2, unit);
- },
- // 更新下拉刷新时间
- updateTime() {
- if (this.showUpdateTime) {
- this.refresherTimeText = u$1.getRefesrherFormatTimeByKey(this.updateTimeKey, this.updateTimeTextMap);
- }
- }
- }
- };
- function _sfc_render$2g(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { style: { "height": "100%" } }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass($props.showUpdateTime ? "zp-r-container zp-r-container-padding" : "zp-r-container")
- },
- [
- vue.createElementVNode("view", { class: "zp-r-left" }, [
- vue.createCommentVNode(" 非加载中(继续下拉刷新、松手立即刷新状态图片) "),
- $props.status !== $data.R.Loading ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: vue.normalizeClass($options.leftImageClass),
- style: vue.normalizeStyle([$options.leftImageStyle, $props.imgStyle]),
- src: $options.leftImageSrc
- }, null, 14, ["src"])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 加载状态图片 "),
- vue.createElementVNode("image", {
- class: vue.normalizeClass({ "zp-line-loading-image": $props.refreshingAnimated, "zp-r-left-image": true, "zp-r-left-image-pre-size-rpx": $props.unit === "rpx", "zp-r-left-image-pre-size-px": $props.unit === "px" }),
- style: vue.normalizeStyle([$options.leftImageStyle, $props.imgStyle]),
- src: $options.leftImageSrc
- }, null, 14, ["src"])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- )),
- vue.createCommentVNode(" 在nvue中,加载状态loading使用系统loading ")
- ]),
- vue.createCommentVNode(" 右侧文字内容 "),
- vue.createElementVNode("view", { class: "zp-r-right" }, [
- vue.createCommentVNode(" 右侧下拉刷新状态文字 "),
- vue.createElementVNode(
- "text",
- {
- class: "zp-r-right-text",
- style: vue.normalizeStyle([$options.rightTextStyle, $props.titleStyle])
- },
- vue.toDisplayString($options.currentTitle),
- 5
- /* TEXT, STYLE */
- ),
- vue.createCommentVNode(" 右侧下拉刷新时间文字 "),
- $props.showUpdateTime && $data.refresherTimeText.length ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["zp-r-right-text", { "zp-r-right-time-text-rpx": $props.unit === "rpx", "zp-r-right-time-text-px": $props.unit === "px" }]),
- style: vue.normalizeStyle([{ color: $data.zTheme.title[$options.ts] }, $props.updateTimeStyle])
- },
- vue.toDisplayString($data.refresherTimeText),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 2
- /* CLASS */
- )
- ]);
- }
- const zPagingRefresh = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["render", _sfc_render$2g], ["__scopeId", "data-v-00a16504"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/z-paging/components/z-paging/components/z-paging-refresh.vue"]]);
- const _sfc_main$2g = {
- name: "z-paging-load-more",
- data() {
- return {
- M: Enum.More,
- zTheme: {
- title: { white: "#efefef", black: "#a4a4a4" },
- line: { white: "#efefef", black: "#eeeeee" },
- circleBorder: { white: "#aaaaaa", black: "#c8c8c8" },
- circleBorderTop: { white: "#ffffff", black: "#444444" },
- flower: { white: zStatic.base64FlowerWhite, black: zStatic.base64Flower },
- indicator: { white: "#eeeeee", black: "#777777" }
- }
- };
- },
- props: ["zConfig"],
- computed: {
- ts() {
- return this.c.defaultThemeStyle;
- },
- // 底部加载更多配置
- c() {
- return this.zConfig || {};
- },
- // 底部加载更多文字
- ownLoadingMoreText() {
- return {
- [this.M.Default]: this.c.defaultText,
- [this.M.Loading]: this.c.loadingText,
- [this.M.NoMore]: this.c.noMoreText,
- [this.M.Fail]: this.c.failText
- }[this.finalStatus];
- },
- // 底部加载更多状态
- finalStatus() {
- if (this.c.defaultAsLoading && this.c.status === this.M.Default)
- return this.M.Loading;
- return this.c.status;
- },
- // 加载更多icon类型
- finalLoadingIconType() {
- return this.c.loadingIconType;
- }
- },
- methods: {
- // 点击了加载更多
- doClick() {
- this.$emit("doClick");
- }
- }
- };
- function _sfc_render$2f(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["zp-l-container", { "zp-l-container-rpx": $options.c.unit === "rpx", "zp-l-container-px": $options.c.unit === "px" }]),
- style: vue.normalizeStyle([$options.c.customStyle]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.doClick && $options.doClick(...args))
- },
- [
- !$options.c.hideContent ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createCommentVNode(" 底部加载更多没有更多数据分割线 "),
- $options.c.showNoMoreLine && $options.finalStatus === $data.M.NoMore ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass({ "zp-l-line-rpx": $options.c.unit === "rpx", "zp-l-line-px": $options.c.unit === "px" }),
- style: vue.normalizeStyle([{ backgroundColor: $data.zTheme.line[$options.ts] }, $options.c.noMoreLineCustomStyle])
- },
- null,
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 底部加载更多loading "),
- $options.finalStatus === $data.M.Loading && !!$options.c.loadingIconCustomImage ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- src: $options.c.loadingIconCustomImage,
- style: vue.normalizeStyle([$options.c.iconCustomStyle]),
- class: vue.normalizeClass({ "zp-l-line-loading-custom-image": true, "zp-l-line-loading-custom-image-animated": $options.c.loadingAnimated, "zp-l-line-loading-custom-image-rpx": $options.c.unit === "rpx", "zp-l-line-loading-custom-image-px": $options.c.unit === "px" })
- }, null, 14, ["src"])) : vue.createCommentVNode("v-if", true),
- $options.finalStatus === $data.M.Loading && $options.finalLoadingIconType === "flower" && !$options.c.loadingIconCustomImage.length ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 2,
- class: vue.normalizeClass({ "zp-line-loading-image": true, "zp-line-loading-image-rpx": $options.c.unit === "rpx", "zp-line-loading-image-px": $options.c.unit === "px" }),
- style: vue.normalizeStyle([$options.c.iconCustomStyle]),
- src: $data.zTheme.flower[$options.ts]
- }, null, 14, ["src"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 底部加载更多文字 "),
- $options.finalStatus === $data.M.Loading && $options.finalLoadingIconType === "circle" && !$options.c.loadingIconCustomImage.length ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 3,
- class: vue.normalizeClass(["zp-l-circle-loading-view", { "zp-l-circle-loading-view-rpx": $options.c.unit === "rpx", "zp-l-circle-loading-view-px": $options.c.unit === "px" }]),
- style: vue.normalizeStyle([{ borderColor: $data.zTheme.circleBorder[$options.ts], borderTopColor: $data.zTheme.circleBorderTop[$options.ts] }, $options.c.iconCustomStyle])
- },
- null,
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- !$options.c.isChat || !$options.c.chatDefaultAsLoading && $options.finalStatus === $data.M.Default || $options.finalStatus === $data.M.Fail ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 4,
- class: vue.normalizeClass({ "zp-l-text-rpx": $options.c.unit === "rpx", "zp-l-text-px": $options.c.unit === "px" }),
- style: vue.normalizeStyle([{ color: $data.zTheme.title[$options.ts] }, $options.c.titleCustomStyle])
- },
- vue.toDisplayString($options.ownLoadingMoreText),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 底部加载更多没有更多数据分割线 "),
- $options.c.showNoMoreLine && $options.finalStatus === $data.M.NoMore ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 5,
- class: vue.normalizeClass({ "zp-l-line-rpx": $options.c.unit === "rpx", "zp-l-line-px": $options.c.unit === "px" }),
- style: vue.normalizeStyle([{ backgroundColor: $data.zTheme.line[$options.ts] }, $options.c.noMoreLineCustomStyle])
- },
- null,
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const zPagingLoadMore = /* @__PURE__ */ _export_sfc(_sfc_main$2g, [["render", _sfc_render$2f], ["__scopeId", "data-v-8cc5c400"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/z-paging/components/z-paging/components/z-paging-load-more.vue"]]);
- const commonLayoutModule = {
- data() {
- return {
- systemInfo: null,
- cssSafeAreaInsetBottom: -1,
- isReadyDestroy: false
- };
- },
- computed: {
- // 顶部可用距离
- windowTop() {
- if (!this.systemInfo)
- return 0;
- return this.systemInfo.windowTop || 0;
- },
- // 底部安全区域高度
- safeAreaBottom() {
- if (!this.systemInfo)
- return 0;
- let safeAreaBottom = 0;
- safeAreaBottom = this.systemInfo.safeAreaInsets.bottom || 0;
- return safeAreaBottom;
- },
- // 是否是比较老的webview,在一些老的webview中,需要进行一些特殊处理
- isOldWebView() {
- try {
- const systemInfos = u$1.getSystemInfoSync(true).system.split(" ");
- const deviceType = systemInfos[0];
- const version2 = parseInt(systemInfos[1]);
- if (deviceType === "iOS" && version2 <= 10 || deviceType === "Android" && version2 <= 6) {
- return true;
- }
- } catch (e2) {
- return false;
- }
- return false;
- },
- // 当前组件的$slots,兼容不同平台
- zSlots() {
- return this.$slots;
- }
- },
- beforeDestroy() {
- this.isReadyDestroy = true;
- },
- unmounted() {
- this.isReadyDestroy = true;
- },
- methods: {
- // 更新fixed模式下z-paging的布局
- updateFixedLayout() {
- this.fixed && this.$nextTick(() => {
- this.systemInfo = u$1.getSystemInfoSync();
- });
- },
- // 获取节点尺寸
- _getNodeClientRect(select, inDom = true, scrollOffset = false) {
- if (this.isReadyDestroy) {
- return Promise.resolve(false);
- }
- let res = !!inDom ? uni.createSelectorQuery().in(inDom === true ? this : inDom) : uni.createSelectorQuery();
- scrollOffset ? res.select(select).scrollOffset() : res.select(select).boundingClientRect();
- return new Promise((resolve, reject) => {
- res.exec((data) => {
- resolve(data && data != "" && data != void 0 && data.length ? data : false);
- });
- });
- },
- // 获取slot="left"和slot="right"宽度并且更新布局
- _updateLeftAndRightWidth(targetStyle, parentNodePrefix) {
- this.$nextTick(() => {
- let delayTime = 0;
- setTimeout(() => {
- ["left", "right"].map((position) => {
- this._getNodeClientRect(`.${parentNodePrefix}-${position}`).then((res) => {
- this.$set(targetStyle, position, res ? res[0].width + "px" : "0px");
- });
- });
- }, delayTime);
- });
- },
- // 通过获取css设置的底部安全区域占位view高度设置bottom距离(直接通过systemInfo在部分平台上无法获取到底部安全区域)
- _getCssSafeAreaInsetBottom(success) {
- this._getNodeClientRect(".zp-safe-area-inset-bottom").then((res) => {
- this.cssSafeAreaInsetBottom = res ? res[0].height : -1;
- res && success && success();
- });
- },
- // 同步获取系统信息,兼容不同平台(供z-paging-swiper使用)
- _getSystemInfoSync(useCache = false) {
- return u$1.getSystemInfoSync(useCache);
- }
- }
- };
- const queryKey = "Query";
- const fetchParamsKey = "FetchParams";
- const fetchResultKey = "FetchResult";
- const language2LocalKey = "Language2Local";
- function handleQuery(callback) {
- _addHandleByKey(queryKey, callback);
- return this;
- }
- function _handleQuery(pageNo, pageSize, from, lastItem) {
- const callback = _getHandleByKey(queryKey);
- return callback ? callback(pageNo, pageSize, from, lastItem) : [pageNo, pageSize, from];
- }
- function handleFetchParams(callback) {
- _addHandleByKey(fetchParamsKey, callback);
- return this;
- }
- function _handleFetchParams(parmas, extraParams) {
- const callback = _getHandleByKey(fetchParamsKey);
- return callback ? callback(parmas, extraParams || {}) : { pageNo: parmas.pageNo, pageSize: parmas.pageSize, ...extraParams || {} };
- }
- function handleFetchResult(callback) {
- _addHandleByKey(fetchResultKey, callback);
- return this;
- }
- function _handleFetchResult(result, paging, params2) {
- const callback = _getHandleByKey(fetchResultKey);
- callback && callback(result, paging, params2);
- return callback ? true : false;
- }
- function handleLanguage2Local(callback) {
- _addHandleByKey(language2LocalKey, callback);
- return this;
- }
- function _handleLanguage2Local(language, local) {
- const callback = _getHandleByKey(language2LocalKey);
- return callback ? callback(language, local) : local;
- }
- function _getApp() {
- return getApp();
- }
- function _hasGlobalData() {
- return _getApp() && _getApp().globalData;
- }
- function _addHandleByKey(key, callback) {
- try {
- setTimeout(function() {
- if (_hasGlobalData()) {
- _getApp().globalData[`zp_handle${key}Callback`] = callback;
- }
- }, 1);
- } catch (_2) {
- }
- }
- function _getHandleByKey(key) {
- return _hasGlobalData() ? _getApp().globalData[`zp_handle${key}Callback`] : null;
- }
- const interceptor = {
- handleQuery,
- _handleQuery,
- handleFetchParams,
- _handleFetchParams,
- handleFetchResult,
- _handleFetchResult,
- handleLanguage2Local,
- _handleLanguage2Local
- };
- const dataHandleModule = {
- props: {
- // 自定义初始的pageNo,默认为1
- defaultPageNo: {
- type: Number,
- default: u$1.gc("defaultPageNo", 1),
- observer: function(newVal) {
- this.pageNo = newVal;
- }
- },
- // 自定义pageSize,默认为10
- defaultPageSize: {
- type: Number,
- default: u$1.gc("defaultPageSize", 10),
- validator: (value2) => {
- if (value2 <= 0)
- u$1.consoleErr("default-page-size必须大于0!");
- return value2 > 0;
- }
- },
- // 为保证数据一致,设置当前tab切换时的标识key,并在complete中传递相同key,若二者不一致,则complete将不会生效
- dataKey: {
- type: [Number, String, Object],
- default: u$1.gc("dataKey", null)
- },
- // 使用缓存,若开启将自动缓存第一页的数据,默认为否。请注意,因考虑到切换tab时不同tab数据不同的情况,默认仅会缓存组件首次加载时第一次请求到的数据,后续的下拉刷新操作不会更新缓存。
- useCache: {
- type: Boolean,
- default: u$1.gc("useCache", false)
- },
- // 使用缓存时缓存的key,用于区分不同列表的缓存数据,useCache为true时必须设置,否则缓存无效
- cacheKey: {
- type: String,
- default: u$1.gc("cacheKey", null)
- },
- // 缓存模式,默认仅会缓存组件首次加载时第一次请求到的数据,可设置为always,即代表总是缓存,每次列表刷新(下拉刷新、调用reload等)都会更新缓存
- cacheMode: {
- type: String,
- default: u$1.gc("cacheMode", Enum.CacheMode.Default)
- },
- // 自动注入的list名,可自动修改父view(包含ref="paging")中对应name的list值
- autowireListName: {
- type: String,
- default: u$1.gc("autowireListName", "")
- },
- // 自动注入的query名,可自动调用父view(包含ref="paging")中的query方法
- autowireQueryName: {
- type: String,
- default: u$1.gc("autowireQueryName", "")
- },
- // 获取分页数据Function,功能与@query类似。若设置了fetch则@query将不再触发
- fetch: {
- type: Function,
- default: null
- },
- // fetch的附加参数,fetch配置后有效
- fetchParams: {
- type: Object,
- default: u$1.gc("fetchParams", null)
- },
- // z-paging mounted后自动调用reload方法(mounted后自动调用接口),默认为是
- auto: {
- type: Boolean,
- default: u$1.gc("auto", true)
- },
- // 用户下拉刷新时是否触发reload方法,默认为是
- reloadWhenRefresh: {
- type: Boolean,
- default: u$1.gc("reloadWhenRefresh", true)
- },
- // reload时自动滚动到顶部,默认为是
- autoScrollToTopWhenReload: {
- type: Boolean,
- default: u$1.gc("autoScrollToTopWhenReload", true)
- },
- // reload时立即自动清空原list,默认为是,若立即自动清空,则在reload之后、请求回调之前页面是空白的
- autoCleanListWhenReload: {
- type: Boolean,
- default: u$1.gc("autoCleanListWhenReload", true)
- },
- // 列表刷新时自动显示下拉刷新view,默认为否
- showRefresherWhenReload: {
- type: Boolean,
- default: u$1.gc("showRefresherWhenReload", false)
- },
- // 列表刷新时自动显示加载更多view,且为加载中状态,默认为否
- showLoadingMoreWhenReload: {
- type: Boolean,
- default: u$1.gc("showLoadingMoreWhenReload", false)
- },
- // 组件created时立即触发reload(可解决一些情况下先看到页面再看到loading的问题),auto为true时有效。为否时将在mounted+nextTick后触发reload,默认为否
- createdReload: {
- type: Boolean,
- default: u$1.gc("createdReload", false)
- },
- // 本地分页时上拉加载更多延迟时间,单位为毫秒,默认200毫秒
- localPagingLoadingTime: {
- type: [Number, String],
- default: u$1.gc("localPagingLoadingTime", 200)
- },
- // 自动拼接complete中传过来的数组(使用聊天记录模式时无效)
- concat: {
- type: Boolean,
- default: u$1.gc("concat", true)
- },
- // 请求失败是否触发reject,默认为是
- callNetworkReject: {
- type: Boolean,
- default: u$1.gc("callNetworkReject", true)
- },
- // 父组件v-model所绑定的list的值
- value: {
- type: Array,
- default: function() {
- return [];
- }
- },
- modelValue: {
- type: Array,
- default: function() {
- return [];
- }
- }
- },
- data() {
- return {
- currentData: [],
- totalData: [],
- realTotalData: [],
- totalLocalPagingList: [],
- dataPromiseResultMap: {
- reload: null,
- complete: null,
- localPaging: null
- },
- isSettingCacheList: false,
- pageNo: 1,
- currentRefreshPageSize: 0,
- isLocalPaging: false,
- isAddedData: false,
- isTotalChangeFromAddData: false,
- privateConcat: true,
- myParentQuery: -1,
- firstPageLoaded: false,
- pagingLoaded: false,
- loaded: false,
- isUserReload: true,
- fromEmptyViewReload: false,
- queryFrom: "",
- listRendering: false,
- isHandlingRefreshToPage: false,
- isFirstPageAndNoMore: false,
- totalDataChangeThrow: true,
- addDataFromTopBufferedInsert: u$1.useBufferedInsert(this._addDataFromTop)
- };
- },
- computed: {
- pageSize() {
- return this.defaultPageSize;
- },
- finalConcat() {
- return this.concat && this.privateConcat;
- },
- finalUseCache() {
- if (this.useCache && !this.cacheKey) {
- u$1.consoleErr("use-cache为true时,必须设置cache-key,否则缓存无效!");
- }
- return this.useCache && !!this.cacheKey;
- },
- finalCacheKey() {
- return this.cacheKey ? `${c$1.cachePrefixKey}-${this.cacheKey}` : null;
- },
- isFirstPage() {
- return this.pageNo === this.defaultPageNo;
- }
- },
- watch: {
- totalData(newVal, oldVal) {
- this._totalDataChange(newVal, oldVal, this.totalDataChangeThrow);
- this.totalDataChangeThrow = true;
- },
- currentData(newVal, oldVal) {
- this._currentDataChange(newVal, oldVal);
- },
- useChatRecordMode(newVal, oldVal) {
- if (newVal) {
- this.nLoadingMoreFixedHeight = false;
- }
- },
- value: {
- handler(newVal) {
- if (newVal !== this.totalData) {
- this.totalDataChangeThrow = false;
- this.totalData = newVal;
- }
- },
- immediate: true
- },
- modelValue: {
- handler(newVal) {
- if (newVal !== this.totalData) {
- this.totalDataChangeThrow = false;
- this.totalData = newVal;
- }
- },
- immediate: true
- }
- },
- methods: {
- // 请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为是否成功(默认为是)
- complete(data, success = true) {
- this.customNoMore = -1;
- return this.addData(data, success);
- },
- //【保证数据一致】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为dataKey,需与:data-key绑定的一致,第三个参数为是否成功(默认为是)
- completeByKey(data, dataKey = null, success = true) {
- if (dataKey !== null && this.dataKey !== null && dataKey !== this.dataKey) {
- this.isFirstPage && this.endRefresh();
- return new Promise((resolve) => resolve());
- }
- this.customNoMore = -1;
- return this.addData(data, success);
- },
- //【通过total判断是否有更多数据】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为total(列表总数),第三个参数为是否成功(默认为是)
- completeByTotal(data, total, success = true) {
- if (total == "undefined") {
- this.customNoMore = -1;
- } else {
- const dataTypeRes = this._checkDataType(data, success, false);
- data = dataTypeRes.data;
- success = dataTypeRes.success;
- if (total >= 0 && success) {
- return new Promise((resolve, reject) => {
- this.$nextTick(() => {
- let nomore = false;
- const realTotalDataCount = this.pageNo == this.defaultPageNo ? 0 : this.realTotalData.length;
- const dataLength = this.privateConcat ? data.length : 0;
- let exceedCount = realTotalDataCount + dataLength - total;
- if (exceedCount >= 0) {
- nomore = true;
- exceedCount = this.defaultPageSize - exceedCount;
- if (this.privateConcat && exceedCount > 0 && exceedCount < data.length) {
- data = data.splice(0, exceedCount);
- }
- }
- this.completeByNoMore(data, nomore, success).then((res) => resolve(res)).catch(() => reject());
- });
- });
- }
- }
- return this.addData(data, success);
- },
- //【自行判断是否有更多数据】请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging处理,第一个参数为请求结果数组,第二个参数为是否没有更多数据,第三个参数为是否成功(默认是是)
- completeByNoMore(data, nomore, success = true) {
- if (nomore != "undefined") {
- this.customNoMore = nomore == true ? 1 : 0;
- }
- return this.addData(data, success);
- },
- // 请求结束且请求失败时调用,支持传入请求失败原因
- completeByError(errorMsg) {
- this.customerEmptyViewErrorText = errorMsg;
- return this.complete(false);
- },
- // 与上方complete方法功能一致,新版本中设置服务端回调数组请使用complete方法
- addData(data, success = true) {
- if (!this.fromCompleteEmit) {
- this.disabledCompleteEmit = true;
- this.fromCompleteEmit = false;
- }
- const currentTimeStamp = u$1.getTime();
- const disTime = currentTimeStamp - this.requestTimeStamp;
- let minDelay = this.minDelay;
- if (this.isFirstPage && this.finalShowRefresherWhenReload) {
- minDelay = Math.max(400, minDelay);
- }
- const addDataDalay = this.requestTimeStamp > 0 && disTime < minDelay ? minDelay - disTime : 0;
- this.$nextTick(() => {
- u$1.delay(() => {
- this._addData(data, success, false);
- }, this.delay > 0 ? this.delay : addDataDalay);
- });
- return new Promise((resolve, reject) => {
- this.dataPromiseResultMap.complete = { resolve, reject };
- });
- },
- // 从顶部添加数据,不会影响分页的pageNo和pageSize
- addDataFromTop(data, toTop = true, toTopWithAnimate = true) {
- (this.finalUseVirtualList ? this.addDataFromTopBufferedInsert : this._addDataFromTop)(
- data,
- toTop,
- toTopWithAnimate
- );
- },
- // 重新设置列表数据,调用此方法不会影响pageNo和pageSize,也不会触发请求。适用场景:当需要删除列表中某一项时,将删除对应项后的数组通过此方法传递给z-paging。(当出现类似的需要修改列表数组的场景时,请使用此方法,请勿直接修改page中:list.sync绑定的数组)
- resetTotalData(data) {
- this.isTotalChangeFromAddData = true;
- data = Object.prototype.toString.call(data) !== "[object Array]" ? [data] : data;
- this.totalData = data;
- },
- // 设置本地分页数据,请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging作分页处理(若调用了此方法,则上拉加载更多时内部会自动分页,不会触发@query所绑定的事件)
- setLocalPaging(data, success = true) {
- this.isLocalPaging = true;
- this.$nextTick(() => {
- this._addData(data, success, true);
- });
- return new Promise((resolve, reject) => {
- this.dataPromiseResultMap.localPaging = { resolve, reject };
- });
- },
- // 重新加载分页数据,pageNo会恢复为默认值,相当于下拉刷新的效果(animate为true时会展示下拉刷新动画,默认为false)
- reload(animate = this.showRefresherWhenReload) {
- if (animate) {
- this.privateShowRefresherWhenReload = animate;
- this.isUserPullDown = true;
- }
- if (!this.showLoadingMoreWhenReload) {
- this.listRendering = true;
- }
- this.$nextTick(() => {
- this._preReload(animate, false);
- });
- return new Promise((resolve, reject) => {
- this.dataPromiseResultMap.reload = { resolve, reject };
- });
- },
- // 刷新列表数据,pageNo和pageSize不会重置,列表数据会重新从服务端获取。必须保证@query绑定的方法中的pageNo和pageSize和传给服务端的一致
- refresh() {
- return this._handleRefreshWithDisPageNo(this.pageNo - this.defaultPageNo + 1);
- },
- // 刷新列表数据至指定页,例如pageNo=5时则代表刷新列表至第5页,此时pageNo会变为5,列表会展示前5页的数据。必须保证@query绑定的方法中的pageNo和pageSize和传给服务端的一致
- refreshToPage(pageNo) {
- this.isHandlingRefreshToPage = true;
- return this._handleRefreshWithDisPageNo(pageNo + this.defaultPageNo - 1);
- },
- // 手动更新列表缓存数据,将自动截取v-model绑定的list中的前pageSize条覆盖缓存,请确保在list数据更新到预期结果后再调用此方法
- updateCache() {
- if (this.finalUseCache && this.totalData.length) {
- this._saveLocalCache(this.totalData.slice(0, Math.min(this.totalData.length, this.pageSize)));
- }
- },
- // 清空分页数据
- clean() {
- this._reload(true);
- this._addData([], true, false);
- },
- // 清空分页数据
- clear() {
- this.clean();
- },
- // reload之前的一些处理
- _preReload(animate = this.showRefresherWhenReload, isFromMounted = true, retryCount = 0) {
- const showRefresher = this.finalRefresherEnabled && this.useCustomRefresher;
- if (this.customRefresherHeight === -1 && showRefresher) {
- u$1.delay(() => {
- retryCount++;
- if (retryCount % 10 === 0) {
- this._updateCustomRefresherHeight();
- }
- this._preReload(animate, isFromMounted, retryCount);
- }, c$1.delayTime / 2);
- return;
- }
- this.isUserReload = true;
- this.loadingType = Enum.LoadingType.Refresher;
- if (animate) {
- this.privateShowRefresherWhenReload = animate;
- if (this.useCustomRefresher) {
- this._doRefresherRefreshAnimate();
- } else {
- this.refresherTriggered = true;
- }
- } else {
- this._refresherEnd(false, false, false, false);
- }
- this._reload(false, isFromMounted);
- },
- // 重新加载分页数据
- _reload(isClean = false, isFromMounted = false, isUserPullDown = false) {
- this.isAddedData = false;
- this.insideOfPaging = -1;
- this.cacheScrollNodeHeight = -1;
- this.pageNo = this.defaultPageNo;
- this._cleanRefresherEndTimeout();
- !this.privateShowRefresherWhenReload && !isClean && this._startLoading(true);
- this.firstPageLoaded = true;
- this.isTotalChangeFromAddData = false;
- if (!this.isSettingCacheList) {
- this.totalData = [];
- }
- if (!isClean) {
- this._emitQuery(this.pageNo, this.defaultPageSize, isUserPullDown ? Enum.QueryFrom.UserPullDown : Enum.QueryFrom.Reload);
- let delay2 = 0;
- u$1.delay(this._callMyParentQuery, delay2);
- if (!isFromMounted && this.autoScrollToTopWhenReload) {
- this._scrollToTop(false);
- }
- }
- },
- // 处理服务端返回的数组
- _addData(data, success, isLocal) {
- this.isAddedData = true;
- this.fromEmptyViewReload = false;
- this.isTotalChangeFromAddData = true;
- this.refresherTriggered = false;
- this._endSystemLoadingAndRefresh();
- const tempIsUserPullDown = this.isUserPullDown;
- if (this.showRefresherUpdateTime && this.isFirstPage) {
- u$1.setRefesrherTime(u$1.getTime(), this.refresherUpdateTimeKey);
- this.$refs.refresh && this.$refs.refresh.updateTime();
- }
- if (!isLocal && tempIsUserPullDown && this.isFirstPage) {
- this.isUserPullDown = false;
- }
- this.listRendering = true;
- this.$nextTick(() => {
- u$1.delay(() => this.listRendering = false);
- });
- let dataTypeRes = this._checkDataType(data, success, isLocal);
- data = dataTypeRes.data;
- success = dataTypeRes.success;
- let delayTime = c$1.delayTime;
- if (this.useChatRecordMode)
- delayTime = 0;
- this.loadingForNow = false;
- u$1.delay(() => {
- this.pagingLoaded = true;
- this.$nextTick(() => {
- !isLocal && this._refresherEnd(delayTime > 0, true, tempIsUserPullDown);
- });
- });
- if (this.isFirstPage) {
- this.isLoadFailed = !success;
- this.$emit("isLoadFailedChange", this.isLoadFailed);
- if (this.finalUseCache && success && (this.cacheMode === Enum.CacheMode.Always ? true : this.isSettingCacheList)) {
- this._saveLocalCache(data);
- }
- }
- this.isSettingCacheList = false;
- if (success) {
- if (!(this.privateConcat === false && !this.isHandlingRefreshToPage && this.loadingStatus === Enum.More.NoMore)) {
- this.loadingStatus = Enum.More.Default;
- }
- if (isLocal) {
- this.totalLocalPagingList = data;
- const localPageNo = this.defaultPageNo;
- const localPageSize = this.queryFrom !== Enum.QueryFrom.Refresh ? this.defaultPageSize : this.currentRefreshPageSize;
- this._localPagingQueryList(localPageNo, localPageSize, 0, (res) => {
- u$1.delay(() => {
- this.completeByTotal(res, this.totalLocalPagingList.length);
- }, 0);
- });
- } else {
- let dataChangeDelayTime = 0;
- u$1.delay(() => {
- this._currentDataChange(data, this.currentData);
- this._callDataPromise(true, this.totalData);
- }, dataChangeDelayTime);
- }
- if (this.isHandlingRefreshToPage) {
- this.isHandlingRefreshToPage = false;
- this.pageNo = this.defaultPageNo + Math.ceil(data.length / this.pageSize) - 1;
- if (data.length % this.pageSize !== 0) {
- this.customNoMore = 1;
- }
- }
- } else {
- this._currentDataChange(data, this.currentData);
- this._callDataPromise(false);
- this.loadingStatus = Enum.More.Fail;
- this.isHandlingRefreshToPage = false;
- if (this.loadingType === Enum.LoadingType.LoadMore) {
- this.pageNo--;
- }
- }
- },
- // 所有数据改变时调用
- _totalDataChange(newVal, oldVal, eventThrow = true) {
- if ((!this.isUserReload || !this.autoCleanListWhenReload) && this.firstPageLoaded && !newVal.length && oldVal.length) {
- return;
- }
- this._doCheckScrollViewShouldFullHeight(newVal);
- if (!this.realTotalData.length && !newVal.length) {
- eventThrow = false;
- }
- this.realTotalData = newVal;
- if (eventThrow) {
- this.$emit("input", newVal);
- this.$emit("update:modelValue", newVal);
- this.$emit("update:list", newVal);
- this.$emit("listChange", newVal);
- this._callMyParentList(newVal);
- }
- this.firstPageLoaded = false;
- this.isTotalChangeFromAddData = false;
- this.$nextTick(() => {
- u$1.delay(() => {
- this._getNodeClientRect(".zp-paging-container-content").then((res) => {
- res && this.$emit("contentHeightChanged", res[0].height);
- });
- }, c$1.delayTime * (this.isIos ? 1 : 3));
- });
- },
- // 当前数据改变时调用
- _currentDataChange(newVal, oldVal) {
- newVal = [...newVal];
- this.finalUseVirtualList && this._setCellIndex(newVal, "bottom");
- if (this.isFirstPage && this.finalConcat) {
- this.totalData = [];
- }
- if (this.customNoMore !== -1) {
- if (this.customNoMore === 1 || this.customNoMore !== 0 && !newVal.length) {
- this.loadingStatus = Enum.More.NoMore;
- }
- } else {
- if (!newVal.length || newVal.length && newVal.length < this.defaultPageSize) {
- this.loadingStatus = Enum.More.NoMore;
- }
- }
- if (!this.totalData.length) {
- this.totalData = newVal;
- } else {
- if (this.finalConcat) {
- this.oldScrollTop;
- this.totalData = [...this.totalData, ...newVal];
- } else {
- this.totalData = newVal;
- }
- }
- this.privateConcat = true;
- },
- // 根据pageNo处理refresh操作
- _handleRefreshWithDisPageNo(pageNo) {
- if (!this.isHandlingRefreshToPage && !this.realTotalData.length)
- return this.reload();
- if (pageNo >= 1) {
- this.loading = true;
- this.privateConcat = false;
- const totalPageSize = pageNo * this.pageSize;
- this.currentRefreshPageSize = totalPageSize;
- if (this.isLocalPaging && this.isHandlingRefreshToPage) {
- this._localPagingQueryList(this.defaultPageNo, totalPageSize, 0, (res) => {
- this.complete(res);
- });
- } else {
- this._emitQuery(this.defaultPageNo, totalPageSize, Enum.QueryFrom.Refresh);
- this._callMyParentQuery(this.defaultPageNo, totalPageSize);
- }
- }
- return new Promise((resolve, reject) => {
- this.dataPromiseResultMap.reload = { resolve, reject };
- });
- },
- // 本地分页请求
- _localPagingQueryList(pageNo, pageSize, localPagingLoadingTime, callback) {
- pageNo = Math.max(1, pageNo);
- pageSize = Math.max(1, pageSize);
- const totalPagingList = [...this.totalLocalPagingList];
- const pageNoIndex = (pageNo - 1) * pageSize;
- const finalPageNoIndex = Math.min(totalPagingList.length, pageNoIndex + pageSize);
- const resultPagingList = totalPagingList.splice(pageNoIndex, finalPageNoIndex - pageNoIndex);
- u$1.delay(() => callback(resultPagingList), localPagingLoadingTime);
- },
- // 从顶部添加数据,不会影响分页的pageNo和pageSize
- _addDataFromTop(data, toTop = true, toTopWithAnimate = true) {
- let addFromTop = !this.isChatRecordModeAndNotInversion;
- data = Object.prototype.toString.call(data) !== "[object Array]" ? [data] : addFromTop ? data.reverse() : data;
- this.finalUseVirtualList && this._setCellIndex(data, "top");
- this.totalData = addFromTop ? [...data, ...this.totalData] : [...this.totalData, ...data];
- if (toTop) {
- u$1.delay(() => this.useChatRecordMode ? this.scrollToBottom(toTopWithAnimate) : this.scrollToTop(toTopWithAnimate));
- }
- },
- // 存储列表缓存数据
- _saveLocalCache(data) {
- uni.setStorageSync(this.finalCacheKey, data);
- },
- // 通过缓存数据填充列表数据
- _setListByLocalCache() {
- this.totalData = uni.getStorageSync(this.finalCacheKey) || [];
- this.isSettingCacheList = true;
- },
- // 修改父view的list
- _callMyParentList(newVal) {
- if (this.autowireListName.length) {
- const myParent = u$1.getParent(this.$parent);
- if (myParent && myParent[this.autowireListName]) {
- myParent[this.autowireListName] = newVal;
- }
- }
- },
- // 调用父view的query
- _callMyParentQuery(customPageNo = 0, customPageSize = 0) {
- if (this.autowireQueryName) {
- if (this.myParentQuery === -1) {
- const myParent = u$1.getParent(this.$parent);
- if (myParent && myParent[this.autowireQueryName]) {
- this.myParentQuery = myParent[this.autowireQueryName];
- }
- }
- if (this.myParentQuery !== -1) {
- customPageSize > 0 ? this.myParentQuery(customPageNo, customPageSize) : this.myParentQuery(this.pageNo, this.defaultPageSize);
- }
- }
- },
- // emit query事件
- _emitQuery(pageNo, pageSize, from) {
- this.queryFrom = from;
- this.requestTimeStamp = u$1.getTime();
- const [lastItem] = this.realTotalData.slice(-1);
- if (this.fetch) {
- const fetchParams = interceptor._handleFetchParams({ pageNo, pageSize, from, lastItem: lastItem || null }, this.fetchParams);
- const fetchResult = this.fetch(fetchParams);
- if (!interceptor._handleFetchResult(fetchResult, this, fetchParams)) {
- u$1.isPromise(fetchResult) ? fetchResult.then((res) => {
- this.complete(res);
- }).catch((err) => {
- this.complete(false);
- }) : this.complete(fetchResult);
- }
- } else {
- this.$emit("query", ...interceptor._handleQuery(pageNo, pageSize, from, lastItem || null));
- }
- },
- // 触发数据改变promise
- _callDataPromise(success, totalList) {
- for (const key in this.dataPromiseResultMap) {
- const obj = this.dataPromiseResultMap[key];
- if (!obj)
- continue;
- success ? obj.resolve({ totalList, noMore: this.loadingStatus === Enum.More.NoMore }) : this.callNetworkReject && obj.reject(`z-paging-${key}-error`);
- }
- },
- // 检查complete data的类型
- _checkDataType(data, success, isLocal) {
- const dataType = Object.prototype.toString.call(data);
- if (dataType === "[object Boolean]") {
- success = data;
- data = [];
- } else if (dataType !== "[object Array]") {
- data = [];
- if (dataType !== "[object Undefined]" && dataType !== "[object Null]") {
- u$1.consoleErr(`${isLocal ? "setLocalPaging" : "complete"}参数类型不正确,第一个参数类型必须为Array!`);
- }
- }
- return { data, success };
- }
- }
- };
- const isObject$1 = (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(message, delimiters);
- this._caches[message] = tokens;
- }
- return compile(tokens, values);
- }
- }
- const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
- const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
- function parse(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 sub2 = "";
- char = format2[position++];
- while (char !== void 0 && char !== endDelimiter) {
- sub2 += char;
- char = format2[position++];
- }
- const isClosed = char === endDelimiter;
- const type2 = RE_TOKEN_LIST_VALUE.test(sub2) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub2) ? "named" : "unknown";
- tokens.push({ value: sub2, type: type2 });
- } 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$1(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 = Object.prototype.hasOwnProperty;
- const hasOwn = (val, key) => hasOwnProperty.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, i18n) {
- if (appVm.$watchLocale) {
- appVm.$watchLocale((newLocale) => {
- i18n.setLocale(newLocale);
- });
- } else {
- appVm.$watch(() => appVm.$locale, (newLocale) => {
- i18n.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 i18n = new I18n({
- locale,
- fallbackLocale,
- messages: messages2,
- watcher
- });
- let t2 = (key, values) => {
- if (typeof getApp !== "function") {
- t2 = function(key2, values2) {
- return i18n.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, i18n);
- }
- }
- return i18n.t(key2, values2);
- };
- }
- return t2(key, values);
- };
- return {
- i18n,
- f(message, values, delimiters) {
- return i18n.f(message, values, delimiters);
- },
- t(key, values) {
- return t2(key, values);
- },
- add(locale2, message, override = true) {
- return i18n.add(locale2, message, override);
- },
- watch(fn) {
- return i18n.watchLocale(fn);
- },
- getLocale() {
- return i18n.getLocale();
- },
- setLocale(newLocale) {
- return i18n.setLocale(newLocale);
- }
- };
- }
- const en$1 = {
- "zp.refresher.default": "Pull down to refresh",
- "zp.refresher.pulling": "Release to refresh",
- "zp.refresher.refreshing": "Refreshing...",
- "zp.refresher.complete": "Refresh succeeded",
- "zp.refresher.f2": "Refresh to enter 2f",
- "zp.loadingMore.default": "Click to load more",
- "zp.loadingMore.loading": "Loading...",
- "zp.loadingMore.noMore": "No more data",
- "zp.loadingMore.fail": "Load failed,click to reload",
- "zp.emptyView.title": "No data",
- "zp.emptyView.reload": "Reload",
- "zp.emptyView.error": "Sorry,load failed",
- "zp.refresherUpdateTime.title": "Last update: ",
- "zp.refresherUpdateTime.none": "None",
- "zp.refresherUpdateTime.today": "Today",
- "zp.refresherUpdateTime.yesterday": "Yesterday",
- "zp.systemLoading.title": "Loading..."
- };
- const zhHans$1 = {
- "zp.refresher.default": "继续下拉刷新",
- "zp.refresher.pulling": "松开立即刷新",
- "zp.refresher.refreshing": "正在刷新...",
- "zp.refresher.complete": "刷新成功",
- "zp.refresher.f2": "松手进入二楼",
- "zp.loadingMore.default": "点击加载更多",
- "zp.loadingMore.loading": "正在加载...",
- "zp.loadingMore.noMore": "没有更多了",
- "zp.loadingMore.fail": "加载失败,点击重新加载",
- "zp.emptyView.title": "没有数据哦~",
- "zp.emptyView.reload": "重新加载",
- "zp.emptyView.error": "很抱歉,加载失败",
- "zp.refresherUpdateTime.title": "最后更新:",
- "zp.refresherUpdateTime.none": "无",
- "zp.refresherUpdateTime.today": "今天",
- "zp.refresherUpdateTime.yesterday": "昨天",
- "zp.systemLoading.title": "加载中..."
- };
- const zhHant$1 = {
- "zp.refresher.default": "繼續下拉重繪",
- "zp.refresher.pulling": "鬆開立即重繪",
- "zp.refresher.refreshing": "正在重繪...",
- "zp.refresher.complete": "重繪成功",
- "zp.refresher.f2": "鬆手進入二樓",
- "zp.loadingMore.default": "點擊加載更多",
- "zp.loadingMore.loading": "正在加載...",
- "zp.loadingMore.noMore": "沒有更多了",
- "zp.loadingMore.fail": "加載失敗,點擊重新加載",
- "zp.emptyView.title": "沒有數據哦~",
- "zp.emptyView.reload": "重新加載",
- "zp.emptyView.error": "很抱歉,加載失敗",
- "zp.refresherUpdateTime.title": "最後更新:",
- "zp.refresherUpdateTime.none": "無",
- "zp.refresherUpdateTime.today": "今天",
- "zp.refresherUpdateTime.yesterday": "昨天",
- "zp.systemLoading.title": "加載中..."
- };
- const messages$1 = {
- en: en$1,
- "zh-Hans": zhHans$1,
- "zh-Hant": zhHant$1
- };
- const { t: t$2 } = initVueI18n(messages$1);
- const i18nModule = {
- computed: {
- finalLanguage() {
- try {
- const local = uni.getLocale();
- const language = this.systemInfo.appLanguage;
- return local === "auto" ? interceptor._handleLanguage2Local(language, this._language2Local(language)) : local;
- } catch (e2) {
- return "zh-Hans";
- }
- },
- // 最终的下拉刷新默认状态的文字
- finalRefresherDefaultText() {
- return this._getI18nText("zp.refresher.default", this.refresherDefaultText);
- },
- // 最终的下拉刷新下拉中的文字
- finalRefresherPullingText() {
- return this._getI18nText("zp.refresher.pulling", this.refresherPullingText);
- },
- // 最终的下拉刷新中文字
- finalRefresherRefreshingText() {
- return this._getI18nText("zp.refresher.refreshing", this.refresherRefreshingText);
- },
- // 最终的下拉刷新完成文字
- finalRefresherCompleteText() {
- return this._getI18nText("zp.refresher.complete", this.refresherCompleteText);
- },
- // 最终的下拉刷新上次更新时间文字
- finalRefresherUpdateTimeTextMap() {
- return {
- title: t$2("zp.refresherUpdateTime.title"),
- none: t$2("zp.refresherUpdateTime.none"),
- today: t$2("zp.refresherUpdateTime.today"),
- yesterday: t$2("zp.refresherUpdateTime.yesterday")
- };
- },
- // 最终的继续下拉进入二楼文字
- finalRefresherGoF2Text() {
- return this._getI18nText("zp.refresher.f2", this.refresherGoF2Text);
- },
- // 最终的底部加载更多默认状态文字
- finalLoadingMoreDefaultText() {
- return this._getI18nText("zp.loadingMore.default", this.loadingMoreDefaultText);
- },
- // 最终的底部加载更多加载中文字
- finalLoadingMoreLoadingText() {
- return this._getI18nText("zp.loadingMore.loading", this.loadingMoreLoadingText);
- },
- // 最终的底部加载更多没有更多数据文字
- finalLoadingMoreNoMoreText() {
- return this._getI18nText("zp.loadingMore.noMore", this.loadingMoreNoMoreText);
- },
- // 最终的底部加载更多加载失败文字
- finalLoadingMoreFailText() {
- return this._getI18nText("zp.loadingMore.fail", this.loadingMoreFailText);
- },
- // 最终的空数据图title
- finalEmptyViewText() {
- return this.isLoadFailed ? this.finalEmptyViewErrorText : this._getI18nText("zp.emptyView.title", this.emptyViewText);
- },
- // 最终的空数据图reload title
- finalEmptyViewReloadText() {
- return this._getI18nText("zp.emptyView.reload", this.emptyViewReloadText);
- },
- // 最终的空数据图加载失败文字
- finalEmptyViewErrorText() {
- return this.customerEmptyViewErrorText || this._getI18nText("zp.emptyView.error", this.emptyViewErrorText);
- },
- // 最终的系统loading title
- finalSystemLoadingText() {
- return this._getI18nText("zp.systemLoading.title", this.systemLoadingText);
- }
- },
- methods: {
- // 获取当前z-paging的语言
- getLanguage() {
- return this.finalLanguage;
- },
- // 获取国际化转换后的文本
- _getI18nText(key, value2) {
- const dataType = Object.prototype.toString.call(value2);
- if (dataType === "[object Object]") {
- const nextValue = value2[this.finalLanguage];
- if (nextValue)
- return nextValue;
- } else if (dataType === "[object String]") {
- return value2;
- }
- return t$2(key);
- },
- // 系统language转i18n local
- _language2Local(language) {
- const formatedLanguage = language.toLowerCase().replace(new RegExp("_", ""), "-");
- if (formatedLanguage.indexOf("zh") !== -1) {
- if (formatedLanguage === "zh" || formatedLanguage === "zh-cn" || formatedLanguage.indexOf("zh-hans") !== -1) {
- return "zh-Hans";
- }
- return "zh-Hant";
- }
- if (formatedLanguage.indexOf("en") !== -1)
- return "en";
- return language;
- }
- }
- };
- const nvueModule = {
- props: {},
- data() {
- return {
- nRefresherLoading: false,
- nListIsDragging: false,
- nShowBottom: true,
- nFixFreezing: false,
- nShowRefresherReveal: false,
- nLoadingMoreFixedHeight: false,
- nShowRefresherRevealHeight: 0,
- nOldShowRefresherRevealHeight: -1,
- nRefresherWidth: u$1.rpx2px(750),
- nListHeight: 0,
- nF2Opacity: 0
- };
- },
- computed: {},
- mounted() {
- },
- methods: {}
- };
- const emptyModule = {
- props: {
- // 是否强制隐藏空数据图,默认为否
- hideEmptyView: {
- type: Boolean,
- default: u$1.gc("hideEmptyView", false)
- },
- // 空数据图描述文字,默认为“没有数据哦~”
- emptyViewText: {
- type: [String, Object],
- default: u$1.gc("emptyViewText", null)
- },
- // 是否显示空数据图重新加载按钮(无数据时),默认为否
- showEmptyViewReload: {
- type: Boolean,
- default: u$1.gc("showEmptyViewReload", false)
- },
- // 加载失败时是否显示空数据图重新加载按钮,默认为是
- showEmptyViewReloadWhenError: {
- type: Boolean,
- default: u$1.gc("showEmptyViewReloadWhenError", true)
- },
- // 空数据图点击重新加载文字,默认为“重新加载”
- emptyViewReloadText: {
- type: [String, Object],
- default: u$1.gc("emptyViewReloadText", null)
- },
- // 空数据图图片,默认使用z-paging内置的图片
- emptyViewImg: {
- type: String,
- default: u$1.gc("emptyViewImg", "")
- },
- // 空数据图“加载失败”描述文字,默认为“很抱歉,加载失败”
- emptyViewErrorText: {
- type: [String, Object],
- default: u$1.gc("emptyViewErrorText", null)
- },
- // 空数据图“加载失败”图片,默认使用z-paging内置的图片
- emptyViewErrorImg: {
- type: String,
- default: u$1.gc("emptyViewErrorImg", "")
- },
- // 空数据图样式
- emptyViewStyle: {
- type: Object,
- default: u$1.gc("emptyViewStyle", {})
- },
- // 空数据图容器样式
- emptyViewSuperStyle: {
- type: Object,
- default: u$1.gc("emptyViewSuperStyle", {})
- },
- // 空数据图img样式
- emptyViewImgStyle: {
- type: Object,
- default: u$1.gc("emptyViewImgStyle", {})
- },
- // 空数据图描述文字样式
- emptyViewTitleStyle: {
- type: Object,
- default: u$1.gc("emptyViewTitleStyle", {})
- },
- // 空数据图重新加载按钮样式
- emptyViewReloadStyle: {
- type: Object,
- default: u$1.gc("emptyViewReloadStyle", {})
- },
- // 空数据图片是否铺满z-paging,默认为否,即填充满z-paging内列表(滚动区域)部分。若设置为否,则为填铺满整个z-paging
- emptyViewFixed: {
- type: Boolean,
- default: u$1.gc("emptyViewFixed", false)
- },
- // 空数据图片是否垂直居中,默认为是,若设置为否即为从空数据容器顶部开始显示。emptyViewFixed为false时有效
- emptyViewCenter: {
- type: Boolean,
- default: u$1.gc("emptyViewCenter", true)
- },
- // 加载中时是否自动隐藏空数据图,默认为是
- autoHideEmptyViewWhenLoading: {
- type: Boolean,
- default: u$1.gc("autoHideEmptyViewWhenLoading", true)
- },
- // 用户下拉列表触发下拉刷新加载中时是否自动隐藏空数据图,默认为是
- autoHideEmptyViewWhenPull: {
- type: Boolean,
- default: u$1.gc("autoHideEmptyViewWhenPull", true)
- },
- // 空数据view的z-index,默认为9
- emptyViewZIndex: {
- type: Number,
- default: u$1.gc("emptyViewZIndex", 9)
- }
- },
- data() {
- return {
- customerEmptyViewErrorText: ""
- };
- },
- computed: {
- finalEmptyViewImg() {
- return this.isLoadFailed ? this.emptyViewErrorImg : this.emptyViewImg;
- },
- finalShowEmptyViewReload() {
- return this.isLoadFailed ? this.showEmptyViewReloadWhenError : this.showEmptyViewReload;
- },
- // 是否展示空数据图
- showEmpty() {
- if (this.isOnly || this.hideEmptyView || this.realTotalData.length)
- return false;
- if (this.autoHideEmptyViewWhenLoading) {
- if (this.isAddedData && !this.firstPageLoaded && !this.loading)
- return true;
- } else {
- return true;
- }
- return !this.autoHideEmptyViewWhenPull && !this.isUserReload;
- }
- },
- methods: {
- // 点击了空数据view重新加载按钮
- _emptyViewReload() {
- let callbacked = false;
- this.$emit("emptyViewReload", (reload) => {
- if (reload === void 0 || reload === true) {
- this.fromEmptyViewReload = true;
- this.reload().catch(() => {
- });
- }
- callbacked = true;
- });
- this.$nextTick(() => {
- if (!callbacked) {
- this.fromEmptyViewReload = true;
- this.reload().catch(() => {
- });
- }
- });
- },
- // 点击了空数据view
- _emptyViewClick() {
- this.$emit("emptyViewClick");
- }
- }
- };
- const refresherModule = {
- props: {
- // 下拉刷新的主题样式,支持black,white,默认black
- refresherThemeStyle: {
- type: String,
- default: u$1.gc("refresherThemeStyle", "")
- },
- // 自定义下拉刷新中左侧图标的样式
- refresherImgStyle: {
- type: Object,
- default: u$1.gc("refresherImgStyle", {})
- },
- // 自定义下拉刷新中右侧状态描述文字的样式
- refresherTitleStyle: {
- type: Object,
- default: u$1.gc("refresherTitleStyle", {})
- },
- // 自定义下拉刷新中右侧最后更新时间文字的样式(show-refresher-update-time为true时有效)
- refresherUpdateTimeStyle: {
- type: Object,
- default: u$1.gc("refresherUpdateTimeStyle", {})
- },
- // 在微信小程序和QQ小程序中,是否实时监听下拉刷新中进度,默认为否
- watchRefresherTouchmove: {
- type: Boolean,
- default: u$1.gc("watchRefresherTouchmove", false)
- },
- // 底部加载更多的主题样式,支持black,white,默认black
- loadingMoreThemeStyle: {
- type: String,
- default: u$1.gc("loadingMoreThemeStyle", "")
- },
- // 是否只使用下拉刷新,设置为true后将关闭mounted自动请求数据、关闭滚动到底部加载更多,强制隐藏空数据图。默认为否
- refresherOnly: {
- type: Boolean,
- default: u$1.gc("refresherOnly", false)
- },
- // 自定义下拉刷新默认状态下回弹动画时间,单位为毫秒,默认为100毫秒,nvue无效
- refresherDefaultDuration: {
- type: [Number, String],
- default: u$1.gc("refresherDefaultDuration", 100)
- },
- // 自定义下拉刷新结束以后延迟回弹的时间,单位为毫秒,默认为0
- refresherCompleteDelay: {
- type: [Number, String],
- default: u$1.gc("refresherCompleteDelay", 0)
- },
- // 自定义下拉刷新结束回弹动画时间,单位为毫秒,默认为300毫秒(refresherEndBounceEnabled为false时,refresherCompleteDuration为设定值的1/3),nvue无效
- refresherCompleteDuration: {
- type: [Number, String],
- default: u$1.gc("refresherCompleteDuration", 300)
- },
- // 自定义下拉刷新中是否允许列表滚动,默认为是
- refresherRefreshingScrollable: {
- type: Boolean,
- default: u$1.gc("refresherRefreshingScrollable", true)
- },
- // 自定义下拉刷新结束状态下是否允许列表滚动,默认为否
- refresherCompleteScrollable: {
- type: Boolean,
- default: u$1.gc("refresherCompleteScrollable", false)
- },
- // 是否使用自定义的下拉刷新,默认为是,即使用z-paging的下拉刷新。设置为false即代表使用uni scroll-view自带的下拉刷新,h5、App、微信小程序以外的平台不支持uni scroll-view自带的下拉刷新
- useCustomRefresher: {
- type: Boolean,
- default: u$1.gc("useCustomRefresher", true)
- },
- // 自定义下拉刷新下拉帧率,默认为40,过高可能会出现抖动问题
- refresherFps: {
- type: [Number, String],
- default: u$1.gc("refresherFps", 40)
- },
- // 自定义下拉刷新允许触发的最大下拉角度,默认为40度,当下拉角度小于设定值时,自定义下拉刷新动画不会被触发
- refresherMaxAngle: {
- type: [Number, String],
- default: u$1.gc("refresherMaxAngle", 40)
- },
- // 自定义下拉刷新的角度由未达到最大角度变到达到最大角度时,是否继续下拉刷新手势,默认为否
- refresherAngleEnableChangeContinued: {
- type: Boolean,
- default: u$1.gc("refresherAngleEnableChangeContinued", false)
- },
- // 自定义下拉刷新默认状态下的文字
- refresherDefaultText: {
- type: [String, Object],
- default: u$1.gc("refresherDefaultText", null)
- },
- // 自定义下拉刷新松手立即刷新状态下的文字
- refresherPullingText: {
- type: [String, Object],
- default: u$1.gc("refresherPullingText", null)
- },
- // 自定义下拉刷新刷新中状态下的文字
- refresherRefreshingText: {
- type: [String, Object],
- default: u$1.gc("refresherRefreshingText", null)
- },
- // 自定义下拉刷新刷新结束状态下的文字
- refresherCompleteText: {
- type: [String, Object],
- default: u$1.gc("refresherCompleteText", null)
- },
- // 自定义继续下拉进入二楼文字
- refresherGoF2Text: {
- type: [String, Object],
- default: u$1.gc("refresherGoF2Text", null)
- },
- // 自定义下拉刷新默认状态下的图片
- refresherDefaultImg: {
- type: String,
- default: u$1.gc("refresherDefaultImg", null)
- },
- // 自定义下拉刷新松手立即刷新状态下的图片,默认与refresherDefaultImg一致
- refresherPullingImg: {
- type: String,
- default: u$1.gc("refresherPullingImg", null)
- },
- // 自定义下拉刷新刷新中状态下的图片
- refresherRefreshingImg: {
- type: String,
- default: u$1.gc("refresherRefreshingImg", null)
- },
- // 自定义下拉刷新刷新结束状态下的图片
- refresherCompleteImg: {
- type: String,
- default: u$1.gc("refresherCompleteImg", null)
- },
- // 自定义下拉刷新刷新中状态下是否展示旋转动画
- refresherRefreshingAnimated: {
- type: Boolean,
- default: u$1.gc("refresherRefreshingAnimated", true)
- },
- // 是否开启自定义下拉刷新刷新结束回弹效果,默认为是
- refresherEndBounceEnabled: {
- type: Boolean,
- default: u$1.gc("refresherEndBounceEnabled", true)
- },
- // 是否开启自定义下拉刷新,默认为是
- refresherEnabled: {
- type: Boolean,
- default: u$1.gc("refresherEnabled", true)
- },
- // 设置自定义下拉刷新阈值,默认为80rpx
- refresherThreshold: {
- type: [Number, String],
- default: u$1.gc("refresherThreshold", "80rpx")
- },
- // 设置系统下拉刷新默认样式,支持设置 black,white,none,none 表示不使用默认样式,默认为black
- refresherDefaultStyle: {
- type: String,
- default: u$1.gc("refresherDefaultStyle", "black")
- },
- // 设置自定义下拉刷新区域背景
- refresherBackground: {
- type: String,
- default: u$1.gc("refresherBackground", "transparent")
- },
- // 设置固定的自定义下拉刷新区域背景
- refresherFixedBackground: {
- type: String,
- default: u$1.gc("refresherFixedBackground", "transparent")
- },
- // 设置固定的自定义下拉刷新区域高度,默认为0
- refresherFixedBacHeight: {
- type: [Number, String],
- default: u$1.gc("refresherFixedBacHeight", 0)
- },
- // 设置自定义下拉刷新下拉超出阈值后继续下拉位移衰减的比例,范围0-1,值越大代表衰减越多。默认为0.65(nvue无效)
- refresherOutRate: {
- type: Number,
- default: u$1.gc("refresherOutRate", 0.65)
- },
- // 是否开启下拉进入二楼功能,默认为否
- refresherF2Enabled: {
- type: Boolean,
- default: u$1.gc("refresherF2Enabled", false)
- },
- // 下拉进入二楼阈值,默认为200rpx
- refresherF2Threshold: {
- type: [Number, String],
- default: u$1.gc("refresherF2Threshold", "200rpx")
- },
- // 下拉进入二楼动画时间,单位为毫秒,默认为200毫秒
- refresherF2Duration: {
- type: [Number, String],
- default: u$1.gc("refresherF2Duration", 200)
- },
- // 下拉进入二楼状态松手后是否弹出二楼,默认为是
- showRefresherF2: {
- type: Boolean,
- default: u$1.gc("showRefresherF2", true)
- },
- // 设置自定义下拉刷新下拉时实际下拉位移与用户下拉距离的比值,默认为0.75,即代表若用户下拉10px,则实际位移为7.5px(nvue无效)
- refresherPullRate: {
- type: Number,
- default: u$1.gc("refresherPullRate", 0.75)
- },
- // 是否显示最后更新时间,默认为否
- showRefresherUpdateTime: {
- type: Boolean,
- default: u$1.gc("showRefresherUpdateTime", false)
- },
- // 如果需要区别不同页面的最后更新时间,请为不同页面的z-paging的`refresher-update-time-key`设置不同的字符串
- refresherUpdateTimeKey: {
- type: String,
- default: u$1.gc("refresherUpdateTimeKey", "default")
- },
- // 下拉刷新时下拉到“松手立即刷新”或“松手进入二楼”状态时是否使手机短振动,默认为否(h5无效)
- refresherVibrate: {
- type: Boolean,
- default: u$1.gc("refresherVibrate", false)
- },
- // 下拉刷新时是否禁止下拉刷新view跟随用户触摸竖直移动,默认为否。注意此属性只是禁止下拉刷新view移动,其他下拉刷新逻辑依然会正常触发
- refresherNoTransform: {
- type: Boolean,
- default: u$1.gc("refresherNoTransform", false)
- },
- // 是否开启下拉刷新状态栏占位,适用于隐藏导航栏时,下拉刷新需要避开状态栏高度的情况,默认为否
- useRefresherStatusBarPlaceholder: {
- type: Boolean,
- default: u$1.gc("useRefresherStatusBarPlaceholder", false)
- }
- },
- data() {
- return {
- R: Enum.Refresher,
- //下拉刷新状态
- refresherStatus: Enum.Refresher.Default,
- refresherTouchstartY: 0,
- lastRefresherTouchmove: null,
- refresherReachMaxAngle: true,
- refresherTransform: "translateY(0px)",
- refresherTransition: "",
- finalRefresherDefaultStyle: "black",
- refresherRevealStackCount: 0,
- refresherCompleteTimeout: null,
- refresherCompleteSubTimeout: null,
- refresherEndTimeout: null,
- isTouchmovingTimeout: null,
- refresherTriggered: false,
- isTouchmoving: false,
- isTouchEnded: false,
- isUserPullDown: false,
- privateRefresherEnabled: -1,
- privateShowRefresherWhenReload: false,
- customRefresherHeight: -1,
- showCustomRefresher: false,
- doRefreshAnimateAfter: false,
- isRefresherInComplete: false,
- showF2: false,
- f2Transform: "",
- pullDownTimeStamp: 0,
- moveDis: 0,
- oldMoveDis: 0,
- currentDis: 0,
- oldCurrentMoveDis: 0,
- oldRefresherTouchmoveY: 0,
- oldTouchDirection: "",
- oldEmitedTouchDirection: "",
- oldPullingDistance: -1,
- refresherThresholdUpdateTag: 0
- };
- },
- watch: {
- refresherDefaultStyle: {
- handler(newVal) {
- if (newVal.length) {
- this.finalRefresherDefaultStyle = newVal;
- }
- },
- immediate: true
- },
- refresherStatus(newVal) {
- newVal === Enum.Refresher.Loading && this._cleanRefresherEndTimeout();
- this.refresherVibrate && (newVal === Enum.Refresher.ReleaseToRefresh || newVal === Enum.Refresher.GoF2) && this._doVibrateShort();
- this.$emit("refresherStatusChange", newVal);
- this.$emit("update:refresherStatus", newVal);
- },
- // 监听当前下拉刷新启用/禁用状态
- refresherEnabled(newVal) {
- !newVal && this.endRefresh();
- }
- },
- computed: {
- pullDownDisTimeStamp() {
- return 1e3 / this.refresherFps;
- },
- refresherThresholdUnitConverted() {
- return u$1.addUnit(this.refresherThreshold, this.unit);
- },
- finalRefresherEnabled() {
- if (this.layoutOnly || this.useChatRecordMode)
- return false;
- if (this.privateRefresherEnabled === -1)
- return this.refresherEnabled;
- return this.privateRefresherEnabled === 1;
- },
- finalRefresherThreshold() {
- let refresherThreshold = this.refresherThresholdUnitConverted;
- let idDefault = false;
- if (refresherThreshold === u$1.addUnit(80, this.unit)) {
- idDefault = true;
- if (this.showRefresherUpdateTime) {
- refresherThreshold = u$1.addUnit(120, this.unit);
- }
- }
- if (idDefault && this.customRefresherHeight > 0)
- return this.customRefresherHeight + this.finalRefresherThresholdPlaceholder;
- return u$1.convertToPx(refresherThreshold) + this.finalRefresherThresholdPlaceholder;
- },
- finalRefresherF2Threshold() {
- return u$1.convertToPx(u$1.addUnit(this.refresherF2Threshold, this.unit));
- },
- finalRefresherThresholdPlaceholder() {
- return this.useRefresherStatusBarPlaceholder ? this.statusBarHeight : 0;
- },
- finalRefresherFixedBacHeight() {
- return u$1.convertToPx(this.refresherFixedBacHeight);
- },
- finalRefresherThemeStyle() {
- return this.refresherThemeStyle.length ? this.refresherThemeStyle : this.defaultThemeStyle;
- },
- finalRefresherOutRate() {
- let rate = this.refresherOutRate;
- rate = Math.max(0, rate);
- rate = Math.min(1, rate);
- return rate;
- },
- finalRefresherPullRate() {
- let rate = this.refresherPullRate;
- rate = Math.max(0, rate);
- return rate;
- },
- finalRefresherTransform() {
- if (this.refresherNoTransform || this.refresherTransform === "translateY(0px)")
- return "none";
- return this.refresherTransform;
- },
- finalShowRefresherWhenReload() {
- return this.showRefresherWhenReload || this.privateShowRefresherWhenReload;
- },
- finalRefresherTriggered() {
- if (!(this.finalRefresherEnabled && !this.useCustomRefresher))
- return false;
- return this.refresherTriggered;
- },
- showRefresher() {
- const showRefresher = this.finalRefresherEnabled || this.useCustomRefresher && !this.useChatRecordMode;
- this.active && this.customRefresherHeight === -1 && showRefresher && this.updateCustomRefresherHeight();
- return showRefresher;
- },
- hasTouchmove() {
- return this.watchRefresherTouchmove;
- }
- },
- methods: {
- // 终止下拉刷新状态
- endRefresh() {
- this.totalData = this.realTotalData;
- this._refresherEnd();
- this._endSystemLoadingAndRefresh();
- this._handleScrollViewBounce({ bounce: true });
- this.$nextTick(() => {
- this.refresherTriggered = false;
- });
- },
- // 手动更新自定义下拉刷新view高度
- updateCustomRefresherHeight() {
- u$1.delay(() => this.$nextTick(this._updateCustomRefresherHeight));
- },
- // 进入二楼
- goF2() {
- this._handleGoF2();
- },
- // 关闭二楼
- closeF2() {
- this._handleCloseF2();
- },
- // 自定义下拉刷新被触发
- _onRefresh(fromScrollView = false, isUserPullDown = true) {
- if (fromScrollView && !(this.finalRefresherEnabled && !this.useCustomRefresher))
- return;
- this.$emit("onRefresh");
- this.$emit("Refresh");
- if (this.loading || this.isRefresherInComplete)
- return;
- this.loadingType = Enum.LoadingType.Refresher;
- if (this.nShowRefresherReveal)
- return;
- this.isUserPullDown = isUserPullDown;
- this.isUserReload = !isUserPullDown;
- this._startLoading(true);
- this.refresherTriggered = true;
- if (this.reloadWhenRefresh && isUserPullDown) {
- this.useChatRecordMode ? this._onLoadingMore("click") : this._reload(false, false, isUserPullDown);
- }
- },
- // 自定义下拉刷新被复位
- _onRestore() {
- this.refresherTriggered = "restore";
- this.$emit("onRestore");
- this.$emit("Restore");
- },
- // 进一步处理touch开始结果
- _handleRefresherTouchstart(touch) {
- if (!this.loading && this.isTouchEnded) {
- this.isTouchmoving = false;
- }
- this.loadingType = Enum.LoadingType.Refresher;
- this.isTouchmovingTimeout && clearTimeout(this.isTouchmovingTimeout);
- this.isTouchEnded = false;
- this.refresherTransition = "";
- this.refresherTouchstartY = touch.touchY;
- this.$emit("refresherTouchstart", this.refresherTouchstartY);
- this.lastRefresherTouchmove = touch;
- this._cleanRefresherCompleteTimeout();
- this._cleanRefresherEndTimeout();
- },
- // 非app-vue或微信小程序或QQ小程序或h5平台,使用js控制下拉刷新
- // 进一步处理touch中结果
- _handleRefresherTouchmove(moveDis, touch) {
- this.refresherReachMaxAngle = true;
- this.isTouchmovingTimeout && clearTimeout(this.isTouchmovingTimeout);
- this.isTouchmoving = true;
- this.isTouchEnded = false;
- if (moveDis >= this.finalRefresherThreshold) {
- this.refresherStatus = this.refresherF2Enabled && moveDis >= this.finalRefresherF2Threshold ? Enum.Refresher.GoF2 : Enum.Refresher.ReleaseToRefresh;
- } else {
- this.refresherStatus = Enum.Refresher.Default;
- }
- this.moveDis = moveDis;
- },
- // 进一步处理touch结束结果
- _handleRefresherTouchend(moveDis) {
- this.isTouchmovingTimeout && clearTimeout(this.isTouchmovingTimeout);
- this.refresherReachMaxAngle = true;
- this.isTouchEnded = true;
- const refresherThreshold = this.finalRefresherThreshold;
- if (moveDis >= refresherThreshold && [Enum.Refresher.ReleaseToRefresh, Enum.Refresher.GoF2].indexOf(this.refresherStatus) >= 0) {
- if (this.refresherStatus === Enum.Refresher.GoF2) {
- this._handleGoF2();
- this._refresherEnd();
- } else {
- u$1.delay(() => {
- this._emitTouchmove({ pullingDistance: refresherThreshold, dy: this.moveDis - refresherThreshold });
- }, 0.1);
- this.moveDis = refresherThreshold;
- this.refresherStatus = Enum.Refresher.Loading;
- this._doRefresherLoad();
- }
- } else {
- this._refresherEnd();
- this.isTouchmovingTimeout = u$1.delay(() => {
- this.isTouchmoving = false;
- }, this.refresherDefaultDuration);
- }
- this.scrollEnable = true;
- this.$emit("refresherTouchend", moveDis);
- },
- // 处理列表触摸开始事件
- _handleListTouchstart() {
- if (this.useChatRecordMode && this.autoHideKeyboardWhenChat) {
- uni.hideKeyboard();
- this.$emit("hidedKeyboard");
- }
- },
- // 处理scroll-view bounce是否生效
- _handleScrollViewBounce({ bounce }) {
- if (!this.usePageScroll && !this.scrollToTopBounceEnabled) {
- if (this.wxsScrollTop <= 5) {
- this.refresherTransition = "";
- this.scrollEnable = bounce;
- } else if (bounce) {
- this.scrollEnable = bounce;
- }
- }
- },
- // wxs正在下拉状态改变处理
- _handleWxsPullingDownStatusChange(onPullingDown) {
- this.wxsOnPullingDown = onPullingDown;
- if (onPullingDown && !this.useChatRecordMode) {
- this.renderPropScrollTop = 0;
- }
- },
- // wxs正在下拉处理
- _handleWxsPullingDown({ moveDis, diffDis }) {
- this._emitTouchmove({ pullingDistance: moveDis, dy: diffDis });
- },
- // wxs触摸方向改变
- _handleTouchDirectionChange({ direction }) {
- this.$emit("touchDirectionChange", direction);
- },
- // wxs通知更新其props
- _handlePropUpdate() {
- this.wxsPropType = u$1.getTime().toString();
- },
- // 下拉刷新结束
- _refresherEnd(shouldEndLoadingDelay = true, fromAddData = false, isUserPullDown = false, setLoading = true) {
- if (this.loadingType === Enum.LoadingType.Refresher) {
- const refresherCompleteDelay = fromAddData && (isUserPullDown || this.showRefresherWhenReload) ? this.refresherCompleteDelay : 0;
- const refresherStatus = refresherCompleteDelay > 0 ? Enum.Refresher.Complete : Enum.Refresher.Default;
- if (this.finalShowRefresherWhenReload) {
- const stackCount = this.refresherRevealStackCount;
- this.refresherRevealStackCount--;
- if (stackCount > 1)
- return;
- }
- this._cleanRefresherEndTimeout();
- this.refresherEndTimeout = u$1.delay(() => {
- this.refresherStatus = refresherStatus;
- if (refresherStatus !== Enum.Refresher.Complete) {
- this.isRefresherInComplete = false;
- }
- }, this.refresherStatus !== Enum.Refresher.Default && refresherStatus === Enum.Refresher.Default ? this.refresherCompleteDuration : 0);
- if (refresherCompleteDelay > 0) {
- this.isRefresherInComplete = true;
- }
- this._cleanRefresherCompleteTimeout();
- this.refresherCompleteTimeout = u$1.delay(() => {
- let animateDuration = 1;
- const animateType = this.refresherEndBounceEnabled && fromAddData ? "cubic-bezier(0.19,1.64,0.42,0.72)" : "linear";
- if (fromAddData) {
- animateDuration = this.refresherEndBounceEnabled ? this.refresherCompleteDuration / 1e3 : this.refresherCompleteDuration / 3e3;
- }
- this.refresherTransition = `transform ${fromAddData ? animateDuration : this.refresherDefaultDuration / 1e3}s ${animateType}`;
- this.wxsPropType = this.refresherTransition + "end" + u$1.getTime();
- this.moveDis = 0;
- if (refresherStatus === Enum.Refresher.Complete) {
- if (this.refresherCompleteSubTimeout) {
- clearTimeout(this.refresherCompleteSubTimeout);
- this.refresherCompleteSubTimeout = null;
- }
- this.refresherCompleteSubTimeout = u$1.delay(() => {
- this.$nextTick(() => {
- this.refresherStatus = Enum.Refresher.Default;
- this.isRefresherInComplete = false;
- });
- }, animateDuration * 800);
- }
- this._emitTouchmove({ pullingDistance: 0, dy: this.moveDis });
- }, refresherCompleteDelay);
- }
- if (setLoading) {
- u$1.delay(() => this.loading = false, shouldEndLoadingDelay ? 10 : 0);
- isUserPullDown && this._onRestore();
- }
- },
- // 处理进入二楼
- _handleGoF2() {
- if (this.showF2 || !this.refresherF2Enabled)
- return;
- this.$emit("refresherF2Change", "go");
- if (!this.showRefresherF2)
- return;
- this.f2Transform = `translateY(${-this.superContentHeight}px)`;
- this.showF2 = true;
- u$1.delay(() => {
- this.f2Transform = "translateY(0px)";
- }, 100, "f2ShowDelay");
- },
- // 处理退出二楼
- _handleCloseF2() {
- if (!this.showF2 || !this.refresherF2Enabled)
- return;
- this.$emit("refresherF2Change", "close");
- if (!this.showRefresherF2)
- return;
- this.f2Transform = `translateY(${-this.superContentHeight}px)`;
- u$1.delay(() => {
- this.showF2 = false;
- this.nF2Opacity = 0;
- }, this.refresherF2Duration, "f2CloseDelay");
- },
- // 模拟用户手动触发下拉刷新
- _doRefresherRefreshAnimate() {
- this._cleanRefresherCompleteTimeout();
- const doRefreshAnimateAfter = !this.doRefreshAnimateAfter && this.finalShowRefresherWhenReload && this.customRefresherHeight === -1 && this.refresherThreshold === u$1.addUnit(80, this.unit);
- if (doRefreshAnimateAfter) {
- this.doRefreshAnimateAfter = true;
- return;
- }
- this.refresherRevealStackCount++;
- this.wxsPropType = "begin" + u$1.getTime();
- this.moveDis = this.finalRefresherThreshold;
- this.refresherStatus = Enum.Refresher.Loading;
- this.isTouchmoving = true;
- this.isTouchmovingTimeout && clearTimeout(this.isTouchmovingTimeout);
- this._doRefresherLoad(false);
- },
- // 触发下拉刷新
- _doRefresherLoad(isUserPullDown = true) {
- this._onRefresh(false, isUserPullDown);
- this.loading = true;
- },
- // 更新自定义下拉刷新view高度
- _updateCustomRefresherHeight() {
- this._getNodeClientRect(".zp-custom-refresher-slot-view").then((res) => {
- this.customRefresherHeight = res ? res[0].height : 0;
- this.showCustomRefresher = this.customRefresherHeight > 0;
- if (this.doRefreshAnimateAfter) {
- this.doRefreshAnimateAfter = false;
- this._doRefresherRefreshAnimate();
- }
- });
- },
- // emit pullingDown事件
- _emitTouchmove(e2) {
- e2.viewHeight = this.finalRefresherThreshold;
- e2.rate = e2.viewHeight > 0 ? e2.pullingDistance / e2.viewHeight : 0;
- this.hasTouchmove && this.oldPullingDistance !== e2.pullingDistance && this.$emit("refresherTouchmove", e2);
- this.oldPullingDistance = e2.pullingDistance;
- },
- // 清除refresherCompleteTimeout
- _cleanRefresherCompleteTimeout() {
- this.refresherCompleteTimeout = this._cleanTimeout(this.refresherCompleteTimeout);
- },
- // 清除refresherEndTimeout
- _cleanRefresherEndTimeout() {
- this.refresherEndTimeout = this._cleanTimeout(this.refresherEndTimeout);
- }
- }
- };
- const loadMoreModule = {
- props: {
- // 自定义底部加载更多样式
- loadingMoreCustomStyle: {
- type: Object,
- default: u$1.gc("loadingMoreCustomStyle", {})
- },
- // 自定义底部加载更多文字样式
- loadingMoreTitleCustomStyle: {
- type: Object,
- default: u$1.gc("loadingMoreTitleCustomStyle", {})
- },
- // 自定义底部加载更多加载中动画样式
- loadingMoreLoadingIconCustomStyle: {
- type: Object,
- default: u$1.gc("loadingMoreLoadingIconCustomStyle", {})
- },
- // 自定义底部加载更多加载中动画图标类型,可选flower或circle,默认为flower
- loadingMoreLoadingIconType: {
- type: String,
- default: u$1.gc("loadingMoreLoadingIconType", "flower")
- },
- // 自定义底部加载更多加载中动画图标图片
- loadingMoreLoadingIconCustomImage: {
- type: String,
- default: u$1.gc("loadingMoreLoadingIconCustomImage", "")
- },
- // 底部加载更多加载中view是否展示旋转动画,默认为是
- loadingMoreLoadingAnimated: {
- type: Boolean,
- default: u$1.gc("loadingMoreLoadingAnimated", true)
- },
- // 是否启用加载更多数据(含滑动到底部加载更多数据和点击加载更多数据),默认为是
- loadingMoreEnabled: {
- type: Boolean,
- default: u$1.gc("loadingMoreEnabled", true)
- },
- // 是否启用滑动到底部加载更多数据,默认为是
- toBottomLoadingMoreEnabled: {
- type: Boolean,
- default: u$1.gc("toBottomLoadingMoreEnabled", true)
- },
- // 滑动到底部状态为默认状态时,以加载中的状态展示,默认为否。若设置为是,可避免滚动到底部看到默认状态然后立刻变为加载中状态的问题,但分页数量未超过一屏时,不会显示【点击加载更多】
- loadingMoreDefaultAsLoading: {
- type: Boolean,
- default: u$1.gc("loadingMoreDefaultAsLoading", false)
- },
- // 滑动到底部"默认"文字,默认为【点击加载更多】
- loadingMoreDefaultText: {
- type: [String, Object],
- default: u$1.gc("loadingMoreDefaultText", null)
- },
- // 滑动到底部"加载中"文字,默认为【正在加载...】
- loadingMoreLoadingText: {
- type: [String, Object],
- default: u$1.gc("loadingMoreLoadingText", null)
- },
- // 滑动到底部"没有更多"文字,默认为【没有更多了】
- loadingMoreNoMoreText: {
- type: [String, Object],
- default: u$1.gc("loadingMoreNoMoreText", null)
- },
- // 滑动到底部"加载失败"文字,默认为【加载失败,点击重新加载】
- loadingMoreFailText: {
- type: [String, Object],
- default: u$1.gc("loadingMoreFailText", null)
- },
- // 当没有更多数据且分页内容未超出z-paging时是否隐藏没有更多数据的view,默认为否
- hideNoMoreInside: {
- type: Boolean,
- default: u$1.gc("hideNoMoreInside", false)
- },
- // 当没有更多数据且分页数组长度少于这个值时,隐藏没有更多数据的view,默认为0,代表不限制。
- hideNoMoreByLimit: {
- type: Number,
- default: u$1.gc("hideNoMoreByLimit", 0)
- },
- // 是否显示默认的加载更多text,默认为是
- showDefaultLoadingMoreText: {
- type: Boolean,
- default: u$1.gc("showDefaultLoadingMoreText", true)
- },
- // 是否显示没有更多数据的view
- showLoadingMoreNoMoreView: {
- type: Boolean,
- default: u$1.gc("showLoadingMoreNoMoreView", true)
- },
- // 是否显示没有更多数据的分割线,默认为是
- showLoadingMoreNoMoreLine: {
- type: Boolean,
- default: u$1.gc("showLoadingMoreNoMoreLine", true)
- },
- // 自定义底部没有更多数据的分割线样式
- loadingMoreNoMoreLineCustomStyle: {
- type: Object,
- default: u$1.gc("loadingMoreNoMoreLineCustomStyle", {})
- },
- // 当分页未满一屏时,是否自动加载更多,默认为否(nvue无效)
- insideMore: {
- type: Boolean,
- default: u$1.gc("insideMore", false)
- },
- // 距底部/右边多远时(单位px),触发 scrolltolower 事件,默认为100rpx
- lowerThreshold: {
- type: [Number, String],
- default: u$1.gc("lowerThreshold", "100rpx")
- }
- },
- data() {
- return {
- M: Enum.More,
- // 底部加载更多状态
- loadingStatus: Enum.More.Default,
- // 在渲染之后的底部加载更多状态
- loadingStatusAfterRender: Enum.More.Default,
- // 底部加载更多时间戳
- loadingMoreTimeStamp: 0,
- // 底部加载更多slot
- loadingMoreDefaultSlot: null,
- // 是否展示底部加载更多
- showLoadingMore: false,
- // 是否是开发者自定义的加载更多,-1代表交由z-paging自行判断;1代表没有更多了;0代表还有更多数据
- customNoMore: -1
- };
- },
- computed: {
- // 底部加载更多配置
- zLoadMoreConfig() {
- return {
- status: this.loadingStatusAfterRender,
- defaultAsLoading: this.loadingMoreDefaultAsLoading || this.useChatRecordMode && this.chatLoadingMoreDefaultAsLoading,
- defaultThemeStyle: this.finalLoadingMoreThemeStyle,
- customStyle: this.loadingMoreCustomStyle,
- titleCustomStyle: this.loadingMoreTitleCustomStyle,
- iconCustomStyle: this.loadingMoreLoadingIconCustomStyle,
- loadingIconType: this.loadingMoreLoadingIconType,
- loadingIconCustomImage: this.loadingMoreLoadingIconCustomImage,
- loadingAnimated: this.loadingMoreLoadingAnimated,
- showNoMoreLine: this.showLoadingMoreNoMoreLine,
- noMoreLineCustomStyle: this.loadingMoreNoMoreLineCustomStyle,
- defaultText: this.finalLoadingMoreDefaultText,
- loadingText: this.finalLoadingMoreLoadingText,
- noMoreText: this.finalLoadingMoreNoMoreText,
- failText: this.finalLoadingMoreFailText,
- hideContent: !this.loadingMoreDefaultAsLoading && this.listRendering,
- unit: this.unit,
- isChat: this.useChatRecordMode,
- chatDefaultAsLoading: this.chatLoadingMoreDefaultAsLoading
- };
- },
- // 最终的底部加载更多主题
- finalLoadingMoreThemeStyle() {
- return this.loadingMoreThemeStyle.length ? this.loadingMoreThemeStyle : this.defaultThemeStyle;
- },
- // 最终的底部加载更多触发阈值
- finalLowerThreshold() {
- return u$1.convertToPx(this.lowerThreshold);
- },
- // 是否显示默认状态下的底部加载更多
- showLoadingMoreDefault() {
- return this._showLoadingMore("Default");
- },
- // 是否显示加载中状态下的底部加载更多
- showLoadingMoreLoading() {
- return this._showLoadingMore("Loading");
- },
- // 是否显示没有更多了状态下的底部加载更多
- showLoadingMoreNoMore() {
- return this._showLoadingMore("NoMore");
- },
- // 是否显示加载失败状态下的底部加载更多
- showLoadingMoreFail() {
- return this._showLoadingMore("Fail");
- },
- // 是否显示自定义状态下的底部加载更多
- showLoadingMoreCustom() {
- return this._showLoadingMore("Custom");
- },
- // 底部加载更多固定高度
- loadingMoreFixedHeight() {
- return u$1.addUnit("80rpx", this.unit);
- }
- },
- methods: {
- // 页面滚动到底部时通知z-paging进行进一步处理
- pageReachBottom() {
- !this.useChatRecordMode && this.toBottomLoadingMoreEnabled && this._onLoadingMore("toBottom");
- },
- // 手动触发上拉加载更多(非必须,可依据具体需求使用)
- doLoadMore(type2) {
- this._onLoadingMore(type2);
- },
- // 通过@scroll事件检测是否滚动到了底部(顺带检测下是否滚动到了顶部)
- _checkScrolledToBottom(scrollDiff, checked = false) {
- if (this.cacheScrollNodeHeight === -1) {
- this._getNodeClientRect(".zp-scroll-view").then((res) => {
- if (res) {
- const scrollNodeHeight = res[0].height;
- this.cacheScrollNodeHeight = scrollNodeHeight;
- if (scrollDiff - scrollNodeHeight <= this.finalLowerThreshold) {
- this._onLoadingMore("toBottom");
- }
- }
- });
- } else {
- if (scrollDiff - this.cacheScrollNodeHeight <= this.finalLowerThreshold) {
- this._onLoadingMore("toBottom");
- } else if (scrollDiff - this.cacheScrollNodeHeight <= 500 && !checked) {
- u$1.delay(() => {
- this._getNodeClientRect(".zp-scroll-view", true, true).then((res) => {
- if (res) {
- this.oldScrollTop = res[0].scrollTop;
- const newScrollDiff = res[0].scrollHeight - this.oldScrollTop;
- this._checkScrolledToBottom(newScrollDiff, true);
- }
- });
- }, 150, "checkScrolledToBottomDelay");
- }
- if (this.oldScrollTop <= 150 && this.oldScrollTop !== 0) {
- u$1.delay(() => {
- if (this.oldScrollTop !== 0) {
- this._getNodeClientRect(".zp-scroll-view", true, true).then((res) => {
- if (res && res[0].scrollTop === 0 && this.oldScrollTop !== 0) {
- this._onScrollToUpper();
- }
- });
- }
- }, 150, "checkScrolledToTopDelay");
- }
- }
- },
- // 触发加载更多时调用,from:toBottom-滑动到底部触发;click-点击加载更多触发
- _onLoadingMore(from = "click") {
- if (this.isIos && from === "toBottom" && !this.scrollToBottomBounceEnabled && this.scrollEnable) {
- this.scrollEnable = false;
- this.$nextTick(() => {
- this.scrollEnable = true;
- });
- }
- this._emitScrollEvent("scrolltolower");
- if (this.isOnly || !this.loadingMoreEnabled || !(this.loadingStatus === Enum.More.Default || this.loadingStatus === Enum.More.Fail) || this.loading || this.showEmpty)
- return;
- this._doLoadingMore();
- },
- // 处理开始加载更多
- _doLoadingMore() {
- if (this.pageNo >= this.defaultPageNo && this.loadingStatus !== Enum.More.NoMore) {
- this.pageNo++;
- this._startLoading(false);
- if (this.isLocalPaging) {
- this._localPagingQueryList(this.pageNo, this.defaultPageSize, this.localPagingLoadingTime, (res) => {
- this.completeByTotal(res, this.totalLocalPagingList.length);
- this.queryFrom = Enum.QueryFrom.LoadMore;
- });
- } else {
- this._emitQuery(this.pageNo, this.defaultPageSize, Enum.QueryFrom.LoadMore);
- this._callMyParentQuery();
- }
- this.loadingType = Enum.LoadingType.LoadMore;
- }
- },
- // (预处理)判断当没有更多数据且分页内容未超出z-paging时是否显示没有更多数据的view
- _preCheckShowNoMoreInside(newVal, scrollViewNode, pagingContainerNode) {
- if (this.loadingStatus === Enum.More.NoMore && this.hideNoMoreByLimit > 0 && newVal.length) {
- this.showLoadingMore = newVal.length > this.hideNoMoreByLimit;
- } else if (this.loadingStatus === Enum.More.NoMore && this.hideNoMoreInside && newVal.length || this.insideMore && this.insideOfPaging !== false && newVal.length) {
- this.$nextTick(() => {
- this._checkShowNoMoreInside(newVal, scrollViewNode, pagingContainerNode);
- });
- if (this.insideMore && this.insideOfPaging !== false && newVal.length) {
- this.showLoadingMore = newVal.length;
- }
- } else {
- this.showLoadingMore = newVal.length;
- }
- },
- // 判断当没有更多数据且分页内容未超出z-paging时是否显示没有更多数据的view
- async _checkShowNoMoreInside(totalData, oldScrollViewNode, oldPagingContainerNode) {
- try {
- const scrollViewNode = oldScrollViewNode || await this._getNodeClientRect(".zp-scroll-view");
- if (this.usePageScroll) {
- if (scrollViewNode) {
- const scrollViewTotalH = scrollViewNode[0].top + scrollViewNode[0].height;
- this.insideOfPaging = scrollViewTotalH < this.windowHeight;
- if (this.hideNoMoreInside) {
- this.showLoadingMore = !this.insideOfPaging;
- }
- this._updateInsideOfPaging();
- }
- } else {
- const pagingContainerNode = oldPagingContainerNode || await this._getNodeClientRect(".zp-paging-container-content");
- const pagingContainerH = pagingContainerNode ? pagingContainerNode[0].height : 0;
- const scrollViewH = scrollViewNode ? scrollViewNode[0].height : 0;
- this.insideOfPaging = pagingContainerH < scrollViewH;
- if (this.hideNoMoreInside) {
- this.showLoadingMore = !this.insideOfPaging;
- }
- this._updateInsideOfPaging();
- }
- } catch (e2) {
- this.insideOfPaging = !totalData.length;
- if (this.hideNoMoreInside) {
- this.showLoadingMore = !this.insideOfPaging;
- }
- this._updateInsideOfPaging();
- }
- },
- // 是否要展示上拉加载更多view
- _showLoadingMore(type2) {
- if (!this.showLoadingMoreWhenReload && (!(this.loadingStatus === Enum.More.Default ? this.nShowBottom : true) || !this.realTotalData.length))
- return false;
- if ((!this.showLoadingMoreWhenReload || this.isUserPullDown || this.loadingStatus !== Enum.More.Loading) && !this.showLoadingMore || !this.loadingMoreEnabled && (!this.showLoadingMoreWhenReload || this.isUserPullDown || this.loadingStatus !== Enum.More.Loading) || this.isOnly) {
- return false;
- }
- if (this.useChatRecordMode && type2 !== "Loading")
- return false;
- if (!this.zSlots)
- return false;
- if (type2 === "Custom") {
- return this.showDefaultLoadingMoreText && !(this.loadingStatus === Enum.More.NoMore && !this.showLoadingMoreNoMoreView);
- }
- const res = this.loadingStatus === Enum.More[type2] && this.zSlots[`loadingMore${type2}`] && (type2 === "NoMore" ? this.showLoadingMoreNoMoreView : true);
- return res;
- }
- }
- };
- const loadingModule = {
- props: {
- // 第一次加载后自动隐藏loading slot,默认为是
- autoHideLoadingAfterFirstLoaded: {
- type: Boolean,
- default: u$1.gc("autoHideLoadingAfterFirstLoaded", true)
- },
- // loading slot是否铺满屏幕并固定,默认为否
- loadingFullFixed: {
- type: Boolean,
- default: u$1.gc("loadingFullFixed", false)
- },
- // 是否自动显示系统Loading:即uni.showLoading,若开启则将在刷新列表时(调用reload、refresh时)显示,下拉刷新和滚动到底部加载更多不会显示,默认为false。
- autoShowSystemLoading: {
- type: Boolean,
- default: u$1.gc("autoShowSystemLoading", false)
- },
- // 显示系统Loading时是否显示透明蒙层,防止触摸穿透,默认为是(H5、App、微信小程序、百度小程序有效)
- systemLoadingMask: {
- type: Boolean,
- default: u$1.gc("systemLoadingMask", true)
- },
- // 显示系统Loading时显示的文字,默认为"加载中"
- systemLoadingText: {
- type: [String, Object],
- default: u$1.gc("systemLoadingText", null)
- }
- },
- data() {
- return {
- loading: false,
- loadingForNow: false
- };
- },
- watch: {
- // loading状态
- loadingStatus(newVal) {
- this.$emit("loadingStatusChange", newVal);
- this.$nextTick(() => {
- this.loadingStatusAfterRender = newVal;
- });
- if (this.useChatRecordMode) {
- if (this.isFirstPage && (newVal === Enum.More.NoMore || newVal === Enum.More.Fail)) {
- this.isFirstPageAndNoMore = true;
- return;
- }
- }
- this.isFirstPageAndNoMore = false;
- },
- loading(newVal) {
- if (newVal) {
- this.loadingForNow = newVal;
- }
- }
- },
- computed: {
- // 是否显示loading
- showLoading() {
- if (this.firstPageLoaded || !this.loading || !this.loadingForNow)
- return false;
- if (this.finalShowSystemLoading) {
- uni.showLoading({
- title: this.finalSystemLoadingText,
- mask: this.systemLoadingMask
- });
- }
- return this.autoHideLoadingAfterFirstLoaded ? this.fromEmptyViewReload ? true : !this.pagingLoaded : this.loadingType === Enum.LoadingType.Refresher;
- },
- // 最终的是否显示系统loading
- finalShowSystemLoading() {
- return this.autoShowSystemLoading && this.loadingType === Enum.LoadingType.Refresher;
- }
- },
- methods: {
- // 处理开始加载更多状态
- _startLoading(isReload = false) {
- if (this.showLoadingMoreWhenReload && !this.isUserPullDown || !isReload) {
- this.loadingStatus = Enum.More.Loading;
- }
- this.loading = true;
- },
- // 停止系统loading和refresh
- _endSystemLoadingAndRefresh() {
- this.finalShowSystemLoading && uni.hideLoading();
- !this.useCustomRefresher && uni.stopPullDownRefresh();
- }
- }
- };
- const chatRecordModerModule = {
- props: {
- // 使用聊天记录模式,默认为否
- useChatRecordMode: {
- type: Boolean,
- default: u$1.gc("useChatRecordMode", false)
- },
- // 使用聊天记录模式时滚动到顶部后,列表垂直移动偏移距离。默认0rpx。单位px(暂时无效)
- chatRecordMoreOffset: {
- type: [Number, String],
- default: u$1.gc("chatRecordMoreOffset", "0rpx")
- },
- // 使用聊天记录模式时是否自动隐藏键盘:在用户触摸列表时候自动隐藏键盘,默认为是
- autoHideKeyboardWhenChat: {
- type: Boolean,
- default: u$1.gc("autoHideKeyboardWhenChat", true)
- },
- // 使用聊天记录模式中键盘弹出时是否自动调整slot="bottom"高度,默认为是
- autoAdjustPositionWhenChat: {
- type: Boolean,
- default: u$1.gc("autoAdjustPositionWhenChat", true)
- },
- // 使用聊天记录模式中键盘弹出时占位高度偏移距离。默认0rpx。单位px
- chatAdjustPositionOffset: {
- type: [Number, String],
- default: u$1.gc("chatAdjustPositionOffset", "0rpx")
- },
- // 使用聊天记录模式中键盘弹出时是否自动滚动到底部,默认为否
- autoToBottomWhenChat: {
- type: Boolean,
- default: u$1.gc("autoToBottomWhenChat", false)
- },
- // 使用聊天记录模式中reload时是否显示chatLoading,默认为否
- showChatLoadingWhenReload: {
- type: Boolean,
- default: u$1.gc("showChatLoadingWhenReload", false)
- },
- // 在聊天记录模式中滑动到顶部状态为默认状态时,以加载中的状态展示,默认为是。若设置为否,则默认会显示【点击加载更多】,然后才会显示loading
- chatLoadingMoreDefaultAsLoading: {
- type: Boolean,
- default: u$1.gc("chatLoadingMoreDefaultAsLoading", true)
- }
- },
- data() {
- return {
- // 键盘高度
- keyboardHeight: 0,
- // 键盘高度是否未改变,此时占位高度变化不需要动画效果
- isKeyboardHeightChanged: false
- };
- },
- computed: {
- finalChatRecordMoreOffset() {
- return u$1.convertToPx(this.chatRecordMoreOffset);
- },
- finalChatAdjustPositionOffset() {
- return u$1.convertToPx(this.chatAdjustPositionOffset);
- },
- // 聊天记录模式旋转180度style
- chatRecordRotateStyle() {
- let cellStyle;
- cellStyle = this.useChatRecordMode ? { transform: "scaleY(-1)" } : {};
- this.$emit("update:cellStyle", cellStyle);
- this.$emit("cellStyleChange", cellStyle);
- this.$nextTick(() => {
- if (this.isFirstPage && this.isChatRecordModeAndNotInversion) {
- this.$nextTick(() => {
- this._scrollToBottom(false);
- u$1.delay(() => {
- this._scrollToBottom(false);
- u$1.delay(() => {
- this._scrollToBottom(false);
- }, 50);
- }, 50);
- });
- }
- });
- return cellStyle;
- },
- // 是否是聊天记录列表并且有配置transform
- isChatRecordModeHasTransform() {
- return this.useChatRecordMode && this.chatRecordRotateStyle && this.chatRecordRotateStyle.transform;
- },
- // 是否是聊天记录列表并且列表未倒置
- isChatRecordModeAndNotInversion() {
- return this.isChatRecordModeHasTransform && this.chatRecordRotateStyle.transform === "scaleY(1)";
- },
- // 是否是聊天记录列表并且列表倒置
- isChatRecordModeAndInversion() {
- return this.isChatRecordModeHasTransform && this.chatRecordRotateStyle.transform === "scaleY(-1)";
- },
- // 最终的聊天记录模式中底部安全区域的高度,如果开启了底部安全区域并且键盘未弹出,则添加底部区域高度
- chatRecordModeSafeAreaBottom() {
- return this.safeAreaInsetBottom && !this.keyboardHeight ? this.safeAreaBottom : 0;
- }
- },
- mounted() {
- this.addKeyboardHeightChangeListener();
- },
- methods: {
- // 添加聊天记录
- addChatRecordData(data, toBottom = true, toBottomWithAnimate = true) {
- if (!this.useChatRecordMode)
- return;
- this.isTotalChangeFromAddData = true;
- this.addDataFromTop(data, toBottom, toBottomWithAnimate);
- },
- // 手动触发滚动到顶部加载更多,聊天记录模式时有效
- doChatRecordLoadMore() {
- this.useChatRecordMode && this._onLoadingMore("click");
- },
- // 手动添加键盘高度变化监听
- addKeyboardHeightChangeListener() {
- if (this.useChatRecordMode) {
- uni.onKeyboardHeightChange(this._handleKeyboardHeightChange);
- }
- },
- // 处理键盘高度变化
- _handleKeyboardHeightChange(res) {
- this.$emit("keyboardHeightChange", res);
- if (this.autoAdjustPositionWhenChat) {
- this.isKeyboardHeightChanged = true;
- this.keyboardHeight = res.height > 0 ? res.height + this.finalChatAdjustPositionOffset : res.height;
- }
- if (this.autoToBottomWhenChat && this.keyboardHeight > 0) {
- u$1.delay(() => {
- this.scrollToBottom(false);
- u$1.delay(() => {
- this.scrollToBottom(false);
- });
- });
- }
- }
- }
- };
- const scrollerModule = {
- props: {
- // 使用页面滚动,默认为否,当设置为是时则使用页面的滚动而非此组件内部的scroll-view的滚动,使用页面滚动时z-paging无需设置确定的高度且对于长列表展示性能更高,但配置会略微繁琐
- usePageScroll: {
- type: Boolean,
- default: u$1.gc("usePageScroll", false)
- },
- // 是否可以滚动,使用内置scroll-view和nvue时有效,默认为是
- scrollable: {
- type: Boolean,
- default: u$1.gc("scrollable", true)
- },
- // 控制是否出现滚动条,默认为是
- showScrollbar: {
- type: Boolean,
- default: u$1.gc("showScrollbar", true)
- },
- // 是否允许横向滚动,默认为否
- scrollX: {
- type: Boolean,
- default: u$1.gc("scrollX", false)
- },
- // iOS设备上滚动到顶部时是否允许回弹效果,默认为否。关闭回弹效果后可使滚动到顶部与下拉刷新更连贯,但是有吸顶view时滚动到顶部时可能出现抖动。
- scrollToTopBounceEnabled: {
- type: Boolean,
- default: u$1.gc("scrollToTopBounceEnabled", false)
- },
- // iOS设备上滚动到底部时是否允许回弹效果,默认为是。
- scrollToBottomBounceEnabled: {
- type: Boolean,
- default: u$1.gc("scrollToBottomBounceEnabled", true)
- },
- // 在设置滚动条位置时使用动画过渡,默认为否
- scrollWithAnimation: {
- type: Boolean,
- default: u$1.gc("scrollWithAnimation", false)
- },
- // 值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素
- scrollIntoView: {
- type: String,
- default: u$1.gc("scrollIntoView", "")
- }
- },
- data() {
- return {
- scrollTop: 0,
- oldScrollTop: 0,
- scrollLeft: 0,
- oldScrollLeft: 0,
- scrollViewStyle: {},
- scrollViewContainerStyle: {},
- scrollViewInStyle: {},
- pageScrollTop: -1,
- scrollEnable: true,
- privateScrollWithAnimation: -1,
- cacheScrollNodeHeight: -1,
- superContentHeight: 0,
- lastScrollHeight: 0,
- lastScrollDirection: "",
- setContentHeightPending: false
- };
- },
- watch: {
- oldScrollTop(newVal) {
- !this.usePageScroll && this._scrollTopChange(newVal, false);
- },
- pageScrollTop(newVal) {
- this.usePageScroll && this._scrollTopChange(newVal, true);
- },
- usePageScroll: {
- handler(newVal) {
- this.loaded && this.autoHeight && this._setAutoHeight(!newVal);
- },
- immediate: true
- },
- finalScrollTop(newVal) {
- this.renderPropScrollTop = newVal < 6 ? 0 : 10;
- }
- },
- computed: {
- finalScrollWithAnimation() {
- if (this.privateScrollWithAnimation !== -1) {
- return this.privateScrollWithAnimation === 1;
- }
- return this.scrollWithAnimation;
- },
- finalScrollViewStyle() {
- if (this.superContentZIndex != 1) {
- this.scrollViewStyle["z-index"] = this.superContentZIndex;
- this.scrollViewStyle["position"] = "relative";
- }
- return this.scrollViewStyle;
- },
- finalScrollTop() {
- return this.usePageScroll ? this.pageScrollTop : this.oldScrollTop;
- },
- // 当前是否是旧版webview
- finalIsOldWebView() {
- return this.isOldWebView && !this.usePageScroll;
- },
- // 当前scroll-view/list-view是否允许滚动
- finalScrollable() {
- return this.scrollable && !this.usePageScroll && this.scrollEnable && (this.refresherCompleteScrollable ? true : this.refresherStatus !== Enum.Refresher.Complete) && (this.refresherRefreshingScrollable ? true : this.refresherStatus !== Enum.Refresher.Loading);
- }
- },
- methods: {
- // 滚动到顶部,animate为是否展示滚动动画,默认为是
- scrollToTop(animate, checkReverse = true) {
- if (this.useChatRecordMode && checkReverse && !this.isChatRecordModeAndNotInversion) {
- this.scrollToBottom(animate, false);
- return;
- }
- this.$nextTick(() => {
- this._scrollToTop(animate, false);
- });
- },
- // 滚动到底部,animate为是否展示滚动动画,默认为是
- scrollToBottom(animate, checkReverse = true) {
- if (this.useChatRecordMode && checkReverse && !this.isChatRecordModeAndNotInversion) {
- this.scrollToTop(animate, false);
- return;
- }
- this.$nextTick(() => {
- this._scrollToBottom(animate);
- });
- },
- // 滚动到指定view(vue中有效)。sel为需要滚动的view的id值,不包含"#";offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
- scrollIntoViewById(sel, offset, animate) {
- this._scrollIntoView(sel, offset, animate);
- },
- // 滚动到指定view(vue中有效)。nodeTop为需要滚动的view的top值(通过uni.createSelectorQuery()获取);offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
- scrollIntoViewByNodeTop(nodeTop, offset, animate) {
- this.scrollTop = this.oldScrollTop;
- this.$nextTick(() => {
- this._scrollIntoViewByNodeTop(nodeTop, offset, animate);
- });
- },
- // y轴滚动到指定位置(vue中有效)。y为与顶部的距离,单位为px;offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
- scrollToY(y2, offset, animate) {
- this.scrollTop = this.oldScrollTop;
- this.$nextTick(() => {
- this._scrollToY(y2, offset, animate);
- });
- },
- // x轴滚动到指定位置(非页面滚动且在vue中有效)。x为与左侧的距离,单位为px;offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
- scrollToX(x2, offset, animate) {
- this.scrollLeft = this.oldScrollLeft;
- this.$nextTick(() => {
- this._scrollToX(x2, offset, animate);
- });
- },
- // 滚动到指定view(nvue中和虚拟列表中有效)。index为需要滚动的view的index(第几个,从0开始);offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
- scrollIntoViewByIndex(index2, offset, animate) {
- if (index2 >= this.realTotalData.length) {
- u$1.consoleErr("当前滚动的index超出已渲染列表长度,请先通过refreshToPage加载到对应index页并等待渲染成功后再调用此方法!");
- return;
- }
- this.$nextTick(() => {
- if (this.finalUseVirtualList) {
- const isCellFixed = this.cellHeightMode === Enum.CellHeightMode.Fixed;
- u$1.delay(() => {
- if (this.finalUseVirtualList) {
- const scrollTop = isCellFixed ? this.virtualCellHeight * index2 : this.virtualHeightCacheList[index2].lastTotalHeight;
- this.scrollToY(scrollTop, offset, animate);
- }
- }, isCellFixed ? 0 : 100);
- }
- });
- },
- // 滚动到指定view(nvue中有效)。view为需要滚动的view(通过`this.$refs.xxx`获取),不包含"#";offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否
- scrollIntoViewByView(view, offset, animate) {
- this._scrollIntoView(view, offset, animate);
- },
- // 当使用页面滚动并且自定义下拉刷新时,请在页面的onPageScroll中调用此方法,告知z-paging当前的pageScrollTop,否则会导致在任意位置都可以下拉刷新
- updatePageScrollTop(value2) {
- this.pageScrollTop = value2;
- },
- // 当使用页面滚动并且设置了slot="top"时,默认初次加载会自动获取其高度,并使内部容器下移,当slot="top"的view高度动态改变时,在其高度需要更新时调用此方法
- updatePageScrollTopHeight() {
- this._updatePageScrollTopOrBottomHeight("top");
- },
- // 当使用页面滚动并且设置了slot="bottom"时,默认初次加载会自动获取其高度,并使内部容器下移,当slot="bottom"的view高度动态改变时,在其高度需要更新时调用此方法
- updatePageScrollBottomHeight() {
- this._updatePageScrollTopOrBottomHeight("bottom");
- },
- // 更新slot="left"和slot="right"宽度,当slot="left"或slot="right"宽度动态改变时调用
- updateLeftAndRightWidth() {
- if (!this.finalIsOldWebView)
- return;
- this.$nextTick(() => this._updateLeftAndRightWidth(this.scrollViewContainerStyle, "zp-page"));
- },
- // 更新z-paging内置scroll-view的scrollTop
- updateScrollViewScrollTop(scrollTop, animate = true) {
- this._updatePrivateScrollWithAnimation(animate);
- this.scrollTop = this.oldScrollTop;
- this.$nextTick(() => {
- this.scrollTop = scrollTop;
- this.oldScrollTop = this.scrollTop;
- });
- },
- // 当滚动到顶部时
- _onScrollToUpper() {
- this._emitScrollEvent("scrolltoupper");
- this.$emit("scrollTopChange", 0);
- this.$nextTick(() => {
- this.oldScrollTop = 0;
- });
- },
- // 当滚动到底部时
- _onScrollToLower(e2) {
- (!e2.detail || !e2.detail.direction || e2.detail.direction === "bottom") && this.toBottomLoadingMoreEnabled && this._onLoadingMore(this.useChatRecordMode ? "click" : "toBottom");
- },
- // 滚动到顶部
- _scrollToTop(animate = true, isPrivate = true) {
- if (this.usePageScroll) {
- this.$nextTick(() => {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: animate ? 100 : 0
- });
- });
- return;
- }
- this._updatePrivateScrollWithAnimation(animate);
- this.scrollTop = this.oldScrollTop;
- this.$nextTick(() => {
- this.scrollTop = 0;
- this.oldScrollTop = this.scrollTop;
- });
- },
- // 滚动到底部
- async _scrollToBottom(animate = true) {
- if (this.usePageScroll) {
- this.$nextTick(() => {
- uni.pageScrollTo({
- scrollTop: Number.MAX_VALUE,
- duration: animate ? 100 : 0
- });
- });
- return;
- }
- try {
- this._updatePrivateScrollWithAnimation(animate);
- const pagingContainerNode = await this._getNodeClientRect(".zp-paging-container");
- const scrollViewNode = await this._getNodeClientRect(".zp-scroll-view");
- const pagingContainerH = pagingContainerNode ? pagingContainerNode[0].height : 0;
- const scrollViewH = scrollViewNode ? scrollViewNode[0].height : 0;
- if (pagingContainerH > scrollViewH) {
- this.scrollTop = this.oldScrollTop;
- this.$nextTick(() => {
- this.scrollTop = pagingContainerH - scrollViewH + this.virtualPlaceholderTopHeight;
- this.oldScrollTop = this.scrollTop;
- });
- }
- } catch (e2) {
- }
- },
- // 滚动到指定view
- _scrollIntoView(sel, offset = 0, animate = false, finishCallback) {
- try {
- this.scrollTop = this.oldScrollTop;
- this.$nextTick(() => {
- this._getNodeClientRect("#" + sel.replace("#", ""), false).then((node2) => {
- if (node2) {
- this._getNodeClientRect(".zp-scroll-view-container").then((svContainerNode) => {
- if (svContainerNode) {
- this._scrollIntoViewByNodeTop(node2[0].top - svContainerNode[0].top, offset, animate);
- finishCallback && finishCallback();
- }
- });
- } else {
- u$1.consoleErr(`无法获取${sel}的节点信息,请检查!`);
- }
- });
- });
- } catch (e2) {
- }
- },
- // 通过nodeTop滚动到指定view
- _scrollIntoViewByNodeTop(nodeTop, offset = 0, animate = false) {
- if (this.isChatRecordModeAndInversion) {
- this._getNodeClientRect(".zp-scroll-view").then((sNode) => {
- if (sNode) {
- this._scrollToY(sNode[0].height - nodeTop, offset, animate, true);
- }
- });
- } else {
- this._scrollToY(nodeTop, offset, animate, true);
- }
- },
- // y轴滚动到指定位置
- _scrollToY(y2, offset = 0, animate = false, addScrollTop = false) {
- this._updatePrivateScrollWithAnimation(animate);
- u$1.delay(() => {
- if (this.usePageScroll) {
- if (addScrollTop && this.pageScrollTop !== -1) {
- y2 += this.pageScrollTop;
- }
- const scrollTop = y2 - offset;
- uni.pageScrollTo({
- scrollTop,
- duration: animate ? 100 : 0
- });
- } else {
- if (addScrollTop) {
- y2 += this.oldScrollTop;
- }
- this.scrollTop = y2 - offset;
- }
- }, 10);
- },
- // x轴滚动到指定位置
- _scrollToX(x2, offset = 0, animate = false) {
- this._updatePrivateScrollWithAnimation(animate);
- u$1.delay(() => {
- if (!this.usePageScroll) {
- this.scrollLeft = x2 - offset;
- } else {
- u$1.consoleErr("使用页面滚动时不支持scrollToX");
- }
- }, 10);
- },
- // scroll-view滚动中
- _scroll(e2) {
- this.$emit("scroll", e2);
- const { scrollTop, scrollLeft, scrollHeight } = e2.detail;
- if (this.watchScrollDirectionChange) {
- let direction = this.oldScrollTop > scrollTop ? "top" : "bottom";
- if (scrollTop <= 0 || !this.scrollEnable) {
- direction = "top";
- }
- if (scrollTop > this.lastScrollHeight - this.scrollViewHeight - 1 && this.scrollEnable) {
- direction = "bottom";
- }
- if (direction !== this.lastScrollDirection) {
- this.$emit("scrollDirectionChange", direction);
- this.lastScrollDirection = direction;
- }
- if (this.lastScrollHeight !== scrollHeight && !this.setContentHeightPending) {
- this.setContentHeightPending = true;
- u$1.delay(() => {
- this.lastScrollHeight = scrollHeight;
- this.setContentHeightPending = false;
- });
- }
- }
- this.finalUseVirtualList && this._updateVirtualScroll(scrollTop, this.oldScrollTop - scrollTop);
- this.oldScrollTop = scrollTop;
- this.oldScrollLeft = scrollLeft;
- const scrollDiff = e2.detail.scrollHeight - this.oldScrollTop;
- !this.isIos && this._checkScrolledToBottom(scrollDiff);
- },
- // emit scrolltolower/scrolltoupper事件
- _emitScrollEvent(type2) {
- const reversedType = type2 === "scrolltolower" ? "scrolltoupper" : "scrolltolower";
- const eventType = this.useChatRecordMode && !this.isChatRecordModeAndNotInversion ? reversedType : type2;
- this.$emit(eventType);
- },
- // 更新内置的scroll-view是否启用滚动动画
- _updatePrivateScrollWithAnimation(animate) {
- this.privateScrollWithAnimation = animate ? 1 : 0;
- u$1.delay(() => this.$nextTick(() => {
- this.privateScrollWithAnimation = -1;
- }), 100, "updateScrollWithAnimationDelay");
- },
- // 检测scrollView是否要铺满屏幕
- _doCheckScrollViewShouldFullHeight(totalData) {
- if (this.autoFullHeight && this.usePageScroll && this.isTotalChangeFromAddData) {
- this.$nextTick(() => {
- this._checkScrollViewShouldFullHeight((scrollViewNode, pagingContainerNode) => {
- this._preCheckShowNoMoreInside(totalData, scrollViewNode, pagingContainerNode);
- });
- });
- } else {
- this._preCheckShowNoMoreInside(totalData);
- }
- },
- // 检测z-paging是否要全屏覆盖(当使用页面滚动并且不满全屏时,默认z-paging需要铺满全屏,避免数据过少时内部的empty-view无法正确展示)
- async _checkScrollViewShouldFullHeight(callback) {
- try {
- const scrollViewNode = await this._getNodeClientRect(".zp-scroll-view");
- const pagingContainerNode = await this._getNodeClientRect(".zp-paging-container-content");
- if (!scrollViewNode || !pagingContainerNode)
- return;
- const scrollViewHeight = pagingContainerNode[0].height;
- const scrollViewTop = scrollViewNode[0].top;
- if (this.isAddedData && scrollViewHeight + scrollViewTop <= this.windowHeight) {
- this._setAutoHeight(true, scrollViewNode);
- callback(scrollViewNode, pagingContainerNode);
- } else {
- this._setAutoHeight(false);
- callback(null, null);
- }
- } catch (e2) {
- callback(null, null);
- }
- },
- // 更新缓存中z-paging整个内容容器高度
- async _updateCachedSuperContentHeight() {
- const superContentNode = await this._getNodeClientRect(".z-paging-content");
- if (superContentNode) {
- this.superContentHeight = superContentNode[0].height;
- }
- },
- // scrollTop改变时触发
- _scrollTopChange(newVal, isPageScrollTop) {
- this.$emit("scrollTopChange", newVal);
- this.$emit("update:scrollTop", newVal);
- this._checkShouldShowBackToTop(newVal);
- const scrollTop = newVal > 5 ? 6 : 0;
- if (isPageScrollTop && this.wxsPageScrollTop !== scrollTop) {
- this.wxsPageScrollTop = scrollTop;
- } else if (!isPageScrollTop && this.wxsScrollTop !== scrollTop) {
- this.wxsScrollTop = scrollTop;
- if (scrollTop > 6) {
- this.scrollEnable = true;
- }
- }
- },
- // 更新使用页面滚动时slot="top"或"bottom"插入view的高度
- _updatePageScrollTopOrBottomHeight(type2) {
- if (!this.usePageScroll)
- return;
- this._doCheckScrollViewShouldFullHeight(this.realTotalData);
- const node2 = `.zp-page-${type2}`;
- const marginText = `margin${type2.slice(0, 1).toUpperCase() + type2.slice(1)}`;
- const safeAreaInsetBottomAdd = this.safeAreaInsetBottom && !this.zSlots.bottom && !this.useSafeAreaPlaceholder;
- this.$nextTick(() => {
- let delayTime = 0;
- u$1.delay(() => {
- this._getNodeClientRect(node2).then((res) => {
- if (res) {
- let pageScrollNodeHeight = res[0].height;
- if (type2 === "bottom") {
- if (safeAreaInsetBottomAdd) {
- pageScrollNodeHeight += this.safeAreaBottom;
- }
- } else {
- this.cacheTopHeight = pageScrollNodeHeight;
- }
- this.$set(this.scrollViewStyle, marginText, `${pageScrollNodeHeight}px`);
- } else if (safeAreaInsetBottomAdd) {
- this.$set(this.scrollViewStyle, marginText, `${this.safeAreaBottom}px`);
- }
- });
- }, delayTime);
- });
- }
- }
- };
- const backToTopModule = {
- props: {
- // 自动显示点击返回顶部按钮,默认为否
- autoShowBackToTop: {
- type: Boolean,
- default: u$1.gc("autoShowBackToTop", false)
- },
- // 点击返回顶部按钮显示/隐藏的阈值(滚动距离),单位为px,默认为400rpx
- backToTopThreshold: {
- type: [Number, String],
- default: u$1.gc("backToTopThreshold", "400rpx")
- },
- // 点击返回顶部按钮的自定义图片地址,默认使用z-paging内置的图片
- backToTopImg: {
- type: String,
- default: u$1.gc("backToTopImg", "")
- },
- // 点击返回顶部按钮返回到顶部时是否展示过渡动画,默认为是
- backToTopWithAnimate: {
- type: Boolean,
- default: u$1.gc("backToTopWithAnimate", true)
- },
- // 点击返回顶部按钮与底部的距离,注意添加单位px或rpx,默认为160rpx
- backToTopBottom: {
- type: [Number, String],
- default: u$1.gc("backToTopBottom", "160rpx")
- },
- // 点击返回顶部按钮的自定义样式
- backToTopStyle: {
- type: Object,
- default: u$1.gc("backToTopStyle", {})
- },
- // iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只支持竖向,默认为是
- enableBackToTop: {
- type: Boolean,
- default: u$1.gc("enableBackToTop", true)
- }
- },
- data() {
- return {
- // 点击返回顶部的class
- backToTopClass: "zp-back-to-top zp-back-to-top-hide",
- // 上次点击返回顶部的时间
- lastBackToTopShowTime: 0,
- // 点击返回顶部显示的class是否在展示中,使得按钮展示/隐藏过度效果更自然
- showBackToTopClass: false
- };
- },
- computed: {
- backToTopThresholdUnitConverted() {
- return u$1.addUnit(this.backToTopThreshold, this.unit);
- },
- backToTopBottomUnitConverted() {
- return u$1.addUnit(this.backToTopBottom, this.unit);
- },
- finalEnableBackToTop() {
- return this.usePageScroll ? false : this.enableBackToTop;
- },
- finalBackToTopThreshold() {
- return u$1.convertToPx(this.backToTopThresholdUnitConverted);
- },
- finalBackToTopStyle() {
- const backToTopStyle = this.backToTopStyle;
- if (!backToTopStyle.bottom) {
- backToTopStyle.bottom = this.windowBottom + u$1.convertToPx(this.backToTopBottomUnitConverted) + "px";
- }
- if (!backToTopStyle.position) {
- backToTopStyle.position = this.usePageScroll ? "fixed" : "absolute";
- }
- return backToTopStyle;
- },
- finalBackToTopClass() {
- return `${this.backToTopClass} zp-back-to-top-${this.unit}`;
- }
- },
- methods: {
- // 点击了返回顶部
- _backToTopClick() {
- let callbacked = false;
- this.$emit("backToTopClick", (toTop) => {
- (toTop === void 0 || toTop === true) && this._handleToTop();
- callbacked = true;
- });
- this.$nextTick(() => {
- !callbacked && this._handleToTop();
- });
- },
- // 处理滚动到顶部(聊天记录模式中为滚动到底部)
- _handleToTop() {
- !this.backToTopWithAnimate && this._checkShouldShowBackToTop(0);
- !this.useChatRecordMode ? this.scrollToTop(this.backToTopWithAnimate) : this.scrollToBottom(this.backToTopWithAnimate);
- },
- // 判断是否要显示返回顶部按钮
- _checkShouldShowBackToTop(scrollTop) {
- if (!this.autoShowBackToTop) {
- this.showBackToTopClass = false;
- return;
- }
- if (scrollTop > this.finalBackToTopThreshold) {
- if (!this.showBackToTopClass) {
- this.showBackToTopClass = true;
- this.lastBackToTopShowTime = (/* @__PURE__ */ new Date()).getTime();
- u$1.delay(() => {
- this.backToTopClass = "zp-back-to-top zp-back-to-top-show";
- }, 300);
- }
- } else {
- if (this.showBackToTopClass) {
- this.backToTopClass = "zp-back-to-top zp-back-to-top-hide";
- u$1.delay(() => {
- this.showBackToTopClass = false;
- }, (/* @__PURE__ */ new Date()).getTime() - this.lastBackToTopShowTime < 500 ? 0 : 300);
- }
- }
- }
- }
- };
- const virtualListModule = {
- props: {
- // 是否使用虚拟列表,默认为否
- useVirtualList: {
- type: Boolean,
- default: u$1.gc("useVirtualList", false)
- },
- // 在使用虚拟列表时,是否使用兼容模式,默认为否
- useCompatibilityMode: {
- type: Boolean,
- default: u$1.gc("useCompatibilityMode", false)
- },
- // 使用兼容模式时传递的附加数据
- extraData: {
- type: Object,
- default: u$1.gc("extraData", {})
- },
- // 是否在z-paging内部循环渲染列表(内置列表),默认为否。若use-virtual-list为true,则此项恒为true
- useInnerList: {
- type: Boolean,
- default: u$1.gc("useInnerList", false)
- },
- // 强制关闭inner-list,默认为false,如果为true将强制关闭innerList,适用于开启了虚拟列表后需要强制关闭inner-list的情况
- forceCloseInnerList: {
- type: Boolean,
- default: u$1.gc("forceCloseInnerList", false)
- },
- // 内置列表cell的key名称,仅nvue有效,在nvue中开启use-inner-list时必须填此项
- cellKeyName: {
- type: String,
- default: u$1.gc("cellKeyName", "")
- },
- // innerList样式
- innerListStyle: {
- type: Object,
- default: u$1.gc("innerListStyle", {})
- },
- // innerCell样式
- innerCellStyle: {
- type: Object,
- default: u$1.gc("innerCellStyle", {})
- },
- // 预加载的列表可视范围(列表高度)页数,默认为12,即预加载当前页及上下各12页的cell。此数值越大,则虚拟列表中加载的dom越多,内存消耗越大(会维持在一个稳定值),但增加预加载页面数量可缓解快速滚动短暂白屏问题
- preloadPage: {
- type: [Number, String],
- default: u$1.gc("preloadPage", 12),
- validator: (value2) => {
- if (value2 <= 0)
- u$1.consoleErr("preload-page必须大于0!");
- return value2 > 0;
- }
- },
- // 虚拟列表cell高度模式,默认为fixed,也就是每个cell高度完全相同,将以第一个cell高度为准进行计算。可选值【dynamic】,即代表高度是动态非固定的,【dynamic】性能低于【fixed】。
- cellHeightMode: {
- type: String,
- default: u$1.gc("cellHeightMode", Enum.CellHeightMode.Fixed)
- },
- // 固定的cell高度,cellHeightMode=fixed才有效,若设置了值,则不计算第一个cell高度而使用设置的cell高度
- fixedCellHeight: {
- type: [Number, String],
- default: u$1.gc("fixedCellHeight", 0)
- },
- // 虚拟列表列数,默认为1。常用于每行有多列的情况,例如每行有2列数据,需要将此值设置为2
- virtualListCol: {
- type: [Number, String],
- default: u$1.gc("virtualListCol", 1)
- },
- // 虚拟列表scroll取样帧率,默认为80,过低容易出现白屏问题,过高容易出现卡顿问题
- virtualScrollFps: {
- type: [Number, String],
- default: u$1.gc("virtualScrollFps", 80)
- },
- // 虚拟列表cell id的前缀,适用于一个页面有多个虚拟列表的情况,用以区分不同虚拟列表cell的id,注意:请勿传数字或以数字开头的字符串。如设置为list1,则cell的id应为:list1-zp-id-${item.zp_index}
- virtualCellIdPrefix: {
- type: String,
- default: u$1.gc("virtualCellIdPrefix", "")
- },
- // 虚拟列表是否使用swiper-item包裹,默认为否,此属性为了解决vue3+(微信小程序或QQ小程序)中,使用非内置列表写法时,若z-paging在swiper-item内存在无法获取slot插入的cell高度进而导致虚拟列表失败的问题
- // 仅vue3+(微信小程序或QQ小程序)+非内置列表写法虚拟列表有效,其他情况此属性设置任何值都无效,所以如果您在swiper-item内使用z-paging的非内置虚拟列表写法,将此属性设置为true即可
- virtualInSwiperSlot: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- virtualListKey: u$1.getInstanceId(),
- virtualCellHeight: 0,
- virtualScrollTimeStamp: 0,
- virtualList: [],
- virtualPlaceholderTopHeight: 0,
- virtualPlaceholderBottomHeight: 0,
- virtualTopRangeIndex: 0,
- virtualBottomRangeIndex: 0,
- lastVirtualTopRangeIndex: 0,
- lastVirtualBottomRangeIndex: 0,
- virtualItemInsertedCount: 0,
- virtualHeightCacheList: [],
- getCellHeightRetryCount: {
- fixed: 0,
- dynamic: 0
- },
- updateVirtualListFromDataChange: false
- };
- },
- watch: {
- // 监听总数据的改变,刷新虚拟列表布局
- realTotalData() {
- this.updateVirtualListRender();
- },
- // 监听虚拟列表渲染数组的改变并emit
- virtualList(newVal) {
- this.$emit("update:virtualList", newVal);
- this.$emit("virtualListChange", newVal);
- },
- // 监听虚拟列表顶部占位高度改变并emit
- virtualPlaceholderTopHeight(newVal) {
- this.$emit("virtualTopHeightChange", newVal);
- }
- },
- computed: {
- virtualCellIndexKey() {
- return c$1.listCellIndexKey;
- },
- finalUseVirtualList() {
- if (this.useVirtualList && this.usePageScroll) {
- u$1.consoleErr("使用页面滚动时,开启虚拟列表无效!");
- }
- return this.useVirtualList && !this.usePageScroll;
- },
- finalUseInnerList() {
- return this.useInnerList || this.finalUseVirtualList && !this.forceCloseInnerList;
- },
- finalCellKeyName() {
- return this.cellKeyName;
- },
- finalVirtualPageHeight() {
- return this.scrollViewHeight > 0 ? this.scrollViewHeight : this.windowHeight;
- },
- finalFixedCellHeight() {
- return u$1.convertToPx(this.fixedCellHeight);
- },
- fianlVirtualCellIdPrefix() {
- const prefix = this.virtualCellIdPrefix ? this.virtualCellIdPrefix + "-" : "";
- return prefix + "zp-id";
- },
- finalPlaceholderTopHeightStyle() {
- return {};
- },
- virtualRangePageHeight() {
- return this.finalVirtualPageHeight * this.preloadPage;
- },
- virtualScrollDisTimeStamp() {
- return 1e3 / this.virtualScrollFps;
- }
- },
- methods: {
- // 在使用动态高度虚拟列表时,若在列表数组中需要插入某个item,需要调用此方法;item:需要插入的item,index:插入的cell位置,若index为2,则插入的item在原list的index=1之后,index从0开始
- doInsertVirtualListItem(item, index2) {
- if (this.cellHeightMode !== Enum.CellHeightMode.Dynamic)
- return;
- this.realTotalData.splice(index2, 0, item);
- this.realTotalData = [...this.realTotalData];
- this.virtualItemInsertedCount++;
- if (!item || Object.prototype.toString.call(item) !== "[object Object]") {
- item = { item };
- }
- const cellIndexKey = this.virtualCellIndexKey;
- item[cellIndexKey] = `custom-${this.virtualItemInsertedCount}`;
- item[c$1.listCellIndexUniqueKey] = `${this.virtualListKey}-${item[cellIndexKey]}`;
- this.$nextTick(async () => {
- let retryCount = 0;
- while (retryCount <= 10) {
- await u$1.wait(c$1.delayTime);
- const cellNode = await this._getVirtualCellNodeByIndex(item[cellIndexKey]);
- if (!cellNode) {
- retryCount++;
- continue;
- }
- const currentHeight = cellNode ? cellNode[0].height : 0;
- const lastHeightCache = this.virtualHeightCacheList[index2 - 1];
- const lastTotalHeight = lastHeightCache ? lastHeightCache.totalHeight : 0;
- this.virtualHeightCacheList.splice(index2, 0, {
- height: currentHeight,
- lastTotalHeight,
- totalHeight: lastTotalHeight + currentHeight
- });
- for (let i2 = index2 + 1; i2 < this.virtualHeightCacheList.length; i2++) {
- const thisNode = this.virtualHeightCacheList[i2];
- thisNode.lastTotalHeight += currentHeight;
- thisNode.totalHeight += currentHeight;
- }
- this._updateVirtualScroll(this.oldScrollTop);
- break;
- }
- });
- },
- // 在使用动态高度虚拟列表时,手动更新指定cell的缓存高度(当cell高度在初始化之后再次改变后调用);index:需要更新的cell在列表中的位置,从0开始
- didUpdateVirtualListCell(index2) {
- if (this.cellHeightMode !== Enum.CellHeightMode.Dynamic)
- return;
- const currentNode = this.virtualHeightCacheList[index2];
- this.$nextTick(() => {
- this._getVirtualCellNodeByIndex(index2).then((cellNode) => {
- const cellNodeHeight = cellNode ? cellNode[0].height : 0;
- const heightDis = cellNodeHeight - currentNode.height;
- currentNode.height = cellNodeHeight;
- currentNode.totalHeight = currentNode.lastTotalHeight + cellNodeHeight;
- for (let i2 = index2 + 1; i2 < this.virtualHeightCacheList.length; i2++) {
- const thisNode = this.virtualHeightCacheList[i2];
- thisNode.totalHeight += heightDis;
- thisNode.lastTotalHeight += heightDis;
- }
- });
- });
- },
- // 在使用动态高度虚拟列表时,若删除了列表数组中的某个item,需要调用此方法以更新高度缓存数组;index:删除的cell在列表中的位置,从0开始
- didDeleteVirtualListCell(index2) {
- if (this.cellHeightMode !== Enum.CellHeightMode.Dynamic)
- return;
- const currentNode = this.virtualHeightCacheList[index2];
- for (let i2 = index2 + 1; i2 < this.virtualHeightCacheList.length; i2++) {
- const thisNode = this.virtualHeightCacheList[i2];
- thisNode.totalHeight -= currentNode.height;
- thisNode.lastTotalHeight -= currentNode.height;
- }
- this.virtualHeightCacheList.splice(index2, 1);
- },
- // 手动触发虚拟列表渲染更新,可用于解决例如修改了虚拟列表数组中元素,但展示未更新的情况
- updateVirtualListRender() {
- if (this.finalUseVirtualList) {
- this.updateVirtualListFromDataChange = true;
- this.$nextTick(() => {
- this.getCellHeightRetryCount.fixed = 0;
- if (this.realTotalData.length) {
- this.cellHeightMode === Enum.CellHeightMode.Fixed && this.isFirstPage && this._updateFixedCellHeight();
- } else {
- this._resetDynamicListState(!this.isUserPullDown);
- }
- this._updateVirtualScroll(this.oldScrollTop);
- });
- }
- },
- // cellHeightMode为fixed时获取第一个cell高度
- _updateFixedCellHeight() {
- if (!this.finalFixedCellHeight) {
- this.$nextTick(() => {
- u$1.delay(() => {
- this._getVirtualCellNodeByIndex(0).then((cellNode) => {
- if (!cellNode) {
- if (this.getCellHeightRetryCount.fixed > 10)
- return;
- this.getCellHeightRetryCount.fixed++;
- this._updateFixedCellHeight();
- } else {
- this.virtualCellHeight = cellNode[0].height;
- this._updateVirtualScroll(this.oldScrollTop);
- }
- });
- }, c$1.delayTime, "updateFixedCellHeightDelay");
- });
- } else {
- this.virtualCellHeight = this.finalFixedCellHeight;
- }
- },
- // cellHeightMode为dynamic时获取每个cell高度
- _updateDynamicCellHeight(list, dataFrom = "bottom") {
- const dataFromTop = dataFrom === "top";
- const heightCacheList = this.virtualHeightCacheList;
- const currentCacheList = dataFromTop ? [] : heightCacheList;
- let listTotalHeight = 0;
- this.$nextTick(() => {
- u$1.delay(async () => {
- for (let i2 = 0; i2 < list.length; i2++) {
- const cellNode = await this._getVirtualCellNodeByIndex(list[i2][this.virtualCellIndexKey]);
- const currentHeight = cellNode ? cellNode[0].height : 0;
- if (!cellNode) {
- if (this.getCellHeightRetryCount.dynamic <= 10) {
- heightCacheList.splice(heightCacheList.length - i2, i2);
- this.getCellHeightRetryCount.dynamic++;
- this._updateDynamicCellHeight(list, dataFrom);
- }
- return;
- }
- const lastHeightCache = currentCacheList.length ? currentCacheList.slice(-1)[0] : null;
- const lastTotalHeight = lastHeightCache ? lastHeightCache.totalHeight : 0;
- currentCacheList.push({
- height: currentHeight,
- lastTotalHeight,
- totalHeight: lastTotalHeight + currentHeight
- });
- if (dataFromTop) {
- listTotalHeight += currentHeight;
- }
- }
- if (dataFromTop && list.length) {
- for (let i2 = 0; i2 < heightCacheList.length; i2++) {
- const heightCacheItem = heightCacheList[i2];
- heightCacheItem.lastTotalHeight += listTotalHeight;
- heightCacheItem.totalHeight += listTotalHeight;
- }
- this.virtualHeightCacheList = currentCacheList.concat(heightCacheList);
- }
- this._updateVirtualScroll(this.oldScrollTop);
- }, c$1.delayTime, "updateDynamicCellHeightDelay");
- });
- },
- // 设置cellItem的index
- _setCellIndex(list, dataFrom = "bottom") {
- let currentItemIndex = 0;
- const cellIndexKey = this.virtualCellIndexKey;
- dataFrom === "bottom" && [Enum.QueryFrom.Refresh, Enum.QueryFrom.Reload].indexOf(this.queryFrom) >= 0 && this._resetDynamicListState();
- if (this.totalData.length && this.queryFrom !== Enum.QueryFrom.Refresh) {
- if (dataFrom === "bottom") {
- currentItemIndex = this.realTotalData.length;
- const lastItem = this.realTotalData.length ? this.realTotalData.slice(-1)[0] : null;
- if (lastItem && lastItem[cellIndexKey] !== void 0) {
- currentItemIndex = lastItem[cellIndexKey] + 1;
- }
- } else if (dataFrom === "top") {
- const firstItem = this.realTotalData.length ? this.realTotalData[0] : null;
- if (firstItem && firstItem[cellIndexKey] !== void 0) {
- currentItemIndex = firstItem[cellIndexKey] - list.length;
- }
- }
- } else {
- this._resetDynamicListState();
- }
- for (let i2 = 0; i2 < list.length; i2++) {
- let item = list[i2];
- if (!item || Object.prototype.toString.call(item) !== "[object Object]") {
- item = { item };
- }
- if (item[c$1.listCellIndexUniqueKey]) {
- item = u$1.deepCopy(item);
- }
- item[cellIndexKey] = currentItemIndex + i2;
- item[c$1.listCellIndexUniqueKey] = `${this.virtualListKey}-${item[cellIndexKey]}`;
- list[i2] = item;
- }
- this.getCellHeightRetryCount.dynamic = 0;
- this.cellHeightMode === Enum.CellHeightMode.Dynamic && this._updateDynamicCellHeight(list, dataFrom);
- },
- // 更新scroll滚动(虚拟列表滚动时触发)
- _updateVirtualScroll(scrollTop, scrollDiff = 0) {
- const currentTimeStamp = u$1.getTime();
- scrollTop === 0 && this._resetTopRange();
- if (scrollTop !== 0 && this.virtualScrollTimeStamp && currentTimeStamp - this.virtualScrollTimeStamp <= this.virtualScrollDisTimeStamp) {
- return;
- }
- this.virtualScrollTimeStamp = currentTimeStamp;
- let scrollIndex = 0;
- const cellHeightMode = this.cellHeightMode;
- if (cellHeightMode === Enum.CellHeightMode.Fixed) {
- scrollIndex = parseInt(scrollTop / this.virtualCellHeight) || 0;
- this._updateFixedTopRangeIndex(scrollIndex);
- this._updateFixedBottomRangeIndex(scrollIndex);
- } else if (cellHeightMode === Enum.CellHeightMode.Dynamic) {
- const scrollDirection = scrollDiff > 0 ? "top" : "bottom";
- const rangePageHeight = this.virtualRangePageHeight;
- const topRangePageOffset = scrollTop - rangePageHeight;
- const bottomRangePageOffset = scrollTop + this.finalVirtualPageHeight + rangePageHeight;
- let virtualBottomRangeIndex = 0;
- let virtualPlaceholderBottomHeight = 0;
- let reachedLimitBottom = false;
- const heightCacheList = this.virtualHeightCacheList;
- const lastHeightCache = !!heightCacheList ? heightCacheList.slice(-1)[0] : null;
- let startTopRangeIndex = this.virtualTopRangeIndex;
- if (scrollDirection === "bottom") {
- for (let i2 = startTopRangeIndex; i2 < heightCacheList.length; i2++) {
- const heightCacheItem = heightCacheList[i2];
- if (heightCacheItem && heightCacheItem.totalHeight > topRangePageOffset) {
- this.virtualTopRangeIndex = i2;
- this.virtualPlaceholderTopHeight = heightCacheItem.lastTotalHeight;
- break;
- }
- }
- } else {
- let topRangeMatched = false;
- for (let i2 = startTopRangeIndex; i2 >= 0; i2--) {
- const heightCacheItem = heightCacheList[i2];
- if (heightCacheItem && heightCacheItem.totalHeight < topRangePageOffset) {
- this.virtualTopRangeIndex = i2;
- this.virtualPlaceholderTopHeight = heightCacheItem.lastTotalHeight;
- topRangeMatched = true;
- break;
- }
- }
- !topRangeMatched && this._resetTopRange();
- }
- for (let i2 = this.virtualTopRangeIndex; i2 < heightCacheList.length; i2++) {
- const heightCacheItem = heightCacheList[i2];
- if (heightCacheItem && heightCacheItem.totalHeight > bottomRangePageOffset) {
- virtualBottomRangeIndex = i2;
- virtualPlaceholderBottomHeight = lastHeightCache.totalHeight - heightCacheItem.totalHeight;
- reachedLimitBottom = true;
- break;
- }
- }
- if (!reachedLimitBottom || this.virtualBottomRangeIndex === 0) {
- this.virtualBottomRangeIndex = this.realTotalData.length ? this.realTotalData.length - 1 : this.pageSize;
- this.virtualPlaceholderBottomHeight = 0;
- } else {
- this.virtualBottomRangeIndex = virtualBottomRangeIndex;
- this.virtualPlaceholderBottomHeight = virtualPlaceholderBottomHeight;
- }
- this._updateVirtualList();
- }
- },
- // 更新fixedCell模式下topRangeIndex&placeholderTopHeight
- _updateFixedTopRangeIndex(scrollIndex) {
- let virtualTopRangeIndex = this.virtualCellHeight === 0 ? 0 : scrollIndex - (parseInt(this.finalVirtualPageHeight / this.virtualCellHeight) || 1) * this.preloadPage;
- virtualTopRangeIndex *= this.virtualListCol;
- virtualTopRangeIndex = Math.max(0, virtualTopRangeIndex);
- this.virtualTopRangeIndex = virtualTopRangeIndex;
- this.virtualPlaceholderTopHeight = virtualTopRangeIndex / this.virtualListCol * this.virtualCellHeight;
- },
- // 更新fixedCell模式下bottomRangeIndex&placeholderBottomHeight
- _updateFixedBottomRangeIndex(scrollIndex) {
- let virtualBottomRangeIndex = this.virtualCellHeight === 0 ? this.pageSize : scrollIndex + (parseInt(this.finalVirtualPageHeight / this.virtualCellHeight) || 1) * (this.preloadPage + 1);
- virtualBottomRangeIndex *= this.virtualListCol;
- virtualBottomRangeIndex = Math.min(this.realTotalData.length, virtualBottomRangeIndex);
- this.virtualBottomRangeIndex = virtualBottomRangeIndex;
- this.virtualPlaceholderBottomHeight = (this.realTotalData.length - virtualBottomRangeIndex) * this.virtualCellHeight / this.virtualListCol;
- this._updateVirtualList();
- },
- // 更新virtualList
- _updateVirtualList() {
- const shouldUpdateList = this.updateVirtualListFromDataChange || (this.lastVirtualTopRangeIndex !== this.virtualTopRangeIndex || this.lastVirtualBottomRangeIndex !== this.virtualBottomRangeIndex);
- if (shouldUpdateList) {
- this.updateVirtualListFromDataChange = false;
- this.lastVirtualTopRangeIndex = this.virtualTopRangeIndex;
- this.lastVirtualBottomRangeIndex = this.virtualBottomRangeIndex;
- this.virtualList = this.realTotalData.slice(this.virtualTopRangeIndex, this.virtualBottomRangeIndex + 1);
- }
- },
- // 重置动态cell模式下的高度缓存数据、虚拟列表和滚动状态
- _resetDynamicListState(resetVirtualList = false) {
- this.virtualHeightCacheList = [];
- if (resetVirtualList) {
- this.virtualList = [];
- }
- this.virtualTopRangeIndex = 0;
- this.virtualPlaceholderTopHeight = 0;
- },
- // 重置topRangeIndex和placeholderTopHeight
- _resetTopRange() {
- this.virtualTopRangeIndex = 0;
- this.virtualPlaceholderTopHeight = 0;
- this._updateVirtualList();
- },
- // 检测虚拟列表当前滚动位置,如发现滚动位置不正确则重新计算虚拟列表相关参数(为解决在App中可能出现的长时间进入后台后打开App白屏的问题)
- _checkVirtualListScroll() {
- if (this.finalUseVirtualList) {
- this.$nextTick(() => {
- this._getNodeClientRect(".zp-paging-touch-view").then((node2) => {
- const currentTop = node2 ? node2[0].top : 0;
- if (!node2 || currentTop === this.pagingOrgTop && this.virtualPlaceholderTopHeight !== 0) {
- this._updateVirtualScroll(0);
- }
- });
- });
- }
- },
- // 获取对应index的虚拟列表cell节点信息
- _getVirtualCellNodeByIndex(index2) {
- let inDom = this.finalUseInnerList;
- return this._getNodeClientRect(`#${this.fianlVirtualCellIdPrefix}-${index2}`, inDom);
- },
- // 处理使用内置列表时点击了cell事件
- _innerCellClick(item, index2) {
- this.$emit("innerCellClick", item, index2);
- }
- }
- };
- const systemInfo$1 = u$1.getSystemInfoSync();
- const _sfc_main$2f = {
- name: "z-paging",
- components: {
- zPagingRefresh,
- zPagingLoadMore,
- zPagingEmptyView: __easycom_0$f
- },
- mixins: [
- commonLayoutModule,
- dataHandleModule,
- i18nModule,
- nvueModule,
- emptyModule,
- refresherModule,
- loadMoreModule,
- loadingModule,
- chatRecordModerModule,
- scrollerModule,
- backToTopModule,
- virtualListModule
- ],
- data() {
- return {
- // --------------静态资源---------------
- base64BackToTop: zStatic.base64BackToTop,
- // -------------全局数据相关--------------
- // 当前加载类型
- loadingType: Enum.LoadingType.Refresher,
- requestTimeStamp: 0,
- wxsPropType: "",
- renderPropScrollTop: -1,
- checkScrolledToBottomTimeOut: null,
- cacheTopHeight: -1,
- statusBarHeight: systemInfo$1.statusBarHeight,
- scrollViewHeight: 0,
- pagingOrgTop: -1,
- // --------------状态&判断---------------
- insideOfPaging: -1,
- isLoadFailed: false,
- isIos: systemInfo$1.platform === "ios",
- disabledBounce: false,
- fromCompleteEmit: false,
- disabledCompleteEmit: false,
- pageLaunched: false,
- active: false,
- // ---------------wxs相关---------------
- wxsIsScrollTopInTopRange: true,
- wxsScrollTop: 0,
- wxsPageScrollTop: 0,
- wxsOnPullingDown: false
- };
- },
- props: {
- // 调用complete后延迟处理的时间,单位为毫秒,默认0毫秒,优先级高于minDelay
- delay: {
- type: [Number, String],
- default: u$1.gc("delay", 0)
- },
- // 触发@query后最小延迟处理的时间,单位为毫秒,默认0毫秒,优先级低于delay(假设设置为300毫秒,若分页请求时间小于300毫秒,则在调用complete后延迟[300毫秒-请求时长];若请求时长大于300毫秒,则不延迟),当show-refresher-when-reload为true或reload(true)时,其最小值为400
- minDelay: {
- type: [Number, String],
- default: u$1.gc("minDelay", 0)
- },
- // 设置z-paging的style,部分平台(如微信小程序)无法直接修改组件的style,可使用此属性代替
- pagingStyle: {
- type: Object,
- default: u$1.gc("pagingStyle", {})
- },
- // 设置z-paging的class,优先级低于pagingStyle和height、width、maxWidth、bgColor
- pagingClass: {
- type: [String, Array, Object],
- default: u$1.gc("pagingClass", "")
- },
- // z-paging的高度,优先级低于pagingStyle中设置的height;传字符串,如100px、100rpx、100%
- height: {
- type: String,
- default: u$1.gc("height", "")
- },
- // z-paging的宽度,优先级低于pagingStyle中设置的width;传字符串,如100px、100rpx、100%
- width: {
- type: String,
- default: u$1.gc("width", "")
- },
- // z-paging的最大宽度,优先级低于pagingStyle中设置的max-width;传字符串,如100px、100rpx、100%。默认为空,也就是铺满窗口宽度,若设置了特定值则会自动添加margin: 0 auto
- maxWidth: {
- type: String,
- default: u$1.gc("maxWidth", "")
- },
- // z-paging的背景色,优先级低于pagingStyle中设置的background。传字符串,如"#ffffff"
- bgColor: {
- type: String,
- default: u$1.gc("bgColor", "")
- },
- // 设置z-paging的容器(插槽的父view)的style
- pagingContentStyle: {
- type: Object,
- default: u$1.gc("pagingContentStyle", {})
- },
- // z-paging是否自动高度,若自动高度则会自动铺满屏幕
- autoHeight: {
- type: Boolean,
- default: u$1.gc("autoHeight", false)
- },
- // z-paging是否自动高度时,附加的高度,注意添加单位px或rpx,若需要减少高度,则传负数
- autoHeightAddition: {
- type: [Number, String],
- default: u$1.gc("autoHeightAddition", "0px")
- },
- // loading(下拉刷新、上拉加载更多)的主题样式,支持black,white,默认black
- defaultThemeStyle: {
- type: String,
- default: u$1.gc("defaultThemeStyle", "black")
- },
- // z-paging是否使用fixed布局,若使用fixed布局,则z-paging的父view无需固定高度,z-paging高度默认为100%,默认为是(当使用内置scroll-view滚动时有效)
- fixed: {
- type: Boolean,
- default: u$1.gc("fixed", true)
- },
- // 是否开启底部安全区域适配
- safeAreaInsetBottom: {
- type: Boolean,
- default: u$1.gc("safeAreaInsetBottom", false)
- },
- // 开启底部安全区域适配后,是否使用placeholder形式实现,默认为否。为否时滚动区域会自动避开底部安全区域,也就是所有滚动内容都不会挡住底部安全区域,若设置为是,则滚动时滚动内容会挡住底部安全区域,但是当滚动到底部时才会避开底部安全区域
- useSafeAreaPlaceholder: {
- type: Boolean,
- default: u$1.gc("useSafeAreaPlaceholder", false)
- },
- // z-paging bottom的背景色,默认透明,传字符串,如"#ffffff"
- bottomBgColor: {
- type: String,
- default: u$1.gc("bottomBgColor", "")
- },
- // slot="top"的view的z-index,默认为99,仅使用页面滚动时有效
- topZIndex: {
- type: Number,
- default: u$1.gc("topZIndex", 99)
- },
- // z-paging内容容器父view的z-index,默认为1
- superContentZIndex: {
- type: Number,
- default: u$1.gc("superContentZIndex", 1)
- },
- // z-paging内容容器部分的z-index,默认为1
- contentZIndex: {
- type: Number,
- default: u$1.gc("contentZIndex", 1)
- },
- // z-paging二楼的z-index,默认为100
- f2ZIndex: {
- type: Number,
- default: u$1.gc("f2ZIndex", 100)
- },
- // 使用页面滚动时,是否在不满屏时自动填充满屏幕,默认为是
- autoFullHeight: {
- type: Boolean,
- default: u$1.gc("autoFullHeight", true)
- },
- // 是否监听列表触摸方向改变,默认为否
- watchTouchDirectionChange: {
- type: Boolean,
- default: u$1.gc("watchTouchDirectionChange", false)
- },
- // 是否监听列表滚动方向改变,默认为否
- watchScrollDirectionChange: {
- type: Boolean,
- default: u$1.gc("watchScrollDirectionChange", false)
- },
- // 是否只使用基础布局,设置为true后将关闭mounted自动请求数据、关闭下拉刷新和滚动到底部加载更多,强制隐藏空数据图。默认为否
- layoutOnly: {
- type: Boolean,
- default: u$1.gc("layoutOnly", false)
- },
- // z-paging中布局的单位,默认为rpx
- unit: {
- type: String,
- default: u$1.gc("unit", "rpx")
- }
- },
- created() {
- if (this.createdReload && !this.isOnly && this.auto) {
- this._startLoading();
- this.$nextTick(this._preReload);
- }
- },
- mounted() {
- this.active = true;
- this.wxsPropType = u$1.getTime().toString();
- this.renderJsIgnore;
- if (!this.createdReload && !this.isOnly && this.auto) {
- u$1.delay(() => this.$nextTick(this._preReload), 0);
- }
- this.finalUseCache && this._setListByLocalCache();
- this.$nextTick(() => {
- this.systemInfo = u$1.getSystemInfoSync();
- !this.usePageScroll && this.autoHeight && this._setAutoHeight();
- this.loaded = true;
- u$1.delay(() => {
- this.updateFixedLayout();
- this._updateCachedSuperContentHeight();
- this._updateScrollViewHeight();
- });
- });
- this.updatePageScrollTopHeight();
- this.updatePageScrollBottomHeight();
- this.updateLeftAndRightWidth();
- if (this.finalRefresherEnabled && this.useCustomRefresher) {
- this.$nextTick(() => {
- this.isTouchmoving = true;
- });
- }
- if (!this.layoutOnly) {
- this._onEmit();
- }
- },
- destroyed() {
- this._handleUnmounted();
- },
- unmounted() {
- this._handleUnmounted();
- },
- watch: {
- defaultThemeStyle: {
- handler(newVal) {
- if (newVal.length) {
- this.finalRefresherDefaultStyle = newVal;
- }
- },
- immediate: true
- },
- autoHeight(newVal) {
- this.loaded && !this.usePageScroll && this._setAutoHeight(newVal);
- },
- autoHeightAddition(newVal) {
- this.loaded && !this.usePageScroll && this.autoHeight && this._setAutoHeight(newVal);
- }
- },
- computed: {
- // 当前z-paging的内置样式
- finalPagingStyle() {
- const pagingStyle = { ...this.pagingStyle };
- if (!this.systemInfo)
- return pagingStyle;
- const { windowTop, windowBottom } = this;
- if (!this.usePageScroll && this.fixed) {
- if (windowTop && !pagingStyle.top) {
- pagingStyle.top = windowTop + "px";
- }
- if (windowBottom && !pagingStyle.bottom) {
- pagingStyle.bottom = windowBottom + "px";
- }
- }
- if (this.bgColor.length && !pagingStyle["background"]) {
- pagingStyle["background"] = this.bgColor;
- }
- if (this.height.length && !pagingStyle["height"]) {
- pagingStyle["height"] = this.height;
- }
- if (this.width.length && !pagingStyle["width"]) {
- pagingStyle["width"] = this.width;
- }
- if (this.maxWidth.length && !pagingStyle["max-width"]) {
- pagingStyle["max-width"] = this.maxWidth;
- pagingStyle["margin"] = "0 auto";
- }
- return pagingStyle;
- },
- // 当前z-paging内容的样式
- finalPagingContentStyle() {
- if (this.contentZIndex != 1) {
- this.pagingContentStyle["z-index"] = this.contentZIndex;
- this.pagingContentStyle["position"] = "relative";
- }
- return this.pagingContentStyle;
- },
- // 最终的当前开启安全区域适配后,是否使用placeholder形式实现。如果slot=bottom存在,则应当交由固定在底部的view处理,因此需排除此情况
- finalUseSafeAreaPlaceholder() {
- return this.useSafeAreaPlaceholder && !this.zSlots.bottom;
- },
- renderJsIgnore() {
- if (this.usePageScroll && this.useChatRecordMode || !this.refresherEnabled && this.scrollable || !this.useCustomRefresher) {
- this.$nextTick(() => {
- this.renderPropScrollTop = 10;
- });
- }
- return 0;
- },
- windowHeight() {
- if (!this.systemInfo)
- return 0;
- return this.systemInfo.windowHeight || 0;
- },
- windowBottom() {
- if (!this.systemInfo)
- return 0;
- return this.systemInfo.windowBottom || 0;
- },
- // 是否是ios+h5
- isIosAndH5() {
- return false;
- },
- // 是否是只使用基础布局或者只使用下拉刷新
- isOnly() {
- return this.layoutOnly || this.refresherOnly;
- }
- },
- methods: {
- // 当前版本号
- getVersion() {
- return `z-paging v${c$1.version}`;
- },
- // 设置nvue List的specialEffects
- setSpecialEffects(args) {
- this.setListSpecialEffects(args);
- },
- // 与setSpecialEffects等效,兼容旧版本
- setListSpecialEffects(args) {
- this.nFixFreezing = args && Object.keys(args).length;
- if (this.isIos) {
- this.privateRefresherEnabled = 0;
- }
- !this.usePageScroll && this.$refs["zp-n-list"].setSpecialEffects(args);
- },
- // 当app长时间进入后台后进入前台,因系统内存管理导致app重新加载时,进行一些适配处理
- _handlePageLaunch() {
- if (this.pageLaunched) {
- this.refresherThresholdUpdateTag = 1;
- this.$nextTick(() => {
- this.refresherThresholdUpdateTag = 0;
- });
- this._checkVirtualListScroll();
- }
- this.pageLaunched = true;
- },
- // 使手机发生较短时间的振动(15ms)
- _doVibrateShort() {
- if (this.isIos) {
- const UISelectionFeedbackGenerator = plus.ios.importClass("UISelectionFeedbackGenerator");
- const feedbackGenerator = new UISelectionFeedbackGenerator();
- feedbackGenerator.init();
- setTimeout(() => {
- feedbackGenerator.selectionChanged();
- }, 0);
- } else {
- plus.device.vibrate(15);
- }
- },
- // 设置z-paging高度
- async _setAutoHeight(shouldFullHeight = true, scrollViewNode = null) {
- const heightKey = "min-height";
- try {
- if (shouldFullHeight) {
- let finalScrollViewNode = scrollViewNode || await this._getNodeClientRect(".zp-scroll-view");
- let finalScrollBottomNode = await this._getNodeClientRect(".zp-page-bottom");
- if (finalScrollViewNode) {
- const scrollViewTop = finalScrollViewNode[0].top;
- let scrollViewHeight = this.windowHeight - scrollViewTop;
- scrollViewHeight -= finalScrollBottomNode ? finalScrollBottomNode[0].height : 0;
- const additionHeight = u$1.convertToPx(this.autoHeightAddition);
- let importantSuffix = " !important";
- const finalHeight = scrollViewHeight + additionHeight - (this.insideMore ? 1 : 0) + "px" + importantSuffix;
- this.$set(this.scrollViewStyle, heightKey, finalHeight);
- this.$set(this.scrollViewInStyle, heightKey, finalHeight);
- }
- } else {
- this.$delete(this.scrollViewStyle, heightKey);
- this.$delete(this.scrollViewInStyle, heightKey);
- }
- } catch (e2) {
- }
- },
- // 更新scroll-view高度
- async _updateScrollViewHeight() {
- const scrollViewNode = await this._getNodeClientRect(".zp-scroll-view");
- if (scrollViewNode) {
- const scrollViewNodeHeight = scrollViewNode[0].height;
- this.scrollViewHeight = scrollViewNodeHeight;
- this.pagingOrgTop = scrollViewNode[0].top;
- }
- },
- // 组件销毁后续处理
- _handleUnmounted() {
- this.active = false;
- if (!this.layoutOnly) {
- this._offEmit();
- }
- this.useChatRecordMode && uni.offKeyboardHeightChange(this._handleKeyboardHeightChange);
- },
- // 触发更新是否超出页面状态
- _updateInsideOfPaging() {
- this.insideMore && this.insideOfPaging === true && setTimeout(this.doLoadMore, 200);
- },
- // 清除timeout
- _cleanTimeout(timeout2) {
- if (timeout2) {
- clearTimeout(timeout2);
- timeout2 = null;
- }
- return timeout2;
- },
- // 添加全局emit监听
- _onEmit() {
- uni.$on(c$1.errorUpdateKey, (errorMsg) => {
- if (this.loading) {
- if (!!errorMsg) {
- this.customerEmptyViewErrorText = errorMsg;
- }
- this.complete(false).catch(() => {
- });
- }
- });
- uni.$on(c$1.completeUpdateKey, (data) => {
- setTimeout(() => {
- if (this.loading) {
- if (!this.disabledCompleteEmit) {
- const type2 = data.type || "normal";
- const list = data.list || data;
- const rule = data.rule;
- this.fromCompleteEmit = true;
- switch (type2) {
- case "normal":
- this.complete(list);
- break;
- case "total":
- this.completeByTotal(list, rule);
- break;
- case "nomore":
- this.completeByNoMore(list, rule);
- break;
- case "key":
- this.completeByKey(list, rule);
- break;
- }
- } else {
- this.disabledCompleteEmit = false;
- }
- }
- }, 1);
- });
- },
- // 销毁全局emit和listener监听
- _offEmit() {
- uni.$off(c$1.errorUpdateKey);
- uni.$off(c$1.completeUpdateKey);
- }
- }
- };
- const block0$3 = (Comp) => {
- (Comp.$renderjs || (Comp.$renderjs = [])).push("pagingRenderjs");
- (Comp.$renderjsModules || (Comp.$renderjsModules = {}))["pagingRenderjs"] = "463e3cc3";
- };
- const block1 = (Comp) => {
- (Comp.$wxs || (Comp.$wxs = [])).push("pagingWxs");
- (Comp.$wxsModules || (Comp.$wxsModules = {}))["pagingWxs"] = "42613348";
- };
- function _sfc_render$2e(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_z_paging_refresh = vue.resolveComponent("z-paging-refresh");
- const _component_z_paging_load_more = vue.resolveComponent("z-paging-load-more");
- const _component_z_paging_empty_view = resolveEasycom(vue.resolveDynamicComponent("z-paging-empty-view"), __easycom_0$f);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass([{ "z-paging-content": true, "z-paging-content-full": !_ctx.usePageScroll, "z-paging-content-fixed": !_ctx.usePageScroll && _ctx.fixed, "z-paging-content-page": _ctx.usePageScroll, "z-paging-reached-top": _ctx.renderPropScrollTop < 1, "z-paging-use-chat-record-mode": _ctx.useChatRecordMode }, _ctx.pagingClass]),
- style: vue.normalizeStyle([_ctx.finalPagingStyle])
- },
- [
- vue.createCommentVNode(" 二楼view "),
- _ctx.showF2 && _ctx.showRefresherF2 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- onTouchmove: _cache[0] || (_cache[0] = vue.withModifiers(() => {
- }, ["stop", "prevent"])),
- class: "zp-f2-content",
- style: vue.normalizeStyle([{ "transform": _ctx.f2Transform, "transition": `transform .2s linear`, "height": _ctx.superContentHeight + "px", "z-index": _ctx.f2ZIndex }])
- },
- [
- vue.renderSlot(_ctx.$slots, "f2", {}, void 0, true)
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 顶部固定的slot "),
- _ctx.zSlots.top ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- !_ctx.usePageScroll ? vue.renderSlot(_ctx.$slots, "top", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "zp-page-top",
- onTouchmove: _cache[1] || (_cache[1] = vue.withModifiers(() => {
- }, ["stop", "prevent"])),
- style: vue.normalizeStyle([{ "top": `${_ctx.windowTop}px`, "z-index": _ctx.topZIndex }])
- },
- [
- vue.renderSlot(_ctx.$slots, "top", {}, void 0, true)
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass({ "zp-view-super": true, "zp-scroll-view-super": !_ctx.usePageScroll }),
- style: vue.normalizeStyle([_ctx.finalScrollViewStyle])
- },
- [
- _ctx.zSlots.left ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass({ "zp-page-left": true, "zp-absoulte": _ctx.finalIsOldWebView })
- },
- [
- vue.renderSlot(_ctx.$slots, "left", {}, void 0, true)
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass({ "zp-scroll-view-container": true, "zp-absoulte": _ctx.finalIsOldWebView }),
- style: vue.normalizeStyle([_ctx.scrollViewContainerStyle])
- },
- [
- vue.createElementVNode("scroll-view", {
- ref: "zp-scroll-view",
- class: vue.normalizeClass({ "zp-scroll-view": true, "zp-scroll-view-absolute": !_ctx.usePageScroll, "zp-scroll-view-hide-scrollbar": !_ctx.showScrollbar }),
- style: vue.normalizeStyle([_ctx.chatRecordRotateStyle]),
- "scroll-top": _ctx.scrollTop,
- "scroll-left": _ctx.scrollLeft,
- "scroll-x": _ctx.scrollX,
- "scroll-y": _ctx.finalScrollable,
- "enable-back-to-top": _ctx.finalEnableBackToTop,
- "show-scrollbar": _ctx.showScrollbar,
- "scroll-with-animation": _ctx.finalScrollWithAnimation,
- "scroll-into-view": _ctx.scrollIntoView,
- "lower-threshold": _ctx.finalLowerThreshold,
- "upper-threshold": 5,
- "refresher-enabled": _ctx.finalRefresherEnabled && !_ctx.useCustomRefresher,
- "refresher-threshold": _ctx.finalRefresherThreshold,
- "refresher-default-style": _ctx.finalRefresherDefaultStyle,
- "refresher-background": _ctx.refresherBackground,
- "refresher-triggered": _ctx.finalRefresherTriggered,
- onScroll: _cache[12] || (_cache[12] = (...args) => _ctx._scroll && _ctx._scroll(...args)),
- onScrolltolower: _cache[13] || (_cache[13] = (...args) => _ctx._onScrollToLower && _ctx._onScrollToLower(...args)),
- onScrolltoupper: _cache[14] || (_cache[14] = (...args) => _ctx._onScrollToUpper && _ctx._onScrollToUpper(...args)),
- onRefresherrestore: _cache[15] || (_cache[15] = (...args) => _ctx._onRestore && _ctx._onRestore(...args)),
- onRefresherrefresh: _cache[16] || (_cache[16] = ($event) => _ctx._onRefresh(true))
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "zp-paging-touch-view",
- onTouchstart: _cache[4] || (_cache[4] = (...args) => _ctx.pagingWxs.touchstart && _ctx.pagingWxs.touchstart(...args)),
- onTouchmove: _cache[5] || (_cache[5] = (...args) => _ctx.pagingWxs.touchmove && _ctx.pagingWxs.touchmove(...args)),
- onTouchend: _cache[6] || (_cache[6] = (...args) => _ctx.pagingWxs.touchend && _ctx.pagingWxs.touchend(...args)),
- onTouchcancel: _cache[7] || (_cache[7] = (...args) => _ctx.pagingWxs.touchend && _ctx.pagingWxs.touchend(...args)),
- onMousedown: _cache[8] || (_cache[8] = (...args) => _ctx.pagingWxs.mousedown && _ctx.pagingWxs.mousedown(...args)),
- onMousemove: _cache[9] || (_cache[9] = (...args) => _ctx.pagingWxs.mousemove && _ctx.pagingWxs.mousemove(...args)),
- onMouseup: _cache[10] || (_cache[10] = (...args) => _ctx.pagingWxs.mouseup && _ctx.pagingWxs.mouseup(...args)),
- onMouseleave: _cache[11] || (_cache[11] = (...args) => _ctx.pagingWxs.mouseleave && _ctx.pagingWxs.mouseleave(...args))
- },
- [
- _ctx.finalRefresherFixedBacHeight > 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "zp-fixed-bac-view",
- style: vue.normalizeStyle([{ "background": _ctx.refresherFixedBackground, "height": `${_ctx.finalRefresherFixedBacHeight}px` }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", {
- class: "zp-paging-main",
- style: vue.normalizeStyle([_ctx.scrollViewInStyle, { "transform": _ctx.finalRefresherTransform, "transition": _ctx.refresherTransition }]),
- "change:prop": _ctx.pagingWxs.propObserver,
- prop: vue.wp(_ctx.wxsPropType),
- "data-refresherThreshold": _ctx.finalRefresherThreshold,
- "data-refresherF2Enabled": _ctx.refresherF2Enabled,
- "data-refresherF2Threshold": _ctx.finalRefresherF2Threshold,
- "data-isIos": _ctx.isIos,
- "data-loading": _ctx.loading || _ctx.isRefresherInComplete,
- "data-useChatRecordMode": _ctx.useChatRecordMode,
- "data-refresherEnabled": _ctx.finalRefresherEnabled,
- "data-useCustomRefresher": _ctx.useCustomRefresher,
- "data-pageScrollTop": _ctx.wxsPageScrollTop,
- "data-scrollTop": _ctx.wxsScrollTop,
- "data-refresherMaxAngle": _ctx.refresherMaxAngle,
- "data-refresherNoTransform": _ctx.refresherNoTransform,
- "data-refresherAecc": _ctx.refresherAngleEnableChangeContinued,
- "data-usePageScroll": _ctx.usePageScroll,
- "data-watchTouchDirectionChange": _ctx.watchTouchDirectionChange,
- "data-oldIsTouchmoving": _ctx.isTouchmoving,
- "data-refresherOutRate": _ctx.finalRefresherOutRate,
- "data-refresherPullRate": _ctx.finalRefresherPullRate,
- "data-hasTouchmove": _ctx.hasTouchmove,
- "change:renderPropIsIosAndH5": _ctx.pagingRenderjs.renderPropIsIosAndH5Change,
- renderPropIsIosAndH5: vue.wp(_ctx.isIosAndH5)
- }, [
- _ctx.showRefresher ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "zp-custom-refresher-view",
- style: vue.normalizeStyle([{ "margin-top": `-${_ctx.finalRefresherThreshold + _ctx.refresherThresholdUpdateTag}px`, "background": _ctx.refresherBackground, "opacity": _ctx.isTouchmoving ? 1 : 0 }])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "zp-custom-refresher-container",
- style: vue.normalizeStyle([{ "height": `${_ctx.finalRefresherThreshold}px`, "background": _ctx.refresherBackground }])
- },
- [
- _ctx.useRefresherStatusBarPlaceholder ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "zp-custom-refresher-status-bar-placeholder",
- style: vue.normalizeStyle([{ "height": `${_ctx.statusBarHeight}px` }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 下拉刷新view "),
- vue.createElementVNode("view", { class: "zp-custom-refresher-slot-view" }, [
- !(_ctx.zSlots.refresherComplete && _ctx.refresherStatus === _ctx.R.Complete) && !(_ctx.zSlots.refresherF2 && _ctx.refresherStatus === _ctx.R.GoF2) ? vue.renderSlot(_ctx.$slots, "refresher", {
- key: 0,
- refresherStatus: _ctx.refresherStatus
- }, void 0, true) : vue.createCommentVNode("v-if", true)
- ]),
- _ctx.zSlots.refresherComplete && _ctx.refresherStatus === _ctx.R.Complete ? vue.renderSlot(_ctx.$slots, "refresherComplete", { key: 1 }, void 0, true) : _ctx.zSlots.refresherF2 && _ctx.refresherStatus === _ctx.R.GoF2 ? vue.renderSlot(_ctx.$slots, "refresherF2", { key: 2 }, void 0, true) : !_ctx.showCustomRefresher ? (vue.openBlock(), vue.createBlock(_component_z_paging_refresh, {
- key: 3,
- ref: "refresh",
- class: "zp-custom-refresher-refresh",
- style: vue.normalizeStyle([{ "height": `${_ctx.finalRefresherThreshold - _ctx.finalRefresherThresholdPlaceholder}px` }]),
- status: _ctx.refresherStatus,
- defaultThemeStyle: _ctx.finalRefresherThemeStyle,
- defaultText: _ctx.finalRefresherDefaultText,
- isIos: _ctx.isIos,
- pullingText: _ctx.finalRefresherPullingText,
- refreshingText: _ctx.finalRefresherRefreshingText,
- completeText: _ctx.finalRefresherCompleteText,
- goF2Text: _ctx.finalRefresherGoF2Text,
- defaultImg: _ctx.refresherDefaultImg,
- pullingImg: _ctx.refresherPullingImg,
- refreshingImg: _ctx.refresherRefreshingImg,
- completeImg: _ctx.refresherCompleteImg,
- refreshingAnimated: _ctx.refresherRefreshingAnimated,
- showUpdateTime: _ctx.showRefresherUpdateTime,
- updateTimeKey: _ctx.refresherUpdateTimeKey,
- updateTimeTextMap: _ctx.finalRefresherUpdateTimeTextMap,
- imgStyle: _ctx.refresherImgStyle,
- titleStyle: _ctx.refresherTitleStyle,
- updateTimeStyle: _ctx.refresherUpdateTimeStyle,
- unit: _ctx.unit
- }, null, 8, ["style", "status", "defaultThemeStyle", "defaultText", "isIos", "pullingText", "refreshingText", "completeText", "goF2Text", "defaultImg", "pullingImg", "refreshingImg", "completeImg", "refreshingAnimated", "showUpdateTime", "updateTimeKey", "updateTimeTextMap", "imgStyle", "titleStyle", "updateTimeStyle", "unit"])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "zp-paging-container",
- style: vue.normalizeStyle([{ justifyContent: _ctx.useChatRecordMode ? "flex-end" : "flex-start" }])
- },
- [
- vue.createCommentVNode(" 全屏Loading "),
- _ctx.showLoading && _ctx.zSlots.loading && !_ctx.loadingFullFixed ? vue.renderSlot(_ctx.$slots, "loading", { key: 0 }, void 0, true) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 主体内容 "),
- vue.createElementVNode(
- "view",
- {
- class: "zp-paging-container-content",
- style: vue.normalizeStyle([_ctx.finalPlaceholderTopHeightStyle, _ctx.finalPagingContentStyle])
- },
- [
- vue.createCommentVNode(" 虚拟列表顶部占位view "),
- _ctx.useVirtualList ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "zp-virtual-placeholder",
- style: vue.normalizeStyle([{ height: _ctx.virtualPlaceholderTopHeight + "px" }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- vue.createCommentVNode(" 内置列表&虚拟列表 "),
- _ctx.finalUseInnerList ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.renderSlot(_ctx.$slots, "header", {}, void 0, true),
- vue.createElementVNode(
- "view",
- {
- class: "zp-list-container",
- style: vue.normalizeStyle([_ctx.innerListStyle])
- },
- [
- _ctx.finalUseVirtualList ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList(_ctx.virtualList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "zp-list-cell",
- style: vue.normalizeStyle([_ctx.innerCellStyle]),
- id: `${_ctx.fianlVirtualCellIdPrefix}-${item[_ctx.virtualCellIndexKey]}`,
- key: item["zp_unique_index"],
- onClick: ($event) => _ctx._innerCellClick(item, _ctx.virtualTopRangeIndex + index2)
- }, [
- _ctx.useCompatibilityMode ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, "使用兼容模式请在组件源码z-paging.vue第105行中注释这一行,并打开下面一行注释")) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(' <zp-public-virtual-cell v-if="useCompatibilityMode" :extraData="extraData" :item="item" :index="virtualTopRangeIndex+index" /> '),
- vue.renderSlot(_ctx.$slots, "cell", {
- item,
- index: _ctx.virtualTopRangeIndex + index2
- }, void 0, true)
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- ))
- ], 12, ["id", "onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- vue.renderList(_ctx.realTotalData, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "zp-list-cell",
- key: index2,
- onClick: ($event) => _ctx._innerCellClick(item, index2)
- }, [
- vue.renderSlot(_ctx.$slots, "cell", {
- item,
- index: index2
- }, void 0, true)
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- ),
- vue.renderSlot(_ctx.$slots, "footer", {}, void 0, true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 聊天记录模式加载更多loading "),
- _ctx.useChatRecordMode && _ctx.realTotalData.length >= _ctx.defaultPageSize && (_ctx.loadingStatus !== _ctx.M.NoMore || _ctx.zSlots.chatNoMore) && (_ctx.realTotalData.length || _ctx.showChatLoadingWhenReload && _ctx.showLoading) && !_ctx.isFirstPageAndNoMore ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- style: vue.normalizeStyle([_ctx.chatRecordRotateStyle])
- },
- [
- _ctx.loadingStatus === _ctx.M.NoMore && _ctx.zSlots.chatNoMore ? vue.renderSlot(_ctx.$slots, "chatNoMore", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- _ctx.zSlots.chatLoading ? vue.renderSlot(_ctx.$slots, "chatLoading", {
- key: 0,
- loadingMoreStatus: _ctx.loadingStatus
- }, void 0, true) : (vue.openBlock(), vue.createBlock(_component_z_paging_load_more, {
- key: 1,
- onDoClick: _cache[2] || (_cache[2] = ($event) => _ctx._onLoadingMore("click")),
- zConfig: _ctx.zLoadMoreConfig
- }, null, 8, ["zConfig"]))
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 虚拟列表底部占位view "),
- _ctx.useVirtualList ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 3,
- class: "zp-virtual-placeholder",
- style: vue.normalizeStyle([{ height: _ctx.virtualPlaceholderBottomHeight + "px" }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 上拉加载更多view "),
- _ctx.showLoadingMoreDefault ? vue.renderSlot(_ctx.$slots, "loadingMoreDefault", { key: 4 }, void 0, true) : _ctx.showLoadingMoreLoading ? vue.renderSlot(_ctx.$slots, "loadingMoreLoading", { key: 5 }, void 0, true) : _ctx.showLoadingMoreNoMore ? vue.renderSlot(_ctx.$slots, "loadingMoreNoMore", { key: 6 }, void 0, true) : _ctx.showLoadingMoreFail ? vue.renderSlot(_ctx.$slots, "loadingMoreFail", { key: 7 }, void 0, true) : _ctx.showLoadingMoreCustom ? (vue.openBlock(), vue.createBlock(_component_z_paging_load_more, {
- key: 8,
- onDoClick: _cache[3] || (_cache[3] = ($event) => _ctx._onLoadingMore("click")),
- zConfig: _ctx.zLoadMoreConfig
- }, null, 8, ["zConfig"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 底部安全区域useSafeAreaPlaceholder模式占位,此时占位不再固定在底部而是跟随页面一起滚动 "),
- vue.createCommentVNode(" 如果底部slot=bottom存在,占位区域会插入在slot=bottom下方,不再跟随页面滚动,因此这里就没必要显示了 "),
- vue.createCommentVNode(" 聊天记录模式因为列表倒置,此处不需要显示底部安全区域,另行处理 "),
- _ctx.safeAreaInsetBottom && _ctx.finalUseSafeAreaPlaceholder && !_ctx.useChatRecordMode ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 9,
- class: "zp-safe-area-placeholder",
- style: vue.normalizeStyle([{ height: _ctx.safeAreaBottom + "px" }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 空数据图 "),
- _ctx.showEmpty ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass({ "zp-empty-view": true, "zp-empty-view-center": _ctx.emptyViewCenter }),
- style: vue.normalizeStyle([_ctx.emptyViewSuperStyle, _ctx.chatRecordRotateStyle])
- },
- [
- _ctx.zSlots.empty ? vue.renderSlot(_ctx.$slots, "empty", {
- key: 0,
- isLoadFailed: _ctx.isLoadFailed
- }, void 0, true) : (vue.openBlock(), vue.createBlock(_component_z_paging_empty_view, {
- key: 1,
- emptyViewImg: _ctx.finalEmptyViewImg,
- emptyViewText: _ctx.finalEmptyViewText,
- showEmptyViewReload: _ctx.finalShowEmptyViewReload,
- emptyViewReloadText: _ctx.finalEmptyViewReloadText,
- isLoadFailed: _ctx.isLoadFailed,
- emptyViewStyle: _ctx.emptyViewStyle,
- emptyViewTitleStyle: _ctx.emptyViewTitleStyle,
- emptyViewImgStyle: _ctx.emptyViewImgStyle,
- emptyViewReloadStyle: _ctx.emptyViewReloadStyle,
- emptyViewZIndex: _ctx.emptyViewZIndex,
- emptyViewFixed: _ctx.emptyViewFixed,
- unit: _ctx.unit,
- onReload: _ctx._emptyViewReload,
- onViewClick: _ctx._emptyViewClick
- }, null, 8, ["emptyViewImg", "emptyViewText", "showEmptyViewReload", "emptyViewReloadText", "isLoadFailed", "emptyViewStyle", "emptyViewTitleStyle", "emptyViewImgStyle", "emptyViewReloadStyle", "emptyViewZIndex", "emptyViewFixed", "unit", "onReload", "onViewClick"]))
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ], 12, ["change:prop", "prop", "data-refresherThreshold", "data-refresherF2Enabled", "data-refresherF2Threshold", "data-isIos", "data-loading", "data-useChatRecordMode", "data-refresherEnabled", "data-useCustomRefresher", "data-pageScrollTop", "data-scrollTop", "data-refresherMaxAngle", "data-refresherNoTransform", "data-refresherAecc", "data-usePageScroll", "data-watchTouchDirectionChange", "data-oldIsTouchmoving", "data-refresherOutRate", "data-refresherPullRate", "data-hasTouchmove", "change:renderPropIsIosAndH5", "renderPropIsIosAndH5"])
- ],
- 32
- /* NEED_HYDRATION */
- )
- ], 46, ["scroll-top", "scroll-left", "scroll-x", "scroll-y", "enable-back-to-top", "show-scrollbar", "scroll-with-animation", "scroll-into-view", "lower-threshold", "refresher-enabled", "refresher-threshold", "refresher-default-style", "refresher-background", "refresher-triggered"])
- ],
- 6
- /* CLASS, STYLE */
- ),
- _ctx.zSlots.right ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass({ "zp-page-right": true, "zp-absoulte zp-right": _ctx.finalIsOldWebView })
- },
- [
- vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createCommentVNode(" 底部固定的slot "),
- vue.createElementVNode(
- "view",
- {
- class: "zp-page-bottom-container",
- style: vue.normalizeStyle({ "background": _ctx.bottomBgColor })
- },
- [
- _ctx.zSlots.bottom ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createCommentVNode(" 非页面滚动底部插槽(父容器开启flex,中间列表设置了flex:1,通过中间列表撑开固定在底部) "),
- !_ctx.usePageScroll ? vue.renderSlot(_ctx.$slots, "bottom", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 页面滚动底部插槽(通过position: fixed固定在底部) "),
- vue.createElementVNode(
- "view",
- {
- class: "zp-page-bottom",
- onTouchmove: _cache[17] || (_cache[17] = vue.withModifiers(() => {
- }, ["stop", "prevent"])),
- style: vue.normalizeStyle([{ "bottom": `${_ctx.windowBottom}px`, "background": _ctx.bottomBgColor }])
- },
- [
- vue.renderSlot(_ctx.$slots, "bottom", {}, void 0, true),
- vue.createCommentVNode(" 页面滚动底部安全区域占位(仅slot=bottom存在时展示在slot=bottom插入的view下方,当slot=bottom不存在时,通过控制容器的marginBottom设置底部安全区域间距) "),
- _ctx.safeAreaInsetBottom ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- style: vue.normalizeStyle([{ height: _ctx.safeAreaBottom + "px" }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- )
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 非页面滚动底部安全区域占位(无论slot=bottom是否存在)"),
- vue.createCommentVNode(" 如果useSafeAreaPlaceholder开启了并且slot=bottom不存在就不显示这个占位view了,因为此时useSafeAreaPlaceholder会是跟随滚动的状态 "),
- vue.createCommentVNode(" 聊天记录模式因为列表倒置,此处不需要显示底部安全区域,另行处理 "),
- _ctx.safeAreaInsetBottom && !_ctx.usePageScroll && !_ctx.finalUseSafeAreaPlaceholder && !_ctx.useChatRecordMode ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- style: vue.normalizeStyle([{ height: _ctx.safeAreaBottom + "px" }])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 聊天记录模式底部占位 "),
- _ctx.useChatRecordMode && _ctx.autoAdjustPositionWhenChat ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle([{ height: _ctx.chatRecordModeSafeAreaBottom + "px" }])
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "zp-page-bottom-keyboard-placeholder-animate",
- style: vue.normalizeStyle([{ height: _ctx.keyboardHeight + "px" }])
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 点击返回顶部view "),
- _ctx.showBackToTopClass ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: vue.normalizeClass(_ctx.finalBackToTopClass),
- style: vue.normalizeStyle([_ctx.finalBackToTopStyle]),
- onClick: _cache[18] || (_cache[18] = vue.withModifiers((...args) => _ctx._backToTopClick && _ctx._backToTopClick(...args), ["stop"]))
- },
- [
- _ctx.zSlots.backToTop ? vue.renderSlot(_ctx.$slots, "backToTop", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- class: vue.normalizeClass(["zp-back-to-top-img", { "zp-back-to-top-img-inversion": _ctx.useChatRecordMode && !_ctx.backToTopImg.length }]),
- src: _ctx.backToTopImg.length ? _ctx.backToTopImg : _ctx.base64BackToTop
- }, null, 10, ["src"]))
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 全屏Loading(铺满z-paging并固定) "),
- _ctx.showLoading && _ctx.zSlots.loading && _ctx.loadingFullFixed ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 3,
- class: "zp-loading-fixed"
- }, [
- vue.renderSlot(_ctx.$slots, "loading", {}, void 0, true)
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- if (typeof block0$3 === "function")
- block0$3(_sfc_main$2f);
- if (typeof block1 === "function")
- block1(_sfc_main$2f);
- const __easycom_1$5 = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["render", _sfc_render$2e], ["__scopeId", "data-v-1aa372d7"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/z-paging/components/z-paging/z-paging.vue"]]);
- function useZPaging(paging) {
- const cPaging = !!paging ? paging.value || paging : null;
- onPullDownRefresh(() => {
- if (!cPaging || !cPaging.value)
- return;
- cPaging.value.reload().catch(() => {
- });
- });
- onPageScroll((e2) => {
- if (!cPaging || !cPaging.value)
- return;
- cPaging.value.updatePageScrollTop(e2.scrollTop);
- e2.scrollTop < 10 && cPaging.value.doChatRecordLoadMore();
- });
- onReachBottom(() => {
- if (!cPaging || !cPaging.value)
- return;
- cPaging.value.pageReachBottom();
- });
- }
- const _sfc_main$2e = {
- props: {
- modelValue: {
- type: [String, Number],
- default: ""
- },
- title: {
- type: String,
- default: ""
- },
- description: {
- type: String,
- default: ""
- },
- options: {
- type: Array,
- default: () => {
- return [];
- }
- },
- valueKey: {
- type: String,
- default: "value"
- },
- labelKey: {
- type: String,
- default: "name"
- }
- },
- data() {
- return {
- show: false,
- current: ""
- };
- },
- created() {
- if (this.modelValue) {
- this.options.forEach((ele) => {
- if (ele[this.valueKey] == this.modelValue) {
- this.current = ele[this.labelKey];
- }
- });
- }
- },
- emits: ["update:modelValue"],
- watch: {
- modelValue() {
- this.options.forEach((ele) => {
- if (ele[this.valueKey] == this.modelValue) {
- this.current = ele[this.labelKey];
- }
- });
- }
- },
- methods: {
- hideKeyboard() {
- uni.hideKeyboard();
- },
- select(e2) {
- this.$emit("update:modelValue", e2[this.valueKey]);
- this.current = e2[this.labelKey];
- }
- }
- };
- function _sfc_render$2d(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_input = vue.resolveComponent("up-input");
- const _component_up_action_sheet = vue.resolveComponent("up-action-sheet");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-action-sheet-data" }, [
- vue.createElementVNode("view", { class: "u-action-sheet-data__trigger" }, [
- vue.renderSlot(_ctx.$slots, "trigger", {}, void 0, true),
- !_ctx.$slots["trigger"] ? (vue.openBlock(), vue.createBlock(_component_up_input, {
- key: 0,
- modelValue: $data.current,
- disabled: "",
- disabledColor: "#ffffff",
- placeholder: $props.title,
- border: "none"
- }, null, 8, ["modelValue", "placeholder"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", {
- onClick: _cache[0] || (_cache[0] = ($event) => $data.show = true),
- class: "u-action-sheet-data__trigger__cover"
- })
- ]),
- vue.createVNode(_component_up_action_sheet, {
- show: $data.show,
- actions: $props.options,
- title: $props.title,
- safeAreaInsetBottom: "",
- description: $props.description,
- onClose: _cache[1] || (_cache[1] = ($event) => $data.show = false),
- onSelect: $options.select
- }, null, 8, ["show", "actions", "title", "description", "onSelect"])
- ]);
- }
- const uActionSheetData = /* @__PURE__ */ _export_sfc(_sfc_main$2e, [["render", _sfc_render$2d], ["__scopeId", "data-v-2ac4c00c"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-action-sheet-data/u-action-sheet-data.vue"]]);
- const __vite_glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uActionSheetData
- }, Symbol.toStringTag, { value: "Module" }));
- const defineMixin = (options2) => {
- return options2;
- };
- const version = "3";
- {
- formatAppLog("log", "at uni_modules/uview-plus/libs/config/config.js:5", `
- %c uview-plus V${version} %c https://ijry.github.io/uview-plus/
- `, "color: #ffffff; background: #3c9cff; padding:5px 0;", "color: #3c9cff;background: #ffffff; padding:5px 0;");
- }
- const config$1 = {
- v: version,
- version,
- // 主题名称
- type: [
- "primary",
- "success",
- "info",
- "error",
- "warning"
- ],
- // 颜色部分,本来可以通过scss的:export导出供js使用,但是奈何nvue不支持
- color: {
- "u-primary": "#2979ff",
- "u-warning": "#ff9900",
- "u-success": "#19be6b",
- "u-error": "#fa3534",
- "u-info": "#909399",
- "u-main-color": "#303133",
- "u-content-color": "#606266",
- "u-tips-color": "#909399",
- "u-light-color": "#c0c4cc",
- "up-primary": "#2979ff",
- "up-warning": "#ff9900",
- "up-success": "#19be6b",
- "up-error": "#fa3534",
- "up-info": "#909399",
- "up-main-color": "#303133",
- "up-content-color": "#606266",
- "up-tips-color": "#909399",
- "up-light-color": "#c0c4cc"
- },
- // 字体图标地址
- iconUrl: "https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf",
- // 自定义图标
- customIcon: {
- family: "",
- url: ""
- },
- customIcons: {},
- // 自定义图标与unicode对应关系
- // 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx
- unit: "px",
- // 拦截器
- interceptor: {
- navbarLeftClick: null
- },
- // 只加载一次字体
- loadFontOnce: false
- };
- const zIndex = {
- toast: 10090,
- noNetwork: 10080,
- // popup包含popup,actionsheet,keyboard,picker的值
- popup: 10075,
- mask: 10070,
- navbar: 980,
- topTips: 975,
- sticky: 970,
- indexListSticky: 965
- };
- const color$3 = {
- primary: "#3c9cff",
- info: "#909399",
- default: "#909399",
- warning: "#f9ae3d",
- error: "#f56c6c",
- success: "#5ac725",
- mainColor: "#303133",
- contentColor: "#606266",
- tipsColor: "#909399",
- lightColor: "#c0c4cc",
- borderColor: "#e4e7ed"
- };
- const { toString } = Object.prototype;
- function isArray(val) {
- return toString.call(val) === "[object Array]";
- }
- function isObject(val) {
- return val !== null && typeof val === "object";
- }
- function isDate(val) {
- return toString.call(val) === "[object Date]";
- }
- function isURLSearchParams(val) {
- return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
- }
- function forEach(obj, fn) {
- if (obj === null || typeof obj === "undefined") {
- return;
- }
- if (typeof obj !== "object") {
- obj = [obj];
- }
- if (isArray(obj)) {
- for (let i2 = 0, l2 = obj.length; i2 < l2; i2++) {
- fn.call(null, obj[i2], i2, obj);
- }
- } else {
- for (const key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- fn.call(null, obj[key], key, obj);
- }
- }
- }
- }
- function isPlainObject(obj) {
- return Object.prototype.toString.call(obj) === "[object Object]";
- }
- function deepMerge$2() {
- const result = {};
- function assignValue(val, key) {
- if (typeof result[key] === "object" && typeof val === "object") {
- result[key] = deepMerge$2(result[key], val);
- } else if (typeof val === "object") {
- result[key] = deepMerge$2({}, val);
- } else {
- result[key] = val;
- }
- }
- for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) {
- forEach(arguments[i2], assignValue);
- }
- return result;
- }
- function isUndefined(val) {
- return typeof val === "undefined";
- }
- function encode(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(url2, params2) {
- if (!params2) {
- return url2;
- }
- let serializedParams;
- if (isURLSearchParams(params2)) {
- serializedParams = params2.toString();
- } else {
- const parts = [];
- forEach(params2, (val, key) => {
- if (val === null || typeof val === "undefined") {
- return;
- }
- if (isArray(val)) {
- key = `${key}[]`;
- } else {
- val = [val];
- }
- forEach(val, (v2) => {
- if (isDate(v2)) {
- v2 = v2.toISOString();
- } else if (isObject(v2)) {
- v2 = JSON.stringify(v2);
- }
- parts.push(`${encode(key)}=${encode(v2)}`);
- });
- });
- serializedParams = parts.join("&");
- }
- if (serializedParams) {
- const hashmarkIndex = url2.indexOf("#");
- if (hashmarkIndex !== -1) {
- url2 = url2.slice(0, hashmarkIndex);
- }
- url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
- }
- return url2;
- }
- 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;
- }
- function settle(resolve, reject, response) {
- const { validateStatus } = response.config;
- const status = response.statusCode;
- if (status && (!validateStatus || validateStatus(status))) {
- resolve(response);
- } else {
- reject(response);
- }
- }
- const mergeKeys$1 = (keys, config2) => {
- const config3 = {};
- keys.forEach((prop) => {
- if (!isUndefined(config2[prop])) {
- config3[prop] = config2[prop];
- }
- });
- return config3;
- };
- const adapter = (config2) => new Promise((resolve, reject) => {
- const fullPath = buildURL(buildFullPath(config2.baseURL, config2.url), config2.params);
- const _config = {
- url: fullPath,
- header: config2.header,
- complete: (response) => {
- config2.fullPath = fullPath;
- response.config = config2;
- try {
- if (typeof response.data === "string") {
- response.data = JSON.parse(response.data);
- }
- } catch (e2) {
- }
- settle(resolve, reject, response);
- }
- };
- let requestTask;
- if (config2.method === "UPLOAD") {
- delete _config.header["content-type"];
- delete _config.header["Content-Type"];
- const 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") {
- if (!isUndefined(config2.timeout)) {
- _config.timeout = config2.timeout;
- }
- requestTask = uni.downloadFile(_config);
- } 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 = (config2) => adapter(config2);
- function InterceptorManager() {
- this.handlers = [];
- }
- InterceptorManager.prototype.use = function use(fulfilled, rejected) {
- this.handlers.push({
- fulfilled,
- rejected
- });
- return this.handlers.length - 1;
- };
- InterceptorManager.prototype.eject = function eject(id) {
- if (this.handlers[id]) {
- this.handlers[id] = null;
- }
- };
- InterceptorManager.prototype.forEach = function forEach2(fn) {
- this.handlers.forEach((h2) => {
- if (h2 !== null) {
- fn(h2);
- }
- });
- };
- const mergeKeys = (keys, globalsConfig, config2) => {
- const config3 = {};
- keys.forEach((prop) => {
- if (!isUndefined(config2[prop])) {
- config3[prop] = config2[prop];
- } else if (!isUndefined(globalsConfig[prop])) {
- config3[prop] = globalsConfig[prop];
- }
- });
- return config3;
- };
- const mergeConfig = (globalsConfig, config2 = {}) => {
- const method = config2.method || globalsConfig.method || "GET";
- let config3 = {
- baseURL: globalsConfig.baseURL || "",
- method,
- url: config2.url || "",
- params: config2.params || {},
- custom: { ...globalsConfig.custom || {}, ...config2.custom || {} },
- header: deepMerge$2(globalsConfig.header || {}, config2.header || {})
- };
- const defaultToConfig2Keys = ["getTask", "validateStatus"];
- config3 = { ...config3, ...mergeKeys(defaultToConfig2Keys, globalsConfig, config2) };
- if (method === "DOWNLOAD") {
- if (!isUndefined(config2.timeout)) {
- config3.timeout = config2.timeout;
- } else if (!isUndefined(globalsConfig.timeout)) {
- config3.timeout = globalsConfig.timeout;
- }
- } 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(config2[prop])) {
- config3[prop] = config2[prop];
- }
- });
- if (isUndefined(config3.timeout) && !isUndefined(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 = {
- baseURL: "",
- header: {},
- method: "GET",
- dataType: "json",
- responseType: "text",
- custom: {},
- timeout: 6e4,
- sslVerify: true,
- firstIpv4: false,
- validateStatus: function validateStatus(status) {
- return status >= 200 && status < 300;
- }
- };
- var clone = function() {
- function _instanceof(obj, type2) {
- return type2 != null && obj instanceof type2;
- }
- 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(parent, circular, depth, prototype, includeNonEnumerable) {
- if (typeof circular === "object") {
- depth = circular.depth;
- prototype = 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(parent2, depth2) {
- if (parent2 === null)
- return null;
- if (depth2 === 0)
- return parent2;
- var child;
- var proto;
- if (typeof parent2 != "object") {
- return parent2;
- }
- if (_instanceof(parent2, nativeMap)) {
- child = new nativeMap();
- } else if (_instanceof(parent2, nativeSet)) {
- child = new nativeSet();
- } else if (_instanceof(parent2, nativePromise)) {
- child = new nativePromise(function(resolve, reject) {
- parent2.then(function(value2) {
- resolve(_clone(value2, depth2 - 1));
- }, function(err) {
- reject(_clone(err, depth2 - 1));
- });
- });
- } else if (clone2.__isArray(parent2)) {
- child = [];
- } else if (clone2.__isRegExp(parent2)) {
- child = new RegExp(parent2.source, __getRegExpFlags(parent2));
- if (parent2.lastIndex)
- child.lastIndex = parent2.lastIndex;
- } else if (clone2.__isDate(parent2)) {
- child = new Date(parent2.getTime());
- } else if (useBuffer && Buffer.isBuffer(parent2)) {
- if (Buffer.from) {
- child = Buffer.from(parent2);
- } else {
- child = new Buffer(parent2.length);
- parent2.copy(child);
- }
- return child;
- } else if (_instanceof(parent2, Error)) {
- child = Object.create(parent2);
- } else {
- if (typeof prototype == "undefined") {
- proto = Object.getPrototypeOf(parent2);
- child = Object.create(proto);
- } else {
- child = Object.create(prototype);
- proto = prototype;
- }
- }
- if (circular) {
- var index2 = allParents.indexOf(parent2);
- if (index2 != -1) {
- return allChildren[index2];
- }
- allParents.push(parent2);
- allChildren.push(child);
- }
- if (_instanceof(parent2, nativeMap)) {
- parent2.forEach(function(value2, key) {
- var keyChild = _clone(key, depth2 - 1);
- var valueChild = _clone(value2, depth2 - 1);
- child.set(keyChild, valueChild);
- });
- }
- if (_instanceof(parent2, nativeSet)) {
- parent2.forEach(function(value2) {
- var entryChild = _clone(value2, depth2 - 1);
- child.add(entryChild);
- });
- }
- for (var i2 in parent2) {
- var attrs = Object.getOwnPropertyDescriptor(parent2, i2);
- if (attrs) {
- child[i2] = _clone(parent2[i2], depth2 - 1);
- }
- try {
- var objProperty = Object.getOwnPropertyDescriptor(parent2, i2);
- if (objProperty.set === "undefined") {
- continue;
- }
- child[i2] = _clone(parent2[i2], depth2 - 1);
- } catch (e2) {
- if (e2 instanceof TypeError) {
- continue;
- } else if (e2 instanceof ReferenceError) {
- continue;
- }
- }
- }
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(parent2);
- for (var i2 = 0; i2 < symbols.length; i2++) {
- var symbol = symbols[i2];
- var descriptor = Object.getOwnPropertyDescriptor(parent2, symbol);
- if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
- continue;
- }
- child[symbol] = _clone(parent2[symbol], depth2 - 1);
- Object.defineProperty(child, symbol, descriptor);
- }
- }
- if (includeNonEnumerable) {
- var allPropertyNames = Object.getOwnPropertyNames(parent2);
- for (var i2 = 0; i2 < allPropertyNames.length; i2++) {
- var propertyName = allPropertyNames[i2];
- var descriptor = Object.getOwnPropertyDescriptor(parent2, propertyName);
- if (descriptor && descriptor.enumerable) {
- continue;
- }
- child[propertyName] = _clone(parent2[propertyName], depth2 - 1);
- Object.defineProperty(child, propertyName, descriptor);
- }
- }
- return child;
- }
- return _clone(parent, depth);
- }
- clone2.clonePrototype = function clonePrototype(parent) {
- if (parent === null)
- return null;
- var c2 = function() {
- };
- c2.prototype = parent;
- 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;
- }();
- 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(arg)) {
- arg = {};
- formatAppLog("warn", "at uni_modules/uview-plus/libs/luch-request/core/Request.js:40", "设置全局参数必须接收一个Object");
- }
- this.config = clone({ ...defaults, ...arg });
- this.interceptors = {
- request: new InterceptorManager(),
- response: new InterceptorManager()
- };
- }
- /**
- * @Function
- * @param {Request~setConfigCallback} f - 设置全局默认配置
- */
- setConfig(f2) {
- this.config = f2(this.config);
- }
- middleware(config2) {
- config2 = mergeConfig(this.config, config2);
- const chain = [dispatchRequest, void 0];
- let promise2 = Promise.resolve(config2);
- this.interceptors.request.forEach((interceptor2) => {
- chain.unshift(interceptor2.fulfilled, interceptor2.rejected);
- });
- this.interceptors.response.forEach((interceptor2) => {
- chain.push(interceptor2.fulfilled, interceptor2.rejected);
- });
- while (chain.length) {
- promise2 = promise2.then(chain.shift(), chain.shift());
- }
- return promise2;
- }
- /**
- * @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);
- }
- }
- const http = new Request();
- function email(value2) {
- return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value2);
- }
- function mobile(value2) {
- return /^1[23456789]\d{9}$/.test(value2);
- }
- function url(value2) {
- 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(value2);
- }
- function date(value2) {
- if (!value2)
- return false;
- if (typeof value2 === "number") {
- if (value2.toString().length !== 10 && value2.toString().length !== 13) {
- return false;
- }
- return !isNaN(new Date(value2).getTime());
- }
- if (typeof value2 === "string") {
- const numV = Number(value2);
- if (!isNaN(numV)) {
- if (numV.toString().length === 10 || numV.toString().length === 13) {
- return !isNaN(new Date(numV).getTime());
- }
- }
- if (value2.length < 10 || value2.length > 19) {
- return false;
- }
- const dateRegex = /^\d{4}[-\/]\d{2}[-\/]\d{2}( \d{1,2}:\d{2}(:\d{2})?)?$/;
- if (!dateRegex.test(value2)) {
- return false;
- }
- const dateValue = new Date(value2);
- return !isNaN(dateValue.getTime());
- }
- return false;
- }
- function dateISO(value2) {
- return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value2);
- }
- function number(value2) {
- return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value2);
- }
- function string$1(value2) {
- return typeof value2 === "string";
- }
- function digits(value2) {
- return /^\d+$/.test(value2);
- }
- function idCard(value2) {
- 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(
- value2
- );
- }
- function carNo(value2) {
- 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 (value2.length === 7) {
- return creg.test(value2);
- }
- if (value2.length === 8) {
- return xreg.test(value2);
- }
- return false;
- }
- function amount(value2) {
- return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value2);
- }
- function chinese(value2) {
- const reg = /^[\u4e00-\u9fa5]+$/gi;
- return reg.test(value2);
- }
- function letter(value2) {
- return /^[a-zA-Z]*$/.test(value2);
- }
- function enOrNum(value2) {
- const reg = /^[0-9a-zA-Z]*$/g;
- return reg.test(value2);
- }
- function contains(value2, param) {
- return value2.indexOf(param) >= 0;
- }
- function range$2(value2, param) {
- return value2 >= param[0] && value2 <= param[1];
- }
- function rangeLength(value2, param) {
- return value2.length >= param[0] && value2.length <= param[1];
- }
- function landline(value2) {
- const reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
- return reg.test(value2);
- }
- function empty(value2) {
- switch (typeof value2) {
- case "undefined":
- return true;
- case "string":
- if (value2.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, "").length == 0)
- return true;
- break;
- case "boolean":
- if (!value2)
- return true;
- break;
- case "number":
- if (value2 === 0 || isNaN(value2))
- return true;
- break;
- case "object":
- if (value2 === null || value2.length === 0)
- return true;
- for (const i2 in value2) {
- return false;
- }
- return true;
- }
- return false;
- }
- function jsonString(value2) {
- if (typeof value2 === "string") {
- try {
- const obj = JSON.parse(value2);
- if (typeof obj === "object" && obj) {
- return true;
- }
- return false;
- } catch (e2) {
- return false;
- }
- }
- return false;
- }
- function array(value2) {
- if (typeof Array.isArray === "function") {
- return Array.isArray(value2);
- }
- return Object.prototype.toString.call(value2) === "[object Array]";
- }
- function object(value2) {
- return Object.prototype.toString.call(value2) === "[object Object]";
- }
- function objectPromise(value2) {
- return Object.prototype.toString.call(value2) === "[object Promise]";
- }
- function code(value2, len = 6) {
- return new RegExp(`^\\d{${len}}$`).test(value2);
- }
- function func(value2) {
- return typeof value2 === "function";
- }
- function promise(value2) {
- return objectPromise(value2) && func(value2.then) && func(value2.catch);
- }
- function image(value2) {
- const newValue = value2.split("?")[0];
- const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
- return IMAGE_REGEXP.test(newValue);
- }
- function video(value2) {
- const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i;
- return VIDEO_REGEXP.test(value2);
- }
- function regExp(o2) {
- return o2 && Object.prototype.toString.call(o2) === "[object RegExp]";
- }
- const test = {
- email,
- mobile,
- url,
- date,
- dateISO,
- number,
- digits,
- idCard,
- carNo,
- amount,
- chinese,
- letter,
- enOrNum,
- contains,
- range: range$2,
- rangeLength,
- empty,
- isEmpty: empty,
- jsonString,
- landline,
- object,
- array,
- code,
- func,
- promise,
- video,
- image,
- regExp,
- string: string$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 uni_modules/uview-plus/libs/function/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$1(...nums) {
- if (nums.length > 2) {
- return iteratorOperation(nums, times$1);
- }
- 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$1(num1Changed / num2Changed, strip(Math.pow(10, digitLength(num2) - digitLength(num1))));
- }
- function round(num, ratio) {
- const base = Math.pow(10, ratio);
- let result = divide(Math.round(Math.abs(times$1(num, base))), base);
- if (num < 0 && result !== 0) {
- result = times$1(result, -1);
- }
- return result;
- }
- function range$1(min = 0, max = 0, value2 = 0) {
- return Math.max(min, Math.min(max, Number(value2)));
- }
- function getPx(value2, unit = false) {
- if (number(value2)) {
- return unit ? `${value2}px` : Number(value2);
- }
- if (/(rpx|upx)$/.test(value2)) {
- return unit ? `${uni.upx2px(parseInt(value2))}px` : Number(uni.upx2px(parseInt(value2)));
- }
- return unit ? `${parseInt(value2)}px` : parseInt(value2);
- }
- function sleep(value2 = 30) {
- return new Promise((resolve) => {
- setTimeout(() => {
- resolve();
- }, value2);
- });
- }
- function os() {
- return uni.getDeviceInfo().platform.toLowerCase();
- }
- function sys() {
- return uni.getSystemInfoSync();
- }
- function getWindowInfo() {
- let ret = {};
- ret = uni.getWindowInfo();
- return ret;
- }
- function getDeviceInfo() {
- let ret = {};
- ret = uni.getDeviceInfo();
- return ret;
- }
- 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 parent = this.$parent;
- while (parent) {
- name2 = name2.replace(/up-([a-zA-Z0-9-_]+)/g, "u-$1");
- if (parent.$options && parent.$options.name !== name2) {
- parent = parent.$parent;
- } else {
- return parent;
- }
- }
- return false;
- }
- function addStyle(customStyle, target = "object") {
- if (empty(customStyle) || typeof customStyle === "object" && target === "object" || target === "string" && typeof customStyle === "string") {
- return customStyle;
- }
- if (target === "object") {
- customStyle = trim(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(item[0])] = trim(item[1]);
- }
- }
- return style;
- }
- let string2 = "";
- if (typeof customStyle === "object") {
- customStyle.forEach((val, i2) => {
- const key = i2.replace(/([A-Z])/g, "-$1").toLowerCase();
- string2 += `${key}:${val};`;
- });
- }
- return trim(string2);
- }
- function addUnit(value2 = "auto", unit = "") {
- if (!unit) {
- unit = config$1.unit || "px";
- }
- if (unit == "rpx" && number(String(value2))) {
- value2 = value2 * 2;
- }
- value2 = String(value2);
- return number(value2) ? `${value2}${unit}` : value2;
- }
- function deepClone(obj) {
- if ([null, void 0, NaN, false].includes(obj))
- return obj;
- if (typeof obj !== "object" && typeof obj !== "function") {
- return obj;
- }
- const o2 = 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$1(targetOrigin = {}, source = {}) {
- let target = deepClone(targetOrigin);
- if (typeof target !== "object" || typeof source !== "object")
- return false;
- for (const prop in source) {
- if (!source.hasOwnProperty(prop))
- continue;
- if (prop in target) {
- if (source[prop] == null) {
- target[prop] = source[prop];
- } else 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$1(target[prop], source[prop]);
- }
- } else {
- target[prop] = source[prop];
- }
- }
- return target;
- }
- function shallowMerge(target, source = {}) {
- if (typeof target !== "object" || typeof source !== "object")
- return false;
- for (const prop in source) {
- if (!source.hasOwnProperty(prop))
- continue;
- if (prop in target) {
- if (source[prop] == null) {
- target[prop] = source[prop];
- } else 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] = shallowMerge(target[prop], source[prop]);
- }
- } else {
- target[prop] = source[prop];
- }
- }
- return target;
- }
- function error(err) {
- {
- formatAppLog("error", "at uni_modules/uview-plus/libs/function/index.js:304", `uView提示:${err}`);
- }
- }
- function randomArray(array3 = []) {
- return array3.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 date3;
- if (!dateTime) {
- date3 = /* @__PURE__ */ new Date();
- } else if (/^\d{10}$/.test(dateTime.toString().trim())) {
- date3 = new Date(dateTime * 1e3);
- } else if (typeof dateTime === "string" && /^\d+$/.test(dateTime.trim())) {
- date3 = new Date(Number(dateTime));
- } else if (typeof dateTime === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(dateTime)) {
- date3 = new Date(dateTime);
- } else {
- date3 = new Date(
- typeof dateTime === "string" ? dateTime.replace(/-/g, "/") : dateTime
- );
- }
- const timeSource = {
- "y": date3.getFullYear().toString(),
- // 年
- "m": (date3.getMonth() + 1).toString().padStart(2, "0"),
- // 月
- "d": date3.getDate().toString().padStart(2, "0"),
- // 日
- "h": date3.getHours().toString().padStart(2, "0"),
- // 时
- "M": date3.getMinutes().toString().padStart(2, "0"),
- // 分
- "s": date3.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 timer = (/* @__PURE__ */ new Date()).getTime() - timestamp;
- timer = parseInt(timer / 1e3);
- let tips = "";
- switch (true) {
- case timer < 300:
- tips = "刚刚";
- break;
- case (timer >= 300 && timer < 3600):
- tips = `${parseInt(timer / 60)}分钟前`;
- break;
- case (timer >= 3600 && timer < 86400):
- tips = `${parseInt(timer / 3600)}小时前`;
- break;
- case (timer >= 86400 && timer < 2592e3):
- tips = `${parseInt(timer / 86400)}天前`;
- break;
- default:
- if (format2 === false) {
- if (timer >= 2592e3 && timer < 365 * 86400) {
- tips = `${parseInt(timer / (86400 * 30))}个月前`;
- } else {
- tips = `${parseInt(timer / (86400 * 365))}年前`;
- }
- } else {
- tips = timeFormat(timestamp, format2);
- }
- }
- return tips;
- }
- function trim(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 value2 = data[key];
- if (["", void 0, null].indexOf(value2) >= 0) {
- continue;
- }
- if (value2.constructor === Array) {
- switch (arrayFormat) {
- case "indices":
- for (let i2 = 0; i2 < value2.length; i2++) {
- _result.push(`${key}[${i2}]=${value2[i2]}`);
- }
- break;
- case "brackets":
- value2.forEach((_value) => {
- _result.push(`${key}[]=${_value}`);
- });
- break;
- case "repeat":
- value2.forEach((_value) => {
- _result.push(`${key}=${_value}`);
- });
- break;
- case "comma":
- let commaStr = "";
- value2.forEach((_value) => {
- commaStr += (commaStr ? "," : "") + _value;
- });
- _result.push(`${key}=${commaStr}`);
- break;
- default:
- value2.forEach((_value) => {
- _result.push(`${key}[]=${_value}`);
- });
- }
- } else {
- _result.push(`${key}=${value2}`);
- }
- }
- return _result.length ? prefix + _result.join("&") : "";
- }
- function toast(title, duration = 2e3) {
- uni.showToast({
- title: String(title),
- icon: "none",
- duration
- });
- }
- function type2icon(type2 = "success", fill = false) {
- if (["primary", "info", "error", "warning", "success"].indexOf(type2) == -1)
- type2 = "success";
- let iconName = "";
- switch (type2) {
- 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(number3, decimals = 0, decimalPoint = ".", thousandsSeparator = ",") {
- number3 = `${number3}`.replace(/[^0-9+-Ee.]/g, "");
- const n2 = !isFinite(+number3) ? 0 : +number3;
- 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(value2, unit = true) {
- const valueNum = parseInt(value2);
- if (unit) {
- if (/s$/.test(value2))
- return value2;
- return value2 > 30 ? `${value2}ms` : `${value2}s`;
- }
- if (/ms$/.test(value2))
- return valueNum;
- if (/s$/.test(value2))
- return valueNum > 30 ? valueNum : valueNum * 1e3;
- return valueNum;
- }
- function padZero$1(value2) {
- return `00${value2}`.slice(-2);
- }
- function formValidate(instance, event) {
- const formItem = $parent.call(instance, "u-form-item");
- const form = $parent.call(instance, "u-form");
- if (formItem && form) {
- form.validateField(formItem.prop, () => {
- }, event);
- }
- }
- function getProperty(obj, key) {
- if (typeof obj !== "object" || null == 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, value2) {
- if (typeof obj !== "object" || null == obj) {
- return;
- }
- const inFn = function(_obj, keys, v2) {
- if (keys.length === 1) {
- _obj[keys[0]] = v2;
- return;
- }
- while (keys.length > 1) {
- const k2 = keys[0];
- if (!_obj[k2] || typeof _obj[k2] !== "object") {
- _obj[k2] = {};
- }
- keys.shift();
- inFn(_obj[k2], keys, v2);
- }
- };
- if (typeof key !== "string" || key === "")
- ;
- else if (key.indexOf(".") !== -1) {
- const keys = key.split(".");
- inFn(obj, keys, value2);
- } else {
- obj[key] = value2;
- }
- }
- function page() {
- const pages2 = getCurrentPages();
- return `/${pages2[pages2.length - 1].route || ""}`;
- }
- function pages() {
- const pages2 = getCurrentPages();
- return pages2;
- }
- function getValueByPath(obj, path) {
- const pathArr = path.split(".");
- return pathArr.reduce((acc, curr) => {
- return acc && acc[curr] !== void 0 ? acc[curr] : void 0;
- }, obj);
- }
- function genLightColor(textColor, lightness = 95) {
- const rgb = parseColorWithoutDOM(textColor);
- const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);
- const bgHsl = {
- h: hsl.h,
- s: hsl.s,
- l: Math.min(lightness, 95)
- };
- return hslToHex(bgHsl.h, bgHsl.s, bgHsl.l);
- }
- function parseColorWithoutDOM(colorStr) {
- const str = colorStr.toLowerCase().trim();
- if (str.startsWith("#")) {
- const hex = str.replace("#", "");
- const fullHex = hex.length === 3 ? hex.split("").map((c2) => c2 + c2).join("") : hex;
- return {
- r: parseInt(fullHex.substring(0, 2), 16),
- g: parseInt(fullHex.substring(2, 4), 16),
- b: parseInt(fullHex.substring(4, 6), 16)
- };
- }
- const rgbMatch = str.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
- if (rgbMatch) {
- return {
- r: +rgbMatch[1],
- g: +rgbMatch[2],
- b: +rgbMatch[3]
- };
- }
- throw new Error("Invalid color format");
- }
- function rgbToHsl(r2, g2, b2) {
- r2 /= 255, g2 /= 255, b2 /= 255;
- const max = Math.max(r2, g2, b2), min = Math.min(r2, g2, b2);
- let h2, s2, l2 = (max + min) / 2;
- if (max === min) {
- h2 = s2 = 0;
- } else {
- const d2 = max - min;
- s2 = l2 > 0.5 ? d2 / (2 - max - min) : d2 / (max + min);
- switch (max) {
- case r2:
- h2 = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0);
- break;
- case g2:
- h2 = (b2 - r2) / d2 + 2;
- break;
- case b2:
- h2 = (r2 - g2) / d2 + 4;
- break;
- }
- h2 = (h2 * 60).toFixed(1);
- }
- return { h: +h2, s: +(s2 * 100).toFixed(1), l: +(l2 * 100).toFixed(1) };
- }
- function hslToHex(h2, s2, l2) {
- l2 /= 100;
- const a2 = s2 * Math.min(l2, 1 - l2) / 100;
- const f2 = (n2) => {
- const k2 = (n2 + h2 / 30) % 12;
- const color2 = l2 - a2 * Math.max(Math.min(k2 - 3, 9 - k2, 1), -1);
- return Math.round(255 * color2).toString(16).padStart(2, "0");
- };
- return `#${f2(0)}${f2(8)}${f2(4)}`;
- }
- const index = {
- range: range$1,
- getPx,
- sleep,
- os,
- sys,
- getWindowInfo,
- random,
- guid,
- $parent,
- addStyle,
- addUnit,
- deepClone,
- deepMerge: deepMerge$1,
- shallowMerge,
- error,
- randomArray,
- timeFormat,
- timeFrom,
- trim,
- queryParams,
- toast,
- type2icon,
- priceFormat,
- getDuration,
- padZero: padZero$1,
- formValidate,
- getProperty,
- setProperty,
- page,
- pages,
- getValueByPath,
- genLightColor
- };
- const ActionSheet = {
- // action-sheet组件
- actionSheet: {
- show: false,
- title: "",
- description: "",
- actions: [],
- index: "",
- cancelText: "",
- closeOnClickAction: true,
- safeAreaInsetBottom: true,
- openType: "",
- closeOnClickOverlay: true,
- round: 0,
- wrapMaxHeight: "600px"
- }
- };
- const Album = {
- // album 组件
- album: {
- urls: [],
- keyName: "",
- singleSize: 180,
- multipleSize: 70,
- space: 6,
- singleMode: "scaleToFill",
- multipleMode: "aspectFill",
- maxCount: 9,
- previewFullImage: true,
- rowCount: 3,
- showMore: true,
- autoWrap: false,
- unit: "px",
- stop: true
- }
- };
- const Alert = {
- // alert警告组件
- alert: {
- title: "",
- type: "warning",
- description: "",
- closable: false,
- showIcon: false,
- effect: "light",
- center: false,
- fontSize: 14,
- transitionMode: "fade",
- duration: 0,
- icon: "",
- value: true
- }
- };
- const Avatar = {
- // avatar 组件
- avatar: {
- src: "",
- shape: "circle",
- size: 40,
- mode: "scaleToFill",
- text: "",
- bgColor: "#c0c4cc",
- color: "#ffffff",
- fontSize: 18,
- icon: "",
- mpAvatar: false,
- randomBgColor: false,
- defaultUrl: "",
- colorIndex: "",
- name: ""
- }
- };
- const AvatarGroup = {
- // avatarGroup 组件
- avatarGroup: {
- urls: [],
- maxCount: 5,
- shape: "circle",
- mode: "scaleToFill",
- showMore: true,
- size: 40,
- keyName: "",
- gap: 0.5,
- extraValue: 0
- }
- };
- const Backtop = {
- // backtop组件
- backtop: {
- mode: "circle",
- icon: "arrow-upward",
- text: "",
- duration: 100,
- scrollTop: 0,
- top: 400,
- bottom: 100,
- right: 20,
- zIndex: 9,
- iconStyle: {
- color: "#909399",
- fontSize: "19px"
- }
- }
- };
- const Badge = {
- // 徽标数组件
- badge: {
- isDot: false,
- value: "",
- show: true,
- max: 999,
- type: "error",
- showZero: false,
- bgColor: null,
- color: null,
- shape: "circle",
- numberType: "overflow",
- offset: [],
- inverted: false,
- absolute: false
- }
- };
- const Button = {
- // button组件
- button: {
- hairline: false,
- type: "info",
- size: "normal",
- shape: "square",
- plain: false,
- disabled: false,
- loading: false,
- loadingText: "",
- loadingMode: "spinner",
- loadingSize: 15,
- openType: "",
- formType: "",
- appParameter: "",
- hoverStopPropagation: true,
- lang: "en",
- sessionFrom: "",
- sendMessageTitle: "",
- sendMessagePath: "",
- sendMessageImg: "",
- showMessageCard: false,
- dataName: "",
- throttleTime: 0,
- hoverStartTime: 0,
- hoverStayTime: 200,
- text: "",
- icon: "",
- iconColor: "",
- color: "",
- stop: true
- }
- };
- const zhHans = {
- "up.common.cancel": "取消",
- "up.common.confirm": "确定",
- "up.common.start": "开始",
- "up.common.end": "结束",
- "up.common.stop": "停止",
- "up.common.copy": "复制",
- "up.common.none": "暂无",
- "up.common.tip": "提示",
- "up.common.success": "成功",
- "up.common.fail": "失败",
- "up.common.close": "关闭",
- "up.common.preview": "预览",
- "up.common.re-select": "重选",
- "up.common.rotate": "旋转",
- "up.common.pleaseChoose": "请选择",
- "up.common.loading": "加载中",
- "up.common.loading2": "正在加载",
- "up.common.inOperation": "操作中",
- "up.common.settings": "设置",
- "up.common.retry": "重试",
- "up.common.search": "搜索",
- "up.common.more": "更多",
- "up.common.video": "视频",
- "up.common.file": "文件",
- "up.week.one": "一",
- "up.week.two": "二",
- "up.week.three": "三",
- "up.week.four": "四",
- "up.week.five": "五",
- "up.week.six": "六",
- "up.week.seven": "日",
- "up.barcode.error": "生成条码失败",
- "up.calendar.chooseDates": "日期选择",
- "up.calendar.disabled": "该日期已禁用",
- "up.calendar.daysExceed": "选择天数不能超过{days}天",
- "up.cityLocate.locateCity": "定位城市",
- "up.cityLocate.fail": "定位失败,请点击重试。",
- "up.cityLocate.locating": "定位中",
- "up.code.send": "获取验证码",
- "up.code.resendAfter": "X秒重新获取",
- "up.code.resend": "重新获取",
- "up.cropper.emptyWidhtOrHeight": "裁剪框的宽或高没有设置",
- "up.empty.car": "购物车为空",
- "up.empty.page": "页面不存在",
- "up.empty.search": "没有搜索结果",
- "up.empty.address": "没有收货地址",
- "up.empty.wifi": "没有WiFi",
- "up.empty.order": "订单为空",
- "up.empty.coupon": "没有优惠券",
- "up.empty.favor": "暂无收藏",
- "up.empty.permission": "无权限",
- "up.empty.history": "无历史记录",
- "up.empty.news": "无新闻列表",
- "up.empty.message": "消息列表为空",
- "up.empty.list": "列表为空",
- "up.empty.data": "数据为空",
- "up.empty.comment": "暂无评论",
- "up.link.copyed": "链接已复制,请在浏览器打开",
- "up.loadmoe.loadmore": "加载更多",
- "up.loadmoe.nomore": "没有更多了",
- "up.noNetwork.text": "哎呀,网络信号丢失",
- "up.noNetwork.pleaseCheck": "请检查网络,或前往",
- "up.noNetwork.connect": "网络已连接",
- "up.noNetwork.disconnect": "无网络连接",
- "up.pagination.previous": "上一页",
- "up.pagination.next": "下一页",
- "up.pullRefresh.pull": "下拉刷新",
- "up.pullRefresh.release": "释放刷新",
- "up.pullRefresh.refreshing": "正在刷新",
- "up.readMore.expand": "展开阅读全文",
- "up.readMore.fold": "收起",
- "up.search.placeholder": "请输入关键字",
- "up.signature.penSize": "笔画大小",
- "up.signature.penColor": "笔画颜色",
- "up.upload.sizeExceed": "超过大小限制",
- "up.upload.uploading": "上传中",
- "up.upload.previewImageFail": "预览图片失败",
- "up.upload.previewVideoFail": "预览视频失败"
- };
- const zhHant = {
- "up.common.cancel": "取消",
- "up.common.confirm": "确定",
- "up.common.start": "開始",
- "up.common.end": "結束",
- "up.common.stop": "停止",
- "up.common.copy": "複製",
- "up.common.none": "暫無",
- "up.common.tip": "提示",
- "up.common.success": "成功",
- "up.common.fail": "失敗",
- "up.common.close": "關閉",
- "up.common.preview": "預覽",
- "up.common.re-select": "重選",
- "up.common.rotate": "旋轉",
- "up.common.pleaseChoose": "請選擇",
- "up.common.loading": "加載中",
- "up.common.loading2": "正在加載",
- "up.common.inOperation": "操作中",
- "up.common.settings": "設置",
- "up.common.retry": "重試",
- "up.common.search": "搜索",
- "up.common.more": "更多",
- "up.common.video": "視頻",
- "up.common.file": "文件",
- "up.week.one": "一",
- "up.week.two": "二",
- "up.week.three": "三",
- "up.week.four": "四",
- "up.week.five": "五",
- "up.week.six": "六",
- "up.week.seven": "日",
- "up.barcode.error": "生成條碼失敗",
- "up.calendar.chooseDates": "日期選擇",
- "up.calendar.disabled": "該日期已禁用",
- "up.calendar.daysExceed": "選擇天數不能超過{days}天",
- "up.cityLocate.locateCity": "定位城市",
- "up.cityLocate.fail": "定位失敗,請點擊重試。",
- "up.cityLocate.locating": "定位中",
- "up.code.send": "獲取驗證碼",
- "up.code.resendAfter": "X秒重新獲取",
- "up.code.resend": "重新獲取",
- "up.cropper.emptyWidhtOrHeight": "裁剪框的寬或高沒有設置",
- "up.empty.car": "購物車為空",
- "up.empty.page": "頁面不存在",
- "up.empty.search": "沒有搜索結果",
- "up.empty.address": "沒有收貨地址",
- "up.empty.wifi": "沒有WiFi",
- "up.empty.order": "訂單為空",
- "up.empty.coupon": "沒有優惠券",
- "up.empty.favor": "暫無收藏",
- "up.empty.permission": "無權限",
- "up.empty.history": "無歷史記錄",
- "up.empty.news": "無新聞列表",
- "up.empty.message": "消息列表為空",
- "up.empty.list": "列表為空",
- "up.empty.data": "數據為空",
- "up.empty.comment": "暫無評論",
- "up.link.copyed": "鏈接已複製,請在瀏覽器打開",
- "up.loadmoe.loadmore": "加載更多",
- "up.loadmoe.nomore": "沒有更多了",
- "up.noNetwork.text": "哎呀,網絡信號丟失",
- "up.noNetwork.pleaseCheck": "請檢查網絡,或前往",
- "up.noNetwork.connect": "網絡已連接",
- "up.noNetwork.disconnect": "無網絡連接",
- "up.pagination.previous": "上一頁",
- "up.pagination.next": "下一頁",
- "up.pullRefresh.pull": "下拉刷新",
- "up.pullRefresh.release": "釋放刷新",
- "up.pullRefresh.refreshing": "正在刷新",
- "up.readMore.expand": "展開閱讀全文",
- "up.readMore.fold": "收起",
- "up.search.placeholder": "請輸入關鍵字",
- "up.signature.penSize": "筆畫大小",
- "up.signature.penColor": "筆畫顏色",
- "up.upload.sizeExceed": "超過大小限制",
- "up.upload.uploading": "上傳中",
- "up.upload.previewImageFail": "預覽圖片失敗",
- "up.upload.previewVideoFail": "預覽視頻失敗"
- };
- const en = {
- "up.common.cancel": "Cancel",
- "up.common.confirm": "Confirm",
- "up.common.start": "Start",
- "up.common.end": "End",
- "up.common.stop": "Stop",
- "up.common.copy": "Copy",
- "up.common.none": "None",
- "up.common.tip": "Tip",
- "up.common.success": "Success",
- "up.common.fail": "Fail",
- "up.common.close": "Close",
- "up.common.preview": "Preview",
- "up.common.re-select": "Re-select",
- "up.common.rotate": "Rotate",
- "up.common.pleaseChoose": "Please choose",
- "up.common.loading": "Loading",
- "up.common.loading2": "Loading",
- "up.common.inOperation": "In operation",
- "up.common.settings": "Settings",
- "up.common.retry": "Retry",
- "up.common.search": "Search",
- "up.common.more": "More",
- "up.common.video": "Video",
- "up.common.file": "File",
- "up.week.one": "Mon",
- "up.week.two": "Tue",
- "up.week.three": "Wed",
- "up.week.four": "Thu",
- "up.week.five": "Fri",
- "up.week.six": "Sat",
- "up.week.seven": "Sun",
- "up.barcode.error": "Failed to generate barcode",
- "up.calendar.chooseDates": "Date selection",
- "up.calendar.disabled": "This date is disabled",
- "up.calendar.daysExceed": "The number of selected days cannot exceed {days} days",
- "up.cityLocate.locateCity": "Locate city",
- "up.cityLocate.fail": "Location failed, please click to retry.",
- "up.cityLocate.locating": "Locating",
- "up.code.send": "Get verification code",
- "up.code.resendAfter": "Resend after X seconds",
- "up.code.resend": "Resend",
- "up.cropper.emptyWidhtOrHeight": "The width or height of the cropping box is not set",
- "up.empty.car": "Shopping cart is empty",
- "up.empty.page": "Page not found",
- "up.empty.search": "No search results",
- "up.empty.address": "No shipping address",
- "up.empty.wifi": "No WiFi",
- "up.empty.order": "Order is empty",
- "up.empty.coupon": "No coupons",
- "up.empty.favor": "No favorites",
- "up.empty.permission": "No permission",
- "up.empty.history": "No history",
- "up.empty.news": "No news list",
- "up.empty.message": "Message list is empty",
- "up.empty.list": "List is empty",
- "up.empty.data": "Data is empty",
- "up.empty.comment": "No comments",
- "up.link.copyed": "Link copied, please open in browser",
- "up.loadmoe.loadmore": "Load more",
- "up.loadmoe.nomore": "No more",
- "up.noNetwork.text": "Oops, network signal lost",
- "up.noNetwork.pleaseCheck": "Please check the network, or go to",
- "up.noNetwork.connect": "Network connected",
- "up.noNetwork.disconnect": "No network connection",
- "up.pagination.previous": "Previous",
- "up.pagination.next": "Next",
- "up.pullRefresh.pull": "Pull to refresh",
- "up.pullRefresh.release": "Release to refresh",
- "up.pullRefresh.refreshing": "Refreshing",
- "up.readMore.expand": "Expand to read more",
- "up.readMore.fold": "Collapse",
- "up.search.placeholder": "Please enter keywords",
- "up.signature.penSize": "Stroke size",
- "up.signature.penColor": "Stroke color",
- "up.upload.sizeExceed": "Size limit exceeded",
- "up.upload.uploading": "Uploading",
- "up.upload.previewImageFail": "Failed to preview image",
- "up.upload.previewVideoFail": "Failed to preview video"
- };
- const es = {
- "up.common.cancel": "Cancelar",
- "up.common.confirm": "Confirmar",
- "up.common.start": "Iniciar",
- "up.common.end": "Finalizar",
- "up.common.stop": "Detener",
- "up.common.copy": "Copiar",
- "up.common.none": "Ninguno",
- "up.common.tip": "Consejo",
- "up.common.success": "Éxito",
- "up.common.fail": "Fallido",
- "up.common.close": "Cerrar",
- "up.common.preview": "Vista previa",
- "up.common.re-select": "Re seleccionar",
- "up.common.rotate": "Rotar",
- "up.common.pleaseChoose": "Por favor seleccione",
- "up.common.loading": "Cargando",
- "up.common.loading2": "Cargando",
- "up.common.inOperation": "En operación",
- "up.common.settings": "Configuración",
- "up.common.retry": "Reintentar",
- "up.common.search": "Buscar",
- "up.common.more": "Más",
- "up.common.video": "Vídeo",
- "up.common.file": "Archivo",
- "up.week.one": "Lun",
- "up.week.two": "Mar",
- "up.week.three": "Mié",
- "up.week.four": "Jue",
- "up.week.five": "Vie",
- "up.week.six": "Sáb",
- "up.week.seven": "Dom",
- "up.barcode.error": "Error al generar código de barras",
- "up.calendar.chooseDates": "Selección de fecha",
- "up.calendar.disabled": "Esta fecha está deshabilitada",
- "up.calendar.daysExceed": "Los días seleccionados no pueden exceder {days} días",
- "up.cityLocate.locateCity": "Localizar ciudad",
- "up.cityLocate.fail": "Error de localización, haga clic para reintentar.",
- "up.cityLocate.locating": "Localizando",
- "up.code.send": "Obtener código de verificación",
- "up.code.resendAfter": "Reenviar en X segundos",
- "up.code.resend": "Reenviar",
- "up.cropper.emptyWidhtOrHeight": "El ancho o alto del recorte no está configurado",
- "up.empty.car": "Carrito de compras vacío",
- "up.empty.page": "Página no encontrada",
- "up.empty.search": "Sin resultados de búsqueda",
- "up.empty.address": "Sin dirección de envío",
- "up.empty.wifi": "Sin WiFi",
- "up.empty.order": "Pedido vacío",
- "up.empty.coupon": "Sin cupones",
- "up.empty.favor": "Sin favoritos",
- "up.empty.permission": "Sin permisos",
- "up.empty.history": "Sin historial",
- "up.empty.news": "Sin noticias",
- "up.empty.message": "Lista de mensajes vacía",
- "up.empty.list": "Lista vacía",
- "up.empty.data": "Datos vacíos",
- "up.empty.comment": "Sin comentarios",
- "up.link.copyed": "Enlace copiado, por favor abra en el navegador",
- "up.loadmoe.loadmore": "Cargar más",
- "up.loadmoe.nomore": "No hay más",
- "up.noNetwork.text": "¡Ups! Se perdió la señal de red",
- "up.noNetwork.pleaseCheck": "Por favor verifique la red, o vaya a",
- "up.noNetwork.connect": "Red conectada",
- "up.noNetwork.disconnect": "Sin conexión a internet",
- "up.pagination.previous": "Página anterior",
- "up.pagination.next": "Página siguiente",
- "up.pullRefresh.pull": "Deslizar hacia abajo para actualizar",
- "up.pullRefresh.release": "Soltar para actualizar",
- "up.pullRefresh.refreshing": "Actualizando",
- "up.readMore.expand": "Expandir para leer más",
- "up.readMore.fold": "Contraer",
- "up.search.placeholder": "Ingrese palabra clave",
- "up.signature.penSize": "Tamaño del trazo",
- "up.signature.penColor": "Color del trazo",
- "up.upload.sizeExceed": "Excede el límite de tamaño",
- "up.upload.uploading": "Subiendo",
- "up.upload.previewImageFail": "Error al previsualizar imagen",
- "up.upload.previewVideoFail": "Error al previsualizar vídeo"
- };
- const fr = {
- "up.common.cancel": "Annuler",
- "up.common.confirm": "Confirmer",
- "up.common.start": "Démarrer",
- "up.common.end": "Terminer",
- "up.common.stop": "Arrêter",
- "up.common.copy": "Copier",
- "up.common.none": "Aucun",
- "up.common.tip": "Conseil",
- "up.common.success": "Succès",
- "up.common.fail": "Échec",
- "up.common.close": "Fermer",
- "up.common.preview": "Aperçu",
- "up.common.re-select": "Resélectionner",
- "up.common.rotate": "Rotation",
- "up.common.pleaseChoose": "Veuillez choisir",
- "up.common.loading": "Chargement",
- "up.common.loading2": "Chargement en cours",
- "up.common.inOperation": "En cours d'opération",
- "up.common.settings": "Paramètres",
- "up.common.retry": "Réessayer",
- "up.common.search": "Rechercher",
- "up.common.more": "Plus",
- "up.common.video": "Vidéo",
- "up.common.file": "Fichier",
- "up.week.one": "Lun",
- "up.week.two": "Mar",
- "up.week.three": "Mer",
- "up.week.four": "Jeu",
- "up.week.five": "Ven",
- "up.week.six": "Sam",
- "up.week.seven": "Dim",
- "up.barcode.error": "Échec de génération du code-barres",
- "up.calendar.chooseDates": "Sélection de dates",
- "up.calendar.disabled": "Cette date est désactivée",
- "up.calendar.daysExceed": "Le nombre de jours sélectionnés ne peut pas dépasser {days} jours",
- "up.cityLocate.locateCity": "Localiser la ville",
- "up.cityLocate.fail": "Échec de localisation, veuillez cliquer pour réessayer.",
- "up.cityLocate.locating": "Localisation en cours",
- "up.code.send": "Obtenir le code de vérification",
- "up.code.resendAfter": "Renvoyer dans X secondes",
- "up.code.resend": "Renvoyer",
- "up.cropper.emptyWidhtOrHeight": "La largeur ou la hauteur de recadrage n'est pas définie",
- "up.empty.car": "Panier vide",
- "up.empty.page": "Page introuvable",
- "up.empty.search": "Aucun résultat de recherche",
- "up.empty.address": "Aucune adresse de livraison",
- "up.empty.wifi": "Aucun Wi-Fi",
- "up.empty.order": "Commande vide",
- "up.empty.coupon": "Aucun coupon",
- "up.empty.favor": "Aucun favori",
- "up.empty.permission": "Aucune autorisation",
- "up.empty.history": "Aucun historique",
- "up.empty.news": "Aucune actualité",
- "up.empty.message": "Liste de messages vide",
- "up.empty.list": "Liste vide",
- "up.empty.data": "Données vides",
- "up.empty.comment": "Aucun commentaire",
- "up.link.copyed": "Lien copié, veuillez ouvrir dans le navigateur",
- "up.loadmoe.loadmore": "Charger plus",
- "up.loadmoe.nomore": "Plus de contenu",
- "up.noNetwork.text": "Oups, le signal réseau est perdu",
- "up.noNetwork.pleaseCheck": "Veuillez vérifier le réseau, ou aller à",
- "up.noNetwork.connect": "Réseau connecté",
- "up.noNetwork.disconnect": "Aucune connexion réseau",
- "up.pagination.previous": "Page précédente",
- "up.pagination.next": "Page suivante",
- "up.pullRefresh.pull": "Tirer pour actualiser",
- "up.pullRefresh.release": "Relâcher pour actualiser",
- "up.pullRefresh.refreshing": "Actualisation en cours",
- "up.readMore.expand": "Développer pour lire la suite",
- "up.readMore.fold": "Réduire",
- "up.search.placeholder": "Veuillez saisir un mot-clé",
- "up.signature.penSize": "Taille du trait",
- "up.signature.penColor": "Couleur du trait",
- "up.upload.sizeExceed": "Dépassement de la limite de taille",
- "up.upload.uploading": "Téléchargement en cours",
- "up.upload.previewImageFail": "Échec de l'aperçu de l'image",
- "up.upload.previewVideoFail": "Échec de l'aperçu de la vidéo"
- };
- const de = {
- "up.common.cancel": "Abbrechen",
- "up.common.confirm": "Bestätigen",
- "up.common.start": "Start",
- "up.common.end": "Ende",
- "up.common.stop": "Stopp",
- "up.common.copy": "Kopieren",
- "up.common.none": "Keine",
- "up.common.tip": "Hinweis",
- "up.common.success": "Erfolg",
- "up.common.fail": "Fehlgeschlagen",
- "up.common.close": "Schließen",
- "up.common.preview": "Vorschau",
- "up.common.re-select": "Erneut auswählen",
- "up.common.rotate": "Drehen",
- "up.common.pleaseChoose": "Bitte wählen",
- "up.common.loading": "Laden",
- "up.common.loading2": "Wird geladen",
- "up.common.inOperation": "In Bearbeitung",
- "up.common.settings": "Einstellungen",
- "up.common.retry": "Wiederholen",
- "up.common.search": "Suchen",
- "up.common.more": "Mehr",
- "up.common.video": "Video",
- "up.common.file": "Datei",
- "up.week.one": "Mo",
- "up.week.two": "Di",
- "up.week.three": "Mi",
- "up.week.four": "Do",
- "up.week.five": "Fr",
- "up.week.six": "Sa",
- "up.week.seven": "So",
- "up.barcode.error": "Barcode-Generierung fehlgeschlagen",
- "up.calendar.chooseDates": "Datumsauswahl",
- "up.calendar.disabled": "Dieses Datum ist deaktiviert",
- "up.calendar.daysExceed": "Die Anzahl der ausgewählten Tage darf {days} Tage nicht überschreiten",
- "up.cityLocate.locateCity": "Stadt lokalisieren",
- "up.cityLocate.fail": "Lokalisierung fehlgeschlagen, bitte klicken Sie zum Wiederholen.",
- "up.cityLocate.locating": "Lokalisierung läuft",
- "up.code.send": "Bestätigungscode erhalten",
- "up.code.resendAfter": "Erneut senden in X Sekunden",
- "up.code.resend": "Erneut senden",
- "up.cropper.emptyWidhtOrHeight": "Breite oder Höhe des Zuschneidebereichs nicht festgelegt",
- "up.empty.car": "Warenkorb ist leer",
- "up.empty.page": "Seite existiert nicht",
- "up.empty.search": "Keine Suchergebnisse",
- "up.empty.address": "Keine Lieferadresse",
- "up.empty.wifi": "Kein WLAN",
- "up.empty.order": "Bestellungen sind leer",
- "up.empty.coupon": "Keine Gutscheine",
- "up.empty.favor": "Keine Favoriten",
- "up.empty.permission": "Keine Berechtigung",
- "up.empty.history": "Kein Verlauf",
- "up.empty.news": "Keine Nachrichtenliste",
- "up.empty.message": "Nachrichtenliste ist leer",
- "up.empty.list": "Liste ist leer",
- "up.empty.data": "Daten sind leer",
- "up.empty.comment": "Keine Kommentare",
- "up.link.copyed": "Link kopiert, bitte im Browser öffnen",
- "up.loadmoe.loadmore": "Mehr laden",
- "up.loadmoe.nomore": "Keine weiteren Daten",
- "up.noNetwork.text": "Ups, Netzwerksignal verloren",
- "up.noNetwork.pleaseCheck": "Bitte überprüfen Sie das Netzwerk oder gehen Sie zu",
- "up.noNetwork.connect": "Netzwerk verbunden",
- "up.noNetwork.disconnect": "Keine Netzwerkverbindung",
- "up.pagination.previous": "Vorherige Seite",
- "up.pagination.next": "Nächste Seite",
- "up.pullRefresh.pull": "Zum Aktualisieren nach unten ziehen",
- "up.pullRefresh.release": "Loslassen zum Aktualisieren",
- "up.pullRefresh.refreshing": "Aktualisierung läuft",
- "up.readMore.expand": "Erweitern zum vollständigen Lesen",
- "up.readMore.fold": "Einklappen",
- "up.search.placeholder": "Bitte Schlüsselwort eingeben",
- "up.signature.penSize": "Strichstärke",
- "up.signature.penColor": "Strichfarbe",
- "up.upload.sizeExceed": "Größenbegrenzung überschritten",
- "up.upload.uploading": "Upload läuft",
- "up.upload.previewImageFail": "Bildvorschau fehlgeschlagen",
- "up.upload.previewVideoFail": "Videovorschau fehlgeschlagen"
- };
- const ko = {
- "up.common.cancel": "취소",
- "up.common.confirm": "확인",
- "up.common.start": "시작",
- "up.common.end": "종료",
- "up.common.stop": "정지",
- "up.common.copy": "복사",
- "up.common.none": "없음",
- "up.common.tip": "팁",
- "up.common.success": "성공",
- "up.common.fail": "실패",
- "up.common.close": "닫기",
- "up.common.preview": "미리보기",
- "up.common.re-select": "재선택",
- "up.common.rotate": "회전",
- "up.common.pleaseChoose": "선택해주세요",
- "up.common.loading": "로딩중",
- "up.common.loading2": "로딩중",
- "up.common.inOperation": "작업중",
- "up.common.settings": "설정",
- "up.common.retry": "재시도",
- "up.common.search": "검색",
- "up.common.more": "더보기",
- "up.common.video": "비디오",
- "up.common.file": "파일",
- "up.week.one": "월",
- "up.week.two": "화",
- "up.week.three": "수",
- "up.week.four": "목",
- "up.week.five": "금",
- "up.week.six": "토",
- "up.week.seven": "일",
- "up.barcode.error": "바코드 생성 실패",
- "up.calendar.chooseDates": "날짜 선택",
- "up.calendar.disabled": "해당 날짜는 사용할 수 없습니다",
- "up.calendar.daysExceed": "선택한 날짜 수가 {days}일을 초과할 수 없습니다",
- "up.cityLocate.locateCity": "도시 위치 찾기",
- "up.cityLocate.fail": "위치 찾기 실패, 다시 시도하려면 클릭하세요.",
- "up.cityLocate.locating": "위치 찾는 중",
- "up.code.send": "인증코드 받기",
- "up.code.resendAfter": "X초 후 재전송",
- "up.code.resend": "재전송",
- "up.cropper.emptyWidhtOrHeight": "자르기 영역의 너비 또는 높이가 설정되지 않았습니다",
- "up.empty.car": "장바구니가 비어 있습니다",
- "up.empty.page": "페이지가 존재하지 않습니다",
- "up.empty.search": "검색 결과가 없습니다",
- "up.empty.address": "배송 주소가 없습니다",
- "up.empty.wifi": "Wi-Fi가 없습니다",
- "up.empty.order": "주문이 없습니다",
- "up.empty.coupon": "쿠폰이 없습니다",
- "up.empty.favor": "즐겨찾기가 없습니다",
- "up.empty.permission": "권한이 없습니다",
- "up.empty.history": "기록이 없습니다",
- "up.empty.news": "뉴스가 없습니다",
- "up.empty.message": "메시지가 없습니다",
- "up.empty.list": "목록이 비어 있습니다",
- "up.empty.data": "데이터가 없습니다",
- "up.empty.comment": "댓글이 없습니다",
- "up.link.copyed": "링크가 복사되었습니다. 브라우저에서 열어주세요",
- "up.loadmoe.loadmore": "더 불러오기",
- "up.loadmoe.nomore": "더 이상 데이터가 없습니다",
- "up.noNetwork.text": "네트워크 신호가 없습니다",
- "up.noNetwork.pleaseCheck": "네트워크를 확인하거나 이동하세요",
- "up.noNetwork.connect": "네트워크 연결됨",
- "up.noNetwork.disconnect": "네트워크 연결 끊김",
- "up.pagination.previous": "이전 페이지",
- "up.pagination.next": "다음 페이지",
- "up.pullRefresh.pull": "당겨서 새로고침",
- "up.pullRefresh.release": "놓아서 새로고침",
- "up.pullRefresh.refreshing": "새로고침 중",
- "up.readMore.expand": "펼쳐서 전체 보기",
- "up.readMore.fold": "접기",
- "up.search.placeholder": "키워드를 입력하세요",
- "up.signature.penSize": "선 굵기",
- "up.signature.penColor": "선 색상",
- "up.upload.sizeExceed": "용량 제한 초과",
- "up.upload.uploading": "업로드 중",
- "up.upload.previewImageFail": "이미지 미리보기 실패",
- "up.upload.previewVideoFail": "비디오 미리보기 실패"
- };
- const ja = {
- "up.common.cancel": "キャンセル",
- "up.common.confirm": "確認",
- "up.common.start": "開始",
- "up.common.end": "終了",
- "up.common.stop": "停止",
- "up.common.copy": "コピー",
- "up.common.none": "なし",
- "up.common.tip": "ヒント",
- "up.common.success": "成功",
- "up.common.fail": "失敗",
- "up.common.close": "閉じる",
- "up.common.preview": "プレビュー",
- "up.common.re-select": "再選択",
- "up.common.rotate": "回転",
- "up.common.pleaseChoose": "選択してください",
- "up.common.loading": "読み込み中",
- "up.common.loading2": "読み込み中",
- "up.common.inOperation": "操作中",
- "up.common.settings": "設定",
- "up.common.retry": "再試行",
- "up.common.search": "検索",
- "up.common.more": "もっと見る",
- "up.common.video": "ビデオ",
- "up.common.file": "ファイル",
- "up.week.one": "月",
- "up.week.two": "火",
- "up.week.three": "水",
- "up.week.four": "木",
- "up.week.five": "金",
- "up.week.six": "土",
- "up.week.seven": "日",
- "up.barcode.error": "バーコードの生成に失敗しました",
- "up.calendar.chooseDates": "日付選択",
- "up.calendar.disabled": "この日付は無効です",
- "up.calendar.daysExceed": "選択日数は{days}日を超えることはできません",
- "up.cityLocate.locateCity": "都市の位置を特定",
- "up.cityLocate.fail": "位置特定に失敗しました。再試行するにはクリックしてください。",
- "up.cityLocate.locating": "位置特定中",
- "up.code.send": "認証コードを取得",
- "up.code.resendAfter": "X秒後に再送信",
- "up.code.resend": "再送信",
- "up.cropper.emptyWidhtOrHeight": "切り抜き枠の幅または高さが設定されていません",
- "up.empty.car": "ショッピングカートは空です",
- "up.empty.page": "ページが存在しません",
- "up.empty.search": "検索結果がありません",
- "up.empty.address": "配送先住所がありません",
- "up.empty.wifi": "Wi-Fiがありません",
- "up.empty.order": "注文がありません",
- "up.empty.coupon": "クーポンがありません",
- "up.empty.favor": "お気に入りがありません",
- "up.empty.permission": "権限がありません",
- "up.empty.history": "履歴がありません",
- "up.empty.news": "ニュースがありません",
- "up.empty.message": "メッセージがありません",
- "up.empty.list": "リストが空です",
- "up.empty.data": "データがありません",
- "up.empty.comment": "コメントがありません",
- "up.link.copyed": "リンクがコピーされました。ブラウザで開いてください",
- "up.loadmoe.loadmore": "さらに読み込む",
- "up.loadmoe.nomore": "これ以上データがありません",
- "up.noNetwork.text": "ネットワーク信号が失われました",
- "up.noNetwork.pleaseCheck": "ネットワークを確認するか、移動してください",
- "up.noNetwork.connect": "ネットワーク接続済み",
- "up.noNetwork.disconnect": "ネットワーク未接続",
- "up.pagination.previous": "前へ",
- "up.pagination.next": "次へ",
- "up.pullRefresh.pull": "引き下げて更新",
- "up.pullRefresh.release": "指を離して更新",
- "up.pullRefresh.refreshing": "更新中",
- "up.readMore.expand": "全文表示",
- "up.readMore.fold": "折りたたむ",
- "up.search.placeholder": "キーワードを入力してください",
- "up.signature.penSize": "線の太さ",
- "up.signature.penColor": "線の色",
- "up.upload.sizeExceed": "サイズ制限を超えています",
- "up.upload.uploading": "アップロード中",
- "up.upload.previewImageFail": "画像プレビュー失敗",
- "up.upload.previewVideoFail": "ビデオプレビュー失敗"
- };
- const ru = {
- "up.common.cancel": "Отмена",
- "up.common.confirm": "Подтвердить",
- "up.common.start": "Начало",
- "up.common.end": "Конец",
- "up.common.stop": "Стоп",
- "up.common.copy": "Копировать",
- "up.common.none": "Нет",
- "up.common.tip": "Подсказка",
- "up.common.success": "Успех",
- "up.common.fail": "Ошибка",
- "up.common.close": "Закрыть",
- "up.common.preview": "Предпросмотр",
- "up.common.re-select": "Выбрать снова",
- "up.common.rotate": "Повернуть",
- "up.common.pleaseChoose": "Пожалуйста, выберите",
- "up.common.loading": "Загрузка",
- "up.common.loading2": "Загружается",
- "up.common.inOperation": "В процессе",
- "up.common.settings": "Настройки",
- "up.common.retry": "Повторить",
- "up.common.search": "Поиск",
- "up.common.more": "Больше",
- "up.common.video": "Видео",
- "up.common.file": "Файл",
- "up.week.one": "Пн",
- "up.week.two": "Вт",
- "up.week.three": "Ср",
- "up.week.four": "Чт",
- "up.week.five": "Пт",
- "up.week.six": "Сб",
- "up.week.seven": "Вс",
- "up.barcode.error": "Ошибка генерации штрихкода",
- "up.calendar.chooseDates": "Выбор даты",
- "up.calendar.disabled": "Эта дата отключена",
- "up.calendar.daysExceed": "Количество выбранных дней не может превышать {days} дней",
- "up.cityLocate.locateCity": "Определение города",
- "up.cityLocate.fail": "Ошибка определения местоположения, нажмите для повтора.",
- "up.cityLocate.locating": "Определение местоположения",
- "up.code.send": "Получить код подтверждения",
- "up.code.resendAfter": "Повторная отправка через X секунд",
- "up.code.resend": "Отправить снова",
- "up.cropper.emptyWidhtOrHeight": "Ширина или высота области обрезки не задана",
- "up.empty.car": "Корзина пуста",
- "up.empty.page": "Страница не существует",
- "up.empty.search": "Нет результатов поиска",
- "up.empty.address": "Нет адреса доставки",
- "up.empty.wifi": "Нет Wi-Fi",
- "up.empty.order": "Заказы отсутствуют",
- "up.empty.coupon": "Нет купонов",
- "up.empty.favor": "Нет избранного",
- "up.empty.permission": "Нет разрешения",
- "up.empty.history": "Нет истории",
- "up.empty.news": "Нет новостей",
- "up.empty.message": "Список сообщений пуст",
- "up.empty.list": "Список пуст",
- "up.empty.data": "Нет данных",
- "up.empty.comment": "Нет комментариев",
- "up.link.copyed": "Ссылка скопирована, откройте в браузере",
- "up.loadmoe.loadmore": "Загрузить еще",
- "up.loadmoe.nomore": "Больше нет данных",
- "up.noNetwork.text": "Ой, потеряно сетевое соединение",
- "up.noNetwork.pleaseCheck": "Проверьте сеть или перейдите к",
- "up.noNetwork.connect": "Сеть подключена",
- "up.noNetwork.disconnect": "Нет сетевого подключения",
- "up.pagination.previous": "Предыдущая страница",
- "up.pagination.next": "Следующая страница",
- "up.pullRefresh.pull": "Потяните вниз для обновления",
- "up.pullRefresh.release": "Отпустите для обновления",
- "up.pullRefresh.refreshing": "Обновление",
- "up.readMore.expand": "Развернуть для полного чтения",
- "up.readMore.fold": "Свернуть",
- "up.search.placeholder": "Введите ключевое слово",
- "up.signature.penSize": "Размер штриха",
- "up.signature.penColor": "Цвет штриха",
- "up.upload.sizeExceed": "Превышен лимит размера",
- "up.upload.uploading": "Загрузка",
- "up.upload.previewImageFail": "Ошибка предпросмотра изображения",
- "up.upload.previewVideoFail": "Ошибка предпросмотра видео"
- };
- let settings = {
- lang: uni.getLocale(),
- locales: {
- en,
- es,
- fr,
- de,
- ko,
- ja,
- ru,
- "zh-Hant": zhHant,
- "zh-Hans": zhHans
- }
- };
- uni.onLocaleChange((locale) => {
- settings.lang = locale;
- });
- function t$1(value2, params2 = {}) {
- if (value2) {
- let result = settings.locales[settings.lang][value2] || value2;
- Object.keys(params2).forEach((key) => {
- const reg = new RegExp(`{${key}}`, "g");
- result = result.replace(reg, params2[key]);
- });
- return result;
- } else {
- return value2;
- }
- }
- const Calendar$1 = {
- // calendar 组件
- calendar: {
- title: t$1("up.calendar.chooseDates"),
- showTitle: true,
- showSubtitle: true,
- mode: "single",
- startText: t$1("up.common.start"),
- endText: t$1("up.common.end"),
- customList: [],
- color: "#3c9cff",
- minDate: 0,
- maxDate: 0,
- defaultDate: null,
- maxCount: Number.MAX_SAFE_INTEGER,
- // Infinity
- rowHeight: 56,
- formatter: null,
- showLunar: false,
- showMark: true,
- confirmText: t$1("up.common.confirm"),
- confirmDisabledText: t$1("up.common.confirm"),
- show: false,
- closeOnClickOverlay: false,
- readonly: false,
- showConfirm: true,
- maxRange: Number.MAX_SAFE_INTEGER,
- // Infinity
- rangePrompt: "",
- showRangePrompt: true,
- allowSameDay: false,
- round: 0,
- monthNum: 3,
- weekText: [t$1("up.week.one"), t$1("up.week.two"), t$1("up.week.three"), t$1("up.week.four"), t$1("up.week.five"), t$1("up.week.six"), t$1("up.week.seven")],
- forbidDays: [],
- forbidDaysToast: t$1("up.calendar.disabled"),
- monthFormat: "",
- pageInline: false
- }
- };
- const CarKeyboard = {
- // 车牌号键盘
- carKeyboard: {
- random: false
- }
- };
- const Card = {
- // card组件的props
- card: {
- full: false,
- title: "",
- titleColor: "#303133",
- titleSize: "15px",
- subTitle: "",
- subTitleColor: "#909399",
- subTitleSize: "13px",
- border: true,
- index: "",
- margin: "15px",
- borderRadius: "8px",
- headStyle: {},
- bodyStyle: {},
- footStyle: {},
- headBorderBottom: true,
- footBorderTop: true,
- thumb: "",
- thumbWidth: "30px",
- thumbCircle: false,
- padding: "15px",
- paddingHead: "",
- paddingBody: "",
- paddingFoot: "",
- showHead: true,
- showFoot: true,
- boxShadow: "none"
- }
- };
- const Cell = {
- // cell组件的props
- cell: {
- customClass: "",
- title: "",
- label: "",
- value: "",
- icon: "",
- disabled: false,
- border: true,
- center: false,
- url: "",
- linkType: "navigateTo",
- clickable: false,
- isLink: false,
- required: false,
- arrowDirection: "",
- iconStyle: {},
- rightIconStyle: {},
- rightIcon: "arrow-right",
- titleStyle: {},
- size: "",
- stop: true,
- name: ""
- }
- };
- const CellGroup = {
- // cell-group组件的props
- cellGroup: {
- title: "",
- border: true,
- customStyle: {}
- }
- };
- const Checkbox = {
- // checkbox组件
- checkbox: {
- name: "",
- shape: "",
- size: "",
- checkbox: false,
- disabled: "",
- activeColor: "",
- inactiveColor: "",
- iconSize: "",
- iconColor: "",
- label: "",
- labelSize: "",
- labelColor: "",
- labelDisabled: ""
- }
- };
- const CheckboxGroup = {
- // checkbox-group组件
- checkboxGroup: {
- name: "",
- value: [],
- shape: "square",
- disabled: false,
- activeColor: "#2979ff",
- inactiveColor: "#c8c9cc",
- size: 18,
- placement: "row",
- labelSize: 14,
- labelColor: "#303133",
- labelDisabled: false,
- iconColor: "#ffffff",
- iconSize: 12,
- iconPlacement: "left",
- borderBottom: false
- }
- };
- const CircleProgress = {
- // circleProgress 组件
- circleProgress: {
- percentage: 30
- }
- };
- const Code = {
- // code 组件
- code: {
- seconds: 60,
- startText: t$1("up.code.send"),
- changeText: t$1("up.code.resendAfter"),
- endText: t$1("up.code.resend"),
- keepRunning: false,
- uniqueKey: ""
- }
- };
- const CodeInput = {
- // codeInput 组件
- codeInput: {
- adjustPosition: true,
- maxlength: 6,
- dot: false,
- mode: "box",
- hairline: false,
- space: 10,
- value: "",
- focus: false,
- bold: false,
- color: "#606266",
- fontSize: 18,
- size: 35,
- disabledKeyboard: false,
- borderColor: "#c9cacc",
- disabledDot: true
- }
- };
- const Col = {
- // col 组件
- col: {
- span: 12,
- offset: 0,
- justify: "start",
- align: "stretch",
- textAlign: "left"
- }
- };
- const Collapse = {
- // collapse 组件
- collapse: {
- value: null,
- accordion: false,
- border: true
- }
- };
- const CollapseItem = {
- // collapseItem 组件
- collapseItem: {
- title: "",
- value: "",
- label: "",
- disabled: false,
- isLink: true,
- clickable: true,
- border: true,
- align: "left",
- name: "",
- icon: "",
- duration: 300,
- showRight: true,
- titleStyle: {},
- iconStyle: {},
- rightIconStyle: {},
- cellCustomStyle: {},
- cellCustomClass: ""
- }
- };
- const ColumnNotice = {
- // columnNotice 组件
- columnNotice: {
- text: "",
- icon: "volume",
- mode: "",
- color: "#f9ae3d",
- bgColor: "#fdf6ec",
- fontSize: 14,
- speed: 80,
- step: false,
- duration: 1500,
- disableTouch: true,
- justifyContent: "flex-start"
- }
- };
- const CountDown = {
- // u-count-down 计时器组件
- countDown: {
- time: 0,
- format: "HH:mm:ss",
- autoStart: true,
- millisecond: false
- }
- };
- const CountTo = {
- // countTo 组件
- countTo: {
- startVal: 0,
- endVal: 0,
- duration: 2e3,
- autoplay: true,
- decimals: 0,
- useEasing: true,
- decimal: ".",
- color: "#606266",
- fontSize: 22,
- bold: false,
- separator: ""
- }
- };
- const DatetimePicker = {
- // datetimePicker 组件
- datetimePicker: {
- show: false,
- popupMode: "bottom",
- showToolbar: true,
- value: "",
- title: "",
- mode: "datetime",
- maxDate: new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 0, 1).getTime(),
- minDate: new Date((/* @__PURE__ */ new Date()).getFullYear() - 10, 0, 1).getTime(),
- minHour: 0,
- maxHour: 23,
- minMinute: 0,
- maxMinute: 59,
- filter: null,
- formatter: null,
- loading: false,
- itemHeight: 44,
- cancelText: t$1("up.common.cancel"),
- confirmText: t$1("up.common.confirm"),
- cancelColor: "#909193",
- confirmColor: "#3c9cff",
- visibleItemCount: 5,
- closeOnClickOverlay: false,
- defaultIndex: [],
- inputBorder: "surround",
- disabled: false,
- disabledColor: "",
- placeholder: t$1("up.common.pleaseChoose"),
- inputProps: {},
- pageInline: false
- }
- };
- const Divider = {
- // divider组件
- divider: {
- dashed: false,
- hairline: true,
- dot: false,
- textPosition: "center",
- text: "",
- textSize: 14,
- textColor: "#909399",
- lineColor: "#dcdfe6"
- }
- };
- const Empty = {
- // empty组件
- empty: {
- icon: "",
- text: "",
- textColor: "#c0c4cc",
- textSize: 14,
- iconColor: "#c0c4cc",
- iconSize: 90,
- mode: "data",
- width: 160,
- height: 160,
- show: true,
- marginTop: 0
- }
- };
- const Form = {
- // form 组件
- form: {
- model: {},
- rules: {},
- errorType: "message",
- borderBottom: true,
- labelPosition: "left",
- labelWidth: 45,
- labelAlign: "left",
- labelStyle: {}
- }
- };
- const GormItem = {
- // formItem 组件
- formItem: {
- label: "",
- prop: "",
- rules: [],
- borderBottom: "",
- labelPosition: "",
- labelWidth: "",
- rightIcon: "",
- leftIcon: "",
- required: false,
- leftIconStyle: ""
- }
- };
- const Gap = {
- // gap组件
- gap: {
- bgColor: "transparent",
- height: 20,
- marginTop: 0,
- marginBottom: 0,
- customStyle: {}
- }
- };
- const Grid = {
- // grid组件
- grid: {
- col: 3,
- border: false,
- align: "left"
- }
- };
- const GridItem = {
- // grid-item组件
- gridItem: {
- name: null,
- bgColor: "transparent"
- }
- };
- const {
- color: color$2
- } = config$1;
- const Icon = {
- // icon组件
- icon: {
- name: "",
- color: color$2["u-content-color"],
- size: "16px",
- bold: false,
- index: "",
- hoverClass: "",
- customPrefix: "uicon",
- label: "",
- labelPos: "right",
- labelSize: "15px",
- labelColor: color$2["u-content-color"],
- space: "3px",
- imgMode: "",
- width: "",
- height: "",
- top: 0,
- stop: false
- }
- };
- const Image$1 = {
- // image组件
- image: {
- src: "",
- mode: "aspectFill",
- width: "300",
- height: "225",
- shape: "square",
- radius: 0,
- lazyLoad: true,
- showMenuByLongpress: true,
- loadingIcon: "photo",
- errorIcon: "error-circle",
- showLoading: true,
- showError: true,
- fade: true,
- webp: false,
- duration: 500,
- bgColor: "#f3f4f6"
- }
- };
- const IndexAnchor = {
- // indexAnchor 组件
- indexAnchor: {
- text: "",
- color: "#606266",
- size: 14,
- bgColor: "#f1f1f1",
- height: 32
- }
- };
- const IndexList = {
- // indexList 组件
- indexList: {
- inactiveColor: "#606266",
- activeColor: "#5677fc",
- indexList: [],
- sticky: true,
- customNavHeight: 0,
- safeBottomFix: false
- }
- };
- const Input = {
- // index 组件
- input: {
- value: "",
- type: "text",
- fixed: false,
- disabled: false,
- disabledColor: "#f5f7fa",
- clearable: false,
- password: false,
- maxlength: 140,
- placeholder: null,
- placeholderClass: "input-placeholder",
- placeholderStyle: "color: #c0c4cc",
- showWordLimit: false,
- confirmType: "done",
- confirmHold: false,
- holdKeyboard: false,
- focus: false,
- autoBlur: false,
- disableDefaultPadding: false,
- cursor: -1,
- cursorSpacing: 30,
- selectionStart: -1,
- selectionEnd: -1,
- adjustPosition: true,
- inputAlign: "left",
- fontSize: "15px",
- color: "#303133",
- prefixIcon: "",
- prefixIconStyle: "",
- suffixIcon: "",
- suffixIconStyle: "",
- border: "surround",
- readonly: false,
- shape: "square",
- formatter: null,
- cursorColor: "",
- passwordVisibilityToggle: true
- }
- };
- const Keyboard = {
- // 键盘组件
- keyboard: {
- mode: "number",
- dotDisabled: false,
- tooltip: true,
- showTips: true,
- tips: "",
- showCancel: true,
- showConfirm: true,
- random: false,
- safeAreaInsetBottom: true,
- closeOnClickOverlay: true,
- show: false,
- overlay: true,
- zIndex: 10075,
- cancelText: t$1("up.common.cancel"),
- confirmText: t$1("up.common.confirm"),
- autoChange: false
- }
- };
- const Line = {
- // line组件
- line: {
- color: "#d6d7d9",
- length: "100%",
- direction: "row",
- hairline: true,
- margin: 0,
- dashed: false
- }
- };
- const LineProgress = {
- // lineProgress 组件
- lineProgress: {
- activeColor: "#19be6b",
- inactiveColor: "#ececec",
- percentage: 0,
- showText: true,
- height: 12,
- fromRight: false
- }
- };
- const {
- color: color$1
- } = config$1;
- const Link = {
- // link超链接组件props参数
- link: {
- color: color$1["u-primary"],
- fontSize: 15,
- underLine: false,
- href: "",
- mpTips: t$1("up.link.copyed"),
- lineColor: "",
- text: ""
- }
- };
- const List = {
- // list 组件
- list: {
- showScrollbar: false,
- lowerThreshold: 50,
- upperThreshold: 0,
- scrollTop: 0,
- offsetAccuracy: 10,
- enableFlex: false,
- pagingEnabled: false,
- scrollable: true,
- scrollIntoView: "",
- scrollWithAnimation: false,
- enableBackToTop: false,
- height: 0,
- width: 0,
- preLoadScreen: 1
- }
- };
- const ListItem = {
- // listItem 组件
- listItem: {
- anchor: ""
- }
- };
- const {
- color
- } = config$1;
- const LoadingIcon = {
- // loading-icon加载中图标组件
- loadingIcon: {
- show: true,
- color: color["u-tips-color"],
- textColor: color["u-tips-color"],
- vertical: false,
- mode: "spinner",
- size: 24,
- textSize: 15,
- text: "",
- timingFunction: "ease-in-out",
- duration: 1200,
- inactiveColor: ""
- }
- };
- const LoadingPage = {
- // loading-page组件
- loadingPage: {
- loadingText: t$1("up.common.loading2"),
- image: "",
- loadingMode: "circle",
- loading: false,
- bgColor: "#ffffff",
- color: "#C8C8C8",
- fontSize: 19,
- iconSize: 28,
- loadingColor: "#C8C8C8",
- zIndex: 10
- }
- };
- const Loadmore = {
- // loadmore 组件
- loadmore: {
- status: "loadmore",
- bgColor: "transparent",
- icon: true,
- fontSize: 14,
- iconSize: 17,
- color: "#606266",
- loadingIcon: "spinner",
- loadmoreText: t$1("up.loadmoe.loadmore"),
- loadingText: t$1("up.common.loading2") + "...",
- nomoreText: t$1("up.loadmoe.nomore"),
- isDot: false,
- iconColor: "#b7b7b7",
- marginTop: 10,
- marginBottom: 10,
- height: "auto",
- line: false,
- lineColor: "#E6E8EB",
- dashed: false
- }
- };
- const Modal = {
- // modal 组件
- modal: {
- show: false,
- title: "",
- content: "",
- confirmText: t$1("up.common.confirm"),
- cancelText: t$1("up.common.cancel"),
- showConfirmButton: true,
- showCancelButton: false,
- confirmColor: "#2979ff",
- cancelColor: "#606266",
- buttonReverse: false,
- zoom: true,
- asyncClose: false,
- closeOnClickOverlay: false,
- negativeTop: 0,
- width: "650rpx",
- confirmButtonShape: "",
- duration: 400,
- contentTextAlign: "left",
- asyncCloseTip: t$1("up.common.inOperatio") + "...",
- asyncCancelClose: false,
- contentStyle: {}
- }
- };
- const Navbar = {
- // navbar 组件
- navbar: {
- safeAreaInsetTop: true,
- placeholder: false,
- fixed: true,
- border: false,
- leftIcon: "arrow-left",
- leftText: "",
- rightText: "",
- rightIcon: "",
- title: "",
- titleColor: "",
- bgColor: "#ffffff",
- titleWidth: "400rpx",
- height: "44px",
- leftIconSize: 20,
- leftIconColor: color$3.mainColor,
- autoBack: false,
- titleStyle: ""
- }
- };
- const NoNetwork = {
- // noNetwork
- noNetwork: {
- tips: t$1("up.noNetwork.text"),
- zIndex: "",
- image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABLKADAAQAAAABAAABLAAAAADYYILnAABAAElEQVR4Ae29CZhkV3kefNeq6m2W7tn3nl0aCbHIAgmQPGB+sLCNzSID9g9PYrAf57d/+4+DiW0cy8QBJ06c2In/PLFDHJ78+MGCGNsYgyxwIwktwEijAc1ohtmnZ+2Z7p5eq6vu9r/vuXWrq25VdVV1V3dXVX9Hmj73nv285963vvOd75yraeIEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQaD8E9PbrkvRopSMwMBBYRs+5O/yJS68cPnzYXel4tFP/jXbqjPRFEAiCQNe6Bw/6gdFn9Oy9Q90LLG2DgBBW2wyldIQIPPPCte2a5q3jtR+4ff/4wuBuXotrDwSEsNpjHKUXQODppy+udYJMEUEZgbd94DvnNwlA7YGAEFZ7jOOK78Xp06eTTkq7sxwQhmXuf/754VXl4iSstRAQwmqt8ZLWlkHg0UcD49qYfUjXfLtMtOZ7npExJu4iqZWLl7DWQUAIq3XGSlpaAYHD77q8xwuCOSUoXw8Sl0eMux977DGzQjES3AIICGG1wCBJEysj8PXnz230XXdr5RQFMYbRvWnv6w8UhMhliyGwYghr4Pjg3oEXL34ey9zyC9tiD2ml5h47dr1LN7S6CMjz/A3PvHh1Z6UyJby5EVgRhKUe7Kz/JU0LfvrJo5f+Y3MPibSuFgQGBgasYSd9l6GDsup0WS/T/9RTp9fXmU2SNwECdQ92E7S57iaMeJnPQLK6ixkDLfjlb7546RfrLkQyNBcC3dsP6oHWMd9G+V3JgwPHh7rnm1/yLQ8CbU9Y33zp0j+nZFUMb/DHmB7+SHGY3LUKAk8cObtD00xlHDrfNge+Z2ozU3c9dvx4Yr5lSL6lR6CtCWvg6OAPw9z538ZhhZRl6XrwhW8du1KX/iNejtwvPQIDR8+vSRqJ/obU7GupjdNdh2gW0ZDypJBFR6BtB2rg2OVtuub9JcmpHIpBoK1xfffLzx4f7C0XL2HNiYDp6bs9z23Ypn1fC1Y/9PCFDc3ZW2lVHIG2JKzTp4Ok7nv/G6Q054MIvda+bNb74pEgKGtwGAdL7pcfAa8vOKEZ2kyjWuLr7uDh+/qvN6o8KWdxEWhLwroyeek/g4zuqwU6kNrhyZcu/UktaSXN8iNwuL9/RuvVXtJ9PbPQ1vhmcP6t9+47u9ByJP/SIdB2hDVw9MJHQFYfrQdCph84evFX68kjaZcPAZJWwjMXRFpJ2zr91tfuvrh8vZCa54NA2xGWrunvmg8QWCJ/N4ir7fCYDxatkOeBB7an501agXbygVdvv9IK/ZQ2FiPQdi9osGbH+zRNf7y4m9Xu9Me7N9nv0HXdr5ZS4psHgXpJC9P/wDRTx0Vn1TxjWG9LGrbaUm/Fi5meSvcrkxf/Cg/ow9XqAUk91v3qHT97r6471dJKfHMi8Oyzgx1Z03t1YAQVT2MwgsC3u+yXHzi0faQ5eyGtqgWBtpOw2Ol9+/TM+sTOn8L08MtzgQCy+tOHXr3jA0JWc6HU/HF5Scssr4jXcYqfP6V/T8iq+ceyWgvbUsKKOn38eJAYyl56TAuCEr2WYei//9Crd/5GlFb81kdASVopSFrerKRlaoZj9HR+700H10+0fg+lB21NWBxe2lhNHsUpDZr27mi4dV379R9+za4/iO7Fbx8ECknLCPTsTDJ17O33bJpqnx6u7J60PWFxeAcCbMV56dJfQKf1bkMLfuGh1+76zMoe9vbuPUnLsb2DtmOe5HSxvXsrvWtLBEhaTx29+Ma27Jx0ShAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQaEsEVoQdVluO3BJ06ptHL34b1XRjp4Ch6Rq24+kmjG4Nwwg+9uA9u/73EjRBqhAEihAoe3xwUQq5WTYEzp0b3ZnV/Ncf6O/9AvY9wlh/6dy3X7ncN512Zw9BVLXjuAP4np44vnQtkZoEgVkEhLBmsWiKqwsXpjbPBOn3gRfenwnc+7GBe+zsjclvonFDS9nA9Iy/u3x9+vAP3735VPk4CRUEFhcBIazFxbfm0k9fHD7k+v4nQFaPQIrx8Gmyx/GJ0J/t7ez7mw0b9MmaC2pQQgh0/ZSm4g5TwueWWtqLt0HuVy4CQljLPPYnB0depTn+b3t+8B4t0AdBUv93h2H9xc6da0aXs2m+r1WQsLRnl7NdUvfKRkAIa5nG//r1oGtsZvjTgev/kqYHF/TA+AXoqv4npJemOEiQU1Eo2l+G0movBK1UBBPU7s9E1+ILAkuNgKwSLjXiqO/khVtvARH8dxDBRkMzPrF/V+9/BlG5y9CUqlXinHv9mRPXtvuus88L9H3JPv2zD2yXExCqAicJBIFWRwAvv3Xqwq0/Pnn+lv/K+ZvfPH3p9p5W75O0fxaBp793ce3AwIDMWmYhafiVgNtwSMsXeHp4eNXJC8Nf0PAdRCiuf/XgrnWUqsqotcvnl9DmRkCdweX4b9N7+m/ih+mbMraLM14yJVwcXItKpT1VRve+ArC3Qqn+3gM7132jKEGZm6tXg86J7OhDfuA/iHwPUpfUZSfu2L59tXxEoQxeyxkEgjKeOnLxHb4RqC+NY5H3+2953d4XlrNN7Vq3ENYij+yZwbG9jpt9GkBPQ5H9zgP9607OVeWp87cOQtn9zwJf+xDMNFfj+jryPqXpxj8c2Nn7P+SXey70lidu4IXzb0DNB4tr9751+HV7zxSHyd1CERDCWiiCc+QPjUCnsaqmZ62O5IN7N/VUNP48ee7mAZDTf4Tt049iUG4Guv4ZfNLos9UIbo7qJWoJEHjy+bP7fNsoOcnW0A0/aacef8PdG28sQTNWTBVCWIs01OfPj66BpfqTmq732UnjgT1bei+Vq4pTv7HM8Ceg2/o1qLQug7T+FaaM3IqTLZdewpoHgYEjV9fphvOj+OShWa5V+CxvZtpzv/LwG/aNl4uXsPoRwI+4uEYjAJ2GmdG8L0FK2mYa+tsrkdXZy+P7x2ZuHdW14P+BLdank9q6Qwd3rf+ckFWjR6Tx5Q2cP58K9Jm3VCIr1ogt48lO237r3//96YofeG18y9q7RFklXITxPXV+5DchKb3ZDMy37Nu5tuxG4R9cHH6b42QfAzlds+3EPXu2rfrBIjRFilwkBIIR7SHoJDurFU89ZOd680Gke6JaWomvjoBIWNUxqivFD87fej0e0n8Fwvr0/t1rnyqX+QfnRz7g+8FX8Rv8vL3auF/IqhxKzR2WCPxXqKeq3krDTdj2ierpJEUtCIgOqxaUakwzNBR0D09yiqePHOjveyOkpxLr9VMXb73V97S/h3nDXx7Y2fdPkAYbncW1IgIDxy5vM7LZt/hgrnLtxyaBrJNxv/72N+6tuNhSLp+EVUZACKsyNnXHvHL+1qcgNf2KbSXu2bt9dcmS9qlzo/fARgcmCtpzB3b1/Vg5QiuslLowENyDWDn8cSjl98PgdBviu03N+rl9/WufLEwr18uDwLdevLTF1YK3xnVZ2HI1bUxrT7z5zTuXdRP78qCyeLUKYTUI25OXbm4JPO00TBj+6I7+db8ZL3ZwMOiYdG4dA1lN9HWte2iuI2NAVPapC8O/CGPR34Ip/AZIbIMo7yX8G9QMbcS09P+2b1vf5XgdrXaPfiYns9oeLLEd8D1/B7Dp0E1jGP042pXQj7RKf546cmGzp+tv1TRf6YQD35/QO3seP3xow5IfC9QqmM23naJ0ny9ysXwgq98BWc0kVhv/Nhalbqe8kd/Fr8MOSEr3zEVWrwyO3I29hl+E9LUHGf+nAXI6sGPdd8uV2YphIKnE5IyL6bLxk7cn3bdkHHefrpvJAExMZ1uBZmqeNzXtfzUzk/m/ens7LjV7Px+8d9e1579/44l0duZtge+Np5zEEw8c2pBu9na3YvtEwmrAqNE8IZvNHsep5//yjl3r/0O8yFOXbv0QCO05gP0JGIL+fjw+uj91YeRh/Dp/PtCDM7Zpfmjvjt6Xo7hW9ycmJjaYduf7Hdf/8HTGfa3rG9rYxLSWnsloPg7fijZV8oFM2Ja2a9t6EJd7bCztvHP7us4rrdD/r3/7ct9I99jEI4cOiQ3dIg2YEFYDgOUJDFj1e8TqX7cT4kImXuQr5279A4DeBEX8ayvprU4N3rovcALot/TH13T0fXDTJn0qXk4r3k9OTm4y7a6PzjjORzOOvn1kbEqbnEprPhRzwAKzwFLHk05hv6Yd6N+o3R6beG50aPSdr3qV6IJKkVp5ITIlXOCYn4Yexr0w/DO6YXymHFlR0e5r7tsM3fxgJbI6fW1ivTeT+SsYmr54cFff+5Cu5X+hb94Merp6/J/PusGvTE6724eGJ7RpSFOkKPCUZvBPBccoHBet3Rwe13rX9tw/PjXzZ5hKvr8SfhWKkeA2REAIa4GD6p0feRdWBnvxjv2PckVhVfBf4A29uG/X2i+Ui2eYn8n8NryuDr3jPfWSFV5k44UT137eshIP2K7/64cObbheqZ6lCp+Ydt8TBO7vTM5od1+/NR4SFVhoLpKKt410lnE8LTMzo3V2dLznxLkhYgQ9obiVjEDln7mVjEodfYcpw+MAsftg/7qSDbAnb97sCSb0Yei2fqOcbovVqKNnNO8HmAE9Cv3Wp+uoWjt27HpXNqH9WTKR+kBHKqEFbvo5y3N/avfu4g23R45f3WGa1k9ZicTd0zPTf/f6O7f8dT311Jp2fHzmgJlI/N70jPPe4bEZ6Kg4qw0lqlrLiNKBiLWerpTW25PUbkPXZViW62ecHz+4d8PXojTirzwEyhq8rTwYFtRjvpX/rlwJ+iSXugPbMuyKBOHo3geRJtuT7PujcmVUCuPJlhnL/9NUqvMD2eyM5sxMaIlE4n7XML907tyNjcxHQjty4sZv66Z1xEok/xNW5n4uZSf+8sT5m++vVO58wkEu5sR09pd9w/rWyET2vReujiqygrSopn/zKZN5qMeirotKeTyolm7p/+X06Wvr51ue5Gt9BISwFjiGsLl6N6SrvylXDNTK70D4mX071pwtF88w6Jd/DG/1E1u26NOV0pQL71y3/8PJVOcHMzPTWkcCH2YGOaTTaS2RTN6f1fQvvvDK1bdnbO2JZCr1SeRfn05Pa1PTU0gXJBKW+ecnzlxvCGndhFQ1NRP8bcY1/vjS9bF1V26MwHwsVKiXa3etYVw1TNhYJ3TDjQCO42jJVMcez7J+t9YyJF37ISCEtahjGjxkGDr2DJZ31D8h5vUQJL5RPkXlUMM07u3qSGidICvkzzuSlmlZb0olrK9hD9v9JCrPC196JoPMAolFg6CV+PPj54YeyWecx8Vk2v1Q0rSfhFT18LnBmzBRyNalp5qrSuq7kiAsh4SFa7oZ9M0wzI+cPHOjZPo9V1kS1z4ICGEt4lhiCvZrSa2jol7qzPXJPk6nIGbVbWfUvcr7hO9MP97ZVXpggOu6ajplYStj7l1XvbRMXbPAbp6HzSSBlkraNknrvfVCcPt2sHYi7f3pTDb47KUbYxuvKqkKpYBXKBnV869c3WgbDEixAck0FGFFfEzJzbIsO9C1TyrcymWWsLZGIHoW2rqTzdo5dXyykz0NC8l779i5vu4zwM+eHVntGP5jqVTq/6AkVc5NZ3wNH2lVxNWZNIukMSjiNd9z0+CHp5DXAdX4SAg203w8GB5IATtODHzdK8C15kEjhXvNS9rWA11dnfcMDY9prscss48RySakrOLWqODCoIKAgkuVgsS0urtD60haeV1YYVbbtjUn6/74HXvW/11huFy3PwKzT1r797Upe3jq4sib9u9Y+wxe+vh7W1N7jx49v6ZzbffnQD4/Cj1Pfjx54XiBls6GVuTUc9mQsOIO9mPQFdkIRlz4fy5JLm2ZMOqTcJaXIqpcqnixVe+rdbZ3dbc2OT0D0wZIibHSksmklslknvx+//q3PiKnXcTQae/b+LPQ3r1t0969cOL6G7o6E09qgZegdMJBpVQ1DbKCpyUt6oPKz/4NEJalCAuZFIuEVBJd+jgLh4rvAiFqUVGkhJZMWFp3Z0obGSu/d5gSnWmavuO6h+/cvYHSobgVgoAYjrb4QPMUiGtj1/79jBMkLBwiTlMASlYzTkhWCJyTrGAyMOFkst/BoYMmuIIyGJYcMXMMdNwHPhYN1qWS1t6ZLGaKZL8yzFXTr15BooLLMugHMBRNKgW+It8y9TEcJGt4rvcRFCCEVQbFdg0Swmrxkb0+cf2XOzq73kgdFieEXF2jdEUJKQH6SVWQrNjtZDKlpTPp38U58iUbthk/Ph7sN6zg/xudSGvD4xkq6otcnnjyF0XRRTflkyC0IIJE1JG0QbqGNpMNp5xFhRTcZDNoj66988SFm5vv3LX+WkGUXLYxAuXnCW3c4XbqGs9hwjv+a9lsuN+ahOJSCoLjNDAFvVUll0p1aNPp6adTweSflEszPO48oFn+4yOTmR+6enOshKyYhzWpf/jDuuf6x2aV/qNRaPG/1d0gUXWCA0uu7GhMmkqmerEc8KOVU0lMuyFQ+Ylut562YX9Sncmf7Ojo3BDZWbGLtMkiUVXSWTFNuMqWuYG530f7+/tnGFboxsfdd9mm8XdDo9O7rg6NFq0CFqZr5DWlK9qV0fZqGvZchSuPlevB2VmG/hOV4yWm3RAQwmrhEcW64qu4ykfJho52Vp3J8quBYQooqWDKADftBd6HD+5efyoKj/zR8ew/hWXY56/cnFh7a3RCTTGjuMX0SVB9qzu1qfQM+jO3dBW1g6uVSHv/qVNX10Vh4rc3AkJYLTy+WA/8ou9kJjo7bOh+DLVFZ64TEbCyBktxI5PJZj56R//Gx+NdH5vM4vuI+p8NXh9LjU1iw3EZhXc8TyPuuV9wDaaCfBjTM06N0hVWQmHBDzvSDZ5tvqYR7ZAymh8BIazmH6OKLbzv0KZvJEz3ZzEFnEolaEtV2XEaCLKadrIz//TQnk1/EU85NuH8th8Yf4j9gMZUOrNkZEVZCnsbtTU9KW18GqcKFyjh420sd2+j33pg3F8uTsLaDwEhrBYf04O7N/2t7/o/C2FoGnsIy/YGlvAwSfCvZzLOe+8oR1ZT3u/5uvHJC9dGtJlMrfqjslXVHwjpat2aLi2rjFFLjUSrFUjlO0juddXSSXx7ICCE1QbjiHO0/hofbPgwpnDTOR2V6hWNQqGUx34890noet5yaO+Gko3Y45PO7/uB/lvnrwxrWdha1absbgxo1FWtwplXqYSJY5Nn5lU3bLHQmGA/yko0plVSSjMjIITVzKNTR9sO7dv8RSeb/T9BWmMkKv4D+YzBXuljV7yxd+zfte6VeHGKrHTz4+cv38JWmyUmKzSGG5z7VndoE7kz3uPtq+Welvhwm39weVjOyaoFsBZPI4TV4gNY2Pw79mz8KyebeRIH+VEZTaX0sf27+v794TKmCxNTzr/2NOPj5wZBVjjdYSklq6jN69dyKuhqmWztivYob+RTSkPbe/xMdlMUJn77IiCE1W5jq+s4dYEO6mzsYAmvi/+CrH7LDYxPcBq4HGTFVcG1ULLT5orS1ULIkoSFI2cMHKG8obiXcteOCAhhtdmo6gaOh4EWWlkyYU9gvHswXfgV19d/7+LVkSWfBrItJJhObL/p7elQR8fUZnEV70XxPc01sM+xrzhU7toRgZIHuh07uZL6xA3LBaYB+Ar8rBsfz34YX1j+D5eu317QNGy2xPquSE4mDuXb2IujY2AgytNE67RiKFshzuwCR5s9ZSMlsK0QEMJqq+GkBKOF5yFzRoidK5BoFCeMjM/8mG+a//Xy0Li55KYLBRiTrGjwOQ1br4VMBQuKVJeQKVPxMLlvPwSEsNpsTEECmBLSgbHUpwD1YGwse59l2p+9fmuig4fiNZIowrqq/6Xeqm9Vh9JbjcOKvqFtACX7gV8kTVZvkaRoRQSEsFpx1OZoM2iKxxuHLtDcsZlgLzYZfv7m7XSv+r7fIm234XSP/8o5ktWqzqSyZr89PoXPYDTYkZvziw0NLluKayoEyq4iNVULpTF1IaDjHHZmoAW4aep9geN8fiLt998cGYdtVp7K6iqzXGJFUCAi7jdkuapsBJKcPBwgyP8YRyV7B04Q3dDbpY3jg6gupoMNla5U41BbUN9n0sr1ScKaHwEhrOYfo7paCAW0WiWknihhW/0Tabf/6tDtxpIVSIhGnz1dSXUkDL8fSHKi4/lWPId9Kp3Vxqegp8J/m9f14D6DQ/nmb281FwgkZ1Dj7bnSSFx7ICCE1R7jmO8FJJr8jCvjeNrIxFjDJBpKVaSlXhwDw384MyucBoLAGEfHI5ptO6n1YAq4FjorH9IWjUOnFlF3pj62aui3whbI33ZGQAir/UY3XCVEvzgdw/8NcSyGUhSlpVWQrFg2p39xp0JYLyIohaXxdZ2FGofG6yi85/QS32F0Asu8URgu1+2JgCjd22xcsVElPC85169Gaa1YTkRWJKpSqooBiQQzONvq9sRULKKxtzzAEJw1api2EFZjoW3K0oSwmnJY5tcoSD09HanEDztubnfO/IopyUWC6sUmZUpW5aSqkgwgK04DxxaZrFivacCaIdAuH9zaM1rSDgloOwSEsNpoSMenvU93dXb+EE5taFivKElRqd67qrNmsqIF+yjMF/i56MV2JqadYKxXMDXM6+4Wu04pf/kQEMJaPuwbWvPticwj4Il/NnTrdl7JrqaDC5wTUle1GmdWWVCw1+JotjA6PgnThsIdQrXknF8arkJi/+R355dbcrUaArU9ha3WqxXW3tHR9C5dN//T9eEJ3aGdUwP7T0V7F86Mr0VW4mF6o2NTS/ilaB2HDmb8wA2+08AuS1FNjIAQVhMPTi1NgwRkGKbxRxMz3uaJSRzVUkumOtLwo6Zc7aOkVdEhynN9NQ1cyuNqeEqD67mX9TXGyxXbJhFthYAQVosP58S0909czfqJqzdGODVqaG/IUbCWr2p0yukfp4FUtDfeir1yl8IPUGjPHFy/fqJyKolpJwSEsFp4NEfT6Z3YBvOp8MvMc0hAi9hHNQ1cBrJil5TUZxhfXsTuSdFNhoAQVpMNSD3NMTzzU1PZYAM/ProYkg3UV5rHT8lXmA7SwnwEq4FLLVkRI04HM+n0LdvzvlEPZpK2tREQwmrR8ZucCd7hePr7rw2N5PfxLUZXON1zHKz4kb0KnIttP6Njk8tyaimbwXPrsW/yq3v3bhoqaJZctjkCQlgtOMCYCnU4GedTI+NpQ32XbxH7QOmKG5nzdIWZJz8HNkKygqI9TmSL2JSiovGVn0A39c8WBcpN2yMghNWCQ4zPc0HRbr6GEs6chJFnmfl3knZO4/hmII1B6fiFG9br0s6qAeXPp2WUrhzHeXH/jr6n5pNf8rQuAkJYLTZ2kK7Wul7w6zeGx9DyUsZovOodOizosTg1TM9k1Wogpa7lIisOF+w48E/7E5B1Y/cgtdizsBKbK6c1tNioT6X9n3MDcyePOo7OoJqrC6S0+ZIYV+GSOHxvc18PJCxXG4ed13I727axqTp9yk9rX1jutkj9S4+ASFhLj/m8axwdDdbgELxfGsLpoZyqVXPVU1QugVJUV0dC27p+FaaBWWxknq6ceAljTNMiAf/BoUMbJpewWqmqSRAQCatJBqKWZpgJ731Zx9pJM4aK0hXe5vlKVFEbKFlxs3PvqpSSqpbzKztRm+gnEkktnU6/2GFMfa4wXK5XDgJCWC0y1iAR6/Z49iOjY7C5qkG6mk+3SFQGlEP8FFdnygrNFqBsn1OxP5+K5pGHbcBhqhT8fqu/v39mHkVIljZAQAirRQYx7Wj3Zj3tddQjVVJ4l50CMjHe8mqOTJCCvmoTyIrENXx7Uinbm4Gs2PZUqkObnp76i0N7N36tWl8kvn0RaGnCGhgILKPn3B3+xKVXDh8+nPseX3sOlpt13+P4uonv71WeDqLr1ampFB8S1JrulNaHc9rTMxltcpofOeWns0rTLkeIZUHRnpm5YibMf7kc9UudzYNAyyrd8ZLpWvfgQT8w+oyevXeo++bBtaEtQd9s1/ffRsV3I6eDJCp+nourgH04UZQnhIYfWm1o8xdUGCU8/E/bil89sH3dlQUVJplbHoGWJaxnXri2HTvd1nEEcCBS3z++MLi75UejQgcmJjL92ax/gNJPo6QekhVXAbdvXI3D+XQ1Bcxiu02zTAEjKFIdHTQS/S8Hd2/4YhQm/spFoCUJ6+mnL651gkwRQRmBt33gO+c3teNQYin/oG6aKX5rcKEukqqoWN+Ij5vy81v8UATDG0WGC21jlJ96K6wKPpWd8H8jChN/ZSPQcoR1+vTppJPS7iw3bIZl7n/++eFV5eJaOczX9Z2YvM1LPxWpocBHKv8qHHdMqSphGUqqahaThfj40ITBcbLnsDj6oXvu2bS4n96JVy73TYtASxHWo48GxrUx+5Cu+XY5RH3PMzLGxF0ktXLxrRoGNVPPfNtOolIrgElLGYH2wbZqcipdIFVFlDbfGhqfj9bskCaHHS/7gTt3r73Y+BqkxFZFoKUI6/C7Lu/Bl1jmlKB8PUhcHjHufuyxx/g5lbZw+BL7bX4EoiZqyS0T0uM0j1+82QSl+ua+bhxj7GjD2LicwWkLzaarigbKsmDJ7gcTmezMBw/t3ixntUfAiK8QaBmzhq8/f26j77pbaxo3w+jetPf1B5D2RE3pmzyR4/nH+Mti4Wx1dUrCHO0lSVGqskFUnakkpn6mhu086jgYHkWTW3Wbo4Tli6L5gqYHE47vfeDufVv+YflaIjU3KwItIWEdO3a9Szc0ElDNDqcLbHjmxas7a87QxAnX9ljfxcr+Mzs29ykpi1O8iJjoR/cm5o7dnUl89LRLW93dyWmVIip+Kp7pmlWqIvQ8Mga9Gslm3Efu3LX+K008HNK0ZUSgplnGMrZPGxgYsIKeXa/TA61jPu0w0+7xBx/cd3M+eZspD0wbDgWm+RXP13cODY/jWGKuGAb48jG+agNpilbqlKZoWDqDY2AyjtNUlupzYZlKpXgaxIVMNv0zd+/d+uxcaSVuZSPQ/IT13TN34QRvZW81n6HSDdMLUqmjh9tgd//Fi8OHEl3JL3Z2dh3MzGA7XU664llVWRz/QhLjNYmsmaWp/DjCjqIDdlaZTOZZ1/A+fGj7hjP5OLkQBMog0NSE9cSRszuswNhdpt31BRnazM3U9IuPHDrUuG+419eChqU+cvzqjp7u5P9KJpMPpqc51Zv9QntLkFQBEqZluVCw/7nhaP9i376+8YIouRQEyiLQtIQ1cPT8GjOw7vE8tyFtxBrb2MBXdh579FF99g0vC0nzB548ebNHT2l/aFmJj1BPBYyav9EFLaQ+jdPAVNL8/pZ13a8qiJLLOhAAjvrTRy/d0enbF+69d0tzHFhWR/vnk7Rple6mp+9uFFkRGF8LVj/08IUN8wGp2fIcPLh+4sCu9R+F3ucj0MLf4vaVVnChqYWmdaQS2jpY2vd0djh86Vqh7c3Yxm8dudTPxaW0lrn7yJEjZW0Tm7HdC2lT0xKW1xecgHE3FDWNcb7uDh6+r/96Y0prjlIO7ur7TOD5b3ayzt9ylY0Gl83qKFXZsCXrXdOlrV3djf2LBr556JOshLDmMWhPPXV6vav5O5jVxYLUhNl3iIbV8yiqpbI0bQcP85C2Xu0l3dczC0XUN4Pzb71339mFltOM+Q/0rzu5f2fvu1zH+QDOt3uZ0pbVRMRFouJK5qqeTkhVqyBdtdUmhGV5JI4cudrpd5kHiyp3tTU/8s6r+4rC2vCmaQmLWJO0Ep65INJK2tbpt75298U2HLuiLh3oX/95L+0/kHUyvwTieiUJHVEimVzy1UKeWMqv2pCoKEVFRNXT1aHawnBx80eAZj7TwcxdAc5Gi5fiaNnNT37nCk4xaV/X1IRF2B94YHt63qQVaCcfePX2K+07fMU9U7qtHev+xE/7r3cc70O+6w1gxuV0dHZiusgvJS/O7IskRXLs6KCxqj+B26t9a3uUREWi4plbQlTFYzXvu+7tB3EIUGel/L6e3TNw5NS8zYAqldss4YvzBC9C7559drAja3qvDoyg6pwCP+KBZaVOPPjazS1vMLpQKE9fuPnawDB+EqehPwzWuAuSl8LPg90WVxhJJPWQCUmPBAWTBEz1TFUGpqO3wYYvIPgr2az35a2b1/50V6f1e1NTlVcvEzB0xRekj67usu5FmS2/crvQcaol/zeeObfTSOj91dIq28PxiaOHDx9quy8LtQxhcZBqIS0Dhkl2l/3yA4e2j1Qb2JUUD1Iyz1waOQib0vsxKXsAFvH3wMB0JySwtZC+DBPTN5BOCEnhrI1BuKe9l6tIzsVCiD6E0DOabrwI2elZ09aP7N3aNxjheXvK+a1OENa0EFYEyYL9rz072Ju03ZpNQKj7Xd899cKhNrA9LASvZTY/s9GcHoK0XsrakLS8UklLxyl+/rj+/Qfu2367sJNyTS7SuZfneO7ffweBGScu3NwAqWgrTvTc5jjBZmw87tMCfRXYKQWOgula4OiBOQUZ7DZuhrAGdQXxV0zPuCaGnkv3VPGHOpPw7+QPR62OM5HhdNddGOeX2kmCbSnC4mDlSStVTFr4eLljdHV+702vWz9R66Cu5HS5h5hmHvz3QiOxwJTRo2BGgY06dm7OVhewYGAY6s75oD+ZDs4JPY9JyqSCQ7ABqftd5VFM3/j2Ja4mtsWpJQSq6ZXu5UZTKeJnsHpohiYPRqBn04nkS2+CQWW59BK2dAjwS0Y4IHDz2ERWG8Gnwm7iK9W3sFmbvrqGPzw6gW8eTmvTM07XmTPX28KYd7EQ3rjnvv1QFHbPt3zT9DcMPHd+13zzN1s+/hC2rKOo7NjeQdsxT5LEWrYjbdLw05eHtwWe9jl0542u62HZHZIVpalY/yIlP5X3MHYddLLZfy4fmYiBhNuB509vw+rG3tKY+kOwGHLi7W/cS91jS7v4s9TSnZHGLx8CICH9lXNDX+zpWfXuycnaBV2e3e567nAm4973qv0bzy1fD5qr5oEB7KXt0u7B3Loh7yhWVfypbOalh9+wr6U3mbfklLC5Hi1pDRE4ef7Wj+EEiZ+amqpvJT2bzWjJRLIPR3n9riA5i4DZg720DSIrlsrvHXSZ9p7ZGlrzSgirNcetqVp9/vz5FJTqj6JRejTdq6eBMzNpHP9s//QrF4bvrydfO6f1JrCX1mvcXlo98Kembjotr3wXwmrnp36J+pYNeh5JdqRem83O77gxkpxtW3bgOZ/g1HKJmt3U1Rw+3D+zrc89aunagnWzpq6PdxujLz388L4F78tdbtCEsJZ7BFq8/sHBoMPX/I9hyrGgnuDUUZzrnnz7yQu3HlxQQW2Ued++fZmJ1e5LoPB5k5ZpWCPXz+08du+99zrtAI0QVjuM4jL2YcIZeh+2+9wF49MFtYJSlgmHE0g/JlLWLJQPg7RmhtyXsJ18eja0tivsXhj6xy9ve/mRR5TRcG2ZmjyViN9NPkDN3Dz1FW5z9XM4i+s1ME1YcFNpUIrVLHzJzHnwjl0bn1twgW1UwPHjxxPXpztejR0HFTc+F3YXRwxdfdM9W08D0zrs4wtLaM5rkbCac1xaolWOvurhZIPIih0OdVm2haNTfqUlAFjCRnJP4HBn+iUqz6tVa2nGpTe/etsP2o2s2G8hrGqjL/FlEQC5GHghfplSUSMdvwaEA/9+4vjpa3c2stx2KIsfUek2dr+EuXNF2xEjSJx98w/tbFt7NiGsdniSl6EPp84O3W/Z1oPzXRms1GRKWdCJdeCIlJ+vlGYlh997r+70+EPH8NHJEtLCauCph+7bmj81ox1xEsJqx1Fdij4Zxi9AT2KSYBrtslgxhOD2gWOyz7AstFzx6zFHj1mGobYUYAgC9cHge3ddK5uhjQKFsNpoMJeqK6+8cm0X6noXiWUxHA8WxAdWNyQM45HFKL8dyiRpueM7jllmMGpnjO+1w9fNaxmXxiogaqlR0jQdAkeOBPjczrnOiQ6jw88ESSOA6KT7iQzOHEvavu1pZsLQg4QPP/DdZG9Xx/vWrOr+mfR03SvtNffdxleAQIgvTzjBT0w409Mpu2faufZy+vDhw5WPMa25dEnYqggIYbXqyNXY7i/jCyvdfmaVb5hdVsLp9LJGp43j1/1A7/RdvdMwPRzEboRnLVHe9vEvL3eXBOB4ZMta22H+TiqV2LJQ26u5u6Bju44Z3J7O/Lvp6cwPmBanOwQ4uNHRTWMK21bSvh1Mm642nTWCtKkH07rnTE72aOO0XZq7bIltVQSEsFp15HLthg5J/+aJE12m3tVjOPYq1/dW4cTjHnwMYhXOce8xDd3y/PJW6OpMdsTRVy4iK/rKMR/jwvz825VIHFzT3fkx13UW/dnhRy3GJyeeHEs7n1XNibUPFvY6vtGDw5vV9w0Vofn81qGhZfDhi3HX8SfQ/3HPMse9CWcCX0gel2OIFJIt+2fRH7qWRaYJG85NxldGzV4tGayFSLQ24+q9ULyu9gJfMU5ELTn6wUISTl03NHz1KzyiJLqmX657OLLdSJgoXTO7cBxyN172blier4YCvBsFdSNXV2dC35tKJrbzfPfFdjwvC/qs9MSMxxNRsSqmT6LhUDQHE+jUBE7UnATXTuLsrRn01K2l/x6+qItiR3TNG8V59KNB0DGSfNXGUXwJY2Gm+osNhpSvEBDCasIHgVLTt75/aQ0MnXpBNb2QgNYEntfr4wu/nBYpKQLtxtdwAh0SBX3VDe7nM/Ha5vf1Fb/CURS2bCTAWWuxR229qRsbQQQbUed61LfW14JVKKsTJ5sk8WUcHbtlNANyTOhgcmAGKH7p3m1FWpqtuZCu+LByVdKHVMjpKEQrBwIW9tnpXOIH+QTDSH/D9f0bmCLewDn1I4HmwtAypPDZ/oe9oXKf/aMPsWxSs/RR13FHrURiZE1gDR86tKHEdCDMKX+XCwEhrOVCvqBeHNaW6ui11/mWDtLQ1kEiWodXE4rwYgepAPssTPCMOjIdAk94TZ8pMZjch8HjDorGFUTUAwlkh64be0A9/ZCatiDZWtOyE7ClQmIdJICJFYhA+TRV4Fo5/QIHiUvrTEbkVRCxiJfsSBbfYk87OTExXxdazY5yUgiRKfpHQ1YSkONmAZY+gV4NIeVFfCXoLNA5h/Plb5LzWAyzF+IVXdNnvO/6GcsyhjC1vmWZ7s2pO3fdOqzriy9asnJxZREoerDLppDAhiIAEtCfO3F5rW0a6z1PX4/nf53nG5RqqrpieSnULEVh8cx4E7ugH78H8tG9eP/24oVezY+pkpA8b/abhPF8le75BqdsXUtaFeaTlTI2IByEoU1l8oq1mkokcZHElIRoWmpejMMCMyCvQXyy7JjjuUcgOl4tLCzCMpTHgFpcgkViX/dH/ax2Szf8m2Yqc/MN+1r7BM/C/rfCtRDWEozSkbMjq7NTY5t13dqE6dhG3wsSqlp+C9DDi0ifLrqmT1f6BgUaPjiHN0lJAGAfvpWcI4XjiHIMF6ocO/EjmMa9HeelQ1LT1PRpoce/sJwOTCQtc+kfGQp6Uxl+9JWtmL+jNEaJ0gKBgbsygR58B4sHfwV5aliVWg3vCHv6ymHcdG868IzrVsK6pnd71+/dsmXxbD3m3/W2ybn0T1/bQFe5I8euX+9ybuqbXMPbDA7ZCKV4uMOecyz+9OfmWvj9x9zEw6JW+JuOX298WhE6qtwLEV3TL1tb/AWj7sqwfqaro/sdmcyM+vBp2XzzDEzaBiQsNH+e+eeTjQ+ohwqnG0BYhfVzNYKrkOmpyauYYH8KvD8G6RPBszrC6Jq+ystl0ghzXEZjR5+O4+iZwTh+eG7Yqa5rq/3hGzzTSkXKn4YgIITVABjBP+ZzP7i8ydasrZCetuCHvIvFRs92SEdlpnCYE2LOQi12OA7RNf1yjrphHIyE9yOXPnfNMDg70DpdTf8DWDKs5rRvMVwChAWrUgh21HzllD0NrigqlxKVC7bKQuOOWeGiuI7OTkhb6T8C/Xw3xkel9cXxj6eIxiY3Hhx3X9dHsWJwDaa3l1+zd9Mt/F4tUk/ijWnP+/DBb8++LWqvnh0c7NDGta0pO7kl6zpb8AJzEUr91kYEFdeBRCt69Nm4+AsSl6jwjVGckY6VwPwUpLhLURx9xliWvxFHi/w+zB0SWCnLsVpxnoXesSI2ngp4zmRJXPgf/0IleGH51R6uwjeX5MR76qtITh7+8N9Cp4GF7Sm8Zl1s35pVXVomm/5c1vG+Wm284njHJeJq44/FjixUAld8w7uijW6+xo3MhW2S6+oIVHumqpewglJ87+LFtcFUcqur+1vxwPcZJqYPMOyhXw6GKI4+4/GwQpjCBhe+6XDIpFb06PM+np5hhS5eXzw9bLJ2pBLGv4Fe36BU4kA6IQGw8MUY6MJywVeqDs54Z69zrWdY7jI3G1ZtUiSV6zzDI3IqLLew/wu9jspl+yywrA1pEed5QceXPT3jBb/DLrA5ua5UHZ/4eMTbFx+fwvE3DJO8fANrjlctL7giJhRx9MrfR89R+VgJ1Y6currONuwd0FNsxwtV02mPlWGLy1TxlPHf6Hh8PH9xesvw9yRM+5PIRT2ZIgVKKZxWUY/PT8aTFPji0i3m4Ed1hDWV/7uY9bNGtiGqAyorJRWSqCgdkrQiR5KddrwPlsq8xfhG6efvx8dvtiQczDdmmPaldDBxSVYeZ3GJXxUMWzxq5d4fPz7Ym7X1HTAL2A7NqtJHEQ3qtCPjw3LoxB/v+OMZ5VVzR5aHWRuErYA+y4uu6fM+Xl9J/lh7bFvbY+vmv0bWos9tsXAWSLIiaSnyApHxJz6SbFSFuXTw8i86r5vVRW1m+6IHmUREAuI0lcREP5q2ztWPrO9/YK54xsXHI56+cePvj3qBfimZNS+J5FWMcrjptThsRd4dPX9+DcwEd5iQphwozfkCwJKaLv9ewHYKeicfSudwShcnJDBBOD3MTwGRO0cqLIj73jQTaejDBYaPHTBgJ/i5+HyYijd95sFhRzkzB7yL2IrCtGwezj9nOQVTUlfPwiicifnu5J0qHHd8mXHIG6ZD7JQqIk9kJK6QwAokMWRUhMaSeJ0vcfaiXNhs7PyuwpYV51Vh+EM/Pu2M9GckpyiOuZm2Wvtom+Y4me8xPbvIIujzPu6Wbvyt1ejL3U7Sv/v754ZHsORwaX3KGdwiJhO5pzY+Mivk/urVq52jTnIXlEc78LKu8qAMx/G8kHhyOicosz0ovM3IrIDKb15HSvDoOoqv+hMLYCOWI8ash0vmufryZVcqLz4u8fym3ov1xT/EVp4UDUTn4/iS0xW+sZTMojASmLqGp64iH4FRXJQ2TKj+lv7JVRTVxwQkm9APyaboGnGMzSVR6VR87ipsVT645ovOzi5tamb6zzB1/nqzjz+s9YetwLioZW5C8jq08K9+1IxS8yQsfF6ap1WL2BK8VOaJc6NbPcPrx7wJ++hmHQUPvOaQgMJ3ETtVlERDP0wVsQ19uPgcLQyt/Dc+p4jlL6k/1xa2qVyh5ApEzEoErm/DsPOTXV3de6anq36roFyRdYWVbVSshHJEMt98saIXfIu9koplYZL6m/hUz7kS/Jt0/PE8+Jj6X/Y6k+fv2tA1BKIvB/OC8WnGAmp5dpqx3XW36fjgYK/upXbhFd+BrRlqn16MfkrspkoC4hnirYjbUVWzs4rHx8uL3cerjwt0TA4RcBcsuX8Rn97q54okVsCKJJ9YkSvy1gJR4aOtnAr6OJP+L13d+BKBKMEzHhAfgDh6yzD+vqHjTDDvYpAxLqwEfVdbE9bpIEi6V27tdLP+LnzPrWS/XrRTnz5d4e79+LNY7r4kP+Z7Jv7z1LyPL0B4Tb+ci9cXLy+eJ54e8Rw//rqqcUR+HOrgYVprJbBl5E2w63oI64J7k8mUDZLGhmAXs19ucVkxP8gKQu4ptCxbMy2TW3KAGI4u1P207ztH3CDx/7bL+Cdse8h1Zy5ev7Dp8uHD7blJuy0J69TV8XW6l92Dl3cbLG6g98idbhDgdANcY1ZY9o2N4mpNr96GRf1Da3Wui0RW69F1bWslvp81LD2xDTOGu9DhQzBc7AcYfYlkAqo6A6ozqHNBYJTESGitTGShsp0qQSxT4AcoPJQw0LBlEPhBFakHDjoLvY+XgVIyg7WK77tG8n9pvpHXBbXL+OMBd7FN6KLu+uf27esbX9RHdIkLbxvCGhgYsDb3v2a7obt7YHakpKmYiqgE2ioqJbzIOszXcSov/DAzRRNehyJKvPx4+igv/ZLKEaCkoZxUFMYXE1I8f7Xyq/UHp9CkAlfbCF3NdlhS7IQguA0N2wiJYy1ktC5IISb1Okr5jSYruy2SGlYkIkKLSC3yy/WrUWGzSnjaTUX/QEhYQuNewLCdwBFKRkpOuAfr4sBnwwfDg6B0MHagORhBHNqHw5WxTwYav6lAt/42MBLfrYZXHO9w3Ftr/B0Hp0pY+tkD29ddAz5ln8NGjddSlNPyhHV8aKjbzAS7Dd3egRcvgRHJWyrHASw9Pyp+vlSxEluH0jWAGQF9VVZMpxHVRZ/xSKQU4PR5Xy0+/sLQZCFS9DN/XKtSeh5WrL2x+sMyZv+W67+vwz5eC7oDx12rm9pakNg639B68XL3Qh+2Bm94DySxHhg0daBHSQhiCbyyyMS9SDi8RhEHyYP1qD9qak0S4VGn5VYrSTRKEkKHWYYiHuQmCYb/YKYLqS+3H5LYckxJmz6qhSYJ5yNgzgtuclESpncBfN8Fj3lgJdCSGpHcGECoxrouMoHjzO+4evLLMB1VKxJV8Wyj8Q80Ix043jnTu32hlTdkh08Yn7UWcnio9Qs3pzZm0lN7LCOxIdIZxbuQ1+lAVFFxJB7aMeUIiPkiPRPjo2v6dPF4FVjHnxi/oQK0Az/bymf5uI7ayGLj6eM63nrbF5VNXzV7nv3HViQL3JAEaSV1z0iBNJIgJBCYkSKJYbdjEiSHw7a0BI5s6QBBbINUswMUsQ6E11UojZGccA9dcZDBdQY+TgyFTgkiEKYyIBvstAQzIRk8cBJ+A2j4gZFDFWAqjAp3V5IhQYYwwUJ57ByS0QINzMYK8FyrRxt3KNbXb2qG/UVNT5wDyCt6/A0boGbdqzPA4tD21SPquWihPy1FWHjQzYs3xnZkM95ePIZd8RccBx1xez/UPowp46I4+uVcLD9/8Plq0Gfy6Jp+uez5uqPyY+UtNN5DuVQc06drpv4bIDXsjtsMpdkOSC79QK4Xog3PzwF4IBNCBiIhpBSpoE8jioqWaM2KCRuOqwLXgIQItKIe0lCYD/lZjoqgGIo0+J++SsmMKA8eqQ21qHuUh2PfzQHN6vgG6vVK8GfmQhcbr3Yff+AEi3rtdCtNF8u/eIWD2ATXx4Mg0XH1Vr/hm7sDQw8PvyvTrriKWocEE0C6oM/kJRJHrAykgj6WGlq+JUifu6YfS6pu4/UVa6AgQcXKi78ApekhcWFBwMstEkTX9MvVHw+Lt2ex+4+Pg62CxgsHEwZbAdgWIJfA+ICkfDRYtyAwWWB7Ay8F8VT/KB0bOJ4Gx/CQfUKSwZGrJJs8iZHYgB0zMB+zk8hopQ8hEcEog2ERASIBAOL5fIrVIKLxXKtzKPZLgZUckvGf+/nH5HsK0+Uz3316zeAjj3D23Lwu90w0ZwNpiZ72UnvwfO/AXIFnXfLBxLOsHn6yiLqmr3oQ04LHX9hq6TFHI6txrlYWkHj98UT1lh8vryR/rIKq6aO204drdP8hRWF3itmLUw42QnW1CSTSA2IAIXkWOBYKLWw8wjVqNkEaFqjFwLQNJhWI4ZiFoiq6QX0SbsEo6HMoWVFCYprwjw6FP65BXCSoXJwiOwpnFK9A6yiWkQhRDwA9XAfpwLS/AqnqSKP7jwapquiznXFXMn6x8Yg/X/HySvLHKqiaPlZfvf0H6BloAM/v3tpzHkJwUx59Uxb4GE5Lfnt2ZGS16SX3+F5mq4llfegtwnaSR6J5EC8hPUV6IDaS6aDnoZ5DpYe6AtdgOr4pyhXLNPH0KKCo/DDP7N+S+mI6qHzbQr7AbdgW+iylWn0l5cf6E29ftfSN6L9lGl04x30tOtMHklmLhxpClW9BL4S1T+i2uNPRp+0FflD0AN9A9LHnmHGBBfJCE3QL9ALiguoJqiu+64gDzWGIIAlhzhaSDsMV/yjJi3BxyY9khP9BXBSzEMY/AFORGMmM1yyKZfmm+ZKuJf4uMHV1THEj+o+S864E7zYd/8Dliqp2MamvPbt9uw4dY/M4DnXTuMuXx/scK9iHLcbryzfKwvOJBSGNPl10Tb8WV0xYyMFymDdXXv46Kq+ueChJQI4WlSUqf8StOf5CNdXqr9afxe8/Gm6AoLAqGKyCGLSG350ACFzKM2FvaeOseEhFOsjItdQ2S6wYYmkOdl2+CfLBvmpIV55vYY2Qn6uAxAWC40zbhxSmWArcQj0TSIiSU37mx0kgVesgLereOSz8E5EWJa6Qzyh1hZEcO7xY4Ct9WLfNvwa+5xA2h6uGP6vMPxMsZ8WNf0Gf+cOCw9usq51a5+kNG9Sn1IjJsjoO0LI7EpVra/vxhPdFs7JyjYriohlbTAKGxO1C6oJEljseOLqmTxfPX66OucJK66OUNzuDjK7p05UIbGwX25I/vrj4BYrnD0uZ/Rtvfzz9fPsPIkgkbL0DZNMFRVEHFEY2ZCBTcwMLdfCsCCVN4SwpE9YG+ARNgD24IDHYSYB1yNCYDkLRFoC8oOUG40AKQx5IYyAmlQ6SF7dDoSof0hbJiApzqLs43aPc5UG+AvVQ/4T7nGQFQiJ5kdbAkmgH2Sz0FaWB4gLrad22v4nmuvPt/yzCc1+V4t0e4z93r8PYwDCvNANxLSthkai0jmCf5+jq6y6Y4SkjTfoKprgWufj9Dg3AozBmiK7pl3H8WDH3u0YfLY6u6c/HVS2vSvsxoygyTF2q/qNenEyjJ5NJPYGPRidME1M1/JYqwyoNq32Ihu4J0z5M+WA2DoqwEI9wfmEaEhQJzPNsKNOh0jJwrfRVJqbnNOrC6IGwQFzgHiKrpCuq2kE+FizrMXWE7IWCEKemg7hSiimOQchNIC3EchqpHlBO95TshQThkwF5TL9k+Mm/MZLGzVo3AlQdLzagDle1vCYd/wU9/5Z5ZcyZPnNow/J8ZHZZCGtsbKw3rdn7nIzTx42o0WfP1cPKuYJ6XPFs5q7p8zmKx5v8cdcxDeMPOR1fj+gh4X10TV/dukiC+nJPeLy8eH1hrtm/UVvpKxcrP2oL/dlcs1eQ9PCeo73wGcp+R2Xyvlp74vH19B9EkoA2CYKUlcQqJCQj6vkoyBjh/IurcJiy4Zxy2FMptRBO7sK3kClR0UYUZAX+wMqfC1ICiYHMYBsKSQsSFKaAUEqZLoiK00ASFsgpN0UEUWE6yOkiiArE6NmUb91OWwAAEuNJREFUszCNxA0c/uBoF04W86YOarWQAYjGmHBBEIkUiXEqib025hNmInWknv6zKo77Sh3/RvcfSx5Xl4O4yr5Y7NxiuEEQFT4uvs8yrF5VvosX28LLS185vsiRHkc9YPiJtrCbJIzHyx3gJdfpl80flZWPR6qIxJghus7xjSqj4E9UNn2VvN76Csqq6XIR+48OYEeGlcAaXhLfQwxNQcgQEI9IErOOxBUuCuDLz9Arm5iyOTaYy7Jty8hAb2VCm43ZmwnwQTbgFpAWyA4SGEKhaMdgYNpngKAcpeMCAfFjYGE4yAqco3RZ0LorUqOkxVkf6AgzvFBPFbISSsOUD+WRrWijpcwbmI4Gomj4yxAIv4bPVU+q9sfxk/EP36UlfP49N3vNWr/m9CZdX/zzjDDofAoW3XHVr9NPHdB8p2+uORl/mjFLUktMbBTtkSJbpLCRxYyD5OpJps/4+DJuvq5IIgoLqfi3pLzcRuloM7QSzKImsBSWG80LVKkxkSvOkFHaCjL5QvrPN9rwvaSVtEg2ICmQCNRQkGjwnlOpNktMxdds+GxcRFrIyCmhTQMEUJjl4qwtzPbAOVC8o0DUZroGiMmBpEUfRBZ4DvRUJC4/1GOpij1ML9XU0PJdFxIZGsOpJkkOQ0YdFh5CPodKl0WfRqQkVUhTIEf1iN4GkdJU4Rx/xsJfHkpfMv4cd+IAUJb1+YdkfSU7NXp6+/bti7qquKiEdfVq0Gl2TO2DonYzAcUTCv0slCB8FuGia/q8j7iAPl30aNIPHVKq55w+00MvjFLo05WmV8H5P9XLzydVF/H0xbGl9UGfjm226B98po2u6fO+0f3H9M7SbT1h+FoS00ybSmm+5/RZHxzbwWvVHtSvNuLRR4BKl0vPtHRhWh1SESUsNBkH0qjvNiAx4MA1JDBc4yBmTPmwJArJCFM+dA1SE5XsmFIqRTzKUrZYkMio78IUkauFoW6Mcbin1GWrOR8nqOEUEUQFmuK3ZdEw6NFg92s9j3XLp0CIsAuS8VdPkcKhCZ9/KAc81x/c3NdzFjy6KHZc0YPNh7VhDg9jYnh4co9n2dvx1nLalys7Rimx2xLGigfEJBQ0Xr149FkBVb04BQiTlPAFbTiDxRGKM1pJf5AgarPKG0sQu413N07hkCANO5m0fSebtCwziW5DqMISHTRMJCDF23inYbmsauNCHq+Vn1ta5dErzKN8psP/RiIXVpAegKJQ30Y06AQSEXdAIpdL0wbTNsLpoSIeCwRJHZYBpTusIFAIlPC0iqL5AxoCcmLPQkkLdITRCc0dSFqQD1A51g4pLOXmhZCwDMO2BpH9q6ZtDoU4oKQIy5yEynFnv+mzw+0+/q3Sf5yT4aYs89zq1alLIK7wYeQANcCpgW5AOaqIARzxcudrXrMTz+cuFAxBI1Rw06eLKz3xsnDikt+Mmr9mWBlXrbySeJAlTt8MXJImXHRNv0zx2GpWZ3r0KKqzXHlRHH26+fQf+mkbg56ADjppUuihMJl7BEhGtmnj+4Phj1lEUAzjaQcgJkzcqPPmlI/yjdJV8Trf/+hbeYyP0uMS0zSVF8SEaSELxkhR6a7IC1IVHkNMBWEkCljxYQ7YXgWKrDCHw2ohJDDKSkr5Tst3TANBp7DdgkTFKSOpxYMtV2i3hXQoJjwbBo3L4oibAajdXmSbCl01PEvi6x3PetMvwfi3cv+xHpPRk8GZvo6Oq5y5FvZlvtfqQZ5v5igfH7iRdHqrn/H24McyEb6ejCUxkCwqEATi8JDNKtWRIxI6wrLj+aOyQgIqLT/KTZ+OLYnCFGHE60PdSgzIgVmcfrbt5evjYkB97VeNyv8plx/UYoChElhYgB7KtD3PAUWRpejIVNzNAjNzyDuYRqnrMF5dIx4CkTrlAJQRps2FhZIX5lqYwfFLOygTBeSmkUhDEgNvIC7MR5ML6JhozoCpn+858G1utbH4j7BRT0Z9VlZzbTyOKJCKeCjkqYbkFBJh+DXCPVcKuXKIFURlm8WBoZSFOBCYmk6i33ioT+Kw1CegEMspcFfe+M8+rRySNum/YUwm9I7TPT04NWOBDg/nwtz16xMbEp3mPswIOuI6G7wBSlynz1pQWZEIP0smIcEEWN3QsfJDn+nj9FFSPh73wilgdE2f+eOumo4pPqWI2kI/LKu4RVXLq7H/kJopRUFhnkj4joNT9KC/BlZgAIVD1I+cwASVUBgCIsF1KEQxJLpGPKHGP5LYrAs5ikREnmJ61KF4K5cG1+REVS6HC1JauGroYYcOrLWUEp6MSF0UpoZgK5hV2dgEzeNLYbMBnRQZEUPnOwGMT6GOp57Kg/0WTCMYjnsQHpDmlJFTR5IcNt/alvV1PdF5NsKcLSpGG03L6QcjnWDpeIXqgFYb//A9wGi1+fMPDeqY7nae6uvT530KKp+JebkhHJyX6Fqz33X83tCgRr1d6gXBH+XnFtEwDmEVMBfAtbK7UvHxVTb1gGLQokbFVBZMDtUJHmT+dsPxmqSRU2nkrxkWxhfbOfEVwLov4sIaonSRr1qZy6vy8xliPbn+qPjYHxSm6mJwdB357DfaVtJ/BMLeW0/ayVQSR6TA5AB7h8kwmFeRrFBUSFYkJk7GsM+F5SuiCQmFBEriCskHYcxfEM9ozBjBS/yaKD//rBzndjD3BHswAcmqwFdhOWGugCw5owwpEt9sxMlVGWQEK4GlcAOi1XAcL6eLICfdcMFmNDnH7xdO/YTCHTkxM2B6EiSPbuXmHrZO5eJy4Iu6lfo2Gu8orFfA+PM9UMjnHpBIx9v+/Q9Wm8nMfcMTE1d7u7vP4Ec6fzy1wqOGP3xI63JHjgT2/rsy/boTbMP0pe78dVUWS5wjK0VUjIqNN3kA62ZYeIcfxofXDFNFUZBTT4W6m71mWBlXrb4yWSoEYWh0jVIUdJEmzA6o18mRDN7dCplCEkK8IiP4WRAU9OO8j5wimZB3SAhKYlJEphLkJCaSEP7PEdxsfVG5UWFxP6qPPngTlvBED6IWLN8dTPmg8ocFPPRXWBdlFWqqCEmLlhAgLRtKdLaAkpQNfRUM6DUQGOUiTimNEaT7FvRVw/F6K91XG4/mHf9KPaovvJ36jzfSS1mpc6mUdhnvhZL4a0GjZsKBKK+n0+kt0AHvztCAsIzjeeAeUKVPF1l101cBWCICxcGmcPalUeHRnyguIsJYej79fFnpKxdjrKhu+spVK69Ke+OW6SXlh7Xk/8b7D5umJKY6nUiQAEmp5ZKoD5Ay8kTFzcAsJIrL+ZREYCWAaU4ubXRNP8wfpuSuGubHMwCJhSuGPCiYJIMw5GV6xkfY0Wd+WoPiBAlEhvnzNluw3SKZYTkQHIQ5J1RQDg7Lw/QQGUIdFp4wcC9KgQ/7KkxjucEHROVmc3ZaCFfEjMxUvlPvBZ0WhT1Q1zG06hQKyGPA9qEh4bPRJuO/0p//WvoPyXpa77BPr9L1mn64QiJRT0vlP3jg1oyn0/th1dnN6VOkQyh8wVRuPpLUH9GHi+sckD4vLaj43NSHLwfv8cKjbGxdgc97JUpFpIRbpovKYHTUltkpHYkyEqNYf1gWfZU+Vn+JiMZERS4qKyTAMv1hmwoItLT/aL6OL9cn8A4mknhDkR5CUuh43ExhAXjnIQVxRQ9UwnU1JM73meHISINzlY/1Ir3jwNQBtui5IpU3K2mFZbEUEhgJiHlZhkqI8rws7hPFxBHlZ5romu1CGRSv2HyQEQiLPkwefJcSk2o0mU+F8Z46KswbKd8qvRUWiq7BsuoYlF/q+Jd839p4/KNnFHhw+Fbc819r/y3dHO7qsk9D2lLPBvEq59SLXC6CYSCq1OTk5F48g+FxLyQSvvyzhFK8taaYL1ACiYdkkSOg/HVO4irmAySLlR8+yHy5wnaWysTF7YmnRxdyecMXFDcxx3KjNCUEGUtb2r4Iixwh5qebxEG58v2Hkh0ERqlLp5kClNLkngLSyF8XExrZi089SYbFm9DRg1FCbEKyoxQE8sqFkTOgTwrDVIPCP/k8qpRcGrxMEXmxnpwjUeXbhjpgA2bBNsp0HPQWOiwNOnddw5YcNIdSFyzTlUKehEbrLDxDNn7osjCXPw5FO22qgPfKHn/pf8XxxxetvSvYlX8BxBVKCdGDmPPDhz0W+Oijjxof//jHt+Hh2oko/qKqFx4l0BJQmQIwS3RNn/fxZXqGFbq4nQzimI9tKFs+S1S1KJ9XoQkEfUQwtKg98fSzefMMwmx5F28/IqK2RLjM2b54/gX0H0v6+IiDZSVgHJogfYWNzDMUpCtsUkKg4pKIUJAsnNTlkjNWzfBCPMOhi8JAiCSqPBmyMFVQ1OdctQwLywNZ5cPCpDl80D6IhjzBASQF0sUeREpSJCyE4ceSpJXbEO2612AHepaTSRn/YrtEAD3n8xV/ntv4+S96nyGRO9gccQZmEPiBK3bRi5kPHcG+v2T32n2+53bxNY8oQyWIB0SR9OmqxMeTh5lm/8azx8srEbCQNSqTpUTX+eagwCiPqiWeQAXO/olHV2tPaYUFjWCxsQJjt7MV564K6iOB2Xj1adNGa3PqDMFl4XwSSnAQCUIibqFPlwtTwbiOkoSR+JvLx3KYv9BXaSrlLyifSegQBNMFTAWhiIeFArRZnoX+8Y2EzKhbnuNlYO9wFpZXkwoH5Kmj/6qOFTz+0n8+Y4Y/2pVIcJqY35+YJ6wjEN33ZzL9kPY3hWjx6Sv+RcByLIQAZZYQJSn2C944FRF/QkvjQ31XZDcV04GVPOGl+WdJEhVGbaNPV3d7Va7ZP83U/1ACgzTjkg4gjUFvHhGWkrPAPnnBLNeFSEKKfAbzOu9yBAUdVj6cZURpZuU3XOUILioD93x2IEnxxFGc9c6M+M93cHSNZVzHquBQDeMn4x898wQ2us7pgGvAbyU8/z5e5EupVEqtJirCgp4KHxVI7sbrQIYKHyKF3+yvIvEEX8FsQNk9qXwgBpgQwNo7p9OKrukzfdzF08+WTmYrV35YF+tU8bEpYImInGtLVH+8PkzZ8iQcVpjrawXCLOHH5uo/9JmWjbXHJMQcNhVW8bOklbsumnJw7Q+cgtVK2mJxAUNNKKncp54KHuzAwnjCE01B1UIHA1A80ik/IkdIfTj6mE8MXh2sSKZhdHUd+IcDykwFLj4eMv7Fv+il75c8/xEmeHaojD+jZ4LgbsPVVvO5iutg4oSAFCCiAqVp/jrUKRU8mzVexsube05ff3tiD0Q1wkP/ojrYgeiaftiheHsjLKL4GrudTxYvb0H9h94bpzeAwCD4cAqJf5SmlBjFH5D8ChVC1Q8KyIkrjtgbE64y4lqtINJHel5Hq4q4ZdsYzsWBWaU+rkFWtFzQbiNNnWciNbT/qD4+Hitq/FdE/3mWzmvQU+W4hZZPenQuRHRNfylcvfVjpUqz0Tj6dNE1/fm4euufTx1z5am3/hr6z6lj9A9ElneKwPJ3IYEVEpqKys0YFeUhoDBP4TV/+bjVIkfqKuu8/ixC/+tqR73111V4DYnrrb+G8a+h1tkk9dY/m7MxV7XUzwdP3ApBgCYG6Co+L6/+kcB4X0g0ERFFzwXjojBc5q8ZhqOKtWEoROmLEwSWBIHowVySyqSS5kIABEYhisRFEov8SgRWGD6K9OMgq8IwBIkTBBYXASGsxcW3pUoHgfF5iIiLPv9x+03kuLxMqaqsUj1KJL4gsFgICGEtFrJtUG6OwDhtJHHhqLOl+dBAG0AnXRAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBIGVhMD/D0fV/fpMMM+gAAAAAElFTkSuQmCC"
- }
- };
- const NoticeBar = {
- // noticeBar
- noticeBar: {
- text: [],
- direction: "row",
- step: false,
- icon: "volume",
- mode: "",
- color: "#f9ae3d",
- bgColor: "#fdf6ec",
- speed: 80,
- fontSize: 14,
- duration: 2e3,
- disableTouch: true,
- url: "",
- linkType: "navigateTo",
- justifyContent: "flex-start"
- }
- };
- const Notify = {
- // notify组件
- notify: {
- top: 0,
- type: "primary",
- color: "#ffffff",
- bgColor: "",
- message: "",
- duration: 3e3,
- fontSize: 15,
- safeAreaInsetTop: false
- }
- };
- const NumberBox = {
- // 步进器组件
- numberBox: {
- name: "",
- value: 0,
- min: 1,
- max: Number.MAX_SAFE_INTEGER,
- step: 1,
- integer: false,
- disabled: false,
- disabledInput: false,
- asyncChange: false,
- inputWidth: 35,
- showMinus: true,
- showPlus: true,
- decimalLength: null,
- longPress: true,
- color: "#323233",
- buttonWidth: 30,
- buttonSize: 30,
- buttonRadius: "0px",
- bgColor: "#EBECEE",
- disabledBgColor: "#f7f8fa",
- inputBgColor: "#EBECEE",
- cursorSpacing: 100,
- disableMinus: false,
- disablePlus: false,
- iconStyle: "",
- miniMode: false
- }
- };
- const NumberKeyboard = {
- // 数字键盘
- numberKeyboard: {
- mode: "number",
- dotDisabled: false,
- random: false
- }
- };
- const Overlay = {
- // overlay组件
- overlay: {
- show: false,
- zIndex: 10070,
- duration: 300,
- opacity: 0.5
- }
- };
- const Parse = {
- // parse
- parse: {
- copyLink: true,
- errorImg: "",
- lazyLoad: false,
- loadingImg: "",
- pauseVideo: true,
- previewImg: true,
- setTitle: true,
- showImgMenu: true
- }
- };
- const Picker = {
- // picker
- picker: {
- show: false,
- popupMode: "bottom",
- showToolbar: true,
- title: "",
- columns: [],
- loading: false,
- itemHeight: 44,
- cancelText: t$1("up.common.cancel"),
- confirmText: t$1("up.common.confirm"),
- cancelColor: "#909193",
- confirmColor: "",
- visibleItemCount: 5,
- keyName: "text",
- valueName: "value",
- closeOnClickOverlay: false,
- defaultIndex: [],
- immediateChange: true,
- zIndex: 10076,
- disabled: false,
- disabledColor: "",
- placeholder: t$1("up.common.pleaseChoose"),
- inputProps: {},
- bgColor: "",
- round: 0,
- duration: 300,
- overlayOpacity: 0.5,
- pageInline: false
- }
- };
- const Popup = {
- // popup组件
- popup: {
- show: false,
- overlay: true,
- mode: "bottom",
- duration: 300,
- closeable: false,
- overlayStyle: {},
- closeOnClickOverlay: true,
- zIndex: 10075,
- safeAreaInsetBottom: true,
- safeAreaInsetTop: false,
- closeIconPos: "top-right",
- round: 0,
- zoom: true,
- bgColor: "",
- overlayOpacity: 0.5,
- pageInline: false
- }
- };
- const Radio = {
- // radio组件
- radio: {
- name: "",
- shape: "",
- disabled: "",
- labelDisabled: "",
- activeColor: "",
- inactiveColor: "",
- iconSize: "",
- labelSize: "",
- label: "",
- labelColor: "",
- size: "",
- iconColor: "",
- placement: ""
- }
- };
- const RadioGroup = {
- // radio-group组件
- radioGroup: {
- value: "",
- disabled: false,
- shape: "circle",
- activeColor: "#2979ff",
- inactiveColor: "#c8c9cc",
- name: "",
- size: 18,
- placement: "row",
- label: "",
- labelColor: "#303133",
- labelSize: 14,
- labelDisabled: false,
- iconColor: "#ffffff",
- iconSize: 12,
- borderBottom: false,
- iconPlacement: "left",
- gap: "10px"
- }
- };
- const Rate = {
- // rate组件
- rate: {
- value: 1,
- count: 5,
- disabled: false,
- size: 18,
- inactiveColor: "#b2b2b2",
- activeColor: "#FA3534",
- gutter: 4,
- minCount: 1,
- allowHalf: false,
- activeIcon: "star-fill",
- inactiveIcon: "star",
- touchable: true
- }
- };
- const ReadMore = {
- // readMore
- readMore: {
- showHeight: 400,
- toggle: false,
- closeText: t$1("up.readMore.expand"),
- openText: t$1("up.readMore.fold"),
- color: "#2979ff",
- fontSize: 14,
- textIndent: "2em",
- name: ""
- }
- };
- const Row = {
- // row
- row: {
- gutter: 0,
- justify: "start",
- align: "center"
- }
- };
- const RowNotice = {
- // rowNotice
- rowNotice: {
- text: "",
- icon: "volume",
- mode: "",
- color: "#f9ae3d",
- bgColor: "#fdf6ec",
- fontSize: 14,
- speed: 80
- }
- };
- const ScrollList = {
- // scrollList
- scrollList: {
- indicatorWidth: 50,
- indicatorBarWidth: 20,
- indicator: true,
- indicatorColor: "#f2f2f2",
- indicatorActiveColor: "#3c9cff",
- indicatorStyle: ""
- }
- };
- const Search = {
- // search
- search: {
- shape: "round",
- bgColor: "#f2f2f2",
- placeholder: t$1("up.search.placeholder"),
- clearabled: true,
- focus: false,
- showAction: true,
- actionStyle: {},
- actionText: t$1("up.common.search"),
- inputAlign: "left",
- inputStyle: {},
- disabled: false,
- borderColor: "transparent",
- searchIconColor: "#909399",
- searchIconSize: 22,
- color: "#606266",
- placeholderColor: "#909399",
- searchIcon: "search",
- iconPosition: "left",
- margin: "0",
- animation: false,
- value: "",
- maxlength: "-1",
- height: 32,
- label: null
- }
- };
- const Section = {
- // u-section组件
- section: {
- title: "",
- subTitle: t$1("up.common.more"),
- right: true,
- fontSize: 15,
- bold: true,
- color: "#303133",
- subColor: "#909399",
- showLine: true,
- lineColor: "",
- arrow: true
- }
- };
- const Skeleton = {
- // skeleton
- skeleton: {
- loading: true,
- animate: true,
- rows: 0,
- rowsWidth: "100%",
- rowsHeight: 18,
- title: true,
- titleWidth: "50%",
- titleHeight: 18,
- avatar: false,
- avatarSize: 32,
- avatarShape: "circle"
- }
- };
- const Slider = {
- // slider组件
- slider: {
- value: 0,
- blockSize: 18,
- min: 0,
- max: 100,
- step: 1,
- activeColor: "#2979ff",
- inactiveColor: "#c0c4cc",
- blockColor: "#ffffff",
- showValue: false,
- disabled: false,
- blockStyle: {},
- useNative: false,
- height: "2px",
- innerStyle: {}
- }
- };
- const StatusBar = {
- // statusBar
- statusBar: {
- bgColor: "transparent",
- height: 0
- }
- };
- const Steps = {
- // steps组件
- steps: {
- direction: "row",
- current: 0,
- activeColor: "#3c9cff",
- inactiveColor: "#969799",
- activeIcon: "",
- inactiveIcon: "",
- dot: false
- }
- };
- const StepsItem = {
- // steps-item组件
- stepsItem: {
- title: "",
- desc: "",
- iconSize: 17,
- error: false
- }
- };
- const Sticky = {
- // sticky组件
- sticky: {
- offsetTop: 0,
- customNavHeight: 0,
- disabled: false,
- bgColor: "transparent",
- zIndex: "",
- index: ""
- }
- };
- const Subsection = {
- // subsection组件
- subsection: {
- list: [],
- current: 0,
- activeColor: "#3c9cff",
- inactiveColor: "#303133",
- mode: "button",
- fontSize: 12,
- bold: true,
- bgColor: "#eeeeef",
- keyName: "name",
- activeColorKeyName: "activeColorKey",
- inactiveColorKeyName: "inactiveColorKey",
- disabled: false
- }
- };
- const SwipeAction = {
- // swipe-action组件
- swipeAction: {
- autoClose: true
- }
- };
- const SwipeActionItem = {
- // swipeActionItem 组件
- swipeActionItem: {
- show: false,
- closeOnClick: true,
- name: "",
- disabled: false,
- threshold: 20,
- autoClose: true,
- options: [],
- duration: 300
- }
- };
- const Swiper = {
- // swiper 组件
- swiper: {
- list: [],
- indicator: false,
- indicatorActiveColor: "#FFFFFF",
- indicatorInactiveColor: "rgba(255, 255, 255, 0.35)",
- indicatorStyle: "",
- indicatorMode: "line",
- autoplay: true,
- current: 0,
- currentItemId: "",
- interval: 3e3,
- duration: 300,
- circular: false,
- previousMargin: 0,
- nextMargin: 0,
- acceleration: false,
- displayMultipleItems: 1,
- easingFunction: "default",
- keyName: "url",
- imgMode: "aspectFill",
- height: 130,
- bgColor: "#f3f4f6",
- radius: 4,
- loading: false,
- showTitle: false
- }
- };
- const SwipterIndicator = {
- // swiperIndicator 组件
- swiperIndicator: {
- length: 0,
- current: 0,
- indicatorActiveColor: "",
- indicatorInactiveColor: "",
- indicatorMode: "line"
- }
- };
- const Switch = {
- // switch
- switch: {
- loading: false,
- disabled: false,
- size: 25,
- activeColor: "#2979ff",
- inactiveColor: "#ffffff",
- value: false,
- activeValue: true,
- inactiveValue: false,
- asyncChange: false,
- space: 0
- }
- };
- const Tabbar = {
- // tabbar
- tabbar: {
- value: null,
- safeAreaInsetBottom: true,
- border: true,
- zIndex: 1,
- activeColor: "#1989fa",
- inactiveColor: "#7d7e80",
- fixed: true,
- placeholder: true,
- borderColor: "",
- backgroundColor: ""
- }
- };
- const TabbarItem = {
- //
- tabbarItem: {
- name: null,
- icon: "",
- badge: null,
- dot: false,
- text: "",
- badgeStyle: "top: 6px;right:2px;",
- mode: ""
- }
- };
- const Tabs = {
- //
- tabs: {
- duration: 300,
- list: [],
- lineColor: "",
- activeStyle: {
- color: "#303133"
- },
- inactiveStyle: {
- color: "#606266"
- },
- lineWidth: 20,
- lineHeight: 3,
- lineBgSize: "cover",
- itemStyle: {
- height: "44px"
- },
- scrollable: true,
- current: 0,
- keyName: "name",
- iconStyle: {}
- }
- };
- const Tag = {
- // tag 组件
- tag: {
- type: "primary",
- disabled: false,
- size: "medium",
- shape: "square",
- text: "",
- bgColor: "",
- color: "",
- borderColor: "",
- closeColor: "#C6C7CB",
- name: "",
- plainFill: false,
- plain: false,
- closable: false,
- show: true,
- icon: "",
- iconColor: "",
- textSize: "",
- height: "",
- padding: "",
- borderRadius: "",
- autoBgColor: 0
- }
- };
- const Text = {
- // text 组件
- text: {
- type: "",
- show: true,
- text: "",
- prefixIcon: "",
- suffixIcon: "",
- mode: "",
- href: "",
- format: "",
- call: false,
- openType: "",
- bold: false,
- block: false,
- lines: "",
- color: "#303133",
- size: 15,
- iconStyle: {
- fontSize: "15px"
- },
- decoration: "none",
- margin: 0,
- lineHeight: "",
- align: "left",
- wordWrap: "normal",
- flex1: true
- }
- };
- const Textarea = {
- // textarea 组件
- textarea: {
- value: "",
- placeholder: "",
- placeholderClass: "textarea-placeholder",
- placeholderStyle: "color: #c0c4cc",
- height: 70,
- confirmType: "done",
- disabled: false,
- count: false,
- focus: false,
- autoHeight: false,
- fixed: false,
- cursorSpacing: 0,
- cursor: "",
- showConfirmBar: true,
- selectionStart: -1,
- selectionEnd: -1,
- adjustPosition: true,
- disableDefaultPadding: false,
- holdKeyboard: false,
- maxlength: 140,
- border: "surround",
- formatter: null
- }
- };
- const Toast = {
- // toast组件
- toast: {
- zIndex: 10090,
- loading: false,
- message: "",
- icon: "",
- type: "",
- loadingMode: "",
- show: "",
- overlay: false,
- position: "center",
- params: {},
- duration: 2e3,
- isTab: false,
- url: "",
- callback: null,
- back: false
- }
- };
- const Toolbar = {
- // toolbar 组件
- toolbar: {
- show: true,
- cancelText: t$1("up.common.cancel"),
- confirmText: t$1("up.common.confirm"),
- cancelColor: "#909193",
- confirmColor: "",
- title: ""
- }
- };
- const Tooltip = {
- // tooltip 组件
- tooltip: {
- text: "",
- copyText: "",
- size: 14,
- color: "#606266",
- bgColor: "transparent",
- direction: "top",
- zIndex: 10071,
- showCopy: true,
- buttons: [],
- overlay: true,
- showToast: true,
- popupBgColor: "",
- triggerMode: "longpress"
- }
- };
- const Transition = {
- // transition动画组件的props
- transition: {
- show: false,
- mode: "fade",
- duration: "300",
- timingFunction: "ease-out"
- }
- };
- const Upload = {
- // upload组件
- upload: {
- accept: "image",
- extension: [],
- capture: ["album", "camera"],
- compressed: true,
- camera: "back",
- maxDuration: 60,
- uploadIcon: "camera-fill",
- uploadIconColor: "#D3D4D6",
- useBeforeRead: false,
- previewFullImage: true,
- maxCount: 52,
- disabled: false,
- imageMode: "aspectFill",
- name: "",
- sizeType: ["original", "compressed"],
- multiple: false,
- deletable: true,
- maxSize: Number.MAX_VALUE,
- fileList: [],
- uploadText: "",
- width: 80,
- height: 80,
- previewImage: true,
- autoDelete: false,
- autoUpload: false,
- autoUploadApi: "",
- autoUploadAuthUrl: "",
- autoUploadDriver: "",
- autoUploadHeader: {},
- getVideoThumb: false,
- customAfterAutoUpload: false,
- videoPreviewObjectFit: "cover"
- }
- };
- const props$1x = {
- ...ActionSheet,
- ...Album,
- ...Alert,
- ...Avatar,
- ...AvatarGroup,
- ...Backtop,
- ...Badge,
- ...Button,
- ...Calendar$1,
- ...CarKeyboard,
- ...Card,
- ...Cell,
- ...CellGroup,
- ...Checkbox,
- ...CheckboxGroup,
- ...CircleProgress,
- ...Code,
- ...CodeInput,
- ...Col,
- ...Collapse,
- ...CollapseItem,
- ...ColumnNotice,
- ...CountDown,
- ...CountTo,
- ...DatetimePicker,
- ...Divider,
- ...Empty,
- ...Form,
- ...GormItem,
- ...Gap,
- ...Grid,
- ...GridItem,
- ...Icon,
- ...Image$1,
- ...IndexAnchor,
- ...IndexList,
- ...Input,
- ...Keyboard,
- ...Line,
- ...LineProgress,
- ...Link,
- ...List,
- ...ListItem,
- ...LoadingIcon,
- ...LoadingPage,
- ...Loadmore,
- ...Modal,
- ...Navbar,
- ...NoNetwork,
- ...NoticeBar,
- ...Notify,
- ...NumberBox,
- ...NumberKeyboard,
- ...Overlay,
- ...Parse,
- ...Picker,
- ...Popup,
- ...Radio,
- ...RadioGroup,
- ...Rate,
- ...ReadMore,
- ...Row,
- ...RowNotice,
- ...ScrollList,
- ...Search,
- ...Section,
- ...Skeleton,
- ...Slider,
- ...StatusBar,
- ...Steps,
- ...StepsItem,
- ...Sticky,
- ...Subsection,
- ...SwipeAction,
- ...SwipeActionItem,
- ...Swiper,
- ...SwipterIndicator,
- ...Switch,
- ...Tabbar,
- ...TabbarItem,
- ...Tabs,
- ...Tag,
- ...Text,
- ...Textarea,
- ...Toast,
- ...Toolbar,
- ...Tooltip,
- ...Transition,
- ...Upload
- };
- function setConfig$1(configs) {
- shallowMerge(config$1, configs.config || {});
- shallowMerge(props$1x, configs.props || {});
- shallowMerge(color$3, configs.color || {});
- shallowMerge(zIndex, configs.zIndex || {});
- }
- if (uni && uni.upuiParams) {
- formatAppLog("log", "at uni_modules/uview-plus/libs/config/props.js:206", "setting uview-plus");
- let temp = uni.upuiParams();
- if (temp.httpIns) {
- temp.httpIns(http);
- }
- if (temp.options) {
- setConfig$1(temp.options);
- }
- }
- const props$1w = defineMixin({
- props: {
- color: {
- type: String,
- default: () => props$1x.line.color
- },
- // 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等
- length: {
- type: [String, Number],
- default: () => props$1x.line.length
- },
- // 线条方向,col-竖向,row-横向
- direction: {
- type: String,
- default: () => props$1x.line.direction
- },
- // 是否显示细边框
- hairline: {
- type: Boolean,
- default: () => props$1x.line.hairline
- },
- // 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
- margin: {
- type: [String, Number],
- default: () => props$1x.line.margin
- },
- // 是否虚线,true-虚线,false-实线
- dashed: {
- type: Boolean,
- default: () => props$1x.line.dashed
- }
- }
- });
- const mpMixin = defineMixin({});
- class Router {
- constructor() {
- this.config = {
- type: "navigateTo",
- url: "",
- delta: 1,
- // navigateBack页面后退时,回退的层数
- params: {},
- // 传递的参数
- animationType: "pop-in",
- // 窗口动画,只在APP有效
- animationDuration: 300,
- // 窗口动画持续时间,单位毫秒,只在APP有效
- intercept: false
- // 是否需要拦截
- };
- this.route = this.route.bind(this);
- }
- // 判断url前面是否有"/",如果没有则加上,否则无法跳转
- addRootPath(url2) {
- return url2[0] === "/" ? url2 : `/${url2}`;
- }
- // 整合路由参数
- mixinParam(url2, params2) {
- url2 = url2 && this.addRootPath(url2);
- let query = "";
- if (/.*\/.*\?.*=.*/.test(url2)) {
- query = queryParams(params2, false);
- return url2 += `&${query}`;
- }
- query = queryParams(params2);
- return url2 += query;
- }
- // 对外的方法名称
- async route(options2 = {}, params2 = {}) {
- let mergeConfig2 = {};
- if (typeof options2 === "string") {
- mergeConfig2.url = this.mixinParam(options2, params2);
- mergeConfig2.type = "navigateTo";
- } else {
- mergeConfig2 = deepMerge$1(this.config, options2);
- mergeConfig2.url = this.mixinParam(options2.url, options2.params);
- }
- if (mergeConfig2.url === page())
- return;
- if (params2.intercept) {
- this.config.intercept = params2.intercept;
- }
- mergeConfig2.params = params2;
- mergeConfig2 = deepMerge$1(this.config, mergeConfig2);
- if (typeof uni.$u.routeIntercept === "function") {
- const isNext = await new Promise((resolve, reject) => {
- uni.$u.routeIntercept(mergeConfig2, resolve);
- });
- isNext && this.openPage(mergeConfig2);
- } else {
- this.openPage(mergeConfig2);
- }
- }
- // 执行路由跳转
- openPage(config2) {
- const {
- url: url2,
- type: type2,
- delta,
- animationType,
- animationDuration
- } = config2;
- if (config2.type == "navigateTo" || config2.type == "to") {
- uni.navigateTo({
- url: url2,
- animationType,
- animationDuration
- });
- }
- if (config2.type == "redirectTo" || config2.type == "redirect") {
- uni.redirectTo({
- url: url2
- });
- }
- if (config2.type == "switchTab" || config2.type == "tab") {
- uni.switchTab({
- url: url2
- });
- }
- if (config2.type == "reLaunch" || config2.type == "launch") {
- uni.reLaunch({
- url: url2
- });
- }
- if (config2.type == "navigateBack" || config2.type == "back") {
- uni.navigateBack({
- delta
- });
- }
- }
- }
- const route = new Router().route;
- const mixin = defineMixin({
- // 定义每个组件都可能需要用到的外部样式以及类名
- props: {
- // 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
- customStyle: {
- type: [Object, String],
- default: () => ({})
- },
- customClass: {
- type: String,
- default: ""
- },
- // 跳转的页面路径
- url: {
- type: String,
- default: ""
- },
- // 页面跳转的类型
- linkType: {
- type: String,
- default: "navigateTo"
- }
- },
- data() {
- return {};
- },
- onLoad() {
- this.$u.getRect = this.$uGetRect;
- },
- created() {
- this.$u.getRect = this.$uGetRect;
- },
- computed: {
- // 在2.x版本中,将会把$u挂载到uni对象下,导致在模板中无法使用uni.$u.xxx形式
- // 所以这里通过computed计算属性将其附加到this.$u上,就可以在模板或者js中使用uni.$u.xxx
- // 只在nvue环境通过此方式引入完整的$u,其他平台会出现性能问题,非nvue则按需引入(主要原因是props过大)
- $u() {
- return deepMerge$1(uni.$u, {
- props: void 0,
- http: void 0,
- mixin: void 0
- });
- },
- /**
- * 生成bem规则类名
- * 由于微信小程序,H5,nvue之间绑定class的差异,无法通过:class="[bem()]"的形式进行同用
- * 故采用如下折中做法,最后返回的是数组(一般平台)或字符串(支付宝和字节跳动平台),类似['a', 'b', 'c']或'a b c'的形式
- * @param {String} name 组件名称
- * @param {Array} fixed 一直会存在的类名
- * @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名
- * @returns {Array|string}
- */
- bem() {
- return function(name2, fixed, change) {
- const prefix = `u-${name2}--`;
- const classes = {};
- if (fixed) {
- fixed.map((item) => {
- classes[prefix + this[item]] = true;
- });
- }
- if (change) {
- change.map((item) => {
- this[item] ? classes[prefix + item] = this[item] : delete classes[prefix + item];
- });
- }
- return Object.keys(classes);
- };
- }
- },
- methods: {
- // 跳转某一个页面
- openPage(urlKey = "url") {
- const url2 = this[urlKey];
- if (url2) {
- route({ type: this.linkType, url: url2 });
- }
- },
- navTo(url2 = "", linkType = "navigateTo") {
- route({ type: this.linkType, url: url2 });
- },
- // 查询节点信息
- // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
- // 解决办法为在组件根部再套一个没有任何作用的view元素
- $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();
- });
- },
- 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];
- });
- }
- },
- // 阻止事件冒泡
- preventEvent(e2) {
- e2 && typeof e2.stopPropagation === "function" && e2.stopPropagation();
- },
- // 空操作
- noop(e2) {
- this.preventEvent(e2);
- }
- },
- onReachBottom() {
- uni.$emit("uOnReachBottom");
- },
- beforeUnmount() {
- if (this.parent && test.array(this.parent.children)) {
- const childrenList = this.parent.children;
- childrenList.map((child, index2) => {
- if (child === this) {
- childrenList.splice(index2, 1);
- }
- });
- }
- }
- });
- const _sfc_main$2d = {
- name: "u-line",
- mixins: [mpMixin, mixin, props$1w],
- computed: {
- lineStyle() {
- const style = {};
- style.margin = this.margin;
- if (this.direction === "row") {
- style.borderBottomWidth = "1px";
- style.borderBottomStyle = this.dashed ? "dashed" : "solid";
- style.width = addUnit(this.length);
- if (this.hairline)
- style.transform = "scaleY(0.5)";
- } else {
- style.borderLeftWidth = "1px";
- style.borderLeftStyle = this.dashed ? "dashed" : "solid";
- style.height = addUnit(this.length);
- if (this.hairline)
- style.transform = "scaleX(0.5)";
- }
- style.borderColor = this.color;
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- }
- };
- function _sfc_render$2c(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-line",
- style: vue.normalizeStyle([$options.lineStyle])
- },
- null,
- 4
- /* STYLE */
- );
- }
- const __easycom_1$4 = /* @__PURE__ */ _export_sfc(_sfc_main$2d, [["render", _sfc_render$2c], ["__scopeId", "data-v-72791e59"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-line/u-line.vue"]]);
- const __vite_glob_0_55 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_1$4
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1v = defineMixin({
- props: {
- // 是否显示组件
- show: {
- type: Boolean,
- default: () => props$1x.loadingIcon.show
- },
- // 颜色
- color: {
- type: String,
- default: () => props$1x.loadingIcon.color
- },
- // 提示文字颜色
- textColor: {
- type: String,
- default: () => props$1x.loadingIcon.textColor
- },
- // 文字和图标是否垂直排列
- vertical: {
- type: Boolean,
- default: () => props$1x.loadingIcon.vertical
- },
- // 模式选择,circle-圆形,spinner-花朵形,semicircle-半圆形
- mode: {
- type: String,
- default: () => props$1x.loadingIcon.mode
- },
- // 图标大小,单位默认px
- size: {
- type: [String, Number],
- default: () => props$1x.loadingIcon.size
- },
- // 文字大小
- textSize: {
- type: [String, Number],
- default: () => props$1x.loadingIcon.textSize
- },
- // 文字内容
- text: {
- type: [String, Number],
- default: () => props$1x.loadingIcon.text
- },
- // 动画模式
- timingFunction: {
- type: String,
- default: () => props$1x.loadingIcon.timingFunction
- },
- // 动画执行周期时间
- duration: {
- type: [String, Number],
- default: () => props$1x.loadingIcon.duration
- },
- // mode=circle时的暗边颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.loadingIcon.inactiveColor
- }
- }
- });
- function colorGradient(startColor = "rgb(0, 0, 0)", endColor = "rgb(255, 255, 255)", step = 10) {
- const startRGB = hexToRgb(startColor, false);
- const startR = startRGB[0];
- const startG = startRGB[1];
- const startB = startRGB[2];
- const endRGB = hexToRgb(endColor, false);
- const endR = endRGB[0];
- const endG = endRGB[1];
- const endB = endRGB[2];
- const sR = (endR - startR) / step;
- const sG = (endG - startG) / step;
- const sB = (endB - startB) / step;
- const colorArr = [];
- for (let i2 = 0; i2 < step; i2++) {
- let hex = rgbToHex(`rgb(${Math.round(sR * i2 + startR)},${Math.round(sG * i2 + startG)},${Math.round(sB * i2 + startB)})`);
- if (i2 === 0)
- hex = rgbToHex(startColor);
- if (i2 === step - 1)
- hex = rgbToHex(endColor);
- colorArr.push(hex);
- }
- return colorArr;
- }
- function hexToRgb(sColor, str = true) {
- const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
- sColor = String(sColor).toLowerCase();
- if (sColor && reg.test(sColor)) {
- if (sColor.length === 4) {
- let sColorNew = "#";
- for (let i2 = 1; i2 < 4; i2 += 1) {
- sColorNew += sColor.slice(i2, i2 + 1).concat(sColor.slice(i2, i2 + 1));
- }
- sColor = sColorNew;
- }
- const sColorChange = [];
- for (let i2 = 1; i2 < 7; i2 += 2) {
- sColorChange.push(parseInt(`0x${sColor.slice(i2, i2 + 2)}`));
- }
- if (!str) {
- return sColorChange;
- }
- return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`;
- }
- if (/^(rgb|RGB)/.test(sColor)) {
- const arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
- return arr.map((val) => Number(val));
- }
- return sColor;
- }
- function rgbToHex(rgb) {
- const _this = rgb;
- const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
- if (/^(rgb|RGB)/.test(_this)) {
- const aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
- let strHex = "#";
- for (let i2 = 0; i2 < aColor.length; i2++) {
- let hex = Number(aColor[i2]).toString(16);
- hex = String(hex).length == 1 ? `${0}${hex}` : hex;
- if (hex === "0") {
- hex += hex;
- }
- strHex += hex;
- }
- if (strHex.length !== 7) {
- strHex = _this;
- }
- return strHex;
- }
- if (reg.test(_this)) {
- const aNum = _this.replace(/#/, "").split("");
- if (aNum.length === 6) {
- return _this;
- }
- if (aNum.length === 3) {
- let numHex = "#";
- for (let i2 = 0; i2 < aNum.length; i2 += 1) {
- numHex += aNum[i2] + aNum[i2];
- }
- return numHex;
- }
- } else {
- return _this;
- }
- }
- function colorToRgba(color2, alpha) {
- color2 = rgbToHex(color2);
- const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
- let sColor = String(color2).toLowerCase();
- if (sColor && reg.test(sColor)) {
- if (sColor.length === 4) {
- let sColorNew = "#";
- for (let i2 = 1; i2 < 4; i2 += 1) {
- sColorNew += sColor.slice(i2, i2 + 1).concat(sColor.slice(i2, i2 + 1));
- }
- sColor = sColorNew;
- }
- const sColorChange = [];
- for (let i2 = 1; i2 < 7; i2 += 2) {
- sColorChange.push(parseInt(`0x${sColor.slice(i2, i2 + 2)}`));
- }
- return `rgba(${sColorChange.join(",")},${alpha})`;
- }
- return sColor;
- }
- const colorGradient$1 = {
- colorGradient,
- hexToRgb,
- rgbToHex,
- colorToRgba
- };
- const _sfc_main$2c = {
- name: "u-loading-icon",
- mixins: [mpMixin, mixin, props$1v],
- data() {
- return {
- // Array.form可以通过一个伪数组对象创建指定长度的数组
- // https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/from
- array12: Array.from({
- length: 12
- }),
- // 这里需要设置默认值为360,否则在安卓nvue上,会延迟一个duration周期后才执行
- // 在iOS nvue上,则会一开始默认执行两个周期的动画
- aniAngel: 360,
- // 动画旋转角度
- webviewHide: false,
- // 监听webview的状态,如果隐藏了页面,则停止动画,以免性能消耗
- loading: false
- // 是否运行中,针对nvue使用
- };
- },
- computed: {
- // 当为circle类型时,给其另外三边设置一个更轻一些的颜色
- // 之所以需要这么做的原因是,比如父组件传了color为红色,那么需要另外的三个边为浅红色
- // 而不能是固定的某一个其他颜色(因为这个固定的颜色可能浅蓝,导致效果没有那么细腻良好)
- otherBorderColor() {
- const lightColor = colorGradient(this.color, "#ffffff", 100)[80];
- if (this.mode === "circle") {
- return this.inactiveColor ? this.inactiveColor : lightColor;
- } else {
- return "transparent";
- }
- }
- },
- watch: {
- show(n2) {
- }
- },
- mounted() {
- this.init();
- },
- methods: {
- addUnit,
- addStyle,
- init() {
- setTimeout(() => {
- this.show && this.addEventListenerToWebview();
- }, 20);
- },
- // 监听webview的显示与隐藏
- addEventListenerToWebview() {
- const pages2 = getCurrentPages();
- const page2 = pages2[pages2.length - 1];
- const currentWebview = page2.$getAppWebview();
- currentWebview.addEventListener("hide", () => {
- this.webviewHide = true;
- });
- currentWebview.addEventListener("show", () => {
- this.webviewHide = false;
- });
- }
- }
- };
- function _sfc_render$2b(_ctx, _cache, $props, $setup, $data, $options) {
- return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-loading-icon", [_ctx.vertical && "u-loading-icon--vertical"]]),
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)])
- },
- [
- !$data.webviewHide ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-loading-icon__spinner", [`u-loading-icon__spinner--${_ctx.mode}`]]),
- ref: "ani",
- style: vue.normalizeStyle({
- color: _ctx.color,
- width: $options.addUnit(_ctx.size),
- height: $options.addUnit(_ctx.size),
- borderTopColor: _ctx.color,
- borderBottomColor: $options.otherBorderColor,
- borderLeftColor: $options.otherBorderColor,
- borderRightColor: $options.otherBorderColor,
- "animation-duration": `${_ctx.duration}ms`,
- "animation-timing-function": _ctx.mode === "semicircle" || _ctx.mode === "circle" ? _ctx.timingFunction : ""
- })
- },
- [
- _ctx.mode === "spinner" ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList($data.array12, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: "u-loading-icon__dot"
- });
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.text ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "u-loading-icon__text",
- style: vue.normalizeStyle({
- fontSize: $options.addUnit(_ctx.textSize),
- color: _ctx.textColor
- })
- },
- vue.toDisplayString(_ctx.text),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0$e = /* @__PURE__ */ _export_sfc(_sfc_main$2c, [["render", _sfc_render$2b], ["__scopeId", "data-v-2af81691"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-loading-icon/u-loading-icon.vue"]]);
- const __vite_glob_0_59 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$e
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1u = defineMixin({
- props: {
- // 背景颜色(默认transparent)
- bgColor: {
- type: String,
- default: () => props$1x.gap.bgColor
- },
- // 分割槽高度,单位px(默认30)
- height: {
- type: [String, Number],
- default: () => props$1x.gap.height
- },
- // 与上一个组件的距离
- marginTop: {
- type: [String, Number],
- default: () => props$1x.gap.marginTop
- },
- // 与下一个组件的距离
- marginBottom: {
- type: [String, Number],
- default: () => props$1x.gap.marginBottom
- }
- }
- });
- const _sfc_main$2b = {
- name: "u-gap",
- mixins: [mpMixin, mixin, props$1u],
- computed: {
- gapStyle() {
- const style = {
- backgroundColor: this.bgColor,
- height: addUnit(this.height),
- marginTop: addUnit(this.marginTop),
- marginBottom: addUnit(this.marginBottom)
- };
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- }
- };
- function _sfc_render$2a(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-gap",
- style: vue.normalizeStyle([$options.gapStyle])
- },
- null,
- 4
- /* STYLE */
- );
- }
- const __easycom_1$3 = /* @__PURE__ */ _export_sfc(_sfc_main$2b, [["render", _sfc_render$2a], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-gap/u-gap.vue"]]);
- const __vite_glob_0_43 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_1$3
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1t = defineMixin({
- props: {
- // 是否展示组件
- show: {
- type: Boolean,
- default: () => props$1x.transition.show
- },
- // 使用的动画模式
- mode: {
- type: String,
- default: () => props$1x.transition.mode
- },
- // 动画的执行时间,单位ms
- duration: {
- type: [String, Number],
- default: () => props$1x.transition.duration
- },
- // 使用的动画过渡函数
- timingFunction: {
- type: String,
- default: () => props$1x.transition.timingFunction
- }
- }
- });
- const getClassNames = (name2) => ({
- enter: `u-${name2}-enter u-${name2}-enter-active`,
- "enter-to": `u-${name2}-enter-to u-${name2}-enter-active`,
- leave: `u-${name2}-leave u-${name2}-leave-active`,
- "leave-to": `u-${name2}-leave-to u-${name2}-leave-active`
- });
- const transitionMixin = {
- methods: {
- // 组件被点击发出事件
- clickHandler() {
- this.$emit("click");
- },
- // vue版本的组件进场处理
- async vueEnter() {
- const classNames = getClassNames(this.mode);
- this.status = "enter";
- this.$emit("beforeEnter");
- this.inited = true;
- this.display = true;
- this.classes = classNames.enter;
- await vue.nextTick();
- {
- await sleep(20);
- this.$emit("enter");
- this.transitionEnded = false;
- this.$emit("afterEnter");
- this.classes = classNames["enter-to"];
- }
- },
- // 动画离场处理
- async vueLeave() {
- if (!this.display)
- return;
- const classNames = getClassNames(this.mode);
- this.status = "leave";
- this.$emit("beforeLeave");
- this.classes = classNames.leave;
- await vue.nextTick();
- {
- this.transitionEnded = false;
- this.$emit("leave");
- setTimeout(this.onTransitionEnd, this.duration);
- this.classes = classNames["leave-to"];
- }
- },
- // 完成过渡后触发
- onTransitionEnd() {
- if (this.transitionEnded)
- return;
- this.transitionEnded = true;
- this.$emit(this.status === "leave" ? "afterLeave" : "afterEnter");
- if (!this.show && this.display) {
- this.display = false;
- this.inited = false;
- }
- }
- }
- };
- const _sfc_main$2a = {
- name: "u-transition",
- data() {
- return {
- inited: false,
- // 是否显示/隐藏组件
- viewStyle: {},
- // 组件内部的样式
- status: "",
- // 记录组件动画的状态
- transitionEnded: false,
- // 组件是否结束的标记
- display: false,
- // 组件是否展示
- classes: ""
- // 应用的类名
- };
- },
- emits: ["click", "beforeEnter", "enter", "afterEnter", "beforeLeave", "leave", "afterLeave"],
- computed: {
- mergeStyle() {
- const { viewStyle, customStyle } = this;
- return {
- transitionDuration: `${this.duration}ms`,
- // display: `${this.display ? '' : 'none'}`,
- transitionTimingFunction: this.timingFunction,
- // 避免自定义样式影响到动画属性,所以写在viewStyle前面
- ...addStyle(customStyle),
- ...viewStyle
- };
- }
- },
- // 将mixin挂在到组件中,实际上为一个vue格式对象。
- mixins: [mpMixin, mixin, transitionMixin, props$1t],
- watch: {
- show: {
- handler(newVal) {
- newVal ? this.vueEnter() : this.vueLeave();
- },
- // 表示同时监听初始化时的props的show的意思
- immediate: true
- }
- }
- };
- function _sfc_render$29(_ctx, _cache, $props, $setup, $data, $options) {
- return $data.inited ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-transition", $data.classes]),
- ref: "u-transition",
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickHandler && _ctx.clickHandler(...args)),
- style: vue.normalizeStyle([$options.mergeStyle]),
- onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.noop && _ctx.noop(...args))
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 38
- /* CLASS, STYLE, NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2a, [["render", _sfc_render$29], ["__scopeId", "data-v-5cec8177"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-transition/u-transition.vue"]]);
- const __vite_glob_0_124 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_2$1
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1s = defineMixin({
- props: {
- // 是否显示遮罩
- show: {
- type: Boolean,
- default: () => props$1x.overlay.show
- },
- // 层级z-index
- zIndex: {
- type: [String, Number],
- default: () => props$1x.overlay.zIndex
- },
- // 遮罩的过渡时间,单位为ms
- duration: {
- type: [String, Number],
- default: () => props$1x.overlay.duration
- },
- // 不透明度值,当做rgba的第四个参数
- opacity: {
- type: [String, Number],
- default: () => props$1x.overlay.opacity
- }
- }
- });
- const _sfc_main$29 = {
- name: "u-overlay",
- mixins: [mpMixin, mixin, props$1s],
- computed: {
- overlayStyle() {
- const style = {
- position: "fixed",
- top: 0,
- left: 0,
- right: 0,
- zIndex: this.zIndex,
- bottom: 0,
- "background-color": `rgba(0, 0, 0, ${this.opacity})`
- };
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- emits: ["click"],
- methods: {
- clickHandler() {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$28(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_2$1);
- return vue.openBlock(), vue.createBlock(_component_u_transition, {
- show: _ctx.show,
- "custom-class": "u-overlay",
- duration: _ctx.duration,
- "custom-style": $options.overlayStyle,
- onClick: $options.clickHandler,
- onTouchmove: vue.withModifiers(_ctx.noop, ["stop", "prevent"])
- }, {
- default: vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "duration", "custom-style", "onClick", "onTouchmove"]);
- }
- const __easycom_0$d = /* @__PURE__ */ _export_sfc(_sfc_main$29, [["render", _sfc_render$28], ["__scopeId", "data-v-9112bed9"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-overlay/u-overlay.vue"]]);
- const __vite_glob_0_72 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$d
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1r = defineMixin({
- props: {
- bgColor: {
- type: String,
- default: () => props$1x.statusBar.bgColor
- },
- // 状态栏获取得高度
- height: {
- type: Number,
- default: () => props$1x.statusBar.height
- }
- }
- });
- const _sfc_main$28 = {
- name: "u-status-bar",
- mixins: [mpMixin, mixin, props$1r],
- data() {
- return {
- isH5: false
- };
- },
- created() {
- },
- emits: ["update:height"],
- computed: {
- style() {
- const style = {};
- let sheight = getWindowInfo().statusBarHeight;
- this.$emit("update:height", sheight);
- if (sheight == 0) {
- this.isH5 = true;
- } else {
- style.height = addUnit(sheight, "px");
- }
- style.backgroundColor = this.bgColor;
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- }
- };
- function _sfc_render$27(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle([$options.style]),
- class: vue.normalizeClass(["u-status-bar", [$data.isH5 && "u-safe-area-inset-top"]])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_0$c = /* @__PURE__ */ _export_sfc(_sfc_main$28, [["render", _sfc_render$27], ["__scopeId", "data-v-eb8e0cdd"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-status-bar/u-status-bar.vue"]]);
- const __vite_glob_0_98 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$c
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1q = defineMixin({
- props: {}
- });
- const _sfc_main$27 = {
- name: "u-safe-bottom",
- mixins: [mpMixin, mixin, props$1q],
- data() {
- return {
- safeAreaBottomHeight: 0,
- isNvue: false
- };
- },
- computed: {
- style() {
- const style = {};
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- mounted() {
- }
- };
- function _sfc_render$26(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-safe-bottom", [!$data.isNvue && "u-safe-area-inset-bottom"]]),
- style: vue.normalizeStyle([$options.style])
- },
- null,
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_0$b = /* @__PURE__ */ _export_sfc(_sfc_main$27, [["render", _sfc_render$26], ["__scopeId", "data-v-f3d22cfe"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-safe-bottom/u-safe-bottom.vue"]]);
- const __vite_glob_0_90 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$b
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1p = defineMixin({
- props: {
- // 是否展示弹窗
- show: {
- type: Boolean,
- default: () => props$1x.popup.show
- },
- // 是否显示遮罩
- overlay: {
- type: Boolean,
- default: () => props$1x.popup.overlay
- },
- // 弹出的方向,可选值为 top bottom right left center
- mode: {
- type: String,
- default: () => props$1x.popup.mode
- },
- // 动画时长,单位ms
- duration: {
- type: [String, Number],
- default: () => props$1x.popup.duration
- },
- // 是否显示关闭图标
- closeable: {
- type: Boolean,
- default: () => props$1x.popup.closeable
- },
- // 自定义遮罩的样式
- overlayStyle: {
- type: [Object, String],
- default: () => props$1x.popup.overlayStyle
- },
- // 点击遮罩是否关闭弹窗
- closeOnClickOverlay: {
- type: Boolean,
- default: () => props$1x.popup.closeOnClickOverlay
- },
- // 层级
- zIndex: {
- type: [String, Number],
- default: () => props$1x.popup.zIndex
- },
- // 是否为iPhoneX留出底部安全距离
- safeAreaInsetBottom: {
- type: Boolean,
- default: () => props$1x.popup.safeAreaInsetBottom
- },
- // 是否留出顶部安全距离(状态栏高度)
- safeAreaInsetTop: {
- type: Boolean,
- default: () => props$1x.popup.safeAreaInsetTop
- },
- // 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角
- closeIconPos: {
- type: String,
- default: () => props$1x.popup.closeIconPos
- },
- // 是否显示圆角
- round: {
- type: [Boolean, String, Number],
- default: () => props$1x.popup.round
- },
- // mode=center,也即中部弹出时,是否使用缩放模式
- zoom: {
- type: Boolean,
- default: () => props$1x.popup.zoom
- },
- // 弹窗背景色,设置为transparent可去除白色背景
- bgColor: {
- type: String,
- default: () => props$1x.popup.bgColor
- },
- // 遮罩的透明度,0-1之间
- overlayOpacity: {
- type: [Number, String],
- default: () => props$1x.popup.overlayOpacity
- },
- // 是否页面内展示
- pageInline: {
- type: Boolean,
- default: () => props$1x.popup.pageInline
- }
- }
- });
- const _sfc_main$26 = {
- name: "u-popup",
- mixins: [mpMixin, mixin, props$1p],
- data() {
- return {
- overlayDuration: this.duration + 50
- };
- },
- watch: {
- show(newValue, oldValue) {
- }
- },
- computed: {
- transitionStyle() {
- const style = {
- display: "flex"
- };
- if (!this.pageInline) {
- style.zIndex = this.zIndex;
- style.position = "fixed";
- }
- style[this.mode] = 0;
- if (this.mode === "left") {
- return deepMerge$1(style, {
- bottom: 0,
- top: 0
- });
- } else if (this.mode === "right") {
- return deepMerge$1(style, {
- bottom: 0,
- top: 0
- });
- } else if (this.mode === "top") {
- return deepMerge$1(style, {
- left: 0,
- right: 0
- });
- } else if (this.mode === "bottom") {
- return deepMerge$1(style, {
- left: 0,
- right: 0
- });
- } else if (this.mode === "center") {
- return deepMerge$1(style, {
- alignItems: "center",
- "justify-content": "center",
- top: 0,
- left: 0,
- right: 0,
- bottom: 0
- });
- }
- },
- contentStyle() {
- const style = {};
- getWindowInfo();
- if (this.mode !== "center") {
- style.flex = 1;
- }
- if (this.bgColor) {
- style.backgroundColor = this.bgColor;
- }
- if (this.round) {
- const value2 = addUnit(this.round);
- if (this.mode === "top") {
- style.borderBottomLeftRadius = value2;
- style.borderBottomRightRadius = value2;
- } else if (this.mode === "bottom") {
- style.borderTopLeftRadius = value2;
- style.borderTopRightRadius = value2;
- } else if (this.mode === "center") {
- style.borderRadius = value2;
- }
- }
- return deepMerge$1(style, addStyle(this.customStyle));
- },
- position() {
- if (this.mode === "center") {
- return this.zoom ? "fade-zoom" : "fade";
- }
- if (this.mode === "left") {
- return "slide-left";
- }
- if (this.mode === "right") {
- return "slide-right";
- }
- if (this.mode === "bottom") {
- return "slide-up";
- }
- if (this.mode === "top") {
- return "slide-down";
- }
- }
- },
- emits: ["open", "close", "click", "update:show"],
- methods: {
- // 点击遮罩
- overlayClick() {
- if (this.closeOnClickOverlay) {
- this.$emit("update:show", false);
- this.$emit("close");
- }
- },
- open(e2) {
- this.$emit("update:show", true);
- },
- close(e2) {
- this.$emit("update:show", false);
- this.$emit("close");
- },
- afterEnter() {
- this.$emit("open");
- },
- clickHandler() {
- if (this.mode === "center") {
- this.overlayClick();
- }
- this.$emit("click");
- }
- }
- };
- function _sfc_render$25(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_overlay = resolveEasycom(vue.resolveDynamicComponent("u-overlay"), __easycom_0$d);
- const _component_u_status_bar = resolveEasycom(vue.resolveDynamicComponent("u-status-bar"), __easycom_0$c);
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_safe_bottom = resolveEasycom(vue.resolveDynamicComponent("u-safe-bottom"), __easycom_0$b);
- const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_2$1);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-popup", [_ctx.customClass]]),
- style: vue.normalizeStyle({
- width: _ctx.show == false ? "0px" : "",
- height: _ctx.show == false ? "0px" : ""
- })
- },
- [
- vue.createElementVNode("view", { class: "u-popup__trigger" }, [
- vue.renderSlot(_ctx.$slots, "trigger", {}, void 0, true),
- vue.createElementVNode("view", {
- onClick: _cache[0] || (_cache[0] = (...args) => $options.open && $options.open(...args)),
- class: "u-popup__trigger__cover"
- })
- ]),
- _ctx.overlay ? (vue.openBlock(), vue.createBlock(_component_u_overlay, {
- key: 0,
- show: _ctx.show && _ctx.pageInline == false,
- onClick: $options.overlayClick,
- zIndex: _ctx.zIndex,
- duration: $data.overlayDuration,
- customStyle: _ctx.overlayStyle,
- opacity: _ctx.overlayOpacity
- }, null, 8, ["show", "onClick", "zIndex", "duration", "customStyle", "opacity"])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_u_transition, {
- show: _ctx.show,
- customStyle: $options.transitionStyle,
- mode: _ctx.pageInline ? "none" : $options.position,
- duration: _ctx.duration,
- onAfterEnter: $options.afterEnter,
- onClick: $options.clickHandler
- }, {
- default: vue.withCtx(() => [
- vue.createCommentVNode(" @click.stop不能去除,去除会导致居中模式下点击内容区域触发关闭弹窗 "),
- vue.createElementVNode(
- "view",
- {
- class: "u-popup__content",
- style: vue.normalizeStyle([$options.contentStyle]),
- onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => _ctx.noop && _ctx.noop(...args), ["stop"])),
- onTouchmove: _cache[3] || (_cache[3] = vue.withModifiers((...args) => _ctx.noop && _ctx.noop(...args), ["stop", "prevent"]))
- },
- [
- _ctx.safeAreaInsetTop ? (vue.openBlock(), vue.createBlock(_component_u_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- _ctx.closeable ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.close && $options.close(...args), ["stop"])),
- class: vue.normalizeClass(["u-popup__content__close", ["u-popup__content__close--" + _ctx.closeIconPos]]),
- "hover-class": "u-popup__content__close--hover",
- "hover-stay-time": "150"
- },
- [
- vue.createVNode(_component_up_icon, {
- name: "close",
- color: "#909399",
- size: "18",
- bold: ""
- })
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.safeAreaInsetBottom ? (vue.openBlock(), vue.createBlock(_component_u_safe_bottom, { key: 2 })) : vue.createCommentVNode("v-if", true)
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- ),
- vue.renderSlot(_ctx.$slots, "bottom", {}, void 0, true)
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "customStyle", "mode", "duration", "onAfterEnter", "onClick"])
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$26, [["render", _sfc_render$25], ["__scopeId", "data-v-05c24e9b"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-popup/u-popup.vue"]]);
- const __vite_glob_0_79 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_2
- }, Symbol.toStringTag, { value: "Module" }));
- const openType = defineMixin({
- props: {
- openType: String
- },
- methods: {
- onGetUserInfo(event) {
- this.$emit("getuserinfo", event.detail);
- },
- onContact(event) {
- this.$emit("contact", event.detail);
- },
- onGetPhoneNumber(event) {
- this.$emit("getphonenumber", event.detail);
- },
- onError(event) {
- this.$emit("error", event.detail);
- },
- onLaunchApp(event) {
- this.$emit("launchapp", event.detail);
- },
- onOpenSetting(event) {
- this.$emit("opensetting", event.detail);
- }
- }
- });
- const buttonMixin = defineMixin({
- props: {
- lang: String,
- sessionFrom: String,
- sendMessageTitle: String,
- sendMessagePath: String,
- sendMessageImg: String,
- showMessageCard: Boolean,
- appParameter: String,
- formType: String,
- openType: String
- }
- });
- const props$1o = defineMixin({
- props: {
- // 操作菜单是否展示 (默认false)
- show: {
- type: Boolean,
- default: () => props$1x.actionSheet.show
- },
- // 标题
- title: {
- type: String,
- default: () => props$1x.actionSheet.title
- },
- // 选项上方的描述信息
- description: {
- type: String,
- default: () => props$1x.actionSheet.description
- },
- // 数据
- actions: {
- type: Array,
- default: () => props$1x.actionSheet.actions
- },
- // 取消按钮的文字,不为空时显示按钮
- cancelText: {
- type: String,
- default: () => props$1x.actionSheet.cancelText
- },
- // 点击某个菜单项时是否关闭弹窗
- closeOnClickAction: {
- type: Boolean,
- default: () => props$1x.actionSheet.closeOnClickAction
- },
- // 处理底部安全区(默认true)
- safeAreaInsetBottom: {
- type: Boolean,
- default: () => props$1x.actionSheet.safeAreaInsetBottom
- },
- // 小程序的打开方式
- openType: {
- type: String,
- default: () => props$1x.actionSheet.openType
- },
- // 点击遮罩是否允许关闭 (默认true)
- closeOnClickOverlay: {
- type: Boolean,
- default: () => props$1x.actionSheet.closeOnClickOverlay
- },
- // 圆角值
- round: {
- type: [Boolean, String, Number],
- default: () => props$1x.actionSheet.round
- },
- // 选项区域最大高度
- wrapMaxHeight: {
- type: [String],
- default: () => props$1x.actionSheet.wrapMaxHeight
- }
- }
- });
- const _sfc_main$25 = {
- name: "u-action-sheet",
- // 一些props参数和methods方法,通过mixin混入,因为其他文件也会用到
- mixins: [openType, buttonMixin, mixin, props$1o],
- data() {
- return {};
- },
- computed: {
- // 操作项目的样式
- itemStyle() {
- return (index2) => {
- let style = {};
- if (this.actions[index2].color)
- style.color = this.actions[index2].color;
- if (this.actions[index2].fontSize)
- style.fontSize = addUnit(this.actions[index2].fontSize);
- if (this.actions[index2].disabled)
- style.color = "#c0c4cc";
- return style;
- };
- }
- },
- emits: ["close", "select", "update:show"],
- methods: {
- // 关闭操作菜单事件处理
- closeHandler() {
- if (this.closeOnClickOverlay) {
- this.$emit("update:show", false);
- this.$emit("close");
- }
- },
- // 点击取消按钮
- cancel() {
- this.$emit("update:show", false);
- this.$emit("close");
- },
- // 选择操作项处理
- selectHandler(index2) {
- const item = this.actions[index2];
- if (item && !item.disabled && !item.loading) {
- this.$emit("select", item);
- if (this.closeOnClickAction) {
- this.$emit("update:show", false);
- this.$emit("close");
- }
- }
- }
- }
- };
- function _sfc_render$24(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- const _component_u_loading_icon = resolveEasycom(vue.resolveDynamicComponent("u-loading-icon"), __easycom_0$e);
- const _component_u_gap = resolveEasycom(vue.resolveDynamicComponent("u-gap"), __easycom_1$3);
- const _component_u_popup = resolveEasycom(vue.resolveDynamicComponent("u-popup"), __easycom_2);
- return vue.openBlock(), vue.createBlock(_component_u_popup, {
- show: _ctx.show,
- mode: "bottom",
- onClose: $options.closeHandler,
- safeAreaInsetBottom: _ctx.safeAreaInsetBottom,
- round: _ctx.round
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "u-action-sheet" }, [
- vue.createCommentVNode(" 顶部标题区域 "),
- _ctx.title ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-action-sheet__header"
- }, [
- vue.createElementVNode(
- "text",
- { class: "u-action-sheet__header__title u-line-1" },
- vue.toDisplayString(_ctx.title),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", {
- class: "u-action-sheet__header__icon-wrap",
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.cancel && $options.cancel(...args), ["stop"]))
- }, [
- vue.createVNode(_component_up_icon, {
- name: "close",
- size: "17",
- color: "#c8c9cc",
- bold: ""
- })
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 描述信息 "),
- _ctx.description ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "u-action-sheet__description",
- style: vue.normalizeStyle([{
- marginTop: `${_ctx.title && _ctx.description ? 0 : "18px"}`
- }])
- },
- vue.toDisplayString(_ctx.description),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createCommentVNode(" 分割线 "),
- _ctx.description ? (vue.openBlock(), vue.createBlock(_component_u_line, { key: 0 })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 操作项列表 "),
- vue.createElementVNode(
- "scroll-view",
- {
- "scroll-y": "",
- class: "u-action-sheet__item-wrap",
- style: vue.normalizeStyle({ maxHeight: _ctx.wrapMaxHeight })
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.actions, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
- vue.createElementVNode("view", {
- class: "u-action-sheet__item-wrap__item",
- onClick: vue.withModifiers(($event) => $options.selectHandler(index2), ["stop"]),
- "hover-class": !item.disabled && !item.loading ? "u-action-sheet--hover" : "",
- "hover-stay-time": 150
- }, [
- !item.loading ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createElementVNode(
- "text",
- {
- class: "u-action-sheet__item-wrap__item__name",
- style: vue.normalizeStyle([$options.itemStyle(index2)])
- },
- vue.toDisplayString(item.name),
- 5
- /* TEXT, STYLE */
- ),
- item.subname ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-action-sheet__item-wrap__item__subname"
- },
- vue.toDisplayString(item.subname),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 加载状态图标 "),
- vue.createVNode(_component_u_loading_icon, {
- "custom-class": "van-action-sheet__loading",
- size: "18",
- mode: "circle"
- })
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- ))
- ], 8, ["onClick", "hover-class"]),
- vue.createCommentVNode(" 选项间分割线 "),
- index2 !== _ctx.actions.length - 1 ? (vue.openBlock(), vue.createBlock(_component_u_line, { key: 0 })) : vue.createCommentVNode("v-if", true)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )
- ], true),
- vue.createCommentVNode(" 取消按钮前的分割区域 "),
- _ctx.cancelText ? (vue.openBlock(), vue.createBlock(_component_u_gap, {
- key: 2,
- bgColor: "#eaeaec",
- height: "6"
- })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 取消按钮 "),
- _ctx.cancelText ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 3,
- class: "u-action-sheet__item-wrap__item u-action-sheet__cancel",
- "hover-class": "u-action-sheet--hover",
- onClick: _cache[2] || (_cache[2] = (...args) => $options.cancel && $options.cancel(...args))
- }, [
- vue.createElementVNode(
- "text",
- {
- onTouchmove: _cache[1] || (_cache[1] = vue.withModifiers(() => {
- }, ["stop", "prevent"])),
- "hover-stay-time": 150,
- class: "u-action-sheet__cancel-text"
- },
- vue.toDisplayString(_ctx.cancelText),
- 33
- /* TEXT, NEED_HYDRATION */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "onClose", "safeAreaInsetBottom", "round"]);
- }
- const uActionSheet = /* @__PURE__ */ _export_sfc(_sfc_main$25, [["render", _sfc_render$24], ["__scopeId", "data-v-69669810"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-action-sheet/u-action-sheet.vue"]]);
- const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uActionSheet
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$24 = {
- name: "up-agreement",
- props: {
- urlProtocol: {
- type: String,
- default: "/pages/user_agreement/agreement/info?title=用户协议"
- },
- urlPrivacy: {
- type: String,
- default: "/pages/user_agreement/agreement/info?title=隐私政策"
- }
- },
- emits: ["confirm"],
- data() {
- return {
- show: false
- };
- },
- methods: {
- close() {
- plus.runtime.quit();
- },
- confirm() {
- this.show = false;
- this.$emit("confirm", 1);
- },
- showModal() {
- this.show = true;
- },
- urlClick(type2) {
- uni.navigateTo({
- url: this[type2]
- });
- }
- }
- };
- function _sfc_render$23(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_modal = vue.resolveComponent("up-modal");
- return vue.openBlock(), vue.createElementBlock("view", { class: "up-agreement" }, [
- vue.createVNode(_component_up_modal, {
- show: $data.show,
- "onUpdate:show": _cache[2] || (_cache[2] = ($event) => $data.show = $event),
- showCancelButton: "",
- onConfirm: $options.confirm,
- onCancel: $options.close,
- confirmText: "阅读并同意"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "agreement-content" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createTextVNode(" 我们非常重视您的个人信息和隐私保护。为了更好地保障您的个人权益,在您使用我们的产品前, 请务必审慎阅读《"),
- vue.createElementVNode("text", {
- class: "agreement-url",
- onClick: _cache[0] || (_cache[0] = ($event) => $options.urlClick("urlProtocol"))
- }, "用户协议"),
- vue.createTextVNode("》 和《"),
- vue.createElementVNode("text", {
- class: "agreement-url",
- onClick: _cache[1] || (_cache[1] = ($event) => $options.urlClick("urlPrivacy"))
- }, "隐私政策"),
- vue.createTextVNode("》内的所有条款, 尤其是:1.我们对您的个人信息的收集/保存/使用/对外提供/保护等规则条款,以及您的用户权利等条款;2. 约定我们的限制责任、免责 条款;3.其他以颜色或加粗进行标识的重要条款。如您对以上协议有任何疑问,请先不要同意,您点击“同意并继续”的行为即表示您已阅读 完毕并同意以上协议的全部内容。 ")
- ], true)
- ])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "onConfirm", "onCancel"])
- ]);
- }
- const uAgreement = /* @__PURE__ */ _export_sfc(_sfc_main$24, [["render", _sfc_render$23], ["__scopeId", "data-v-1bf68e1e"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-agreement/u-agreement.vue"]]);
- const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uAgreement
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1n = defineMixin({
- props: {
- // 图片地址,Array<String>|Array<Object>形式
- urls: {
- type: Array,
- default: () => props$1x.album.urls
- },
- // 指定从数组的对象元素中读取哪个属性作为图片地址
- keyName: {
- type: String,
- default: () => props$1x.album.keyName
- },
- // 单图时,图片长边的长度
- singleSize: {
- type: [String, Number],
- default: () => props$1x.album.singleSize
- },
- // 多图时,图片边长
- multipleSize: {
- type: [String, Number],
- default: () => props$1x.album.multipleSize
- },
- // 多图时,图片水平和垂直之间的间隔
- space: {
- type: [String, Number],
- default: () => props$1x.album.space
- },
- // 单图时,图片缩放裁剪的模式
- singleMode: {
- type: String,
- default: () => props$1x.album.singleMode
- },
- // 多图时,图片缩放裁剪的模式
- multipleMode: {
- type: String,
- default: () => props$1x.album.multipleMode
- },
- // 最多展示的图片数量,超出时最后一个位置将会显示剩余图片数量
- maxCount: {
- type: [String, Number],
- default: () => props$1x.album.maxCount
- },
- // 是否可以预览图片
- previewFullImage: {
- type: Boolean,
- default: () => props$1x.album.previewFullImage
- },
- // 每行展示图片数量,如设置,singleSize和multipleSize将会无效
- rowCount: {
- type: [String, Number],
- default: () => props$1x.album.rowCount
- },
- // 超出maxCount时是否显示查看更多的提示
- showMore: {
- type: Boolean,
- default: () => props$1x.album.showMore
- },
- // 图片形状,circle-圆形,square-方形
- shape: {
- type: String,
- default: () => props$1x.image.shape
- },
- // 圆角,单位任意
- radius: {
- type: [String, Number],
- default: () => props$1x.image.radius
- },
- // 自适应换行
- autoWrap: {
- type: Boolean,
- default: () => props$1x.album.autoWrap
- },
- // 单位
- unit: {
- type: [String],
- default: () => props$1x.album.unit
- },
- // 阻止点击冒泡
- stop: {
- type: Boolean,
- default: () => props$1x.album.stop
- }
- }
- });
- const _sfc_main$23 = {
- name: "u-album",
- mixins: [mpMixin, mixin, props$1n],
- data() {
- return {
- // 单图的宽度
- singleWidth: 0,
- // 单图的高度
- singleHeight: 0,
- // 单图时,如果无法获取图片的尺寸信息,让图片宽度默认为容器的一定百分比
- singlePercent: 0.6
- };
- },
- watch: {
- urls: {
- immediate: true,
- handler(newVal) {
- if (newVal.length === 1) {
- this.getImageRect();
- }
- }
- }
- },
- computed: {
- /**
- * 计算图片样式
- * @param {Number} index1 - 行索引
- * @param {Number} index2 - 列索引
- * @returns {Object} 图片样式对象
- */
- imageStyle() {
- return (index1, index2) => {
- const { space, rowCount, multipleSize, urls } = this, rowLen = this.showUrls.length;
- this.urls.length;
- const style = {
- marginRight: addUnit(space),
- marginBottom: addUnit(space)
- };
- if (index1 === rowLen && !this.autoWrap)
- style.marginBottom = 0;
- if (!this.autoWrap) {
- if (index2 === rowCount || index1 === rowLen && index2 === this.showUrls[index1 - 1].length)
- style.marginRight = 0;
- }
- return style;
- };
- },
- /**
- * 将图片地址数组划分为二维数组,用于按行显示
- * @returns {Array} 二维数组,每个子数组代表一行图片
- */
- showUrls() {
- if (this.autoWrap) {
- return [this.urls.slice(0, this.maxCount)];
- } else {
- const arr = [];
- this.urls.map((item, index2) => {
- if (index2 + 1 <= this.maxCount) {
- const itemIndex = Math.floor(index2 / this.rowCount);
- if (!arr[itemIndex]) {
- arr[itemIndex] = [];
- }
- arr[itemIndex].push(item);
- }
- });
- return arr;
- }
- },
- /**
- * 计算图片宽度
- * @returns {String} 图片宽度样式值
- */
- imageWidth() {
- return addUnit(
- this.urls.length === 1 ? this.singleWidth : this.multipleSize,
- this.unit
- );
- },
- /**
- * 计算图片高度
- * @returns {String} 图片高度样式值
- */
- imageHeight() {
- return addUnit(
- this.urls.length === 1 ? this.singleHeight : this.multipleSize,
- this.unit
- );
- },
- /**
- * 计算相册总宽度,用于外部组件对齐
- * 此变量无实际用途,仅仅是为了利用computed特性,让其在urls长度等变化时,重新计算图片的宽度
- * @returns {Number} 相册宽度
- */
- albumWidth() {
- let width = 0;
- if (this.urls.length === 1) {
- width = this.singleWidth;
- } else {
- width = this.showUrls[0].length * this.multipleSize + this.space * (this.showUrls[0].length - 1);
- }
- this.$emit("albumWidth", width);
- return width;
- }
- },
- emits: ["preview", "albumWidth"],
- methods: {
- addUnit,
- /**
- * 点击图片预览
- * @param {Event} e - 点击事件对象
- * @param {String} url - 当前点击图片的地址
- */
- onPreviewTap(e2, url2) {
- const urls = this.urls.map((item) => {
- return this.getSrc(item);
- });
- if (this.previewFullImage) {
- uni.previewImage({
- current: url2,
- urls
- });
- this.stop && this.preventEvent(e2);
- } else {
- this.$emit("preview", {
- urls,
- currentIndex: urls.indexOf(url2)
- });
- }
- },
- /**
- * 获取图片地址
- * @param {String|Object} item - 图片项,可以是字符串或对象
- * @returns {String} 图片地址
- */
- getSrc(item) {
- return test.object(item) ? this.keyName && item[this.keyName] || item.src : item;
- },
- /**
- * 单图时,获取图片的尺寸
- * 在小程序中,需要将网络图片的的域名添加到小程序的download域名才可能获取尺寸
- * 在没有添加的情况下,让单图宽度默认为盒子的一定宽度(singlePercent)
- */
- getImageRect() {
- const src = this.getSrc(this.urls[0]);
- uni.getImageInfo({
- src,
- success: (res) => {
- let singleSize = this.singleSize;
- let unit = "";
- if (Number.isNaN(Number(this.singleSize))) {
- unit = this.singleSize.replace(/\d+/g, "");
- singleSize = Number(this.singleSize.replace(/\D+/g, ""), 10);
- }
- const isHorizotal = res.width >= res.height;
- this.singleWidth = isHorizotal ? singleSize : res.width / res.height * singleSize;
- this.singleHeight = !isHorizotal ? singleSize : res.height / res.width * this.singleWidth;
- if (unit != null && unit !== "") {
- this.singleWidth = this.singleWidth + unit;
- this.singleHeight = this.singleHeight + unit;
- }
- },
- fail: () => {
- this.getComponentWidth();
- }
- });
- },
- /**
- * 获取组件的宽度,用于计算单图显示尺寸
- */
- async getComponentWidth() {
- await sleep(30);
- this.$uGetRect(".u-album__row").then((size) => {
- this.singleWidth = size.width * this.singlePercent;
- });
- }
- }
- };
- function _sfc_render$22(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_text = vue.resolveComponent("up-text");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-album" }, [
- vue.createCommentVNode(" 相册行容器,每行显示 rowCount 个图片 "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.showUrls, (arr, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-album__row",
- ref_for: true,
- ref: "u-album__row",
- forComputedUse: $options.albumWidth,
- key: index2,
- style: vue.normalizeStyle({ flexWrap: _ctx.autoWrap ? "wrap" : "nowrap" })
- }, [
- vue.createCommentVNode(" 图片包装容器 "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(arr, (item, index1) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-album__row__wrapper",
- key: index1,
- style: vue.normalizeStyle([$options.imageStyle(index2 + 1, index1 + 1)]),
- onClick: ($event) => $options.onPreviewTap($event, $options.getSrc(item))
- }, [
- vue.createCommentVNode(" 图片显示 "),
- vue.createElementVNode("image", {
- src: $options.getSrc(item),
- mode: _ctx.urls.length === 1 ? $options.imageHeight > 0 ? _ctx.singleMode : "widthFix" : _ctx.multipleMode,
- style: vue.normalizeStyle([
- {
- width: $options.imageWidth,
- height: $options.imageHeight,
- borderRadius: _ctx.shape == "circle" ? "10000px" : $options.addUnit(_ctx.radius)
- }
- ])
- }, null, 12, ["src", "mode"]),
- vue.createCommentVNode(" 超出最大显示数量时的更多提示 "),
- _ctx.showMore && _ctx.urls.length > _ctx.rowCount * $options.showUrls.length && index2 === $options.showUrls.length - 1 && index1 === $options.showUrls[$options.showUrls.length - 1].length - 1 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-album__row__wrapper__text",
- style: vue.normalizeStyle({
- borderRadius: _ctx.shape == "circle" ? "50%" : $options.addUnit(_ctx.radius)
- })
- },
- [
- vue.createVNode(_component_up_text, {
- text: `+${_ctx.urls.length - _ctx.maxCount}`,
- color: "#fff",
- size: _ctx.multipleSize * 0.3,
- align: "center",
- customStyle: "justify-content: center"
- }, null, 8, ["text", "size"])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ], 12, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 12, ["forComputedUse"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }
- const uAlbum = /* @__PURE__ */ _export_sfc(_sfc_main$23, [["render", _sfc_render$22], ["__scopeId", "data-v-96d28356"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-album/u-album.vue"]]);
- const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uAlbum
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1m = defineMixin({
- props: {
- // 显示文字
- title: {
- type: String,
- default: () => props$1x.alert.title
- },
- // 主题,success/warning/info/error
- type: {
- type: String,
- default: () => props$1x.alert.type
- },
- // 辅助性文字
- description: {
- type: String,
- default: () => props$1x.alert.description
- },
- // 是否可关闭
- closable: {
- type: Boolean,
- default: () => props$1x.alert.closable
- },
- // 是否显示图标
- showIcon: {
- type: Boolean,
- default: () => props$1x.alert.showIcon
- },
- // 浅或深色调,light-浅色,dark-深色
- effect: {
- type: String,
- default: () => props$1x.alert.effect
- },
- // 文字是否居中
- center: {
- type: Boolean,
- default: () => props$1x.alert.center
- },
- // 字体大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.alert.fontSize
- },
- // 动画类型
- transitionMode: {
- type: [String],
- default: () => props$1x.alert.transitionMode
- },
- // 自动定时关闭毫秒
- duration: {
- type: [Number],
- default: () => props$1x.alert.duration
- },
- // 自定义图标
- icon: {
- type: [String],
- default: () => props$1x.alert.icon
- },
- // 是否显示
- modelValue: {
- type: [String],
- default: () => props$1x.alert.value
- }
- }
- });
- const _sfc_main$22 = {
- name: "u-alert",
- mixins: [mpMixin, mixin, props$1m],
- data() {
- return {
- // 控制组件显示隐藏
- show: true
- };
- },
- computed: {
- // 根据不同的主题类型返回对应的图标颜色
- iconColor() {
- return this.effect === "light" ? this.type : "#fff";
- },
- // 不同主题对应不同的图标
- iconName() {
- if (this.icon)
- return this.icon;
- switch (this.type) {
- case "success":
- return "checkmark-circle-fill";
- case "error":
- return "close-circle-fill";
- case "warning":
- return "error-circle-fill";
- case "info":
- return "info-circle-fill";
- case "primary":
- return "more-circle-fill";
- default:
- return "error-circle-fill";
- }
- }
- },
- emits: ["click", "close", "closed", "update:modelValue"],
- watch: {
- modelValue: {
- handler(newVal) {
- this.show = newVal;
- },
- immediate: true
- },
- show: {
- handler(newVal) {
- this.$emit("update:modelValue", newVal);
- if (!newVal && this.duration > 0) {
- this.$emit("closed");
- }
- }
- }
- },
- mounted() {
- if (this.duration > 0) {
- setTimeout(() => {
- this.closeHandler();
- }, this.duration);
- }
- },
- methods: {
- addUnit,
- addStyle,
- // 点击内容区域触发click事件
- clickHandler() {
- this.$emit("click");
- },
- // 点击关闭按钮触发close事件并隐藏组件
- closeHandler() {
- this.show = false;
- this.$emit("close");
- }
- }
- };
- function _sfc_render$21(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_up_transition = vue.resolveComponent("up-transition");
- return vue.openBlock(), vue.createBlock(_component_up_transition, {
- mode: _ctx.transitionMode,
- show: $data.show
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-alert", [`u-alert--${_ctx.type}--${_ctx.effect}`]]),
- onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.clickHandler && $options.clickHandler(...args), ["stop"])),
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)])
- },
- [
- vue.createCommentVNode(" 左侧图标 "),
- _ctx.showIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-alert__icon"
- }, [
- vue.createVNode(_component_up_icon, {
- name: $options.iconName,
- size: "18",
- color: $options.iconColor
- }, null, 8, ["name", "color"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 内容区域 "),
- vue.createElementVNode(
- "view",
- {
- class: "u-alert__content",
- style: vue.normalizeStyle([{
- paddingRight: _ctx.closable ? "20px" : 0
- }])
- },
- [
- vue.createCommentVNode(" 标题 "),
- _ctx.title ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["u-alert__content__title", [_ctx.effect === "dark" ? "u-alert__text--dark" : `u-alert__text--${_ctx.type}--light`]]),
- style: vue.normalizeStyle([{
- fontSize: $options.addUnit(_ctx.fontSize),
- textAlign: _ctx.center ? "center" : "left"
- }])
- },
- vue.toDisplayString(_ctx.title),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 描述信息 "),
- _ctx.description ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: vue.normalizeClass(["u-alert__content__desc", [_ctx.effect === "dark" ? "u-alert__text--dark" : `u-alert__text--${_ctx.type}--light`]]),
- style: vue.normalizeStyle([{
- fontSize: $options.addUnit(_ctx.fontSize),
- textAlign: _ctx.center ? "center" : "left"
- }])
- },
- vue.toDisplayString(_ctx.description),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 关闭按钮 "),
- _ctx.closable ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-alert__close",
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.closeHandler && $options.closeHandler(...args), ["stop"]))
- }, [
- vue.renderSlot(_ctx.$slots, "close", {}, () => [
- vue.createVNode(_component_up_icon, {
- name: "close",
- color: $options.iconColor,
- size: "15"
- }, null, 8, ["color"])
- ], true)
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["mode", "show"]);
- }
- const uAlert = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["render", _sfc_render$21], ["__scopeId", "data-v-158e540a"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-alert/u-alert.vue"]]);
- const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uAlert
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1l = defineMixin({
- props: {
- // 头像图片路径(不能为相对路径)
- src: {
- type: String,
- default: () => props$1x.avatar.src
- },
- // 头像形状,circle-圆形,square-方形
- shape: {
- type: String,
- default: () => props$1x.avatar.shape
- },
- // 头像尺寸
- size: {
- type: [String, Number],
- default: () => props$1x.avatar.size
- },
- // 裁剪模式
- mode: {
- type: String,
- default: () => props$1x.avatar.mode
- },
- // 显示的文字
- text: {
- type: String,
- default: () => props$1x.avatar.text
- },
- // 背景色
- bgColor: {
- type: String,
- default: () => props$1x.avatar.bgColor
- },
- // 文字颜色
- color: {
- type: String,
- default: () => props$1x.avatar.color
- },
- // 文字大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.avatar.fontSize
- },
- // 显示的图标
- icon: {
- type: String,
- default: () => props$1x.avatar.icon
- },
- // 显示小程序头像,只对百度,微信,QQ小程序有效
- mpAvatar: {
- type: Boolean,
- default: () => props$1x.avatar.mpAvatar
- },
- // 是否使用随机背景色
- randomBgColor: {
- type: Boolean,
- default: () => props$1x.avatar.randomBgColor
- },
- // 加载失败的默认头像(组件有内置默认图片)
- defaultUrl: {
- type: String,
- default: () => props$1x.avatar.defaultUrl
- },
- // 如果配置了randomBgColor为true,且配置了此值,则从默认的背景色数组中取出对应索引的颜色值,取值0-19之间
- colorIndex: {
- type: [String, Number],
- // 校验参数规则,索引在0-19之间
- validator(n2) {
- return test.range(n2, [0, 19]) || n2 === "";
- },
- default: () => props$1x.avatar.colorIndex
- },
- // 组件标识符
- name: {
- type: String,
- default: () => props$1x.avatar.name
- }
- }
- });
- const base64Avatar = "data:image/jpg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMtYzAxMSA2Ni4xNDU2NjEsIDIwMTIvMDIvMDYtMTQ6NTY6MjcgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzYgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjREMEQwRkY0RjgwNDExRUE5OTY2RDgxODY3NkJFODMxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjREMEQwRkY1RjgwNDExRUE5OTY2RDgxODY3NkJFODMxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NEQwRDBGRjJGODA0MTFFQTk5NjZEODE4Njc2QkU4MzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NEQwRDBGRjNGODA0MTFFQTk5NjZEODE4Njc2QkU4MzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAGBAQEBQQGBQUGCQYFBgkLCAYGCAsMCgoLCgoMEAwMDAwMDBAMDg8QDw4MExMUFBMTHBsbGxwfHx8fHx8fHx8fAQcHBw0MDRgQEBgaFREVGh8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx//wAARCADIAMgDAREAAhEBAxEB/8QAcQABAQEAAwEBAAAAAAAAAAAAAAUEAQMGAgcBAQAAAAAAAAAAAAAAAAAAAAAQAAIBAwICBgkDBQAAAAAAAAABAhEDBCEFMVFBYXGREiKBscHRMkJSEyOh4XLxYjNDFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A/fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHbHFyZ/Dam+yLA+Z2L0Pjtyj2poD4AAAAAAAAAAAAAAAAAAAAAAAAKWFs9y6lcvvwQeqj8z9wFaziY1n/HbUX9XF97A7QAGXI23EvJ1goyfzR0YEfN269jeZ+a03pNe0DIAAAAAAAAAAAAAAAAAAAACvtO3RcVkXlWutuL9YFYAAAAAOJRjKLjJVi9GmB5/csH/mu1h/in8PU+QGMAAAAAAAAAAAAAAAAAAaMDG/6MmMH8C80+xAelSSVFolwQAAAAAAAHVlWI37ErUulaPk+hgeYnCUJuElSUXRrrQHAAAAAAAAAAAAAAAAABa2Oz4bM7r4zdF2ICmAAAAAAAAAg7zZ8GX41wuJP0rRgYAAAAAAAAAAAAAAAAAD0m2R8ODaXU33tsDSAAAAAAAAAlb9HyWZcnJd9PcBHAAAAAAAAAAAAAAAAAPS7e64Vn+KA0AAAAAAAAAJm+v8Ftf3ewCKAAAAAAAAAAAAAAAAAX9muqeGo9NttP06+0DcAAAAAAAAAjb7dTu2ra+VOT9P8AQCWAAAAAAAAAAAAAAAAAUNmyPt5Ltv4bui/kuAF0AAAAAAADiUlGLlJ0SVW+oDzOXfd/Ind6JPRdS0QHSAAAAAAAAAAAAAAAAAE2nVaNcGB6Lbs6OTao9LsF51z60BrAAAAAABJ3jOVHjW3r/sa9QEgAAAAAAAAAAAAAAAAAAAPu1duWriuW34ZR4MC9hbnZyEoy8l36XwfYBsAAADaSq9EuLAlZ+7xSdrGdW9Hc5dgEdtt1erfFgAAAAAAAAAAAAAAAAADVjbblX6NR8MH80tEBRs7HYivyzlN8lovaBPzduvY0m6eK10TXtAyAarO55lpJK54orolr+4GqO/Xaea1FvqbXvA+Z77kNeW3GPbV+4DJfzcm/pcm3H6Vou5AdAFLC2ed2Pjv1txa8sV8T6wOL+yZEKu1JXFy4MDBOE4ScZxcZLinoB8gAAAAAAAAAAAB242LeyJ+C3GvN9C7QLmJtePYpKS+5c+p8F2IDYAANJqj1T4oCfk7Nj3G5Wn9qXJax7gJ93Z82D8sVNc4v30A6Xg5i42Z+iLfqARwcyT0sz9MWvWBps7LlTf5Grce9/oBTxdtxseklHxT+uWr9AGoAB138ezfj4bsFJdD6V2MCPm7RdtJzs1uW1xXzL3gTgAAAAAAAAADRhYc8q74I6RWs5ckB6GxYtWLat21SK731sDsAAAAAAAAAAAAAAAASt021NO/YjrxuQXT1oCOAAAAAAABzGLlJRSq26JAelwsWONYjbXxcZvmwO8AAAAAAAAAAAAAAAAAAef3TEWPkVivx3NY9T6UBiAAAAAABo2+VmGXblddIJ8eivRUD0oAAAAAAAAAAAAAAAAAAAYt4tKeFKVNYNSXfRgefAAAAAAAAr7VuSSWPedKaW5v1MCsAAAAAAAAAAAAAAAAAAIe6bj96Ts2n+JPzSXzP3ATgAAAAAAAAFbbt1UUrOQ9FpC4/UwK6aaqtU+DAAAAAAAAAAAAAAA4lKMIuUmoxWrb4ARNx3R3q2rLpa4Sl0y/YCcAAAAAAAAAAANmFud7G8r89r6X0dgFvGzLGRGtuWvTF6NAdwAAAAAAAAAAAy5W442PVN+K59EePp5ARMvOv5MvO6QXCC4AZwAAAAAAAAAAAAAcxlKLUotprg1owN+PvORborq+7Hnwl3gUbO74VzRydt8pKn68ANcJwmqwkpLmnUDkAAAAfNy9atqtyagut0AxXt5xIV8Fbj6lRd7Am5G65V6qUvtwfyx94GMAAAAAAAAAAAAAAAAAAAOU2nVOj5gdsc3LiqRvTpyqwOxbnnrhdfpSfrQB7pnv/AGvuS9gHXPMy5/Fem1yq0v0A6W29XqwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//Z";
- const _sfc_main$21 = {
- name: "u-avatar",
- mixins: [mpMixin, mixin, props$1l],
- data() {
- return {
- // 如果配置randomBgColor参数为true,在图标或者文字的模式下,会随机从中取出一个颜色值当做背景色
- colors: [
- "#ffb34b",
- "#f2bba9",
- "#f7a196",
- "#f18080",
- "#88a867",
- "#bfbf39",
- "#89c152",
- "#94d554",
- "#f19ec2",
- "#afaae4",
- "#e1b0df",
- "#c38cc1",
- "#72dcdc",
- "#9acdcb",
- "#77b1cc",
- "#448aca",
- "#86cefa",
- "#98d1ee",
- "#73d1f1",
- "#80a7dc"
- ],
- avatarUrl: this.src,
- allowMp: false
- };
- },
- watch: {
- // 监听头像src的变化,赋值给内部的avatarUrl变量,因为图片加载失败时,需要修改图片的src为默认值
- // 而组件内部不能直接修改props的值,所以需要一个中间变量
- src: {
- immediate: true,
- handler(newVal) {
- this.avatarUrl = newVal;
- if (!newVal) {
- this.errorHandler();
- }
- }
- }
- },
- computed: {
- imageStyle() {
- const style = {};
- return style;
- }
- },
- created() {
- this.init();
- },
- emits: ["click"],
- methods: {
- addStyle,
- addUnit,
- random,
- init() {
- },
- // 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
- isImg() {
- return this.src.indexOf("/") !== -1;
- },
- // 图片加载时失败时触发
- errorHandler() {
- this.avatarUrl = this.defaultUrl || base64Avatar;
- },
- clickHandler(e2) {
- this.$emit("click", this.name, e2);
- }
- }
- };
- function _sfc_render$20(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_up_text = vue.resolveComponent("up-text");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-avatar", [`u-avatar--${_ctx.shape}`]]),
- style: vue.normalizeStyle([{
- backgroundColor: _ctx.text || _ctx.icon ? _ctx.randomBgColor ? $data.colors[_ctx.colorIndex !== "" ? _ctx.colorIndex : $options.random(0, 19)] : _ctx.bgColor : "transparent",
- width: $options.addUnit(_ctx.size),
- height: $options.addUnit(_ctx.size)
- }, $options.addStyle(_ctx.customStyle)]),
- onClick: _cache[1] || (_cache[1] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- _ctx.mpAvatar && $data.allowMp ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [],
- 64
- /* STABLE_FRAGMENT */
- )) : _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- name: _ctx.icon,
- size: _ctx.fontSize,
- color: _ctx.color
- }, null, 8, ["name", "size", "color"])) : _ctx.text ? (vue.openBlock(), vue.createBlock(_component_up_text, {
- key: 2,
- text: _ctx.text,
- size: _ctx.fontSize,
- color: _ctx.color,
- align: "center",
- customStyle: "justify-content: center"
- }, null, 8, ["text", "size", "color"])) : (vue.openBlock(), vue.createElementBlock("image", {
- key: 3,
- class: vue.normalizeClass(["u-avatar__image", [`u-avatar__image--${_ctx.shape}`]]),
- src: $data.avatarUrl || _ctx.defaultUrl,
- mode: _ctx.mode,
- onError: _cache[0] || (_cache[0] = (...args) => $options.errorHandler && $options.errorHandler(...args)),
- style: vue.normalizeStyle([{
- width: $options.addUnit(_ctx.size),
- height: $options.addUnit(_ctx.size)
- }])
- }, null, 46, ["src", "mode"]))
- ], true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_0$a = /* @__PURE__ */ _export_sfc(_sfc_main$21, [["render", _sfc_render$20], ["__scopeId", "data-v-34d954f9"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-avatar/u-avatar.vue"]]);
- const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$a
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1k = defineMixin({
- props: {
- // 头像图片组
- urls: {
- type: Array,
- default: () => props$1x.avatarGroup.urls
- },
- // 最多展示的头像数量
- maxCount: {
- type: [String, Number],
- default: () => props$1x.avatarGroup.maxCount
- },
- // 头像形状
- shape: {
- type: String,
- default: () => props$1x.avatarGroup.shape
- },
- // 图片裁剪模式
- mode: {
- type: String,
- default: () => props$1x.avatarGroup.mode
- },
- // 超出maxCount时是否显示查看更多的提示
- showMore: {
- type: Boolean,
- default: () => props$1x.avatarGroup.showMore
- },
- // 头像大小
- size: {
- type: [String, Number],
- default: () => props$1x.avatarGroup.size
- },
- // 指定从数组的对象元素中读取哪个属性作为图片地址
- keyName: {
- type: String,
- default: () => props$1x.avatarGroup.keyName
- },
- // 头像之间的遮挡比例
- gap: {
- type: [String, Number],
- validator(value2) {
- return value2 >= 0 && value2 <= 1;
- },
- default: () => props$1x.avatarGroup.gap
- },
- // 需额外显示的值
- extraValue: {
- type: [Number, String],
- default: () => props$1x.avatarGroup.extraValue
- }
- }
- });
- const _sfc_main$20 = {
- name: "u-avatar-group",
- mixins: [mpMixin, mixin, props$1k],
- data() {
- return {};
- },
- computed: {
- showUrl() {
- return this.urls.slice(0, this.maxCount);
- }
- },
- emits: ["showMore"],
- methods: {
- addUnit,
- testObject: test.object,
- clickHandler() {
- this.$emit("showMore");
- }
- }
- };
- function _sfc_render$1$(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_avatar = resolveEasycom(vue.resolveDynamicComponent("u-avatar"), __easycom_0$a);
- const _component_up_text = vue.resolveComponent("up-text");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-avatar-group" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.showUrl, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-avatar-group__item",
- key: index2,
- style: vue.normalizeStyle({
- marginLeft: index2 === 0 ? 0 : $options.addUnit(-_ctx.size * _ctx.gap)
- })
- },
- [
- vue.createVNode(_component_u_avatar, {
- size: _ctx.size,
- shape: _ctx.shape,
- mode: _ctx.mode,
- src: $options.testObject(item) ? _ctx.keyName && item[_ctx.keyName] || item.url : item
- }, null, 8, ["size", "shape", "mode", "src"]),
- _ctx.showMore && index2 === $options.showUrl.length - 1 && (_ctx.urls.length > _ctx.maxCount || _ctx.extraValue > 0) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-avatar-group__item__show-more",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- }, [
- vue.createVNode(_component_up_text, {
- color: "#ffffff",
- size: _ctx.size * 0.4,
- text: `+${_ctx.extraValue || _ctx.urls.length - $options.showUrl.length}`,
- align: "center",
- customStyle: "justify-content: center"
- }, null, 8, ["size", "text"])
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }
- const uAvatarGroup = /* @__PURE__ */ _export_sfc(_sfc_main$20, [["render", _sfc_render$1$], ["__scopeId", "data-v-3bd09520"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-avatar-group/u-avatar-group.vue"]]);
- const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uAvatarGroup
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1j = defineMixin({
- props: {
- // 返回顶部的形状,circle-圆形,square-方形
- mode: {
- type: String,
- default: () => props$1x.backtop.mode
- },
- // 自定义图标
- icon: {
- type: String,
- default: () => props$1x.backtop.icon
- },
- // 提示文字
- text: {
- type: String,
- default: () => props$1x.backtop.text
- },
- // 返回顶部滚动时间
- duration: {
- type: [String, Number],
- default: () => props$1x.backtop.duration
- },
- // 滚动距离
- scrollTop: {
- type: [String, Number],
- default: () => props$1x.backtop.scrollTop
- },
- // 距离顶部多少距离显示,单位px
- top: {
- type: [String, Number],
- default: () => props$1x.backtop.top
- },
- // 返回顶部按钮到底部的距离,单位px
- bottom: {
- type: [String, Number],
- default: () => props$1x.backtop.bottom
- },
- // 返回顶部按钮到右边的距离,单位px
- right: {
- type: [String, Number],
- default: () => props$1x.backtop.right
- },
- // 层级
- zIndex: {
- type: [String, Number],
- default: () => props$1x.backtop.zIndex
- },
- // 图标的样式,对象形式
- iconStyle: {
- type: Object,
- default: () => props$1x.backtop.iconStyle
- }
- }
- });
- const _sfc_main$1$ = {
- name: "u-back-top",
- mixins: [mpMixin, mixin, props$1j],
- computed: {
- backTopStyle() {
- const style = {
- bottom: addUnit(this.bottom),
- right: addUnit(this.right),
- width: "40px",
- height: "40px",
- position: "fixed",
- zIndex: 10
- };
- return style;
- },
- show() {
- return getPx(this.scrollTop) > getPx(this.top);
- },
- contentStyle() {
- const style = {};
- let radius = 0;
- if (this.mode === "circle") {
- radius = "100px";
- } else {
- radius = "4px";
- }
- style.borderTopLeftRadius = radius;
- style.borderTopRightRadius = radius;
- style.borderBottomLeftRadius = radius;
- style.borderBottomRightRadius = radius;
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- emits: ["click"],
- methods: {
- backToTop() {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: this.duration
- });
- this.$emit("click");
- }
- }
- };
- function _sfc_render$1_(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_2$1);
- return vue.openBlock(), vue.createBlock(_component_u_transition, {
- mode: "fade",
- customStyle: $options.backTopStyle,
- show: $options.show
- }, {
- default: vue.withCtx(() => [
- !_ctx.$slots.default && !_ctx.$slots.$default ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-back-top",
- style: vue.normalizeStyle([$options.contentStyle]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.backToTop && $options.backToTop(...args))
- },
- [
- vue.createVNode(_component_up_icon, {
- name: _ctx.icon,
- "custom-style": _ctx.iconStyle
- }, null, 8, ["name", "custom-style"]),
- _ctx.text ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-back-top__text"
- },
- vue.toDisplayString(_ctx.text),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true)
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["customStyle", "show"]);
- }
- const uBackTop = /* @__PURE__ */ _export_sfc(_sfc_main$1$, [["render", _sfc_render$1_], ["__scopeId", "data-v-91347e36"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-back-top/u-back-top.vue"]]);
- const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uBackTop
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1i = defineMixin({
- props: {
- // 是否显示圆点
- isDot: {
- type: Boolean,
- default: () => props$1x.badge.isDot
- },
- // 显示的内容
- value: {
- type: [Number, String],
- default: () => props$1x.badge.value
- },
- // 显示的内容
- modelValue: {
- type: [Number, String],
- default: () => props$1x.badge.modelValue
- },
- // 是否显示
- show: {
- type: Boolean,
- default: () => props$1x.badge.show
- },
- // 最大值,超过最大值会显示 '{max}+'
- max: {
- type: [Number, String],
- default: () => props$1x.badge.max
- },
- // 主题类型,error|warning|success|primary
- type: {
- type: String,
- default: () => props$1x.badge.type
- },
- // 当数值为 0 时,是否展示 Badge
- showZero: {
- type: Boolean,
- default: () => props$1x.badge.showZero
- },
- // 背景颜色,优先级比type高,如设置,type参数会失效
- bgColor: {
- type: [String, null],
- default: () => props$1x.badge.bgColor
- },
- // 字体颜色
- color: {
- type: [String, null],
- default: () => props$1x.badge.color
- },
- // 徽标形状,circle-四角均为圆角,horn-左下角为直角
- shape: {
- type: String,
- default: () => props$1x.badge.shape
- },
- // 设置数字的显示方式,overflow|ellipsis|limit
- // overflow会根据max字段判断,超出显示`${max}+`
- // ellipsis会根据max判断,超出显示`${max}...`
- // limit会依据1000作为判断条件,超出1000,显示`${value/1000}K`,比如2.2k、3.34w,最多保留2位小数
- numberType: {
- type: String,
- default: () => props$1x.badge.numberType
- },
- // 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,absolute为true时有效
- offset: {
- type: Array,
- default: () => props$1x.badge.offset
- },
- // 是否反转背景和字体颜色
- inverted: {
- type: Boolean,
- default: () => props$1x.badge.inverted
- },
- // 是否绝对定位
- absolute: {
- type: Boolean,
- default: () => props$1x.badge.absolute
- }
- }
- });
- const _sfc_main$1_ = {
- name: "u-badge",
- mixins: [mpMixin, props$1i, mixin],
- computed: {
- // 是否将badge中心与父组件右上角重合
- boxStyle() {
- let style = {};
- return style;
- },
- // 整个组件的样式
- badgeStyle() {
- const style = {};
- if (this.color) {
- style.color = this.color;
- }
- if (this.bgColor && !this.inverted) {
- style.backgroundColor = this.bgColor;
- }
- if (this.absolute) {
- style.position = "absolute";
- if (this.offset.length) {
- const top = this.offset[0];
- const right = this.offset[1] || top;
- style.top = addUnit(top);
- style.right = addUnit(right);
- }
- }
- return style;
- },
- showValue() {
- switch (this.numberType) {
- case "overflow":
- return Number(this.value) > Number(this.max) ? this.max + "+" : this.value;
- case "ellipsis":
- return Number(this.value) > Number(this.max) ? "..." : this.value;
- case "limit":
- return Number(this.value) > 999 ? Number(this.value) >= 9999 ? Math.floor(this.value / 1e4 * 100) / 100 + "w" : Math.floor(this.value / 1e3 * 100) / 100 + "k" : this.value;
- default:
- return Number(this.value);
- }
- }
- },
- methods: {
- addStyle
- }
- };
- function _sfc_render$1Z(_ctx, _cache, $props, $setup, $data, $options) {
- return _ctx.show && ((Number(_ctx.value) === 0 ? _ctx.showZero : true) || _ctx.isDot) ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass([[_ctx.isDot ? "u-badge--dot" : "u-badge--not-dot", _ctx.inverted && "u-badge--inverted", _ctx.shape === "horn" && "u-badge--horn", `u-badge--${_ctx.type}${_ctx.inverted ? "--inverted" : ""}`], "u-badge"]),
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle), $options.badgeStyle])
- },
- vue.toDisplayString(_ctx.isDot ? "" : $options.showValue),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0$9 = /* @__PURE__ */ _export_sfc(_sfc_main$1_, [["render", _sfc_render$1Z], ["__scopeId", "data-v-06cca9b7"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-badge/u-badge.vue"]]);
- const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$9
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1Z = {
- name: "u-barcode",
- props: {
- // 条码值
- value: {
- type: [String, Number],
- required: true
- },
- // 条码格式
- format: {
- type: String,
- default: "auto",
- validator: function(value2) {
- return [
- "auto",
- "CODE128",
- "CODE128A",
- "CODE128B",
- "CODE128C",
- "EAN13",
- "EAN8",
- "EAN5",
- "EAN2",
- "UPC",
- "UPCA",
- "UPCE",
- "CODE39",
- "ITF",
- "ITF14",
- "MSI",
- "MSI10",
- "MSI11",
- "MSI1010",
- "MSI1110",
- "pharmacode",
- "codabar"
- ].includes(value2);
- }
- },
- // 宽度
- width: {
- type: Number,
- default: 200
- },
- // 高度
- height: {
- type: Number,
- default: 80
- },
- // 是否显示文本
- displayValue: {
- type: Boolean,
- default: true
- },
- // 文本内容
- text: {
- type: String,
- default: void 0
- },
- // 字体选项
- fontOptions: {
- type: String,
- default: ""
- },
- // 字体
- font: {
- type: String,
- default: "monospace"
- },
- // 文本对齐方式
- textAlign: {
- type: String,
- default: "center"
- },
- // 文本位置
- textPosition: {
- type: String,
- default: "bottom"
- },
- // 文本边距
- textMargin: {
- type: Number,
- default: 2
- },
- // 字体大小
- fontSize: {
- type: Number,
- default: 14
- },
- // 背景色
- background: {
- type: String,
- default: "#ffffff"
- },
- // 条码颜色
- lineColor: {
- type: String,
- default: "#000000"
- },
- // 边距
- margin: {
- type: Number,
- default: 10
- },
- // 上边距
- marginTop: {
- type: Number,
- default: void 0
- },
- // 下边距
- marginBottom: {
- type: Number,
- default: void 0
- },
- // 左边距
- marginLeft: {
- type: Number,
- default: void 0
- },
- // 右边距
- marginRight: {
- type: Number,
- default: void 0
- },
- // 使用canvas还是生成图片
- useCanvas: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {
- canvasId: "barcode-" + Math.random().toString(36).substr(2, 9),
- barcodeImage: "",
- showCanvas: false,
- canvasWidth: 0,
- canvasHeight: 0,
- calcSizeDone: false,
- error: ""
- };
- },
- watch: {
- value() {
- this.generateBarcode();
- },
- format() {
- this.generateBarcode();
- },
- width() {
- this.generateBarcode();
- },
- height() {
- this.generateBarcode();
- },
- displayValue() {
- this.generateBarcode();
- },
- text() {
- this.generateBarcode();
- },
- font() {
- this.generateBarcode();
- },
- textAlign() {
- this.generateBarcode();
- },
- textPosition() {
- this.generateBarcode();
- },
- textMargin() {
- this.generateBarcode();
- },
- fontSize() {
- this.generateBarcode();
- },
- background() {
- this.generateBarcode();
- },
- lineColor() {
- this.generateBarcode();
- },
- margin() {
- this.generateBarcode();
- }
- },
- mounted() {
- this.$nextTick(() => {
- this.generateBarcode();
- });
- },
- methods: {
- /**
- * 生成条形码
- * @author jry <ijry@qq.com>
- * @param {String|Number} value - 条码值
- * @param {Object} options - 条码配置选项
- */
- generateBarcode() {
- const margin = this.margin;
- const options2 = {
- format: this.format || "auto",
- width: this.width,
- height: this.height,
- displayValue: this.displayValue,
- text: this.text,
- fontOptions: this.fontOptions || "",
- font: this.font || "monospace",
- textAlign: this.textAlign || "center",
- textPosition: this.textPosition || "bottom",
- textMargin: this.textMargin !== void 0 ? this.textMargin : 2,
- fontSize: this.fontSize || 20,
- background: this.background || "#ffffff",
- lineColor: this.lineColor || "#000000",
- margin,
- marginTop: this.marginTop !== void 0 ? this.marginTop : margin,
- marginBottom: this.marginBottom !== void 0 ? this.marginBottom : margin,
- marginLeft: this.marginLeft !== void 0 ? this.marginLeft : margin,
- marginRight: this.marginRight !== void 0 ? this.marginRight : margin
- };
- Object.keys(options2).forEach((key) => {
- if (options2[key] === void 0) {
- delete options2[key];
- }
- });
- if (this.useCanvas) {
- this.showCanvas = true;
- this.$nextTick(() => {
- this.renderToCanvas(options2);
- });
- } else {
- this.showCanvas = false;
- this.renderToImage(options2);
- }
- },
- /**
- * 渲染条形码到canvas
- * @author jry <ijry@qq.com>
- * @param {Object} options - 条码配置选项
- */
- async renderToCanvas(options2) {
- try {
- this.calculateCanvasSize(options2);
- await vue.nextTick();
- const ctx = uni.createCanvasContext(this.canvasId, this);
- ctx.setFillStyle(options2.background);
- ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight);
- const barcodeData = this.encodeBarcode(this.value, options2.format);
- if (barcodeData) {
- this.drawBarcode(ctx, barcodeData, options2);
- }
- ctx.draw(false, () => {
- this.$emit("rendered", { type: "canvas", id: this.canvasId });
- });
- } catch (error2) {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-barcode/u-barcode.vue:293", "生成条码失败:", error2);
- this.error = error2.message || t$1("up.barcode.error");
- this.$emit("error", error2);
- }
- },
- /**
- * 渲染条形码为图片
- * @author jry <ijry@qq.com>
- * @param {Object} options - 条码配置选项
- */
- renderToImage(options2) {
- try {
- this.calculateCanvasSize(options2);
- const tempCanvasId = "temp-" + this.canvasId;
- const ctx = uni.createCanvasContext(tempCanvasId, this);
- ctx.setFillStyle(options2.background);
- ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight);
- const barcodeData = this.encodeBarcode(this.value, options2.format);
- if (barcodeData) {
- this.drawBarcode(ctx, barcodeData, options2);
- }
- ctx.draw(false, () => {
- setTimeout(() => {
- uni.canvasToTempFilePath({
- canvasId: tempCanvasId,
- success: (res) => {
- this.barcodeImage = res.tempFilePath;
- this.$emit("rendered", { type: "image", value: this.value, path: res.tempFilePath });
- },
- fail: (error2) => {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-barcode/u-barcode.vue:337", "生成条码图片失败:", error2);
- this.$emit("error", error2);
- }
- }, this);
- }, 100);
- });
- } catch (error2) {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-barcode/u-barcode.vue:344", "生成条码图片失败:", error2);
- this.$emit("error", error2);
- }
- },
- /**
- * 计算canvas尺寸
- * @author jry <ijry@qq.com>
- * @param {Object} options - 条码配置选项
- */
- calculateCanvasSize(options2) {
- let width = options2.width;
- let height = options2.height;
- const marginLeft = options2.marginLeft;
- const marginRight = options2.marginRight;
- const marginTop = options2.marginTop;
- const marginBottom = options2.marginBottom;
- let textHeight = 0;
- if (options2.displayValue !== false) {
- textHeight = options2.fontSize + options2.textMargin;
- }
- if (options2.textPosition === "top" || options2.textPosition === "bottom") {
- height += textHeight;
- }
- width += marginLeft + marginRight;
- height += marginTop + marginBottom;
- this.canvasWidth = Math.max(width, 100);
- this.canvasHeight = Math.max(height, 60 + textHeight);
- this.calcSizeDone = true;
- },
- /**
- * 编码条形码数据
- * @author jry <ijry@qq.com>
- * @param {String|Number} value - 条码值
- * @param {String} format - 条码格式
- * @returns {String|null} 条形码编码数据
- */
- encodeBarcode(value2, format2) {
- try {
- switch (format2) {
- case "CODE128":
- case "auto":
- return this.encodeCode128(value2);
- case "CODE39":
- return this.encodeCode39(value2);
- case "EAN13":
- return this.encodeEAN13(value2);
- case "EAN8":
- return this.encodeEAN8(value2);
- case "EAN5":
- case "EAN2":
- return this.encodeEAN52(value2, format2);
- case "UPC":
- case "UPCA":
- return this.encodeUPCA(value2);
- case "UPCE":
- return this.encodeUPCE(value2);
- default:
- return this.encodeCode128(value2);
- }
- } catch (error2) {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-barcode/u-barcode.vue:418", "条码编码失败:", error2);
- throw error2;
- }
- },
- /**
- * 添加右侧安静区(至少2个模块宽度的空白)
- * @author jry <ijry@qq.com>
- * @param {String} data - 要编码的数据
- * @returns {String|null} 编码后的条形码数据
- */
- encodeCode128(data) {
- const CODE128_START_CODE_B = 104;
- const CODE128_STOP = 106;
- const CODE128_CODE_B_CHARS = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
- const codes = [];
- let checksum = CODE128_START_CODE_B;
- codes.push(CODE128_START_CODE_B);
- for (let i2 = 0; i2 < data.length; i2++) {
- const char = data[i2];
- const code2 = CODE128_CODE_B_CHARS.indexOf(char);
- if (code2 === -1) {
- throw new Error("Invalid character in CODE128: " + char);
- }
- codes.push(code2);
- checksum += code2 * (i2 + 1);
- }
- codes.push(checksum % 103);
- codes.push(CODE128_STOP);
- let barcode = "";
- for (let i2 = 0; i2 < codes.length; i2++) {
- const code2 = codes[i2];
- barcode += this.getCode128Pattern(code2);
- }
- barcode += "00000";
- return barcode;
- },
- /**
- * 获取CODE128编码模式
- * @author jry <ijry@qq.com>
- * @param {Number} code - 字符编码
- * @returns {String} 条形码二进制模式
- */
- getCode128Pattern(code2) {
- const patterns = [
- "11011001100",
- "11001101100",
- "11001100110",
- "10010011000",
- "10010001100",
- "10001001100",
- "10011001000",
- "10011000100",
- "10001100100",
- "11001001000",
- "11001000100",
- "11000100100",
- "10110011100",
- "10011011100",
- "10011001110",
- "10111001100",
- "10011101100",
- "10011100110",
- "11001110010",
- "11001011100",
- "11001001110",
- "11011100100",
- "11001110100",
- "11101101110",
- "11101001100",
- "11100101100",
- "11100100110",
- "11101100100",
- "11100110100",
- "11100110010",
- "11011011000",
- "11011000110",
- "11000110110",
- "10100011000",
- "10001011000",
- "10001000110",
- "10110001000",
- "10001101000",
- "10001100010",
- "11010001000",
- "11000101000",
- "11000100010",
- "10110111000",
- "10110001110",
- "10001101110",
- "10111011000",
- "10111000110",
- "10001110110",
- "11101110110",
- "11010001110",
- "11000101110",
- "11011101000",
- "11011100010",
- "11011101110",
- "11101011000",
- "11101000110",
- "11100010110",
- "11101101000",
- "11101100010",
- "11100011010",
- "11101111010",
- "11001000010",
- "11110001010",
- "10100110000",
- "10100001100",
- "10010110000",
- "10010000110",
- "10000101100",
- "10000100110",
- "10110010000",
- "10110000100",
- "10011010000",
- "10011000010",
- "10000110100",
- "10000110010",
- "11000010010",
- "11001010000",
- "11110111010",
- "11000010100",
- "10001111010",
- "10100111100",
- "10010111100",
- "10010011110",
- "10111100100",
- "10011110100",
- "10011110010",
- "11110100100",
- "11110010100",
- "11110010010",
- "11011011110",
- "11011110110",
- "11110110110",
- "10101111000",
- "10100011110",
- "10001011110",
- "10111101000",
- "10111100010",
- "11110101000",
- "11110100010",
- "10111011110",
- "10111101110",
- "11101011110",
- "11110101110",
- "11010000100",
- "11010010000",
- "11010011100",
- "11000111010"
- ];
- return patterns[code2] || "";
- },
- /**
- * CODE39编码实现
- * @author jry <ijry@qq.com>
- * @param {String} data - 要编码的数据
- * @returns {String|null} 编码后的条形码数据
- */
- encodeCode39(data) {
- const codes = {
- "0": "101000111011101",
- "1": "111010001010111",
- "2": "101110001010111",
- "3": "111011100010101",
- "4": "101000111010111",
- "5": "111010001110101",
- "6": "101110001110101",
- "7": "101000101110111",
- "8": "111010001011101",
- "9": "101110001011101",
- "A": "111010100010111",
- "B": "101110100010111",
- "C": "111011101000101",
- "D": "101011100010111",
- "E": "111010111000101",
- "F": "101110111000101",
- "G": "101010001110111",
- "H": "111010100011101",
- "I": "101110100011101",
- "J": "101011100011101",
- "K": "111010101000111",
- "L": "101110101000111",
- "M": "111011101010001",
- "N": "101011101000111",
- "O": "111010111010001",
- "P": "101110111010001",
- "Q": "101010111000111",
- "R": "111010101110001",
- "S": "101110101110001",
- "T": "101011101110001",
- "U": "111000101010111",
- "V": "100011101010111",
- "W": "111000111010101",
- "X": "100010111010111",
- "Y": "111000101110101",
- "Z": "100011101110101",
- "-": "100010101110111",
- ".": "111000101011101",
- " ": "100011101011101",
- "*": "100010111011101",
- // 起始和终止字符
- "$": "100010001000101",
- "/": "100010001010001",
- "+": "100010100010001",
- "%": "101000100010001"
- };
- data = data.toUpperCase();
- let barcode = codes["*"];
- for (let i2 = 0; i2 < data.length; i2++) {
- const char = data[i2];
- if (codes[char]) {
- barcode += "0";
- barcode += codes[char];
- } else {
- throw new Error("Invalid character in CODE39: " + char);
- }
- }
- barcode += "0";
- barcode += codes["*"];
- return barcode;
- },
- /**
- * EAN13编码实现
- * @author jry <ijry@qq.com>
- * @param {String} data - 13位数字字符串
- * @returns {String|null} 编码后的条形码数据
- */
- encodeEAN13(data) {
- if (!/^\d{13}$/.test(data)) {
- throw new Error("EAN13 must be 13 digits");
- }
- let sum = 0;
- for (let i2 = 0; i2 < 12; i2++) {
- const digit = parseInt(data[i2]);
- sum += i2 % 2 === 0 ? digit : digit * 3;
- }
- const checkDigit = (10 - sum % 10) % 10;
- if (parseInt(data[12]) !== checkDigit) {
- throw new Error("Invalid EAN13 check digit");
- }
- const leftData = data.substring(1, 7);
- const rightData = data.substring(7, 13);
- let barcode = "101";
- const firstDigit = parseInt(data[0]);
- const leftPatterns = [
- [
- "LLLLLL",
- "LLGLGG",
- "LLGGLG",
- "LLGGGL",
- "LGLLGG",
- "LGGLLG",
- "LGGGLL",
- "LGLGLG",
- "LGLGGL",
- "LGGLGL"
- ]
- ];
- const pattern2 = leftPatterns[0][firstDigit];
- const leftOdd = [
- "0001101",
- "0011001",
- "0010011",
- "0111101",
- "0100011",
- "0110001",
- "0101111",
- "0111011",
- "0110111",
- "0001011"
- ];
- const leftEven = [
- "0100111",
- "0110011",
- "0011011",
- "0100001",
- "0011101",
- "0111001",
- "0000101",
- "0010001",
- "0001001",
- "0010111"
- ];
- for (let i2 = 0; i2 < leftData.length; i2++) {
- const digit = parseInt(leftData[i2]);
- if (pattern2[i2] === "L") {
- barcode += leftOdd[digit];
- } else {
- barcode += leftEven[digit];
- }
- }
- barcode += "01010";
- const rightCodes = [
- "1110010",
- "1100110",
- "1101100",
- "1000010",
- "1011100",
- "1001110",
- "1010000",
- "1000100",
- "1001000",
- "1110100"
- ];
- for (let i2 = 0; i2 < rightData.length; i2++) {
- const digit = parseInt(rightData[i2]);
- barcode += rightCodes[digit];
- }
- barcode += "101";
- return barcode;
- },
- /**
- * EAN8编码实现
- * @author jry <ijry@qq.com>
- * @param {String} data - 8位数字字符串
- * @returns {String|null} 编码后的条形码数据
- */
- encodeEAN8(data) {
- if (!/^\d{8}$/.test(data)) {
- throw new Error("EAN8 must be 8 digits");
- }
- let sum = 0;
- for (let i2 = 0; i2 < 7; i2++) {
- const digit = parseInt(data[i2]);
- sum += digit * (i2 % 2 === 0 ? 3 : 1);
- }
- const checkDigit = (10 - sum % 10) % 10;
- if (parseInt(data[7]) !== checkDigit) {
- throw new Error("Invalid EAN8 check digit");
- }
- const leftData = data.substring(0, 4);
- const rightData = data.substring(4, 8);
- let barcode = "101";
- const leftOdd = [
- "0001101",
- "0011001",
- "0010011",
- "0111101",
- "0100011",
- "0110001",
- "0101111",
- "0111011",
- "0110111",
- "0001011"
- ];
- for (let i2 = 0; i2 < leftData.length; i2++) {
- const digit = parseInt(leftData[i2]);
- barcode += leftOdd[digit];
- }
- barcode += "01010";
- const rightCodes = [
- "1110010",
- "1100110",
- "1101100",
- "1000010",
- "1011100",
- "1001110",
- "1010000",
- "1000100",
- "1001000",
- "1110100"
- ];
- for (let i2 = 0; i2 < rightData.length; i2++) {
- const digit = parseInt(rightData[i2]);
- barcode += rightCodes[digit];
- }
- barcode += "101";
- return barcode;
- },
- /**
- * EAN5/EAN2编码实现
- * @author jry <ijry@qq.com>
- * @param {String} data - 2位或5位数字字符串
- * @param {String} format - 格式类型(EAN5或EAN2)
- * @returns {String|null} 编码后的条形码数据
- */
- encodeEAN52(data, format2) {
- const length = format2 === "EAN5" ? 5 : 2;
- if (!new RegExp(`^\\d{${length}}$`).test(data)) {
- throw new Error(`${format2} must be ${length} digits`);
- }
- const codes = [
- "0001101",
- "0011001",
- "0010011",
- "0111101",
- "0100011",
- "0110001",
- "0101111",
- "0111011",
- "0110111",
- "0001011"
- ];
- let checksum = 0;
- for (let i2 = 0; i2 < data.length; i2++) {
- checksum += parseInt(data[i2]) * (i2 % 2 === 0 ? 3 : 1);
- }
- let barcode = "1011";
- for (let i2 = 0; i2 < data.length; i2++) {
- if (i2 > 0) {
- barcode += "01";
- }
- const digit = parseInt(data[i2]);
- const code2 = codes[digit];
- barcode += code2;
- }
- return barcode;
- },
- /**
- * UPCA编码实现
- * @author jry <ijry@qq.com>
- * @param {String} data - 11位或12位数字字符串
- * @returns {String|null} 编码后的条形码数据
- */
- encodeUPCA(data) {
- if (/^\d{11}$/.test(data)) {
- let sum = 0;
- for (let i2 = 0; i2 < 11; i2++) {
- const digit = parseInt(data[i2]);
- sum += i2 % 2 === 0 ? digit * 3 : digit;
- }
- const checkDigit = (10 - sum % 10) % 10;
- data += checkDigit;
- }
- if (!/^\d{12}$/.test(data)) {
- throw new Error("UPC-A must be 11 or 12 digits");
- }
- return this.encodeEAN13("0" + data);
- },
- /**
- * UPCE编码实现
- * @author jry <ijry@qq.com>
- * @param {String} data - 6位或8位数字字符串
- * @returns {String|null} 编码后的条形码数据
- */
- encodeUPCE(data) {
- if (/^\d{7}$/.test(data)) {
- let sum = 0;
- for (let i2 = 0; i2 < 7; i2++) {
- const digit = parseInt(data[i2]);
- sum += i2 % 2 === 0 ? digit * 3 : digit;
- }
- const checkDigit2 = (10 - sum % 10) % 10;
- data += checkDigit2;
- }
- if (!/^\d{8}$/.test(data)) {
- throw new Error("UPC-E must be 7 or 8 digits");
- }
- if (data[0] !== "0" && data[0] !== "1") {
- throw new Error("UPC-E must start with 0 or 1");
- }
- const leftOdd = [
- "0001101",
- "0011001",
- "0010011",
- "0111101",
- "0100011",
- "0110001",
- "0101111",
- "0111011",
- "0110111",
- "0001011"
- ];
- const leftEven = [
- "0100111",
- "0110011",
- "0011011",
- "0100001",
- "0011101",
- "0111001",
- "0000101",
- "0010001",
- "0001001",
- "0010111"
- ];
- data[0];
- const checkDigit = data[7];
- const middleData = data.substring(1, 7);
- let pattern2;
- if (checkDigit === "0" || checkDigit === "1" || checkDigit === "2") {
- pattern2 = "EEEEOO";
- } else if (checkDigit === "3") {
- pattern2 = "EEEEOO";
- } else if (checkDigit === "4") {
- pattern2 = "EEEOOO";
- } else {
- pattern2 = "EEOOOO";
- }
- let barcode = "101";
- for (let i2 = 0; i2 < middleData.length; i2++) {
- const digit = parseInt(middleData[i2]);
- if (pattern2[i2] === "E") {
- barcode += leftEven[digit];
- } else {
- barcode += leftOdd[digit];
- }
- }
- barcode += "010101";
- barcode += "101";
- return barcode;
- },
- /**
- * 绘制条形码
- * @author jry <ijry@qq.com>
- * @param {Object} ctx - canvas上下文
- * @param {String} barcodeData - 条形码数据
- * @param {Object} options - 条码配置选项
- */
- drawBarcode(ctx, barcodeData, options2) {
- if (!barcodeData)
- return;
- const marginLeft = options2.marginLeft;
- const marginTop = options2.marginTop;
- const marginBottom = options2.marginBottom;
- const textHeight = options2.displayValue !== false ? options2.fontSize + options2.textMargin : 0;
- const height = options2.height;
- const moduleWidth = Math.max(1, (this.canvasWidth - marginLeft - (options2.marginRight || 10)) / barcodeData.length);
- ctx.setFillStyle(options2.lineColor);
- let barcodeY = marginTop;
- if (options2.displayValue !== false && options2.textPosition === "top") {
- barcodeY += textHeight;
- }
- let x2 = marginLeft;
- for (let i2 = 0; i2 < barcodeData.length; i2++) {
- if (barcodeData[i2] === "1") {
- ctx.fillRect(x2, barcodeY, moduleWidth, height);
- }
- x2 += moduleWidth;
- }
- if (options2.displayValue !== false) {
- const text = options2.text || this.value;
- let textY;
- ctx.setFillStyle(options2.lineColor);
- ctx.setFontSize(options2.fontSize);
- ctx.setTextAlign(options2.textAlign);
- let textX;
- switch (options2.textAlign) {
- case "left":
- textX = marginLeft;
- break;
- case "right":
- textX = this.canvasWidth - options2.marginRight;
- break;
- default:
- textX = this.canvasWidth / 2;
- }
- if (options2.textPosition === "top") {
- textY = marginTop + options2.fontSize - 3;
- } else {
- textY = barcodeY + height + options2.textMargin + options2.fontSize;
- if (textY > this.canvasHeight - marginBottom) {
- textY = this.canvasHeight - marginBottom - 2;
- }
- }
- ctx.fillText(text, textX, textY);
- }
- }
- }
- };
- function _sfc_render$1Y(_ctx, _cache, $props, $setup, $data, $options) {
- return $data.calcSizeDone ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-barcode"
- }, [
- $data.showCanvas && !$data.error ? (vue.openBlock(), vue.createElementBlock("canvas", {
- key: 0,
- id: $data.canvasId,
- "canvas-id": $data.canvasId,
- style: vue.normalizeStyle({ width: $data.canvasWidth + "px", height: $data.canvasHeight + "px" })
- }, null, 12, ["id", "canvas-id"])) : !$data.showCanvas && !$data.error ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- src: $data.barcodeImage,
- style: vue.normalizeStyle({ width: $data.canvasWidth + "px", height: $data.canvasHeight + "px" }),
- mode: "aspectFit"
- }, null, 12, ["src"])) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "error-container",
- style: vue.normalizeStyle({ width: $data.canvasWidth + "px", height: $data.canvasHeight + "px" })
- },
- [
- vue.createElementVNode(
- "text",
- { class: "error-text" },
- vue.toDisplayString($data.error),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- ))
- ])) : vue.createCommentVNode("v-if", true);
- }
- const uBarcode = /* @__PURE__ */ _export_sfc(_sfc_main$1Z, [["render", _sfc_render$1Y], ["__scopeId", "data-v-f3ca37b6"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-barcode/u-barcode.vue"]]);
- const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uBarcode
- }, Symbol.toStringTag, { value: "Module" }));
- const propsBox = defineMixin({
- props: {
- // 背景色
- bgColors: {
- type: [Array],
- default: ["#EEFCFF", "#FCF8FF", "#FDF8F2"]
- },
- // 高度
- height: {
- type: [String],
- default: "160px"
- },
- // 圆角
- borderRadius: {
- type: [String],
- default: "6px"
- },
- // 间隔
- gap: {
- type: [String],
- default: "15px"
- }
- }
- });
- const _sfc_main$1Y = {
- name: "up-box",
- data() {
- return {};
- },
- mixins: [mpMixin, mixin, propsBox],
- computed: {},
- emits: [],
- methods: {
- addStyle
- }
- };
- function _sfc_render$1X(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-box",
- style: vue.normalizeStyle([{ height: _ctx.height }, $options.addStyle(_ctx.customStyle)])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-box__left",
- style: vue.normalizeStyle({ borderRadius: _ctx.borderRadius, backgroundColor: _ctx.bgColors[0] })
- },
- [
- vue.renderSlot(_ctx.$slots, "left", {}, () => [
- vue.createTextVNode("左")
- ], true)
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "u-box__gap",
- style: vue.normalizeStyle({ width: _ctx.gap, height: _ctx.height })
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "u-box__right" }, [
- vue.createElementVNode(
- "view",
- {
- class: "u-box__right-top",
- style: vue.normalizeStyle({ borderRadius: _ctx.borderRadius, backgroundColor: _ctx.bgColors[1] })
- },
- [
- vue.renderSlot(_ctx.$slots, "rightTop", {}, () => [
- vue.createTextVNode("右上")
- ], true)
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "u-box__right-gap",
- style: vue.normalizeStyle({ height: _ctx.gap })
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "u-box__right-bottom",
- style: vue.normalizeStyle({ borderRadius: _ctx.borderRadius, backgroundColor: _ctx.bgColors[2] })
- },
- [
- vue.renderSlot(_ctx.$slots, "rightBottom", {}, () => [
- vue.createTextVNode("右下")
- ], true)
- ],
- 4
- /* STYLE */
- )
- ])
- ],
- 4
- /* STYLE */
- );
- }
- const uBox = /* @__PURE__ */ _export_sfc(_sfc_main$1Y, [["render", _sfc_render$1X], ["__scopeId", "data-v-5409417d"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-box/u-box.vue"]]);
- const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uBox
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1h = defineMixin({
- props: {
- // 是否细边框
- hairline: {
- type: Boolean,
- default: () => props$1x.button.hairline
- },
- // 按钮的预置样式,info,primary,error,warning,success
- type: {
- type: String,
- default: () => props$1x.button.type
- },
- // 按钮尺寸,large,normal,small,mini
- size: {
- type: String,
- default: () => props$1x.button.size
- },
- // 按钮形状,circle(两边为半圆),square(带圆角)
- shape: {
- type: String,
- default: () => props$1x.button.shape
- },
- // 按钮是否镂空
- plain: {
- type: Boolean,
- default: () => props$1x.button.plain
- },
- // 是否禁止状态
- disabled: {
- type: Boolean,
- default: () => props$1x.button.disabled
- },
- // 是否加载中
- loading: {
- type: Boolean,
- default: () => props$1x.button.loading
- },
- // 加载中提示文字
- loadingText: {
- type: [String, Number],
- default: () => props$1x.button.loadingText
- },
- // 加载状态图标类型
- loadingMode: {
- type: String,
- default: () => props$1x.button.loadingMode
- },
- // 加载图标大小
- loadingSize: {
- type: [String, Number],
- default: () => props$1x.button.loadingSize
- },
- // 开放能力,具体请看uniapp稳定关于button组件部分说明
- // https://uniapp.dcloud.io/component/button
- openType: {
- type: String,
- default: () => props$1x.button.openType
- },
- // 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
- // 取值为submit(提交表单),reset(重置表单)
- formType: {
- type: String,
- default: () => props$1x.button.formType
- },
- // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
- // 只微信小程序、QQ小程序有效
- appParameter: {
- type: String,
- default: () => props$1x.button.appParameter
- },
- // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
- hoverStopPropagation: {
- type: Boolean,
- default: () => props$1x.button.hoverStopPropagation
- },
- // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效
- lang: {
- type: String,
- default: () => props$1x.button.lang
- },
- // 会话来源,open-type="contact"时有效。只微信小程序有效
- sessionFrom: {
- type: String,
- default: () => props$1x.button.sessionFrom
- },
- // 会话内消息卡片标题,open-type="contact"时有效
- // 默认当前标题,只微信小程序有效
- sendMessageTitle: {
- type: String,
- default: () => props$1x.button.sendMessageTitle
- },
- // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效
- // 默认当前分享路径,只微信小程序有效
- sendMessagePath: {
- type: String,
- default: () => props$1x.button.sendMessagePath
- },
- // 会话内消息卡片图片,open-type="contact"时有效
- // 默认当前页面截图,只微信小程序有效
- sendMessageImg: {
- type: String,
- default: () => props$1x.button.sendMessageImg
- },
- // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
- // 用户点击后可以快速发送小程序消息,open-type="contact"时有效
- showMessageCard: {
- type: Boolean,
- default: () => props$1x.button.showMessageCard
- },
- // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
- dataName: {
- type: String,
- default: () => props$1x.button.dataName
- },
- // 节流,一定时间内只能触发一次
- throttleTime: {
- type: [String, Number],
- default: () => props$1x.button.throttleTime
- },
- // 按住后多久出现点击态,单位毫秒
- hoverStartTime: {
- type: [String, Number],
- default: () => props$1x.button.hoverStartTime
- },
- // 手指松开后点击态保留时间,单位毫秒
- hoverStayTime: {
- type: [String, Number],
- default: () => props$1x.button.hoverStayTime
- },
- // 按钮文字,之所以通过props传入,是因为slot传入的话
- // nvue中无法控制文字的样式
- text: {
- type: [String, Number],
- default: () => props$1x.button.text
- },
- // 按钮图标
- icon: {
- type: String,
- default: () => props$1x.button.icon
- },
- // 按钮图标
- iconColor: {
- type: String,
- default: () => props$1x.button.icon
- },
- // 按钮颜色,支持传入linear-gradient渐变色
- color: {
- type: String,
- default: () => props$1x.button.color
- },
- // 停止冒泡
- stop: {
- type: Boolean,
- default: () => props$1x.button.stop
- }
- }
- });
- let flag;
- function throttle(func2, wait2 = 500, immediate = true) {
- if (immediate) {
- if (!flag) {
- flag = true;
- typeof func2 === "function" && func2();
- setTimeout(() => {
- flag = false;
- }, wait2);
- }
- } else if (!flag) {
- flag = true;
- setTimeout(() => {
- flag = false;
- typeof func2 === "function" && func2();
- }, wait2);
- }
- }
- const _sfc_main$1X = {
- name: "u-button",
- mixins: [mpMixin, mixin, props$1h],
- data() {
- return {};
- },
- computed: {
- // 生成bem风格的类名
- bemClass() {
- if (!this.color) {
- return this.bem(
- "button",
- ["type", "shape", "size"],
- ["disabled", "plain", "hairline"]
- );
- } else {
- return this.bem(
- "button",
- ["shape", "size"],
- ["disabled", "plain", "hairline"]
- );
- }
- },
- loadingColor() {
- if (this.plain) {
- return this.color ? this.color : color$3[`u-${this.type}`];
- }
- if (this.type === "info") {
- return "#c9c9c9";
- }
- return "rgb(200, 200, 200)";
- },
- iconColorCom() {
- if (this.iconColor)
- return this.iconColor;
- if (this.plain) {
- return this.color ? this.color : this.type;
- } else {
- return this.type === "info" ? "#000000" : "#ffffff";
- }
- },
- baseColor() {
- let style = {};
- if (this.color) {
- style.color = this.plain ? this.color : "white";
- if (!this.plain) {
- style["background-color"] = this.color;
- }
- if (this.color.indexOf("gradient") !== -1) {
- style.borderTopWidth = 0;
- style.borderRightWidth = 0;
- style.borderBottomWidth = 0;
- style.borderLeftWidth = 0;
- if (!this.plain) {
- style.backgroundImage = this.color;
- }
- } else {
- style.borderColor = this.color;
- style.borderWidth = "1px";
- style.borderStyle = "solid";
- }
- }
- return style;
- },
- // nvue版本按钮的字体不会继承父组件的颜色,需要对每一个text组件进行单独的设置
- nvueTextStyle() {
- let style = {};
- if (this.type === "info") {
- style.color = "#323233";
- }
- if (this.color) {
- style.color = this.plain ? this.color : "white";
- }
- style.fontSize = this.textSize + "px";
- return style;
- },
- // 字体大小
- textSize() {
- let fontSize = 14, { size } = this;
- if (size === "large")
- fontSize = 16;
- if (size === "normal")
- fontSize = 14;
- if (size === "small")
- fontSize = 12;
- if (size === "mini")
- fontSize = 10;
- return fontSize;
- }
- },
- emits: [
- "click",
- "getphonenumber",
- "getuserinfo",
- "error",
- "opensetting",
- "launchapp",
- "agreeprivacyauthorization"
- ],
- methods: {
- addStyle,
- clickHandler(e2) {
- if (!this.disabled && !this.loading) {
- throttle(() => {
- this.$emit("click", e2);
- }, this.throttleTime);
- }
- this.stop && this.preventEvent(e2);
- },
- // 下面为对接uniapp官方按钮开放能力事件回调的对接
- getphonenumber(res) {
- this.$emit("getphonenumber", res);
- },
- getuserinfo(res) {
- this.$emit("getuserinfo", res);
- },
- error(res) {
- this.$emit("error", res);
- },
- opensetting(res) {
- this.$emit("opensetting", res);
- },
- launchapp(res) {
- this.$emit("launchapp", res);
- },
- agreeprivacyauthorization(res) {
- this.$emit("agreeprivacyauthorization", res);
- }
- }
- };
- function _sfc_render$1W(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_loading_icon = resolveEasycom(vue.resolveDynamicComponent("u-loading-icon"), __easycom_0$e);
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock("button", {
- "hover-start-time": Number(_ctx.hoverStartTime),
- "hover-stay-time": Number(_ctx.hoverStayTime),
- "form-type": _ctx.formType,
- "open-type": _ctx.openType,
- "app-parameter": _ctx.appParameter,
- "hover-stop-propagation": _ctx.hoverStopPropagation,
- "send-message-title": _ctx.sendMessageTitle,
- "send-message-path": _ctx.sendMessagePath,
- lang: _ctx.lang,
- "data-name": _ctx.dataName,
- "session-from": _ctx.sessionFrom,
- "send-message-img": _ctx.sendMessageImg,
- "show-message-card": _ctx.showMessageCard,
- onGetphonenumber: _cache[0] || (_cache[0] = (...args) => $options.getphonenumber && $options.getphonenumber(...args)),
- onGetuserinfo: _cache[1] || (_cache[1] = (...args) => $options.getuserinfo && $options.getuserinfo(...args)),
- onError: _cache[2] || (_cache[2] = (...args) => $options.error && $options.error(...args)),
- onOpensetting: _cache[3] || (_cache[3] = (...args) => $options.opensetting && $options.opensetting(...args)),
- onLaunchapp: _cache[4] || (_cache[4] = (...args) => $options.launchapp && $options.launchapp(...args)),
- onAgreeprivacyauthorization: _cache[5] || (_cache[5] = (...args) => $options.agreeprivacyauthorization && $options.agreeprivacyauthorization(...args)),
- "hover-class": !_ctx.disabled && !_ctx.loading ? "u-button--active" : "",
- class: vue.normalizeClass(["u-button u-reset-button", $options.bemClass]),
- style: vue.normalizeStyle([$options.baseColor, $options.addStyle(_ctx.customStyle)]),
- onClick: _cache[6] || (_cache[6] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- }, [
- _ctx.loading ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createVNode(_component_u_loading_icon, {
- mode: _ctx.loadingMode,
- size: _ctx.loadingSize * 1.15,
- color: $options.loadingColor
- }, null, 8, ["mode", "size", "color"]),
- vue.createElementVNode(
- "text",
- {
- class: "u-button__loading-text",
- style: vue.normalizeStyle([{ fontSize: $options.textSize + "px" }])
- },
- vue.toDisplayString(_ctx.loadingText || _ctx.text),
- 5
- /* TEXT, STYLE */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: _ctx.icon,
- color: $options.iconColorCom,
- size: $options.textSize * 1.35,
- customStyle: { marginRight: "2px" }
- }, null, 8, ["name", "color", "size"])) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode(
- "text",
- {
- class: "u-button__text",
- style: vue.normalizeStyle([{ fontSize: $options.textSize + "px" }])
- },
- vue.toDisplayString(_ctx.text),
- 5
- /* TEXT, STYLE */
- )
- ], true)
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ], 46, ["hover-start-time", "hover-stay-time", "form-type", "open-type", "app-parameter", "hover-stop-propagation", "send-message-title", "send-message-path", "lang", "data-name", "session-from", "send-message-img", "show-message-card", "hover-class"]);
- }
- const __easycom_0$8 = /* @__PURE__ */ _export_sfc(_sfc_main$1X, [["render", _sfc_render$1W], ["__scopeId", "data-v-5ce41ee6"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-button/u-button.vue"]]);
- const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$8
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1W = {
- name: "u-calendar-header",
- mixins: [mpMixin, mixin],
- props: {
- // 标题
- title: {
- type: String,
- default: ""
- },
- // 副标题
- subtitle: {
- type: String,
- default: ""
- },
- // 是否显示标题
- showTitle: {
- type: Boolean,
- default: true
- },
- // 是否显示副标题
- showSubtitle: {
- type: Boolean,
- default: true
- },
- // 星期文本
- weekText: {
- type: Array,
- default: () => {
- return [];
- }
- }
- },
- data() {
- return {};
- },
- methods: {
- name() {
- }
- }
- };
- function _sfc_render$1V(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-calendar-header u-border-bottom" }, [
- $props.showTitle ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-calendar-header__title"
- },
- vue.toDisplayString($props.title),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $props.showSubtitle ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "u-calendar-header__subtitle"
- },
- vue.toDisplayString($props.subtitle),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "u-calendar-header__weekdays" }, [
- vue.createElementVNode(
- "text",
- { class: "u-calendar-header__weekdays__weekday" },
- vue.toDisplayString($props.weekText[0]),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "u-calendar-header__weekdays__weekday" },
- vue.toDisplayString($props.weekText[1]),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "u-calendar-header__weekdays__weekday" },
- vue.toDisplayString($props.weekText[2]),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "u-calendar-header__weekdays__weekday" },
- vue.toDisplayString($props.weekText[3]),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "u-calendar-header__weekdays__weekday" },
- vue.toDisplayString($props.weekText[4]),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "u-calendar-header__weekdays__weekday" },
- vue.toDisplayString($props.weekText[5]),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "u-calendar-header__weekdays__weekday" },
- vue.toDisplayString($props.weekText[6]),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const uHeader = /* @__PURE__ */ _export_sfc(_sfc_main$1W, [["render", _sfc_render$1V], ["__scopeId", "data-v-7f0f7602"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-calendar/header.vue"]]);
- var e$1 = function() {
- var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", s2 = "second", i2 = "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]) + "]";
- } }, g2 = function(t3, e3, n3) {
- var r3 = String(t3);
- return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3;
- }, v2 = { s: g2, z: function(t3) {
- var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), s3 = n3 % 60;
- return (e3 <= 0 ? "+" : "-") + g2(r3, 2, "0") + ":" + g2(s3, 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()), s3 = e3.clone().add(r3, c2), i3 = n3 - s3 < 0, u3 = e3.clone().add(r3 + (i3 ? -1 : 1), c2);
- return +(-(r3 + (n3 - s3) / (i3 ? s3 - u3 : u3 - s3)) || 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: i2, s: s2, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
- }, u: function(t3) {
- return void 0 === t3;
- } }, m2 = "en", D2 = {};
- D2[m2] = M2;
- var p2 = "$isDayjsObject", S2 = function(t3) {
- return t3 instanceof _2 || !(!t3 || !t3[p2]);
- }, w2 = function t3(e3, n3, r3) {
- var s3;
- if (!e3)
- return m2;
- if ("string" == typeof e3) {
- var i3 = e3.toLowerCase();
- D2[i3] && (s3 = i3), n3 && (D2[i3] = n3, s3 = i3);
- var u3 = e3.split("-");
- if (!s3 && u3.length > 1)
- return t3(u3[0]);
- } else {
- var a3 = e3.name;
- D2[a3] = e3, s3 = a3;
- }
- return !r3 && s3 && (m2 = s3), s3 || !r3 && m2;
- }, b2 = 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);
- }, O2 = v2;
- O2.l = w2, O2.i = S2, O2.w = function(t3, e3) {
- return b2(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 g3 = M3.prototype;
- return g3.parse = function(t3) {
- this.$d = function(t4) {
- var e3 = t4.date, n3 = t4.utc;
- if (null === e3)
- return /* @__PURE__ */ new Date(NaN);
- if (O2.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 s3 = r3[2] - 1 || 0, i3 = (r3[7] || "0").substring(0, 3);
- return n3 ? new Date(Date.UTC(r3[1], s3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, i3)) : new Date(r3[1], s3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, i3);
- }
- }
- return new Date(e3);
- }(t3), this.init();
- }, g3.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();
- }, g3.$utils = function() {
- return O2;
- }, g3.isValid = function() {
- return !(this.$d.toString() === l2);
- }, g3.isSame = function(t3, e3) {
- var n3 = b2(t3);
- return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
- }, g3.isAfter = function(t3, e3) {
- return b2(t3) < this.startOf(e3);
- }, g3.isBefore = function(t3, e3) {
- return this.endOf(e3) < b2(t3);
- }, g3.$g = function(t3, e3, n3) {
- return O2.u(t3) ? this[e3] : this.set(n3, t3);
- }, g3.unix = function() {
- return Math.floor(this.valueOf() / 1e3);
- }, g3.valueOf = function() {
- return this.$d.getTime();
- }, g3.startOf = function(t3, e3) {
- var n3 = this, r3 = !!O2.u(e3) || e3, f3 = O2.p(t3), l3 = function(t4, e4) {
- var s3 = O2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
- return r3 ? s3 : s3.endOf(a2);
- }, $3 = function(t4, e4) {
- return O2.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, g4 = 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 m3 = this.$locale().weekStart || 0, D3 = (y3 < m3 ? y3 + 7 : y3) - m3;
- return l3(r3 ? g4 - D3 : g4 + (6 - D3), M4);
- case a2:
- case d2:
- return $3(v3 + "Hours", 0);
- case u2:
- return $3(v3 + "Minutes", 1);
- case i2:
- return $3(v3 + "Seconds", 2);
- case s2:
- return $3(v3 + "Milliseconds", 3);
- default:
- return this.clone();
- }
- }, g3.endOf = function(t3) {
- return this.startOf(t3, false);
- }, g3.$set = function(t3, e3) {
- var n3, o3 = O2.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[i2] = f3 + "Minutes", n3[s2] = 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;
- }, g3.set = function(t3, e3) {
- return this.clone().$set(t3, e3);
- }, g3.get = function(t3) {
- return this[O2.p(t3)]();
- }, g3.add = function(r3, f3) {
- var d3, l3 = this;
- r3 = Number(r3);
- var $3 = O2.p(f3), y3 = function(t3) {
- var e3 = b2(l3);
- return O2.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[i2] = e2, d3[u2] = n2, d3[s2] = t2, d3)[$3] || 1, g4 = this.$d.getTime() + r3 * M4;
- return O2.w(g4, this);
- }, g3.subtract = function(t3, e3) {
- return this.add(-1 * t3, e3);
- }, g3.format = function(t3) {
- var e3 = this, n3 = this.$locale();
- if (!this.isValid())
- return n3.invalidDate || l2;
- var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", s3 = O2.z(this), i3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, s4, i4) {
- return t4 && (t4[n4] || t4(e3, r3)) || s4[n4].slice(0, i4);
- }, d3 = function(t4) {
- return O2.s(i3 % 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 O2.s(e3.$y, 4, "0");
- case "M":
- return a3 + 1;
- case "MM":
- return O2.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 O2.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(i3);
- case "HH":
- return O2.s(i3, 2, "0");
- case "h":
- return d3(1);
- case "hh":
- return d3(2);
- case "a":
- return $3(i3, u3, true);
- case "A":
- return $3(i3, u3, false);
- case "m":
- return String(u3);
- case "mm":
- return O2.s(u3, 2, "0");
- case "s":
- return String(e3.$s);
- case "ss":
- return O2.s(e3.$s, 2, "0");
- case "SSS":
- return O2.s(e3.$ms, 3, "0");
- case "Z":
- return s3;
- }
- return null;
- }(t4) || s3.replace(":", "");
- });
- }, g3.utcOffset = function() {
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
- }, g3.diff = function(r3, d3, l3) {
- var $3, y3 = this, M4 = O2.p(d3), g4 = b2(r3), v3 = (g4.utcOffset() - this.utcOffset()) * e2, m3 = this - g4, D3 = function() {
- return O2.m(y3, g4);
- };
- switch (M4) {
- case h2:
- $3 = D3() / 12;
- break;
- case c2:
- $3 = D3();
- break;
- case f2:
- $3 = D3() / 3;
- break;
- case o2:
- $3 = (m3 - v3) / 6048e5;
- break;
- case a2:
- $3 = (m3 - v3) / 864e5;
- break;
- case u2:
- $3 = m3 / n2;
- break;
- case i2:
- $3 = m3 / e2;
- break;
- case s2:
- $3 = m3 / t2;
- break;
- default:
- $3 = m3;
- }
- return l3 ? $3 : O2.a($3);
- }, g3.daysInMonth = function() {
- return this.endOf(c2).$D;
- }, g3.$locale = function() {
- return D2[this.$L];
- }, g3.locale = function(t3, e3) {
- if (!t3)
- return this.$L;
- var n3 = this.clone(), r3 = w2(t3, e3, true);
- return r3 && (n3.$L = r3), n3;
- }, g3.clone = function() {
- return O2.w(this.$d, this);
- }, g3.toDate = function() {
- return new Date(this.valueOf());
- }, g3.toJSON = function() {
- return this.isValid() ? this.toISOString() : null;
- }, g3.toISOString = function() {
- return this.$d.toISOString();
- }, g3.toString = function() {
- return this.$d.toUTCString();
- }, M3;
- }(), k2 = _2.prototype;
- return b2.prototype = k2, [["$ms", r2], ["$s", s2], ["$m", i2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
- k2[t3[1]] = function(e3) {
- return this.$g(e3, t3[0], t3[1]);
- };
- }), b2.extend = function(t3, e3) {
- return t3.$i || (t3(e3, _2, b2), t3.$i = true), b2;
- }, b2.locale = w2, b2.isDayjs = S2, b2.unix = function(t3) {
- return b2(1e3 * t3);
- }, b2.en = D2[m2], b2.Ls = D2, b2.p = {}, b2;
- }();
- const _sfc_main$1V = {
- name: "u-calendar-month",
- mixins: [mpMixin, mixin],
- props: {
- // 是否显示月份背景色
- showMark: {
- type: Boolean,
- default: true
- },
- // 主题色,对底部按钮和选中日期有效
- color: {
- type: String,
- default: "#3c9cff"
- },
- // 月份数据
- months: {
- type: Array,
- default: () => []
- },
- // 日期选择类型
- mode: {
- type: String,
- default: "single"
- },
- // 日期行高
- rowHeight: {
- type: [String, Number],
- default: 58
- },
- // mode=multiple时,最多可选多少个日期
- maxCount: {
- type: [String, Number],
- default: Infinity
- },
- // mode=range时,第一个日期底部的提示文字
- startText: {
- type: String,
- default: "开始"
- },
- // mode=range时,最后一个日期底部的提示文字
- endText: {
- type: String,
- default: "结束"
- },
- // 默认选中的日期,mode为multiple或range是必须为数组格式
- defaultDate: {
- type: [Array, String, Date],
- default: null
- },
- // 最小的可选日期
- minDate: {
- type: [String, Number],
- default: 0
- },
- // 最大可选日期
- maxDate: {
- type: [String, Number],
- default: 0
- },
- // 如果没有设置maxDate,则往后推多少个月
- maxMonth: {
- type: [String, Number],
- default: 2
- },
- // 是否为只读状态,只读状态下禁止选择日期
- readonly: {
- type: Boolean,
- default: () => props$1x.calendar.readonly
- },
- // 日期区间最多可选天数,默认无限制,mode = range时有效
- maxRange: {
- type: [Number, String],
- default: Infinity
- },
- // 范围选择超过最多可选天数时的提示文案,mode = range时有效
- rangePrompt: {
- type: String,
- default: ""
- },
- // 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效
- showRangePrompt: {
- type: Boolean,
- default: true
- },
- // 是否允许日期范围的起止时间为同一天,mode = range时有效
- allowSameDay: {
- type: Boolean,
- default: false
- },
- forbidDays: {
- type: Array,
- default: () => []
- },
- forbidDaysToast: {
- type: String,
- default: ""
- }
- },
- data() {
- return {
- // 每个日期的宽度
- width: 0,
- // 当前选中的日期item
- item: {},
- selected: []
- };
- },
- watch: {
- selectedChange: {
- immediate: true,
- handler(n2) {
- this.setDefaultDate();
- }
- }
- },
- computed: {
- // 多个条件的变化,会引起选中日期的变化,这里统一管理监听
- selectedChange() {
- return [this.minDate, this.maxDate, this.defaultDate];
- },
- dayStyle(index1, index2, item) {
- return (index12, index22, item2) => {
- const style = {};
- let week = item2.week;
- const dayWidth = Number(parseFloat(this.width / 7).toFixed(3).slice(0, -1));
- style.height = addUnit(this.rowHeight, "px");
- if (index22 === 0) {
- week = (week === 0 ? 7 : week) - 1;
- style.marginLeft = addUnit(week * dayWidth, "px");
- }
- if (this.mode === "range") {
- style.paddingLeft = 0;
- style.paddingRight = 0;
- style.paddingBottom = 0;
- style.paddingTop = 0;
- }
- return style;
- };
- },
- daySelectStyle() {
- return (index1, index2, item) => {
- let date3 = e$1(item.date).format("YYYY-MM-DD"), style = {};
- if (this.selected.some((item2) => this.dateSame(item2, date3))) {
- style.backgroundColor = this.color;
- }
- if (this.mode === "single") {
- if (date3 === this.selected[0]) {
- style.borderTopLeftRadius = "3px";
- style.borderBottomLeftRadius = "3px";
- style.borderTopRightRadius = "3px";
- style.borderBottomRightRadius = "3px";
- }
- } else if (this.mode === "range") {
- if (this.selected.length >= 2) {
- const len = this.selected.length - 1;
- if (this.dateSame(date3, this.selected[0])) {
- style.borderTopLeftRadius = "3px";
- style.borderBottomLeftRadius = "3px";
- }
- if (this.dateSame(date3, this.selected[len])) {
- style.borderTopRightRadius = "3px";
- style.borderBottomRightRadius = "3px";
- }
- if (e$1(date3).isAfter(e$1(this.selected[0])) && e$1(date3).isBefore(e$1(this.selected[len]))) {
- style.backgroundColor = colorGradient(this.color, "#ffffff", 100)[90];
- style.opacity = 0.7;
- }
- } else if (this.selected.length === 1) {
- style.borderTopLeftRadius = "3px";
- style.borderBottomLeftRadius = "3px";
- }
- } else {
- if (this.selected.some((item2) => this.dateSame(item2, date3))) {
- style.borderTopLeftRadius = "3px";
- style.borderBottomLeftRadius = "3px";
- style.borderTopRightRadius = "3px";
- style.borderBottomRightRadius = "3px";
- }
- }
- return style;
- };
- },
- // 某个日期是否被选中
- textStyle() {
- return (item) => {
- const date3 = e$1(item.date).format("YYYY-MM-DD"), style = {};
- if (this.selected.some((item2) => this.dateSame(item2, date3))) {
- style.color = "#ffffff";
- }
- if (this.mode === "range") {
- const len = this.selected.length - 1;
- if (e$1(date3).isAfter(e$1(this.selected[0])) && e$1(date3).isBefore(e$1(this.selected[len]))) {
- style.color = this.color;
- }
- }
- return style;
- };
- },
- // 获取底部的提示文字
- getBottomInfo() {
- return (index1, index2, item) => {
- const date3 = e$1(item.date).format("YYYY-MM-DD");
- const bottomInfo = item.bottomInfo;
- if (this.mode === "range" && this.selected.length > 0) {
- if (this.selected.length === 1) {
- if (this.dateSame(date3, this.selected[0]))
- return this.startText;
- else
- return bottomInfo;
- } else {
- const len = this.selected.length - 1;
- if (this.dateSame(date3, this.selected[0]) && this.dateSame(date3, this.selected[1]) && len === 1) {
- return `${this.startText}/${this.endText}`;
- } else if (this.dateSame(date3, this.selected[0])) {
- return this.startText;
- } else if (this.dateSame(date3, this.selected[len])) {
- return this.endText;
- } else {
- return bottomInfo;
- }
- }
- } else {
- return bottomInfo;
- }
- };
- }
- },
- mounted() {
- this.init();
- },
- emits: ["monthSelected", "updateMonthTop"],
- methods: {
- init() {
- this.$emit("monthSelected", this.selected);
- this.$nextTick(() => {
- sleep(10).then(() => {
- this.getWrapperWidth();
- this.getMonthRect();
- });
- });
- },
- monthTitle(item) {
- if (uni.getLocale() == "zh-Hans" || uni.getLocale() == "zh-Hant") {
- return item.year + "年" + (item.month < 10 ? "0" + item.month : item.month) + "月";
- } else {
- return (item.month < 10 ? "0" + item.month : item.month) + "/" + item.year;
- }
- },
- isForbid(item) {
- let date3 = e$1(item.date).format("YYYY-MM-DD");
- if (this.mode !== "range" && this.forbidDays.includes(date3)) {
- return true;
- }
- return false;
- },
- // 判断两个日期是否相等
- dateSame(date1, date22) {
- return e$1(date1).isSame(e$1(date22));
- },
- // 获取月份数据区域的宽度,因为nvue不支持百分比,所以无法通过css设置每个日期item的宽度
- getWrapperWidth() {
- this.$uGetRect(".u-calendar-month-wrapper").then((size) => {
- this.width = size.width;
- });
- },
- getMonthRect() {
- const promiseAllArr = this.months.map((item, index2) => this.getMonthRectByPromise(
- `u-calendar-month-${index2}`
- ));
- Promise.all(promiseAllArr).then(
- (sizes) => {
- let height = 1;
- const topArr = [];
- for (let i2 = 0; i2 < this.months.length; i2++) {
- topArr[i2] = height;
- height += sizes[i2].height;
- }
- this.$emit("updateMonthTop", topArr);
- }
- );
- },
- // 获取每个月份区域的尺寸
- getMonthRectByPromise(el) {
- return new Promise((resolve) => {
- this.$uGetRect(`.${el}`).then((size) => {
- resolve(size);
- });
- });
- },
- // 点击某一个日期
- clickHandler(index1, index2, item) {
- if (this.readonly) {
- return;
- }
- this.item = item;
- const date3 = e$1(item.date).format("YYYY-MM-DD");
- if (item.disabled)
- return;
- if (this.isForbid(item)) {
- uni.showToast({
- title: this.forbidDaysToast
- });
- return;
- }
- let selected = deepClone(this.selected);
- if (this.mode === "single") {
- selected = [date3];
- } else if (this.mode === "multiple") {
- if (selected.some((item2) => this.dateSame(item2, date3))) {
- const itemIndex = selected.findIndex((item2) => item2 === date3);
- selected.splice(itemIndex, 1);
- } else {
- if (selected.length < this.maxCount)
- selected.push(date3);
- }
- } else {
- if (selected.length === 0 || selected.length >= 2) {
- selected = [date3];
- } else if (selected.length === 1) {
- const existsDate = selected[0];
- if (e$1(date3).isBefore(existsDate)) {
- selected = [date3];
- } else if (e$1(date3).isAfter(existsDate)) {
- if (e$1(e$1(date3).subtract(this.maxRange, "day")).isAfter(e$1(selected[0])) && this.showRangePrompt) {
- if (this.rangePrompt) {
- toast(this.rangePrompt);
- } else {
- toast(t$1("up.calendar.daysExceed", { days: this.maxRange }));
- }
- return;
- }
- selected.push(date3);
- const startDate = selected[0];
- const endDate = selected[1];
- const arr = [];
- let i2 = 0;
- do {
- arr.push(e$1(startDate).add(i2, "day").format("YYYY-MM-DD"));
- i2++;
- } while (e$1(startDate).add(i2, "day").isBefore(e$1(endDate)));
- arr.push(endDate);
- selected = arr;
- } else {
- if (selected[0] === date3 && !this.allowSameDay)
- return;
- selected.push(date3);
- }
- }
- }
- this.setSelected(selected);
- },
- // 设置默认日期
- setDefaultDate() {
- if (!this.defaultDate) {
- const selected = [e$1().format("YYYY-MM-DD")];
- return this.setSelected(selected, false);
- }
- let defaultDate = [];
- const minDate = this.minDate || e$1().format("YYYY-MM-DD");
- const maxDate = this.maxDate || e$1(minDate).add(this.maxMonth - 1, "month").format("YYYY-MM-DD");
- if (this.mode === "single") {
- if (!test.array(this.defaultDate)) {
- defaultDate = [e$1(this.defaultDate).format("YYYY-MM-DD")];
- } else {
- defaultDate = [this.defaultDate[0]];
- }
- } else {
- if (!test.array(this.defaultDate))
- return;
- defaultDate = this.defaultDate;
- }
- defaultDate = defaultDate.filter((item) => {
- return e$1(item).isAfter(e$1(minDate).subtract(1, "day")) && e$1(item).isBefore(e$1(
- maxDate
- ).add(1, "day"));
- });
- this.setSelected(defaultDate, false);
- },
- setSelected(selected, event = true) {
- this.selected = selected;
- event && this.$emit("monthSelected", this.selected, "tap");
- }
- }
- };
- function _sfc_render$1U(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-calendar-month-wrapper",
- ref: "u-calendar-month-wrapper"
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.months, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: vue.normalizeClass([`u-calendar-month-${index2}`]),
- ref_for: true,
- ref: `u-calendar-month-${index2}`,
- id: `month-${index2}`
- }, [
- index2 !== 0 ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-calendar-month__title"
- },
- vue.toDisplayString($options.monthTitle(item)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "u-calendar-month__days" }, [
- $props.showMark ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-calendar-month__days__month-mark-wrapper"
- }, [
- vue.createElementVNode(
- "text",
- { class: "u-calendar-month__days__month-mark-wrapper__text" },
- vue.toDisplayString(item.month),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(item.date, (item1, index1) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["u-calendar-month__days__day", [item1.selected && "u-calendar-month__days__day__select--selected"]]),
- key: index1,
- style: vue.normalizeStyle([$options.dayStyle(index2, index1, item1)]),
- onClick: ($event) => $options.clickHandler(index2, index1, item1)
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "u-calendar-month__days__day__select",
- style: vue.normalizeStyle([$options.daySelectStyle(index2, index1, item1)])
- },
- [
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["u-calendar-month__days__day__select__info", [item1.disabled || $options.isForbid(item1) ? "u-calendar-month__days__day__select__info--disabled" : ""]]),
- style: vue.normalizeStyle([$options.textStyle(item1)])
- },
- vue.toDisplayString(item1.day),
- 7
- /* TEXT, CLASS, STYLE */
- ),
- $options.getBottomInfo(index2, index1, item1) ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["u-calendar-month__days__day__select__buttom-info", [item1.disabled || $options.isForbid(item1) ? "u-calendar-month__days__day__select__buttom-info--disabled" : ""]]),
- style: vue.normalizeStyle([$options.textStyle(item1)])
- },
- vue.toDisplayString($options.getBottomInfo(index2, index1, item1)),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- item1.dot ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- class: "u-calendar-month__days__day__select__dot"
- })) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ], 14, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ], 10, ["id"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 512
- /* NEED_PATCH */
- );
- }
- const uMonth = /* @__PURE__ */ _export_sfc(_sfc_main$1V, [["render", _sfc_render$1U], ["__scopeId", "data-v-3c847935"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-calendar/month.vue"]]);
- const props$1g = defineMixin({
- props: {
- // 日历顶部标题
- title: {
- type: String,
- default: () => props$1x.calendar.title
- },
- // 是否显示标题
- showTitle: {
- type: Boolean,
- default: () => props$1x.calendar.showTitle
- },
- // 是否显示副标题
- showSubtitle: {
- type: Boolean,
- default: () => props$1x.calendar.showSubtitle
- },
- // 日期类型选择,single-选择单个日期,multiple-可以选择多个日期,range-选择日期范围
- mode: {
- type: String,
- default: () => props$1x.calendar.mode
- },
- // mode=range时,第一个日期底部的提示文字
- startText: {
- type: String,
- default: () => props$1x.calendar.startText
- },
- // mode=range时,最后一个日期底部的提示文字
- endText: {
- type: String,
- default: () => props$1x.calendar.endText
- },
- // 自定义列表
- customList: {
- type: Array,
- default: () => props$1x.calendar.customList
- },
- // 主题色,对底部按钮和选中日期有效
- color: {
- type: String,
- default: () => props$1x.calendar.color
- },
- // 最小的可选日期
- minDate: {
- type: [String, Number],
- default: () => props$1x.calendar.minDate
- },
- // 最大可选日期
- maxDate: {
- type: [String, Number],
- default: () => props$1x.calendar.maxDate
- },
- // 默认选中的日期,mode为multiple或range是必须为数组格式
- defaultDate: {
- type: [Array, String, Date, null],
- default: () => props$1x.calendar.defaultDate
- },
- // mode=multiple时,最多可选多少个日期
- maxCount: {
- type: [String, Number],
- default: () => props$1x.calendar.maxCount
- },
- // 日期行高
- rowHeight: {
- type: [String, Number],
- default: () => props$1x.calendar.rowHeight
- },
- // 日期格式化函数
- formatter: {
- type: [Function, null],
- default: () => props$1x.calendar.formatter
- },
- // 是否显示农历
- showLunar: {
- type: Boolean,
- default: () => props$1x.calendar.showLunar
- },
- // 是否显示月份背景色
- showMark: {
- type: Boolean,
- default: () => props$1x.calendar.showMark
- },
- // 确定按钮的文字
- confirmText: {
- type: String,
- default: () => props$1x.calendar.confirmText
- },
- // 确认按钮处于禁用状态时的文字
- confirmDisabledText: {
- type: String,
- default: () => props$1x.calendar.confirmDisabledText
- },
- // 是否显示日历弹窗
- show: {
- type: Boolean,
- default: () => props$1x.calendar.show
- },
- // 是否允许点击遮罩关闭日历
- closeOnClickOverlay: {
- type: Boolean,
- default: () => props$1x.calendar.closeOnClickOverlay
- },
- // 是否为只读状态,只读状态下禁止选择日期
- readonly: {
- type: Boolean,
- default: () => props$1x.calendar.readonly
- },
- // 是否展示确认按钮
- showConfirm: {
- type: Boolean,
- default: () => props$1x.calendar.showConfirm
- },
- // 日期区间最多可选天数,默认无限制,mode = range时有效
- maxRange: {
- type: [Number, String],
- default: () => props$1x.calendar.maxRange
- },
- // 范围选择超过最多可选天数时的提示文案,mode = range时有效
- rangePrompt: {
- type: String,
- default: () => props$1x.calendar.rangePrompt
- },
- // 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效
- showRangePrompt: {
- type: Boolean,
- default: () => props$1x.calendar.showRangePrompt
- },
- // 是否允许日期范围的起止时间为同一天,mode = range时有效
- allowSameDay: {
- type: Boolean,
- default: () => props$1x.calendar.allowSameDay
- },
- // 圆角值
- round: {
- type: [Boolean, String, Number],
- default: () => props$1x.calendar.round
- },
- // 最多展示月份数量
- monthNum: {
- type: [Number, String],
- default: 3
- },
- // 星期文案
- weekText: {
- type: Array,
- default: props$1x.calendar.weekText
- },
- forbidDays: {
- type: Array,
- default: props$1x.calendar.forbidDays
- },
- forbidDaysToast: {
- type: String,
- default: props$1x.calendar.forbidDaysToast
- },
- monthFormat: {
- type: String,
- default: props$1x.calendar.monthFormat
- },
- // 是否页面内展示
- pageInline: {
- type: Boolean,
- default: props$1x.calendar.pageInline
- }
- }
- });
- var Calendar = {
- /**
- * 农历1900-2100的润大小信息表
- * @Array Of Property
- * @return Hex
- */
- lunarInfo: [
- 19416,
- 19168,
- 42352,
- 21717,
- 53856,
- 55632,
- 91476,
- 22176,
- 39632,
- 21970,
- // 1900-1909
- 19168,
- 42422,
- 42192,
- 53840,
- 119381,
- 46400,
- 54944,
- 44450,
- 38320,
- 84343,
- // 1910-1919
- 18800,
- 42160,
- 46261,
- 27216,
- 27968,
- 109396,
- 11104,
- 38256,
- 21234,
- 18800,
- // 1920-1929
- 25958,
- 54432,
- 59984,
- 28309,
- 23248,
- 11104,
- 100067,
- 37600,
- 116951,
- 51536,
- // 1930-1939
- 54432,
- 120998,
- 46416,
- 22176,
- 107956,
- 9680,
- 37584,
- 53938,
- 43344,
- 46423,
- // 1940-1949
- 27808,
- 46416,
- 86869,
- 19872,
- 42416,
- 83315,
- 21168,
- 43432,
- 59728,
- 27296,
- // 1950-1959
- 44710,
- 43856,
- 19296,
- 43748,
- 42352,
- 21088,
- 62051,
- 55632,
- 23383,
- 22176,
- // 1960-1969
- 38608,
- 19925,
- 19152,
- 42192,
- 54484,
- 53840,
- 54616,
- 46400,
- 46752,
- 103846,
- // 1970-1979
- 38320,
- 18864,
- 43380,
- 42160,
- 45690,
- 27216,
- 27968,
- 44870,
- 43872,
- 38256,
- // 1980-1989
- 19189,
- 18800,
- 25776,
- 29859,
- 59984,
- 27480,
- 23232,
- 43872,
- 38613,
- 37600,
- // 1990-1999
- 51552,
- 55636,
- 54432,
- 55888,
- 30034,
- 22176,
- 43959,
- 9680,
- 37584,
- 51893,
- // 2000-2009
- 43344,
- 46240,
- 47780,
- 44368,
- 21977,
- 19360,
- 42416,
- 86390,
- 21168,
- 43312,
- // 2010-2019
- 31060,
- 27296,
- 44368,
- 23378,
- 19296,
- 42726,
- 42208,
- 53856,
- 60005,
- 54576,
- // 2020-2029
- 23200,
- 30371,
- 38608,
- 19195,
- 19152,
- 42192,
- 118966,
- 53840,
- 54560,
- 56645,
- // 2030-2039
- 46496,
- 22224,
- 21938,
- 18864,
- 42359,
- 42160,
- 43600,
- 111189,
- 27936,
- 44448,
- // 2040-2049
- /** Add By JJonline@JJonline.Cn**/
- 84835,
- 37744,
- 18936,
- 18800,
- 25776,
- 92326,
- 59984,
- 27424,
- 108228,
- 43744,
- // 2050-2059
- 41696,
- 53987,
- 51552,
- 54615,
- 54432,
- 55888,
- 23893,
- 22176,
- 42704,
- 21972,
- // 2060-2069
- 21200,
- 43448,
- 43344,
- 46240,
- 46758,
- 44368,
- 21920,
- 43940,
- 42416,
- 21168,
- // 2070-2079
- 45683,
- 26928,
- 29495,
- 27296,
- 44368,
- 84821,
- 19296,
- 42352,
- 21732,
- 53600,
- // 2080-2089
- 59752,
- 54560,
- 55968,
- 92838,
- 22224,
- 19168,
- 43476,
- 41680,
- 53584,
- 62034,
- // 2090-2099
- 54560
- ],
- // 2100
- /**
- * 公历每个月份的天数普通表
- * @Array Of Property
- * @return Number
- */
- solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
- /**
- * 天干地支之天干速查表
- * @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
- * @return Cn string
- */
- Gan: ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"],
- /**
- * 天干地支之地支速查表
- * @Array Of Property
- * @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
- * @return Cn string
- */
- Zhi: ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"],
- /**
- * 天干地支之地支速查表<=>生肖
- * @Array Of Property
- * @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
- * @return Cn string
- */
- Animals: ["鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"],
- /**
- * 24节气速查表
- * @Array Of Property
- * @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
- * @return Cn string
- */
- solarTerm: ["小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至"],
- /**
- * 1900-2100各年的24节气日期速查表
- * @Array Of Property
- * @return 0x string For splice
- */
- sTermInfo: [
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf97c3598082c95f8c965cc920f",
- "97bd0b06bdb0722c965ce1cfcc920f",
- "b027097bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf97c359801ec95f8c965cc920f",
- "97bd0b06bdb0722c965ce1cfcc920f",
- "b027097bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf97c359801ec95f8c965cc920f",
- "97bd0b06bdb0722c965ce1cfcc920f",
- "b027097bd097c36b0b6fc9274c91aa",
- "9778397bd19801ec9210c965cc920e",
- "97b6b97bd19801ec95f8c965cc920f",
- "97bd09801d98082c95f8e1cfcc920f",
- "97bd097bd097c36b0b6fc9210c8dc2",
- "9778397bd197c36c9210c9274c91aa",
- "97b6b97bd19801ec95f8c965cc920e",
- "97bd09801d98082c95f8e1cfcc920f",
- "97bd097bd097c36b0b6fc9210c8dc2",
- "9778397bd097c36c9210c9274c91aa",
- "97b6b97bd19801ec95f8c965cc920e",
- "97bcf97c3598082c95f8e1cfcc920f",
- "97bd097bd097c36b0b6fc9210c8dc2",
- "9778397bd097c36c9210c9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf97c3598082c95f8c965cc920f",
- "97bd097bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf97c3598082c95f8c965cc920f",
- "97bd097bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf97c359801ec95f8c965cc920f",
- "97bd097bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf97c359801ec95f8c965cc920f",
- "97bd097bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf97c359801ec95f8c965cc920f",
- "97bd097bd07f595b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9210c8dc2",
- "9778397bd19801ec9210c9274c920e",
- "97b6b97bd19801ec95f8c965cc920f",
- "97bd07f5307f595b0b0bc920fb0722",
- "7f0e397bd097c36b0b6fc9210c8dc2",
- "9778397bd097c36c9210c9274c920e",
- "97b6b97bd19801ec95f8c965cc920f",
- "97bd07f5307f595b0b0bc920fb0722",
- "7f0e397bd097c36b0b6fc9210c8dc2",
- "9778397bd097c36c9210c9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bd07f1487f595b0b0bc920fb0722",
- "7f0e397bd097c36b0b6fc9210c8dc2",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf7f1487f595b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf7f1487f595b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf7f1487f531b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c965cc920e",
- "97bcf7f1487f531b0b0bb0b6fb0722",
- "7f0e397bd07f595b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b97bd19801ec9210c9274c920e",
- "97bcf7f0e47f531b0b0bb0b6fb0722",
- "7f0e397bd07f595b0b0bc920fb0722",
- "9778397bd097c36b0b6fc9210c91aa",
- "97b6b97bd197c36c9210c9274c920e",
- "97bcf7f0e47f531b0b0bb0b6fb0722",
- "7f0e397bd07f595b0b0bc920fb0722",
- "9778397bd097c36b0b6fc9210c8dc2",
- "9778397bd097c36c9210c9274c920e",
- "97b6b7f0e47f531b0723b0b6fb0722",
- "7f0e37f5307f595b0b0bc920fb0722",
- "7f0e397bd097c36b0b6fc9210c8dc2",
- "9778397bd097c36b0b70c9274c91aa",
- "97b6b7f0e47f531b0723b0b6fb0721",
- "7f0e37f1487f595b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc9210c8dc2",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f595b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e397bd07f595b0b0bc920fb0722",
- "9778397bd097c36b0b6fc9274c91aa",
- "97b6b7f0e47f531b0723b0787b0721",
- "7f0e27f0e47f531b0b0bb0b6fb0722",
- "7f0e397bd07f595b0b0bc920fb0722",
- "9778397bd097c36b0b6fc9210c91aa",
- "97b6b7f0e47f149b0723b0787b0721",
- "7f0e27f0e47f531b0723b0b6fb0722",
- "7f0e397bd07f595b0b0bc920fb0722",
- "9778397bd097c36b0b6fc9210c8dc2",
- "977837f0e37f149b0723b0787b0721",
- "7f07e7f0e47f531b0723b0b6fb0722",
- "7f0e37f5307f595b0b0bc920fb0722",
- "7f0e397bd097c35b0b6fc9210c8dc2",
- "977837f0e37f14998082b0787b0721",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e37f1487f595b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc9210c8dc2",
- "977837f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc920fb0722",
- "977837f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e397bd097c35b0b6fc920fb0722",
- "977837f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e397bd07f595b0b0bc920fb0722",
- "977837f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e397bd07f595b0b0bc920fb0722",
- "977837f0e37f14998082b0787b06bd",
- "7f07e7f0e47f149b0723b0787b0721",
- "7f0e27f0e47f531b0b0bb0b6fb0722",
- "7f0e397bd07f595b0b0bc920fb0722",
- "977837f0e37f14998082b0723b06bd",
- "7f07e7f0e37f149b0723b0787b0721",
- "7f0e27f0e47f531b0723b0b6fb0722",
- "7f0e397bd07f595b0b0bc920fb0722",
- "977837f0e37f14898082b0723b02d5",
- "7ec967f0e37f14998082b0787b0721",
- "7f07e7f0e47f531b0723b0b6fb0722",
- "7f0e37f1487f595b0b0bb0b6fb0722",
- "7f0e37f0e37f14898082b0723b02d5",
- "7ec967f0e37f14998082b0787b0721",
- "7f07e7f0e47f531b0723b0b6fb0722",
- "7f0e37f1487f531b0b0bb0b6fb0722",
- "7f0e37f0e37f14898082b0723b02d5",
- "7ec967f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e37f1487f531b0b0bb0b6fb0722",
- "7f0e37f0e37f14898082b072297c35",
- "7ec967f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e37f0e37f14898082b072297c35",
- "7ec967f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e37f0e366aa89801eb072297c35",
- "7ec967f0e37f14998082b0787b06bd",
- "7f07e7f0e47f149b0723b0787b0721",
- "7f0e27f1487f531b0b0bb0b6fb0722",
- "7f0e37f0e366aa89801eb072297c35",
- "7ec967f0e37f14998082b0723b06bd",
- "7f07e7f0e47f149b0723b0787b0721",
- "7f0e27f0e47f531b0723b0b6fb0722",
- "7f0e37f0e366aa89801eb072297c35",
- "7ec967f0e37f14998082b0723b06bd",
- "7f07e7f0e37f14998083b0787b0721",
- "7f0e27f0e47f531b0723b0b6fb0722",
- "7f0e37f0e366aa89801eb072297c35",
- "7ec967f0e37f14898082b0723b02d5",
- "7f07e7f0e37f14998082b0787b0721",
- "7f07e7f0e47f531b0723b0b6fb0722",
- "7f0e36665b66aa89801e9808297c35",
- "665f67f0e37f14898082b0723b02d5",
- "7ec967f0e37f14998082b0787b0721",
- "7f07e7f0e47f531b0723b0b6fb0722",
- "7f0e36665b66a449801e9808297c35",
- "665f67f0e37f14898082b0723b02d5",
- "7ec967f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e36665b66a449801e9808297c35",
- "665f67f0e37f14898082b072297c35",
- "7ec967f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e26665b66a449801e9808297c35",
- "665f67f0e37f1489801eb072297c35",
- "7ec967f0e37f14998082b0787b06bd",
- "7f07e7f0e47f531b0723b0b6fb0721",
- "7f0e27f1487f531b0b0bb0b6fb0722"
- ],
- /**
- * 数字转中文速查表
- * @Array Of Property
- * @trans ['日','一','二','三','四','五','六','七','八','九','十']
- * @return Cn string
- */
- nStr1: ["日", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十"],
- /**
- * 日期转农历称呼速查表
- * @Array Of Property
- * @trans ['初','十','廿','卅']
- * @return Cn string
- */
- nStr2: ["初", "十", "廿", "卅"],
- /**
- * 月份转农历称呼速查表
- * @Array Of Property
- * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
- * @return Cn string
- */
- nStr3: ["正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "冬", "腊"],
- /**
- * 返回农历y年一整年的总天数
- * @param lunar Year
- * @return Number
- * @eg:var count = calendar.lYearDays(1987) ;//count=387
- */
- lYearDays: function(y2) {
- var i2;
- var sum = 348;
- for (i2 = 32768; i2 > 8; i2 >>= 1) {
- sum += this.lunarInfo[y2 - 1900] & i2 ? 1 : 0;
- }
- return sum + this.leapDays(y2);
- },
- /**
- * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
- * @param lunar Year
- * @return Number (0-12)
- * @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
- */
- leapMonth: function(y2) {
- return this.lunarInfo[y2 - 1900] & 15;
- },
- /**
- * 返回农历y年闰月的天数 若该年没有闰月则返回0
- * @param lunar Year
- * @return Number (0、29、30)
- * @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
- */
- leapDays: function(y2) {
- if (this.leapMonth(y2)) {
- return this.lunarInfo[y2 - 1900] & 65536 ? 30 : 29;
- }
- return 0;
- },
- /**
- * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
- * @param lunar Year
- * @return Number (-1、29、30)
- * @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
- */
- monthDays: function(y2, m2) {
- if (m2 > 12 || m2 < 1) {
- return -1;
- }
- return this.lunarInfo[y2 - 1900] & 65536 >> m2 ? 30 : 29;
- },
- /**
- * 返回公历(!)y年m月的天数
- * @param solar Year
- * @return Number (-1、28、29、30、31)
- * @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
- */
- solarDays: function(y2, m2) {
- if (m2 > 12 || m2 < 1) {
- return -1;
- }
- var ms = m2 - 1;
- if (ms == 1) {
- return y2 % 4 == 0 && y2 % 100 != 0 || y2 % 400 == 0 ? 29 : 28;
- } else {
- return this.solarMonth[ms];
- }
- },
- /**
- * 农历年份转换为干支纪年
- * @param lYear 农历年的年份数
- * @return Cn string
- */
- toGanZhiYear: function(lYear) {
- var ganKey = (lYear - 3) % 10;
- var zhiKey = (lYear - 3) % 12;
- if (ganKey == 0)
- ganKey = 10;
- if (zhiKey == 0)
- zhiKey = 12;
- return this.Gan[ganKey - 1] + this.Zhi[zhiKey - 1];
- },
- /**
- * 公历月、日判断所属星座
- * @param cMonth [description]
- * @param cDay [description]
- * @return Cn string
- */
- toAstro: function(cMonth, cDay) {
- var s2 = "魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯";
- var arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
- return s2.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + "座";
- },
- /**
- * 传入offset偏移量返回干支
- * @param offset 相对甲子的偏移量
- * @return Cn string
- */
- toGanZhi: function(offset) {
- return this.Gan[offset % 10] + this.Zhi[offset % 12];
- },
- /**
- * 传入公历(!)y年获得该年第n个节气的公历日期
- * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
- * @return day Number
- * @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
- */
- getTerm: function(y2, n2) {
- if (y2 < 1900 || y2 > 2100) {
- return -1;
- }
- if (n2 < 1 || n2 > 24) {
- return -1;
- }
- var _table = this.sTermInfo[y2 - 1900];
- var _info = [
- parseInt("0x" + _table.substr(0, 5)).toString(),
- parseInt("0x" + _table.substr(5, 5)).toString(),
- parseInt("0x" + _table.substr(10, 5)).toString(),
- parseInt("0x" + _table.substr(15, 5)).toString(),
- parseInt("0x" + _table.substr(20, 5)).toString(),
- parseInt("0x" + _table.substr(25, 5)).toString()
- ];
- var _calday = [
- _info[0].substr(0, 1),
- _info[0].substr(1, 2),
- _info[0].substr(3, 1),
- _info[0].substr(4, 2),
- _info[1].substr(0, 1),
- _info[1].substr(1, 2),
- _info[1].substr(3, 1),
- _info[1].substr(4, 2),
- _info[2].substr(0, 1),
- _info[2].substr(1, 2),
- _info[2].substr(3, 1),
- _info[2].substr(4, 2),
- _info[3].substr(0, 1),
- _info[3].substr(1, 2),
- _info[3].substr(3, 1),
- _info[3].substr(4, 2),
- _info[4].substr(0, 1),
- _info[4].substr(1, 2),
- _info[4].substr(3, 1),
- _info[4].substr(4, 2),
- _info[5].substr(0, 1),
- _info[5].substr(1, 2),
- _info[5].substr(3, 1),
- _info[5].substr(4, 2)
- ];
- return parseInt(_calday[n2 - 1]);
- },
- /**
- * 传入农历数字月份返回汉语通俗表示法
- * @param lunar month
- * @return Cn string
- * @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
- */
- toChinaMonth: function(m2) {
- if (m2 > 12 || m2 < 1) {
- return -1;
- }
- var s2 = this.nStr3[m2 - 1];
- s2 += "月";
- return s2;
- },
- /**
- * 传入农历日期数字返回汉字表示法
- * @param lunar day
- * @return Cn string
- * @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
- */
- toChinaDay: function(d2) {
- var s2;
- switch (d2) {
- case 10:
- s2 = "初十";
- break;
- case 20:
- s2 = "二十";
- break;
- case 30:
- s2 = "三十";
- break;
- default:
- s2 = this.nStr2[Math.floor(d2 / 10)];
- s2 += this.nStr1[d2 % 10];
- }
- return s2;
- },
- /**
- * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
- * @param y year
- * @return Cn string
- * @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
- */
- getAnimal: function(y2) {
- return this.Animals[(y2 - 4) % 12];
- },
- /**
- * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
- * @param y solar year
- * @param m solar month
- * @param d solar day
- * @return JSON object
- * @eg:__f__('log','at uni_modules/uview-plus/libs/util/calendar.js:381',calendar.solar2lunar(1987,11,01));
- */
- solar2lunar: function(y2, m2, d2) {
- if (y2 < 1900 || y2 > 2100) {
- return -1;
- }
- if (y2 == 1900 && m2 == 1 && d2 < 31) {
- return -1;
- }
- if (!y2) {
- var objDate = /* @__PURE__ */ new Date();
- } else {
- var objDate = new Date(y2, parseInt(m2) - 1, d2);
- }
- var i2;
- var leap = 0;
- var temp = 0;
- var y2 = objDate.getFullYear();
- var m2 = objDate.getMonth() + 1;
- var d2 = objDate.getDate();
- var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 864e5;
- for (i2 = 1900; i2 < 2101 && offset > 0; i2++) {
- temp = this.lYearDays(i2);
- offset -= temp;
- }
- if (offset < 0) {
- offset += temp;
- i2--;
- }
- var isTodayObj = /* @__PURE__ */ new Date();
- var isToday = false;
- if (isTodayObj.getFullYear() == y2 && isTodayObj.getMonth() + 1 == m2 && isTodayObj.getDate() == d2) {
- isToday = true;
- }
- var nWeek = objDate.getDay();
- var cWeek = this.nStr1[nWeek];
- if (nWeek == 0) {
- nWeek = 7;
- }
- var year = i2;
- var leap = this.leapMonth(i2);
- var isLeap = false;
- for (i2 = 1; i2 < 13 && offset > 0; i2++) {
- if (leap > 0 && i2 == leap + 1 && isLeap == false) {
- --i2;
- isLeap = true;
- temp = this.leapDays(year);
- } else {
- temp = this.monthDays(year, i2);
- }
- if (isLeap == true && i2 == leap + 1) {
- isLeap = false;
- }
- offset -= temp;
- }
- if (offset == 0 && leap > 0 && i2 == leap + 1) {
- if (isLeap) {
- isLeap = false;
- } else {
- isLeap = true;
- --i2;
- }
- }
- if (offset < 0) {
- offset += temp;
- --i2;
- }
- var month = i2;
- var day = offset + 1;
- var sm = m2 - 1;
- var gzY = this.toGanZhiYear(year);
- var firstNode = this.getTerm(y2, m2 * 2 - 1);
- var secondNode = this.getTerm(y2, m2 * 2);
- var gzM = this.toGanZhi((y2 - 1900) * 12 + m2 + 11);
- if (d2 >= firstNode) {
- gzM = this.toGanZhi((y2 - 1900) * 12 + m2 + 12);
- }
- var isTerm = false;
- var Term = null;
- if (firstNode == d2) {
- isTerm = true;
- Term = this.solarTerm[m2 * 2 - 2];
- }
- if (secondNode == d2) {
- isTerm = true;
- Term = this.solarTerm[m2 * 2 - 1];
- }
- var dayCyclical = Date.UTC(y2, sm, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10;
- var gzD = this.toGanZhi(dayCyclical + d2 - 1);
- var astro = this.toAstro(m2, d2);
- return { "lYear": year, "lMonth": month, "lDay": day, "Animal": this.getAnimal(year), "IMonthCn": (isLeap ? "闰" : "") + this.toChinaMonth(month), "IDayCn": this.toChinaDay(day), "cYear": y2, "cMonth": m2, "cDay": d2, "gzYear": gzY, "gzMonth": gzM, "gzDay": gzD, "isToday": isToday, "isLeap": isLeap, "nWeek": nWeek, "ncWeek": "星期" + cWeek, "isTerm": isTerm, "Term": Term, "astro": astro };
- },
- /**
- * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
- * @param y lunar year
- * @param m lunar month
- * @param d lunar day
- * @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
- * @return JSON object
- * @eg:__f__('log','at uni_modules/uview-plus/libs/util/calendar.js:500',calendar.lunar2solar(1987,9,10));
- */
- lunar2solar: function(y2, m2, d2, isLeapMonth) {
- var isLeapMonth = !!isLeapMonth;
- var leapMonth = this.leapMonth(y2);
- this.leapDays(y2);
- if (isLeapMonth && leapMonth != m2) {
- return -1;
- }
- if (y2 == 2100 && m2 == 12 && d2 > 1 || y2 == 1900 && m2 == 1 && d2 < 31) {
- return -1;
- }
- var day = this.monthDays(y2, m2);
- var _day = day;
- if (isLeapMonth) {
- _day = this.leapDays(y2, m2);
- }
- if (y2 < 1900 || y2 > 2100 || d2 > _day) {
- return -1;
- }
- var offset = 0;
- for (var i2 = 1900; i2 < y2; i2++) {
- offset += this.lYearDays(i2);
- }
- var leap = 0;
- var isAdd = false;
- for (var i2 = 1; i2 < m2; i2++) {
- leap = this.leapMonth(y2);
- if (!isAdd) {
- if (leap <= i2 && leap > 0) {
- offset += this.leapDays(y2);
- isAdd = true;
- }
- }
- offset += this.monthDays(y2, i2);
- }
- if (isLeapMonth) {
- offset += day;
- }
- var stmap = Date.UTC(1900, 1, 30, 0, 0, 0);
- var calObj = new Date((offset + d2 - 31) * 864e5 + stmap);
- var cY = calObj.getUTCFullYear();
- var cM = calObj.getUTCMonth() + 1;
- var cD = calObj.getUTCDate();
- return this.solar2lunar(cY, cM, cD);
- }
- };
- const _sfc_main$1U = {
- name: "u-calendar",
- mixins: [mpMixin, mixin, props$1g],
- components: {
- uHeader,
- uMonth
- },
- data() {
- return {
- // 需要显示的月份的数组
- months: [],
- // 在月份滚动区域中,当前视图中月份的index索引
- monthIndex: 0,
- // 月份滚动区域的高度
- listHeight: 0,
- // month组件中选择的日期数组
- selected: [],
- scrollIntoView: "",
- scrollIntoViewScroll: "",
- scrollTop: 0,
- // 过滤处理方法
- innerFormatter: (value2) => value2
- };
- },
- watch: {
- scrollIntoView: {
- immediate: true,
- handler(n2) {
- }
- },
- selectedChange: {
- immediate: true,
- handler(n2) {
- this.setMonth();
- }
- },
- // 打开弹窗时,设置月份数据
- show: {
- immediate: true,
- handler(n2) {
- if (n2) {
- this.setMonth();
- } else {
- this.scrollIntoView = "";
- }
- }
- }
- },
- computed: {
- // 由于maxDate和minDate可以为字符串(2021-10-10),或者数值(时间戳),但是dayjs如果接受字符串形式的时间戳会有问题,这里进行处理
- innerMaxDate() {
- return test.number(this.maxDate) ? Number(this.maxDate) : this.maxDate;
- },
- innerMinDate() {
- return test.number(this.minDate) ? Number(this.minDate) : this.minDate;
- },
- // 多个条件的变化,会引起选中日期的变化,这里统一管理监听
- selectedChange() {
- return [this.innerMinDate, this.innerMaxDate, this.defaultDate];
- },
- subtitle() {
- if (this.months.length) {
- if (uni.getLocale() == "zh-Hans" || uni.getLocale() == "zh-Hant") {
- return this.months[this.monthIndex].year + "年" + (this.months[this.monthIndex].month < 10 ? "0" + this.months[this.monthIndex].month : this.months[this.monthIndex].month) + "月";
- } else {
- return (this.months[this.monthIndex].month < 10 ? "0" + this.months[this.monthIndex].month : this.months[this.monthIndex].month) + "/" + this.months[this.monthIndex].year;
- }
- } else {
- return "";
- }
- },
- buttonDisabled() {
- if (this.mode === "range") {
- if (this.selected.length <= 1) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
- },
- mounted() {
- this.start = Date.now();
- this.init();
- },
- emits: ["confirm", "close"],
- methods: {
- addUnit,
- // 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
- setFormatter(e2) {
- this.innerFormatter = e2;
- },
- // month组件内部选择日期后,通过事件通知给父组件
- monthSelected(e2, scene = "init") {
- this.selected = e2;
- if (!this.showConfirm) {
- if (this.mode === "multiple" || this.mode === "single" || this.mode === "range" && this.selected.length >= 2) {
- if (scene === "init") {
- return;
- }
- if (scene === "tap") {
- this.$emit("confirm", this.selected);
- }
- }
- }
- },
- init() {
- if (this.innerMaxDate && this.innerMinDate && new Date(this.innerMaxDate).getTime() < new Date(this.innerMinDate).getTime()) {
- return error("maxDate不能小于minDate时间");
- }
- let bottomPadding = 0;
- if (this.pageInline) {
- bottomPadding = 0;
- } else {
- bottomPadding = 30;
- }
- this.listHeight = this.rowHeight * 5 + bottomPadding;
- this.setMonth();
- },
- close() {
- this.$emit("close");
- },
- // 点击确定按钮
- confirm() {
- if (!this.buttonDisabled) {
- this.$emit("confirm", this.selected);
- }
- },
- // 获得两个日期之间的月份数
- getMonths(minDate, maxDate) {
- const minYear = e$1(minDate).year();
- const minMonth = e$1(minDate).month() + 1;
- const maxYear = e$1(maxDate).year();
- const maxMonth = e$1(maxDate).month() + 1;
- return (maxYear - minYear) * 12 + (maxMonth - minMonth) + 1;
- },
- // 设置月份数据
- setMonth() {
- const minDate = this.innerMinDate || e$1().valueOf();
- const maxDate = this.innerMaxDate || e$1(minDate).add(this.monthNum - 1, "month").valueOf();
- const months = range$1(
- 1,
- this.monthNum,
- this.getMonths(minDate, maxDate)
- );
- this.months = [];
- for (let i2 = 0; i2 < months; i2++) {
- this.months.push({
- date: new Array(
- e$1(minDate).add(i2, "month").daysInMonth()
- ).fill(1).map((item, index2) => {
- let day = index2 + 1;
- const week = e$1(minDate).add(i2, "month").date(day).day();
- const date3 = e$1(minDate).add(i2, "month").date(day).format("YYYY-MM-DD");
- let bottomInfo = "";
- if (this.showLunar) {
- const lunar = Calendar.solar2lunar(
- e$1(date3).year(),
- e$1(date3).month() + 1,
- e$1(date3).date()
- );
- bottomInfo = lunar.IDayCn;
- }
- let config2 = {
- day,
- week,
- // 小于最小允许的日期,或者大于最大的日期,则设置为disabled状态
- disabled: e$1(date3).isBefore(
- e$1(minDate).format("YYYY-MM-DD")
- ) || e$1(date3).isAfter(
- e$1(maxDate).format("YYYY-MM-DD")
- ),
- // 返回一个日期对象,供外部的formatter获取当前日期的年月日等信息,进行加工处理
- date: new Date(date3),
- bottomInfo,
- dot: false,
- month: e$1(minDate).add(i2, "month").month() + 1
- };
- const formatter = this.formatter || this.innerFormatter;
- return formatter(config2);
- }),
- // 当前所属的月份
- month: e$1(minDate).add(i2, "month").month() + 1,
- // 当前年份
- year: e$1(minDate).add(i2, "month").year()
- });
- }
- },
- // 滚动到默认设置的月份
- scrollIntoDefaultMonth(selected) {
- const _index = this.months.findIndex(({
- year,
- month
- }) => {
- month = padZero$1(month);
- return `${year}-${month}` === selected;
- });
- if (_index !== -1) {
- this.$nextTick(() => {
- this.scrollIntoView = `month-${_index}`;
- this.scrollIntoViewScroll = this.scrollIntoView;
- });
- }
- },
- // scroll-view滚动监听
- onScroll(event) {
- const scrollTop = Math.max(0, event.detail.scrollTop);
- for (let i2 = 0; i2 < this.months.length; i2++) {
- if (scrollTop >= (this.months[i2].top || this.listHeight)) {
- this.monthIndex = i2;
- this.scrollIntoViewScroll = `month-${i2}`;
- }
- }
- },
- // 更新月份的top值
- updateMonthTop(topArr = []) {
- topArr.map((item, index2) => {
- this.months[index2].top = item;
- });
- if (!this.defaultDate) {
- const selected2 = e$1().format("YYYY-MM");
- this.scrollIntoDefaultMonth(selected2);
- return;
- }
- let selected = e$1().format("YYYY-MM");
- if (!test.array(this.defaultDate)) {
- selected = e$1(this.defaultDate).format("YYYY-MM");
- } else {
- selected = e$1(this.defaultDate[0]).format("YYYY-MM");
- }
- this.scrollIntoDefaultMonth(selected);
- }
- }
- };
- function _sfc_render$1T(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uHeader = vue.resolveComponent("uHeader");
- const _component_uMonth = vue.resolveComponent("uMonth");
- const _component_u_button = resolveEasycom(vue.resolveDynamicComponent("u-button"), __easycom_0$8);
- const _component_u_popup = resolveEasycom(vue.resolveDynamicComponent("u-popup"), __easycom_2);
- return vue.openBlock(), vue.createBlock(_component_u_popup, {
- show: _ctx.show,
- mode: "bottom",
- closeable: !_ctx.pageInline,
- onClose: $options.close,
- round: _ctx.round,
- pageInline: _ctx.pageInline,
- closeOnClickOverlay: _ctx.closeOnClickOverlay
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "u-calendar" }, [
- vue.createVNode(_component_uHeader, {
- title: _ctx.title,
- subtitle: $options.subtitle,
- showSubtitle: _ctx.showSubtitle,
- showTitle: _ctx.showTitle,
- weekText: _ctx.weekText
- }, null, 8, ["title", "subtitle", "showSubtitle", "showTitle", "weekText"]),
- vue.createElementVNode("scroll-view", {
- style: vue.normalizeStyle({
- height: $options.addUnit($data.listHeight, "px")
- }),
- "scroll-y": "",
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.onScroll && $options.onScroll(...args)),
- "scroll-top": $data.scrollTop,
- scrollIntoView: $data.scrollIntoView
- }, [
- vue.createVNode(_component_uMonth, {
- color: _ctx.color,
- rowHeight: _ctx.rowHeight,
- showMark: _ctx.showMark,
- months: $data.months,
- mode: _ctx.mode,
- maxCount: _ctx.maxCount,
- startText: _ctx.startText,
- endText: _ctx.endText,
- defaultDate: _ctx.defaultDate,
- minDate: $options.innerMinDate,
- maxDate: $options.innerMaxDate,
- maxMonth: _ctx.monthNum,
- readonly: _ctx.readonly,
- maxRange: _ctx.maxRange,
- rangePrompt: _ctx.rangePrompt,
- showRangePrompt: _ctx.showRangePrompt,
- allowSameDay: _ctx.allowSameDay,
- forbidDays: _ctx.forbidDays,
- forbidDaysToast: _ctx.forbidDaysToast,
- monthFormat: _ctx.monthFormat,
- ref: "month",
- onMonthSelected: $options.monthSelected,
- onUpdateMonthTop: $options.updateMonthTop
- }, null, 8, ["color", "rowHeight", "showMark", "months", "mode", "maxCount", "startText", "endText", "defaultDate", "minDate", "maxDate", "maxMonth", "readonly", "maxRange", "rangePrompt", "showRangePrompt", "allowSameDay", "forbidDays", "forbidDaysToast", "monthFormat", "onMonthSelected", "onUpdateMonthTop"])
- ], 44, ["scroll-top", "scrollIntoView"]),
- _ctx.showConfirm ? vue.renderSlot(_ctx.$slots, "footer", { key: 0 }, () => [
- vue.createElementVNode("view", { class: "u-calendar__confirm" }, [
- vue.createVNode(_component_u_button, {
- shape: "circle",
- text: $options.buttonDisabled ? _ctx.confirmDisabledText : _ctx.confirmText,
- color: _ctx.color,
- onClick: $options.confirm,
- disabled: $options.buttonDisabled
- }, null, 8, ["text", "color", "onClick", "disabled"])
- ])
- ], true) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "closeable", "onClose", "round", "pageInline", "closeOnClickOverlay"]);
- }
- const uCalendar = /* @__PURE__ */ _export_sfc(_sfc_main$1U, [["render", _sfc_render$1T], ["__scopeId", "data-v-c9867878"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-calendar/u-calendar.vue"]]);
- const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCalendar
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1f = defineMixin({
- props: {
- // 是否打乱键盘按键的顺序
- random: {
- type: Boolean,
- default: false
- },
- // 输入一个中文后,是否自动切换到英文
- autoChange: {
- type: Boolean,
- default: false
- }
- }
- });
- const _sfc_main$1T = {
- name: "u-car-keyboard",
- mixins: [mpMixin, mixin, props$1f],
- data() {
- return {
- // 车牌输入时,abc=true为输入车牌号码,bac=false为输入省份中文简称
- abc: false
- };
- },
- computed: {
- areaList() {
- let data = [
- "京",
- "沪",
- "粤",
- "津",
- "冀",
- "豫",
- "云",
- "辽",
- "黑",
- "湘",
- "皖",
- "鲁",
- "苏",
- "浙",
- "赣",
- "鄂",
- "桂",
- "甘",
- "晋",
- "陕",
- "蒙",
- "吉",
- "闽",
- "贵",
- "渝",
- "川",
- "青",
- "琼",
- "宁",
- "挂",
- "藏",
- "港",
- "澳",
- "新",
- "使",
- "学"
- ];
- let tmp = [];
- if (this.random)
- data = randomArray(data);
- tmp[0] = data.slice(0, 10);
- tmp[1] = data.slice(10, 20);
- tmp[2] = data.slice(20, 30);
- tmp[3] = data.slice(30, 36);
- return tmp;
- },
- engKeyBoardList() {
- let data = [
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9,
- 0,
- "Q",
- "W",
- "E",
- "R",
- "T",
- "Y",
- "U",
- "I",
- "O",
- "P",
- "A",
- "S",
- "D",
- "F",
- "G",
- "H",
- "J",
- "K",
- "L",
- "Z",
- "X",
- "C",
- "V",
- "B",
- "N",
- "M"
- ];
- let tmp = [];
- if (this.random)
- data = randomArray(data);
- tmp[0] = data.slice(0, 10);
- tmp[1] = data.slice(10, 20);
- tmp[2] = data.slice(20, 30);
- tmp[3] = data.slice(30, 36);
- return tmp;
- }
- },
- emits: ["change", "backspace"],
- methods: {
- // 点击键盘按钮
- carInputClick(i2, j2) {
- let value2 = "";
- if (this.abc)
- value2 = this.engKeyBoardList[i2][j2];
- else
- value2 = this.areaList[i2][j2];
- if (!this.abc && this.autoChange)
- sleep(200).then(() => this.abc = true);
- this.$emit("change", value2);
- },
- // 修改汽车牌键盘的输入模式,中文|英文
- changeCarInputMode() {
- this.abc = !this.abc;
- },
- // 点击退格键
- backspaceClick() {
- this.$emit("backspace");
- clearInterval(this.timer);
- this.timer = null;
- this.timer = setInterval(() => {
- this.$emit("backspace");
- }, 250);
- },
- clearTimer() {
- clearInterval(this.timer);
- this.timer = null;
- }
- }
- };
- function _sfc_render$1S(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-keyboard",
- onTouchmove: _cache[3] || (_cache[3] = vue.withModifiers((...args) => _ctx.noop && _ctx.noop(...args), ["stop", "prevent"]))
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.abc ? $options.engKeyBoardList : $options.areaList, (group, i2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: i2,
- class: vue.normalizeClass(["u-keyboard__button", [i2 + 1 === 4 && "u-keyboard__button--center"]]),
- index: i2
- }, [
- i2 === 3 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-keyboard__button__inner-wrapper"
- }, [
- vue.createElementVNode("view", {
- class: "u-keyboard__button__inner-wrapper__left",
- "hover-class": "u-hover-class",
- "hover-stay-time": 200,
- onClick: _cache[0] || (_cache[0] = (...args) => $options.changeCarInputMode && $options.changeCarInputMode(...args))
- }, [
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["u-keyboard__button__inner-wrapper__left__lang", [!$data.abc && "u-keyboard__button__inner-wrapper__left__lang--active"]])
- },
- "中",
- 2
- /* CLASS */
- ),
- vue.createElementVNode("text", { class: "u-keyboard__button__inner-wrapper__left__line" }, "/"),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["u-keyboard__button__inner-wrapper__left__lang", [$data.abc && "u-keyboard__button__inner-wrapper__left__lang--active"]])
- },
- "英",
- 2
- /* CLASS */
- )
- ])
- ])) : vue.createCommentVNode("v-if", true),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(group, (item, j2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-keyboard__button__inner-wrapper",
- key: j2
- }, [
- vue.createElementVNode("view", {
- class: "u-keyboard__button__inner-wrapper__inner",
- "hover-stay-time": 200,
- onClick: ($event) => $options.carInputClick(i2, j2),
- "hover-class": "u-hover-class"
- }, [
- vue.createElementVNode(
- "text",
- { class: "u-keyboard__button__inner-wrapper__inner__text" },
- vue.toDisplayString(item),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- i2 === 3 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- onTouchstart: _cache[1] || (_cache[1] = (...args) => $options.backspaceClick && $options.backspaceClick(...args)),
- onTouchend: _cache[2] || (_cache[2] = (...args) => $options.clearTimer && $options.clearTimer(...args)),
- class: "u-keyboard__button__inner-wrapper"
- },
- [
- vue.createElementVNode("view", {
- class: "u-keyboard__button__inner-wrapper__right",
- "hover-class": "u-hover-class",
- "hover-stay-time": 200
- }, [
- vue.createVNode(_component_up_icon, {
- size: "28",
- name: "backspace",
- color: "#303133"
- })
- ])
- ],
- 32
- /* NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true)
- ], 10, ["index"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 32
- /* NEED_HYDRATION */
- );
- }
- const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1T, [["render", _sfc_render$1S], ["__scopeId", "data-v-e3990159"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-car-keyboard/u-car-keyboard.vue"]]);
- const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_1$2
- }, Symbol.toStringTag, { value: "Module" }));
- const propsCard = defineMixin({
- props: {
- // 与屏幕两侧是否留空隙
- full: {
- type: Boolean,
- default: () => props$1x.card.full
- },
- // 标题
- title: {
- type: String,
- default: () => props$1x.card.title
- },
- // 标题颜色
- titleColor: {
- type: String,
- default: () => props$1x.card.titleColor
- },
- // 标题字体大小
- titleSize: {
- type: [Number, String],
- default: () => props$1x.card.titleSize
- },
- // 副标题
- subTitle: {
- type: String,
- default: () => props$1x.card.subTitle
- },
- // 副标题颜色
- subTitleColor: {
- type: String,
- default: () => props$1x.card.subTitleColor
- },
- // 副标题字体大小
- subTitleSize: {
- type: [Number, String],
- default: () => props$1x.card.subTitleSize
- },
- // 是否显示外部边框,只对full=false时有效(卡片与边框有空隙时)
- border: {
- type: Boolean,
- default: () => props$1x.card.border
- },
- // 用于标识点击了第几个
- index: {
- type: [Number, String, Object],
- default: () => props$1x.card.index
- },
- // 用于隔开上下左右的边距,带单位的写法,如:"30px 30px","20px 20px 30px 30px"
- margin: {
- type: String,
- default: () => props$1x.card.margin
- },
- // card卡片的圆角
- borderRadius: {
- type: [Number, String],
- default: () => props$1x.card.borderRadius
- },
- // 头部自定义样式,对象形式
- headStyle: {
- type: Object,
- default: () => props$1x.card.headStyle
- },
- // 主体自定义样式,对象形式
- bodyStyle: {
- type: Object,
- default: () => props$1x.card.bodyStyle
- },
- // 底部自定义样式,对象形式
- footStyle: {
- type: Object,
- default: () => props$1x.card.footStyle
- },
- // 头部是否下边框
- headBorderBottom: {
- type: Boolean,
- default: () => props$1x.card.headBorderBottom
- },
- // 底部是否有上边框
- footBorderTop: {
- type: Boolean,
- default: () => props$1x.card.footBorderTop
- },
- // 标题左边的缩略图
- thumb: {
- type: String,
- default: () => props$1x.card.thumb
- },
- // 缩略图宽高
- thumbWidth: {
- type: [String, Number],
- default: () => props$1x.card.thumbWidth
- },
- // 缩略图是否为圆形
- thumbCircle: {
- type: Boolean,
- default: () => props$1x.card.thumbCircle
- },
- // 给head,body,foot的内边距
- padding: {
- type: [String, Number],
- default: () => props$1x.card.padding
- },
- paddingHead: {
- type: [String, Number],
- default: () => props$1x.card.paddingHead
- },
- paddingBody: {
- type: [String, Number],
- default: () => props$1x.card.paddingBody
- },
- paddingFoot: {
- type: [String, Number],
- default: () => props$1x.card.paddingFoot
- },
- // 是否显示头部
- showHead: {
- type: Boolean,
- default: () => props$1x.card.showHead
- },
- // 是否显示尾部
- showFoot: {
- type: Boolean,
- default: () => props$1x.card.showFoot
- },
- // 卡片外围阴影,字符串形式
- boxShadow: {
- type: String,
- default: () => props$1x.card.boxShadow
- }
- }
- });
- const _sfc_main$1S = {
- name: "up-card",
- data() {
- return {};
- },
- mixins: [mpMixin, mixin, propsCard],
- emits: ["click", "head-click", "body-click", "foot-click"],
- methods: {
- addStyle,
- addUnit,
- getPx,
- click() {
- this.$emit("click", this.index);
- },
- headClick() {
- this.$emit("head-click", this.index);
- },
- bodyClick() {
- this.$emit("body-click", this.index);
- },
- footClick() {
- this.$emit("foot-click", this.index);
- }
- }
- };
- function _sfc_render$1R(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-card", { "u-border": _ctx.border, "u-card-full": _ctx.full, "u-card--border": $options.getPx(_ctx.borderRadius) > 0 }]),
- onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.click && $options.click(...args), ["stop"])),
- style: vue.normalizeStyle({
- borderRadius: $options.addUnit(_ctx.borderRadius),
- margin: _ctx.margin,
- boxShadow: _ctx.boxShadow
- })
- },
- [
- _ctx.showHead ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-card__head", {
- "u-border-bottom": _ctx.headBorderBottom
- }]),
- style: vue.normalizeStyle([{ padding: $options.addUnit(_ctx.paddingHead || _ctx.padding) }, _ctx.headStyle]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.headClick && $options.headClick(...args))
- },
- [
- !_ctx.$slots.head ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-flex u-flex-between"
- }, [
- _ctx.title ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-card__head--left u-flex u-line-1"
- }, [
- _ctx.thumb ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _ctx.thumb,
- class: "u-card__head--left__thumb",
- mode: "aspectFill",
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.thumbWidth),
- width: $options.addUnit(_ctx.thumbWidth),
- borderRadius: _ctx.thumbCircle ? "50px" : "4px"
- })
- }, null, 12, ["src"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- {
- class: "u-card__head--left__title u-line-1",
- style: vue.normalizeStyle({
- fontSize: $options.addUnit(_ctx.titleSize),
- color: _ctx.titleColor
- })
- },
- vue.toDisplayString(_ctx.title),
- 5
- /* TEXT, STYLE */
- )
- ])) : vue.createCommentVNode("v-if", true),
- _ctx.subTitle ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-card__head--right u-line-1"
- }, [
- vue.createElementVNode(
- "text",
- {
- class: "u-card__head__title__text",
- style: vue.normalizeStyle({
- fontSize: $options.addUnit(_ctx.subTitleSize),
- color: _ctx.subTitleColor
- })
- },
- vue.toDisplayString(_ctx.subTitle),
- 5
- /* TEXT, STYLE */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ])) : vue.renderSlot(_ctx.$slots, "head", { key: 1 }, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[1] || (_cache[1] = (...args) => $options.bodyClick && $options.bodyClick(...args)),
- class: "u-card__body",
- style: vue.normalizeStyle([{ padding: $options.addUnit(_ctx.paddingBody || _ctx.padding) }, _ctx.bodyStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "body", {}, void 0, true)
- ],
- 4
- /* STYLE */
- ),
- _ctx.showFoot ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["u-card__foot", {
- "u-border-top": _ctx.footBorderTop
- }]),
- onClick: _cache[2] || (_cache[2] = (...args) => $options.footClick && $options.footClick(...args)),
- style: vue.normalizeStyle([{ padding: _ctx.$slots.foot ? $options.addUnit(_ctx.paddingFoot || _ctx.padding) : 0 }, _ctx.footStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "foot", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uCard = /* @__PURE__ */ _export_sfc(_sfc_main$1S, [["render", _sfc_render$1R], ["__scopeId", "data-v-040f828b"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-card/u-card.vue"]]);
- const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCard
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1R = {
- name: "up-cate-tab",
- props: {
- height: {
- type: String,
- default: "100%"
- },
- tabList: {
- type: Array,
- default: () => {
- return [];
- }
- },
- tabKeyName: {
- type: String,
- default: "name"
- },
- itemKeyName: {
- type: String,
- default: "name"
- },
- current: {
- type: Number,
- default: 0
- }
- },
- watch: {
- tabList: {
- deep: true,
- handler(newVal, oldVal) {
- sleep(30);
- this.getMenuItemTop();
- this.leftMenuStatus(this.innerCurrent);
- }
- },
- current(nval) {
- this.innerCurrent = nval;
- this.leftMenuStatus(this.innerCurrent);
- },
- height() {
- this.getMenuItemTop();
- this.leftMenuStatus(this.innerCurrent);
- }
- },
- emits: ["update:current"],
- data() {
- return {
- scrollTop: 0,
- //tab标题的滚动条位置
- scrollIntoView: "",
- // 滚动至哪个元素
- oldScrollTop: 0,
- innerCurrent: 0,
- // 预设当前项的值
- menuHeight: 0,
- // 左边菜单的高度
- menuItemHeight: 0,
- // 左边菜单item的高度
- itemId: "",
- // 栏目右边scroll-view用于滚动的id
- menuItemPos: [],
- rects: [],
- arr: [],
- scrollRightTop: 0,
- // 右边栏目scroll-view的滚动条高度
- timer: null
- // 定时器
- };
- },
- mounted() {
- this.innerCurrent = this.current;
- this.leftMenuStatus(this.innerCurrent);
- this.getMenuItemTop();
- },
- methods: {
- addUnit,
- // 点击左边的栏目切换
- async swichMenu(index2) {
- if (this.arr.length == 0) {
- await this.getMenuItemTop();
- }
- this.scrollIntoView = "item" + index2;
- if (index2 == this.innerCurrent)
- return;
- this.$nextTick(function() {
- this.innerCurrent = index2;
- this.$emit("update:current", index2);
- });
- },
- // 获取一个目标元素的高度
- getElRect(elClass, dataVal) {
- return new Promise((resolve, reject) => {
- const query = uni.createSelectorQuery().in(this);
- query.select("." + elClass).fields({
- size: true
- }, (res) => {
- if (!res) {
- setTimeout(() => {
- this.getElRect(elClass);
- }, 10);
- return;
- }
- this[dataVal] = res.height;
- resolve();
- }).exec();
- });
- },
- // 观测元素相交状态
- async observer() {
- await this.$nextTick();
- if (this._observerList) {
- this._observerList.forEach((observer) => {
- observer.disconnect();
- });
- }
- this._observerList = [];
- this.tabList.map((val, index2) => {
- let observer = uni.createIntersectionObserver(this);
- this._observerList.push(observer);
- observer.relativeTo(".u-cate-tab__right-box", {
- top: 10
- }).observe("#item" + index2, (res) => {
- if (res.intersectionRatio > 0) {
- formatAppLog("log", "at uni_modules/uview-plus/components/u-cate-tab/u-cate-tab.vue:170", "res", res);
- let id = res.id ? res.id.substring(4) : index2;
- this.leftMenuStatus(parseInt(id));
- }
- });
- });
- },
- // 设置左边菜单的滚动状态
- async leftMenuStatus(index2) {
- this.innerCurrent = index2;
- this.$emit("update:current", index2);
- if (this.menuHeight == 0 || this.menuItemHeight == 0) {
- await this.getElRect("u-cate-tab__menu-scroll-view", "menuHeight");
- await this.getElRect("u-cate-tab__item", "menuItemHeight");
- }
- this.scrollTop = index2 * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
- },
- // 获取右边菜单每个item到顶部的距离
- async getMenuItemTop() {
- return new Promise((resolve) => {
- let selectorQuery = uni.createSelectorQuery().in(this);
- selectorQuery.selectAll(".u-cate-tab__page-item").boundingClientRect((rects) => {
- if (!rects.length) {
- setTimeout(() => {
- this.getMenuItemTop();
- }, 100);
- return;
- }
- this.rects = rects;
- this.arr = [];
- rects.forEach((rect) => {
- this.arr.push(rect.top - rects[0].top);
- });
- resolve();
- }).exec();
- });
- },
- // 右边菜单滚动
- async rightScroll(e2) {
- this.oldScrollTop = e2.detail.scrollTop;
- if (this.arr.length == 0) {
- await this.getMenuItemTop();
- }
- if (this.timer)
- return;
- if (!this.menuHeight) {
- await this.getElRect("u-cate-tab__menu-scroll-view", "menuHeight");
- }
- setTimeout(() => {
- this.timer = null;
- let scrollHeight = e2.detail.scrollTop + 1;
- for (let i2 = 0; i2 < this.arr.length; i2++) {
- let height1 = this.arr[i2];
- let height2 = this.arr[i2 + 1];
- if (!height2 || scrollHeight >= height1 && scrollHeight <= height2) {
- this.leftMenuStatus(i2);
- return;
- }
- }
- }, 100);
- }
- }
- };
- function _sfc_render$1Q(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-cate-tab",
- style: vue.normalizeStyle({ height: $options.addUnit($props.height) })
- },
- [
- vue.createElementVNode("view", { class: "u-cate-tab__wrap" }, [
- vue.createElementVNode("scroll-view", {
- class: "u-cate-tab__view u-cate-tab__menu-scroll-view",
- "scroll-y": "",
- "scroll-with-animation": "",
- "scroll-top": $data.scrollTop,
- "scroll-into-view": $data.itemId
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.tabList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: vue.normalizeClass(["u-cate-tab__item", [$data.innerCurrent == index2 ? "u-cate-tab__item-active" : ""]]),
- onClick: vue.withModifiers(($event) => $options.swichMenu(index2), ["stop"])
- }, [
- vue.renderSlot(_ctx.$slots, "tabItem", { item }, void 0, true),
- !_ctx.$slots["tabItem"] ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-line-1"
- },
- vue.toDisplayString(item[$props.tabKeyName]),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 8, ["scroll-top", "scroll-into-view"]),
- vue.createElementVNode("scroll-view", {
- "scroll-top": $data.scrollRightTop,
- "scroll-with-animation": "",
- "scroll-into-view": $data.scrollIntoView,
- "scroll-y": "",
- class: "u-cate-tab__right-box",
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.rightScroll && $options.rightScroll(...args))
- }, [
- vue.createElementVNode("view", { class: "u-cate-tab__right-top" }, [
- vue.renderSlot(_ctx.$slots, "rightTop", { tabList: $props.tabList }, void 0, true)
- ]),
- vue.createElementVNode("view", { class: "u-cate-tab__page-view" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.tabList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-cate-tab__page-item",
- id: "item" + index2,
- key: index2
- }, [
- vue.renderSlot(_ctx.$slots, "itemList", { item }, void 0, true),
- !_ctx.$slots["itemList"] ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createElementVNode("view", { class: "item-title" }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString(item[$props.tabKeyName]),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "item-container" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(item.children, (item1, index1) => {
- return vue.renderSlot(_ctx.$slots, "pageItem", {
- key: index1,
- pageItem: item1
- }, () => [
- vue.createElementVNode("view", { class: "thumb-box" }, [
- vue.createElementVNode("image", {
- class: "item-menu-image",
- src: item1.icon,
- mode: ""
- }, null, 8, ["src"]),
- vue.createElementVNode(
- "view",
- { class: "item-menu-name" },
- vue.toDisplayString(item1[$props.itemKeyName]),
- 1
- /* TEXT */
- )
- ])
- ], true);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ], 8, ["id"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ], 40, ["scroll-top", "scroll-into-view"])
- ])
- ],
- 4
- /* STYLE */
- );
- }
- const uCateTab = /* @__PURE__ */ _export_sfc(_sfc_main$1R, [["render", _sfc_render$1Q], ["__scopeId", "data-v-963a5e40"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-cate-tab/u-cate-tab.vue"]]);
- const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCateTab
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1e = defineMixin({
- props: {
- // 分组标题
- title: {
- type: String,
- default: () => props$1x.cellGroup.title
- },
- // 是否显示外边框
- border: {
- type: Boolean,
- default: () => props$1x.cellGroup.border
- }
- }
- });
- const _sfc_main$1Q = {
- name: "u-cell-group",
- mixins: [mpMixin, mixin, props$1e],
- methods: {
- addStyle
- }
- };
- function _sfc_render$1P(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)]),
- class: vue.normalizeClass([[_ctx.customClass], "u-cell-group"])
- },
- [
- _ctx.title ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-cell-group__title"
- }, [
- vue.renderSlot(_ctx.$slots, "title", {}, () => [
- vue.createElementVNode(
- "text",
- { class: "u-cell-group__title__text" },
- vue.toDisplayString(_ctx.title),
- 1
- /* TEXT */
- )
- ], true)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "u-cell-group__wrapper" }, [
- _ctx.border ? (vue.openBlock(), vue.createBlock(_component_u_line, { key: 0 })) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uCellGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1Q, [["render", _sfc_render$1P], ["__scopeId", "data-v-014d39dc"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-cell-group/u-cell-group.vue"]]);
- const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCellGroup
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1d = defineMixin({
- props: {
- // 标题
- title: {
- type: [String, Number],
- default: () => props$1x.cell.title
- },
- // 标题下方的描述信息
- label: {
- type: [String, Number],
- default: () => props$1x.cell.label
- },
- // 右侧的内容
- value: {
- type: [String, Number],
- default: () => props$1x.cell.value
- },
- // 左侧图标名称,或者图片链接(本地文件建议使用绝对地址)
- icon: {
- type: String,
- default: () => props$1x.cell.icon
- },
- // 是否禁用cell
- disabled: {
- type: Boolean,
- default: () => props$1x.cell.disabled
- },
- // 是否显示下边框
- border: {
- type: Boolean,
- default: () => props$1x.cell.border
- },
- // 内容是否垂直居中(主要是针对右侧的value部分)
- center: {
- type: Boolean,
- default: () => props$1x.cell.center
- },
- // 点击后跳转的URL地址
- url: {
- type: String,
- default: () => props$1x.cell.url
- },
- // 链接跳转的方式,内部使用的是uView封装的route方法,可能会进行拦截操作
- linkType: {
- type: String,
- default: () => props$1x.cell.linkType
- },
- // 是否开启点击反馈(表现为点击时加上灰色背景)
- clickable: {
- type: Boolean,
- default: () => props$1x.cell.clickable
- },
- // 是否展示右侧箭头并开启点击反馈
- isLink: {
- type: Boolean,
- default: () => props$1x.cell.isLink
- },
- // 是否显示表单状态下的必填星号(此组件可能会内嵌入input组件)
- required: {
- type: Boolean,
- default: () => props$1x.cell.required
- },
- // 右侧的图标箭头
- rightIcon: {
- type: String,
- default: () => props$1x.cell.rightIcon
- },
- // 右侧箭头的方向,可选值为:left,up,down
- arrowDirection: {
- type: String,
- default: () => props$1x.cell.arrowDirection
- },
- // 左侧图标样式
- iconStyle: {
- type: [Object, String],
- default: () => {
- return props$1x.cell.iconStyle;
- }
- },
- // 右侧箭头图标的样式
- rightIconStyle: {
- type: [Object, String],
- default: () => {
- return props$1x.cell.rightIconStyle;
- }
- },
- // 标题的样式
- titleStyle: {
- type: [Object, String],
- default: () => {
- return props$1x.cell.titleStyle;
- }
- },
- // 单位元的大小,可选值为large
- size: {
- type: String,
- default: () => props$1x.cell.size
- },
- // 点击cell是否阻止事件传播
- stop: {
- type: Boolean,
- default: () => props$1x.cell.stop
- },
- // 标识符,cell被点击时返回
- name: {
- type: [Number, String],
- default: () => props$1x.cell.name
- }
- }
- });
- const _sfc_main$1P = {
- name: "u-cell",
- data() {
- return {};
- },
- mixins: [mpMixin, mixin, props$1d],
- computed: {
- titleTextStyle() {
- return addStyle(this.titleStyle);
- }
- },
- emits: ["click"],
- methods: {
- addStyle,
- testEmpty: test.empty,
- // 点击cell
- clickHandler(e2) {
- if (this.disabled)
- return;
- this.$emit("click", {
- name: this.name
- });
- this.openPage();
- this.stop && this.preventEvent(e2);
- }
- }
- };
- function _sfc_render$1O(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["u-cell", [_ctx.customClass]]),
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)]),
- "hover-class": !_ctx.disabled && (_ctx.clickable || _ctx.isLink) ? "u-cell--clickable" : "",
- "hover-stay-time": 250,
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-cell__body", [_ctx.center && "u-cell--center", _ctx.size === "large" && "u-cell__body--large"]])
- },
- [
- vue.createElementVNode("view", { class: "u-cell__body__content" }, [
- _ctx.$slots.icon || _ctx.icon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-cell__left-icon-wrap"
- }, [
- _ctx.$slots.icon ? vue.renderSlot(_ctx.$slots, "icon", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- name: _ctx.icon,
- "custom-style": _ctx.iconStyle,
- size: _ctx.size === "large" ? 22 : 18
- }, null, 8, ["name", "custom-style", "size"]))
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "u-cell__title" }, [
- vue.createCommentVNode(" 将slot与默认内容用if/else分开主要是因为微信小程序不支持slot嵌套传递,这样才能解决collapse组件的slot不失效问题,label暂时未用到。 "),
- _ctx.$slots.title || !_ctx.title ? vue.renderSlot(_ctx.$slots, "title", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: vue.normalizeClass(["u-cell__title-text", [_ctx.required && "u-cell--required", _ctx.disabled && "u-cell--disabled", _ctx.size === "large" && "u-cell__title-text--large"]]),
- style: vue.normalizeStyle([$options.titleTextStyle])
- },
- vue.toDisplayString(_ctx.title),
- 7
- /* TEXT, CLASS, STYLE */
- )),
- vue.renderSlot(_ctx.$slots, "label", {}, () => [
- _ctx.label ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["u-cell__label", [_ctx.disabled && "u-cell--disabled", _ctx.size === "large" && "u-cell__label--large"]])
- },
- vue.toDisplayString(_ctx.label),
- 3
- /* TEXT, CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ])
- ]),
- vue.renderSlot(_ctx.$slots, "value", {}, () => [
- !$options.testEmpty(_ctx.value) ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["u-cell__value", [_ctx.disabled && "u-cell--disabled", _ctx.size === "large" && "u-cell__value--large"]])
- },
- vue.toDisplayString(_ctx.value),
- 3
- /* TEXT, CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ], true),
- _ctx.$slots["right-icon"] || _ctx.isLink ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-cell__right-icon-wrap", [`u-cell__right-icon-wrap--${_ctx.arrowDirection}`]])
- },
- [
- _ctx.rightIcon && !_ctx.$slots["right-icon"] ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: _ctx.rightIcon,
- "custom-style": _ctx.rightIconStyle,
- color: _ctx.disabled ? "#c8c9cc" : "info",
- size: _ctx.size === "large" ? 18 : 16
- }, null, 8, ["name", "custom-style", "color", "size"])) : vue.renderSlot(_ctx.$slots, "right-icon", { key: 1 }, void 0, true)
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.$slots["righticon"] ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["u-cell__right-icon-wrap", [`u-cell__right-icon-wrap--${_ctx.arrowDirection}`]])
- },
- [
- vue.renderSlot(_ctx.$slots, "righticon", {}, void 0, true)
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- ),
- _ctx.border ? (vue.openBlock(), vue.createBlock(_component_u_line, { key: 0 })) : vue.createCommentVNode("v-if", true)
- ], 14, ["hover-class"]);
- }
- const __easycom_0$7 = /* @__PURE__ */ _export_sfc(_sfc_main$1P, [["render", _sfc_render$1O], ["__scopeId", "data-v-3fd6feca"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-cell/u-cell.vue"]]);
- const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$7
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1c = defineMixin({
- props: {
- // 标识符
- name: {
- type: String,
- default: () => props$1x.checkboxGroup.name
- },
- // 绑定的值
- modelValue: {
- type: Array,
- default: () => props$1x.checkboxGroup.value
- },
- // 形状,circle-圆形,square-方形
- shape: {
- type: String,
- default: () => props$1x.checkboxGroup.shape
- },
- // 是否禁用全部checkbox
- disabled: {
- type: Boolean,
- default: () => props$1x.checkboxGroup.disabled
- },
- // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
- activeColor: {
- type: String,
- default: () => props$1x.checkboxGroup.activeColor
- },
- // 未选中的颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.checkboxGroup.inactiveColor
- },
- // 整个组件的尺寸,默认px
- size: {
- type: [String, Number],
- default: () => props$1x.checkboxGroup.size
- },
- // 布局方式,row-横向,column-纵向
- placement: {
- type: String,
- default: () => props$1x.checkboxGroup.placement
- },
- // label的字体大小,px单位
- labelSize: {
- type: [String, Number],
- default: () => props$1x.checkboxGroup.labelSize
- },
- // label的字体颜色
- labelColor: {
- type: [String],
- default: () => props$1x.checkboxGroup.labelColor
- },
- // 是否禁止点击文本操作
- labelDisabled: {
- type: Boolean,
- default: () => props$1x.checkboxGroup.labelDisabled
- },
- // 图标颜色
- iconColor: {
- type: String,
- default: () => props$1x.checkboxGroup.iconColor
- },
- // 图标的大小,单位px
- iconSize: {
- type: [String, Number],
- default: () => props$1x.checkboxGroup.iconSize
- },
- // 勾选图标的对齐方式,left-左边,right-右边
- iconPlacement: {
- type: String,
- default: () => props$1x.checkboxGroup.iconPlacement
- },
- // 竖向配列时,是否显示下划线
- borderBottom: {
- type: Boolean,
- default: () => props$1x.checkboxGroup.borderBottom
- }
- }
- });
- const _sfc_main$1O = {
- name: "u-checkbox-group",
- mixins: [mpMixin, mixin, props$1c],
- computed: {
- // 这里computed的变量,都是子组件u-checkbox需要用到的,由于头条小程序的兼容性差异,子组件无法实时监听父组件参数的变化
- // 所以需要手动通知子组件,这里返回一个parentData变量,供watch监听,在其中去通知每一个子组件重新从父组件(u-checkbox-group)
- // 拉取父组件新的变化后的参数
- parentData() {
- return [
- this.modelValue,
- this.disabled,
- this.inactiveColor,
- this.activeColor,
- this.size,
- this.labelDisabled,
- this.shape,
- this.iconSize,
- this.borderBottom,
- this.placement
- ];
- },
- bemClass() {
- return this.bem("checkbox-group", ["placement"]);
- }
- },
- watch: {
- // 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
- parentData: {
- handler() {
- if (this.children.length) {
- this.children.map((child) => {
- typeof child.init === "function" && child.init();
- });
- }
- },
- deep: true
- }
- },
- data() {
- return {};
- },
- created() {
- this.children = [];
- },
- emits: ["update:modelValue", "change"],
- methods: {
- // 将其他的checkbox设置为未选中的状态
- unCheckedOther(childInstance) {
- const values = [];
- this.children.map((child) => {
- if (child.isChecked) {
- values.push(child.name);
- }
- });
- this.$emit("update:modelValue", values);
- this.$emit("change", values);
- }
- }
- };
- function _sfc_render$1N(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-checkbox-group", $options.bemClass])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 2
- /* CLASS */
- );
- }
- const uCheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1O, [["render", _sfc_render$1N], ["__scopeId", "data-v-ff0492f0"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group.vue"]]);
- const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCheckboxGroup
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1b = defineMixin({
- props: {
- // checkbox的名称
- name: {
- type: [String, Number, Boolean],
- default: () => props$1x.checkbox.name
- },
- // 形状,square为方形,circle为圆型
- shape: {
- type: String,
- default: () => props$1x.checkbox.shape
- },
- // 整体的大小
- size: {
- type: [String, Number],
- default: () => props$1x.checkbox.size
- },
- // 是否默认选中
- checked: {
- type: Boolean,
- default: () => props$1x.checkbox.checked
- },
- // 是否禁用
- disabled: {
- type: [String, Boolean],
- default: () => props$1x.checkbox.disabled
- },
- // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
- activeColor: {
- type: String,
- default: () => props$1x.checkbox.activeColor
- },
- // 未选中的颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.checkbox.inactiveColor
- },
- // 图标的大小,单位px
- iconSize: {
- type: [String, Number],
- default: () => props$1x.checkbox.iconSize
- },
- // 图标颜色
- iconColor: {
- type: String,
- default: () => props$1x.checkbox.iconColor
- },
- // label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式
- label: {
- type: [String, Number],
- default: () => props$1x.checkbox.label
- },
- // label的字体大小,px单位
- labelSize: {
- type: [String, Number],
- default: () => props$1x.checkbox.labelSize
- },
- // label的颜色
- labelColor: {
- type: String,
- default: () => props$1x.checkbox.labelColor
- },
- // 是否禁止点击提示语选中复选框
- labelDisabled: {
- type: [String, Boolean],
- default: () => props$1x.checkbox.labelDisabled
- },
- // 是否独立使用
- usedAlone: {
- type: [Boolean],
- default: () => false
- }
- }
- });
- const _sfc_main$1N = {
- name: "u-checkbox",
- mixins: [mpMixin, mixin, props$1b],
- data() {
- return {
- isChecked: false,
- // 父组件的默认值,因为头条小程序不支持在computed中使用this.parent.shape的形式
- // 故只能使用如此方法
- parentData: {
- iconSize: 12,
- labelDisabled: null,
- disabled: null,
- shape: "square",
- activeColor: null,
- inactiveColor: null,
- size: 18,
- modelValue: null,
- iconColor: null,
- placement: "row",
- borderBottom: false,
- iconPlacement: "left"
- }
- };
- },
- computed: {
- // 是否禁用,如果父组件u-radios-group禁用的话,将会忽略子组件的配置
- elDisabled() {
- return this.disabled !== "" ? this.disabled : this.parentData.disabled !== null ? this.parentData.disabled : false;
- },
- // 是否禁用label点击
- elLabelDisabled() {
- return this.labelDisabled !== "" ? this.labelDisabled : this.parentData.labelDisabled !== null ? this.parentData.labelDisabled : false;
- },
- // 组件尺寸,对应size的值,默认值为21px
- elSize() {
- return this.size ? this.size : this.parentData.size ? this.parentData.size : 21;
- },
- // 组件的勾选图标的尺寸,默认12px
- elIconSize() {
- return this.iconSize ? this.iconSize : this.parentData.iconSize ? this.parentData.iconSize : 12;
- },
- // 组件选中激活时的颜色
- elActiveColor() {
- return this.activeColor ? this.activeColor : this.parentData.activeColor ? this.parentData.activeColor : "#2979ff";
- },
- // 组件选未中激活时的颜色
- elInactiveColor() {
- return this.inactiveColor ? this.inactiveColor : this.parentData.inactiveColor ? this.parentData.inactiveColor : "#c8c9cc";
- },
- // label的颜色
- elLabelColor() {
- return this.labelColor ? this.labelColor : this.parentData.labelColor ? this.parentData.labelColor : "#606266";
- },
- // 组件的形状
- elShape() {
- return this.shape ? this.shape : this.parentData.shape ? this.parentData.shape : "circle";
- },
- // label大小
- elLabelSize() {
- return addUnit(this.labelSize ? this.labelSize : this.parentData.labelSize ? this.parentData.labelSize : "15");
- },
- elIconColor() {
- const iconColor = this.iconColor ? this.iconColor : this.parentData.iconColor ? this.parentData.iconColor : "#ffffff";
- if (this.elDisabled) {
- return this.isChecked ? this.elInactiveColor : "transparent";
- } else {
- return this.isChecked ? iconColor : "transparent";
- }
- },
- iconClasses() {
- let classes = [];
- classes.push("u-checkbox__icon-wrap--" + this.elShape);
- if (this.elDisabled) {
- classes.push("u-checkbox__icon-wrap--disabled");
- }
- if (this.isChecked && this.elDisabled) {
- classes.push("u-checkbox__icon-wrap--disabled--checked");
- }
- return classes;
- },
- iconWrapStyle() {
- const style = {};
- style.backgroundColor = this.isChecked && !this.elDisabled ? this.elActiveColor : "#ffffff";
- style.borderColor = this.isChecked && !this.elDisabled ? this.elActiveColor : this.elInactiveColor;
- style.width = addUnit(this.elSize);
- style.height = addUnit(this.elSize);
- if (!this.usedAlone) {
- if (this.parentData.iconPlacement === "right") {
- style.marginRight = 0;
- }
- }
- return style;
- },
- checkboxStyle() {
- const style = {};
- if (!this.usedAlone) {
- if (this.parentData.borderBottom && this.parentData.placement === "row") {
- error("检测到您将borderBottom设置为true,需要同时将up-checkbox-group的placement设置为column才有效");
- }
- if (this.parentData.borderBottom && this.parentData.placement === "column") {
- style.paddingBottom = "8px";
- }
- }
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- mounted() {
- this.init();
- },
- emits: ["change", "update:checked"],
- methods: {
- init() {
- if (!this.usedAlone) {
- this.updateParentData();
- if (!this.parent) {
- error("up-checkbox必须搭配up-checkbox-group组件使用");
- }
- const value2 = this.parentData.modelValue;
- if (this.checked) {
- this.isChecked = true;
- } else if (!this.usedAlone && test.array(value2)) {
- this.isChecked = value2.some((item) => {
- return item === this.name;
- });
- }
- } else {
- if (this.checked) {
- this.isChecked = true;
- }
- }
- },
- updateParentData() {
- this.getParentData("u-checkbox-group");
- },
- // 横向两端排列时,点击组件即可触发选中事件
- wrapperClickHandler(e2) {
- if (!this.usedAlone) {
- this.parentData.iconPlacement === "right" && this.iconClickHandler(e2);
- } else {
- this.iconClickHandler(e2);
- }
- },
- // 点击图标
- iconClickHandler(e2) {
- this.preventEvent(e2);
- if (!this.elDisabled) {
- this.setRadioCheckedStatus();
- }
- },
- // 点击label
- labelClickHandler(e2) {
- this.preventEvent(e2);
- if (!this.elLabelDisabled && !this.elDisabled) {
- this.setRadioCheckedStatus();
- }
- },
- emitEvent() {
- this.$emit("change", this.isChecked, {
- name: this.name
- });
- if (this.usedAlone) {
- this.$emit("update:checked", this.isChecked);
- }
- this.$nextTick(() => {
- formValidate(this, "change");
- });
- },
- // 改变组件选中状态
- // 这里的改变的依据是,更改本组件的checked值为true,同时通过父组件遍历所有u-checkbox实例
- // 将本组件外的其他u-checkbox的checked都设置为false(都被取消选中状态),因而只剩下一个为选中状态
- setRadioCheckedStatus() {
- this.isChecked = !this.isChecked;
- this.emitEvent();
- if (!this.usedAlone) {
- typeof this.parent.unCheckedOther === "function" && this.parent.unCheckedOther(this);
- }
- }
- },
- watch: {
- checked(newValue, oldValue) {
- if (newValue !== this.isChecked) {
- this.isChecked = newValue;
- }
- }
- }
- };
- function _sfc_render$1M(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-checkbox cursor-pointer", [`u-checkbox-label--${$data.parentData.iconPlacement}`, $data.parentData.borderBottom && $data.parentData.placement === "column" && "u-border-bottom"]]),
- style: vue.normalizeStyle([$options.checkboxStyle]),
- onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.wrapperClickHandler && $options.wrapperClickHandler(...args), ["stop"]))
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-checkbox__icon-wrap cursor-pointer", $options.iconClasses]),
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.iconClickHandler && $options.iconClickHandler(...args), ["stop"])),
- style: vue.normalizeStyle([$options.iconWrapStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "icon", {
- elIconSize: $options.elIconSize,
- elIconColor: $options.elIconColor
- }, () => [
- vue.createVNode(_component_up_icon, {
- class: "u-checkbox__icon-wrap__icon",
- name: "checkbox-mark",
- size: $options.elIconSize,
- color: $options.elIconColor
- }, null, 8, ["size", "color"])
- ], true)
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createElementVNode("view", {
- class: "u-checkbox__label-wrap cursor-pointer",
- onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.labelClickHandler && $options.labelClickHandler(...args), ["stop"]))
- }, [
- vue.renderSlot(_ctx.$slots, "label", {
- label: _ctx.label,
- elDisabled: $options.elDisabled
- }, () => [
- vue.createElementVNode(
- "text",
- {
- style: vue.normalizeStyle({
- color: $options.elDisabled ? $options.elInactiveColor : $options.elLabelColor,
- fontSize: $options.elLabelSize,
- lineHeight: $options.elLabelSize
- })
- },
- vue.toDisplayString(_ctx.label),
- 5
- /* TEXT, STYLE */
- )
- ], true)
- ])
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$1N, [["render", _sfc_render$1M], ["__scopeId", "data-v-41713600"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-checkbox/u-checkbox.vue"]]);
- const __vite_glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCheckbox
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1a = defineMixin({
- props: {
- percentage: {
- type: [String, Number],
- default: () => props$1x.circleProgress.percentage
- }
- }
- });
- const _sfc_main$1M = {
- name: "u-circle-progress",
- mixins: [mpMixin, mixin, props$1a],
- data() {
- return {
- leftBorderColor: "rgb(200, 200, 200)",
- rightBorderColor: "rgb(200, 200, 200)"
- };
- },
- computed: {
- leftSyle() {
- const style = {};
- style.borderTopColor = this.leftBorderColor;
- style.borderRightColor = this.leftBorderColor;
- return style;
- },
- rightSyle() {
- const style = {};
- style.borderLeftColor = this.rightBorderColor;
- style.borderBottomColor = this.rightBorderColor;
- return style;
- }
- },
- mounted() {
- sleep().then(() => {
- this.rightBorderColor = "rgb(66, 185, 131)";
- });
- },
- methods: {
- init() {
- animation.transition(this.$refs["right-circle"].ref, {
- styles: {
- transform: "rotate(45deg)",
- transformOrigin: "center center"
- }
- }, () => {
- this.rightBorderColor = "rgb(66, 185, 131)";
- });
- }
- }
- };
- function _sfc_render$1L(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-circle-progress" }, [
- vue.createElementVNode("view", { class: "u-circle-progress__left" }, [
- vue.createElementVNode(
- "view",
- {
- class: "u-circle-progress__left__circle",
- style: vue.normalizeStyle([$options.leftSyle]),
- ref: "left-circle"
- },
- null,
- 4
- /* STYLE */
- )
- ]),
- vue.createElementVNode("view", { class: "u-circle-progress__right" }, [
- vue.createElementVNode(
- "view",
- {
- class: "u-circle-progress__right__circle",
- ref: "right-circle",
- style: vue.normalizeStyle([$options.rightSyle])
- },
- null,
- 4
- /* STYLE */
- )
- ]),
- vue.createElementVNode("view", { class: "u-circle-progress__circle" })
- ]);
- }
- const uCircleProgress = /* @__PURE__ */ _export_sfc(_sfc_main$1M, [["render", _sfc_render$1L], ["__scopeId", "data-v-8379d4ea"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-circle-progress/u-circle-progress.vue"]]);
- const __vite_glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCircleProgress
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1L = {
- name: "u-city-locate",
- props: {
- indexList: {
- type: Array,
- default: ["🔥"]
- },
- cityList: {
- type: Array,
- default: () => {
- return [
- [
- {
- name: "北京",
- value: "beijing"
- },
- {
- name: "上海",
- value: "shanghai"
- },
- {
- name: "广州",
- value: "guangzhou"
- },
- {
- name: "深圳",
- value: "shenzhen"
- },
- {
- name: "杭州",
- value: "hangzhou"
- }
- ]
- ];
- }
- },
- locationType: {
- type: String,
- default: "wgs84"
- },
- currentCity: {
- type: String,
- default: ""
- },
- nameKey: {
- type: String,
- default: "name"
- }
- },
- computed: {},
- watch: {
- currentCity(val) {
- this.locationCity = val;
- }
- },
- data() {
- return {
- locationCity: t$1("up.cityLocate.locating") + "...."
- };
- },
- emits: ["location-success", "select-city"],
- methods: {
- t: t$1,
- // 获取城市
- selectedCity(city) {
- this.locationCity = city[this.nameKey];
- this.$emit("select-city", {
- locationCity: this.locationCity
- });
- },
- // 定位操作
- location() {
- let That = this;
- uni.getLocation({
- type: this.locationType,
- geocode: true,
- success(res) {
- formatAppLog("log", "at uni_modules/uview-plus/components/u-city-locate/u-city-locate.vue:120", res);
- That.locationCity = res.address && res.address.city;
- That.$emit("location-success", {
- ...res,
- locationCity: That.locationCity
- });
- },
- fail() {
- That.locationCity = t$1("up.cityLocate.fail");
- }
- });
- }
- },
- // 页面挂载后进行异步操作
- created() {
- },
- mounted() {
- this.location();
- }
- };
- function _sfc_render$1K(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_index_anchor = vue.resolveComponent("up-index-anchor");
- const _component_up_line = vue.resolveComponent("up-line");
- const _component_up_index_item = vue.resolveComponent("up-index-item");
- const _component_up_index_list = vue.resolveComponent("up-index-list");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-city-locate" }, [
- vue.createVNode(_component_up_index_list, { indexList: $props.indexList }, {
- header: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "u-current-city-wrap" }, [
- vue.createElementVNode(
- "view",
- { class: "u-current-city-title" },
- vue.toDisplayString($options.t("up.cityLocate.locateCity")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", {
- class: "u-current-city-item",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.location && $options.location(...args))
- }, [
- vue.createElementVNode(
- "view",
- { class: "u-location-city" },
- vue.toDisplayString($data.locationCity),
- 1
- /* TEXT */
- )
- ])
- ])
- ]),
- footer: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "u-safe-area-inset--bottom" }, [
- vue.createElementVNode("text", { class: "list__footer" })
- ])
- ]),
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.cityList, (item, index2) => {
- return vue.openBlock(), vue.createBlock(
- _component_up_index_item,
- { key: index2 },
- {
- default: vue.withCtx(() => [
- vue.createVNode(_component_up_index_anchor, {
- text: $props.indexList[index2]
- }, null, 8, ["text"]),
- index2 == 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "hot-city-list"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(item, (item1, index1) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "",
- onClick: ($event) => $options.selectedCity(item1)
- }, [
- vue.createElementVNode(
- "view",
- { class: "hot-city-item" },
- vue.toDisplayString(item1[$props.nameKey]),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"]);
- }),
- 256
- /* UNKEYED_FRAGMENT */
- ))
- ])) : (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- vue.renderList(item, (item1, index1) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "item-list",
- key: index1
- }, [
- vue.createElementVNode("view", {
- class: "list__item",
- onClick: ($event) => $options.selectedCity(item1)
- }, [
- vue.createElementVNode(
- "text",
- { class: "list__item__city-name" },
- vue.toDisplayString(item1[$props.nameKey]),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"]),
- vue.createVNode(_component_up_line)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["indexList"])
- ]);
- }
- const uCityLocate = /* @__PURE__ */ _export_sfc(_sfc_main$1L, [["render", _sfc_render$1K], ["__scopeId", "data-v-8eca2484"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-city-locate/u-city-locate.vue"]]);
- const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCityLocate
- }, Symbol.toStringTag, { value: "Module" }));
- const props$19 = defineMixin({
- props: {
- // 键盘弹起时,是否自动上推页面
- adjustPosition: {
- type: Boolean,
- default: () => props$1x.codeInput.adjustPosition
- },
- // 最大输入长度
- maxlength: {
- type: [String, Number],
- default: () => props$1x.codeInput.maxlength
- },
- // 是否用圆点填充
- dot: {
- type: Boolean,
- default: () => props$1x.codeInput.dot
- },
- // 显示模式,box-盒子模式,line-底部横线模式
- mode: {
- type: String,
- default: () => props$1x.codeInput.mode
- },
- // 是否细边框
- hairline: {
- type: Boolean,
- default: () => props$1x.codeInput.hairline
- },
- // 字符间的距离
- space: {
- type: [String, Number],
- default: () => props$1x.codeInput.space
- },
- // 预置值
- modelValue: {
- type: [String, Number],
- default: () => props$1x.codeInput.value
- },
- // 是否自动获取焦点
- focus: {
- type: Boolean,
- default: () => props$1x.codeInput.focus
- },
- // 字体是否加粗
- bold: {
- type: Boolean,
- default: () => props$1x.codeInput.bold
- },
- // 字体颜色
- color: {
- type: String,
- default: () => props$1x.codeInput.color
- },
- // 字体大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.codeInput.fontSize
- },
- // 输入框的大小,宽等于高
- size: {
- type: [String, Number],
- default: () => props$1x.codeInput.size
- },
- // 是否隐藏原生键盘,如果想用自定义键盘的话,需设置此参数为true
- disabledKeyboard: {
- type: Boolean,
- default: () => props$1x.codeInput.disabledKeyboard
- },
- // 边框和线条颜色
- borderColor: {
- type: String,
- default: () => props$1x.codeInput.borderColor
- },
- // 是否禁止输入"."符号
- disabledDot: {
- type: Boolean,
- default: () => props$1x.codeInput.disabledDot
- }
- }
- });
- const _sfc_main$1K = {
- name: "u-code-input",
- mixins: [mpMixin, mixin, props$19],
- data() {
- return {
- inputValue: "",
- isFocus: this.focus,
- timer: null,
- opacity: 1
- };
- },
- watch: {
- modelValue: {
- immediate: true,
- handler(val) {
- this.inputValue = String(val).substring(0, this.maxlength);
- }
- },
- isFocus: {
- handler(val) {
- }
- }
- },
- created() {
- },
- beforeUnmount() {
- },
- computed: {
- // 根据长度,循环输入框的个数,因为头条小程序数值不能用于v-for
- codeLength() {
- return new Array(Number(this.maxlength));
- },
- // 循环item的样式
- itemStyle() {
- return (index2) => {
- const style = {
- width: addUnit(this.size),
- height: addUnit(this.size)
- };
- if (this.mode === "box") {
- style.border = `${this.hairline ? 0.5 : 1}px solid ${this.borderColor}`;
- if (getPx(this.space) === 0) {
- if (index2 === 0) {
- style.borderTopLeftRadius = "3px";
- style.borderBottomLeftRadius = "3px";
- }
- if (index2 === this.codeLength.length - 1) {
- style.borderTopRightRadius = "3px";
- style.borderBottomRightRadius = "3px";
- }
- if (index2 !== this.codeLength.length - 1) {
- style.borderRight = "none";
- }
- }
- }
- if (index2 !== this.codeLength.length - 1) {
- style.marginRight = addUnit(this.space);
- } else {
- style.marginRight = 0;
- }
- return style;
- };
- },
- // 将输入的值,转为数组,给item历遍时,根据当前的索引显示数组的元素
- codeArray() {
- return String(this.inputValue).split("");
- },
- // 下划线模式下,横线的样式
- lineStyle() {
- const style = {};
- style.height = this.hairline ? "2px" : "4px";
- style.width = addUnit(this.size);
- style.backgroundColor = this.borderColor;
- return style;
- }
- },
- emits: ["change", "finish", "update:modelValue"],
- methods: {
- addUnit,
- // 监听输入框的值发生变化
- inputHandler(e2) {
- const value2 = e2.detail.value;
- this.inputValue = value2;
- if (this.disabledDot) {
- this.$nextTick(() => {
- this.inputValue = value2.replace(".", "");
- });
- }
- this.$emit("change", value2);
- this.$emit("update:modelValue", value2);
- if (String(value2).length >= Number(this.maxlength)) {
- this.$emit("finish", value2);
- }
- }
- }
- };
- function _sfc_render$1J(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-code-input" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.codeLength, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-code-input__item",
- style: vue.normalizeStyle([$options.itemStyle(index2)]),
- key: index2
- },
- [
- _ctx.dot && $options.codeArray.length > index2 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-code-input__item__dot"
- })) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- style: vue.normalizeStyle({
- fontSize: $options.addUnit(_ctx.fontSize),
- fontWeight: _ctx.bold ? "bold" : "normal",
- color: _ctx.color
- })
- },
- vue.toDisplayString($options.codeArray[index2]),
- 5
- /* TEXT, STYLE */
- )),
- _ctx.mode === "line" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "u-code-input__item__line",
- style: vue.normalizeStyle([$options.lineStyle])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $data.isFocus && $options.codeArray.length === index2 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 3,
- style: vue.normalizeStyle({ backgroundColor: _ctx.color }),
- class: "u-code-input__item__cursor"
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode("input", {
- disabled: _ctx.disabledKeyboard,
- type: "number",
- focus: _ctx.focus,
- value: $data.inputValue,
- maxlength: _ctx.maxlength,
- adjustPosition: _ctx.adjustPosition,
- class: "u-code-input__input",
- onInput: _cache[0] || (_cache[0] = (...args) => $options.inputHandler && $options.inputHandler(...args)),
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.size)
- }),
- onFocus: _cache[1] || (_cache[1] = ($event) => $data.isFocus = true),
- onBlur: _cache[2] || (_cache[2] = ($event) => $data.isFocus = false)
- }, null, 44, ["disabled", "focus", "value", "maxlength", "adjustPosition"])
- ]);
- }
- const uCodeInput = /* @__PURE__ */ _export_sfc(_sfc_main$1K, [["render", _sfc_render$1J], ["__scopeId", "data-v-10e44dac"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-code-input/u-code-input.vue"]]);
- const __vite_glob_0_22 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCodeInput
- }, Symbol.toStringTag, { value: "Module" }));
- const props$18 = defineMixin({
- props: {
- // 倒计时总秒数
- seconds: {
- type: [String, Number],
- default: () => props$1x.code.seconds
- },
- // 尚未开始时提示
- startText: {
- type: String,
- default: () => props$1x.code.startText
- },
- // 正在倒计时中的提示
- changeText: {
- type: String,
- default: () => props$1x.code.changeText
- },
- // 倒计时结束时的提示
- endText: {
- type: String,
- default: () => props$1x.code.endText
- },
- // 是否在H5刷新或各端返回再进入时继续倒计时
- keepRunning: {
- type: Boolean,
- default: () => props$1x.code.keepRunning
- },
- // 为了区分多个页面,或者一个页面多个倒计时组件本地存储的继续倒计时变了
- uniqueKey: {
- type: String,
- default: () => props$1x.code.uniqueKey
- }
- }
- });
- const _sfc_main$1J = {
- name: "u-code",
- mixins: [mpMixin, mixin, props$18],
- data() {
- return {
- secNum: this.seconds,
- timer: null,
- canGetCode: true
- // 是否可以执行验证码操作
- };
- },
- mounted() {
- this.checkKeepRunning();
- },
- watch: {
- seconds: {
- immediate: true,
- handler(n2) {
- this.secNum = n2;
- }
- }
- },
- emits: ["start", "end", "change"],
- methods: {
- checkKeepRunning() {
- let lastTimestamp = Number(uni.getStorageSync(this.uniqueKey + "_$uCountDownTimestamp"));
- if (!lastTimestamp)
- return this.changeEvent(this.startText);
- let nowTimestamp = Math.floor(+/* @__PURE__ */ new Date() / 1e3);
- if (this.keepRunning && lastTimestamp && lastTimestamp > nowTimestamp) {
- this.secNum = lastTimestamp - nowTimestamp;
- uni.removeStorageSync(this.uniqueKey + "_$uCountDownTimestamp");
- this.start();
- } else {
- this.changeEvent(this.startText);
- }
- },
- // 开始倒计时
- start() {
- if (this.timer) {
- clearInterval(this.timer);
- this.timer = null;
- }
- this.$emit("start");
- this.canGetCode = false;
- this.changeEvent(this.changeText.replace(/x|X/, this.secNum));
- this.timer = setInterval(() => {
- if (--this.secNum) {
- this.changeEvent(this.changeText.replace(/x|X/, this.secNum));
- } else {
- clearInterval(this.timer);
- this.timer = null;
- this.changeEvent(this.endText);
- this.secNum = this.seconds;
- this.$emit("end");
- this.canGetCode = true;
- }
- }, 1e3);
- this.setTimeToStorage();
- },
- // 重置,可以让用户再次获取验证码
- reset() {
- this.canGetCode = true;
- clearInterval(this.timer);
- this.secNum = this.seconds;
- this.changeEvent(this.endText);
- },
- changeEvent(text) {
- this.$emit("change", text);
- },
- // 保存时间戳,为了防止倒计时尚未结束,H5刷新或者各端的右上角返回上一页再进来
- setTimeToStorage() {
- if (!this.keepRunning || !this.timer)
- return;
- if (this.secNum > 0 && this.secNum <= this.seconds) {
- let nowTimestamp = Math.floor(+/* @__PURE__ */ new Date() / 1e3);
- uni.setStorage({
- key: this.uniqueKey + "_$uCountDownTimestamp",
- data: nowTimestamp + Number(this.secNum)
- });
- }
- }
- },
- // 组件销毁的时候,清除定时器,否则定时器会继续存在,系统不会自动清除
- beforeUnmount() {
- this.setTimeToStorage();
- clearTimeout(this.timer);
- this.timer = null;
- }
- };
- function _sfc_render$1I(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-code" }, [
- vue.createCommentVNode(" 此组件功能由js完成,无需写html逻辑 ")
- ]);
- }
- const uCode = /* @__PURE__ */ _export_sfc(_sfc_main$1J, [["render", _sfc_render$1I], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-code/u-code.vue"]]);
- const __vite_glob_0_23 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCode
- }, Symbol.toStringTag, { value: "Module" }));
- const props$17 = defineMixin({
- props: {
- // 占父容器宽度的多少等分,总分为12份
- span: {
- type: [String, Number],
- default: () => props$1x.col.span
- },
- // 指定栅格左侧的间隔数(总12栏)
- offset: {
- type: [String, Number],
- default: () => props$1x.col.offset
- },
- // 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
- justify: {
- type: String,
- default: () => props$1x.col.justify
- },
- // 垂直对齐方式,可选值为top、center、bottom、stretch
- align: {
- type: String,
- default: () => props$1x.col.align
- },
- // 文字对齐方式
- textAlign: {
- type: String,
- default: () => props$1x.col.textAlign
- }
- }
- });
- const _sfc_main$1I = {
- name: "u-col",
- mixins: [mpMixin, mixin, props$17],
- data() {
- return {
- width: 0,
- parentData: {
- gutter: 0
- },
- gridNum: 12
- };
- },
- // 微信小程序中 options 选项
- options: {
- virtualHost: true
- // 将自定义节点设置成虚拟的,更加接近Vue组件的表现。我们不希望自定义组件的这个节点本身可以设置样式、响应 flex 布局等
- },
- computed: {
- uJustify() {
- if (this.justify == "end" || this.justify == "start")
- return "flex-" + this.justify;
- else if (this.justify == "around" || this.justify == "between")
- return "space-" + this.justify;
- else
- return this.justify;
- },
- uAlignItem() {
- if (this.align == "top")
- return "flex-start";
- if (this.align == "bottom")
- return "flex-end";
- else
- return this.align;
- },
- colStyle() {
- const style = {
- // 这里写成"padding: 0 10px"的形式是因为nvue的需要
- paddingLeft: addUnit(getPx(this.parentData.gutter) / 2),
- paddingRight: addUnit(getPx(this.parentData.gutter) / 2),
- alignItems: this.uAlignItem,
- justifyContent: this.uJustify,
- textAlign: this.textAlign,
- // 在非nvue上,使用百分比形式
- flex: `0 0 ${100 / this.gridNum * this.span}%`,
- marginLeft: 100 / 12 * this.offset + "%"
- };
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- mounted() {
- this.init();
- },
- emits: ["click"],
- methods: {
- async init() {
- this.updateParentData();
- this.width = await this.parent.getComponentWidth();
- },
- updateParentData() {
- this.getParentData("u-row");
- },
- clickHandler(e2) {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$1H(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-col", [
- "u-col-" + _ctx.span
- ]]),
- ref: "u-col",
- style: vue.normalizeStyle([$options.colStyle]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uCol = /* @__PURE__ */ _export_sfc(_sfc_main$1I, [["render", _sfc_render$1H], ["__scopeId", "data-v-2ae1a870"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-col/u-col.vue"]]);
- const __vite_glob_0_24 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCol
- }, Symbol.toStringTag, { value: "Module" }));
- const props$16 = defineMixin({
- props: {
- // 标题
- title: {
- type: String,
- default: () => props$1x.collapseItem.title
- },
- // 标题的样式
- titleStyle: {
- type: [Object, String],
- default: () => {
- return props$1x.collapseItem.titleStyle;
- }
- },
- // 标题右侧内容
- value: {
- type: String,
- default: () => props$1x.collapseItem.value
- },
- // 标题下方的描述信息
- label: {
- type: String,
- default: () => props$1x.collapseItem.label
- },
- // 是否禁用折叠面板
- disabled: {
- type: Boolean,
- default: () => props$1x.collapseItem.disabled
- },
- // 是否展示右侧箭头并开启点击反馈
- isLink: {
- type: Boolean,
- default: () => props$1x.collapseItem.isLink
- },
- // 是否开启点击反馈
- clickable: {
- type: Boolean,
- default: () => props$1x.collapseItem.clickable
- },
- // 是否显示内边框
- border: {
- type: Boolean,
- default: () => props$1x.collapseItem.border
- },
- // 标题的对齐方式
- align: {
- type: String,
- default: () => props$1x.collapseItem.align
- },
- // 唯一标识符
- name: {
- type: [String, Number],
- default: () => props$1x.collapseItem.name
- },
- // 标题左侧图片,可为绝对路径的图片或内置图标
- icon: {
- type: String,
- default: () => props$1x.collapseItem.icon
- },
- // 面板展开收起的过渡时间,单位ms
- duration: {
- type: Number,
- default: () => props$1x.collapseItem.duration
- },
- // 显示右侧图标
- showRight: {
- type: Boolean,
- default: () => props$1x.collapseItem.showRight
- },
- // 左侧图标样式
- iconStyle: {
- type: [Object, String],
- default: () => {
- return props$1x.collapseItem.iconStyle;
- }
- },
- // 右侧箭头图标的样式
- rightIconStyle: {
- type: [Object, String],
- default: () => {
- return props$1x.collapseItem.rightIconStyle;
- }
- },
- cellCustomStyle: {
- type: [Object, String],
- default: () => {
- return props$1x.collapseItem.cellCustomStyle;
- }
- },
- cellCustomClass: {
- type: String,
- default: () => props$1x.collapseItem.cellCustomClass
- }
- }
- });
- const _sfc_main$1H = {
- name: "u-collapse-item",
- mixins: [mpMixin, mixin, props$16],
- data() {
- return {
- elId: guid(),
- // uni.createAnimation的导出数据
- animationData: {},
- // 是否展开状态
- expanded: false,
- // 根据expanded确定是否显示border,为了控制展开时,cell的下划线更好的显示效果,进行一定时间的延时
- showBorder: false,
- // 是否动画中,如果是则不允许继续触发点击
- animating: false,
- // 父组件u-collapse的参数
- parentData: {
- accordion: false,
- border: false
- }
- };
- },
- watch: {
- expanded(n2) {
- clearTimeout(this.timer);
- this.timer = null;
- this.timer = setTimeout(() => {
- this.showBorder = n2;
- }, n2 ? 10 : 290);
- }
- },
- mounted() {
- this.init();
- },
- methods: {
- // 异步获取内容,或者动态修改了内容时,需要重新初始化
- async init() {
- this.updateParentData();
- if (!this.parent) {
- return error("u-collapse-item必须要搭配u-collapse组件使用");
- }
- const {
- value: value2,
- accordion,
- children = []
- } = this.parent;
- if (accordion) {
- if (test.array(value2)) {
- return error("手风琴模式下,u-collapse组件的value参数不能为数组");
- }
- this.expanded = this.name == value2;
- } else {
- if (!test.array(value2) && value2 !== null) {
- return error("非手风琴模式下,u-collapse组件的value参数必须为数组");
- }
- this.expanded = (value2 || []).some((item) => item == this.name);
- }
- await vue.nextTick();
- this.setContentAnimate();
- },
- updateParentData() {
- this.getParentData("u-collapse");
- },
- async setContentAnimate() {
- const rect = await this.queryRect();
- const height = this.expanded ? rect.height : 0;
- this.animating = true;
- const animation2 = uni.createAnimation({
- timingFunction: "ease-in-out"
- });
- animation2.height(height).step({
- duration: this.duration
- }).step();
- this.animationData = animation2.export();
- sleep(this.duration).then(() => {
- this.animating = false;
- });
- },
- // 点击collapsehead头部
- clickHandler() {
- if (this.disabled && this.animating)
- return;
- this.parent && this.parent.onChange(this);
- },
- // 查询内容高度
- queryRect() {
- return new Promise((resolve) => {
- this.$uGetRect(`#${this.elId}`).then((size) => {
- resolve(size);
- });
- });
- }
- }
- };
- function _sfc_render$1G(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_cell = resolveEasycom(vue.resolveDynamicComponent("u-cell"), __easycom_0$7);
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-collapse-item" }, [
- vue.createVNode(_component_u_cell, {
- title: _ctx.$slots.title ? "" : _ctx.title,
- value: _ctx.value,
- label: _ctx.label,
- icon: _ctx.icon,
- isLink: _ctx.isLink,
- clickable: _ctx.clickable,
- border: $data.parentData.border && $data.showBorder,
- onClick: $options.clickHandler,
- arrowDirection: $data.expanded ? "up" : "down",
- disabled: _ctx.disabled,
- customClass: _ctx.cellCustomClass,
- customStyle: _ctx.cellCustomStyle
- }, {
- title: vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "title", {}, () => [
- !_ctx.$slots.title && _ctx.title ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 0 },
- vue.toDisplayString(_ctx.title),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ]),
- icon: vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "icon", {}, () => [
- !_ctx.$slots.icon && _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- size: 22,
- name: _ctx.icon
- }, null, 8, ["name"])) : vue.createCommentVNode("v-if", true)
- ], true)
- ]),
- value: vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "value", {}, () => [
- !_ctx.$slots.value && _ctx.value ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 0 },
- vue.toDisplayString(_ctx.value),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ]),
- "right-icon": vue.withCtx(() => [
- _ctx.showRight ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- !_ctx.$slots["right-icon"] ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- size: 16,
- name: "arrow-right"
- })) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "right-icon", {}, void 0, true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["title", "value", "label", "icon", "isLink", "clickable", "border", "onClick", "arrowDirection", "disabled", "customClass", "customStyle"]),
- vue.createElementVNode("view", {
- class: "u-collapse-item__content",
- animation: $data.animationData,
- ref: "animation"
- }, [
- vue.createElementVNode("view", {
- class: "u-collapse-item__content__text content-class",
- id: $data.elId,
- ref: $data.elId
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ], 8, ["id"])
- ], 8, ["animation"]),
- $data.parentData.border ? (vue.openBlock(), vue.createBlock(_component_u_line, { key: 0 })) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const uCollapseItem = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["render", _sfc_render$1G], ["__scopeId", "data-v-82f3baf9"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-collapse-item/u-collapse-item.vue"]]);
- const __vite_glob_0_25 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCollapseItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$15 = defineMixin({
- props: {
- // 当前展开面板的name,非手风琴模式:[<string | number>],手风琴模式:string | number
- value: {
- type: [String, Number, Array, null],
- default: () => props$1x.collapse.value
- },
- // 是否手风琴模式
- accordion: {
- type: Boolean,
- default: () => props$1x.collapse.accordion
- },
- // 是否显示外边框
- border: {
- type: Boolean,
- default: () => props$1x.collapse.border
- }
- }
- });
- const _sfc_main$1G = {
- name: "u-collapse",
- mixins: [mpMixin, mixin, props$15],
- watch: {
- needInit() {
- this.init();
- },
- // 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
- parentData() {
- if (this.children.length) {
- this.children.map((child) => {
- typeof child.updateParentData === "function" && child.updateParentData();
- });
- }
- }
- },
- created() {
- this.children = [];
- },
- computed: {
- needInit() {
- return [this.accordion, this.value];
- }
- },
- emits: ["open", "close", "change"],
- methods: {
- // 重新初始化一次内部的所有子元素
- init() {
- this.children.map((child) => {
- child.init();
- });
- },
- /**
- * collapse-item被点击时触发,由collapse统一处理各子组件的状态
- * @param {Object} target 被操作的面板的实例
- */
- onChange(target) {
- let changeArr = [];
- this.children.map((child, index2) => {
- if (this.accordion) {
- child.expanded = child === target ? !target.expanded : false;
- child.setContentAnimate();
- } else {
- if (child === target) {
- child.expanded = !child.expanded;
- child.setContentAnimate();
- }
- }
- changeArr.push({
- // 如果没有定义name属性,则默认返回组件的index索引
- name: child.name || index2,
- status: child.expanded ? "open" : "close"
- });
- });
- this.$emit("change", changeArr);
- this.$emit(target.expanded ? "open" : "close", target.name);
- }
- }
- };
- function _sfc_render$1F(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-collapse" }, [
- _ctx.border ? (vue.openBlock(), vue.createBlock(_component_u_line, { key: 0 })) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default")
- ]);
- }
- const uCollapse = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["render", _sfc_render$1F], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-collapse/u-collapse.vue"]]);
- const __vite_glob_0_26 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCollapse
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1F = {
- name: "up-color-picker",
- props: {
- // 初始颜色值
- modelValue: {
- type: String,
- default: "#ff0000"
- },
- // 常用颜色列表
- commonColors: {
- type: Array,
- default: () => []
- }
- },
- data() {
- return {
- show: false,
- // 颜色类型索引:0-纯色,1-渐变色
- colorTypeIndex: 0,
- // 纯色相关数据
- hue: 0,
- saturation: 100,
- lightness: 50,
- alpha: 1,
- saturationPosition: { x: 150, y: 0 },
- huePosition: 0,
- alphaPosition: 0,
- // 将在initColor中设置为最右侧
- // 渐变色相关数据
- gradientColors: [
- { color: "#ff0000", percent: 0 },
- { color: "#0000ff", percent: 1 }
- ],
- gradientDirections: [
- { label: "从左到右", value: "to right" },
- { label: "从上到下", value: "to bottom" },
- { label: "从左上到右下", value: "to bottom right" },
- { label: "从右上到左下", value: "to bottom left" }
- ],
- currentDirection: { label: "从左到右", value: "to right" },
- showDirectionPicker: false,
- // 当前选中颜色
- currentColor: "#ff0000",
- // 渐变色控制相关
- draggingPointerIndex: -1,
- directionPointer: { x: 20, y: 20 },
- // 默认向右(在圆的右侧)
- // 渐变节点颜色修改相关
- editingGradientIndex: -1,
- // 保存纯色和渐变色的各自状态
- solidColorState: {
- hue: 0,
- saturation: 100,
- lightness: 50,
- alpha: 1,
- saturationPosition: { x: 150, y: 0 },
- huePosition: 0,
- alphaPosition: 0,
- // 将在initColor中设置为最右侧
- currentColor: "#ff0000"
- },
- gradientColorState: {
- gradientColors: [
- { color: "#ff0000", percent: 0 },
- { color: "#0000ff", percent: 1 }
- ],
- currentDirection: { label: "从左到右", value: "to right" },
- directionPointer: { x: 100, y: 0 }
- },
- // 区分预览类型:solid-纯色预览,gradient-整体渐变预览,gradient-point-渐变点预览
- previewType: "solid"
- };
- },
- computed: {
- // 渐变色样式
- gradientStyle() {
- const colors = this.gradientColors.map((item) => `${item.color} ${Math.round(item.percent * 100)}%`).join(", ");
- return `linear-gradient(${this.currentDirection.value}, ${colors})`;
- },
- // 显示的颜色预览值
- displayColor() {
- if (this.previewType === "gradient-point" && this.editingGradientIndex >= 0) {
- return this.gradientColors[this.editingGradientIndex].color;
- }
- formatAppLog("log", "at uni_modules/uview-plus/components/u-color-picker/u-color-picker.vue:251", this.editingGradientIndex);
- return this.currentColor;
- }
- },
- watch: {
- show(newVal) {
- if (newVal) {
- this.initColor();
- }
- },
- colorTypeIndex(newVal) {
- if (newVal == 0) {
- this.editingGradientIndex = -1;
- }
- }
- },
- mounted() {
- this.initColor();
- },
- emits: ["update:modelValue", "confirm", "close"],
- methods: {
- // 初始化颜色
- initColor() {
- if (this.modelValue) {
- this.currentColor = this.modelValue;
- if (this.modelValue.includes("linear-gradient")) {
- this.colorTypeIndex = 1;
- this.parseGradientColor(this.modelValue);
- this.previewType = "gradient";
- } else {
- this.colorTypeIndex = 0;
- this.parseSolidColor(this.modelValue);
- this.previewType = "solid";
- }
- }
- this.initDirectionPointer();
- this.initAlphaPosition();
- },
- // 初始化alpha位置为最右侧
- async initAlphaPosition() {
- const query = uni.createSelectorQuery().in(this);
- query.select(".up-color-picker__alpha").boundingClientRect();
- await this.$nextTick();
- query.exec((res) => {
- const rect = res[0];
- if (rect) {
- this.alphaPosition = rect.width || 150;
- } else {
- this.alphaPosition = 150;
- }
- this.solidColorState.alphaPosition = this.alphaPosition;
- this.updateSolidColor();
- });
- },
- // 初始化方向指针位置
- initDirectionPointer() {
- const angle = this.getDirectionAngle(this.currentDirection.value);
- this.setDirectionPointerByAngle(angle);
- },
- // 根据方向值获取角度
- getDirectionAngle(direction) {
- switch (direction) {
- case "to right":
- return 0;
- case "to bottom":
- return 90;
- case "to left":
- return 180;
- case "to top":
- return 270;
- case "to bottom right":
- return 45;
- case "to bottom left":
- return 135;
- case "to top left":
- return 225;
- case "to top right":
- return 315;
- default:
- return 0;
- }
- },
- // 根据角度设置方向指针位置
- setDirectionPointerByAngle(angle) {
- const radian = angle * Math.PI / 180;
- const radius = 20;
- this.directionPointer = {
- x: radius * Math.cos(radian) + 20,
- // 20是圆心位置
- y: radius * Math.sin(radian) + 20
- };
- },
- // 打开颜色选择器以修改渐变节点颜色
- openColorPickerForGradient(index2) {
- this.editingGradientIndex = index2;
- const color2 = this.gradientColors[index2].color;
- this.currentColor = color2;
- this.previewType = "gradient-point";
- if (!color2.includes("linear-gradient")) {
- this.colorTypeIndex = 0;
- this.parseSolidColor(color2);
- this.gradientColorState = {
- gradientColors: [...this.gradientColors],
- currentDirection: { ...this.currentDirection },
- directionPointer: { ...this.directionPointer }
- };
- }
- },
- // 解析纯色
- parseSolidColor(color2) {
- this.currentColor = color2;
- if (this.editingGradientIndex >= 0) {
- this.gradientColors[this.editingGradientIndex].color = color2;
- this.colorTypeIndex = 1;
- Object.assign(this, this.solidColorState);
- this.previewType = "gradient-point";
- } else {
- this.previewType = "solid";
- }
- },
- // 解析渐变色
- parseGradientColor(gradient) {
- this.currentColor = gradient;
- },
- // 切换颜色类型
- changeColorType(index2) {
- if (this.colorTypeIndex === 0) {
- this.solidColorState = {
- hue: this.hue,
- saturation: this.saturation,
- lightness: this.lightness,
- alpha: this.alpha,
- saturationPosition: { ...this.saturationPosition },
- huePosition: this.huePosition,
- alphaPosition: this.alphaPosition,
- currentColor: this.currentColor
- };
- } else {
- this.gradientColorState = {
- gradientColors: [...this.gradientColors],
- currentDirection: { ...this.currentDirection },
- directionPointer: { ...this.directionPointer }
- };
- }
- this.colorTypeIndex = index2;
- if (index2 === 0) {
- Object.assign(this, this.solidColorState);
- this.previewType = "solid";
- } else {
- Object.assign(this, this.gradientColorState);
- this.gradientColors = [...this.gradientColorState.gradientColors];
- this.previewType = "gradient";
- }
- },
- // 饱和度和明度触摸开始
- onSaturationTouchStart(e2) {
- this.updateSaturationPosition(e2);
- },
- // 饱和度和明度触摸移动
- onSaturationTouchMove(e2) {
- this.updateSaturationPosition(e2);
- },
- // 饱和度和明度触摸结束
- onSaturationTouchEnd(e2) {
- this.updateSaturationPosition(e2);
- },
- // 更新饱和度和明度位置
- updateSaturationPosition(e2) {
- const touch = e2.touches[0] || e2.changedTouches[0];
- e2.currentTarget;
- const query = uni.createSelectorQuery().in(this);
- query.select(".up-color-picker__saturation").boundingClientRect();
- query.exec((res) => {
- const rect = res[0];
- if (rect) {
- let x2 = touch.clientX - rect.left;
- let y2 = touch.clientY - rect.top;
- x2 = Math.max(0, Math.min(x2, rect.width));
- y2 = Math.max(0, Math.min(y2, rect.height));
- this.saturationPosition = { x: x2, y: y2 };
- this.updateSolidColor();
- }
- });
- },
- // 色相触摸开始
- onHueTouchStart(e2) {
- this.updateHuePosition(e2);
- },
- // 色相触摸移动
- onHueTouchMove(e2) {
- this.updateHuePosition(e2);
- },
- // 色相触摸结束
- onHueTouchEnd(e2) {
- this.updateHuePosition(e2);
- },
- // 更新色相位置
- updateHuePosition(e2) {
- const touch = e2.touches[0] || e2.changedTouches[0];
- e2.currentTarget;
- const query = uni.createSelectorQuery().in(this);
- query.select(".up-color-picker__hue").boundingClientRect();
- query.exec((res) => {
- const rect = res[0];
- if (rect) {
- let x2 = touch.clientX - rect.left;
- x2 = Math.max(0, Math.min(x2, rect.width));
- this.huePosition = x2;
- this.hue = Math.round(x2 / rect.width * 360);
- this.updateSolidColor();
- }
- });
- },
- // 透明度触摸开始
- onAlphaTouchStart(e2) {
- this.updateAlphaPosition(e2);
- },
- // 透明度触摸移动
- onAlphaTouchMove(e2) {
- this.updateAlphaPosition(e2);
- },
- // 透明度触摸结束
- onAlphaTouchEnd(e2) {
- this.updateAlphaPosition(e2);
- },
- // 更新透明度位置
- updateAlphaPosition(e2) {
- const touch = e2.touches[0] || e2.changedTouches[0];
- e2.currentTarget;
- const query = uni.createSelectorQuery().in(this);
- query.select(".up-color-picker__alpha").boundingClientRect();
- query.exec((res) => {
- const rect = res[0];
- if (rect) {
- let x2 = touch.clientX - rect.left;
- x2 = Math.max(0, Math.min(x2, rect.width));
- this.alphaPosition = x2;
- this.alpha = x2 / rect.width;
- this.updateSolidColor();
- }
- });
- },
- // 更新纯色
- updateSolidColor() {
- const query = uni.createSelectorQuery().in(this);
- query.select(".up-color-picker__saturation").boundingClientRect();
- query.exec((res) => {
- const rect = res[0];
- const size = rect ? Math.min(rect.width, rect.height) : 150;
- const s2 = this.saturationPosition.x / size * 100;
- const l2 = 100 - this.saturationPosition.y / size * 100;
- this.saturation = s2;
- this.lightness = l2;
- if (this.colorTypeIndex == 0) {
- this.currentColor = this.hslToRgb(this.hue, this.saturation, this.lightness, this.alpha);
- } else if (this.colorTypeIndex == 1) {
- this.gradientColors[this.editingGradientIndex].color = this.hslToRgb(this.hue, this.saturation, this.lightness, this.alpha);
- }
- });
- },
- // 添加渐变色
- addGradientColor() {
- if (this.gradientColors.length < 5) {
- this.gradientColors.push({
- color: "#ffffff",
- percent: 1
- });
- }
- },
- // 删除渐变色
- removeGradientColor(index2) {
- if (this.gradientColors.length > 2) {
- this.gradientColors.splice(index2, 1);
- }
- },
- // 获取渐变控制点位置
- getGradientPointerPosition(index2) {
- const trackWidth = 280;
- return this.gradientColors[index2].percent * trackWidth;
- },
- // 更新渐变色
- updateGradientColor(e2) {
- const touch = e2.touches[0] || e2.changedTouches[0];
- const query = uni.createSelectorQuery().in(this);
- query.select(".up-color-picker__gradient-track").boundingClientRect();
- query.exec((res) => {
- const rect = res[0];
- if (rect) {
- let x2 = touch.clientX - rect.left;
- x2 = Math.max(0, Math.min(x2, rect.width));
- const percent = x2 / rect.width;
- if (this.draggingPointerIndex >= 0) {
- this.gradientColors[this.draggingPointerIndex].percent = percent;
- this.gradientColors.sort((a2, b2) => a2.percent - b2.percent);
- }
- }
- });
- },
- // 控制点触摸开始
- onPointerTouchStart(e2, index2) {
- this.draggingPointerIndex = index2;
- this.currentColor = this.gradientColors[index2].color;
- this.previewType = "gradient-point";
- this.editingGradientIndex = index2;
- e2.stopPropagation();
- },
- // 控制点触摸移动
- onPointerTouchMove(e2) {
- if (this.draggingPointerIndex === -1)
- return;
- const touch = e2.touches[0] || e2.changedTouches[0];
- const query = uni.createSelectorQuery().in(this);
- query.select(".up-color-picker__gradient-track").boundingClientRect();
- query.exec((res) => {
- const rect = res[0];
- if (rect) {
- let x2 = touch.clientX - rect.left;
- x2 = Math.max(0, Math.min(x2, rect.width));
- let percent = x2 / rect.width;
- if (x2 === 0)
- percent = 0;
- if (x2 === rect.width)
- percent = 1;
- this.gradientColors[this.draggingPointerIndex].percent = percent;
- this.gradientColors.sort((a2, b2) => a2.percent - b2.percent);
- this.draggingPointerIndex = this.gradientColors.findIndex((item, index2) => {
- return Math.abs(item.percent - percent) < 1e-4;
- });
- }
- });
- },
- // 控制点触摸结束
- onPointerTouchEnd() {
- this.draggingPointerIndex = -1;
- },
- // 方向选择器触摸开始
- onDirectionTouchStart(e2) {
- this.updateDirection(e2);
- },
- // 方向选择器触摸移动
- onDirectionTouchMove(e2) {
- this.updateDirection(e2);
- },
- // 方向选择器触摸结束
- onDirectionTouchEnd(e2) {
- this.updateDirection(e2);
- },
- // 更新方向
- updateDirection(e2) {
- const touch = e2.touches[0] || e2.changedTouches[0];
- const query = uni.createSelectorQuery().in(this);
- query.select(".up-color-picker__gradient__direction-circle").boundingClientRect();
- query.exec((res) => {
- const rect = res[0];
- if (rect) {
- const centerX = rect.left + rect.width / 2;
- const centerY = rect.top + rect.height / 2;
- const x2 = touch.clientX - centerX;
- const y2 = touch.clientY - centerY;
- const distance = Math.sqrt(x2 * x2 + y2 * y2);
- const maxDistance = rect.width / 2;
- if (distance <= maxDistance) {
- this.directionPointer = {
- x: x2 + rect.width / 2,
- y: y2 + rect.height / 2
- };
- } else {
- const ratio = maxDistance / distance;
- this.directionPointer = {
- x: x2 * ratio + rect.width / 2,
- y: y2 * ratio + rect.height / 2
- };
- }
- const angle = Math.atan2(y2, x2) * 180 / Math.PI;
- formatAppLog("log", "at uni_modules/uview-plus/components/u-color-picker/u-color-picker.vue:704", angle);
- this.updateGradientDirection(angle);
- }
- });
- },
- // 根据角度更新渐变方向
- updateGradientDirection(angle) {
- if (angle < 0)
- angle += 360;
- if (angle >= 315 || angle < 45) {
- this.currentDirection = { label: "从左到右", value: "to right" };
- } else if (angle >= 45 && angle < 135) {
- this.currentDirection = { label: "从上到下", value: "to bottom" };
- } else if (angle >= 135 && angle < 225) {
- this.currentDirection = { label: "从右到左", value: "to left" };
- } else {
- this.currentDirection = { label: "从下到上", value: "to top" };
- }
- },
- // 确认方向选择
- confirmDirection(e2) {
- this.currentDirection = this.gradientDirections[e2.index];
- this.showDirectionPicker = false;
- },
- // 选择常用颜色
- selectCommonColor(color2) {
- this.currentColor = color2;
- if (this.colorTypeIndex === 0) {
- this.parseSolidColor(color2);
- } else {
- this.gradientColors[this.editingGradientIndex].color = color2;
- }
- },
- // 确认选择
- confirm() {
- let color2 = this.currentColor;
- if (this.colorTypeIndex === 1) {
- color2 = this.gradientStyle;
- }
- this.$emit("update:modelValue", color2);
- this.show = false;
- this.$emit("confirm", color2);
- this.editingGradientIndex = -1;
- this.previewType = this.colorTypeIndex === 0 ? "solid" : "gradient";
- this.close();
- },
- // 关闭选择器
- close() {
- this.show = false;
- this.$emit("close");
- },
- // HSL转RGB辅助函数
- hslToRgb(h2, s2, l2, a2 = 1) {
- h2 = h2 / 360;
- s2 = s2 / 100;
- l2 = l2 / 100;
- let r2, g2, b2;
- if (s2 === 0) {
- r2 = g2 = b2 = l2;
- } else {
- const hue2rgb = (p3, q3, t2) => {
- if (t2 < 0)
- t2 += 1;
- if (t2 > 1)
- t2 -= 1;
- if (t2 < 1 / 6)
- return p3 + (q3 - p3) * 6 * t2;
- if (t2 < 1 / 2)
- return q3;
- if (t2 < 2 / 3)
- return p3 + (q3 - p3) * (2 / 3 - t2) * 6;
- return p3;
- };
- const q2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2;
- const p2 = 2 * l2 - q2;
- r2 = hue2rgb(p2, q2, h2 + 1 / 3);
- g2 = hue2rgb(p2, q2, h2);
- b2 = hue2rgb(p2, q2, h2 - 1 / 3);
- }
- const round2 = (value2) => Math.round(value2 * 255);
- return `rgba(${round2(r2)}, ${round2(g2)}, ${round2(b2)}, ${a2.toFixed(2)})`;
- }
- }
- };
- function _sfc_render$1E(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_subsection = vue.resolveComponent("up-subsection");
- const _component_up_button = vue.resolveComponent("up-button");
- const _component_up_popup = vue.resolveComponent("up-popup");
- return vue.openBlock(), vue.createElementBlock("view", { class: "up-color-picker" }, [
- vue.createElementVNode(
- "view",
- {
- clas: "up-color-picker__trigger",
- onClick: _cache[0] || (_cache[0] = ($event) => $data.show = true),
- style: vue.normalizeStyle({ backgroundColor: _ctx.value })
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 4
- /* STYLE */
- ),
- vue.createVNode(_component_up_popup, {
- show: $data.show,
- mode: "bottom",
- round: "10",
- onClose: $options.close,
- closeOnClickOverlay: true
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "up-color-picker__content" }, [
- vue.createElementVNode("view", { class: "up-color-picker__header" }, [
- vue.createElementVNode("text", { class: "up-color-picker__title" }, "选择颜色")
- ]),
- vue.createCommentVNode(" 纯色/渐变色切换 "),
- vue.createElementVNode("view", { class: "up-color-picker__switch" }, [
- vue.createVNode(_component_up_subsection, {
- list: [{ name: "纯色" }, { name: "渐变" }],
- current: $data.colorTypeIndex,
- onChange: $options.changeColorType,
- fontSize: "14"
- }, null, 8, ["current", "onChange"])
- ]),
- vue.createCommentVNode(" 渐变色选择器 "),
- $data.colorTypeIndex == 1 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "up-color-picker__gradient"
- }, [
- vue.createCommentVNode(" 渐变色控制条 "),
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__gradient-track",
- style: vue.normalizeStyle({ background: $options.gradientStyle })
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.gradientColors, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "up-color-picker__gradient-pointer",
- key: index2,
- style: vue.normalizeStyle({ left: $options.getGradientPointerPosition(index2) + "px" }),
- onClick: ($event) => $options.openColorPickerForGradient(index2),
- onTouchstart: ($event) => $options.onPointerTouchStart($event, index2),
- onTouchmove: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.onPointerTouchMove && $options.onPointerTouchMove(...args), ["stop"])),
- onTouchend: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.onPointerTouchEnd && $options.onPointerTouchEnd(...args), ["stop"]))
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__gradient-pointer-inner",
- style: vue.normalizeStyle({ backgroundColor: item.color })
- },
- null,
- 4
- /* STYLE */
- )
- ], 44, ["onClick", "onTouchstart"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "up-color-picker__gradient-controls" }, [
- vue.createVNode(_component_up_button, {
- type: "primary",
- size: "mini",
- plain: "",
- onClick: $options.addGradientColor,
- class: "up-color-picker__add-btn"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(" 添加颜色 ")
- ]),
- _: 1
- /* STABLE */
- }, 8, ["onClick"])
- ]),
- vue.createCommentVNode(" 圆形方向选择器 "),
- vue.createElementVNode("view", { class: "up-color-picker__gradient-direction" }, [
- vue.createElementVNode("text", null, "方向:"),
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__gradient__direction-circle",
- onTouchstart: _cache[3] || (_cache[3] = (...args) => $options.onDirectionTouchStart && $options.onDirectionTouchStart(...args)),
- onTouchmove: _cache[4] || (_cache[4] = (...args) => $options.onDirectionTouchMove && $options.onDirectionTouchMove(...args)),
- onTouchend: _cache[5] || (_cache[5] = (...args) => $options.onDirectionTouchEnd && $options.onDirectionTouchEnd(...args))
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__direction-pointer",
- style: vue.normalizeStyle({
- left: $data.directionPointer.x + "px",
- top: $data.directionPointer.y + "px"
- })
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 纯色选择器 "),
- vue.createElementVNode("view", { class: "up-color-picker__solid" }, [
- vue.createCommentVNode(" 饱和度和明度选择区域 "),
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__saturation",
- style: vue.normalizeStyle({ backgroundColor: `hsl(${$data.hue}, 100%, 50%)` }),
- onTouchstart: _cache[6] || (_cache[6] = (...args) => $options.onSaturationTouchStart && $options.onSaturationTouchStart(...args)),
- onTouchmove: _cache[7] || (_cache[7] = (...args) => $options.onSaturationTouchMove && $options.onSaturationTouchMove(...args)),
- onTouchend: _cache[8] || (_cache[8] = (...args) => $options.onSaturationTouchEnd && $options.onSaturationTouchEnd(...args))
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__saturation-pointer",
- style: vue.normalizeStyle({
- left: $data.saturationPosition.x + "px",
- top: $data.saturationPosition.y + "px"
- })
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- ),
- vue.createCommentVNode(" 色相选择 "),
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__hue",
- onTouchstart: _cache[9] || (_cache[9] = (...args) => $options.onHueTouchStart && $options.onHueTouchStart(...args)),
- onTouchmove: _cache[10] || (_cache[10] = (...args) => $options.onHueTouchMove && $options.onHueTouchMove(...args)),
- onTouchend: _cache[11] || (_cache[11] = (...args) => $options.onHueTouchEnd && $options.onHueTouchEnd(...args))
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__hue-pointer",
- style: vue.normalizeStyle({ left: $data.huePosition + "px" })
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 32
- /* NEED_HYDRATION */
- ),
- vue.createCommentVNode(" 透明度选择 "),
- $data.colorTypeIndex == 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "up-color-picker__alpha",
- onTouchstart: _cache[12] || (_cache[12] = (...args) => $options.onAlphaTouchStart && $options.onAlphaTouchStart(...args)),
- onTouchmove: _cache[13] || (_cache[13] = (...args) => $options.onAlphaTouchMove && $options.onAlphaTouchMove(...args)),
- onTouchend: _cache[14] || (_cache[14] = (...args) => $options.onAlphaTouchEnd && $options.onAlphaTouchEnd(...args))
- },
- [
- vue.createElementVNode("view", { class: "up-color-picker__alpha-bg" }),
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__alpha-pointer",
- style: vue.normalizeStyle({ left: $data.alphaPosition + "px" })
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 32
- /* NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createCommentVNode(" 常用颜色 "),
- $props.commonColors && $props.commonColors.length ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "up-color-picker__common"
- }, [
- vue.createElementVNode("text", { class: "up-color-picker__common-title" }, "常用颜色"),
- vue.createElementVNode("view", { class: "up-color-picker__common-list" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.commonColors, (color2, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: "up-color-picker__common-item",
- style: vue.normalizeStyle({ backgroundColor: color2 }),
- onClick: ($event) => $options.selectCommonColor(color2)
- }, null, 12, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 颜色预览和操作按钮 "),
- vue.createElementVNode("view", { class: "up-color-picker__footer" }, [
- vue.createElementVNode("view", { class: "up-color-picker__preview" }, [
- vue.createElementVNode(
- "view",
- {
- class: "up-color-picker__preview-color",
- style: vue.normalizeStyle({ backgroundColor: $options.displayColor })
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "text",
- { class: "up-color-picker__preview-text" },
- vue.toDisplayString($options.displayColor),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "up-color-picker__actions" }, [
- vue.createVNode(_component_up_button, {
- type: "primary",
- size: "small",
- onClick: $options.confirm,
- class: "up-color-picker__btn"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(" 确定 ")
- ]),
- _: 1
- /* STABLE */
- }, 8, ["onClick"]),
- vue.createVNode(_component_up_button, {
- type: "info",
- size: "small",
- onClick: $options.close,
- class: "up-color-picker__btn"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(" 取消 ")
- ]),
- _: 1
- /* STABLE */
- }, 8, ["onClick"])
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show", "onClose"])
- ]);
- }
- const uColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["render", _sfc_render$1E], ["__scopeId", "data-v-b51e9743"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-color-picker/u-color-picker.vue"]]);
- const __vite_glob_0_27 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uColorPicker
- }, Symbol.toStringTag, { value: "Module" }));
- const props$14 = defineMixin({
- props: {
- // 显示的内容,字符串
- text: {
- type: [Array],
- default: () => props$1x.columnNotice.text
- },
- // 是否显示左侧的音量图标
- icon: {
- type: String,
- default: () => props$1x.columnNotice.icon
- },
- // 通告模式,link-显示右箭头,closable-显示右侧关闭图标
- mode: {
- type: String,
- default: () => props$1x.columnNotice.mode
- },
- // 文字颜色,各图标也会使用文字颜色
- color: {
- type: String,
- default: () => props$1x.columnNotice.color
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.columnNotice.bgColor
- },
- // 字体大小,单位px
- fontSize: {
- type: [String, Number],
- default: () => props$1x.columnNotice.fontSize
- },
- // 水平滚动时的滚动速度,即每秒滚动多少px(px),这有利于控制文字无论多少时,都能有一个恒定的速度
- speed: {
- type: [String, Number],
- default: () => props$1x.columnNotice.speed
- },
- // direction = row时,是否使用步进形式滚动
- step: {
- type: Boolean,
- default: () => props$1x.columnNotice.step
- },
- // 滚动一个周期的时间长,单位ms
- duration: {
- type: [String, Number],
- default: () => props$1x.columnNotice.duration
- },
- // 是否禁止用手滑动切换
- // 目前HX2.6.11,只支持App 2.5.5+、H5 2.5.5+、支付宝小程序、字节跳动小程序
- disableTouch: {
- type: Boolean,
- default: () => props$1x.columnNotice.disableTouch
- },
- justifyContent: {
- type: String,
- default: () => props$1x.columnNotice.justifyContent
- }
- }
- });
- const _sfc_main$1E = {
- mixins: [mpMixin, mixin, props$14],
- watch: {
- text: {
- immediate: true,
- handler(newValue, oldValue) {
- if (!test.array(newValue)) {
- error("noticebar组件direction为column时,要求text参数为数组形式");
- }
- }
- }
- },
- computed: {
- // 文字内容的样式
- textStyle() {
- let style = {};
- style.color = this.color;
- style.fontSize = addUnit(this.fontSize);
- return style;
- },
- // 垂直或者水平滚动
- vertical() {
- if (this.mode == "horizontal")
- return false;
- else
- return true;
- }
- },
- data() {
- return {
- index: 0
- };
- },
- emits: ["click", "close"],
- methods: {
- noticeChange(e2) {
- this.index = e2.detail.current;
- },
- // 点击通告栏
- clickHandler() {
- this.$emit("click", this.index);
- },
- // 点击关闭按钮
- close() {
- this.$emit("close");
- }
- }
- };
- function _sfc_render$1D(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-notice",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "icon", {}, () => [
- _ctx.icon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-notice__left-icon"
- }, [
- vue.createVNode(_component_up_icon, {
- name: _ctx.icon,
- color: _ctx.color,
- size: "19"
- }, null, 8, ["name", "color"])
- ])) : vue.createCommentVNode("v-if", true)
- ], true),
- vue.createElementVNode("swiper", {
- "disable-touch": _ctx.disableTouch,
- vertical: _ctx.step ? false : true,
- circular: "",
- interval: _ctx.duration,
- autoplay: true,
- class: "u-notice__swiper",
- onChange: _cache[0] || (_cache[0] = (...args) => $options.noticeChange && $options.noticeChange(...args))
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.text, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "swiper-item",
- {
- key: index2,
- class: "u-notice__swiper__item",
- style: vue.normalizeStyle({ "justifyContent": _ctx.justifyContent })
- },
- [
- vue.createElementVNode(
- "text",
- {
- class: "u-notice__swiper__item__text u-line-1",
- style: vue.normalizeStyle([$options.textStyle])
- },
- vue.toDisplayString(item),
- 5
- /* TEXT, STYLE */
- )
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 40, ["disable-touch", "vertical", "interval"]),
- ["link", "closable"].includes(_ctx.mode) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-notice__right-icon"
- }, [
- _ctx.mode === "link" ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: "arrow-right",
- size: 17,
- color: _ctx.color
- }, null, 8, ["color"])) : vue.createCommentVNode("v-if", true),
- _ctx.mode === "closable" ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- name: "close",
- size: 16,
- color: _ctx.color,
- onClick: $options.close
- }, null, 8, ["color", "onClick"])) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_0$6 = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["render", _sfc_render$1D], ["__scopeId", "data-v-bacc3427"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-column-notice/u-column-notice.vue"]]);
- const __vite_glob_0_28 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$6
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1D = {
- name: "up-copy",
- props: {
- content: {
- type: String,
- default: ""
- },
- alertStyle: {
- type: String,
- default: "toast"
- },
- notice: {
- type: String,
- default: t$1("up.common.copy") + t$1("up.common.success")
- }
- },
- emits: ["success"],
- methods: {
- t: t$1,
- handleClick() {
- let content = this.content;
- if (!content) {
- uni.showToast({
- title: t$1("up.common.none"),
- icon: "none",
- duration: 2e3
- });
- return false;
- }
- content = typeof content === "string" ? content : content.toString();
- let that2 = this;
- uni.setClipboardData({
- data: content,
- success: function() {
- if (that2.alertStyle == "modal") {
- uni.showModal({
- title: "up.common.tip",
- content: that2.notice
- });
- } else {
- uni.showToast({
- title: that2.notice,
- icon: "none"
- });
- }
- that2.$emit("success");
- },
- fail: function() {
- uni.showToast({
- title: t$1("up.common.copy") + t$1("up.common.fail"),
- icon: "none",
- duration: 3e3
- });
- }
- });
- }
- }
- };
- function _sfc_render$1C(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", {
- onClick: _cache[0] || (_cache[0] = (...args) => $options.handleClick && $options.handleClick(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createTextVNode(
- vue.toDisplayString($options.t("up.common.copy")),
- 1
- /* TEXT */
- )
- ])
- ]);
- }
- const uCopy = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["render", _sfc_render$1C], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-copy/u-copy.vue"]]);
- const __vite_glob_0_29 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCopy
- }, Symbol.toStringTag, { value: "Module" }));
- const props$13 = defineMixin({
- props: {
- // 倒计时时长,单位ms
- time: {
- type: [String, Number],
- default: () => props$1x.countDown.time
- },
- // 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒
- format: {
- type: String,
- default: () => props$1x.countDown.format
- },
- // 是否自动开始倒计时
- autoStart: {
- type: Boolean,
- default: () => props$1x.countDown.autoStart
- },
- // 是否展示毫秒倒计时
- millisecond: {
- type: Boolean,
- default: () => props$1x.countDown.millisecond
- }
- }
- });
- function padZero(num, targetLength = 2) {
- let str = `${num}`;
- while (str.length < targetLength) {
- str = `0${str}`;
- }
- return str;
- }
- const SECOND = 1e3;
- const MINUTE = 60 * SECOND;
- const HOUR = 60 * MINUTE;
- const DAY = 24 * HOUR;
- function parseTimeData(time) {
- const days = Math.floor(time / DAY);
- const hours = Math.floor(time % DAY / HOUR);
- const minutes = Math.floor(time % HOUR / MINUTE);
- const seconds = Math.floor(time % MINUTE / SECOND);
- const milliseconds = Math.floor(time % SECOND);
- return {
- days,
- hours,
- minutes,
- seconds,
- milliseconds
- };
- }
- function parseFormat(format2, timeData) {
- let {
- days,
- hours,
- minutes,
- seconds,
- milliseconds
- } = timeData;
- if (format2.indexOf("DD") === -1) {
- hours += days * 24;
- } else {
- format2 = format2.replace("DD", padZero(days));
- }
- if (format2.indexOf("HH") === -1) {
- minutes += hours * 60;
- } else {
- format2 = format2.replace("HH", padZero(hours));
- }
- if (format2.indexOf("mm") === -1) {
- seconds += minutes * 60;
- } else {
- format2 = format2.replace("mm", padZero(minutes));
- }
- if (format2.indexOf("ss") === -1) {
- milliseconds += seconds * 1e3;
- } else {
- format2 = format2.replace("ss", padZero(seconds));
- }
- return format2.replace("SSS", padZero(milliseconds, 3));
- }
- function isSameSecond(time1, time2) {
- return Math.floor(time1 / 1e3) === Math.floor(time2 / 1e3);
- }
- const _sfc_main$1C = {
- name: "u-count-down",
- mixins: [mpMixin, mixin, props$13],
- data() {
- return {
- timer: null,
- // 各单位(天,时,分等)剩余时间
- timeData: parseTimeData(0),
- // 格式化后的时间,如"03:23:21"
- formattedTime: "0",
- // 倒计时是否正在进行中
- runing: false,
- endTime: 0,
- // 结束的毫秒时间戳
- remainTime: 0
- // 剩余的毫秒时间
- };
- },
- watch: {
- time(n2) {
- this.reset();
- }
- },
- mounted() {
- this.init();
- },
- emits: ["change", "finish"],
- methods: {
- init() {
- this.reset();
- },
- // 开始倒计时
- start() {
- if (this.runing)
- return;
- this.runing = true;
- this.endTime = Date.now() + this.remainTime;
- this.toTick();
- },
- // 根据是否展示毫秒,执行不同操作函数
- toTick() {
- if (this.millisecond) {
- this.microTick();
- } else {
- this.macroTick();
- }
- },
- macroTick() {
- this.clearTimeout();
- this.timer = setTimeout(() => {
- const remain = this.getRemainTime();
- if (!isSameSecond(remain, this.remainTime) || remain === 0) {
- this.setRemainTime(remain);
- }
- if (this.remainTime !== 0) {
- this.macroTick();
- }
- }, 30);
- },
- microTick() {
- this.clearTimeout();
- this.timer = setTimeout(() => {
- this.setRemainTime(this.getRemainTime());
- if (this.remainTime !== 0) {
- this.microTick();
- }
- }, 50);
- },
- // 获取剩余的时间
- getRemainTime() {
- return Math.max(this.endTime - Date.now(), 0);
- },
- // 设置剩余的时间
- setRemainTime(remain) {
- this.remainTime = remain;
- const timeData = parseTimeData(remain);
- this.timeData = timeData;
- this.$emit("change", timeData);
- this.formattedTime = parseFormat(this.format, timeData);
- if (remain <= 0) {
- this.pause();
- this.$emit("finish");
- }
- },
- // 重置倒计时
- reset() {
- this.pause();
- this.remainTime = this.time;
- this.setRemainTime(this.remainTime);
- if (this.autoStart) {
- this.start();
- }
- },
- // 暂停倒计时
- pause() {
- this.runing = false;
- this.clearTimeout();
- },
- // 清空定时器
- clearTimeout() {
- clearTimeout(this.timer);
- this.timer = null;
- }
- },
- beforeUnmount() {
- this.clearTimeout();
- }
- };
- function _sfc_render$1B(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-count-down" }, [
- vue.renderSlot(_ctx.$slots, "default", {
- days: $data.timeData.days,
- hours: $data.timeData.hours,
- minutes: $data.timeData.minutes,
- seconds: $data.timeData.seconds
- }, () => [
- vue.createElementVNode(
- "text",
- { class: "u-count-down__text" },
- vue.toDisplayString($data.formattedTime),
- 1
- /* TEXT */
- )
- ], true)
- ]);
- }
- const uCountDown = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["render", _sfc_render$1B], ["__scopeId", "data-v-2f829c0f"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-count-down/u-count-down.vue"]]);
- const __vite_glob_0_30 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCountDown
- }, Symbol.toStringTag, { value: "Module" }));
- const props$12 = defineMixin({
- props: {
- // 开始的数值,默认从0增长到某一个数
- startVal: {
- type: [String, Number],
- default: () => props$1x.countTo.startVal
- },
- // 要滚动的目标数值,必须
- endVal: {
- type: [String, Number],
- default: () => props$1x.countTo.endVal
- },
- // 滚动到目标数值的动画持续时间,单位为毫秒(ms)
- duration: {
- type: [String, Number],
- default: () => props$1x.countTo.duration
- },
- // 设置数值后是否自动开始滚动
- autoplay: {
- type: Boolean,
- default: () => props$1x.countTo.autoplay
- },
- // 要显示的小数位数
- decimals: {
- type: [String, Number],
- default: () => props$1x.countTo.decimals
- },
- // 是否在即将到达目标数值的时候,使用缓慢滚动的效果
- useEasing: {
- type: Boolean,
- default: () => props$1x.countTo.useEasing
- },
- // 十进制分割
- decimal: {
- type: [String, Number],
- default: () => props$1x.countTo.decimal
- },
- // 字体颜色
- color: {
- type: String,
- default: () => props$1x.countTo.color
- },
- // 字体大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.countTo.fontSize
- },
- // 是否加粗字体
- bold: {
- type: Boolean,
- default: () => props$1x.countTo.bold
- },
- // 千位分隔符,类似金额的分割(¥23,321.05中的",")
- separator: {
- type: String,
- default: () => props$1x.countTo.separator
- }
- }
- });
- const _sfc_main$1B = {
- name: "u-count-to",
- data() {
- return {
- localStartVal: this.startVal,
- displayValue: this.formatNumber(this.startVal),
- printVal: null,
- paused: false,
- // 是否暂停
- localDuration: Number(this.duration),
- startTime: null,
- // 开始的时间
- timestamp: null,
- // 时间戳
- remaining: null,
- // 停留的时间
- rAF: null,
- lastTime: 0
- // 上一次的时间
- };
- },
- mixins: [mpMixin, mixin, props$12],
- computed: {
- countDown() {
- return this.startVal > this.endVal;
- }
- },
- watch: {
- startVal() {
- this.autoplay && this.start();
- },
- endVal() {
- this.autoplay && this.start();
- }
- },
- mounted() {
- this.autoplay && this.start();
- },
- emits: ["end"],
- methods: {
- addUnit,
- easingFn(t2, b2, c2, d2) {
- return c2 * (-Math.pow(2, -10 * t2 / d2) + 1) * 1024 / 1023 + b2;
- },
- requestAnimationFrame(callback) {
- const currTime = (/* @__PURE__ */ new Date()).getTime();
- const timeToCall = Math.max(0, 16 - (currTime - this.lastTime));
- const id = setTimeout(() => {
- callback(currTime + timeToCall);
- }, timeToCall);
- this.lastTime = currTime + timeToCall;
- return id;
- },
- cancelAnimationFrame(id) {
- clearTimeout(id);
- },
- // 开始滚动数字
- start() {
- this.localStartVal = this.startVal;
- this.startTime = null;
- this.localDuration = this.duration;
- this.paused = false;
- this.rAF = this.requestAnimationFrame(this.count);
- },
- // 暂定状态,重新再开始滚动;或者滚动状态下,暂停
- reStart() {
- if (this.paused) {
- this.resume();
- this.paused = false;
- } else {
- this.stop();
- this.paused = true;
- }
- },
- // 暂停
- stop() {
- this.cancelAnimationFrame(this.rAF);
- },
- // 重新开始(暂停的情况下)
- resume() {
- if (!this.remaining)
- return;
- this.startTime = 0;
- this.localDuration = this.remaining;
- this.localStartVal = this.printVal;
- this.requestAnimationFrame(this.count);
- },
- // 重置
- reset() {
- this.startTime = null;
- this.cancelAnimationFrame(this.rAF);
- this.displayValue = this.formatNumber(this.startVal);
- },
- count(timestamp) {
- if (!this.startTime)
- this.startTime = timestamp;
- this.timestamp = timestamp;
- const progress = timestamp - this.startTime;
- this.remaining = this.localDuration - progress;
- if (this.useEasing) {
- if (this.countDown) {
- this.printVal = this.localStartVal - this.easingFn(progress, 0, this.localStartVal - this.endVal, this.localDuration);
- } else {
- this.printVal = this.easingFn(progress, this.localStartVal, this.endVal - this.localStartVal, this.localDuration);
- }
- } else {
- if (this.countDown) {
- this.printVal = this.localStartVal - (this.localStartVal - this.endVal) * (progress / this.localDuration);
- } else {
- this.printVal = this.localStartVal + (this.endVal - this.localStartVal) * (progress / this.localDuration);
- }
- }
- if (this.countDown) {
- this.printVal = this.printVal < this.endVal ? this.endVal : this.printVal;
- } else {
- this.printVal = this.printVal > this.endVal ? this.endVal : this.printVal;
- }
- this.displayValue = this.formatNumber(this.printVal) || 0;
- if (progress < this.localDuration) {
- this.rAF = this.requestAnimationFrame(this.count);
- } else {
- this.$emit("end");
- }
- },
- // 判断是否数字
- isNumber(val) {
- return !isNaN(parseFloat(val));
- },
- formatNumber(num) {
- num = Number(num);
- num = num.toFixed(Number(this.decimals));
- num += "";
- const x2 = num.split(".");
- let x1 = x2[0];
- const x22 = x2.length > 1 ? this.decimal + x2[1] : "";
- const rgx = /(\d+)(\d{3})/;
- if (this.separator && !this.isNumber(this.separator)) {
- while (rgx.test(x1)) {
- x1 = x1.replace(rgx, "$1" + this.separator + "$2");
- }
- }
- return x1 + x22;
- },
- destroyed() {
- this.cancelAnimationFrame(this.rAF);
- }
- }
- };
- function _sfc_render$1A(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "text",
- {
- class: "u-count-num",
- style: vue.normalizeStyle({
- fontSize: $options.addUnit(_ctx.fontSize),
- fontWeight: _ctx.bold ? "bold" : "normal",
- color: _ctx.color
- })
- },
- vue.toDisplayString($data.displayValue),
- 5
- /* TEXT, STYLE */
- );
- }
- const uCountTo = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["render", _sfc_render$1A], ["__scopeId", "data-v-eb411063"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-count-to/u-count-to.vue"]]);
- const __vite_glob_0_31 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCountTo
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1A = {
- name: "up-coupon",
- props: {
- // 金额
- amount: {
- type: [String, Number],
- default: ""
- },
- // 金额单位
- unit: {
- type: String,
- default: "¥"
- },
- // 单位位置
- unitPosition: {
- type: String,
- default: "left"
- },
- // 使用限制
- limit: {
- type: String,
- default: ""
- },
- // 标题
- title: {
- type: String,
- default: "优惠券"
- },
- // 描述
- desc: {
- type: String,
- default: ""
- },
- // 有效期
- time: {
- type: String,
- default: ""
- },
- // 操作按钮文字
- actionText: {
- type: String,
- default: "使用"
- },
- // 形状:coupon-优惠券, envelope-红包, card-卡片
- shape: {
- type: String,
- default: "coupon"
- },
- // 尺寸:small, medium, large
- size: {
- type: String,
- default: "medium"
- },
- // 是否圆形按钮
- circle: {
- type: Boolean,
- default: false
- },
- // 是否禁用
- disabled: {
- type: Boolean,
- default: false
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: ""
- },
- // 文字颜色
- color: {
- type: String,
- default: ""
- },
- // 内置背景类型
- type: {
- type: String,
- default: ""
- }
- },
- computed: {
- couponStyle() {
- const style = {};
- if (this.bgColor)
- style.background = this.bgColor;
- if (this.color)
- style.color = this.color;
- return style;
- },
- dotCount() {
- const map = {
- small: 8,
- medium: 10,
- large: 12
- };
- return map[this.size] || 10;
- }
- },
- methods: {
- handleClick() {
- if (this.disabled)
- return;
- this.$emit("click");
- }
- }
- };
- function _sfc_render$1z(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_tag = vue.resolveComponent("up-tag");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["up-coupon", [`up-coupon--${$props.shape}`, `up-coupon--${$props.type}`, `up-coupon--${$props.size}`, { "up-coupon--disabled": $props.disabled }]]),
- style: vue.normalizeStyle([$options.couponStyle]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.handleClick && $options.handleClick(...args))
- },
- [
- vue.createElementVNode("view", { class: "up-coupon__content" }, [
- vue.createCommentVNode(" 左侧金额区域 "),
- vue.createElementVNode("view", { class: "up-coupon__amount" }, [
- $props.unitPosition === "left" ? vue.renderSlot(_ctx.$slots, "unit", {
- key: 0,
- unit: $props.unit,
- unitPosition: $props.unitPosition
- }, () => [
- $props.unitPosition === "left" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "up-coupon__amount-unit"
- },
- vue.toDisplayString($props.unit),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "amount", { amount: $props.amount }, () => [
- vue.createElementVNode(
- "text",
- { class: "up-coupon__amount-value" },
- vue.toDisplayString($props.amount),
- 1
- /* TEXT */
- )
- ], true),
- $props.unitPosition === "right" ? vue.renderSlot(_ctx.$slots, "unit", {
- key: 1,
- unit: $props.unit,
- unitPosition: $props.unitPosition
- }, () => [
- $props.unitPosition === "right" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "up-coupon__amount-unit"
- },
- vue.toDisplayString($props.unit),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "limit", { limit: $props.limit }, () => [
- $props.limit ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "up-coupon__amount-limit"
- },
- vue.toDisplayString($props.limit),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ]),
- vue.createCommentVNode(" 中间描述区域 "),
- vue.createElementVNode("view", { class: "up-coupon__info" }, [
- vue.renderSlot(_ctx.$slots, "title", { title: $props.title }, () => [
- vue.createElementVNode(
- "text",
- { class: "up-coupon__info-title" },
- vue.toDisplayString($props.title),
- 1
- /* TEXT */
- )
- ], true),
- vue.renderSlot(_ctx.$slots, "desc", { desc: $props.desc }, () => [
- $props.desc ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "up-coupon__info-desc"
- },
- vue.toDisplayString($props.desc),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true),
- vue.renderSlot(_ctx.$slots, "time", { time: $props.time }, () => [
- $props.time ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "up-coupon__info-time"
- },
- vue.toDisplayString($props.time),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ]),
- vue.createCommentVNode(" 右侧操作区域 "),
- vue.createElementVNode("view", { class: "up-coupon__action u-padding-right-20" }, [
- vue.renderSlot(_ctx.$slots, "action", {
- actionText: $props.actionText,
- circle: $props.circle
- }, () => [
- vue.createVNode(_component_up_tag, {
- type: "error",
- bgColor: $props.type ? "transparent" : "#eb433d",
- borderColor: $props.type ? "#eee" : "#eb433d",
- borderRadius: "6px",
- size: "medium",
- class: "up-coupon__action-text",
- shape: $props.circle ? "circle" : "circle"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString($props.actionText),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["bgColor", "borderColor", "shape"])
- ], true)
- ])
- ]),
- vue.createCommentVNode(" 红包绳子效果 "),
- $props.shape === "envelope" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "up-coupon__rope"
- })) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 默认插槽,可用于添加额外内容 "),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uCoupon = /* @__PURE__ */ _export_sfc(_sfc_main$1A, [["render", _sfc_render$1z], ["__scopeId", "data-v-8013dcad"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-coupon/u-coupon.vue"]]);
- const __vite_glob_0_32 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCoupon
- }, Symbol.toStringTag, { value: "Module" }));
- const tabHeight = 50;
- const _sfc_main$1z = {
- name: "u-cropper",
- data() {
- return {
- // 添加实例ID用于区分不同实例
- instanceId: Date.now() + "-" + Math.random().toString(36).substr(2, 9),
- cvsStyleHeight: "0px",
- styleDisplay: "none",
- styleTop: "-10000px",
- prvTop: "-10000px",
- imgStyle: {},
- selStyle: {},
- showOper: true,
- imgSrc: {
- imgSrc: ""
- },
- btnWidth: "19%",
- btnDsp: "flex",
- // 裁剪区域宽度,用于设置选择区域的宽度
- arWidth: "",
- // 裁剪区域高度,用于设置选择区域的高度
- arHeight: "",
- // 导出图片宽度,用于设置最终导出图片的宽度
- expWidth: "",
- // 导出图片高度,用于设置最终导出图片的高度
- expHeight: "",
- // 是否允许调整裁剪框大小
- letChangeSize: false
- };
- },
- watch: {
- avatarSrc() {
- this.imgSrc.imgSrc = this.avatarSrc;
- }
- },
- emits: ["avtinit", "confirm"],
- props: {
- minScale: "",
- maxScale: "",
- canScale: true,
- canRotate: true,
- lockWidth: "",
- lockHeight: "",
- stretch: "",
- lock: "",
- noTab: true,
- inner: false,
- quality: "",
- index: "",
- canChangeSize: false,
- areaWidth: "300rpx",
- // 裁剪区域高度,用于设置选择区域的高度
- areaHeight: "300rpx",
- // 导出图片宽度,用于设置最终导出图片的宽度
- exportWidth: "260rpx",
- // 导出图片高度,用于设置最终导出图片的高度
- exportHeight: "260rpx"
- },
- created() {
- this.ctxCanvas = uni.createCanvasContext("avatar-canvas-" + this.instanceId, this);
- this.ctxCanvasOper = uni.createCanvasContext("oper-canvas-" + this.instanceId, this);
- this.ctxCanvasPrv = uni.createCanvasContext("prv-canvas-" + this.instanceId, this);
- this.qlty = parseInt(this.quality) || 0.9;
- this.imgSrc.imgSrc = this.imageSrc;
- this.letRotate = this.canRotate === false || this.inner === true ? 0 : 1;
- this.letScale = this.canScale === false ? 0 : 1;
- this.letChangeSize = this.canChangeSize;
- this.isin = this.inner === true ? 1 : 0;
- this.indx = this.index || void 0;
- this.mnScale = this.minScale || 0.3;
- this.mxScale = this.maxScale || 4;
- this.noBar = this.noTab === true ? 1 : 0;
- this.stc = this.stretch;
- this.lck = this.lock;
- if (this.isin) {
- this.btnWidth = "24%";
- this.btnDsp = "none";
- } else {
- this.btnWidth = "19%";
- this.btnDsp = "flex";
- }
- if (this.noBar) {
- this.moreHeight = 0;
- this.windowResize();
- } else {
- uni.showTabBar({
- complete: (res) => {
- this.moreHeight = res.errMsg === "showTabBar:ok" ? 50 : 0;
- this.windowResize();
- }
- });
- }
- },
- methods: {
- t: t$1,
- windowResize() {
- let sysInfo = uni.getSystemInfoSync();
- this.platform = sysInfo.platform;
- this.pixelRatio = sysInfo.pixelRatio;
- this.windowWidth = sysInfo.windowWidth;
- if (this.platform === "android") {
- this.windowHeight = sysInfo.screenHeight + sysInfo.statusBarHeight;
- this.cvsStyleHeight = this.windowHeight - tabHeight + "px";
- } else {
- this.windowHeight = sysInfo.windowHeight + this.moreHeight;
- this.cvsStyleHeight = this.windowHeight - tabHeight + 6 + "px";
- }
- this.pxRatio = this.windowWidth / 750;
- let style = this.avatarStyle;
- if (style && style !== true && (style = style.trim())) {
- style = style.split(";");
- let obj = {};
- for (let v2 of style) {
- if (!v2)
- continue;
- v2 = v2.trim().split(":");
- if (v2[1].indexOf("rpx") >= 0) {
- let arr = v2[1].trim().split(" ");
- for (let k2 in arr) {
- if (!arr[k2])
- continue;
- if (arr[k2].indexOf("rpx") >= 0) {
- arr[k2] = parseFloat(arr[k2]) * this.pxRatio + "px";
- }
- }
- v2[1] = arr.join(" ");
- }
- obj[v2[0].trim()] = v2[1].trim();
- }
- this.imgStyle = obj;
- }
- this.expWidth && (this.expWidth = this.expWidth.indexOf("rpx") >= 0 ? parseInt(this.expWidth) * this.pxRatio : parseInt(this.expWidth));
- this.expHeight && (this.expHeight = this.expHeight.indexOf("rpx") >= 0 ? parseInt(this.expHeight) * this.pxRatio : parseInt(this.expHeight));
- if (this.styleDisplay === "flex") {
- this.drawInit(true);
- }
- this.hideImg();
- },
- select() {
- if (this.fSelecting)
- return;
- this.fSelecting = true;
- setTimeout(() => {
- this.fSelecting = false;
- }, 500);
- uni.chooseImage({
- count: 1,
- sizeType: ["original", "compressed"],
- sourceType: ["album", "camera"],
- success: (r2) => {
- uni.showLoading({ mask: true });
- let path = this.imgPath = r2.tempFilePaths[0];
- uni.getImageInfo({
- src: path,
- success: (r3) => {
- this.imgWidth = r3.width;
- this.imgHeight = r3.height;
- this.path = path;
- if (!this.hasSel) {
- let style = this.selStyle || {};
- if (this.arWidth && this.arHeight) {
- let areaWidth = this.arWidth.indexOf("rpx") >= 0 ? parseInt(this.arWidth) * this.pxRatio : parseInt(this.arWidth), areaHeight = this.arHeight.indexOf("rpx") >= 0 ? parseInt(this.arHeight) * this.pxRatio : parseInt(this.arHeight);
- style.width = areaWidth + "px";
- style.height = areaHeight + "px";
- style.top = (this.windowHeight - areaHeight - tabHeight) / 2 + "px";
- style.left = (this.windowWidth - areaWidth) / 2 + "px";
- } else {
- uni.showModal({
- title: t$1("up.cropper.emptyWidhtOrHeight"),
- showCancel: false
- });
- return;
- }
- this.selStyle = style;
- }
- if (this.noBar) {
- this.drawInit(true);
- } else {
- uni.hideTabBar({
- complete: () => {
- this.drawInit(true);
- }
- });
- }
- },
- fail: () => {
- uni.showToast({
- title: "error3",
- duration: 2e3
- });
- },
- complete() {
- uni.hideLoading();
- }
- });
- }
- });
- },
- confirm() {
- if (this.fUploading)
- return;
- this.fUploading = true;
- setTimeout(() => {
- this.fUploading = false;
- }, 1e3);
- let style = this.selStyle, x2 = parseInt(style.left), y2 = parseInt(style.top), width = parseInt(style.width), height = parseInt(style.height), expWidth = this.expWidth || width, expHeight = this.expHeight || height;
- uni.showLoading({ mask: true });
- this.styleDisplay = "none";
- this.styleTop = "-10000px";
- this.hasSel = false;
- this.hideImg();
- uni.canvasToTempFilePath({
- x: x2,
- y: y2,
- width,
- height,
- destWidth: expWidth,
- destHeight: expHeight,
- canvasId: "avatar-canvas-" + this.instanceId,
- fileType: "png",
- quality: this.qlty,
- success: (r2) => {
- r2 = r2.tempFilePath;
- this.$emit("confirm", { avatar: this.imgSrc, path: r2, index: this.indx, data: this.rtn });
- },
- fail: (res) => {
- uni.showToast({
- title: "error1",
- duration: 2e3
- });
- },
- complete: () => {
- uni.hideLoading();
- this.noBar || uni.showTabBar();
- }
- }, this);
- },
- // 用户点击"预览"模式下的"确认"按钮时被调用,用于将预览的裁剪结果上传
- prvUpload() {
- if (this.fPrvUploading)
- return;
- this.fPrvUploading = true;
- setTimeout(() => {
- this.fPrvUploading = false;
- }, 1e3);
- let style = this.selStyle;
- parseInt(style.width);
- parseInt(style.height);
- let prvX = this.prvX, prvY = this.prvY, prvWidth = this.prvWidth, prvHeight = this.prvHeight, expWidth = this.expWidth || prvWidth, expHeight = this.expHeight || prvHeight;
- uni.showLoading({ mask: true });
- this.styleDisplay = "none";
- this.styleTop = "-10000px";
- this.hasSel = false;
- this.hideImg();
- uni.canvasToTempFilePath({
- x: prvX,
- y: prvY,
- width: prvWidth,
- height: prvHeight,
- destWidth: expWidth,
- destHeight: expHeight,
- canvasId: "prv-canvas-" + this.instanceId,
- fileType: "png",
- quality: this.qlty,
- success: (r2) => {
- r2 = r2.tempFilePath;
- this.$emit("confirm", { avatar: this.imgSrc, path: r2, index: this.indx, data: this.rtn });
- },
- fail: () => {
- uni.showToast({
- title: "error_prv",
- duration: 2e3
- });
- },
- complete: () => {
- uni.hideLoading();
- this.noBar || uni.showTabBar();
- }
- }, this);
- },
- drawInit(ini = false) {
- let allWidth = this.windowWidth, allHeight = this.windowHeight, imgWidth = this.imgWidth, imgHeight = this.imgHeight, imgRadio = imgWidth / imgHeight, useWidth = allWidth - 40, useHeight = allHeight - tabHeight - 80;
- this.pixelRatio;
- let selWidth = parseInt(this.selStyle.width), selHeight = parseInt(this.selStyle.height);
- this.fixWidth = 0;
- this.fixHeight = 0;
- this.lckWidth = 0;
- this.lckHeight = 0;
- switch (this.stc) {
- case "x":
- this.fixWidth = 1;
- break;
- case "y":
- this.fixHeight = 1;
- break;
- case "long":
- if (imgRadio > 1)
- this.fixWidth = 1;
- else
- this.fixHeight = 1;
- break;
- case "short":
- if (imgRadio > 1)
- this.fixHeight = 1;
- else
- this.fixWidth = 1;
- break;
- case "longSel":
- if (selWidth > selHeight)
- this.fixWidth = 1;
- else
- this.fixHeight = 1;
- break;
- case "shortSel":
- if (selWidth > selHeight)
- this.fixHeight = 1;
- else
- this.fixWidth = 1;
- break;
- }
- switch (this.lck) {
- case "x":
- this.lckWidth = 1;
- break;
- case "y":
- this.lckHeight = 1;
- break;
- case "long":
- if (imgRadio > 1)
- this.lckWidth = 1;
- else
- this.lckHeight = 1;
- break;
- case "short":
- if (imgRadio > 1)
- this.lckHeight = 1;
- else
- this.lckWidth = 1;
- break;
- case "longSel":
- if (selWidth > selHeight)
- this.lckWidth = 1;
- else
- this.lckHeight = 1;
- break;
- case "shortSel":
- if (selWidth > selHeight)
- this.lckHeight = 1;
- else
- this.lckWidth = 1;
- break;
- }
- if (this.fixWidth) {
- useWidth = selWidth;
- useHeight = useWidth / imgRadio;
- } else if (this.fixHeight) {
- useHeight = selHeight;
- useWidth = useHeight * imgRadio;
- } else if (imgRadio < 1) {
- if (imgHeight < useHeight) {
- useWidth = imgWidth;
- useHeight = imgHeight;
- } else {
- useHeight = useHeight;
- useWidth = useHeight * imgRadio;
- }
- } else {
- if (imgWidth < useWidth) {
- useWidth = imgWidth;
- useHeight = imgHeight;
- } else {
- useWidth = useWidth;
- useHeight = useWidth / imgRadio;
- }
- }
- if (this.isin) {
- this.scaleWidth = 0;
- this.scaleHeight = 0;
- if (useWidth < selWidth) {
- useWidth = selWidth;
- useHeight = useWidth / imgRadio;
- this.lckHeight = 0;
- }
- if (useHeight < selHeight) {
- useHeight = selHeight;
- useWidth = useHeight * imgRadio;
- this.lckWidth = 0;
- }
- }
- this.scaleSize = 1;
- this.rotateDeg = 0;
- this.posWidth = (allWidth - useWidth) / 2;
- this.posHeight = (allHeight - useHeight - tabHeight) / 2;
- this.useWidth = useWidth;
- this.useHeight = useHeight;
- let style = this.selStyle, left = parseInt(style.left), top = parseInt(style.top), width = parseInt(style.width), height = parseInt(style.height);
- this.canvas;
- this.canvasOper;
- let ctxCanvas = this.ctxCanvas, ctxCanvasOper = this.ctxCanvasOper;
- ctxCanvasOper.setLineWidth(3);
- ctxCanvasOper.setStrokeStyle("grey");
- ctxCanvasOper.setGlobalAlpha(0.4);
- ctxCanvasOper.setFillStyle("black");
- ctxCanvasOper.strokeRect(left, top, width, height);
- ctxCanvasOper.fillRect(0, 0, this.windowWidth, top);
- ctxCanvasOper.fillRect(0, top, left, height);
- ctxCanvasOper.fillRect(0, top + height, this.windowWidth, this.windowHeight - height - top - tabHeight);
- ctxCanvasOper.fillRect(left + width, top, this.windowWidth - width - left, height);
- ctxCanvasOper.setStrokeStyle("red");
- ctxCanvasOper.moveTo(left + 20, top);
- ctxCanvasOper.lineTo(left, top);
- ctxCanvasOper.lineTo(left, top + 20);
- ctxCanvasOper.moveTo(left + width - 20, top);
- ctxCanvasOper.lineTo(left + width, top);
- ctxCanvasOper.lineTo(left + width, top + 20);
- ctxCanvasOper.moveTo(left + 20, top + height);
- ctxCanvasOper.lineTo(left, top + height);
- ctxCanvasOper.lineTo(left, top + height - 20);
- ctxCanvasOper.moveTo(left + width - 20, top + height);
- ctxCanvasOper.lineTo(left + width, top + height);
- ctxCanvasOper.lineTo(left + width, top + height - 20);
- const controlPointSize = 10;
- ctxCanvasOper.setFillStyle("white");
- ctxCanvasOper.setStrokeStyle("grey");
- ctxCanvasOper.setLineWidth(1);
- ctxCanvasOper.fillRect(left - controlPointSize / 2, top - controlPointSize / 2, controlPointSize, controlPointSize);
- ctxCanvasOper.strokeRect(left - controlPointSize / 2, top - controlPointSize / 2, controlPointSize, controlPointSize);
- ctxCanvasOper.fillRect(left + width - controlPointSize / 2, top - controlPointSize / 2, controlPointSize, controlPointSize);
- ctxCanvasOper.strokeRect(left + width - controlPointSize / 2, top - controlPointSize / 2, controlPointSize, controlPointSize);
- ctxCanvasOper.fillRect(left - controlPointSize / 2, top + height - controlPointSize / 2, controlPointSize, controlPointSize);
- ctxCanvasOper.strokeRect(left - controlPointSize / 2, top + height - controlPointSize / 2, controlPointSize, controlPointSize);
- ctxCanvasOper.fillRect(left + width - controlPointSize / 2, top + height - controlPointSize / 2, controlPointSize, controlPointSize);
- ctxCanvasOper.strokeRect(left + width - controlPointSize / 2, top + height - controlPointSize / 2, controlPointSize, controlPointSize);
- ctxCanvasOper.stroke();
- ctxCanvasOper.draw(false, () => {
- if (ini) {
- this.styleDisplay = "flex";
- this.styleTop = "0";
- ctxCanvas.setFillStyle("black");
- this.drawImage();
- }
- });
- this.$emit("avtinit");
- },
- drawImage() {
- let tm_now = Date.now();
- if (tm_now - this.drawTm < 20)
- return;
- this.drawTm = tm_now;
- let ctxCanvas = this.ctxCanvas;
- ctxCanvas.fillRect(0, 0, this.windowWidth, this.windowHeight - tabHeight);
- ctxCanvas.translate(this.posWidth + this.useWidth / 2, this.posHeight + this.useHeight / 2);
- ctxCanvas.scale(this.scaleSize, this.scaleSize);
- ctxCanvas.rotate(this.rotateDeg * Math.PI / 180);
- ctxCanvas.drawImage(this.imgPath, -this.useWidth / 2, -this.useHeight / 2, this.useWidth, this.useHeight);
- ctxCanvas.draw(false);
- },
- hideImg() {
- this.prvImg = "";
- this.prvTop = "-10000px";
- this.showOper = true;
- this.prvImgData = null;
- this.target = null;
- },
- close() {
- this.styleDisplay = "none";
- this.styleTop = "-10000px";
- this.hasSel = false;
- this.hideImg();
- this.noBar || uni.showTabBar();
- },
- preview() {
- if (this.fPreviewing)
- return;
- this.fPreviewing = true;
- setTimeout(() => {
- this.fPreviewing = false;
- }, 1e3);
- let style = this.selStyle, x2 = parseInt(style.left), y2 = parseInt(style.top), width = parseInt(style.width), height = parseInt(style.height);
- uni.showLoading({ mask: true });
- uni.canvasToTempFilePath({
- x: x2,
- y: y2,
- width,
- height,
- canvasId: "avatar-canvas-" + this.instanceId,
- fileType: "png",
- quality: this.qlty,
- success: (r2) => {
- this.prvImgTmp = r2 = r2.tempFilePath;
- let ctxCanvasPrv = this.ctxCanvasPrv, prvX = this.windowWidth, prvY = parseInt(this.cvsStyleHeight), prvWidth = parseInt(this.selStyle.width), prvHeight = parseInt(this.selStyle.height), useWidth = prvX - 40, useHeight = prvY - 80, radio = useWidth / prvWidth, rHeight = prvHeight * radio;
- if (rHeight < useHeight) {
- prvWidth = useWidth;
- prvHeight = rHeight;
- } else {
- radio = useHeight / prvHeight;
- prvWidth *= radio;
- prvHeight = useHeight;
- }
- ctxCanvasPrv.setFillStyle("black");
- ctxCanvasPrv.fillRect(0, 0, prvX, prvY);
- ctxCanvasPrv.fillRect(x2, y2, width, height);
- this.prvX = prvX = (prvX - prvWidth) / 2;
- this.prvY = prvY = (prvY - prvHeight) / 2;
- this.prvWidth = prvWidth;
- this.prvHeight = prvHeight;
- ctxCanvasPrv.drawImage(r2, prvX, prvY, prvWidth, prvHeight);
- ctxCanvasPrv.draw(false, () => {
- if (this.platform != "android") {
- this.showOper = false;
- }
- this.prvTop = "0";
- });
- },
- fail: () => {
- uni.showToast({
- title: "error2",
- duration: 2e3
- });
- },
- complete: () => {
- uni.hideLoading();
- }
- }, this);
- },
- chooseImage(index2 = void 0, params2 = void 0, data = void 0) {
- if (params2) {
- formatAppLog("log", "at uni_modules/uview-plus/components/u-cropper/u-cropper.vue:698", params2);
- let areaWidth = params2.areaWidth || this.areaWidth, areaHeight = params2.areaHeight || this.areaHeight, expWidth = params2.exportWidth || this.exportWidth, expHeight = params2.exportHeight || this.exportHeight, quality = params2.quality, canRotate = params2.canRotate, canScale = params2.canScale, canChangeSize = params2.canChangeSize, minScale = params2.minScale, maxScale = params2.maxScale, stretch = params2.stretch, inner = params2.inner, lock = params2.lock;
- formatAppLog("log", "at uni_modules/uview-plus/components/u-cropper/u-cropper.vue:712", "areaWidth", this.areaWidth);
- expWidth && (this.expWidth = expWidth.indexOf("rpx") >= 0 ? parseInt(expWidth) * this.pxRatio : parseInt(expWidth));
- expHeight && (this.expHeight = expHeight.indexOf("rpx") >= 0 ? parseInt(expHeight) * this.pxRatio : parseInt(expHeight));
- this.letRotate = canRotate === false ? 0 : 1;
- this.letScale = canScale === false ? 0 : 1;
- this.letChangeSize = canChangeSize || false;
- this.qlty = parseInt(quality) || 0.9;
- this.mnScale = minScale || 0.3;
- this.mxScale = maxScale || 4;
- this.stc = stretch;
- this.isin = inner === true ? 1 : 0;
- this.lck = lock;
- if (this.isin) {
- this.btnWidth = "24%";
- this.btnDsp = "none";
- } else {
- this.btnWidth = "19%";
- this.btnDsp = "flex";
- }
- if (areaWidth && areaHeight) {
- areaWidth = areaWidth.indexOf("rpx") >= 0 ? parseInt(areaWidth) * this.pxRatio : parseInt(areaWidth);
- areaHeight = areaHeight.indexOf("rpx") >= 0 ? parseInt(areaHeight) * this.pxRatio : parseInt(areaHeight);
- this.selStyle.width = areaWidth + "px";
- this.selStyle.height = areaHeight + "px";
- this.selStyle.top = (this.windowHeight - areaHeight - tabHeight) / 2 + "px";
- this.selStyle.left = (this.windowWidth - areaWidth) / 2 + "px";
- this.hasSel = true;
- }
- }
- this.rtn = data;
- this.indx = index2;
- this.select();
- },
- rotate() {
- if (this.platform === "android") {
- if (this.fRotateing)
- return;
- this.fRotateing = true;
- setTimeout(() => {
- this.fRotateing = false;
- }, 500);
- }
- this.rotateDeg += 90 - this.rotateDeg % 90;
- this.drawImage();
- },
- start(e2) {
- let touches = e2.touches, touch0 = touches[0], touch1 = touches[1];
- this.touch0 = touch0;
- this.touch1 = touch1;
- if (touch1) {
- let x2 = touch1.x - touch0.x, y2 = touch1.y - touch0.y;
- this.fgDistance = Math.sqrt(x2 * x2 + y2 * y2);
- } else {
- if (this.letChangeSize) {
- const controlPointSize = 20;
- const x2 = touch0.x;
- const y2 = touch0.y;
- const style = this.selStyle;
- const left = parseInt(style.left);
- const top = parseInt(style.top);
- const width = parseInt(style.width);
- const height = parseInt(style.height);
- if (Math.abs(x2 - left) < controlPointSize && Math.abs(y2 - top) < controlPointSize) {
- this.resizeHandle = "top-left";
- } else if (Math.abs(x2 - (left + width)) < controlPointSize && Math.abs(y2 - top) < controlPointSize) {
- this.resizeHandle = "top-right";
- } else if (Math.abs(x2 - left) < controlPointSize && Math.abs(y2 - (top + height)) < controlPointSize) {
- this.resizeHandle = "bottom-left";
- } else if (Math.abs(x2 - (left + width)) < controlPointSize && Math.abs(y2 - (top + height)) < controlPointSize) {
- this.resizeHandle = "bottom-right";
- } else {
- this.resizeHandle = null;
- }
- } else {
- this.resizeHandle = null;
- }
- }
- },
- move(e2) {
- let touches = e2.touches, touch0 = touches[0], touch1 = touches[1];
- if (touch1) {
- let x2 = touch1.x - touch0.x, y2 = touch1.y - touch0.y, fgDistance = Math.sqrt(x2 * x2 + y2 * y2), scaleSize = 5e-3 * (fgDistance - this.fgDistance), beScaleSize = this.scaleSize + scaleSize;
- do {
- if (!this.letScale)
- break;
- if (beScaleSize < this.mnScale)
- break;
- if (beScaleSize > this.mxScale)
- break;
- if (this.isin) {
- let imgWidth = this.useWidth * beScaleSize, imgHeight = this.useHeight * beScaleSize, rx0 = this.posWidth + this.useWidth / 2, ry0 = this.posHeight + this.useHeight / 2, l2 = rx0 - imgWidth / 2, t2 = ry0 - imgHeight / 2, r2 = l2 + imgWidth, b2 = t2 + imgHeight, left = parseInt(this.selStyle.left), top = parseInt(this.selStyle.top), width = parseInt(this.selStyle.width), height = parseInt(this.selStyle.height);
- if (left < l2 || left + width > r2 || top < t2 || top + height > b2)
- break;
- this.scaleWidth = (this.useWidth - imgWidth) / 2;
- this.scaleHeight = (this.useHeight - imgHeight) / 2;
- }
- this.scaleSize = beScaleSize;
- } while (0);
- this.fgDistance = fgDistance;
- if (touch1.x !== touch0.x && this.letRotate) {
- x2 = (this.touch1.y - this.touch0.y) / (this.touch1.x - this.touch0.x);
- y2 = (touch1.y - touch0.y) / (touch1.x - touch0.x);
- this.rotateDeg += Math.atan((y2 - x2) / (1 + x2 * y2)) * 180 / Math.PI;
- this.touch0 = touch0;
- this.touch1 = touch1;
- }
- this.drawImage();
- } else if (this.touch0) {
- if (this.resizeHandle && this.letChangeSize) {
- const style = { ...this.selStyle };
- const left = parseInt(style.left);
- const top = parseInt(style.top);
- const width = parseInt(style.width);
- const height = parseInt(style.height);
- const minWidth = 50;
- const minHeight = 50;
- switch (this.resizeHandle) {
- case "top-left":
- style.left = touch0.x + "px";
- style.top = touch0.y + "px";
- style.width = left + width - touch0.x + "px";
- style.height = top + height - touch0.y + "px";
- break;
- case "top-right":
- style.top = touch0.y + "px";
- style.width = touch0.x - left + "px";
- style.height = top + height - touch0.y + "px";
- break;
- case "bottom-left":
- style.left = touch0.x + "px";
- style.width = left + width - touch0.x + "px";
- style.height = touch0.y - top + "px";
- break;
- case "bottom-right":
- style.width = touch0.x - left + "px";
- style.height = touch0.y - top + "px";
- break;
- }
- if (parseInt(style.width) >= minWidth && parseInt(style.height) >= minHeight) {
- if (parseInt(style.left) >= 0 && parseInt(style.top) >= 0 && parseInt(style.left) + parseInt(style.width) <= this.windowWidth && parseInt(style.top) + parseInt(style.height) <= this.windowHeight - tabHeight) {
- this.selStyle = style;
- this.drawInit();
- }
- }
- } else {
- let x2 = touch0.x - this.touch0.x, y2 = touch0.y - this.touch0.y, beX = this.posWidth + x2, beY = this.posHeight + y2;
- if (this.isin) {
- let imgWidth = this.useWidth * this.scaleSize, imgHeight = this.useHeight * this.scaleSize, rx0 = beX + this.useWidth / 2, ry0 = beY + this.useHeight / 2, l2 = rx0 - imgWidth / 2, t2 = ry0 - imgHeight / 2, r2 = l2 + imgWidth, b2 = t2 + imgHeight, left = parseInt(this.selStyle.left), top = parseInt(this.selStyle.top), width = parseInt(this.selStyle.width), height = parseInt(this.selStyle.height);
- if (!this.lckWidth && Math.abs(x2) < 100) {
- if (left >= l2 && left + width <= r2) {
- this.posWidth = beX;
- } else if (left < l2) {
- this.posWidth = left - this.scaleWidth;
- } else if (left + width > r2) {
- this.posWidth = left - (imgWidth - width) - this.scaleWidth;
- }
- }
- if (!this.lckHeight && Math.abs(y2) < 100) {
- if (top >= t2 && top + height <= b2) {
- this.posHeight = beY;
- } else if (top < t2) {
- this.posHeight = top - this.scaleHeight;
- } else if (top + height > b2) {
- this.posHeight = top - (imgHeight - height) - this.scaleHeight;
- }
- }
- } else {
- if (Math.abs(x2) < 100 && !this.lckWidth)
- this.posWidth = beX;
- if (Math.abs(y2) < 100 && !this.lckHeight)
- this.posHeight = beY;
- }
- this.touch0 = touch0;
- this.drawImage();
- }
- }
- },
- end(e2) {
- let touches = e2.touches, touch0 = touches && touches[0];
- touches && touches[1];
- if (touch0) {
- this.touch0 = touch0;
- } else {
- this.touch0 = null;
- this.touch1 = null;
- this.resizeHandle = null;
- }
- },
- getImgData() {
- return new Promise((resolve, reject) => {
- let prvX = this.prvX, prvY = this.prvY, prvWidth = this.prvWidth, prvHeight = this.prvHeight;
- prvX *= this.pixelRatio;
- prvY *= this.pixelRatio;
- prvWidth *= this.pixelRatio;
- prvHeight *= this.pixelRatio;
- uni.canvasGetImageData({
- canvasId: "prv-canvas-" + this.instanceId,
- x: prvX,
- y: prvY,
- width: prvWidth,
- height: prvHeight,
- success(res) {
- resolve(res.data);
- },
- fail(err) {
- reject(err);
- }
- }, this);
- });
- },
- async colorChange(e2) {
- let tm_now = Date.now();
- if (tm_now - this.prvTm < 100)
- return;
- this.prvTm = tm_now;
- uni.showLoading({ mask: true });
- if (!this.prvImgData) {
- if (!(this.prvImgData = await this.getImgData().catch((res) => {
- uni.showToast({
- title: "error_read",
- duration: 2e3
- });
- })))
- return;
- this.target = new Uint8ClampedArray(this.prvImgData.length);
- }
- let data = this.prvImgData, target = this.target, i2 = e2.detail.value, r2, g2, b2, a2, h2, s2, l2, d2, p2, q2, min, max, hK, tR, tG, tB;
- if (i2 === 0) {
- target = data;
- } else {
- i2 = (i2 + 100) / 200;
- if (i2 < 5e-3)
- i2 = 0;
- if (i2 > 0.995)
- i2 = 1;
- for (let n2 = data.length - 1; n2 >= 0; n2 -= 4) {
- r2 = data[n2 - 3] / 255;
- g2 = data[n2 - 2] / 255;
- b2 = data[n2 - 1] / 255;
- max = Math.max(r2, g2, b2);
- min = Math.min(r2, g2, b2);
- d2 = max - min;
- if (max === min) {
- h2 = 0;
- } else if (max === r2 && g2 >= b2) {
- h2 = 60 * ((g2 - b2) / d2);
- } else if (max === r2 && g2 < b2) {
- h2 = 60 * ((g2 - b2) / d2) + 360;
- } else if (max === g2) {
- h2 = 60 * ((b2 - r2) / d2) + 120;
- } else if (max === b2) {
- h2 = 60 * ((r2 - g2) / d2) + 240;
- }
- l2 = (max + min) / 2;
- if (l2 === 0 || max === min) {
- s2 = 0;
- } else if (0 < l2 && l2 <= 0.5) {
- s2 = d2 / (2 * l2);
- } else if (l2 > 0.5) {
- s2 = d2 / (2 - 2 * l2);
- }
- data[n2] && (a2 = data[n2]);
- if (i2 < 0.5) {
- s2 = s2 * i2 / 0.5;
- } else if (i2 > 0.5) {
- s2 = 2 * s2 + 2 * i2 - s2 * i2 / 0.5 - 1;
- }
- if (s2 === 0) {
- r2 = g2 = b2 = Math.round(l2 * 255);
- } else {
- if (l2 < 0.5) {
- q2 = l2 * (1 + s2);
- } else if (l2 >= 0.5) {
- q2 = l2 + s2 - l2 * s2;
- }
- p2 = 2 * l2 - q2;
- hK = h2 / 360;
- tR = hK + 1 / 3;
- tG = hK;
- tB = hK - 1 / 3;
- let correctRGB = (t2) => {
- if (t2 < 0) {
- return t2 + 1;
- }
- if (t2 > 1) {
- return t2 - 1;
- }
- return t2;
- };
- let createRGB = (t2) => {
- if (t2 < 1 / 6) {
- return p2 + (q2 - p2) * 6 * t2;
- } else if (t2 >= 1 / 6 && t2 < 1 / 2) {
- return q2;
- } else if (t2 >= 1 / 2 && t2 < 2 / 3) {
- return p2 + (q2 - p2) * 6 * (2 / 3 - t2);
- }
- return p2;
- };
- r2 = tR = Math.round(createRGB(correctRGB(tR)) * 255);
- g2 = tG = Math.round(createRGB(correctRGB(tG)) * 255);
- b2 = tB = Math.round(createRGB(correctRGB(tB)) * 255);
- }
- a2 && (target[n2] = a2);
- target[n2 - 3] = r2;
- target[n2 - 2] = g2;
- target[n2 - 1] = b2;
- }
- }
- let prvX = this.prvX, prvY = this.prvY, prvWidth = this.prvWidth, prvHeight = this.prvHeight;
- this.ctxCanvasPrv.setFillStyle("black");
- this.ctxCanvasPrv.fillRect(prvX, prvY, prvWidth, prvHeight);
- this.ctxCanvasPrv.draw(true);
- prvX *= this.pixelRatio;
- prvY *= this.pixelRatio;
- prvWidth *= this.pixelRatio;
- prvHeight *= this.pixelRatio;
- uni.canvasPutImageData({
- canvasId: "prv-canvas-" + this.instanceId,
- x: prvX,
- y: prvY,
- width: prvWidth,
- height: prvHeight,
- data: target,
- fail() {
- uni.showToast({
- title: "error_put",
- duration: 2e3
- });
- },
- complete() {
- uni.hideLoading();
- }
- }, this);
- },
- btop(base64) {
- return new Promise(function(resolve, reject) {
- var arr = base64.split(","), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n2 = bstr.length, u8arr = new Uint8Array(n2);
- while (n2--) {
- u8arr[n2] = bstr.charCodeAt(n2);
- }
- return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([u8arr], { type: mime })));
- });
- }
- }
- };
- function _sfc_render$1y(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-cropper" }, [
- vue.createCommentVNode(' <image :src="imgSrc.imgSrc" @click="select" :style="[ imgStyle ]" class="my-avatar"></image> '),
- vue.createElementVNode("canvas", {
- "canvas-id": "avatar-canvas-" + $data.instanceId,
- id: "avatar-canvas-" + $data.instanceId,
- class: "my-canvas",
- style: vue.normalizeStyle({ top: $data.styleTop, height: $data.cvsStyleHeight }),
- "disable-scroll": "false"
- }, null, 12, ["canvas-id", "id"]),
- vue.createElementVNode("canvas", {
- "canvas-id": "oper-canvas-" + $data.instanceId,
- id: "oper-canvas-" + $data.instanceId,
- class: "oper-canvas",
- style: vue.normalizeStyle({ top: $data.styleTop, height: $data.cvsStyleHeight }),
- "disable-scroll": "false",
- onTouchstart: _cache[0] || (_cache[0] = (...args) => $options.start && $options.start(...args)),
- onTouchmove: _cache[1] || (_cache[1] = (...args) => $options.move && $options.move(...args)),
- onTouchend: _cache[2] || (_cache[2] = (...args) => $options.end && $options.end(...args))
- }, null, 44, ["canvas-id", "id"]),
- vue.createElementVNode("canvas", {
- "canvas-id": "prv-canvas-" + $data.instanceId,
- id: "prv-canvas-" + $data.instanceId,
- class: "prv-canvas",
- "disable-scroll": "false",
- onTouchstart: _cache[3] || (_cache[3] = (...args) => $options.hideImg && $options.hideImg(...args)),
- style: vue.normalizeStyle({ height: $data.cvsStyleHeight, top: $data.prvTop })
- }, null, 44, ["canvas-id", "id"]),
- vue.createElementVNode(
- "view",
- {
- class: "oper-wrapper",
- style: vue.normalizeStyle({ display: $data.styleDisplay })
- },
- [
- vue.createElementVNode("view", { class: "oper" }, [
- $data.showOper ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "btn-wrapper"
- }, [
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[4] || (_cache[4] = (...args) => $options.select && $options.select(...args)),
- "hover-class": "hover",
- style: vue.normalizeStyle({ width: $data.btnWidth })
- },
- [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($options.t("up.common.re-select")),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[5] || (_cache[5] = (...args) => $options.close && $options.close(...args)),
- "hover-class": "hover",
- style: vue.normalizeStyle({ width: $data.btnWidth })
- },
- [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($options.t("up.common.close")),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[6] || (_cache[6] = (...args) => $options.rotate && $options.rotate(...args)),
- "hover-class": "hover",
- style: vue.normalizeStyle({ width: $data.btnWidth, display: $data.btnDsp })
- },
- [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($options.t("up.common.rotate")),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[7] || (_cache[7] = (...args) => $options.preview && $options.preview(...args)),
- "hover-class": "hover",
- style: vue.normalizeStyle({ width: $data.btnWidth })
- },
- [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($options.t("up.common.preview")),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[8] || (_cache[8] = (...args) => $options.confirm && $options.confirm(...args)),
- "hover-class": "hover",
- style: vue.normalizeStyle({ width: $data.btnWidth })
- },
- [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($options.t("up.common.confirm")),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- )
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "clr-wrapper"
- }, [
- vue.createElementVNode(
- "slider",
- {
- class: "my-slider",
- onChange: _cache[9] || (_cache[9] = (...args) => $options.colorChange && $options.colorChange(...args)),
- "block-size": "25",
- value: "0",
- min: "-100",
- max: "100",
- activeColor: "red",
- backgroundColor: "green",
- "block-color": "grey",
- "show-value": ""
- },
- null,
- 32
- /* NEED_HYDRATION */
- ),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[10] || (_cache[10] = (...args) => $options.prvUpload && $options.prvUpload(...args)),
- "hover-class": "hover",
- style: vue.normalizeStyle({ width: $data.btnWidth })
- },
- [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($options.t("up.common.confirm")),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- )
- ]))
- ])
- ],
- 4
- /* STYLE */
- ),
- $data.styleDisplay == "none" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- onClick: _cache[11] || (_cache[11] = ($event) => $options.chooseImage(0, {}))
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const uCropper = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["render", _sfc_render$1y], ["__scopeId", "data-v-4888bba5"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-cropper/u-cropper.vue"]]);
- const __vite_glob_0_33 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uCropper
- }, Symbol.toStringTag, { value: "Module" }));
- const props$11 = defineMixin({
- props: {
- // 是否展示工具条
- show: {
- type: Boolean,
- default: () => props$1x.toolbar.show
- },
- // 取消按钮的文字
- cancelText: {
- type: String,
- default: () => props$1x.toolbar.cancelText
- },
- // 确认按钮的文字
- confirmText: {
- type: String,
- default: () => props$1x.toolbar.confirmText
- },
- // 取消按钮的颜色
- cancelColor: {
- type: String,
- default: () => props$1x.toolbar.cancelColor
- },
- // 确认按钮的颜色
- confirmColor: {
- type: String,
- default: () => props$1x.toolbar.confirmColor
- },
- // 标题文字
- title: {
- type: String,
- default: () => props$1x.toolbar.title
- },
- // 开启右侧插槽
- rightSlot: {
- type: Boolean,
- default: false
- }
- }
- });
- const _sfc_main$1y = {
- name: "u-toolbar",
- mixins: [mpMixin, mixin, props$11],
- emits: ["confirm", "cancel"],
- created() {
- },
- methods: {
- // 点击取消按钮
- cancel() {
- this.$emit("cancel");
- },
- // 点击确定按钮
- confirm() {
- this.$emit("confirm");
- }
- }
- };
- function _sfc_render$1x(_ctx, _cache, $props, $setup, $data, $options) {
- return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-toolbar",
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers((...args) => _ctx.noop && _ctx.noop(...args), ["stop", "prevent"]))
- },
- [
- vue.createElementVNode("view", { class: "u-toolbar__left" }, [
- 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: _ctx.cancelColor
- })
- },
- vue.toDisplayString(_ctx.cancelText),
- 5
- /* TEXT, STYLE */
- )
- ])
- ]),
- _ctx.title ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-toolbar__title u-line-1"
- },
- vue.toDisplayString(_ctx.title),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "u-toolbar__right" }, [
- !_ctx.rightSlot ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- 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: _ctx.confirmColor
- })
- },
- vue.toDisplayString(_ctx.confirmText),
- 5
- /* TEXT, STYLE */
- )
- ])) : vue.renderSlot(_ctx.$slots, "right", { key: 1 }, void 0, true)
- ])
- ],
- 32
- /* NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0$5 = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["render", _sfc_render$1x], ["__scopeId", "data-v-eadae74e"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-toolbar/u-toolbar.vue"]]);
- const __vite_glob_0_121 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$5
- }, Symbol.toStringTag, { value: "Module" }));
- const props$10 = defineMixin({
- props: {
- modelValue: {
- type: Array,
- default: () => []
- },
- hasInput: {
- type: Boolean,
- default: false
- },
- inputProps: {
- type: Object,
- default: () => {
- return {};
- }
- },
- disabled: {
- type: Boolean,
- default: () => props$1x.picker.disabled
- },
- disabledColor: {
- type: String,
- default: () => props$1x.picker.disabledColor
- },
- placeholder: {
- type: String,
- default: () => props$1x.picker.placeholder
- },
- // 是否展示picker弹窗
- show: {
- type: Boolean,
- default: () => props$1x.picker.show
- },
- // 弹出的方向,可选值为 top bottom right left center
- popupMode: {
- type: String,
- default: () => props$1x.picker.popupMode
- },
- // 是否展示顶部的操作栏
- showToolbar: {
- type: Boolean,
- default: () => props$1x.picker.showToolbar
- },
- // 顶部标题
- title: {
- type: String,
- default: () => props$1x.picker.title
- },
- // 对象数组,设置每一列的数据
- columns: {
- type: Array,
- default: () => props$1x.picker.columns
- },
- // 是否显示加载中状态
- loading: {
- type: Boolean,
- default: () => props$1x.picker.loading
- },
- // 各列中,单个选项的高度
- itemHeight: {
- type: [String, Number],
- default: () => props$1x.picker.itemHeight
- },
- // 取消按钮的文字
- cancelText: {
- type: String,
- default: () => props$1x.picker.cancelText
- },
- // 确认按钮的文字
- confirmText: {
- type: String,
- default: () => props$1x.picker.confirmText
- },
- // 取消按钮的颜色
- cancelColor: {
- type: String,
- default: () => props$1x.picker.cancelColor
- },
- // 确认按钮的颜色
- confirmColor: {
- type: String,
- default: () => props$1x.picker.confirmColor
- },
- // 每列中可见选项的数量
- visibleItemCount: {
- type: [String, Number],
- default: () => props$1x.picker.visibleItemCount
- },
- // 选项对象中,需要展示的属性键名
- keyName: {
- type: String,
- default: () => props$1x.picker.keyName
- },
- // 选项对象中,需要获取的属性值键名
- valueName: {
- type: String,
- default: () => props$1x.picker.valueName
- },
- // 是否允许点击遮罩关闭选择器
- closeOnClickOverlay: {
- type: Boolean,
- default: () => props$1x.picker.closeOnClickOverlay
- },
- // 各列的默认索引
- defaultIndex: {
- type: Array,
- default: () => props$1x.picker.defaultIndex
- },
- // 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件,只在微信2.21.1及以上有效
- immediateChange: {
- type: Boolean,
- default: () => props$1x.picker.immediateChange
- },
- // 工具栏右侧插槽是否开启
- toolbarRightSlot: {
- type: Boolean,
- default: false
- },
- // 层级
- zIndex: {
- type: [String, Number],
- default: () => props$1x.picker.zIndex
- },
- // 弹窗背景色,设置为transparent可去除白色背景
- bgColor: {
- type: String,
- default: () => props$1x.picker.bgColor
- },
- // 是否显示圆角
- round: {
- type: [Boolean, String, Number],
- default: () => props$1x.picker.round
- },
- // 动画时长,单位ms
- duration: {
- type: [String, Number],
- default: () => props$1x.picker.duration
- },
- // 遮罩的透明度,0-1之间
- overlayOpacity: {
- type: [Number, String],
- default: () => props$1x.picker.overlayOpacity
- },
- // 是否页面内展示
- pageInline: {
- type: Boolean,
- default: () => props$1x.picker.pageInline
- }
- }
- });
- const _sfc_main$1x = {
- name: "u-picker",
- mixins: [mpMixin, mixin, props$10],
- data() {
- return {
- // 上一次选择的列索引
- lastIndex: [],
- // 索引值 ,对应picker-view的value
- innerIndex: [],
- // 各列的值
- innerColumns: [],
- // 上一次的变化列索引
- columnIndex: 0,
- showByClickInput: false,
- currentActiveValue: []
- //当前用户选中,但是还没确认的值,用户没做change操作时候,点击确认可以默认选中第一个
- };
- },
- watch: {
- // 监听columns参数的变化
- columns: {
- immediate: true,
- deep: true,
- handler(n2) {
- this.setColumns(n2);
- }
- },
- // 监听默认索引的变化,重新设置对应的值
- defaultIndex: {
- immediate: true,
- deep: true,
- handler(n2, o2) {
- if (!o2 || n2.join("/") != o2.join("/")) {
- this.setIndexs(n2, true);
- }
- }
- },
- modelValue: {
- immediate: true,
- deep: true,
- handler(n2, o2) {
- if (!o2 || n2.join("/") != o2.join("/")) {
- let arr = [];
- if (n2 != null) {
- n2.forEach((element, index2) => {
- let currentCols = this.getColumnValues(index2);
- if (currentCols && Object.prototype.toString.call(currentCols) === "[object Object]") {
- currentCols.forEach((item, index22) => {
- if (item[this.keyName] == element) {
- arr.push(index22);
- }
- });
- } else {
- currentCols.forEach((item, index22) => {
- if (item == element) {
- arr.push(index22);
- }
- });
- }
- });
- if (arr.length == 0 && this.defaultIndex)
- ;
- else {
- this.setIndexs(arr, true);
- }
- }
- }
- }
- }
- },
- emits: ["close", "cancel", "confirm", "change", "update:modelValue", "update:show"],
- computed: {
- // input的props
- inputPropsInner() {
- return {
- border: this.inputBorder,
- placeholder: this.placeholder,
- disabled: this.disabled,
- disabledColor: this.disabledColor,
- ...this.inputProps
- };
- },
- //已选&&已确认的值显示在input上面的文案
- inputLabel() {
- let firstItem = this.innerColumns[0] && this.innerColumns[0][0];
- if (firstItem && Object.prototype.toString.call(firstItem) === "[object Object]") {
- let res = this.innerColumns[0].filter((item) => this.modelValue.includes(item["id"]));
- res = res.map((item) => item[this.keyName]);
- return res.join("/");
- } else {
- return this.modelValue.join("/");
- }
- },
- //已选,待确认的值
- inputValue() {
- let items = this.innerColumns.map((item, index2) => item[this.innerIndex[index2]]);
- let res = [];
- if (items[0] && Object.prototype.toString.call(items[0]) === "[object Object]") {
- items.forEach((element) => {
- res.push(element && element[this.valueName]);
- });
- } else {
- items.forEach((element, index2) => {
- res.push(element);
- });
- }
- return res;
- }
- },
- methods: {
- addUnit,
- testArray: test.array,
- onShowByClickInput() {
- if (!this.disabled) {
- this.showByClickInput = !this.showByClickInput;
- }
- },
- // 获取item需要显示的文字,判别为对象还是文本
- getItemText(item) {
- if (test.object(item)) {
- return item[this.keyName];
- } else {
- return item;
- }
- },
- // 关闭选择器
- closeHandler() {
- if (this.closeOnClickOverlay) {
- if (this.hasInput) {
- this.showByClickInput = false;
- }
- this.setDefault();
- this.$emit("update:show", false);
- this.$emit("close");
- }
- },
- // 点击工具栏的取消按钮
- cancel() {
- if (this.hasInput) {
- this.showByClickInput = false;
- }
- this.setDefault();
- this.$emit("update:show", false);
- this.$emit("cancel");
- },
- setDefault() {
- let arr = [0];
- if (this.lastIndex.length == 0) {
- if (Array.isArray(this.defaultIndex) && this.defaultIndex.length == this.innerColumns.length) {
- arr = [...this.defaultIndex];
- } else {
- arr = Array(this.innerColumns.length).fill(0);
- }
- } else {
- arr = deepClone(this.lastIndex);
- }
- this.setLastIndex(arr);
- this.setIndexs(arr);
- },
- // 点击工具栏的确定按钮
- confirm() {
- if (!this.currentActiveValue.length) {
- this.setDefault();
- }
- this.$emit("update:modelValue", this.inputValue);
- if (this.hasInput) {
- this.showByClickInput = false;
- }
- this.setLastIndex(this.innerIndex);
- this.$emit("update:show", false);
- this.$emit("confirm", {
- indexs: this.innerIndex,
- value: this.innerColumns.map((item, index2) => item[this.innerIndex[index2]]),
- values: this.innerColumns
- });
- },
- // 选择器某一列的数据发生变化时触发
- changeHandler(e2) {
- const {
- value: value2
- } = e2.detail;
- let index2 = 0, columnIndex = 0;
- this.currentActiveValue = value2;
- for (let i2 = 0; i2 < value2.length; i2++) {
- let item = value2[i2];
- if (item !== (this.lastIndex[i2] || 0)) {
- columnIndex = i2;
- index2 = item;
- break;
- }
- }
- this.columnIndex = columnIndex;
- const values = this.innerColumns;
- this.setIndexs(value2);
- this.$emit("change", {
- // 微信小程序不能传递this,会因为循环引用而报错
- // picker: this,
- value: this.innerColumns.map((item, index3) => item[value2[index3]]),
- index: index2,
- indexs: value2,
- // values为当前变化列的数组内容
- values,
- columnIndex
- });
- },
- // 设置index索引,此方法可被外部调用设置
- setIndexs(index2, setLastIndex) {
- this.innerIndex = deepClone(index2);
- if (setLastIndex) {
- this.setLastIndex(index2);
- }
- },
- // 记录上一次的各列索引位置
- setLastIndex(index2) {
- this.lastIndex = deepClone(index2);
- },
- // 设置对应列选项的所有值
- setColumnValues(columnIndex, values) {
- this.innerColumns.splice(columnIndex, 1, values);
- this.setLastIndex(this.innerIndex.slice(0, columnIndex));
- let tmpIndex = deepClone(this.innerIndex);
- for (let i2 = 0; i2 < this.innerColumns.length; i2++) {
- if (i2 > this.columnIndex) {
- tmpIndex[i2] = 0;
- }
- }
- this.setIndexs(tmpIndex);
- },
- // 获取对应列的所有选项
- getColumnValues(columnIndex) {
- (async () => {
- await sleep();
- })();
- return this.innerColumns[columnIndex];
- },
- // 设置整体各列的columns的值
- setColumns(columns) {
- this.innerColumns = deepClone(columns);
- if (this.innerIndex.length === 0) {
- this.innerIndex = new Array(columns.length).fill(0);
- }
- },
- // 获取各列选中值对应的索引
- getIndexs() {
- return this.innerIndex;
- },
- // 获取各列选中的值
- getValues() {
- (async () => {
- await sleep();
- })();
- return this.innerColumns.map((item, index2) => item[this.innerIndex[index2]]);
- }
- }
- };
- function _sfc_render$1w(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_input = vue.resolveComponent("up-input");
- const _component_u_toolbar = resolveEasycom(vue.resolveDynamicComponent("u-toolbar"), __easycom_0$5);
- const _component_u_loading_icon = resolveEasycom(vue.resolveDynamicComponent("u-loading-icon"), __easycom_0$e);
- const _component_u_popup = resolveEasycom(vue.resolveDynamicComponent("u-popup"), __easycom_2);
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-picker-wraper" }, [
- _ctx.hasInput ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-picker-input cursor-pointer",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.onShowByClickInput && $options.onShowByClickInput(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default", { value: $options.inputLabel }, void 0, true),
- vue.renderSlot(_ctx.$slots, "trigger", { value: $options.inputLabel }, void 0, true),
- !_ctx.$slots["default"] && !_ctx.$slots["$default"] && !_ctx.$slots["trigger"] ? (vue.openBlock(), vue.createBlock(_component_up_input, vue.mergeProps({
- key: 0,
- readonly: true,
- modelValue: $options.inputLabel,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.inputLabel = $event)
- }, $options.inputPropsInner), null, 16, ["modelValue"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "input-cover" })
- ])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_u_popup, {
- show: _ctx.show || _ctx.hasInput && $data.showByClickInput,
- mode: _ctx.popupMode,
- zIndex: _ctx.zIndex,
- bgColor: _ctx.bgColor,
- round: _ctx.round,
- duration: _ctx.duration,
- pageInline: _ctx.pageInline,
- overlayOpacity: _ctx.overlayOpacity,
- onClose: $options.closeHandler
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "u-picker" }, [
- _ctx.showToolbar ? (vue.openBlock(), vue.createBlock(_component_u_toolbar, {
- key: 0,
- cancelColor: _ctx.cancelColor,
- confirmColor: _ctx.confirmColor,
- cancelText: _ctx.cancelText,
- confirmText: _ctx.confirmText,
- title: _ctx.title,
- rightSlot: _ctx.toolbarRightSlot ? true : false,
- onCancel: $options.cancel,
- onConfirm: $options.confirm
- }, {
- right: vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "toolbar-right", {}, void 0, true)
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["cancelColor", "confirmColor", "cancelText", "confirmText", "title", "rightSlot", "onCancel", "onConfirm"])) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "toolbar-bottom", {}, void 0, true),
- vue.createElementVNode("picker-view", {
- class: "u-picker__view",
- indicatorStyle: `height: ${$options.addUnit(_ctx.itemHeight, "px")}`,
- value: $data.innerIndex,
- immediateChange: _ctx.immediateChange,
- style: vue.normalizeStyle({
- height: `${$options.addUnit(_ctx.visibleItemCount * _ctx.itemHeight, "px")}`
- }),
- onChange: _cache[2] || (_cache[2] = (...args) => $options.changeHandler && $options.changeHandler(...args))
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.innerColumns, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("picker-view-column", {
- key: index2,
- class: "u-picker__view__column"
- }, [
- $options.testArray(item) ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList(item, (item1, index1) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-picker__view__column__item u-line-1", [index1 === $data.innerIndex[index2] && "u-picker__view__column__item--selected"]]),
- key: index1,
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.itemHeight, "px"),
- lineHeight: $options.addUnit(_ctx.itemHeight, "px"),
- fontWeight: index1 === $data.innerIndex[index2] ? "bold" : "normal",
- display: "block"
- })
- },
- vue.toDisplayString($options.getItemText(item1)),
- 7
- /* TEXT, CLASS, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 44, ["indicatorStyle", "value", "immediateChange"]),
- _ctx.loading ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-picker--loading"
- }, [
- vue.createVNode(_component_u_loading_icon, { mode: "circle" })
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "mode", "zIndex", "bgColor", "round", "duration", "pageInline", "overlayOpacity", "onClose"])
- ]);
- }
- const __easycom_0$4 = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["render", _sfc_render$1w], ["__scopeId", "data-v-91b05052"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-picker/u-picker.vue"]]);
- const __vite_glob_0_78 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$4
- }, Symbol.toStringTag, { value: "Module" }));
- const props$$ = defineMixin({
- props: {
- // 是否显示input
- hasInput: {
- type: Boolean,
- default: false
- },
- inputProps: {
- type: Object,
- default: () => {
- return {};
- }
- },
- inputBorder: {
- type: String,
- default: () => props$1x.input.inputBorder
- },
- disabled: {
- type: Boolean,
- default: () => props$1x.input.disabled
- },
- disabledColor: {
- type: String,
- default: () => props$1x.input.disabledColor
- },
- placeholder: {
- type: String,
- default: () => props$1x.input.placeholder
- },
- format: {
- type: String,
- default: () => ""
- },
- // 是否打开组件
- show: {
- type: Boolean,
- default: () => props$1x.datetimePicker.show
- },
- // 弹出的方向,可选值为 top bottom right left center
- popupMode: {
- type: String,
- default: () => props$1x.picker.popupMode
- },
- // 是否展示顶部的操作栏
- showToolbar: {
- type: Boolean,
- default: () => props$1x.datetimePicker.showToolbar
- },
- // 工具栏右侧内容
- toolbarRightSlot: {
- type: Boolean,
- default: false
- },
- // 绑定值
- modelValue: {
- type: [String, Number],
- default: () => props$1x.datetimePicker.value
- },
- // 顶部标题
- title: {
- type: String,
- default: () => props$1x.datetimePicker.title
- },
- // 展示格式,mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择
- mode: {
- type: String,
- default: () => props$1x.datetimePicker.mode
- },
- // 可选的最大时间
- maxDate: {
- type: Number,
- // 最大默认值为后10年
- default: () => props$1x.datetimePicker.maxDate
- },
- // 可选的最小时间
- minDate: {
- type: Number,
- // 最小默认值为前10年
- default: () => props$1x.datetimePicker.minDate
- },
- // 可选的最小小时,仅mode=time有效
- minHour: {
- type: Number,
- default: () => props$1x.datetimePicker.minHour
- },
- // 可选的最大小时,仅mode=time有效
- maxHour: {
- type: Number,
- default: () => props$1x.datetimePicker.maxHour
- },
- // 可选的最小分钟,仅mode=time有效
- minMinute: {
- type: Number,
- default: () => props$1x.datetimePicker.minMinute
- },
- // 可选的最大分钟,仅mode=time有效
- maxMinute: {
- type: Number,
- default: () => props$1x.datetimePicker.maxMinute
- },
- // 选项过滤函数
- filter: {
- type: [Function, null],
- default: () => props$1x.datetimePicker.filter
- },
- // 选项格式化函数
- formatter: {
- type: [Function, null],
- default: () => props$1x.datetimePicker.formatter
- },
- // 是否显示加载中状态
- loading: {
- type: Boolean,
- default: () => props$1x.datetimePicker.loading
- },
- // 各列中,单个选项的高度
- itemHeight: {
- type: [String, Number],
- default: () => props$1x.datetimePicker.itemHeight
- },
- // 取消按钮的文字
- cancelText: {
- type: String,
- default: () => props$1x.datetimePicker.cancelText
- },
- // 确认按钮的文字
- confirmText: {
- type: String,
- default: () => props$1x.datetimePicker.confirmText
- },
- // 取消按钮的颜色
- cancelColor: {
- type: String,
- default: () => props$1x.datetimePicker.cancelColor
- },
- // 确认按钮的颜色
- confirmColor: {
- type: String,
- default: () => props$1x.datetimePicker.confirmColor
- },
- // 每列中可见选项的数量
- visibleItemCount: {
- type: [String, Number],
- default: () => props$1x.datetimePicker.visibleItemCount
- },
- // 是否允许点击遮罩关闭选择器
- closeOnClickOverlay: {
- type: Boolean,
- default: () => props$1x.datetimePicker.closeOnClickOverlay
- },
- // 各列的默认索引
- defaultIndex: {
- type: Array,
- default: () => props$1x.datetimePicker.defaultIndex
- },
- // 是否页面内展示
- pageInline: {
- type: Boolean,
- default: () => props$1x.datetimePicker.pageInline
- }
- }
- });
- function times(n2, iteratee) {
- let index2 = -1;
- const result = Array(n2 < 0 ? 0 : n2);
- while (++index2 < n2) {
- result[index2] = iteratee(index2);
- }
- return result;
- }
- const _sfc_main$1w = {
- name: "up-datetime-picker",
- mixins: [mpMixin, mixin, props$$],
- data() {
- return {
- // 原来的日期选择器不方便,这里增加一个hasInput选项支持类似element的自带输入框的功能。
- inputValue: "",
- // 表单显示值
- showByClickInput: false,
- // 是否在hasInput模式下显示日期选择弹唱
- columns: [],
- innerDefaultIndex: [],
- innerFormatter: (type2, value2) => value2
- };
- },
- watch: {
- show(newValue, oldValue) {
- if (newValue) {
- this.innerValue = this.correctValue(this.modelValue);
- this.updateColumnValue(this.innerValue);
- }
- },
- modelValue(newValue) {
- this.init();
- },
- propsChange() {
- this.init();
- }
- },
- computed: {
- // 如果以下这些变量发生了变化,意味着需要重新初始化各列的值
- propsChange() {
- return [this.mode, this.maxDate, this.minDate, this.minHour, this.maxHour, this.minMinute, this.maxMinute, this.filter, this.modelValue];
- },
- // input的props
- inputPropsInner() {
- return {
- border: this.inputBorder,
- placeholder: this.placeholder,
- disabled: this.disabled,
- disabledColor: this.disabledColor,
- ...this.inputProps
- };
- }
- },
- mounted() {
- this.init();
- },
- emits: ["close", "cancel", "confirm", "change", "update:modelValue"],
- methods: {
- getInputValue(newValue) {
- if (newValue == "" || !newValue || newValue == void 0) {
- this.inputValue = "";
- return;
- }
- if (this.mode == "time") {
- this.inputValue = newValue;
- } else {
- if (this.format) {
- this.inputValue = e$1(newValue).format(this.format);
- } else {
- let format2 = "";
- switch (this.mode) {
- case "date":
- format2 = "YYYY-MM-DD";
- break;
- case "year-month":
- format2 = "YYYY-MM";
- break;
- case "datehour":
- format2 = "YYYY-MM-DD HH";
- break;
- case "datetime":
- format2 = "YYYY-MM-DD HH:mm";
- break;
- case "time":
- format2 = "HH:mm";
- break;
- }
- this.inputValue = e$1(newValue).format(format2);
- }
- }
- },
- init() {
- this.innerValue = this.correctValue(this.modelValue);
- this.updateColumnValue(this.innerValue);
- this.getInputValue(this.innerValue);
- },
- // 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
- setFormatter(e2) {
- this.innerFormatter = e2;
- },
- // 关闭选择器
- close() {
- if (this.closeOnClickOverlay) {
- this.$emit("close");
- }
- },
- // 点击工具栏的取消按钮
- cancel() {
- if (this.hasInput) {
- this.showByClickInput = false;
- }
- this.$emit("cancel");
- },
- // 点击工具栏的确定按钮
- confirm() {
- this.$emit("update:modelValue", this.innerValue);
- if (this.hasInput) {
- this.getInputValue(this.innerValue);
- this.showByClickInput = false;
- }
- this.$emit("confirm", {
- value: this.innerValue,
- mode: this.mode
- });
- },
- //用正则截取输出值,当出现多组数字时,抛出错误
- intercept(e2, type2) {
- let judge = e2.match(/\d+/g);
- if (judge.length > 1) {
- error("请勿在过滤或格式化函数时添加数字");
- return 0;
- } else if (type2 && judge[0].length == 4) {
- return judge[0];
- } else if (judge[0].length > 2) {
- error("请勿在过滤或格式化函数时添加数字");
- return 0;
- } else {
- return judge[0];
- }
- },
- // 列发生变化时触发
- change(e2) {
- const { indexs, values } = e2;
- let selectValue = "";
- if (this.mode === "time") {
- selectValue = `${this.intercept(values[0][indexs[0]])}:${this.intercept(values[1][indexs[1]])}`;
- } else {
- const year = parseInt(this.intercept(values[0][indexs[0]], "year"));
- const month = parseInt(this.intercept(values[1][indexs[1]]));
- let date3 = parseInt(values[2] ? this.intercept(values[2][indexs[2]]) : 1);
- let hour = 0, minute = 0;
- const maxDate = e$1(`${year}-${month}`).daysInMonth();
- if (this.mode === "year-month") {
- date3 = 1;
- }
- date3 = Math.min(maxDate, date3);
- if (this.mode === "datetime") {
- hour = parseInt(this.intercept(values[3][indexs[3]]));
- minute = parseInt(this.intercept(values[4][indexs[4]]));
- }
- selectValue = Number(new Date(year, month - 1, date3, hour, minute));
- }
- selectValue = this.correctValue(selectValue);
- this.innerValue = selectValue;
- this.updateColumnValue(selectValue);
- this.$emit("change", {
- value: selectValue,
- // 微信小程序不能传递this实例,会因为循环引用而报错
- // picker: this.$refs.picker,
- mode: this.mode
- });
- },
- // 更新各列的值,进行补0、格式化等操作
- updateColumnValue(value2) {
- this.innerValue = value2;
- this.updateColumns();
- setTimeout(() => {
- this.updateIndexs(value2);
- }, 0);
- },
- // 更新索引
- updateIndexs(value2) {
- let values = [];
- const formatter = this.formatter || this.innerFormatter;
- if (this.mode === "time") {
- const timeArr = value2.split(":");
- values = [formatter("hour", timeArr[0]), formatter("minute", timeArr[1])];
- } else {
- values = [
- formatter("year", `${e$1(value2).year()}`),
- // 月份补0
- formatter("month", padZero$1(e$1(value2).month() + 1))
- ];
- if (this.mode === "date") {
- values.push(formatter("day", padZero$1(e$1(value2).date())));
- }
- if (this.mode === "datetime") {
- values.push(formatter("day", padZero$1(e$1(value2).date())), formatter("hour", padZero$1(e$1(value2).hour())), formatter("minute", padZero$1(e$1(value2).minute())));
- }
- }
- const indexs = this.columns.map((column, index2) => {
- return Math.max(0, column.findIndex((item) => item === values[index2]));
- });
- this.innerDefaultIndex = indexs;
- },
- // 更新各列的值
- updateColumns() {
- const formatter = this.formatter || this.innerFormatter;
- const results = this.getOriginColumns().map((column) => column.values.map((value2) => formatter(column.type, value2)));
- this.columns = results;
- },
- getOriginColumns() {
- const results = this.getRanges().map(({ type: type2, range: range2 }) => {
- let values = times(range2[1] - range2[0] + 1, (index2) => {
- let value2 = range2[0] + index2;
- value2 = type2 === "year" ? `${value2}` : padZero$1(value2);
- return value2;
- });
- if (this.filter) {
- values = this.filter(type2, values);
- if (!values || values && values.length == 0) {
- formatAppLog("log", "at uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.vue:366", "日期filter结果不能为空");
- }
- }
- return { type: type2, values };
- });
- return results;
- },
- // 通过最大值和最小值生成数组
- generateArray(start, end) {
- return Array.from(new Array(end + 1).keys()).slice(start);
- },
- // 得出合法的时间
- correctValue(value2) {
- const isDateMode = this.mode !== "time";
- if (isDateMode && !e$1.unix(value2).isValid()) {
- value2 = this.minDate;
- } else if (!isDateMode && !value2) {
- value2 = `${padZero$1(this.minHour)}:${padZero$1(this.minMinute)}`;
- }
- if (!isDateMode) {
- if (String(value2).indexOf(":") === -1)
- return error("时间错误,请传递如12:24的格式");
- let [hour, minute] = value2.split(":");
- hour = padZero$1(range$1(this.minHour, this.maxHour, Number(hour)));
- minute = padZero$1(range$1(this.minMinute, this.maxMinute, Number(minute)));
- return `${hour}:${minute}`;
- } else {
- value2 = e$1(value2).isBefore(e$1(this.minDate)) ? this.minDate : value2;
- value2 = e$1(value2).isAfter(e$1(this.maxDate)) ? this.maxDate : value2;
- return value2;
- }
- },
- // 获取每列的最大和最小值
- getRanges() {
- if (this.mode === "time") {
- return [
- {
- type: "hour",
- range: [this.minHour, this.maxHour]
- },
- {
- type: "minute",
- range: [this.minMinute, this.maxMinute]
- }
- ];
- }
- const { maxYear, maxDate, maxMonth, maxHour, maxMinute } = this.getBoundary("max", this.innerValue);
- const { minYear, minDate, minMonth, minHour, minMinute } = this.getBoundary("min", this.innerValue);
- const result = [
- {
- type: "year",
- range: [minYear, maxYear]
- },
- {
- type: "month",
- range: [minMonth, maxMonth]
- },
- {
- type: "day",
- range: [minDate, maxDate]
- },
- {
- type: "hour",
- range: [minHour, maxHour]
- },
- {
- type: "minute",
- range: [minMinute, maxMinute]
- }
- ];
- if (this.mode === "date")
- result.splice(3, 2);
- if (this.mode === "year-month")
- result.splice(2, 3);
- return result;
- },
- // 根据minDate、maxDate、minHour、maxHour等边界值,判断各列的开始和结束边界值
- getBoundary(type2, innerValue) {
- let value2 = new Date(innerValue);
- if (isNaN(value2.getTime())) {
- value2 = /* @__PURE__ */ new Date();
- }
- const boundary = new Date(this[`${type2}Date`]);
- const year = e$1(boundary).year();
- let month = 1;
- let date3 = 1;
- let hour = 0;
- let minute = 0;
- if (type2 === "max") {
- month = 12;
- date3 = e$1(value2).daysInMonth();
- hour = 23;
- minute = 59;
- }
- if (e$1(value2).year() === year) {
- month = e$1(boundary).month() + 1;
- if (e$1(value2).month() + 1 === month) {
- date3 = e$1(boundary).date();
- if (e$1(value2).date() === date3) {
- hour = e$1(boundary).hour();
- if (e$1(value2).hour() === hour) {
- minute = e$1(boundary).minute();
- }
- }
- }
- }
- return {
- [`${type2}Year`]: year,
- [`${type2}Month`]: month,
- [`${type2}Date`]: date3,
- [`${type2}Hour`]: hour,
- [`${type2}Minute`]: minute
- };
- },
- onShowByClickInput() {
- if (!this.disabled) {
- this.showByClickInput = !this.showByClickInput;
- }
- }
- }
- };
- function _sfc_render$1v(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_input = vue.resolveComponent("up-input");
- const _component_u_picker = resolveEasycom(vue.resolveDynamicComponent("u-picker"), __easycom_0$4);
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-datetime-picker" }, [
- _ctx.hasInput ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-datetime-picker__has-input",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.onShowByClickInput && $options.onShowByClickInput(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "trigger", { value: $data.inputValue }, () => [
- vue.createVNode(_component_up_input, vue.mergeProps({
- readonly: !!$data.showByClickInput,
- modelValue: $data.inputValue,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.inputValue = $event)
- }, $options.inputPropsInner), null, 16, ["readonly", "modelValue"]),
- vue.createElementVNode("view", { class: "input-cover" })
- ], true)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_u_picker, {
- ref: "picker",
- show: _ctx.pageInline || _ctx.show || _ctx.hasInput && $data.showByClickInput,
- popupMode: _ctx.popupMode,
- closeOnClickOverlay: _ctx.closeOnClickOverlay,
- columns: $data.columns,
- title: _ctx.title,
- itemHeight: _ctx.itemHeight,
- showToolbar: _ctx.showToolbar,
- visibleItemCount: _ctx.visibleItemCount,
- defaultIndex: $data.innerDefaultIndex,
- cancelText: _ctx.cancelText,
- confirmText: _ctx.confirmText,
- cancelColor: _ctx.cancelColor,
- confirmColor: _ctx.confirmColor,
- toolbarRightSlot: _ctx.toolbarRightSlot,
- pageInline: _ctx.pageInline,
- onClose: $options.close,
- onCancel: $options.cancel,
- onConfirm: $options.confirm,
- onChange: $options.change
- }, {
- "toolbar-right": vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "toolbar-right", {}, void 0, true)
- ]),
- "toolbar-bottom": vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "toolbar-bottom", {}, void 0, true)
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "popupMode", "closeOnClickOverlay", "columns", "title", "itemHeight", "showToolbar", "visibleItemCount", "defaultIndex", "cancelText", "confirmText", "cancelColor", "confirmColor", "toolbarRightSlot", "pageInline", "onClose", "onCancel", "onConfirm", "onChange"])
- ]);
- }
- const uDatetimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["render", _sfc_render$1v], ["__scopeId", "data-v-e7a0f1eb"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.vue"]]);
- const __vite_glob_0_34 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uDatetimePicker
- }, Symbol.toStringTag, { value: "Module" }));
- const props$_ = defineMixin({
- props: {
- // 是否虚线
- dashed: {
- type: Boolean,
- default: () => props$1x.divider.dashed
- },
- // 是否细线
- hairline: {
- type: Boolean,
- default: () => props$1x.divider.hairline
- },
- // 是否以点替代文字,优先于text字段起作用
- dot: {
- type: Boolean,
- default: () => props$1x.divider.dot
- },
- // 内容文本的位置,left-左边,center-中间,right-右边
- textPosition: {
- type: String,
- default: () => props$1x.divider.textPosition
- },
- // 文本内容
- text: {
- type: [String, Number],
- default: () => props$1x.divider.text
- },
- // 文本大小
- textSize: {
- type: [String, Number],
- default: () => props$1x.divider.textSize
- },
- // 文本颜色
- textColor: {
- type: String,
- default: () => props$1x.divider.textColor
- },
- // 线条颜色
- lineColor: {
- type: String,
- default: () => props$1x.divider.lineColor
- }
- }
- });
- const _sfc_main$1v = {
- name: "u-divider",
- mixins: [mpMixin, mixin, props$_],
- computed: {
- textStyle() {
- const style = {};
- style.fontSize = addUnit(this.textSize);
- style.color = this.textColor;
- return style;
- },
- // 左边线条的的样式
- leftLineStyle() {
- const style = {};
- if (this.textPosition === "left") {
- style.width = "80rpx";
- } else {
- style.flex = 1;
- }
- return style;
- },
- // 右边线条的的样式
- rightLineStyle() {
- const style = {};
- if (this.textPosition === "right") {
- style.width = "80rpx";
- } else {
- style.flex = 1;
- }
- return style;
- }
- },
- emits: ["click"],
- methods: {
- addStyle,
- // divider组件被点击时触发
- click() {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$1u(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-divider",
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.click && $options.click(...args))
- },
- [
- vue.createVNode(_component_u_line, {
- color: _ctx.lineColor,
- customStyle: $options.leftLineStyle,
- hairline: _ctx.hairline,
- dashed: _ctx.dashed
- }, null, 8, ["color", "customStyle", "hairline", "dashed"]),
- _ctx.dot ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "u-divider__dot"
- }, "●")) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- !_ctx.dot && _ctx.text ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-divider__text",
- style: vue.normalizeStyle([$options.textStyle])
- },
- vue.toDisplayString(_ctx.text),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ], true),
- vue.createVNode(_component_u_line, {
- color: _ctx.lineColor,
- customStyle: $options.rightLineStyle,
- hairline: _ctx.hairline,
- dashed: _ctx.dashed
- }, null, 8, ["color", "customStyle", "hairline", "dashed"])
- ],
- 4
- /* STYLE */
- );
- }
- const uDivider = /* @__PURE__ */ _export_sfc(_sfc_main$1v, [["render", _sfc_render$1u], ["__scopeId", "data-v-ea022cee"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-divider/u-divider.vue"]]);
- const __vite_glob_0_35 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uDivider
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1u = {
- name: "u-dragsort",
- mixins: [mixin],
- props: {
- initialList: {
- type: Array,
- required: true,
- default: () => []
- },
- draggable: {
- type: Boolean,
- default: true
- },
- direction: {
- type: String,
- default: "vertical",
- validator: (value2) => ["vertical", "horizontal", "all"].includes(value2)
- },
- // 新增列数属性,用于all模式
- columns: {
- type: Number,
- default: 3
- }
- },
- data() {
- return {
- list: [],
- dragIndex: -1,
- itemHeight: 40,
- itemWidth: 80,
- areaWidth: 0,
- // 可拖动区域宽度
- areaHeight: 0,
- // 可拖动区域高度
- originalPositions: [],
- // 保存原始位置
- currentPosition: {
- x: 0,
- y: 0
- }
- };
- },
- computed: {
- movableAreaStyle() {
- if (this.direction === "vertical") {
- return {
- height: `${this.list.length * this.itemHeight}px`,
- width: "100%"
- };
- } else if (this.direction === "horizontal") {
- return {
- height: "100%",
- width: `${this.list.length * this.itemWidth}px`
- };
- } else {
- const rows = Math.ceil(this.list.length / this.columns);
- return {
- height: `${rows * this.itemHeight}px`,
- width: "100%"
- };
- }
- }
- },
- emits: ["drag-end"],
- async mounted() {
- await this.$nextTick();
- this.initList();
- this.calculateItemSize();
- this.calculateAreaSize();
- },
- methods: {
- initList() {
- this.list = this.initialList.map((item, index2) => {
- let x2 = 0, y2 = 0;
- if (this.direction === "horizontal") {
- x2 = index2 * this.itemWidth;
- y2 = 0;
- } else if (this.direction === "vertical") {
- x2 = 0;
- y2 = index2 * this.itemHeight;
- } else {
- const col = index2 % this.columns;
- const row = Math.floor(index2 / this.columns);
- x2 = col * this.itemWidth;
- y2 = row * this.itemHeight;
- }
- return {
- ...item,
- x: x2,
- y: y2
- };
- });
- this.saveOriginalPositions();
- },
- saveOriginalPositions() {
- this.originalPositions = this.list.map((item) => ({
- x: item.x,
- y: item.y
- }));
- },
- async calculateItemSize() {
- await sleep(30);
- return new Promise((resolve) => {
- uni.createSelectorQuery().in(this).select(".u-dragsort-item-content").boundingClientRect((res) => {
- if (res) {
- this.itemHeight = res.height || 40;
- this.itemWidth = res.width || 80;
- this.updatePositions();
- this.saveOriginalPositions();
- }
- resolve(res);
- }).exec();
- });
- },
- async calculateAreaSize() {
- await sleep(30);
- return new Promise((resolve) => {
- uni.createSelectorQuery().in(this).select(".u-dragsort-area").boundingClientRect((res) => {
- if (res) {
- this.areaWidth = res.width || 300;
- this.areaHeight = res.height || 300;
- }
- resolve(res);
- }).exec();
- });
- },
- updatePositions() {
- this.list.forEach((item, index2) => {
- if (this.direction === "vertical") {
- item.y = index2 * this.itemHeight;
- item.x = 0;
- } else if (this.direction === "horizontal") {
- item.x = index2 * this.itemWidth;
- item.y = 0;
- } else {
- const col = index2 % this.columns;
- const row = Math.floor(index2 / this.columns);
- item.x = col * this.itemWidth;
- item.y = row * this.itemHeight;
- }
- });
- },
- onTouchStart(index2) {
- this.dragIndex = index2;
- this.saveOriginalPositions();
- },
- onChange(index2, event) {
- if (!event.detail.source || event.detail.source !== "touch")
- return;
- this.currentPosition.x = event.detail.x;
- this.currentPosition.y = event.detail.y;
- if (this.direction === "all") {
- this.handleAllModeChange(index2);
- } else {
- let itemSize = 0;
- let targetIndex = -1;
- if (this.direction === "vertical") {
- itemSize = this.itemHeight;
- targetIndex = Math.max(0, Math.min(
- Math.round(this.currentPosition.y / itemSize),
- this.list.length - 1
- ));
- } else if (this.direction === "horizontal") {
- itemSize = this.itemWidth;
- targetIndex = Math.max(0, Math.min(
- Math.round(this.currentPosition.x / itemSize),
- this.list.length - 1
- ));
- }
- if (targetIndex !== index2) {
- this.reorderItems(index2, targetIndex);
- }
- }
- },
- handleAllModeChange(index2) {
- const col = Math.max(0, Math.min(Math.round(this.currentPosition.x / this.itemWidth), this.columns - 1));
- const row = Math.max(0, Math.round(this.currentPosition.y / this.itemHeight));
- let targetIndex = row * this.columns + col;
- targetIndex = Math.max(0, Math.min(targetIndex, this.list.length - 1));
- if (targetIndex !== index2) {
- this.reorderItems(index2, targetIndex);
- }
- },
- reorderItems(fromIndex, toIndex) {
- const movedItem = this.list.splice(fromIndex, 1)[0];
- this.list.splice(toIndex, 0, movedItem);
- if (uni.vibrateShort) {
- uni.vibrateShort();
- }
- this.dragIndex = toIndex;
- this.updatePositions();
- this.saveOriginalPositions();
- },
- onTouchEnd() {
- if (this.direction === "horizontal") {
- this.list[this.dragIndex].x = this.currentPosition.x + 1e-3;
- } else if (this.direction === "vertical" || this.direction === "all") {
- this.list[this.dragIndex].y = this.currentPosition.y + 1e-3;
- this.list[this.dragIndex].x = this.currentPosition.x + 1e-3;
- }
- sleep(50).then(() => {
- this.list.forEach((item, index2) => {
- item.x = this.originalPositions[index2].x;
- item.y = this.originalPositions[index2].y;
- });
- this.dragIndex = -1;
- this.$emit("drag-end", [...this.list]);
- });
- }
- },
- watch: {
- initialList: {
- handler() {
- this.$nextTick(() => {
- this.initList();
- });
- },
- deep: true
- },
- direction: {
- handler() {
- this.$nextTick(() => {
- this.initList();
- this.calculateItemSize();
- this.calculateAreaSize();
- });
- }
- },
- columns: {
- handler() {
- if (this.direction === "all") {
- this.$nextTick(() => {
- this.initList();
- this.updatePositions();
- this.saveOriginalPositions();
- });
- }
- }
- }
- }
- };
- function _sfc_render$1t(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-dragsort", [$props.direction == "horizontal" ? "u-dragsort--horizontal" : "", $props.direction == "all" ? "u-dragsort--all" : ""]])
- },
- [
- vue.createElementVNode(
- "movable-area",
- {
- class: "u-dragsort-area",
- style: vue.normalizeStyle($options.movableAreaStyle)
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("movable-view", {
- key: item.id,
- id: `u-dragsort-item-${index2}`,
- class: vue.normalizeClass(["u-dragsort-item", { "dragging": $data.dragIndex === index2 }]),
- direction: $props.direction === "all" ? "all" : $props.direction,
- x: item.x,
- y: item.y,
- inertia: false,
- disabled: !$props.draggable || item.draggable === false,
- onChange: ($event) => $options.onChange(index2, $event),
- onTouchstart: ($event) => $options.onTouchStart(index2),
- onTouchend: _cache[0] || (_cache[0] = (...args) => $options.onTouchEnd && $options.onTouchEnd(...args)),
- onTouchcancel: _cache[1] || (_cache[1] = (...args) => $options.onTouchEnd && $options.onTouchEnd(...args))
- }, [
- vue.createElementVNode("view", { class: "u-dragsort-item-content" }, [
- vue.renderSlot(_ctx.$slots, "default", {
- item,
- index: index2
- }, () => [
- vue.createTextVNode(
- vue.toDisplayString(item.label),
- 1
- /* TEXT */
- )
- ], true)
- ])
- ], 42, ["id", "direction", "x", "y", "disabled", "onChange", "onTouchstart"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )
- ],
- 2
- /* CLASS */
- );
- }
- const uDragsort = /* @__PURE__ */ _export_sfc(_sfc_main$1u, [["render", _sfc_render$1t], ["__scopeId", "data-v-09ad657e"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-dragsort/u-dragsort.vue"]]);
- const __vite_glob_0_36 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uDragsort
- }, Symbol.toStringTag, { value: "Module" }));
- const props$Z = defineMixin({
- props: {
- // 当前选中项的value值
- modelValue: {
- type: [Number, String, Array],
- default: ""
- },
- // 菜单项标题
- title: {
- type: [String, Number],
- default: ""
- },
- // 选项数据,如果传入了默认slot,此参数无效
- options: {
- type: Array,
- default() {
- return [];
- }
- },
- // 是否禁用此菜单项
- disabled: {
- type: Boolean,
- default: false
- },
- // 下拉弹窗的高度
- height: {
- type: [Number, String],
- default: "auto"
- },
- // 点击遮罩是否可以收起弹窗
- closeOnClickOverlay: {
- type: Boolean,
- default: true
- }
- }
- });
- const _sfc_main$1t = {
- name: "u-dropdown-item",
- mixins: [mpMixin, mixin, props$Z],
- options: {
- styleIsolation: "shared"
- },
- data() {
- return {
- active: false,
- // 当前项是否处于展开状态
- activeColor: "#2979ff",
- // 激活时左边文字和右边对勾图标的颜色
- inactiveColor: "#606266"
- // 未激活时左边文字和右边对勾图标的颜色
- };
- },
- computed: {
- // 监听props是否发生了变化,有些值需要传递给父组件u-dropdown,无法双向绑定
- propsChange() {
- return `${this.title}-${this.disabled}`;
- }
- },
- watch: {
- propsChange(n2) {
- if (this.parent)
- this.parent.init();
- }
- },
- created() {
- this.parent = false;
- },
- emits: ["update:modelValue", "change"],
- methods: {
- addUnit,
- init() {
- let parent = $parent.call(this, "u-dropdown");
- if (parent) {
- this.parent = parent;
- this.activeColor = parent.activeColor;
- this.inactiveColor = parent.inactiveColor;
- let exist = parent.children.find((val) => {
- return this === val;
- });
- if (!exist)
- parent.children.push(this);
- if (parent.children.length == 1)
- this.active = true;
- parent.menuList.push({
- title: this.title,
- disabled: this.disabled
- });
- }
- },
- // cell被点击
- cellClick(value2) {
- this.$emit("update:modelValue", value2);
- this.parent.close();
- this.$emit("change", value2);
- }
- },
- mounted() {
- this.init();
- }
- };
- function _sfc_render$1s(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_up_cell = vue.resolveComponent("up-cell");
- const _component_up_cell_group = vue.resolveComponent("up-cell-group");
- return $data.active ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-dropdown-item",
- onTouchmove: vue.withModifiers(() => {
- }, ["stop", "prevent"]),
- onClick: vue.withModifiers(() => {
- }, ["stop", "prevent"])
- },
- [
- !_ctx.$slots.default && !_ctx.$slots.$default ? (vue.openBlock(), vue.createElementBlock(
- "scroll-view",
- {
- key: 0,
- class: "u-dropdown-item__scroll",
- "scroll-y": "true",
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.height)
- })
- },
- [
- vue.createElementVNode("view", { class: "u-dropdown-item__options" }, [
- vue.createVNode(_component_up_cell_group, null, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.options, (item, index2) => {
- return vue.openBlock(), vue.createBlock(_component_up_cell, {
- onClick: ($event) => $options.cellClick(item.value),
- arrow: false,
- title: item.label,
- key: index2,
- "title-style": {
- color: _ctx.modelValue == item.value ? $data.activeColor : $data.inactiveColor
- }
- }, {
- default: vue.withCtx(() => [
- _ctx.modelValue == item.value ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: "checkbox-mark",
- color: $data.activeColor,
- size: "32"
- }, null, 8, ["color"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["onClick", "title", "title-style"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- })
- ])
- ],
- 4
- /* STYLE */
- )) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true)
- ],
- 32
- /* NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true);
- }
- const uDropdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["render", _sfc_render$1s], ["__scopeId", "data-v-2ab01489"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-dropdown-item/u-dropdown-item.vue"]]);
- const __vite_glob_0_37 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uDropdownItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$Y = defineMixin({
- props: {
- // 菜单标题和选项的激活态颜色
- activeColor: {
- type: String,
- default: "#2979ff"
- },
- // 菜单标题和选项的未激活态颜色
- inactiveColor: {
- type: String,
- default: "#606266"
- },
- // 点击遮罩是否关闭菜单
- closeOnClickMask: {
- type: Boolean,
- default: true
- },
- // 点击当前激活项标题是否关闭菜单
- closeOnClickSelf: {
- type: Boolean,
- default: true
- },
- // 过渡时间
- duration: {
- type: [Number, String],
- default: 300
- },
- // 标题菜单的高度
- height: {
- type: [Number, String],
- default: 40
- },
- // 是否显示下边框
- borderBottom: {
- type: Boolean,
- default: false
- },
- // 标题的字体大小
- titleSize: {
- type: [Number, String],
- default: 14
- },
- // 下拉出来的内容部分的圆角值
- borderRadius: {
- type: [Number, String],
- default: 0
- },
- // 菜单右侧的icon图标
- menuIcon: {
- type: String,
- default: "arrow-down"
- },
- // 菜单右侧图标的大小
- menuIconSize: {
- type: [Number, String],
- default: 14
- }
- }
- });
- const _sfc_main$1s = {
- name: "u-dropdown",
- mixins: [mpMixin, mixin, props$Y],
- data() {
- return {
- showDropdown: true,
- // 是否打开下来菜单,
- menuList: [],
- // 显示的菜单
- active: false,
- // 下拉菜单的状态
- // 当前是第几个菜单处于激活状态,小程序中此处不能写成false或者"",否则后续将current赋值为0,
- // 无能的TX没有使用===而是使用==判断,导致程序认为前后二者没有变化,从而不会触发视图更新
- current: 99999,
- // 外层内容的样式,初始时处于底层,且透明
- contentStyle: {
- zIndex: -1,
- opacity: 0
- },
- // 让某些菜单保持高亮的状态
- highlightIndexList: [],
- contentHeight: 0
- };
- },
- computed: {
- // 下拉出来部分的样式
- popupStyle() {
- let style = {};
- style.transform = `translateY(${this.active ? 0 : "-100%"})`;
- style["transition-duration"] = this.duration / 1e3 + "s";
- style.borderRadius = `0 0 ${addUnit(this.borderRadius)} ${addUnit(this.borderRadius)}`;
- return style;
- }
- },
- created() {
- this.children = [];
- },
- mounted() {
- this.getContentHeight();
- },
- emits: ["open", "close"],
- methods: {
- addUnit,
- init() {
- this.menuList = [];
- this.children.map((child) => {
- child.init();
- });
- },
- // 点击菜单
- menuClick(index2) {
- if (this.menuList[index2].disabled)
- return;
- if (index2 === this.current && this.closeOnClickSelf) {
- this.close();
- setTimeout(() => {
- this.children[index2].active = false;
- }, this.duration);
- return;
- }
- this.open(index2);
- },
- // 打开下拉菜单
- open(index2) {
- if (this.contentHeight < 1)
- this.getContentHeight();
- this.contentStyle = {
- zIndex: 11,
- height: this.contentHeight + "px"
- };
- this.active = true;
- this.current = index2;
- this.children.map((val, idx) => {
- val.active = index2 == idx ? true : false;
- });
- this.$emit("open", this.current);
- },
- // 设置下拉菜单处于收起状态
- close() {
- this.$emit("close", this.current);
- this.active = false;
- this.current = 99999;
- this.contentStyle.zIndex = -1;
- this.contentStyle.opacity = 0;
- setTimeout(() => {
- this.contentStyle.height = 0;
- }, this.duration);
- },
- // 点击遮罩
- maskClick() {
- if (!this.closeOnClickMask)
- return;
- this.close();
- },
- // 外部手动设置某些菜单高亮
- highlight(indexParams = void 0) {
- if (Array.isArray(indexParams)) {
- this.highlightIndexList = [...indexParams];
- return;
- }
- this.highlightIndexList = indexParams !== void 0 ? [indexParams] : [];
- },
- // 获取下拉菜单内容的高度
- getContentHeight() {
- let windowHeight = getWindowInfo().windowHeight;
- this.$uGetRect(".u-dropdown__menu").then((res) => {
- this.contentHeight = windowHeight - res.bottom;
- });
- }
- }
- };
- function _sfc_render$1r(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-dropdown" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-dropdown__menu", {
- "u-border-bottom": _ctx.borderBottom
- }]),
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.height)
- })
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.menuList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-dropdown__menu__item",
- key: index2,
- onClick: vue.withModifiers(($event) => $options.menuClick(index2), ["stop"])
- }, [
- vue.createElementVNode("view", { class: "u-flex u-flex-row" }, [
- vue.createElementVNode(
- "text",
- {
- class: "u-dropdown__menu__item__text",
- style: vue.normalizeStyle({
- color: item.disabled ? "#c0c4cc" : index2 === $data.current || $data.highlightIndexList.includes(index2) ? _ctx.activeColor : _ctx.inactiveColor,
- fontSize: $options.addUnit(_ctx.titleSize)
- })
- },
- vue.toDisplayString(item.title),
- 5
- /* TEXT, STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-dropdown__menu__item__arrow", {
- "u-dropdown__menu__item__arrow--rotate": index2 === $data.current
- }])
- },
- [
- vue.createVNode(_component_up_icon, {
- "custom-style": { display: "flex" },
- name: _ctx.menuIcon,
- size: $options.addUnit(_ctx.menuIconSize),
- color: index2 === $data.current || $data.highlightIndexList.includes(index2) ? _ctx.activeColor : "#c0c4cc"
- }, null, 8, ["name", "size", "color"])
- ],
- 2
- /* CLASS */
- )
- ])
- ], 8, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "u-dropdown__content",
- style: vue.normalizeStyle([$data.contentStyle, {
- transition: `opacity ${_ctx.duration / 1e3}s, z-index ${_ctx.duration / 1e3}s linear`,
- top: $options.addUnit(_ctx.height)
- }]),
- onClick: _cache[1] || (_cache[1] = (...args) => $options.maskClick && $options.maskClick(...args)),
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers(() => {
- }, ["stop", "prevent"]))
- },
- [
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
- }, ["stop", "prevent"])),
- class: "u-dropdown__content__popup",
- style: vue.normalizeStyle([$options.popupStyle, {}])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "u-dropdown__content__mask" })
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- )
- ]);
- }
- const uDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$1s, [["render", _sfc_render$1r], ["__scopeId", "data-v-029e9a16"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-dropdown/u-dropdown.vue"]]);
- const __vite_glob_0_38 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uDropdown
- }, Symbol.toStringTag, { value: "Module" }));
- const props$X = defineMixin({
- props: {
- // 内置图标名称,或图片路径,建议绝对路径
- icon: {
- type: String,
- default: () => props$1x.empty.icon
- },
- // 提示文字
- text: {
- type: String,
- default: () => props$1x.empty.text
- },
- // 文字颜色
- textColor: {
- type: String,
- default: () => props$1x.empty.textColor
- },
- // 文字大小
- textSize: {
- type: [String, Number],
- default: () => props$1x.empty.textSize
- },
- // 图标的颜色
- iconColor: {
- type: String,
- default: () => props$1x.empty.iconColor
- },
- // 图标的大小
- iconSize: {
- type: [String, Number],
- default: () => props$1x.empty.iconSize
- },
- // 选择预置的图标类型
- mode: {
- type: String,
- default: () => props$1x.empty.mode
- },
- // 图标宽度,单位px
- width: {
- type: [String, Number],
- default: () => props$1x.empty.width
- },
- // 图标高度,单位px
- height: {
- type: [String, Number],
- default: () => props$1x.empty.height
- },
- // 是否显示组件
- show: {
- type: Boolean,
- default: () => props$1x.empty.show
- },
- // 组件距离上一个元素之间的距离,默认px单位
- marginTop: {
- type: [String, Number],
- default: () => props$1x.empty.marginTop
- }
- }
- });
- const _sfc_main$1r = {
- name: "u-empty",
- mixins: [mpMixin, mixin, props$X],
- data() {
- return {
- icons: {
- car: t$1("up.empty.car"),
- page: t$1("up.empty.page"),
- search: t$1("up.empty.search"),
- address: t$1("up.empty.address"),
- wifi: t$1("up.empty.wifi"),
- order: t$1("up.empty.order"),
- coupon: t$1("up.empty.coupon"),
- favor: t$1("up.empty.favor"),
- permission: t$1("up.empty.permission"),
- history: t$1("up.empty.history"),
- news: t$1("up.empty.news"),
- message: t$1("up.empty.message"),
- list: t$1("up.empty.list"),
- data: t$1("up.empty.data"),
- comment: t$1("up.empty.comment")
- }
- };
- },
- computed: {
- // 组件样式
- emptyStyle() {
- const style = {};
- style.marginTop = addUnit(this.marginTop);
- return deepMerge$1(addStyle(this.customStyle), style);
- },
- // 文本样式
- textStyle() {
- const style = {};
- style.color = this.textColor;
- style.fontSize = addUnit(this.textSize);
- return style;
- },
- // 判断icon是否图片路径
- isSrc() {
- return this.icon.indexOf("/") >= 0;
- }
- },
- methods: {
- addUnit
- }
- };
- function _sfc_render$1q(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-empty",
- style: vue.normalizeStyle([$options.emptyStyle])
- },
- [
- !$options.isSrc ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: _ctx.mode === "message" ? "chat" : `empty-${_ctx.mode}`,
- size: _ctx.iconSize,
- color: _ctx.iconColor,
- "margin-top": "14"
- }, null, 8, ["name", "size", "color"])) : (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- style: vue.normalizeStyle({
- width: $options.addUnit(_ctx.width),
- height: $options.addUnit(_ctx.height)
- }),
- src: _ctx.icon,
- mode: "widthFix"
- }, null, 12, ["src"])),
- vue.createElementVNode(
- "text",
- {
- class: "u-empty__text",
- style: vue.normalizeStyle([$options.textStyle])
- },
- vue.toDisplayString(_ctx.text ? _ctx.text : $data.icons[_ctx.mode]),
- 5
- /* TEXT, STYLE */
- ),
- _ctx.$slots.default || _ctx.$slots.$default ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "u-empty__wrap"
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const uEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["render", _sfc_render$1q], ["__scopeId", "data-v-8dd5928e"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-empty/u-empty.vue"]]);
- const __vite_glob_0_39 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uEmpty
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1q = {
- name: "u-float-button",
- mixins: [mpMixin, mixin],
- emits: ["click", "item-click"],
- computed: {},
- props: {
- // 背景颜色
- backgroundColor: {
- type: String,
- default: "#2979ff"
- },
- // 文字颜色
- color: {
- type: String,
- default: "#fff"
- },
- // 宽度
- width: {
- type: String,
- default: "50px"
- },
- // 高度
- height: {
- type: String,
- default: "50px"
- },
- // 边框颜色,默认为空字符串表示无边框
- borderColor: {
- type: String,
- default: ""
- },
- // 右侧偏移量
- right: {
- type: [String, Number],
- default: "30px"
- },
- // 顶部偏移量,未提供默认值,可能需要根据具体情况设置
- top: {
- type: [String, Number],
- default: ""
- },
- // 底部偏移量
- bottom: {
- type: String,
- default: ""
- },
- // 是否为菜单项
- isMenu: {
- type: Boolean,
- default: false
- },
- list: {
- type: Array,
- default: () => {
- return [];
- }
- }
- },
- data() {
- return {
- showList: false
- };
- },
- methods: {
- addStyle,
- clickHandler(e2) {
- if (this.isMenu) {
- this.showList = !this.showList;
- this.$emit("click", e2);
- } else {
- this.$emit("click", e2);
- }
- },
- itemClick(item, index2) {
- this.$emit("item-click", {
- ...item,
- index: index2
- });
- }
- }
- };
- function _sfc_render$1p(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-float-button",
- style: vue.normalizeStyle({
- position: "fixed",
- top: $props.top,
- bottom: $props.bottom,
- right: $props.right
- })
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-float-button__main",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args)),
- style: vue.normalizeStyle({
- backgroundColor: $props.backgroundColor,
- color: $props.color,
- display: "flex",
- flexDirection: "row",
- justifyContent: "center",
- alignItems: "center",
- width: $props.width,
- height: $props.height,
- borderRadius: "50%",
- borderColor: $props.borderColor
- })
- },
- [
- vue.renderSlot(_ctx.$slots, "default", { showList: $data.showList }, () => [
- vue.createVNode(_component_up_icon, {
- class: vue.normalizeClass(["cursor-pointer", { "show-list": $data.showList }]),
- name: "plus",
- color: $props.color
- }, null, 8, ["class", "color"])
- ], true),
- $data.showList ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-float-button__list",
- style: vue.normalizeStyle({
- bottom: $props.height
- })
- },
- [
- vue.renderSlot(_ctx.$slots, "list", {}, () => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: "u-float-button__item",
- style: vue.normalizeStyle({
- backgroundColor: (item == null ? void 0 : item.backgroundColor) ? item == null ? void 0 : item.backgroundColor : $props.backgroundColor,
- color: (item == null ? void 0 : item.color) ? item == null ? void 0 : item.color : $props.color,
- display: "flex",
- flexDirection: "row",
- justifyContent: "center",
- alignItems: "center",
- width: $props.width,
- height: $props.height,
- borderRadius: "50%",
- borderColor: (item == null ? void 0 : item.borderColor) ? item == null ? void 0 : item.borderColor : $props.borderColor
- }),
- onClick: ($event) => $options.itemClick(item, index2)
- }, [
- vue.createVNode(_component_up_icon, {
- name: item.name,
- color: (item == null ? void 0 : item.color) ? item == null ? void 0 : item.color : $props.color
- }, null, 8, ["name", "color"])
- ], 12, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- );
- }
- const uFloatButton = /* @__PURE__ */ _export_sfc(_sfc_main$1q, [["render", _sfc_render$1p], ["__scopeId", "data-v-8a662942"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-float-button/u-float-button.vue"]]);
- const __vite_glob_0_40 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uFloatButton
- }, Symbol.toStringTag, { value: "Module" }));
- const props$W = defineMixin({
- props: {
- // input的label提示语
- label: {
- type: String,
- default: () => props$1x.formItem.label
- },
- // 绑定的值
- prop: {
- type: String,
- default: () => props$1x.formItem.prop
- },
- // 绑定的规则
- rules: {
- type: Array,
- default: () => props$1x.formItem.rules
- },
- // 是否显示表单域的下划线边框
- borderBottom: {
- type: [String, Boolean],
- default: () => props$1x.formItem.borderBottom
- },
- // label的位置,left-左边,top-上边
- labelPosition: {
- type: String,
- default: () => props$1x.formItem.labelPosition
- },
- // label的宽度,单位px
- labelWidth: {
- type: [String, Number],
- default: () => props$1x.formItem.labelWidth
- },
- // 右侧图标
- rightIcon: {
- type: String,
- default: () => props$1x.formItem.rightIcon
- },
- // 左侧图标
- leftIcon: {
- type: String,
- default: () => props$1x.formItem.leftIcon
- },
- // 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置
- required: {
- type: Boolean,
- default: () => props$1x.formItem.required
- },
- leftIconStyle: {
- type: [String, Object],
- default: () => props$1x.formItem.leftIconStyle
- }
- }
- });
- const _sfc_main$1p = {
- name: "u-form-item",
- mixins: [mpMixin, mixin, props$W],
- data() {
- return {
- // 错误提示语
- message: "",
- parentData: {
- // 提示文本的位置
- labelPosition: "left",
- // 提示文本对齐方式
- labelAlign: "left",
- // 提示文本的样式
- labelStyle: {},
- // 提示文本的宽度
- labelWidth: 45,
- // 错误提示方式
- errorType: "message"
- },
- color: color$3,
- itemRules: []
- };
- },
- // 组件创建完成时,将当前实例保存到u-form中
- computed: {
- propsLine() {
- return props$1x.line;
- }
- },
- mounted() {
- this.init();
- },
- emits: ["click"],
- watch: {
- // 监听规则的变化
- rules: {
- immediate: true,
- handler(n2) {
- this.setRules(n2);
- }
- }
- },
- methods: {
- addStyle,
- addUnit,
- init() {
- this.updateParentData();
- if (!this.parent) {
- error("u-form-item需要结合u-form组件使用");
- }
- },
- // 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则
- setRules(rules2) {
- if (rules2.length === 0) {
- this.itemRules = [];
- return;
- }
- this.itemRules = rules2;
- },
- // 获取父组件的参数
- updateParentData() {
- this.getParentData("u-form");
- },
- // 移除u-form-item的校验结果
- clearValidate() {
- this.message = null;
- },
- // 清空当前的组件的校验结果,并重置为初始值
- resetField() {
- const value2 = getProperty(this.parent.originalModel, this.prop);
- setProperty(this.parent.model, this.prop, value2);
- this.message = null;
- },
- // 点击组件
- clickHandler() {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$1o(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-form-item", { "u-form-item--error": !!$data.message && $data.parentData.errorType === "message" }])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-form-item__body",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args)),
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle), {
- flexDirection: (_ctx.labelPosition || $data.parentData.labelPosition) === "left" ? "row" : "column"
- }])
- },
- [
- vue.createCommentVNode(' 微信小程序中,将一个参数设置空字符串,结果会变成字符串"true" '),
- vue.renderSlot(_ctx.$slots, "label", {}, () => [
- vue.createCommentVNode(" {{required}} "),
- _ctx.required || _ctx.leftIcon || _ctx.label ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-form-item__body__left",
- style: vue.normalizeStyle({
- width: $options.addUnit(_ctx.labelWidth || $data.parentData.labelWidth),
- marginBottom: (_ctx.labelPosition || $data.parentData.labelPosition) === "left" ? 0 : "5px"
- })
- },
- [
- vue.createCommentVNode(" 为了块对齐 "),
- vue.createElementVNode("view", { class: "u-form-item__body__left__content" }, [
- vue.createCommentVNode(" nvue不支持伪元素before "),
- _ctx.required ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "u-form-item__body__left__content__required"
- }, "*")) : vue.createCommentVNode("v-if", true),
- _ctx.leftIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-form-item__body__left__content__icon"
- }, [
- vue.createVNode(_component_up_icon, {
- name: _ctx.leftIcon,
- "custom-style": _ctx.leftIconStyle
- }, null, 8, ["name", "custom-style"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- {
- class: "u-form-item__body__left__content__label",
- style: vue.normalizeStyle([$data.parentData.labelStyle, {
- justifyContent: $data.parentData.labelAlign === "left" ? "flex-start" : $data.parentData.labelAlign === "center" ? "center" : "flex-end"
- }])
- },
- vue.toDisplayString(_ctx.label),
- 5
- /* TEXT, STYLE */
- )
- ])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ], true),
- vue.createElementVNode("view", { class: "u-form-item__body__right" }, [
- vue.createElementVNode("view", { class: "u-form-item__body__right__content" }, [
- vue.createElementVNode("view", { class: "u-form-item__body__right__content__slot" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ]),
- _ctx.$slots.right ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "item__body__right__content__icon"
- }, [
- vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ])
- ],
- 4
- /* STYLE */
- ),
- vue.renderSlot(_ctx.$slots, "error", {}, () => [
- !!$data.message && $data.parentData.errorType === "message" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-form-item__body__right__message",
- style: vue.normalizeStyle({
- marginLeft: $options.addUnit((_ctx.labelPosition || $data.parentData.labelPosition) === "top" ? 0 : _ctx.labelWidth || $data.parentData.labelWidth)
- })
- },
- vue.toDisplayString($data.message),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ], true),
- _ctx.borderBottom ? (vue.openBlock(), vue.createBlock(_component_u_line, {
- key: 0,
- color: $data.message && $data.parentData.errorType === "border-bottom" ? $data.color.error : $options.propsLine.color,
- customStyle: `margin-top: ${$data.message && $data.parentData.errorType === "message" ? "5px" : 0}`
- }, null, 8, ["color", "customStyle"])) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- );
- }
- const uFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$1p, [["render", _sfc_render$1o], ["__scopeId", "data-v-42bac3de"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-form-item/u-form-item.vue"]]);
- const __vite_glob_0_41 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uFormItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$V = defineMixin({
- props: {
- // 当前form的需要验证字段的集合
- model: {
- type: Object,
- default: () => props$1x.form.model
- },
- // 验证规则
- rules: {
- type: [Object, Function, Array],
- default: () => props$1x.form.rules
- },
- // 有错误时的提示方式,message-提示信息,toast-进行toast提示
- // border-bottom-下边框呈现红色,none-无提示
- errorType: {
- type: String,
- default: () => props$1x.form.errorType
- },
- // 是否显示表单域的下划线边框
- borderBottom: {
- type: Boolean,
- default: () => props$1x.form.borderBottom
- },
- // label的位置,left-左边,top-上边
- labelPosition: {
- type: String,
- default: () => props$1x.form.labelPosition
- },
- // label的宽度,单位px
- labelWidth: {
- type: [String, Number],
- default: () => props$1x.form.labelWidth
- },
- // lable字体的对齐方式
- labelAlign: {
- type: String,
- default: () => props$1x.form.labelAlign
- },
- // lable的样式,对象形式
- labelStyle: {
- type: Object,
- default: () => props$1x.form.labelStyle
- }
- }
- });
- var define_process_env_default = {};
- const formatRegExp = /%[sdj%]/g;
- let warning = function warning2() {
- };
- if (typeof process !== "undefined" && define_process_env_default && true && typeof window !== "undefined" && typeof document !== "undefined") {
- warning = function warning3(type2, errors) {
- if (typeof console !== "undefined" && console.warn) {
- if (errors.every((e2) => typeof e2 === "string")) {
- formatAppLog("warn", "at uni_modules/uview-plus/libs/util/async-validator.js:28", type2, errors);
- }
- }
- };
- }
- function convertFieldsError(errors) {
- if (!errors || !errors.length)
- return null;
- const fields = {};
- errors.forEach((error2) => {
- const { field } = error2;
- fields[field] = fields[field] || [];
- fields[field].push(error2);
- });
- return fields;
- }
- function format() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- let i2 = 1;
- const f2 = args[0];
- const len = args.length;
- if (typeof f2 === "function") {
- return f2.apply(null, args.slice(1));
- }
- if (typeof f2 === "string") {
- let str = String(f2).replace(formatRegExp, (x2) => {
- if (x2 === "%%") {
- return "%";
- }
- if (i2 >= len) {
- return x2;
- }
- switch (x2) {
- case "%s":
- return String(args[i2++]);
- case "%d":
- return Number(args[i2++]);
- case "%j":
- try {
- return JSON.stringify(args[i2++]);
- } catch (_2) {
- return "[Circular]";
- }
- break;
- default:
- return x2;
- }
- });
- for (let arg = args[i2]; i2 < len; arg = args[++i2]) {
- str += ` ${arg}`;
- }
- return str;
- }
- return f2;
- }
- function isNativeStringType(type2) {
- return type2 === "string" || type2 === "url" || type2 === "hex" || type2 === "email" || type2 === "pattern";
- }
- function isEmptyValue(value2, type2) {
- if (value2 === void 0 || value2 === null) {
- return true;
- }
- if (type2 === "array" && Array.isArray(value2) && !value2.length) {
- return true;
- }
- if (isNativeStringType(type2) && typeof value2 === "string" && !value2) {
- return true;
- }
- return false;
- }
- function asyncParallelArray(arr, func2, callback) {
- const results = [];
- let total = 0;
- const arrLength = arr.length;
- function count(errors) {
- results.push.apply(results, errors);
- total++;
- if (total === arrLength) {
- callback(results);
- }
- }
- arr.forEach((a2) => {
- func2(a2, count);
- });
- }
- function asyncSerialArray(arr, func2, callback) {
- let index2 = 0;
- const arrLength = arr.length;
- function next(errors) {
- if (errors && errors.length) {
- callback(errors);
- return;
- }
- const original = index2;
- index2 += 1;
- if (original < arrLength) {
- func2(arr[original], next);
- } else {
- callback([]);
- }
- }
- next([]);
- }
- function flattenObjArr(objArr) {
- const ret = [];
- Object.keys(objArr).forEach((k2) => {
- ret.push.apply(ret, objArr[k2]);
- });
- return ret;
- }
- function asyncMap(objArr, option, func2, callback) {
- if (option.first) {
- const _pending = new Promise((resolve, reject) => {
- const next = function next2(errors) {
- callback(errors);
- return errors.length ? reject({
- errors,
- fields: convertFieldsError(errors)
- }) : resolve();
- };
- const flattenArr = flattenObjArr(objArr);
- asyncSerialArray(flattenArr, func2, next);
- });
- _pending.catch((e2) => e2);
- return _pending;
- }
- let firstFields = option.firstFields || [];
- if (firstFields === true) {
- firstFields = Object.keys(objArr);
- }
- const objArrKeys = Object.keys(objArr);
- const objArrLength = objArrKeys.length;
- let total = 0;
- const results = [];
- const pending = new Promise((resolve, reject) => {
- const next = function next2(errors) {
- results.push.apply(results, errors);
- total++;
- if (total === objArrLength) {
- callback(results);
- return results.length ? reject({
- errors: results,
- fields: convertFieldsError(results)
- }) : resolve();
- }
- };
- if (!objArrKeys.length) {
- callback(results);
- resolve();
- }
- objArrKeys.forEach((key) => {
- const arr = objArr[key];
- if (firstFields.indexOf(key) !== -1) {
- asyncSerialArray(arr, func2, next);
- } else {
- asyncParallelArray(arr, func2, next);
- }
- });
- });
- pending.catch((e2) => e2);
- return pending;
- }
- function complementError(rule) {
- return function(oe2) {
- if (oe2 && oe2.message) {
- oe2.field = oe2.field || rule.fullField;
- return oe2;
- }
- return {
- message: typeof oe2 === "function" ? oe2() : oe2,
- field: oe2.field || rule.fullField
- };
- };
- }
- function deepMerge(target, source) {
- if (source) {
- for (const s2 in source) {
- if (source.hasOwnProperty(s2)) {
- const value2 = source[s2];
- if (typeof value2 === "object" && typeof target[s2] === "object") {
- target[s2] = { ...target[s2], ...value2 };
- } else {
- target[s2] = value2;
- }
- }
- }
- }
- return target;
- }
- function required(rule, value2, source, errors, options2, type2) {
- if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value2, type2 || rule.type))) {
- errors.push(format(options2.messages.required, rule.fullField));
- }
- }
- function whitespace(rule, value2, source, errors, options2) {
- if (/^\s+$/.test(value2) || value2 === "") {
- errors.push(format(options2.messages.whitespace, rule.fullField));
- }
- }
- const pattern = {
- // http://emailregex.com/
- email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
- 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"
- ),
- hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
- };
- var types = {
- integer: function integer(value2) {
- return /^(-)?\d+$/.test(value2);
- },
- float: function float(value2) {
- return /^(-)?\d+(\.\d+)?$/.test(value2);
- },
- array: function array3(value2) {
- return Array.isArray(value2);
- },
- regexp: function regexp(value2) {
- if (value2 instanceof RegExp) {
- return true;
- }
- try {
- return !!new RegExp(value2);
- } catch (e2) {
- return false;
- }
- },
- date: function date3(value2) {
- return typeof value2.getTime === "function" && typeof value2.getMonth === "function" && typeof value2.getYear === "function";
- },
- number: function number3(value2) {
- if (isNaN(value2)) {
- return false;
- }
- return typeof +value2 === "number";
- },
- object: function object3(value2) {
- return typeof value2 === "object" && !types.array(value2);
- },
- method: function method(value2) {
- return typeof value2 === "function";
- },
- email: function email2(value2) {
- return typeof value2 === "string" && !!value2.match(pattern.email) && value2.length < 255;
- },
- url: function url2(value2) {
- return typeof value2 === "string" && !!value2.match(pattern.url);
- },
- hex: function hex(value2) {
- return typeof value2 === "string" && !!value2.match(pattern.hex);
- }
- };
- function type(rule, value2, source, errors, options2) {
- if (rule.required && value2 === void 0) {
- required(rule, value2, source, errors, options2);
- return;
- }
- const custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"];
- const ruleType = rule.type;
- if (custom.indexOf(ruleType) > -1) {
- if (!types[ruleType](value2)) {
- errors.push(format(options2.messages.types[ruleType], rule.fullField, rule.type));
- }
- } else if (ruleType && typeof value2 !== rule.type) {
- errors.push(format(options2.messages.types[ruleType], rule.fullField, rule.type));
- }
- }
- function range(rule, value2, source, errors, options2) {
- const len = typeof rule.len === "number";
- const min = typeof rule.min === "number";
- const max = typeof rule.max === "number";
- const spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
- let val = value2;
- let key = null;
- const num = typeof value2 === "number";
- const str = typeof value2 === "string";
- const arr = Array.isArray(value2);
- if (num) {
- key = "number";
- } else if (str) {
- key = "string";
- } else if (arr) {
- key = "array";
- }
- if (!key) {
- return false;
- }
- if (arr) {
- val = value2.length;
- }
- if (str) {
- val = value2.replace(spRegexp, "_").length;
- }
- if (len) {
- if (val !== rule.len) {
- errors.push(format(options2.messages[key].len, rule.fullField, rule.len));
- }
- } else if (min && !max && val < rule.min) {
- errors.push(format(options2.messages[key].min, rule.fullField, rule.min));
- } else if (max && !min && val > rule.max) {
- errors.push(format(options2.messages[key].max, rule.fullField, rule.max));
- } else if (min && max && (val < rule.min || val > rule.max)) {
- errors.push(format(options2.messages[key].range, rule.fullField, rule.min, rule.max));
- }
- }
- const ENUM = "enum";
- function enumerable(rule, value2, source, errors, options2) {
- rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
- if (rule[ENUM].indexOf(value2) === -1) {
- errors.push(format(options2.messages[ENUM], rule.fullField, rule[ENUM].join(", ")));
- }
- }
- function pattern$1(rule, value2, source, errors, options2) {
- if (rule.pattern) {
- if (rule.pattern instanceof RegExp) {
- rule.pattern.lastIndex = 0;
- if (!rule.pattern.test(value2)) {
- errors.push(format(options2.messages.pattern.mismatch, rule.fullField, value2, rule.pattern));
- }
- } else if (typeof rule.pattern === "string") {
- const _pattern = new RegExp(rule.pattern);
- if (!_pattern.test(value2)) {
- errors.push(format(options2.messages.pattern.mismatch, rule.fullField, value2, rule.pattern));
- }
- }
- }
- }
- const rules = {
- required,
- whitespace,
- type,
- range,
- enum: enumerable,
- pattern: pattern$1
- };
- function string(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2, "string") && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2, "string");
- if (!isEmptyValue(value2, "string")) {
- rules.type(rule, value2, source, errors, options2);
- rules.range(rule, value2, source, errors, options2);
- rules.pattern(rule, value2, source, errors, options2);
- if (rule.whitespace === true) {
- rules.whitespace(rule, value2, source, errors, options2);
- }
- }
- }
- callback(errors);
- }
- function method2(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function number2(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (value2 === "") {
- value2 = void 0;
- }
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options2);
- rules.range(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function _boolean(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function regexp2(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (!isEmptyValue(value2)) {
- rules.type(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function integer2(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options2);
- rules.range(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function floatFn(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options2);
- rules.range(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function array2(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2, "array") && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2, "array");
- if (!isEmptyValue(value2, "array")) {
- rules.type(rule, value2, source, errors, options2);
- rules.range(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function object2(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- const ENUM$1 = "enum";
- function enumerable$1(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (value2 !== void 0) {
- rules[ENUM$1](rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function pattern$2(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2, "string") && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (!isEmptyValue(value2, "string")) {
- rules.pattern(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function date2(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- if (!isEmptyValue(value2)) {
- let dateObject;
- if (typeof value2 === "number") {
- dateObject = new Date(value2);
- } else {
- dateObject = value2;
- }
- rules.type(rule, dateObject, source, errors, options2);
- if (dateObject) {
- rules.range(rule, dateObject.getTime(), source, errors, options2);
- }
- }
- }
- callback(errors);
- }
- function required$1(rule, value2, callback, source, options2) {
- const errors = [];
- const type2 = Array.isArray(value2) ? "array" : typeof value2;
- rules.required(rule, value2, source, errors, options2, type2);
- callback(errors);
- }
- function type$1(rule, value2, callback, source, options2) {
- const ruleType = rule.type;
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2, ruleType) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2, ruleType);
- if (!isEmptyValue(value2, ruleType)) {
- rules.type(rule, value2, source, errors, options2);
- }
- }
- callback(errors);
- }
- function any(rule, value2, callback, source, options2) {
- const errors = [];
- const validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate2) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options2);
- }
- callback(errors);
- }
- const validators = {
- string,
- method: method2,
- number: number2,
- boolean: _boolean,
- regexp: regexp2,
- integer: integer2,
- float: floatFn,
- array: array2,
- object: object2,
- enum: enumerable$1,
- pattern: pattern$2,
- date: date2,
- url: type$1,
- hex: type$1,
- email: type$1,
- required: required$1,
- any
- };
- function newMessages() {
- return {
- default: "Validation error on field %s",
- required: "%s is required",
- enum: "%s must be one of %s",
- whitespace: "%s cannot be empty",
- date: {
- format: "%s date %s is invalid for format %s",
- parse: "%s date could not be parsed, %s is invalid ",
- invalid: "%s date %s is invalid"
- },
- types: {
- string: "%s is not a %s",
- method: "%s is not a %s (function)",
- array: "%s is not an %s",
- object: "%s is not an %s",
- number: "%s is not a %s",
- date: "%s is not a %s",
- boolean: "%s is not a %s",
- integer: "%s is not an %s",
- float: "%s is not a %s",
- regexp: "%s is not a valid %s",
- email: "%s is not a valid %s",
- url: "%s is not a valid %s",
- hex: "%s is not a valid %s"
- },
- string: {
- len: "%s must be exactly %s characters",
- min: "%s must be at least %s characters",
- max: "%s cannot be longer than %s characters",
- range: "%s must be between %s and %s characters"
- },
- number: {
- len: "%s must equal %s",
- min: "%s cannot be less than %s",
- max: "%s cannot be greater than %s",
- range: "%s must be between %s and %s"
- },
- array: {
- len: "%s must be exactly %s in length",
- min: "%s cannot be less than %s in length",
- max: "%s cannot be greater than %s in length",
- range: "%s must be between %s and %s in length"
- },
- pattern: {
- mismatch: "%s value %s does not match pattern %s"
- },
- clone: function clone2() {
- const cloned = JSON.parse(JSON.stringify(this));
- cloned.clone = this.clone;
- return cloned;
- }
- };
- }
- const messages = newMessages();
- function Schema(descriptor) {
- this.rules = null;
- this._messages = messages;
- this.define(descriptor);
- }
- Schema.prototype = {
- messages: function messages2(_messages) {
- if (_messages) {
- this._messages = deepMerge(newMessages(), _messages);
- }
- return this._messages;
- },
- define: function define(rules2) {
- if (!rules2) {
- throw new Error("Cannot configure a schema with no rules");
- }
- if (typeof rules2 !== "object" || Array.isArray(rules2)) {
- throw new Error("Rules must be an object");
- }
- this.rules = {};
- let z2;
- let item;
- for (z2 in rules2) {
- if (rules2.hasOwnProperty(z2)) {
- item = rules2[z2];
- this.rules[z2] = Array.isArray(item) ? item : [item];
- }
- }
- },
- validate: function validate(source_, o2, oc) {
- const _this = this;
- if (o2 === void 0) {
- o2 = {};
- }
- if (oc === void 0) {
- oc = function oc2() {
- };
- }
- let source = source_;
- let options2 = o2;
- let callback = oc;
- if (typeof options2 === "function") {
- callback = options2;
- options2 = {};
- }
- if (!this.rules || Object.keys(this.rules).length === 0) {
- if (callback) {
- callback();
- }
- return Promise.resolve();
- }
- function complete(results) {
- let i2;
- let errors = [];
- let fields = {};
- function add2(e2) {
- if (Array.isArray(e2)) {
- let _errors;
- errors = (_errors = errors).concat.apply(_errors, e2);
- } else {
- errors.push(e2);
- }
- }
- for (i2 = 0; i2 < results.length; i2++) {
- add2(results[i2]);
- }
- if (!errors.length) {
- errors = null;
- fields = null;
- } else {
- fields = convertFieldsError(errors);
- }
- callback(errors, fields);
- }
- if (options2.messages) {
- let messages$12 = this.messages();
- if (messages$12 === messages) {
- messages$12 = newMessages();
- }
- deepMerge(messages$12, options2.messages);
- options2.messages = messages$12;
- } else {
- options2.messages = this.messages();
- }
- let arr;
- let value2;
- const series = {};
- const keys = options2.keys || Object.keys(this.rules);
- keys.forEach((z2) => {
- arr = _this.rules[z2];
- value2 = source[z2];
- arr.forEach((r2) => {
- let rule = r2;
- if (typeof rule.transform === "function") {
- if (source === source_) {
- source = { ...source };
- }
- value2 = source[z2] = rule.transform(value2);
- }
- if (typeof rule === "function") {
- rule = {
- validator: rule
- };
- } else {
- rule = { ...rule };
- }
- rule.validator = _this.getValidationMethod(rule);
- rule.field = z2;
- rule.fullField = rule.fullField || z2;
- rule.type = _this.getType(rule);
- if (!rule.validator) {
- return;
- }
- series[z2] = series[z2] || [];
- series[z2].push({
- rule,
- value: value2,
- source,
- field: z2
- });
- });
- });
- const errorFields = {};
- return asyncMap(series, options2, (data, doIt) => {
- const { rule } = data;
- let deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
- deep = deep && (rule.required || !rule.required && data.value);
- rule.field = data.field;
- function addFullfield(key, schema) {
- return { ...schema, fullField: `${rule.fullField}.${key}` };
- }
- function cb(e2) {
- if (e2 === void 0) {
- e2 = [];
- }
- let errors = e2;
- if (!Array.isArray(errors)) {
- errors = [errors];
- }
- if (!options2.suppressWarning && errors.length) {
- Schema.warning("async-validator:", errors);
- }
- if (errors.length && rule.message) {
- errors = [].concat(rule.message);
- }
- errors = errors.map(complementError(rule));
- if (options2.first && errors.length) {
- errorFields[rule.field] = 1;
- return doIt(errors);
- }
- if (!deep) {
- doIt(errors);
- } else {
- if (rule.required && !data.value) {
- if (rule.message) {
- errors = [].concat(rule.message).map(complementError(rule));
- } else if (options2.error) {
- errors = [options2.error(rule, format(options2.messages.required, rule.field))];
- } else {
- errors = [];
- }
- return doIt(errors);
- }
- let fieldsSchema = {};
- if (rule.defaultField) {
- for (const k2 in data.value) {
- if (data.value.hasOwnProperty(k2)) {
- fieldsSchema[k2] = rule.defaultField;
- }
- }
- }
- fieldsSchema = { ...fieldsSchema, ...data.rule.fields };
- for (const f2 in fieldsSchema) {
- if (fieldsSchema.hasOwnProperty(f2)) {
- const fieldSchema = Array.isArray(fieldsSchema[f2]) ? fieldsSchema[f2] : [fieldsSchema[f2]];
- fieldsSchema[f2] = fieldSchema.map(addFullfield.bind(null, f2));
- }
- }
- const schema = new Schema(fieldsSchema);
- schema.messages(options2.messages);
- if (data.rule.options) {
- data.rule.options.messages = options2.messages;
- data.rule.options.error = options2.error;
- }
- schema.validate(data.value, data.rule.options || options2, (errs) => {
- const finalErrors = [];
- if (errors && errors.length) {
- finalErrors.push.apply(finalErrors, errors);
- }
- if (errs && errs.length) {
- finalErrors.push.apply(finalErrors, errs);
- }
- doIt(finalErrors.length ? finalErrors : null);
- });
- }
- }
- let res;
- if (rule.asyncValidator) {
- res = rule.asyncValidator(rule, data.value, cb, data.source, options2);
- } else if (rule.validator) {
- res = rule.validator(rule, data.value, cb, data.source, options2);
- if (res === true) {
- cb();
- } else if (res === false) {
- cb(rule.message || `${rule.field} fails`);
- } else if (res instanceof Array) {
- cb(res);
- } else if (res instanceof Error) {
- cb(res.message);
- }
- }
- if (res && res.then) {
- res.then(() => cb(), (e2) => cb(e2));
- }
- }, (results) => {
- complete(results);
- });
- },
- getType: function getType(rule) {
- if (rule.type === void 0 && rule.pattern instanceof RegExp) {
- rule.type = "pattern";
- }
- if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) {
- throw new Error(format("Unknown rule type %s", rule.type));
- }
- return rule.type || "string";
- },
- getValidationMethod: function getValidationMethod(rule) {
- if (typeof rule.validator === "function") {
- return rule.validator;
- }
- const keys = Object.keys(rule);
- const messageIndex = keys.indexOf("message");
- if (messageIndex !== -1) {
- keys.splice(messageIndex, 1);
- }
- if (keys.length === 1 && keys[0] === "required") {
- return validators.required;
- }
- return validators[this.getType(rule)] || false;
- }
- };
- Schema.register = function register(type2, validator) {
- if (typeof validator !== "function") {
- throw new Error("Cannot register a validator by type, validator is not a function");
- }
- validators[type2] = validator;
- };
- Schema.warning = warning;
- Schema.messages = messages;
- Schema.warning = function() {
- };
- const _sfc_main$1o = {
- name: "u-form",
- mixins: [mpMixin, mixin, props$V],
- provide() {
- return {
- uForm: this
- };
- },
- data() {
- return {
- formRules: {},
- // 规则校验器
- validator: {},
- // 原始的model快照,用于resetFields方法重置表单时使用
- originalModel: null
- };
- },
- watch: {
- // 监听规则的变化
- rules: {
- immediate: true,
- handler(n2) {
- this.setRules(n2);
- }
- },
- // 监听属性的变化,通知子组件u-form-item重新获取信息
- propsChange(n2) {
- var _a2;
- if ((_a2 = this.children) == null ? void 0 : _a2.length) {
- this.children.map((child) => {
- typeof child.updateParentData == "function" && child.updateParentData();
- });
- }
- },
- // 监听model的初始值作为重置表单的快照
- model: {
- immediate: true,
- handler(n2) {
- if (!this.originalModel) {
- this.originalModel = deepClone(n2);
- }
- }
- }
- },
- computed: {
- propsChange() {
- return [
- this.errorType,
- this.borderBottom,
- this.labelPosition,
- this.labelWidth,
- this.labelAlign,
- this.labelStyle
- ];
- }
- },
- created() {
- this.children = [];
- },
- methods: {
- // 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则
- setRules(rules2) {
- if (Object.keys(rules2).length === 0)
- return;
- if (Object.keys(this.model).length === 0) {
- error("设置rules,model必须设置!如果已经设置,请刷新页面。");
- return;
- }
- this.formRules = rules2;
- this.validator = new Schema(rules2);
- },
- // 清空所有u-form-item组件的内容,本质上是调用了u-form-item组件中的resetField()方法
- resetFields() {
- this.resetModel();
- },
- // 重置model为初始值的快照
- resetModel(obj) {
- this.children.map((child) => {
- const prop = child == null ? void 0 : child.prop;
- const value2 = getProperty(this.originalModel, prop);
- setProperty(this.model, prop, value2);
- });
- },
- // 清空校验结果
- clearValidate(props2) {
- props2 = [].concat(props2);
- this.children.map((child) => {
- if (props2[0] === void 0 || props2.includes(child.prop)) {
- child.message = null;
- }
- });
- },
- // 对部分表单字段进行校验
- async validateField(value2, callback, event = null, options2) {
- this.$nextTick(() => {
- const errorsRes = [];
- value2 = [].concat(value2);
- let promises = this.children.map((child) => {
- return new Promise((resolve, reject) => {
- const childErrors = [];
- if (value2.includes(child.prop)) {
- const propertyVal = getProperty(
- this.model,
- child.prop
- );
- const propertyChain = child.prop.split(".");
- const propertyName = propertyChain[propertyChain.length - 1];
- let rule = [];
- if (child.itemRules && child.itemRules.length > 0) {
- rule = child.itemRules;
- } else {
- rule = this.formRules[child.prop];
- }
- if (!rule) {
- resolve();
- return;
- }
- const rules2 = [].concat(rule);
- if (!rules2.length) {
- resolve();
- }
- for (let i2 = 0; i2 < rules2.length; i2++) {
- const ruleItem = rules2[i2];
- const trigger = [].concat(ruleItem == null ? void 0 : ruleItem.trigger);
- if (event && !trigger.includes(event)) {
- resolve();
- continue;
- }
- const validator = new Schema({
- [propertyName]: ruleItem
- });
- validator.validate(
- {
- [propertyName]: propertyVal
- },
- (errors, fields) => {
- var _a2;
- if (test.array(errors)) {
- errors.forEach((element) => {
- element.prop = child.prop;
- });
- errorsRes.push(...errors);
- childErrors.push(...errors);
- }
- if (!options2 || (options2 == null ? void 0 : options2.showErrorMsg) == true) {
- child.message = ((_a2 = childErrors[0]) == null ? void 0 : _a2.message) ? childErrors[0].message : null;
- }
- if (i2 == rules2.length - 1) {
- resolve(errorsRes);
- }
- }
- );
- }
- } else {
- resolve({});
- }
- });
- });
- Promise.all(promises).then((results) => {
- typeof callback === "function" && callback(errorsRes);
- }).catch((error2) => {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-form/u-form.vue:218", "An error occurred:", error2);
- });
- });
- },
- /**
- * 校验全部数据
- * @param {Object} options
- * @param {Boolean} options.showErrorMsg -是否显示校验信息,
- */
- validate(options2) {
- if (Object.keys(this.formRules).length === 0) {
- error("未设置rules,请看文档说明!如果已经设置,请刷新页面。");
- return;
- }
- return new Promise((resolve, reject) => {
- this.$nextTick(() => {
- const formItemProps = this.children.map(
- (item) => item.prop
- );
- this.validateField(formItemProps, (errors) => {
- if (errors.length) {
- this.errorType === "toast" && toast(errors[0].message);
- reject(errors);
- } else {
- resolve(true);
- }
- }, null, options2);
- });
- });
- }
- }
- };
- function _sfc_render$1n(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-form" }, [
- vue.renderSlot(_ctx.$slots, "default")
- ]);
- }
- const uForm = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["render", _sfc_render$1n], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-form/u-form.vue"]]);
- const __vite_glob_0_42 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uForm
- }, Symbol.toStringTag, { value: "Module" }));
- const props$U = defineMixin({
- props: {
- // 宫格的name
- name: {
- type: [String, Number, null],
- default: () => props$1x.gridItem.name
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.gridItem.bgColor
- }
- }
- });
- const _sfc_main$1n = {
- name: "u-grid-item",
- mixins: [mpMixin, mixin, props$U],
- data() {
- return {
- parentData: {
- col: 0,
- // 父组件划分的宫格数
- border: true
- // 是否显示边框,根据父组件决定
- },
- classes: []
- // 类名集合,用于判断是否显示右边和下边框
- };
- },
- mounted() {
- this.init();
- },
- emits: ["click"],
- // 微信小程序中 options 选项
- computed: {
- itemStyle() {
- const style = {
- background: this.bgColor
- };
- style["width"] = "100%";
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- methods: {
- init() {
- uni.$on("$uGridItem", () => {
- this.gridItemClasses();
- });
- this.updateParentData();
- uni.$emit("$uGridItem");
- this.gridItemClasses();
- },
- // 获取父组件的参数
- updateParentData() {
- this.getParentData("u-grid");
- },
- clickHandler() {
- var _a2;
- let name2 = this.name;
- const children = (_a2 = this.parent) == null ? void 0 : _a2.children;
- if (children && this.name === null) {
- name2 = children.findIndex((child) => child === this);
- }
- this.parent && this.parent.childClick(name2);
- this.$emit("click", name2);
- },
- async getItemWidth() {
- let width = 0;
- if (this.parent) {
- const parentWidth = await this.getParentWidth();
- width = parentWidth / Number(this.parentData.col) + "px";
- }
- this.width = width;
- },
- // 获取父元素的尺寸
- getParentWidth() {
- },
- gridItemClasses() {
- if (this.parentData.border) {
- let classes = [];
- this.parent.children.map((child, index2) => {
- if (this === child) {
- const len = this.parent.children.length;
- if ((index2 + 1) % this.parentData.col !== 0 && index2 + 1 !== len) {
- classes.push("u-border-right");
- }
- const lessNum = len % this.parentData.col === 0 ? this.parentData.col : len % this.parentData.col;
- if (index2 < len - lessNum) {
- classes.push("u-border-bottom");
- }
- }
- });
- this.classes = classes;
- }
- }
- },
- beforeUnmount() {
- uni.$off("$uGridItem");
- }
- };
- function _sfc_render$1m(_ctx, _cache, $props, $setup, $data, $options) {
- return $data.parentData.col > 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-grid-item", $data.classes]),
- "hover-class": "u-grid-item--hover-class",
- "hover-stay-time": 200,
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args)),
- style: vue.normalizeStyle([$options.itemStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const uGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$1n, [["render", _sfc_render$1m], ["__scopeId", "data-v-0a78094b"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-grid-item/u-grid-item.vue"]]);
- const __vite_glob_0_44 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uGridItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$T = defineMixin({
- props: {
- // 分成几列
- col: {
- type: [String, Number],
- default: () => props$1x.grid.col
- },
- // 是否显示边框
- border: {
- type: Boolean,
- default: () => props$1x.grid.border
- },
- // 宫格对齐方式,表现为数量少的时候,靠左,居中,还是靠右
- align: {
- type: String,
- default: () => props$1x.grid.align
- },
- // 间隔
- gap: {
- type: String,
- default: "0px"
- }
- }
- });
- const _sfc_main$1m = {
- name: "u-grid",
- mixins: [mpMixin, mixin, props$T],
- data() {
- return {
- index: 0,
- width: 0
- };
- },
- watch: {
- // 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
- parentData() {
- if (this.children.length) {
- this.children.map((child) => {
- typeof child.updateParentData == "function" && child.updateParentData();
- });
- }
- }
- },
- created() {
- this.children = [];
- },
- computed: {
- // 计算父组件的值是否发生变化
- parentData() {
- return [this.hoverClass, this.col, this.size, this.border];
- },
- // 宫格对齐方式
- gridStyle() {
- let style = {};
- switch (this.align) {
- case "left":
- style.justifyContent = "flex-start";
- break;
- case "center":
- style.justifyContent = "center";
- break;
- case "right":
- style.justifyContent = "flex-end";
- break;
- default:
- style.justifyContent = "flex-start";
- }
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- emits: ["click"],
- // 防止事件执行两次
- // 20240409发现抖音小程序如果开启virtualHost会出现严重问题,几乎所有事件包括created等生命周期事件全部失效。
- methods: {
- // 此方法由u-grid-item触发,用于在u-grid发出事件
- childClick(name2) {
- this.$emit("click", name2);
- }
- }
- };
- const __injectCSSVars__ = () => {
- vue.useCssVars((_ctx) => ({
- "10b668c8-gap": _ctx.gap,
- "10b668c8-col": _ctx.col
- }));
- };
- const __setup__ = _sfc_main$1m.setup;
- _sfc_main$1m.setup = __setup__ ? (props2, ctx) => {
- __injectCSSVars__();
- return __setup__(props2, ctx);
- } : __injectCSSVars__;
- function _sfc_render$1l(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-grid",
- ref: "u-grid",
- style: vue.normalizeStyle([$options.gridStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 4
- /* STYLE */
- );
- }
- const uGrid = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["render", _sfc_render$1l], ["__scopeId", "data-v-10b668c8"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-grid/u-grid.vue"]]);
- const __vite_glob_0_45 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uGrid
- }, Symbol.toStringTag, { value: "Module" }));
- const icons = {
- "uicon-level": "",
- "uicon-column-line": "",
- "uicon-checkbox-mark": "",
- "uicon-folder": "",
- "uicon-movie": "",
- "uicon-star-fill": "",
- "uicon-star": "",
- "uicon-phone-fill": "",
- "uicon-phone": "",
- "uicon-apple-fill": "",
- "uicon-chrome-circle-fill": "",
- "uicon-backspace": "",
- "uicon-attach": "",
- "uicon-cut": "",
- "uicon-empty-car": "",
- "uicon-empty-coupon": "",
- "uicon-empty-address": "",
- "uicon-empty-favor": "",
- "uicon-empty-permission": "",
- "uicon-empty-news": "",
- "uicon-empty-search": "",
- "uicon-github-circle-fill": "",
- "uicon-rmb": "",
- "uicon-person-delete-fill": "",
- "uicon-reload": "",
- "uicon-order": "",
- "uicon-server-man": "",
- "uicon-search": "",
- "uicon-fingerprint": "",
- "uicon-more-dot-fill": "",
- "uicon-scan": "",
- "uicon-share-square": "",
- "uicon-map": "",
- "uicon-map-fill": "",
- "uicon-tags": "",
- "uicon-tags-fill": "",
- "uicon-bookmark-fill": "",
- "uicon-bookmark": "",
- "uicon-eye": "",
- "uicon-eye-fill": "",
- "uicon-mic": "",
- "uicon-mic-off": "",
- "uicon-calendar": "",
- "uicon-calendar-fill": "",
- "uicon-trash": "",
- "uicon-trash-fill": "",
- "uicon-play-left": "",
- "uicon-play-right": "",
- "uicon-minus": "",
- "uicon-plus": "",
- "uicon-info": "",
- "uicon-info-circle": "",
- "uicon-info-circle-fill": "",
- "uicon-question": "",
- "uicon-error": "",
- "uicon-close": "",
- "uicon-checkmark": "",
- "uicon-android-circle-fill": "",
- "uicon-android-fill": "",
- "uicon-ie": "",
- "uicon-IE-circle-fill": "",
- "uicon-google": "",
- "uicon-google-circle-fill": "",
- "uicon-setting-fill": "",
- "uicon-setting": "",
- "uicon-minus-square-fill": "",
- "uicon-plus-square-fill": "",
- "uicon-heart": "",
- "uicon-heart-fill": "",
- "uicon-camera": "",
- "uicon-camera-fill": "",
- "uicon-more-circle": "",
- "uicon-more-circle-fill": "",
- "uicon-chat": "",
- "uicon-chat-fill": "",
- "uicon-bag-fill": "",
- "uicon-bag": "",
- "uicon-error-circle-fill": "",
- "uicon-error-circle": "",
- "uicon-close-circle": "",
- "uicon-close-circle-fill": "",
- "uicon-checkmark-circle": "",
- "uicon-checkmark-circle-fill": "",
- "uicon-question-circle-fill": "",
- "uicon-question-circle": "",
- "uicon-share": "",
- "uicon-share-fill": "",
- "uicon-shopping-cart": "",
- "uicon-shopping-cart-fill": "",
- "uicon-bell": "",
- "uicon-bell-fill": "",
- "uicon-list": "",
- "uicon-list-dot": "",
- "uicon-zhihu": "",
- "uicon-zhihu-circle-fill": "",
- "uicon-zhifubao": "",
- "uicon-zhifubao-circle-fill": "",
- "uicon-weixin-circle-fill": "",
- "uicon-weixin-fill": "",
- "uicon-twitter-circle-fill": "",
- "uicon-twitter": "",
- "uicon-taobao-circle-fill": "",
- "uicon-taobao": "",
- "uicon-weibo-circle-fill": "",
- "uicon-weibo": "",
- "uicon-qq-fill": "",
- "uicon-qq-circle-fill": "",
- "uicon-moments-circel-fill": "",
- "uicon-moments": "",
- "uicon-qzone": "",
- "uicon-qzone-circle-fill": "",
- "uicon-baidu-circle-fill": "",
- "uicon-baidu": "",
- "uicon-facebook-circle-fill": "",
- "uicon-facebook": "",
- "uicon-car": "",
- "uicon-car-fill": "",
- "uicon-warning-fill": "",
- "uicon-warning": "",
- "uicon-clock-fill": "",
- "uicon-clock": "",
- "uicon-edit-pen": "",
- "uicon-edit-pen-fill": "",
- "uicon-email": "",
- "uicon-email-fill": "",
- "uicon-minus-circle": "",
- "uicon-minus-circle-fill": "",
- "uicon-plus-circle": "",
- "uicon-plus-circle-fill": "",
- "uicon-file-text": "",
- "uicon-file-text-fill": "",
- "uicon-pushpin": "",
- "uicon-pushpin-fill": "",
- "uicon-grid": "",
- "uicon-grid-fill": "",
- "uicon-play-circle": "",
- "uicon-play-circle-fill": "",
- "uicon-pause-circle-fill": "",
- "uicon-pause": "",
- "uicon-pause-circle": "",
- "uicon-eye-off": "",
- "uicon-eye-off-outline": "",
- "uicon-gift-fill": "",
- "uicon-gift": "",
- "uicon-rmb-circle-fill": "",
- "uicon-rmb-circle": "",
- "uicon-kefu-ermai": "",
- "uicon-server-fill": "",
- "uicon-coupon-fill": "",
- "uicon-coupon": "",
- "uicon-integral": "",
- "uicon-integral-fill": "",
- "uicon-home-fill": "",
- "uicon-home": "",
- "uicon-hourglass-half-fill": "",
- "uicon-hourglass": "",
- "uicon-account": "",
- "uicon-plus-people-fill": "",
- "uicon-minus-people-fill": "",
- "uicon-account-fill": "",
- "uicon-thumb-down-fill": "",
- "uicon-thumb-down": "",
- "uicon-thumb-up": "",
- "uicon-thumb-up-fill": "",
- "uicon-lock-fill": "",
- "uicon-lock-open": "",
- "uicon-lock-opened-fill": "",
- "uicon-lock": "",
- "uicon-red-packet-fill": "",
- "uicon-photo-fill": "",
- "uicon-photo": "",
- "uicon-volume-off-fill": "",
- "uicon-volume-off": "",
- "uicon-volume-fill": "",
- "uicon-volume": "",
- "uicon-red-packet": "",
- "uicon-download": "",
- "uicon-arrow-up-fill": "",
- "uicon-arrow-down-fill": "",
- "uicon-play-left-fill": "",
- "uicon-play-right-fill": "",
- "uicon-rewind-left-fill": "",
- "uicon-rewind-right-fill": "",
- "uicon-arrow-downward": "",
- "uicon-arrow-leftward": "",
- "uicon-arrow-rightward": "",
- "uicon-arrow-upward": "",
- "uicon-arrow-down": "",
- "uicon-arrow-right": "",
- "uicon-arrow-left": "",
- "uicon-arrow-up": "",
- "uicon-skip-back-left": "",
- "uicon-skip-forward-right": "",
- "uicon-rewind-right": "",
- "uicon-rewind-left": "",
- "uicon-arrow-right-double": "",
- "uicon-arrow-left-double": "",
- "uicon-wifi-off": "",
- "uicon-wifi": "",
- "uicon-empty-data": "",
- "uicon-empty-history": "",
- "uicon-empty-list": "",
- "uicon-empty-page": "",
- "uicon-empty-order": "",
- "uicon-man": "",
- "uicon-woman": "",
- "uicon-man-add": "",
- "uicon-man-add-fill": "",
- "uicon-man-delete": "",
- "uicon-man-delete-fill": "",
- "uicon-zh": "",
- "uicon-en": ""
- };
- const props$S = defineMixin({
- props: {
- // 图标类名
- name: {
- type: String,
- default: () => props$1x.icon.name
- },
- // 图标颜色,可接受主题色
- color: {
- type: String,
- default: () => props$1x.icon.color
- },
- // 字体大小,单位px
- size: {
- type: [String, Number],
- default: () => props$1x.icon.size
- },
- // 是否显示粗体
- bold: {
- type: Boolean,
- default: () => props$1x.icon.bold
- },
- // 点击图标的时候传递事件出去的index(用于区分点击了哪一个)
- index: {
- type: [String, Number],
- default: () => props$1x.icon.index
- },
- // 触摸图标时的类名
- hoverClass: {
- type: String,
- default: () => props$1x.icon.hoverClass
- },
- // 自定义扩展前缀,方便用户扩展自己的图标库
- customPrefix: {
- type: String,
- default: () => props$1x.icon.customPrefix
- },
- // 图标右边或者下面的文字
- label: {
- type: [String, Number],
- default: () => props$1x.icon.label
- },
- // label的位置,只能右边或者下边
- labelPos: {
- type: String,
- default: () => props$1x.icon.labelPos
- },
- // label的大小
- labelSize: {
- type: [String, Number],
- default: () => props$1x.icon.labelSize
- },
- // label的颜色
- labelColor: {
- type: String,
- default: () => props$1x.icon.labelColor
- },
- // label与图标的距离
- space: {
- type: [String, Number],
- default: () => props$1x.icon.space
- },
- // 图片的mode
- imgMode: {
- type: String,
- default: () => props$1x.icon.imgMode
- },
- // 用于显示图片小图标时,图片的宽度
- width: {
- type: [String, Number],
- default: () => props$1x.icon.width
- },
- // 用于显示图片小图标时,图片的高度
- height: {
- type: [String, Number],
- default: () => props$1x.icon.height
- },
- // 用于解决某些情况下,让图标垂直居中的用途
- top: {
- type: [String, Number],
- default: () => props$1x.icon.top
- },
- // 是否阻止事件传播
- stop: {
- type: Boolean,
- default: () => props$1x.icon.stop
- }
- }
- });
- let params = {
- loaded: false
- };
- const loadFont = () => {
- if (config$1.loadFontOnce) {
- params.loaded = true;
- }
- uni.loadFontFace({
- global: true,
- // 是否全局生效。微信小程序 '2.10.0'起支持全局生效,需在 app.vue 中调用。
- family: "uicon-iconfont",
- source: 'url("' + config$1.iconUrl + '")',
- success() {
- },
- fail() {
- }
- });
- if (config$1.customIcon.family) {
- uni.loadFontFace({
- global: true,
- // 是否全局生效。微信小程序 '2.10.0'起支持全局生效,需在 app.vue 中调用。
- family: config$1.customIcon.family,
- source: 'url("' + config$1.customIcon.url + '")',
- success() {
- },
- fail() {
- }
- });
- }
- return true;
- };
- const fontUtil = {
- params,
- loadFont
- };
- const _sfc_main$1l = {
- name: "u-icon",
- beforeCreate() {
- if (!fontUtil.params.loaded) {
- fontUtil.loadFont();
- }
- },
- data() {
- return {};
- },
- emits: ["click"],
- mixins: [mpMixin, mixin, props$S],
- computed: {
- uClasses() {
- let classes = [];
- classes.push(this.customPrefix + "-" + this.name);
- if (this.customPrefix == "uicon") {
- classes.push("u-iconfont");
- } else {
- classes.push(this.customPrefix);
- }
- if (this.color && config$1.type.includes(this.color))
- classes.push("u-icon__icon--" + this.color);
- return classes;
- },
- iconStyle() {
- let style = {};
- style = {
- fontSize: addUnit(this.size),
- lineHeight: addUnit(this.size),
- fontWeight: this.bold ? "bold" : "normal",
- // 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
- top: addUnit(this.top)
- };
- if (this.customPrefix !== "uicon") {
- style.fontFamily = this.customPrefix;
- }
- if (this.color && !config$1.type.includes(this.color))
- style.color = this.color;
- return style;
- },
- // 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
- isImg() {
- return this.name.indexOf("/") !== -1;
- },
- imgStyle() {
- let style = {};
- style.width = this.width ? addUnit(this.width) : addUnit(this.size);
- style.height = this.height ? addUnit(this.height) : addUnit(this.size);
- return style;
- },
- // 通过图标名,查找对应的图标
- icon() {
- if (this.customPrefix !== "uicon") {
- return config$1.customIcons[this.name] || this.name;
- }
- return icons["uicon-" + this.name] || this.name;
- }
- },
- methods: {
- addStyle,
- addUnit,
- clickHandler(e2) {
- this.$emit("click", this.index, e2);
- this.stop && this.preventEvent(e2);
- }
- }
- };
- function _sfc_render$1k(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-icon", ["u-icon--" + _ctx.labelPos]]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- },
- [
- $options.isImg ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "u-icon__img",
- src: _ctx.name,
- mode: _ctx.imgMode,
- style: vue.normalizeStyle([$options.imgStyle, $options.addStyle(_ctx.customStyle)])
- }, null, 12, ["src", "mode"])) : (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- class: vue.normalizeClass(["u-icon__icon", $options.uClasses]),
- style: vue.normalizeStyle([$options.iconStyle, $options.addStyle(_ctx.customStyle)]),
- "hover-class": _ctx.hoverClass
- }, vue.toDisplayString($options.icon), 15, ["hover-class"])),
- vue.createCommentVNode(' 这里进行空字符串判断,如果仅仅是v-if="label",可能会出现传递0的时候,结果也无法显示 '),
- _ctx.label !== "" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 2,
- class: "u-icon__label",
- style: vue.normalizeStyle({
- color: _ctx.labelColor,
- fontSize: $options.addUnit(_ctx.labelSize),
- marginLeft: _ctx.labelPos == "right" ? $options.addUnit(_ctx.space) : 0,
- marginTop: _ctx.labelPos == "bottom" ? $options.addUnit(_ctx.space) : 0,
- marginRight: _ctx.labelPos == "left" ? $options.addUnit(_ctx.space) : 0,
- marginBottom: _ctx.labelPos == "top" ? $options.addUnit(_ctx.space) : 0
- })
- },
- vue.toDisplayString(_ctx.label),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- );
- }
- const uIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["render", _sfc_render$1k], ["__scopeId", "data-v-ac70166d"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-icon/u-icon.vue"]]);
- const __vite_glob_0_46 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uIcon
- }, Symbol.toStringTag, { value: "Module" }));
- const props$R = defineMixin({
- props: {
- // 图片地址
- src: {
- type: String,
- default: () => props$1x.image.src
- },
- // 裁剪模式
- mode: {
- type: String,
- default: () => props$1x.image.mode
- },
- // 宽度,单位任意
- width: {
- type: [String, Number],
- default: () => props$1x.image.width
- },
- // 高度,单位任意
- height: {
- type: [String, Number],
- default: () => props$1x.image.height
- },
- // 图片形状,circle-圆形,square-方形
- shape: {
- type: String,
- default: () => props$1x.image.shape
- },
- // 圆角,单位任意
- radius: {
- type: [String, Number],
- default: () => props$1x.image.radius
- },
- // 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序
- lazyLoad: {
- type: Boolean,
- default: () => props$1x.image.lazyLoad
- },
- // 开启长按图片显示识别微信小程序码菜单
- showMenuByLongpress: {
- type: Boolean,
- default: () => props$1x.image.showMenuByLongpress
- },
- // 加载中的图标,或者小图片
- loadingIcon: {
- type: String,
- default: () => props$1x.image.loadingIcon
- },
- // 加载失败的图标,或者小图片
- errorIcon: {
- type: String,
- default: () => props$1x.image.errorIcon
- },
- // 是否显示加载中的图标或者自定义的slot
- showLoading: {
- type: Boolean,
- default: () => props$1x.image.showLoading
- },
- // 是否显示加载错误的图标或者自定义的slot
- showError: {
- type: Boolean,
- default: () => props$1x.image.showError
- },
- // 是否需要淡入效果
- fade: {
- type: Boolean,
- default: () => props$1x.image.fade
- },
- // 只支持网络资源,只对微信小程序有效
- webp: {
- type: Boolean,
- default: () => props$1x.image.webp
- },
- // 过渡时间,单位ms
- duration: {
- type: [String, Number],
- default: () => props$1x.image.duration
- },
- // 背景颜色,用于深色页面加载图片时,为了和背景色融合
- bgColor: {
- type: String,
- default: () => props$1x.image.bgColor
- }
- }
- });
- const _sfc_main$1k = {
- name: "u-image",
- mixins: [mpMixin, mixin, props$R],
- data() {
- return {
- // 图片是否加载错误,如果是,则显示错误占位图
- isError: false,
- // 初始化组件时,默认为加载中状态
- loading: true,
- // 不透明度,为了实现淡入淡出的效果
- opacity: 1,
- // 过渡时间,因为props的值无法修改,故需要一个中间值
- durationTime: this.duration,
- // 图片加载完成时,去掉背景颜色,因为如果是png图片,就会显示灰色的背景
- backgroundStyle: {},
- // 用于fade模式的控制组件显示与否
- show: false
- };
- },
- watch: {
- src: {
- immediate: true,
- handler(n2) {
- if (!n2) {
- this.isError = true;
- } else {
- this.isError = false;
- this.loading = true;
- }
- }
- }
- },
- computed: {
- transStyle() {
- let style = {};
- if (this.loading || this.isError || this.width == "100%" || this.mode != "heightFix") {
- style.width = addUnit(this.width);
- } else {
- style.width = "fit-content";
- }
- if (this.loading || this.isError || this.height == "100%" || this.mode != "widthFix") {
- style.height = addUnit(this.height);
- } else {
- style.height = "fit-content";
- }
- return style;
- },
- wrapStyle() {
- let style = {};
- if (this.loading || this.isError || this.width == "100%" || this.mode != "heightFix") {
- style.width = addUnit(this.width);
- } else {
- style.width = "fit-content";
- }
- if (this.loading || this.isError || this.height == "100%" || this.mode != "widthFix") {
- style.height = addUnit(this.height);
- } else {
- style.height = "fit-content";
- }
- style.borderRadius = this.shape == "circle" ? "10000px" : addUnit(this.radius);
- style.overflow = this.radius > 0 ? "hidden" : "visible";
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- mounted() {
- this.show = true;
- },
- emits: ["click", "error", "load"],
- methods: {
- addUnit,
- // 点击图片
- onClick(e2) {
- this.$emit("click", e2);
- },
- // 图片加载失败
- onErrorHandler(err) {
- this.loading = false;
- this.isError = true;
- this.$emit("error", err);
- },
- // 图片加载完成,标记loading结束
- onLoadHandler(event) {
- this.loading = false;
- this.isError = false;
- this.$emit("load", event);
- this.removeBgColor();
- },
- // 移除图片的背景色
- removeBgColor() {
- }
- }
- };
- function _sfc_render$1j(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_2$1);
- return vue.openBlock(), vue.createBlock(_component_u_transition, {
- mode: "fade",
- show: $data.show,
- style: vue.normalizeStyle($options.transStyle),
- duration: _ctx.fade ? 1e3 : 0
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "u-image box-border",
- onClick: _cache[2] || (_cache[2] = (...args) => $options.onClick && $options.onClick(...args)),
- style: vue.normalizeStyle([$options.wrapStyle, $data.backgroundStyle])
- },
- [
- !$data.isError ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _ctx.src,
- mode: _ctx.mode,
- onError: _cache[0] || (_cache[0] = (...args) => $options.onErrorHandler && $options.onErrorHandler(...args)),
- onLoad: _cache[1] || (_cache[1] = (...args) => $options.onLoadHandler && $options.onLoadHandler(...args)),
- "show-menu-by-longpress": _ctx.showMenuByLongpress,
- "lazy-load": _ctx.lazyLoad,
- class: "u-image__image",
- style: vue.normalizeStyle({
- width: $options.addUnit(_ctx.width),
- height: $options.addUnit(_ctx.height),
- borderRadius: _ctx.shape == "circle" ? "10000px" : $options.addUnit(_ctx.radius)
- })
- }, null, 44, ["src", "mode", "show-menu-by-longpress", "lazy-load"])) : vue.createCommentVNode("v-if", true),
- _ctx.showLoading && $data.loading ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "u-image__loading",
- style: vue.normalizeStyle({
- borderRadius: _ctx.shape == "circle" ? "50%" : $options.addUnit(_ctx.radius),
- backgroundColor: this.bgColor,
- width: $options.addUnit(_ctx.width),
- height: $options.addUnit(_ctx.height)
- })
- },
- [
- vue.renderSlot(_ctx.$slots, "loading", {}, () => [
- vue.createVNode(_component_up_icon, { name: _ctx.loadingIcon }, null, 8, ["name"])
- ], true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.showError && $data.isError && !$data.loading ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "u-image__error",
- style: vue.normalizeStyle({
- borderRadius: _ctx.shape == "circle" ? "50%" : $options.addUnit(_ctx.radius),
- backgroundColor: this.bgColor,
- width: $options.addUnit(_ctx.width),
- height: $options.addUnit(_ctx.height)
- })
- },
- [
- vue.renderSlot(_ctx.$slots, "error", {}, () => [
- vue.createVNode(_component_up_icon, { name: _ctx.errorIcon }, null, 8, ["name"])
- ], true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "style", "duration"]);
- }
- const uImage = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["render", _sfc_render$1j], ["__scopeId", "data-v-abebd402"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-image/u-image.vue"]]);
- const __vite_glob_0_47 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uImage
- }, Symbol.toStringTag, { value: "Module" }));
- const props$Q = defineMixin({
- props: {
- // 列表锚点文本内容
- text: {
- type: [String, Number],
- default: () => props$1x.indexAnchor.text
- },
- // 列表锚点文字颜色
- color: {
- type: String,
- default: () => props$1x.indexAnchor.color
- },
- // 列表锚点文字大小,单位默认px
- size: {
- type: [String, Number],
- default: () => props$1x.indexAnchor.size
- },
- // 列表锚点背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.indexAnchor.bgColor
- },
- // 列表锚点高度,单位默认px
- height: {
- type: [String, Number],
- default: () => props$1x.indexAnchor.height
- }
- }
- });
- const _sfc_main$1j = {
- name: "u-index-anchor",
- mixins: [mpMixin, mixin, props$Q],
- data() {
- return {};
- },
- mounted() {
- this.init();
- },
- methods: {
- addUnit,
- init() {
- const indexList2 = $parent.call(this, "u-index-list");
- if (!indexList2) {
- return error("u-index-anchor必须要搭配u-index-list组件使用");
- }
- indexList2.anchors.push(this);
- const indexListItem = $parent.call(this, "u-index-item");
- if (!indexListItem) {
- return error("u-index-anchor必须要搭配u-index-item组件使用");
- }
- if (typeof this.text == "string") {
- indexListItem.id = this.text.charCodeAt(0);
- } else {
- indexListItem.id = this.text.name.charCodeAt(0);
- }
- }
- },
- computed: {
- parentSticky() {
- const indexList2 = $parent.call(this, "u-index-list");
- return indexList2 ? indexList2.sticky : true;
- }
- }
- };
- function _sfc_render$1i(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-index-anchor u-border-bottom", { "u-index-anchor--sticky": $options.parentSticky }]),
- ref: `u-index-anchor-${_ctx.text}`,
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.height),
- backgroundColor: _ctx.bgColor
- })
- },
- [
- vue.createElementVNode(
- "text",
- {
- class: "u-index-anchor__text",
- style: vue.normalizeStyle({
- fontSize: $options.addUnit(_ctx.size),
- color: _ctx.color
- })
- },
- vue.toDisplayString(_ctx.text.name || _ctx.text),
- 5
- /* TEXT, STYLE */
- )
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uIndexAnchor = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["render", _sfc_render$1i], ["__scopeId", "data-v-20d39374"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-index-anchor/u-index-anchor.vue"]]);
- const __vite_glob_0_48 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uIndexAnchor
- }, Symbol.toStringTag, { value: "Module" }));
- const props$P = defineMixin({
- props: {}
- });
- const _sfc_main$1i = {
- name: "u-index-item",
- mixins: [mpMixin, mixin, props$P],
- data() {
- return {
- // 本组件到滚动条顶部的距离
- top: 0,
- height: 0,
- id: ""
- };
- },
- created() {
- this.anchor = {};
- },
- mounted() {
- this.init();
- },
- methods: {
- init() {
- this.getParentData("u-index-list");
- if (!this.parent) {
- return error("u-index-item必须要搭配u-index-list组件使用");
- }
- sleep().then(() => {
- this.getIndexItemRect().then((size) => {
- this.top = Math.ceil(size.top);
- this.height = Math.ceil(size.height);
- });
- });
- },
- getIndexItemRect() {
- return new Promise((resolve) => {
- this.$uGetRect(".u-index-item").then((size) => {
- resolve(size);
- });
- });
- }
- }
- };
- function _sfc_render$1h(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["u-index-item", [`u-index-item-${$data.id}`]]),
- id: `u-index-item-${$data.id}`
- }, [
- vue.renderSlot(_ctx.$slots, "default")
- ], 10, ["id"]);
- }
- const uIndexItem = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["render", _sfc_render$1h], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-index-item/u-index-item.vue"]]);
- const __vite_glob_0_49 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uIndexItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$O = defineMixin({
- props: {
- // 右边锚点非激活的颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.indexList.inactiveColor
- },
- // 右边锚点激活的颜色
- activeColor: {
- type: String,
- default: () => props$1x.indexList.activeColor
- },
- // 索引字符列表,数组形式
- indexList: {
- type: Array,
- default: () => props$1x.indexList.indexList
- },
- // 是否开启锚点自动吸顶
- sticky: {
- type: Boolean,
- default: () => props$1x.indexList.sticky
- },
- // 自定义导航栏的高度
- customNavHeight: {
- type: [String, Number],
- default: () => props$1x.indexList.customNavHeight
- },
- // 是否开启底部安全距离适配
- safeBottomFix: {
- type: Boolean,
- default: () => props$1x.indexList.safeBottomFix
- }
- }
- });
- const indexList = () => {
- const indexList2 = [];
- const charCodeOfA = "A".charCodeAt(0);
- for (let i2 = 0; i2 < 26; i2++) {
- indexList2.push(String.fromCharCode(charCodeOfA + i2));
- }
- return indexList2;
- };
- const _sfc_main$1h = {
- name: "u-index-list",
- mixins: [mpMixin, mixin, props$O],
- data() {
- return {
- // 当前正在被选中的字母索引
- activeIndex: -1,
- touchmoveIndex: 1,
- // 索引字母的信息
- letterInfo: {
- height: 0,
- itemHeight: 0,
- top: 0
- },
- // 设置字母指示器的高度,后面为了让指示器跟随字母,并将尖角部分指向字母的中部,需要依赖此值
- indicatorHeight: 50,
- // 字母放大指示器的top值,为了让其指向当前激活的字母
- // indicatorTop: 0
- // 当前是否正在被触摸状态
- touching: false,
- // 滚动条顶部top值
- scrollTop: 0,
- // scroll-view的高度
- scrollViewHeight: 0,
- // 系统信息
- sys: {},
- scrolling: false,
- scrollIntoView: "",
- pageY: 0,
- topOffset: 0
- };
- },
- computed: {
- // 如果有传入外部的indexList锚点数组则使用,否则使用内部生成A-Z字母
- uIndexList() {
- return this.indexList.length ? this.indexList : indexList();
- },
- // 字母放大指示器的top值,为了让其指向当前激活的字母
- indicatorTop() {
- const {
- top,
- height,
- itemHeight
- } = this.letterInfo;
- return Math.floor(top - height / 2 + itemHeight * this.activeIndex + itemHeight - 70 / 2);
- }
- },
- watch: {
- // 监听字母索引的变化,重新设置尺寸
- uIndexList: {
- immediate: false,
- handler() {
- sleep(30).then(() => {
- this.setIndexListLetterInfo();
- });
- }
- }
- },
- created() {
- this.children = [];
- this.anchors = [];
- this.sys = getWindowInfo();
- },
- mounted() {
- this.init();
- sleep(50).then(() => {
- this.setIndexListLetterInfo();
- });
- },
- methods: {
- addUnit,
- init() {
- let customNavHeight = getPx(this.customNavHeight);
- this.getIndexListRect().then(async (sizeScroll) => {
- this.scrollViewHeight = sizeScroll.height ? sizeScroll.height : this.sys.windowHeight - customNavHeight;
- this.topOffset = this.sys.windowHeight - this.scrollViewHeight;
- });
- },
- // 索引列表被触摸
- touchStart(e2) {
- const touchStartData = e2.changedTouches[0];
- if (!touchStartData)
- return;
- this.touching = true;
- const {
- pageY,
- screenY
- } = touchStartData;
- const currentIndex = this.getIndexListLetter(pageY);
- this.setValueForTouch(currentIndex);
- },
- // 索引字母列表被触摸滑动中
- touchMove(e2) {
- let touchMove = e2.changedTouches[0];
- if (!touchMove)
- return;
- if (!this.touching) {
- this.touching = true;
- }
- const {
- pageY,
- screenY
- } = touchMove;
- const currentIndex = this.getIndexListLetter(pageY);
- this.setValueForTouch(currentIndex);
- },
- // 触摸结束
- touchEnd(e2) {
- sleep(300).then(() => {
- this.touching = false;
- });
- },
- // 获取索引列表的尺寸以及单个字符的尺寸信息
- getIndexListLetterRect() {
- return new Promise((resolve) => {
- this.$uGetRect(".u-index-list__letter").then((size) => {
- resolve(size);
- });
- });
- },
- getIndexListScrollViewRect() {
- return new Promise((resolve) => {
- this.$uGetRect(".u-index-list__scroll-view").then((size) => {
- resolve(size);
- });
- });
- },
- getIndexListRect() {
- return new Promise((resolve) => {
- this.$uGetRect(".u-index-list").then((size) => {
- resolve(size);
- });
- });
- },
- // 设置indexList索引的尺寸信息
- setIndexListLetterInfo() {
- this.getIndexListLetterRect().then((size) => {
- const {
- height
- } = size;
- const sysData = getWindowInfo();
- sysData.windowHeight;
- if (this.customNavHeight == 0) {
- -(sysData.statusBarHeight + 44);
- } else {
- getPx(this.customNavHeight);
- }
- this.getIndexListScrollViewRect().then((sizeScroll) => {
- this.letterInfo = {
- height,
- // 为了让字母列表对屏幕绝对居中,让其对导航栏进行修正,也即往上偏移导航栏的一半高度
- top: sizeScroll.height / 2,
- // top: (this.scrollViewHeight - height) / 2 + customNavHeight / 2,
- itemHeight: Math.floor(height / this.uIndexList.length)
- };
- });
- });
- },
- // 获取当前被触摸的索引字母
- getIndexListLetter(pageY) {
- this.pageY = pageY;
- let {
- top,
- height,
- itemHeight
- } = this.letterInfo;
- let index2 = this.currentIndex;
- top = top - height / 2;
- pageY = pageY - this.topOffset;
- if (pageY < top) {
- index2 = 0;
- } else if (pageY >= top + height) {
- index2 = this.uIndexList.length - 1;
- } else {
- index2 = Math.floor((pageY - top) / itemHeight);
- }
- return index2;
- },
- // 设置各项由触摸而导致变化的值
- async setValueForTouch(currentIndex) {
- if (currentIndex === this.activeIndex)
- return;
- this.activeIndex = currentIndex;
- this.$emit("select", this.uIndexList[currentIndex]);
- if (typeof this.uIndexList[currentIndex] == "string") {
- this.scrollIntoView = `u-index-item-${this.uIndexList[currentIndex].charCodeAt(0)}`;
- } else {
- this.scrollIntoView = `u-index-item-${this.uIndexList[currentIndex].name.charCodeAt(0)}`;
- }
- },
- getHeaderRect() {
- return new Promise((resolve) => {
- if (!this.$slots.header) {
- resolve({
- width: 0,
- height: 0
- });
- }
- this.$uGetRect(".u-index-list__header").then((size) => {
- resolve(size);
- });
- });
- },
- // scroll-view的滚动事件
- async scrollHandler(e2) {
- if (this.touching || this.scrolling)
- return;
- this.scrolling = true;
- sleep(10).then(() => {
- this.scrolling = false;
- });
- let scrollTop = 0;
- const len = this.children.length;
- let children = this.children;
- const header = await this.getHeaderRect();
- let top = header.height;
- this.anchors;
- children = this.children.map((item, index2) => {
- const child = {
- height: item.height,
- top
- };
- top = top + item.height;
- return child;
- });
- scrollTop = e2.detail.scrollTop;
- scrollTop = scrollTop + getPx(this.customNavHeight);
- for (let i2 = 0; i2 < len; i2++) {
- const item = children[i2], nextItem = children[i2 + 1];
- if (scrollTop <= children[0].top || scrollTop >= children[len - 1].top + children[len - 1].height) {
- this.activeIndex = -1;
- break;
- } else if (!nextItem) {
- this.activeIndex = len - 1;
- break;
- } else if (scrollTop > item.top && scrollTop < nextItem.top) {
- this.activeIndex = i2;
- break;
- }
- }
- }
- }
- };
- function _sfc_render$1g(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_2$1);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- ref: "u-index-list",
- class: "u-index-list"
- },
- [
- vue.createElementVNode("scroll-view", {
- scrollTop: $data.scrollTop,
- scrollIntoView: $data.scrollIntoView,
- "offset-accuracy": 1,
- style: vue.normalizeStyle({
- maxHeight: $options.addUnit($data.scrollViewHeight)
- }),
- "scroll-y": "",
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.scrollHandler && $options.scrollHandler(...args)),
- ref: "u-index-list__scroll-view",
- class: "u-index-list__scroll-view"
- }, [
- _ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-index-list__header"
- }, [
- vue.renderSlot(_ctx.$slots, "header", {}, void 0, true)
- ])) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-index-list__footer"
- }, [
- vue.renderSlot(_ctx.$slots, "footer", {}, void 0, true)
- ])) : vue.createCommentVNode("v-if", true)
- ], 44, ["scrollTop", "scrollIntoView"]),
- vue.createElementVNode(
- "view",
- {
- class: "u-index-list__letter",
- ref: "u-index-list__letter",
- style: vue.normalizeStyle({ top: $options.addUnit($data.letterInfo.top), transform: "translateY(-50%)" }),
- onTouchstart: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.touchStart && $options.touchStart(...args), ["prevent"])),
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.touchMove && $options.touchMove(...args), ["prevent"])),
- onTouchend: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.touchEnd && $options.touchEnd(...args), ["prevent"])),
- onTouchcancel: _cache[4] || (_cache[4] = vue.withModifiers((...args) => $options.touchEnd && $options.touchEnd(...args), ["prevent"]))
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.uIndexList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-index-list__letter__item",
- key: index2,
- style: vue.normalizeStyle({
- backgroundColor: $data.activeIndex === index2 ? _ctx.activeColor : "transparent"
- })
- },
- [
- vue.createElementVNode(
- "text",
- {
- class: "u-index-list__letter__item__index",
- style: vue.normalizeStyle({ color: $data.activeIndex === index2 ? "#fff" : _ctx.inactiveColor })
- },
- vue.toDisplayString(item.key || item),
- 5
- /* TEXT, STYLE */
- )
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- ),
- vue.createVNode(_component_u_transition, {
- mode: "fade",
- show: $data.touching,
- customStyle: {
- position: "absolute",
- right: "50px",
- top: $options.addUnit($options.indicatorTop, "px"),
- zIndex: 3
- }
- }, {
- default: vue.withCtx(() => {
- var _a2;
- return [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-index-list__indicator", ["u-index-list__indicator--show"]]),
- style: vue.normalizeStyle({
- height: $options.addUnit($data.indicatorHeight),
- width: $options.addUnit($data.indicatorHeight)
- })
- },
- [
- vue.createElementVNode(
- "text",
- { class: "u-index-list__indicator__text" },
- vue.toDisplayString(((_a2 = $options.uIndexList[$data.activeIndex]) == null ? void 0 : _a2.key) || $options.uIndexList[$data.activeIndex]),
- 1
- /* TEXT */
- )
- ],
- 4
- /* STYLE */
- )
- ];
- }),
- _: 1
- /* STABLE */
- }, 8, ["show", "customStyle"])
- ],
- 512
- /* NEED_PATCH */
- );
- }
- const uIndexList = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["render", _sfc_render$1g], ["__scopeId", "data-v-dfefaad1"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-index-list/u-index-list.vue"]]);
- const __vite_glob_0_50 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uIndexList
- }, Symbol.toStringTag, { value: "Module" }));
- const props$N = defineMixin({
- props: {
- // 绑定的值
- modelValue: {
- type: [String, Number],
- default: () => props$1x.input.value
- },
- // number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
- // idcard-身份证输入键盘,微信、支付宝、百度、QQ小程序
- // digit-带小数点的数字键盘,App的nvue页面、微信、支付宝、百度、头条、QQ小程序
- // text-文本输入键盘
- type: {
- type: String,
- default: () => props$1x.input.type
- },
- // 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,
- // 兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序
- fixed: {
- type: Boolean,
- default: () => props$1x.input.fixed
- },
- // 是否禁用输入框
- disabled: {
- type: Boolean,
- default: () => props$1x.input.disabled
- },
- // 禁用状态时的背景色
- disabledColor: {
- type: String,
- default: () => props$1x.input.disabledColor
- },
- // 是否显示清除控件
- clearable: {
- type: Boolean,
- default: false
- },
- // 是否仅在聚焦时显示清除控件
- onlyClearableOnFocused: {
- type: Boolean,
- default: true
- },
- // 是否密码类型
- password: {
- type: Boolean,
- default: () => props$1x.input.password
- },
- // 最大输入长度,设置为 -1 的时候不限制最大长度
- maxlength: {
- type: [String, Number],
- default: () => props$1x.input.maxlength
- },
- // 输入框为空时的占位符
- placeholder: {
- type: String,
- default: () => props$1x.input.placeholder
- },
- // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
- placeholderClass: {
- type: String,
- default: () => props$1x.input.placeholderClass
- },
- // 指定placeholder的样式
- placeholderStyle: {
- type: [String, Object],
- default: () => props$1x.input.placeholderStyle
- },
- // 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
- showWordLimit: {
- type: Boolean,
- default: () => props$1x.input.showWordLimit
- },
- // 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
- // https://uniapp.dcloud.io/component/input
- // https://uniapp.dcloud.io/component/textarea
- confirmType: {
- type: String,
- default: () => props$1x.input.confirmType
- },
- // 点击键盘右下角按钮时是否保持键盘不收起,H5无效
- confirmHold: {
- type: Boolean,
- default: () => props$1x.input.confirmHold
- },
- // focus时,点击页面的时候不收起键盘,微信小程序有效
- holdKeyboard: {
- type: Boolean,
- default: () => props$1x.input.holdKeyboard
- },
- // 自动获取焦点
- // 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
- focus: {
- type: Boolean,
- default: () => props$1x.input.focus
- },
- // 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
- autoBlur: {
- type: Boolean,
- default: () => props$1x.input.autoBlur
- },
- // 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效
- disableDefaultPadding: {
- type: Boolean,
- default: () => props$1x.input.disableDefaultPadding
- },
- // 指定focus时光标的位置
- cursor: {
- type: [String, Number],
- default: () => props$1x.input.cursor
- },
- // 输入框聚焦时底部与键盘的距离
- cursorSpacing: {
- type: [String, Number],
- default: () => props$1x.input.cursorSpacing
- },
- // 光标起始位置,自动聚集时有效,需与selection-end搭配使用
- selectionStart: {
- type: [String, Number],
- default: () => props$1x.input.selectionStart
- },
- // 光标结束位置,自动聚集时有效,需与selection-start搭配使用
- selectionEnd: {
- type: [String, Number],
- default: () => props$1x.input.selectionEnd
- },
- // 键盘弹起时,是否自动上推页面
- adjustPosition: {
- type: Boolean,
- default: () => props$1x.input.adjustPosition
- },
- // 输入框内容对齐方式,可选值为:left|center|right
- inputAlign: {
- type: String,
- default: () => props$1x.input.inputAlign
- },
- // 输入框字体的大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.input.fontSize
- },
- // 输入框字体颜色
- color: {
- type: String,
- default: () => props$1x.input.color
- },
- // 输入框前置图标
- prefixIcon: {
- type: String,
- default: () => props$1x.input.prefixIcon
- },
- // 前置图标样式,对象或字符串
- prefixIconStyle: {
- type: [String, Object],
- default: () => props$1x.input.prefixIconStyle
- },
- // 输入框后置图标
- suffixIcon: {
- type: String,
- default: () => props$1x.input.suffixIcon
- },
- // 后置图标样式,对象或字符串
- suffixIconStyle: {
- type: [String, Object],
- default: () => props$1x.input.suffixIconStyle
- },
- // 边框类型,surround-四周边框,bottom-底部边框,none-无边框
- border: {
- type: String,
- default: () => props$1x.input.border
- },
- // 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
- readonly: {
- type: Boolean,
- default: () => props$1x.input.readonly
- },
- // 输入框形状,circle-圆形,square-方形
- shape: {
- type: String,
- default: () => props$1x.input.shape
- },
- // 用于处理或者过滤输入框内容的方法
- formatter: {
- type: [Function, null],
- default: () => props$1x.input.formatter
- },
- // 是否忽略组件内对文本合成系统事件的处理
- ignoreCompositionEvent: {
- type: Boolean,
- default: true
- },
- // 光标颜色
- cursorColor: {
- type: String,
- default: () => props$1x.input.cursorColor
- },
- // 密码类型可见性切换
- passwordVisibilityToggle: {
- type: Boolean,
- default: () => props$1x.input.passwordVisibilityToggle
- }
- }
- });
- let timeout = null;
- function debounce(func2, wait2 = 500, immediate = false) {
- if (timeout !== null)
- clearTimeout(timeout);
- if (immediate) {
- const callNow = !timeout;
- timeout = setTimeout(() => {
- timeout = null;
- }, wait2);
- if (callNow)
- typeof func2 === "function" && func2();
- } else {
- timeout = setTimeout(() => {
- typeof func2 === "function" && func2();
- }, wait2);
- }
- }
- const _sfc_main$1g = {
- name: "u-input",
- mixins: [mpMixin, mixin, props$N],
- data() {
- return {
- // 清除操作
- clearInput: false,
- // 输入框的值
- innerValue: "",
- // 是否处于获得焦点状态
- focused: false,
- // value是否第一次变化,在watch中,由于加入immediate属性,会在第一次触发,此时不应该认为value发生了变化
- firstChange: true,
- // value绑定值的变化是由内部还是外部引起的
- changeFromInner: false,
- // 过滤处理方法
- innerFormatter: (value2) => value2,
- showPassword: false
- };
- },
- created() {
- if (this.formatter) {
- this.innerFormatter = this.formatter;
- }
- },
- watch: {
- modelValue: {
- immediate: true,
- handler(newVal, oldVal) {
- if (this.changeFromInner || this.innerValue === newVal) {
- this.changeFromInner = false;
- return;
- }
- this.innerValue = newVal;
- if (this.firstChange === false && this.changeFromInner === false) {
- this.valueChange(this.innerValue, true);
- } else {
- if (!this.firstChange)
- formValidate(this, "change");
- }
- this.firstChange = false;
- this.changeFromInner = false;
- }
- }
- },
- computed: {
- // 是否密码
- isPassword() {
- let ret = false;
- if (this.password) {
- ret = true;
- } else if (this.type == "password") {
- ret = true;
- } else {
- ret = false;
- }
- if (this.showPassword) {
- ret = false;
- }
- return ret;
- },
- // 是否显示清除控件
- isShowClear() {
- const { clearable, readonly, focused, innerValue, onlyClearableOnFocused } = this;
- if (!clearable || readonly) {
- return false;
- }
- if (onlyClearableOnFocused) {
- return !!focused && innerValue !== "";
- } else {
- return innerValue !== "";
- }
- },
- // 组件的类名
- inputClass() {
- let classes = [], { border, disabled, shape } = this;
- border === "surround" && (classes = classes.concat(["u-border", "u-input--radius"]));
- classes.push(`u-input--${shape}`);
- border === "bottom" && (classes = classes.concat([
- "u-border-bottom",
- "u-input--no-radius"
- ]));
- return classes.join(" ");
- },
- // 组件的样式
- wrapperStyle() {
- const style = {};
- if (this.disabled) {
- style.backgroundColor = this.disabledColor;
- }
- if (this.border === "none") {
- style.padding = "0";
- } else {
- style.paddingTop = "6px";
- style.paddingBottom = "6px";
- style.paddingLeft = "9px";
- style.paddingRight = "9px";
- }
- return deepMerge$1(style, addStyle(this.customStyle));
- },
- // 输入框的样式
- inputStyle() {
- const style = {
- color: this.color,
- fontSize: addUnit(this.fontSize),
- textAlign: this.inputAlign
- };
- return style;
- }
- },
- emits: ["update:modelValue", "focus", "blur", "change", "confirm", "clear", "keyboardheightchange", "nicknamereview"],
- methods: {
- // 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
- setFormatter(e2) {
- this.innerFormatter = e2;
- },
- // 当键盘输入时,触发input事件
- onInput(e2) {
- let { value: value2 = "" } = e2.detail || {};
- this.innerValue = value2;
- this.$nextTick(() => {
- let formatValue = this.innerFormatter(value2);
- this.innerValue = formatValue;
- this.valueChange(formatValue);
- });
- },
- // 输入框失去焦点时触发
- onBlur(event) {
- this.$emit("blur", event.detail.value);
- sleep(150).then(() => {
- this.focused = false;
- });
- formValidate(this, "blur");
- },
- // 输入框聚焦时触发
- onFocus(event) {
- this.focused = true;
- this.$emit("focus");
- },
- doFocus() {
- this.$refs["input-native"].focus();
- },
- doBlur() {
- this.$refs["input-native"].blur();
- },
- // 点击完成按钮时触发
- onConfirm(event) {
- this.$emit("confirm", this.innerValue);
- },
- // 键盘高度发生变化的时候触发此事件
- // 兼容性:微信小程序2.7.0+、App 3.1.0+
- onkeyboardheightchange(event) {
- this.$emit("keyboardheightchange", event);
- },
- onnicknamereview(event) {
- this.$emit("nicknamereview", event);
- },
- // 内容发生变化,进行处理
- valueChange(value2, isOut = false) {
- if (this.clearInput) {
- this.innerValue = "";
- this.clearInput = false;
- }
- this.$nextTick(() => {
- if (!isOut || this.clearInput) {
- this.changeFromInner = true;
- this.$emit("change", value2);
- this.$emit("update:modelValue", value2);
- }
- formValidate(this, "change");
- });
- },
- // 点击清除控件
- onClear() {
- this.clearInput = true;
- this.innerValue = "";
- this.$nextTick(() => {
- this.valueChange("");
- this.$emit("clear");
- });
- },
- /**
- * 在安卓nvue上,事件无法冒泡
- * 在某些时间,我们希望监听u-from-item的点击事件,此时会导致点击u-form-item内的u-input后
- * 无法触发u-form-item的点击事件,这里通过手动调用u-form-item的方法进行触发
- */
- clickHandler() {
- if (this.disabled || this.readonly) {
- uni.hideKeyboard();
- }
- }
- }
- };
- function _sfc_render$1f(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-input", $options.inputClass]),
- style: vue.normalizeStyle([$options.wrapperStyle])
- },
- [
- vue.createElementVNode("view", { class: "u-input__content" }, [
- _ctx.prefixIcon || _ctx.$slots.prefix ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-input__content__prefix-icon"
- }, [
- vue.renderSlot(_ctx.$slots, "prefix", {}, () => [
- vue.createVNode(_component_up_icon, {
- name: _ctx.prefixIcon,
- size: "18",
- customStyle: _ctx.prefixIconStyle
- }, null, 8, ["name", "customStyle"])
- ], true)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", {
- class: "u-input__content__field-wrapper",
- onClick: _cache[6] || (_cache[6] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- }, [
- vue.createCommentVNode(" 根据uni-app的input组件文档,H5和APP中只要声明了password参数(无论true还是false),type均失效,此时\n 为了防止type=number时,又存在password属性,type无效,此时需要设置password为undefined\n "),
- vue.createElementVNode("input", {
- ref: "input-native",
- class: "u-input__content__field-wrapper__field",
- style: vue.normalizeStyle([$options.inputStyle]),
- type: $data.showPassword && "password" == _ctx.type ? "text" : _ctx.type,
- focus: _ctx.focus,
- cursor: _ctx.cursor,
- value: $data.innerValue,
- "auto-blur": _ctx.autoBlur,
- disabled: _ctx.disabled || _ctx.readonly,
- maxlength: _ctx.maxlength,
- placeholder: _ctx.placeholder,
- "placeholder-style": _ctx.placeholderStyle,
- "placeholder-class": _ctx.placeholderClass,
- "confirm-type": _ctx.confirmType,
- "confirm-hold": _ctx.confirmHold,
- "hold-keyboard": _ctx.holdKeyboard,
- "cursor-color": _ctx.cursorColor,
- "cursor-spacing": _ctx.cursorSpacing,
- "adjust-position": _ctx.adjustPosition,
- "selection-end": _ctx.selectionEnd,
- "selection-start": _ctx.selectionStart,
- password: $options.isPassword,
- ignoreCompositionEvent: _ctx.ignoreCompositionEvent,
- onInput: _cache[0] || (_cache[0] = (...args) => $options.onInput && $options.onInput(...args)),
- onBlur: _cache[1] || (_cache[1] = (...args) => $options.onBlur && $options.onBlur(...args)),
- onFocus: _cache[2] || (_cache[2] = (...args) => $options.onFocus && $options.onFocus(...args)),
- onConfirm: _cache[3] || (_cache[3] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
- onKeyboardheightchange: _cache[4] || (_cache[4] = (...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args)),
- onNicknamereview: _cache[5] || (_cache[5] = (...args) => $options.onnicknamereview && $options.onnicknamereview(...args))
- }, null, 44, ["type", "focus", "cursor", "value", "auto-blur", "disabled", "maxlength", "placeholder", "placeholder-style", "placeholder-class", "confirm-type", "confirm-hold", "hold-keyboard", "cursor-color", "cursor-spacing", "adjust-position", "selection-end", "selection-start", "password", "ignoreCompositionEvent"])
- ]),
- $options.isShowClear ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-input__content__clear",
- onClick: _cache[7] || (_cache[7] = (...args) => $options.onClear && $options.onClear(...args))
- }, [
- vue.createVNode(_component_up_icon, {
- name: "close",
- size: "11",
- color: "#ffffff",
- customStyle: "line-height: 12px"
- })
- ])) : vue.createCommentVNode("v-if", true),
- (_ctx.type == "password" || _ctx.password) && _ctx.passwordVisibilityToggle ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "u-input__content__subfix-password-shower"
- }, [
- vue.createVNode(_component_up_icon, {
- onClick: _cache[8] || (_cache[8] = ($event) => $data.showPassword = !$data.showPassword),
- name: $data.showPassword ? "eye-off" : "eye-fill",
- size: "18"
- }, null, 8, ["name"])
- ])) : vue.createCommentVNode("v-if", true),
- _ctx.suffixIcon || _ctx.$slots.suffix ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 3,
- class: "u-input__content__subfix-icon"
- }, [
- vue.renderSlot(_ctx.$slots, "suffix", {}, () => [
- vue.createVNode(_component_up_icon, {
- name: _ctx.suffixIcon,
- size: "18",
- customStyle: _ctx.suffixIconStyle
- }, null, 8, ["name", "customStyle"])
- ], true)
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uInput = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["render", _sfc_render$1f], ["__scopeId", "data-v-df79975b"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-input/u-input.vue"]]);
- const __vite_glob_0_51 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uInput
- }, Symbol.toStringTag, { value: "Module" }));
- const props$M = defineMixin({
- props: {
- // 键盘的类型,number-数字键盘,card-身份证键盘
- mode: {
- type: String,
- default: () => props$1x.numberKeyboard.value
- },
- // 是否显示键盘的"."符号
- dotDisabled: {
- type: Boolean,
- default: () => props$1x.numberKeyboard.dotDisabled
- },
- // 是否打乱键盘按键的顺序
- random: {
- type: Boolean,
- default: () => props$1x.numberKeyboard.random
- }
- }
- });
- const _sfc_main$1f = {
- name: "u-number-keyboard",
- mixins: [mpMixin, mixin, props$M],
- data() {
- return {
- backspace: "backspace",
- // 退格键内容
- dot: ".",
- // 点
- timer: null,
- // 长按多次删除的事件监听
- cardX: "X"
- // 身份证的X符号
- };
- },
- computed: {
- // 键盘需要显示的内容
- numList() {
- if (this.dotDisabled && this.mode == "number") {
- if (!this.random) {
- return [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
- } else {
- return randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]);
- }
- } else if (!this.dotDisabled && this.mode == "number") {
- if (!this.random) {
- return [1, 2, 3, 4, 5, 6, 7, 8, 9, this.dot, 0];
- } else {
- return randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, this.dot, 0]);
- }
- } else if (this.mode == "card") {
- if (!this.random) {
- return [1, 2, 3, 4, 5, 6, 7, 8, 9, this.cardX, 0];
- } else {
- return randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, this.cardX, 0]);
- }
- }
- },
- // 按键的样式,在非乱序&&数字键盘&&不显示点按钮时,index为9时,按键占位两个空间
- itemStyle() {
- return (index2) => {
- let style = {};
- if (this.mode == "number" && this.dotDisabled && index2 == 9)
- style.width = "464rpx";
- return style;
- };
- },
- // 是否让按键显示灰色,只在非乱序&&数字键盘&&且允许点按键的时候
- btnBgGray() {
- return (index2) => {
- if (!this.random && index2 == 9 && (this.mode != "number" || this.mode == "number" && !this.dotDisabled))
- return true;
- else
- return false;
- };
- }
- },
- created() {
- },
- emits: ["backspace", "change"],
- methods: {
- // 点击退格键
- backspaceClick() {
- this.$emit("backspace");
- clearInterval(this.timer);
- this.timer = null;
- this.timer = setInterval(() => {
- this.$emit("backspace");
- }, 250);
- },
- clearTimer() {
- clearInterval(this.timer);
- this.timer = null;
- },
- // 获取键盘显示的内容
- keyboardClick(val) {
- if (!this.dotDisabled && val != this.dot && val != this.cardX)
- val = Number(val);
- this.$emit("change", val);
- }
- }
- };
- function _sfc_render$1e(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-keyboard",
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers((...args) => _ctx.noop && _ctx.noop(...args), ["stop", "prevent"]))
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.numList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-keyboard__button-wrapper",
- key: index2
- }, [
- vue.createElementVNode("view", {
- class: "u-keyboard__button-wrapper__button",
- style: vue.normalizeStyle([$options.itemStyle(index2)]),
- onClick: ($event) => $options.keyboardClick(item),
- "hover-class": "u-hover-class",
- "hover-stay-time": 200
- }, [
- vue.createElementVNode(
- "text",
- { class: "u-keyboard__button-wrapper__button__text" },
- vue.toDisplayString(item),
- 1
- /* TEXT */
- )
- ], 12, ["onClick"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode("view", { class: "u-keyboard__button-wrapper" }, [
- vue.createElementVNode(
- "view",
- {
- class: "u-keyboard__button-wrapper__button u-keyboard__button-wrapper__button--gray",
- "hover-class": "u-hover-class",
- "hover-stay-time": 200,
- onTouchstart: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.backspaceClick && $options.backspaceClick(...args), ["stop"])),
- onTouchend: _cache[1] || (_cache[1] = (...args) => $options.clearTimer && $options.clearTimer(...args))
- },
- [
- vue.createVNode(_component_up_icon, {
- name: "backspace",
- color: "#303133",
- size: "28"
- })
- ],
- 32
- /* NEED_HYDRATION */
- )
- ])
- ],
- 32
- /* NEED_HYDRATION */
- );
- }
- const __easycom_0$3 = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["render", _sfc_render$1e], ["__scopeId", "data-v-d73731be"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-number-keyboard/u-number-keyboard.vue"]]);
- const __vite_glob_0_71 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$3
- }, Symbol.toStringTag, { value: "Module" }));
- const props$L = defineMixin({
- props: {
- // 键盘的类型,number-数字键盘,card-身份证键盘,car-车牌号键盘
- mode: {
- type: String,
- default: () => props$1x.keyboard.mode
- },
- // 是否显示键盘的"."符号
- dotDisabled: {
- type: Boolean,
- default: () => props$1x.keyboard.dotDisabled
- },
- // 是否显示顶部工具条
- tooltip: {
- type: Boolean,
- default: () => props$1x.keyboard.tooltip
- },
- // 是否显示工具条中间的提示
- showTips: {
- type: Boolean,
- default: () => props$1x.keyboard.showTips
- },
- // 工具条中间的提示文字
- tips: {
- type: String,
- default: () => props$1x.keyboard.tips
- },
- // 是否显示工具条左边的"取消"按钮
- showCancel: {
- type: Boolean,
- default: () => props$1x.keyboard.showCancel
- },
- // 是否显示工具条右边的"完成"按钮
- showConfirm: {
- type: Boolean,
- default: () => props$1x.keyboard.showConfirm
- },
- // 是否打乱键盘按键的顺序
- random: {
- type: Boolean,
- default: () => props$1x.keyboard.random
- },
- // 是否开启底部安全区适配,开启的话,会在iPhoneX机型底部添加一定的内边距
- safeAreaInsetBottom: {
- type: Boolean,
- default: () => props$1x.keyboard.safeAreaInsetBottom
- },
- // 是否允许通过点击遮罩关闭键盘
- closeOnClickOverlay: {
- type: Boolean,
- default: () => props$1x.keyboard.closeOnClickOverlay
- },
- // 控制键盘的弹出与收起
- show: {
- type: Boolean,
- default: () => props$1x.keyboard.show
- },
- // 是否显示遮罩,某些时候数字键盘时,用户希望看到自己的数值,所以可能不想要遮罩
- overlay: {
- type: Boolean,
- default: () => props$1x.keyboard.overlay
- },
- // z-index值
- zIndex: {
- type: [String, Number],
- default: () => props$1x.keyboard.zIndex
- },
- // 取消按钮的文字
- cancelText: {
- type: String,
- default: () => props$1x.keyboard.cancelText
- },
- // 确认按钮的文字
- confirmText: {
- type: String,
- default: () => props$1x.keyboard.confirmText
- },
- // 输入一个中文后,是否自动切换到英文
- autoChange: {
- type: Boolean,
- default: () => props$1x.keyboard.autoChange
- }
- }
- });
- const _sfc_main$1e = {
- name: "u-keyboard",
- data() {
- return {};
- },
- mixins: [mpMixin, mixin, props$L],
- emits: ["change", "close", "confirm", "cancel", "backspace"],
- methods: {
- change(e2) {
- this.$emit("change", e2);
- },
- // 键盘关闭
- popupClose() {
- this.$emit("close");
- },
- // 输入完成
- onConfirm() {
- this.$emit("confirm");
- },
- // 取消输入
- onCancel() {
- this.$emit("cancel");
- },
- // 退格键
- backspace() {
- this.$emit("backspace");
- }
- }
- };
- function _sfc_render$1d(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_number_keyboard = resolveEasycom(vue.resolveDynamicComponent("u-number-keyboard"), __easycom_0$3);
- const _component_u_car_keyboard = resolveEasycom(vue.resolveDynamicComponent("u-car-keyboard"), __easycom_1$2);
- const _component_u_popup = resolveEasycom(vue.resolveDynamicComponent("u-popup"), __easycom_2);
- return vue.openBlock(), vue.createBlock(_component_u_popup, {
- overlay: _ctx.overlay,
- closeOnClickOverlay: _ctx.closeOnClickOverlay,
- mode: "bottom",
- popup: false,
- show: _ctx.show,
- safeAreaInsetBottom: _ctx.safeAreaInsetBottom,
- onClose: $options.popupClose,
- zIndex: _ctx.zIndex,
- customStyle: {
- backgroundColor: "rgb(214, 218, 220)"
- }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "u-keyboard" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- _ctx.tooltip ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-keyboard__tooltip"
- }, [
- vue.createElementVNode("view", {
- "hover-class": "u-hover-class",
- "hover-stay-time": 100
- }, [
- _ctx.showCancel ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-keyboard__tooltip__item u-keyboard__tooltip__cancel",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.onCancel && $options.onCancel(...args))
- },
- vue.toDisplayString(_ctx.showCancel && _ctx.cancelText),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", null, [
- _ctx.showTips ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-keyboard__tooltip__item u-keyboard__tooltip__tips"
- },
- vue.toDisplayString(_ctx.tips ? _ctx.tips : _ctx.mode == "number" ? "数字键盘" : _ctx.mode == "card" ? "身份证键盘" : "车牌号键盘"),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", {
- "hover-class": "u-hover-class",
- "hover-stay-time": 100
- }, [
- _ctx.showConfirm ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- onClick: _cache[1] || (_cache[1] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
- class: "u-keyboard__tooltip__item u-keyboard__tooltip__submit",
- "hover-class": "u-hover-class"
- },
- vue.toDisplayString(_ctx.showConfirm && _ctx.confirmText),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ])) : vue.createCommentVNode("v-if", true),
- _ctx.mode == "number" || _ctx.mode == "card" ? (vue.openBlock(), vue.createBlock(_component_u_number_keyboard, {
- key: 1,
- random: _ctx.random,
- onBackspace: $options.backspace,
- onChange: $options.change,
- mode: _ctx.mode,
- dotDisabled: _ctx.dotDisabled
- }, null, 8, ["random", "onBackspace", "onChange", "mode", "dotDisabled"])) : (vue.openBlock(), vue.createBlock(_component_u_car_keyboard, {
- key: 2,
- random: _ctx.random,
- autoChange: _ctx.autoChange,
- onBackspace: $options.backspace,
- onChange: $options.change
- }, null, 8, ["random", "autoChange", "onBackspace", "onChange"]))
- ])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["overlay", "closeOnClickOverlay", "show", "safeAreaInsetBottom", "onClose", "zIndex", "customStyle"]);
- }
- const uKeyboard = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["render", _sfc_render$1d], ["__scopeId", "data-v-5c3a4793"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-keyboard/u-keyboard.vue"]]);
- const __vite_glob_0_52 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uKeyboard
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$1d = {
- name: "u-lazy-load",
- props: {
- index: {
- type: [Number, String]
- },
- // 要显示的图片
- image: {
- type: String,
- default: ""
- },
- // 图片裁剪模式
- imgMode: {
- type: String,
- default: "widthFix"
- },
- // 占位图片路径
- loadingImg: {
- type: String,
- default: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUM0QjNBQjkyQUQ2MTFFQTlCNUQ4RTIzNDE5RUIxNjciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUM0QjNBQkEyQUQ2MTFFQTlCNUQ4RTIzNDE5RUIxNjciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QzRCM0FCNzJBRDYxMUVBOUI1RDhFMjM0MTlFQjE2NyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QzRCM0FCODJBRDYxMUVBOUI1RDhFMjM0MTlFQjE2NyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtRHfPcAAAAzUExURZWVldfX18PDw62trZubm9zc3Li4uKGhoebm5tLS0uHh4c3Nzaenp729vcjIyLKysuvr6141L40AAAcXSURBVHja7NzZlqpGAEBR5lG0//9rIw7IJKJi4or7PGTdtN10wr5SVAEGf/qqArsAiIAAERAgAgJEQIAIiIAAERAgAgJEQIAIiIAAERAgAgJEQIAIiIAAERAgAgJEQIAIiIAAERAgAgJEQIAIiIAAERAgAgJEQIAIiIAAERAgAgJEQIAIiIAAERAgAgJEQIAIiIAAERAgAgJEQIAIiIAAERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAgAgJEQIAICBABERAg+nmQFMi5Jis+sIniED23jSzIgLTtg2D//iYme/8QBM/9lQ+CAEhbNLM3N9hEHAThX7GPCiBfAxK1b51kD+R7QMLjXg7iCsgWIPUh7pfVozG791oeBPngm48G583uW5GkBvI+SBaM2xXDn1oqum423bX/mgF5FySc2cv93Voug9TdZotsggnkBZB2NzbhrSY5HnoG07jei8dvzsJB/c3W60SALILE46+WCztsbhPR7R2VJq0ukEcT49nyy8QhaKcRa3fYHZD4+ufqOJAcgDz8/59vtw1I3QP5K6JsOG0vm3hce4I8LQp/BaRZGJC3AAn7IKOKXbC+7EdA5vdmmVwOLksgRThqOqiH4XEGsht+peoPUE8U/jJIO5OLH4GEwUslV5G0PTBG5Uiw/Y2jyigO3l9HAHKv9PYb82LloH74dZBoBUgar+l48NsNvtD0fkez9iwrAvIYZDRCl+Xs149Hm/KZmQ+QjUCiO1ei4ru7EsgnQYrkznlQb7thCuRfAzlOAPN72427P4VA/i2Q/DKT/Ls/VR8fvIBsDZIuz7TPF6TCbnk4GJkB2RokejTjuE7/unlgCuSTIO0Cy+Plp6vDfnQlBchy8QtjSHVd3EgmK1bHLm+H6+nXYbz2DuQRSPnqoL7vvq0u70on4zvxgCyWD3b9UyDVdW24PaWaiGTnFZJwPIQAebDpIKheBIm7n124ZthMJipAlkqHO+IZkP1tbfzOJark/A7MgKyvvl60fRqkvXfhuow+t9+q00+0/yyBrK8ZngOtBzldhw2X9tvpNGty0gvkmbPeJ0Cy/r09s/stbmfo0yMWkEdjevgKyOn2t2pxv7UXoibTdCDLje9/Ww1ymqzn87dbp92242ZmMRjI8hASvwKSLq4udqN6ksw8nxXN3tszD9L8Gkg+2mFrQYql5az4tvFj5xOx4VwnSdeBtGdyPwUytxK77pBVlNHdO7OK3rh/eTPUvdutT3fO52tuHMqD4N7llv8pyOQQ//w19YVDfX27+Sfuby9/6nau4pdA8vEdOZuChEH/quHt0Jg+IRJ/5+PrHwKZXfjbDiS73Zo7mu5UkzX7uTsXe0e/7nC3ePf1O69+BUg2XDfZCqSqOu7rGVf8cHBe8zhC2b61dtUHXv0OkGo6ZL4JkpbRYXdUaFevivx2M/1GIOctNh949TtAoumQ+TpIHMX54CJu+8BDd8FkE5BqcZh/59XvAClmTvKfB0nDqIlHo3T70SftyW1eX9dXtgQJqs1f/Q6QaOa/7wmQKtxH8eiGoCRuovODIO3VxOMmruZbHrLyD7z6DSDtGyT7ew1kf9hNn07c986JTovzzem0Id9wUG+Vk/IDr34DSNR7huZJkMFT6vEhqrPx/j5cnlZML8N6/PAzh9Y99Flm5Yde/c9BquDOkvkKkMP58dA4qi9vivE8JOvGz/j8FokfPpr288+pH2ZPOZrLmeGD+7KOh6dqYWJ48ki7yUg0tz0go/fv/LLddfV3sgOLJyaGPY/zrSlh1a36Arkzoue9CyG35ze6E6/dzO2Ga0EGHqdRJIkfn9/8OEjTW8Vq91ZWh39FeehWA7Nu9ft8CpUEk1WWOyDF0OPyEU2Pnzf/bZC0P6IPzmAvu7KauQBVrgKpJ0tG2arHzX8e5Pb3PezNs/PrX+3JMyCLn9XXf37tPFHvt09WfCDDjx+yyn1/p1V11j7GnB/q3leLuVva79S/tzed+db08YpF4uOZtmz/9oXWMq6BCAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAERECACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiACAgQAQEiIEAEBIiAALELvqt/BBgACqVeUBXxcCkAAAAASUVORK5CYII="
- },
- // 加载失败的错误占位图
- errorImg: {
- type: String,
- default: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODdDMjhENDYyQUQ2MTFFQTlDQ0VBODgxQjFFOEEyMEMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODdDMjhENDcyQUQ2MTFFQTlDQ0VBODgxQjFFOEEyMEMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4N0MyOEQ0NDJBRDYxMUVBOUNDRUE4ODFCMUU4QTIwQyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4N0MyOEQ0NTJBRDYxMUVBOUNDRUE4ODFCMUU4QTIwQyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhLwhikAAAAzUExURZWVldfX162trcPDw5ubm7i4uNzc3Obm5s3NzaGhoeHh4cjIyKenp9LS0r29vbKysuvr67sDMEkAAAlpSURBVHja7NzpYqMgAIVRUVHc8/5PO66R1WAbOzX97q+ZtDEpR0AWTR7kVyWhCAAhgABCAAGEAAIIAQQQAggBBBACCCAEEEAIIIAQQAgggBBAACGAAEIAAYQAQgABhAACCAEEEAIIIAQQAgggBBBACCCAEEAAIYAQQAAhgABCAAGEAAIIAYQAAggBBBACCCAEEEAIIAQQQAgggBBAACGAAEIAIYAAQgABhAACCAEEEAIIAQQQAgggBBBACCCAEEAAIYAQQAAhgABCAAGEAAIIAYQAAggBBBACCCAEEEAIIAQQQAgggBBAACGAAEIAIYAAQgABhAACCAEEEAIIAQQQAgggBBBACCCAEEAIIIAQQAAhgABCAAGEAEIAAYQAAggBBBACCCAEEAIIIAQQQAgggBBAACGAEEAAIYAAsqeX5QWHKIcs/Ptl03lfL4zDFPWfBGmSpPn+IZzSH5KkCL5B+n+oklwz6Iz//R2QzFOabzhEmiRirAmZt/bl0w/dpMbLqeeo4wEdpC7zR5WAPKziHKtO7ql+ReKvIa9BxgNaL5ZtEkpeAGIVp5jKJa09xVo9vgSSzQcszdYvmOqjQNSQ6pHK6rO1n1Xj32788miwHLaZz1Tl9i/yayDlYJ/60/+lp8GSY7OY1B8E4p55bWmfquFk22GLuUUxi78cX+m+BjL2GLkhMrV+/muS6Sfic0CEp5T1Yu2OQdTzsKV0MJV73KVjroyTffxfuv5Tf3fd6iLT9wz8YdVHgUzF2Is9/Xhi5sYJqP1w/GUpjOiHVbaI0w2L+pg3GZzvtokcgHxWDXHaiy78l3sPke01qphamT5c+dqyeAGSumdL/mkggauTam0e3L/mPEiqtzKDbl0Z1Wn8xOa4ySo8X/7TQIJnY/seEKWf12UmC72CKP9xYjr19RPT7NNA+oMO+R0gwmlotAry+C6I0f59ch8yXVQOr0BKYcXt1IUYRyCt+Ur9HGsrQKI79WY9sY9ARPKlzFOFdb41ioD8b5Bp+mqeeRKAxINkESBFGpOpKhgv9OuYpH8A8l4Qa3qp60Kl2/k+rG2sWafuuyCBafb2j4JkgZUob3nWcmicpkxEgmTLLGejTxnWSWCi8lPmsk6DlIHFJv24ojiYyYoGacwL8zXTLEAVaDI/Ybb3NIgKDSv2oXpmHkvNs+PTpMASEdlk7fOZeRk37fwJ6yGnQarQsGIfqqcvx43rTOXY6jf7uKXdRzdLDRPbjIrx1cIj3Kr4KyBFezzgUGuR5893qkOQ19fR2uVBaU+r16LphJNOiatK7PeBZK/Kb+tUn71rcQjSvARpghfH/yG/D2RetTuI3N5QrMWdP46brP7FmKZ//CGQ9At9SL01DLkzY/Vs8Z97fQZ7gelw7jHqCz+/Wile5J4g3Vc79eb5a6oLSue+Ve83gaSv2jp5PxCzjzwFUm9zw9MllSMil1kS4d2E9SaQ1xNo9wMxx0+nQNLnew/WDHvveMAHYm08mofl3TFI/8pD3Q6kMAv6DIi2jTCwRJUvNdDYrrJum9oHhusCbWALonwxBRk1vXMnEGWuT5wAmfYuVGUYpJ7fUZujCN92hvzwWlrFgxSfANKb10DxIMbShnfrynyZZV30imA7P43ArXXHbvBVkTCIuGy25AdBrHmNeBCpL214QdLp9LZarG3IMWrmW0ehtuO7F2PS09UcgqS3B7FKPhpknrStD0HGF/vQRne37LwLG8EbHT4WxN7/Fg0yD9Yr/3br4nnstA+0Il6QxzdBmg8A6a2/IRbkcK9h/uzV8zywF/oSkOyageCPglRWgcWClHnEzs9q/t/SENVXgFijlsq3VtXdCsRp4qObrLLLgjuzSq3fX89ZZW6AfxNIzF6X9FYgThN/fk093KkvHX/hbWd+DqS/FUhlf+G3gohEXzVs3g9iDluWoaW8fL73QhB34u+tIHIf19nLuF4Q98a09Eynnl56q+ePgEhnX+dbQOp6H5XnJ0ACd8dFgkwf12nTOTcEqd2pom+CFF02TIPw6dKmrLS5qOtBpo8b5quUtrwrSGbuqPkeSJqllTFHO02NPxdMrm+y5LKdWyWXjw4vA5nGEtnjuyCFyHqNYvEolzmASm3zK1Eg5zr13lhqV1tlksnVw8Pkwgri7O07AVKLJkutRYw87bPlRpBpNXE8xGb+fhBlvEGrGPLqViu5sILIx9dAmqF1705sxF4M8+R8P5dOdQwi12fMnATpjJ2JSt/POIvU9wPJEs/jduJAjLvU0yFT0i64Yb1bsVi79dA4pEy3TzoHMq2O7Re4vXm5O9+l290NpE4CU+YRIMNye2iaqbVS2AUnn2fsekthYKReVNutVedA5juttyIXrT38mOds+ps9DWhwL7GWc61/DVKPzVN9UHDarf1icU98IOU8tm6L031Iq63t1tKzj3fe/FCpO4F0/i0Z2+yvA1KeGBjqj1qYx8/zoxpKZ1Yl367I1k+sfcft/QPy9csXy/32qX1qLZsrryG5BGQaRj0vc/b7N54XXq293TCLB5HO42Fy517obW19b+qjl3CHp0fdLJcWvmdy1etESi/uAdJrs1hTaUklHuW8qSDdC3UfXVR5cnD3rAFSSqtFb7z7eapErx7rC739jCXfbK3aWiipjXo8UbmxXPa7QQq9R289j2Gr88N7Ag5AlHPRKc37pNZv0CZtX1tVMG6rm8qW1/KlCgQvcMss933ybwXZz3dReW5yce4ByZtHFIhwT9kmjxg8BzbKDUe1PB9edBJqSN7/KM1LmqyuMZ5BpeTUw1aD/uDI0relPfSHa/Wn8Pxq1BNfxy/h3IdwOJqIKumb9CHvTqMefyY82RoQAgggBBBACCCAEEAAIYAQQAAhgABCAAGEAAIIAYQAAggBBBACCCAEEEAIIAQQQAgggBBAACGAAEIAIYAAQgABhAACCAEEEAIIAQQQAgggBBBACCCAEEAIIIAQQAAhgABCAAGEAEIAAYQAAggBBBACCCAEEAIIIAQQQAgggBBAACGAEEAAIYAAQgABhAACCAEEEAIIAQQQAgggBBBACCCAEEAIIIAQQAAhgABCAAGEAEIAAYQAAggBBBACCCAEEAIIIAQQQAgggBBAACGAEEAAIYAAQgABhAACCAGEAAIIAQQQAgggBBBACCAEEEAIIIAQQAAhgABCACGAAEIAAYQAAggBBBACCAEEEAIIIAQQQAggfyL/BBgA8PgLdH0TBtkAAAAASUVORK5CYII="
- },
- // 图片进入可见区域前多少像素时,单位rpx,开始加载图片
- // 负数为图片超出屏幕底部多少距离后触发懒加载,正数为图片顶部距离屏幕底部多少距离时触发(图片还没出现在屏幕上)
- threshold: {
- type: [Number, String],
- default: 100
- },
- // 淡入淡出动画的过渡时间
- duration: {
- type: [Number, String],
- default: 500
- },
- // 渡效果的速度曲线,各个之间差别不大,因为这是淡入淡出,且时间很短,不是那些变形或者移动的情况,会明显
- // linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(n,n,n,n);
- effect: {
- type: String,
- default: "ease-in-out"
- },
- // 是否使用过渡效果
- isEffect: {
- type: Boolean,
- default: true
- },
- // 圆角值
- borderRadius: {
- type: [Number, String],
- default: 0
- },
- // 图片高度,单位rpx
- height: {
- type: [Number, String],
- default: "200"
- }
- },
- data() {
- return {
- isShow: false,
- opacity: 1,
- time: this.duration,
- loadStatus: "",
- // 默认是懒加载中的状态
- isError: false,
- // 图片加载失败
- elIndex: guid()
- };
- },
- computed: {
- // 将threshold从rpx转为px
- getThreshold() {
- let thresholdPx = uni.upx2px(Math.abs(this.threshold));
- return this.threshold < 0 ? -thresholdPx : thresholdPx;
- },
- // 计算图片的高度,可能为auto,带%,或者直接数值
- imgHeight() {
- return addUnit(this.height);
- }
- },
- created() {
- this.observer = {};
- },
- watch: {
- isShow(nVal) {
- if (!this.isEffect)
- return;
- this.time = 0;
- this.opacity = 0;
- setTimeout(() => {
- this.time = this.duration;
- this.opacity = 1;
- }, 30);
- },
- // 图片路径发生变化时,需要重新标记一些变量,否则会一直卡在某一个状态,比如isError
- image(n2) {
- if (!n2) {
- this.isError = true;
- } else {
- this.init();
- this.isError = false;
- }
- }
- },
- emits: ["click", "load", "error"],
- methods: {
- // 用于重新初始化
- init() {
- this.isError = false;
- this.loadStatus = "";
- },
- // 点击图片触发的事件,loadlazy-还是懒加载中状态,loading-图片正在加载,loaded-图片加加载完成
- clickImg() {
- if (this.isShow == false)
- ;
- else if (this.isError == true)
- ;
- else
- ;
- this.$emit("click", this.index);
- },
- // 图片加载完成事件,可能是加载占位图时触发,也可能是加载真正的图片完成时触发,通过isShow区分
- imgLoaded() {
- if (this.loadStatus == "") {
- this.loadStatus = "lazyed";
- } else if (this.loadStatus == "lazyed") {
- this.loadStatus = "loaded";
- this.$emit("load", this.index);
- }
- },
- // 错误的图片加载完成
- errorImgLoaded() {
- this.$emit("error", this.index);
- },
- // 图片加载失败
- loadError() {
- this.isError = true;
- },
- disconnectObserver(observerName) {
- const observer = this[observerName];
- observer && observer.disconnect();
- }
- },
- beforeUnmount() {
- },
- mounted() {
- this.$nextTick(() => {
- uni.$once("uOnReachBottom", () => {
- if (!this.isShow)
- this.isShow = true;
- });
- });
- setTimeout(() => {
- const contentObserver = uni.createIntersectionObserver(this);
- contentObserver.relativeToViewport({
- bottom: this.getThreshold
- }).observe(".u-lazy-item-" + this.elIndex, (res) => {
- if (res.intersectionRatio > 0) {
- this.isShow = true;
- if (!this.image) {
- this.loadError();
- }
- this.disconnectObserver("contentObserver");
- }
- });
- this.contentObserver = contentObserver;
- }, 30);
- }
- };
- function _sfc_render$1c(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-wrap", "u-lazy-item-" + $data.elIndex]),
- style: vue.normalizeStyle({
- opacity: Number($data.opacity),
- borderRadius: $props.borderRadius + "rpx",
- // 因为time值需要改变,所以不直接用duration值(不能改变父组件prop传过来的值)
- transition: `opacity ${$data.time / 1e3}s ease-in-out`
- })
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass("u-lazy-item-" + $data.elIndex)
- },
- [
- !$data.isError ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- style: vue.normalizeStyle({ borderRadius: $props.borderRadius + "rpx", height: $options.imgHeight }),
- class: "u-lazy-item",
- src: $data.isShow ? $props.image : $props.loadingImg,
- mode: $props.imgMode,
- onLoad: _cache[0] || (_cache[0] = (...args) => $options.imgLoaded && $options.imgLoaded(...args)),
- onError: _cache[1] || (_cache[1] = (...args) => $options.loadError && $options.loadError(...args)),
- onClick: _cache[2] || (_cache[2] = (...args) => $options.clickImg && $options.clickImg(...args))
- }, null, 44, ["src", "mode"])) : (vue.openBlock(), vue.createElementBlock("image", {
- key: 1,
- style: vue.normalizeStyle({ borderRadius: $props.borderRadius + "rpx", height: $options.imgHeight }),
- class: "u-lazy-item error",
- src: $props.errorImg,
- mode: $props.imgMode,
- onLoad: _cache[3] || (_cache[3] = (...args) => $options.errorImgLoaded && $options.errorImgLoaded(...args)),
- onClick: _cache[4] || (_cache[4] = (...args) => $options.clickImg && $options.clickImg(...args))
- }, null, 44, ["src", "mode"]))
- ],
- 2
- /* CLASS */
- )
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uLazyLoad = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["render", _sfc_render$1c], ["__scopeId", "data-v-8b9e8d2e"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-lazy-load/u-lazy-load.vue"]]);
- const __vite_glob_0_53 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uLazyLoad
- }, Symbol.toStringTag, { value: "Module" }));
- const props$K = defineMixin({
- props: {
- // 激活部分的颜色
- activeColor: {
- type: String,
- default: () => props$1x.lineProgress.activeColor
- },
- inactiveColor: {
- type: String,
- default: () => props$1x.lineProgress.color
- },
- // 进度百分比,数值
- percentage: {
- type: [String, Number],
- default: () => props$1x.lineProgress.inactiveColor
- },
- // 是否在进度条内部显示百分比的值
- showText: {
- type: Boolean,
- default: () => props$1x.lineProgress.showText
- },
- // 进度条的高度,单位px
- height: {
- type: [String, Number],
- default: () => props$1x.lineProgress.height
- },
- // 是否从右往左加载
- fromRight: {
- type: Boolean,
- default: () => props$1x.lineProgress.fromRight
- }
- }
- });
- const _sfc_main$1c = {
- name: "u-line-progress",
- mixins: [mpMixin, mixin, props$K],
- data() {
- return {
- lineWidth: 0
- };
- },
- watch: {
- percentage(n2) {
- this.resizeProgressWidth();
- }
- },
- computed: {
- progressStyle() {
- let style = {};
- style.width = this.lineWidth;
- style.backgroundColor = this.activeColor;
- style.height = addUnit(this.height);
- if (this.fromRight) {
- style.right = 0;
- } else {
- style.left = 0;
- }
- return style;
- },
- innserPercentage() {
- return range$1(0, 100, this.percentage);
- }
- },
- mounted() {
- this.init();
- },
- methods: {
- addStyle,
- addUnit,
- init() {
- sleep(20).then(() => {
- this.resizeProgressWidth();
- });
- },
- getProgressWidth() {
- return this.$uGetRect(".u-line-progress__background");
- },
- resizeProgressWidth() {
- this.getProgressWidth().then((size) => {
- const {
- width
- } = size;
- this.lineWidth = width * this.innserPercentage / 100 + "px";
- });
- }
- }
- };
- function _sfc_render$1b(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-line-progress",
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-line-progress__background",
- ref: "u-line-progress__background",
- style: vue.normalizeStyle([{
- backgroundColor: _ctx.inactiveColor,
- height: $options.addUnit(_ctx.height)
- }])
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: "u-line-progress__line",
- style: vue.normalizeStyle([$options.progressStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- _ctx.showText && _ctx.percentage >= 10 ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-line-progress__text"
- },
- vue.toDisplayString($options.innserPercentage + "%"),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- );
- }
- const uLineProgress = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["render", _sfc_render$1b], ["__scopeId", "data-v-eeee7090"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-line-progress/u-line-progress.vue"]]);
- const __vite_glob_0_54 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uLineProgress
- }, Symbol.toStringTag, { value: "Module" }));
- const props$J = defineMixin({
- props: {
- // 文字颜色
- color: {
- type: String,
- default: () => props$1x.link.color
- },
- // 字体大小,单位px
- fontSize: {
- type: [String, Number],
- default: () => props$1x.link.fontSize
- },
- // 是否显示下划线
- underLine: {
- type: Boolean,
- default: () => props$1x.link.underLine
- },
- // 要跳转的链接
- href: {
- type: String,
- default: () => props$1x.link.href
- },
- // 小程序中复制到粘贴板的提示语
- mpTips: {
- type: String,
- default: () => props$1x.link.mpTips
- },
- // 下划线颜色
- lineColor: {
- type: String,
- default: () => props$1x.link.lineColor
- },
- // 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
- text: {
- type: String,
- default: () => props$1x.link.text
- }
- }
- });
- const _sfc_main$1b = {
- name: "u-link",
- mixins: [mpMixin, mixin, props$J],
- computed: {
- linkStyle() {
- const style = {
- color: this.color,
- fontSize: addUnit(this.fontSize),
- // line-height设置为比字体大小多2px
- lineHeight: addUnit(getPx(this.fontSize) + 2),
- textDecoration: this.underLine ? "underline" : "none"
- };
- return style;
- }
- },
- emits: ["click"],
- methods: {
- addStyle,
- openLink() {
- plus.runtime.openURL(this.href);
- this.$emit("click");
- }
- }
- };
- function _sfc_render$1a(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "text",
- {
- class: "u-link",
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.openLink && $options.openLink(...args), ["stop"])),
- style: vue.normalizeStyle([$options.linkStyle, $options.addStyle(_ctx.customStyle)])
- },
- vue.toDisplayString(_ctx.text),
- 5
- /* TEXT, STYLE */
- );
- }
- const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["render", _sfc_render$1a], ["__scopeId", "data-v-12f6646d"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-link/u-link.vue"]]);
- const __vite_glob_0_56 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$2
- }, Symbol.toStringTag, { value: "Module" }));
- const props$I = defineMixin({
- props: {
- // 用于滚动到指定item
- anchor: {
- type: [String, Number],
- default: () => props$1x.listItem.anchor
- }
- }
- });
- const _sfc_main$1a = {
- name: "u-list-item",
- mixins: [mpMixin, mixin, props$I],
- data() {
- return {
- // 节点信息
- rect: {},
- index: 0,
- show: true,
- sys: getWindowInfo()
- };
- },
- computed: {},
- inject: ["uList"],
- watch: {
- "uList.innerScrollTop"(n2) {
- const preLoadScreen = this.uList.preLoadScreen;
- const windowHeight = this.sys.windowHeight;
- if (n2 <= windowHeight * preLoadScreen) {
- this.parent.updateOffsetFromChild(0);
- } else if (this.rect.top <= n2 - windowHeight * preLoadScreen) {
- this.parent.updateOffsetFromChild(this.rect.top);
- }
- }
- },
- created() {
- this.parent = {};
- },
- mounted() {
- this.init();
- },
- methods: {
- init() {
- this.updateParentData();
- this.index = this.parent.children.indexOf(this);
- this.resize();
- },
- updateParentData() {
- this.getParentData("u-list");
- },
- resize() {
- this.queryRect(`u-list-item-${this.anchor}`).then((size) => {
- const lastChild = this.parent.children[this.index - 1];
- this.rect = size;
- const preLoadScreen = this.uList.preLoadScreen;
- const windowHeight = this.sys.windowHeight;
- if (lastChild) {
- this.rect.top = lastChild.rect.top + lastChild.rect.height;
- }
- if (size.top >= this.uList.innerScrollTop + (1 + preLoadScreen) * windowHeight)
- this.show = false;
- });
- },
- // 查询元素尺寸
- queryRect(el) {
- return new Promise((resolve) => {
- this.$uGetRect(`.${el}`).then((size) => {
- resolve(size);
- });
- });
- }
- }
- };
- function _sfc_render$19(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["u-list-item", [`u-list-item-${_ctx.anchor}`]]),
- ref: `u-list-item-${_ctx.anchor}`,
- anchor: `u-list-item-${_ctx.anchor}`
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ], 10, ["anchor"]);
- }
- const uListItem = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["render", _sfc_render$19], ["__scopeId", "data-v-0c3fc59c"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-list-item/u-list-item.vue"]]);
- const __vite_glob_0_57 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uListItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$H = defineMixin({
- props: {
- // 控制是否出现滚动条,仅nvue有效
- showScrollbar: {
- type: Boolean,
- default: () => props$1x.list.showScrollbar
- },
- // 距底部多少时触发scrolltolower事件
- lowerThreshold: {
- type: [String, Number],
- default: () => props$1x.list.lowerThreshold
- },
- // 距顶部多少时触发scrolltoupper事件,非nvue有效
- upperThreshold: {
- type: [String, Number],
- default: () => props$1x.list.upperThreshold
- },
- // 设置竖向滚动条位置
- scrollTop: {
- type: [String, Number],
- default: () => props$1x.list.scrollTop
- },
- // 控制 onscroll 事件触发的频率,仅nvue有效
- offsetAccuracy: {
- type: [String, Number],
- default: () => props$1x.list.offsetAccuracy
- },
- // 启用 flexbox 布局。开启后,当前节点声明了display: flex就会成为flex container,并作用于其孩子节点,仅微信小程序有效
- enableFlex: {
- type: Boolean,
- default: () => props$1x.list.enableFlex
- },
- // 是否按分页模式显示List,默认值false
- pagingEnabled: {
- type: Boolean,
- default: () => props$1x.list.pagingEnabled
- },
- // 是否允许List滚动
- scrollable: {
- type: Boolean,
- default: () => props$1x.list.scrollable
- },
- // 值应为某子元素id(id不能以数字开头)
- scrollIntoView: {
- type: String,
- default: () => props$1x.list.scrollIntoView
- },
- // 在设置滚动条位置时使用动画过渡
- scrollWithAnimation: {
- type: Boolean,
- default: () => props$1x.list.scrollWithAnimation
- },
- // iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只对微信小程序有效
- enableBackToTop: {
- type: Boolean,
- default: () => props$1x.list.enableBackToTop
- },
- // 列表的高度
- height: {
- type: [String, Number],
- default: () => props$1x.list.height
- },
- // 列表宽度
- width: {
- type: [String, Number],
- default: () => props$1x.list.width
- },
- // 列表前后预渲染的屏数,1代表一个屏幕的高度,1.5代表1个半屏幕高度
- preLoadScreen: {
- type: [String, Number],
- default: () => props$1x.list.preLoadScreen
- },
- // 开启自定义下拉刷新
- refresherEnabled: {
- type: Boolean,
- default: () => false
- },
- // 设置自定义下拉刷新阈值
- refresherThreshold: {
- type: Number,
- default: () => 45
- },
- // 设置自定义下拉刷新默认样式,支持设置 black,white,none,none 表示不使用默认样式
- refresherDefaultStyle: {
- type: String,
- default: () => "black"
- },
- // 设置自定义下拉刷新区域背景颜色
- refresherBackground: {
- type: String,
- default: () => "#FFF"
- },
- // 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
- refresherTriggered: {
- type: Boolean,
- default: () => false
- }
- }
- });
- const _sfc_main$19 = {
- name: "u-list",
- mixins: [mpMixin, mixin, props$H],
- watch: {
- scrollIntoView(n2) {
- this.scrollIntoViewById(n2);
- }
- },
- data() {
- return {
- // 记录内部滚动的距离
- innerScrollTop: 0,
- // vue下,scroll-view在上拉加载时的偏移值
- offset: 0,
- sys: getWindowInfo()
- };
- },
- computed: {
- listStyle() {
- const style = {};
- if (this.width != 0)
- style.width = addUnit(this.width);
- if (this.height != 0)
- style.height = addUnit(this.height);
- if (!style.height)
- style.height = addUnit(this.sys.windowHeight, "px");
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- provide() {
- return {
- uList: this
- };
- },
- created() {
- this.refs = [];
- this.children = [];
- this.anchors = [];
- },
- mounted() {
- },
- emits: [
- "scroll",
- "scrolltolower",
- "scrolltoupper",
- "refresherpulling",
- "refresherrefresh",
- "refresherrestore",
- "refresherabort"
- ],
- methods: {
- updateOffsetFromChild(top) {
- this.offset = top;
- },
- onScroll(e2) {
- let scrollTop = 0;
- scrollTop = e2.detail.scrollTop;
- this.innerScrollTop = scrollTop;
- this.$emit("scroll", scrollTop);
- },
- scrollIntoViewById(id) {
- },
- // 滚动到底部触发事件
- scrolltolower(e2) {
- sleep(30).then(() => {
- this.$emit("scrolltolower");
- });
- },
- // 滚动到底部时触发,非nvue有效
- scrolltoupper(e2) {
- sleep(30).then(() => {
- this.$emit("scrolltoupper");
- this.offset = 0;
- });
- },
- refresherpulling(e2) {
- this.$emit("refresherpulling", e2);
- },
- refresherrefresh(e2) {
- this.$emit("refresherrefresh", e2);
- },
- refresherrestore(e2) {
- this.$emit("refresherrestore", e2);
- },
- refresherabort(e2) {
- this.$emit("refresherabort", e2);
- }
- }
- };
- function _sfc_render$18(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("scroll-view", {
- class: "u-list",
- "scroll-into-view": _ctx.scrollIntoView,
- style: vue.normalizeStyle([$options.listStyle]),
- "scroll-y": _ctx.scrollable,
- "scroll-top": Number(_ctx.scrollTop),
- "lower-threshold": Number(_ctx.lowerThreshold),
- "upper-threshold": Number(_ctx.upperThreshold),
- "show-scrollbar": _ctx.showScrollbar,
- "enable-back-to-top": _ctx.enableBackToTop,
- "scroll-with-animation": _ctx.scrollWithAnimation,
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.onScroll && $options.onScroll(...args)),
- onScrolltolower: _cache[1] || (_cache[1] = (...args) => $options.scrolltolower && $options.scrolltolower(...args)),
- onScrolltoupper: _cache[2] || (_cache[2] = (...args) => $options.scrolltoupper && $options.scrolltoupper(...args)),
- "refresher-enabled": _ctx.refresherEnabled,
- "refresher-threshold": _ctx.refresherThreshold,
- "refresher-default-style": _ctx.refresherDefaultStyle,
- "refresher-background": _ctx.refresherBackground,
- "refresher-triggered": _ctx.refresherTriggered,
- onRefresherpulling: _cache[3] || (_cache[3] = (...args) => $options.refresherpulling && $options.refresherpulling(...args)),
- onRefresherrefresh: _cache[4] || (_cache[4] = (...args) => $options.refresherrefresh && $options.refresherrefresh(...args)),
- onRefresherrestore: _cache[5] || (_cache[5] = (...args) => $options.refresherrestore && $options.refresherrestore(...args)),
- onRefresherabort: _cache[6] || (_cache[6] = (...args) => $options.refresherabort && $options.refresherabort(...args)),
- "scroll-anchoring": true
- }, [
- vue.createElementVNode("view", null, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])
- ], 44, ["scroll-into-view", "scroll-y", "scroll-top", "lower-threshold", "upper-threshold", "show-scrollbar", "enable-back-to-top", "scroll-with-animation", "refresher-enabled", "refresher-threshold", "refresher-default-style", "refresher-background", "refresher-triggered"]);
- }
- const uList = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["render", _sfc_render$18], ["__scopeId", "data-v-a7e78647"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-list/u-list.vue"]]);
- const __vite_glob_0_58 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uList
- }, Symbol.toStringTag, { value: "Module" }));
- const props$G = defineMixin({
- props: {
- // 提示内容
- loadingText: {
- type: [String, Number],
- default: () => props$1x.loadingPage.loadingText
- },
- // 文字上方用于替换loading动画的图片
- image: {
- type: String,
- default: () => props$1x.loadingPage.image
- },
- // 加载动画的模式,circle-圆形,spinner-花朵形,semicircle-半圆形
- loadingMode: {
- type: String,
- default: () => props$1x.loadingPage.loadingMode
- },
- // 是否加载中
- loading: {
- type: Boolean,
- default: () => props$1x.loadingPage.loading
- },
- // 背景色
- bgColor: {
- type: String,
- default: () => props$1x.loadingPage.bgColor
- },
- // 文字颜色
- color: {
- type: String,
- default: () => props$1x.loadingPage.color
- },
- // 文字大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.loadingPage.fontSize
- },
- // 图标大小
- iconSize: {
- type: [String, Number],
- default: () => props$1x.loadingPage.fontSize
- },
- // 加载中图标的颜色,只能rgb或者十六进制颜色值
- loadingColor: {
- type: String,
- default: () => props$1x.loadingPage.loadingColor
- },
- // 层级
- zIndex: {
- type: [Number],
- default: () => props$1x.loadingPage.zIndex
- }
- }
- });
- const _sfc_main$18 = {
- name: "u-loading-page",
- mixins: [mpMixin, mixin, props$G],
- data() {
- return {};
- },
- methods: {
- addUnit
- }
- };
- function _sfc_render$17(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_loading_icon = resolveEasycom(vue.resolveDynamicComponent("u-loading-icon"), __easycom_0$e);
- const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_2$1);
- return vue.openBlock(), vue.createBlock(_component_u_transition, {
- show: _ctx.loading,
- "custom-style": {
- position: "fixed",
- top: 0,
- left: 0,
- right: 0,
- bottom: 0,
- backgroundColor: _ctx.bgColor,
- display: "flex",
- zIndex: _ctx.zIndex,
- ..._ctx.customStyle
- }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "u-loading-page" }, [
- vue.createElementVNode("view", { class: "u-loading-page__warpper" }, [
- vue.createElementVNode("view", { class: "u-loading-page__warpper__loading-icon" }, [
- _ctx.image ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _ctx.image,
- class: "u-loading-page__warpper__loading-icon__img",
- mode: "widthFit",
- style: vue.normalizeStyle({
- width: $options.addUnit(_ctx.iconSize),
- height: $options.addUnit(_ctx.iconSize)
- })
- }, null, 12, ["src"])) : (vue.openBlock(), vue.createBlock(_component_u_loading_icon, {
- key: 1,
- mode: _ctx.loadingMode,
- size: $options.addUnit(_ctx.iconSize),
- color: _ctx.loadingColor
- }, null, 8, ["mode", "size", "color"]))
- ]),
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode(
- "text",
- {
- class: "u-loading-page__warpper__text",
- style: vue.normalizeStyle({
- fontSize: $options.addUnit(_ctx.fontSize),
- color: _ctx.color
- })
- },
- vue.toDisplayString(_ctx.loadingText),
- 5
- /* TEXT, STYLE */
- )
- ], true)
- ])
- ])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "custom-style"]);
- }
- const uLoadingPage = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["render", _sfc_render$17], ["__scopeId", "data-v-9c9e88a3"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-loading-page/u-loading-page.vue"]]);
- const __vite_glob_0_60 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uLoadingPage
- }, Symbol.toStringTag, { value: "Module" }));
- const props$F = defineMixin({
- props: {
- // 组件状态,loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
- status: {
- type: String,
- default: () => props$1x.loadmore.status
- },
- // 组件背景色
- bgColor: {
- type: String,
- default: () => props$1x.loadmore.bgColor
- },
- // 是否显示加载中的图标
- icon: {
- type: Boolean,
- default: () => props$1x.loadmore.icon
- },
- // 字体大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.loadmore.fontSize
- },
- // 图标大小
- iconSize: {
- type: [String, Number],
- default: () => props$1x.loadmore.iconSize
- },
- // 字体颜色
- color: {
- type: String,
- default: () => props$1x.loadmore.color
- },
- // 加载中状态的图标,spinner-花朵状图标,circle-圆圈状,semicircle-半圆
- loadingIcon: {
- type: String,
- default: () => props$1x.loadmore.loadingIcon
- },
- // 加载前的提示语
- loadmoreText: {
- type: String,
- default: () => props$1x.loadmore.loadmoreText
- },
- // 加载中提示语
- loadingText: {
- type: String,
- default: () => props$1x.loadmore.loadingText
- },
- // 没有更多的提示语
- nomoreText: {
- type: String,
- default: () => props$1x.loadmore.nomoreText
- },
- // 在“没有更多”状态下,是否显示粗点
- isDot: {
- type: Boolean,
- default: () => props$1x.loadmore.isDot
- },
- // 加载中图标的颜色
- iconColor: {
- type: String,
- default: () => props$1x.loadmore.iconColor
- },
- // 上边距
- marginTop: {
- type: [String, Number],
- default: () => props$1x.loadmore.marginTop
- },
- // 下边距
- marginBottom: {
- type: [String, Number],
- default: () => props$1x.loadmore.marginBottom
- },
- // 高度,单位px
- height: {
- type: [String, Number],
- default: () => props$1x.loadmore.height
- },
- // 是否显示左边分割线
- line: {
- type: Boolean,
- default: () => props$1x.loadmore.line
- },
- // 线条颜色
- lineColor: {
- type: String,
- default: () => props$1x.loadmore.lineColor
- },
- // 是否虚线,true-虚线,false-实线
- dashed: {
- type: Boolean,
- default: () => props$1x.loadmore.dashed
- }
- }
- });
- const _sfc_main$17 = {
- name: "u-loadmore",
- mixins: [mpMixin, mixin, props$F],
- data() {
- return {
- // 粗点
- dotText: "●"
- };
- },
- computed: {
- // 加载的文字显示的样式
- loadTextStyle() {
- return {
- color: this.color,
- fontSize: addUnit(this.fontSize),
- lineHeight: addUnit(this.fontSize),
- backgroundColor: this.bgColor
- };
- },
- // 显示的提示文字
- showText() {
- let text = "";
- if (this.status == "loadmore")
- text = this.loadmoreText;
- else if (this.status == "loading")
- text = this.loadingText;
- else if (this.status == "nomore" && this.isDot)
- text = this.dotText;
- else
- text = this.nomoreText;
- return text;
- }
- },
- emits: ["loadmore"],
- methods: {
- addStyle,
- addUnit,
- loadMore() {
- if (this.status == "loadmore")
- this.$emit("loadmore");
- }
- }
- };
- function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- const _component_u_loading_icon = resolveEasycom(vue.resolveDynamicComponent("u-loading-icon"), __easycom_0$e);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-loadmore",
- style: vue.normalizeStyle([
- $options.addStyle(_ctx.customStyle),
- {
- backgroundColor: _ctx.bgColor,
- marginBottom: $options.addUnit(_ctx.marginBottom),
- marginTop: $options.addUnit(_ctx.marginTop),
- height: $options.addUnit(_ctx.height)
- }
- ])
- },
- [
- _ctx.line ? (vue.openBlock(), vue.createBlock(_component_u_line, {
- key: 0,
- length: "140rpx",
- color: _ctx.lineColor,
- hairline: false,
- dashed: _ctx.dashed
- }, null, 8, ["color", "dashed"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 加载中和没有更多的状态才显示两边的横线 "),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([_ctx.status == "loadmore" || _ctx.status == "nomore" ? "u-more" : "", "u-loadmore__content"])
- },
- [
- _ctx.status === "loading" && _ctx.icon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-loadmore__content__icon-wrap"
- }, [
- vue.createVNode(_component_u_loading_icon, {
- color: _ctx.iconColor,
- size: _ctx.iconSize,
- mode: _ctx.loadingIcon
- }, null, 8, ["color", "size", "mode"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 如果没有更多的状态下,显示内容为dot(粗点),加载特定样式 "),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["u-line-1", [_ctx.status == "nomore" && _ctx.isDot == true ? "u-loadmore__content__dot-text" : "u-loadmore__content__text"]]),
- style: vue.normalizeStyle([$options.loadTextStyle]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.loadMore && $options.loadMore(...args))
- },
- vue.toDisplayString($options.showText),
- 7
- /* TEXT, CLASS, STYLE */
- )
- ],
- 2
- /* CLASS */
- ),
- _ctx.line ? (vue.openBlock(), vue.createBlock(_component_u_line, {
- key: 1,
- length: "140rpx",
- color: _ctx.lineColor,
- hairline: false,
- dashed: _ctx.dashed
- }, null, 8, ["color", "dashed"])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$16], ["__scopeId", "data-v-4ccc1478"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-loadmore/u-loadmore.vue"]]);
- const __vite_glob_0_61 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0$1
- }, Symbol.toStringTag, { value: "Module" }));
- function e() {
- return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
- }
- var t = { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
- function n(e2) {
- t = e2;
- }
- var r = { exec: () => null };
- function s(e2, t2 = "") {
- let n2 = "string" == typeof e2 ? e2 : e2.source, r2 = { replace: (e3, t3) => {
- let s2 = "string" == typeof t3 ? t3 : t3.source;
- return s2 = s2.replace(l.caret, "$1"), n2 = n2.replace(e3, s2), r2;
- }, getRegex: () => new RegExp(n2, t2) };
- return r2;
- }
- var l = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[a-zA-Z0-9\u00C0-\u02AF\u0300-\u036F\u0400-\u04FF\u0500-\u052F\u1E00-\u1EFF]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (e2) => new RegExp(`^( {0,3}${e2})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (e2) => new RegExp(`^ {0,${Math.min(3, e2 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (e2) => new RegExp(`^ {0,${Math.min(3, e2 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (e2) => new RegExp(`^ {0,${Math.min(3, e2 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (e2) => new RegExp(`^ {0,${Math.min(3, e2 - 1)}}#`), htmlBeginRegex: (e2) => new RegExp(`^ {0,${Math.min(3, e2 - 1)}}<(?:[a-z].*>|!--)`, "i") }, i = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, a = /(?:[*+-]|\d{1,9}[.)])/, o = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, c = s(o).replace(/bull/g, a).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), h = s(o).replace(/bull/g, a).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), p = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, u = /(?!\s*\])(?:\\.|[^\[\]\\])+/, g = s(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", u).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), k = s(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, a).getRegex(), d = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", f = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, x = s("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", f).replace("tag", d).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), b = s(p).replace("hr", i).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", d).getRegex(), w = { blockquote: s(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", b).getRegex(), code: /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, def: g, fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, hr: i, html: x, lheading: c, list: k, newline: /^(?:[ \t]*(?:\n|$))+/, paragraph: b, table: r, text: /^[^\n]+/ }, m = s("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", i).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", d).getRegex(), y = { ...w, lheading: h, table: m, paragraph: s(p).replace("hr", i).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", m).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", d).getRegex() }, $ = { ...w, html: s(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", f).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: r, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: s(p).replace("hr", i).replace("heading", " *#{1,6} *[^\n]").replace("lheading", c).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, R = /^( {2,}|\\)\n(?!\s*$)/, S = /[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~·!¥……()——《》「」『』【】、;:‘’“”,。、]/u, T = /[\s!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~·!¥……()——《》「」『』【】、;:‘’“”,。、]/, z = /[^a-zA-Z0-9\u4e00-\u9fa5\s!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~·!¥……()——《》「」『』【】、;:‘’“”,。、]/, A = s(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, T).getRegex(), _ = /[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}·!¥……()——《》「」『』【】、;:‘’“”,。、]/, P = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, I = s(P, "u").replace(/punct/g, S).getRegex(), L = s(P, "u").replace(/punct/g, _).getRegex(), B = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", C = s(B, "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, T).replace(/punct/g, S).getRegex(), q = s(B, "gu").replace(/notPunctSpace/g, /[a-zA-Z0-9\u4e00-\u9fa5~]/).replace(/punctSpace/g, /[\s!"#$%&'()*+,-./:;<=>?@[\]^_`{|}·!¥……()——《》「」『』【】、;:‘’“”,。、]/).replace(/punct/g, _).getRegex(), E = s("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, T).replace(/punct/g, S).getRegex(), v = s(/\\(punct)/, "gu").replace(/punct/g, S).getRegex(), Z = s(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), D = s(f).replace("(?:-->|$)", "-->").getRegex(), M = s("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", D).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), O = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Q = s(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", O).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), N = s(/^!?\[(label)\]\[(ref)\]/).replace("label", O).replace("ref", u).getRegex(), j = s(/^!?\[(ref)\](?:\[\])?/).replace("ref", u).getRegex(), G = { _backpedal: r, anyPunctuation: v, autolink: Z, blockSkip: /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g, br: R, code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, del: r, emStrongLDelim: I, emStrongRDelimAst: C, emStrongRDelimUnd: E, escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, link: Q, nolink: j, punctuation: A, reflink: N, reflinkSearch: s("reflink|nolink(?!\\()", "g").replace("reflink", N).replace("nolink", j).getRegex(), tag: M, text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, url: r }, H = { ...G, link: s(/^!?\[(label)\]\((.*?)\)/).replace("label", O).getRegex(), reflink: s(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", O).getRegex() }, W = { ...G, emStrongRDelimAst: q, emStrongLDelim: L, url: s(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ }, X = { ...W, br: s(R).replace("{2,}", "*").getRegex(), text: s(W.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, F = { normal: w, gfm: y, pedantic: $ }, U = { normal: G, gfm: W, breaks: X, pedantic: H }, J = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, K = (e2) => J[e2];
- function V(e2, t2) {
- if (t2) {
- if (l.escapeTest.test(e2))
- return e2.replace(l.escapeReplace, K);
- } else if (l.escapeTestNoEncode.test(e2))
- return e2.replace(l.escapeReplaceNoEncode, K);
- return e2;
- }
- function Y(e2) {
- try {
- e2 = encodeURI(e2).replace(l.percentDecode, "%");
- } catch {
- return null;
- }
- return e2;
- }
- function ee(e2, t2) {
- var _a2;
- let n2 = e2.replace(l.findPipe, (e3, t3, n3) => {
- let r3 = false, s2 = t3;
- for (; --s2 >= 0 && "\\" === n3[s2]; )
- r3 = !r3;
- return r3 ? "|" : " |";
- }).split(l.splitPipe), r2 = 0;
- if (n2[0].trim() || n2.shift(), n2.length > 0 && !((_a2 = n2.at(-1)) == null ? void 0 : _a2.trim()) && n2.pop(), t2)
- if (n2.length > t2)
- n2.splice(t2);
- else
- for (; n2.length < t2; )
- n2.push("");
- for (; r2 < n2.length; r2++)
- n2[r2] = n2[r2].trim().replace(l.slashPipe, "|");
- return n2;
- }
- function te(e2, t2, n2) {
- let r2 = e2.length;
- if (0 === r2)
- return "";
- let s2 = 0;
- for (; s2 < r2; ) {
- let l2 = e2.charAt(r2 - s2 - 1);
- if (l2 !== t2 || n2) {
- if (l2 === t2 || !n2)
- break;
- s2++;
- } else
- s2++;
- }
- return e2.slice(0, r2 - s2);
- }
- function ne(e2, t2, n2, r2, s2) {
- let l2 = t2.href, i2 = t2.title || null, a2 = e2[1].replace(s2.other.outputLinkReplace, "$1");
- r2.state.inLink = true;
- let o2 = { type: "!" === e2[0].charAt(0) ? "image" : "link", raw: n2, href: l2, title: i2, text: a2, tokens: r2.inlineTokens(a2) };
- return r2.state.inLink = false, o2;
- }
- var re = class {
- constructor(e2) {
- __publicField(this, "options");
- __publicField(this, "rules");
- __publicField(this, "lexer");
- this.options = e2 || t;
- }
- space(e2) {
- let t2 = this.rules.block.newline.exec(e2);
- if (t2 && t2[0].length > 0)
- return { type: "space", raw: t2[0] };
- }
- code(e2) {
- let t2 = this.rules.block.code.exec(e2);
- if (t2) {
- let e3 = t2[0].replace(this.rules.other.codeRemoveIndent, "");
- return { type: "code", raw: t2[0], codeBlockStyle: "indented", text: this.options.pedantic ? e3 : te(e3, "\n") };
- }
- }
- fences(e2) {
- let t2 = this.rules.block.fences.exec(e2);
- if (t2) {
- let e3 = t2[0], n2 = function(e4, t3, n3) {
- let r2 = e4.match(n3.other.indentCodeCompensation);
- if (null === r2)
- return t3;
- let s2 = r2[1];
- return t3.split("\n").map((e5) => {
- let t4 = e5.match(n3.other.beginningSpace);
- if (null === t4)
- return e5;
- let [r3] = t4;
- return r3.length >= s2.length ? e5.slice(s2.length) : e5;
- }).join("\n");
- }(e3, t2[3] || "", this.rules);
- return { type: "code", raw: e3, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: n2 };
- }
- }
- heading(e2) {
- let t2 = this.rules.block.heading.exec(e2);
- if (t2) {
- let e3 = t2[2].trim();
- if (this.rules.other.endingHash.test(e3)) {
- let t3 = te(e3, "#");
- (this.options.pedantic || !t3 || this.rules.other.endingSpaceChar.test(t3)) && (e3 = t3.trim());
- }
- return { type: "heading", raw: t2[0], depth: t2[1].length, text: e3, tokens: this.lexer.inline(e3) };
- }
- }
- hr(e2) {
- let t2 = this.rules.block.hr.exec(e2);
- if (t2)
- return { type: "hr", raw: te(t2[0], "\n") };
- }
- blockquote(e2) {
- let t2 = this.rules.block.blockquote.exec(e2);
- if (t2) {
- let e3 = te(t2[0], "\n").split("\n"), n2 = "", r2 = "", s2 = [];
- for (; e3.length > 0; ) {
- let t3, l2 = false, i2 = [];
- for (t3 = 0; t3 < e3.length; t3++)
- if (this.rules.other.blockquoteStart.test(e3[t3]))
- i2.push(e3[t3]), l2 = true;
- else {
- if (l2)
- break;
- i2.push(e3[t3]);
- }
- e3 = e3.slice(t3);
- let a2 = i2.join("\n"), o2 = a2.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
- n2 = n2 ? `${n2}
- ${a2}` : a2, r2 = r2 ? `${r2}
- ${o2}` : o2;
- let c2 = this.lexer.state.top;
- if (this.lexer.state.top = true, this.lexer.blockTokens(o2, s2, true), this.lexer.state.top = c2, 0 === e3.length)
- break;
- let h2 = s2.at(-1);
- if ("code" === (h2 == null ? void 0 : h2.type))
- break;
- if ("blockquote" === (h2 == null ? void 0 : h2.type)) {
- let t4 = h2, l3 = t4.raw + "\n" + e3.join("\n"), i3 = this.blockquote(l3);
- s2[s2.length - 1] = i3, n2 = n2.substring(0, n2.length - t4.raw.length) + i3.raw, r2 = r2.substring(0, r2.length - t4.text.length) + i3.text;
- break;
- }
- if ("list" !== (h2 == null ? void 0 : h2.type))
- ;
- else {
- let t4 = h2, l3 = t4.raw + "\n" + e3.join("\n"), i3 = this.list(l3);
- s2[s2.length - 1] = i3, n2 = n2.substring(0, n2.length - h2.raw.length) + i3.raw, r2 = r2.substring(0, r2.length - t4.raw.length) + i3.raw, e3 = l3.substring(s2.at(-1).raw.length).split("\n");
- }
- }
- return { type: "blockquote", raw: n2, tokens: s2, text: r2 };
- }
- }
- list(e2) {
- let t2 = this.rules.block.list.exec(e2);
- if (t2) {
- let n2 = t2[1].trim(), r2 = n2.length > 1, s2 = { type: "list", raw: "", ordered: r2, start: r2 ? +n2.slice(0, -1) : "", loose: false, items: [] };
- n2 = r2 ? `\\d{1,9}\\${n2.slice(-1)}` : `\\${n2}`, this.options.pedantic && (n2 = r2 ? n2 : "[*+-]");
- let l2 = this.rules.other.listItemRegex(n2), i2 = false;
- for (; e2; ) {
- let n3 = false, r3 = "", a3 = "";
- if (!(t2 = l2.exec(e2)) || this.rules.block.hr.test(e2))
- break;
- r3 = t2[0], e2 = e2.substring(r3.length);
- let o2 = t2[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e3) => " ".repeat(3 * e3.length)), c2 = e2.split("\n", 1)[0], h2 = !o2.trim(), p2 = 0;
- if (this.options.pedantic ? (p2 = 2, a3 = o2.trimStart()) : h2 ? p2 = t2[1].length + 1 : (p2 = t2[2].search(this.rules.other.nonSpaceChar), p2 = p2 > 4 ? 1 : p2, a3 = o2.slice(p2), p2 += t2[1].length), h2 && this.rules.other.blankLine.test(c2) && (r3 += c2 + "\n", e2 = e2.substring(c2.length + 1), n3 = true), !n3) {
- let t3 = this.rules.other.nextBulletRegex(p2), n4 = this.rules.other.hrRegex(p2), s3 = this.rules.other.fencesBeginRegex(p2), l3 = this.rules.other.headingBeginRegex(p2), i3 = this.rules.other.htmlBeginRegex(p2);
- for (; e2; ) {
- let u3, g3 = e2.split("\n", 1)[0];
- if (c2 = g3, this.options.pedantic ? (c2 = c2.replace(this.rules.other.listReplaceNesting, " "), u3 = c2) : u3 = c2.replace(this.rules.other.tabCharGlobal, " "), s3.test(c2) || l3.test(c2) || i3.test(c2) || t3.test(c2) || n4.test(c2))
- break;
- if (u3.search(this.rules.other.nonSpaceChar) >= p2 || !c2.trim())
- a3 += "\n" + u3.slice(p2);
- else {
- if (h2 || o2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || s3.test(o2) || l3.test(o2) || n4.test(o2))
- break;
- a3 += "\n" + c2;
- }
- !h2 && !c2.trim() && (h2 = true), r3 += g3 + "\n", e2 = e2.substring(g3.length + 1), o2 = u3.slice(p2);
- }
- }
- s2.loose || (i2 ? s2.loose = true : this.rules.other.doubleBlankLine.test(r3) && (i2 = true));
- let u2, g2 = null;
- this.options.gfm && (g2 = this.rules.other.listIsTask.exec(a3), g2 && (u2 = "[ ] " !== g2[0], a3 = a3.replace(this.rules.other.listReplaceTask, ""))), s2.items.push({ type: "list_item", raw: r3, task: !!g2, checked: u2, loose: false, text: a3, tokens: [] }), s2.raw += r3;
- }
- let a2 = s2.items.at(-1);
- if (!a2)
- return;
- a2.raw = a2.raw.trimEnd(), a2.text = a2.text.trimEnd(), s2.raw = s2.raw.trimEnd();
- for (let e3 = 0; e3 < s2.items.length; e3++)
- if (this.lexer.state.top = false, s2.items[e3].tokens = this.lexer.blockTokens(s2.items[e3].text, []), !s2.loose) {
- let t3 = s2.items[e3].tokens.filter((e4) => "space" === e4.type), n3 = t3.length > 0 && t3.some((e4) => this.rules.other.anyLine.test(e4.raw));
- s2.loose = n3;
- }
- if (s2.loose)
- for (let e3 = 0; e3 < s2.items.length; e3++)
- s2.items[e3].loose = true;
- return s2;
- }
- }
- html(e2) {
- let t2 = this.rules.block.html.exec(e2);
- if (t2)
- return { type: "html", block: true, raw: t2[0], pre: "pre" === t2[1] || "script" === t2[1] || "style" === t2[1], text: t2[0] };
- }
- def(e2) {
- let t2 = this.rules.block.def.exec(e2);
- if (t2) {
- let e3 = t2[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n2 = t2[2] ? t2[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r2 = t2[3] ? t2[3].substring(1, t2[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t2[3];
- return { type: "def", tag: e3, raw: t2[0], href: n2, title: r2 };
- }
- }
- table(e2) {
- var _a2;
- let t2 = this.rules.block.table.exec(e2);
- if (!t2 || !this.rules.other.tableDelimiter.test(t2[2]))
- return;
- let n2 = ee(t2[1]), r2 = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), s2 = ((_a2 = t2[3]) == null ? void 0 : _a2.trim()) ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], l2 = { type: "table", raw: t2[0], header: [], align: [], rows: [] };
- if (n2.length === r2.length) {
- for (let e3 of r2)
- this.rules.other.tableAlignRight.test(e3) ? l2.align.push("right") : this.rules.other.tableAlignCenter.test(e3) ? l2.align.push("center") : this.rules.other.tableAlignLeft.test(e3) ? l2.align.push("left") : l2.align.push(null);
- for (let e3 = 0; e3 < n2.length; e3++)
- l2.header.push({ text: n2[e3], tokens: this.lexer.inline(n2[e3]), header: true, align: l2.align[e3] });
- for (let e3 of s2)
- l2.rows.push(ee(e3, l2.header.length).map((e4, t3) => ({ text: e4, tokens: this.lexer.inline(e4), header: false, align: l2.align[t3] })));
- return l2;
- }
- }
- lheading(e2) {
- let t2 = this.rules.block.lheading.exec(e2);
- if (t2)
- return { type: "heading", raw: t2[0], depth: "=" === t2[2].charAt(0) ? 1 : 2, text: t2[1], tokens: this.lexer.inline(t2[1]) };
- }
- paragraph(e2) {
- let t2 = this.rules.block.paragraph.exec(e2);
- if (t2) {
- let e3 = "\n" === t2[1].charAt(t2[1].length - 1) ? t2[1].slice(0, -1) : t2[1];
- return { type: "paragraph", raw: t2[0], text: e3, tokens: this.lexer.inline(e3) };
- }
- }
- text(e2) {
- let t2 = this.rules.block.text.exec(e2);
- if (t2)
- return { type: "text", raw: t2[0], text: t2[0], tokens: this.lexer.inline(t2[0]) };
- }
- escape(e2) {
- let t2 = this.rules.inline.escape.exec(e2);
- if (t2)
- return { type: "escape", raw: t2[0], text: t2[1] };
- }
- tag(e2) {
- let t2 = this.rules.inline.tag.exec(e2);
- if (t2)
- return !this.lexer.state.inLink && this.rules.other.startATag.test(t2[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t2[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t2[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t2[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t2[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t2[0] };
- }
- link(e2) {
- let t2 = this.rules.inline.link.exec(e2);
- if (t2) {
- let e3 = t2[2].trim();
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e3)) {
- if (!this.rules.other.endAngleBracket.test(e3))
- return;
- let t3 = te(e3.slice(0, -1), "\\");
- if ((e3.length - t3.length) % 2 == 0)
- return;
- } else {
- let e4 = function(e5, t3) {
- if (-1 === e5.indexOf(t3[1]))
- return -1;
- let n3 = 0;
- for (let r3 = 0; r3 < e5.length; r3++)
- if ("\\" === e5[r3])
- r3++;
- else if (e5[r3] === t3[0])
- n3++;
- else if (e5[r3] === t3[1] && (n3--, n3 < 0))
- return r3;
- return n3 > 0 ? -2 : -1;
- }(t2[2], "()");
- if (-2 === e4)
- return;
- if (e4 > -1) {
- let n3 = (0 === t2[0].indexOf("!") ? 5 : 4) + t2[1].length + e4;
- t2[2] = t2[2].substring(0, e4), t2[0] = t2[0].substring(0, n3).trim(), t2[3] = "";
- }
- }
- let n2 = t2[2], r2 = "";
- if (this.options.pedantic) {
- let e4 = this.rules.other.pedanticHrefTitle.exec(n2);
- e4 && (n2 = e4[1], r2 = e4[3]);
- } else
- r2 = t2[3] ? t2[3].slice(1, -1) : "";
- return n2 = n2.trim(), this.rules.other.startAngleBracket.test(n2) && (n2 = this.options.pedantic && !this.rules.other.endAngleBracket.test(e3) ? n2.slice(1) : n2.slice(1, -1)), ne(t2, { href: n2 && n2.replace(this.rules.inline.anyPunctuation, "$1"), title: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1") }, t2[0], this.lexer, this.rules);
- }
- }
- reflink(e2, t2) {
- let n2;
- if ((n2 = this.rules.inline.reflink.exec(e2)) || (n2 = this.rules.inline.nolink.exec(e2))) {
- let e3 = t2[(n2[2] || n2[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
- if (!e3) {
- let e4 = n2[0].charAt(0);
- return { type: "text", raw: e4, text: e4 };
- }
- return ne(n2, e3, n2[0], this.lexer, this.rules);
- }
- }
- emStrong(e2, t2, n2 = "") {
- let r2 = this.rules.inline.emStrongLDelim.exec(e2);
- if (!(!r2 || r2[3] && n2.match(this.rules.other.unicodeAlphaNumeric)) && (!r2[1] && !r2[2] || !n2 || this.rules.inline.punctuation.exec(n2))) {
- let n3, s2, l2 = [...r2[0]].length - 1, i2 = l2, a2 = 0, o2 = "*" === r2[0][0] ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
- for (o2.lastIndex = 0, t2 = t2.slice(-1 * e2.length + l2); null != (r2 = o2.exec(t2)); ) {
- if (n3 = r2[1] || r2[2] || r2[3] || r2[4] || r2[5] || r2[6], !n3)
- continue;
- if (s2 = [...n3].length, r2[3] || r2[4]) {
- i2 += s2;
- continue;
- }
- if ((r2[5] || r2[6]) && l2 % 3 && !((l2 + s2) % 3)) {
- a2 += s2;
- continue;
- }
- if (i2 -= s2, i2 > 0)
- continue;
- s2 = Math.min(s2, s2 + i2 + a2);
- let t3 = [...r2[0]][0].length, o3 = e2.slice(0, l2 + r2.index + t3 + s2);
- if (Math.min(l2, s2) % 2) {
- let e3 = o3.slice(1, -1);
- return { type: "em", raw: o3, text: e3, tokens: this.lexer.inlineTokens(e3) };
- }
- let c2 = o3.slice(2, -2);
- return { type: "strong", raw: o3, text: c2, tokens: this.lexer.inlineTokens(c2) };
- }
- }
- }
- codespan(e2) {
- let t2 = this.rules.inline.code.exec(e2);
- if (t2) {
- let e3 = t2[2].replace(this.rules.other.newLineCharGlobal, " "), n2 = this.rules.other.nonSpaceChar.test(e3), r2 = this.rules.other.startingSpaceChar.test(e3) && this.rules.other.endingSpaceChar.test(e3);
- return n2 && r2 && (e3 = e3.substring(1, e3.length - 1)), { type: "codespan", raw: t2[0], text: e3 };
- }
- }
- br(e2) {
- let t2 = this.rules.inline.br.exec(e2);
- if (t2)
- return { type: "br", raw: t2[0] };
- }
- del(e2) {
- let t2 = this.rules.inline.del.exec(e2);
- if (t2)
- return { type: "del", raw: t2[0], text: t2[2], tokens: this.lexer.inlineTokens(t2[2]) };
- }
- autolink(e2) {
- let t2 = this.rules.inline.autolink.exec(e2);
- if (t2) {
- let e3, n2;
- return "@" === t2[2] ? (e3 = t2[1], n2 = "mailto:" + e3) : (e3 = t2[1], n2 = e3), { type: "link", raw: t2[0], text: e3, href: n2, tokens: [{ type: "text", raw: e3, text: e3 }] };
- }
- }
- url(e2) {
- var _a2;
- let t2;
- if (t2 = this.rules.inline.url.exec(e2)) {
- let e3, n2;
- if ("@" === t2[2])
- e3 = t2[0], n2 = "mailto:" + e3;
- else {
- let r2;
- do {
- r2 = t2[0], t2[0] = ((_a2 = this.rules.inline._backpedal.exec(t2[0])) == null ? void 0 : _a2[0]) ?? "";
- } while (r2 !== t2[0]);
- e3 = t2[0], n2 = "www." === t2[1] ? "http://" + t2[0] : t2[0];
- }
- return { type: "link", raw: t2[0], text: e3, href: n2, tokens: [{ type: "text", raw: e3, text: e3 }] };
- }
- }
- inlineText(e2) {
- let t2 = this.rules.inline.text.exec(e2);
- if (t2) {
- let e3 = this.lexer.state.inRawBlock;
- return { type: "text", raw: t2[0], text: t2[0], escaped: e3 };
- }
- }
- }, se = class e2 {
- constructor(e3) {
- __publicField(this, "tokens");
- __publicField(this, "options");
- __publicField(this, "state");
- __publicField(this, "tokenizer");
- __publicField(this, "inlineQueue");
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e3 || t, this.options.tokenizer = this.options.tokenizer || new re(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
- let n2 = { other: l, block: F.normal, inline: U.normal };
- this.options.pedantic ? (n2.block = F.pedantic, n2.inline = U.pedantic) : this.options.gfm && (n2.block = F.gfm, this.options.breaks ? n2.inline = U.breaks : n2.inline = U.gfm), this.tokenizer.rules = n2;
- }
- static get rules() {
- return { block: F, inline: U };
- }
- static lex(t2, n2) {
- return new e2(n2).lex(t2);
- }
- static lexInline(t2, n2) {
- return new e2(n2).inlineTokens(t2);
- }
- lex(e3) {
- e3 = e3.replace(l.carriageReturn, "\n"), this.blockTokens(e3, this.tokens);
- for (let e4 = 0; e4 < this.inlineQueue.length; e4++) {
- let t2 = this.inlineQueue[e4];
- this.inlineTokens(t2.src, t2.tokens);
- }
- return this.inlineQueue = [], this.tokens;
- }
- blockTokens(e3, t2 = [], n2 = false) {
- var _a2, _b, _c;
- for (this.options.pedantic && (e3 = e3.replace(l.tabCharGlobal, " ").replace(l.spaceLine, "")); e3; ) {
- let r2;
- if ((_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.block) == null ? void 0 : _b.some((n3) => !!(r2 = n3.call({ lexer: this }, e3, t2)) && (e3 = e3.substring(r2.raw.length), t2.push(r2), true)))
- continue;
- if (r2 = this.tokenizer.space(e3)) {
- e3 = e3.substring(r2.raw.length);
- let n3 = t2.at(-1);
- 1 === r2.raw.length && void 0 !== n3 ? n3.raw += "\n" : t2.push(r2);
- continue;
- }
- if (r2 = this.tokenizer.code(e3)) {
- e3 = e3.substring(r2.raw.length);
- let n3 = t2.at(-1);
- "paragraph" === (n3 == null ? void 0 : n3.type) || "text" === (n3 == null ? void 0 : n3.type) ? (n3.raw += (n3.raw.endsWith("\n") ? "" : "\n") + r2.raw, n3.text += "\n" + r2.text, this.inlineQueue.at(-1).src = n3.text) : t2.push(r2);
- continue;
- }
- if (r2 = this.tokenizer.fences(e3)) {
- e3 = e3.substring(r2.raw.length), t2.push(r2);
- continue;
- }
- if (r2 = this.tokenizer.heading(e3)) {
- e3 = e3.substring(r2.raw.length), t2.push(r2);
- continue;
- }
- if (r2 = this.tokenizer.hr(e3)) {
- e3 = e3.substring(r2.raw.length), t2.push(r2);
- continue;
- }
- if (r2 = this.tokenizer.blockquote(e3)) {
- e3 = e3.substring(r2.raw.length), t2.push(r2);
- continue;
- }
- if (r2 = this.tokenizer.list(e3)) {
- e3 = e3.substring(r2.raw.length), t2.push(r2);
- continue;
- }
- if (r2 = this.tokenizer.html(e3)) {
- e3 = e3.substring(r2.raw.length), t2.push(r2);
- continue;
- }
- if (r2 = this.tokenizer.def(e3)) {
- e3 = e3.substring(r2.raw.length);
- let n3 = t2.at(-1);
- "paragraph" === (n3 == null ? void 0 : n3.type) || "text" === (n3 == null ? void 0 : n3.type) ? (n3.raw += (n3.raw.endsWith("\n") ? "" : "\n") + r2.raw, n3.text += "\n" + r2.raw, this.inlineQueue.at(-1).src = n3.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title });
- continue;
- }
- if (r2 = this.tokenizer.table(e3)) {
- e3 = e3.substring(r2.raw.length), t2.push(r2);
- continue;
- }
- if (r2 = this.tokenizer.lheading(e3)) {
- e3 = e3.substring(r2.raw.length), t2.push(r2);
- continue;
- }
- let s2 = e3;
- if ((_c = this.options.extensions) == null ? void 0 : _c.startBlock) {
- let t3, n3 = 1 / 0, r3 = e3.slice(1);
- this.options.extensions.startBlock.forEach((e4) => {
- t3 = e4.call({ lexer: this }, r3), "number" == typeof t3 && t3 >= 0 && (n3 = Math.min(n3, t3));
- }), n3 < 1 / 0 && n3 >= 0 && (s2 = e3.substring(0, n3 + 1));
- }
- if (this.state.top && (r2 = this.tokenizer.paragraph(s2))) {
- let l2 = t2.at(-1);
- n2 && "paragraph" === (l2 == null ? void 0 : l2.type) ? (l2.raw += (l2.raw.endsWith("\n") ? "" : "\n") + r2.raw, l2.text += "\n" + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l2.text) : t2.push(r2), n2 = s2.length !== e3.length, e3 = e3.substring(r2.raw.length);
- } else if (r2 = this.tokenizer.text(e3)) {
- e3 = e3.substring(r2.raw.length);
- let n3 = t2.at(-1);
- "text" === (n3 == null ? void 0 : n3.type) ? (n3.raw += (n3.raw.endsWith("\n") ? "" : "\n") + r2.raw, n3.text += "\n" + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n3.text) : t2.push(r2);
- } else if (e3) {
- let t3 = "Infinite loop on byte: " + e3.charCodeAt(0);
- if (this.options.silent) {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-markdown/marked.esm.js:7", t3);
- break;
- }
- throw new Error(t3);
- }
- }
- return this.state.top = true, t2;
- }
- inline(e3, t2 = []) {
- return this.inlineQueue.push({ src: e3, tokens: t2 }), t2;
- }
- inlineTokens(e3, t2 = []) {
- var _a2, _b, _c;
- let n2 = e3, r2 = null;
- if (this.tokens.links) {
- let e4 = Object.keys(this.tokens.links);
- if (e4.length > 0)
- for (; null != (r2 = this.tokenizer.rules.inline.reflinkSearch.exec(n2)); )
- e4.includes(r2[0].slice(r2[0].lastIndexOf("[") + 1, -1)) && (n2 = n2.slice(0, r2.index) + "[" + "a".repeat(r2[0].length - 2) + "]" + n2.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
- }
- for (; null != (r2 = this.tokenizer.rules.inline.anyPunctuation.exec(n2)); )
- n2 = n2.slice(0, r2.index) + "++" + n2.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
- for (; null != (r2 = this.tokenizer.rules.inline.blockSkip.exec(n2)); )
- n2 = n2.slice(0, r2.index) + "[" + "a".repeat(r2[0].length - 2) + "]" + n2.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
- let s2 = false, l2 = "";
- for (; e3; ) {
- let r3;
- if (s2 || (l2 = ""), s2 = false, (_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.inline) == null ? void 0 : _b.some((n3) => !!(r3 = n3.call({ lexer: this }, e3, t2)) && (e3 = e3.substring(r3.raw.length), t2.push(r3), true)))
- continue;
- if (r3 = this.tokenizer.escape(e3)) {
- e3 = e3.substring(r3.raw.length), t2.push(r3);
- continue;
- }
- if (r3 = this.tokenizer.tag(e3)) {
- e3 = e3.substring(r3.raw.length), t2.push(r3);
- continue;
- }
- if (r3 = this.tokenizer.link(e3)) {
- e3 = e3.substring(r3.raw.length), t2.push(r3);
- continue;
- }
- if (r3 = this.tokenizer.reflink(e3, this.tokens.links)) {
- e3 = e3.substring(r3.raw.length);
- let n3 = t2.at(-1);
- "text" === r3.type && "text" === (n3 == null ? void 0 : n3.type) ? (n3.raw += r3.raw, n3.text += r3.text) : t2.push(r3);
- continue;
- }
- if (r3 = this.tokenizer.emStrong(e3, n2, l2)) {
- e3 = e3.substring(r3.raw.length), t2.push(r3);
- continue;
- }
- if (r3 = this.tokenizer.codespan(e3)) {
- e3 = e3.substring(r3.raw.length), t2.push(r3);
- continue;
- }
- if (r3 = this.tokenizer.br(e3)) {
- e3 = e3.substring(r3.raw.length), t2.push(r3);
- continue;
- }
- if (r3 = this.tokenizer.del(e3)) {
- e3 = e3.substring(r3.raw.length), t2.push(r3);
- continue;
- }
- if (r3 = this.tokenizer.autolink(e3)) {
- e3 = e3.substring(r3.raw.length), t2.push(r3);
- continue;
- }
- if (!this.state.inLink && (r3 = this.tokenizer.url(e3))) {
- e3 = e3.substring(r3.raw.length), t2.push(r3);
- continue;
- }
- let i2 = e3;
- if ((_c = this.options.extensions) == null ? void 0 : _c.startInline) {
- let t3, n3 = 1 / 0, r4 = e3.slice(1);
- this.options.extensions.startInline.forEach((e4) => {
- t3 = e4.call({ lexer: this }, r4), "number" == typeof t3 && t3 >= 0 && (n3 = Math.min(n3, t3));
- }), n3 < 1 / 0 && n3 >= 0 && (i2 = e3.substring(0, n3 + 1));
- }
- if (r3 = this.tokenizer.inlineText(i2)) {
- e3 = e3.substring(r3.raw.length), "_" !== r3.raw.slice(-1) && (l2 = r3.raw.slice(-1)), s2 = true;
- let n3 = t2.at(-1);
- "text" === (n3 == null ? void 0 : n3.type) ? (n3.raw += r3.raw, n3.text += r3.text) : t2.push(r3);
- } else if (e3) {
- let t3 = "Infinite loop on byte: " + e3.charCodeAt(0);
- if (this.options.silent) {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-markdown/marked.esm.js:7", t3);
- break;
- }
- throw new Error(t3);
- }
- }
- return t2;
- }
- }, le = class {
- constructor(e2) {
- __publicField(this, "options");
- __publicField(this, "parser");
- this.options = e2 || t;
- }
- space(e2) {
- return "";
- }
- code({ text: e2, lang: t2, escaped: n2 }) {
- var _a2;
- let r2 = (_a2 = (t2 || "").match(l.notSpaceStart)) == null ? void 0 : _a2[0], s2 = e2.replace(l.endingNewline, "") + "\n";
- return r2 ? '<pre><code class="language-' + V(r2) + '">' + (n2 ? s2 : V(s2, true)) + "</code></pre>\n" : "<pre><code>" + (n2 ? s2 : V(s2, true)) + "</code></pre>\n";
- }
- blockquote({ tokens: e2 }) {
- return `<blockquote>
- ${this.parser.parse(e2)}</blockquote>
- `;
- }
- html({ text: e2 }) {
- return e2;
- }
- heading({ tokens: e2, depth: t2 }) {
- return `<h${t2}>${this.parser.parseInline(e2)}</h${t2}>
- `;
- }
- hr(e2) {
- return "<hr>\n";
- }
- list(e2) {
- let t2 = e2.ordered, n2 = e2.start, r2 = "";
- for (let t3 = 0; t3 < e2.items.length; t3++) {
- let n3 = e2.items[t3];
- r2 += this.listitem(n3);
- }
- let s2 = t2 ? "ol" : "ul";
- return "<" + s2 + (t2 && 1 !== n2 ? ' start="' + n2 + '"' : "") + ">\n" + r2 + "</" + s2 + ">\n";
- }
- listitem(e2) {
- var _a2;
- let t2 = "";
- if (e2.task) {
- let n2 = this.checkbox({ checked: !!e2.checked });
- e2.loose ? "paragraph" === ((_a2 = e2.tokens[0]) == null ? void 0 : _a2.type) ? (e2.tokens[0].text = n2 + " " + e2.tokens[0].text, e2.tokens[0].tokens && e2.tokens[0].tokens.length > 0 && "text" === e2.tokens[0].tokens[0].type && (e2.tokens[0].tokens[0].text = n2 + " " + V(e2.tokens[0].tokens[0].text), e2.tokens[0].tokens[0].escaped = true)) : e2.tokens.unshift({ type: "text", raw: n2 + " ", text: n2 + " ", escaped: true }) : t2 += n2 + " ";
- }
- return t2 += this.parser.parse(e2.tokens, !!e2.loose), `<li>${t2}</li>
- `;
- }
- checkbox({ checked: e2 }) {
- return "<input " + (e2 ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
- }
- paragraph({ tokens: e2 }) {
- return `<p>${this.parser.parseInline(e2)}</p>
- `;
- }
- table(e2) {
- let t2 = "", n2 = "";
- for (let t3 = 0; t3 < e2.header.length; t3++)
- n2 += this.tablecell(e2.header[t3]);
- t2 += this.tablerow({ text: n2 });
- let r2 = "";
- for (let t3 = 0; t3 < e2.rows.length; t3++) {
- let s2 = e2.rows[t3];
- n2 = "";
- for (let e3 = 0; e3 < s2.length; e3++)
- n2 += this.tablecell(s2[e3]);
- r2 += this.tablerow({ text: n2 });
- }
- return r2 && (r2 = `<tbody>${r2}</tbody>`), "<table>\n<thead>\n" + t2 + "</thead>\n" + r2 + "</table>\n";
- }
- tablerow({ text: e2 }) {
- return `<tr>
- ${e2}</tr>
- `;
- }
- tablecell(e2) {
- let t2 = this.parser.parseInline(e2.tokens), n2 = e2.header ? "th" : "td";
- return (e2.align ? `<${n2} align="${e2.align}">` : `<${n2}>`) + t2 + `</${n2}>
- `;
- }
- strong({ tokens: e2 }) {
- return `<strong>${this.parser.parseInline(e2)}</strong>`;
- }
- em({ tokens: e2 }) {
- return `<em>${this.parser.parseInline(e2)}</em>`;
- }
- codespan({ text: e2 }) {
- return `<code>${V(e2, true)}</code>`;
- }
- br(e2) {
- return "<br>";
- }
- del({ tokens: e2 }) {
- return `<del>${this.parser.parseInline(e2)}</del>`;
- }
- link({ href: e2, title: t2, tokens: n2 }) {
- let r2 = this.parser.parseInline(n2), s2 = Y(e2);
- if (null === s2)
- return r2;
- let l2 = '<a href="' + (e2 = s2) + '"';
- return t2 && (l2 += ' title="' + V(t2) + '"'), l2 += ">" + r2 + "</a>", l2;
- }
- image({ href: e2, title: t2, text: n2, tokens: r2 }) {
- r2 && (n2 = this.parser.parseInline(r2, this.parser.textRenderer));
- let s2 = Y(e2);
- if (null === s2)
- return V(n2);
- let l2 = `<img src="${e2 = s2}" alt="${n2}"`;
- return t2 && (l2 += ` title="${V(t2)}"`), l2 += ">", l2;
- }
- text(e2) {
- return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : V(e2.text);
- }
- }, ie = class {
- strong({ text: e2 }) {
- return e2;
- }
- em({ text: e2 }) {
- return e2;
- }
- codespan({ text: e2 }) {
- return e2;
- }
- del({ text: e2 }) {
- return e2;
- }
- html({ text: e2 }) {
- return e2;
- }
- text({ text: e2 }) {
- return e2;
- }
- link({ text: e2 }) {
- return "" + e2;
- }
- image({ text: e2 }) {
- return "" + e2;
- }
- br() {
- return "";
- }
- }, ae = class e2 {
- constructor(e3) {
- __publicField(this, "options");
- __publicField(this, "renderer");
- __publicField(this, "textRenderer");
- this.options = e3 || t, this.options.renderer = this.options.renderer || new le(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new ie();
- }
- static parse(t2, n2) {
- return new e2(n2).parse(t2);
- }
- static parseInline(t2, n2) {
- return new e2(n2).parseInline(t2);
- }
- parse(e3, t2 = true) {
- var _a2, _b;
- let n2 = "";
- for (let r2 = 0; r2 < e3.length; r2++) {
- let s2 = e3[r2];
- if ((_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.renderers) == null ? void 0 : _b[s2.type]) {
- let e4 = s2, t3 = this.options.extensions.renderers[e4.type].call({ parser: this }, e4);
- if (false !== t3 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(e4.type)) {
- n2 += t3 || "";
- continue;
- }
- }
- let l2 = s2;
- switch (l2.type) {
- case "space":
- n2 += this.renderer.space(l2);
- continue;
- case "hr":
- n2 += this.renderer.hr(l2);
- continue;
- case "heading":
- n2 += this.renderer.heading(l2);
- continue;
- case "code":
- n2 += this.renderer.code(l2);
- continue;
- case "table":
- n2 += this.renderer.table(l2);
- continue;
- case "blockquote":
- n2 += this.renderer.blockquote(l2);
- continue;
- case "list":
- n2 += this.renderer.list(l2);
- continue;
- case "html":
- n2 += this.renderer.html(l2);
- continue;
- case "paragraph":
- n2 += this.renderer.paragraph(l2);
- continue;
- case "text": {
- let s3 = l2, i2 = this.renderer.text(s3);
- for (; r2 + 1 < e3.length && "text" === e3[r2 + 1].type; )
- s3 = e3[++r2], i2 += "\n" + this.renderer.text(s3);
- n2 += t2 ? this.renderer.paragraph({ type: "paragraph", raw: i2, text: i2, tokens: [{ type: "text", raw: i2, text: i2, escaped: true }] }) : i2;
- continue;
- }
- default: {
- let e4 = 'Token with "' + l2.type + '" type was not found.';
- if (this.options.silent)
- return formatAppLog("error", "at uni_modules/uview-plus/components/u-markdown/marked.esm.js:7", e4), "";
- throw new Error(e4);
- }
- }
- }
- return n2;
- }
- parseInline(e3, t2 = this.renderer) {
- var _a2, _b;
- let n2 = "";
- for (let r2 = 0; r2 < e3.length; r2++) {
- let s2 = e3[r2];
- if ((_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.renderers) == null ? void 0 : _b[s2.type]) {
- let e4 = this.options.extensions.renderers[s2.type].call({ parser: this }, s2);
- if (false !== e4 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s2.type)) {
- n2 += e4 || "";
- continue;
- }
- }
- let l2 = s2;
- switch (l2.type) {
- case "escape":
- case "text":
- n2 += t2.text(l2);
- break;
- case "html":
- n2 += t2.html(l2);
- break;
- case "link":
- n2 += t2.link(l2);
- break;
- case "image":
- n2 += t2.image(l2);
- break;
- case "strong":
- n2 += t2.strong(l2);
- break;
- case "em":
- n2 += t2.em(l2);
- break;
- case "codespan":
- n2 += t2.codespan(l2);
- break;
- case "br":
- n2 += t2.br(l2);
- break;
- case "del":
- n2 += t2.del(l2);
- break;
- default: {
- let e4 = 'Token with "' + l2.type + '" type was not found.';
- if (this.options.silent)
- return formatAppLog("error", "at uni_modules/uview-plus/components/u-markdown/marked.esm.js:7", e4), "";
- throw new Error(e4);
- }
- }
- }
- return n2;
- }
- }, oe = (_a = class {
- constructor(e2) {
- __publicField(this, "options");
- __publicField(this, "block");
- this.options = e2 || t;
- }
- preprocess(e2) {
- return e2;
- }
- postprocess(e2) {
- return e2;
- }
- processAllTokens(e2) {
- return e2;
- }
- provideLexer() {
- return this.block ? se.lex : se.lexInline;
- }
- provideParser() {
- return this.block ? ae.parse : ae.parseInline;
- }
- }, __publicField(_a, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), _a), ce = class {
- constructor(...e2) {
- __publicField(this, "defaults", { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null });
- __publicField(this, "options", this.setOptions);
- __publicField(this, "parse", this.parseMarkdown(true));
- __publicField(this, "parseInline", this.parseMarkdown(false));
- __publicField(this, "Parser", ae);
- __publicField(this, "Renderer", le);
- __publicField(this, "TextRenderer", ie);
- __publicField(this, "Lexer", se);
- __publicField(this, "Tokenizer", re);
- __publicField(this, "Hooks", oe);
- this.use(...e2);
- }
- walkTokens(e2, t2) {
- var _a2, _b;
- let n2 = [];
- for (let r2 of e2)
- switch (n2 = n2.concat(t2.call(this, r2)), r2.type) {
- case "table": {
- let e3 = r2;
- for (let r3 of e3.header)
- n2 = n2.concat(this.walkTokens(r3.tokens, t2));
- for (let r3 of e3.rows)
- for (let e4 of r3)
- n2 = n2.concat(this.walkTokens(e4.tokens, t2));
- break;
- }
- case "list": {
- let e3 = r2;
- n2 = n2.concat(this.walkTokens(e3.items, t2));
- break;
- }
- default: {
- let e3 = r2;
- ((_b = (_a2 = this.defaults.extensions) == null ? void 0 : _a2.childTokens) == null ? void 0 : _b[e3.type]) ? this.defaults.extensions.childTokens[e3.type].forEach((r3) => {
- let s2 = e3[r3].flat(1 / 0);
- n2 = n2.concat(this.walkTokens(s2, t2));
- }) : e3.tokens && (n2 = n2.concat(this.walkTokens(e3.tokens, t2)));
- }
- }
- return n2;
- }
- use(...e2) {
- let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
- return e2.forEach((e3) => {
- let n2 = { ...e3 };
- if (n2.async = this.defaults.async || n2.async || false, e3.extensions && (e3.extensions.forEach((e4) => {
- if (!e4.name)
- throw new Error("extension name required");
- if ("renderer" in e4) {
- let n3 = t2.renderers[e4.name];
- t2.renderers[e4.name] = n3 ? function(...t3) {
- let r2 = e4.renderer.apply(this, t3);
- return false === r2 && (r2 = n3.apply(this, t3)), r2;
- } : e4.renderer;
- }
- if ("tokenizer" in e4) {
- if (!e4.level || "block" !== e4.level && "inline" !== e4.level)
- throw new Error("extension level must be 'block' or 'inline'");
- let n3 = t2[e4.level];
- n3 ? n3.unshift(e4.tokenizer) : t2[e4.level] = [e4.tokenizer], e4.start && ("block" === e4.level ? t2.startBlock ? t2.startBlock.push(e4.start) : t2.startBlock = [e4.start] : "inline" === e4.level && (t2.startInline ? t2.startInline.push(e4.start) : t2.startInline = [e4.start]));
- }
- "childTokens" in e4 && e4.childTokens && (t2.childTokens[e4.name] = e4.childTokens);
- }), n2.extensions = t2), e3.renderer) {
- let t3 = this.defaults.renderer || new le(this.defaults);
- for (let n3 in e3.renderer) {
- if (!(n3 in t3))
- throw new Error(`renderer '${n3}' does not exist`);
- if (["options", "parser"].includes(n3))
- continue;
- let r2 = n3, s2 = e3.renderer[r2], l2 = t3[r2];
- t3[r2] = (...e4) => {
- let n4 = s2.apply(t3, e4);
- return false === n4 && (n4 = l2.apply(t3, e4)), n4 || "";
- };
- }
- n2.renderer = t3;
- }
- if (e3.tokenizer) {
- let t3 = this.defaults.tokenizer || new re(this.defaults);
- for (let n3 in e3.tokenizer) {
- if (!(n3 in t3))
- throw new Error(`tokenizer '${n3}' does not exist`);
- if (["options", "rules", "lexer"].includes(n3))
- continue;
- let r2 = n3, s2 = e3.tokenizer[r2], l2 = t3[r2];
- t3[r2] = (...e4) => {
- let n4 = s2.apply(t3, e4);
- return false === n4 && (n4 = l2.apply(t3, e4)), n4;
- };
- }
- n2.tokenizer = t3;
- }
- if (e3.hooks) {
- let t3 = this.defaults.hooks || new oe();
- for (let n3 in e3.hooks) {
- if (!(n3 in t3))
- throw new Error(`hook '${n3}' does not exist`);
- if (["options", "block"].includes(n3))
- continue;
- let r2 = n3, s2 = e3.hooks[r2], l2 = t3[r2];
- oe.passThroughHooks.has(n3) ? t3[r2] = (e4) => {
- if (this.defaults.async)
- return Promise.resolve(s2.call(t3, e4)).then((e5) => l2.call(t3, e5));
- let n4 = s2.call(t3, e4);
- return l2.call(t3, n4);
- } : t3[r2] = (...e4) => {
- let n4 = s2.apply(t3, e4);
- return false === n4 && (n4 = l2.apply(t3, e4)), n4;
- };
- }
- n2.hooks = t3;
- }
- if (e3.walkTokens) {
- let t3 = this.defaults.walkTokens, r2 = e3.walkTokens;
- n2.walkTokens = function(e4) {
- let n3 = [];
- return n3.push(r2.call(this, e4)), t3 && (n3 = n3.concat(t3.call(this, e4))), n3;
- };
- }
- this.defaults = { ...this.defaults, ...n2 };
- }), this;
- }
- setOptions(e2) {
- return this.defaults = { ...this.defaults, ...e2 }, this;
- }
- lexer(e2, t2) {
- return se.lex(e2, t2 ?? this.defaults);
- }
- parser(e2, t2) {
- return ae.parse(e2, t2 ?? this.defaults);
- }
- parseMarkdown(e2) {
- return (t2, n2) => {
- let r2 = { ...n2 }, s2 = { ...this.defaults, ...r2 }, l2 = this.onError(!!s2.silent, !!s2.async);
- if (true === this.defaults.async && false === r2.async)
- return l2(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
- if (typeof t2 > "u" || null === t2)
- return l2(new Error("marked(): input parameter is undefined or null"));
- if ("string" != typeof t2)
- return l2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t2) + ", string expected"));
- s2.hooks && (s2.hooks.options = s2, s2.hooks.block = e2);
- let i2 = s2.hooks ? s2.hooks.provideLexer() : e2 ? se.lex : se.lexInline, a2 = s2.hooks ? s2.hooks.provideParser() : e2 ? ae.parse : ae.parseInline;
- if (s2.async)
- return Promise.resolve(s2.hooks ? s2.hooks.preprocess(t2) : t2).then((e3) => i2(e3, s2)).then((e3) => s2.hooks ? s2.hooks.processAllTokens(e3) : e3).then((e3) => s2.walkTokens ? Promise.all(this.walkTokens(e3, s2.walkTokens)).then(() => e3) : e3).then((e3) => a2(e3, s2)).then((e3) => s2.hooks ? s2.hooks.postprocess(e3) : e3).catch(l2);
- try {
- s2.hooks && (t2 = s2.hooks.preprocess(t2));
- let e3 = i2(t2, s2);
- s2.hooks && (e3 = s2.hooks.processAllTokens(e3)), s2.walkTokens && this.walkTokens(e3, s2.walkTokens);
- let n3 = a2(e3, s2);
- return s2.hooks && (n3 = s2.hooks.postprocess(n3)), n3;
- } catch (e3) {
- return l2(e3);
- }
- };
- }
- onError(e2, t2) {
- return (n2) => {
- if (n2.message += "\nPlease report this to https://github.com/markedjs/marked.", e2) {
- let e3 = "<p>An error occurred:</p><pre>" + V(n2.message + "", true) + "</pre>";
- return t2 ? Promise.resolve(e3) : e3;
- }
- if (t2)
- return Promise.reject(n2);
- throw n2;
- };
- }
- }, he = new ce();
- function pe(e2, t2) {
- return he.parse(e2, t2);
- }
- pe.options = pe.setOptions = function(e2) {
- return he.setOptions(e2), pe.defaults = he.defaults, n(pe.defaults), pe;
- }, pe.getDefaults = e, pe.defaults = t, pe.use = function(...e2) {
- return he.use(...e2), pe.defaults = he.defaults, n(pe.defaults), pe;
- }, pe.walkTokens = function(e2, t2) {
- return he.walkTokens(e2, t2);
- }, pe.parseInline = he.parseInline, pe.Parser = ae, pe.parser = ae.parse, pe.Renderer = le, pe.TextRenderer = ie, pe.Lexer = se, pe.lexer = se.lex, pe.Tokenizer = re, pe.Hooks = oe, pe.parse = pe;
- pe.options;
- pe.setOptions;
- pe.use;
- pe.walkTokens;
- pe.parseInline;
- ae.parse;
- se.lex;
- const _sfc_main$16 = {
- name: "up-markdown",
- props: {
- // markdown内容
- content: {
- type: String,
- default: ""
- },
- // 是否启用图片预览
- previewImg: {
- type: Boolean,
- default: true
- },
- // 是否显示代码块行号
- showLineNumber: {
- type: Boolean,
- default: false
- },
- // 主题样式 'light' | 'dark'
- theme: {
- type: String,
- default: "light"
- }
- },
- data() {
- return {
- parsedContent: ""
- };
- },
- watch: {
- content: {
- handler(newVal) {
- this.parseMarkdown(newVal);
- },
- immediate: true
- }
- },
- methods: {
- // 解析markdown内容
- parseMarkdown(content) {
- if (!content) {
- this.parsedContent = "";
- return;
- }
- let parsed = pe(content);
- parsed = this.handleCodeBlock(parsed);
- parsed = this.applyTheme(parsed);
- this.parsedContent = parsed;
- },
- // 处理代码块
- handleCodeBlock(html) {
- return html.replace(/<pre><code([^>]*)>([^<]+)<\/code><\/pre>/g, (match, lang, code2) => {
- const language = lang.match(/class="language-([^"]+)"/);
- const langClass = language ? `language-${language[1]}` : "";
- let result = `<pre class="up-markdown-code ${langClass}">`;
- if (this.showLineNumber) {
- const lines = code2.split("\n").filter((line) => line.trim() !== "");
- result += '<span class="up-markdown-line-numbers">';
- lines.push("");
- lines.forEach((_2, index2) => {
- result += `<span class="up-markdown-line-number">${index2 + 1}</span>`;
- });
- result += "</span>";
- }
- result += `<code class='code-lang ${langClass}'>${code2}</code></pre>`;
- return result;
- });
- },
- // 应用主题样式
- applyTheme(html) {
- return html;
- }
- }
- };
- function _sfc_render$15(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_parse = vue.resolveComponent("up-parse");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["up-markdown", $props.theme])
- },
- [
- vue.createVNode(_component_up_parse, {
- content: $data.parsedContent,
- previewImg: $props.previewImg
- }, null, 8, ["content", "previewImg"])
- ],
- 2
- /* CLASS */
- );
- }
- const uMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["render", _sfc_render$15], ["__scopeId", "data-v-9f53166f"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-markdown/u-markdown.vue"]]);
- const __vite_glob_0_62 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uMarkdown
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$15 = {
- name: "u-message-input",
- props: {
- // 最大输入长度
- maxlength: {
- type: [Number, String],
- default: 4
- },
- // 是否用圆点填充
- dotFill: {
- type: Boolean,
- default: false
- },
- // 显示模式,box-盒子模式,bottomLine-横线在底部模式,middleLine-横线在中部模式
- mode: {
- type: String,
- default: "box"
- },
- // 预置值
- modelValue: {
- type: [String, Number],
- default: ""
- },
- // 当前激活输入item,是否带有呼吸效果
- breathe: {
- type: Boolean,
- default: true
- },
- // 是否自动获取焦点
- focus: {
- type: Boolean,
- default: false
- },
- // 字体是否加粗
- bold: {
- type: Boolean,
- default: false
- },
- // 字体大小
- fontSize: {
- type: [String, Number],
- default: 60
- },
- // 激活样式
- activeColor: {
- type: String,
- default: "#2979ff"
- },
- // 未激活的样式
- inactiveColor: {
- type: String,
- default: "#606266"
- },
- // 输入框的大小,单位rpx,宽等于高
- width: {
- type: [Number, String],
- default: "80"
- },
- // 是否隐藏原生键盘,如果想用自定义键盘的话,需设置此参数为true
- disabledKeyboard: {
- type: Boolean,
- default: false
- }
- },
- watch: {
- // maxlength: {
- // // 此值设置为true,会在组件加载后无需maxlength变化就会执行一次本监听函数,无需再created生命周期中处理
- // immediate: true,
- // handler(val) {
- // this.maxlength = Number(val);
- // }
- // },
- modelValue: {
- immediate: true,
- handler(val) {
- val = String(val);
- this.valueModel = val.substring(0, this.maxlength);
- }
- }
- },
- data() {
- return {
- valueModel: ""
- };
- },
- emits: ["change", "finish"],
- computed: {
- // 是否显示呼吸灯效果
- animationClass() {
- return (index2) => {
- if (this.breathe && this.charArr.length == index2)
- return "u-breathe";
- else
- return "";
- };
- },
- // 用于显示字符
- charArr() {
- return this.valueModel.split("");
- },
- charArrLength() {
- return this.charArr.length;
- },
- // 根据长度,循环输入框的个数,因为头条小程序数值不能用于v-for
- loopCharArr() {
- return new Array(this.maxlength);
- }
- },
- methods: {
- getVal(e2) {
- let {
- value: value2
- } = e2.detail;
- this.valueModel = value2;
- if (String(value2).length > this.maxlength)
- return;
- this.$emit("change", value2);
- if (String(value2).length == this.maxlength) {
- this.$emit("finish", value2);
- }
- }
- }
- };
- function _sfc_render$14(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-char-box" }, [
- vue.createElementVNode("view", { class: "u-char-flex" }, [
- vue.createElementVNode("input", {
- disabled: $props.disabledKeyboard,
- value: $data.valueModel,
- type: "number",
- focus: $props.focus,
- maxlength: $props.maxlength,
- class: "u-input",
- onInput: _cache[0] || (_cache[0] = (...args) => $options.getVal && $options.getVal(...args))
- }, null, 40, ["disabled", "value", "focus", "maxlength"]),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.loopCharArr, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([
- $props.breathe && $options.charArrLength == index2 ? "u-breathe" : "",
- "u-char-item",
- $options.charArrLength === index2 && $props.mode == "box" ? "u-box-active" : "",
- $props.mode === "box" ? "u-box" : ""
- ]),
- style: vue.normalizeStyle({
- fontWeight: $props.bold ? "bold" : "normal",
- fontSize: $props.fontSize + "rpx",
- width: $props.width + "rpx",
- height: $props.width + "rpx",
- color: $props.inactiveColor,
- borderColor: $options.charArrLength === index2 && $props.mode == "box" ? $props.activeColor : $props.inactiveColor
- })
- },
- [
- $props.mode !== "middleLine" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-placeholder-line",
- style: vue.normalizeStyle({
- display: $options.charArrLength === index2 ? "block" : "none",
- height: $props.width * 0.5 + "rpx"
- })
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.mode === "middleLine" && $options.charArrLength <= index2 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass([[$props.breathe && $options.charArrLength == index2 ? "u-breathe" : "", $options.charArrLength === index2 ? "u-middle-line-active" : ""], "u-middle-line"]),
- style: vue.normalizeStyle({ height: $props.bold ? "4px" : "2px", background: $options.charArrLength === index2 ? $props.activeColor : $props.inactiveColor })
- },
- null,
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- $props.mode === "bottomLine" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: vue.normalizeClass([[$props.breathe && $options.charArrLength == index2 ? "u-breathe" : "", $options.charArrLength === index2 ? "u-bottom-line-active" : ""], "u-bottom-line"]),
- style: vue.normalizeStyle({ height: $props.bold ? "4px" : "2px", background: $options.charArrLength === index2 ? $props.activeColor : $props.inactiveColor })
- },
- null,
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- !$props.dotFill ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 3 },
- [
- vue.createTextVNode(
- vue.toDisplayString($options.charArr[index2] ? $options.charArr[index2] : ""),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 4,
- class: "u-dot"
- },
- vue.toDisplayString($options.charArr[index2] ? "●" : ""),
- 1
- /* TEXT */
- ))
- ],
- 6
- /* CLASS, STYLE */
- )
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }
- const uMessageInput = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["render", _sfc_render$14], ["__scopeId", "data-v-bf0cf2ff"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-message-input/u-message-input.vue"]]);
- const __vite_glob_0_63 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uMessageInput
- }, Symbol.toStringTag, { value: "Module" }));
- const props$E = defineMixin({
- props: {
- // 是否展示modal
- show: {
- type: Boolean,
- default: () => props$1x.modal.show
- },
- // 标题
- title: {
- type: [String],
- default: () => props$1x.modal.title
- },
- // 弹窗内容
- content: {
- type: String,
- default: () => props$1x.modal.content
- },
- // 确认文案
- confirmText: {
- type: String,
- default: () => props$1x.modal.confirmText
- },
- // 取消文案
- cancelText: {
- type: String,
- default: () => props$1x.modal.cancelText
- },
- // 是否显示确认按钮
- showConfirmButton: {
- type: Boolean,
- default: () => props$1x.modal.showConfirmButton
- },
- // 是否显示取消按钮
- showCancelButton: {
- type: Boolean,
- default: () => props$1x.modal.showCancelButton
- },
- // 确认按钮颜色
- confirmColor: {
- type: String,
- default: () => props$1x.modal.confirmColor
- },
- // 取消文字颜色
- cancelColor: {
- type: String,
- default: () => props$1x.modal.cancelColor
- },
- // 对调确认和取消的位置
- buttonReverse: {
- type: Boolean,
- default: () => props$1x.modal.buttonReverse
- },
- // 是否开启缩放效果
- zoom: {
- type: Boolean,
- default: () => props$1x.modal.zoom
- },
- // 是否异步关闭,只对确定按钮有效
- asyncClose: {
- type: Boolean,
- default: () => props$1x.modal.asyncClose
- },
- // 是否允许点击遮罩关闭modal
- closeOnClickOverlay: {
- type: Boolean,
- default: () => props$1x.modal.closeOnClickOverlay
- },
- // 给一个负的margin-top,往上偏移,避免和键盘重合的情况
- negativeTop: {
- type: [String, Number],
- default: () => props$1x.modal.negativeTop
- },
- // modal宽度,不支持百分比,可以数值,px,rpx单位
- width: {
- type: [String, Number],
- default: () => props$1x.modal.width
- },
- // 确认按钮的样式,circle-圆形,square-方形,如设置,将不会显示取消按钮
- confirmButtonShape: {
- type: String,
- default: () => props$1x.modal.confirmButtonShape
- },
- // 弹窗动画过度时间
- duration: {
- type: [Number],
- default: props$1x.modal.duration
- },
- // 文案对齐方式
- contentTextAlign: {
- type: String,
- default: () => props$1x.modal.contentTextAlign
- },
- // 异步确定时如果点击了取消时候的提示文案
- asyncCloseTip: {
- type: String,
- default: () => props$1x.modal.asyncCloseTip
- },
- // 是否异步关闭,只对取消按钮有效
- asyncCancelClose: {
- type: Boolean,
- default: () => props$1x.modal.asyncCancelClose
- },
- // 内容样式
- contentStyle: {
- type: Object,
- default: () => props$1x.modal.contentStyle
- }
- }
- });
- const _sfc_main$14 = {
- name: "u-modal",
- mixins: [mpMixin, mixin, props$E],
- data() {
- return {
- loading: false
- };
- },
- watch: {
- show(n2) {
- if (n2 && this.loading)
- this.loading = false;
- }
- },
- emits: ["confirm", "cancel", "close", "update:show", "cancelOnAsync"],
- computed: {
- contentStyleCpu() {
- let style = this.contentStyle;
- style.paddingTop = `${this.title ? 12 : 25}px`;
- return style;
- }
- },
- methods: {
- addUnit,
- // 点击确定按钮
- confirmHandler() {
- if (this.asyncClose) {
- this.loading = true;
- } else {
- this.$emit("update:show", false);
- }
- this.$emit("confirm");
- },
- // 点击取消按钮
- cancelHandler() {
- if (this.asyncClose && this.loading) {
- if (this.asyncCloseTip) {
- uni.showToast({
- title: this.asyncCloseTip,
- icon: "none"
- });
- }
- this.$emit("cancelOnAsync");
- } else {
- if (!this.asyncCancelClose) {
- this.$emit("update:show", false);
- }
- }
- this.$emit("cancel");
- },
- // 点击遮罩
- // 从原理上来说,modal的遮罩点击,并不是真的点击到了遮罩
- // 因为modal依赖于popup的中部弹窗类型,中部弹窗比较特殊,虽有然遮罩,但是为了让弹窗内容能flex居中
- // 多了一个透明的遮罩,此透明的遮罩会覆盖在灰色的遮罩上,所以实际上是点击不到灰色遮罩的,popup内部在
- // 透明遮罩的子元素做了.stop处理,所以点击内容区,也不会导致误触发
- clickHandler() {
- if (this.closeOnClickOverlay) {
- this.$emit("update:show", false);
- this.$emit("close");
- }
- }
- }
- };
- function _sfc_render$13(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- const _component_u_loading_icon = resolveEasycom(vue.resolveDynamicComponent("u-loading-icon"), __easycom_0$e);
- const _component_u_popup = resolveEasycom(vue.resolveDynamicComponent("u-popup"), __easycom_2);
- return vue.openBlock(), vue.createBlock(_component_u_popup, {
- mode: "center",
- zoom: _ctx.zoom,
- show: _ctx.show,
- class: vue.normalizeClass([_ctx.customClass]),
- customStyle: {
- borderRadius: "6px",
- overflow: "hidden",
- marginTop: `-${$options.addUnit(_ctx.negativeTop)}`
- },
- closeOnClickOverlay: _ctx.closeOnClickOverlay,
- safeAreaInsetBottom: false,
- duration: _ctx.duration,
- onClick: $options.clickHandler
- }, {
- bottom: vue.withCtx(() => [
- vue.renderSlot(_ctx.$slots, "popupBottom", {}, void 0, true)
- ]),
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "u-modal",
- style: vue.normalizeStyle({
- width: $options.addUnit(_ctx.width)
- })
- },
- [
- _ctx.title ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-modal__title"
- },
- vue.toDisplayString(_ctx.title),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "u-modal__content",
- style: vue.normalizeStyle($options.contentStyleCpu)
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode(
- "text",
- {
- class: "u-modal__content__text",
- style: vue.normalizeStyle({ textAlign: _ctx.contentTextAlign })
- },
- vue.toDisplayString(_ctx.content),
- 5
- /* TEXT, STYLE */
- )
- ], true)
- ],
- 4
- /* STYLE */
- ),
- _ctx.$slots.confirmButton ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-modal__button-group--confirm-button"
- }, [
- vue.renderSlot(_ctx.$slots, "confirmButton", {}, void 0, true)
- ])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- vue.createVNode(_component_u_line),
- vue.createElementVNode(
- "view",
- {
- class: "u-modal__button-group",
- style: vue.normalizeStyle({
- flexDirection: _ctx.buttonReverse ? "row-reverse" : "row"
- })
- },
- [
- _ctx.showCancelButton ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-modal__button-group__wrapper u-modal__button-group__wrapper--cancel", [_ctx.showCancelButton && !_ctx.showConfirmButton && "u-modal__button-group__wrapper--only-cancel"]]),
- "hover-stay-time": 150,
- "hover-class": "u-modal__button-group__wrapper--hover",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.cancelHandler && $options.cancelHandler(...args))
- },
- [
- vue.createElementVNode(
- "text",
- {
- class: "u-modal__button-group__wrapper__text",
- style: vue.normalizeStyle({
- color: _ctx.cancelColor
- })
- },
- vue.toDisplayString(_ctx.cancelText),
- 5
- /* TEXT, STYLE */
- )
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.showConfirmButton && _ctx.showCancelButton ? (vue.openBlock(), vue.createBlock(_component_u_line, {
- key: 1,
- direction: "column"
- })) : vue.createCommentVNode("v-if", true),
- _ctx.showConfirmButton ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: vue.normalizeClass(["u-modal__button-group__wrapper u-modal__button-group__wrapper--confirm", [!_ctx.showCancelButton && _ctx.showConfirmButton && "u-modal__button-group__wrapper--only-confirm"]]),
- "hover-stay-time": 150,
- "hover-class": "u-modal__button-group__wrapper--hover",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.confirmHandler && $options.confirmHandler(...args))
- },
- [
- $data.loading ? (vue.openBlock(), vue.createBlock(_component_u_loading_icon, { key: 0 })) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "u-modal__button-group__wrapper__text",
- style: vue.normalizeStyle({
- color: _ctx.confirmColor
- })
- },
- vue.toDisplayString(_ctx.confirmText),
- 5
- /* TEXT, STYLE */
- ))
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["zoom", "show", "class", "customStyle", "closeOnClickOverlay", "duration", "onClick"]);
- }
- const uModal = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["render", _sfc_render$13], ["__scopeId", "data-v-f667648f"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-modal/u-modal.vue"]]);
- const __vite_glob_0_64 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uModal
- }, Symbol.toStringTag, { value: "Module" }));
- const props$D = defineMixin({
- props: {
- // 是否开启顶部安全区适配
- safeAreaInsetTop: {
- type: Boolean,
- default: () => true
- },
- // 是否固定在顶部
- fixed: {
- type: Boolean,
- default: () => true
- },
- // 左边的图标
- leftIcon: {
- type: String,
- default: "arrow-leftward"
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: () => "rgba(0,0,0,.15)"
- },
- // 导航栏高度
- height: {
- type: [String, Number],
- default: () => "32px"
- },
- // 图标的大小
- iconSize: {
- type: [String, Number],
- default: "20px"
- },
- // 图标的颜色
- iconColor: {
- type: String,
- default: "#fff"
- },
- // 点击左侧区域(返回图标),是否自动返回上一页
- autoBack: {
- type: Boolean,
- default: () => true
- },
- // 首页路径
- homeUrl: {
- type: [String],
- default: ""
- }
- }
- });
- const _sfc_main$13 = {
- name: "u-navbar-mini",
- mixins: [mpMixin, mixin, props$D],
- data() {
- return {};
- },
- emits: ["leftClick", "homeClick"],
- created() {
- },
- methods: {
- addStyle,
- addUnit,
- sys,
- getPx,
- // 点击左侧区域
- leftClick() {
- this.$emit("leftClick");
- if (this.autoBack) {
- uni.navigateBack();
- }
- },
- homeClick() {
- if (this.homeUrl) {
- uni.reLaunch({ url: this.homeUrl });
- }
- }
- }
- };
- function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_status_bar = resolveEasycom(vue.resolveDynamicComponent("u-status-bar"), __easycom_0$c);
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_up_line = vue.resolveComponent("up-line");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-navbar-mini", [_ctx.customClass]])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-navbar-mini__inner", [_ctx.fixed && "u-navbar-mini--fixed"]])
- },
- [
- _ctx.safeAreaInsetTop ? (vue.openBlock(), vue.createBlock(_component_u_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "u-navbar-mini__content",
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.height),
- backgroundColor: _ctx.bgColor
- })
- },
- [
- vue.createElementVNode("view", {
- class: "u-navbar-mini__content__left",
- "hover-class": "u-navbar-mini__content__left--hover",
- "hover-start-time": "150",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.leftClick && $options.leftClick(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "left", {}, () => [
- vue.createVNode(_component_up_icon, {
- name: _ctx.leftIcon,
- size: _ctx.iconSize,
- color: _ctx.iconColor
- }, null, 8, ["name", "size", "color"])
- ], true)
- ]),
- vue.createElementVNode("view", { style: { "padding": "10px 10px" } }, [
- vue.createVNode(_component_up_line, {
- direction: "col",
- color: "#fff",
- length: "16px"
- })
- ]),
- vue.createElementVNode("view", {
- class: "u-navbar-mini__content__center",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.homeClick && $options.homeClick(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "center", {}, () => [
- vue.createVNode(_component_up_icon, {
- name: "home",
- size: _ctx.iconSize,
- color: _ctx.iconColor
- }, null, 8, ["size", "color"])
- ], true)
- ])
- ],
- 4
- /* STYLE */
- )
- ],
- 2
- /* CLASS */
- )
- ],
- 2
- /* CLASS */
- );
- }
- const uNavbarMini = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["render", _sfc_render$12], ["__scopeId", "data-v-dc7ccfda"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-navbar-mini/u-navbar-mini.vue"]]);
- const __vite_glob_0_65 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uNavbarMini
- }, Symbol.toStringTag, { value: "Module" }));
- const props$C = defineMixin({
- props: {
- // 是否开启顶部安全区适配
- safeAreaInsetTop: {
- type: Boolean,
- default: () => props$1x.navbar.safeAreaInsetTop
- },
- // 固定在顶部时,是否生成一个等高元素,以防止塌陷
- placeholder: {
- type: Boolean,
- default: () => props$1x.navbar.placeholder
- },
- // 是否固定在顶部
- fixed: {
- type: Boolean,
- default: () => props$1x.navbar.fixed
- },
- // 是否显示下边框
- border: {
- type: Boolean,
- default: () => props$1x.navbar.border
- },
- // 左边的图标
- leftIcon: {
- type: String,
- default: () => props$1x.navbar.leftIcon
- },
- // 左边的提示文字
- leftText: {
- type: String,
- default: () => props$1x.navbar.leftText
- },
- // 左右的提示文字
- rightText: {
- type: String,
- default: () => props$1x.navbar.rightText
- },
- // 右边的图标
- rightIcon: {
- type: String,
- default: () => props$1x.navbar.rightIcon
- },
- // 标题
- title: {
- type: [String, Number],
- default: () => props$1x.navbar.title
- },
- // 标题颜色
- titleColor: {
- type: String,
- default: () => props$1x.navbar.titleColor
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.navbar.bgColor
- },
- // 状态栏背景颜色 不写会使用背景颜色bgColor
- statusBarBgColor: {
- type: String,
- default: () => ""
- },
- // 标题的宽度
- titleWidth: {
- type: [String, Number],
- default: () => props$1x.navbar.titleWidth
- },
- // 导航栏高度
- height: {
- type: [String, Number],
- default: () => props$1x.navbar.height
- },
- // 左侧返回图标的大小
- leftIconSize: {
- type: [String, Number],
- default: () => props$1x.navbar.leftIconSize
- },
- // 左侧返回图标的颜色
- leftIconColor: {
- type: String,
- default: () => props$1x.navbar.leftIconColor
- },
- // 点击左侧区域(返回图标),是否自动返回上一页
- autoBack: {
- type: Boolean,
- default: () => props$1x.navbar.autoBack
- },
- // 标题的样式,对象或字符串
- titleStyle: {
- type: [String, Object],
- default: () => props$1x.navbar.titleStyle
- }
- }
- });
- const _sfc_main$12 = {
- name: "u-navbar",
- mixins: [mpMixin, mixin, props$C],
- data() {
- return {};
- },
- emits: ["leftClick", "rightClick"],
- methods: {
- addStyle,
- addUnit,
- getWindowInfo,
- getPx,
- // 点击左侧区域
- leftClick() {
- this.$emit("leftClick");
- if (config$1.interceptor.navbarLeftClick != null) {
- config$1.interceptor.navbarLeftClick();
- } else {
- if (this.autoBack) {
- uni.navigateBack();
- }
- }
- },
- // 点击右侧区域
- rightClick() {
- this.$emit("rightClick");
- }
- }
- };
- function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_status_bar = resolveEasycom(vue.resolveDynamicComponent("u-status-bar"), __easycom_0$c);
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-navbar", [_ctx.customClass]])
- },
- [
- _ctx.fixed && _ctx.placeholder ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-navbar__placeholder",
- style: vue.normalizeStyle({
- height: $options.addUnit($options.getPx(_ctx.height) + $options.getWindowInfo().statusBarHeight, "px")
- })
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([_ctx.fixed && "u-navbar--fixed"])
- },
- [
- _ctx.safeAreaInsetTop ? (vue.openBlock(), vue.createBlock(_component_u_status_bar, {
- key: 0,
- bgColor: _ctx.statusBarBgColor ? _ctx.statusBarBgColor : _ctx.bgColor
- }, null, 8, ["bgColor"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-navbar__content", [_ctx.border && "u-border-bottom"]]),
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.height),
- backgroundColor: _ctx.bgColor
- })
- },
- [
- vue.createElementVNode("view", {
- class: "u-navbar__content__left",
- "hover-class": "u-navbar__content__left--hover",
- "hover-start-time": "150",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.leftClick && $options.leftClick(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "left", {}, () => [
- _ctx.leftIcon ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: _ctx.leftIcon,
- size: _ctx.leftIconSize,
- color: _ctx.leftIconColor
- }, null, 8, ["name", "size", "color"])) : vue.createCommentVNode("v-if", true),
- _ctx.leftText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- style: vue.normalizeStyle({
- color: _ctx.leftIconColor
- }),
- class: "u-navbar__content__left__text"
- },
- vue.toDisplayString(_ctx.leftText),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ]),
- vue.renderSlot(_ctx.$slots, "center", {}, () => [
- vue.createElementVNode(
- "text",
- {
- class: "u-line-1 u-navbar__content__title",
- style: vue.normalizeStyle([{
- width: $options.addUnit(_ctx.titleWidth),
- color: _ctx.titleColor
- }, $options.addStyle(_ctx.titleStyle)])
- },
- vue.toDisplayString(_ctx.title),
- 5
- /* TEXT, STYLE */
- )
- ], true),
- _ctx.$slots.right || _ctx.rightIcon || _ctx.rightText ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-navbar__content__right",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.rightClick && $options.rightClick(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "right", {}, () => [
- _ctx.rightIcon ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: _ctx.rightIcon,
- size: "20"
- }, null, 8, ["name"])) : vue.createCommentVNode("v-if", true),
- _ctx.rightText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "u-navbar__content__right__text"
- },
- vue.toDisplayString(_ctx.rightText),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], true)
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )
- ],
- 2
- /* CLASS */
- )
- ],
- 2
- /* CLASS */
- );
- }
- const uNavbar = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$11], ["__scopeId", "data-v-f631659b"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-navbar/u-navbar.vue"]]);
- const __vite_glob_0_66 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uNavbar
- }, Symbol.toStringTag, { value: "Module" }));
- const props$B = defineMixin({
- props: {
- // 页面文字提示
- tips: {
- type: String,
- default: () => props$1x.noNetwork.tips
- },
- // 一个z-index值,用于设置没有网络这个组件的层次,因为页面可能会有其他定位的元素层级过高,导致此组件被覆盖
- zIndex: {
- type: [String, Number],
- default: () => props$1x.noNetwork.zIndex
- },
- // image 没有网络的图片提示
- image: {
- type: String,
- default: () => props$1x.noNetwork.image
- }
- }
- });
- const _sfc_main$11 = {
- name: "u-no-network",
- mixins: [mpMixin, mixin, props$B],
- data() {
- return {
- isConnected: true,
- // 是否有网络连接
- networkType: "none"
- // 网络类型
- };
- },
- mounted() {
- this.isIOS = getDeviceInfo().platform === "ios";
- uni.onNetworkStatusChange((res) => {
- this.isConnected = res.isConnected;
- this.networkType = res.networkType;
- this.emitEvent(this.networkType);
- });
- uni.getNetworkType({
- success: (res) => {
- this.networkType = res.networkType;
- this.emitEvent(this.networkType);
- if (res.networkType == "none") {
- this.isConnected = false;
- } else {
- this.isConnected = true;
- }
- }
- });
- },
- emits: ["disconnected", "connected"],
- methods: {
- t: t$1,
- retry() {
- uni.getNetworkType({
- success: (res) => {
- this.networkType = res.networkType;
- this.emitEvent(this.networkType);
- if (res.networkType == "none") {
- toast(t$1("up.noNetwork.disconnect"));
- this.isConnected = false;
- } else {
- toast(t$1("up.noNetwork.connect"));
- this.isConnected = true;
- }
- }
- });
- this.$emit("retry");
- },
- // 发出事件给父组件
- emitEvent(networkType) {
- this.$emit(networkType === "none" ? "disconnected" : "connected");
- },
- async openSettings() {
- if (this.networkType == "none") {
- this.openSystemSettings();
- return;
- }
- },
- openAppSettings() {
- this.gotoAppSetting();
- },
- openSystemSettings() {
- if (this.isIOS) {
- this.gotoiOSSetting();
- } else {
- this.gotoAndroidSetting();
- }
- },
- network() {
- var result = null;
- var cellularData = plus.ios.newObject("CTCellularData");
- var state = cellularData.plusGetAttribute("restrictedState");
- if (state == 0) {
- result = null;
- } else if (state == 2) {
- result = 1;
- } else if (state == 1) {
- result = 2;
- }
- plus.ios.deleteObject(cellularData);
- return result;
- },
- gotoAppSetting() {
- if (this.isIOS) {
- var UIApplication = plus.ios.import("UIApplication");
- var application2 = UIApplication.sharedApplication();
- var NSURL2 = plus.ios.import("NSURL");
- var setting2 = NSURL2.URLWithString("app-settings:");
- application2.openURL(setting2);
- plus.ios.deleteObject(setting2);
- plus.ios.deleteObject(NSURL2);
- plus.ios.deleteObject(application2);
- } else {
- var Intent = plus.android.importClass("android.content.Intent");
- var Settings = plus.android.importClass("android.provider.Settings");
- var Uri = plus.android.importClass("android.net.Uri");
- var mainActivity = plus.android.runtimeMainActivity();
- var intent = new Intent();
- intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
- var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
- intent.setData(uri);
- mainActivity.startActivity(intent);
- }
- },
- gotoiOSSetting() {
- var UIApplication = plus.ios.import("UIApplication");
- var application2 = UIApplication.sharedApplication();
- var NSURL2 = plus.ios.import("NSURL");
- var setting2 = NSURL2.URLWithString("App-prefs:root=General");
- application2.openURL(setting2);
- plus.ios.deleteObject(setting2);
- plus.ios.deleteObject(NSURL2);
- plus.ios.deleteObject(application2);
- },
- gotoAndroidSetting() {
- var Intent = plus.android.importClass("android.content.Intent");
- var Settings = plus.android.importClass("android.provider.Settings");
- var mainActivity = plus.android.runtimeMainActivity();
- var intent = new Intent(Settings.ACTION_SETTINGS);
- mainActivity.startActivity(intent);
- }
- }
- };
- function _sfc_render$10(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_button = resolveEasycom(vue.resolveDynamicComponent("u-button"), __easycom_0$8);
- const _component_u_overlay = resolveEasycom(vue.resolveDynamicComponent("u-overlay"), __easycom_0$d);
- return vue.openBlock(), vue.createBlock(_component_u_overlay, {
- show: !$data.isConnected,
- zIndex: _ctx.zIndex,
- onTouchmove: vue.withModifiers(_ctx.noop, ["stop", "prevent"]),
- customStyle: {
- backgroundColor: "#fff",
- display: "flex",
- justifyContent: "center"
- }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "u-no-network" }, [
- vue.createVNode(_component_up_icon, {
- name: _ctx.image,
- size: "150",
- imgMode: "widthFit",
- class: "u-no-network__error-icon"
- }, null, 8, ["name"]),
- vue.createElementVNode(
- "text",
- { class: "u-no-network__tips" },
- vue.toDisplayString(_ctx.tips),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(" 只有APP平台,才能跳转设置页,因为需要调用plus环境 "),
- vue.createElementVNode("view", { class: "u-no-network__app" }, [
- vue.createElementVNode(
- "text",
- { class: "u-no-network__app__setting" },
- vue.toDisplayString($options.t("up.noNetwork.pleaseCheck")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "u-no-network__app__to-setting",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.openSettings && $options.openSettings(...args))
- },
- vue.toDisplayString($options.t("up.common.settings")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "u-no-network__retry" }, [
- vue.createVNode(_component_u_button, {
- size: "mini",
- text: $options.t("up.common.retry"),
- type: "primary",
- plain: "",
- onClick: $options.retry
- }, null, 8, ["text", "onClick"])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show", "zIndex", "onTouchmove"]);
- }
- const uNoNetwork = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$10], ["__scopeId", "data-v-12a0c5bd"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-no-network/u-no-network.vue"]]);
- const __vite_glob_0_67 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uNoNetwork
- }, Symbol.toStringTag, { value: "Module" }));
- const props$A = defineMixin({
- props: {
- // 显示的内容,字符串
- text: {
- type: String,
- default: () => props$1x.rowNotice.text
- },
- // 是否显示左侧的音量图标
- icon: {
- type: String,
- default: () => props$1x.rowNotice.icon
- },
- // 通告模式,link-显示右箭头,closable-显示右侧关闭图标
- mode: {
- type: String,
- default: () => props$1x.rowNotice.mode
- },
- // 文字颜色,各图标也会使用文字颜色
- color: {
- type: String,
- default: () => props$1x.rowNotice.color
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.rowNotice.bgColor
- },
- // 字体大小,单位px
- fontSize: {
- type: [String, Number],
- default: () => props$1x.rowNotice.fontSize
- },
- // 水平滚动时的滚动速度,即每秒滚动多少px(rpx),这有利于控制文字无论多少时,都能有一个恒定的速度
- speed: {
- type: [String, Number],
- default: () => props$1x.rowNotice.speed
- }
- }
- });
- const _sfc_main$10 = {
- name: "u-row-notice",
- mixins: [mpMixin, mixin, props$A],
- data() {
- return {
- animationDuration: "0",
- // 动画执行时间
- animationPlayState: "paused",
- // 动画的开始和结束执行
- // nvue下,内容发生变化,导致滚动宽度也变化,需要标志为是否需要重新计算宽度
- // 不能在内容变化时直接重新计算,因为nvue的animation模块上一次的滚动不是刚好结束,会有影响
- nvueInit: true,
- show: true
- };
- },
- watch: {
- text: {
- immediate: true,
- handler(newValue, oldValue) {
- this.vue();
- if (!test.string(newValue)) {
- error("noticebar组件direction为row时,要求text参数为字符串形式");
- }
- }
- },
- fontSize() {
- this.vue();
- },
- speed() {
- this.vue();
- }
- },
- computed: {
- // 文字内容的样式
- textStyle() {
- let style = {};
- style.whiteSpace = "nowrap !important";
- style.color = this.color;
- style.fontSize = addUnit(this.fontSize);
- return style;
- },
- animationStyle() {
- let style = {};
- style.animationDuration = this.animationDuration;
- style.animationPlayState = this.animationPlayState;
- return style;
- },
- // 内部对用户传入的数据进一步分割,放到多个text标签循环,否则如果用户传入的字符串很长(100个字符以上)
- // 放在一个text标签中进行滚动,在低端安卓机上,动画可能会出现抖动现象,需要分割到多个text中可解决此问题
- innerText() {
- let result = [], len = 20;
- const textArr = this.text.split("");
- for (let i2 = 0; i2 < textArr.length; i2 += len) {
- result.push(textArr.slice(i2, i2 + len).join(""));
- }
- return result;
- }
- },
- 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.init();
- },
- emits: ["click", "close"],
- methods: {
- init() {
- this.vue();
- if (!test.string(this.text)) {
- error("noticebar组件direction为row时,要求text参数为字符串形式");
- }
- },
- // vue版处理
- async vue() {
- let textWidth = 0;
- await sleep();
- textWidth = (await this.$uGetRect(".u-notice__content__text")).width;
- (await this.$uGetRect(".u-notice__content")).width;
- this.animationDuration = `${textWidth / getPx(this.speed)}s`;
- this.animationPlayState = "paused";
- setTimeout(() => {
- this.animationPlayState = "running";
- }, 10);
- },
- // nvue版处理
- async nvue() {
- },
- loopAnimation(textWidth, boxWidth) {
- },
- getNvueRect(el) {
- },
- // 点击通告栏
- clickHandler(index2) {
- this.$emit("click");
- },
- // 点击右侧按钮,需要判断点击的是关闭图标还是箭头图标
- close() {
- this.$emit("close");
- }
- },
- beforeUnmount() {
- this.stopAnimation = true;
- }
- };
- function _sfc_render$$(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-notice",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "icon", {}, () => [
- _ctx.icon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-notice__left-icon"
- }, [
- vue.createVNode(_component_up_icon, {
- name: _ctx.icon,
- color: _ctx.color,
- size: "19"
- }, null, 8, ["name", "color"])
- ])) : vue.createCommentVNode("v-if", true)
- ], true),
- vue.createElementVNode(
- "view",
- {
- class: "u-notice__content",
- ref: "u-notice__content"
- },
- [
- vue.createElementVNode(
- "view",
- {
- ref: "u-notice__content__text",
- class: "u-notice__content__text",
- style: vue.normalizeStyle([$options.animationStyle])
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.innerText, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: index2,
- style: vue.normalizeStyle([$options.textStyle])
- },
- vue.toDisplayString(item),
- 5
- /* TEXT, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )
- ],
- 512
- /* NEED_PATCH */
- ),
- ["link", "closable"].includes(_ctx.mode) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-notice__right-icon"
- }, [
- _ctx.mode === "link" ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: "arrow-right",
- size: 17,
- color: _ctx.color
- }, null, 8, ["color"])) : vue.createCommentVNode("v-if", true),
- _ctx.mode === "closable" ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- onClick: $options.close,
- name: "close",
- size: 16,
- color: _ctx.color
- }, null, 8, ["onClick", "color"])) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$$], ["__scopeId", "data-v-ab8dee7b"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-row-notice/u-row-notice.vue"]]);
- const __vite_glob_0_88 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_1$1
- }, Symbol.toStringTag, { value: "Module" }));
- const props$z = defineMixin({
- props: {
- // 显示的内容,数组
- text: {
- type: [Array, String],
- default: () => props$1x.noticeBar.text
- },
- // 通告滚动模式,row-横向滚动,column-竖向滚动
- direction: {
- type: String,
- default: () => props$1x.noticeBar.direction
- },
- // direction = row时,是否使用步进形式滚动
- step: {
- type: Boolean,
- default: () => props$1x.noticeBar.step
- },
- // 是否显示左侧的音量图标
- icon: {
- type: String,
- default: () => props$1x.noticeBar.icon
- },
- // 通告模式,link-显示右箭头,closable-显示右侧关闭图标
- mode: {
- type: String,
- default: () => props$1x.noticeBar.mode
- },
- // 文字颜色,各图标也会使用文字颜色
- color: {
- type: String,
- default: () => props$1x.noticeBar.color
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.noticeBar.bgColor
- },
- // 水平滚动时的滚动速度,即每秒滚动多少px(px),这有利于控制文字无论多少时,都能有一个恒定的速度
- speed: {
- type: [String, Number],
- default: () => props$1x.noticeBar.speed
- },
- // 字体大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.noticeBar.fontSize
- },
- // 滚动一个周期的时间长,单位ms
- duration: {
- type: [String, Number],
- default: () => props$1x.noticeBar.duration
- },
- // 是否禁止用手滑动切换
- // 目前HX2.6.11,只支持App 2.5.5+、H5 2.5.5+、支付宝小程序、字节跳动小程序
- disableTouch: {
- type: Boolean,
- default: () => props$1x.noticeBar.disableTouch
- },
- // 跳转的页面路径
- url: {
- type: String,
- default: () => props$1x.noticeBar.url
- },
- // 页面跳转的类型
- linkType: {
- type: String,
- default: () => props$1x.noticeBar.linkType
- },
- justifyContent: {
- type: String,
- default: () => props$1x.noticeBar.justifyContent
- }
- }
- });
- const _sfc_main$$ = {
- name: "u-notice-bar",
- mixins: [mpMixin, mixin, props$z],
- data() {
- return {
- show: true
- };
- },
- emits: ["click", "close"],
- methods: {
- addStyle,
- // 点击通告栏
- click(index2) {
- this.$emit("click", index2);
- if (this.url && this.linkType) {
- this.openPage();
- }
- },
- // 点击关闭按钮
- close() {
- this.show = false;
- this.$emit("close");
- }
- }
- };
- function _sfc_render$_(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_column_notice = resolveEasycom(vue.resolveDynamicComponent("u-column-notice"), __easycom_0$6);
- const _component_u_row_notice = resolveEasycom(vue.resolveDynamicComponent("u-row-notice"), __easycom_1$1);
- return $data.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-notice-bar",
- style: vue.normalizeStyle([{
- backgroundColor: _ctx.bgColor
- }, $options.addStyle(_ctx.customStyle)])
- },
- [
- _ctx.direction === "column" || _ctx.direction === "row" && _ctx.step ? (vue.openBlock(), vue.createBlock(_component_u_column_notice, {
- key: 0,
- color: _ctx.color,
- bgColor: _ctx.bgColor,
- text: _ctx.text,
- mode: _ctx.mode,
- step: _ctx.step,
- icon: _ctx.icon,
- "disable-touch": _ctx.disableTouch,
- fontSize: _ctx.fontSize,
- duration: _ctx.duration,
- justifyContent: _ctx.justifyContent,
- onClose: $options.close,
- onClick: $options.click
- }, null, 8, ["color", "bgColor", "text", "mode", "step", "icon", "disable-touch", "fontSize", "duration", "justifyContent", "onClose", "onClick"])) : (vue.openBlock(), vue.createBlock(_component_u_row_notice, {
- key: 1,
- color: _ctx.color,
- bgColor: _ctx.bgColor,
- text: _ctx.text,
- mode: _ctx.mode,
- fontSize: _ctx.fontSize,
- speed: _ctx.speed,
- url: _ctx.url,
- linkType: _ctx.linkType,
- icon: _ctx.icon,
- onClose: $options.close,
- onClick: $options.click
- }, null, 8, ["color", "bgColor", "text", "mode", "fontSize", "speed", "url", "linkType", "icon", "onClose", "onClick"]))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const uNoticeBar = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["render", _sfc_render$_], ["__scopeId", "data-v-54bd9363"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-notice-bar/u-notice-bar.vue"]]);
- const __vite_glob_0_68 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uNoticeBar
- }, Symbol.toStringTag, { value: "Module" }));
- const props$y = defineMixin({
- props: {
- // 到顶部的距离
- top: {
- type: [String, Number],
- default: () => props$1x.notify.top
- },
- // 是否展示组件
- // show: {
- // type: Boolean,
- // default: () => defProps.notify.show
- // },
- // type主题,primary,success,warning,error
- type: {
- type: String,
- default: () => props$1x.notify.type
- },
- // 字体颜色
- color: {
- type: String,
- default: () => props$1x.notify.color
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.notify.bgColor
- },
- // 展示的文字内容
- message: {
- type: String,
- default: () => props$1x.notify.message
- },
- // 展示时长,为0时不消失,单位ms
- duration: {
- type: [String, Number],
- default: () => props$1x.notify.duration
- },
- // 字体大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.notify.fontSize
- },
- // 是否留出顶部安全距离(状态栏高度)
- safeAreaInsetTop: {
- type: Boolean,
- default: () => props$1x.notify.safeAreaInsetTop
- }
- }
- });
- const _sfc_main$_ = {
- name: "u-notify",
- mixins: [mpMixin, mixin, props$y],
- data() {
- return {
- // 是否展示组件
- open: false,
- timer: null,
- config: {
- // 到顶部的距离
- top: props$1x.notify.top,
- // type主题,primary,success,warning,error
- type: props$1x.notify.type,
- // 字体颜色
- color: props$1x.notify.color,
- // 背景颜色
- bgColor: props$1x.notify.bgColor,
- // 展示的文字内容
- message: props$1x.notify.message,
- // 展示时长,为0时不消失,单位ms
- duration: props$1x.notify.duration,
- // 字体大小
- fontSize: props$1x.notify.fontSize,
- // 是否留出顶部安全距离(状态栏高度)
- safeAreaInsetTop: props$1x.notify.safeAreaInsetTop
- },
- // 合并后的配置,避免多次调用组件后,可能会复用之前使用的配置参数
- tmpConfig: {}
- };
- },
- computed: {
- containerStyle() {
- let top = 0;
- if (this.tmpConfig.top === 0)
- ;
- const style = {
- top: addUnit(this.tmpConfig.top === 0 ? top : this.tmpConfig.top),
- // 因为组件底层为u-transition组件,必须将其设置为fixed定位
- // 让其出现在导航栏底部
- position: "fixed",
- left: 0,
- right: 0,
- zIndex: 10076
- };
- return style;
- },
- // 组件背景颜色
- backgroundColor() {
- const style = {};
- if (this.tmpConfig.bgColor) {
- style.backgroundColor = this.tmpConfig.bgColor;
- }
- return style;
- },
- // 默认主题下的图标
- icon() {
- let icon;
- if (this.tmpConfig.type === "success") {
- icon = "checkmark-circle";
- } else if (this.tmpConfig.type === "error") {
- icon = "close-circle";
- } else if (this.tmpConfig.type === "warning") {
- icon = "error-circle";
- }
- return icon;
- }
- },
- created() {
- ["primary", "success", "error", "warning"].map((item) => {
- this[item] = (message) => this.show({
- type: item,
- message
- });
- });
- },
- methods: {
- addStyle,
- addUnit,
- show(options2) {
- this.tmpConfig = deepMerge$1(this.config, options2);
- this.clearTimer();
- this.open = true;
- if (this.tmpConfig.duration > 0) {
- this.timer = setTimeout(() => {
- this.open = false;
- this.clearTimer();
- typeof this.tmpConfig.complete === "function" && this.tmpConfig.complete();
- }, this.tmpConfig.duration);
- }
- },
- // 关闭notify
- close() {
- this.clearTimer();
- },
- clearTimer() {
- this.open = false;
- clearTimeout(this.timer);
- this.timer = null;
- }
- },
- beforeUnmount() {
- this.clearTimer();
- }
- };
- function _sfc_render$Z(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_status_bar = resolveEasycom(vue.resolveDynamicComponent("u-status-bar"), __easycom_0$c);
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_2$1);
- return vue.openBlock(), vue.createBlock(_component_u_transition, {
- mode: "slide-down",
- customStyle: $options.containerStyle,
- show: $data.open
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-notify", [`u-notify--${$data.tmpConfig.type}`]]),
- style: vue.normalizeStyle([$options.backgroundColor, $options.addStyle(_ctx.customStyle)])
- },
- [
- $data.tmpConfig.safeAreaInsetTop ? (vue.openBlock(), vue.createBlock(_component_u_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "u-notify__warpper" }, [
- vue.renderSlot(_ctx.$slots, "icon", {}, () => [
- ["success", "warning", "error"].includes($data.tmpConfig.type) ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: $data.tmpConfig.icon,
- color: $data.tmpConfig.color,
- size: 1.3 * $data.tmpConfig.fontSize,
- customStyle: { marginRight: "4px" }
- }, null, 8, ["name", "color", "size"])) : vue.createCommentVNode("v-if", true)
- ], true),
- vue.createElementVNode(
- "text",
- {
- class: "u-notify__warpper__text",
- style: vue.normalizeStyle({
- fontSize: $options.addUnit($data.tmpConfig.fontSize),
- color: $data.tmpConfig.color
- })
- },
- vue.toDisplayString($data.tmpConfig.message),
- 5
- /* TEXT, STYLE */
- )
- ])
- ],
- 6
- /* CLASS, STYLE */
- )
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["customStyle", "show"]);
- }
- const uNotify = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$Z], ["__scopeId", "data-v-67836363"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-notify/u-notify.vue"]]);
- const __vite_glob_0_69 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uNotify
- }, Symbol.toStringTag, { value: "Module" }));
- const props$x = defineMixin({
- props: {
- // 步进器标识符,在change回调返回
- name: {
- type: [String, Number],
- default: () => props$1x.numberBox.name
- },
- // 用于双向绑定的值,初始化时设置设为默认min值(最小值)
- modelValue: {
- type: [String, Number],
- default: () => props$1x.numberBox.value
- },
- // 最小值
- min: {
- type: [String, Number],
- default: () => props$1x.numberBox.min
- },
- // 最大值
- max: {
- type: [String, Number],
- default: () => props$1x.numberBox.max
- },
- // 加减的步长,可为小数
- step: {
- type: [String, Number],
- default: () => props$1x.numberBox.step
- },
- // 是否只允许输入整数
- integer: {
- type: Boolean,
- default: () => props$1x.numberBox.integer
- },
- // 是否禁用,包括输入框,加减按钮
- disabled: {
- type: Boolean,
- default: () => props$1x.numberBox.disabled
- },
- // 是否禁用输入框
- disabledInput: {
- type: Boolean,
- default: () => props$1x.numberBox.disabledInput
- },
- // 是否开启异步变更,开启后需要手动控制输入值
- asyncChange: {
- type: Boolean,
- default: () => props$1x.numberBox.asyncChange
- },
- // 输入框宽度,单位为px
- inputWidth: {
- type: [String, Number],
- default: () => props$1x.numberBox.inputWidth
- },
- // 是否显示减少按钮
- showMinus: {
- type: Boolean,
- default: () => props$1x.numberBox.showMinus
- },
- // 是否显示增加按钮
- showPlus: {
- type: Boolean,
- default: () => props$1x.numberBox.showPlus
- },
- // 显示的小数位数
- decimalLength: {
- type: [String, Number, null],
- default: () => props$1x.numberBox.decimalLength
- },
- // 是否开启长按加减手势
- longPress: {
- type: Boolean,
- default: () => props$1x.numberBox.longPress
- },
- // 输入框文字和加减按钮图标的颜色
- color: {
- type: String,
- default: () => props$1x.numberBox.color
- },
- // 按钮宽度
- buttonWidth: {
- type: [String, Number],
- default: () => props$1x.numberBox.buttonWidth
- },
- // 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致
- buttonSize: {
- type: [String, Number],
- default: () => props$1x.numberBox.buttonSize
- },
- // 按钮圆角
- buttonRadius: {
- type: [String],
- default: () => props$1x.numberBox.buttonRadius
- },
- // 输入框和按钮的背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.numberBox.bgColor
- },
- // 按钮禁用背景色
- disabledBgColor: {
- type: String,
- default: () => props$1x.numberBox.disabledBgColor
- },
- // 输入框背景颜色
- inputBgColor: {
- type: String,
- default: () => props$1x.numberBox.inputBgColor
- },
- // 指定光标于键盘的距离,避免键盘遮挡输入框,单位px
- cursorSpacing: {
- type: [String, Number],
- default: () => props$1x.numberBox.cursorSpacing
- },
- // 是否禁用增加按钮
- disablePlus: {
- type: Boolean,
- default: () => props$1x.numberBox.disablePlus
- },
- // 是否禁用减少按钮
- disableMinus: {
- type: Boolean,
- default: () => props$1x.numberBox.disableMinus
- },
- // 加减按钮图标的样式
- iconStyle: {
- type: [Object, String],
- default: () => props$1x.numberBox.iconStyle
- },
- // 迷你模式
- miniMode: {
- type: Boolean,
- default: () => props$1x.numberBox.miniMode
- }
- }
- });
- const _sfc_main$Z = {
- name: "u-number-box",
- mixins: [mpMixin, mixin, props$x],
- data() {
- return {
- // 输入框实际操作的值
- currentValue: "",
- // 定时器
- longPressTimer: null
- };
- },
- watch: {
- // 多个值之间,只要一个值发生变化,都要重新检查check()函数
- watchChange(n2) {
- this.check();
- },
- // 监听v-mode的变化,重新初始化内部的值
- modelValue: {
- handler: function(newV, oldV) {
- if (newV !== this.currentValue) {
- this.currentValue = this.format(this.modelValue);
- }
- },
- immediate: true
- }
- },
- computed: {
- hideMinus() {
- return this.currentValue == 0 && this.miniMode == true;
- },
- getCursorSpacing() {
- return getPx(this.cursorSpacing);
- },
- // 按钮的样式
- buttonStyle() {
- return (type2) => {
- const style = {
- backgroundColor: this.bgColor,
- width: addUnit(this.buttonWidth),
- height: addUnit(this.buttonSize),
- color: this.color,
- borderRadius: this.buttonRadius
- };
- if (this.isDisabled(type2)) {
- style.backgroundColor = this.disabledBgColor;
- }
- return style;
- };
- },
- // 输入框的样式
- inputStyle() {
- this.disabled || this.disabledInput;
- const style = {
- color: this.color,
- backgroundColor: this.inputBgColor || this.bgColor,
- height: addUnit(this.buttonSize),
- width: addUnit(this.inputWidth)
- };
- return style;
- },
- // 用于监听多个值发生变化
- watchChange() {
- return [this.integer, this.decimalLength, this.min, this.max];
- },
- isDisabled() {
- return (type2) => {
- if (type2 === "plus") {
- return this.disabled || this.disablePlus || this.currentValue >= this.max;
- }
- return this.disabled || this.disableMinus || this.currentValue <= this.min;
- };
- }
- },
- mounted() {
- this.init();
- },
- emits: ["update:modelValue", "focus", "blur", "overlimit", "change", "plus", "minus"],
- methods: {
- init() {
- this.currentValue = this.format(this.modelValue);
- },
- // 格式化整理数据,限制范围
- format(value2) {
- value2 = this.filter(value2);
- value2 = value2 === "" ? 0 : +value2;
- value2 = Math.max(Math.min(this.max, value2), this.min);
- if (this.decimalLength !== null) {
- value2 = value2.toFixed(this.decimalLength);
- }
- return value2;
- },
- // 过滤非法的字符
- filter(value2) {
- value2 = String(value2).replace(/[^0-9.-]/g, "");
- if (this.integer && value2.indexOf(".") !== -1) {
- value2 = value2.split(".")[0];
- }
- return value2;
- },
- check() {
- const val = this.format(this.currentValue);
- if (val !== this.currentValue) {
- this.currentValue = val;
- this.emitChange(val);
- }
- },
- // 判断是否出于禁止操作状态
- // isDisabled(type) {
- // if (type === 'plus') {
- // // 在点击增加按钮情况下,判断整体的disabled,是否单独禁用增加按钮,以及当前值是否大于最大的允许值
- // return (
- // this.disabled ||
- // this.disablePlus ||
- // this.currentValue >= this.max
- // )
- // }
- // // 点击减少按钮同理
- // return (
- // this.disabled ||
- // this.disableMinus ||
- // this.currentValue <= this.min
- // )
- // },
- // 输入框活动焦点
- onFocus(event) {
- this.$emit("focus", {
- ...event.detail,
- name: this.name
- });
- },
- // 输入框失去焦点
- onBlur(event) {
- this.format(event.detail.value);
- this.$emit(
- "blur",
- {
- ...event.detail,
- name: this.name
- }
- );
- },
- // 输入框值发生变化
- onInput(e2) {
- const {
- value: value2 = ""
- } = e2.detail || {};
- if (value2 === "") {
- this.emitChange(this.min);
- return;
- }
- let formatted = this.filter(value2);
- this.emitChange(value2);
- if (this.decimalLength !== null && formatted.indexOf(".") !== -1) {
- const pair = formatted.split(".");
- formatted = `${pair[0]}.${pair[1].slice(0, this.decimalLength)}`;
- }
- formatted = this.format(formatted);
- this.emitChange(formatted);
- },
- // 发出change事件,type目前只支持点击时有值,手动输入不支持。
- emitChange(value2, type2 = "") {
- if (!this.asyncChange) {
- this.$nextTick(() => {
- this.$emit("update:modelValue", value2);
- this.currentValue = value2;
- this.$forceUpdate();
- });
- }
- this.$emit("change", {
- value: value2,
- name: this.name,
- type: type2
- // 当前变更类型
- });
- },
- onChange() {
- const {
- type: type2
- } = this;
- if (this.isDisabled(type2)) {
- return this.$emit("overlimit", type2);
- }
- const diff = type2 === "minus" ? -this.step : +this.step;
- const value2 = this.format(this.add(+this.currentValue, diff));
- this.emitChange(value2, type2);
- this.$emit(type2);
- },
- // 对值扩大后进行四舍五入,再除以扩大因子,避免出现浮点数操作的精度问题
- add(num1, num2) {
- const cardinal = Math.pow(10, 10);
- return Math.round((num1 + num2) * cardinal) / cardinal;
- },
- // 点击加减按钮
- clickHandler(type2) {
- this.type = type2;
- this.onChange();
- },
- longPressStep() {
- this.clearTimeout();
- this.longPressTimer = setTimeout(() => {
- this.onChange();
- this.longPressStep();
- }, 250);
- },
- onTouchStart(type2) {
- if (!this.longPress)
- return;
- this.clearTimeout();
- this.type = type2;
- this.longPressTimer = setTimeout(() => {
- this.onChange();
- this.longPressStep();
- }, 600);
- },
- // 触摸结束,清除定时器,停止长按加减
- onTouchEnd() {
- if (!this.longPress)
- return;
- this.clearTimeout();
- },
- // 清除定时器
- clearTimeout() {
- clearTimeout(this.longPressTimer);
- this.longPressTimer = null;
- }
- }
- };
- function _sfc_render$Y(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-number-box" }, [
- _ctx.showMinus && !$options.hideMinus && _ctx.$slots.minus ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-number-box__slot cursor-pointer",
- onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => $options.clickHandler("minus"), ["stop"])),
- onTouchstart: _cache[1] || (_cache[1] = ($event) => $options.onTouchStart("minus")),
- onTouchend: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.clearTimeout && $options.clearTimeout(...args), ["stop"]))
- },
- [
- vue.renderSlot(_ctx.$slots, "minus", {}, void 0, true)
- ],
- 32
- /* NEED_HYDRATION */
- )) : _ctx.showMinus && !$options.hideMinus ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass(["u-number-box__minus cursor-pointer", { "u-number-box__minus--disabled": $options.isDisabled("minus") }]),
- onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => $options.clickHandler("minus"), ["stop"])),
- onTouchstart: _cache[4] || (_cache[4] = ($event) => $options.onTouchStart("minus")),
- onTouchend: _cache[5] || (_cache[5] = vue.withModifiers((...args) => $options.clearTimeout && $options.clearTimeout(...args), ["stop"])),
- "hover-class": "u-number-box__minus--hover",
- "hover-stay-time": "150",
- style: vue.normalizeStyle([$options.buttonStyle("minus")])
- },
- [
- vue.createVNode(_component_up_icon, {
- name: "minus",
- color: $options.isDisabled("minus") ? "#c8c9cc" : "#323233",
- size: "15",
- bold: "",
- customStyle: _ctx.iconStyle
- }, null, 8, ["color", "customStyle"])
- ],
- 38
- /* CLASS, STYLE, NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true),
- !$options.hideMinus ? vue.renderSlot(_ctx.$slots, "input", { key: 2 }, () => [
- vue.withDirectives(vue.createElementVNode("input", {
- disabled: _ctx.disabledInput || _ctx.disabled,
- "cursor-spacing": $options.getCursorSpacing,
- class: vue.normalizeClass([{ "u-number-box__input--disabled": _ctx.disabled || _ctx.disabledInput }, "u-number-box__input"]),
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.currentValue = $event),
- onBlur: _cache[7] || (_cache[7] = (...args) => $options.onBlur && $options.onBlur(...args)),
- onFocus: _cache[8] || (_cache[8] = (...args) => $options.onFocus && $options.onFocus(...args)),
- onInput: _cache[9] || (_cache[9] = (...args) => $options.onInput && $options.onInput(...args)),
- type: "number",
- style: vue.normalizeStyle([$options.inputStyle])
- }, null, 46, ["disabled", "cursor-spacing"]), [
- [vue.vModelText, $data.currentValue]
- ])
- ], true) : vue.createCommentVNode("v-if", true),
- _ctx.showPlus && _ctx.$slots.plus ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 3,
- class: "u-number-box__slot cursor-pointer",
- onClick: _cache[10] || (_cache[10] = vue.withModifiers(($event) => $options.clickHandler("plus"), ["stop"])),
- onTouchstart: _cache[11] || (_cache[11] = ($event) => $options.onTouchStart("plus")),
- onTouchend: _cache[12] || (_cache[12] = vue.withModifiers((...args) => $options.clearTimeout && $options.clearTimeout(...args), ["stop"]))
- },
- [
- vue.renderSlot(_ctx.$slots, "plus", {}, void 0, true)
- ],
- 32
- /* NEED_HYDRATION */
- )) : _ctx.showPlus ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 4,
- class: vue.normalizeClass(["u-number-box__plus cursor-pointer", { "u-number-box__minus--disabled": $options.isDisabled("plus") }]),
- onClick: _cache[13] || (_cache[13] = vue.withModifiers(($event) => $options.clickHandler("plus"), ["stop"])),
- onTouchstart: _cache[14] || (_cache[14] = ($event) => $options.onTouchStart("plus")),
- onTouchend: _cache[15] || (_cache[15] = vue.withModifiers((...args) => $options.clearTimeout && $options.clearTimeout(...args), ["stop"])),
- "hover-class": "u-number-box__plus--hover",
- "hover-stay-time": "150",
- style: vue.normalizeStyle([$options.buttonStyle("plus")])
- },
- [
- vue.createVNode(_component_up_icon, {
- name: "plus",
- color: $options.isDisabled("plus") ? "#c8c9cc" : "#323233",
- size: "15",
- bold: "",
- customStyle: _ctx.iconStyle
- }, null, 8, ["color", "customStyle"])
- ],
- 38
- /* CLASS, STYLE, NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const uNumberBox = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$Y], ["__scopeId", "data-v-eb6f6237"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-number-box/u-number-box.vue"]]);
- const __vite_glob_0_70 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uNumberBox
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$Y = {
- name: "u-pagination",
- props: {
- // 当前页码
- currentPage: {
- type: Number,
- default: 1
- },
- // 每页条目数
- pageSize: {
- type: Number,
- default: 10
- },
- // 总数据条目数
- total: {
- type: Number,
- default: 0
- },
- // 上一页按钮文案
- prevText: {
- type: String,
- default: ""
- },
- // 下一页按钮文案
- nextText: {
- type: String,
- default: ""
- },
- buttonBgColor: {
- type: String,
- default: "#f5f7fa"
- },
- buttonBorderColor: {
- type: String,
- default: "#dcdfe6"
- },
- // 可选的每页条目数
- pageSizes: {
- type: Array,
- default: () => [10, 20, 30, 40, 50]
- },
- // 布局方式(类似 el-pagination)
- layout: {
- type: String,
- default: "prev, pager, next"
- },
- // 是否隐藏只有一个页面时的分页控件
- hideOnSinglePage: {
- type: Boolean,
- default: false
- }
- },
- emits: ["update:currentPage", "update:pageSize", "current-change", "size-change"],
- data() {
- return {
- currentPageInput: this.currentPage + ""
- };
- },
- computed: {
- totalPages() {
- return Math.max(1, Math.ceil(this.total / this.pageSize));
- },
- pageSizeIndex() {
- const index2 = this.pageSizes.findIndex((size) => size.value === this.pageSize);
- return index2 >= 0 ? index2 : 0;
- },
- pageSizeLabel() {
- const found = this.pageSizes.find((size) => size.value === this.pageSize);
- return (found == null ? void 0 : found.label) || this.pageSize;
- },
- displayedPages() {
- const total = this.totalPages;
- const current = this.currentPage;
- if (total <= 4) {
- return Array.from({ length: total }, (_2, i2) => i2 + 1);
- }
- const pages2 = [];
- if (current <= 2) {
- for (let i2 = 1; i2 <= 4; i2++) {
- pages2.push(i2);
- }
- pages2.push("...");
- pages2.push(total);
- } else if (current >= total - 1) {
- pages2.push(1);
- pages2.push("...");
- for (let i2 = total - 3; i2 <= total; i2++) {
- pages2.push(i2);
- }
- } else {
- pages2.push(1);
- pages2.push("...");
- pages2.push(current - 1);
- pages2.push(current);
- pages2.push(current + 1);
- pages2.push("...");
- pages2.push(total);
- }
- return pages2;
- }
- // 控制是否隐藏
- },
- watch: {
- currentPage(val) {
- this.currentPageInput = val + "";
- }
- },
- methods: {
- t: t$1,
- handleSizeChange(e2) {
- var _a2;
- const selected = e2.detail.value;
- const size = ((_a2 = this.pageSizes[selected]) == null ? void 0 : _a2.value) || this.pageSizes[0].value;
- this.$emit("update:pageSize", size);
- this.$emit("size-change", size);
- },
- prev() {
- if (this.currentPage > 1) {
- this.goTo(this.currentPage - 1);
- }
- },
- next() {
- if (this.currentPage < this.totalPages) {
- this.goTo(this.currentPage + 1);
- }
- },
- goTo(page2) {
- if (page2 === "..." || page2 === this.currentPage)
- return;
- this.$emit("update:currentPage", page2);
- this.$emit("current-change", page2);
- },
- onInputPage(e2) {
- this.currentPageInput = e2.detail.value;
- },
- onConfirmPage(e2) {
- const num = parseInt(e2.detail.value);
- if (!isNaN(num) && num >= 1 && num <= this.totalPages) {
- this.goTo(num);
- }
- }
- }
- };
- function _sfc_render$X(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-pagination" }, [
- vue.createCommentVNode(" 上一页按钮 "),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([
- "u-pagination-btn",
- { disabled: $props.currentPage === 1 }
- ]),
- style: vue.normalizeStyle({ backgroundColor: $props.buttonBgColor, borderColor: $props.buttonBorderColor }),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.prev && $options.prev(...args))
- },
- [
- $props.prevText ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createTextVNode(
- vue.toDisplayString($props.prevText),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- name: "arrow-left"
- }))
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createCommentVNode(" 页码列表 "),
- $props.layout.includes("pager") ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList($options.displayedPages, (page2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: page2,
- class: vue.normalizeClass([
- "u-pagination-item",
- { active: page2 === $props.currentPage }
- ]),
- onClick: ($event) => $options.goTo(page2)
- }, vue.toDisplayString(page2), 11, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 总数显示 "),
- $props.total > 0 && $props.layout.includes("total") ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "u-pagination-total"
- },
- vue.toDisplayString($props.currentPage) + " / " + vue.toDisplayString($options.totalPages),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 每页数量选择器 "),
- vue.createCommentVNode(` <picker\r
- v-if="layout.includes('sizes')"\r
- mode="selector"\r
- :range="pageSizes"\r
- range-key="label"\r
- :value="pageSizeIndex"\r
- @change="handleSizeChange"\r
- class="u-pagination-sizes"\r
- >\r
- <view>{{ pageSizeLabel }}</view>\r
- </picker> `),
- vue.createCommentVNode(" 下一页按钮 "),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([
- "u-pagination-btn",
- { disabled: $props.currentPage === $options.totalPages }
- ]),
- style: vue.normalizeStyle({ backgroundColor: $props.buttonBgColor, borderColor: $props.buttonBorderColor }),
- onClick: _cache[1] || (_cache[1] = (...args) => $options.next && $options.next(...args))
- },
- [
- $props.nextText ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createTextVNode(
- vue.toDisplayString($props.nextText),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- name: "arrow-right"
- }))
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createCommentVNode(" 跳转输入框 "),
- vue.createCommentVNode(` <view v-if="layout.includes('jumper')">\r
- <text>前往</text>\r
- <input\r
- type="number"\r
- class="u-pagination-jumper"\r
- :value="currentPageInput"\r
- @input="onInputPage"\r
- @confirm="onConfirmPage"\r
- />\r
- <text>页</text>\r
- </view> `)
- ]);
- }
- const uPagination = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$X], ["__scopeId", "data-v-c04d6295"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-pagination/u-pagination.vue"]]);
- const __vite_glob_0_73 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uPagination
- }, Symbol.toStringTag, { value: "Module" }));
- const block0$2 = (Comp) => {
- (Comp.$wxs || (Comp.$wxs = [])).push("handler");
- (Comp.$wxsModules || (Comp.$wxsModules = {}))["handler"] = "155ce918";
- };
- const _sfc_main$X = {
- name: "node",
- options: {},
- data() {
- return {
- ctrl: {}
- };
- },
- props: {
- name: String,
- attrs: {
- type: Object,
- default() {
- return {};
- }
- },
- childs: Array,
- opts: Array
- },
- components: {},
- mounted() {
- this.$nextTick(() => {
- var _a2, _b;
- for (this.root = this == null ? void 0 : this.$parent; this.root && ((_a2 = this.root) == null ? void 0 : _a2.$options.name) !== "mp-html"; this.root = (_b = this.root) == null ? void 0 : _b.$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) {
- const i2 = e2.currentTarget.dataset.i;
- const node2 = this.childs[i2];
- this.root.$emit("play", {
- source: node2.name,
- attrs: {
- ...node2.attrs,
- src: node2.src[this.ctrl[i2] || 0]
- }
- });
- },
- /**
- * @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 && !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$W(_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: [{ attrs: { style: n2.attrs.style || "", src: n2.attrs.src }, name: "img" }],
- "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" : n2.m || "",
- "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 }, vue.toDisplayString("\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,
- "data-i": i2,
- onVplay: _cache[6] || (_cache[6] = vue.withModifiers((...args) => $options.play && $options.play(...args), ["stop"]))
- }, null, 46, ["id", "innerHTML", "data-i"])
- ],
- 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, x2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: x2,
- 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(" insert "),
- vue.createCommentVNode(" 富文本 "),
- vue.createElementVNode("rich-text", {
- id: n2.attrs.id,
- style: vue.normalizeStyle("display:inline;" + n2.f),
- 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$2 === "function")
- block0$2(_sfc_main$X);
- const node = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["render", _sfc_render$W], ["__scopeId", "data-v-1200d422"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-parse/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",
- foreignobject: "foreignObject"
- }
- };
- const tagSelector = {};
- let windowWidth;
- const systemInfo = uni.getSystemInfoSync();
- windowWidth = systemInfo.windowWidth;
- 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 domain2 = this.options.domain;
- if (url2[0] === "/") {
- if (url2[1] === "/") {
- url2 = (domain2 ? domain2.split("://")[0] : "http") + ":" + url2;
- } else if (domain2) {
- url2 = domain2 + url2;
- } else {
- url2 = plus.io.convertLocalFileSystemURL(url2);
- }
- } else if (!url2.includes("data:") && !url2.includes("://")) {
- if (domain2) {
- url2 = domain2 + "/" + 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 value2 = info.join(":").trim();
- if (value2[0] === "-" && value2.lastIndexOf("-") > 0 || value2.includes("safe")) {
- tmp += `;${key}:${value2}`;
- } else if (!styleObj[key] || value2.includes("import") || !styleObj[key].includes("import")) {
- if (value2.includes("url")) {
- let j2 = value2.indexOf("(") + 1;
- if (j2) {
- while (value2[j2] === '"' || value2[j2] === "'" || blankChar[value2[j2]]) {
- j2++;
- }
- value2 = value2.substr(0, j2) + this.getUrl(value2.substr(j2));
- }
- } else if (value2.includes("rpx")) {
- value2 = value2.replace(/[0-9.]+\s*rpx/g, ($2) => parseFloat($2) * windowWidth / 750 + "px");
- }
- styleObj[key] = value2;
- }
- }
- 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;
- config.ignoreTags.style = void 0;
- }
- };
- Parser.prototype.onAttrName = function(name2) {
- name2 = this.xml ? name2 : name2.toLowerCase();
- if (name2.includes("?") || name2.includes(";")) {
- this.attrName = void 0;
- return;
- }
- 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 parent = this.stack[this.stack.length - 1];
- const siblings = parent ? parent.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" && parent && (parent.name === "video" || parent.name === "audio") && attrs.src) {
- parent.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:") && this.options.previewImg !== "all" && !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("%") || parent && (parent.attrs.style || "").includes("height"))) {
- node2.h = "T";
- }
- if (node2.w && node2.h && styleObj["object-fit"]) {
- if (styleObj["object-fit"] === "contain") {
- node2.m = "aspectFit";
- } else if (styleObj["object-fit"] === "cover") {
- node2.m = "aspectFill";
- }
- }
- } 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 parent = this.stack[this.stack.length - 1];
- const siblings = parent ? parent.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;
- if (name2 === "foreignObject") {
- for (const child of node3.children || []) {
- if (child.attrs && !child.attrs.xmlns) {
- child.attrs.xmlns = "http://www.w3.org/1999/xhtml";
- break;
- }
- }
- }
- src += "<" + name2;
- for (const item in node3.attrs) {
- const val = node3.attrs[item];
- if (val) {
- src += ` ${config.svgDict[item] || item}="${val.replace(/"/g, "")}"`;
- }
- }
- 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;
- config.ignoreTags.style = true;
- 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 (styleObj["border-collapse"] === "collapse") {
- styleObj["border-collapse"] = void 0;
- spacing = 0;
- }
- 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 if (nodes[i2].name === "colgroup") {
- let colI = 1;
- for (const col of nodes[i2].children || []) {
- if (col.name === "col") {
- const style = col.attrs.style || "";
- const start = style.indexOf("width") ? style.indexOf(";width") : 0;
- if (start !== -1) {
- let end = style.indexOf(";", start + 6);
- if (end === -1) {
- end = style.length;
- }
- width[colI] = style.substring(start ? start + 7 : 6, end);
- }
- colI += 1;
- }
- }
- } 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 === "tbody" || node2.name === "tr") && node2.flag && node2.c) {
- node2.flag = void 0;
- (function traversal(nodes) {
- for (let i2 = 0; i2 < nodes.length; i2++) {
- if (nodes[i2].name === "td") {
- for (const style of ["color", "background", "background-color"]) {
- if (styleObj[style]) {
- nodes[i2].attrs.style = style + ":" + styleObj[style] + ";" + (nodes[i2].attrs.style || "");
- }
- }
- } else {
- traversal(nodes[i2].children || []);
- }
- }
- })(children);
- } 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].name === "tbody" || this.stack[i2].name === "tr") {
- this.stack[i2].flag = 1;
- }
- }
- } 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 = parent && ((parent.attrs.style || "").includes("flex") || (parent.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 parent = this.stack[this.stack.length - 1];
- if (parent && parent.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$W = {
- name: "u-parse",
- 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);
- }
- },
- beforeUnmount() {
- 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$V(_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 uParse = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$V], ["__scopeId", "data-v-cd79d006"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-parse/u-parse.vue"]]);
- const __vite_glob_0_74 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uParse
- }, Symbol.toStringTag, { value: "Module" }));
- const props$w = {
- props: {
- // PDF文件地址
- src: {
- type: String,
- default: ""
- },
- // 组件高度
- height: {
- type: String,
- default: "700px"
- },
- // pdfjs资源域名
- baseUrl: {
- type: String,
- default: "https://uview-plus.jiangruyi.com/h5"
- }
- }
- };
- const _sfc_main$V = {
- name: "up-pdf-reader",
- mixins: [props$w],
- data() {
- return {
- baseUrlInner: "https://uview-plus.jiangruyi.com/h5",
- viewerUrl: ""
- };
- },
- watch: {
- baseUrl: function(val) {
- this.baseUrl = val;
- },
- src: function(val) {
- this.viewerUrl = `${this.baseUrlInner}/static/pdfjs/web/viewer.html?file=` + encodeURIComponent(val);
- }
- },
- mounted() {
- if (this.baseUrl) {
- this.baseUrlInner = this.baseUrl;
- }
- this.viewerUrl = `${this.baseUrlInner}/static/pdfjs/web/viewer.html?file=` + encodeURIComponent(this.src);
- }
- };
- function _sfc_render$U(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "up-pdf-reader",
- style: vue.normalizeStyle({ height: _ctx.height })
- },
- [
- vue.createElementVNode("web-view", {
- fullscreen: false,
- src: $data.viewerUrl,
- style: vue.normalizeStyle({ width: "750rpx", height: _ctx.height }),
- "webview-styles": { width: "750rpx", height: _ctx.height },
- frameborder: "0"
- }, null, 12, ["src", "webview-styles"])
- ],
- 4
- /* STYLE */
- );
- }
- const uPdfReader = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$U], ["__scopeId", "data-v-2149504b"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-pdf-reader/u-pdf-reader.vue"]]);
- const __vite_glob_0_75 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uPdfReader
- }, Symbol.toStringTag, { value: "Module" }));
- const props$v = defineMixin({
- props: {}
- });
- const _sfc_main$U = {
- name: "u-picker-column",
- mixins: [mpMixin, mixin, props$v]
- };
- function _sfc_render$T(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("picker-view-column", null, [
- vue.createElementVNode("view", { class: "u-picker-column" })
- ]);
- }
- const uPickerColumn = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["render", _sfc_render$T], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-picker-column/u-picker-column.vue"]]);
- const __vite_glob_0_76 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uPickerColumn
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$T = {
- name: "u-picker-data",
- props: {
- modelValue: {
- type: [String, Number],
- default: ""
- },
- title: {
- type: String,
- default: ""
- },
- description: {
- type: String,
- default: ""
- },
- options: {
- type: Array,
- default: () => {
- return [];
- }
- },
- valueKey: {
- type: String,
- default: "id"
- },
- labelKey: {
- type: String,
- default: "name"
- }
- },
- data() {
- return {
- show: false,
- current: "",
- defaultIndex: []
- };
- },
- created() {
- if (this.modelValue) {
- this.options.forEach((ele, index2) => {
- if (ele[this.valueKey] == this.modelValue) {
- this.current = ele[this.labelKey];
- this.defaultIndex = [index2];
- }
- });
- }
- },
- watch: {
- modelValue() {
- if (this.modelValue) {
- this.options.forEach((ele, index2) => {
- if (ele[this.valueKey] == this.modelValue) {
- this.current = ele[this.labelKey];
- this.defaultIndex = [index2];
- }
- });
- }
- }
- },
- computed: {
- optionsInner() {
- return [this.options];
- }
- },
- emits: ["update:modelValue", "cancel", "close", "confirm"],
- methods: {
- hideKeyboard() {
- uni.hideKeyboard();
- },
- cancel() {
- this.show = false;
- this.$emit("cancel");
- },
- close() {
- this.$emit("close");
- },
- confirm(e2) {
- const {
- columnIndex,
- index: index2,
- value: value2
- } = e2;
- this.show = false;
- this.$emit("update:modelValue", value2[0][this.valueKey]);
- this.defaultIndex = columnIndex;
- this.current = value2[0][this.labelKey];
- this.$emit("confirm");
- }
- }
- };
- function _sfc_render$S(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_input = vue.resolveComponent("up-input");
- const _component_up_picker = vue.resolveComponent("up-picker");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-picker-data" }, [
- vue.createElementVNode("view", { class: "u-picker-data__trigger" }, [
- vue.renderSlot(_ctx.$slots, "trigger", { current: $data.current }, void 0, true),
- !_ctx.$slots["trigger"] ? (vue.openBlock(), vue.createBlock(_component_up_input, {
- key: 0,
- modelValue: $data.current,
- disabled: "",
- disabledColor: "#ffffff",
- placeholder: $props.title,
- border: "none"
- }, null, 8, ["modelValue", "placeholder"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", {
- onClick: _cache[0] || (_cache[0] = ($event) => $data.show = true),
- class: "u-picker-data__trigger__cover"
- })
- ]),
- vue.createVNode(_component_up_picker, {
- show: $data.show,
- columns: $options.optionsInner,
- keyName: $props.labelKey,
- defaultIndex: $data.defaultIndex,
- onConfirm: $options.confirm,
- onCancel: $options.cancel,
- onClose: $options.close
- }, null, 8, ["show", "columns", "keyName", "defaultIndex", "onConfirm", "onCancel", "onClose"])
- ]);
- }
- const uPickerData = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$S], ["__scopeId", "data-v-cdfa3c95"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-picker-data/u-picker-data.vue"]]);
- const __vite_glob_0_77 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uPickerData
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$S = {
- name: "up-poster",
- props: {
- json: {
- type: Object,
- default: () => ({})
- }
- },
- data() {
- return {
- canvasId: "u-poster-canvas-" + Date.now(),
- showCanvas: false,
- canvasWidth: 0,
- canvasHeight: 0,
- // 二维码相关数据
- qrCodeValue: "",
- qrCodeSize: 200,
- qrCodeShow: false,
- // 存储多个二维码的数据
- qrCodeMap: /* @__PURE__ */ new Map()
- };
- },
- computed: {
- // 根据传入的css生成文本样式
- getTextStyle() {
- return (css) => {
- const style = {};
- if (css.color)
- style.color = css.color;
- if (css.fontSize)
- style.fontSize = css.fontSize;
- if (css.fontWeight)
- style.fontWeight = css.fontWeight;
- if (css.lineHeight)
- style.lineHeight = css.lineHeight;
- if (css.textAlign)
- style.textAlign = css.textAlign;
- return style;
- };
- }
- },
- methods: {
- /**
- * 导出海报图片
- * @description 根据json配置生成海报并导出为临时图片路径
- * @returns {Promise<Object>} 返回包含图片信息的对象
- * @author jry ijry@qq.com
- */
- async exportImage() {
- return new Promise(async (resolve, reject) => {
- try {
- const posterSize = this.json.css;
- const width = this.convertRpxToPx(posterSize.width || "750rpx");
- const height = this.convertRpxToPx(posterSize.height || "1114rpx");
- this.canvasWidth = width;
- this.canvasHeight = height;
- this.showCanvas = true;
- await this.$nextTick();
- const ctx = uni.createCanvasContext(this.canvasId, this);
- if (posterSize.background) {
- if (posterSize.background.includes("linear-gradient") || posterSize.background.includes("radial-gradient")) {
- this.drawGradientBackground(ctx, posterSize, 0, 0, width, height);
- } else {
- ctx.setFillStyle(posterSize.background);
- ctx.fillRect(0, 0, width, height);
- }
- }
- for (const item of this.json.views) {
- await this.drawItem(ctx, item, width, height);
- }
- ctx.draw(false, () => {
- setTimeout(() => {
- uni.canvasToTempFilePath({
- canvasId: this.canvasId,
- success: (res) => {
- this.showCanvas = false;
- resolve({
- width,
- height,
- path: res.tempFilePath,
- // H5下添加blob格式
- blob: this.dataURLToBlob(res.tempFilePath)
- });
- },
- fail: (err) => {
- this.showCanvas = false;
- reject(new Error("导出图片失败: " + JSON.stringify(err)));
- }
- }, this);
- }, 300);
- });
- setTimeout(() => {
- this.showCanvas = false;
- reject(new Error("导出图片超时"));
- }, 1e4);
- } catch (error2) {
- this.showCanvas = false;
- reject(error2);
- }
- });
- },
- /**
- * 绘制单个元素
- * @description 根据元素类型绘制文本、图片、矩形或二维码到canvas
- * @param {Object} ctx canvas上下文
- * @param {Object} item 元素配置信息
- * @param {Number} canvasWidth canvas宽度
- * @param {Number} canvasHeight canvas高度
- * @returns {Promise} 绘制完成的Promise
- * @author jry ijry@qq.com
- */
- async drawItem(ctx, item, canvasWidth, canvasHeight) {
- const css = item.css || {};
- const left = this.convertRpxToPx(css.left || "0rpx");
- const top = this.convertRpxToPx(css.top || "0rpx");
- const width = this.convertRpxToPx(css.width || "0rpx");
- const height = this.convertRpxToPx(css.height || "0rpx");
- switch (item.type) {
- case "view":
- if (css.background) {
- if (css.background.includes("linear-gradient") || css.background.includes("radial-gradient")) {
- this.drawGradientBackground(ctx, css, left, top, width, height);
- } else {
- ctx.setFillStyle(css.background);
- if (css.radius) {
- const radius = this.convertRpxToPx(css.radius);
- this.drawRoundRect(ctx, left, top, width, height, radius, css.background);
- } else {
- ctx.fillRect(left, top, width, height);
- }
- }
- }
- break;
- case "text":
- if (css.color)
- ctx.setFillStyle(css.color);
- if (css.fontSize) {
- const fontSize = this.convertRpxToPx(css.fontSize);
- ctx.setFontSize(fontSize);
- }
- if (css.fontWeight) {
- ctx.setLineWidth(css.fontWeight === "bold" ? 2 : 1);
- }
- if (css.lineClamp) {
- this.drawTextWithLineClamp(ctx, item.text, left, top, width, css);
- } else {
- const textBaseLine = css.fontSize ? this.convertRpxToPx(css.fontSize) / 2 : 10;
- ctx.fillText(item.text, left, top + textBaseLine);
- }
- break;
- case "image":
- return new Promise((resolve) => {
- uni.getImageInfo({
- src: item.src,
- success: (res) => {
- if (css.radius) {
- const radius = this.convertRpxToPx(css.radius);
- this.clipRoundRect(ctx, left, top, width, height, radius);
- }
- ctx.drawImage(item.src, left, top, width, height);
- ctx.restore();
- resolve();
- },
- fail: () => {
- ctx.setFillStyle("#f5f5f5");
- ctx.fillRect(left, top, width, height);
- resolve();
- }
- });
- });
- case "qrcode":
- if (item.text) {
- const qrCodeImageUrl = await this.generateQRCode(item.text, width, height);
- return new Promise((resolve) => {
- uni.getImageInfo({
- src: qrCodeImageUrl,
- success: (res) => {
- ctx.drawImage(res.path, left, top, width, height);
- resolve();
- },
- fail: () => {
- ctx.setFillStyle("#f5f5f5");
- ctx.fillRect(left, top, width, height);
- ctx.setFillStyle("#999");
- ctx.setFontSize(12);
- ctx.setTextAlign("center");
- ctx.fillText("QR", left + width / 2, top + height / 2);
- ctx.setTextAlign("left");
- resolve();
- }
- });
- });
- } else {
- ctx.setFillStyle("#f5f5f5");
- ctx.fillRect(left, top, width, height);
- ctx.setFillStyle("#999");
- ctx.setFontSize(12);
- ctx.setTextAlign("center");
- ctx.fillText("QR", left + width / 2, top + height / 2);
- ctx.setTextAlign("left");
- }
- break;
- }
- },
- /**
- * 绘制圆角矩形
- * @description 绘制指定位置和尺寸的圆角矩形
- * @param {Object} ctx canvas上下文
- * @param {Number} x x坐标
- * @param {Number} y y坐标
- * @param {Number} width 宽度
- * @param {Number} height 高度
- * @param {Number} radius 圆角半径
- * @param {String} fillColor 填充颜色
- * @author jry ijry@qq.com
- */
- drawRoundRect(ctx, x2, y2, width, height, radius, fillColor) {
- ctx.save();
- ctx.beginPath();
- ctx.moveTo(x2 + radius, y2);
- ctx.lineTo(x2 + width - radius, y2);
- ctx.quadraticCurveTo(x2 + width, y2, x2 + width, y2 + radius);
- ctx.lineTo(x2 + width, y2 + height - radius);
- ctx.quadraticCurveTo(x2 + width, y2 + height, x2 + width - radius, y2 + height);
- ctx.lineTo(x2 + radius, y2 + height);
- ctx.quadraticCurveTo(x2, y2 + height, x2, y2 + height - radius);
- ctx.lineTo(x2, y2 + radius);
- ctx.quadraticCurveTo(x2, y2, x2 + radius, y2);
- ctx.closePath();
- if (fillColor) {
- ctx.setFillStyle(fillColor);
- ctx.fill();
- }
- ctx.restore();
- },
- /**
- * 裁剪圆角矩形区域
- * @description 在canvas上创建圆角矩形裁剪区域
- * @param {Object} ctx canvas上下文
- * @param {Number} x x坐标
- * @param {Number} y y坐标
- * @param {Number} width 宽度
- * @param {Number} height 高度
- * @param {Number} radius 圆角半径
- * @author jry ijry@qq.com
- */
- clipRoundRect(ctx, x2, y2, width, height, radius) {
- ctx.save();
- ctx.beginPath();
- ctx.arc(x2 + radius, y2 + radius, radius, Math.PI, Math.PI * 1.5);
- ctx.lineTo(x2 + width - radius, y2);
- ctx.arc(x2 + width - radius, y2 + radius, radius, Math.PI * 1.5, Math.PI * 2);
- ctx.lineTo(x2 + width, y2 + height - radius);
- ctx.arc(x2 + width - radius, y2 + height - radius, radius, 0, Math.PI * 0.5);
- ctx.lineTo(x2 + radius, y2 + height);
- ctx.arc(x2 + radius, y2 + height - radius, radius, Math.PI * 0.5, Math.PI);
- ctx.closePath();
- ctx.clip();
- },
- /**
- * 绘制带行数限制的文本
- * @description 绘制可控制最大行数的文本,超出部分显示省略号
- * @param {Object} ctx canvas上下文
- * @param {String} text 文本内容
- * @param {Number} x x坐标
- * @param {Number} y y坐标
- * @param {Number} maxWidth 最大宽度
- * @param {Object} css 样式配置
- * @author jry ijry@qq.com
- */
- drawTextWithLineClamp(ctx, text, x2, y2, maxWidth, css) {
- const lineClamp = parseInt(css.lineClamp) || 1;
- const lineHeight = css.lineHeight ? this.convertRpxToPx(css.lineHeight) : 20;
- const lines = [];
- let currentLine = "";
- for (let i2 = 0; i2 < text.length; i2++) {
- const char = text[i2];
- const testLine = currentLine + char;
- const metrics = ctx.measureText(testLine);
- if (metrics.width > maxWidth && currentLine !== "") {
- lines.push(currentLine);
- currentLine = char;
- if (lines.length === lineClamp) {
- if (metrics.width > maxWidth) {
- let fitLine = currentLine.substring(0, currentLine.length - 1);
- while (ctx.measureText(fitLine + "...").width > maxWidth && fitLine.length > 0) {
- fitLine = fitLine.substring(0, fitLine.length - 1);
- }
- lines[lines.length - 1] = fitLine + "...";
- }
- break;
- }
- } else {
- currentLine = testLine;
- }
- if (i2 === text.length - 1 && lines.length < lineClamp) {
- lines.push(currentLine);
- }
- }
- for (let i2 = 0; i2 < lines.length; i2++) {
- const textBaseLine = css.fontSize ? this.convertRpxToPx(css.fontSize) / 2 : 10;
- ctx.fillText(lines[i2], x2, y2 + i2 * lineHeight + textBaseLine);
- }
- },
- /**
- * 生成二维码图片
- * @description 根据文本内容生成二维码图片URL
- * @param {String} text 二维码内容
- * @param {Number} width 二维码宽度
- * @param {Number} height 二维码高度
- * @returns {Promise<String>} 二维码图片URL
- * @author jry ijry@qq.com
- */
- generateQRCode(text, width, height) {
- return new Promise((resolve) => {
- const qrCodeKey = `${text}_${width}_${height}`;
- if (this.qrCodeMap.has(qrCodeKey)) {
- resolve(this.qrCodeMap.get(qrCodeKey));
- return;
- }
- try {
- this.qrCodeValue = text;
- this.qrCodeSize = Math.max(width, height);
- this.qrCodeShow = true;
- this.$nextTick(() => {
- if (this.$refs.qrCode) {
- setTimeout(() => {
- this.$refs.qrCode.toTempFilePath({
- success: (res) => {
- this.qrCodeMap.set(qrCodeKey, res.tempFilePath);
- this.qrCodeShow = false;
- resolve(res.tempFilePath);
- },
- fail: (err) => {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-poster/u-poster.vue:437", "二维码生成失败:", err);
- this.qrCodeShow = false;
- }
- });
- }, 300);
- } else {
- this.qrCodeShow = false;
- }
- });
- } catch (error2) {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-poster/u-poster.vue:448", "生成二维码出错:", error2);
- this.qrCodeShow = false;
- }
- });
- },
- /**
- * 将rpx单位转换为px
- * @description 根据屏幕密度将rpx单位转换为px单位
- * @param {String|Number} rpxValue rpx值
- * @returns {Number} 转换后的px值
- * @author jry ijry@qq.com
- */
- convertRpxToPx(rpxValue) {
- if (typeof rpxValue === "number")
- return rpxValue;
- if (typeof rpxValue === "string" && rpxValue.endsWith("rpx")) {
- const value2 = parseFloat(rpxValue);
- return uni.rpx2px(value2);
- }
- return parseFloat(rpxValue) || 0;
- },
- /**
- * 绘制渐变背景
- * @description 绘制线性渐变或径向渐变背景
- * @param {Object} ctx canvas上下文
- * @param {Object} css 样式配置
- * @param {Number} left 左边距
- * @param {Number} top 上边距
- * @param {Number} width 宽度
- * @param {Number} height 高度
- * @author jry ijry@qq.com
- */
- drawGradientBackground(ctx, css, left, top, width, height) {
- const background = css.background;
- let gradient = null;
- if (background.includes("linear-gradient")) {
- const angleMatch = background.match(/linear-gradient\((\d+)deg/);
- const angle = angleMatch ? parseInt(angleMatch[1]) : 135;
- let startX = left, startY = top, endX = left + width, endY = top + height;
- if (angle === 0) {
- startX = left;
- startY = top + height;
- endX = left;
- endY = top;
- } else if (angle === 90) {
- startX = left;
- startY = top;
- endX = left + width;
- endY = top;
- } else if (angle === 180) {
- startX = left;
- startY = top;
- endX = left;
- endY = top + height;
- } else if (angle === 270) {
- startX = left + width;
- startY = top;
- endX = left;
- endY = top;
- }
- gradient = ctx.createLinearGradient(startX, startY, endX, endY);
- const colorMatches = background.match(/#[0-9a-fA-F]+|rgba?\([^)]+\)/g);
- if (colorMatches && colorMatches.length >= 2) {
- colorMatches.forEach((color2, index2) => {
- const stop = index2 / (colorMatches.length - 1);
- gradient.addColorStop(stop, color2);
- });
- }
- } else if (background.includes("radial-gradient")) {
- const centerX = left + width / 2;
- const centerY = top + height / 2;
- const radius = Math.min(width, height) / 2;
- gradient = ctx.createRadialGradient(centerX, centerY, 0, centerX, centerY, radius);
- const colorMatches = background.match(/#[0-9a-fA-F]+|rgba?\([^)]+\)/g);
- if (colorMatches && colorMatches.length >= 2) {
- colorMatches.forEach((color2, index2) => {
- const stop = index2 / (colorMatches.length - 1);
- gradient.addColorStop(stop, color2);
- });
- }
- }
- if (gradient) {
- ctx.setFillStyle(gradient);
- if (css.radius) {
- const radius = this.convertRpxToPx(css.radius);
- this.drawRoundRect(ctx, left, top, width, height, radius, gradient);
- } else {
- ctx.fillRect(left, top, width, height);
- }
- }
- },
- /**
- * 将dataURL转换为Blob
- * @description H5环境下将base64格式的dataURL转换为Blob对象
- * @param {String} dataURL base64格式的图片数据
- * @returns {Blob} Blob对象
- * @author jry ijry@qq.com
- */
- dataURLToBlob(dataURL) {
- return null;
- }
- }
- };
- function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_qrcode = vue.resolveComponent("up-qrcode");
- return vue.openBlock(), vue.createElementBlock("view", { class: "up-poster" }, [
- vue.createCommentVNode(" canvas用于绘制海报 "),
- $data.showCanvas ? (vue.openBlock(), vue.createElementBlock("canvas", {
- key: 0,
- class: "up-poster__hidden-canvas",
- "canvas-id": $data.canvasId,
- id: $data.canvasId,
- style: vue.normalizeStyle({ width: $data.canvasWidth + "px", height: $data.canvasHeight + "px" })
- }, null, 12, ["canvas-id", "id"])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 隐藏的二维码组件,用于生成二维码图片 "),
- vue.createVNode(_component_up_qrcode, {
- ref: "qrCode",
- val: $data.qrCodeValue,
- size: $data.qrCodeSize,
- margin: 0,
- loadMake: false,
- background: "#ffffff",
- foreground: "#000000",
- class: vue.normalizeClass(["up-poster__hidden-qrcode", $data.qrCodeShow ? "" : "up-poster__hidden-qrcode--hidden"])
- }, null, 8, ["val", "size", "class"])
- ]);
- }
- const uPoster = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$R], ["__scopeId", "data-v-79cfe3ab"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-poster/u-poster.vue"]]);
- const __vite_glob_0_80 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uPoster
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$R = {
- name: "u-pull-refresh",
- props: {
- // 是否正在刷新
- refreshing: {
- type: Boolean,
- default: false
- },
- // 下拉刷新阈值
- threshold: {
- type: Number,
- default: 80
- },
- // 阻尼系数
- damping: {
- type: Number,
- default: 0.4
- },
- // 最大下拉距离
- maxDistance: {
- type: Number,
- default: 120
- },
- // 是否显示加载更多
- showLoadmore: {
- type: Boolean,
- default: false
- },
- // u-loadmore 组件的 props 配置
- loadmoreProps: {
- type: Object,
- default: () => ({
- status: "loadmore"
- // loadmoreText: '加载更多',
- // loadingText: '正在加载...',
- // nomoreText: '没有更多了'
- })
- },
- // 是否使用 scroll-view 包装内容
- useScrollView: {
- type: Boolean,
- default: true
- },
- // scroll-view 相关属性
- enableBackToTop: {
- type: Boolean,
- default: false
- },
- lowerThreshold: {
- type: [Number, String],
- default: 50
- },
- scrollTop: {
- type: [Number, String],
- default: 0
- }
- },
- data() {
- return {
- // 下拉刷新相关
- isRefreshing: false,
- refreshStatus: "pull",
- // pull, release, refreshing
- refreshDistance: 0,
- startY: 0,
- currentY: 0,
- touching: false,
- // 动画相关
- contentTranslateY: 0
- };
- },
- emits: ["refresh", "loadmore", "scroll"],
- watch: {
- refreshing: {
- handler(newVal) {
- if (!newVal) {
- this.finishRefresh();
- } else {
- this.startRefresh();
- }
- }
- }
- },
- methods: {
- t: t$1,
- // 触摸开始
- onTouchStart(e2) {
- if (this.isRefreshing)
- return;
- this.touching = true;
- this.startY = e2.touches[0].pageY;
- this.currentY = this.startY;
- this.refreshStatus = "pull";
- },
- // 触摸移动
- onTouchMove(e2) {
- if (!this.touching || this.isRefreshing)
- return;
- this.currentY = e2.touches[0].pageY;
- const diff = this.currentY - this.startY;
- if (diff > 0 && this.isScrollViewAtTop()) {
- this.refreshDistance = Math.min(diff * this.damping, this.maxDistance);
- this.contentTranslateY = this.refreshDistance;
- if (this.refreshDistance >= this.threshold) {
- this.refreshStatus = "release";
- } else {
- this.refreshStatus = "pull";
- }
- e2.preventDefault();
- e2.stopPropagation();
- }
- },
- // 触摸结束
- onTouchEnd() {
- if (!this.touching)
- return;
- this.touching = false;
- if (this.refreshDistance >= this.threshold && !this.isRefreshing) {
- this.startRefresh();
- this.$emit("refresh");
- } else {
- this.resetRefresh();
- }
- },
- // 开始刷新
- startRefresh() {
- this.isRefreshing = true;
- this.refreshStatus = "refreshing";
- this.refreshDistance = this.threshold;
- this.contentTranslateY = this.threshold;
- },
- // 完成刷新
- finishRefresh() {
- this.isRefreshing = false;
- this.refreshStatus = "pull";
- this.resetRefresh();
- },
- // 重置刷新状态
- resetRefresh() {
- this.refreshDistance = 0;
- this.contentTranslateY = 0;
- },
- // 检查 scroll-view 是否在顶部
- isScrollViewAtTop() {
- return true;
- },
- // 处理滚动事件
- handleScroll(e2) {
- this.$emit("scroll", e2);
- },
- // 处理滚动到底部事件
- handleScrollToLower(e2) {
- if (this.showLoadmore && this.loadmoreProps.status === "loadmore") {
- this.$emit("loadmore");
- }
- }
- }
- };
- function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_loadmore = resolveEasycom(vue.resolveDynamicComponent("u-loadmore"), __easycom_0$1);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-pull-refresh",
- onTouchstart: _cache[2] || (_cache[2] = (...args) => $options.onTouchStart && $options.onTouchStart(...args)),
- onTouchmove: _cache[3] || (_cache[3] = (...args) => $options.onTouchMove && $options.onTouchMove(...args)),
- onTouchend: _cache[4] || (_cache[4] = (...args) => $options.onTouchEnd && $options.onTouchEnd(...args)),
- onTouchcancel: _cache[5] || (_cache[5] = (...args) => $options.onTouchEnd && $options.onTouchEnd(...args))
- },
- [
- vue.createCommentVNode(" 下拉刷新区域 "),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["refresh-area", { refreshing: $data.isRefreshing }]),
- style: vue.normalizeStyle({ height: $data.refreshDistance + "px" })
- },
- [
- vue.createCommentVNode(" 不同状态的插槽 "),
- $data.refreshStatus === "pull" ? vue.renderSlot(_ctx.$slots, "pull", {
- key: 0,
- distance: $data.refreshDistance,
- threshold: $props.threshold
- }, () => [
- vue.createCommentVNode(" 默认下拉状态 "),
- vue.createElementVNode("view", { class: "refresh-content" }, [
- vue.createElementVNode("view", { class: "refresh-indicator" }, [
- vue.createVNode(_component_up_icon, {
- name: "arrow-downward",
- size: "26px"
- })
- ]),
- vue.createElementVNode(
- "text",
- { class: "refresh-text" },
- vue.toDisplayString($options.t("up.pullRefresh.pull")),
- 1
- /* TEXT */
- )
- ])
- ], true) : $data.refreshStatus === "release" ? vue.renderSlot(_ctx.$slots, "release", {
- key: 1,
- distance: $data.refreshDistance,
- threshold: $props.threshold
- }, () => [
- vue.createCommentVNode(" 默认释放状态 "),
- vue.createElementVNode("view", { class: "refresh-content" }, [
- vue.createElementVNode("view", { class: "refresh-indicator" }, [
- vue.createVNode(_component_up_icon, {
- name: "arrow-upward",
- size: "26px"
- })
- ]),
- vue.createElementVNode(
- "text",
- { class: "refresh-text" },
- vue.toDisplayString($options.t("up.pullRefresh.release")),
- 1
- /* TEXT */
- )
- ])
- ], true) : $data.refreshStatus === "refreshing" ? vue.renderSlot(_ctx.$slots, "refreshing", { key: 2 }, () => [
- vue.createCommentVNode(" 默认刷新中状态 "),
- vue.createElementVNode("view", { class: "refresh-content" }, [
- vue.createElementVNode("view", { class: "refresh-indicator" }, [
- vue.createElementVNode("view", { class: "spinner" })
- ]),
- vue.createElementVNode(
- "text",
- { class: "refresh-text" },
- vue.toDisplayString($options.t("up.pullRefresh.refreshing")) + "...",
- 1
- /* TEXT */
- )
- ])
- ], true) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createCommentVNode(" 内容区域 "),
- vue.createElementVNode(
- "view",
- {
- class: "refresh-content-wrapper",
- style: vue.normalizeStyle({ transform: `translateY(${$data.contentTranslateY}px)` })
- },
- [
- $props.useScrollView ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
- key: 0,
- class: "scroll-wrapper",
- "scroll-y": true,
- "enable-back-to-top": $props.enableBackToTop,
- "scroll-top": $props.scrollTop,
- "lower-threshold": $props.lowerThreshold,
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.handleScroll && $options.handleScroll(...args)),
- onScrolltolower: _cache[1] || (_cache[1] = (...args) => $options.handleScrollToLower && $options.handleScrollToLower(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- vue.createCommentVNode(" 使用 u-loadmore 组件实现上拉加载更多 "),
- $props.showLoadmore ? (vue.openBlock(), vue.createBlock(
- _component_u_loadmore,
- vue.normalizeProps(vue.mergeProps({ key: 0 }, $props.loadmoreProps)),
- null,
- 16
- /* FULL_PROPS */
- )) : vue.createCommentVNode("v-if", true)
- ], 40, ["enable-back-to-top", "scroll-top", "lower-threshold"])) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- vue.createCommentVNode(" 使用 u-loadmore 组件实现上拉加载更多 "),
- $props.showLoadmore ? (vue.openBlock(), vue.createBlock(
- _component_u_loadmore,
- vue.normalizeProps(vue.mergeProps({ key: 0 }, $props.loadmoreProps)),
- null,
- 16
- /* FULL_PROPS */
- )) : vue.createCommentVNode("v-if", true)
- ]))
- ],
- 4
- /* STYLE */
- )
- ],
- 32
- /* NEED_HYDRATION */
- );
- }
- const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$Q], ["__scopeId", "data-v-34a6b4c5"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-pull-refresh/u-pull-refresh.vue"]]);
- const __vite_glob_0_81 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_1
- }, Symbol.toStringTag, { value: "Module" }));
- let QRCode = {};
- (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(string2) {
- var utf8codes = [];
- for (var i3 = 0; i3 < string2.length; i3++) {
- var code2 = string2.charCodeAt(i3);
- var utf8 = unicodeFormat8(code2);
- for (var j2 = 0; j2 < utf8.length; j2++) {
- utf8codes.push(utf8[j2]);
- }
- }
- return utf8codes;
- }
- function QRCodeAlg(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();
- }
- QRCodeAlg.prototype = {
- constructor: QRCodeAlg,
- /**
- * 获取二维码矩阵大小
- * @return {num} 矩阵大小
- */
- getModuleCount: function() {
- return this.moduleCount;
- },
- /**
- * 编码
- */
- make: function() {
- this.getRightType();
- this.dataCache = this.createData();
- this.createQrcode();
- },
- /**
- * 设置二位矩阵功能图形
- * @param {bool} test 表示是否在寻找最好掩膜阶段
- * @param {num} maskPattern 掩膜的版本
- */
- 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);
- },
- /**
- * 设置二维码的位置探测图形
- * @param {num} row 探测图形的中心横坐标
- * @param {num} col 探测图形的中心纵坐标
- */
- 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;
- }
- }
- }
- },
- /**
- * 创建二维码
- * @return {[type]} [description]
- */
- 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);
- }
- },
- /**
- * 设置定位图形
- * @return {[type]} [description]
- */
- 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;
- }
- },
- /**
- * 设置矫正图形
- * @return {[type]} [description]
- */
- 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;
- }
- }
- }
- }
- }
- },
- /**
- * 设置版本信息(7以上版本才有)
- * @param {bool} test 是否处于判断最佳掩膜阶段
- * @return {[type]} [description]
- */
- 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;
- }
- },
- /**
- * 设置格式信息(纠错等级和掩膜版本)
- * @param {bool} test
- * @param {num} maskPattern 掩膜版本
- * @return {}
- */
- 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;
- },
- /**
- * 数据编码
- * @return {[type]} [description]
- */
- 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(QRCodeAlg.PAD0, 8);
- if (buffer.length >= this.totalDataCount * 8) {
- break;
- }
- buffer.put(QRCodeAlg.PAD1, 8);
- }
- return this.createBytes(buffer);
- },
- /**
- * 纠错码编码
- * @param {buffer} buffer 数据编码
- * @return {[type]}
- */
- 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;
- },
- /**
- * 布置模块,构建最终信息
- * @param {} data
- * @param {} maskPattern
- * @return {}
- */
- 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;
- }
- }
- }
- }
- };
- QRCodeAlg.PAD0 = 236;
- QRCodeAlg.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,
- /*
- BCH编码格式信息
- */
- 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;
- },
- /*
- BCH编码版本信息
- */
- 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;
- },
- /*
- 获取BCH位信息
- */
- 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);
- }
- },
- /*
- 获取RS的纠错多项式
- */
- 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 = {
- /*
- 将n转化为a^m
- */
- glog: function(n2) {
- if (n2 < 1) {
- throw new Error("glog(" + n2 + ")");
- }
- return QRMath.LOG_TABLE[n2];
- },
- /*
- 将a^m转化为n
- */
- 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;
- },
- /**
- * 多项式乘法
- * @param {QRPolynomial} e 被乘多项式
- * @return {[type]} [description]
- */
- 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);
- },
- /**
- * 多项式模运算
- * @param {QRPolynomial} e 模多项式
- * @return {}
- */
- 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 = [
- // L
- // M
- // Q
- // H
- // 1
- [1, 26, 19],
- [1, 26, 16],
- [1, 26, 13],
- [1, 26, 9],
- // 2
- [1, 44, 34],
- [1, 44, 28],
- [1, 44, 22],
- [1, 44, 16],
- // 3
- [1, 70, 55],
- [1, 70, 44],
- [2, 35, 17],
- [2, 35, 13],
- // 4
- [1, 100, 80],
- [2, 50, 32],
- [2, 50, 24],
- [4, 25, 9],
- // 5
- [1, 134, 108],
- [2, 67, 43],
- [2, 33, 15, 2, 34, 16],
- [2, 33, 11, 2, 34, 12],
- // 6
- [2, 86, 68],
- [4, 43, 27],
- [4, 43, 19],
- [4, 43, 15],
- // 7
- [2, 98, 78],
- [4, 49, 31],
- [2, 32, 14, 4, 33, 15],
- [4, 39, 13, 1, 40, 14],
- // 8
- [2, 121, 97],
- [2, 60, 38, 2, 61, 39],
- [4, 40, 18, 2, 41, 19],
- [4, 40, 14, 2, 41, 15],
- // 9
- [2, 146, 116],
- [3, 58, 36, 2, 59, 37],
- [4, 36, 16, 4, 37, 17],
- [4, 36, 12, 4, 37, 13],
- // 10
- [2, 86, 68, 2, 87, 69],
- [4, 69, 43, 1, 70, 44],
- [6, 43, 19, 2, 44, 20],
- [6, 43, 15, 2, 44, 16],
- // 11
- [4, 101, 81],
- [1, 80, 50, 4, 81, 51],
- [4, 50, 22, 4, 51, 23],
- [3, 36, 12, 8, 37, 13],
- // 12
- [2, 116, 92, 2, 117, 93],
- [6, 58, 36, 2, 59, 37],
- [4, 46, 20, 6, 47, 21],
- [7, 42, 14, 4, 43, 15],
- // 13
- [4, 133, 107],
- [8, 59, 37, 1, 60, 38],
- [8, 44, 20, 4, 45, 21],
- [12, 33, 11, 4, 34, 12],
- // 14
- [3, 145, 115, 1, 146, 116],
- [4, 64, 40, 5, 65, 41],
- [11, 36, 16, 5, 37, 17],
- [11, 36, 12, 5, 37, 13],
- // 15
- [5, 109, 87, 1, 110, 88],
- [5, 65, 41, 5, 66, 42],
- [5, 54, 24, 7, 55, 25],
- [11, 36, 12],
- // 16
- [5, 122, 98, 1, 123, 99],
- [7, 73, 45, 3, 74, 46],
- [15, 43, 19, 2, 44, 20],
- [3, 45, 15, 13, 46, 16],
- // 17
- [1, 135, 107, 5, 136, 108],
- [10, 74, 46, 1, 75, 47],
- [1, 50, 22, 15, 51, 23],
- [2, 42, 14, 17, 43, 15],
- // 18
- [5, 150, 120, 1, 151, 121],
- [9, 69, 43, 4, 70, 44],
- [17, 50, 22, 1, 51, 23],
- [2, 42, 14, 19, 43, 15],
- // 19
- [3, 141, 113, 4, 142, 114],
- [3, 70, 44, 11, 71, 45],
- [17, 47, 21, 4, 48, 22],
- [9, 39, 13, 16, 40, 14],
- // 20
- [3, 135, 107, 5, 136, 108],
- [3, 67, 41, 13, 68, 42],
- [15, 54, 24, 5, 55, 25],
- [15, 43, 15, 10, 44, 16],
- // 21
- [4, 144, 116, 4, 145, 117],
- [17, 68, 42],
- [17, 50, 22, 6, 51, 23],
- [19, 46, 16, 6, 47, 17],
- // 22
- [2, 139, 111, 7, 140, 112],
- [17, 74, 46],
- [7, 54, 24, 16, 55, 25],
- [34, 37, 13],
- // 23
- [4, 151, 121, 5, 152, 122],
- [4, 75, 47, 14, 76, 48],
- [11, 54, 24, 14, 55, 25],
- [16, 45, 15, 14, 46, 16],
- // 24
- [6, 147, 117, 4, 148, 118],
- [6, 73, 45, 14, 74, 46],
- [11, 54, 24, 16, 55, 25],
- [30, 46, 16, 2, 47, 17],
- // 25
- [8, 132, 106, 4, 133, 107],
- [8, 75, 47, 13, 76, 48],
- [7, 54, 24, 22, 55, 25],
- [22, 45, 15, 13, 46, 16],
- // 26
- [10, 142, 114, 2, 143, 115],
- [19, 74, 46, 4, 75, 47],
- [28, 50, 22, 6, 51, 23],
- [33, 46, 16, 4, 47, 17],
- // 27
- [8, 152, 122, 4, 153, 123],
- [22, 73, 45, 3, 74, 46],
- [8, 53, 23, 26, 54, 24],
- [12, 45, 15, 28, 46, 16],
- // 28
- [3, 147, 117, 10, 148, 118],
- [3, 73, 45, 23, 74, 46],
- [4, 54, 24, 31, 55, 25],
- [11, 45, 15, 31, 46, 16],
- // 29
- [7, 146, 116, 7, 147, 117],
- [21, 73, 45, 7, 74, 46],
- [1, 53, 23, 37, 54, 24],
- [19, 45, 15, 26, 46, 16],
- // 30
- [5, 145, 115, 10, 146, 116],
- [19, 75, 47, 10, 76, 48],
- [15, 54, 24, 25, 55, 25],
- [23, 45, 15, 25, 46, 16],
- // 31
- [13, 145, 115, 3, 146, 116],
- [2, 74, 46, 29, 75, 47],
- [42, 54, 24, 1, 55, 25],
- [23, 45, 15, 28, 46, 16],
- // 32
- [17, 145, 115],
- [10, 74, 46, 23, 75, 47],
- [10, 54, 24, 35, 55, 25],
- [19, 45, 15, 35, 46, 16],
- // 33
- [17, 145, 115, 1, 146, 116],
- [14, 74, 46, 21, 75, 47],
- [29, 54, 24, 19, 55, 25],
- [11, 45, 15, 46, 46, 16],
- // 34
- [13, 145, 115, 6, 146, 116],
- [14, 74, 46, 23, 75, 47],
- [44, 54, 24, 7, 55, 25],
- [59, 46, 16, 1, 47, 17],
- // 35
- [12, 151, 121, 7, 152, 122],
- [12, 75, 47, 26, 76, 48],
- [39, 54, 24, 14, 55, 25],
- [22, 45, 15, 41, 46, 16],
- // 36
- [6, 151, 121, 14, 152, 122],
- [6, 75, 47, 34, 76, 48],
- [46, 54, 24, 10, 55, 25],
- [2, 45, 15, 64, 46, 16],
- // 37
- [17, 152, 122, 4, 153, 123],
- [29, 74, 46, 14, 75, 47],
- [49, 54, 24, 10, 55, 25],
- [24, 45, 15, 46, 46, 16],
- // 38
- [4, 152, 122, 18, 153, 123],
- [13, 74, 46, 32, 75, 47],
- [48, 54, 24, 14, 55, 25],
- [42, 45, 15, 32, 46, 16],
- // 39
- [20, 147, 117, 4, 148, 118],
- [40, 75, 47, 7, 76, 48],
- [43, 54, 24, 22, 55, 25],
- [10, 45, 15, 67, 46, 16],
- // 40
- [19, 148, 118, 6, 149, 119],
- [18, 75, 47, 31, 76, 48],
- [34, 54, 24, 34, 55, 25],
- [20, 45, 15, 61, 46, 16]
- ];
- QRCodeAlg.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++;
- }
- };
- let qrcodeAlgObjCache = [];
- QRCode = function(opt) {
- this.options = {
- text: "",
- size: 256,
- correctLevel: 3,
- background: "#ffffff",
- foreground: "#000000",
- pdground: "#000000",
- image: "",
- imageSize: 30,
- canvasId: opt.canvasId,
- nvueContext: opt.nvueContext,
- context: opt.context,
- usingComponents: opt.usingComponents,
- showLoading: opt.showLoading,
- loadingText: opt.loadingText
- };
- let canvas = null;
- if (typeof opt === "string") {
- opt = {
- text: opt
- };
- }
- if (opt) {
- for (var i3 in opt) {
- this.options[i3] = opt[i3];
- }
- }
- var qrCodeAlg = null;
- for (var i3 = 0, l2 = qrcodeAlgObjCache.length; i3 < l2; i3++) {
- if (qrcodeAlgObjCache[i3].text == this.options.text && qrcodeAlgObjCache[i3].text.correctLevel == this.options.correctLevel) {
- qrCodeAlg = qrcodeAlgObjCache[i3].obj;
- break;
- }
- }
- if (i3 == l2) {
- qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
- qrcodeAlgObjCache.push({
- text: this.options.text,
- correctLevel: this.options.correctLevel,
- obj: qrCodeAlg
- });
- }
- let getForeGround = function(config2) {
- var options2 = config2.options;
- if (options2.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 options2.pdground;
- }
- return options2.foreground;
- };
- let getCanvas = async (id) => {
- return new Promise((resolve, reject) => {
- try {
- const query = uni.createSelectorQuery().in(this.options.context);
- query.select(`#${id}`).fields({ node: true, size: true }).exec((res) => {
- resolve(res[0].node);
- });
- } catch (e2) {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-qrcode/qrcode.js:1101", "createCanvasContextFail", e2);
- }
- });
- };
- let createCanvas = async function(options2) {
- let isApp = false;
- isApp = true;
- if (options2.showLoading) {
- uni.showLoading({
- title: options2.loadingText,
- mask: true
- });
- }
- var ctx = "";
- if (options2.nvueContext) {
- ctx = options2.nvueContext;
- } else {
- canvas = await getCanvas(options2.canvasId);
- ctx = uni.createCanvasContext(options2.canvasId, options2.context);
- }
- options2.context.ctx = ctx;
- options2.context.canvas = canvas;
- var count = qrCodeAlg.getModuleCount();
- var ratioSize = options2.size;
- var ratioImgSize = options2.imageSize;
- var tileW = (ratioSize / count).toPrecision(4);
- var tileH = (ratioSize / count).toPrecision(4);
- for (var row = 0; row < count; row++) {
- for (var col = 0; col < count; col++) {
- var w2 = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW);
- var h2 = Math.ceil((row + 1) * tileH) - Math.floor(row * tileH);
- var foreground = getForeGround({
- row,
- col,
- count,
- options: options2
- });
- if (options2.nvueContext) {
- ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options2.background);
- } else {
- ctx.fillStyle = qrCodeAlg.modules[row][col] ? foreground : options2.background;
- }
- ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w2, h2);
- }
- }
- if (options2.image) {
- let drawRoundedRect = function(ctxi, x3, y3, width, height, r2, lineWidth, fill, stroke) {
- if (options2.nvueContext || isApp) {
- ctxi.setLineWidth(lineWidth);
- ctxi.setFillStyle(options2.background);
- ctxi.setStrokeStyle(options2.background);
- } else {
- ctxi.lineWidth = lineWidth;
- ctxi.fillStyle = options2.background;
- ctxi.strokeStyle = options2.background;
- }
- ctxi.beginPath();
- ctxi.moveTo(x3 + r2, y3);
- ctxi.lineTo(x3 + width, y3);
- ctxi.arc(x3 + width - r2, y3 + r2, r2, -Math.PI / 2, 0);
- ctxi.lineTo(x3 + width, y3 + height - r2);
- ctxi.arc(x3 + width - r2, y3 + height - r2, r2, 0, Math.PI / 2);
- ctxi.lineTo(x3 + r2, y3 + height);
- ctxi.arc(x3 + r2, y3 + height - r2, r2, Math.PI / 2, Math.PI);
- ctxi.lineTo(x3, y3 + r2);
- ctxi.arc(x3 + r2, y3 + r2, r2, Math.PI, Math.PI * 3 / 2);
- ctxi.closePath();
- if (fill) {
- ctxi.fill();
- }
- if (stroke) {
- ctxi.stroke();
- }
- };
- var x2 = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
- var y2 = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
- drawRoundedRect(ctx, x2, y2, ratioImgSize, ratioImgSize, 2, 6, true, true);
- if (options2.nvueContext) {
- ctx.drawImage(options2.image, x2, y2, ratioImgSize, ratioImgSize);
- } else {
- const img = new Image();
- img.onload = () => {
- ctx.drawImage(img, x2, y2, ratioImgSize, ratioImgSize);
- };
- img.src = options2.image;
- }
- }
- setTimeout(() => {
- if (options2.nvueContext || isApp) {
- ctx.draw(true, () => {
- setTimeout(() => {
- if (options2.nvueContext) {
- ctx.toTempFilePath(
- 0,
- 0,
- options2.width,
- options2.height,
- options2.width,
- options2.height,
- "",
- 1,
- function(res) {
- if (options2.cbResult) {
- options2.cbResult(res.tempFilePath);
- }
- }
- );
- } else {
- uni.canvasToTempFilePath({
- width: options2.width,
- height: options2.height,
- destWidth: options2.width,
- destHeight: options2.height,
- canvasId: options2.canvasId,
- quality: Number(1),
- success: function(res) {
- if (options2.cbResult) {
- if (!empty2(res.tempFilePath)) {
- options2.cbResult(res.tempFilePath);
- } else if (!empty2(res.apFilePath)) {
- options2.cbResult(res.apFilePath);
- } else {
- options2.cbResult(res.tempFilePath);
- }
- }
- },
- fail: function(res) {
- if (options2.cbResult) {
- options2.cbResult(res);
- }
- },
- complete: function() {
- uni.hideLoading();
- }
- }, options2.context);
- }
- }, options2.text.length + 100);
- });
- } else {
- options2.cbResult("");
- }
- }, options2.usingComponents ? 0 : 150);
- };
- createCanvas(this.options);
- let empty2 = function(v2) {
- let tp = typeof v2, rt = false;
- if (tp == "number" && String(v2) == "") {
- rt = true;
- } else if (tp == "undefined") {
- rt = true;
- } else if (tp == "object") {
- if (JSON.stringify(v2) == "{}" || JSON.stringify(v2) == "[]" || v2 == null)
- rt = true;
- } else if (tp == "string") {
- if (v2 == "" || v2 == "undefined" || v2 == "null" || v2 == "{}" || v2 == "[]")
- rt = true;
- } else if (tp == "function") {
- rt = false;
- }
- return rt;
- };
- };
- QRCode.prototype.clear = function(fn) {
- var ctx = "";
- if (options.nvueContext) {
- ctx = options.nvueContext;
- } else {
- uni.createCanvasContext(this.options.canvasId, this.options.context);
- }
- ctx.clearRect(0, 0, this.options.size, this.options.size);
- ctx.draw(false, () => {
- if (fn) {
- fn();
- }
- });
- };
- })();
- const QRCode$1 = QRCode;
- let qrcode;
- const _sfc_main$Q = {
- name: "u-qrcode",
- props: {
- cid: {
- type: String,
- default: () => `u-qrcode-canvas${Math.floor(Math.random() * 1e6)}`
- },
- size: {
- type: Number,
- default: 200
- },
- unit: {
- type: String,
- default: "px"
- },
- show: {
- type: Boolean,
- default: true
- },
- val: {
- type: String,
- default: ""
- },
- background: {
- type: String,
- default: "#ffffff"
- },
- foreground: {
- type: String,
- default: "#000000"
- },
- pdground: {
- type: String,
- default: "#000000"
- },
- icon: {
- type: String,
- default: ""
- },
- iconSize: {
- type: Number,
- default: 40
- },
- lv: {
- type: Number,
- default: 3
- },
- onval: {
- type: Boolean,
- default: true
- },
- loadMake: {
- type: Boolean,
- default: true
- },
- usingComponents: {
- type: Boolean,
- default: true
- },
- showLoading: {
- type: Boolean,
- default: true
- },
- loadingText: {
- type: String,
- default: "生成中"
- },
- allowPreview: {
- type: Boolean,
- default: false
- },
- // 是否使用根节点宽高
- useRootHeightAndWidth: {
- type: Boolean,
- default: () => false
- }
- },
- emits: ["result", "longpressCallback"],
- data() {
- return {
- loading: false,
- result: "",
- popupShow: false,
- list: [
- {
- name: "保存二维码"
- }
- ],
- rootId: `rootId${Number(Math.random() * 100).toFixed(0)}`,
- ganvas: null,
- context: "",
- canvasObj: {},
- sizeLocal: this.size,
- ctx: null,
- // ctx 在new Qrcode 时js文件内部设置
- canvas: null
- // ctx 在new Qrcode 时js文件内部设置
- };
- },
- async mounted() {
- if (this.useRootHeightAndWidth) {
- await this.setNewSize();
- }
- if (this.loadMake) {
- if (!this._empty(this.val)) {
- setTimeout(() => {
- setTimeout(() => {
- this._makeCode();
- });
- }, 0);
- }
- }
- },
- methods: {
- _makeCode() {
- let that2 = this;
- if (!this._empty(this.val)) {
- this.loading = true;
- qrcode = new QRCode$1({
- context: that2,
- // 上下文环境
- canvasId: that2.cid,
- // canvas-id
- nvueContext: that2.context,
- usingComponents: that2.usingComponents,
- // 是否是自定义组件
- showLoading: false,
- // 是否显示loading
- loadingText: that2.loadingText,
- // loading文字
- text: that2.val,
- // 生成内容
- size: that2.sizeLocal,
- // 二维码大小
- background: that2.background,
- // 背景色
- foreground: that2.foreground,
- // 前景色
- pdground: that2.pdground,
- // 定位角点颜色
- correctLevel: that2.lv,
- // 容错级别
- image: that2.icon,
- // 二维码图标
- imageSize: that2.iconSize,
- // 二维码图标大小
- cbResult: function(res) {
- that2._result(res);
- }
- });
- } else {
- uni.showToast({
- title: "二维码内容不能为空",
- icon: "none",
- duration: 2e3
- });
- }
- },
- _clearCode() {
- this._result("");
- qrcode.clear();
- },
- _saveCode() {
- let that2 = this;
- if (this.result != "") {
- uni.saveImageToPhotosAlbum({
- filePath: that2.result,
- success: function() {
- uni.showToast({
- title: "二维码保存成功",
- icon: "success",
- duration: 2e3
- });
- }
- });
- }
- },
- preview(e2) {
- if (this.allowPreview) {
- uni.previewImage({
- urls: [this.result],
- longPressActions: {
- itemList: ["保存二维码图片"],
- success: function(data) {
- switch (data.tapIndex) {
- case 0:
- that._saveCode();
- break;
- }
- },
- fail: function(err) {
- formatAppLog("log", "at uni_modules/uview-plus/components/u-qrcode/u-qrcode.vue:254", err.errMsg);
- }
- }
- });
- }
- this.$emit("preview", {
- url: this.result
- }, e2);
- },
- async toTempFilePath({ success, fail }) {
- if (this.context) {
- this.ctx.toTempFilePath(
- 0,
- 0,
- this.sizeLocal,
- this.sizeLocal,
- this.sizeLocal,
- this.sizeLocal,
- "",
- 1,
- (res) => {
- success(res);
- }
- );
- } else {
- uni.canvasToTempFilePath(
- {
- canvasId: this.cid,
- success: (res) => {
- success(res);
- },
- fail
- },
- this
- );
- }
- },
- async longpress() {
- this.toTempFilePath({
- success: (res) => {
- this.$emit("longpressCallback", res.tempFilePath);
- },
- fail: (err) => {
- }
- });
- },
- /**
- * 使用根节点宽高 设置新的size
- * @return {Promise<void>}
- */
- async setNewSize() {
- const rootNode = await this.getNode(this.rootId, false);
- const { width, height } = rootNode;
- if (width > height) {
- this.sizeLocal = height;
- } else {
- this.sizeLocal = width;
- }
- },
- /**
- * 获取节点
- * @param id 节点id
- * @param isCanvas 是否为Canvas节点
- * @return {Promise<unknown>}
- */
- async getNode(id, isCanvas) {
- return new Promise((resolve, reject) => {
- try {
- const query = uni.createSelectorQuery().in(this);
- query.select(`#${id}`).fields({ node: true, size: true }).exec((res) => {
- if (isCanvas) {
- resolve(res[0].node);
- } else {
- resolve(res[0]);
- }
- });
- } catch (e2) {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-qrcode/u-qrcode.vue:361", "获取节点失败", e2);
- }
- });
- },
- selectClick(index2) {
- switch (index2) {
- case 0:
- alert("保存二维码");
- this._saveCode();
- break;
- }
- },
- _result(res) {
- this.loading = false;
- this.result = res;
- this.$emit("result", res);
- },
- _empty(v2) {
- let tp = typeof v2, rt = false;
- if (tp == "number" && String(v2) == "") {
- rt = true;
- } else if (tp == "undefined") {
- rt = true;
- } else if (tp == "object") {
- if (JSON.stringify(v2) == "{}" || JSON.stringify(v2) == "[]" || v2 == null)
- rt = true;
- } else if (tp == "string") {
- if (v2 == "" || v2 == "undefined" || v2 == "null" || v2 == "{}" || v2 == "[]")
- rt = true;
- } else if (tp == "function") {
- rt = false;
- }
- return rt;
- }
- },
- watch: {
- size: function(n2, o2) {
- if (n2 != o2 && !this._empty(n2)) {
- this.cSize = n2;
- if (!this._empty(this.val)) {
- setTimeout(() => {
- this._makeCode();
- }, 100);
- }
- }
- },
- val: function(n2, o2) {
- if (this.onval) {
- if (n2 != o2 && !this._empty(n2)) {
- setTimeout(() => {
- this._makeCode();
- }, 0);
- }
- }
- }
- },
- computed: {}
- };
- function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_loading_icon = vue.resolveComponent("up-loading-icon");
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-qrcode",
- id: $data.rootId,
- style: vue.normalizeStyle({
- width: $props.useRootHeightAndWidth ? "100%" : "auto",
- height: $props.useRootHeightAndWidth ? "100%" : "auto"
- }),
- onLongpress: _cache[1] || (_cache[1] = (...args) => $options.longpress && $options.longpress(...args))
- }, [
- vue.createElementVNode("view", {
- class: "u-qrcode__content",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.preview && $options.preview(...args))
- }, [
- vue.createElementVNode("canvas", {
- class: "u-qrcode__canvas",
- id: $props.cid,
- "canvas-id": $props.cid,
- style: vue.normalizeStyle({ width: $data.sizeLocal + $props.unit, height: $data.sizeLocal + $props.unit })
- }, null, 12, ["id", "canvas-id"]),
- vue.createElementVNode("canvas", {
- class: "u-qrcode__canvas",
- id: $props.cid,
- "canvas-id": $props.cid,
- style: vue.normalizeStyle({ width: $data.sizeLocal + $props.unit, height: $data.sizeLocal + $props.unit })
- }, null, 12, ["id", "canvas-id"]),
- $props.showLoading && $data.loading ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-qrcode__loading",
- style: vue.normalizeStyle({ width: $data.sizeLocal + $props.unit, height: $data.sizeLocal + $props.unit })
- },
- [
- vue.createVNode(_component_up_loading_icon, {
- vertical: "",
- text: $props.loadingText,
- textSize: "14px"
- }, null, 8, ["text"])
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ], 44, ["id"]);
- }
- const uQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["render", _sfc_render$P], ["__scopeId", "data-v-44e78b4f"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-qrcode/u-qrcode.vue"]]);
- const __vite_glob_0_82 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uQrcode
- }, Symbol.toStringTag, { value: "Module" }));
- const props$u = defineMixin({
- props: {
- // 绑定的值
- modelValue: {
- type: [String, Number, Boolean],
- default: () => props$1x.radioGroup.value
- },
- // 是否禁用全部radio
- disabled: {
- type: Boolean,
- default: () => props$1x.radioGroup.disabled
- },
- // 形状,circle-圆形,square-方形
- shape: {
- type: String,
- default: () => props$1x.radioGroup.shape
- },
- // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
- activeColor: {
- type: String,
- default: () => props$1x.radioGroup.activeColor
- },
- // 未选中的颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.radioGroup.inactiveColor
- },
- // 标识符
- name: {
- type: String,
- default: () => props$1x.radioGroup.name
- },
- // 整个组件的尺寸,默认px
- size: {
- type: [String, Number],
- default: () => props$1x.radioGroup.size
- },
- // 布局方式,row-横向,column-纵向
- placement: {
- type: String,
- default: () => props$1x.radioGroup.placement
- },
- // label的文本
- label: {
- type: [String],
- default: () => props$1x.radioGroup.label
- },
- // label的颜色 (默认 '#303133' )
- labelColor: {
- type: [String],
- default: () => props$1x.radioGroup.labelColor
- },
- // label的字体大小,px单位
- labelSize: {
- type: [String, Number],
- default: () => props$1x.radioGroup.labelSize
- },
- // 是否禁止点击文本操作checkbox(默认 false )
- labelDisabled: {
- type: Boolean,
- default: () => props$1x.radioGroup.labelDisabled
- },
- // 图标颜色
- iconColor: {
- type: String,
- default: () => props$1x.radioGroup.iconColor
- },
- // 图标的大小,单位px
- iconSize: {
- type: [String, Number],
- default: () => props$1x.radioGroup.iconSize
- },
- // 竖向配列时,是否显示下划线
- borderBottom: {
- type: Boolean,
- default: () => props$1x.radioGroup.borderBottom
- },
- // 图标与文字的对齐方式
- iconPlacement: {
- type: String,
- default: () => props$1x.radio.iconPlacement
- },
- // item 之间的间距
- gap: {
- type: [String, Number],
- default: () => props$1x.radioGroup.gap
- }
- }
- });
- const _sfc_main$P = {
- name: "u-radio-group",
- mixins: [mpMixin, mixin, props$u],
- computed: {
- // 这里computed的变量,都是子组件u-radio需要用到的,由于头条小程序的兼容性差异,子组件无法实时监听父组件参数的变化
- // 所以需要手动通知子组件,这里返回一个parentData变量,供watch监听,在其中去通知每一个子组件重新从父组件(u-radio-group)
- // 拉取父组件新的变化后的参数
- parentData() {
- return [
- this.modelValue,
- this.disabled,
- this.inactiveColor,
- this.activeColor,
- this.size,
- this.labelDisabled,
- this.shape,
- this.iconSize,
- this.borderBottom,
- this.placement
- ];
- },
- bemClass() {
- return this.bem("radio-group", ["placement"]);
- },
- radioGroupStyle() {
- const style = {
- gap: addUnit(this.gap)
- };
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- watch: {
- // 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
- parentData() {
- if (this.children.length) {
- this.children.map((child) => {
- typeof child.init === "function" && child.init();
- });
- }
- }
- },
- data() {
- return {};
- },
- created() {
- this.children = [];
- },
- emits: ["update:modelValue", "change"],
- methods: {
- // 将其他的radio设置为未选中的状态
- unCheckedOther(childInstance) {
- this.children.map((child) => {
- if (childInstance !== child) {
- child.checked = false;
- }
- });
- const {
- name: name2
- } = childInstance;
- this.$emit("update:modelValue", name2);
- this.$emit("change", name2);
- }
- }
- };
- function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-radio-group", $options.bemClass]),
- style: vue.normalizeStyle($options.radioGroupStyle)
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$O], ["__scopeId", "data-v-cbc8bf70"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-radio-group/u-radio-group.vue"]]);
- const __vite_glob_0_83 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uRadioGroup
- }, Symbol.toStringTag, { value: "Module" }));
- const props$t = defineMixin({
- props: {
- // radio的名称
- name: {
- type: [String, Number, Boolean],
- default: () => props$1x.radio.name
- },
- // 形状,square为方形,circle为圆型
- shape: {
- type: String,
- default: () => props$1x.radio.shape
- },
- // 是否禁用
- disabled: {
- type: [String, Boolean],
- default: () => props$1x.radio.disabled
- },
- // 是否禁止点击提示语选中单选框
- labelDisabled: {
- type: [String, Boolean],
- default: () => props$1x.radio.labelDisabled
- },
- // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
- activeColor: {
- type: String,
- default: () => props$1x.radio.activeColor
- },
- // 未选中的颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.radio.inactiveColor
- },
- // 图标的大小,单位px
- iconSize: {
- type: [String, Number],
- default: () => props$1x.radio.iconSize
- },
- // label的字体大小,px单位
- labelSize: {
- type: [String, Number],
- default: () => props$1x.radio.labelSize
- },
- // label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式
- label: {
- type: [String, Number],
- default: () => props$1x.radio.label
- },
- // 整体的大小
- size: {
- type: [String, Number],
- default: () => props$1x.radio.size
- },
- // 图标颜色
- color: {
- type: String,
- default: () => props$1x.radio.color
- },
- // label的颜色
- labelColor: {
- type: String,
- default: () => props$1x.radio.labelColor
- },
- // 图标颜色
- iconColor: {
- type: String,
- default: () => props$1x.radio.iconColor
- }
- }
- });
- const _sfc_main$O = {
- name: "u-radio",
- mixins: [mpMixin, mixin, props$t],
- data() {
- return {
- checked: false,
- // 当你看到这段代码的时候,
- // 父组件的默认值,因为头条小程序不支持在computed中使用this.parent.shape的形式
- // 故只能使用如此方法
- parentData: {
- iconSize: 12,
- labelDisabled: null,
- disabled: null,
- shape: null,
- activeColor: null,
- inactiveColor: null,
- size: 18,
- value: null,
- modelValue: null,
- iconColor: null,
- placement: "row",
- borderBottom: false,
- iconPlacement: "left"
- }
- };
- },
- computed: {
- // 是否禁用,如果父组件u-raios-group禁用的话,将会忽略子组件的配置
- elDisabled() {
- return this.disabled !== "" ? this.disabled : this.parentData.disabled !== null ? this.parentData.disabled : false;
- },
- // 是否禁用label点击
- elLabelDisabled() {
- return this.labelDisabled !== "" ? this.labelDisabled : this.parentData.labelDisabled !== null ? this.parentData.labelDisabled : false;
- },
- // 组件尺寸,对应size的值,默认值为21px
- elSize() {
- return this.size ? this.size : this.parentData.size ? this.parentData.size : 21;
- },
- // 组件的勾选图标的尺寸,默认12px
- elIconSize() {
- return this.iconSize ? this.iconSize : this.parentData.iconSize ? this.parentData.iconSize : 12;
- },
- // 组件选中激活时的颜色
- elActiveColor() {
- return this.activeColor ? this.activeColor : this.parentData.activeColor ? this.parentData.activeColor : "#2979ff";
- },
- // 组件选未中激活时的颜色
- elInactiveColor() {
- return this.inactiveColor ? this.inactiveColor : this.parentData.inactiveColor ? this.parentData.inactiveColor : "#c8c9cc";
- },
- // label的颜色
- elLabelColor() {
- return this.labelColor ? this.labelColor : this.parentData.labelColor ? this.parentData.labelColor : "#606266";
- },
- // 组件的形状
- elShape() {
- return this.shape ? this.shape : this.parentData.shape ? this.parentData.shape : "circle";
- },
- // label大小
- elLabelSize() {
- return addUnit(this.labelSize ? this.labelSize : this.parentData.labelSize ? this.parentData.labelSize : "15");
- },
- elIconColor() {
- const iconColor = this.iconColor ? this.iconColor : this.parentData.iconColor ? this.parentData.iconColor : "#ffffff";
- if (this.elDisabled) {
- return this.checked ? this.elInactiveColor : "transparent";
- } else {
- return this.checked ? iconColor : "transparent";
- }
- },
- iconClasses() {
- let classes = [];
- classes.push("u-radio__icon-wrap--" + this.elShape);
- if (this.elDisabled) {
- classes.push("u-radio__icon-wrap--disabled");
- }
- if (this.checked && this.elDisabled) {
- classes.push("u-radio__icon-wrap--disabled--checked");
- }
- return classes;
- },
- iconWrapStyle() {
- const style = {};
- style.backgroundColor = this.checked && !this.elDisabled ? this.elActiveColor : "#ffffff";
- style.borderColor = this.checked && !this.elDisabled ? this.elActiveColor : this.elInactiveColor;
- style.width = addUnit(this.elSize);
- style.height = addUnit(this.elSize);
- if (this.parentData.iconPlacement === "right") {
- style.marginRight = 0;
- }
- return style;
- },
- radioStyle() {
- const style = {};
- if (this.parentData.borderBottom && this.parentData.placement === "row") {
- error("检测到您将borderBottom设置为true,需要同时将u-radio-group的placement设置为column才有效");
- }
- if (this.parentData.borderBottom && this.parentData.placement === "column") {
- style.paddingBottom = os() === "ios" ? "12px" : "8px";
- }
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- mounted() {
- this.init();
- },
- emits: ["change"],
- methods: {
- init() {
- this.updateParentData();
- if (!this.parent) {
- error("u-radio必须搭配u-radio-group组件使用");
- }
- this.checked = this.name === this.parentData.modelValue;
- },
- updateParentData() {
- this.getParentData("u-radio-group");
- },
- // 点击图标
- iconClickHandler(e2) {
- this.preventEvent(e2);
- if (!this.elDisabled) {
- this.setRadioCheckedStatus();
- }
- },
- // 横向两端排列时,点击组件即可触发选中事件
- wrapperClickHandler(e2) {
- this.parentData.iconPlacement === "right" && this.iconClickHandler(e2);
- },
- // 点击label
- labelClickHandler(e2) {
- this.preventEvent(e2);
- if (!this.elLabelDisabled && !this.elDisabled) {
- this.setRadioCheckedStatus();
- }
- },
- emitEvent() {
- if (!this.checked) {
- this.$emit("change", this.name);
- this.$nextTick(() => {
- formValidate(this, "change");
- });
- }
- },
- // 改变组件选中状态
- // 这里的改变的依据是,更改本组件的checked值为true,同时通过父组件遍历所有u-radio实例
- // 将本组件外的其他u-radio的checked都设置为false(都被取消选中状态),因而只剩下一个为选中状态
- setRadioCheckedStatus() {
- this.emitEvent();
- this.checked = true;
- typeof this.parent.unCheckedOther === "function" && this.parent.unCheckedOther(this);
- }
- }
- };
- function _sfc_render$N(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-radio cursor-pointer", [`u-radio-label--${$data.parentData.iconPlacement}`, $data.parentData.borderBottom && $data.parentData.placement === "column" && "u-border-bottom"]]),
- onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.wrapperClickHandler && $options.wrapperClickHandler(...args), ["stop"])),
- style: vue.normalizeStyle([$options.radioStyle])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-radio__icon-wrap cursor-pointer", $options.iconClasses]),
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.iconClickHandler && $options.iconClickHandler(...args), ["stop"])),
- style: vue.normalizeStyle([$options.iconWrapStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "icon", {
- elIconSize: $options.elIconSize,
- elIconColor: $options.elIconColor
- }, () => [
- vue.createVNode(_component_up_icon, {
- class: "u-radio__icon-wrap__icon",
- name: "checkbox-mark",
- size: $options.elIconSize,
- color: $options.elIconColor
- }, null, 8, ["size", "color"])
- ], true)
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createElementVNode("view", {
- class: "u-radio__label-wrap cursor-pointer",
- onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.labelClickHandler && $options.labelClickHandler(...args), ["stop"]))
- }, [
- vue.renderSlot(_ctx.$slots, "label", {
- label: _ctx.label,
- elDisabled: $options.elDisabled
- }, () => [
- vue.createElementVNode(
- "text",
- {
- class: "u-radio__text",
- style: vue.normalizeStyle({
- color: $options.elDisabled ? $options.elInactiveColor : $options.elLabelColor,
- fontSize: $options.elLabelSize,
- lineHeight: $options.elLabelSize
- })
- },
- vue.toDisplayString(_ctx.label),
- 5
- /* TEXT, STYLE */
- )
- ], true)
- ])
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uRadio = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$N], ["__scopeId", "data-v-83036558"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-radio/u-radio.vue"]]);
- const __vite_glob_0_84 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uRadio
- }, Symbol.toStringTag, { value: "Module" }));
- const props$s = defineMixin({
- props: {
- // 用于v-model双向绑定选中的星星数量
- modelValue: {
- type: [String, Number],
- default: () => props$1x.rate.value
- },
- // 要显示的星星数量
- count: {
- type: [String, Number],
- default: () => props$1x.rate.count
- },
- // 是否不可选中
- disabled: {
- type: Boolean,
- default: () => props$1x.rate.disabled
- },
- // 是否只读
- readonly: {
- type: Boolean,
- default: () => props$1x.rate.readonly
- },
- // 星星的大小,单位px
- size: {
- type: [String, Number],
- default: () => props$1x.rate.size
- },
- // 未选中时的颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.rate.inactiveColor
- },
- // 选中的颜色
- activeColor: {
- type: String,
- default: () => props$1x.rate.activeColor
- },
- // 星星之间的间距,单位px
- gutter: {
- type: [String, Number],
- default: () => props$1x.rate.gutter
- },
- // 最少能选择的星星个数
- minCount: {
- type: [String, Number],
- default: () => props$1x.rate.minCount
- },
- // 是否允许半星
- allowHalf: {
- type: Boolean,
- default: () => props$1x.rate.allowHalf
- },
- // 选中时的图标(星星)
- activeIcon: {
- type: String,
- default: () => props$1x.rate.activeIcon
- },
- // 未选中时的图标(星星)
- inactiveIcon: {
- type: String,
- default: () => props$1x.rate.inactiveIcon
- },
- // 是否可以通过滑动手势选择评分
- touchable: {
- type: Boolean,
- default: () => props$1x.rate.touchable
- }
- }
- });
- const _sfc_main$N = {
- name: "u-rate",
- mixins: [mpMixin, mixin, props$s],
- data() {
- return {
- // 生成一个唯一id,否则一个页面多个评分组件,会造成冲突
- elId: guid(),
- elClass: guid(),
- rateBoxLeft: 0,
- // 评分盒子左边到屏幕左边的距离,用于滑动选择时计算距离
- activeIndex: this.modelValue,
- rateWidth: 0,
- // 每个星星的宽度
- // 标识是否正在滑动,由于iOS事件上touch比click先触发,导致快速滑动结束后,接着触发click,导致事件混乱而出错
- moving: false
- };
- },
- watch: {
- modelValue(val) {
- this.activeIndex = val;
- },
- activeIndex: "emitEvent"
- },
- emits: ["update:modelValue", "change"],
- methods: {
- addStyle,
- addUnit,
- init() {
- sleep().then(() => {
- this.getRateItemRect();
- this.getRateIconWrapRect();
- });
- },
- // 获取评分组件盒子的布局信息
- async getRateItemRect() {
- await sleep();
- this.$uGetRect("#" + this.elId).then((res) => {
- this.rateBoxLeft = res.left;
- });
- },
- // 获取单个星星的尺寸
- getRateIconWrapRect() {
- this.$uGetRect("." + this.elClass).then((res) => {
- this.rateWidth = res.width;
- });
- },
- // 手指滑动
- touchMove(e2) {
- if (!this.touchable) {
- return;
- }
- this.preventEvent(e2);
- const x2 = e2.changedTouches[0].pageX;
- this.getActiveIndex(x2);
- },
- // 停止滑动
- touchEnd(e2) {
- if (!this.touchable) {
- return;
- }
- this.preventEvent(e2);
- const x2 = e2.changedTouches[0].pageX;
- this.getActiveIndex(x2);
- },
- // 通过点击,直接选中
- clickHandler(e2, index2) {
- if (os() === "ios" && this.moving) {
- return;
- }
- this.preventEvent(e2);
- let x2 = 0;
- x2 = e2.changedTouches[0].pageX;
- this.getActiveIndex(x2, true);
- },
- // 发出事件
- emitEvent() {
- this.$emit("change", this.activeIndex);
- this.$emit("update:modelValue", this.activeIndex);
- },
- // 获取当前激活的评分图标
- getActiveIndex(x2, isClick = false) {
- if (this.disabled || this.readonly) {
- return;
- }
- const allRateWidth = this.rateWidth * this.count + this.rateBoxLeft;
- x2 = range$1(this.rateBoxLeft, allRateWidth, x2) - this.rateBoxLeft;
- const distance = x2;
- let index2;
- if (this.allowHalf) {
- index2 = Math.floor(distance / this.rateWidth);
- const decimal = distance % this.rateWidth;
- if (decimal <= this.rateWidth / 2 && decimal > 0) {
- index2 += 0.5;
- } else if (decimal > this.rateWidth / 2) {
- index2++;
- }
- } else {
- index2 = Math.floor(distance / this.rateWidth);
- const decimal = distance % this.rateWidth;
- if (isClick) {
- if (decimal > 0)
- index2++;
- } else {
- if (decimal > this.rateWidth / 2)
- index2++;
- }
- }
- this.activeIndex = Math.min(index2, this.count);
- if (this.activeIndex < this.minCount) {
- this.activeIndex = this.minCount;
- }
- setTimeout(() => {
- this.moving = true;
- }, 10);
- setTimeout(() => {
- this.moving = false;
- }, 10);
- }
- },
- mounted() {
- this.init();
- }
- };
- function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-rate",
- id: $data.elId,
- ref: "u-rate",
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)])
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "u-rate__content",
- onTouchmove: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.touchMove && $options.touchMove(...args), ["stop"])),
- onTouchend: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.touchEnd && $options.touchEnd(...args), ["stop"]))
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(Number(_ctx.count), (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-rate__content__item cursor-pointer", [$data.elClass]]),
- key: index2
- },
- [
- vue.createElementVNode("view", {
- class: "u-rate__content__item__icon-wrap",
- ref_for: true,
- ref: "u-rate__content__item__icon-wrap",
- onClick: vue.withModifiers(($event) => $options.clickHandler($event, index2 + 1), ["stop"])
- }, [
- vue.createVNode(_component_up_icon, {
- name: Math.floor($data.activeIndex) > index2 ? _ctx.activeIcon : _ctx.inactiveIcon,
- color: _ctx.disabled ? "#c8c9cc" : Math.floor($data.activeIndex) > index2 ? _ctx.activeColor : _ctx.inactiveColor,
- "custom-style": {
- padding: `0 ${$options.addUnit(_ctx.gutter / 2)}`
- },
- size: _ctx.size
- }, null, 8, ["name", "color", "custom-style", "size"])
- ], 8, ["onClick"]),
- _ctx.allowHalf ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- onClick: vue.withModifiers(($event) => $options.clickHandler($event, index2 + 1), ["stop"]),
- class: "u-rate__content__item__icon-wrap u-rate__content__item__icon-wrap--half",
- style: vue.normalizeStyle([{
- width: $options.addUnit($data.rateWidth / 2)
- }]),
- ref_for: true,
- ref: "u-rate__content__item__icon-wrap"
- }, [
- vue.createVNode(_component_up_icon, {
- name: Math.ceil($data.activeIndex) > index2 ? _ctx.activeIcon : _ctx.inactiveIcon,
- color: _ctx.disabled ? "#c8c9cc" : Math.ceil($data.activeIndex) > index2 ? _ctx.activeColor : _ctx.inactiveColor,
- "custom-style": {
- padding: `0 ${$options.addUnit(_ctx.gutter / 2)}`
- },
- size: _ctx.size
- }, null, 8, ["name", "color", "custom-style", "size"])
- ], 12, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ], 12, ["id"]);
- }
- const uRate = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$M], ["__scopeId", "data-v-69a384ee"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-rate/u-rate.vue"]]);
- const __vite_glob_0_85 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uRate
- }, Symbol.toStringTag, { value: "Module" }));
- const props$r = defineMixin({
- props: {
- // 默认的显示占位高度
- showHeight: {
- type: [String, Number],
- default: () => props$1x.readMore.showHeight
- },
- // 展开后是否显示"收起"按钮
- toggle: {
- type: Boolean,
- default: () => props$1x.readMore.toggle
- },
- // 关闭时的提示文字
- closeText: {
- type: String,
- default: () => props$1x.readMore.closeText
- },
- // 展开时的提示文字
- openText: {
- type: String,
- default: () => props$1x.readMore.openText
- },
- // 提示的文字颜色
- color: {
- type: String,
- default: () => props$1x.readMore.color
- },
- // 提示文字的大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.readMore.fontSize
- },
- // 是否显示阴影
- // 此参数不能写在props/readMore.js中进行默认配置,因为使用了条件编译,在外部js中
- // uni无法准确识别当前是否处于nvue还是非nvue下
- shadowStyle: {
- type: Object,
- default: () => ({
- backgroundImage: "linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)",
- paddingTop: "100px",
- marginTop: "-100px"
- })
- },
- // 段落首行缩进的字符个数
- textIndent: {
- type: String,
- default: () => props$1x.readMore.textIndent
- },
- // open和close事件时,将此参数返回在回调参数中
- name: {
- type: [String, Number],
- default: () => props$1x.readMore.name
- }
- }
- });
- const _sfc_main$M = {
- name: "u-read-more",
- mixins: [mpMixin, mixin, props$r],
- data() {
- return {
- isLongContent: false,
- // 是否需要隐藏一部分内容
- status: "close",
- // 当前隐藏与显示的状态,close-收起状态,open-展开状态
- elId: guid(),
- // 生成唯一class
- contentHeight: 100
- // 内容高度
- };
- },
- computed: {
- // 展开后无需阴影,收起时才需要阴影样式
- innerShadowStyle() {
- if (this.status === "open")
- return {};
- else
- return this.shadowStyle;
- }
- },
- mounted() {
- this.init();
- },
- emits: ["open", "close"],
- methods: {
- addUnit,
- async init() {
- this.getContentHeight().then((height) => {
- this.contentHeight = height;
- if (height > getPx(this.showHeight)) {
- this.isLongContent = true;
- this.status = "close";
- } else {
- this.isLongContent = false;
- this.status = "close";
- }
- });
- },
- // 获取内容的高度
- async getContentHeight() {
- await sleep(30);
- return new Promise((resolve) => {
- this.$uGetRect("." + this.elId).then((res) => {
- resolve(res.height);
- });
- });
- },
- // 展开或者收起
- toggleReadMore() {
- this.status = this.status === "close" ? "open" : "close";
- if (this.toggle == false)
- this.isLongContent = false;
- this.$emit(this.status, this.name);
- }
- }
- };
- function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_text = vue.resolveComponent("up-text");
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-read-more" }, [
- vue.createElementVNode(
- "view",
- {
- class: "u-read-more__content",
- style: vue.normalizeStyle({
- height: $data.isLongContent && $data.status === "close" ? $options.addUnit(_ctx.showHeight) : $options.addUnit($data.contentHeight),
- textIndent: _ctx.textIndent
- })
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-read-more__content__inner", [$data.elId]]),
- ref: "u-read-more__content__inner"
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 2
- /* CLASS */
- )
- ],
- 4
- /* STYLE */
- ),
- $data.isLongContent ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-read-more__toggle",
- style: vue.normalizeStyle([$options.innerShadowStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "toggle", {}, () => [
- vue.createElementVNode("view", {
- class: "u-read-more__toggle__text",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.toggleReadMore && $options.toggleReadMore(...args))
- }, [
- vue.createVNode(_component_up_text, {
- text: $data.status === "close" ? _ctx.closeText : _ctx.openText,
- color: _ctx.color,
- size: _ctx.fontSize,
- lineHeight: _ctx.fontSize,
- margin: "0 5px 0 0"
- }, null, 8, ["text", "color", "size", "lineHeight"]),
- vue.createElementVNode("view", { class: "u-read-more__toggle__icon" }, [
- vue.createVNode(_component_up_icon, {
- color: _ctx.color,
- size: _ctx.fontSize + 2,
- name: $data.status === "close" ? "arrow-down" : "arrow-up"
- }, null, 8, ["color", "size", "name"])
- ])
- ])
- ], true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const uReadMore = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$L], ["__scopeId", "data-v-4bc7fe29"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-read-more/u-read-more.vue"]]);
- const __vite_glob_0_86 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uReadMore
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$L = {
- name: "u-virtual-list",
- props: {
- // 数据源
- listData: {
- type: Array,
- default: () => []
- },
- // 每项高度(固定高度模式)
- itemHeight: {
- type: Number,
- default: 50
- },
- // 容器高度
- height: {
- type: [String, Number],
- default: "100%"
- },
- // 缓冲区项数
- buffer: {
- type: Number,
- default: 4
- },
- // 索引键名
- keyField: {
- type: String,
- default: "id"
- },
- // 当前滚动位置
- scrollTop: {
- type: Number,
- default: 0
- }
- },
- data() {
- return {
- // 起始索引
- startIndex: 0,
- // 容器实际高度
- containerHeight: 0
- };
- },
- computed: {
- // 可视区域显示的项数(根据容器实际高度自动计算)
- remain() {
- if (this.containerHeight <= 0) {
- return Math.ceil(500 / this.itemHeight) || 10;
- }
- const calculated = Math.ceil(this.containerHeight / this.itemHeight);
- return Math.max(1, calculated);
- },
- // 可视项数量
- visibleCount() {
- return this.remain + this.buffer;
- },
- // 可视项
- visibleItems() {
- const start = Math.max(0, this.startIndex - Math.floor(this.buffer / 2));
- const end = Math.min(this.listData.length, start + this.visibleCount);
- return this.listData.slice(start, end).map((item, index2) => {
- return {
- ...item,
- _virtualIndex: start + index2
- };
- });
- },
- // 顶部占位高度
- topPlaceholderHeight() {
- const start = Math.max(0, this.startIndex - Math.floor(this.buffer / 2));
- return start * this.itemHeight;
- },
- // 底部占位高度
- bottomPlaceholderHeight() {
- const start = Math.max(0, this.startIndex - Math.floor(this.buffer / 2));
- const end = Math.min(this.listData.length, start + this.visibleCount);
- return (this.listData.length - end) * this.itemHeight;
- }
- },
- emits: ["update:scrollTop", "scroll"],
- watch: {
- listData: {
- handler() {
- this.updateVisibleItems();
- },
- immediate: true
- },
- scrollTop: {
- handler(newVal) {
- this.updateVisibleItems();
- }
- }
- },
- mounted() {
- this.measureContainerHeight();
- },
- methods: {
- addUnit,
- // 测量容器高度
- measureContainerHeight() {
- this.$nextTick(() => {
- const query = uni.createSelectorQuery().in(this);
- query.select(".u-virtual-list").boundingClientRect((rect) => {
- if (rect) {
- this.containerHeight = rect.height || 500;
- } else {
- this.containerHeight = this.calculateDefaultHeight();
- }
- }).exec();
- });
- },
- // 计算默认高度
- calculateDefaultHeight() {
- const height = this.height;
- if (typeof height === "number") {
- return height;
- }
- if (typeof height === "string") {
- if (height.includes("px")) {
- return parseInt(height) || 500;
- } else if (height.includes("vh")) {
- const vh = parseInt(height);
- return isNaN(vh) ? 500 : vh / 100 * this.getViewportHeight();
- } else if (height.includes("%")) {
- return 500;
- } else {
- const num = parseInt(height);
- return isNaN(num) ? 500 : num;
- }
- }
- return 500;
- },
- // 获取视口高度
- getViewportHeight() {
- try {
- const res = uni.getSystemInfoSync();
- return res.windowHeight;
- } catch (e2) {
- return 600;
- }
- },
- getItemKey(item) {
- return item[this.keyField] !== void 0 ? item[this.keyField] : item._virtualIndex;
- },
- // 更新可视项
- updateVisibleItems() {
- const index2 = Math.floor(this.scrollTop / this.itemHeight);
- this.startIndex = Math.max(0, index2);
- },
- // 处理滚动
- handleScroll(e2) {
- const scrollTop = e2.detail.scrollTop;
- this.$emit("update:scrollTop", scrollTop);
- this.$emit("scroll", scrollTop);
- },
- // 处理触摸移动,阻止事件冒泡
- handleTouchMove(e2) {
- e2.stopPropagation();
- },
- // 获取可见项范围
- getVisibleRange() {
- const start = Math.max(0, this.startIndex - Math.floor(this.buffer / 2));
- const end = Math.min(this.listData.length, start + this.visibleCount);
- return { start, end };
- }
- }
- };
- function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-virtual-list",
- style: vue.normalizeStyle({ height: $options.addUnit($props.height) }),
- ref: "container"
- },
- [
- vue.createElementVNode("scroll-view", {
- class: "virtual-scroll-container",
- "scroll-y": true,
- "scroll-top": $props.scrollTop,
- style: { height: "100%" },
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.handleScroll && $options.handleScroll(...args))
- }, [
- vue.createCommentVNode(' @touchmove.stop.prevent="handleTouchMove" '),
- vue.createElementVNode("view", { class: "scroll-content" }, [
- vue.createCommentVNode(" 顶部占位 "),
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle({ height: $options.topPlaceholderHeight + "px" })
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createCommentVNode(" 可见项 "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.visibleItems, (item) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: $options.getItemKey(item),
- class: "list-item",
- style: vue.normalizeStyle({ height: $props.itemHeight + "px" })
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {
- item,
- index: item._virtualIndex
- }, void 0, true)
- ],
- 4
- /* STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createCommentVNode(" 底部占位 "),
- vue.createElementVNode(
- "view",
- {
- style: vue.normalizeStyle({ height: $options.bottomPlaceholderHeight + "px" })
- },
- null,
- 4
- /* STYLE */
- )
- ])
- ], 40, ["scroll-top"])
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$K], ["__scopeId", "data-v-2f4c3fe0"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-virtual-list/u-virtual-list.vue"]]);
- const __vite_glob_0_128 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __easycom_0
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$K = {
- name: "u-refresh-virtual-list",
- props: {
- // 数据源
- listData: {
- type: Array,
- default: () => []
- },
- // 每项高度(固定高度模式)
- itemHeight: {
- type: Number,
- default: 50
- },
- // 容器高度
- height: {
- type: [String, Number],
- default: "100%"
- },
- // 缓冲区项数
- buffer: {
- type: Number,
- default: 4
- },
- // 索引键名
- keyField: {
- type: String,
- default: "id"
- }
- },
- data() {
- return {
- refreshing: false,
- scrollTop: 0
- };
- },
- methods: {
- handleRefresh() {
- this.refreshing = true;
- this.$emit("refresh");
- },
- handleScroll(scrollTop) {
- this.scrollTop = scrollTop;
- this.$emit("scroll", scrollTop);
- },
- finishRefresh() {
- this.refreshing = false;
- },
- scrollTo(top) {
- this.scrollTop = top;
- },
- scrollToTop() {
- this.scrollTo(0);
- }
- }
- };
- function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_virtual_list = resolveEasycom(vue.resolveDynamicComponent("u-virtual-list"), __easycom_0);
- const _component_u_pull_refresh = resolveEasycom(vue.resolveDynamicComponent("u-pull-refresh"), __easycom_1);
- return vue.openBlock(), vue.createBlock(_component_u_pull_refresh, {
- refreshing: $data.refreshing,
- threshold: 50,
- onRefresh: $options.handleRefresh
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_u_virtual_list, {
- ref: "virtualList",
- "list-data": $props.listData,
- "item-height": $props.itemHeight,
- height: $props.height,
- buffer: $props.buffer,
- "key-field": $props.keyField,
- "scroll-top": $data.scrollTop,
- onScroll: $options.handleScroll
- }, {
- default: vue.withCtx(({ item, index: index2 }) => [
- vue.renderSlot(_ctx.$slots, "default", {
- item,
- index: index2
- })
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["list-data", "item-height", "height", "buffer", "key-field", "scroll-top", "onScroll"])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["refreshing", "onRefresh"]);
- }
- const uRefreshVirtualList = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$J], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-refresh-virtual-list/u-refresh-virtual-list.vue"]]);
- const __vite_glob_0_87 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uRefreshVirtualList
- }, Symbol.toStringTag, { value: "Module" }));
- const props$q = defineMixin({
- props: {
- // 给col添加间距,左右边距各占一半
- gutter: {
- type: [String, Number],
- default: () => props$1x.row.gutter
- },
- // 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
- justify: {
- type: String,
- default: () => props$1x.row.justify
- },
- // 垂直对齐方式,可选值为top、center、bottom
- align: {
- type: String,
- default: () => props$1x.row.align
- }
- }
- });
- const _sfc_main$J = {
- name: "u-row",
- mixins: [mpMixin, mixin, props$q],
- data() {
- return {};
- },
- computed: {
- uJustify() {
- if (this.justify == "end" || this.justify == "start")
- return "flex-" + this.justify;
- else if (this.justify == "around" || this.justify == "between")
- return "space-" + this.justify;
- else
- return this.justify;
- },
- uAlignItem() {
- if (this.align == "top")
- return "flex-start";
- if (this.align == "bottom")
- return "flex-end";
- else
- return this.align;
- },
- rowStyle() {
- const style = {
- alignItems: this.uAlignItem,
- justifyContent: this.uJustify
- };
- if (this.gutter) {
- style.marginLeft = addUnit(-Number(this.gutter) / 2);
- style.marginRight = addUnit(-Number(this.gutter) / 2);
- }
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- emits: ["click"],
- methods: {
- clickHandler(e2) {
- this.$emit("click");
- },
- async getComponentWidth() {
- await sleep();
- return new Promise((resolve) => {
- this.$uGetRect(".u-row").then((res) => {
- resolve(res.width);
- });
- });
- }
- }
- };
- function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-row",
- ref: "u-row",
- style: vue.normalizeStyle([$options.rowStyle]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 4
- /* STYLE */
- );
- }
- const uRow = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$I], ["__scopeId", "data-v-a2f99026"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-row/u-row.vue"]]);
- const __vite_glob_0_89 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uRow
- }, Symbol.toStringTag, { value: "Module" }));
- const props$p = defineMixin({
- props: {
- // 指示器的整体宽度
- indicatorWidth: {
- type: [String, Number],
- default: () => props$1x.scrollList.indicatorWidth
- },
- // 滑块的宽度
- indicatorBarWidth: {
- type: [String, Number],
- default: () => props$1x.scrollList.indicatorBarWidth
- },
- // 是否显示面板指示器
- indicator: {
- type: Boolean,
- default: () => props$1x.scrollList.indicator
- },
- // 指示器非激活颜色
- indicatorColor: {
- type: String,
- default: () => props$1x.scrollList.indicatorColor
- },
- // 指示器的激活颜色
- indicatorActiveColor: {
- type: String,
- default: () => props$1x.scrollList.indicatorActiveColor
- },
- // 指示器样式,可通过bottom,left,right进行定位
- indicatorStyle: {
- type: [String, Object],
- default: () => props$1x.scrollList.indicatorStyle
- }
- }
- });
- const block0$1 = (Comp) => {
- (Comp.$wxs || (Comp.$wxs = [])).push("wxs");
- (Comp.$wxsModules || (Comp.$wxsModules = {}))["wxs"] = "0c1bc38e";
- };
- const _sfc_main$I = {
- name: "u-scroll-list",
- mixins: [mpMixin, mixin, props$p],
- data() {
- return {
- scrollInfo: {
- scrollLeft: 0,
- scrollWidth: 0
- },
- scrollWidth: 0
- };
- },
- computed: {
- // 指示器为线型的样式
- barStyle() {
- const style = {};
- style.width = addUnit(this.indicatorBarWidth);
- style.backgroundColor = this.indicatorActiveColor;
- return style;
- },
- lineStyle() {
- const style = {};
- style.width = addUnit(this.indicatorWidth);
- style.backgroundColor = this.indicatorColor;
- return style;
- }
- },
- mounted() {
- this.init();
- },
- emits: ["left", "right"],
- methods: {
- addStyle,
- getPx,
- init() {
- this.getComponentWidth();
- },
- //
- scrollEvent(status) {
- this.$emit(status);
- },
- // 获取组件的宽度
- async getComponentWidth() {
- await sleep(30);
- this.$uGetRect(".u-scroll-list").then((size) => {
- this.scrollWidth = size.width;
- });
- }
- }
- };
- function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-scroll-list",
- ref: "u-scroll-list"
- },
- [
- vue.createCommentVNode(" 以上平台,支持wxs "),
- vue.createElementVNode("scroll-view", {
- class: "u-scroll-list__scroll-view scroll-view-native",
- "scroll-x": "",
- "enable-flex": "",
- onScroll: _cache[0] || (_cache[0] = (...args) => _ctx.wxs.scroll && _ctx.wxs.scroll(...args)),
- onScrolltoupper: _cache[1] || (_cache[1] = (...args) => _ctx.wxs.scrolltoupper && _ctx.wxs.scrolltoupper(...args)),
- onScrolltolower: _cache[2] || (_cache[2] = (...args) => _ctx.wxs.scrolltolower && _ctx.wxs.scrolltolower(...args)),
- "data-scrollWidth": $data.scrollWidth,
- "data-barWidth": $options.getPx(_ctx.indicatorBarWidth),
- "data-indicatorWidth": $options.getPx(_ctx.indicatorWidth),
- "show-scrollbar": false,
- "upper-threshold": 0,
- "lower-threshold": 0
- }, [
- vue.createElementVNode("view", { class: "u-scroll-list__scroll-view__content" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])
- ], 40, ["data-scrollWidth", "data-barWidth", "data-indicatorWidth"]),
- _ctx.indicator ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-scroll-list__indicator",
- style: vue.normalizeStyle([$options.addStyle(_ctx.indicatorStyle)])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-scroll-list__indicator__line",
- style: vue.normalizeStyle([$options.lineStyle])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-scroll-list__indicator__line__bar",
- style: vue.normalizeStyle([$options.barStyle]),
- ref: "u-scroll-list__indicator__line__bar"
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 512
- /* NEED_PATCH */
- );
- }
- if (typeof block0$1 === "function")
- block0$1(_sfc_main$I);
- const uScrollList = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$H], ["__scopeId", "data-v-75b0f429"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-scroll-list/u-scroll-list.vue"]]);
- const __vite_glob_0_91 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uScrollList
- }, Symbol.toStringTag, { value: "Module" }));
- const props$o = defineMixin({
- props: {
- // 绑定的值
- modelValue: {
- type: [String, Number],
- default: () => props$1x.search.value
- },
- // 搜索框形状,round-圆形,square-方形
- shape: {
- type: String,
- default: () => props$1x.search.shape
- },
- // 搜索框背景色
- bgColor: {
- type: String,
- default: () => props$1x.search.bgColor
- },
- // 占位提示文字
- placeholder: {
- type: String,
- default: () => props$1x.search.placeholder
- },
- // 是否启用清除控件
- clearabled: {
- type: Boolean,
- default: () => props$1x.search.clearabled
- },
- // 是否仅聚焦时显示清除控件
- onlyClearableOnFocused: {
- type: Boolean,
- default: true
- },
- // 是否自动聚焦
- focus: {
- type: Boolean,
- default: () => props$1x.search.focus
- },
- // 是否在搜索框右侧显示取消按钮
- showAction: {
- type: Boolean,
- default: () => props$1x.search.showAction
- },
- // 右侧取消按钮文字
- actionText: {
- type: String,
- default: () => props$1x.search.actionText
- },
- // 搜索框左侧文本
- label: {
- type: [String, Number, null],
- default: () => props$1x.search.label
- },
- // 输入框内容对齐方式,可选值为:left|center|right
- inputAlign: {
- type: String,
- default: () => props$1x.search.inputAlign
- },
- // 是否启用输入框
- disabled: {
- type: Boolean,
- default: () => props$1x.search.disabled
- },
- // 开启showAction时,是否在input获取焦点时才显示
- animation: {
- type: Boolean,
- default: () => props$1x.search.animation
- },
- // 边框颜色,只要配置了颜色,才会有边框
- borderColor: {
- type: String,
- default: () => props$1x.search.borderColor
- },
- // 搜索图标的颜色,默认同输入框字体颜色
- searchIconColor: {
- type: String,
- default: () => props$1x.search.searchIconColor
- },
- // 搜索图标的大小
- searchIconSize: {
- type: [Number, String],
- default: () => props$1x.search.searchIconSize
- },
- // 输入框字体颜色
- color: {
- type: String,
- default: () => props$1x.search.color
- },
- // placeholder的颜色
- placeholderColor: {
- type: String,
- default: () => props$1x.search.placeholderColor
- },
- // 左边输入框的图标,可以为uView图标名称或图片路径
- searchIcon: {
- type: String,
- default: () => props$1x.search.searchIcon
- },
- // 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30px"
- margin: {
- type: String,
- default: () => props$1x.search.margin
- },
- // 应该是uView-plus版本新增的,用于控制搜索图标的插槽位置
- iconPosition: {
- type: String,
- default: () => props$1x.search.iconPosition
- },
- // 输入框最大能输入的长度,-1为不限制长度
- maxlength: {
- type: [String, Number],
- default: () => props$1x.search.maxlength
- },
- // 输入框高度,单位px
- height: {
- type: [String, Number],
- default: () => props$1x.search.height
- },
- // 键盘弹起时,是否自动上推页面
- adjustPosition: {
- type: Boolean,
- default: () => props$1x.search.adjustPosition
- },
- // 键盘收起时,是否自动失去焦点
- autoBlur: {
- type: Boolean,
- default: () => props$1x.search.autoBlur
- },
- // 输入框的样式,对象形式
- inputStyle: {
- type: Object,
- default: () => props$1x.search.inputStyle
- },
- // 右侧控件的样式,对象形式
- actionStyle: {
- type: Object,
- default: () => props$1x.search.actionStyle
- },
- // 自定义样式,对象形式
- customStyle: {
- type: Object,
- default: () => props$1x.search.customStyle
- }
- }
- });
- const _sfc_main$H = {
- name: "u-search",
- mixins: [mpMixin, mixin, props$o],
- data() {
- return {
- keyword: "",
- show: false,
- // 标记input当前状态是否处于聚焦中,如果是,才会显示右侧的清除控件
- focused: this.focus
- // 绑定输入框的值
- // inputValue: this.value
- };
- },
- watch: {
- keyword(nVal) {
- this.$emit("update:modelValue", nVal);
- this.$emit("change", nVal);
- },
- modelValue: {
- immediate: true,
- handler(nVal) {
- this.keyword = nVal;
- }
- }
- },
- computed: {
- showActionBtn() {
- return !this.animation && this.showAction;
- },
- // 是否显示清除控件
- isShowClear() {
- const { clearabled, focused, keyword, onlyClearableOnFocused } = this;
- if (!clearabled) {
- return false;
- }
- if (onlyClearableOnFocused) {
- return !!focused && keyword !== "";
- } else {
- return keyword !== "";
- }
- }
- },
- emits: ["clear", "search", "custom", "focus", "blur", "click", "clickIcon", "update:modelValue", "change"],
- methods: {
- addStyle,
- addUnit,
- // 目前HX2.6.9 v-model双向绑定无效,故监听input事件获取输入框内容的变化
- inputChange(e2) {
- this.keyword = e2.detail.value;
- },
- // 清空输入
- // 也可以作为用户通过this.$refs形式调用清空输入框内容
- clear() {
- this.keyword = "";
- this.$nextTick(() => {
- this.$emit("clear");
- });
- },
- // 确定搜索
- search(e2) {
- this.$emit("search", e2.detail.value);
- try {
- uni.hideKeyboard();
- } catch (e3) {
- }
- },
- // 点击右边自定义按钮的事件
- custom() {
- this.$emit("custom", this.keyword);
- try {
- uni.hideKeyboard();
- } catch (e2) {
- }
- },
- // 获取焦点
- getFocus() {
- this.focused = true;
- if (this.animation && this.showAction)
- this.show = true;
- this.$emit("focus", this.keyword);
- },
- // 失去焦点
- blur() {
- setTimeout(() => {
- this.focused = false;
- }, 100);
- this.show = false;
- this.$emit("blur", this.keyword);
- },
- // 点击搜索框,只有disabled=true时才发出事件,因为禁止了输入,意味着是想跳转真正的搜索页
- clickHandler() {
- if (this.disabled)
- this.$emit("click");
- },
- // 点击左边图标
- clickIcon(e2) {
- this.$emit("clickIcon", this.keyword);
- try {
- uni.hideKeyboard();
- } catch (e3) {
- }
- }
- }
- };
- function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-search", [_ctx.iconPosition === "right" && "u-search__reverse"]]),
- onClick: _cache[6] || (_cache[6] = (...args) => $options.clickHandler && $options.clickHandler(...args)),
- style: vue.normalizeStyle([{
- margin: _ctx.margin
- }, $options.addStyle(_ctx.customStyle)])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-search__content",
- style: vue.normalizeStyle({
- backgroundColor: _ctx.bgColor,
- borderRadius: _ctx.shape == "round" ? "100px" : "4px",
- borderColor: _ctx.borderColor
- })
- },
- [
- _ctx.$slots.label || _ctx.label !== null ? vue.renderSlot(_ctx.$slots, "label", { key: 0 }, () => [
- vue.createElementVNode(
- "text",
- { class: "u-search__content__label" },
- vue.toDisplayString(_ctx.label),
- 1
- /* TEXT */
- )
- ], true) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "u-search__content__icon" }, [
- vue.createVNode(_component_up_icon, {
- onClick: $options.clickIcon,
- size: _ctx.searchIconSize,
- name: _ctx.searchIcon,
- color: _ctx.searchIconColor ? _ctx.searchIconColor : _ctx.color
- }, null, 8, ["onClick", "size", "name", "color"])
- ]),
- vue.createElementVNode("input", {
- "confirm-type": "search",
- onBlur: _cache[0] || (_cache[0] = (...args) => $options.blur && $options.blur(...args)),
- value: $data.keyword,
- onConfirm: _cache[1] || (_cache[1] = (...args) => $options.search && $options.search(...args)),
- onInput: _cache[2] || (_cache[2] = (...args) => $options.inputChange && $options.inputChange(...args)),
- disabled: _ctx.disabled,
- onFocus: _cache[3] || (_cache[3] = (...args) => $options.getFocus && $options.getFocus(...args)),
- focus: _ctx.focus,
- maxlength: _ctx.maxlength,
- "adjust-position": _ctx.adjustPosition,
- "auto-blur": _ctx.autoBlur,
- "placeholder-class": "u-search__content__input--placeholder",
- placeholder: _ctx.placeholder,
- "placeholder-style": `color: ${_ctx.placeholderColor}`,
- class: "u-search__content__input",
- type: "text",
- style: vue.normalizeStyle([{
- pointerEvents: _ctx.disabled ? "none" : "auto",
- textAlign: _ctx.inputAlign,
- color: _ctx.color,
- backgroundColor: _ctx.bgColor,
- height: $options.addUnit(_ctx.height)
- }, _ctx.inputStyle])
- }, null, 44, ["value", "disabled", "focus", "maxlength", "adjust-position", "auto-blur", "placeholder", "placeholder-style"]),
- $options.isShowClear ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-search__content__icon u-search__content__close",
- onClick: _cache[4] || (_cache[4] = (...args) => $options.clear && $options.clear(...args))
- }, [
- vue.createVNode(_component_up_icon, {
- name: "close",
- size: "11",
- color: "#ffffff",
- customStyle: "line-height: 12px"
- })
- ])) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "inputRight", {}, void 0, true)
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "text",
- {
- style: vue.normalizeStyle([_ctx.actionStyle]),
- class: vue.normalizeClass(["u-search__action", [($options.showActionBtn || $data.show) && "u-search__action--active"]]),
- onClick: _cache[5] || (_cache[5] = vue.withModifiers((...args) => $options.custom && $options.custom(...args), ["stop", "prevent"]))
- },
- vue.toDisplayString(_ctx.actionText),
- 7
- /* TEXT, CLASS, STYLE */
- )
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uSearch = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$G], ["__scopeId", "data-v-e082a34a"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-search/u-search.vue"]]);
- const __vite_glob_0_92 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSearch
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$G = {
- name: "up-select",
- emits: ["update:current", "select"],
- props: {
- maxHeight: {
- type: String,
- default: "90vh"
- },
- overlay: {
- type: Boolean,
- default: true
- },
- overlayOpacity: {
- type: Number,
- default: 0.01
- },
- overlayStyle: {
- type: Object,
- default: () => {
- return {};
- }
- },
- duration: {
- type: Number,
- default: 300
- },
- label: {
- type: String,
- default: "选项"
- },
- options: {
- type: Array,
- default: () => {
- return [];
- }
- },
- keyName: {
- type: String,
- default: "id"
- },
- labelName: {
- type: String,
- default: "name"
- },
- showOptionsLabel: {
- type: Boolean,
- default: false
- },
- current: {
- type: [String, Number],
- default: ""
- },
- zIndex: {
- type: Number,
- default: 11e3
- },
- itemColor: {
- type: String,
- default: "#333333"
- },
- iconColor: {
- type: String,
- default: ""
- },
- iconSize: {
- type: [String],
- default: "13px"
- }
- },
- data() {
- return {
- isOpen: false,
- optionsWrapLeft: "auto",
- optionsWrapRight: "auto"
- };
- },
- computed: {
- currentLabel() {
- let name2 = "";
- this.options.forEach((ele) => {
- if (ele[this.keyName] === this.current) {
- name2 = ele[this.labelName];
- }
- });
- return name2;
- }
- },
- methods: {
- openSelect() {
- this.isOpen = true;
- this.$nextTick(() => {
- if (this.isOpen) {
- this.adjustOptionsWrapPosition();
- }
- });
- },
- overlayClick() {
- this.isOpen = false;
- },
- selectItem(item) {
- this.isOpen = false;
- this.$emit("update:current", item[this.keyName]);
- this.$emit("select", item);
- },
- adjustOptionsWrapPosition() {
- let wi = getWindowInfo();
- let windowWidth2 = wi.windowWidth;
- this.$uGetRect(".u-select__options__wrap").then((rect) => {
- formatAppLog("log", "at uni_modules/uview-plus/components/u-select/u-select.vue:158", rect);
- if (rect.left + rect.width > windowWidth2) {
- this.optionsWrapLeft = "auto";
- this.optionsWrapRight = `0px`;
- }
- });
- }
- }
- };
- function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_overlay = resolveEasycom(vue.resolveDynamicComponent("u-overlay"), __easycom_0$d);
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-select" }, [
- vue.createElementVNode("view", { class: "u-select__content" }, [
- vue.createElementVNode("view", {
- class: "u-select__label",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.openSelect && $options.openSelect(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "text", { currentLabel: $options.currentLabel }, () => [
- $props.showOptionsLabel ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-select__text"
- },
- vue.toDisplayString($options.currentLabel),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "u-select__text"
- },
- vue.toDisplayString($props.label),
- 1
- /* TEXT */
- ))
- ], true),
- vue.renderSlot(_ctx.$slots, "icon", {}, () => [
- vue.createVNode(_component_up_icon, {
- name: "arrow-down",
- size: $props.iconSize,
- color: $props.iconColor
- }, null, 8, ["size", "color"])
- ], true)
- ]),
- $props.overlay ? (vue.openBlock(), vue.createBlock(_component_u_overlay, {
- key: 0,
- show: $data.isOpen,
- onClick: $options.overlayClick,
- zIndex: $props.zIndex,
- duration: $props.duration + 50,
- customStyle: $props.overlayStyle,
- opacity: $props.overlayOpacity,
- onTouchmove: vue.withModifiers(_ctx.noop, ["stop", "prevent"])
- }, null, 8, ["show", "onClick", "zIndex", "duration", "customStyle", "opacity", "onTouchmove"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "u-select__options__wrap",
- style: vue.normalizeStyle({ overflowY: "auto", zIndex: $props.zIndex + 1, left: $data.optionsWrapLeft, right: $data.optionsWrapRight, maxHeight: $props.maxHeight })
- },
- [
- $data.isOpen ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-select__options"
- }, [
- vue.renderSlot(_ctx.$slots, "options", {}, () => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.options, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["u-select__options_item", $props.current == item[$props.keyName] ? "active" : ""]),
- key: index2,
- onClick: ($event) => $options.selectItem(item)
- }, [
- vue.renderSlot(_ctx.$slots, "optionItem", { item }, () => [
- vue.createElementVNode(
- "text",
- {
- class: "u-select__item_text",
- style: vue.normalizeStyle({ color: $props.itemColor })
- },
- vue.toDisplayString(item[$props.labelName]),
- 5
- /* TEXT, STYLE */
- )
- ], true)
- ], 10, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], true)
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ])
- ]);
- }
- const uSelect = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$F], ["__scopeId", "data-v-791c325c"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-select/u-select.vue"]]);
- const __vite_glob_0_93 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSelect
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$F = {
- name: "u-short-video",
- props: {
- // tabs标签列表
- tabsList: {
- type: Array,
- default: () => [
- { name: "推荐" },
- { name: "关注" },
- { name: "朋友" },
- { name: "本地" }
- ]
- },
- // 视频列表数据
- videoList: {
- type: Array,
- default: () => []
- },
- // 当前选中的tab索引
- currentTab: {
- type: Number,
- default: 0
- },
- // 当前播放的视频索引
- currentVideo: {
- type: Number,
- default: 0
- }
- },
- data() {
- return {
- progressValue: 0,
- showSpeedSheet: false,
- currentSpeedVideoIndex: 0,
- speedOptions: [
- { name: "0.5x", value: 0.5 },
- { name: "0.75x", value: 0.75 },
- { name: "1.0x", value: 1 },
- { name: "1.25x", value: 1.25 },
- { name: "1.5x", value: 1.5 },
- { name: "2.0x", value: 2 }
- ]
- };
- },
- methods: {
- // 处理tab切换
- handleTabChange(index2) {
- this.$emit("tabChange", index2);
- },
- // 处理swiper切换
- handleSwiperChange(e2) {
- const currentIndex = e2.detail.current;
- this.pauseCurrentVideo();
- this.$nextTick(() => {
- this.playVideo(currentIndex);
- });
- this.$emit("videoChange", currentIndex);
- },
- // 处理点赞
- handleLike(item, index2) {
- this.$emit("like", { item, index: index2 });
- },
- // 处理评论
- handleComment(item, index2) {
- this.$emit("comment", { item, index: index2 });
- },
- // 处理分享
- handleShare(item, index2) {
- this.$emit("share", { item, index: index2 });
- },
- // 处理收藏
- handleCollect(item, index2) {
- this.$emit("collect", { item, index: index2 });
- },
- // 进度条拖动中
- onProgressChanging(value2) {
- if (this.videoList[this.currentVideo]) {
- this.videoList[this.currentVideo]["progressValue"] = value2.detail.value;
- }
- this.$emit("progressChanging", {
- progress: value2.detail.value,
- index: this.currentVideo
- });
- },
- // 进度条值改变
- onProgressChange(value2) {
- if (this.videoList[this.currentVideo]) {
- this.$set(this.videoList[this.currentVideo], "progressValue", value2.detail.value);
- }
- this.$emit("progressChange", {
- progress: value2.detail.value,
- index: this.currentVideo
- });
- },
- // 显示倍速选项
- showSpeedOptions(index2) {
- this.currentSpeedVideoIndex = index2;
- this.showSpeedSheet = true;
- },
- // 选择倍速
- selectSpeed(action) {
- const videoContext = uni.createVideoContext("video-" + this.currentSpeedVideoIndex, this);
- videoContext.playbackRate(action.value);
- this.$set(this.videoList[this.currentSpeedVideoIndex], "playbackRate", action.value);
- this.showSpeedSheet = false;
- },
- // 播放指定索引的视频
- playVideo(index2) {
- const videoContext = uni.createVideoContext("video-" + index2, this);
- videoContext.play();
- },
- // 暂停当前视频
- pauseCurrentVideo() {
- const videoContext = uni.createVideoContext("video-" + this.currentVideo, this);
- videoContext.pause();
- },
- // 视频播放事件
- onVideoPlay(e2) {
- this.$emit("videoPlay", { index: this.currentVideo, event: e2 });
- },
- // 视频暂停事件
- onVideoPause(e2) {
- this.$emit("videoPause", { index: this.currentVideo, event: e2 });
- },
- // 视频结束事件
- onVideoEnded(e2) {
- this.$emit("videoEnded", { index: this.currentVideo, event: e2 });
- },
- // 视频时间更新事件
- onTimeUpdate(e2) {
- const progress = e2.detail.currentTime / e2.detail.duration * 100;
- if (this.videoList[this.currentVideo]) {
- this.$set(this.videoList[this.currentVideo], "progress", progress);
- }
- this.$emit("timeUpdate", { index: this.currentVideo, event: e2 });
- },
- // 视频元数据加载完成事件
- onLoadedMetadata(e2) {
- this.$emit("loadedMetadata", { index: this.currentVideo, event: e2 });
- }
- }
- };
- function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2;
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_up_tabs = vue.resolveComponent("up-tabs");
- const _component_u_avatar = resolveEasycom(vue.resolveDynamicComponent("u-avatar"), __easycom_0$a);
- const _component_up_button = vue.resolveComponent("up-button");
- const _component_up_action_sheet = vue.resolveComponent("up-action-sheet");
- const _component_up_slider = vue.resolveComponent("up-slider");
- const _component_up_tabbar_item = vue.resolveComponent("up-tabbar-item");
- const _component_up_tabbar = vue.resolveComponent("up-tabbar");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-short-video" }, [
- vue.createCommentVNode(" 顶部导航区域 "),
- vue.createElementVNode("view", { class: "u-short-video__header" }, [
- vue.renderSlot(_ctx.$slots, "menu", {}, () => [
- vue.createElementVNode("view", { class: "u-short-video__header__menu" }, [
- vue.createVNode(_component_up_icon, {
- name: "grid",
- size: "24"
- })
- ])
- ], true),
- vue.createVNode(_component_up_tabs, {
- list: $props.tabsList,
- current: $props.currentTab,
- lineColor: "#ddd",
- activeStyle: {
- color: "#ddd",
- fontWeight: 400,
- transform: "scale(1)"
- },
- inactiveStyle: {
- color: "#bbb",
- transform: "scale(1)"
- },
- onChange: $options.handleTabChange,
- class: "u-short-video__header__tabs"
- }, null, 8, ["list", "current", "activeStyle", "inactiveStyle", "onChange"]),
- vue.renderSlot(_ctx.$slots, "search", {}, () => [
- vue.createElementVNode("view", { class: "u-short-video__header__search" }, [
- vue.createVNode(_component_up_icon, {
- name: "search",
- size: "24"
- })
- ])
- ], true)
- ]),
- vue.createCommentVNode(" 视频内容区域 "),
- vue.createElementVNode("swiper", {
- vertical: true,
- autoplay: false,
- onChange: _cache[5] || (_cache[5] = (...args) => $options.handleSwiperChange && $options.handleSwiperChange(...args)),
- current: $props.currentVideo,
- class: "u-short-video__content"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.videoList, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("swiper-item", { key: index2 }, [
- vue.createElementVNode("view", { class: "u-short-video__content__item" }, [
- vue.createCommentVNode(" 视频播放区域 "),
- vue.createElementVNode("view", { class: "u-short-video__content__video" }, [
- vue.createElementVNode("video", {
- id: "video-" + index2,
- src: item.videoUrl,
- autoplay: index2 === $props.currentVideo,
- controls: false,
- "show-fullscreen-btn": false,
- "show-play-btn": false,
- "show-center-play-btn": false,
- "enable-progress-gesture": true,
- loop: true,
- "playback-rate": item.playbackRate || 1,
- onPlay: _cache[0] || (_cache[0] = (...args) => $options.onVideoPlay && $options.onVideoPlay(...args)),
- onPause: _cache[1] || (_cache[1] = (...args) => $options.onVideoPause && $options.onVideoPause(...args)),
- onEnded: _cache[2] || (_cache[2] = (...args) => $options.onVideoEnded && $options.onVideoEnded(...args)),
- onTimeupdate: _cache[3] || (_cache[3] = (...args) => $options.onTimeUpdate && $options.onTimeUpdate(...args)),
- onLoadedmetadata: _cache[4] || (_cache[4] = (...args) => $options.onLoadedMetadata && $options.onLoadedMetadata(...args)),
- style: { "width": "100%", "height": "100%" }
- }, null, 40, ["id", "src", "autoplay", "playback-rate"]),
- vue.createCommentVNode(" 倍速设置按钮 "),
- vue.createCommentVNode(' <view class="u-short-video__content__video__speed" @click="showSpeedOptions(index)">\n <text class="speed-text">{{ item.playbackRate || 1.0 }}x</text>\n <up-icon name="arrow-down" size="12" color="#fff"></up-icon>\n </view> ')
- ]),
- vue.createCommentVNode(" 作者信息 "),
- vue.createElementVNode("view", { class: "u-short-video__content__author" }, [
- vue.createElementVNode("view", { class: "u-short-video__content__author__avatar" }, [
- vue.createVNode(_component_u_avatar, {
- src: item.author.avatar,
- size: "50px"
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "u-short-video__content__author__info" }, [
- vue.createElementVNode(
- "text",
- { class: "u-short-video__content__author__name" },
- vue.toDisplayString(item.author.name),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "u-short-video__content__author__desc" },
- vue.toDisplayString(item.author.desc),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "u-short-video__content__author__follow" }, [
- vue.createVNode(_component_up_button, {
- type: "primary",
- size: "mini"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode("关注")
- ]),
- _: 1
- /* STABLE */
- })
- ])
- ]),
- vue.createCommentVNode(" 右侧操作区域 "),
- vue.createElementVNode("view", { class: "u-short-video__content__actions" }, [
- vue.renderSlot(_ctx.$slots, "actions", {
- item,
- index: index2
- }, () => [
- vue.createElementVNode("view", {
- class: "u-short-video__content__actions__item",
- onClick: ($event) => $options.handleLike(item, index2)
- }, [
- vue.createVNode(_component_up_icon, {
- color: "#eee",
- name: item.isLiked ? "thumb-up-fill" : "thumb-up",
- size: "32px"
- }, null, 8, ["name"]),
- vue.createElementVNode(
- "text",
- { class: "u-short-video__content__actions__text" },
- vue.toDisplayString(item.likeCount),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"]),
- vue.createElementVNode("view", {
- class: "u-short-video__content__actions__item",
- onClick: ($event) => $options.handleComment(item, index2)
- }, [
- vue.createVNode(_component_up_icon, {
- color: "#eee",
- name: "chat",
- size: "32px"
- }),
- vue.createElementVNode(
- "text",
- { class: "u-short-video__content__actions__text" },
- vue.toDisplayString(item.commentCount),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"]),
- vue.createElementVNode("view", {
- class: "u-short-video__content__actions__item",
- onClick: ($event) => $options.handleShare(item, index2)
- }, [
- vue.createVNode(_component_up_icon, {
- color: "#eee",
- name: "share",
- size: "32px"
- }),
- vue.createElementVNode(
- "text",
- { class: "u-short-video__content__actions__text" },
- vue.toDisplayString(item.shareCount),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"]),
- vue.createElementVNode("view", {
- class: "u-short-video__content__actions__item",
- onClick: ($event) => $options.handleCollect(item, index2)
- }, [
- vue.createVNode(_component_up_icon, {
- color: "#eee",
- name: item.isCollected ? "bookmark-fill" : "bookmark",
- size: "32px"
- }, null, 8, ["name"]),
- vue.createElementVNode(
- "text",
- { class: "u-short-video__content__actions__text" },
- vue.toDisplayString(item.collectCount),
- 1
- /* TEXT */
- )
- ], 8, ["onClick"])
- ], true)
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 40, ["current"]),
- vue.createCommentVNode(" 倍速选择弹窗 "),
- vue.createVNode(_component_up_action_sheet, {
- show: $data.showSpeedSheet,
- actions: $data.speedOptions,
- title: "播放速度",
- onClose: _cache[6] || (_cache[6] = ($event) => $data.showSpeedSheet = false),
- onSelect: $options.selectSpeed
- }, null, 8, ["show", "actions", "onSelect"]),
- vue.createCommentVNode(" 底部导航栏 "),
- vue.createElementVNode("view", { class: "u-short-video__footer" }, [
- vue.createCommentVNode(" 进度条 "),
- vue.createElementVNode("view", {
- class: "u-short-video__progress",
- style: { "z-index": "999" }
- }, [
- vue.createVNode(_component_up_slider, {
- value: (_a2 = $props.videoList[$props.currentVideo]) == null ? void 0 : _a2.progress,
- min: 0,
- max: 100,
- step: 1,
- "show-value": false,
- innerStyle: { padding: 0 },
- activeColor: "rgba(255,255,255,0.32)",
- "inactive-color": "rgba(255,255,255,0.3)",
- "block-size": "6px",
- "block-color": "rgba(255,255,255,0.5)",
- height: "1px",
- onChanging: $options.onProgressChanging,
- onChange: $options.onProgressChange
- }, null, 8, ["value", "onChanging", "onChange"])
- ]),
- vue.renderSlot(_ctx.$slots, "tabbar", {}, () => [
- vue.createVNode(_component_up_tabbar, {
- fixed: true,
- placeholder: true,
- safeAreaInsetBottom: true,
- borderColor: "rgba(255,255,255,0.25) !important",
- backgroundColor: "rgba(255,255,255,0.05)"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_up_tabbar_item, {
- onClick: _ctx.goNext,
- text: "首页",
- icon: "home"
- }, null, 8, ["onClick"]),
- vue.createVNode(_component_up_tabbar_item, {
- text: "放映厅",
- icon: "photo"
- }),
- vue.createVNode(_component_up_tabbar_item, {
- text: "直播",
- icon: "play-right"
- }),
- vue.createVNode(_component_up_tabbar_item, {
- text: "我的",
- icon: "account"
- })
- ]),
- _: 1
- /* STABLE */
- })
- ], true)
- ])
- ]);
- }
- const uShortVideo = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$E], ["__scopeId", "data-v-577dd224"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-short-video/u-short-video.vue"]]);
- const __vite_glob_0_94 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uShortVideo
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$E = {
- name: "u-signature",
- props: {
- // 画布宽度
- width: {
- type: [String, Number],
- default: 300
- },
- // 画布高度
- height: {
- type: [String, Number],
- default: 200
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: "#ffffff"
- },
- // 默认笔画颜色
- color: {
- type: String,
- default: "#000000"
- },
- // 默认笔画粗细
- thickness: {
- type: [String, Number],
- default: 3
- },
- // 是否显示工具栏
- showToolbar: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {
- canvasId: "u-signature-" + Math.random().toString(36).substr(2, 9),
- canvasWidth: 300,
- canvasHeight: 200,
- lineColor: "#000000",
- lineWidth: 3,
- isDrawing: false,
- pathStack: [],
- // 存储绘制路径用于回退
- currentPath: [],
- // 当前绘制路径
- ctx: null,
- isEmpty: true,
- presetColors: [
- "#000000",
- // 黑色
- "#ff0000",
- // 红色
- "#00ff00",
- // 绿色
- "#0000ff",
- // 蓝色
- "#ffff00",
- // 黄色
- "#00ffff",
- // 青色
- "#ff00ff",
- // 紫色
- "#ffffff"
- // 白色
- ],
- showBrushSettings: false,
- showColorSettings: false,
- lastPoint: null
- // 保存上一个点的坐标
- };
- },
- mounted() {
- this.initCanvas();
- },
- watch: {
- width: {
- handler(newVal) {
- this.canvasWidth = Number(newVal);
- },
- immediate: true
- },
- height: {
- handler(newVal) {
- this.canvasHeight = Number(newVal);
- },
- immediate: true
- },
- color: {
- handler(newVal) {
- this.lineColor = newVal;
- },
- immediate: true
- },
- thickness: {
- handler(newVal) {
- this.lineWidth = Number(newVal);
- },
- immediate: true
- }
- },
- methods: {
- initCanvas() {
- const ctx = uni.createCanvasContext(this.canvasId, this);
- this.ctx = ctx;
- this.clearCanvas();
- },
- touchStart(e2) {
- if (!this.ctx)
- return;
- this.isDrawing = true;
- this.isEmpty = false;
- this.currentPath = [];
- const { x: x2, y: y2 } = this.getCanvasPoint(e2);
- this.ctx.beginPath();
- this.ctx.moveTo(x2, y2);
- this.ctx.setLineCap("round");
- this.ctx.setLineJoin("round");
- this.ctx.setStrokeStyle(this.lineColor);
- this.ctx.setLineWidth(this.lineWidth);
- this.currentPath.push({
- x: x2,
- y: y2,
- type: "start",
- color: this.lineColor,
- width: this.lineWidth
- });
- this.lastPoint = { x: x2, y: y2 };
- e2.preventDefault();
- },
- touchMove(e2) {
- if (!this.isDrawing || !this.ctx)
- return;
- e2.preventDefault();
- const { x: x2, y: y2 } = this.getCanvasPoint(e2);
- if (this.lastPoint) {
- const distance = Math.sqrt(Math.pow(x2 - this.lastPoint.x, 2) + Math.pow(y2 - this.lastPoint.y, 2));
- const steps = Math.max(1, Math.floor(distance / 1));
- for (let i2 = 1; i2 <= steps; i2++) {
- const t2 = i2 / steps;
- const midX = this.lastPoint.x + (x2 - this.lastPoint.x) * t2;
- const midY = this.lastPoint.y + (y2 - this.lastPoint.y) * t2;
- this.ctx.lineTo(midX, midY);
- this.ctx.stroke();
- this.currentPath.push({
- x: midX,
- y: midY,
- type: "move"
- });
- }
- } else {
- this.ctx.lineTo(x2, y2);
- this.ctx.stroke();
- this.currentPath.push({
- x: x2,
- y: y2,
- type: "move"
- });
- }
- this.ctx.draw(true);
- this.lastPoint = { x: x2, y: y2 };
- },
- touchEnd(e2) {
- if (!this.isDrawing || !this.ctx)
- return;
- this.isDrawing = false;
- this.ctx.closePath();
- this.lastPoint = null;
- if (this.currentPath.length > 0) {
- this.pathStack.push([...this.currentPath]);
- }
- },
- // 同步获取canvas坐标点(兼容处理)
- getCanvasPoint(e2) {
- const touch = e2.touches[0];
- uni.createSelectorQuery().in(this).select(".u-signature__canvas");
- return {
- x: touch.x,
- y: touch.y
- };
- },
- // 选择颜色
- selectColor(color2) {
- this.lineColor = color2;
- },
- // 回退操作
- undo() {
- if (this.pathStack.length === 0)
- return;
- this.pathStack.pop();
- this.redraw();
- },
- // 重新绘制所有路径
- redraw() {
- this.clearCanvas();
- if (this.pathStack.length === 0) {
- this.isEmpty = true;
- return;
- }
- this.isEmpty = false;
- this.pathStack.forEach((path) => {
- if (path.length === 0)
- return;
- this.ctx.beginPath();
- this.ctx.setLineCap("round");
- this.ctx.setLineJoin("round");
- path.forEach((point, index2) => {
- if (index2 === 0 && point.type === "start") {
- this.ctx.setStrokeStyle(point.color);
- this.ctx.setLineWidth(point.width);
- this.ctx.moveTo(point.x, point.y);
- ({ x: point.x, y: point.y });
- } else if (point.type === "move") {
- this.ctx.lineTo(point.x, point.y);
- ({ x: point.x, y: point.y });
- }
- });
- this.ctx.stroke();
- this.ctx.draw(true);
- });
- },
- // 清空画布
- clear() {
- this.pathStack = [];
- this.currentPath = [];
- this.isEmpty = true;
- this.lastPoint = null;
- this.clearCanvas();
- },
- // 清空画布内容
- clearCanvas() {
- if (!this.ctx)
- return;
- this.ctx.setFillStyle(this.bgColor);
- this.ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight);
- this.ctx.draw();
- },
- // 导出签名图片
- exportSignature() {
- if (this.isEmpty)
- return;
- uni.canvasToTempFilePath({
- canvasId: this.canvasId,
- fileType: "png",
- quality: 1,
- success: (res) => {
- this.$emit("confirm", res.tempFilePath);
- },
- fail: (err) => {
- this.$emit("error", err);
- }
- }, this);
- },
- // 切换笔画设置显示
- toggleBrushSettings() {
- this.showBrushSettings = !this.showBrushSettings;
- if (this.showBrushSettings) {
- this.showColorSettings = false;
- }
- },
- // 切换颜色设置显示
- toggleColorSettings() {
- this.showColorSettings = !this.showColorSettings;
- if (this.showColorSettings) {
- this.showBrushSettings = false;
- }
- }
- }
- };
- function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_up_slider = vue.resolveComponent("up-slider");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-signature" }, [
- vue.createElementVNode("view", { class: "u-signature__canvas-wrap" }, [
- vue.createElementVNode("canvas", {
- class: "u-signature__canvas",
- "canvas-id": $data.canvasId,
- "disable-scroll": true,
- onTouchstart: _cache[0] || (_cache[0] = (...args) => $options.touchStart && $options.touchStart(...args)),
- onTouchmove: _cache[1] || (_cache[1] = (...args) => $options.touchMove && $options.touchMove(...args)),
- onTouchend: _cache[2] || (_cache[2] = (...args) => $options.touchEnd && $options.touchEnd(...args)),
- style: vue.normalizeStyle({
- width: $data.canvasWidth + "px",
- height: $data.canvasHeight + "px",
- background: $props.bgColor
- })
- }, null, 44, ["canvas-id"])
- ]),
- $props.showToolbar ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-signature__toolbar"
- }, [
- vue.createElementVNode("view", { class: "u-signature__toolbar-icons u-flex u-flex-x" }, [
- vue.createElementVNode("view", {
- class: "u-signature__toolbar-icon",
- onClick: _cache[3] || (_cache[3] = (...args) => $options.undo && $options.undo(...args))
- }, [
- vue.createVNode(_component_up_icon, {
- name: "arrow-left",
- size: "22",
- color: $data.pathStack.length === 0 ? "#ccc" : "#999"
- }, null, 8, ["color"])
- ]),
- vue.createElementVNode("view", {
- class: "u-signature__toolbar-icon",
- onClick: _cache[4] || (_cache[4] = (...args) => $options.clear && $options.clear(...args))
- }, [
- vue.createVNode(_component_up_icon, {
- name: "trash",
- size: "25",
- color: "#999"
- })
- ]),
- vue.createElementVNode("view", {
- class: "u-signature__toolbar-icon",
- onClick: _cache[5] || (_cache[5] = (...args) => $options.toggleBrushSettings && $options.toggleBrushSettings(...args))
- }, [
- vue.createVNode(_component_up_icon, {
- name: "edit-pen",
- size: "25",
- color: "#999"
- })
- ]),
- vue.createElementVNode("view", {
- class: "u-signature__toolbar-icon",
- onClick: _cache[6] || (_cache[6] = (...args) => $options.toggleColorSettings && $options.toggleColorSettings(...args))
- }, [
- vue.createVNode(_component_up_icon, {
- name: "grid",
- size: "24",
- color: "#999"
- })
- ]),
- vue.createElementVNode("view", {
- class: "u-signature__toolbar-icon",
- onClick: _cache[7] || (_cache[7] = (...args) => $options.exportSignature && $options.exportSignature(...args))
- }, [
- vue.createVNode(_component_up_icon, {
- name: "checkmark",
- size: "25",
- color: $data.isEmpty ? "#ccc" : "#999"
- }, null, 8, ["color"])
- ])
- ]),
- vue.createCommentVNode(" 笔画设置 "),
- $data.showBrushSettings ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-signature__brush-settings"
- }, [
- vue.createElementVNode("view", { class: "u-signature__progress" }, [
- vue.createElementVNode(
- "text",
- { class: "u-signature__progress-label" },
- vue.toDisplayString(_ctx.t("up.signature.penSize")) + ":",
- 1
- /* TEXT */
- ),
- vue.createVNode(_component_up_slider, {
- modelValue: $data.lineWidth,
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.lineWidth = $event),
- min: 1,
- max: 20,
- step: 1,
- onShowValue: ($event) => true,
- "value-show": $data.lineWidth
- }, null, 8, ["modelValue", "value-show"])
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 颜色设置 "),
- $data.showColorSettings ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-signature__color-settings"
- }, [
- vue.createElementVNode("view", { class: "u-signature__color-picker" }, [
- vue.createElementVNode(
- "text",
- { class: "u-signature__color-label" },
- vue.toDisplayString(_ctx.t("up.signature.penColor")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "u-signature__colors" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.presetColors, (color2, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: vue.normalizeClass(["u-signature__color-item", { "u-signature__color-item--active": $data.lineColor === color2 }]),
- style: vue.normalizeStyle({ backgroundColor: color2 }),
- onClick: ($event) => $options.selectColor(color2)
- }, null, 14, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ])
- ])) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const uSignature = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$D], ["__scopeId", "data-v-374dbb3e"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-signature/u-signature.vue"]]);
- const __vite_glob_0_95 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSignature
- }, Symbol.toStringTag, { value: "Module" }));
- const props$n = defineMixin({
- props: {
- // 是否展示骨架组件
- loading: {
- type: Boolean,
- default: () => props$1x.skeleton.loading
- },
- // 是否开启动画效果
- animate: {
- type: Boolean,
- default: () => props$1x.skeleton.animate
- },
- // 段落占位图行数
- rows: {
- type: [String, Number],
- default: () => props$1x.skeleton.rows
- },
- // 段落占位图的宽度
- rowsWidth: {
- type: [String, Number, Array],
- default: () => props$1x.skeleton.rowsWidth
- },
- // 段落占位图的高度
- rowsHeight: {
- type: [String, Number, Array],
- default: () => props$1x.skeleton.rowsHeight
- },
- // 是否展示标题占位图
- title: {
- type: Boolean,
- default: () => props$1x.skeleton.title
- },
- // 段落标题的宽度
- titleWidth: {
- type: [String, Number],
- default: () => props$1x.skeleton.titleWidth
- },
- // 段落标题的高度
- titleHeight: {
- type: [String, Number],
- default: () => props$1x.skeleton.titleHeight
- },
- // 是否展示头像占位图
- avatar: {
- type: Boolean,
- default: () => props$1x.skeleton.avatar
- },
- // 头像占位图大小
- avatarSize: {
- type: [String, Number],
- default: () => props$1x.skeleton.avatarSize
- },
- // 头像占位图的形状,circle-圆形,square-方形
- avatarShape: {
- type: String,
- default: () => props$1x.skeleton.avatarShape
- }
- }
- });
- const _sfc_main$D = {
- name: "u-skeleton",
- mixins: [mpMixin, mixin, props$n],
- data() {
- return {
- width: 0
- };
- },
- watch: {
- loading() {
- this.getComponentWidth();
- }
- },
- computed: {
- rowsArray() {
- if (/%$/.test(this.rowsHeight)) {
- error("rowsHeight参数不支持百分比单位");
- }
- const rows = [];
- for (let i2 = 0; i2 < this.rows; i2++) {
- let item = {}, rowWidth = test.array(this.rowsWidth) ? this.rowsWidth[i2] || (i2 === this.rows - 1 ? "70%" : "100%") : i2 === this.rows - 1 ? "70%" : this.rowsWidth, rowHeight = test.array(this.rowsHeight) ? this.rowsHeight[i2] || "18px" : this.rowsHeight;
- item.marginTop = !this.title && i2 === 0 ? 0 : this.title && i2 === 0 ? "20px" : "12px";
- if (/%$/.test(rowWidth)) {
- item.width = addUnit(this.width * parseInt(rowWidth) / 100);
- } else {
- item.width = addUnit(rowWidth);
- }
- item.height = addUnit(rowHeight);
- rows.push(item);
- }
- return rows;
- },
- uTitleWidth() {
- let tWidth = 0;
- if (/%$/.test(this.titleWidth)) {
- tWidth = addUnit(this.width * parseInt(this.titleWidth) / 100);
- } else {
- tWidth = addUnit(this.titleWidth);
- }
- return addUnit(tWidth);
- }
- },
- mounted() {
- this.init();
- },
- methods: {
- addUnit,
- init() {
- this.getComponentWidth();
- },
- async setNvueAnimation() {
- },
- // 获取组件的宽度
- async getComponentWidth() {
- await sleep(20);
- this.$uGetRect(".u-skeleton__wrapper__content").then((size) => {
- this.width = size.width;
- });
- }
- }
- };
- function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-skeleton" }, [
- _ctx.loading ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-skeleton__wrapper",
- ref: "u-skeleton__wrapper",
- style: { "display": "flex", "flex-direction": "row" }
- },
- [
- _ctx.avatar ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-skeleton__wrapper__avatar", [`u-skeleton__wrapper__avatar--${_ctx.avatarShape}`, _ctx.animate && "animate"]]),
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.avatarSize),
- width: $options.addUnit(_ctx.avatarSize)
- })
- },
- null,
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "u-skeleton__wrapper__content",
- ref: "u-skeleton__wrapper__content",
- style: { "flex": "1" }
- },
- [
- _ctx.title ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-skeleton__wrapper__content__title", [_ctx.animate && "animate"]]),
- style: vue.normalizeStyle({
- width: $options.uTitleWidth,
- height: $options.addUnit(_ctx.titleHeight)
- })
- },
- null,
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.rowsArray, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-skeleton__wrapper__content__rows", [_ctx.animate && "animate"]]),
- key: index2,
- style: vue.normalizeStyle({
- width: item.width,
- height: item.height,
- marginTop: item.marginTop
- })
- },
- null,
- 6
- /* CLASS, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 512
- /* NEED_PATCH */
- )
- ],
- 512
- /* NEED_PATCH */
- )) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true)
- ]);
- }
- const uSkeleton = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$C], ["__scopeId", "data-v-b376446f"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-skeleton/u-skeleton.vue"]]);
- const __vite_glob_0_96 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSkeleton
- }, Symbol.toStringTag, { value: "Module" }));
- const props$m = defineMixin({
- props: {
- // 最小可选值
- min: {
- type: [Number, String],
- default: () => props$1x.slider.min
- },
- // 最大可选值
- max: {
- type: [Number, String],
- default: () => props$1x.slider.max
- },
- // 步长,取值必须大于 0,并且可被(max - min)整除
- step: {
- type: [Number, String],
- default: () => props$1x.slider.step
- },
- // 当前取值
- modelValue: {
- type: [String, Number],
- default: () => props$1x.slider.value
- },
- // 是否区间模式
- isRange: {
- type: Boolean,
- default: false
- },
- // 双滑块时值
- rangeValue: {
- type: [Array],
- default: [0, 0]
- },
- // 滑块右侧已选择部分的背景色
- activeColor: {
- type: String,
- default: () => props$1x.slider.activeColor
- },
- // 滑块左侧未选择部分的背景色
- inactiveColor: {
- type: String,
- default: () => props$1x.slider.inactiveColor
- },
- // 滑块的大小,取值范围为 12 - 28
- blockSize: {
- type: [Number, String],
- default: () => props$1x.slider.blockSize
- },
- // 滑块的颜色
- blockColor: {
- type: String,
- default: () => props$1x.slider.blockColor
- },
- // 用户对滑块的自定义颜色
- blockStyle: {
- type: Object,
- default: () => props$1x.slider.blockStyle
- },
- // 禁用状态
- disabled: {
- type: Boolean,
- default: () => props$1x.slider.disabled
- },
- // 是否显示当前的选择值
- showValue: {
- type: Boolean,
- default: () => props$1x.slider.showValue
- },
- // 是否渲染uni-app框架内置组件
- useNative: {
- type: Boolean,
- default: () => props$1x.slider.useNative
- },
- // 滑块高度
- height: {
- type: String,
- default: () => props$1x.slider.height
- },
- innerStyle: {
- type: Object,
- default: () => props$1x.slider.innerStyle
- }
- }
- });
- const _sfc_main$C = {
- name: "u-slider",
- mixins: [mpMixin, mixin, props$m],
- emits: ["start", "changing", "change", "update:modelValue"],
- data() {
- return {
- startX: 0,
- status: "end",
- newValue: 0,
- distanceX: 0,
- startValue0: 0,
- startValue: 0,
- barStyle0: {},
- barStyle: {},
- sliderRect: {
- left: 0,
- width: 0
- }
- };
- },
- watch: {
- modelValue(n2) {
- if (this.status == "end") {
- const $crtFmtValue = this.updateValue(this.modelValue, false);
- this.$emit("change", $crtFmtValue);
- }
- },
- rangeValue: {
- handler(n2) {
- if (this.status == "end") {
- this.updateValue(this.rangeValue[0], false, 0);
- this.updateValue(this.rangeValue[1], false, 1);
- this.$emit("change", this.rangeValue);
- }
- },
- deep: true
- }
- },
- created() {
- },
- computed: {
- innerStyleCpu() {
- let style = this.innerStyle;
- style.height = this.isRange && this.showValue ? getPx(this.blockSize) + 24 + "px" : getPx(this.blockSize) + "px";
- return style;
- }
- },
- async mounted() {
- if (!this.useNative) {
- this.$uGetRect(".u-slider__base").then((rect) => {
- this.sliderRect = rect;
- if (this.sliderRect.width == 0) {
- formatAppLog("info", "at uni_modules/uview-plus/components/u-slider/u-slider.vue:193", "如在弹窗等元素中使用,请使用v-if来显示滑块,否则无法计算长度。");
- }
- this.init();
- });
- }
- },
- methods: {
- addStyle,
- getPx,
- init() {
- if (this.isRange) {
- this.updateValue(this.rangeValue[0], false, 0);
- this.updateValue(this.rangeValue[1], false, 1);
- } else {
- this.updateValue(this.modelValue, false);
- }
- },
- // native拖动过程中触发
- changingHandler(e2) {
- const {
- value: value2
- } = e2.detail;
- this.$emit("update:modelValue", value2);
- this.$emit("changing", value2);
- },
- // native滑动结束时触发
- changeHandler(e2) {
- const {
- value: value2
- } = e2.detail;
- this.$emit("update:modelValue", value2);
- this.$emit("change", value2);
- },
- onTouchStart(event, index2 = 1) {
- if (this.disabled)
- return;
- this.startX = 0;
- let touches = event.touches[0];
- this.startX = touches.clientX;
- if (this.isRange) {
- this.startValue0 = this.format(this.rangeValue[0], 0);
- this.startValue = this.format(this.rangeValue[1], 1);
- } else {
- this.startValue = this.format(this.modelValue);
- }
- this.status = "start";
- let clientX = 0;
- clientX = touches.clientX;
- this.distanceX = clientX - this.sliderRect.left;
- this.newValue = this.distanceX / this.sliderRect.width * (this.max - this.min) + parseFloat(this.min);
- this.status = "moving";
- let $crtFmtValue = this.updateValue(this.newValue, true, index2);
- this.$emit("changing", $crtFmtValue);
- },
- onTouchMove(event, index2 = 1) {
- if (this.disabled)
- return;
- if (this.status == "start")
- this.$emit("start");
- let touches = event.touches[0];
- let clientX = 0;
- clientX = touches.clientX;
- this.distanceX = clientX - this.sliderRect.left;
- this.newValue = this.distanceX / this.sliderRect.width * (this.max - this.min) + parseFloat(this.min);
- this.status = "moving";
- let $crtFmtValue = this.updateValue(this.newValue, true, index2);
- this.$emit("changing", $crtFmtValue);
- },
- onTouchEnd(event, index2 = 1) {
- if (this.disabled)
- return;
- if (this.status === "moving") {
- let $crtFmtValue = this.updateValue(this.newValue, false, index2);
- this.$emit("change", $crtFmtValue);
- }
- this.status = "end";
- },
- onTouchStart2(event, index2 = 1) {
- if (!this.isRange)
- ;
- },
- onTouchMove2(event, index2 = 1) {
- if (!this.isRange)
- ;
- },
- onTouchEnd2(event, index2 = 1) {
- if (!this.isRange)
- ;
- },
- onClick(event) {
- if (this.disabled)
- return;
- let clientX = event.detail.x - this.sliderRect.left;
- this.newValue = clientX / this.sliderRect.width * (this.max - this.min) + parseFloat(this.min);
- this.updateValue(this.newValue, false, 1);
- },
- updateValue(value2, drag, index2 = 1) {
- let valueFormat = this.format(value2, index2);
- if (valueFormat > this.max) {
- valueFormat = this.max;
- }
- let width = Math.min((valueFormat - this.min) / (this.max - this.min) * this.sliderRect.width, this.sliderRect.width);
- let barStyle = {
- width: width + "px"
- };
- if (drag == true) {
- barStyle.transition = "none";
- } else {
- delete barStyle.transition;
- }
- if (this.isRange) {
- this.rangeValue[index2] = valueFormat;
- this.$emit("update:modelValue", this.rangeValue);
- } else {
- this.$emit("update:modelValue", valueFormat);
- }
- switch (index2) {
- case 0:
- this.barStyle0 = { ...barStyle };
- break;
- case 1:
- this.barStyle = { ...barStyle };
- break;
- }
- if (this.isRange) {
- return this.rangeValue;
- } else {
- return valueFormat;
- }
- },
- format(value2, index2 = 1) {
- if (this.isRange) {
- switch (index2) {
- case 0:
- return Math.round(
- Math.max(this.min, Math.min(value2, this.rangeValue[1] - parseInt(this.step), this.max)) / parseInt(this.step)
- ) * parseInt(this.step);
- case 1:
- return Math.round(
- Math.max(this.min, this.rangeValue[0] + parseInt(this.step), Math.min(value2, this.max)) / parseInt(this.step)
- ) * parseInt(this.step);
- }
- } else {
- return Math.round(
- Math.max(this.min, Math.min(value2, this.max)) / parseInt(this.step)
- ) * parseInt(this.step);
- }
- }
- }
- };
- function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-slider",
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)])
- },
- [
- !_ctx.useNative || _ctx.isRange ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createElementVNode(
- "view",
- {
- ref: "u-slider-inner",
- class: vue.normalizeClass(["u-slider-inner", [_ctx.disabled ? "u-slider--disabled" : ""]]),
- onClick: _cache[9] || (_cache[9] = (...args) => $options.onClick && $options.onClick(...args)),
- "on:onTouchStart": _cache[10] || (_cache[10] = ($event) => $options.onTouchStart2($event, 1)),
- onTouchmove: _cache[11] || (_cache[11] = ($event) => $options.onTouchMove2($event, 1)),
- onTouchend: _cache[12] || (_cache[12] = ($event) => $options.onTouchEnd2($event, 1)),
- onTouchcancel: _cache[13] || (_cache[13] = ($event) => $options.onTouchEnd2($event, 1)),
- style: vue.normalizeStyle($options.innerStyleCpu)
- },
- [
- vue.createElementVNode(
- "view",
- {
- ref: "u-slider__base",
- class: "u-slider__base",
- style: vue.normalizeStyle([
- {
- height: _ctx.height,
- backgroundColor: _ctx.inactiveColor
- }
- ])
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args)),
- class: "u-slider__gap",
- style: vue.normalizeStyle([
- $data.barStyle,
- {
- height: _ctx.height,
- marginTop: "-" + _ctx.height,
- backgroundColor: _ctx.activeColor
- }
- ])
- },
- null,
- 4
- /* STYLE */
- ),
- _ctx.isRange ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-slider__gap u-slider__gap-0",
- style: vue.normalizeStyle([
- $data.barStyle0,
- {
- height: _ctx.height,
- marginTop: "-" + _ctx.height,
- backgroundColor: _ctx.inactiveColor
- }
- ])
- },
- null,
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.isRange && _ctx.showValue ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "u-slider__show-range-value",
- style: vue.normalizeStyle({ left: $options.getPx($data.barStyle0.width) + $options.getPx(_ctx.blockSize) / 2 + "px" })
- },
- vue.toDisplayString(this.rangeValue[0]),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.isRange && _ctx.showValue ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 2,
- class: "u-slider__show-range-value",
- style: vue.normalizeStyle({ left: $options.getPx($data.barStyle.width) + $options.getPx(_ctx.blockSize) / 2 + "px" })
- },
- vue.toDisplayString(this.rangeValue[1]),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.isRange ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 3,
- class: "u-slider__button-wrap u-slider__button-wrap-0",
- onTouchstart: _cache[1] || (_cache[1] = ($event) => $options.onTouchStart($event, 0)),
- onTouchmove: _cache[2] || (_cache[2] = ($event) => $options.onTouchMove($event, 0)),
- onTouchend: _cache[3] || (_cache[3] = ($event) => $options.onTouchEnd($event, 0)),
- onTouchcancel: _cache[4] || (_cache[4] = ($event) => $options.onTouchEnd($event, 0)),
- style: vue.normalizeStyle({ left: $options.getPx($data.barStyle0.width) + $options.getPx(_ctx.blockSize) / 2 + "px" })
- },
- [
- _ctx.$slots.min || _ctx.$slots.$min ? vue.renderSlot(_ctx.$slots, "min", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "u-slider__button",
- style: vue.normalizeStyle([_ctx.blockStyle, {
- height: $options.getPx(_ctx.blockSize, true),
- width: $options.getPx(_ctx.blockSize, true),
- backgroundColor: _ctx.blockColor
- }])
- },
- null,
- 4
- /* STYLE */
- ))
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "u-slider__button-wrap",
- onTouchstart: _cache[5] || (_cache[5] = (...args) => $options.onTouchStart && $options.onTouchStart(...args)),
- onTouchmove: _cache[6] || (_cache[6] = (...args) => $options.onTouchMove && $options.onTouchMove(...args)),
- onTouchend: _cache[7] || (_cache[7] = (...args) => $options.onTouchEnd && $options.onTouchEnd(...args)),
- onTouchcancel: _cache[8] || (_cache[8] = (...args) => $options.onTouchEnd && $options.onTouchEnd(...args)),
- style: vue.normalizeStyle({ left: $options.getPx($data.barStyle.width) + $options.getPx(_ctx.blockSize) / 2 + "px" })
- },
- [
- _ctx.isRange && (_ctx.$slots.max || _ctx.$slots.$max) ? vue.renderSlot(_ctx.$slots, "max", { key: 0 }, void 0, true) : _ctx.$slots.default || _ctx.$slots.$default ? vue.renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "u-slider__button",
- style: vue.normalizeStyle([_ctx.blockStyle, {
- height: $options.getPx(_ctx.blockSize, true),
- width: $options.getPx(_ctx.blockSize, true),
- backgroundColor: _ctx.blockColor
- }])
- },
- null,
- 4
- /* STYLE */
- ))
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- )
- ],
- 38
- /* CLASS, STYLE, NEED_HYDRATION */
- ),
- _ctx.showValue && !_ctx.isRange ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-slider__show-value"
- },
- vue.toDisplayString(_ctx.modelValue),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock("slider", {
- key: 1,
- class: "u-slider__native",
- min: _ctx.min,
- max: _ctx.max,
- step: _ctx.step,
- value: _ctx.modelValue,
- activeColor: _ctx.activeColor,
- backgroundColor: _ctx.inactiveColor,
- blockSize: $options.getPx(_ctx.blockSize),
- blockColor: _ctx.blockColor,
- showValue: _ctx.showValue,
- disabled: _ctx.disabled,
- onChanging: _cache[14] || (_cache[14] = (...args) => $options.changingHandler && $options.changingHandler(...args)),
- onChange: _cache[15] || (_cache[15] = (...args) => $options.changeHandler && $options.changeHandler(...args))
- }, null, 40, ["min", "max", "step", "value", "activeColor", "backgroundColor", "blockSize", "blockColor", "showValue", "disabled"]))
- ],
- 4
- /* STYLE */
- );
- }
- const uSlider = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$B], ["__scopeId", "data-v-7b84e269"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-slider/u-slider.vue"]]);
- const __vite_glob_0_97 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSlider
- }, Symbol.toStringTag, { value: "Module" }));
- const props$l = defineMixin({
- props: {
- // 标题
- title: {
- type: [String, Number],
- default: () => props$1x.stepsItem.title
- },
- // 描述文本
- desc: {
- type: [String, Number],
- default: () => props$1x.stepsItem.desc
- },
- // 图标大小
- iconSize: {
- type: [String, Number],
- default: () => props$1x.stepsItem.iconSize
- },
- // 当前步骤是否处于失败状态
- error: {
- type: Boolean,
- default: () => props$1x.stepsItem.error
- },
- // 自定义样式
- itemStyle: {
- type: [Object],
- default: {}
- }
- }
- });
- const _sfc_main$B = {
- name: "u-steps-item",
- mixins: [mpMixin, mixin, props$l],
- data() {
- return {
- index: 0,
- childLength: 0,
- showLine: false,
- size: {
- height: 0,
- width: 0
- },
- parentData: {
- direction: "row",
- current: 0,
- activeColor: "",
- inactiveColor: "",
- activeIcon: "",
- inactiveIcon: "",
- dot: false
- }
- };
- },
- watch: {
- "parentData"(newValue, oldValue) {
- }
- },
- created() {
- this.init();
- },
- computed: {
- lineStyle() {
- var _a2, _b;
- const style = {};
- if (this.parentData.direction === "row") {
- style.width = this.size.width + "px";
- style.left = this.size.width / 2 + "px";
- } else {
- style.height = this.size.height + "px";
- }
- style.backgroundColor = ((_b = (_a2 = this.parent.children) == null ? void 0 : _a2[this.index + 1]) == null ? void 0 : _b.error) ? color$3.error : this.index < this.parentData.current ? this.parentData.activeColor : this.parentData.inactiveColor;
- return style;
- },
- itemStyleInner() {
- return {
- ...this.itemStyle
- };
- },
- statusClass() {
- const {
- index: index2,
- error: error2
- } = this;
- const {
- current
- } = this.parentData;
- if (current == index2) {
- return error2 === true ? "error" : "process";
- } else if (error2) {
- return "error";
- } else if (current > index2) {
- return "finish";
- } else {
- return "wait";
- }
- },
- statusColor() {
- let colorTmp = "";
- switch (this.statusClass) {
- case "finish":
- colorTmp = this.parentData.activeColor;
- break;
- case "error":
- colorTmp = color$3.error;
- break;
- case "process":
- colorTmp = this.parentData.dot ? this.parentData.activeColor : "transparent";
- break;
- default:
- colorTmp = this.parentData.inactiveColor;
- break;
- }
- return colorTmp;
- },
- contentStyle() {
- const style = {};
- if (this.parentData.direction === "column") {
- style.marginLeft = this.parentData.dot ? "2px" : "6px";
- style.marginTop = this.parentData.dot ? "0px" : "6px";
- } else {
- style.marginTop = this.parentData.dot ? "2px" : "6px";
- style.marginLeft = this.parentData.dot ? "2px" : "6px";
- }
- return style;
- }
- },
- mounted() {
- this.parent && this.parent.updateFromChild();
- sleep().then(() => {
- this.getStepsItemRect();
- });
- },
- methods: {
- init() {
- this.updateParentData();
- if (!this.parent) {
- return error("u-steps-item必须要搭配u-steps组件使用");
- }
- this.index = this.parent.children.indexOf(this);
- this.childLength = this.parent.children.length;
- },
- updateParentData() {
- this.getParentData("u-steps");
- },
- // 父组件数据发生变化
- updateFromParent() {
- this.init();
- },
- // 获取组件的尺寸,用于设置横线的位置
- getStepsItemRect() {
- this.$uGetRect(".u-steps-item").then((size) => {
- this.size = size;
- });
- }
- }
- };
- function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_up_text = vue.resolveComponent("up-text");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-steps-item", [`u-steps-item--${$data.parentData.direction}`]]),
- ref: "u-steps-item"
- },
- [
- $data.index + 1 < $data.childLength ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-steps-item__line", [`u-steps-item__line--${$data.parentData.direction}`]]),
- style: vue.normalizeStyle([$options.lineStyle])
- },
- null,
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-steps-item__wrapper", [`u-steps-item__wrapper--${$data.parentData.direction}`, $data.parentData.dot && `u-steps-item__wrapper--${$data.parentData.direction}--dot`]]),
- style: vue.normalizeStyle([$options.itemStyleInner])
- },
- [
- vue.renderSlot(_ctx.$slots, "icon", {}, () => [
- $data.parentData.dot ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-steps-item__wrapper__dot",
- style: vue.normalizeStyle({
- backgroundColor: $options.statusColor
- })
- },
- null,
- 4
- /* STYLE */
- )) : $data.parentData.activeIcon || $data.parentData.inactiveIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-steps-item__wrapper__icon"
- }, [
- vue.createVNode(_component_up_icon, {
- name: $data.index <= $data.parentData.current ? $data.parentData.activeIcon : $data.parentData.inactiveIcon,
- size: _ctx.iconSize,
- color: $data.index <= $data.parentData.current ? $data.parentData.activeColor : $data.parentData.inactiveColor
- }, null, 8, ["name", "size", "color"])
- ])) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- style: vue.normalizeStyle({
- backgroundColor: $options.statusClass === "process" ? $data.parentData.activeColor : "transparent",
- borderColor: $options.statusColor
- }),
- class: "u-steps-item__wrapper__circle"
- },
- [
- $options.statusClass === "process" || $options.statusClass === "wait" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-steps-item__wrapper__circle__text",
- style: vue.normalizeStyle({
- color: $data.index == $data.parentData.current ? "#ffffff" : $data.parentData.inactiveColor
- })
- },
- vue.toDisplayString($data.index + 1),
- 5
- /* TEXT, STYLE */
- )) : (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- color: $options.statusClass === "error" ? "error" : $data.parentData.activeColor,
- size: "12",
- name: $options.statusClass === "error" ? "close" : "checkmark"
- }, null, 8, ["color", "name"]))
- ],
- 4
- /* STYLE */
- ))
- ], true)
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-steps-item__content", [
- `u-steps-item__content--${$data.parentData.direction}`,
- $data.parentData.current == $data.index ? "u-steps-item__content--current" : ""
- ]]),
- style: vue.normalizeStyle([$options.contentStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "content", { index: $data.index }, void 0, true),
- !_ctx.$slots["content"] ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createElementVNode("view", { class: "u-steps-item__content__title" }, [
- vue.renderSlot(_ctx.$slots, "title", {}, void 0, true),
- !_ctx.$slots["title"] ? (vue.openBlock(), vue.createBlock(_component_up_text, {
- key: 0,
- text: _ctx.title,
- type: $data.parentData.current == $data.index ? "main" : "content",
- lineHeight: "20px",
- size: $data.parentData.current == $data.index ? 14 : 13
- }, null, 8, ["text", "type", "size"])) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", { class: "u-steps-item__content__desc" }, [
- vue.renderSlot(_ctx.$slots, "desc", {}, void 0, true),
- !_ctx.$slots["desc"] ? (vue.openBlock(), vue.createBlock(_component_up_text, {
- key: 0,
- text: _ctx.desc,
- type: "tips",
- size: "12"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createCommentVNode(' <view\r\n class="u-steps-item__line"\r\n v-if="showLine && parentData.direction === \'column\'"\r\n :class="[`u-steps-item__line--${parentData.direction}`]"\r\n :style="[lineStyle]"\r\n ></view> ')
- ],
- 2
- /* CLASS */
- );
- }
- const uStepsItem = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$A], ["__scopeId", "data-v-3c8d19a1"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-steps-item/u-steps-item.vue"]]);
- const __vite_glob_0_99 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uStepsItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$k = defineMixin({
- props: {
- // 排列方向
- direction: {
- type: String,
- default: () => props$1x.steps.direction
- },
- // 设置第几个步骤
- current: {
- type: [String, Number],
- default: () => props$1x.steps.current
- },
- // 激活状态颜色
- activeColor: {
- type: String,
- default: () => props$1x.steps.activeColor
- },
- // 未激活状态颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.steps.inactiveColor
- },
- // 激活状态的图标
- activeIcon: {
- type: String,
- default: () => props$1x.steps.activeIcon
- },
- // 未激活状态图标
- inactiveIcon: {
- type: String,
- default: () => props$1x.steps.inactiveIcon
- },
- // 是否显示点类型
- dot: {
- type: Boolean,
- default: () => props$1x.steps.dot
- }
- }
- });
- const _sfc_main$A = {
- name: "u-steps",
- mixins: [mpMixin, mixin, props$k],
- data() {
- return {};
- },
- watch: {
- children() {
- this.updateChildData();
- },
- parentData() {
- this.updateChildData();
- }
- },
- computed: {
- // 监听参数的变化,通过watch中,手动去更新子组件的数据,否则子组件不会自动变化
- parentData() {
- return [this.current, this.direction, this.activeColor, this.inactiveColor, this.activeIcon, this.inactiveIcon, this.dot];
- }
- },
- methods: {
- // 更新子组件的数据
- updateChildData() {
- this.children.map((child) => {
- test.func((child || {}).updateFromParent()) && child.updateFromParent();
- });
- },
- // 接受子组件的通知,去修改其他子组件的数据
- updateFromChild() {
- this.updateChildData();
- }
- },
- created() {
- this.children = [];
- },
- options: {
- virtualHost: false
- }
- };
- function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-steps", [`u-steps--${_ctx.direction}`]])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 2
- /* CLASS */
- );
- }
- const uSteps = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$z], ["__scopeId", "data-v-504c0814"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-steps/u-steps.vue"]]);
- const __vite_glob_0_100 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSteps
- }, Symbol.toStringTag, { value: "Module" }));
- const props$j = defineMixin({
- props: {
- // 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px
- offsetTop: {
- type: [String, Number],
- default: () => props$1x.sticky.offsetTop
- },
- // 自定义导航栏的高度
- customNavHeight: {
- type: [String, Number],
- default: () => props$1x.sticky.customNavHeight
- },
- // 是否开启吸顶功能
- disabled: {
- type: Boolean,
- default: () => props$1x.sticky.disabled
- },
- // 吸顶区域的背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.sticky.bgColor
- },
- // z-index值
- zIndex: {
- type: [String, Number],
- default: () => props$1x.sticky.zIndex
- },
- // 列表中的索引值
- index: {
- type: [String, Number],
- default: () => props$1x.sticky.index
- }
- }
- });
- const _sfc_main$z = {
- name: "u-sticky",
- mixins: [mpMixin, mixin, props$j],
- 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.disabled) {
- 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$1(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 : zIndex.sticky;
- }
- },
- mounted() {
- this.init();
- },
- watch: {
- offsetTop(nval) {
- this.getStickyTop();
- }
- },
- methods: {
- init() {
- this.getStickyTop();
- this.checkSupportCssSticky();
- if (!this.cssSticky) {
- !this.disabled && this.initObserveContent();
- }
- },
- 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(this, {
- // 检测的区间范围
- 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() === "android" && Number(getDeviceInfo().system) > 8) {
- this.cssSticky = true;
- }
- this.cssSticky = await this.checkComputedStyle();
- if (os() === "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() {
- }
- },
- beforeUnmount() {
- this.disconnectObserver("contentObserver");
- }
- };
- function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-sticky",
- style: vue.normalizeStyle([$options.style])
- },
- [
- vue.createElementVNode("view", {
- id: $data.elId,
- style: vue.normalizeStyle([$options.stickyContent]),
- class: "u-sticky__content"
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ], 12, ["id"])
- ],
- 4
- /* STYLE */
- );
- }
- const uSticky = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$y], ["__scopeId", "data-v-8b303089"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-sticky/u-sticky.vue"]]);
- const __vite_glob_0_101 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSticky
- }, Symbol.toStringTag, { value: "Module" }));
- const props$i = defineMixin({
- props: {
- // tab的数据
- list: {
- type: Array,
- default: () => props$1x.subsection.list
- },
- // 当前活动的tab的index
- current: {
- type: [String, Number],
- default: () => props$1x.subsection.current
- },
- // 激活的颜色
- activeColor: {
- type: String,
- default: () => props$1x.subsection.activeColor
- },
- // 未激活的颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.subsection.inactiveColor
- },
- // 模式选择,mode=button为按钮形式,mode=subsection时为分段模式
- mode: {
- type: String,
- default: () => props$1x.subsection.mode
- },
- // 字体大小
- fontSize: {
- type: [String, Number],
- default: () => props$1x.subsection.fontSize
- },
- // 激活tab的字体是否加粗
- bold: {
- type: Boolean,
- default: () => props$1x.subsection.bold
- },
- // mode = button时,组件背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.subsection.bgColor
- },
- // 从list元素对象中读取的键名
- keyName: {
- type: String,
- default: () => props$1x.subsection.keyName
- },
- // 从`list`元素对象中读取激活时的颜色 如果存在字段 优先级大于 activeColor
- activeColorKeyName: {
- type: String,
- default: () => props$1x.subsection.activeColorKeyName
- },
- // 从`list`元素对象中读取未激活时的颜色 如果存在字段 优先级大于 inactiveColor
- inactiveColorKeyName: {
- type: String,
- default: () => props$1x.subsection.inactiveColorKeyName
- },
- // 是否禁用
- disabled: {
- type: Boolean,
- default: () => props$1x.subsection.disabled
- }
- }
- });
- const _sfc_main$y = {
- name: "u-subsection",
- mixins: [mpMixin, mixin, props$i],
- data() {
- return {
- // 组件尺寸
- itemRect: {
- width: 0,
- height: 0
- },
- innerCurrent: "",
- windowResizeCallback: {}
- };
- },
- watch: {
- list(newValue, oldValue) {
- this.init();
- },
- current: {
- immediate: true,
- handler(n2) {
- if (n2 !== this.innerCurrent) {
- this.innerCurrent = n2;
- }
- }
- }
- },
- computed: {
- wrapperStyle() {
- const style = {};
- if (this.mode === "button") {
- style.backgroundColor = this.bgColor;
- }
- return style;
- },
- // 滑块的样式
- barStyle() {
- const style = {};
- style.width = `${this.itemRect.width}px`;
- style.height = `${this.itemRect.height}px`;
- style.transform = `translateX(${this.innerCurrent * this.itemRect.width}px)`;
- if (this.mode === "subsection") {
- style.backgroundColor = this.activeColor;
- }
- return style;
- },
- // 分段器item的样式
- itemStyle(index2) {
- return (index3) => {
- const style = {};
- if (this.mode === "subsection") {
- style.borderColor = this.activeColor;
- style.borderWidth = "1px";
- style.borderStyle = "solid";
- }
- return style;
- };
- },
- // 分段器文字颜色
- textStyle(index2, item) {
- return (index3, item2) => {
- const style = {};
- style.fontWeight = this.bold && this.innerCurrent === index3 ? "bold" : "normal";
- style.fontSize = addUnit(this.fontSize);
- let activeColorTemp = null;
- let inactiveColorTemp = null;
- if (typeof item2 === "object" && item2[this.activeColorKeyName]) {
- activeColorTemp = item2[this.activeColorKeyName];
- }
- if (typeof item2 === "object" && item2[this.inactiveColorKeyName]) {
- inactiveColorTemp = item2[this.inactiveColorKeyName];
- }
- if (this.mode === "subsection") {
- if (this.innerCurrent === index3) {
- style.color = activeColorTemp ? activeColorTemp : "#FFF";
- } else {
- style.color = inactiveColorTemp ? inactiveColorTemp : this.inactiveColor;
- }
- } else {
- if (this.innerCurrent === index3) {
- style.color = activeColorTemp ? activeColorTemp : this.activeColor;
- } else {
- style.color = inactiveColorTemp ? inactiveColorTemp : this.inactiveColor;
- }
- }
- return style;
- };
- }
- },
- mounted() {
- this.init();
- },
- beforeUnmount() {
- },
- emits: ["change", "update:current"],
- methods: {
- addStyle,
- init() {
- this.innerCurrent = this.current;
- sleep().then(() => this.getRect());
- },
- // 判断展示文本
- getText(item) {
- return typeof item === "object" ? item[this.keyName] : item;
- },
- // 获取组件的尺寸
- getRect() {
- this.$uGetRect(".u-subsection__item--0").then((size) => {
- this.itemRect = size;
- });
- },
- clickHandler(index2) {
- if (this.disabled) {
- return;
- }
- this.innerCurrent = index2;
- this.$emit("update:current", index2);
- this.$emit("change", index2);
- },
- /**
- * 获取当前文字区域的 class禁用样式
- * @param index
- */
- getTextViewDisableClass(index2) {
- if (this.disabled) {
- if (this.mode === "button") {
- return "item-button--disabled";
- } else {
- return "item-subsection--disabled";
- }
- }
- return "";
- }
- }
- };
- function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-subsection", [`u-subsection--${_ctx.mode}`]]),
- ref: "u-subsection",
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle), $options.wrapperStyle])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-subsection__bar cursor-pointer", [
- _ctx.mode === "button" && "u-subsection--button__bar",
- $data.innerCurrent === 0 && _ctx.mode === "subsection" && "u-subsection__bar--first",
- $data.innerCurrent > 0 && $data.innerCurrent < _ctx.list.length - 1 && _ctx.mode === "subsection" && "u-subsection__bar--center",
- $data.innerCurrent === _ctx.list.length - 1 && _ctx.mode === "subsection" && "u-subsection__bar--last"
- ]]),
- ref: "u-subsection__bar",
- style: vue.normalizeStyle([$options.barStyle])
- },
- null,
- 6
- /* CLASS, STYLE */
- ),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["u-subsection__item cursor-pointer", [
- `u-subsection__item--${index2}`,
- index2 < _ctx.list.length - 1 && "u-subsection__item--no-border-right",
- index2 === 0 && "u-subsection__item--first",
- index2 === _ctx.list.length - 1 && "u-subsection__item--last",
- $options.getTextViewDisableClass(index2)
- ]]),
- ref_for: true,
- ref: `u-subsection__item--${index2}`,
- style: vue.normalizeStyle([$options.itemStyle(index2)]),
- onClick: ($event) => $options.clickHandler(index2),
- key: index2
- }, [
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["u-subsection__item__text", [_ctx.disabled ? "u-subsection--disabled" : ""]]),
- style: vue.normalizeStyle([$options.textStyle(index2, item)])
- },
- vue.toDisplayString($options.getText(item)),
- 7
- /* TEXT, CLASS, STYLE */
- )
- ], 14, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uSubsection = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$x], ["__scopeId", "data-v-b5ccb67e"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-subsection/u-subsection.vue"]]);
- const __vite_glob_0_102 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSubsection
- }, Symbol.toStringTag, { value: "Module" }));
- const MIN_DISTANCE = 10;
- function getDirection(x2, y2) {
- if (x2 > y2 && x2 > MIN_DISTANCE) {
- return "horizontal";
- }
- if (y2 > x2 && y2 > MIN_DISTANCE) {
- return "vertical";
- }
- return "";
- }
- const touchMixin = defineMixin({
- methods: {
- getTouchPoint(e2) {
- if (!e2) {
- return {
- x: 0,
- y: 0
- };
- }
- if (e2.touches && e2.touches[0]) {
- return {
- x: e2.touches[0].pageX,
- y: e2.touches[0].pageY
- };
- }
- if (e2.changedTouches && e2.changedTouches[0]) {
- return {
- x: e2.changedTouches[0].pageX,
- y: e2.changedTouches[0].pageY
- };
- }
- return {
- x: e2.clientX || 0,
- y: e2.clientY || 0
- };
- },
- resetTouchStatus() {
- this.direction = "";
- this.deltaX = 0;
- this.deltaY = 0;
- this.offsetX = 0;
- this.offsetY = 0;
- },
- touchStart(event) {
- this.resetTouchStatus();
- const touch = this.getTouchPoint(event);
- this.startX = touch.x;
- this.startY = touch.y;
- },
- touchMove(event) {
- const touch = this.getTouchPoint(event);
- this.deltaX = touch.x - this.startX;
- this.deltaY = touch.y - this.startY;
- this.offsetX = Math.abs(this.deltaX);
- this.offsetY = Math.abs(this.deltaY);
- this.direction = this.direction || getDirection(this.offsetX, this.offsetY);
- }
- }
- });
- const props$h = defineMixin({
- props: {
- // 控制打开或者关闭
- show: {
- type: Boolean,
- default: () => props$1x.swipeActionItem.show
- },
- closeOnClick: {
- type: Boolean,
- default: () => props$1x.swipeActionItem.closeOnClick
- },
- // 标识符,如果是v-for,可用index索引值
- name: {
- type: [String, Number],
- default: () => props$1x.swipeActionItem.name
- },
- // 是否禁用
- disabled: {
- type: Boolean,
- default: () => props$1x.swipeActionItem.disabled
- },
- // 是否自动关闭其他swipe按钮组
- autoClose: {
- type: Boolean,
- default: () => props$1x.swipeActionItem.autoClose
- },
- // 滑动距离阈值,只有大于此值,才被认为是要打开菜单
- threshold: {
- type: Number,
- default: () => props$1x.swipeActionItem.threshold
- },
- // 右侧按钮内容
- options: {
- type: Array,
- default() {
- return props$1x.swipeActionItem.rightOptions;
- }
- },
- // 动画过渡时间,单位ms
- duration: {
- type: [String, Number],
- default: () => props$1x.swipeActionItem.duration
- }
- }
- });
- const wxs = {
- methods: {
- // 关闭时执行
- closeHandler() {
- this.status = "close";
- },
- setState(status) {
- this.status = status;
- },
- closeOther() {
- this.parent && this.parent.closeOther(this);
- }
- }
- };
- const block0 = (Comp) => {
- (Comp.$wxs || (Comp.$wxs = [])).push("wxs");
- (Comp.$wxsModules || (Comp.$wxsModules = {}))["wxs"] = "f1d6d7d8";
- };
- const _sfc_main$x = {
- name: "u-swipe-action-item",
- emits: ["click", "update:show"],
- mixins: [
- mpMixin,
- mixin,
- touchMixin,
- wxs,
- props$h
- ],
- data() {
- return {
- // 按钮的尺寸信息
- size: {},
- // 父组件u-swipe-action的参数
- parentData: {
- autoClose: true
- },
- // 当前状态,open-打开,close-关闭
- status: "",
- sliderStyle: {}
- };
- },
- watch: {
- // 由于wxs无法直接读取外部的值,需要在外部值变化时,重新执行赋值逻辑
- wxsInit(newValue, oldValue) {
- this.queryRect();
- },
- status(newValue) {
- if (newValue === "open") {
- this.$emit("update:show", true);
- this.parent && this.parent.setOpendItem(this);
- } else {
- this.$emit("update:show", false);
- }
- },
- show(newValue) {
- if (newValue) {
- this.status = "open";
- } else {
- this.status = "close";
- }
- }
- },
- computed: {
- wxsInit() {
- return [this.disabled, this.autoClose, this.threshold, this.options, this.duration];
- }
- },
- mounted() {
- this.init();
- },
- beforeUmount() {
- this.closeHandler();
- },
- methods: {
- addUnit,
- getPx,
- init() {
- this.updateParentData();
- sleep().then(() => {
- this.queryRect();
- });
- },
- updateParentData() {
- this.getParentData("u-swipe-action");
- },
- // 查询节点
- queryRect() {
- this.$uGetRect(".u-swipe-action-item__right__button", true).then((buttons) => {
- this.size = {
- buttons,
- show: this.show,
- disabled: this.disabled,
- threshold: this.threshold,
- duration: this.duration
- };
- });
- },
- // 按钮被点击
- buttonClickHandler(item, index2) {
- this.$emit("click", {
- index: index2,
- name: this.name
- }, () => {
- });
- if (this.closeOnClick) {
- this.closeHandler();
- }
- }
- }
- };
- function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-swipe-action-item",
- ref: "u-swipe-action-item"
- },
- [
- vue.createElementVNode("view", { class: "u-swipe-action-item__right" }, [
- vue.renderSlot(_ctx.$slots, "button", {}, () => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.options, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: "u-swipe-action-item__right__button",
- ref_for: true,
- ref: `u-swipe-action-item__right__button-${index2}`,
- style: vue.normalizeStyle([{
- alignItems: item.style && item.style.borderRadius ? "center" : "stretch"
- }]),
- onClick: ($event) => $options.buttonClickHandler(item, index2)
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "u-swipe-action-item__right__button__wrapper",
- style: vue.normalizeStyle([{
- backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : "#C7C6CD",
- borderRadius: item.style && item.style.borderRadius ? item.style.borderRadius : "0",
- padding: item.style && item.style.borderRadius ? "0" : "0 15px"
- }, item.style])
- },
- [
- item.icon ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: item.icon,
- color: item.style && item.style.color ? item.style.color : "#ffffff",
- size: item.iconSize ? $options.addUnit(item.iconSize) : item.style && item.style.fontSize ? $options.getPx(item.style.fontSize) * 1.2 : 17,
- customStyle: {
- marginRight: item.text ? "2px" : 0
- }
- }, null, 8, ["name", "color", "size", "customStyle"])) : vue.createCommentVNode("v-if", true),
- item.text ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "u-swipe-action-item__right__button__wrapper__text u-line-1",
- style: vue.normalizeStyle([{
- color: item.style && item.style.color ? item.style.color : "#ffffff",
- fontSize: item.style && item.style.fontSize ? item.style.fontSize : "16px",
- lineHeight: item.style && item.style.fontSize ? item.style.fontSize : "16px"
- }])
- },
- vue.toDisplayString(item.text),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ], 12, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], true)
- ]),
- vue.createElementVNode("view", {
- class: "u-swipe-action-item__content",
- onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.wxs.touchstart && _ctx.wxs.touchstart(...args)),
- onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.wxs.touchmove && _ctx.wxs.touchmove(...args)),
- onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.wxs.touchend && _ctx.wxs.touchend(...args)),
- status: vue.wp($data.status),
- "change:status": _ctx.wxs.statusChange,
- size: vue.wp($data.size),
- "change:size": _ctx.wxs.sizeChange
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ], 40, ["status", "change:status", "size", "change:size"])
- ],
- 512
- /* NEED_PATCH */
- );
- }
- if (typeof block0 === "function")
- block0(_sfc_main$x);
- const uSwipeActionItem = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$w], ["__scopeId", "data-v-ed3ce04a"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue"]]);
- const __vite_glob_0_103 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSwipeActionItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$g = defineMixin({
- props: {
- // 是否自动关闭其他swipe按钮组
- autoClose: {
- type: Boolean,
- default: () => props$1x.swipeAction.autoClose
- },
- // 是否存在打开的按钮组
- opendItem: {
- type: Boolean,
- default: false
- }
- }
- });
- const _sfc_main$w = {
- name: "u-swipe-action",
- mixins: [mpMixin, mixin, props$g],
- data() {
- return {};
- },
- provide() {
- return {
- swipeAction: this
- };
- },
- computed: {
- // 这里computed的变量,都是子组件u-swipe-action-item需要用到的,由于头条小程序的兼容性差异,子组件无法实时监听父组件参数的变化
- // 所以需要手动通知子组件,这里返回一个parentData变量,供watch监听,在其中去通知每一个子组件重新从父组件(u-swipe-action-item)
- // 拉取父组件新的变化后的参数
- parentData() {
- return [this.autoClose];
- }
- },
- emits: ["opendItem:update"],
- watch: {
- // 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
- parentData() {
- if (this.children.length) {
- this.children.map((child) => {
- typeof child.updateParentData === "function" && child.updateParentData();
- });
- }
- },
- opendItem(val) {
- if (val == false) {
- this.closeAll();
- }
- }
- },
- created() {
- this.children = [];
- },
- methods: {
- closeOther(child) {
- if (this.autoClose) {
- this.children.map((item, index2) => {
- if (child !== item) {
- item.closeHandler();
- }
- });
- }
- },
- closeAll() {
- this.children.map((item, index2) => {
- item.closeHandler();
- });
- },
- setOpendItem(ins) {
- this.$emit("opendItem:update", true);
- }
- }
- };
- function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-swipe-action" }, [
- vue.renderSlot(_ctx.$slots, "default")
- ]);
- }
- const uSwipeAction = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$v], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-swipe-action/u-swipe-action.vue"]]);
- const __vite_glob_0_104 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSwipeAction
- }, Symbol.toStringTag, { value: "Module" }));
- const props$f = defineMixin({
- props: {
- // 轮播的长度
- length: {
- type: [String, Number],
- default: () => props$1x.swiperIndicator.length
- },
- // 当前处于活动状态的轮播的索引
- current: {
- type: [String, Number],
- default: () => props$1x.swiperIndicator.current
- },
- // 指示器非激活颜色
- indicatorActiveColor: {
- type: String,
- default: () => props$1x.swiperIndicator.indicatorActiveColor
- },
- // 指示器的激活颜色
- indicatorInactiveColor: {
- type: String,
- default: () => props$1x.swiperIndicator.indicatorInactiveColor
- },
- // 指示器模式,line-线型,dot-点型
- indicatorMode: {
- type: String,
- default: () => props$1x.swiperIndicator.indicatorMode
- }
- }
- });
- const _sfc_main$v = {
- name: "u-swiper-indicator",
- mixins: [mpMixin, mixin, props$f],
- data() {
- return {
- lineWidth: 22
- };
- },
- computed: {
- // 指示器为线型的样式
- lineStyle() {
- let style = {};
- style.width = addUnit(this.lineWidth);
- style.transform = `translateX(${addUnit(this.current * this.lineWidth)})`;
- style.backgroundColor = this.indicatorActiveColor;
- return style;
- },
- // 指示器为点型的样式
- dotStyle() {
- return (index2) => {
- let style = {};
- style.backgroundColor = index2 === this.current ? this.indicatorActiveColor : this.indicatorInactiveColor;
- return style;
- };
- }
- },
- methods: {
- addUnit
- }
- };
- function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-swiper-indicator" }, [
- _ctx.indicatorMode === "line" ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-swiper-indicator__wrapper", [`u-swiper-indicator__wrapper--${_ctx.indicatorMode}`]]),
- style: vue.normalizeStyle({
- width: $options.addUnit($data.lineWidth * _ctx.length),
- backgroundColor: _ctx.indicatorInactiveColor
- })
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-swiper-indicator__wrapper--line__bar",
- style: vue.normalizeStyle([$options.lineStyle])
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.indicatorMode === "dot" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-swiper-indicator__wrapper"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.length, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-swiper-indicator__wrapper__dot", [index2 === _ctx.current && "u-swiper-indicator__wrapper__dot--active"]]),
- key: index2,
- style: vue.normalizeStyle([$options.dotStyle(index2)])
- },
- null,
- 6
- /* CLASS, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const uSwiperIndicator = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$u], ["__scopeId", "data-v-7b7c7ea6"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-swiper-indicator/u-swiper-indicator.vue"]]);
- const __vite_glob_0_105 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSwiperIndicator
- }, Symbol.toStringTag, { value: "Module" }));
- const props$e = defineMixin({
- props: {
- // 列表数组,元素可为字符串,如为对象可通过keyName指定目标属性名
- list: {
- type: Array,
- default: () => props$1x.swiper.list
- },
- // 是否显示面板指示器
- indicator: {
- type: Boolean,
- default: () => props$1x.swiper.indicator
- },
- // 指示器非激活颜色
- indicatorActiveColor: {
- type: String,
- default: () => props$1x.swiper.indicatorActiveColor
- },
- // 指示器的激活颜色
- indicatorInactiveColor: {
- type: String,
- default: () => props$1x.swiper.indicatorInactiveColor
- },
- // 指示器样式,可通过bottom,left,right进行定位
- indicatorStyle: {
- type: [String, Object],
- default: () => props$1x.swiper.indicatorStyle
- },
- // 指示器模式,line-线型,dot-点型
- indicatorMode: {
- type: String,
- default: () => props$1x.swiper.indicatorMode
- },
- // 是否自动切换
- autoplay: {
- type: Boolean,
- default: () => props$1x.swiper.autoplay
- },
- // 当前所在滑块的 index
- current: {
- type: [String, Number],
- default: () => props$1x.swiper.current
- },
- // 当前所在滑块的 item-id ,不能与 current 被同时指定
- currentItemId: {
- type: String,
- default: () => props$1x.swiper.currentItemId
- },
- // 滑块自动切换时间间隔
- interval: {
- type: [String, Number],
- default: () => props$1x.swiper.interval
- },
- // 滑块切换过程所需时间
- duration: {
- type: [String, Number],
- default: () => props$1x.swiper.duration
- },
- // 播放到末尾后是否重新回到开头
- circular: {
- type: Boolean,
- default: () => props$1x.swiper.circular
- },
- // 前边距,可用于露出前一项的一小部分,nvue和支付宝不支持
- previousMargin: {
- type: [String, Number],
- default: () => props$1x.swiper.previousMargin
- },
- // 后边距,可用于露出后一项的一小部分,nvue和支付宝不支持
- nextMargin: {
- type: [String, Number],
- default: () => props$1x.swiper.nextMargin
- },
- // 当开启时,会根据滑动速度,连续滑动多屏,支付宝不支持
- acceleration: {
- type: Boolean,
- default: () => props$1x.swiper.acceleration
- },
- // 同时显示的滑块数量,nvue、支付宝小程序不支持
- displayMultipleItems: {
- type: Number,
- default: () => props$1x.swiper.displayMultipleItems
- },
- // 指定swiper切换缓动动画类型,有效值:default、linear、easeInCubic、easeOutCubic、easeInOutCubic
- // 只对微信小程序有效
- easingFunction: {
- type: String,
- default: () => props$1x.swiper.easingFunction
- },
- // list数组中指定对象的目标属性名
- keyName: {
- type: String,
- default: () => props$1x.swiper.keyName
- },
- // 图片的裁剪模式
- imgMode: {
- type: String,
- default: () => props$1x.swiper.imgMode
- },
- // 组件高度
- height: {
- type: [String, Number],
- default: () => props$1x.swiper.height
- },
- // 背景颜色
- bgColor: {
- type: String,
- default: () => props$1x.swiper.bgColor
- },
- // 组件圆角,数值或带单位的字符串
- radius: {
- type: [String, Number],
- default: () => props$1x.swiper.radius
- },
- // 是否加载中
- loading: {
- type: Boolean,
- default: () => props$1x.swiper.loading
- },
- // 是否显示标题,要求数组对象中有title属性
- showTitle: {
- type: Boolean,
- default: () => props$1x.swiper.showTitle
- }
- }
- });
- const _sfc_main$u = {
- name: "u-swiper",
- mixins: [mpMixin, mixin, props$e],
- data() {
- return {
- currentIndex: 0
- };
- },
- watch: {
- current(val, preVal) {
- if (val === preVal)
- return;
- this.currentIndex = val;
- }
- },
- emits: ["click", "change", "update:current"],
- computed: {
- itemStyle() {
- return (index2) => {
- const style = {};
- if (this.nextMargin && this.previousMargin) {
- style.borderRadius = addUnit(this.radius);
- if (index2 !== this.currentIndex)
- style.transform = "scale(0.92)";
- }
- return style;
- };
- }
- },
- methods: {
- addStyle,
- addUnit,
- testObject: test.object,
- testImage: test.image,
- getItemType(item) {
- if (typeof item === "string")
- return test.video(this.getSource(item)) ? "video" : "image";
- if (typeof item === "object" && this.keyName) {
- if (!item.type)
- return test.video(this.getSource(item)) ? "video" : "image";
- if (item.type === "image")
- return "image";
- if (item.type === "video")
- return "video";
- return "image";
- }
- },
- // 获取目标路径,可能数组中为字符串,对象的形式,额外可指定对象的目标属性名keyName
- getSource(item) {
- if (typeof item === "string")
- return item;
- if (typeof item === "object" && this.keyName)
- return item[this.keyName];
- else
- error("请按格式传递列表参数");
- return "";
- },
- // 轮播切换事件
- change(e2) {
- const {
- current
- } = e2.detail;
- this.pauseVideo(this.currentIndex);
- this.currentIndex = current;
- this.$emit("update:current", this.currentIndex);
- this.$emit("change", e2.detail);
- },
- // 切换轮播时,暂停视频播放
- pauseVideo(index2) {
- const lastItem = this.getSource(this.list[index2]);
- if (test.video(lastItem)) {
- const video2 = uni.createVideoContext(`video-${index2}`, this);
- video2.pause();
- }
- },
- // 当一个轮播item为视频时,获取它的视频海报
- getPoster(item) {
- return typeof item === "object" && item.poster ? item.poster : "";
- },
- // 点击某个item
- clickHandler(index2) {
- this.$emit("click", index2);
- }
- }
- };
- function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_loading_icon = vue.resolveComponent("up-loading-icon");
- const _component_up_swiper_indicator = vue.resolveComponent("up-swiper-indicator");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-swiper",
- style: vue.normalizeStyle({
- backgroundColor: _ctx.bgColor,
- height: $options.addUnit(_ctx.height),
- borderRadius: $options.addUnit(_ctx.radius)
- })
- },
- [
- _ctx.loading ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-swiper__loading"
- }, [
- vue.createVNode(_component_up_loading_icon, { mode: "circle" })
- ])) : (vue.openBlock(), vue.createElementBlock("swiper", {
- key: 1,
- class: "u-swiper__wrapper",
- style: vue.normalizeStyle({
- flex: "1",
- height: $options.addUnit(_ctx.height)
- }),
- onChange: _cache[0] || (_cache[0] = (...args) => $options.change && $options.change(...args)),
- circular: _ctx.circular,
- interval: _ctx.interval,
- duration: _ctx.duration,
- autoplay: _ctx.autoplay,
- current: _ctx.current,
- currentItemId: _ctx.currentItemId,
- previousMargin: $options.addUnit(_ctx.previousMargin),
- nextMargin: $options.addUnit(_ctx.nextMargin),
- acceleration: _ctx.acceleration,
- displayMultipleItems: _ctx.list.length > 0 ? _ctx.displayMultipleItems : 0,
- easingFunction: _ctx.easingFunction
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("swiper-item", {
- class: "u-swiper__wrapper__item",
- key: index2
- }, [
- vue.renderSlot(_ctx.$slots, "default", {
- item,
- index: index2
- }, () => [
- vue.createElementVNode(
- "view",
- {
- class: "u-swiper__wrapper__item__wrapper",
- style: vue.normalizeStyle([$options.itemStyle(index2)])
- },
- [
- vue.createCommentVNode(" 在nvue中,image图片的宽度默认为屏幕宽度,需要通过flex:1撑开,另外必须设置高度才能显示图片 "),
- $options.getItemType(item) === "image" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "u-swiper__wrapper__item__wrapper__image",
- src: $options.getSource(item),
- mode: _ctx.imgMode,
- onClick: ($event) => $options.clickHandler(index2),
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.height),
- borderRadius: $options.addUnit(_ctx.radius)
- })
- }, null, 12, ["src", "mode", "onClick"])) : vue.createCommentVNode("v-if", true),
- $options.getItemType(item) === "video" ? (vue.openBlock(), vue.createElementBlock("video", {
- key: 1,
- class: "u-swiper__wrapper__item__wrapper__video",
- id: `video-${index2}`,
- "enable-progress-gesture": false,
- src: $options.getSource(item),
- poster: $options.getPoster(item),
- title: _ctx.showTitle && $options.testObject(item) && item.title ? item.title : "",
- style: vue.normalizeStyle({
- height: $options.addUnit(_ctx.height)
- }),
- controls: "",
- onClick: ($event) => $options.clickHandler(index2)
- }, null, 12, ["id", "src", "poster", "title", "onClick"])) : vue.createCommentVNode("v-if", true),
- _ctx.showTitle && $options.testObject(item) && item.title && $options.testImage($options.getSource(item)) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "u-swiper__wrapper__item__wrapper__title"
- }, [
- vue.createElementVNode(
- "text",
- { class: "u-line-1" },
- vue.toDisplayString(item.title),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ], true)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 44, ["circular", "interval", "duration", "autoplay", "current", "currentItemId", "previousMargin", "nextMargin", "acceleration", "displayMultipleItems", "easingFunction"])),
- vue.createElementVNode(
- "view",
- {
- class: "u-swiper__indicator",
- style: vue.normalizeStyle([$options.addStyle(_ctx.indicatorStyle)])
- },
- [
- vue.renderSlot(_ctx.$slots, "indicator", {}, () => [
- !_ctx.loading && _ctx.indicator && !_ctx.showTitle ? (vue.openBlock(), vue.createBlock(_component_up_swiper_indicator, {
- key: 0,
- indicatorActiveColor: _ctx.indicatorActiveColor,
- indicatorInactiveColor: _ctx.indicatorInactiveColor,
- length: _ctx.list.length,
- current: $data.currentIndex,
- indicatorMode: _ctx.indicatorMode
- }, null, 8, ["indicatorActiveColor", "indicatorInactiveColor", "length", "current", "indicatorMode"])) : vue.createCommentVNode("v-if", true)
- ], true)
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- );
- }
- const uSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t], ["__scopeId", "data-v-4e7d0c90"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-swiper/u-swiper.vue"]]);
- const __vite_glob_0_106 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSwiper
- }, Symbol.toStringTag, { value: "Module" }));
- const props$d = defineMixin({
- props: {
- // 是否为加载中状态
- loading: {
- type: Boolean,
- default: () => props$1x.switch.loading
- },
- // 是否为禁用装填
- disabled: {
- type: Boolean,
- default: () => props$1x.switch.disabled
- },
- // 开关尺寸,单位px
- size: {
- type: [String, Number],
- default: () => props$1x.switch.size
- },
- // 打开时的背景颜色
- activeColor: {
- type: String,
- default: () => props$1x.switch.activeColor
- },
- // 关闭时的背景颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.switch.inactiveColor
- },
- // 通过v-model双向绑定的值
- modelValue: {
- type: [Boolean, String, Number],
- default: () => props$1x.switch.value
- },
- // switch打开时的值
- activeValue: {
- type: [String, Number, Boolean],
- default: () => props$1x.switch.activeValue
- },
- // switch关闭时的值
- inactiveValue: {
- type: [String, Number, Boolean],
- default: () => props$1x.switch.inactiveValue
- },
- // 是否开启异步变更,开启后需要手动控制输入值
- asyncChange: {
- type: Boolean,
- default: () => props$1x.switch.asyncChange
- },
- // 圆点与外边框的距离
- space: {
- type: [String, Number],
- default: () => props$1x.switch.space
- }
- }
- });
- const _sfc_main$t = {
- name: "u-switch",
- mixins: [mpMixin, mixin, props$d],
- watch: {
- modelValue: {
- immediate: true,
- handler(n2) {
- if (n2 !== this.inactiveValue && n2 !== this.activeValue) {
- error("v-model绑定的值必须为inactiveValue、activeValue二者之一");
- }
- }
- }
- },
- data() {
- return {
- bgColor: "#ffffff"
- };
- },
- computed: {
- isActive() {
- return this.modelValue === this.activeValue;
- },
- switchStyle() {
- let style = {};
- style.width = addUnit(this.size * 2 + 2);
- style.height = addUnit(Number(this.size) + 2);
- if (this.customInactiveColor) {
- style.borderColor = "rgba(0, 0, 0, 0)";
- }
- style.backgroundColor = this.isActive ? this.activeColor : this.inactiveColor;
- return style;
- },
- nodeStyle() {
- let style = {};
- style.width = addUnit(this.size - this.space);
- style.height = addUnit(this.size - this.space);
- const translateX = this.isActive ? addUnit(this.space) : addUnit(this.size);
- style.transform = `translateX(-${translateX})`;
- return style;
- },
- bgStyle() {
- let style = {};
- style.width = addUnit(Number(this.size) * 2 - this.size / 2);
- style.height = addUnit(this.size);
- style.backgroundColor = this.inactiveColor;
- style.transform = `scale(${this.isActive ? 0 : 1})`;
- return style;
- },
- customInactiveColor() {
- return this.inactiveColor !== "#fff" && this.inactiveColor !== "#ffffff";
- }
- },
- emits: ["update:modelValue", "change"],
- methods: {
- addStyle,
- clickHandler() {
- if (!this.disabled && !this.loading) {
- const oldValue = this.isActive ? this.inactiveValue : this.activeValue;
- if (!this.asyncChange) {
- this.$emit("update:modelValue", oldValue);
- }
- this.$nextTick(() => {
- this.$emit("change", oldValue);
- });
- }
- }
- }
- };
- function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_loading_icon = resolveEasycom(vue.resolveDynamicComponent("u-loading-icon"), __easycom_0$e);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-switch cursor-pointer", [_ctx.disabled && "u-switch--disabled"]]),
- style: vue.normalizeStyle([$options.switchStyle, $options.addStyle(_ctx.customStyle)]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-switch__bg",
- style: vue.normalizeStyle([$options.bgStyle])
- },
- null,
- 4
- /* STYLE */
- ),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-switch__node", [_ctx.modelValue && "u-switch__node--on"]]),
- style: vue.normalizeStyle([$options.nodeStyle]),
- ref: "u-switch__node"
- },
- [
- vue.createVNode(_component_u_loading_icon, {
- show: _ctx.loading,
- mode: "circle",
- timingFunction: "linear",
- color: _ctx.modelValue ? _ctx.activeColor : "#AAABAD",
- size: _ctx.size * 0.6
- }, null, 8, ["show", "color", "size"])
- ],
- 6
- /* CLASS, STYLE */
- )
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s], ["__scopeId", "data-v-6ab257b3"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-switch/u-switch.vue"]]);
- const __vite_glob_0_107 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uSwitch
- }, Symbol.toStringTag, { value: "Module" }));
- const props$c = defineMixin({
- props: {
- // item标签的名称,作为与u-tabbar的value参数匹配的标识符
- name: {
- type: [String, Number, null],
- default: () => props$1x.tabbarItem.name
- },
- // uview-plus内置图标或者绝对路径的图片
- icon: {
- icon: String,
- default: () => props$1x.tabbarItem.icon
- },
- // 右上角的角标提示信息
- badge: {
- type: [String, Number, null],
- default: () => props$1x.tabbarItem.badge
- },
- // 是否显示圆点,将会覆盖badge参数
- dot: {
- type: Boolean,
- default: () => props$1x.tabbarItem.dot
- },
- // 描述文本
- text: {
- type: String,
- default: () => props$1x.tabbarItem.text
- },
- // 控制徽标的位置,对象或者字符串形式,可以设置top和right属性
- badgeStyle: {
- type: [Object, String],
- default: () => props$1x.tabbarItem.badgeStyle
- },
- // 模式,默认普通模式,midButton中间按钮模式
- mode: {
- type: String,
- default: () => props$1x.tabbarItem.mode
- }
- }
- });
- const _sfc_main$s = {
- name: "u-tabbar-item",
- mixins: [mpMixin, mixin, props$c],
- data() {
- return {
- isActive: false,
- // 是否处于激活状态
- parentData: {
- value: null,
- activeColor: "",
- inactiveColor: ""
- }
- };
- },
- // 微信小程序中 options 选项
- options: {
- virtualHost: true
- //将自定义节点设置成虚拟的,更加接近Vue组件的表现。我们不希望自定义组件的这个节点本身可以设置样式、响应 flex 布局等
- },
- computed: {
- // 计算是否为中间按钮
- isMidButton() {
- return this.mode === "midButton";
- }
- },
- created() {
- this.init();
- },
- emits: ["click", "change"],
- methods: {
- addStyle,
- init() {
- this.updateParentData();
- if (!this.parent) {
- error("up-tabbar-item必须搭配up-tabbar组件使用");
- }
- const index2 = this.parent.children.indexOf(this);
- this.isActive = (this.name || index2) === this.parentData.value;
- },
- updateParentData() {
- this.getParentData("u-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$r(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_badge = resolveEasycom(vue.resolveDynamicComponent("u-badge"), __easycom_0$9);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-tabbar-item", [$options.isMidButton ? "u-tabbar-item--mid-button" : ""]]),
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-tabbar-item__icon", [$options.isMidButton ? "u-tabbar-item__icon--mid-button" : ""]])
- },
- [
- $options.isMidButton ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-tabbar-item--mid-button-cover"
- })) : vue.createCommentVNode("v-if", true),
- _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- name: _ctx.icon,
- color: $data.isActive ? $data.parentData.activeColor : $data.parentData.inactiveColor,
- size: $options.isMidButton ? 26 : 20
- }, null, 8, ["name", "color", "size"])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 2 },
- [
- $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.createVNode(_component_u_badge, {
- absolute: "",
- offset: [0, _ctx.dot ? "34rpx" : _ctx.badge > 9 ? "14rpx" : "20rpx"],
- customStyle: _ctx.badgeStyle,
- isDot: _ctx.dot,
- value: _ctx.badge || (_ctx.dot ? 1 : null),
- show: _ctx.dot || _ctx.badge > 0
- }, null, 8, ["offset", "customStyle", "isDot", "value", "show"])
- ],
- 2
- /* CLASS */
- ),
- vue.renderSlot(_ctx.$slots, "text", {}, () => [
- vue.createElementVNode(
- "text",
- {
- class: "u-tabbar-item__text",
- style: vue.normalizeStyle({
- color: $data.isActive ? $data.parentData.activeColor : $data.parentData.inactiveColor
- })
- },
- vue.toDisplayString(_ctx.text),
- 5
- /* TEXT, STYLE */
- )
- ], true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uTabbarItem = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r], ["__scopeId", "data-v-e01cdc2c"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-tabbar-item/u-tabbar-item.vue"]]);
- const __vite_glob_0_108 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTabbarItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$b = defineMixin({
- props: {
- // 当前匹配项的name
- value: {
- type: [String, Number, null],
- default: () => props$1x.tabbar.value
- },
- // 是否为iPhoneX留出底部安全距离
- safeAreaInsetBottom: {
- type: Boolean,
- default: () => props$1x.tabbar.safeAreaInsetBottom
- },
- // 是否显示上方边框
- border: {
- type: Boolean,
- default: () => props$1x.tabbar.border
- },
- // 上方边框颜色
- borderColor: {
- type: Boolean,
- default: () => props$1x.tabbar.borderColor
- },
- // 元素层级z-index
- zIndex: {
- type: [String, Number],
- default: () => props$1x.tabbar.zIndex
- },
- // 选中标签的颜色
- activeColor: {
- type: String,
- default: () => props$1x.tabbar.activeColor
- },
- // 未选中标签的颜色
- inactiveColor: {
- type: String,
- default: () => props$1x.tabbar.inactiveColor
- },
- // 是否固定在底部
- fixed: {
- type: Boolean,
- default: () => props$1x.tabbar.fixed
- },
- // fixed定位固定在底部时,是否生成一个等高元素防止塌陷
- placeholder: {
- type: Boolean,
- default: () => props$1x.tabbar.placeholder
- },
- // 背景色
- backgroundColor: {
- type: String,
- default: () => props$1x.tabbar.backgroundColor
- }
- }
- });
- const _sfc_main$r = {
- name: "u-tabbar",
- mixins: [mpMixin, mixin, props$b],
- data() {
- return {
- placeholderHeight: 0
- };
- },
- computed: {
- tabbarStyle() {
- const style = {
- zIndex: this.zIndex
- };
- if (this.borderColor) {
- style.borderColor = this.borderColor;
- }
- if (this.backgroundColor) {
- style.backgroundColor = this.backgroundColor;
- }
- return deepMerge$1(style, addStyle(this.customStyle));
- },
- // 监听多个参数的变化,通过在computed执行对应的操作
- updateChild() {
- return [this.value, this.activeColor, 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());
- },
- // 设置用于防止塌陷元素的高度
- async setPlaceholderHeight() {
- if (!this.fixed || !this.placeholder)
- return;
- await sleep(20);
- this.$uGetRect(".u-tabbar__content").then(({ height = 50 }) => {
- this.placeholderHeight = height;
- });
- }
- }
- };
- function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_safe_bottom = resolveEasycom(vue.resolveDynamicComponent("u-safe-bottom"), __easycom_0$b);
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-tabbar" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-tabbar__content", [_ctx.border && "u-border-top", _ctx.fixed && "u-tabbar--fixed"]]),
- ref: "u-tabbar__content",
- onTouchmove: _cache[0] || (_cache[0] = vue.withModifiers((...args) => _ctx.noop && _ctx.noop(...args), ["stop", "prevent"])),
- style: vue.normalizeStyle([$options.tabbarStyle])
- },
- [
- vue.createElementVNode("view", { class: "u-tabbar__content__item-wrapper" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ]),
- _ctx.safeAreaInsetBottom ? (vue.openBlock(), vue.createBlock(_component_u_safe_bottom, { key: 0 })) : vue.createCommentVNode("v-if", true)
- ],
- 38
- /* CLASS, STYLE, NEED_HYDRATION */
- ),
- _ctx.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 uTabbar = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q], ["__scopeId", "data-v-b9276d10"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-tabbar/u-tabbar.vue"]]);
- const __vite_glob_0_109 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTabbar
- }, Symbol.toStringTag, { value: "Module" }));
- const props$a = defineMixin({
- props: {}
- });
- const _sfc_main$q = {
- name: "u-table",
- mixins: [mpMixin, mixin, props$a],
- props: {
- borderColor: {
- type: String,
- default: "#e4e7ed"
- },
- align: {
- type: String,
- default: "center"
- },
- // td的内边距
- padding: {
- type: String,
- default: "5px 3px"
- },
- // 字体大小
- fontSize: {
- type: [String],
- default: "14px"
- },
- // 字体颜色
- color: {
- type: String,
- default: "#606266"
- },
- // th的自定义样式
- thStyle: {
- type: Object,
- default() {
- return {};
- }
- },
- // table的背景颜色
- bgColor: {
- type: String,
- default: "#ffffff"
- }
- },
- data() {
- return {
- show: true
- };
- },
- watch: {
- align() {
- this.change();
- },
- borderColor() {
- this.change();
- }
- },
- computed: {
- tableStyle() {
- let style = {};
- style.borderLeft = `solid 1px ${this.borderColor}`;
- style.borderTop = `solid 1px ${this.borderColor}`;
- style.backgroundColor = this.bgColor;
- return style;
- }
- },
- methods: {
- change() {
- this.show = false;
- this.$nextTick(() => {
- this.show = true;
- });
- }
- }
- };
- function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-table",
- style: vue.normalizeStyle([$options.tableStyle])
- },
- [
- $data.show ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- );
- }
- const uTable = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-table/u-table.vue"]]);
- const __vite_glob_0_110 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTable
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$p = {
- name: "tableRow",
- props: {
- row: {
- type: Object,
- required: true
- },
- rowIndex: {
- type: Number,
- required: true
- },
- parentRow: {
- type: Object,
- default: null
- },
- columns: {
- type: Array,
- required: true
- },
- treeProps: {
- type: Object,
- required: true
- },
- rowKey: {
- type: String,
- required: true
- },
- expandedKeys: {
- type: Array,
- required: true
- },
- cellStyleInner: {
- type: Function,
- required: true
- },
- isExpanded: {
- type: Function,
- required: true
- },
- rowClassName: {
- type: Function,
- default: null
- },
- stripe: {
- type: Boolean,
- default: false
- },
- cellClassName: {
- type: Function,
- default: null
- },
- getFixedClass: {
- type: Function,
- required: true
- },
- highlightCurrentRow: {
- type: Boolean,
- default: false
- },
- currentRow: {
- type: Object,
- default: null
- },
- handleRowClick: {
- type: Function,
- required: true
- },
- toggleExpand: {
- type: Function,
- required: true
- },
- level: {
- type: Number,
- required: true
- },
- // 添加computedMainCol属性
- computedMainCol: {
- type: String,
- required: true
- },
- expandWidth: {
- type: String,
- required: true
- },
- hasTree: {
- type: Boolean,
- required: false
- },
- selectedRows: {
- type: Array,
- required: false
- },
- rowHeight: {
- type: String,
- required: true
- }
- },
- emits: ["rowClick", "toggleExpand", "toggleSelect"],
- methods: {
- isSelected(row) {
- return this.selectedRows.some((r2) => r2[this.rowKey] === row[this.rowKey]);
- }
- }
- };
- function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_table_row = vue.resolveComponent("table-row", true);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-table-row u-table-row-child", [
- $props.highlightCurrentRow && $props.currentRow === $props.row ? "u-table-row-highlight" : "",
- $props.rowClassName ? $props.rowClassName($props.row, $props.rowIndex) : "",
- $props.stripe && $props.rowIndex % 2 === 1 ? "u-table-row-zebra" : ""
- ]]),
- style: vue.normalizeStyle({ height: $props.rowHeight }),
- onClick: _cache[2] || (_cache[2] = ($event) => $props.handleRowClick($props.row))
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.columns, (col, colIndex) => {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: col.key,
- class: vue.normalizeClass(["u-table-cell", [
- col.align ? "u-text-" + col.align : "",
- $props.cellClassName ? $props.cellClassName($props.row, col) : "",
- $props.getFixedClass(col)
- ]]),
- style: vue.normalizeStyle($props.cellStyleInner({ row: $props.row, column: col, rowIndex: $props.rowIndex, columnIndex: colIndex, level: $props.level }))
- },
- [
- vue.createCommentVNode(" 复选框列 "),
- col.type === "selection" ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createElementVNode("checkbox", {
- checked: $options.isSelected($props.row),
- onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => _ctx.$emit("toggleSelect", $props.row), ["stop"]))
- }, null, 8, ["checked"])
- ])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 在mainCol列显示展开图标 "),
- col.key === $props.computedMainCol && $props.hasTree ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => $props.toggleExpand($props.row), ["stop"])),
- style: vue.normalizeStyle({ width: $props.expandWidth })
- },
- [
- $props.row.children && $props.row.children.length > 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- { key: 0 },
- vue.toDisplayString($props.isExpanded($props.row) ? "▼" : "▶"),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "cellChild", {
- row: $props.row,
- column: col,
- prow: $props.parentRow,
- rowIndex: $props.rowIndex,
- columnIndex: colIndex,
- level: $props.level
- }, () => [
- vue.createElementVNode(
- "view",
- { class: "u-table-cell_content" },
- vue.toDisplayString($props.row[col.key]),
- 1
- /* TEXT */
- )
- ], true)
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 6
- /* CLASS, STYLE */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createCommentVNode(" 递归渲染更深层的子级 "),
- $props.isExpanded($props.row) && $props.row[$props.treeProps.children] && $props.row[$props.treeProps.children].length ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList($props.row[$props.treeProps.children], (rowChild, childIndex) => {
- return vue.openBlock(), vue.createBlock(_component_table_row, {
- key: rowChild[$props.rowKey] || childIndex,
- row: rowChild,
- rowIndex: childIndex,
- "parent-row": $props.row,
- columns: $props.columns,
- "tree-props": $props.treeProps,
- "row-key": $props.rowKey,
- "expanded-keys": $props.expandedKeys,
- "cell-style-inner": $props.cellStyleInner,
- "is-expanded": $props.isExpanded,
- "row-class-name": $props.rowClassName,
- stripe: $props.stripe,
- "cell-class-name": $props.cellClassName,
- "get-fixed-class": $props.getFixedClass,
- "highlight-current-row": $props.highlightCurrentRow,
- "current-row": $props.currentRow,
- "handle-row-click": $props.handleRowClick,
- "toggle-expand": $props.toggleExpand,
- level: $props.level + 1,
- rowHeight: $props.rowHeight,
- hasTree: $props.hasTree,
- selectedRows: $props.selectedRows,
- expandWidth: $props.expandWidth,
- "computed-main-col": $props.computedMainCol,
- onToggleSelect: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("toggleSelect", $event)),
- onRowClick: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("rowClick", $event)),
- onToggleExpand: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("toggleExpand", $event))
- }, {
- cellChild: vue.withCtx((scope) => [
- vue.renderSlot(_ctx.$slots, "cellChild", {
- row: scope.row,
- column: scope.column,
- prow: scope.prow,
- rowIndex: scope.rowIndex,
- columnIndex: scope.columnIndex,
- level: $props.level
- }, void 0, true)
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["row", "rowIndex", "parent-row", "columns", "tree-props", "row-key", "expanded-keys", "cell-style-inner", "is-expanded", "row-class-name", "stripe", "cell-class-name", "get-fixed-class", "highlight-current-row", "current-row", "handle-row-click", "toggle-expand", "level", "rowHeight", "hasTree", "selectedRows", "expandWidth", "computed-main-col"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const tableRow = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__scopeId", "data-v-0ba90776"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-table2/tableRow.vue"]]);
- const _sfc_main$o = {
- name: "u-table2",
- components: {
- tableRow
- // 注册递归组件
- },
- props: {
- data: {
- type: Array,
- required: true,
- default: () => {
- return [];
- }
- },
- columns: {
- type: Array,
- required: true,
- default: () => {
- return [];
- },
- validator: (cols) => cols.every(
- (col) => ["default", "selection", "expand"].includes(col.type || "default")
- )
- },
- stripe: {
- type: Boolean,
- default: false
- },
- border: {
- type: Boolean,
- default: false
- },
- height: {
- type: [String, Number],
- default: null
- },
- maxHeight: {
- type: [String, Number],
- default: null
- },
- showHeader: {
- type: Boolean,
- default: true
- },
- highlightCurrentRow: {
- type: Boolean,
- default: false
- },
- rowKey: {
- type: String,
- default: "id"
- },
- currentRowKey: {
- type: [String, Number],
- default: null
- },
- rowStyle: {
- type: Object,
- default: () => ({})
- },
- cellClassName: {
- type: Function,
- default: null
- },
- cellStyle: {
- type: Function,
- default: null
- },
- headerCellClassName: {
- type: Function,
- default: null
- },
- rowClassName: {
- type: Function,
- default: null
- },
- context: {
- type: Object,
- default: null
- },
- showOverflowTooltip: {
- type: Boolean,
- default: false
- },
- lazy: {
- type: Boolean,
- default: false
- },
- load: {
- type: Function,
- default: null
- },
- treeProps: {
- type: Object,
- default: () => ({
- children: "children",
- hasChildren: "hasChildren"
- })
- },
- defaultExpandAll: {
- type: Boolean,
- default: false
- },
- expandRowKeys: {
- type: Array,
- default: () => []
- },
- sortOrders: {
- type: Array,
- default: () => ["ascending", "descending"]
- },
- sortable: {
- type: [Boolean, String],
- default: false
- },
- multiSort: {
- type: Boolean,
- default: false
- },
- sortBy: {
- type: String,
- default: null
- },
- sortMethod: {
- type: Function,
- default: null
- },
- filters: {
- type: Object,
- default: () => ({})
- },
- fixedHeader: {
- type: Boolean,
- default: true
- },
- emptyText: {
- type: String,
- default: "暂无数据"
- },
- // 添加mainCol属性,用于指定树形结构展开控制图标所在的列
- mainCol: {
- type: String,
- default: ""
- },
- expandWidth: {
- type: String,
- default: "25px"
- },
- rowHeight: {
- String,
- default: "40px"
- }
- },
- emits: [
- "select",
- "select-all",
- "selection-change",
- "cell-click",
- "row-click",
- "row-dblclick",
- "header-click",
- "sort-change",
- "filter-change",
- "current-change",
- "expand-change"
- ],
- data() {
- return {
- scrollWidth: "auto",
- // 将setup中的ref转换为data属性
- expandedKeys: [...this.expandRowKeys],
- selectedRows: [],
- sortConditions: [],
- currentRow: null,
- scrollLeft: 0,
- // 新增滚动位置数据
- showFixedColumnShadow: false,
- // 是否显示固定列阴影
- fixedLeftColumns: [],
- // 左侧固定列
- tableHeight: "auto",
- // 表格高度
- headerHeight: "auto",
- // 新增表头高度属性
- hasTree: false
- // 新增属性,用于判断是否存在树形结构
- };
- },
- mounted() {
- this.getComponentWidth();
- if (this.currentRowKey !== null) {
- const found = this.data.find((item) => item[this.rowKey] === this.currentRowKey);
- if (found) {
- this.currentRow = found;
- }
- }
- this.fixedLeftColumns = this.columns.filter((col) => col.fixed === "left");
- },
- computed: {
- // 将setup中的computed转换为computed属性
- filteredData() {
- return this.data.filter((row) => {
- return Object.keys(this.filters).every((key) => {
- var _a2;
- const filter = this.filters[key];
- if (!filter)
- return true;
- return (_a2 = row[key]) == null ? void 0 : _a2.toString().includes(filter.toString());
- });
- });
- },
- sortedData() {
- if (!this.sortConditions.length)
- return this.filteredData;
- const data = [...this.filteredData];
- return data.sort((a2, b2) => {
- for (const condition of this.sortConditions) {
- const { field, order } = condition;
- let valA = a2[field];
- let valB = b2[field];
- if (this.sortMethod) {
- const result = this.sortMethod(a2, b2, field);
- if (result !== 0)
- return result * (order === "ascending" ? 1 : -1);
- }
- if (valA < valB)
- return order === "ascending" ? -1 : 1;
- if (valA > valB)
- return order === "ascending" ? 1 : -1;
- }
- return 0;
- });
- },
- // 计算当前应该显示的固定左侧列
- visibleFixedLeftColumns() {
- if (this.scrollLeft <= 0) {
- return [];
- }
- let totalWidth = 0;
- let fixedWidth = 0;
- const visibleColumns = [];
- for (let i2 = 0; i2 < this.columns.length; i2++) {
- const col = this.columns[i2];
- const colWidth = col.width ? parseInt(col.width) : 100;
- if (col.fixed === "left" && this.scrollLeft > totalWidth - fixedWidth) {
- visibleColumns.push(col);
- fixedWidth += colWidth;
- }
- totalWidth += colWidth;
- }
- return visibleColumns;
- },
- // 获取mainCol的值,如果未设置则默认为第一列的key
- computedMainCol() {
- if (this.mainCol) {
- return this.mainCol;
- }
- const validColumns = this.columns.filter((col) => !col.type);
- let mainCol = validColumns && validColumns.length > 0 ? validColumns[0].key : "";
- return mainCol;
- }
- },
- watch: {
- // 将setup中的watch转换为watch属性
- expandRowKeys: {
- handler(newVal) {
- this.expandedKeys = [...newVal];
- },
- immediate: true
- },
- currentRowKey: {
- handler(newVal) {
- const found = this.data.find((item) => item[this.rowKey] === newVal);
- if (found) {
- this.currentRow = found;
- }
- },
- immediate: true
- },
- columns: {
- handler() {
- },
- deep: true,
- immediate: false
- }
- },
- methods: {
- addUnit,
- onScroll(e2) {
- this.scrollLeft = e2.detail.scrollLeft;
- this.fixedLeftColumns = this.columns.filter((col) => col.fixed === "left");
- if (this.fixedLeftColumns.length > 0) {
- this.showFixedColumnShadow = this.scrollLeft > 0;
- }
- },
- getFixedShadowStyle(col, index2) {
- let style = {
- width: col.width ? addUnit(col.width) : "auto"
- };
- if (col == null ? void 0 : col.style) {
- style = { ...style, ...col == null ? void 0 : col.style };
- }
- return style;
- },
- getFixedClass(col) {
- return "";
- },
- headerColStyle(col) {
- let style = {
- width: col.width ? addUnit(col.width) : "auto",
- flex: col.width ? "none" : 1
- };
- if (col == null ? void 0 : col.style) {
- style = { ...style, ...col == null ? void 0 : col.style };
- }
- return style;
- },
- setCellStyle(e2) {
- this.cellStyle = e2;
- },
- cellStyleInner(scope) {
- var _a2, _b;
- let style = {
- width: ((_a2 = scope.column) == null ? void 0 : _a2.width) ? addUnit(scope.column.width) : "auto",
- flex: ((_b = scope.column) == null ? void 0 : _b.width) ? "none" : 1
- };
- if (scope.column.key == this.computedMainCol) {
- style.paddingLeft = 16 * (scope.level - 1) + 2 + "px";
- }
- if (this.cellStyle != null) {
- let styleCalc = this.cellStyle(scope);
- if (styleCalc != null) {
- style = { ...style, ...styleCalc };
- }
- }
- return style;
- },
- // 获取组件的宽度
- async getComponentWidth() {
- await sleep(30);
- this.$uGetRect(".u-table-row").then((size) => {
- this.scrollWidth = size.width + "px";
- });
- this.$uGetRect(".u-table-header").then((size) => {
- if (size.height) {
- this.headerHeight = size.height + "px";
- }
- });
- this.hasTree = this.sortedData.some((item) => {
- return item[this.treeProps.children] && item[this.treeProps.children].length > 0;
- });
- },
- // 将setup中的函数转换为methods
- handleRowClick(row) {
- if (this.highlightCurrentRow) {
- const oldRow = this.currentRow;
- this.currentRow = row;
- this.$emit("current-change", row, oldRow);
- }
- this.$emit("row-click", row);
- },
- handleHeaderClick(column) {
- if (!column.sortable)
- return;
- const index2 = this.sortConditions.findIndex((c2) => c2.field === column.key);
- let newOrder = "ascending";
- if (index2 >= 0) {
- if (this.sortConditions[index2].order === "ascending") {
- newOrder = "descending";
- } else {
- this.sortConditions.splice(index2, 1);
- this.$emit("sort-change", this.sortConditions);
- return;
- }
- }
- if (!this.multiSort) {
- this.sortConditions = [{ field: column.key, order: newOrder }];
- } else {
- if (index2 >= 0) {
- this.sortConditions[index2].order = newOrder;
- } else {
- this.sortConditions.push({ field: column.key, order: newOrder });
- }
- }
- this.$emit("sort-change", this.sortConditions);
- },
- getSortIcon(field) {
- const cond = this.sortConditions.find((c2) => c2.field === field);
- if (!cond)
- return "";
- return cond.order === "ascending" ? "↑" : "↓";
- },
- getSortValue(field) {
- const cond = this.sortConditions.find((c2) => c2.field === field);
- if (!cond)
- return "";
- return cond.order === "ascending";
- },
- toggleSelect(row) {
- const index2 = this.selectedRows.findIndex((r2) => r2[this.rowKey] === row[this.rowKey]);
- if (index2 >= 0) {
- this.selectedRows.splice(index2, 1);
- this.unselectChildren(row);
- } else {
- this.selectedRows.push(row);
- this.selectChildren(row);
- }
- formatAppLog("log", "at uni_modules/uview-plus/components/u-table2/u-table2.vue:574", this.selectedRows);
- this.$emit("selection-change", this.selectedRows);
- this.$emit("select", row);
- },
- toggleExpand(row) {
- const key = row[this.rowKey];
- const index2 = this.expandedKeys.indexOf(key);
- if (index2 === -1) {
- this.expandedKeys.push(key);
- } else {
- this.expandedKeys.splice(index2, 1);
- }
- this.$emit("expand-change", this.expandedKeys);
- },
- isExpanded(row) {
- if (!row) {
- return false;
- }
- return this.expandedKeys.includes(row[this.rowKey]);
- },
- // 新增方法:递归选中所有子节点
- selectChildren(row) {
- const children = row[this.treeProps.children];
- if (children && children.length > 0) {
- children.forEach((child) => {
- const childIndex = this.selectedRows.findIndex((r2) => r2[this.rowKey] === child[this.rowKey]);
- if (childIndex === -1) {
- this.selectedRows.push(child);
- }
- this.selectChildren(child);
- });
- }
- },
- // 新增方法:递归取消选中所有子节点
- unselectChildren(row) {
- const children = row[this.treeProps.children];
- if (children && children.length > 0) {
- children.forEach((child) => {
- const childIndex = this.selectedRows.findIndex((r2) => r2[this.rowKey] === child[this.rowKey]);
- if (childIndex >= 0) {
- this.selectedRows.splice(childIndex, 1);
- }
- this.unselectChildren(child);
- });
- }
- }
- }
- };
- function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_table_row = vue.resolveComponent("table-row");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-table2", { "u-table-border": $props.border }])
- },
- [
- vue.createElementVNode(
- "scroll-view",
- {
- "scroll-x": "",
- class: "u-table2-content",
- style: vue.normalizeStyle({ height: $props.height ? $props.height + "px" : "auto" }),
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.onScroll && $options.onScroll(...args))
- },
- [
- vue.createCommentVNode(" 表头 "),
- $props.showHeader ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-table-header", { "u-table-sticky": $props.fixedHeader }]),
- style: vue.normalizeStyle({ minWidth: $data.scrollWidth })
- },
- [
- vue.createElementVNode("view", { class: "u-table-row" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.columns, (col, colIndex) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: col.key,
- class: vue.normalizeClass(["u-table-cell", [
- col.align ? "u-text-" + col.align : "",
- $props.headerCellClassName ? $props.headerCellClassName(col) : "",
- $options.getFixedClass(col)
- ]]),
- style: vue.normalizeStyle($options.headerColStyle(col)),
- onClick: ($event) => $options.handleHeaderClick(col)
- }, [
- vue.renderSlot(_ctx.$slots, "header", {
- column: col,
- columnIndex: colIndex,
- level: 1
- }, void 0, true),
- !_ctx.$slots["header"] ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 0 },
- vue.toDisplayString(col.title),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- col.sortable ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.renderSlot(_ctx.$slots, "headerSort", {
- sortStatus: $options.getSortValue(col.key),
- column: col,
- columnIndex: colIndex,
- level: 1
- }, void 0, true),
- !_ctx.$slots["headerSort"] ? (vue.openBlock(), vue.createElementBlock(
- "view",
- { key: 0 },
- vue.toDisplayString($options.getSortIcon(col.key)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ], 14, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 表体 "),
- vue.createElementVNode(
- "view",
- {
- class: "u-table-body",
- style: vue.normalizeStyle({ minWidth: $data.scrollWidth, maxHeight: $props.maxHeight ? $props.maxHeight + "px" : "none" })
- },
- [
- $props.data && $props.data.length > 0 ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList($options.sortedData, (row, rowIndex) => {
- return vue.openBlock(), vue.createBlock(_component_table_row, {
- key: row[$props.rowKey] || rowIndex,
- row,
- rowIndex,
- "parent-row": null,
- columns: $props.columns,
- "tree-props": $props.treeProps,
- "row-key": $props.rowKey,
- "expanded-keys": $data.expandedKeys,
- "cell-style-inner": $options.cellStyleInner,
- "is-expanded": $options.isExpanded,
- "row-class-name": $props.rowClassName,
- stripe: $props.stripe,
- "cell-class-name": $props.cellClassName,
- "get-fixed-class": $options.getFixedClass,
- "highlight-current-row": $props.highlightCurrentRow,
- "current-row": $data.currentRow,
- "handle-row-click": $options.handleRowClick,
- "toggle-expand": $options.toggleExpand,
- level: 1,
- rowHeight: $props.rowHeight,
- hasTree: $data.hasTree,
- selectedRows: $data.selectedRows,
- expandWidth: $props.expandWidth,
- computedMainCol: $options.computedMainCol,
- onToggleSelect: $options.toggleSelect,
- onRowClick: $options.handleRowClick,
- onToggleExpand: $options.toggleExpand
- }, {
- cellChild: vue.withCtx((scope) => [
- vue.renderSlot(_ctx.$slots, "cell", {
- row: scope.row,
- column: scope.column,
- prow: scope.prow,
- rowIndex: scope.rowIndex,
- columnIndex: scope.columnIndex,
- level: scope.level
- }, void 0, true)
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["row", "rowIndex", "columns", "tree-props", "row-key", "expanded-keys", "cell-style-inner", "is-expanded", "row-class-name", "stripe", "cell-class-name", "get-fixed-class", "highlight-current-row", "current-row", "handle-row-click", "toggle-expand", "rowHeight", "hasTree", "selectedRows", "expandWidth", "computedMainCol", "onToggleSelect", "onRowClick", "onToggleExpand"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.renderSlot(_ctx.$slots, "empty", {}, void 0, true),
- !_ctx.$slots["empty"] ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-table-empty"
- },
- vue.toDisplayString($props.emptyText),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )
- ],
- 36
- /* STYLE, NEED_HYDRATION */
- ),
- vue.createCommentVNode(" 固定列浮动视图 "),
- $data.showFixedColumnShadow ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-table-fixed-shadow",
- style: vue.normalizeStyle({ height: $data.tableHeight })
- },
- [
- vue.createCommentVNode(" 表头 "),
- $props.showHeader ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-table-header", { "u-table-sticky": $props.fixedHeader }]),
- style: vue.normalizeStyle({ minWidth: $data.scrollWidth })
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "u-table-row",
- style: vue.normalizeStyle({ height: $data.headerHeight })
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($options.visibleFixedLeftColumns, (col, colIndex) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: col.key,
- class: vue.normalizeClass(["u-table-cell", [
- col.align ? "u-text-" + col.align : "",
- $props.headerCellClassName ? $props.headerCellClassName(col) : "",
- $options.getFixedClass(col)
- ]]),
- style: vue.normalizeStyle($options.headerColStyle(col)),
- onClick: ($event) => $options.handleHeaderClick(col)
- }, [
- vue.renderSlot(_ctx.$slots, "header", {
- column: col,
- columnIndex: colIndex,
- level: 1
- }, void 0, true),
- !_ctx.$slots["header"] ? (vue.openBlock(), vue.createElementBlock(
- "text",
- { key: 0 },
- vue.toDisplayString(col.title),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- col.sortable ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.renderSlot(_ctx.$slots, "headerSort", {
- sortStatus: $options.getSortValue(col.key),
- column: col,
- columnIndex: colIndex,
- level: 1
- }, void 0, true),
- !_ctx.$slots["headerSort"] ? (vue.openBlock(), vue.createElementBlock(
- "view",
- { key: 0 },
- vue.toDisplayString($options.getSortIcon(col.key)),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ], 14, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 表体 "),
- vue.createElementVNode(
- "view",
- {
- class: "u-table-body",
- style: vue.normalizeStyle({ minWidth: $data.scrollWidth, maxHeight: $props.maxHeight ? $props.maxHeight + "px" : "none" })
- },
- [
- $props.data && $props.data.length > 0 ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList($options.sortedData, (row, rowIndex) => {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- {
- key: row[$props.rowKey] || rowIndex
- },
- [
- vue.createCommentVNode(" 子级渲染 (递归组件) "),
- vue.createVNode(_component_table_row, {
- row,
- rowIndex,
- "parent-row": null,
- columns: $options.visibleFixedLeftColumns,
- "tree-props": $props.treeProps,
- "row-key": $props.rowKey,
- "expanded-keys": $data.expandedKeys,
- "cell-style-inner": $options.cellStyleInner,
- "is-expanded": $options.isExpanded,
- "row-class-name": $props.rowClassName,
- stripe: $props.stripe,
- "cell-class-name": $props.cellClassName,
- "get-fixed-class": $options.getFixedClass,
- "highlight-current-row": $props.highlightCurrentRow,
- "current-row": $data.currentRow,
- "handle-row-click": $options.handleRowClick,
- "toggle-expand": $options.toggleExpand,
- level: 1,
- rowHeight: $props.rowHeight,
- hasTree: $data.hasTree,
- selectedRows: $data.selectedRows,
- expandWidth: $props.expandWidth,
- computedMainCol: $options.computedMainCol,
- onToggleSelect: $options.toggleSelect,
- onRowClick: $options.handleRowClick,
- onToggleExpand: $options.toggleExpand
- }, {
- cellChild: vue.withCtx((scope) => [
- vue.renderSlot(_ctx.$slots, "cell", {
- row: scope.row,
- column: scope.column,
- prow: scope.prow,
- rowIndex: scope.rowIndex,
- columnIndex: scope.columnIndex,
- level: scope.level
- }, void 0, true)
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["row", "rowIndex", "columns", "tree-props", "row-key", "expanded-keys", "cell-style-inner", "is-expanded", "row-class-name", "stripe", "cell-class-name", "get-fixed-class", "highlight-current-row", "current-row", "handle-row-click", "toggle-expand", "rowHeight", "hasTree", "selectedRows", "expandWidth", "computedMainCol", "onToggleSelect", "onRowClick", "onToggleExpand"])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- );
- }
- const uTable2 = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__scopeId", "data-v-ae8e3747"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-table2/u-table2.vue"]]);
- const __vite_glob_0_111 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTable2
- }, Symbol.toStringTag, { value: "Module" }));
- const props$9 = defineMixin({
- props: {}
- });
- const _sfc_main$n = {
- name: "u-tabs-item",
- mixins: [mpMixin, mixin, props$9],
- data() {
- return {};
- }
- };
- function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("swiper-item", null, [
- vue.renderSlot(_ctx.$slots, "default")
- ]);
- }
- const uTabsItem = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-tabs-item/u-tabs-item.vue"]]);
- const __vite_glob_0_112 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTabsItem
- }, Symbol.toStringTag, { value: "Module" }));
- const props$8 = defineMixin({
- props: {
- // 滑块的移动过渡时间,单位ms
- duration: {
- type: Number,
- default: () => props$1x.tabs.duration
- },
- // tabs标签数组
- list: {
- type: Array,
- default: () => props$1x.tabs.list
- },
- // 滑块颜色
- lineColor: {
- type: String,
- default: () => props$1x.tabs.lineColor
- },
- // 菜单选择中时的样式
- activeStyle: {
- type: [String, Object],
- default: () => props$1x.tabs.activeStyle
- },
- // 菜单非选中时的样式
- inactiveStyle: {
- type: [String, Object],
- default: () => props$1x.tabs.inactiveStyle
- },
- // 滑块长度
- lineWidth: {
- type: [String, Number],
- default: () => props$1x.tabs.lineWidth
- },
- // 滑块高度
- lineHeight: {
- type: [String, Number],
- default: () => props$1x.tabs.lineHeight
- },
- // 滑块背景显示大小,当滑块背景设置为图片时使用
- lineBgSize: {
- type: String,
- default: () => props$1x.tabs.lineBgSize
- },
- // 菜单item的样式
- itemStyle: {
- type: [String, Object],
- default: () => props$1x.tabs.itemStyle
- },
- // 菜单是否可滚动
- scrollable: {
- type: Boolean,
- default: () => props$1x.tabs.scrollable
- },
- // 当前选中标签的索引
- current: {
- type: [Number, String],
- default: () => props$1x.tabs.current
- },
- // 默认读取的键名
- keyName: {
- type: String,
- default: () => props$1x.tabs.keyName
- },
- // 左侧图标样式
- iconStyle: {
- type: [String, Object],
- default: () => props$1x.tabs.iconStyle
- }
- }
- });
- const _sfc_main$m = {
- name: "u-tabs",
- mixins: [mpMixin, mixin, props$8],
- data() {
- return {
- firstTime: true,
- scrollLeft: 0,
- scrollViewWidth: 0,
- lineOffsetLeft: 0,
- tabsRect: {
- left: 0
- },
- innerCurrent: 0,
- moving: false
- };
- },
- watch: {
- current: {
- immediate: true,
- handler(newValue, oldValue) {
- if (newValue !== this.innerCurrent) {
- if (typeof newValue == "string") {
- this.innerCurrent = parseInt(newValue);
- } else {
- 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$1(customeStyle, style);
- };
- },
- propsBadge() {
- return props$1x.badge;
- }
- },
- async mounted() {
- this.init();
- this.windowResizeCallback = (res) => {
- this.init();
- };
- uni.onWindowResize(this.windowResizeCallback);
- },
- beforeUnmount() {
- uni.offWindowResize(this.windowResizeCallback);
- },
- emits: ["click", "longPress", "change", "update:current"],
- methods: {
- addStyle,
- addUnit,
- 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(x2, duration = 0) {
- },
- // 点击某一个标签
- clickHandler(item, index2) {
- this.$emit("click", {
- ...item,
- index: index2
- }, index2);
- if (item.disabled)
- return;
- if (this.innerCurrent == index2)
- return;
- this.innerCurrent = index2;
- this.resize();
- this.$emit("update:current", index2);
- this.$emit("change", {
- ...item,
- index: index2
- }, index2);
- },
- // 长按事件
- longPressHandler(item, index2) {
- this.$emit("longPress", {
- ...item,
- index: index2
- });
- },
- init() {
- sleep().then(() => {
- this.resize();
- });
- },
- setScrollLeft() {
- if (this.innerCurrent < 0) {
- this.innerCurrent = 0;
- }
- 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 = getWindowInfo().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 = []]) => {
- if (tabsRect.left > tabsRect.width) {
- tabsRect.right = tabsRect.right - Math.floor(tabsRect.left / tabsRect.width) * tabsRect.width;
- tabsRect.left = tabsRect.left % tabsRect.width;
- }
- 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$l(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_badge = resolveEasycom(vue.resolveDynamicComponent("u-badge"), __easycom_0$9);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-tabs", [_ctx.customClass]])
- },
- [
- 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": _ctx.scrollable,
- "scroll-left": $data.scrollLeft,
- "scroll-with-animation": "",
- class: "u-tabs__wrapper__scroll-view",
- "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(_ctx.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",
- $data.innerCurrent == index2 ? "u-tabs__wrapper__nav__item-active" : ""
- ]]),
- key: index2,
- onClick: ($event) => $options.clickHandler(item, index2),
- onLongpress: ($event) => $options.longPressHandler(item, index2),
- ref_for: true,
- ref: `u-tabs__wrapper__nav__item-${index2}`,
- style: vue.normalizeStyle([$options.addStyle(_ctx.itemStyle), { flex: _ctx.scrollable ? "" : 1 }])
- }, [
- _ctx.$slots.icon ? vue.renderSlot(_ctx.$slots, "icon", {
- key: 0,
- item,
- keyName: _ctx.keyName,
- index: index2
- }, void 0, true) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- item.icon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-tabs__wrapper__nav__item__prefix-icon"
- }, [
- vue.createVNode(_component_up_icon, {
- name: item.icon,
- customStyle: $options.addStyle(_ctx.iconStyle)
- }, null, 8, ["name", "customStyle"])
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- )),
- _ctx.$slots.content ? vue.renderSlot(_ctx.$slots, "content", {
- key: 2,
- item,
- keyName: _ctx.keyName,
- index: index2
- }, void 0, true) : !_ctx.$slots.content && (_ctx.$slots.default || _ctx.$slots.$default) ? vue.renderSlot(_ctx.$slots, "default", {
- key: 3,
- item,
- keyName: _ctx.keyName,
- index: index2
- }, void 0, true) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 4,
- 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[_ctx.keyName]),
- 7
- /* TEXT, CLASS, STYLE */
- )),
- vue.createVNode(_component_u_badge, {
- show: !!(item.badge && (item.badge.show || item.badge.isDot || item.badge.value)),
- isDot: item.badge && item.badge.isDot || $options.propsBadge.isDot,
- value: item.badge && item.badge.value || $options.propsBadge.value,
- max: item.badge && item.badge.max || $options.propsBadge.max,
- type: item.badge && item.badge.type || $options.propsBadge.type,
- showZero: item.badge && item.badge.showZero || $options.propsBadge.showZero,
- bgColor: item.badge && item.badge.bgColor || $options.propsBadge.bgColor,
- color: item.badge && item.badge.color || $options.propsBadge.color,
- shape: item.badge && item.badge.shape || $options.propsBadge.shape,
- numberType: item.badge && item.badge.numberType || $options.propsBadge.numberType,
- inverted: item.badge && item.badge.inverted || $options.propsBadge.inverted,
- customStyle: "margin-left: 4px;"
- }, null, 8, ["show", "isDot", "value", "max", "type", "showZero", "bgColor", "color", "shape", "numberType", "inverted"])
- ], 46, ["onClick", "onLongpress"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode(
- "view",
- {
- class: "u-tabs__wrapper__nav__line",
- ref: "u-tabs__wrapper__nav__line",
- style: vue.normalizeStyle([{
- width: $options.addUnit(_ctx.lineWidth),
- transform: `translate(${$data.lineOffsetLeft}px)`,
- transitionDuration: `${$data.firstTime ? 0 : _ctx.duration}ms`,
- height: $options.addUnit(_ctx.lineHeight),
- background: _ctx.lineColor,
- backgroundSize: _ctx.lineBgSize
- }])
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 512
- /* NEED_PATCH */
- )
- ], 8, ["scroll-x", "scroll-left"])
- ]),
- vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
- ])
- ],
- 2
- /* CLASS */
- );
- }
- const uTabs = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__scopeId", "data-v-02b0c54f"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-tabs/u-tabs.vue"]]);
- const __vite_glob_0_113 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTabs
- }, Symbol.toStringTag, { value: "Module" }));
- const props$7 = defineMixin({
- props: {
- // 标签类型info、primary、success、warning、error
- type: {
- type: String,
- default: () => props$1x.tag.type
- },
- // 不可用
- disabled: {
- type: [Boolean, String],
- default: () => props$1x.tag.disabled
- },
- // 标签的大小,large,medium,mini
- size: {
- type: String,
- default: () => props$1x.tag.size
- },
- // tag的形状,circle(两边半圆形), square(方形,带圆角)
- shape: {
- type: String,
- default: () => props$1x.tag.shape
- },
- // 标签文字
- text: {
- type: [String, Number],
- default: () => props$1x.tag.text
- },
- // 背景颜色,默认为空字符串,即不处理
- bgColor: {
- type: String,
- default: () => props$1x.tag.bgColor
- },
- // 标签字体颜色,默认为空字符串,即不处理
- color: {
- type: String,
- default: () => props$1x.tag.color
- },
- // 标签的边框颜色
- borderColor: {
- type: String,
- default: () => props$1x.tag.borderColor
- },
- // 关闭按钮图标的颜色
- closeColor: {
- type: String,
- default: () => props$1x.tag.closeColor
- },
- // 点击时返回的索引值,用于区分例遍的数组哪个元素被点击了
- name: {
- type: [String, Number],
- default: () => props$1x.tag.name
- },
- // // 模式选择,dark|light|plain
- // mode: {
- // type: String,
- // default: 'light'
- // },
- // 镂空时是否填充背景色
- plainFill: {
- type: Boolean,
- default: () => props$1x.tag.plainFill
- },
- // 是否镂空
- plain: {
- type: Boolean,
- default: () => props$1x.tag.plain
- },
- // 是否可关闭
- closable: {
- type: Boolean,
- default: () => props$1x.tag.closable
- },
- // 是否显示
- show: {
- type: Boolean,
- default: () => props$1x.tag.show
- },
- // 内置图标,或绝对路径的图片
- icon: {
- type: String,
- default: () => props$1x.tag.icon
- },
- // 图标颜色
- iconColor: {
- type: String,
- default: () => props$1x.tag.iconColor
- },
- // 自定义尺寸字体大小
- textSize: {
- type: String,
- default: () => props$1x.tag.textSize
- },
- // 自定义尺寸高度
- height: {
- type: String,
- default: () => props$1x.tag.height
- },
- // 自定义尺寸padding
- padding: {
- type: String,
- default: () => props$1x.tag.padding
- },
- // 自定义尺寸
- borderRadius: {
- type: String,
- default: () => props$1x.tag.borderRadius
- },
- // 自动计算背景色
- autoBgColor: {
- type: Number,
- default: () => props$1x.tag.autoBgColor
- }
- }
- });
- const _sfc_main$l = {
- name: "u-tag",
- mixins: [mpMixin, mixin, props$7],
- data() {
- return {};
- },
- computed: {
- style() {
- const style = {};
- if (this.bgColor) {
- style.backgroundColor = this.bgColor;
- }
- if (this.color) {
- style.color = this.color;
- }
- if (this.borderColor) {
- style.borderColor = this.borderColor;
- }
- if (this.height) {
- style.height = addUnit(this.height);
- style.lineHeight = addUnit(this.height);
- }
- if (this.padding) {
- style.padding = this.padding;
- }
- if (this.borderRadius) {
- style.borderRadius = addUnit(this.borderRadius);
- }
- if (this.autoBgColor > 0 && this.color) {
- style.backgroundColor = this.getBagColor(this.color);
- }
- return style;
- },
- // nvue下,文本颜色无法继承父元素
- textColor() {
- const style = {};
- if (this.color) {
- style.color = this.color;
- }
- if (this.textSize) {
- style.textSize = addUnit(this.textSize);
- }
- return style;
- },
- imgStyle() {
- const width = this.size === "large" ? "17px" : this.size === "medium" ? "15px" : "13px";
- return {
- width,
- height: width
- };
- },
- // 文本的样式
- closeSize() {
- const size = this.size === "large" ? 15 : this.size === "medium" ? 13 : 12;
- return size;
- },
- // 图标大小
- iconSize() {
- const size = this.size === "large" ? 21 : this.size === "medium" ? 19 : 16;
- return size;
- },
- // 图标颜色
- elIconColor() {
- return this.iconColor ? this.iconColor : this.plain ? this.type : "#ffffff";
- }
- },
- emits: ["click", "close"],
- methods: {
- testImage: test.image,
- // 点击关闭按钮
- closeHandler() {
- this.$emit("close", this.name);
- },
- // 点击标签
- clickHandler() {
- this.$emit("click", this.name);
- },
- // 根据颜色计算浅色作为背景
- getBagColor(darkColor) {
- return genLightColor(darkColor, this.autoBgColor);
- }
- }
- };
- function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_2$1);
- return vue.openBlock(), vue.createBlock(_component_u_transition, {
- mode: "fade",
- show: _ctx.show,
- style: { "display": "inline-flex" }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "u-tag-wrapper cursor-pointer" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-tag", [`u-tag--${_ctx.shape}`, !_ctx.plain && `u-tag--${_ctx.type}`, _ctx.plain && `u-tag--${_ctx.type}--plain`, `u-tag--${_ctx.size}`, _ctx.plain && _ctx.plainFill && `u-tag--${_ctx.type}--plain--fill`]]),
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.clickHandler && $options.clickHandler(...args), ["stop"])),
- style: vue.normalizeStyle([{
- marginRight: _ctx.closable ? "10px" : 0,
- marginTop: _ctx.closable ? "10px" : 0
- }, $options.style])
- },
- [
- vue.renderSlot(_ctx.$slots, "icon", {}, () => [
- _ctx.icon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-tag__icon"
- }, [
- $options.testImage(_ctx.icon) ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: _ctx.icon,
- style: vue.normalizeStyle([$options.imgStyle])
- }, null, 12, ["src"])) : (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- color: $options.elIconColor,
- name: _ctx.icon,
- size: $options.iconSize
- }, null, 8, ["color", "name", "size"]))
- ])) : vue.createCommentVNode("v-if", true)
- ], true),
- vue.createElementVNode("view", { class: "u-tag__content" }, [
- vue.renderSlot(_ctx.$slots, "content", {}, void 0, true),
- !_ctx.$slots.content ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- !_ctx.$slots.default && !_ctx.$slots.$default ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["u-tag__text", [`u-tag__text--${_ctx.type}`, _ctx.plain && `u-tag__text--${_ctx.type}--plain`, `u-tag__text--${_ctx.size}`]]),
- style: vue.normalizeStyle([$options.textColor])
- },
- vue.toDisplayString(_ctx.text),
- 7
- /* TEXT, CLASS, STYLE */
- )) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: vue.normalizeClass(["u-tag__text", [`u-tag__text--${_ctx.type}`, _ctx.plain && `u-tag__text--${_ctx.type}--plain`, `u-tag__text--${_ctx.size}`]]),
- style: vue.normalizeStyle([$options.textColor])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 6
- /* CLASS, STYLE */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ],
- 6
- /* CLASS, STYLE */
- ),
- _ctx.closable ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-tag__close", [`u-tag__close--${_ctx.size}`]]),
- onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.closeHandler && $options.closeHandler(...args), ["stop"])),
- style: vue.normalizeStyle({ backgroundColor: _ctx.closeColor })
- },
- [
- vue.createVNode(_component_up_icon, {
- name: "close",
- size: $options.closeSize,
- color: "#ffffff"
- }, null, 8, ["size"])
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show"]);
- }
- const uTag = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$k], ["__scopeId", "data-v-2fd891bb"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-tag/u-tag.vue"]]);
- const __vite_glob_0_114 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTag
- }, Symbol.toStringTag, { value: "Module" }));
- const props$6 = defineMixin({
- props: {}
- });
- const _sfc_main$k = {
- name: "u-td",
- mixins: [mpMixin, mixin, props$6],
- props: {
- // 宽度,百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比
- width: {
- type: [String],
- default: "auto"
- },
- textAlign: {
- type: String,
- default: ""
- },
- fontSize: {
- type: String,
- default: ""
- },
- borderColor: {
- type: String,
- default: ""
- },
- color: {
- type: String,
- default: ""
- }
- },
- data() {
- return {
- tdStyle: {}
- };
- },
- created() {
- this.parent = false;
- },
- mounted() {
- this.parent = $parent.call(this, "u-table");
- if (this.parent) {
- let style = {};
- if (this.width != "auto")
- style.flex = `0 0 ${this.width}`;
- style.textAlign = this.parent.align;
- style.fontSize = addUnit(this.parent.fontSize);
- style.padding = this.parent.padding;
- style.borderBottom = `solid 1px ${this.parent.borderColor}`;
- style.borderRight = `solid 1px ${this.parent.borderColor}`;
- style.color = this.parent.color;
- if (this.textAlign != "") {
- style.textAlign = this.textAlign;
- }
- if (this.fontSize != "") {
- style.fontSize = this.fontSize;
- }
- if (this.borderColor != "") {
- style.borderColor = this.borderColor;
- }
- if (this.color != "") {
- style.color = this.color;
- }
- this.tdStyle = style;
- }
- }
- };
- function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-td",
- style: vue.normalizeStyle([$data.tdStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 4
- /* STYLE */
- );
- }
- const uTd = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$j], ["__scopeId", "data-v-0c19b389"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-td/u-td.vue"]]);
- const __vite_glob_0_115 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTd
- }, Symbol.toStringTag, { value: "Module" }));
- const props$5 = defineMixin({
- props: {
- // 主题颜色
- type: {
- type: String,
- default: () => props$1x.text.type
- },
- // 是否显示
- show: {
- type: Boolean,
- default: () => props$1x.text.show
- },
- // 显示的值
- text: {
- type: [String, Number],
- default: () => props$1x.text.text
- },
- // 前置图标
- prefixIcon: {
- type: String,
- default: () => props$1x.text.prefixIcon
- },
- // 后置图标
- suffixIcon: {
- type: String,
- default: () => props$1x.text.suffixIcon
- },
- // 文本处理的匹配模式
- // text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
- mode: {
- type: String,
- default: () => props$1x.text.mode
- },
- // mode=link下,配置的链接
- href: {
- type: String,
- default: () => props$1x.text.href
- },
- // 格式化规则
- format: {
- type: [String, Function],
- default: () => props$1x.text.format
- },
- // mode=phone时,点击文本是否拨打电话
- call: {
- type: Boolean,
- default: () => props$1x.text.call
- },
- // 小程序的打开方式
- openType: {
- type: String,
- default: () => props$1x.text.openType
- },
- // 是否粗体,默认normal
- bold: {
- type: Boolean,
- default: () => props$1x.text.bold
- },
- // 是否块状
- block: {
- type: Boolean,
- default: () => props$1x.text.block
- },
- // 文本显示的行数,如果设置,超出此行数,将会显示省略号
- lines: {
- type: [String, Number],
- default: () => props$1x.text.lines
- },
- // 文本颜色
- color: {
- type: String,
- default: () => props$1x.text.color
- },
- // 字体大小
- size: {
- type: [String, Number],
- default: () => props$1x.text.size
- },
- // 图标的样式
- iconStyle: {
- type: [Object, String],
- default: () => props$1x.text.iconStyle
- },
- // 文字装饰,下划线,中划线等,可选值 none|underline|line-through
- decoration: {
- tepe: String,
- default: () => props$1x.text.decoration
- },
- // 外边距,对象、字符串,数值形式均可
- margin: {
- type: [Object, String, Number],
- default: () => props$1x.text.margin
- },
- // 文本行高
- lineHeight: {
- type: [String, Number],
- default: () => props$1x.text.lineHeight
- },
- // 文本对齐方式,可选值left|center|right
- align: {
- type: String,
- default: () => props$1x.text.align
- },
- // 文字换行,可选值break-word|normal|anywhere
- wordWrap: {
- type: String,
- default: () => props$1x.text.wordWrap
- },
- // 占满剩余空间
- flex1: {
- type: Boolean,
- default: () => props$1x.text.flex1
- }
- }
- });
- const value = {
- computed: {
- // 经处理后需要显示的值
- value() {
- const {
- text,
- mode,
- format: format2,
- href
- } = this;
- if (mode === "price") {
- if (!/^\d+(\.\d+)?$/.test(text)) {
- error("金额模式下,text参数需要为金额格式");
- }
- if (test.func(format2)) {
- return format2(text);
- }
- return priceFormat(text, 2);
- }
- if (mode === "date") {
- !test.date(text) && error("日期模式下,text参数需要为日期或时间戳格式");
- if (test.func(format2)) {
- return format2(text);
- }
- if (format2) {
- return timeFormat(text, format2);
- }
- return timeFormat(text, "yyyy-mm-dd");
- }
- if (mode === "phone") {
- if (test.func(format2)) {
- return format2(text);
- }
- if (format2 === "encrypt") {
- return `${text.substr(0, 3)}****${text.substr(7)}`;
- }
- return text;
- }
- if (mode === "name") {
- !(typeof text === "string") && error("姓名模式下,text参数需要为字符串格式");
- if (test.func(format2)) {
- return format2(text);
- }
- if (format2 === "encrypt") {
- return this.formatName(text);
- }
- return text;
- }
- if (mode === "link") {
- !test.url(href) && error("超链接模式下,href参数需要为URL格式");
- return text;
- }
- return text;
- }
- },
- methods: {
- // 默认的姓名脱敏规则
- formatName(name2) {
- let value2 = "";
- if (name2.length === 2) {
- value2 = name2.substr(0, 1) + "*";
- } else if (name2.length > 2) {
- let char = "";
- for (let i2 = 0, len = name2.length - 2; i2 < len; i2++) {
- char += "*";
- }
- value2 = name2.substr(0, 1) + char + name2.substr(-1, 1);
- } else {
- value2 = name2;
- }
- return value2;
- }
- }
- };
- const _sfc_main$j = {
- name: "up-text",
- mixins: [mpMixin, mixin, value, props$5],
- emits: ["click"],
- computed: {
- wrapStyle() {
- let style = {
- margin: this.margin,
- justifyContent: this.align === "left" ? "flex-start" : this.align === "center" ? "center" : "flex-end"
- };
- if (this.flex1) {
- style.flex = 1;
- style.width = "100%";
- }
- return style;
- },
- valueStyle() {
- const style = {
- textDecoration: this.decoration,
- fontWeight: this.bold ? "bold" : "normal",
- wordWrap: this.wordWrap,
- fontSize: addUnit(this.size)
- };
- !this.type && (style.color = this.color);
- this.isNvue && this.lines && (style.lines = this.lines);
- this.lineHeight && (style.lineHeight = addUnit(this.lineHeight));
- !this.isNvue && this.block && (style.display = "block");
- return deepMerge$1(style, addStyle(this.customStyle));
- },
- isNvue() {
- let nvue = false;
- return nvue;
- },
- isMp() {
- let mp = false;
- return mp;
- }
- },
- data() {
- return {};
- },
- methods: {
- addStyle,
- clickHandler(e2) {
- if (this.call && this.mode === "phone") {
- uni.makePhoneCall({
- phoneNumber: this.text
- });
- }
- this.$emit("click", e2);
- }
- }
- };
- function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_link = resolveEasycom(vue.resolveDynamicComponent("u-link"), __easycom_0$2);
- return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["u-text", [_ctx.customClass]]),
- style: vue.normalizeStyle($options.wrapStyle),
- onClick: _cache[6] || (_cache[6] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- },
- [
- _ctx.mode === "price" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["u-text__price", _ctx.type && `u-text__value--${_ctx.type}`]),
- style: vue.normalizeStyle([$options.valueStyle])
- },
- "¥",
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.prefixIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "u-text__prefix-icon"
- }, [
- vue.createVNode(_component_up_icon, {
- name: _ctx.prefixIcon,
- customStyle: $options.addStyle(_ctx.iconStyle)
- }, null, 8, ["name", "customStyle"])
- ])) : vue.createCommentVNode("v-if", true),
- _ctx.mode === "link" ? (vue.openBlock(), vue.createBlock(_component_u_link, {
- key: 2,
- class: vue.normalizeClass(["u-text__value", [_ctx.type && `u-text__value--${_ctx.type}`, _ctx.lines && `u-line-${_ctx.lines}`]]),
- style: vue.normalizeStyle({ fontWeight: $options.valueStyle.fontWeight, wordWrap: $options.valueStyle.wordWrap, fontSize: $options.valueStyle.fontSize }),
- text: _ctx.value,
- href: _ctx.href,
- underLine: ""
- }, null, 8, ["style", "class", "text", "href"])) : _ctx.openType && $options.isMp ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 3,
- class: "u-reset-button u-text__value",
- style: vue.normalizeStyle([$options.valueStyle]),
- "data-index": _ctx.index,
- openType: _ctx.openType,
- onGetuserinfo: _cache[0] || (_cache[0] = (...args) => _ctx.onGetUserInfo && _ctx.onGetUserInfo(...args)),
- onContact: _cache[1] || (_cache[1] = (...args) => _ctx.onContact && _ctx.onContact(...args)),
- onGetphonenumber: _cache[2] || (_cache[2] = (...args) => _ctx.onGetPhoneNumber && _ctx.onGetPhoneNumber(...args)),
- onError: _cache[3] || (_cache[3] = (...args) => _ctx.onError && _ctx.onError(...args)),
- onLaunchapp: _cache[4] || (_cache[4] = (...args) => _ctx.onLaunchApp && _ctx.onLaunchApp(...args)),
- onOpensetting: _cache[5] || (_cache[5] = (...args) => _ctx.onOpenSetting && _ctx.onOpenSetting(...args)),
- lang: _ctx.lang,
- "session-from": _ctx.sessionFrom,
- "send-message-title": _ctx.sendMessageTitle,
- "send-message-path": _ctx.sendMessagePath,
- "send-message-img": _ctx.sendMessageImg,
- "show-message-card": _ctx.showMessageCard,
- "app-parameter": _ctx.appParameter
- }, vue.toDisplayString(_ctx.value), 45, ["data-index", "openType", "lang", "session-from", "send-message-title", "send-message-path", "send-message-img", "show-message-card", "app-parameter"])) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 4,
- class: vue.normalizeClass(["u-text__value", [
- _ctx.type && `u-text__value--${_ctx.type}`,
- _ctx.lines && `u-line-${_ctx.lines}`
- ]]),
- style: vue.normalizeStyle([$options.valueStyle])
- },
- vue.toDisplayString(_ctx.value),
- 7
- /* TEXT, CLASS, STYLE */
- )),
- _ctx.suffixIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 5,
- class: "u-text__suffix-icon"
- }, [
- vue.createVNode(_component_up_icon, {
- name: _ctx.suffixIcon,
- customStyle: $options.addStyle(_ctx.iconStyle)
- }, null, 8, ["name", "customStyle"])
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const uText = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i], ["__scopeId", "data-v-0a574502"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-text/u-text.vue"]]);
- const __vite_glob_0_116 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uText
- }, Symbol.toStringTag, { value: "Module" }));
- const props$4 = defineMixin({
- props: {
- // 输入框的内容
- value: {
- type: [String, Number],
- default: () => props$1x.textarea.value
- },
- // 输入框的内容
- modelValue: {
- type: [String, Number],
- default: () => props$1x.textarea.value
- },
- // 输入框为空时占位符
- placeholder: {
- type: [String, Number],
- default: () => props$1x.textarea.placeholder
- },
- // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
- placeholderClass: {
- type: String,
- default: () => props$1x.input.placeholderClass
- },
- // 指定placeholder的样式
- placeholderStyle: {
- type: [String, Object],
- default: () => props$1x.input.placeholderStyle
- },
- // 输入框高度
- height: {
- type: [String, Number],
- default: () => props$1x.textarea.height
- },
- // 设置键盘右下角按钮的文字,仅微信小程序,App-vue和H5有效
- confirmType: {
- type: String,
- default: () => props$1x.textarea.confirmType
- },
- // 是否禁用
- disabled: {
- type: Boolean,
- default: () => props$1x.textarea.disabled
- },
- // 是否显示统计字数
- count: {
- type: Boolean,
- default: () => props$1x.textarea.count
- },
- // 是否自动获取焦点,nvue不支持,H5取决于浏览器的实现
- focus: {
- type: Boolean,
- default: () => props$1x.textarea.focus
- },
- // 是否自动增加高度
- autoHeight: {
- type: Boolean,
- default: () => props$1x.textarea.autoHeight
- },
- // 如果textarea是在一个position:fixed的区域,需要显示指定属性fixed为true
- fixed: {
- type: Boolean,
- default: () => props$1x.textarea.fixed
- },
- // 指定光标与键盘的距离
- cursorSpacing: {
- type: Number,
- default: () => props$1x.textarea.cursorSpacing
- },
- // 指定focus时的光标位置
- cursor: {
- type: [String, Number],
- default: () => props$1x.textarea.cursor
- },
- // 是否显示键盘上方带有”完成“按钮那一栏,
- showConfirmBar: {
- type: Boolean,
- default: () => props$1x.textarea.showConfirmBar
- },
- // 光标起始位置,自动聚焦时有效,需与selection-end搭配使用
- selectionStart: {
- type: Number,
- default: () => props$1x.textarea.selectionStart
- },
- // 光标结束位置,自动聚焦时有效,需与selection-start搭配使用
- selectionEnd: {
- type: Number,
- default: () => props$1x.textarea.selectionEnd
- },
- // 键盘弹起时,是否自动上推页面
- adjustPosition: {
- type: Boolean,
- default: () => props$1x.textarea.adjustPosition
- },
- // 是否去掉 iOS 下的默认内边距,只微信小程序有效
- disableDefaultPadding: {
- type: Boolean,
- default: () => props$1x.textarea.disableDefaultPadding
- },
- // focus时,点击页面的时候不收起键盘,只微信小程序有效
- holdKeyboard: {
- type: Boolean,
- default: () => props$1x.textarea.holdKeyboard
- },
- // 最大输入长度,设置为 -1 的时候不限制最大长度
- maxlength: {
- type: [String, Number],
- default: () => props$1x.textarea.maxlength
- },
- // 边框类型,surround-四周边框,bottom-底部边框
- border: {
- type: String,
- default: () => props$1x.textarea.border
- },
- // 用于处理或者过滤输入框内容的方法
- formatter: {
- type: [Function, null],
- default: () => props$1x.textarea.formatter
- },
- // 是否忽略组件内对文本合成系统事件的处理
- ignoreCompositionEvent: {
- type: Boolean,
- default: true
- }
- }
- });
- const _sfc_main$i = {
- name: "u-textarea",
- mixins: [mpMixin, mixin, props$4],
- data() {
- return {
- // 输入框的值
- innerValue: "",
- // 是否处于获得焦点状态
- focused: false,
- // value是否第一次变化,在watch中,由于加入immediate属性,会在第一次触发,此时不应该认为value发生了变化
- firstChange: true,
- // value绑定值的变化是由内部还是外部引起的
- changeFromInner: false,
- // 过滤处理方法
- innerFormatter: (value2) => value2
- };
- },
- created() {
- },
- watch: {
- modelValue: {
- immediate: true,
- handler(newVal, oldVal) {
- this.innerValue = newVal;
- this.firstChange = false;
- this.changeFromInner = false;
- }
- }
- },
- computed: {
- fieldStyle() {
- let style = {};
- style["height"] = addUnit(this.height);
- if (this.autoHeight) {
- style["height"] = "auto";
- style["minHeight"] = addUnit(this.height);
- }
- return style;
- },
- // 组件的类名
- textareaClass() {
- let classes = [], { border, disabled } = this;
- border === "surround" && (classes = classes.concat(["u-border", "u-textarea--radius"]));
- border === "bottom" && (classes = classes.concat([
- "u-border-bottom",
- "u-textarea--no-radius"
- ]));
- disabled && classes.push("u-textarea--disabled");
- return classes.join(" ");
- },
- // 组件的样式
- textareaStyle() {
- const style = {};
- return deepMerge$1(style, addStyle(this.customStyle));
- }
- },
- emits: ["update:modelValue", "linechange", "focus", "blur", "change", "confirm", "keyboardheightchange"],
- methods: {
- addStyle,
- addUnit,
- // 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
- setFormatter(e2) {
- this.innerFormatter = e2;
- },
- onFocus(e2) {
- this.$emit("focus", e2);
- },
- onBlur(e2) {
- this.$emit("blur", e2);
- formValidate(this, "blur");
- },
- onLinechange(e2) {
- this.$emit("linechange", e2);
- },
- onInput(e2) {
- let { value: value2 = "" } = e2.detail || {};
- const formatter = this.formatter || this.innerFormatter;
- const formatValue = formatter(value2);
- this.innerValue = value2;
- this.$nextTick(() => {
- this.innerValue = formatValue;
- this.valueChange();
- });
- },
- // 内容发生变化,进行处理
- valueChange() {
- const value2 = this.innerValue;
- this.$nextTick(() => {
- this.$emit("update:modelValue", value2);
- this.changeFromInner = true;
- this.$emit("change", value2);
- formValidate(this, "change");
- });
- },
- onConfirm(e2) {
- this.$emit("confirm", e2);
- },
- onKeyboardheightchange(e2) {
- this.$emit("keyboardheightchange", e2);
- }
- }
- };
- function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-textarea", $options.textareaClass]),
- style: vue.normalizeStyle([$options.textareaStyle])
- },
- [
- vue.createElementVNode("textarea", {
- class: "u-textarea__field",
- value: $data.innerValue,
- style: vue.normalizeStyle($options.fieldStyle),
- placeholder: _ctx.placeholder,
- "placeholder-style": $options.addStyle(_ctx.placeholderStyle, typeof _ctx.placeholderStyle === "string" ? "string" : "object"),
- "placeholder-class": _ctx.placeholderClass,
- disabled: _ctx.disabled,
- focus: _ctx.focus,
- autoHeight: _ctx.autoHeight,
- fixed: _ctx.fixed,
- cursorSpacing: _ctx.cursorSpacing,
- cursor: _ctx.cursor,
- showConfirmBar: _ctx.showConfirmBar,
- selectionStart: _ctx.selectionStart,
- selectionEnd: _ctx.selectionEnd,
- adjustPosition: _ctx.adjustPosition,
- disableDefaultPadding: _ctx.disableDefaultPadding,
- holdKeyboard: _ctx.holdKeyboard,
- maxlength: _ctx.maxlength,
- "confirm-type": _ctx.confirmType,
- ignoreCompositionEvent: _ctx.ignoreCompositionEvent,
- onFocus: _cache[0] || (_cache[0] = (...args) => $options.onFocus && $options.onFocus(...args)),
- onBlur: _cache[1] || (_cache[1] = (...args) => $options.onBlur && $options.onBlur(...args)),
- onLinechange: _cache[2] || (_cache[2] = (...args) => $options.onLinechange && $options.onLinechange(...args)),
- onInput: _cache[3] || (_cache[3] = (...args) => $options.onInput && $options.onInput(...args)),
- onConfirm: _cache[4] || (_cache[4] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
- onKeyboardheightchange: _cache[5] || (_cache[5] = (...args) => $options.onKeyboardheightchange && $options.onKeyboardheightchange(...args))
- }, null, 44, ["value", "placeholder", "placeholder-style", "placeholder-class", "disabled", "focus", "autoHeight", "fixed", "cursorSpacing", "cursor", "showConfirmBar", "selectionStart", "selectionEnd", "adjustPosition", "disableDefaultPadding", "holdKeyboard", "maxlength", "confirm-type", "ignoreCompositionEvent"]),
- _ctx.count ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-textarea__count",
- style: vue.normalizeStyle({
- "background-color": _ctx.disabled ? "transparent" : "#fff"
- })
- },
- vue.toDisplayString($data.innerValue.length) + "/" + vue.toDisplayString(_ctx.maxlength),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const uTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__scopeId", "data-v-b6c174a6"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-textarea/u-textarea.vue"]]);
- const __vite_glob_0_117 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTextarea
- }, Symbol.toStringTag, { value: "Module" }));
- const props$3 = defineMixin({
- props: {}
- });
- const _sfc_main$h = {
- name: "u-th",
- mixins: [mpMixin, mixin, props$3],
- props: {
- // 宽度,百分比或者具体带单位的值,如30%, 200rpx等,一般使用百分比
- width: {
- type: [String],
- default: ""
- }
- },
- data() {
- return {
- thStyle: {}
- };
- },
- created() {
- this.parent = false;
- },
- mounted() {
- this.parent = $parent.call(this, "u-table");
- if (this.parent) {
- let style = {};
- if (this.width)
- style.flex = `0 0 ${this.width}`;
- style.textAlign = this.parent.align;
- style.padding = this.parent.padding;
- style.borderBottom = `solid 1px ${this.parent.borderColor}`;
- style.borderRight = `solid 1px ${this.parent.borderColor}`;
- Object.assign(style, this.parent.thStyle);
- this.thStyle = style;
- }
- }
- };
- function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-th",
- style: vue.normalizeStyle([$data.thStyle])
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 4
- /* STYLE */
- );
- }
- const uTh = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g], ["__scopeId", "data-v-67643fa0"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-th/u-th.vue"]]);
- const __vite_glob_0_118 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTh
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$g = {
- name: "u-title",
- props: {},
- data() {
- return {};
- },
- created: function() {
- },
- methods: {}
- };
- function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-title u-flex-row u-flex-y-center" }, [
- vue.renderSlot(_ctx.$slots, "prefix", {}, () => [
- vue.createElementVNode("view", { class: "u-title-prefix" })
- ], true),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ]);
- }
- const uTitle = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f], ["__scopeId", "data-v-018ff1f0"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-title/u-title.vue"]]);
- const __vite_glob_0_119 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTitle
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$f = {
- name: "u-toast",
- mixins: [mpMixin, mixin],
- data() {
- return {
- isShow: false,
- timer: null,
- // 定时器
- config: {
- message: "",
- // 显示文本
- type: "",
- // 主题类型,primary,success,error,warning,black
- zIndex: 10090,
- // 层级
- duration: 2e3,
- // 显示的时间,毫秒
- icon: true,
- // 显示的图标
- position: "center",
- // toast出现的位置
- complete: null,
- // 执行完后的回调函数
- overlay: true,
- // 是否防止触摸穿透
- loading: false
- // 是否加载中状态
- },
- tmpConfig: {}
- // 将用户配置和内置配置合并后的临时配置变量
- };
- },
- computed: {
- iconName() {
- if (!this.tmpConfig.icon || this.tmpConfig.icon == "none") {
- return "";
- }
- if (this.tmpConfig.icon === true) {
- if (["error", "warning", "success", "primary"].includes(this.tmpConfig.type)) {
- return type2icon(this.tmpConfig.type);
- } else {
- return "";
- }
- } else {
- return this.tmpConfig.icon;
- }
- },
- overlayStyle() {
- const style = {
- justifyContent: "center",
- alignItems: "center",
- display: "flex"
- };
- style.backgroundColor = "rgba(0, 0, 0, 0)";
- return style;
- },
- iconStyle() {
- const style = {};
- style.marginRight = "4px";
- return style;
- },
- loadingIconColor() {
- let colorTmp = "rgb(255, 255, 255)";
- if (["error", "warning", "success", "primary"].includes(this.tmpConfig.type)) {
- colorTmp = hexToRgb(color$3[this.tmpConfig.type]);
- }
- return colorTmp;
- },
- // 内容盒子的样式
- contentStyle() {
- const windowHeight = getWindowInfo().windowHeight, style = {};
- let value2 = 0;
- if (this.tmpConfig.position === "top") {
- value2 = -windowHeight * 0.25;
- } else if (this.tmpConfig.position === "bottom") {
- value2 = windowHeight * 0.25;
- }
- style.transform = `translateY(${value2}px)`;
- return style;
- }
- },
- created() {
- ["primary", "success", "error", "warning", "default", "loading"].map((item) => {
- this[item] = (message) => this.show({
- type: item,
- message
- });
- });
- },
- methods: {
- // 显示toast组件,由父组件通过this.$refs.xxx.show(options)形式调用
- show(options2) {
- this.tmpConfig = deepMerge$1(this.config, options2);
- this.clearTimer();
- this.isShow = true;
- if (this.tmpConfig.duration !== -1) {
- this.timer = setTimeout(() => {
- this.clearTimer();
- typeof this.tmpConfig.complete === "function" && this.tmpConfig.complete();
- }, this.tmpConfig.duration);
- }
- },
- // 隐藏toast组件,由父组件通过this.$refs.xxx.hide()形式调用
- hide() {
- this.clearTimer();
- },
- clearTimer() {
- this.isShow = false;
- clearTimeout(this.timer);
- this.timer = null;
- }
- },
- beforeUnmount() {
- this.clearTimer();
- }
- };
- function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_loading_icon = resolveEasycom(vue.resolveDynamicComponent("u-loading-icon"), __easycom_0$e);
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_gap = resolveEasycom(vue.resolveDynamicComponent("u-gap"), __easycom_1$3);
- const _component_u_overlay = resolveEasycom(vue.resolveDynamicComponent("u-overlay"), __easycom_0$d);
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-toast" }, [
- vue.createVNode(_component_u_overlay, {
- show: $data.isShow,
- zIndex: $data.tmpConfig.overlay ? $data.tmpConfig.zIndex : -1,
- "custom-style": $options.overlayStyle
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["u-toast__content", ["u-type-" + $data.tmpConfig.type, $data.tmpConfig.type === "loading" || $data.tmpConfig.loading ? "u-toast__content--loading" : ""]]),
- style: vue.normalizeStyle([$options.contentStyle])
- },
- [
- $data.tmpConfig.type === "loading" ? (vue.openBlock(), vue.createBlock(_component_u_loading_icon, {
- key: 0,
- mode: "circle",
- color: "rgb(255, 255, 255)",
- inactiveColor: "rgb(120, 120, 120)",
- size: "25"
- })) : $data.tmpConfig.type !== "defalut" && $options.iconName ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- name: $options.iconName,
- size: "17",
- color: $data.tmpConfig.type,
- customStyle: $options.iconStyle
- }, null, 8, ["name", "color", "customStyle"])) : vue.createCommentVNode("v-if", true),
- $data.tmpConfig.type === "loading" || $data.tmpConfig.loading ? (vue.openBlock(), vue.createBlock(_component_u_gap, {
- key: 2,
- height: "12",
- bgColor: "transparent"
- })) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["u-toast__content__text", ["u-toast__content__text--" + $data.tmpConfig.type]]),
- style: { "max-width": "400rpx" }
- },
- vue.toDisplayString($data.tmpConfig.message),
- 3
- /* TEXT, CLASS */
- )
- ],
- 6
- /* CLASS, STYLE */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show", "zIndex", "custom-style"])
- ]);
- }
- const uToast = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e], ["__scopeId", "data-v-e61e8fb9"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-toast/u-toast.vue"]]);
- const __vite_glob_0_120 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uToast
- }, Symbol.toStringTag, { value: "Module" }));
- const props$2 = defineMixin({
- props: {
- // 需要显示的提示文字
- text: {
- type: [String, Number],
- default: () => props$1x.tooltip.text
- },
- // 点击复制按钮时,复制的文本,为空则使用text值
- copyText: {
- type: [String, Number],
- default: () => props$1x.tooltip.copyText
- },
- // 文本大小
- size: {
- type: [String, Number],
- default: () => props$1x.tooltip.size
- },
- // 字体颜色
- color: {
- type: String,
- default: () => props$1x.tooltip.color
- },
- // 弹出提示框时,文本的背景色
- bgColor: {
- type: String,
- default: () => props$1x.tooltip.bgColor
- },
- // 弹出提示框的背景色
- popupBgColor: {
- type: String,
- default: () => props$1x.tooltip.popupBgColor
- },
- // 弹出提示的方向,top-上方,bottom-下方,left-左方,right-右方
- direction: {
- type: String,
- default: () => props$1x.tooltip.direction
- },
- // 弹出提示的z-index,nvue无效
- zIndex: {
- type: [String, Number],
- default: () => props$1x.tooltip.zIndex
- },
- // 是否显示复制按钮
- showCopy: {
- type: Boolean,
- default: () => props$1x.tooltip.showCopy
- },
- // 扩展的按钮组
- buttons: {
- type: Array,
- default: () => props$1x.tooltip.buttons
- },
- // 是否显示透明遮罩以防止触摸穿透
- overlay: {
- type: Boolean,
- default: () => props$1x.tooltip.overlay
- },
- // 是否显示复制成功或者失败的toast
- showToast: {
- type: Boolean,
- default: () => props$1x.tooltip.showToast
- },
- // 触发方式,可选值:longpress/click
- triggerMode: {
- type: String,
- default: () => props$1x.tooltip.triggerMode
- }
- }
- });
- const _sfc_main$e = {
- name: "u-tooltip",
- mixins: [mpMixin, mixin, props$2],
- data() {
- return {
- // 是否展示气泡
- showTooltip: true,
- // 生成唯一id,防止一个页面多个组件,造成干扰
- textId: guid(),
- tooltipId: guid(),
- // 初始时甚至为很大的值,让其移到屏幕外面,为了计算元素的尺寸
- tooltipTop: -1e4,
- // 气泡的位置信息
- tooltipInfo: {
- width: 0,
- left: 0
- },
- // 文本的位置信息
- textInfo: {
- width: 0,
- left: 0
- },
- // 三角形指示器的样式
- indicatorStyle: {},
- // 气泡在可能超出屏幕边沿范围时,重新定位后,距离屏幕边沿的距离
- screenGap: 12,
- // 三角形指示器的宽高,由于对元素进行了角度旋转,精确计算指示器位置时,需要用到其尺寸信息
- indicatorWidth: 14,
- tooltipStyle: {}
- };
- },
- watch: {
- async propsChange() {
- await this.getElRect();
- this.getTooltipStyle();
- }
- },
- computed: {
- // 特别处理H5的复制,因为H5浏览器是自带系统复制功能的,在H5环境
- // 当一些依赖参数变化时,需要重新计算气泡和指示器的位置信息
- propsChange() {
- return [this.text, this.buttons];
- }
- },
- mounted() {
- this.init();
- },
- emits: ["click"],
- methods: {
- addStyle,
- addUnit,
- async init() {
- await this.getElRect();
- this.getTooltipStyle();
- },
- // 计算气泡和指示器的位置信息
- getTooltipStyle() {
- const style = {}, sysInfo = getWindowInfo();
- if (this.direction === "left") {
- style.transform = ``;
- style.top = "-" + addUnit((this.tooltipInfo.height - this.indicatorWidth) / 2, "px");
- style.right = addUnit(this.textInfo.width + this.indicatorWidth, "px");
- this.indicatorStyle = {};
- this.indicatorStyle.right = "-4px";
- this.indicatorStyle.top = addUnit((this.tooltipInfo.height - this.indicatorWidth) / 2, "px");
- } else if (this.direction === "right") {
- style.transform = ``;
- style.top = addUnit((this.textInfo.height - this.tooltipInfo.height) / 2, "px");
- style.left = addUnit(this.textInfo.width + this.indicatorWidth, "px");
- this.indicatorStyle = {};
- this.indicatorStyle.left = "-4px";
- this.indicatorStyle.top = addUnit((this.textInfo.height - this.indicatorWidth) / 2, "px");
- } else if (this.direction === "top" || this.direction === "bottom") {
- style.transform = `translateY(${this.direction === "top" ? "-100%" : "100%"})`;
- if (this.tooltipInfo.width / 2 > this.textInfo.left + this.textInfo.width / 2 - this.screenGap) {
- this.indicatorStyle = {};
- style.left = `-${addUnit(this.textInfo.left - this.screenGap)}`;
- this.indicatorStyle.left = addUnit(this.textInfo.width / 2 - getPx(style.left) - this.indicatorWidth / 2, "px");
- } else if (this.tooltipInfo.width / 2 > sysInfo.windowWidth - this.textInfo.right + this.textInfo.width / 2 - this.screenGap) {
- this.indicatorStyle = {};
- style.right = `-${addUnit(sysInfo.windowWidth - this.textInfo.right - this.screenGap)}`;
- this.indicatorStyle.right = addUnit(this.textInfo.width / 2 - getPx(style.right) - this.indicatorWidth / 2);
- } else {
- const left = Math.abs(this.textInfo.width / 2 - this.tooltipInfo.width / 2);
- style.left = this.textInfo.width > this.tooltipInfo.width ? addUnit(left) : -addUnit(left);
- this.indicatorStyle = {};
- }
- if (this.direction === "top") {
- style.marginTop = "-10px";
- this.indicatorStyle.bottom = "-4px";
- } else {
- style.marginBottom = "-10px";
- this.indicatorStyle.top = "-4px";
- }
- }
- this.tooltipStyle = style;
- return style;
- },
- // 点击触发事件
- async clickHander() {
- if (this.triggerMode == "click") {
- this.tooltipTop = 0;
- this.showTooltip = true;
- }
- },
- // 长按触发事件
- async longpressHandler() {
- if (this.triggerMode == "longpress") {
- this.tooltipTop = 0;
- this.showTooltip = true;
- }
- },
- // 点击透明遮罩
- overlayClickHandler() {
- this.showTooltip = false;
- },
- // 点击弹出按钮
- btnClickHandler(index2) {
- this.showTooltip = false;
- this.$emit("click", this.showCopy ? index2 + 1 : index2);
- },
- // 查询内容高度
- queryRect(ref) {
- return new Promise((resolve) => {
- this.$uGetRect(`#${ref}`).then((size) => {
- resolve(size);
- });
- });
- },
- // 元素尺寸
- getElRect() {
- return new Promise(async (resolve) => {
- this.showTooltip = true;
- this.tooltipTop = -1e4;
- sleep(500).then(async () => {
- this.tooltipInfo = await this.queryRect(this.tooltipId);
- this.showTooltip = false;
- this.textInfo = await this.queryRect(this.textId);
- resolve();
- });
- });
- },
- // 复制文本到粘贴板
- setClipboardData() {
- this.showTooltip = false;
- this.$emit("click", 0);
- uni.setClipboardData({
- // 优先使用copyText字段,如果没有,则默认使用text字段当做复制的内容
- data: this.copyText || this.text,
- success: () => {
- this.showToast && toast("复制成功");
- },
- fail: () => {
- this.showToast && toast("复制失败");
- },
- complete: () => {
- this.showTooltip = false;
- }
- });
- }
- }
- };
- function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_u_overlay = resolveEasycom(vue.resolveDynamicComponent("u-overlay"), __easycom_0$d);
- const _component_u_line = resolveEasycom(vue.resolveDynamicComponent("u-line"), __easycom_1$4);
- const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_2$1);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-tooltip",
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)])
- },
- [
- vue.createVNode(_component_u_overlay, {
- show: $data.showTooltip && $data.tooltipTop !== -1e4 && _ctx.overlay,
- customStyle: "backgroundColor: rgba(0, 0, 0, 0)",
- onClick: $options.overlayClickHandler
- }, null, 8, ["show", "onClick"]),
- vue.createElementVNode("view", { class: "u-tooltip__wrapper" }, [
- vue.createElementVNode("view", {
- class: "u-tooltip__trigger",
- id: $data.textId,
- ref: $data.textId,
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.clickHander && $options.clickHander(...args), ["stop"])),
- onLongpress: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.longpressHandler && $options.longpressHandler(...args), ["stop"]))
- }, [
- vue.renderSlot(_ctx.$slots, "trigger", {}, void 0, true),
- !_ctx.$slots["trigger"] ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-tooltip__wrapper__text",
- userSelect: false,
- selectable: false,
- style: vue.normalizeStyle({
- color: _ctx.color,
- backgroundColor: _ctx.bgColor && $data.showTooltip && $data.tooltipTop !== -1e4 ? _ctx.bgColor : "transparent"
- })
- },
- vue.toDisplayString(_ctx.text),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ], 40, ["id"]),
- vue.createVNode(_component_u_transition, {
- mode: "fade",
- show: $data.showTooltip,
- duration: "300",
- customStyle: {
- position: "absolute",
- top: $options.addUnit($data.tooltipTop),
- zIndex: _ctx.zIndex,
- ...$data.tooltipStyle
- }
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", {
- class: "u-tooltip__wrapper__popup",
- id: $data.tooltipId,
- ref: $data.tooltipId
- }, [
- _ctx.showCopy || _ctx.buttons.length ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-tooltip__wrapper__popup__indicator",
- "hover-class": "u-tooltip__wrapper__popup__indicator--hover",
- style: vue.normalizeStyle([$data.indicatorStyle, {
- width: $options.addUnit($data.indicatorWidth),
- height: $options.addUnit($data.indicatorWidth),
- backgroundColor: _ctx.popupBgColor
- }])
- },
- [
- vue.createCommentVNode(" 由于nvue不支持三角形绘制,这里就做一个四方形,再旋转45deg,得到露出的一个三角 ")
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "view",
- {
- class: "u-tooltip__wrapper__popup__list",
- style: vue.normalizeStyle({
- backgroundColor: _ctx.popupBgColor,
- color: _ctx.color
- })
- },
- [
- vue.renderSlot(_ctx.$slots, "content", {}, void 0, true),
- !_ctx.$slots["content"] ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- _ctx.showCopy ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-tooltip__wrapper__popup__list__btn",
- "hover-class": "u-tooltip__wrapper__popup__list__btn--hover",
- style: vue.normalizeStyle({ backgroundColor: _ctx.popupBgColor }),
- onClick: _cache[2] || (_cache[2] = (...args) => $options.setClipboardData && $options.setClipboardData(...args))
- },
- [
- vue.createElementVNode("text", { class: "u-tooltip__wrapper__popup__list__btn__text" }, "复制")
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.showCopy && _ctx.buttons.length > 0 ? (vue.openBlock(), vue.createBlock(_component_u_line, {
- key: 1,
- direction: "column",
- color: "#8d8e90",
- length: "18"
- })) : vue.createCommentVNode("v-if", true),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.buttons, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: index2 },
- [
- vue.createElementVNode("view", {
- class: "u-tooltip__wrapper__popup__list__btn",
- "hover-class": "u-tooltip__wrapper__popup__list__btn--hover"
- }, [
- vue.createElementVNode("text", {
- class: "u-tooltip__wrapper__popup__list__btn__text",
- onClick: ($event) => $options.btnClickHandler(index2)
- }, vue.toDisplayString(item), 9, ["onClick"])
- ]),
- index2 < _ctx.buttons.length - 1 ? (vue.openBlock(), vue.createBlock(_component_u_line, {
- key: 0,
- direction: "column",
- color: "#8d8e90",
- length: "18"
- })) : vue.createCommentVNode("v-if", true)
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )
- ], 8, ["id"])
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "customStyle"])
- ])
- ],
- 4
- /* STYLE */
- );
- }
- const uTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d], ["__scopeId", "data-v-92dedddb"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-tooltip/u-tooltip.vue"]]);
- const __vite_glob_0_122 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTooltip
- }, Symbol.toStringTag, { value: "Module" }));
- const props$1 = defineMixin({
- props: {}
- });
- const _sfc_main$d = {
- name: "u-tr",
- mixins: [mpMixin, mixin, props$1],
- data() {
- return {};
- }
- };
- function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-tr" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ]);
- }
- const uTr = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c], ["__scopeId", "data-v-1c6ea6f9"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-tr/u-tr.vue"]]);
- const __vite_glob_0_123 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTr
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$c = {
- name: "tree-node",
- props: {
- node: {
- type: Object,
- required: true
- },
- props: {
- type: Object,
- required: true
- },
- showCheckbox: {
- type: Boolean,
- default: false
- },
- checkStrictly: {
- type: Boolean,
- default: false
- },
- expandOnClickNode: {
- type: Boolean,
- default: true
- },
- depth: {
- type: Number,
- default: 0
- }
- },
- computed: {
- hasChildren() {
- return this.node[this.props.children] && this.node[this.props.children].length > 0;
- },
- isExpanded() {
- return this.node.expanded === void 0 ? false : this.node.expanded;
- }
- },
- emits: ["node-click", "check-change"],
- methods: {
- toggle() {
- if (this.expandOnClickNode && this.hasChildren) {
- this.node.expanded = !this.node.expanded;
- }
- this.$emit("node-click", this.node);
- },
- toggleCheck(checked) {
- this.node.checked = checked;
- if (!this.checkStrictly) {
- this.updateChildCheckStatus(this.node, checked);
- this.updateParentCheckStatus(this.node);
- }
- this.$emit("check-change", this.node);
- },
- updateChildCheckStatus(node2, checked) {
- if (node2[this.props.children]) {
- node2[this.props.children].forEach((child) => {
- child.checked = checked;
- this.updateChildCheckStatus(child, checked);
- });
- }
- },
- updateParentCheckStatus(node2) {
- let parent = this.$parent;
- while (parent && parent.node) {
- const allChecked = parent.node[this.props.children].every(
- (child) => child.checked
- );
- parent.node.checked = allChecked;
- parent = parent.$parent;
- }
- }
- }
- };
- function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_up_checkbox = vue.resolveComponent("up-checkbox");
- const _component_tree_node = vue.resolveComponent("tree-node", true);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-tree-node",
- style: vue.normalizeStyle({ paddingLeft: $props.depth * 20 + "px" })
- },
- [
- vue.createElementVNode("view", {
- class: "u-tree-node-content",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.toggle && $options.toggle(...args))
- }, [
- vue.createCommentVNode(` <text v-if="hasChildren" class="u-tree-node-toggle">
- {{ node.expanded ? '▼' : '▶' }}
- </text> `),
- $options.hasChildren ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- class: "u-tree-node-toggle",
- name: $props.node.expanded ? "arrow-down-fill" : "play-right-fill",
- size: "12"
- }, null, 8, ["name"])) : vue.createCommentVNode("v-if", true),
- $props.showCheckbox ? (vue.openBlock(), vue.createBlock(_component_up_checkbox, {
- key: 1,
- usedAlone: "",
- size: 12,
- checked: $props.node.checked,
- onChange: $options.toggleCheck,
- style: { "margin-right": "10px" }
- }, null, 8, ["checked", "onChange"])) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {
- nodeData: $props.node,
- level: $props.depth + 1
- }, () => [
- vue.createTextVNode(
- vue.toDisplayString($props.node[$props.props.label]),
- 1
- /* TEXT */
- )
- ], true)
- ]),
- $options.hasChildren && ($props.node.expanded === void 0 ? true : $props.node.expanded) ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "u-tree-node-children",
- style: vue.normalizeStyle({ paddingLeft: ($props.depth + 1) * 20 + "px" })
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.node[$props.props.children], (child) => {
- return vue.openBlock(), vue.createBlock(_component_tree_node, {
- key: child[$props.props.nodeKey],
- node: child,
- props: $props.props,
- "show-checkbox": $props.showCheckbox,
- "check-strictly": $props.checkStrictly,
- "expand-on-click-node": $props.expandOnClickNode,
- depth: $props.depth + 1,
- onNodeClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("node-click", $event)),
- onCheckChange: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("check-change", $event))
- }, {
- default: vue.withCtx(({ nodeData, level }) => [
- vue.renderSlot(_ctx.$slots, "default", {
- nodeData,
- level
- }, void 0, true)
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["node", "props", "show-checkbox", "check-strictly", "expand-on-click-node", "depth"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- );
- }
- const TreeNode = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b], ["__scopeId", "data-v-469fe828"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-tree/tree-node.vue"]]);
- const _sfc_main$b = {
- name: "u-tree",
- components: { TreeNode },
- props: {
- data: {
- type: Array,
- required: true
- },
- props: {
- type: Object,
- default: () => ({
- label: "label",
- children: "children",
- nodeKey: "id"
- })
- },
- showCheckbox: {
- type: Boolean,
- default: false
- },
- defaultExpandAll: {
- type: Boolean,
- default: false
- },
- expandOnClickNode: {
- type: Boolean,
- default: true
- },
- checkStrictly: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- treeData: []
- };
- },
- created() {
- this.initTree();
- },
- watch: {
- data: {
- handler(newVal) {
- this.treeData = JSON.parse(JSON.stringify(newVal));
- this.initExpandedState(this.treeData, this.defaultExpandAll);
- },
- deep: true,
- immediate: true
- }
- },
- emits: ["node-click", "check-change"],
- methods: {
- initTree() {
- this.treeData = JSON.parse(JSON.stringify(this.data));
- this.initExpandedState(this.treeData, this.defaultExpandAll);
- },
- initExpandedState(nodes, expanded) {
- nodes.forEach((node2) => {
- node2.expanded = expanded;
- if (node2[this.props.children]) {
- this.initExpandedState(node2[this.props.children], expanded);
- }
- });
- },
- handleNodeClick(node2) {
- this.$emit("node-click", node2);
- },
- /**
- * 直接递归 treeData 获取所有 checked 的节点
- */
- getCheckedNodes() {
- const traverse = (nodes) => {
- let result = [];
- nodes.forEach((node2) => {
- if (node2.checked) {
- result.push(node2);
- }
- if (node2[this.props.children] && node2[this.props.children].length > 0) {
- result = result.concat(traverse(node2[this.props.children]));
- }
- });
- return result;
- };
- return traverse(this.treeData);
- }
- }
- };
- function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_tree_node = vue.resolveComponent("tree-node");
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-tree" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.treeData, (node2) => {
- return vue.openBlock(), vue.createBlock(_component_tree_node, {
- key: node2[$props.props.nodeKey],
- node: node2,
- props: $props.props,
- "show-checkbox": $props.showCheckbox,
- "check-strictly": $props.checkStrictly,
- "expand-on-click-node": $props.expandOnClickNode,
- onNodeClick: $options.handleNodeClick,
- onCheckChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("check-change", $event))
- }, {
- default: vue.withCtx(({ nodeData, level }) => [
- vue.renderSlot(_ctx.$slots, "default", {
- node: nodeData,
- level
- }, void 0, true)
- ]),
- _: 2
- /* DYNAMIC */
- }, 1032, ["node", "props", "show-checkbox", "check-strictly", "expand-on-click-node", "onNodeClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }
- const uTree = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a], ["__scopeId", "data-v-35158cdb"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-tree/u-tree.vue"]]);
- const __vite_glob_0_125 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uTree
- }, Symbol.toStringTag, { value: "Module" }));
- function pickExclude(obj, keys) {
- if (!["[object Object]", "[object File]"].includes(Object.prototype.toString.call(obj))) {
- return {};
- }
- return Object.keys(obj).reduce((prev, key) => {
- if (!keys.includes(key)) {
- prev[key] = obj[key];
- }
- return prev;
- }, {});
- }
- function formatImage(res) {
- return res.tempFiles.map((item) => ({
- ...pickExclude(item, ["path"]),
- type: "image",
- url: item.path,
- thumb: item.path,
- size: item.size,
- name: item.path.split("/").pop() + ".png"
- }));
- }
- function formatVideo(res) {
- return [
- {
- ...pickExclude(res, ["tempFilePath", "thumbTempFilePath", "errMsg"]),
- type: "video",
- url: res.tempFilePath,
- thumb: res.thumbTempFilePath,
- size: res.size,
- width: res.width || 0,
- // APP 2.1.0+、H5、微信小程序、京东小程序
- height: res.height || 0,
- // APP 2.1.0+、H5、微信小程序、京东小程序
- name: res.tempFilePath.split("/").pop() + ".mp4"
- }
- ];
- }
- function chooseFile({
- accept,
- multiple,
- capture,
- compressed,
- maxDuration,
- sizeType,
- camera,
- maxCount,
- extension
- }) {
- try {
- capture = test.array(capture) ? capture : capture.split(",");
- } catch (e2) {
- capture = [];
- }
- return new Promise((resolve, reject) => {
- switch (accept) {
- case "image":
- uni.chooseImage({
- count: multiple ? Math.min(maxCount, 9) : 1,
- sourceType: capture,
- sizeType,
- success: (res) => resolve(formatImage(res)),
- fail: reject
- });
- break;
- case "video":
- uni.chooseVideo({
- sourceType: capture,
- compressed,
- maxDuration,
- camera,
- success: (res) => resolve(formatVideo(res)),
- fail: reject
- });
- break;
- }
- });
- }
- const mixinUpload = {
- watch: {
- // 监听accept的变化,判断是否符合个平台要求
- // 只有微信小程序才支持选择媒体,文件类型,所以这里做一个判断提示
- accept: {
- immediate: true,
- handler(val) {
- if (val === "all" || val === "media") {
- error("只有微信小程序才支持把accept配置为all、media之一");
- }
- if (val === "file") {
- error("只有微信小程序和H5(HX2.9.9)才支持把accept配置为file");
- }
- }
- }
- }
- };
- const props = defineMixin({
- props: {
- // 接受的文件类型, 可选值为all media image file video
- accept: {
- type: String,
- default: () => props$1x.upload.accept
- },
- extension: {
- type: Array,
- default: () => props$1x.upload.extension
- },
- // 图片或视频拾取模式,当accept为image类型时设置capture可选额外camera可以直接调起摄像头
- capture: {
- type: [String, Array],
- default: () => props$1x.upload.capture
- },
- // 当accept为video时生效,是否压缩视频,默认为true
- compressed: {
- type: Boolean,
- default: () => props$1x.upload.compressed
- },
- // 当accept为video时生效,可选值为back或front
- camera: {
- type: String,
- default: () => props$1x.upload.camera
- },
- // 当accept为video时生效,拍摄视频最长拍摄时间,单位秒
- maxDuration: {
- type: Number,
- default: () => props$1x.upload.maxDuration
- },
- // 上传区域的图标,只能内置图标
- uploadIcon: {
- type: String,
- default: () => props$1x.upload.uploadIcon
- },
- // 上传区域的图标的颜色,默认
- uploadIconColor: {
- type: String,
- default: () => props$1x.upload.uploadIconColor
- },
- // 是否开启文件读取前事件
- useBeforeRead: {
- type: Boolean,
- default: () => props$1x.upload.useBeforeRead
- },
- // 读取后的处理函数
- afterRead: {
- type: Function,
- default: null
- },
- // 读取前的处理函数
- beforeRead: {
- type: Function,
- default: null
- },
- // 是否显示组件自带的图片&视频预览功能
- previewFullImage: {
- type: Boolean,
- default: () => props$1x.upload.previewFullImage
- },
- // 最大上传数量
- maxCount: {
- type: [String, Number],
- default: () => props$1x.upload.maxCount
- },
- // 是否启用
- disabled: {
- type: Boolean,
- default: () => props$1x.upload.disabled
- },
- // 预览上传的图片时的裁剪模式,和image组件mode属性一致
- imageMode: {
- type: String,
- default: () => props$1x.upload.imageMode
- },
- // 标识符,可以在回调函数的第二项参数中获取
- name: {
- type: String,
- default: () => props$1x.upload.name
- },
- // 所选的图片的尺寸, 可选值为original compressed
- sizeType: {
- type: Array,
- default: () => props$1x.upload.sizeType
- },
- // 是否开启图片多选,部分安卓机型不支持
- multiple: {
- type: Boolean,
- default: () => props$1x.upload.multiple
- },
- // 是否展示删除按钮
- deletable: {
- type: Boolean,
- default: () => props$1x.upload.deletable
- },
- // 文件大小限制,单位为byte
- maxSize: {
- type: [String, Number],
- default: () => props$1x.upload.maxSize
- },
- // 显示已上传的文件列表
- fileList: {
- type: Array,
- default: () => props$1x.upload.fileList
- },
- // 上传区域的提示文字
- uploadText: {
- type: String,
- default: () => props$1x.upload.uploadText
- },
- // 内部预览图片区域和选择图片按钮的区域宽度
- width: {
- type: [String, Number],
- default: () => props$1x.upload.width
- },
- // 内部预览图片区域和选择图片按钮的区域高度
- height: {
- type: [String, Number],
- default: () => props$1x.upload.height
- },
- // 是否在上传完成后展示预览图
- previewImage: {
- type: Boolean,
- default: () => props$1x.upload.previewImage
- },
- // 是否自动删除
- autoDelete: {
- type: Boolean,
- default: () => props$1x.upload.autoDelete
- },
- // 是否自动上传需要传递action指定地址
- autoUpload: {
- type: Boolean,
- default: () => props$1x.upload.autoUpload
- },
- // 自动上传接口地址
- autoUploadApi: {
- type: String,
- default: () => props$1x.upload.autoUploadApi
- },
- // 自动上传驱动,local/oss/cos/kodo
- autoUploadDriver: {
- type: String,
- default: () => props$1x.upload.autoUploadDriver
- },
- // 自动上传授权接口,比如oss的签名接口。
- autoUploadAuthUrl: {
- type: String,
- default: () => props$1x.upload.autoUploadAuthUrl
- },
- // 自动上传携带的header
- autoUploadHeader: {
- type: Object,
- default: () => {
- return props$1x.upload.autoUploadHeader;
- }
- },
- // 本地计算视频封面
- getVideoThumb: {
- type: Boolean,
- default: () => props$1x.upload.getVideoThumb
- },
- // 自定义自动上传后处理
- customAfterAutoUpload: {
- type: Boolean,
- default: () => props$1x.upload.customAfterAutoUpload
- },
- videoPreviewObjectFit: {
- type: String,
- default: () => props$1x.upload.videoPreviewObjectFit
- }
- }
- });
- const _sfc_main$a = {
- name: "u-upload",
- mixins: [mpMixin, mixin, mixinUpload, props],
- data() {
- return {
- lists: [],
- isInCount: true,
- popupShow: false,
- currentItemIndex: -1
- };
- },
- watch: {
- // 监听文件列表的变化,重新整理内部数据
- fileList: {
- handler() {
- this.formatFileList();
- },
- immediate: true,
- deep: true
- },
- deletable(newVal) {
- this.formatFileList();
- },
- maxCount(newVal) {
- this.formatFileList();
- },
- accept(newVal) {
- this.formatFileList();
- },
- popupShow(newVal) {
- if (!newVal) {
- this.currentItemIndex = -1;
- }
- }
- },
- emits: ["error", "beforeRead", "oversize", "afterRead", "delete", "clickPreview", "update:fileList", "afterAutoUpload"],
- methods: {
- t: t$1,
- addUnit,
- addStyle,
- videoErrorCallback() {
- },
- loadedVideoMetadata(e2) {
- if (this.currentItemIndex < 0) {
- return;
- }
- if (this.autoUploadDriver != "local") {
- return;
- }
- if (!this.getVideoThumb) {
- return;
- }
- let w2 = this.lists[this.currentItemIndex].width;
- let h2 = this.lists[this.currentItemIndex].height;
- const dpr = uni.getSystemInfoSync().pixelRatio;
- uni.createSelectorQuery().select("#myVideo").context((res) => {
- formatAppLog("log", "at uni_modules/uview-plus/components/u-upload/u-upload.vue:293", "select video", res);
- const myVideo = res.context;
- uni.createSelectorQuery().select("#myCanvas").fields({ node: true, size: true }).exec(([res2]) => {
- formatAppLog("log", "at uni_modules/uview-plus/components/u-upload/u-upload.vue:299", "select canvas", res2);
- const ctx1 = res2[0].node.getContext("2d");
- res2[0].node.width = w2 * dpr;
- res2[0].node.height = h2 * dpr;
- setTimeout(() => {
- captureFirstFrame();
- }, 500);
- const captureFirstFrame = () => {
- ctx1.drawImage(myVideo, 0, 0, w2 * dpr, h2 * dpr);
- wx.canvasToTempFilePath({
- canvas: res2[0].node,
- success: (result) => {
- formatAppLog("log", "at uni_modules/uview-plus/components/u-upload/u-upload.vue:314", "First frame image path:", result.tempFilePath);
- this.fileList["currentItemIndex"].thumb = result.tempFilePath;
- },
- fail: (err) => {
- formatAppLog("error", "at uni_modules/uview-plus/components/u-upload/u-upload.vue:320", "Failed to export image:", err);
- }
- });
- };
- setInterval(() => {
- ctx1.drawImage(myVideo, 0, 0, w2 * dpr, h2 * dpr);
- }, 1e3 / 24);
- }).exec();
- }).exec();
- },
- formatFileList() {
- const {
- fileList = [],
- maxCount
- } = this;
- const lists = fileList.map((item) => {
- const name2 = item.name || item.url || item.thumb;
- return Object.assign(Object.assign({}, item), {
- // 如果item.url为本地选择的blob文件的话,无法判断其为video还是image,此处优先通过accept做判断处理
- isImage: item.name ? test.image(item.name) : this.accept === "image" || test.image(name2),
- isVideo: item.name ? test.video(item.name) : this.accept === "video" || test.video(name2),
- deletable: typeof item.deletable === "boolean" ? item.deletable : this.deletable
- });
- });
- this.lists = lists;
- this.isInCount = lists.length < maxCount;
- },
- chooseFile(params2) {
- const {
- maxCount,
- multiple,
- lists,
- disabled
- } = this;
- if (disabled)
- return Promise.reject();
- const chooseParams = Object.assign({
- accept: this.accept,
- extension: this.extension,
- multiple: this.multiple,
- capture: this.capture,
- compressed: this.compressed,
- maxDuration: this.maxDuration,
- sizeType: this.sizeType,
- camera: this.camera
- }, {
- maxCount: maxCount - lists.length,
- ...params2
- });
- return chooseFile(chooseParams).then((res) => {
- const result = chooseParams.multiple ? res : res[0];
- this.onBeforeRead(result);
- return result;
- }).catch((error2) => {
- this.$emit("error", error2);
- });
- },
- // 文件读取之前
- onBeforeRead(file) {
- const {
- beforeRead,
- useBeforeRead
- } = this;
- let res = file;
- if (test.func(beforeRead)) {
- res = beforeRead(file, this.getDetail());
- }
- if (useBeforeRead) {
- res = new Promise((resolve, reject) => {
- this.$emit(
- "beforeRead",
- Object.assign(Object.assign({
- file
- }, this.getDetail()), {
- callback: (ok) => {
- ok ? resolve() : reject();
- }
- })
- );
- });
- }
- if (test.promise(res)) {
- res.then((data) => this.onAfterRead(data || file));
- } else {
- this.onAfterRead(res || file);
- }
- },
- getDetail(index2) {
- return {
- name: this.name,
- index: index2 == null ? this.fileList.length : index2
- };
- },
- async onAfterRead(file) {
- const {
- maxSize,
- afterRead
- } = this;
- const oversize = Array.isArray(file) ? file.some((item) => item.size > maxSize) : file.size > maxSize;
- if (oversize) {
- uni.showToast({
- title: t$1("up.upload.sizeExceed")
- });
- this.$emit("oversize", Object.assign({
- file
- }, this.getDetail()));
- return;
- }
- let len = this.fileList.length;
- if (this.autoUpload) {
- let lists = [].concat(file);
- this.fileList.length;
- lists.map((item) => {
- this.fileList.push({
- ...item,
- status: "uploading",
- message: t$1("up.upload.uploading"),
- progress: 0
- });
- });
- let that2 = this;
- this.$emit("update:fileList", this.fileList);
- for (let i2 = 0; i2 < lists.length; i2++) {
- let j2 = i2;
- let result = "";
- switch (this.autoUploadDriver) {
- case "cos":
- break;
- case "kodo":
- break;
- case "oss":
- case "upload_oss":
- console.log();
- let formData = {};
- let ret = await uni.request({
- url: this.autoUploadAuthUrl,
- method: "get",
- header: this.autoUploadHeader,
- data: {
- filename: lists[j2].name
- }
- });
- let res0 = ret.data;
- if (res0.code == 200) {
- formData = res0.data.params;
- } else {
- uni.showToast({
- title: res0.msg,
- duration: 1500
- });
- return;
- }
- var uploadTask = uni.uploadFile({
- url: res0.data.params.host,
- filePath: lists[j2].url,
- name: "file",
- // fileType: 'video', // 仅支付宝小程序,且必填。
- // header: header,
- formData,
- success: (uploadFileRes) => {
- let thumb = "";
- let afterPromise = "";
- if (that2.customAfterAutoUpload) {
- afterPromise = new Promise((resolve, reject) => {
- that2.$emit(
- "afterAutoUpload",
- Object.assign(res0, {
- callback: (r2) => {
- r2.url ? resolve(r2) : reject();
- }
- })
- );
- });
- }
- if (test.promise(afterPromise)) {
- afterPromise.then((data) => that2.succcessUpload(len + j2, data.url, data.thumb));
- } else {
- result = res0.data.params.host + "/" + res0.data.params.key;
- if (that2.accept === "video" || test.video(result)) {
- thumb = result + "?x-oss-process=video/snapshot,t_10000,m_fast";
- }
- that2.succcessUpload(len + j2, result, thumb);
- }
- }
- });
- uploadTask.onProgressUpdate((res) => {
- that2.updateUpload(len + j2, {
- progress: res.progress
- });
- });
- break;
- case "local":
- default:
- var uploadTask = uni.uploadFile({
- url: this.autoUploadApi,
- filePath: lists[j2].url,
- name: "file",
- // fileType: 'video', // 仅支付宝小程序,且必填。
- header: this.autoUploadHeader,
- success: (uploadFileRes) => {
- let res02 = uploadFileRes.data;
- let afterPromise = "";
- if (that2.customAfterAutoUpload) {
- afterPromise = new Promise((resolve, reject) => {
- that2.$emit(
- "afterAutoUpload",
- Object.assign(res02, {
- callback: (r2) => {
- r2.url ? resolve(r2) : reject();
- }
- })
- );
- });
- }
- if (test.promise(afterPromise)) {
- afterPromise.then((data) => that2.succcessUpload(len + j2, data.url));
- } else {
- if (res02.code != 200) {
- uni.showToast({
- title: res02.msg
- });
- } else {
- result = res02.data.url;
- that2.succcessUpload(len + j2, result);
- }
- }
- }
- });
- uploadTask.onProgressUpdate((res) => {
- that2.updateUpload(len + j2, {
- progress: res.progress
- });
- });
- break;
- }
- }
- } else {
- if (typeof afterRead === "function") {
- afterRead(file, this.getDetail());
- }
- this.$emit("afterRead", Object.assign({
- file
- }, this.getDetail()));
- }
- },
- updateUpload(index2, param) {
- let item = this.fileList[index2];
- this.fileList.splice(index2, 1, {
- ...item,
- // 注意这里不判断会出现succcessUpload先执行又被覆盖的问题
- status: param.progress == 100 ? "success" : "uploading",
- message: "",
- progress: param.progress
- });
- this.$emit("update:fileList", this.fileList);
- },
- succcessUpload(index2, url2, thumb = "") {
- let item = this.fileList[index2];
- this.fileList.splice(index2, 1, {
- ...item,
- status: "success",
- message: "",
- url: url2,
- progress: 100,
- thumb
- });
- this.$emit("update:fileList", this.fileList);
- },
- deleteItem(index2) {
- if (this.autoDelete) {
- this.fileList.splice(index2, 1);
- this.$emit("update:fileList", this.fileList);
- } else {
- this.$emit(
- "delete",
- Object.assign(Object.assign({}, this.getDetail(index2)), {
- file: this.fileList[index2]
- })
- );
- }
- },
- // 预览图片
- onPreviewImage(previewItem, index2) {
- if (!previewItem.isImage || !this.previewFullImage)
- return;
- let current = 0;
- const urls = [];
- let imageIndex = 0;
- for (var i2 = 0; i2 < this.lists.length; i2++) {
- const item = this.lists[i2];
- if (item.isImage || item.type && item.type === "image") {
- urls.push(item.url || item.thumb);
- if (i2 === index2) {
- current = imageIndex;
- }
- imageIndex += 1;
- }
- }
- if (urls.length < 1) {
- return;
- }
- uni.previewImage({
- urls,
- current,
- fail() {
- toast(t$1("up.upload.previewImageFail"));
- }
- });
- },
- onPreviewVideo(previewItem, index2) {
- if (!this.previewFullImage)
- return;
- const sources = [];
- for (var i2 = 0; i2 < this.lists.length; i2++) {
- const item = this.lists[i2];
- if (item.isVideo || item.type && item.type === "video") {
- sources.push(Object.assign(Object.assign({}, item), {
- type: "video"
- }));
- }
- }
- if (sources.length < 1) {
- return;
- }
- this.popupShow = true;
- this.currentItemIndex = index2;
- formatAppLog("log", "at uni_modules/uview-plus/components/u-upload/u-upload.vue:671", this.lists[this.currentItemIndex]);
- },
- onClickPreview(item, index2) {
- if (this.previewFullImage) {
- switch (item.type) {
- case "image":
- this.onPreviewImage(item, index2);
- break;
- case "video":
- this.onPreviewVideo(item, index2);
- break;
- }
- }
- this.$emit(
- "clickPreview",
- Object.assign(Object.assign({}, item), this.getDetail(index2))
- );
- }
- }
- };
- function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_icon = vue.resolveComponent("up-icon");
- const _component_u_loading_icon = resolveEasycom(vue.resolveDynamicComponent("u-loading-icon"), __easycom_0$e);
- const _component_up_gap = vue.resolveComponent("up-gap");
- const _component_up_popup = vue.resolveComponent("up-popup");
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "u-upload",
- style: vue.normalizeStyle([$options.addStyle(_ctx.customStyle)])
- },
- [
- vue.createElementVNode("view", { class: "u-upload__wrap" }, [
- _ctx.previewImage ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList($data.lists, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "u-upload__wrap__preview",
- key: index2
- }, [
- item.isImage || item.type && item.type === "image" ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: item.thumb || item.url,
- mode: _ctx.imageMode,
- class: "u-upload__wrap__preview__image",
- onClick: ($event) => $options.onClickPreview(item, index2),
- style: vue.normalizeStyle([{
- width: $options.addUnit(_ctx.width),
- height: $options.addUnit(_ctx.height)
- }])
- }, null, 12, ["src", "mode", "onClick"])) : (item.isVideo || item.type && item.type === "video") && _ctx.getVideoThumb ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "u-upload__wrap__preview__video",
- style: vue.normalizeStyle({
- width: $options.addUnit(_ctx.width),
- height: $options.addUnit(_ctx.height)
- })
- },
- [
- item.thumb ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- src: item.thumb,
- mode: _ctx.imageMode,
- class: "u-upload__wrap__preview__image",
- onClick: ($event) => $options.onClickPreview(item, index2),
- style: vue.normalizeStyle([{
- width: $options.addUnit(_ctx.width),
- height: $options.addUnit(_ctx.height)
- }])
- }, null, 12, ["src", "mode", "onClick"])) : (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 1,
- color: "#80CBF9",
- size: "26",
- name: item.isVideo || item.type && item.type === "video" ? "movie" : "file-text"
- }, null, 8, ["name"])),
- item.status === "success" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "u-upload__wrap__play",
- onClick: ($event) => $options.onClickPreview(item, index2)
- }, [
- vue.renderSlot(_ctx.$slots, "playIcon", {}, void 0, true),
- !_ctx.$slots["playIcon"] ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- class: "u-upload__wrap__play__icon",
- name: "play-right",
- size: "22px"
- })) : vue.createCommentVNode("v-if", true)
- ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: "u-upload__wrap__preview__other",
- onClick: ($event) => $options.onClickPreview(item, index2),
- style: vue.normalizeStyle([{
- width: $options.addUnit(_ctx.width),
- height: $options.addUnit(_ctx.height)
- }])
- }, [
- vue.createVNode(_component_up_icon, {
- color: "#80CBF9",
- size: "26",
- name: item.isVideo || item.type && item.type === "video" ? "movie" : "folder"
- }, null, 8, ["name"]),
- vue.createElementVNode(
- "text",
- { class: "u-upload__wrap__preview__other__text" },
- vue.toDisplayString(item.isVideo || item.type && item.type === "video" ? item.name || $options.t("up.common.video") : item.name || $options.t("up.common.file")),
- 1
- /* TEXT */
- )
- ], 12, ["onClick"])),
- item.status === "uploading" || item.status === "failed" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 3,
- class: "u-upload__status"
- }, [
- vue.createElementVNode("view", { class: "u-upload__status__icon" }, [
- item.status === "failed" ? (vue.openBlock(), vue.createBlock(_component_up_icon, {
- key: 0,
- name: "close-circle",
- color: "#ffffff",
- size: "25"
- })) : (vue.openBlock(), vue.createBlock(_component_u_loading_icon, {
- key: 1,
- size: "22",
- mode: "circle"
- }))
- ]),
- item.message ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-upload__status__message"
- },
- vue.toDisplayString(item.message),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_up_gap, {
- class: "u-upload__progress",
- height: "3px",
- style: vue.normalizeStyle({ width: item.progress + "%" })
- }, null, 8, ["style"])
- ])) : vue.createCommentVNode("v-if", true),
- item.status !== "uploading" && (_ctx.deletable || item.deletable) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 4,
- class: "u-upload__deletable",
- onClick: vue.withModifiers(($event) => $options.deleteItem(index2), ["stop"])
- }, [
- vue.createElementVNode("view", { class: "u-upload__deletable__icon" }, [
- vue.createVNode(_component_up_icon, {
- name: "close",
- color: "#ffffff",
- size: "10"
- })
- ])
- ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "success", {}, () => [
- item.status === "success" ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "u-upload__success"
- }, [
- vue.createElementVNode("view", { class: "u-upload__success__icon" }, [
- vue.createVNode(_component_up_icon, {
- name: "checkmark",
- color: "#ffffff",
- size: "12"
- })
- ])
- ])) : vue.createCommentVNode("v-if", true)
- ], true)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("canvas", {
- id: "myCanvas",
- type: "2d",
- style: { "width": "100px", "height": "150px", "display": "none" }
- }),
- $data.isInCount ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- _ctx.$slots.trigger ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- onClick: _cache[0] || (_cache[0] = (...args) => $options.chooseFile && $options.chooseFile(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "trigger", {}, void 0, true)
- ])) : !_ctx.$slots.trigger && (_ctx.$slots.default || _ctx.$slots.$default) ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- onClick: _cache[1] || (_cache[1] = (...args) => $options.chooseFile && $options.chooseFile(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])) : (vue.openBlock(), vue.createElementBlock("view", {
- key: 2,
- class: vue.normalizeClass(["u-upload__button", [_ctx.disabled && "u-upload__button--disabled"]]),
- "hover-class": !_ctx.disabled ? "u-upload__button--hover" : "",
- "hover-stay-time": "150",
- onClick: _cache[2] || (_cache[2] = (...args) => $options.chooseFile && $options.chooseFile(...args)),
- style: vue.normalizeStyle([{
- width: $options.addUnit(_ctx.width),
- height: $options.addUnit(_ctx.height)
- }])
- }, [
- vue.createVNode(_component_up_icon, {
- name: _ctx.uploadIcon,
- size: "26",
- color: _ctx.uploadIconColor
- }, null, 8, ["name", "color"]),
- _ctx.uploadText ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "u-upload__button__text"
- },
- vue.toDisplayString(_ctx.uploadText),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ], 14, ["hover-class"]))
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createVNode(_component_up_popup, {
- mode: "center",
- show: $data.popupShow,
- "onUpdate:show": _cache[5] || (_cache[5] = ($event) => $data.popupShow = $event)
- }, {
- default: vue.withCtx(() => [
- $data.popupShow ? (vue.openBlock(), vue.createElementBlock("video", {
- key: 0,
- id: "myVideo",
- src: $data.currentItemIndex >= 0 ? $data.lists[$data.currentItemIndex].url : "",
- onError: _cache[3] || (_cache[3] = (...args) => $options.videoErrorCallback && $options.videoErrorCallback(...args)),
- "show-center-play-btn": "",
- "object-fit": _ctx.videoPreviewObjectFit,
- "show-fullscreen-btn": "true",
- "enable-play-gesture": "",
- controls: "",
- autoplay: true,
- "auto-pause-if-open-native": "",
- onLoadedmetadata: _cache[4] || (_cache[4] = (...args) => $options.loadedVideoMetadata && $options.loadedVideoMetadata(...args)),
- "initial-time": 0.1
- }, null, 40, ["src", "object-fit"])) : vue.createCommentVNode("v-if", true)
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ],
- 4
- /* STYLE */
- );
- }
- const uUpload = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__scopeId", "data-v-c8491d64"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-upload/u-upload.vue"]]);
- const __vite_glob_0_126 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uUpload
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$9 = {
- name: "up-view",
- mixins: [mpMixin, mixin],
- emits: ["click"],
- computed: {
- valueStyle() {
- }
- },
- props: {
- backgroundColor: "",
- color: "",
- flexDirection: "",
- justifyContent: "",
- alignItems: "",
- flex1: "",
- width: "",
- height: "",
- padding: "",
- margin: "",
- borderColor: ""
- },
- data() {
- return {};
- },
- methods: {
- addStyle,
- clickHandler() {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["u-view", _ctx.class]),
- style: vue.normalizeStyle({
- backgroundColor: $props.backgroundColor,
- color: $props.color,
- flexDirection: $props.flexDirection,
- justifyContent: $props.justifyContent,
- alignItems: $props.alignItems,
- flex1: $props.flex1,
- width: $props.width,
- height: $props.height,
- padding: $props.padding,
- margin: $props.margin,
- borderColor: $props.borderColor
- })
- },
- null,
- 6
- /* CLASS, STYLE */
- );
- }
- const uView = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__scopeId", "data-v-02d480a7"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-view/u-view.vue"]]);
- const __vite_glob_0_127 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uView
- }, Symbol.toStringTag, { value: "Module" }));
- const _sfc_main$8 = {
- name: "u-waterfall",
- props: {
- modelValue: {
- // 瀑布流数据
- type: Array,
- required: true,
- default: function() {
- return [];
- }
- },
- // 每次向结构插入数据的时间间隔,单位ms
- // 单位ms
- addTime: {
- type: [Number, String],
- default: 200
- },
- // id值,用于清除某一条数据时,根据此idKey名称找到并移除,如数据为{idx: 22, name: 'lisa'}
- // 那么该把idKey设置为idx
- idKey: {
- type: String,
- default: "id"
- },
- // 瀑布流列数
- columns: {
- type: [Number, String],
- default: 2
- },
- // 瀑布流最小列数
- columnsMin: {
- type: [Number, String],
- default: 2
- },
- // 最小列宽
- minColumnWidth: {
- type: Number,
- default: 230
- }
- },
- mixins: [mpMixin, mixin],
- data() {
- return {
- columnList: [[]],
- // 存储每列的数据
- children: [],
- // 用于标记是否已经初始化
- initialized: false,
- windowWidth: 375,
- windowHeight: 0
- };
- },
- watch: {
- copyFlowList: {
- handler(nVal, oVal) {
- if (!nVal || nVal.length == 0) {
- this.clear(false);
- } else {
- if (this.columnList.length == 1) {
- this.initColumnList();
- }
- let startIndex = Array.isArray(oVal) && oVal.length > 0 ? oVal.length : 0;
- this.handleData(nVal.slice(startIndex));
- }
- },
- immediate: true
- },
- columns: {
- handler() {
- this.initColumnList();
- if (this.copyFlowList.length > 0) {
- this.redistributeData();
- }
- },
- immediate: false
- }
- },
- created() {
- this.initColumnList();
- },
- mounted() {
- this.initialized = true;
- },
- // 添加beforeUnmount生命周期清理事件监听
- beforeUnmount() {
- },
- computed: {
- // 破坏flowList变量的引用,否则watch的结果新旧值是一样的
- copyFlowList() {
- if (!this.modelValue || this.modelValue.length == 0) {
- return [];
- } else {
- return this.cloneData(this.modelValue);
- }
- }
- },
- emits: ["update:modelValue"],
- methods: {
- // 初始化列数据数组
- initColumnList() {
- this.windowWidth = uni.getSystemInfoSync().windowWidth;
- const cols = this.getColumnsCount();
- this.columnList = Array.from({ length: cols }, () => []);
- },
- // 获取列数,支持auto模式
- getColumnsCount() {
- if (this.columns === "auto") {
- const columnGap = 7;
- let columnCount = Math.max(1, Math.floor(this.windowWidth / (this.minColumnWidth + columnGap)));
- if (columnCount < this.columnsMin) {
- columnCount = this.columnsMin;
- }
- return columnCount;
- }
- return parseInt(this.columns) || 2;
- },
- // 窗口大小变化处理函数
- handleWindowResize(res) {
- this.windowWidth = res.size.windowWidth;
- this.windowHeight = res.size.windowHeight;
- if (this.resizeTimer) {
- clearTimeout(this.resizeTimer);
- }
- this.resizeTimer = setTimeout(() => {
- const newColumnsCount = this.getColumnsCount();
- const oldColumnsCount = this.columnList.length;
- if (newColumnsCount !== oldColumnsCount) {
- this.redistributeData();
- }
- }, 300);
- },
- // 重新分配所有数据
- async redistributeData() {
- this.initColumnList();
- const allData = this.cloneData(this.copyFlowList);
- this.handleData(allData);
- },
- // 处理新增数据
- async handleData(newData) {
- if (!newData || newData.length === 0)
- return;
- const columnHeights = new Array(this.columnList.length).fill(0);
- for (let i2 = 0; i2 < this.columnList.length; i2++) {
- try {
- const rect = await this.$uGetRect(`#u-column-${i2}`);
- columnHeights[i2] = rect.height || 0;
- } catch (e2) {
- columnHeights[i2] = 0;
- }
- }
- for (let item of newData) {
- const minHeightIndex = columnHeights.indexOf(Math.min(...columnHeights));
- this.columnList[minHeightIndex].push(item);
- await sleep(30);
- this.$nextTick(async () => {
- try {
- const rect = await this.$uGetRect(`#u-column-${minHeightIndex}`);
- if (rect.height) {
- columnHeights[minHeightIndex] = rect.height;
- }
- } catch (e2) {
- }
- });
- }
- },
- // 复制而不是引用对象和数组
- cloneData(data) {
- return JSON.parse(JSON.stringify(data));
- },
- // 清空数据列表
- clear(bak = true) {
- this.initColumnList();
- if (bak) {
- this.$emit("update:modelValue", []);
- }
- },
- // 清除某一条指定的数据,根据id实现
- remove(id) {
- for (let i2 = 0; i2 < this.columnList.length; i2++) {
- const index2 = this.columnList[i2].findIndex((val) => val[this.idKey] == id);
- if (index2 !== -1) {
- this.columnList[i2].splice(index2, 1);
- break;
- }
- }
- const modelValueIndex = this.modelValue.findIndex((val) => val[this.idKey] == id);
- if (modelValueIndex !== -1) {
- const newModelValue = this.cloneData(this.modelValue);
- newModelValue.splice(modelValueIndex, 1);
- this.$emit("update:modelValue", newModelValue);
- }
- },
- // 修改某条数据的某个属性
- modify(id, key, value2) {
- let found = false;
- let targetItem = null;
- for (let i2 = 0; i2 < this.columnList.length; i2++) {
- const index2 = this.columnList[i2].findIndex((val) => val[this.idKey] == id);
- if (index2 !== -1) {
- this.columnList[i2][index2][key] = value2;
- targetItem = this.columnList[i2][index2];
- found = true;
- break;
- }
- }
- if (found && targetItem) {
- const modelValueIndex = this.modelValue.findIndex((val) => val[this.idKey] == id);
- if (modelValueIndex !== -1) {
- let data = this.cloneData(this.modelValue);
- data[modelValueIndex][key] = value2;
- this.$emit("update:modelValue", data);
- }
- }
- }
- }
- };
- function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "u-waterfall" }, [
- vue.createCommentVNode(" 新增支持多列布局 "),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.columnList, (column, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- ref_for: true,
- ref: `u-column-${index2}`,
- id: `u-column-${index2}`,
- class: "u-column"
- }, [
- vue.renderSlot(_ctx.$slots, "column", {
- colIndex: index2,
- colList: column
- }, void 0, true),
- vue.renderSlot(_ctx.$slots, "left", {
- colIndex: index2,
- leftList: column
- }, void 0, true),
- !_ctx.$slots["left"] && !_ctx.$slots["column"] ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList(column, (item, itemIndex) => {
- return vue.renderSlot(_ctx.$slots, "default", {
- key: itemIndex,
- item,
- itemIndex
- }, void 0, true);
- }),
- 128
- /* KEYED_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ], 8, ["id"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]);
- }
- const uWaterfall = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__scopeId", "data-v-366bbda3"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/uni_modules/uview-plus/components/u-waterfall/u-waterfall.vue"]]);
- const __vite_glob_0_129 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: uWaterfall
- }, Symbol.toStringTag, { value: "Module" }));
- function add(arg1, arg2) {
- var r1, r2, m2;
- try {
- r1 = arg1.toString().split(".")[1].length;
- } catch (e2) {
- r1 = 0;
- }
- try {
- r2 = arg2.toString().split(".")[1].length;
- } catch (e2) {
- r2 = 0;
- }
- m2 = Math.pow(10, Math.max(r1, r2));
- return (arg1 * m2 + arg2 * m2) / m2;
- }
- function sub(arg1, arg2) {
- var r1, r2, m2, n2;
- try {
- r1 = arg1.toString().split(".")[1].length;
- } catch (e2) {
- r1 = 0;
- }
- try {
- r2 = arg2.toString().split(".")[1].length;
- } catch (e2) {
- r2 = 0;
- }
- m2 = Math.pow(10, Math.max(r1, r2));
- n2 = r1 >= r2 ? r1 : r2;
- return Math.abs(((arg1 * m2 - arg2 * m2) / m2).toFixed(n2));
- }
- function mul(a2, b2) {
- var c2 = 0, d2 = a2.toString(), e2 = b2.toString();
- try {
- c2 += d2.split(".")[1].length;
- } catch (f2) {
- }
- try {
- c2 += e2.split(".")[1].length;
- } catch (f2) {
- }
- return Number(d2.replace(".", "")) * Number(e2.replace(".", "")) / Math.pow(10, c2);
- }
- function div(a2, b2) {
- var c2, d2, e2 = 0, f2 = 0;
- try {
- e2 = a2.toString().split(".")[1].length;
- } catch (g2) {
- }
- try {
- f2 = b2.toString().split(".")[1].length;
- } catch (g2) {
- }
- return c2 = Number(a2.toString().replace(".", "")), d2 = Number(b2.toString().replace(".", "")), xyutil.mul(c2 / d2, Math.pow(10, f2 - e2));
- }
- const calc = {
- add,
- sub,
- mul,
- div
- };
- let platform = "none";
- platform = "vue3";
- platform = "plus";
- const platform$1 = platform;
- let themeType = ["primary", "success", "error", "warning", "info"];
- function setConfig(configs) {
- index.shallowMerge(config$1, configs.config || {});
- index.shallowMerge(props$1x, configs.props || {});
- index.shallowMerge(color$3, configs.color || {});
- index.shallowMerge(zIndex, configs.zIndex || {});
- }
- index.setConfig = setConfig;
- const $u = {
- route,
- date: index.timeFormat,
- // 另名date
- colorGradient: colorGradient$1.colorGradient,
- hexToRgb: colorGradient$1.hexToRgb,
- rgbToHex: colorGradient$1.rgbToHex,
- colorToRgba: colorGradient$1.colorToRgba,
- test,
- type: themeType,
- http,
- config: config$1,
- // uview-plus配置信息相关,比如版本号
- zIndex,
- debounce,
- throttle,
- calc,
- mixin,
- mpMixin,
- // props,
- ...index,
- color: color$3,
- platform: platform$1
- };
- const importFn = /* @__PURE__ */ Object.assign({ "./components/u-action-sheet-data/u-action-sheet-data.vue": __vite_glob_0_0, "./components/u-action-sheet/u-action-sheet.vue": __vite_glob_0_1, "./components/u-agreement/u-agreement.vue": __vite_glob_0_2, "./components/u-album/u-album.vue": __vite_glob_0_3, "./components/u-alert/u-alert.vue": __vite_glob_0_4, "./components/u-avatar-group/u-avatar-group.vue": __vite_glob_0_5, "./components/u-avatar/u-avatar.vue": __vite_glob_0_6, "./components/u-back-top/u-back-top.vue": __vite_glob_0_7, "./components/u-badge/u-badge.vue": __vite_glob_0_8, "./components/u-barcode/u-barcode.vue": __vite_glob_0_9, "./components/u-box/u-box.vue": __vite_glob_0_10, "./components/u-button/u-button.vue": __vite_glob_0_11, "./components/u-calendar/u-calendar.vue": __vite_glob_0_12, "./components/u-car-keyboard/u-car-keyboard.vue": __vite_glob_0_13, "./components/u-card/u-card.vue": __vite_glob_0_14, "./components/u-cate-tab/u-cate-tab.vue": __vite_glob_0_15, "./components/u-cell-group/u-cell-group.vue": __vite_glob_0_16, "./components/u-cell/u-cell.vue": __vite_glob_0_17, "./components/u-checkbox-group/u-checkbox-group.vue": __vite_glob_0_18, "./components/u-checkbox/u-checkbox.vue": __vite_glob_0_19, "./components/u-circle-progress/u-circle-progress.vue": __vite_glob_0_20, "./components/u-city-locate/u-city-locate.vue": __vite_glob_0_21, "./components/u-code-input/u-code-input.vue": __vite_glob_0_22, "./components/u-code/u-code.vue": __vite_glob_0_23, "./components/u-col/u-col.vue": __vite_glob_0_24, "./components/u-collapse-item/u-collapse-item.vue": __vite_glob_0_25, "./components/u-collapse/u-collapse.vue": __vite_glob_0_26, "./components/u-color-picker/u-color-picker.vue": __vite_glob_0_27, "./components/u-column-notice/u-column-notice.vue": __vite_glob_0_28, "./components/u-copy/u-copy.vue": __vite_glob_0_29, "./components/u-count-down/u-count-down.vue": __vite_glob_0_30, "./components/u-count-to/u-count-to.vue": __vite_glob_0_31, "./components/u-coupon/u-coupon.vue": __vite_glob_0_32, "./components/u-cropper/u-cropper.vue": __vite_glob_0_33, "./components/u-datetime-picker/u-datetime-picker.vue": __vite_glob_0_34, "./components/u-divider/u-divider.vue": __vite_glob_0_35, "./components/u-dragsort/u-dragsort.vue": __vite_glob_0_36, "./components/u-dropdown-item/u-dropdown-item.vue": __vite_glob_0_37, "./components/u-dropdown/u-dropdown.vue": __vite_glob_0_38, "./components/u-empty/u-empty.vue": __vite_glob_0_39, "./components/u-float-button/u-float-button.vue": __vite_glob_0_40, "./components/u-form-item/u-form-item.vue": __vite_glob_0_41, "./components/u-form/u-form.vue": __vite_glob_0_42, "./components/u-gap/u-gap.vue": __vite_glob_0_43, "./components/u-grid-item/u-grid-item.vue": __vite_glob_0_44, "./components/u-grid/u-grid.vue": __vite_glob_0_45, "./components/u-icon/u-icon.vue": __vite_glob_0_46, "./components/u-image/u-image.vue": __vite_glob_0_47, "./components/u-index-anchor/u-index-anchor.vue": __vite_glob_0_48, "./components/u-index-item/u-index-item.vue": __vite_glob_0_49, "./components/u-index-list/u-index-list.vue": __vite_glob_0_50, "./components/u-input/u-input.vue": __vite_glob_0_51, "./components/u-keyboard/u-keyboard.vue": __vite_glob_0_52, "./components/u-lazy-load/u-lazy-load.vue": __vite_glob_0_53, "./components/u-line-progress/u-line-progress.vue": __vite_glob_0_54, "./components/u-line/u-line.vue": __vite_glob_0_55, "./components/u-link/u-link.vue": __vite_glob_0_56, "./components/u-list-item/u-list-item.vue": __vite_glob_0_57, "./components/u-list/u-list.vue": __vite_glob_0_58, "./components/u-loading-icon/u-loading-icon.vue": __vite_glob_0_59, "./components/u-loading-page/u-loading-page.vue": __vite_glob_0_60, "./components/u-loadmore/u-loadmore.vue": __vite_glob_0_61, "./components/u-markdown/u-markdown.vue": __vite_glob_0_62, "./components/u-message-input/u-message-input.vue": __vite_glob_0_63, "./components/u-modal/u-modal.vue": __vite_glob_0_64, "./components/u-navbar-mini/u-navbar-mini.vue": __vite_glob_0_65, "./components/u-navbar/u-navbar.vue": __vite_glob_0_66, "./components/u-no-network/u-no-network.vue": __vite_glob_0_67, "./components/u-notice-bar/u-notice-bar.vue": __vite_glob_0_68, "./components/u-notify/u-notify.vue": __vite_glob_0_69, "./components/u-number-box/u-number-box.vue": __vite_glob_0_70, "./components/u-number-keyboard/u-number-keyboard.vue": __vite_glob_0_71, "./components/u-overlay/u-overlay.vue": __vite_glob_0_72, "./components/u-pagination/u-pagination.vue": __vite_glob_0_73, "./components/u-parse/u-parse.vue": __vite_glob_0_74, "./components/u-pdf-reader/u-pdf-reader.vue": __vite_glob_0_75, "./components/u-picker-column/u-picker-column.vue": __vite_glob_0_76, "./components/u-picker-data/u-picker-data.vue": __vite_glob_0_77, "./components/u-picker/u-picker.vue": __vite_glob_0_78, "./components/u-popup/u-popup.vue": __vite_glob_0_79, "./components/u-poster/u-poster.vue": __vite_glob_0_80, "./components/u-pull-refresh/u-pull-refresh.vue": __vite_glob_0_81, "./components/u-qrcode/u-qrcode.vue": __vite_glob_0_82, "./components/u-radio-group/u-radio-group.vue": __vite_glob_0_83, "./components/u-radio/u-radio.vue": __vite_glob_0_84, "./components/u-rate/u-rate.vue": __vite_glob_0_85, "./components/u-read-more/u-read-more.vue": __vite_glob_0_86, "./components/u-refresh-virtual-list/u-refresh-virtual-list.vue": __vite_glob_0_87, "./components/u-row-notice/u-row-notice.vue": __vite_glob_0_88, "./components/u-row/u-row.vue": __vite_glob_0_89, "./components/u-safe-bottom/u-safe-bottom.vue": __vite_glob_0_90, "./components/u-scroll-list/u-scroll-list.vue": __vite_glob_0_91, "./components/u-search/u-search.vue": __vite_glob_0_92, "./components/u-select/u-select.vue": __vite_glob_0_93, "./components/u-short-video/u-short-video.vue": __vite_glob_0_94, "./components/u-signature/u-signature.vue": __vite_glob_0_95, "./components/u-skeleton/u-skeleton.vue": __vite_glob_0_96, "./components/u-slider/u-slider.vue": __vite_glob_0_97, "./components/u-status-bar/u-status-bar.vue": __vite_glob_0_98, "./components/u-steps-item/u-steps-item.vue": __vite_glob_0_99, "./components/u-steps/u-steps.vue": __vite_glob_0_100, "./components/u-sticky/u-sticky.vue": __vite_glob_0_101, "./components/u-subsection/u-subsection.vue": __vite_glob_0_102, "./components/u-swipe-action-item/u-swipe-action-item.vue": __vite_glob_0_103, "./components/u-swipe-action/u-swipe-action.vue": __vite_glob_0_104, "./components/u-swiper-indicator/u-swiper-indicator.vue": __vite_glob_0_105, "./components/u-swiper/u-swiper.vue": __vite_glob_0_106, "./components/u-switch/u-switch.vue": __vite_glob_0_107, "./components/u-tabbar-item/u-tabbar-item.vue": __vite_glob_0_108, "./components/u-tabbar/u-tabbar.vue": __vite_glob_0_109, "./components/u-table/u-table.vue": __vite_glob_0_110, "./components/u-table2/u-table2.vue": __vite_glob_0_111, "./components/u-tabs-item/u-tabs-item.vue": __vite_glob_0_112, "./components/u-tabs/u-tabs.vue": __vite_glob_0_113, "./components/u-tag/u-tag.vue": __vite_glob_0_114, "./components/u-td/u-td.vue": __vite_glob_0_115, "./components/u-text/u-text.vue": __vite_glob_0_116, "./components/u-textarea/u-textarea.vue": __vite_glob_0_117, "./components/u-th/u-th.vue": __vite_glob_0_118, "./components/u-title/u-title.vue": __vite_glob_0_119, "./components/u-toast/u-toast.vue": __vite_glob_0_120, "./components/u-toolbar/u-toolbar.vue": __vite_glob_0_121, "./components/u-tooltip/u-tooltip.vue": __vite_glob_0_122, "./components/u-tr/u-tr.vue": __vite_glob_0_123, "./components/u-transition/u-transition.vue": __vite_glob_0_124, "./components/u-tree/u-tree.vue": __vite_glob_0_125, "./components/u-upload/u-upload.vue": __vite_glob_0_126, "./components/u-view/u-view.vue": __vite_glob_0_127, "./components/u-virtual-list/u-virtual-list.vue": __vite_glob_0_128, "./components/u-waterfall/u-waterfall.vue": __vite_glob_0_129 });
- let components = [];
- for (const key in importFn) {
- let component = importFn[key].default;
- if (component.name && component.name.indexOf("u--") !== 0) {
- component.install = function(Vue2) {
- Vue2.component(name, component);
- };
- components.push(component);
- }
- }
- const install = (Vue2, upuiParams = "") => {
- components.forEach(function(component) {
- const name2 = component.name.replace(/u-([a-zA-Z0-9-_]+)/g, "up-$1");
- if (name2 != component.name) {
- Vue2.component(component.name, component);
- }
- Vue2.component(name2, component);
- });
- if (upuiParams) {
- uni.upuiParams = upuiParams;
- let temp = upuiParams();
- if (temp.httpIns) {
- temp.httpIns(http);
- }
- if (temp.options) {
- setConfig(temp.options);
- }
- }
- uni.$u = $u;
- Vue2.config.globalProperties.$u = $u;
- Vue2.mixin(mixin);
- };
- const uviewPlus = {
- install
- };
- const _sfc_main$7 = {
- __name: "index",
- props: {
- /**
- * @param add 新增评论
- * @param reply 回复评论
- */
- commentType: {
- type: String,
- default: "add"
- }
- },
- emits: ["clickComment", "moveMessageTop", "inputDone"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const { Toast: Toast2 } = useToast();
- const emit = __emit;
- const props2 = __props;
- const showActionSheet = vue.ref(false);
- function closeActionSheet() {
- showActionSheet.value = false;
- }
- function clickActionSheet(item) {
- if (item.value === 0) {
- handleDeleteComment();
- } else if (item.value === 1) {
- let comment = null;
- if (pressTwoLevelId.value !== 0) {
- const result = findCommentById(pressTwoLevelId.value, "two");
- if (result && result.twoItem) {
- comment = result.twoItem;
- }
- } else if (pressOneLevelId.value !== 0) {
- comment = findCommentById(pressOneLevelId.value, "one");
- }
- if (comment) {
- handleClickComment(comment);
- }
- }
- showActionSheet.value = false;
- }
- async function handleDeleteComment() {
- try {
- await deleteComment(deleteId.value);
- Toast2({ title: "删除成功" });
- removeItemComment();
- } catch (error2) {
- formatAppLog("error", "at components/comment/index.vue:236", "deleteComment", error2);
- } finally {
- pressOneLevelId.value = pressTwoLevelId.value = deleteId.value = 0;
- }
- }
- function removeItemComment() {
- if (pressOneLevelId.value !== 0 && pressTwoLevelId.value === 0) {
- const oneItem = findCommentById(pressOneLevelId.value, "one");
- if (oneItem) {
- const itemIndex = oneCommentList.value.findIndex(
- (v2) => v2.id === oneItem.id
- );
- if (itemIndex !== -1) {
- oneCommentList.value.splice(itemIndex, 1);
- }
- }
- } else if (pressTwoLevelId.value !== 0) {
- const result = findCommentById(pressTwoLevelId.value, "two");
- if (result && result.oneItem && result.twoItem) {
- const twoIndex = result.oneItem.replyList.findIndex(
- (two) => two.id === result.twoItem.id
- );
- if (twoIndex !== -1) {
- result.oneItem.replyList.splice(twoIndex, 1);
- }
- }
- }
- }
- function findCommentById(id, type2 = "one") {
- if (type2 === "one") {
- return oneCommentList.value.find((item) => item.id === id) || null;
- } else if (type2 === "two") {
- for (const oneItem of oneCommentList.value) {
- if (Array.isArray(oneItem.replyList)) {
- const twoItem = oneItem.replyList.find((two) => two.id === id);
- if (twoItem) {
- return { oneItem, twoItem };
- }
- }
- }
- return null;
- }
- return null;
- }
- const deleteId = vue.ref(0);
- const pressOneLevelId = vue.ref(0);
- const pressTwoLevelId = vue.ref(0);
- function longpress(event) {
- var _a2, _b, _c;
- if ((_a2 = event.currentTarget.dataset) == null ? void 0 : _a2.twoLevelId) {
- deleteId.value = pressTwoLevelId.value = event.currentTarget.dataset.twoLevelId;
- } else if ((_b = event.currentTarget.dataset) == null ? void 0 : _b.oneLevelId) {
- deleteId.value = pressOneLevelId.value = (_c = event.currentTarget.dataset) == null ? void 0 : _c.oneLevelId;
- }
- showActionSheet.value = true;
- }
- const actionList = vue.computed(() => {
- return [
- { name: "删除", value: 0 },
- { name: "回复", value: 1 }
- ];
- });
- const articleId = vue.ref("");
- onLoad((options2) => {
- if (!options2.id)
- return;
- articleId.value = options2.id;
- });
- const oneCommentList = vue.ref([]);
- const parentId = vue.ref(0);
- const currentReplyId = vue.ref(0);
- const replyId = vue.ref(0);
- const oneLevelId = vue.ref(0);
- function handleClickComment(comment) {
- if (comment.parentId === 0) {
- currentReplyId.value = comment.id;
- parentId.value = comment.id;
- oneLevelId.value = comment.id;
- } else {
- currentReplyId.value = comment.id;
- parentId.value = comment.parentId;
- oneLevelId.value = comment.oneLevelId;
- }
- replyId.value = comment.userId;
- emit("clickComment", comment);
- }
- function closeF2() {
- }
- const paging = vue.ref(null);
- useZPaging(paging);
- function queryList(page2, pageSize) {
- }
- const likeLoading = vue.ref(false);
- const likeAnimationIds = vue.ref([]);
- function toUserPage(id) {
- uni.navigateTo({ url: `/pages/user/personal?id=${id}` });
- }
- const __returned__ = { Toast: Toast2, emit, props: props2, showActionSheet, closeActionSheet, clickActionSheet, handleDeleteComment, removeItemComment, findCommentById, deleteId, pressOneLevelId, pressTwoLevelId, longpress, actionList, articleId, oneCommentList, parentId, currentReplyId, replyId, oneLevelId, handleClickComment, closeF2, paging, queryList, likeLoading, likeAnimationIds, toUserPage, ref: vue.ref, computed: vue.computed, get useZPaging() {
- return useZPaging;
- }, get onLoad() {
- return onLoad;
- }, get timeFormat() {
- return timeFormat;
- }, get useToast() {
- return useToast;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_avatar = vue.resolveComponent("up-avatar");
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$g);
- const _component_z_paging = resolveEasycom(vue.resolveDynamicComponent("z-paging"), __easycom_1$5);
- const _component_up_action_sheet = vue.resolveComponent("up-action-sheet");
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(_component_z_paging, {
- ref: "paging",
- "use-page-scroll": "",
- onCloseF2: $setup.closeF2,
- modelValue: $setup.oneCommentList,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.oneCommentList = $event),
- onQuery: $setup.queryList,
- class: "comment-paging"
- }, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($setup.oneCommentList, (oneItem) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "comment-box",
- key: oneItem.id
- }, [
- vue.createCommentVNode(" 一级评论 "),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass([
- "item-comment",
- oneItem.replyList && oneItem.replyList.length > 0 ? "child" : ""
- ])
- },
- [
- vue.createElementVNode("view", { class: "avatar" }, [
- vue.createVNode(_component_up_avatar, {
- onClick: ($event) => $setup.toUserPage(oneItem.userId),
- shape: "circle",
- src: oneItem.usePicture
- }, null, 8, ["onClick", "src"])
- ]),
- vue.createElementVNode("view", { class: "content" }, [
- vue.createElementVNode("view", {
- class: "user-box",
- onClick: ($event) => $setup.toUserPage(oneItem.userId)
- }, [
- vue.createElementVNode(
- "text",
- { class: "username" },
- vue.toDisplayString(oneItem.userName),
- 1
- /* TEXT */
- ),
- oneItem.authorMark ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "author-tag"
- }, "作者")) : vue.createCommentVNode("v-if", true)
- ], 8, ["onClick"]),
- vue.createElementVNode("view", {
- onLongpress: $setup.longpress,
- "data-one-level-id": oneItem.id,
- class: "reply-box",
- onClick: ($event) => $setup.handleClickComment(oneItem)
- }, [
- vue.createElementVNode(
- "text",
- { class: "text" },
- vue.toDisplayString(oneItem.content),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "time" },
- vue.toDisplayString($setup.timeFormat(oneItem.createTime, "yyyy-mm-dd")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "reply-tip" }, "回复")
- ], 40, ["data-one-level-id", "onClick"])
- ]),
- vue.createElementVNode("view", { class: "right-box" }, [
- vue.withDirectives(vue.createVNode(_component_uni_icons, {
- customPrefix: "iconfont",
- size: "18",
- color: "#2E2E2E",
- class: vue.normalizeClass(["icon-state icon-dianzan", {
- animated: $setup.likeAnimationIds.includes(oneItem.id),
- heartBeat: $setup.likeAnimationIds.includes(oneItem.id)
- }])
- }, null, 8, ["class"]), [
- [vue.vShow, !oneItem.likeMark]
- ]),
- vue.withDirectives(vue.createVNode(_component_uni_icons, {
- customPrefix: "iconfont",
- size: "18",
- color: "#FF2442",
- class: vue.normalizeClass(["icon-state icon-dianzanxuanzhong", {
- animated: $setup.likeAnimationIds.includes(oneItem.id),
- heartBeat: $setup.likeAnimationIds.includes(oneItem.id)
- }])
- }, null, 8, ["class"]), [
- [vue.vShow, oneItem.likeMark]
- ]),
- vue.createElementVNode(
- "text",
- { class: "count" },
- vue.toDisplayString(oneItem.likeCount),
- 1
- /* TEXT */
- )
- ])
- ],
- 2
- /* CLASS */
- ),
- vue.createCommentVNode(" 二级评论 "),
- oneItem.replyList && oneItem.replyList.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", {
- key: 0,
- class: "child-comment-box"
- }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(oneItem.replyList, (twoItem, idx) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "item-comment sub-comment",
- key: idx
- }, [
- vue.createElementVNode("view", { class: "avatar" }, [
- vue.createVNode(_component_up_avatar, {
- class: "sub-avatar",
- shape: "circle",
- size: "25",
- src: twoItem.usePicture
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "content" }, [
- vue.createElementVNode("view", { class: "user-box" }, [
- vue.createElementVNode(
- "text",
- { class: "username" },
- vue.toDisplayString(twoItem.userName),
- 1
- /* TEXT */
- ),
- twoItem.authorMark ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "author-tag"
- }, "作者")) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", {
- onLongpress: $setup.longpress,
- "data-one-level-id": oneItem.id,
- "data-two-level-id": twoItem.id,
- class: "reply-box"
- }, [
- twoItem.replyMark ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "text"
- }, [
- vue.createTextVNode("回复"),
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString(twoItem.replyName) + ": ",
- 1
- /* TEXT */
- ),
- vue.createTextVNode(
- vue.toDisplayString(twoItem.content),
- 1
- /* TEXT */
- )
- ])) : (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "text"
- },
- vue.toDisplayString(twoItem.content),
- 1
- /* TEXT */
- )),
- vue.createElementVNode(
- "text",
- { class: "time" },
- vue.toDisplayString($setup.timeFormat(twoItem.createTime, "yyyy-mm-dd")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "reply-tip" }, "回复")
- ], 40, ["data-one-level-id", "data-two-level-id"])
- ]),
- vue.createElementVNode("view", { class: "right-box" }, [
- vue.withDirectives(vue.createVNode(_component_uni_icons, {
- customPrefix: "iconfont",
- size: "18",
- color: "#2E2E2E",
- class: vue.normalizeClass(["icon-state icon-dianzan", {
- animated: $setup.likeAnimationIds.includes(twoItem.id),
- heartBeat: $setup.likeAnimationIds.includes(twoItem.id)
- }])
- }, null, 8, ["class"]), [
- [vue.vShow, !twoItem.likeMark]
- ]),
- vue.withDirectives(vue.createVNode(_component_uni_icons, {
- customPrefix: "iconfont",
- size: "18",
- color: "#FF2442",
- class: vue.normalizeClass(["icon-state icon-dianzanxuanzhong", {
- animated: $setup.likeAnimationIds.includes(twoItem.id),
- heartBeat: $setup.likeAnimationIds.includes(twoItem.id)
- }])
- }, null, 8, ["class"]), [
- [vue.vShow, twoItem.likeMark]
- ]),
- vue.createElementVNode(
- "text",
- { class: "count" },
- vue.toDisplayString(twoItem.likeCount),
- 1
- /* TEXT */
- )
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- oneItem.replyList && oneItem.replyList.length > 0 && oneItem.replyPage.hasMore && oneItem.replyCount > 1 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "load-more"
- }, [
- vue.createCommentVNode(" <text>展示{{ twoItem.allReply }}条回复</text> "),
- vue.createElementVNode("text", null, "展开更多回复")
- ])) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true)
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- }, 8, ["modelValue"]),
- vue.createVNode(_component_up_action_sheet, {
- actions: $setup.actionList,
- closeOnClickOverlay: true,
- cancelText: "取消",
- show: $setup.showActionSheet,
- onClose: $setup.closeActionSheet,
- onSelect: $setup.clickActionSheet
- }, null, 8, ["actions", "show"])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const Comment = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__scopeId", "data-v-05fcfa07"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/components/comment/index.vue"]]);
- const _sfc_main$6 = {
- __name: "index",
- props: {
- // 是否已关注
- followed: {
- type: Boolean,
- default: false
- },
- // 被关注用户ID
- followedId: {
- type: [String, Number],
- required: true
- },
- textType: {
- type: String,
- default: "default"
- // 可选值 fans
- },
- showBtn: {
- type: Boolean,
- default: true
- },
- activeStyle: {
- type: Object,
- default: () => ({})
- },
- inactiveStyle: {
- type: Object,
- default: () => ({})
- }
- },
- emits: ["update:followed", "follow-change"],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const defaultActiveStyle = {
- border: "1px solid #999",
- color: "#333"
- };
- const defaultInactiveStyle = {
- border: "1px solid #ff2442",
- color: "#ff2442"
- };
- const { Toast: Toast2 } = useToast();
- const props2 = __props;
- const isOwner = vue.computed(() => {
- });
- const currentStyle = vue.computed(() => {
- if (isFollowed.value) {
- return { ...defaultActiveStyle, ...props2.activeStyle || {} };
- } else {
- return { ...defaultInactiveStyle, ...props2.inactiveStyle || {} };
- }
- });
- const emit = __emit;
- const isFollowed = vue.ref(props2.followed);
- const showFollowModal = vue.ref(false);
- const followLoading = vue.ref(false);
- vue.watch(
- () => props2.followed,
- (newVal) => {
- isFollowed.value = newVal;
- }
- );
- async function handleFollow() {
- formatAppLog("log", "at components/followBtn/index.vue:114", "点击关注按钮");
- if (isFollowed.value) {
- showFollowModal.value = true;
- }
- }
- function confirmFollowModal() {
- showFollowModal.value = false;
- }
- function cancelFollowModal() {
- showFollowModal.value = false;
- }
- const __returned__ = { defaultActiveStyle, defaultInactiveStyle, Toast: Toast2, props: props2, isOwner, currentStyle, emit, isFollowed, showFollowModal, followLoading, handleFollow, confirmFollowModal, cancelFollowModal, ref: vue.ref, watch: vue.watch, computed: vue.computed, onMounted: vue.onMounted, get useToast() {
- return useToast;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_modal = vue.resolveComponent("up-modal");
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock(
- "view",
- { class: "follow-container" },
- [
- vue.createCommentVNode(" 关注按钮 "),
- vue.createElementVNode(
- "view",
- {
- onClick: $setup.handleFollow,
- class: vue.normalizeClass(["follow-box", $setup.isFollowed ? "follow" : "", $setup.currentStyle]),
- style: vue.normalizeStyle($setup.currentStyle)
- },
- [
- vue.createElementVNode("text", null, [
- $props.textType === "default" ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createTextVNode(
- vue.toDisplayString($setup.isFollowed ? "已关注" : "关注"),
- 1
- /* TEXT */
- )
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 粉丝列表展示文案不一样 "),
- $setup.isFollowed ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createTextVNode("互相关注")
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createTextVNode("回关")
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ])
- ],
- 6
- /* CLASS, STYLE */
- ),
- vue.createCommentVNode(" 取关确认弹窗 "),
- vue.createVNode(_component_up_modal, {
- showCancelButton: true,
- confirmText: "不再关注",
- cancelText: "取消",
- onConfirm: $setup.confirmFollowModal,
- onCancel: $setup.cancelFollowModal,
- show: $setup.showFollowModal,
- title: "不再关注该作者?"
- }, null, 8, ["show"])
- ],
- 512
- /* NEED_PATCH */
- )), [
- [vue.vShow, !$setup.isOwner]
- ]);
- }
- const FollowBtn = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__scopeId", "data-v-ca095d49"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/components/followBtn/index.vue"]]);
- const _sfc_main$5 = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- const {
- Toast: Toast2
- } = useToast();
- const goShuiBei = () => {
- {
- window.location.href = "weixin://dl/business/?t=HZ2gBmGKRzp";
- }
- };
- const instance = vue.getCurrentInstance();
- const articleId = vue.ref("");
- const detail = vue.ref(null);
- const isOwner = vue.computed(() => {
- });
- onLoad((options2) => {
- articleId.value = options2.id || "101";
- fetchArticleDetail();
- });
- onReady(() => {
- uni.onKeyboardHeightChange && uni.onKeyboardHeightChange(listenerKeybord);
- });
- onShow(() => {
- uni.$on("followStateChanged", handleFollowStateChanged);
- });
- onHide(() => {
- uni.offKeyboardHeightChange && uni.offKeyboardHeightChange(listenerKeybord);
- uni.$off("followStateChanged", handleFollowStateChanged);
- });
- function clickSwiper(index2) {
- var _a2;
- formatAppLog("log", "at pages/article_details/index.vue:225", "index", index2);
- uni.previewImage({
- current: index2,
- urls: ((_a2 = detail.value) == null ? void 0 : _a2.imageUrlList) || []
- });
- }
- function listenerKeybord(res) {
- if (res.height === 0) {
- keybordHeight.value = 0;
- } else {
- uni.getSystemInfo({
- success(systemRes) {
- const screenHeight = systemRes.screenHeight;
- const windowHeight = systemRes.windowHeight;
- const disHeight = screenHeight - windowHeight;
- keybordHeight.value = res.height - disHeight;
- }
- });
- }
- }
- async function fetchArticleDetail() {
- try {
- uni.showLoading({
- title: "加载中",
- mask: true
- });
- const {
- data
- } = await getGoodDetailId(articleId.value);
- detail.value = data;
- uni.hideLoading();
- } catch (error2) {
- formatAppLog("error", "at pages/article_details/index.vue:261", "fetchArticleDetail", error2);
- uni.hideLoading();
- }
- }
- const commentText = vue.ref("");
- function rightClick() {
- }
- const goBack = () => {
- const pages2 = getCurrentPages();
- if (pages2.length > 1) {
- uni.navigateBack();
- } else {
- uni.switchTab({
- url: "/pages/index/index"
- });
- }
- };
- const showActionPopup = vue.ref(false);
- function handleActions() {
- showActionPopup.value = true;
- }
- function handleDelete() {
- showActionPopup.value = false;
- uni.showModal({
- title: "提示",
- content: "确认删除?",
- success: async function(res) {
- if (res.confirm)
- ;
- }
- });
- }
- function toUserPage() {
- uni.navigateTo({
- url: `/pages/user/personal?id=${detail.value.userId}`
- });
- }
- const commentType = vue.ref("add");
- const commentInputPl = vue.ref("说点什么...");
- function clickComment(comment) {
- const username = comment.userName;
- commentType.value = "reply";
- commentInputPl.value = `回复 @${username}`;
- keybordFocus.value = true;
- }
- const confirmHold = vue.ref(true);
- const commentRef = vue.ref();
- function handleInputConfirm(event) {
- var _a2;
- if (((_a2 = commentText.value) == null ? void 0 : _a2.trim()) === "") {
- confirmHold.value = true;
- return Toast2({
- title: "有内容才能发送哦"
- });
- }
- confirmHold.value = false;
- commentRef.value.handleAddComment(commentText.value);
- }
- function inputDone() {
- commentText.value = "";
- }
- const commentSection = vue.ref();
- const commentOffsetTop = vue.ref(0);
- vue.watch(
- () => detail.value,
- async (val, oldVal) => {
- if (val && !oldVal) {
- await vue.nextTick();
- const query = uni.createSelectorQuery().in(instance.proxy);
- query.select(".comment-section").boundingClientRect((data) => {
- if (data.top) {
- commentOffsetTop.value = data.top - 60;
- }
- }).exec();
- }
- }
- );
- function clickMessageIcon() {
- uni.pageScrollTo({
- scrollTop: commentOffsetTop.value,
- // selector: ".fixed-view",
- success() {
- formatAppLog("log", "at pages/article_details/index.vue:374", "success");
- },
- fail(e2) {
- formatAppLog("error", "at pages/article_details/index.vue:377", `scrollTo error ${e2}`);
- }
- });
- }
- const collectionLoading = vue.ref(false);
- async function handleCollection() {
- try {
- if (collectionLoading.value)
- return;
- collectionLoading.value = true;
- await setUserState({
- type: 1,
- bookId: detail.value.id
- });
- detail.value.collectMark = !detail.value.collectMark;
- if (detail.value.collectMark) {
- detail.value.collectCount += 1;
- } else {
- detail.value.collectCount -= 1;
- }
- collectionLoading.value = false;
- } catch (error2) {
- formatAppLog("error", "at pages/article_details/index.vue:402", "collection error", error2);
- collectionLoading.value = false;
- }
- }
- const likeLoading = vue.ref(false);
- const likeAnimation = vue.ref(false);
- async function handleLike() {
- try {
- if (likeLoading.value)
- return;
- likeLoading.value = true;
- await setUserState({
- type: 0,
- bookId: detail.value.id
- });
- detail.value.likeMark = !detail.value.likeMark;
- if (detail.value.likeMark) {
- likeAnimation.value = true;
- detail.value.likeCount += 1;
- } else {
- likeAnimation.value = false;
- detail.value.likeCount -= 1;
- }
- likeLoading.value = false;
- } catch (error2) {
- likeLoading.value = false;
- Toast2({
- title: "点赞失败"
- });
- formatAppLog("error", "at pages/article_details/index.vue:435", "handleLike", error2);
- }
- }
- const keybordHeight = vue.ref(0);
- const keybordOverlay = vue.ref(true);
- const keybordFocus = vue.ref(false);
- function commentInputFocus(event) {
- }
- function commentInputBlur() {
- keybordHeight.value = 0;
- keybordFocus.value = false;
- }
- function clickFooterInput() {
- formatAppLog("log", "at pages/article_details/index.vue:463", "点击了底部Input");
- commentInputPl.value = "说点什么...";
- commentType.value = "add";
- keybordFocus.value = true;
- }
- function handleFollowStateChanged(data) {
- var _a2;
- if (Number(data.userId) === Number((_a2 = detail.value) == null ? void 0 : _a2.userId)) {
- detail.value.followMark = data.followMark;
- }
- }
- const __returned__ = { Toast: Toast2, goShuiBei, instance, articleId, detail, isOwner, clickSwiper, listenerKeybord, fetchArticleDetail, commentText, rightClick, goBack, showActionPopup, handleActions, handleDelete, toUserPage, commentType, commentInputPl, clickComment, confirmHold, commentRef, handleInputConfirm, inputDone, commentSection, commentOffsetTop, clickMessageIcon, collectionLoading, handleCollection, likeLoading, likeAnimation, handleLike, keybordHeight, keybordOverlay, keybordFocus, commentInputFocus, commentInputBlur, clickFooterInput, handleFollowStateChanged, ref: vue.ref, watch: vue.watch, getCurrentInstance: vue.getCurrentInstance, nextTick: vue.nextTick, computed: vue.computed, get onLoad() {
- return onLoad;
- }, get onReady() {
- return onReady;
- }, get onHide() {
- return onHide;
- }, get onShow() {
- return onShow;
- }, get useToast() {
- return useToast;
- }, get getArticleDetailId() {
- return getArticleDetailId;
- }, get getGoodDetailId() {
- return getGoodDetailId;
- }, get Comment() {
- return Comment;
- }, get FollowBtn() {
- return FollowBtn;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_overlay = vue.resolveComponent("up-overlay");
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$g);
- const _component_up_tabbar = vue.resolveComponent("up-tabbar");
- const _component_up_popup = vue.resolveComponent("up-popup");
- return $setup.detail ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "page-container"
- }, [
- vue.createCommentVNode(" 自定义导航栏 "),
- vue.createCommentVNode(` <up-navbar height="60px" class="nav-bar" @rightClick="rightClick">\r
- <template #left>\r
- <uni-icons @click="goBack" type="left" size="26"></uni-icons>\r
- <view class="user-box" @click="toUserPage">\r
- <up-avatar\r
- class="user-avatar"\r
- :src="detail.usePicture || ''"\r
- shape="circle"\r
- ></up-avatar>\r
- <text class="username">{{ detail.userName }}</text>\r
- </view>\r
- </template>\r
- <template #center> </template>\r
- <template #right>\r
- <FollowBtn\r
- :followed="detail.followMark"\r
- :followedId="detail.userId"\r
- @update:followed="(val) => (detail.followMark = val)"\r
- />\r
- <view @click="handleActions" class="actions" v-if="isOwner">\r
- <uni-icons size="24" type="more-filled"></uni-icons>\r
- </view>\r
- </template>\r
- </up-navbar> `),
- vue.createCommentVNode(" 内容区域 "),
- vue.createElementVNode("view", { class: "content-box" }, [
- vue.createElementVNode("view", { class: "content-container" }, [
- vue.createCommentVNode(" 主体内容 "),
- vue.createElementVNode("view", { class: "post-content" }, [
- vue.createElementVNode("view", { class: "post-image" }, [
- vue.createElementVNode("view", { class: "image-list-box" }, [
- vue.createElementVNode("image", {
- src: $setup.detail.coverImage,
- mode: "",
- class: "coverImage"
- }, null, 8, ["src"]),
- vue.createCommentVNode(' <up-swiper\r\n \r\n indicatorMode="dot"\r\n bgColor="#fff"\r\n imgMode="widthFix"\r\n :autoplay="false"\r\n @click="clickSwiper"\r\n height="540"\r\n :list="[detail.coverImage]"\r\n ></up-swiper> ')
- ]),
- vue.createCommentVNode(' <view v-else class="image-box">\r\n <image :src="detail.imageUrlList[0]" mode="widthFix" />\r\n </view> ')
- ]),
- vue.createElementVNode("view", { class: "post-box" }, [
- vue.createElementVNode("view", { class: "post-title" }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.detail.title),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "post-text" }, [
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.detail.content),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "post-info" }, [
- vue.createElementVNode(
- "text",
- { class: "post-time" },
- vue.toDisplayString($setup.detail.publishTime),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(' <text class="post-views">共{{ detail.commentCount }}条评论</text> ')
- ])
- ])
- ]),
- vue.createElementVNode("view", { class: "fixed-view" }),
- vue.createCommentVNode(" 评论区 "),
- vue.createElementVNode(
- "view",
- {
- class: "comment-section",
- ref: "commentSection"
- },
- [
- vue.createElementVNode("view", { class: "comment-title" }, [
- vue.createElementVNode(
- "text",
- null,
- "全部评论 (" + vue.toDisplayString($setup.detail.commentCount) + ")",
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(" 评论列表 "),
- vue.createVNode($setup["Comment"], {
- commentType: $setup.commentType,
- ref: "commentRef",
- onClickComment: $setup.clickComment,
- onMoveMessageTop: $setup.clickMessageIcon,
- onInputDone: $setup.inputDone
- }, null, 8, ["commentType"])
- ],
- 512
- /* NEED_PATCH */
- )
- ])
- ]),
- vue.createCommentVNode(" 这里是底部input聚焦弹窗键盘时,真实输入框 "),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["keybord-input-box", $setup.keybordHeight > 0 ? "keybord-fixed" : ""])
- },
- [
- vue.createVNode(_component_up_overlay, {
- show: $setup.keybordOverlay,
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.keybordHeight = 0)
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "overlay-input-box",
- style: vue.normalizeStyle(
- $setup.keybordHeight > 0 ? "--tabbar-bottom:" + $setup.keybordHeight + "px" : ""
- )
- },
- [
- vue.createElementVNode("view", { class: "comment-input-container" }, [
- vue.withDirectives(vue.createElementVNode("input", {
- focus: $setup.keybordFocus,
- border: "none",
- adjustPosition: false,
- class: "comment-input",
- type: "text",
- "confirm-type": "send",
- "auto-blur": true,
- "confirm-hold": $setup.confirmHold,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.commentText = $event),
- placeholder: $setup.commentInputPl,
- onFocus: $setup.commentInputFocus,
- onBlur: $setup.commentInputBlur,
- onConfirm: $setup.handleInputConfirm
- }, null, 40, ["focus", "confirm-hold", "placeholder"]), [
- [vue.vModelText, $setup.commentText]
- ])
- ]),
- vue.createElementVNode("view", {
- class: "right-box",
- onClick: $setup.handleInputConfirm
- }, [
- vue.createElementVNode("button", { type: "default" }, "发送")
- ])
- ],
- 4
- /* STYLE */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ],
- 2
- /* CLASS */
- ),
- vue.createCommentVNode(" 底部互动栏 "),
- vue.createVNode(_component_up_tabbar, { class: "u-bottom-tabbar" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "toAPP" }, [
- vue.createElementVNode("button", {
- type: "default",
- class: "storeAPP",
- onClick: $setup.goShuiBei
- }, "打开水贝商城")
- ]),
- vue.createElementVNode("view", { class: "bottom-bar" }, [
- vue.createElementVNode("view", {
- onClick: vue.withModifiers($setup.clickFooterInput, ["stop"]),
- class: "comment-input-container"
- }, [
- vue.createElementVNode("input", {
- border: "none",
- adjustPosition: false,
- class: "comment-input",
- type: "text",
- readonly: true,
- disabled: true,
- "confirm-type": "发送",
- "auto-blur": true,
- placeholder: "说点什么..."
- })
- ]),
- vue.createElementVNode("view", { class: "right-box" }, [
- vue.createElementVNode("view", {
- class: "item",
- onClick: $setup.handleLike
- }, [
- vue.createVNode(_component_uni_icons, {
- type: "heart",
- size: "24"
- }),
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.detail.likeCount),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "item",
- onClick: $setup.handleCollection
- }, [
- vue.createVNode(_component_uni_icons, {
- type: "star",
- size: "24"
- }),
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.detail.collectCount),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", {
- class: "item",
- onClick: $setup.clickMessageIcon
- }, [
- vue.createVNode(_component_uni_icons, {
- type: "chat",
- size: "24"
- }),
- vue.createElementVNode(
- "text",
- null,
- vue.toDisplayString($setup.detail.commentCount),
- 1
- /* TEXT */
- )
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(" 右上角操作popup "),
- vue.createVNode(_component_up_popup, {
- show: $setup.showActionPopup,
- onClose: _cache[3] || (_cache[3] = ($event) => $setup.showActionPopup = false)
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "popup-box" }, [
- vue.createElementVNode("view", {
- class: "close-box",
- onClick: _cache[2] || (_cache[2] = ($event) => $setup.showActionPopup = false)
- }, [
- vue.createVNode(_component_uni_icons, {
- type: "closeempty",
- size: "28"
- })
- ]),
- vue.createElementVNode("view", { class: "header" }, [
- vue.createElementVNode("view", { class: "title" }, "更多操作")
- ]),
- vue.createElementVNode("view", { class: "actions-menu" }, [
- vue.createElementVNode("view", {
- onClick: $setup.handleDelete,
- class: "item-action"
- }, [
- vue.createElementVNode("view", { class: "icon-box" }, [
- vue.createVNode(_component_uni_icons, {
- type: "trash",
- size: "28"
- })
- ]),
- vue.createElementVNode("view", { class: "icon-name" }, "删除")
- ])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"])
- ])) : vue.createCommentVNode("v-if", true);
- }
- const PagesArticleDetailsIndex = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-04f1b7e6"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/pages/article_details/index.vue"]]);
- const wechat = {};
- const _imports_0$1 = "/static/images/stop.png";
- const _sfc_main$4 = {
- __name: "index",
- props: {
- imgUrls: {
- type: Array,
- default: () => []
- },
- videoline: {
- type: String,
- default: ""
- }
- },
- setup(__props, { expose: __expose }) {
- __expose();
- const props2 = __props;
- const indicatorDots = vue.ref(true);
- const circular = vue.ref(true);
- const autoplay = vue.ref(true);
- const interval = vue.ref(3e3);
- const duration = vue.ref(500);
- const currents = vue.ref("1");
- const controls = vue.ref(true);
- const isPlay = vue.ref(true);
- const videoContext = vue.ref("");
- vue.onMounted(() => {
- if (props2.videoline) {
- props2.imgUrls.shift();
- }
- });
- const bindPause = () => {
- videoContext.value.play();
- controls.value = false;
- autoplay.value = false;
- };
- const change = (e2) => {
- currents.value = e2.detail.current + 1;
- };
- const videoPause = (e2) => {
- };
- const __returned__ = { props: props2, indicatorDots, circular, autoplay, interval, duration, currents, controls, isPlay, videoContext, bindPause, change, videoPause, ref: vue.ref, onMounted: vue.onMounted };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "product-bg" }, [
- vue.createElementVNode("swiper", {
- "indicator-dots": $setup.indicatorDots,
- "indicator-active-color": "#e93323",
- autoplay: $setup.autoplay,
- circular: $setup.circular,
- interval: $setup.interval,
- duration: $setup.duration,
- onChange: $setup.change
- }, [
- $props.videoline ? (vue.openBlock(), vue.createElementBlock("swiper-item", { key: 0 }, [
- vue.createElementVNode("view", { class: "item" }, [
- vue.withDirectives(vue.createElementVNode(
- "view",
- { style: { "width": "100%", "height": "100%" } },
- [
- vue.createElementVNode("video", {
- id: "myVideo",
- src: $props.videoline,
- objectFit: "cover",
- controls: "",
- style: { "width": "100%", "height": "100%" },
- "show-center-play-btn": "",
- "show-mute-btn": "true",
- "auto-pause-if-navigate": "",
- "custom-cache": false,
- "enable-progress-gesture": false,
- poster: $props.imgUrls[0],
- onPause: $setup.videoPause
- }, null, 40, ["src", "poster"])
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, !$setup.controls]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "poster" },
- [
- vue.createElementVNode("image", {
- class: "image",
- src: $props.imgUrls[0]
- }, null, 8, ["src"])
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.controls]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- {
- class: "stop",
- onClick: $setup.bindPause
- },
- [
- vue.createElementVNode("image", {
- class: "image",
- src: _imports_0$1
- })
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $setup.controls]
- ])
- ])
- ])) : vue.createCommentVNode("v-if", true),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.imgUrls, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("swiper-item", { key: index2 }, [
- vue.createElementVNode("image", {
- src: item,
- class: "slide-image"
- }, null, 8, ["src"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ], 40, ["indicator-dots", "autoplay", "circular", "interval", "duration"])
- ]);
- }
- const productConSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-afea8b02"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/components/productConSwiper/index.vue"]]);
- const _imports_0 = "/static/images/noCoupon.png";
- const _sfc_main$3 = {
- __name: "index",
- props: {
- showPopup: {
- type: Boolean,
- default: false
- },
- openType: {
- type: Number,
- default: 0
- },
- coupon: {
- type: Object,
- default: () => ({})
- },
- orderShow: {
- type: String,
- default: ""
- }
- },
- emits: [
- "close",
- "ChangCouponsUseState",
- "ChangCoupons",
- "tabCouponType"
- ],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props2 = __props;
- const { Toast: Toast2 } = useToast();
- const emit = __emit;
- const type2 = vue.ref(1);
- function close() {
- type2.value = 1;
- emit("close");
- }
- function setType(val) {
- type2.value = val;
- emit("tabCouponType", val);
- }
- const __returned__ = { props: props2, Toast: Toast2, emit, type: type2, close, setType, ref: vue.ref, get useToast() {
- return useToast;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_popup = vue.resolveComponent("up-popup");
- return vue.openBlock(), vue.createBlock(_component_up_popup, {
- show: $props.showPopup,
- closeOnClickOverlay: true,
- onClose: $setup.close
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "coupon-list-window" }, [
- !$props.orderShow ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "nav acea-row row-around"
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["acea-row", "row-middle", $setup.type === 1 ? "on" : ""]),
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.setType(1))
- },
- "通用券",
- 2
- /* CLASS */
- ),
- vue.createCommentVNode(` <view\r
- :class="['acea-row', 'row-middle', type === 2 ? 'on' : '']"\r
- @click="setType(2)"\r
- >商品券</view\r
- >\r
- <view\r
- :class="['acea-row', 'row-middle', type === 3 ? 'on' : '']"\r
- @click="setType(3)"\r
- >品类券</view\r
- > `)
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "coupon-box" }, [
- vue.createElementVNode(
- "view",
- {
- class: "coupon-list",
- style: vue.normalizeStyle({ "margin-top": !$props.orderShow ? "0" : "50rpx" })
- },
- [
- $props.coupon.list.length ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
- key: 0,
- class: "scroll-box",
- "scroll-y": "true"
- }, [
- $props.coupon.list.length ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createCommentVNode(` <view class='item acea-row row-center-wrapper' v-for="(item,index) in coupon.list" :key='index'> `),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.coupon.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "item acea-row row-center-wrapper",
- key: index2
- }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["money acea-row row-column row-center-wrapper", item.isUse ? "moneyGray" : ""])
- },
- [
- vue.createElementVNode("view", null, [
- vue.createTextVNode("¥"),
- vue.createElementVNode(
- "text",
- { class: "num" },
- vue.toDisplayString(item.money ? Number(item.money) : ""),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode(
- "view",
- { class: "pic-num" },
- "满" + vue.toDisplayString(item.minPrice) + "元可用",
- 1
- /* TEXT */
- )
- ],
- 2
- /* CLASS */
- ),
- vue.createElementVNode("view", { class: "text" }, [
- vue.createElementVNode("view", { class: "condition line2" }, [
- item.useType === 1 ? (vue.openBlock(), vue.createElementBlock(
- "span",
- {
- key: 0,
- class: vue.normalizeClass(["line-title", item.isUse ? "gray" : ""])
- },
- "通用",
- 2
- /* CLASS */
- )) : item.useType === 3 ? (vue.openBlock(), vue.createElementBlock(
- "span",
- {
- key: 1,
- class: vue.normalizeClass(["line-title", item.isUse ? "gray" : ""])
- },
- "品类",
- 2
- /* CLASS */
- )) : (vue.openBlock(), vue.createElementBlock(
- "span",
- {
- key: 2,
- class: vue.normalizeClass(["line-title", item.isUse ? "gray" : ""])
- },
- "商品",
- 2
- /* CLASS */
- )),
- vue.createElementVNode(
- "span",
- null,
- vue.toDisplayString(item.name),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "tip-row" }, "注: 工费一次性抵扣"),
- vue.createElementVNode("view", { class: "data acea-row row-between-wrapper" }, [
- item.day > 0 ? (vue.openBlock(), vue.createElementBlock(
- "view",
- { key: 0 },
- "领取后" + vue.toDisplayString(item.day) + "天内可用",
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- { key: 1 },
- vue.toDisplayString(item.useStartTimeStr && item.useEndTimeStr ? item.useStartTimeStr + " - " + item.useEndTimeStr : ""),
- 1
- /* TEXT */
- )),
- item.isUse ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "bnt gray"
- },
- vue.toDisplayString(item.use_title || "已领取"),
- 1
- /* TEXT */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 3,
- class: "bnt bg-color"
- },
- vue.toDisplayString($props.coupon.statusTile || "立即领取"),
- 1
- /* TEXT */
- ))
- ])
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 64
- /* STABLE_FRAGMENT */
- )) : vue.createCommentVNode("v-if", true)
- ])) : (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 1 },
- [
- vue.createCommentVNode(" 无优惠券 "),
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", { src: _imports_0 })
- ])
- ],
- 2112
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
- ))
- ],
- 4
- /* STYLE */
- )
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]);
- }
- const couponListWindow = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-915a5452"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/components/couponListWindow/index.vue"]]);
- const _sfc_main$2 = {
- __name: "index",
- props: {
- attr: {
- type: Object,
- default: () => ({})
- },
- showPopup: {
- type: Boolean,
- default: false
- },
- limitNum: {
- type: Number,
- default: 0
- },
- isShow: {
- type: Number,
- default: 0
- },
- iSbnt: {
- type: Number,
- default: 0
- },
- iSplus: {
- type: Number,
- default: 0
- },
- iScart: {
- type: Number,
- default: 0
- }
- },
- emits: [
- "goCat",
- "iptCartNum",
- "myevent",
- "ChangeCartNum",
- "attrVal",
- "ChangeAttr",
- "submit",
- "closePopup"
- ],
- setup(__props, { expose: __expose, emit: __emit }) {
- __expose();
- const props2 = __props;
- const emit = __emit;
- const calcNumPrice = vue.computed(() => {
- var _a2;
- if (!((_a2 = props2.attr) == null ? void 0 : _a2.productSelect)) {
- return "0.00";
- }
- const { storePrice, cart_num } = props2.attr.productSelect;
- if (!storePrice || !cart_num) {
- return "0.00";
- }
- const price = Number(storePrice);
- const quantity = Number(cart_num);
- if (isNaN(price) || isNaN(quantity)) {
- return "0.00";
- }
- if (price < 0 || quantity < 0) {
- return "0.00";
- }
- const total = price * quantity;
- return total.toFixed(2);
- });
- function goCat() {
- emit("goCat");
- }
- function bindCode() {
- emit("iptCartNum", props2.attr.productSelect.cart_num);
- }
- function close() {
- emit("closePopup");
- }
- function submit() {
- emit("submit");
- }
- function CartNumDes() {
- emit("ChangeCartNum", false);
- }
- function CartNumAdd() {
- emit("ChangeCartNum", true);
- }
- function tapAttr(indexw, indexn) {
- emit("attrVal", { indexw, indexn });
- if (props2.attr.productAttr && props2.attr.productAttr[indexw]) {
- props2.attr.productAttr[indexw].index = props2.attr.productAttr[indexw].attrValues[indexn];
- }
- const value2 = getCheckedValue().join(",");
- emit("ChangeAttr", value2);
- }
- function getCheckedValue() {
- const productAttr = props2.attr.productAttr || [];
- const value2 = [];
- for (let i2 = 0; i2 < productAttr.length; i2++) {
- for (let j2 = 0; j2 < productAttr[i2].attrValues.length; j2++) {
- if (productAttr[i2].index === productAttr[i2].attrValues[j2]) {
- value2.push(productAttr[i2].attrValues[j2]);
- }
- }
- }
- return value2;
- }
- const __returned__ = { props: props2, emit, calcNumPrice, goCat, bindCode, close, submit, CartNumDes, CartNumAdd, tapAttr, getCheckedValue, computed: vue.computed };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_up_button = vue.resolveComponent("up-button");
- const _component_up_popup = vue.resolveComponent("up-popup");
- return vue.openBlock(), vue.createBlock(_component_up_popup, {
- show: $props.showPopup,
- closeOnClickOverlay: true,
- onClose: $setup.close
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["product-window", ($props.iSbnt ? "join" : "") + " " + ($props.iScart ? "joinCart" : "")])
- },
- [
- vue.createElementVNode("view", { class: "textpic acea-row row-between-wrapper" }, [
- vue.createElementVNode("view", { class: "pictrue" }, [
- vue.createElementVNode("image", {
- src: $props.attr.productSelect.image
- }, null, 8, ["src"])
- ]),
- vue.createElementVNode("view", { class: "text" }, [
- vue.createElementVNode(
- "view",
- { class: "line1" },
- vue.toDisplayString($props.attr.productSelect.storeName),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "money font-color" }, [
- vue.createTextVNode(" ¥"),
- vue.createElementVNode(
- "text",
- { class: "num" },
- vue.toDisplayString($setup.calcNumPrice),
- 1
- /* TEXT */
- ),
- $props.isShow ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: "stock"
- },
- "库存: " + vue.toDisplayString($props.attr.productSelect.stock),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- $props.limitNum ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 1,
- class: "stock"
- },
- "限量: " + vue.toDisplayString($props.attr.productSelect.quota),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- vue.createElementVNode("view", {
- class: "iconfont icon-guanbi",
- onClick: $setup.close
- })
- ]),
- vue.createElementVNode("view", { class: "rollTop" }, [
- vue.createElementVNode("view", { class: "productWinList" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($props.attr.productAttr, (item, indexw) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: "item",
- key: indexw
- }, [
- vue.createElementVNode(
- "view",
- { class: "title" },
- vue.toDisplayString(item.attrName),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "listn acea-row row-middle" }, [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(item.attrValues, (itemn, indexn) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["itemn", item.index === itemn ? "on" : ""]),
- onClick: ($event) => $setup.tapAttr(indexw, indexn),
- key: indexn
- }, vue.toDisplayString(itemn), 11, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createElementVNode("view", { class: "cart acea-row row-between-wrapper" }, [
- vue.createElementVNode("view", { class: "title" }, "数量"),
- vue.createElementVNode("view", { class: "carnum acea-row row-left" }, [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["item reduce", $props.attr.productSelect.cart_num <= 1 ? "on" : ""]),
- onClick: $setup.CartNumDes
- },
- " - ",
- 2
- /* CLASS */
- ),
- vue.createElementVNode("view", { class: "item num" }, [
- vue.withDirectives(vue.createElementVNode(
- "input",
- {
- type: "number",
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.attr.productSelect.cart_num = $event),
- "data-name": "productSelect.cart_num",
- onInput: _cache[1] || (_cache[1] = ($event) => $setup.bindCode($props.attr.productSelect.cart_num))
- },
- null,
- 544
- /* NEED_HYDRATION, NEED_PATCH */
- ), [
- [vue.vModelText, $props.attr.productSelect.cart_num]
- ])
- ]),
- $props.iSplus ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass([
- "item plus",
- $props.attr.productSelect.cart_num >= $props.attr.productSelect.stock ? "on" : ""
- ]),
- onClick: $setup.CartNumAdd
- },
- " + ",
- 2
- /* CLASS */
- )) : (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: vue.normalizeClass([
- "item plus",
- $props.attr.productSelect.cart_num >= $props.attr.productSelect.quota || $props.attr.productSelect.cart_num >= $props.attr.productSelect.stock || $props.attr.productSelect.cart_num >= $props.attr.productSelect.num ? "on" : ""
- ]),
- onClick: $setup.CartNumAdd
- },
- "+",
- 2
- /* CLASS */
- ))
- ])
- ])
- ]),
- vue.createElementVNode("view", { class: "footer-box" }, [
- $props.attr.productSelect.stock > 0 ? (vue.openBlock(), vue.createBlock(_component_up_button, {
- key: 0,
- class: "confirm-btn",
- onClick: $setup.submit,
- type: "primary",
- text: "确定"
- })) : (vue.openBlock(), vue.createBlock(_component_up_button, {
- key: 1,
- class: "confirm-btn",
- onClick: $setup.submit,
- type: "primary",
- text: "已售罄"
- }))
- ])
- ],
- 2
- /* CLASS */
- )
- ]),
- _: 1
- /* STABLE */
- }, 8, ["show"]);
- }
- const productWindow = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-2914200c"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/components/productWindow/index.vue"]]);
- const _sfc_main$1 = {
- __name: "index",
- setup(__props, { expose: __expose }) {
- __expose();
- const {
- Toast: Toast2
- } = useToast();
- const instance = vue.getCurrentInstance();
- const coupon = vue.ref({
- coupon: false,
- type: 1,
- list: [],
- count: []
- });
- const attrTxt = vue.ref("请选择");
- const attrValue = vue.ref("");
- const animated = vue.ref(false);
- const id = vue.ref(0);
- const productInfo = vue.ref({});
- const productValue = vue.ref([]);
- const couponList = vue.ref([]);
- const cart_num = vue.ref(1);
- const isOpen = vue.ref(false);
- const storeImage = vue.ref("");
- const PromotionCode = vue.ref("");
- const posterbackgd = vue.ref("/static/images/posterbackgd.png");
- const sharePacket = vue.ref({
- isState: true
- });
- const clientHeight = vue.ref("");
- const good_list = vue.ref([]);
- const CartCount = vue.ref(0);
- const posters = vue.ref(false);
- const attr = vue.ref({
- cartAttr: false,
- productAttr: [],
- productSelect: {}
- });
- const description = vue.ref("");
- const navActive = vue.ref(0);
- const activityH5 = vue.ref([]);
- const retunTop = vue.ref(true);
- const navH = vue.ref("");
- const opacity = vue.ref(0);
- const scrollY = vue.ref(0);
- const topArr = vue.ref([]);
- const height = vue.ref(0);
- const heightArr = vue.ref([]);
- const lock = vue.ref(false);
- const scrollTop = vue.ref(0);
- const sliderImage = vue.ref([]);
- const canvasStatus = vue.ref(false);
- const imagePath = vue.ref("");
- const imgTop = vue.ref("");
- const errT = vue.ref("");
- const homeTop = vue.ref(20);
- const userCollect = vue.ref(false);
- const returnShow = vue.ref(true);
- const type2 = vue.ref("");
- const showProductPopup = vue.ref(false);
- const showCouponPopup = vue.ref(false);
- const handleBtnTpe = vue.ref("");
- onLoad((options2) => {
- const pages2 = getCurrentPages();
- returnShow.value = pages2.length > 1;
- retunTop.value = pages2.length > 1;
- setTimeout(() => {
- if (options2.spread) {
- spread(options2.spread).catch(() => {
- });
- }
- }, 2e3);
- uni.getSystemInfo({
- success(res) {
- height.value = res.windowHeight;
- }
- });
- if (options2.id || options2.scene) {
- if (options2.scene) {
- const qrCodeValue = $util.getUrlParams(decodeURIComponent(options2.scene));
- const mapeMpQrCodeValue = $util.formatMpQrCodeData(qrCodeValue);
- id.value = mapeMpQrCodeValue.id;
- setTimeout(() => {
- spread(mapeMpQrCodeValue.spread).catch(() => {
- });
- }, 2e3);
- } else {
- id.value = options2.id;
- }
- type2.value = options2.type ?? "normal";
- }
- getGoodsDetails();
- });
- onShow(() => {
- getCartCount();
- });
- onReady(() => {
- });
- const iptCartNum = (e2) => {
- attr.value.productSelect.cart_num = e2 || 1;
- };
- const handleScroll = (e2) => {
- const scrollYVal = e2.detail.scrollTop;
- const opacityVal = scrollYVal / 350 > 1 ? 1 : scrollYVal / 350;
- opacity.value = opacityVal;
- scrollY.value = scrollYVal;
- if (lock.value) {
- lock.value = false;
- return;
- }
- };
- const closeCouponPopup = () => {
- showCouponPopup.value = false;
- };
- const ChangeCartNum = (changeValue) => {
- formatAppLog("log", "at pages/goods_details/index.vue:379", "changeValue", changeValue);
- let productSelect = productValue.value[attrValue.value] || (attr.value.productAttr.length ? void 0 : attr.value.productSelect);
- if (!productSelect)
- return;
- const stock = productSelect.stock || 0;
- let num = attr.value.productSelect;
- num.cart_num = changeValue ? Math.min(num.cart_num + 1, stock) : Math.max(num.cart_num - 1, 1);
- attr.value.productSelect.cart_num = num.cart_num;
- cart_num.value = num.cart_num;
- };
- const attrVal = (val) => {
- attr.value.productAttr[val.indexw].index = attr.value.productAttr[val.indexw].attrValues[val.indexn];
- };
- const ChangeAttr = (res) => {
- const productSelect = productValue.value[res];
- if (productSelect) {
- attr.value.productSelect = {
- ...attr.value.productSelect,
- image: productSelect.image,
- sales: productSelect.sales,
- weight: productSelect.weight,
- price: productSelect.price,
- storePrice: productSelect.storePrice,
- stock: productSelect.stock,
- unique: productSelect.id,
- cart_num: 1
- };
- attrValue.value = res;
- attrTxt.value = "已选择";
- } else {
- attr.value.productSelect = {
- ...attr.value.productSelect,
- image: productInfo.value.image,
- weight: productSelect.weight,
- price: productInfo.value.price,
- storePrice: productSelect.storePrice,
- stock: 0,
- unique: productInfo.value.id,
- cart_num: 1
- };
- attrValue.value = "";
- attrTxt.value = "请选择";
- }
- };
- const ChangCoupons = (coupon2) => {
- couponList.value = couponList.value.filter((item) => item.id !== coupon2.id);
- getCouponList();
- };
- const setClientHeight = () => {
- if (!good_list.value.length)
- return;
- const query = uni.createSelectorQuery().in(instance.proxy);
- query.select("#list0").fields({
- size: true
- }, (data) => {
- clientHeight.value = data.height + 20;
- }).exec();
- };
- const getGoodsDetails = async () => {
- try {
- const res = await getArticleDetailId("34");
- const product = res.data.productInfo;
- sliderImage.value = [product.image];
- formatAppLog("log", "at pages/goods_details/index.vue:453", "sliderImage.value", sliderImage.value);
- productInfo.value = product;
- formatAppLog("log", "at pages/goods_details/index.vue:455", "productInfo.value", productInfo.value);
- description.value = product.content;
- formatAppLog("log", "at pages/goods_details/index.vue:457", "description.value", description.value);
- userCollect.value = res.data.userCollect;
- attr.value.productAttr = res.data.productAttr;
- formatAppLog("log", "at pages/goods_details/index.vue:460", "res.data.productValue", res.data);
- productValue.value = res.data.productValue;
- sharePacket.value.priceName = res.data.priceName;
- sharePacket.value.isState = Math.floor(res.data.priceName) !== 0;
- activityH5.value = res.data.activityAllH5 || [];
- uni.setNavigationBarTitle({
- title: product.storeName.substring(0, 7) + "..."
- });
- attr.value.productAttr = attr.value.productAttr.map((item) => ({
- attrName: item.attrName,
- attrValues: item.attrValues.split(","),
- id: item.id,
- isDel: item.isDel,
- productId: item.productId,
- type: item.type
- }));
- downloadFilestoreImage();
- DefaultSelect();
- } catch (err) {
- Toast2({
- title: err.toString(),
- icon: "none"
- });
- }
- };
- const DefaultSelect = () => {
- let value2 = [];
- formatAppLog("log", "at pages/goods_details/index.vue:523", "productValue.value", vue.toRaw(productValue.value));
- const keys = Object.keys(productValue.value);
- formatAppLog("log", "at pages/goods_details/index.vue:525", "keys", keys);
- for (let i2 = 0; i2 < keys.length; i2++) {
- const key = keys[i2];
- formatAppLog("log", "at pages/goods_details/index.vue:528", "key", key);
- value2 = attr.value.productAttr.length ? key.split(",") : [];
- }
- formatAppLog("log", "at pages/goods_details/index.vue:534", "value", value2);
- attr.value.productAttr.forEach((item, i2) => {
- item.index = value2[i2];
- });
- const productSelect = productValue.value[value2.join(",")];
- formatAppLog("log", "at pages/goods_details/index.vue:539", {
- productSelect
- });
- formatAppLog("log", "at pages/goods_details/index.vue:542", {
- attr
- });
- if (productSelect && attr.value.productAttr.length) {
- attr.value.productSelect = {
- ...attr.value.productSelect,
- storeName: productInfo.value.storeName,
- image: productSelect.image,
- sales: productSelect.sales,
- weight: productSelect.weight,
- price: productSelect.price,
- storePrice: productSelect.storePrice,
- stock: productSelect.stock,
- unique: productSelect.id,
- cart_num: 1
- };
- attrValue.value = value2.join(",");
- attrTxt.value = "已选择";
- } else if (!productSelect && attr.value.productAttr.length) {
- attr.value.productSelect = {
- ...attr.value.productSelect,
- storeName: productInfo.value.storeName,
- image: productInfo.value.image,
- sales: productSelect.sales,
- weight: productSelect.weight,
- price: productInfo.value.price,
- storePrice: productSelect.storePrice,
- stock: 0,
- unique: productInfo.value.id,
- cart_num: 1
- };
- attrValue.value = "";
- attrTxt.value = "请选择";
- } else if (!productSelect && !attr.value.productAttr.length) {
- attr.value.productSelect = {
- ...attr.value.productSelect,
- storeName: productInfo.value.storeName,
- image: productInfo.value.image,
- sales: productSelect.sales,
- weight: productSelect.weight,
- price: productInfo.value.price,
- storePrice: productSelect.storePrice,
- stock: productInfo.value.stock,
- unique: productInfo.value.id || "",
- cart_num: 1
- };
- attrValue.value = "";
- attrTxt.value = "请选择";
- }
- };
- const getCouponList = async (type3 = "") => {
- try {
- const obj = {
- page: 1,
- limit: 20,
- productId: id.value,
- type: type3
- };
- const {
- data
- } = await getCoupons(obj);
- coupon.value.list = data;
- } catch (err) {
- formatAppLog("error", "at pages/goods_details/index.vue:606", "getCouponList", err);
- }
- };
- const tabCouponType = (type3) => {
- coupon.value.type = type3;
- getCouponList(type3);
- };
- const ChangCouponsUseState = (index2) => {
- coupon.value.list[index2].isUse = true;
- coupon.value.coupon = false;
- };
- const selecAttr = () => {
- showProductPopup.value = true;
- handleBtnTpe.value = "buy";
- };
- const handleSubmit = async () => {
- var _a2;
- const productSelect = productValue.value[attrValue.value];
- if (attr.value.productAttr.length && (productSelect == null ? void 0 : productSelect.stock) === 0 && isOpen.value) {
- return Toast2({
- title: "产品库存不足,请选择其它",
- icon: "none"
- });
- }
- if (handleBtnTpe.value === "buy") {
- showProductPopup.value = false;
- getPreOrderFn();
- } else if (handleBtnTpe.value === "cart") {
- try {
- const params2 = {
- productId: parseFloat(id.value),
- cartNum: parseFloat(attr.value.productSelect.cart_num),
- isNew: false,
- productAttrUnique: ((_a2 = attr.value.productSelect) == null ? void 0 : _a2.unique) ?? productInfo.value.id
- };
- Toast2({
- title: "添加购物车成功",
- icon: "success",
- success: () => getCartCount(true)
- });
- showProductPopup.value = false;
- } catch (res) {
- showProductPopup.value = false;
- Toast2({
- title: res.message,
- icon: "none"
- });
- }
- }
- };
- const handleCoupon = () => {
- };
- const onMyEvent = () => {
- attr.value.cartAttr = false;
- isOpen.value = false;
- };
- const closeProductPopup = () => {
- showProductPopup.value = false;
- attr.value.cartAttr = false;
- isOpen.value = false;
- };
- const goBuy = () => {
- };
- const joinCart = (e2) => {
- };
- const toShopCart = () => {
- };
- const getCartCount = async (isAnima = false) => {
- };
- const getPreOrderFn = () => {
- ({
- mallType: 0,
- preOrderType: type2.value === "normal" ? "buyNow" : "video",
- orderDetails: [{
- attrValueId: parseFloat(attr.value.productSelect.unique),
- productId: parseFloat(id.value),
- productNum: parseFloat(attr.value.productSelect.cart_num)
- }]
- });
- };
- const closePosters = () => {
- posters.value = false;
- };
- const posterImageClose = () => {
- canvasStatus.value = false;
- };
- const setDomain = (url2) => {
- url2 = url2 ? url2.toString() : "";
- return url2.includes("https://") ? url2 : url2.replace("http://", "https://");
- };
- const downloadFilestoreImage = async () => {
- try {
- const res = await uni.downloadFile({
- url: setDomain(productInfo.value.image)
- });
- storeImage.value = res.tempFilePath;
- } catch {
- storeImage.value = "";
- }
- };
- const goFriend = () => {
- posters.value = false;
- };
- const getQrcodeFn = async () => {
- };
- const getImageBase64 = async (images) => {
- try {
- const res = await imageBase64({
- url: images
- });
- imgTop.value = res.data.code;
- } catch (err) {
- formatAppLog("error", "at pages/goods_details/index.vue:842", err);
- }
- };
- const goPoster = async () => {
- uni.showLoading({
- title: "海报生成中",
- mask: true
- });
- posters.value = false;
- if (!PromotionCode.value) {
- uni.hideLoading();
- Toast2({
- title: errT.value,
- icon: "none"
- });
- return;
- }
- setTimeout(() => {
- if (!imgTop.value) {
- uni.hideLoading();
- Toast2({
- title: "无法生成商品海报!",
- icon: "none"
- });
- return;
- }
- }, 1e3);
- try {
- const res = await uni.downloadFile({
- url: imgTop.value
- });
- const arrImages = [
- posterbackgd.value,
- res.tempFilePath,
- PromotionCode.value
- ];
- const storeName = productInfo.value.storeName;
- const price = productInfo.value.storePrice;
- setTimeout(() => {
- $util.PosterCanvas(
- arrImages,
- storeName,
- price,
- productInfo.value.otPrice,
- (tempFilePath) => {
- imagePath.value = tempFilePath;
- canvasStatus.value = true;
- uni.hideLoading();
- }
- );
- }, 500);
- } catch {
- uni.hideLoading();
- }
- };
- const ShareInfo = async () => {
- };
- const goBack = () => {
- const pages2 = getCurrentPages();
- if (pages2.length > 1) {
- uni.navigateBack();
- } else {
- uni.switchTab({
- url: "/pages/mall/index"
- });
- }
- };
- const goHome = () => {
- uni.switchTab({
- url: "/pages/index/index"
- });
- };
- function toMessagePage() {
- uni.navigateTo({
- url: "/pages/message_create/message_create"
- });
- }
- const __returned__ = { Toast: Toast2, instance, coupon, attrTxt, attrValue, animated, id, productInfo, productValue, couponList, cart_num, isOpen, storeImage, PromotionCode, posterbackgd, sharePacket, clientHeight, good_list, CartCount, posters, attr, description, navActive, activityH5, retunTop, navH, opacity, scrollY, topArr, height, heightArr, lock, scrollTop, sliderImage, canvasStatus, imagePath, imgTop, errT, homeTop, userCollect, returnShow, type: type2, showProductPopup, showCouponPopup, handleBtnTpe, iptCartNum, handleScroll, closeCouponPopup, ChangeCartNum, attrVal, ChangeAttr, ChangCoupons, setClientHeight, getGoodsDetails, DefaultSelect, getCouponList, tabCouponType, ChangCouponsUseState, selecAttr, handleSubmit, handleCoupon, onMyEvent, closeProductPopup, goBuy, joinCart, toShopCart, getCartCount, getPreOrderFn, closePosters, posterImageClose, setDomain, downloadFilestoreImage, goFriend, getQrcodeFn, getImageBase64, goPoster, ShareInfo, goBack, goHome, toMessagePage, get onReady() {
- return onReady;
- }, get onLoad() {
- return onLoad;
- }, get onShow() {
- return onShow;
- }, ref: vue.ref, computed: vue.computed, watch: vue.watch, getCurrentInstance: vue.getCurrentInstance, toRaw: vue.toRaw, get useToast() {
- return useToast;
- }, get wechat() {
- return wechat;
- }, get productConSwiper() {
- return productConSwiper;
- }, get couponListWindow() {
- return couponListWindow;
- }, get productWindow() {
- return productWindow;
- }, get getArticleDetailId() {
- return getArticleDetailId;
- }, get getGoodDetailId() {
- return getGoodDetailId;
- } };
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
- return __returned__;
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- var _a2;
- const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$g);
- const _component_up_line = vue.resolveComponent("up-line");
- return vue.openBlock(), vue.createElementBlock("view", { class: "product-con" }, [
- vue.createCommentVNode(' <up-navbar\r\n class="goods-nav-bar"\r\n :bgColor="`rgba(255, 255, 255, ${opacity})`"\r\n >\r\n <template #left>\r\n <view class="nav-slot">\r\n <up-icon @click="goBack" name="arrow-left" size="19"></up-icon>\r\n <up-line\r\n direction="column"\r\n :hairline="false"\r\n length="16"\r\n margin="0 8px"\r\n ></up-line>\r\n <up-icon @click="goHome" name="home" size="20"></up-icon>\r\n </view>\r\n </template>\r\n </up-navbar> '),
- vue.createCommentVNode(` <view class='iconfont icon-xiangzuo' :style="'top:'+navH/2+'rpx'" @tap='returns'></view> `),
- vue.createElementVNode("view", null, [
- vue.createElementVNode("scroll-view", {
- "scroll-top": $setup.scrollTop,
- "scroll-y": "true",
- "scroll-with-animation": "true",
- style: vue.normalizeStyle("height:" + $setup.height + "px;"),
- onScroll: $setup.handleScroll
- }, [
- vue.createElementVNode("view", { id: "past0" }, [
- vue.createVNode($setup["productConSwiper"], {
- "indicator-dots": false,
- imgUrls: $setup.sliderImage
- }, null, 8, ["imgUrls"]),
- vue.createCommentVNode(' <image :src="sliderImage" class="goodImg"></image> '),
- vue.createElementVNode("view", { class: "pad30" }, [
- vue.createElementVNode("view", { class: "wrapper mb30 borRadius14" }, [
- vue.createElementVNode(
- "view",
- { class: "introduce" },
- vue.toDisplayString($setup.productInfo.storeName),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "label acea-row row-between-wrapper" }, [
- vue.createElementVNode(
- "view",
- null,
- "工费: " + vue.toDisplayString($setup.attr.productSelect.price || 0) + "元/克",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- null,
- "重量: " + vue.toDisplayString($setup.attr.productSelect.weight) + "克",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- null,
- " 销量:" + vue.toDisplayString(Number(((_a2 = $setup.attr.productSelect) == null ? void 0 : _a2.sales) || 0)) + vue.toDisplayString($setup.productInfo.unitName || ""),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "share acea-row row-between row-bottom" }, [
- vue.createElementVNode("view", { class: "money font-color" }, [
- vue.createTextVNode(" ¥ "),
- vue.createElementVNode(
- "text",
- { class: "num" },
- vue.toDisplayString($setup.attr.productSelect.storePrice),
- 1
- /* TEXT */
- ),
- vue.createCommentVNode(' <text\r\n class="vip-money"\r\n v-if="productInfo.vipPrice && productInfo.vipPrice > 0"\r\n >¥{{ productInfo.vipPrice }}</text\r\n > '),
- vue.createCommentVNode(' <image\r\n v-if="productInfo.vipPrice && productInfo.vipPrice > 0"\r\n src="/static/images/vip.png"\r\n ></image> ')
- ])
- ]),
- vue.createCommentVNode(` <view class='coupon acea-row row-between-wrapper' v-if="productInfo.give_integral > 0">\r
- <view class='hide line1 acea-row'>\r
- 赠积分:\r
- <view class='activity'>赠送 {{productInfo.give_integral}} 积分</view>\r
- </view>\r
- </view> `),
- $setup.coupon.list.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "coupon acea-row row-between-wrapper",
- onClick: $setup.handleCoupon
- }, [
- vue.createElementVNode("view", { class: "hide line1 acea-row" }, [
- vue.createTextVNode(" 优惠券: "),
- vue.createElementVNode(
- "view",
- { class: "activity" },
- " 满" + vue.toDisplayString($setup.coupon.list[0].minPrice) + "减" + vue.toDisplayString($setup.coupon.list[0].money),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "iconfont icon-jiantou" })
- ])) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", {
- class: "attribute acea-row row-between-wrapper mb30 borRadius14",
- onClick: $setup.selecAttr
- }, [
- vue.createElementVNode("view", { class: "line1" }, [
- vue.createTextVNode(
- vue.toDisplayString($setup.attrTxt) + ": ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "atterTxt" },
- vue.toDisplayString($setup.attrValue),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "iconfont icon-jiantou" })
- ]),
- vue.createElementVNode("view", { class: "row-block mb30 borRadius14" }, [
- vue.createElementVNode("view", { class: "row-express" }, [
- vue.createElementVNode("view", { class: "left-box" }, [
- vue.createVNode(_component_uni_icons, {
- class: "icon",
- type: "cart",
- size: "24"
- }),
- vue.createElementVNode("text", { class: "text" }, "48小时送达")
- ]),
- vue.createElementVNode("view", { class: "express-price" }, [
- vue.createElementVNode("text", { class: "express-place" }, "广东深圳"),
- vue.createCommentVNode(' <up-line\r\n color="#ccc"\r\n direction="column"\r\n :hairline="false"\r\n length="14px"\r\n margin="0 8px"\r\n ></up-line> '),
- vue.createCommentVNode(' <text class="express-place">快递费:8元</text> ')
- ])
- ]),
- vue.createVNode(_component_up_line, {
- color: "#ccc",
- length: "100%",
- margin: "10px 0"
- }),
- vue.createElementVNode("view", { class: "tip-text" }, [
- vue.createVNode(_component_uni_icons, {
- size: "24",
- type: "hand-up"
- }),
- vue.createElementVNode("view", { class: "text" }, [
- vue.createElementVNode("text", { class: "t1" }, "买的放心,用的称心"),
- vue.createElementVNode("text", { class: "t2" }, "平台有保障")
- ])
- ])
- ])
- ])
- ])
- ], 44, ["scroll-top"])
- ]),
- vue.createElementVNode("view", { class: "footer acea-row row-between-wrapper" }, [
- vue.createElementVNode("view", { class: "toAPP" }, [
- vue.createElementVNode("button", {
- type: "default",
- class: "storeAPP"
- }, "打开水贝商城")
- ]),
- vue.createElementVNode("navigator", {
- "open-type": "switchTab",
- class: "animated item bounceIn",
- "hover-class": "none"
- }, [
- vue.createVNode(_component_uni_icons, {
- size: "22",
- color: "#666",
- customPrefix: "iconfont",
- type: "icon-shouye"
- }),
- vue.createElementVNode("view", null, "首页")
- ]),
- vue.createElementVNode("button", {
- onClick: $setup.toMessagePage,
- "open-type": "contact",
- "hover-class": "none",
- class: "item"
- }, [
- vue.createVNode(_component_uni_icons, {
- size: "22",
- color: "#666",
- customPrefix: "iconfont",
- type: "icon-kefu1"
- }),
- vue.createElementVNode("view", null, "客服")
- ]),
- vue.createElementVNode("view", {
- class: "animated item bounceIn",
- "hover-class": "none",
- onClick: $setup.toShopCart
- }, [
- vue.createVNode(_component_uni_icons, {
- size: "22",
- color: "#666",
- customPrefix: "iconfont",
- type: "icon-gouwuche",
- class: "icon-item"
- }),
- vue.createCommentVNode(' <view class="iconfont icon-gouwuche1">\r\n <text v-if="Math.floor(CartCount) > 0" class="num bg-color">{{\r\n CartCount\r\n }}</text>\r\n </view> '),
- vue.createElementVNode("view", null, "购物车")
- ]),
- vue.createElementVNode("view", { class: "bnt acea-row" }, [
- vue.createElementVNode("form", { "report-submit": "true" }, [
- vue.createElementVNode("button", {
- class: "joinCart bnts",
- "form-type": "submit"
- }, "加入购物车")
- ]),
- vue.createElementVNode("form", { "report-submit": "true" }, [
- vue.createElementVNode("button", {
- class: "buy bnts",
- "form-type": "submit"
- }, "立即购买")
- ])
- ]),
- vue.createCommentVNode(` <view\r
- class="bnt bntVideo acea-row"\r
- v-if="attr.productSelect.stock <= 0 && type === 'video'"\r
- >\r
- <form report-submit="true">\r
- <button class="buy bnts bg-color-hui" form-type="submit">\r
- 已售罄\r
- </button>\r
- </form>\r
- </view>\r
- <view\r
- class="bnt bntVideo acea-row"\r
- v-if="attr.productSelect.stock > 0 && type === 'video'"\r
- >\r
- <form @submit="goBuy" report-submit="true">\r
- <button class="buy bnts" form-type="submit">立即购买</button>\r
- </form>\r
- </view> `)
- ]),
- vue.createCommentVNode(" 组件 "),
- vue.createVNode($setup["productWindow"], {
- attr: $setup.attr,
- isShow: 1,
- iSplus: 1,
- showPopup: $setup.showProductPopup,
- id: "product-window"
- }, null, 8, ["attr", "showPopup"]),
- vue.createVNode($setup["couponListWindow"], {
- coupon: $setup.coupon,
- showPopup: $setup.showCouponPopup
- }, null, 8, ["coupon", "showPopup"])
- ]);
- }
- const PagesGoodsDetailsIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-c5c6bbf1"], ["__file", "C:/Users/EDY/Desktop/项目/shuibei/pages/goods_details/index.vue"]]);
- __definePage("pages/index/index", PagesIndexIndex);
- __definePage("pages/article_details/index", PagesArticleDetailsIndex);
- __definePage("pages/goods_details/index", PagesGoodsDetailsIndex);
- const _sfc_main = {
- onLaunch: function() {
- formatAppLog("log", "at App.vue:4", "App Launch");
- },
- onShow: function() {
- formatAppLog("log", "at App.vue:7", "App Show");
- },
- onHide: function() {
- formatAppLog("log", "at App.vue:10", "App Hide");
- }
- };
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "C:/Users/EDY/Desktop/项目/shuibei/App.vue"]]);
- function createApp() {
- const app = vue.createVueApp(App);
- app.use(uviewPlus, () => {
- return {
- options: {
- // 修改$u.config对象的属性
- config: {
- // 修改默认单位为rpx,相当于执行 uni.$u.config.unit = 'rpx'
- unit: "rpx"
- // customIcon: {
- // family: 'iconfont',
- // url: '//at.alicdn.com/t/c/font_4946742_e8oa3t01rkk.css'
- // }
- }
- }
- };
- });
- return {
- app
- };
- }
- 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);
|