| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535 |
- 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) {
- var _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R;
- "use strict";
- 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 baseUrl = "https://app.chienxutech.com:30443";
- function dorequest(method2, url2, data, header = {}) {
- return uni.request({
- method: method2,
- url: url2,
- data
- });
- }
- function addlog(data, e, callback = null) {
- let url2 = baseUrl + "/index.php/index/Logmanger/addlog";
- dorequest("post", url2, data).then((res) => {
- if (callback) {
- callback(res);
- } else {
- res = res.data;
- if (0 == res.code) {
- e.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- }
- }
- });
- }
- function islogin() {
- let userinfo = uni.getStorageSync("userinfo");
- if (!userinfo) {
- return false;
- }
- return true;
- }
- function saveuserinfo(info) {
- uni.setStorage({
- key: "userinfo",
- data: info,
- success: function() {
- },
- fail: function(error2) {
- formatAppLog("log", "at common/js/common.js:42", "error");
- addlog({
- json: "用户信息保存失败",
- type: "uniapp错误"
- });
- }
- });
- }
- function tostemlistnext(startindex, next = 0, scaleid_1 = false, srid_1 = false) {
- startindex = parseInt(startindex) + next;
- let stemlist = uni.getStorageSync("stemlist");
- if (!stemlist) {
- return false;
- }
- let item = stemlist[startindex];
- if (!item) {
- return false;
- }
- uni.setStorage({
- key: "stemitem",
- data: item
- });
- if (item == void 0) {
- return false;
- }
- if (scaleid_1 !== false && srid_1 !== false) {
- if (item.stemtype < 101) {
- uni.navigateTo({
- url: "/pages/topic/common?scaleid=" + scaleid_1 + "&srid=" + srid_1 + `&sindex=` + startindex
- });
- } else {
- let url2 = "/pages/topic/" + item.stemdefinepage + "?scaleid=" + scaleid_1 + "&srid=" + srid_1 + `&sindex=` + startindex;
- uni.navigateTo({
- url: url2
- });
- }
- } else {
- let scaleid = 4;
- let srid = uni.getStorageSync("srid");
- if (item.stemtype < 101) {
- uni.navigateTo({
- url: "/pages/topic/common?scaleid=" + scaleid + "&srid=" + srid + `&sindex=` + startindex
- });
- } else {
- let url2 = "/pages/topic/" + item.stemdefinepage + "?scaleid=" + scaleid + "&srid=" + srid + `&sindex=` + startindex;
- uni.navigateTo({
- url: url2
- });
- }
- }
- return true;
- }
- function tohome() {
- uni.redirectTo({
- url: "/pages/index/index"
- });
- }
- const _export_sfc = (sfc, props2) => {
- const target = sfc.__vccOpts || sfc;
- for (const [key, val] of props2) {
- target[key] = val;
- }
- return target;
- };
- if (islogin()) {
- uni.redirectTo({
- url: "/pages/index/index"
- });
- } else {
- uni.redirectTo({
- url: "/pages/login/login"
- });
- }
- const _sfc_main$D = {};
- function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
- return null;
- }
- const PagesIndexShow = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$C], ["__file", "D:/workspace/uniapp/health2/pages/index/show.vue"]]);
- const mpMixin = {};
- 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([3589]\d|4[5-9]|6[1-2,4-7]|7[0-8])\d{8}$/.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$1(value2) {
- if (!value2)
- return false;
- if (number$2(value2))
- value2 = +value2;
- return !/Invalid|NaN/.test(new Date(value2).toString());
- }
- function dateISO(value2) {
- return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value2);
- }
- function number$2(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 i 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 (e) {
- return false;
- }
- }
- return false;
- }
- function array$1(value2) {
- if (typeof Array.isArray === "function") {
- return Array.isArray(value2);
- }
- return Object.prototype.toString.call(value2) === "[object Array]";
- }
- function object$1(value2) {
- return Object.prototype.toString.call(value2) === "[object Object]";
- }
- function code(value2, len = 6) {
- return new RegExp(`^\\d{${len}}$`).test(value2);
- }
- function func(value2) {
- return typeof value2 === "function";
- }
- function promise(value2) {
- return object$1(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(o) {
- return o && Object.prototype.toString.call(o) === "[object RegExp]";
- }
- const test = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- amount,
- array: array$1,
- carNo,
- chinese,
- code,
- contains,
- date: date$1,
- dateISO,
- digits,
- email,
- empty,
- enOrNum,
- func,
- idCard,
- image,
- jsonString,
- landline,
- letter,
- mobile,
- number: number$2,
- object: object$1,
- promise,
- range: range$2,
- rangeLength,
- regExp,
- string: string$1,
- url,
- video
- }, Symbol.toStringTag, { value: "Module" }));
- 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/uv-ui-tools/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(...nums) {
- if (nums.length > 2) {
- return iteratorOperation(nums, times);
- }
- const [num1, num2] = nums;
- const num1Changed = float2Fixed(num1);
- const num2Changed = float2Fixed(num2);
- const baseNum = digitLength(num1) + digitLength(num2);
- const leftValue = num1Changed * num2Changed;
- checkBoundary(leftValue);
- return leftValue / Math.pow(10, baseNum);
- }
- function divide(...nums) {
- if (nums.length > 2) {
- return iteratorOperation(nums, divide);
- }
- const [num1, num2] = nums;
- const num1Changed = float2Fixed(num1);
- const num2Changed = float2Fixed(num2);
- checkBoundary(num1Changed);
- checkBoundary(num2Changed);
- return times(num1Changed / num2Changed, strip(Math.pow(10, digitLength(num2) - digitLength(num1))));
- }
- function round(num, ratio2) {
- const base = Math.pow(10, ratio2);
- let result = divide(Math.round(Math.abs(times(num, base))), base);
- if (num < 0 && result !== 0) {
- result = times(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$2(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.getSystemInfoSync().platform.toLowerCase();
- }
- function sys() {
- return uni.getSystemInfoSync();
- }
- function random(min, max) {
- if (min >= 0 && max > 0 && max >= min) {
- const gab = max - min + 1;
- return Math.floor(Math.random() * gab + min);
- }
- return 0;
- }
- function guid(len = 32, firstU = true, radix = null) {
- const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
- const uuid = [];
- radix = radix || chars.length;
- if (len) {
- for (let i = 0; i < len; i++)
- uuid[i] = chars[0 | Math.random() * radix];
- } else {
- let r;
- uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
- uuid[14] = "4";
- for (let i = 0; i < 36; i++) {
- if (!uuid[i]) {
- r = 0 | Math.random() * 16;
- uuid[i] = chars[i == 19 ? r & 3 | 8 : r];
- }
- }
- }
- if (firstU) {
- uuid.shift();
- return `u${uuid.join("")}`;
- }
- return uuid.join("");
- }
- function $parent(name = void 0) {
- let parent = this.$parent;
- while (parent) {
- if (parent.$options && parent.$options.name !== name) {
- 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 i = 0; i < styleArray.length; i++) {
- if (styleArray[i]) {
- const item = styleArray[i].split(":");
- style[trim(item[0])] = trim(item[1]);
- }
- }
- return style;
- }
- let string2 = "";
- for (const i in customStyle) {
- const key = i.replace(/([A-Z])/g, "-$1").toLowerCase();
- string2 += `${key}:${customStyle[i]};`;
- }
- return trim(string2);
- }
- function addUnit(value2 = "auto", unit = ((_b) => (_b = ((_a) => (_a = uni == null ? void 0 : uni.$uv) == null ? void 0 : _a.config)()) == null ? void 0 : _b.unit)() ? ((_d) => (_d = ((_c) => (_c = uni == null ? void 0 : uni.$uv) == null ? void 0 : _c.config)()) == null ? void 0 : _d.unit)() : "px") {
- value2 = String(value2);
- return number$2(value2) ? `${value2}${unit}` : value2;
- }
- function deepClone(obj, cache2 = /* @__PURE__ */ new WeakMap()) {
- if (obj === null || typeof obj !== "object")
- return obj;
- if (cache2.has(obj))
- return cache2.get(obj);
- let clone;
- if (obj instanceof Date) {
- clone = new Date(obj.getTime());
- } else if (obj instanceof RegExp) {
- clone = new RegExp(obj);
- } else if (obj instanceof Map) {
- clone = new Map(Array.from(obj, ([key, value2]) => [key, deepClone(value2, cache2)]));
- } else if (obj instanceof Set) {
- clone = new Set(Array.from(obj, (value2) => deepClone(value2, cache2)));
- } else if (Array.isArray(obj)) {
- clone = obj.map((value2) => deepClone(value2, cache2));
- } else if (Object.prototype.toString.call(obj) === "[object Object]") {
- clone = Object.create(Object.getPrototypeOf(obj));
- cache2.set(obj, clone);
- for (const [key, value2] of Object.entries(obj)) {
- clone[key] = deepClone(value2, cache2);
- }
- } else {
- clone = Object.assign({}, obj);
- }
- cache2.set(obj, clone);
- return clone;
- }
- function deepMerge$1(target = {}, source = {}) {
- target = deepClone(target);
- if (typeof target !== "object" || target === null || typeof source !== "object" || source === null)
- return target;
- const merged = Array.isArray(target) ? target.slice() : Object.assign({}, target);
- for (const prop in source) {
- if (!source.hasOwnProperty(prop))
- continue;
- const sourceValue = source[prop];
- const targetValue = merged[prop];
- if (sourceValue instanceof Date) {
- merged[prop] = new Date(sourceValue);
- } else if (sourceValue instanceof RegExp) {
- merged[prop] = new RegExp(sourceValue);
- } else if (sourceValue instanceof Map) {
- merged[prop] = new Map(sourceValue);
- } else if (sourceValue instanceof Set) {
- merged[prop] = new Set(sourceValue);
- } else if (typeof sourceValue === "object" && sourceValue !== null) {
- merged[prop] = deepMerge$1(targetValue, sourceValue);
- } else {
- merged[prop] = sourceValue;
- }
- }
- return merged;
- }
- function error(err) {
- {
- formatAppLog("error", "at uni_modules/uv-ui-tools/libs/function/index.js:250", `uvui提示:${err}`);
- }
- }
- function randomArray(array2 = []) {
- return array2.sort(() => Math.random() - 0.5);
- }
- if (!String.prototype.padStart) {
- String.prototype.padStart = function(maxLength, fillString = " ") {
- if (Object.prototype.toString.call(fillString) !== "[object String]") {
- throw new TypeError(
- "fillString must be String"
- );
- }
- const str = this;
- if (str.length >= maxLength)
- return String(str);
- const fillLength = maxLength - str.length;
- let times2 = Math.ceil(fillLength / fillString.length);
- while (times2 >>= 1) {
- fillString += fillString;
- if (times2 === 1) {
- fillString += fillString;
- }
- }
- return fillString.slice(0, fillLength) + str;
- };
- }
- function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd") {
- let date2;
- if (!dateTime) {
- date2 = /* @__PURE__ */ new Date();
- } else if (/^\d{10}$/.test(dateTime == null ? void 0 : dateTime.toString().trim())) {
- date2 = new Date(dateTime * 1e3);
- } else if (typeof dateTime === "string" && /^\d+$/.test(dateTime.trim())) {
- date2 = new Date(Number(dateTime));
- } else if (typeof dateTime === "string" && dateTime.includes("-") && !dateTime.includes("T")) {
- date2 = new Date(dateTime.replace(/-/g, "/"));
- } else {
- date2 = new Date(dateTime);
- }
- const timeSource = {
- "y": date2.getFullYear().toString(),
- // 年
- "m": (date2.getMonth() + 1).toString().padStart(2, "0"),
- // 月
- "d": date2.getDate().toString().padStart(2, "0"),
- // 日
- "h": date2.getHours().toString().padStart(2, "0"),
- // 时
- "M": date2.getMinutes().toString().padStart(2, "0"),
- // 分
- "s": date2.getSeconds().toString().padStart(2, "0")
- // 秒
- // 有其他格式化字符需求可以继续添加,必须转化成字符串
- };
- for (const key in timeSource) {
- const [ret] = new RegExp(`${key}+`).exec(formatStr) || [];
- if (ret) {
- const beginIndex = key === "y" && ret.length === 2 ? 2 : 0;
- formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex));
- }
- }
- return formatStr;
- }
- function timeFrom(timestamp = null, format2 = "yyyy-mm-dd") {
- if (timestamp == null)
- timestamp = Number(/* @__PURE__ */ new Date());
- timestamp = parseInt(timestamp);
- if (timestamp.toString().length == 10)
- timestamp *= 1e3;
- let 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 i = 0; i < value2.length; i++) {
- _result.push(`${key}[${i}]=${value2[i]}`);
- }
- 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(number2, decimals = 0, decimalPoint = ".", thousandsSeparator = ",") {
- number2 = `${number2}`.replace(/[^0-9+-Ee.]/g, "");
- const n2 = !isFinite(+number2) ? 0 : +number2;
- const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
- const sep = typeof thousandsSeparator === "undefined" ? "," : thousandsSeparator;
- const dec = typeof decimalPoint === "undefined" ? "." : decimalPoint;
- let s = "";
- s = (prec ? round(n2, prec) + "" : `${Math.round(n2)}`).split(".");
- const re = /(-?\d+)(\d{3})/;
- while (re.test(s[0])) {
- s[0] = s[0].replace(re, `$1${sep}$2`);
- }
- if ((s[1] || "").length < prec) {
- s[1] = s[1] || "";
- s[1] += new Array(prec - s[1].length + 1).join("0");
- }
- return s.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(value2) {
- return `00${value2}`.slice(-2);
- }
- function formValidate(instance, event) {
- const formItem = $parent.call(instance, "uv-form-item");
- const form = $parent.call(instance, "uv-form");
- if (formItem && form) {
- form.validateField(formItem.prop, () => {
- }, event);
- }
- }
- function getProperty(obj, key) {
- if (!obj) {
- return;
- }
- if (typeof key !== "string" || key === "") {
- return "";
- }
- if (key.indexOf(".") !== -1) {
- const keys = key.split(".");
- let firstObj = obj[keys[0]] || {};
- for (let i = 1; i < keys.length; i++) {
- if (firstObj) {
- firstObj = firstObj[keys[i]];
- }
- }
- return firstObj;
- }
- return obj[key];
- }
- function setProperty(obj, key, value2) {
- if (!obj) {
- return;
- }
- const inFn = function(_obj, keys, v) {
- if (keys.length === 1) {
- _obj[keys[0]] = v;
- return;
- }
- while (keys.length > 1) {
- const k = keys[0];
- if (!_obj[k] || typeof _obj[k] !== "object") {
- _obj[k] = {};
- }
- keys.shift();
- inFn(_obj[k], keys, v);
- }
- };
- if (typeof key !== "string" || key === "")
- ;
- else if (key.indexOf(".") !== -1) {
- const keys = key.split(".");
- inFn(obj, keys, value2);
- } else {
- obj[key] = value2;
- }
- }
- function page() {
- var _a;
- const pages2 = getCurrentPages();
- const route2 = (_a = pages2[pages2.length - 1]) == null ? void 0 : _a.route;
- return `/${route2 ? route2 : ""}`;
- }
- function pages() {
- const pages2 = getCurrentPages();
- return pages2;
- }
- function getHistoryPage(back = 0) {
- const pages2 = getCurrentPages();
- const len = pages2.length;
- return pages2[len - 1 + back];
- }
- function setConfig({
- props: props2 = {},
- config: config2 = {},
- color = {},
- zIndex = {}
- }) {
- const {
- deepMerge: deepMerge2
- } = uni.$uv;
- uni.$uv.config = deepMerge2(uni.$uv.config, config2);
- uni.$uv.props = deepMerge2(uni.$uv.props, props2);
- uni.$uv.color = deepMerge2(uni.$uv.color, color);
- uni.$uv.zIndex = deepMerge2(uni.$uv.zIndex, zIndex);
- }
- const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- $parent,
- addStyle,
- addUnit,
- deepClone,
- deepMerge: deepMerge$1,
- error,
- formValidate,
- getDuration,
- getHistoryPage,
- getProperty,
- getPx,
- guid,
- os,
- padZero,
- page,
- pages,
- priceFormat,
- queryParams,
- random,
- randomArray,
- range: range$1,
- setConfig,
- setProperty,
- sleep,
- sys,
- timeFormat,
- timeFrom,
- toast,
- trim,
- type2icon
- }, Symbol.toStringTag, { value: "Module" }));
- class Router {
- constructor() {
- this.config = {
- type: "navigateTo",
- url: "",
- delta: 1,
- // navigateBack页面后退时,回退的层数
- params: {},
- // 传递的参数
- animationType: "pop-in",
- // 窗口动画,只在APP有效
- animationDuration: 300,
- // 窗口动画持续时间,单位毫秒,只在APP有效
- intercept: false,
- // 是否需要拦截
- events: {}
- // 页面间通信接口,用于监听被打开页面发送到当前页面的数据。hbuilderx 2.8.9+ 开始支持。
- };
- this.route = this.route.bind(this);
- }
- // 判断url前面是否有"/",如果没有则加上,否则无法跳转
- addRootPath(url2) {
- return url2[0] === "/" ? url2 : `/${url2}`;
- }
- // 整合路由参数
- mixinParam(url2, params) {
- url2 = url2 && this.addRootPath(url2);
- let query = "";
- if (/.*\/.*\?.*=.*/.test(url2)) {
- query = queryParams(params, false);
- return url2 += `&${query}`;
- }
- query = queryParams(params);
- return url2 += query;
- }
- // 对外的方法名称
- async route(options = {}, params = {}) {
- let mergeConfig = {};
- if (typeof options === "string") {
- mergeConfig.url = this.mixinParam(options, params);
- mergeConfig.type = "navigateTo";
- } else {
- mergeConfig = deepMerge$1(this.config, options);
- mergeConfig.url = this.mixinParam(options.url, options.params);
- }
- if (mergeConfig.url === page())
- return;
- if (params.intercept) {
- mergeConfig.intercept = params.intercept;
- }
- mergeConfig.params = params;
- mergeConfig = deepMerge$1(this.config, mergeConfig);
- if (typeof mergeConfig.intercept === "function") {
- const isNext = await new Promise((resolve, reject) => {
- mergeConfig.intercept(mergeConfig, resolve);
- });
- isNext && this.openPage(mergeConfig);
- } else {
- this.openPage(mergeConfig);
- }
- }
- // 执行路由跳转
- openPage(config2) {
- const {
- url: url2,
- type: type2,
- delta,
- animationType,
- animationDuration,
- events
- } = config2;
- if (config2.type == "navigateTo" || config2.type == "to") {
- uni.navigateTo({
- url: url2,
- animationType,
- animationDuration,
- events
- });
- }
- 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;
- let timeout = null;
- function debounce(func2, wait = 500, immediate = false) {
- if (timeout !== null)
- clearTimeout(timeout);
- if (immediate) {
- const callNow = !timeout;
- timeout = setTimeout(() => {
- timeout = null;
- }, wait);
- if (callNow)
- typeof func2 === "function" && func2();
- } else {
- timeout = setTimeout(() => {
- typeof func2 === "function" && func2();
- }, wait);
- }
- }
- let flag;
- function throttle(func2, wait = 500, immediate = true) {
- if (immediate) {
- if (!flag) {
- flag = true;
- typeof func2 === "function" && func2();
- setTimeout(() => {
- flag = false;
- }, wait);
- }
- } else if (!flag) {
- flag = true;
- setTimeout(() => {
- flag = false;
- typeof func2 === "function" && func2();
- }, wait);
- }
- }
- const mixin = {
- // 定义每个组件都可能需要用到的外部样式以及类名
- props: {
- // 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
- customStyle: {
- type: [Object, String],
- default: () => ({})
- },
- customClass: {
- type: String,
- default: ""
- },
- // 跳转的页面路径
- url: {
- type: String,
- default: ""
- },
- // 页面跳转的类型
- linkType: {
- type: String,
- default: "navigateTo"
- }
- },
- data() {
- return {};
- },
- onLoad() {
- this.$uv.getRect = this.$uvGetRect;
- },
- created() {
- this.$uv.getRect = this.$uvGetRect;
- },
- computed: {
- $uv() {
- var _a, _b;
- return {
- ...index,
- test,
- route,
- debounce,
- throttle,
- unit: (_b = (_a = uni == null ? void 0 : uni.$uv) == null ? void 0 : _a.config) == null ? void 0 : _b.unit
- };
- },
- /**
- * 生成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(name, fixed, change) {
- const prefix = `uv-${name}--`;
- 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) {
- uni[this.linkType]({
- url: url2
- });
- }
- },
- // 查询节点信息
- // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
- // 解决办法为在组件根部再套一个没有任何作用的view元素
- $uvGetRect(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 = this.$uv.$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(e) {
- e && typeof e.stopPropagation === "function" && e.stopPropagation();
- },
- // 空操作
- noop(e) {
- this.preventEvent(e);
- }
- },
- onReachBottom() {
- uni.$emit("uvOnReachBottom");
- },
- beforeDestroy() {
- if (this.parent && array$1(this.parent.children)) {
- const childrenList = this.parent.children;
- childrenList.map((child, index2) => {
- if (child === this) {
- childrenList.splice(index2, 1);
- }
- });
- }
- },
- // 兼容vue3
- unmounted() {
- if (this.parent && array$1(this.parent.children)) {
- const childrenList = this.parent.children;
- childrenList.map((child, index2) => {
- if (child === this) {
- childrenList.splice(index2, 1);
- }
- });
- }
- }
- };
- class MPAnimation {
- constructor(options, _this) {
- this.options = options;
- this.animation = uni.createAnimation({
- ...options
- });
- this.currentStepAnimates = {};
- this.next = 0;
- this.$ = _this;
- }
- _nvuePushAnimates(type2, args) {
- let aniObj = this.currentStepAnimates[this.next];
- let styles = {};
- if (!aniObj) {
- styles = {
- styles: {},
- config: {}
- };
- } else {
- styles = aniObj;
- }
- if (animateTypes1.includes(type2)) {
- if (!styles.styles.transform) {
- styles.styles.transform = "";
- }
- let unit = "";
- if (type2 === "rotate") {
- unit = "deg";
- }
- styles.styles.transform += `${type2}(${args + unit}) `;
- } else {
- styles.styles[type2] = `${args}`;
- }
- this.currentStepAnimates[this.next] = styles;
- }
- _animateRun(styles = {}, config2 = {}) {
- let ref = this.$.$refs["ani"].ref;
- if (!ref)
- return;
- return new Promise((resolve, reject) => {
- nvueAnimation.transition(ref, {
- styles,
- ...config2
- }, (res) => {
- resolve();
- });
- });
- }
- _nvueNextAnimate(animates, step = 0, fn) {
- let obj = animates[step];
- if (obj) {
- let {
- styles,
- config: config2
- } = obj;
- this._animateRun(styles, config2).then(() => {
- step += 1;
- this._nvueNextAnimate(animates, step, fn);
- });
- } else {
- this.currentStepAnimates = {};
- typeof fn === "function" && fn();
- this.isEnd = true;
- }
- }
- step(config2 = {}) {
- this.animation.step(config2);
- return this;
- }
- run(fn) {
- this.$.animationData = this.animation.export();
- this.$.timer = setTimeout(() => {
- typeof fn === "function" && fn();
- }, this.$.durationTime);
- }
- }
- const animateTypes1 = [
- "matrix",
- "matrix3d",
- "rotate",
- "rotate3d",
- "rotateX",
- "rotateY",
- "rotateZ",
- "scale",
- "scale3d",
- "scaleX",
- "scaleY",
- "scaleZ",
- "skew",
- "skewX",
- "skewY",
- "translate",
- "translate3d",
- "translateX",
- "translateY",
- "translateZ"
- ];
- const animateTypes2 = ["opacity", "backgroundColor"];
- const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
- animateTypes1.concat(animateTypes2, animateTypes3).forEach((type2) => {
- MPAnimation.prototype[type2] = function(...args) {
- this.animation[type2](...args);
- return this;
- };
- });
- function createAnimation(option, _this) {
- if (!_this)
- return;
- clearTimeout(_this.timer);
- return new MPAnimation(option, _this);
- }
- const _sfc_main$C = {
- name: "uv-transition",
- mixins: [mpMixin, mixin],
- emits: ["click", "change"],
- props: {
- // 是否展示组件
- show: {
- type: Boolean,
- default: false
- },
- // 使用的动画模式
- mode: {
- type: [Array, String, null],
- default() {
- return "fade";
- }
- },
- // 动画的执行时间,单位ms
- duration: {
- type: [String, Number],
- default: 300
- },
- // 使用的动画过渡函数
- timingFunction: {
- type: String,
- default: "ease-out"
- },
- customClass: {
- type: String,
- default: ""
- },
- // nvue模式下 是否直接显示,在uv-list等cell下面使用就需要设置
- cellChild: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- isShow: false,
- transform: "",
- opacity: 1,
- animationData: {},
- durationTime: 300,
- config: {}
- };
- },
- watch: {
- show: {
- handler(newVal) {
- if (newVal) {
- this.open();
- } else {
- if (this.isShow) {
- this.close();
- }
- }
- },
- immediate: true
- }
- },
- computed: {
- // 初始化动画条件
- transformStyles() {
- const style = {
- transform: this.transform,
- opacity: this.opacity,
- ...this.$uv.addStyle(this.customStyle),
- "transition-duration": `${this.duration / 1e3}s`
- };
- return this.$uv.addStyle(style, "string");
- }
- },
- created() {
- this.config = {
- duration: this.duration,
- timingFunction: this.timingFunction,
- transformOrigin: "50% 50%",
- delay: 0
- };
- this.durationTime = this.duration;
- },
- methods: {
- /**
- * ref 触发 初始化动画
- */
- init(obj = {}) {
- if (obj.duration) {
- this.durationTime = obj.duration;
- }
- this.animation = createAnimation(Object.assign(this.config, obj), this);
- },
- /**
- * 点击组件触发回调
- */
- onClick() {
- this.$emit("click", {
- detail: this.isShow
- });
- },
- /**
- * ref 触发 动画分组
- * @param {Object} obj
- */
- step(obj, config2 = {}) {
- if (!this.animation)
- return;
- for (let i in obj) {
- try {
- if (typeof obj[i] === "object") {
- this.animation[i](...obj[i]);
- } else {
- this.animation[i](obj[i]);
- }
- } catch (e) {
- formatAppLog("error", "at uni_modules/uv-transition/components/uv-transition/uv-transition.vue:166", `方法 ${i} 不存在`);
- }
- }
- this.animation.step(config2);
- return this;
- },
- /**
- * ref 触发 执行动画
- */
- run(fn) {
- if (!this.animation)
- return;
- this.animation.run(fn);
- },
- // 开始过度动画
- open() {
- clearTimeout(this.timer);
- this.transform = "";
- this.isShow = true;
- let { opacity, transform } = this.styleInit(false);
- if (typeof opacity !== "undefined") {
- this.opacity = opacity;
- }
- this.transform = transform;
- this.$nextTick(() => {
- this.timer = setTimeout(() => {
- this.animation = createAnimation(this.config, this);
- this.tranfromInit(false).step();
- this.animation.run();
- this.$emit("change", {
- detail: this.isShow
- });
- }, 20);
- });
- },
- // 关闭过渡动画
- close(type2) {
- if (!this.animation)
- return;
- this.tranfromInit(true).step().run(() => {
- this.isShow = false;
- this.animationData = null;
- this.animation = null;
- let { opacity, transform } = this.styleInit(false);
- this.opacity = opacity || 1;
- this.transform = transform;
- this.$emit("change", {
- detail: this.isShow
- });
- });
- },
- // 处理动画开始前的默认样式
- styleInit(type2) {
- let styles = {
- transform: ""
- };
- let buildStyle = (type3, mode) => {
- if (mode === "fade") {
- styles.opacity = this.animationType(type3)[mode];
- } else {
- styles.transform += this.animationType(type3)[mode] + " ";
- }
- };
- if (typeof this.mode === "string") {
- buildStyle(type2, this.mode);
- } else {
- this.mode.forEach((mode) => {
- buildStyle(type2, mode);
- });
- }
- return styles;
- },
- // 处理内置组合动画
- tranfromInit(type2) {
- let buildTranfrom = (type3, mode) => {
- let aniNum = null;
- if (mode === "fade") {
- aniNum = type3 ? 0 : 1;
- } else {
- aniNum = type3 ? "-100%" : "0";
- if (mode === "zoom-in") {
- aniNum = type3 ? 0.8 : 1;
- }
- if (mode === "zoom-out") {
- aniNum = type3 ? 1.2 : 1;
- }
- if (mode === "slide-right") {
- aniNum = type3 ? "100%" : "0";
- }
- if (mode === "slide-bottom") {
- aniNum = type3 ? "100%" : "0";
- }
- }
- this.animation[this.animationMode()[mode]](aniNum);
- };
- if (typeof this.mode === "string") {
- buildTranfrom(type2, this.mode);
- } else {
- this.mode.forEach((mode) => {
- buildTranfrom(type2, mode);
- });
- }
- return this.animation;
- },
- animationType(type2) {
- return {
- fade: type2 ? 1 : 0,
- "slide-top": `translateY(${type2 ? "0" : "-100%"})`,
- "slide-right": `translateX(${type2 ? "0" : "100%"})`,
- "slide-bottom": `translateY(${type2 ? "0" : "100%"})`,
- "slide-left": `translateX(${type2 ? "0" : "-100%"})`,
- "zoom-in": `scaleX(${type2 ? 1 : 0.8}) scaleY(${type2 ? 1 : 0.8})`,
- "zoom-out": `scaleX(${type2 ? 1 : 1.2}) scaleY(${type2 ? 1 : 1.2})`
- };
- },
- // 内置动画类型与实际动画对应字典
- animationMode() {
- return {
- fade: "opacity",
- "slide-top": "translateY",
- "slide-right": "translateX",
- "slide-bottom": "translateY",
- "slide-left": "translateX",
- "zoom-in": "scale",
- "zoom-out": "scale"
- };
- },
- // 驼峰转中横线
- toLine(name) {
- return name.replace(/([A-Z])/g, "-$1").toLowerCase();
- }
- }
- };
- function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
- return $data.isShow ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- ref: "ani",
- animation: $data.animationData,
- class: vue.normalizeClass($props.customClass),
- style: vue.normalizeStyle($options.transformStyles),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
- }, [
- vue.renderSlot(_ctx.$slots, "default")
- ], 14, ["animation"])) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_4$1 = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$B], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-transition/components/uv-transition/uv-transition.vue"]]);
- const props$i = {
- props: {
- // 是否显示遮罩
- show: {
- type: Boolean,
- default: false
- },
- // 层级z-index
- zIndex: {
- type: [String, Number],
- default: 10070
- },
- // 遮罩的过渡时间,单位为ms
- duration: {
- type: [String, Number],
- default: 300
- },
- // 不透明度值,当做rgba的第四个参数
- opacity: {
- type: [String, Number],
- default: 0.5
- },
- ...(_f = (_e = uni.$uv) == null ? void 0 : _e.props) == null ? void 0 : _f.overlay
- }
- };
- const _sfc_main$B = {
- name: "uv-overlay",
- emits: ["click"],
- mixins: [mpMixin, mixin, props$i],
- watch: {
- show(newVal) {
- }
- },
- 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 this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- }
- },
- methods: {
- clickHandler() {
- this.$emit("click");
- },
- clear() {
- }
- }
- };
- function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
- return vue.openBlock(), vue.createBlock(_component_uv_transition, {
- show: _ctx.show,
- mode: "fade",
- "custom-class": "uv-overlay",
- duration: _ctx.duration,
- "custom-style": $options.overlayStyle,
- onClick: $options.clickHandler,
- onTouchmove: vue.withModifiers($options.clear, ["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$3 = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$A], ["__scopeId", "data-v-7303e1aa"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-overlay/components/uv-overlay/uv-overlay.vue"]]);
- 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 i = 0; i < step; i++) {
- let hex = rgbToHex(`rgb(${Math.round(sR * i + startR)},${Math.round(sG * i + startG)},${Math.round(sB * i + startB)})`);
- if (i === 0)
- hex = rgbToHex(startColor);
- if (i === 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 i = 1; i < 4; i += 1) {
- sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
- }
- sColor = sColorNew;
- }
- const sColorChange = [];
- for (let i = 1; i < 7; i += 2) {
- sColorChange.push(parseInt(`0x${sColor.slice(i, i + 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 i = 0; i < aColor.length; i++) {
- let hex = Number(aColor[i]).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 i = 0; i < aNum.length; i += 1) {
- numHex += aNum[i] + aNum[i];
- }
- return numHex;
- }
- } else {
- return _this;
- }
- }
- const props$h = {
- props: {
- // 是否显示组件
- show: {
- type: Boolean,
- default: true
- },
- // 颜色
- color: {
- type: String,
- default: "#909193"
- },
- // 提示文字颜色
- textColor: {
- type: String,
- default: "#909193"
- },
- // 文字和图标是否垂直排列
- vertical: {
- type: Boolean,
- default: false
- },
- // 模式选择,circle-圆形,spinner-花朵形,semicircle-半圆形
- mode: {
- type: String,
- default: "spinner"
- },
- // 图标大小,单位默认px
- size: {
- type: [String, Number],
- default: 24
- },
- // 文字大小
- textSize: {
- type: [String, Number],
- default: 15
- },
- // 文字样式
- textStyle: {
- type: Object,
- default() {
- return {};
- }
- },
- // 文字内容
- text: {
- type: [String, Number],
- default: ""
- },
- // 动画模式 https://www.runoob.com/cssref/css3-pr-animation-timing-function.html
- timingFunction: {
- type: String,
- default: "linear"
- },
- // 动画执行周期时间
- duration: {
- type: [String, Number],
- default: 1200
- },
- // mode=circle时的暗边颜色
- inactiveColor: {
- type: String,
- default: ""
- },
- ...(_h = (_g = uni.$uv) == null ? void 0 : _g.props) == null ? void 0 : _h.loadingIcon
- }
- };
- const _sfc_main$A = {
- name: "uv-loading-icon",
- mixins: [mpMixin, mixin, props$h],
- 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: {
- 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$z(_ctx, _cache, $props, $setup, $data, $options) {
- return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uv-loading-icon", [_ctx.vertical && "uv-loading-icon--vertical"]]),
- style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle)])
- },
- [
- !$data.webviewHide ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uv-loading-icon__spinner", [`uv-loading-icon__spinner--${_ctx.mode}`]]),
- ref: "ani",
- style: vue.normalizeStyle({
- color: _ctx.color,
- width: _ctx.$uv.addUnit(_ctx.size),
- height: _ctx.$uv.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: "uv-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: "uv-loading-icon__text",
- style: vue.normalizeStyle([{
- fontSize: _ctx.$uv.addUnit(_ctx.textSize),
- color: _ctx.textColor
- }, _ctx.$uv.addStyle(_ctx.textStyle)])
- },
- vue.toDisplayString(_ctx.text),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_1$4 = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$z], ["__scopeId", "data-v-29b619ea"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-loading-icon/components/uv-loading-icon/uv-loading-icon.vue"]]);
- const icons = {
- "uvicon-level": "e68f",
- "uvicon-checkbox-mark": "e659",
- "uvicon-folder": "e694",
- "uvicon-movie": "e67c",
- "uvicon-star-fill": "e61e",
- "uvicon-star": "e618",
- "uvicon-phone-fill": "e6ac",
- "uvicon-phone": "e6ba",
- "uvicon-apple-fill": "e635",
- "uvicon-backspace": "e64d",
- "uvicon-attach": "e640",
- "uvicon-empty-data": "e671",
- "uvicon-empty-address": "e68a",
- "uvicon-empty-favor": "e662",
- "uvicon-empty-car": "e657",
- "uvicon-empty-order": "e66b",
- "uvicon-empty-list": "e672",
- "uvicon-empty-search": "e677",
- "uvicon-empty-permission": "e67d",
- "uvicon-empty-news": "e67e",
- "uvicon-empty-history": "e685",
- "uvicon-empty-coupon": "e69b",
- "uvicon-empty-page": "e60e",
- "uvicon-empty-wifi-off": "e6cc",
- "uvicon-reload": "e627",
- "uvicon-order": "e695",
- "uvicon-server-man": "e601",
- "uvicon-search": "e632",
- "uvicon-more-dot-fill": "e66f",
- "uvicon-scan": "e631",
- "uvicon-map": "e665",
- "uvicon-map-fill": "e6a8",
- "uvicon-tags": "e621",
- "uvicon-tags-fill": "e613",
- "uvicon-eye": "e664",
- "uvicon-eye-fill": "e697",
- "uvicon-eye-off": "e69c",
- "uvicon-eye-off-outline": "e688",
- "uvicon-mic": "e66d",
- "uvicon-mic-off": "e691",
- "uvicon-calendar": "e65c",
- "uvicon-trash": "e623",
- "uvicon-trash-fill": "e6ce",
- "uvicon-play-left": "e6bf",
- "uvicon-play-right": "e6b3",
- "uvicon-minus": "e614",
- "uvicon-plus": "e625",
- "uvicon-info-circle": "e69f",
- "uvicon-info-circle-fill": "e6a7",
- "uvicon-question-circle": "e622",
- "uvicon-question-circle-fill": "e6bc",
- "uvicon-close": "e65a",
- "uvicon-checkmark": "e64a",
- "uvicon-checkmark-circle": "e643",
- "uvicon-checkmark-circle-fill": "e668",
- "uvicon-setting": "e602",
- "uvicon-setting-fill": "e6d0",
- "uvicon-heart": "e6a2",
- "uvicon-heart-fill": "e68b",
- "uvicon-camera": "e642",
- "uvicon-camera-fill": "e650",
- "uvicon-more-circle": "e69e",
- "uvicon-more-circle-fill": "e684",
- "uvicon-chat": "e656",
- "uvicon-chat-fill": "e63f",
- "uvicon-bag": "e647",
- "uvicon-error-circle": "e66e",
- "uvicon-error-circle-fill": "e655",
- "uvicon-close-circle": "e64e",
- "uvicon-close-circle-fill": "e666",
- "uvicon-share": "e629",
- "uvicon-share-fill": "e6bb",
- "uvicon-share-square": "e6c4",
- "uvicon-shopping-cart": "e6cb",
- "uvicon-shopping-cart-fill": "e630",
- "uvicon-bell": "e651",
- "uvicon-bell-fill": "e604",
- "uvicon-list": "e690",
- "uvicon-list-dot": "e6a9",
- "uvicon-zhifubao-circle-fill": "e617",
- "uvicon-weixin-circle-fill": "e6cd",
- "uvicon-weixin-fill": "e620",
- "uvicon-qq-fill": "e608",
- "uvicon-qq-circle-fill": "e6b9",
- "uvicon-moments-circel-fill": "e6c2",
- "uvicon-moments": "e6a0",
- "uvicon-car": "e64f",
- "uvicon-car-fill": "e648",
- "uvicon-warning-fill": "e6c7",
- "uvicon-warning": "e6c1",
- "uvicon-clock-fill": "e64b",
- "uvicon-clock": "e66c",
- "uvicon-edit-pen": "e65d",
- "uvicon-edit-pen-fill": "e679",
- "uvicon-email": "e673",
- "uvicon-email-fill": "e683",
- "uvicon-minus-circle": "e6a5",
- "uvicon-plus-circle": "e603",
- "uvicon-plus-circle-fill": "e611",
- "uvicon-file-text": "e687",
- "uvicon-file-text-fill": "e67f",
- "uvicon-pushpin": "e6d1",
- "uvicon-pushpin-fill": "e6b6",
- "uvicon-grid": "e68c",
- "uvicon-grid-fill": "e698",
- "uvicon-play-circle": "e6af",
- "uvicon-play-circle-fill": "e62a",
- "uvicon-pause-circle-fill": "e60c",
- "uvicon-pause": "e61c",
- "uvicon-pause-circle": "e696",
- "uvicon-gift-fill": "e6b0",
- "uvicon-gift": "e680",
- "uvicon-kefu-ermai": "e660",
- "uvicon-server-fill": "e610",
- "uvicon-coupon-fill": "e64c",
- "uvicon-coupon": "e65f",
- "uvicon-integral": "e693",
- "uvicon-integral-fill": "e6b1",
- "uvicon-home-fill": "e68e",
- "uvicon-home": "e67b",
- "uvicon-account": "e63a",
- "uvicon-account-fill": "e653",
- "uvicon-thumb-down-fill": "e628",
- "uvicon-thumb-down": "e60a",
- "uvicon-thumb-up": "e612",
- "uvicon-thumb-up-fill": "e62c",
- "uvicon-lock-fill": "e6a6",
- "uvicon-lock-open": "e68d",
- "uvicon-lock-opened-fill": "e6a1",
- "uvicon-lock": "e69d",
- "uvicon-red-packet": "e6c3",
- "uvicon-photo-fill": "e6b4",
- "uvicon-photo": "e60d",
- "uvicon-volume-off-fill": "e6c8",
- "uvicon-volume-off": "e6bd",
- "uvicon-volume-fill": "e624",
- "uvicon-volume": "e605",
- "uvicon-download": "e670",
- "uvicon-arrow-up-fill": "e636",
- "uvicon-arrow-down-fill": "e638",
- "uvicon-play-left-fill": "e6ae",
- "uvicon-play-right-fill": "e6ad",
- "uvicon-arrow-downward": "e634",
- "uvicon-arrow-leftward": "e63b",
- "uvicon-arrow-rightward": "e644",
- "uvicon-arrow-upward": "e641",
- "uvicon-arrow-down": "e63e",
- "uvicon-arrow-right": "e63c",
- "uvicon-arrow-left": "e646",
- "uvicon-arrow-up": "e633",
- "uvicon-skip-back-left": "e6c5",
- "uvicon-skip-forward-right": "e61f",
- "uvicon-arrow-left-double": "e637",
- "uvicon-man": "e675",
- "uvicon-woman": "e626",
- "uvicon-en": "e6b8",
- "uvicon-twitte": "e607",
- "uvicon-twitter-circle-fill": "e6cf"
- };
- const props$g = {
- props: {
- // 图标类名
- name: {
- type: String,
- default: ""
- },
- // 图标颜色,可接受主题色
- color: {
- type: String,
- default: "#606266"
- },
- // 字体大小,单位px
- size: {
- type: [String, Number],
- default: "16px"
- },
- // 是否显示粗体
- bold: {
- type: Boolean,
- default: false
- },
- // 点击图标的时候传递事件出去的index(用于区分点击了哪一个)
- index: {
- type: [String, Number],
- default: null
- },
- // 触摸图标时的类名
- hoverClass: {
- type: String,
- default: ""
- },
- // 自定义扩展前缀,方便用户扩展自己的图标库
- customPrefix: {
- type: String,
- default: "uvicon"
- },
- // 图标右边或者下面的文字
- label: {
- type: [String, Number],
- default: ""
- },
- // label的位置,只能右边或者下边
- labelPos: {
- type: String,
- default: "right"
- },
- // label的大小
- labelSize: {
- type: [String, Number],
- default: "15px"
- },
- // label的颜色
- labelColor: {
- type: String,
- default: "#606266"
- },
- // label与图标的距离
- space: {
- type: [String, Number],
- default: "3px"
- },
- // 图片的mode
- imgMode: {
- type: String,
- default: "aspectFit"
- },
- // 用于显示图片小图标时,图片的宽度
- width: {
- type: [String, Number],
- default: ""
- },
- // 用于显示图片小图标时,图片的高度
- height: {
- type: [String, Number],
- default: ""
- },
- // 用于解决某些情况下,让图标垂直居中的用途
- top: {
- type: [String, Number],
- default: 0
- },
- // 是否阻止事件传播
- stop: {
- type: Boolean,
- default: false
- },
- ...(_j = (_i = uni.$uv) == null ? void 0 : _i.props) == null ? void 0 : _j.icon
- }
- };
- const _sfc_main$z = {
- name: "uv-icon",
- emits: ["click"],
- mixins: [mpMixin, mixin, props$g],
- data() {
- return {
- colorType: [
- "primary",
- "success",
- "info",
- "error",
- "warning"
- ]
- };
- },
- computed: {
- uClasses() {
- let classes = [];
- classes.push(this.customPrefix);
- classes.push(this.customPrefix + "-" + this.name);
- if (this.color && this.colorType.includes(this.color))
- classes.push("uv-icon__icon--" + this.color);
- return classes;
- },
- iconStyle() {
- let style = {};
- style = {
- fontSize: this.$uv.addUnit(this.size),
- lineHeight: this.$uv.addUnit(this.size),
- fontWeight: this.bold ? "bold" : "normal",
- // 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
- top: this.$uv.addUnit(this.top)
- };
- if (this.color && !this.colorType.includes(this.color))
- style.color = this.color;
- return style;
- },
- // 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
- isImg() {
- const isBase64 = this.name.indexOf("data:") > -1 && this.name.indexOf("base64") > -1;
- return this.name.indexOf("/") !== -1 || isBase64;
- },
- imgStyle() {
- let style = {};
- style.width = this.width ? this.$uv.addUnit(this.width) : this.$uv.addUnit(this.size);
- style.height = this.height ? this.$uv.addUnit(this.height) : this.$uv.addUnit(this.size);
- return style;
- },
- // 通过图标名,查找对应的图标
- icon() {
- const code2 = icons["uvicon-" + this.name];
- return code2 ? unescape(`%u${code2}`) : ["uvicon"].indexOf(this.customPrefix) > -1 ? this.name : "";
- }
- },
- methods: {
- clickHandler(e) {
- this.$emit("click", this.index);
- this.stop && this.preventEvent(e);
- }
- }
- };
- function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uv-icon", ["uv-icon--" + _ctx.labelPos]]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- },
- [
- $options.isImg ? (vue.openBlock(), vue.createElementBlock("image", {
- key: 0,
- class: "uv-icon__img",
- src: _ctx.name,
- mode: _ctx.imgMode,
- style: vue.normalizeStyle([$options.imgStyle, _ctx.$uv.addStyle(_ctx.customStyle)])
- }, null, 12, ["src", "mode"])) : (vue.openBlock(), vue.createElementBlock("text", {
- key: 1,
- class: vue.normalizeClass(["uv-icon__icon", $options.uClasses]),
- style: vue.normalizeStyle([$options.iconStyle, _ctx.$uv.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: "uv-icon__label",
- style: vue.normalizeStyle({
- color: _ctx.labelColor,
- fontSize: _ctx.$uv.addUnit(_ctx.labelSize),
- marginLeft: _ctx.labelPos == "right" ? _ctx.$uv.addUnit(_ctx.space) : 0,
- marginTop: _ctx.labelPos == "bottom" ? _ctx.$uv.addUnit(_ctx.space) : 0,
- marginRight: _ctx.labelPos == "left" ? _ctx.$uv.addUnit(_ctx.space) : 0,
- marginBottom: _ctx.labelPos == "top" ? _ctx.$uv.addUnit(_ctx.space) : 0
- })
- },
- vue.toDisplayString(_ctx.label),
- 5
- /* TEXT, STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 2
- /* CLASS */
- );
- }
- const __easycom_3$4 = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$y], ["__scopeId", "data-v-b7a6dd5d"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-icon/components/uv-icon/uv-icon.vue"]]);
- const props$f = {
- props: {
- // 背景颜色(默认transparent)
- bgColor: {
- type: String,
- default: "transparent"
- },
- // 分割槽高度,单位px(默认20)
- height: {
- type: [String, Number],
- default: 20
- },
- // 与上一个组件的距离
- marginTop: {
- type: [String, Number],
- default: 0
- },
- // 与下一个组件的距离
- marginBottom: {
- type: [String, Number],
- default: 0
- },
- ...(_l = (_k = uni.$uv) == null ? void 0 : _k.props) == null ? void 0 : _l.gap
- }
- };
- const _sfc_main$y = {
- name: "uv-gap",
- mixins: [mpMixin, mixin, props$f],
- computed: {
- gapStyle() {
- const style = {
- backgroundColor: this.bgColor,
- height: this.$uv.addUnit(this.height),
- marginTop: this.$uv.addUnit(this.marginTop),
- marginBottom: this.$uv.addUnit(this.marginBottom)
- };
- return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- }
- }
- };
- function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "uv-gap",
- style: vue.normalizeStyle([$options.gapStyle])
- },
- null,
- 4
- /* STYLE */
- );
- }
- const __easycom_3$3 = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$x], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-gap/components/uv-gap/uv-gap.vue"]]);
- const _sfc_main$x = {
- name: "uv-toast",
- mixins: [mpMixin, mixin],
- data() {
- return {
- isShow: false,
- timer: null,
- // 定时器
- config: {
- message: "",
- // 显示文本
- type: "",
- // 主题类型,primary,success,error,warning,black
- duration: 2e3,
- // 显示的时间,毫秒
- icon: true,
- // 显示的图标
- position: "center",
- // toast出现的位置
- complete: null,
- // 执行完后的回调函数
- overlay: true,
- // 是否防止触摸穿透
- loading: false,
- // 是否加载中状态
- zIndex: 10090
- //弹出的层级
- },
- tmpConfig: {},
- // 将用户配置和内置配置合并后的临时配置变量
- rect: {},
- opacity: 0
- };
- },
- computed: {
- iconName() {
- if (!this.tmpConfig.icon || this.tmpConfig.icon == "none") {
- return "";
- }
- if (["error", "warning", "success", "primary"].includes(this.tmpConfig.type)) {
- return this.$uv.type2icon(this.tmpConfig.type);
- } else {
- return "";
- }
- },
- overlayStyle() {
- const style = {
- justifyContent: "center",
- alignItems: "center",
- display: "flex",
- zIndex: this.tmpConfig.zIndex
- };
- style.backgroundColor = "rgba(0, 0, 0, 0)";
- return style;
- },
- iconStyle() {
- const style = {};
- style.marginRight = "4px";
- return style;
- },
- aniStyle() {
- const style = {
- position: "fixed",
- zIndex: this.tmpConfig.zIndex
- };
- return style;
- },
- // 内容盒子的样式
- contentStyle() {
- this.$uv.sys();
- const style = {
- position: "fixed",
- top: "50%",
- left: "50%"
- };
- let value2 = 0;
- if (this.tmpConfig.position === "top") {
- style.top = "25%";
- } else if (this.tmpConfig.position === "bottom") {
- style.top = "75%";
- } else {
- value2 = "-50%";
- }
- style.transform = `translate(-50%,${value2})`;
- 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(options) {
- this.tmpConfig = this.$uv.deepMerge(this.config, options);
- this.clearTimer();
- this.isShow = true;
- this.timer = setTimeout(() => {
- this.clearTimer();
- typeof this.tmpConfig.complete === "function" && this.tmpConfig.complete();
- }, this.tmpConfig.duration);
- },
- // 查询内容高度
- queryRect() {
- return new Promise((resolve) => {
- const ref = this.$refs["uvToastContent"];
- dom.getComponentRect(ref, (res) => {
- resolve(res.size);
- });
- });
- },
- // 隐藏toast组件,由父组件通过this.$refs.xxx.hide()形式调用
- hide() {
- this.clearTimer();
- },
- clearTimer() {
- this.isShow = false;
- clearTimeout(this.timer);
- this.timer = null;
- }
- },
- unmounted() {
- this.clearTimer();
- }
- };
- function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_overlay = resolveEasycom(vue.resolveDynamicComponent("uv-overlay"), __easycom_0$3);
- const _component_uv_loading_icon = resolveEasycom(vue.resolveDynamicComponent("uv-loading-icon"), __easycom_1$4);
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- const _component_uv_gap = resolveEasycom(vue.resolveDynamicComponent("uv-gap"), __easycom_3$3);
- const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
- return vue.openBlock(), vue.createElementBlock("view", { class: "uv-toast" }, [
- vue.createVNode(_component_uv_overlay, {
- show: $data.isShow && $data.tmpConfig.overlay,
- "custom-style": $options.overlayStyle
- }, null, 8, ["show", "custom-style"]),
- vue.createVNode(_component_uv_transition, {
- show: $data.isShow,
- mode: "fade",
- "custom-style": $options.aniStyle
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uv-toast__content", ["uv-type-" + $data.tmpConfig.type, $data.tmpConfig.type === "loading" || $data.tmpConfig.loading ? "uv-toast__content--loading" : ""]]),
- ref: "uvToastContent",
- style: vue.normalizeStyle([$options.contentStyle])
- },
- [
- $data.tmpConfig.type === "loading" ? (vue.openBlock(), vue.createBlock(_component_uv_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_uv_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_uv_gap, {
- key: 2,
- height: "12",
- bgColor: "transparent"
- })) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass(["uv-toast__content__text", ["uv-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", "custom-style"])
- ]);
- }
- const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$w], ["__scopeId", "data-v-70f56d7c"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-toast/components/uv-toast/uv-toast.vue"]]);
- const props$e = {
- props: {
- // 文字颜色
- color: {
- type: String,
- default: ""
- },
- // 字体大小,单位px
- fontSize: {
- type: [String, Number],
- default: 14
- },
- // 是否显示下划线
- underLine: {
- type: Boolean,
- default: false
- },
- // 要跳转的链接
- href: {
- type: String,
- default: ""
- },
- // 小程序中复制到粘贴板的提示语
- mpTips: {
- type: String,
- default: "链接已复制,请在浏览器打开"
- },
- // 下划线颜色
- lineColor: {
- type: String,
- default: ""
- },
- // 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
- text: {
- type: String,
- default: ""
- },
- ...(_n = (_m = uni.$uv) == null ? void 0 : _m.props) == null ? void 0 : _n.link
- }
- };
- const _sfc_main$w = {
- name: "uv-link",
- emits: ["click"],
- mixins: [mpMixin, mixin, props$e],
- computed: {
- linkStyle() {
- const style = {
- color: this.color,
- fontSize: this.$uv.addUnit(this.fontSize),
- // line-height设置为比字体大小多2px
- lineHeight: this.$uv.addUnit(this.$uv.getPx(this.fontSize) + 2),
- textDecoration: this.underLine ? "underline" : "none"
- };
- return style;
- }
- },
- methods: {
- openLink() {
- plus.runtime.openURL(this.href);
- this.$emit("click");
- }
- }
- };
- function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "text",
- {
- class: "uv-link",
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.openLink && $options.openLink(...args), ["stop"])),
- style: vue.normalizeStyle([$options.linkStyle, _ctx.$uv.addStyle(_ctx.customStyle)])
- },
- vue.toDisplayString(_ctx.text),
- 5
- /* TEXT, STYLE */
- );
- }
- const __easycom_1$3 = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$v], ["__scopeId", "data-v-86e87617"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-link/components/uv-link/uv-link.vue"]]);
- const value$1 = {
- computed: {
- // 经处理后需要显示的值
- value() {
- const {
- text,
- mode,
- format: format2,
- href
- } = this;
- if (mode === "price") {
- if (!/^\d+(\.\d+)?$/.test(text)) {
- error("金额模式下,text参数需要为金额格式");
- }
- if (func(format2)) {
- return format2(text);
- }
- return priceFormat(text, 2);
- }
- if (mode === "date") {
- !date$1(text) && error("日期模式下,text参数需要为日期或时间戳格式");
- if (func(format2)) {
- return format2(text);
- }
- if (format2) {
- return timeFormat(text, format2);
- }
- return timeFormat(text, "yyyy-mm-dd");
- }
- if (mode === "phone") {
- if (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 (func(format2)) {
- return format2(text);
- }
- if (format2 === "encrypt") {
- return this.formatName(text);
- }
- return text;
- }
- if (mode === "link") {
- !url(href) && error("超链接模式下,href参数需要为URL格式");
- return text;
- }
- return text;
- }
- },
- methods: {
- // 默认的姓名脱敏规则
- formatName(name) {
- let value2 = "";
- if (name.length === 2) {
- value2 = name.substr(0, 1) + "*";
- } else if (name.length > 2) {
- let char = "";
- for (let i = 0, len = name.length - 2; i < len; i++) {
- char += "*";
- }
- value2 = name.substr(0, 1) + char + name.substr(-1, 1);
- } else {
- value2 = name;
- }
- return value2;
- }
- }
- };
- const props$d = {
- props: {
- // 主题颜色
- type: {
- type: String,
- default: ""
- },
- // 是否显示
- show: {
- type: Boolean,
- default: true
- },
- // 显示的值
- text: {
- type: [String, Number],
- default: ""
- },
- // 前置图标
- prefixIcon: {
- type: String,
- default: ""
- },
- // 后置图标
- suffixIcon: {
- type: String,
- default: ""
- },
- // 文本处理的匹配模式
- // text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
- mode: {
- type: String,
- default: ""
- },
- // mode=link下,配置的链接
- href: {
- type: String,
- default: ""
- },
- // 格式化规则
- format: {
- type: [String, Function],
- default: ""
- },
- // mode=phone时,点击文本是否拨打电话
- call: {
- type: Boolean,
- default: true
- },
- // 小程序的打开方式
- openType: {
- type: String,
- default: ""
- },
- // 是否粗体,默认normal
- bold: {
- type: Boolean,
- default: false
- },
- // 是否块状
- block: {
- type: Boolean,
- default: false
- },
- // 文本显示的行数,如果设置,超出此行数,将会显示省略号
- lines: {
- type: [String, Number],
- default: ""
- },
- // 文本颜色
- color: {
- type: String,
- default: "#303133"
- },
- // 字体大小
- size: {
- type: [String, Number],
- default: 15
- },
- // 图标的样式
- iconStyle: {
- type: [Object, String],
- default: () => ({
- fontSize: "15px"
- })
- },
- // 文字装饰,下划线,中划线等,可选值 none|underline|line-through
- decoration: {
- type: String,
- default: "none"
- },
- // 外边距,对象、字符串,数值形式均可
- margin: {
- type: [Object, String, Number],
- default: 0
- },
- // 文本行高
- lineHeight: {
- type: [String, Number],
- default: ""
- },
- // 文本对齐方式,可选值left|center|right
- align: {
- type: String,
- default: "left"
- },
- // 文字换行,可选值break-word|normal|anywhere
- wordWrap: {
- type: String,
- default: "normal"
- },
- ...(_p = (_o = uni.$uv) == null ? void 0 : _o.props) == null ? void 0 : _p.text
- }
- };
- const _sfc_main$v = {
- name: "uv-text",
- emits: ["click"],
- mixins: [mpMixin, mixin, value$1, props$d],
- computed: {
- valueStyle() {
- const style = {
- textDecoration: this.decoration,
- fontWeight: this.bold ? "bold" : "normal",
- wordWrap: this.wordWrap,
- fontSize: this.$uv.addUnit(this.size)
- };
- !this.type && (style.color = this.color);
- this.isNvue && this.lines && (style.lines = this.lines);
- if (this.isNvue && this.mode != "price" && !this.prefixIcon && !this.suffixIcon) {
- style.flex = 1;
- style.textAlign = this.align === "left" ? "flex-start" : this.align === "center" ? "center" : "right";
- }
- this.lineHeight && (style.lineHeight = this.$uv.addUnit(this.lineHeight));
- !this.isNvue && this.block && (style.display = "block");
- return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- },
- isNvue() {
- let nvue = false;
- return nvue;
- },
- isMp() {
- let mp = false;
- return mp;
- }
- },
- data() {
- return {};
- },
- methods: {
- clickHandler() {
- if (this.call && this.mode === "phone") {
- uni.makePhoneCall({
- phoneNumber: this.text
- });
- }
- this.$emit("click");
- }
- }
- };
- function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- const _component_uv_link = resolveEasycom(vue.resolveDynamicComponent("uv-link"), __easycom_1$3);
- return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uv-text", []]),
- style: vue.normalizeStyle({
- margin: _ctx.margin,
- justifyContent: _ctx.align === "left" ? "flex-start" : _ctx.align === "center" ? "center" : "flex-end"
- }),
- onClick: _cache[6] || (_cache[6] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- },
- [
- _ctx.mode === "price" ? (vue.openBlock(), vue.createElementBlock(
- "text",
- {
- key: 0,
- class: vue.normalizeClass(["uv-text__price", _ctx.type && `uv-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: "uv-text__prefix-icon"
- }, [
- vue.createVNode(_component_uv_icon, {
- name: _ctx.prefixIcon,
- customStyle: _ctx.$uv.addStyle(_ctx.iconStyle)
- }, null, 8, ["name", "customStyle"])
- ])) : vue.createCommentVNode("v-if", true),
- _ctx.mode === "link" ? (vue.openBlock(), vue.createBlock(_component_uv_link, {
- key: 2,
- text: _ctx.value,
- href: _ctx.href,
- underLine: ""
- }, null, 8, ["text", "href"])) : _ctx.openType && $options.isMp ? (vue.openBlock(), vue.createElementBlock("button", {
- key: 3,
- class: "uv-reset-button uv-text__value",
- style: vue.normalizeStyle([$options.valueStyle]),
- 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, ["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(["uv-text__value", [
- _ctx.type && `uv-text__value--${_ctx.type}`,
- _ctx.lines && `uv-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: "uv-text__suffix-icon"
- }, [
- vue.createVNode(_component_uv_icon, {
- name: _ctx.suffixIcon,
- customStyle: _ctx.$uv.addStyle(_ctx.iconStyle)
- }, null, 8, ["name", "customStyle"])
- ])) : vue.createCommentVNode("v-if", true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_2$4 = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$u], ["__scopeId", "data-v-8da47eb3"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-text/components/uv-text/uv-text.vue"]]);
- const props$c = {
- props: {
- // 图片地址
- src: {
- type: String,
- default: ""
- },
- // 裁剪模式
- mode: {
- type: String,
- default: "aspectFill"
- },
- // 宽度,单位任意
- width: {
- type: [String, Number],
- default: "300"
- },
- // 高度,单位任意
- height: {
- type: [String, Number],
- default: "225"
- },
- // 图片形状,circle-圆形,square-方形
- shape: {
- type: String,
- default: "square"
- },
- // 圆角,单位任意
- radius: {
- type: [String, Number],
- default: 0
- },
- // 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序
- lazyLoad: {
- type: Boolean,
- default: true
- },
- // 是否开启observer懒加载,nvue不生效
- observeLazyLoad: {
- type: Boolean,
- default: false
- },
- // 开启长按图片显示识别微信小程序码菜单
- showMenuByLongpress: {
- type: Boolean,
- default: true
- },
- // 加载中的图标,或者小图片
- loadingIcon: {
- type: String,
- default: "photo"
- },
- // 加载失败的图标,或者小图片
- errorIcon: {
- type: String,
- default: "error-circle"
- },
- // 是否显示加载中的图标或者自定义的slot
- showLoading: {
- type: Boolean,
- default: true
- },
- // 是否显示加载错误的图标或者自定义的slot
- showError: {
- type: Boolean,
- default: true
- },
- // 是否需要淡入效果
- fade: {
- type: Boolean,
- default: true
- },
- // 只支持网络资源,只对微信小程序有效
- webp: {
- type: Boolean,
- default: false
- },
- // 过渡时间,单位ms
- duration: {
- type: [String, Number],
- default: 500
- },
- // 背景颜色,用于深色页面加载图片时,为了和背景色融合
- bgColor: {
- type: String,
- default: "#f3f4f6"
- },
- // nvue模式下 是否直接显示,在uv-list等cell下面使用就需要设置
- cellChild: {
- type: Boolean,
- default: false
- },
- ...(_r = (_q = uni.$uv) == null ? void 0 : _q.props) == null ? void 0 : _r.image
- }
- };
- const _sfc_main$u = {
- name: "uv-image",
- emits: ["click", "load", "error"],
- mixins: [mpMixin, mixin, props$c],
- data() {
- return {
- // 图片是否加载错误,如果是,则显示错误占位图
- isError: false,
- // 初始化组件时,默认为加载中状态
- loading: true,
- // 图片加载完成时,去掉背景颜色,因为如果是png图片,就会显示灰色的背景
- backgroundStyle: {},
- // 用于fade模式的控制组件显示与否
- show: false,
- // 是否开启图片出现在可视范围进行加载(另一种懒加载)
- observeShow: !this.observeLazyLoad,
- elIndex: "",
- // 因为props的值无法修改,故需要一个中间值
- imgWidth: this.width,
- // 因为props的值无法修改,故需要一个中间值
- imgHeight: this.height,
- thresholdValue: 50
- };
- },
- watch: {
- src: {
- immediate: true,
- handler(n2) {
- if (!n2) {
- this.isError = true;
- } else {
- this.isError = false;
- this.loading = true;
- }
- }
- },
- width(newVal) {
- this.show = false;
- this.$uv.sleep(2).then((res) => {
- this.show = true;
- });
- this.imgWidth = newVal;
- },
- height(newVal) {
- this.show = false;
- this.$uv.sleep(2).then((res) => {
- this.show = true;
- });
- this.imgHeight = newVal;
- }
- },
- computed: {
- wrapStyle() {
- let style = {};
- if (this.mode !== "heightFix") {
- style.width = this.$uv.addUnit(this.imgWidth);
- }
- if (this.mode !== "widthFix") {
- style.height = this.$uv.addUnit(this.imgHeight);
- }
- style.borderRadius = this.shape == "circle" ? "10000px" : this.$uv.addUnit(this.radius);
- style.overflow = this.radius > 0 ? "hidden" : "visible";
- return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- },
- imageStyle() {
- let style = {};
- style.borderRadius = this.shape == "circle" ? "10000px" : this.$uv.addUnit(this.radius);
- return style;
- }
- },
- created() {
- this.elIndex = this.$uv.guid();
- this.observer = {};
- this.observerName = "lazyLoadContentObserver";
- },
- mounted() {
- this.show = true;
- this.$nextTick(() => {
- if (this.observeLazyLoad)
- this.observerFn();
- });
- },
- methods: {
- // 点击图片
- onClick() {
- this.$emit("click");
- },
- // 图片加载失败
- onErrorHandler(err) {
- this.loading = false;
- this.isError = true;
- this.$emit("error", err);
- },
- // 图片加载完成,标记loading结束
- onLoadHandler(event) {
- if (this.mode == "widthFix")
- this.imgHeight = "auto";
- if (this.mode == "heightFix")
- this.imgWidth = "auto";
- this.loading = false;
- this.isError = false;
- this.$emit("load", event);
- this.removeBgColor();
- },
- // 移除图片的背景色
- removeBgColor() {
- this.backgroundStyle = {
- backgroundColor: "transparent"
- };
- },
- // 观察图片是否在可见视口
- observerFn() {
- this.$nextTick(() => {
- uni.$once("onLazyLoadReachBottom", () => {
- if (!this.observeShow)
- this.observeShow = true;
- });
- });
- setTimeout(() => {
- this.disconnectObserver(this.observerName);
- const contentObserver = uni.createIntersectionObserver(this);
- contentObserver.relativeToViewport({
- bottom: this.thresholdValue
- }).observe(`.uv-image--${this.elIndex}`, (res) => {
- if (res.intersectionRatio > 0) {
- this.observeShow = true;
- this.disconnectObserver(this.observerName);
- }
- });
- this[this.observerName] = contentObserver;
- }, 50);
- },
- disconnectObserver(observerName) {
- const observer = this[observerName];
- observer && observer.disconnect();
- }
- }
- };
- function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
- return $data.show ? (vue.openBlock(), vue.createBlock(_component_uv_transition, {
- key: 0,
- show: $data.show,
- mode: "fade",
- duration: _ctx.fade ? _ctx.duration : 0,
- "cell-child": _ctx.cellChild,
- "custom-style": $options.wrapStyle
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uv-image", [`uv-image--${$data.elIndex}`]]),
- onClick: _cache[2] || (_cache[2] = (...args) => $options.onClick && $options.onClick(...args)),
- style: vue.normalizeStyle([$options.wrapStyle, $data.backgroundStyle])
- },
- [
- !$data.isError && $data.observeShow ? (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-menuv-by-longpress": _ctx.showMenuByLongpress,
- "lazy-load": _ctx.lazyLoad,
- class: "uv-image__image",
- style: vue.normalizeStyle([$options.imageStyle]),
- webp: _ctx.webp
- }, null, 44, ["src", "mode", "show-menuv-by-longpress", "lazy-load", "webp"])) : vue.createCommentVNode("v-if", true),
- _ctx.showLoading && $data.loading ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 1,
- class: "uv-image__loading",
- style: vue.normalizeStyle({
- borderRadius: _ctx.shape == "circle" ? "50%" : _ctx.$uv.addUnit(_ctx.radius),
- backgroundColor: _ctx.bgColor,
- width: _ctx.$uv.addUnit(_ctx.width),
- height: _ctx.$uv.addUnit(_ctx.height)
- })
- },
- [
- vue.renderSlot(_ctx.$slots, "loading", {}, () => [
- vue.createVNode(_component_uv_icon, {
- name: _ctx.loadingIcon,
- width: _ctx.width,
- height: _ctx.height
- }, null, 8, ["name", "width", "height"])
- ], true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- _ctx.showError && $data.isError && !$data.loading ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- class: "uv-image__error",
- style: vue.normalizeStyle({
- borderRadius: _ctx.shape == "circle" ? "50%" : _ctx.$uv.addUnit(_ctx.radius),
- width: _ctx.$uv.addUnit(_ctx.width),
- height: _ctx.$uv.addUnit(_ctx.height)
- })
- },
- [
- vue.renderSlot(_ctx.$slots, "error", {}, () => [
- vue.createVNode(_component_uv_icon, {
- name: _ctx.errorIcon,
- width: _ctx.width,
- height: _ctx.height
- }, null, 8, ["name", "width", "height"])
- ], true)
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["show", "duration", "cell-child", "custom-style"])) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t], ["__scopeId", "data-v-8fe9e33e"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-image/components/uv-image/uv-image.vue"]]);
- const props$b = {
- props: {
- // 指示器的整体宽度
- indicatorWidth: {
- type: [String, Number],
- default: 50
- },
- // 滑块的宽度
- indicatorBarWidth: {
- type: [String, Number],
- default: 20
- },
- // 是否显示面板指示器
- indicator: {
- type: Boolean,
- default: true
- },
- // 指示器非激活颜色
- indicatorColor: {
- type: String,
- default: "#f2f2f2"
- },
- // 指示器的激活颜色
- indicatorActiveColor: {
- type: String,
- default: "#3c9cff"
- },
- // 指示器样式,可通过bottom,left,right进行定位
- indicatorStyle: {
- type: [String, Object],
- default: ""
- },
- ...(_t = (_s = uni.$uv) == null ? void 0 : _s.props) == null ? void 0 : _t.scrollList
- }
- };
- const block0 = (Comp) => {
- (Comp.$wxs || (Comp.$wxs = [])).push("wxs");
- (Comp.$wxsModules || (Comp.$wxsModules = {}))["wxs"] = "1f01b1f2";
- };
- const _sfc_main$t = {
- name: "uv-scroll-list",
- mixins: [mpMixin, mixin, props$b],
- data() {
- return {
- scrollInfo: {
- scrollLeft: 0,
- scrollWidth: 0
- },
- scrollWidth: 0
- };
- },
- computed: {
- // 指示器为线型的样式
- barStyle() {
- const style = {};
- style.width = this.$uv.addUnit(this.indicatorBarWidth);
- style.backgroundColor = this.indicatorActiveColor;
- return style;
- },
- lineStyle() {
- const style = {};
- style.width = this.$uv.addUnit(this.indicatorWidth);
- style.backgroundColor = this.indicatorColor;
- return style;
- }
- },
- mounted() {
- this.init();
- },
- methods: {
- init() {
- this.getComponentWidth();
- },
- scrollEvent(status) {
- this.$emit(status);
- },
- // 获取组件的宽度
- async getComponentWidth() {
- await this.$uv.sleep(30);
- this.$uvGetRect(".uv-scroll-list").then((size) => {
- this.scrollWidth = size.width;
- });
- }
- }
- };
- function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "uv-scroll-list",
- ref: "uv-scroll-list"
- },
- [
- vue.createCommentVNode(" 以上平台,支持wxs "),
- vue.createElementVNode("scroll-view", {
- class: "uv-scroll-list__scroll-view",
- "scroll-x": "",
- 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": _ctx.$uv.getPx(_ctx.indicatorBarWidth),
- "data-indicatorWidth": _ctx.$uv.getPx(_ctx.indicatorWidth),
- "show-scrollbar": false,
- "upper-threshold": 0,
- "lower-threshold": 0,
- "data-unit": _ctx.$uv.unit
- }, [
- vue.createElementVNode("view", { class: "uv-scroll-list__scroll-view__content" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ])
- ], 40, ["data-scrollWidth", "data-barWidth", "data-indicatorWidth", "data-unit"]),
- _ctx.indicator ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "uv-scroll-list__indicator",
- style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.indicatorStyle)])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "uv-scroll-list__indicator__line",
- style: vue.normalizeStyle([$options.lineStyle])
- },
- [
- vue.createElementVNode(
- "view",
- {
- class: "uv-scroll-list__indicator__line__bar",
- style: vue.normalizeStyle([$options.barStyle]),
- ref: "uv-scroll-list__indicator__line__bar"
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(" 避免报错 ")
- ],
- 512
- /* NEED_PATCH */
- );
- }
- if (typeof block0 === "function")
- block0(_sfc_main$t);
- const __easycom_3$2 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s], ["__scopeId", "data-v-145f8032"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-scroll-list/components/uv-scroll-list/uv-scroll-list.vue"]]);
- const props$a = {
- props: {
- // 占父容器宽度的多少等分,总分为12份
- span: {
- type: [String, Number],
- default: 12
- },
- // 指定栅格左侧的间隔数(总12栏)
- offset: {
- type: [String, Number],
- default: 0
- },
- // 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
- justify: {
- type: String,
- default: "start"
- },
- // 垂直对齐方式,可选值为top、center、bottom、stretch
- align: {
- type: String,
- default: "stretch"
- },
- // 文字对齐方式
- textAlign: {
- type: String,
- default: "left"
- },
- ...(_v = (_u = uni.$uv) == null ? void 0 : _u.props) == null ? void 0 : _v.col
- }
- };
- const _sfc_main$s = {
- name: "uv-col",
- emits: ["click"],
- mixins: [mpMixin, mixin, props$a],
- data() {
- return {
- width: 0,
- parentData: {
- gutter: 0
- },
- gridNum: 12
- };
- },
- 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: this.$uv.addUnit(this.$uv.getPx(this.parentData.gutter) / 2),
- paddingRight: this.$uv.addUnit(this.$uv.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 this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- }
- },
- mounted() {
- this.init();
- },
- methods: {
- async init() {
- this.updateParentData();
- this.width = await this.parent.getComponentWidth();
- },
- updateParentData() {
- this.getParentData("uv-row");
- },
- clickHandler(e) {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uv-col", [
- "uv-col-" + _ctx.span
- ]]),
- ref: "uv-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 __easycom_2$3 = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r], ["__scopeId", "data-v-d2bffd23"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-row/components/uv-col/uv-col.vue"]]);
- const props$9 = {
- props: {
- // 给col添加间距,左右边距各占一半
- gutter: {
- type: [String, Number],
- default: 0
- },
- // 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
- justify: {
- type: String,
- default: "start"
- },
- // 垂直对齐方式,可选值为top、center、bottom
- align: {
- type: String,
- default: "center"
- },
- ...(_x = (_w = uni.$uv) == null ? void 0 : _w.props) == null ? void 0 : _x.row
- }
- };
- const _sfc_main$r = {
- name: "uv-row",
- emits: ["click"],
- mixins: [mpMixin, mixin, props$9],
- 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 = this.$uv.addUnit(-Number(this.gutter) / 2);
- style.marginRight = this.$uv.addUnit(-Number(this.gutter) / 2);
- }
- return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- }
- },
- methods: {
- clickHandler(e) {
- this.$emit("click");
- },
- async getComponentWidth() {
- await this.$uv.sleep();
- return new Promise((resolve) => {
- this.$uvGetRect(".uv-row").then((res) => {
- resolve(res.width);
- });
- });
- }
- }
- };
- function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "uv-row",
- ref: "uv-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 __easycom_3$1 = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q], ["__scopeId", "data-v-692ff899"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-row/components/uv-row/uv-row.vue"]]);
- function getlist(data) {
- let url2 = baseUrl + "/index.php/index/Fmember/queryfmemberlistbyuserid";
- return dorequest("post", url2, data);
- }
- function submembergenderbyuserid(data) {
- let url2 = baseUrl + "/index.php/index/Fmember/submembergenderbyuserid";
- return dorequest("post", url2, data);
- }
- function subfmemberlistbyuserid(data) {
- let url2 = baseUrl + "/index.php/index/Fmember/subfmemberlistbyuserid";
- return dorequest("post", url2, data);
- }
- function submembergenderwithuid(data) {
- let url2 = baseUrl + "/index.php/index/Fmember/subgenderbyuserid";
- let usedata = {
- userid: data.userid,
- fmemberid: data.fmemberid,
- gender: data.gender
- };
- return dorequest("post", url2, usedata);
- }
- function querymergescalebyuserid(data) {
- let url2 = baseUrl + "/index.php/index/Scale/querymergescalebyuserid";
- return dorequest("post", url2, data);
- }
- function subanswerbyuserid(answer, data) {
- let url2 = baseUrl + "/index.php/index/Scale/subanswerbyuserid";
- let list = [];
- if (!(answer instanceof Array)) {
- let item = {
- userid: data.userid,
- fmemberid: data.fmemberid,
- stemid: answer.stemid,
- answertype: answer.answertype,
- answervalue: answer.answervalue
- };
- if (answer.answeroptionid) {
- item.answeroptionid = answer.answeroptionid;
- }
- if (answer.answeroption) {
- item.answeroption = answer.answeroption;
- }
- list.push(item);
- } else {
- list = answer;
- }
- let usedata = {
- answer: JSON.stringify(list),
- userid: data.userid,
- fmemberid: data.fmemberid,
- srid: data.srid,
- scaleid: data.scaleid
- };
- return dorequest("post", url2, usedata);
- }
- function subcomstatus(srid) {
- let url2 = baseUrl + "/index.php/index/Scale/subcomstatus";
- let usedata = {
- srid
- };
- return dorequest("post", url2, usedata);
- }
- const _sfc_main$q = {
- data() {
- return {
- shareimg: "https://backup-1306866048.cos.ap-nanjing.myqcloud.com/workercard/20231228/658d1042e1395.jpg"
- };
- },
- methods: {
- showshare() {
- },
- dosharewechat() {
- this.$emit("dosharewechat", { shareimg: this.shareimg });
- }
- }
- };
- function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
- const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
- const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
- return vue.openBlock(), vue.createElementBlock("view", { class: "share_div" }, [
- vue.createVNode(_component_uv_row, null, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "10",
- class: "text",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(" 心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。 ")
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, { span: "2" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", {
- class: "",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.dosharewechat && $options.dosharewechat(...args)),
- align: "center"
- }, [
- vue.createVNode(_component_uv_image, {
- class: "img",
- src: "/static/image/wxfriend.png",
- mode: "aspectFill",
- shape: "circle",
- "lazy-load": true,
- width: "50",
- height: "50"
- }),
- vue.createCommentVNode(' <uv-icon name="share" label="分享" size="50" labelPos="bottom" color="#648EB8" labelColor="#648EB8" labelSize="18"></uv-icon> ')
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]);
- }
- const share$3 = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p], ["__scopeId", "data-v-11758b78"], ["__file", "D:/workspace/uniapp/health2/components/share/share.vue"]]);
- const _sfc_main$p = {
- data() {
- return {
- userinfo: {},
- userlist: [],
- reportinfo: {},
- selectuser: false
- };
- },
- components: {
- share: share$3
- },
- methods: {
- getlist() {
- let data = { userid: this.userinfo.id };
- getlist(data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- }
- if (200 == res.code) {
- let userlist = res.resultData;
- let fmemberid = this.selectuser ? this.selectuser.fmemberid : this.userinfo.fmemberid;
- if (this.selectuser) {
- userlist.map((item, index2) => {
- item.selected = 0;
- if (item.fmemberid == fmemberid) {
- item.selected = 1;
- return;
- }
- });
- } else {
- userlist[0].selected = 1;
- uni.setStorage({
- key: "selectuser",
- data: userlist[0]
- });
- this.selectuser = userlist[0];
- uni.setStorage({
- key: "selectuser",
- data: this.selectuser
- });
- }
- userlist.map((item, index2) => {
- if (!item.gender) {
- item.photourl = "/static/image/member.svg";
- } else {
- switch (item.gender) {
- case "1":
- item.photourl = "/static/image/selecttype/man.png";
- break;
- case "2":
- item.photourl = "/static/image/selecttype/woman.png";
- break;
- }
- }
- });
- this.userlist = userlist;
- uni.setStorage({
- key: "memberlist",
- data: this.userlist
- });
- }
- });
- },
- selected(index2) {
- let that = this;
- this.userlist.map((item, index1) => {
- if (index1 == index2) {
- item.selected = 1;
- that.selectuser = item;
- } else {
- item.selected = 0;
- }
- });
- uni.setStorage({
- key: "selectuser",
- data: this.selectuser
- });
- this.querymergescalebyuserid();
- },
- insertmembe() {
- let count = this.userlist.length - 1;
- if (count >= this.userinfo.fmembercount) {
- this.$refs.toast.show({
- type: "error",
- message: this.$t("member_num_than_max")
- });
- } else {
- uni.navigateTo({
- url: "/pages/member/add"
- });
- }
- },
- querymergescalebyuserid() {
- let userid = this.userinfo.id;
- let fmemberid = this.selectuser.fmemberid ? this.selectuser.fmemberid : 0;
- let data = { userid, fmemberid };
- querymergescalebyuserid(data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- if (200 == res.code) {
- this.reportinfo = res.resultData;
- }
- });
- },
- showreport() {
- uni.navigateTo({
- url: "/pages/report/report"
- });
- },
- init() {
- this.userinfo = uni.getStorageSync("userinfo");
- this.selectuser = uni.getStorageSync("selectuser");
- this.getlist();
- this.querymergescalebyuserid();
- },
- tostem() {
- if (this.reportinfo.stemlist == void 0) {
- return;
- }
- uni.setStorage({
- key: "stemlist",
- data: this.reportinfo.stemlist
- });
- if (this.reportinfo.srid == void 0) {
- this.reportinfo.srid = 0;
- }
- this.reportinfo.stemlist;
- let srid = this.reportinfo.srid;
- uni.setStorage({
- key: "srid",
- data: srid
- });
- let stepprogress = this.reportinfo.stepprogress;
- tostemlistnext(stepprogress);
- },
- restem() {
- uni.setStorage({
- key: "stemlist",
- data: this.reportinfo.stemlist
- });
- if (this.reportinfo.srid == void 0) {
- this.reportinfo.srid = 0;
- }
- this.reportinfo.stemlist;
- let srid = 0;
- uni.setStorage({
- key: "srid",
- data: srid
- });
- let stepprogress = 0;
- var scaleid = 4;
- tostemlistnext(stepprogress, 0, scaleid, srid);
- },
- share(data) {
- uni.share({
- provider: "weixin",
- scene: "WXSceneSession",
- type: 0,
- href: "testapp://",
- //title: this.$t('navigationBarTitleText')+"分享",
- title: this.$t("share"),
- summary: this.$t("share_text"),
- imageUrl: data.shareimg,
- success: function(res) {
- addlog({
- json: JSON.stringify(res),
- type: "uniapp信息"
- });
- formatAppLog("log", "at pages/index/index.vue:348", "success:" + JSON.stringify(res));
- },
- fail: function(err) {
- addlog({
- json: JSON.stringify(err),
- type: "uniapp错误"
- });
- formatAppLog("log", "at pages/index/index.vue:355", "fail:" + JSON.stringify(err));
- }
- });
- }
- },
- mounted() {
- this.init();
- },
- onPullDownRefresh() {
- this.init();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1e3);
- }
- };
- function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
- const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
- const _component_uv_scroll_list = resolveEasycom(vue.resolveDynamicComponent("uv-scroll-list"), __easycom_3$2);
- const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
- const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createCommentVNode(` <custom-navigation-bar class="bar">\r
- {{$t('navigationBarTitleText')}}\r
- </custom-navigation-bar> `),
- vue.createCommentVNode(` <page-meta>\r
- <navigation-bar\r
- :title="$t('navigationBarTitleText')"\r
- front-color="#fff"\r
- background-color="#648EB8"\r
- title-align="center"\r
- />\r
- </page-meta> `),
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "page" }, [
- vue.createElementVNode("view", { class: "bar" }, [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("navigationBarTitleText"),
- align: "center",
- color: "#fff",
- size: "20"
- }, null, 8, ["text"])
- ]),
- vue.createElementVNode("view", { class: "bottomarc" }),
- vue.createElementVNode("view", null, [
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- customStyle: "margin-top: 6%"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1",
- class: "box1"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "hometitle" },
- vue.toDisplayString(_ctx.$t("index_text_1")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "userlist" }, [
- vue.createVNode(_component_uv_row, null, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "10",
- class: "scroll_div"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_scroll_list, { indicator: false }, {
- default: vue.withCtx(() => [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.userlist, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- key: index2,
- class: "item"
- }, [
- vue.createVNode(_component_uv_image, {
- class: vue.normalizeClass(["img", { memberphoto_select: item.selected }]),
- src: item.photourl,
- mode: "aspectFill",
- shape: "circle",
- "lazy-load": true,
- width: "60",
- height: "60",
- onClick: ($event) => $options.selected(index2)
- }, null, 8, ["src", "class", "onClick"]),
- vue.createVNode(_component_uv_text, {
- text: item.membername,
- align: "center",
- customStyle: "margin-top:0.3rem"
- }, null, 8, ["text"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, { span: "2" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "addmember" }, [
- vue.createVNode(_component_uv_image, {
- class: "img",
- src: "/static/image/fabu1.png",
- mode: "aspectFill",
- shape: "circle",
- "lazy-load": true,
- width: "50",
- height: "50",
- onClick: $options.insertmembe
- }, null, 8, ["onClick"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("new_member"),
- align: "center",
- customStyle: "margin-top:0.3rem"
- }, null, 8, ["text"])
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createElementVNode("view", { class: "" }, [
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- customStyle: "margin-top: 2rem"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "box2" }, [
- vue.createElementVNode(
- "view",
- { class: "scalename" },
- vue.toDisplayString(_ctx.$t("index_text_2")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("view", { class: "div1" }, [
- vue.createVNode(_component_uv_row, null, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, { span: "6" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("image", {
- class: "img",
- src: "http://qiniusave.chienxutech.com/sdzyy/img/xgng3.png"
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, { span: "6" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "" }, [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("index_text_3")
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("index_text_4"),
- align: "center",
- customStyle: "margin-top:30px;margin-bottom:40px"
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("index_text_5"),
- align: "center",
- size: "12",
- color: "#1a1a1a"
- }, null, 8, ["text"])
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- vue.createElementVNode(
- "view",
- { class: "scalename" },
- vue.toDisplayString(_ctx.$t("index_text_6")),
- 1
- /* TEXT */
- ),
- $data.selectuser ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "btns"
- }, [
- vue.createCommentVNode(' <view v-show="1!=selectuser.fmemberid"> '),
- vue.createElementVNode("view", null, [
- vue.withDirectives(vue.createVNode(
- _component_uv_row,
- null,
- {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "6",
- offset: "3"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "mybtn",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.tostem && $options.tostem(...args))
- },
- vue.toDisplayString(_ctx.$t("index_btn_1")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- },
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, 0 == $data.reportinfo.comstatus]
- ]),
- vue.withDirectives(vue.createVNode(
- _component_uv_row,
- { gutter: "20" },
- {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, { span: "6" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "mybtn",
- onClick: _cache[1] || (_cache[1] = (...args) => $options.showreport && $options.showreport(...args))
- },
- vue.toDisplayString(_ctx.$t("index_btn_2")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, { span: "6" }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: "mybtn",
- onClick: _cache[2] || (_cache[2] = (...args) => $options.restem && $options.restem(...args))
- },
- vue.toDisplayString(_ctx.$t("index_btn_3")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- },
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, 1 == $data.reportinfo.comstatus]
- ])
- ])
- ])) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
- vue.createElementVNode(
- "p",
- null,
- vue.toDisplayString(_ctx.$t("not_selected")),
- 1
- /* TEXT */
- )
- ])),
- vue.createCommentVNode(" mergerscale.comstatus ")
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createCommentVNode(' <uv-row justify="space-between" customStyle="margin-top: 6%">\r\n <uv-col span="10" offset="1" >\r\n <share @dosharewechat="share"></share>\r\n </uv-col>\r\n </uv-row> ')
- ])
- ])
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__scopeId", "data-v-1cf27b2a"], ["__file", "D:/workspace/uniapp/health2/pages/index/index.vue"]]);
- const props$8 = {
- props: {
- value: {
- type: [String, Number],
- default: ""
- },
- modelValue: {
- type: [String, Number],
- default: ""
- },
- // 输入框类型
- // number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
- // idcard-身份证输入键盘,微信、支付宝、百度、QQ小程序
- // digit-带小数点的数字键盘,App的nvue页面、微信、支付宝、百度、头条、QQ小程序
- // text-文本输入键盘
- type: {
- type: String,
- default: "text"
- },
- // 是否禁用输入框
- disabled: {
- type: Boolean,
- default: false
- },
- // 禁用状态时的背景色
- disabledColor: {
- type: String,
- default: "#f5f7fa"
- },
- // 是否显示清除控件
- clearable: {
- type: Boolean,
- default: false
- },
- // 是否密码类型
- password: {
- type: Boolean,
- default: false
- },
- // 最大输入长度,设置为 -1 的时候不限制最大长度
- maxlength: {
- type: [String, Number],
- default: -1
- },
- // 输入框为空时的占位符
- placeholder: {
- type: String,
- default: null
- },
- // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
- placeholderClass: {
- type: String,
- default: "input-placeholder"
- },
- // 指定placeholder的样式
- placeholderStyle: {
- type: [String, Object],
- default: "color: #c0c4cc"
- },
- // 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
- // https://uniapp.dcloud.io/component/input
- // https://uniapp.dcloud.io/component/textarea
- confirmType: {
- type: String,
- default: "done"
- },
- // 点击键盘右下角按钮时是否保持键盘不收起,H5无效
- confirmHold: {
- type: Boolean,
- default: false
- },
- // focus时,点击页面的时候不收起键盘,微信小程序有效
- holdKeyboard: {
- type: Boolean,
- default: false
- },
- // 自动获取焦点
- // 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
- focus: {
- type: Boolean,
- default: false
- },
- // 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
- autoBlur: {
- type: Boolean,
- default: false
- },
- // 指定focus时光标的位置
- cursor: {
- type: [String, Number],
- default: -1
- },
- // 输入框聚焦时底部与键盘的距离
- cursorSpacing: {
- type: [String, Number],
- default: 30
- },
- // 光标起始位置,自动聚集时有效,需与selection-end搭配使用
- selectionStart: {
- type: [String, Number],
- default: -1
- },
- // 光标结束位置,自动聚集时有效,需与selection-start搭配使用
- selectionEnd: {
- type: [String, Number],
- default: -1
- },
- // 键盘弹起时,是否自动上推页面
- adjustPosition: {
- type: Boolean,
- default: true
- },
- // 输入框内容对齐方式,可选值为:left|center|right
- inputAlign: {
- type: String,
- default: "left"
- },
- // 输入框字体的大小
- fontSize: {
- type: [String, Number],
- default: "14px"
- },
- // 输入框字体颜色
- color: {
- type: String,
- default: "#303133"
- },
- // 输入框前置图标
- prefixIcon: {
- type: String,
- default: ""
- },
- // 前置图标样式,对象或字符串
- prefixIconStyle: {
- type: [String, Object],
- default: ""
- },
- // 输入框后置图标
- suffixIcon: {
- type: String,
- default: ""
- },
- // 后置图标样式,对象或字符串
- suffixIconStyle: {
- type: [String, Object],
- default: ""
- },
- // 边框类型,surround-四周边框,bottom-底部边框,none-无边框
- border: {
- type: String,
- default: "surround"
- },
- // 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
- readonly: {
- type: Boolean,
- default: false
- },
- // 输入框形状,circle-圆形,square-方形
- shape: {
- type: String,
- default: "square"
- },
- // 用于处理或者过滤输入框内容的方法
- formatter: {
- type: [Function, null],
- default: null
- },
- // 是否忽略组件内对文本合成系统事件的处理
- ignoreCompositionEvent: {
- type: Boolean,
- default: true
- },
- ...(_z = (_y = uni.$uv) == null ? void 0 : _y.props) == null ? void 0 : _z.input
- }
- };
- const _sfc_main$o = {
- name: "uv-input",
- mixins: [mpMixin, mixin, props$8],
- data() {
- return {
- // 输入框的值
- innerValue: "",
- // 是否处于获得焦点状态
- focused: false,
- // 过滤处理方法
- innerFormatter: (value2) => value2
- };
- },
- created() {
- this.innerValue = this.modelValue;
- },
- watch: {
- value(newVal) {
- this.innerValue = newVal;
- },
- modelValue(newVal) {
- this.innerValue = newVal;
- }
- },
- computed: {
- // 是否显示清除控件
- isShowClear() {
- const { clearable, readonly, focused, innerValue } = this;
- return !!clearable && !readonly && !!focused && innerValue !== "";
- },
- // 组件的类名
- inputClass() {
- let classes = [], { border, disabled, shape } = this;
- border === "surround" && (classes = classes.concat(["uv-border", "uv-input--radius"]));
- classes.push(`uv-input--${shape}`);
- border === "bottom" && (classes = classes.concat([
- "uv-border-bottom",
- "uv-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 this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- },
- // 输入框的样式
- inputStyle() {
- const style = {
- color: this.color,
- fontSize: this.$uv.addUnit(this.fontSize),
- textAlign: this.inputAlign
- };
- if (this.disabled || this.readonly) {
- style["pointer-events"] = "none";
- }
- return style;
- }
- },
- methods: {
- // 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
- setFormatter(e) {
- this.innerFormatter = e;
- },
- // 当键盘输入时,触发input事件
- onInput(e) {
- let { value: value2 = "" } = e.detail || {};
- const formatter = this.formatter || this.innerFormatter;
- const formatValue = formatter(value2);
- this.innerValue = value2;
- this.$nextTick(() => {
- this.innerValue = formatValue;
- this.valueChange();
- });
- },
- // 输入框失去焦点时触发
- onBlur(event) {
- this.$emit("blur", event.detail.value);
- this.$uv.sleep(100).then(() => {
- this.focused = false;
- });
- this.$uv.formValidate(this, "blur");
- },
- // 输入框聚焦时触发
- onFocus(event) {
- this.focused = true;
- this.$emit("focus");
- },
- // 点击完成按钮时触发
- onConfirm(event) {
- this.$emit("confirm", this.innerValue);
- },
- // 键盘高度发生变化的时候触发此事件
- // 兼容性:微信小程序2.7.0+、App 3.1.0+
- onkeyboardheightchange(e) {
- this.$emit("keyboardheightchange", e);
- },
- // 内容发生变化,进行处理
- valueChange() {
- if (this.isClear)
- this.innerValue = "";
- const value2 = this.innerValue;
- this.$nextTick(() => {
- this.$emit("input", value2);
- this.$emit("update:modelValue", value2);
- this.$emit("change", value2);
- this.$uv.formValidate(this, "change");
- });
- },
- // 点击清除控件
- onClear() {
- this.innerValue = "";
- this.isClear = true;
- this.$uv.sleep(200).then((res) => {
- this.isClear = false;
- });
- this.$nextTick(() => {
- this.$emit("clear");
- this.valueChange();
- });
- },
- /**
- * 在安卓nvue上,事件无法冒泡
- * 在某些时间,我们希望监听uv-from-item的点击事件,此时会导致点击uv-form-item内的uv-input后
- * 无法触发uv-form-item的点击事件,这里通过手动调用uv-form-item的方法进行触发
- */
- clickHandler() {
- }
- }
- };
- function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uv-input", $options.inputClass]),
- style: vue.normalizeStyle([$options.wrapperStyle])
- },
- [
- vue.createElementVNode("view", { class: "uv-input__content" }, [
- vue.createElementVNode("view", { class: "uv-input__content__prefix-icon" }, [
- vue.renderSlot(_ctx.$slots, "prefix", {}, () => [
- _ctx.prefixIcon ? (vue.openBlock(), vue.createBlock(_component_uv_icon, {
- key: 0,
- name: _ctx.prefixIcon,
- size: "18",
- customStyle: _ctx.prefixIconStyle
- }, null, 8, ["name", "customStyle"])) : vue.createCommentVNode("v-if", true)
- ], true)
- ]),
- vue.createElementVNode("view", {
- class: "uv-input__content__field-wrapper",
- onClick: _cache[5] || (_cache[5] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- }, [
- vue.createCommentVNode(" 根据uni-app的input组件文档,H5和APP中只要声明了password参数(无论true还是false),type均失效,此时\r\n 为了防止type=number时,又存在password属性,type无效,此时需要设置password为undefined\r\n "),
- vue.createElementVNode("input", {
- class: "uv-input__content__field-wrapper__field",
- style: vue.normalizeStyle([$options.inputStyle]),
- type: _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-spacing": _ctx.cursorSpacing,
- "adjust-position": _ctx.adjustPosition,
- "selection-end": _ctx.selectionEnd,
- "selection-start": _ctx.selectionStart,
- password: _ctx.password || _ctx.type === "password" || void 0,
- 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))
- }, null, 44, ["type", "focus", "cursor", "value", "auto-blur", "disabled", "maxlength", "placeholder", "placeholder-style", "placeholder-class", "confirm-type", "confirm-hold", "hold-keyboard", "cursor-spacing", "adjust-position", "selection-end", "selection-start", "password", "ignoreCompositionEvent"])
- ]),
- $options.isShowClear ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "uv-input__content__clear",
- onClick: _cache[6] || (_cache[6] = (...args) => $options.onClear && $options.onClear(...args))
- }, [
- vue.createVNode(_component_uv_icon, {
- name: "close",
- size: "11",
- color: "#ffffff",
- customStyle: "line-height: 12px"
- })
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "uv-input__content__subfix-icon" }, [
- vue.renderSlot(_ctx.$slots, "suffix", {}, () => [
- _ctx.suffixIcon ? (vue.openBlock(), vue.createBlock(_component_uv_icon, {
- key: 0,
- name: _ctx.suffixIcon,
- size: "18",
- customStyle: _ctx.suffixIconStyle
- }, null, 8, ["name", "customStyle"])) : vue.createCommentVNode("v-if", true)
- ], true)
- ])
- ])
- ],
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_6$1 = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__scopeId", "data-v-651602aa"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-input/components/uv-input/uv-input.vue"]]);
- const props$7 = {
- props: {
- color: {
- type: String,
- default: "#d6d7d9"
- },
- // 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等
- length: {
- type: [String, Number],
- default: "100%"
- },
- // 线条方向,col-竖向,row-横向
- direction: {
- type: String,
- default: "row"
- },
- // 是否显示细边框
- hairline: {
- type: Boolean,
- default: true
- },
- // 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
- margin: {
- type: [String, Number],
- default: 0
- },
- // 是否虚线,true-虚线,false-实线
- dashed: {
- type: Boolean,
- default: false
- },
- ...(_B = (_A = uni.$uv) == null ? void 0 : _A.props) == null ? void 0 : _B.line
- }
- };
- const _sfc_main$n = {
- name: "uv-line",
- mixins: [mpMixin, mixin, props$7],
- computed: {
- lineStyle() {
- const style = {};
- style.margin = this.margin;
- if (this.direction === "row") {
- style.borderBottomWidth = "1px";
- style.borderBottomStyle = this.dashed ? "dashed" : "solid";
- style.width = this.$uv.addUnit(this.length);
- if (this.hairline)
- style.transform = "scaleY(0.5)";
- } else {
- style.borderLeftWidth = "1px";
- style.borderLeftStyle = this.dashed ? "dashed" : "solid";
- style.height = this.$uv.addUnit(this.length);
- if (this.hairline)
- style.transform = "scaleX(0.5)";
- }
- style.borderColor = this.color;
- return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- }
- }
- };
- function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "uv-line",
- style: vue.normalizeStyle([$options.lineStyle])
- },
- null,
- 4
- /* STYLE */
- );
- }
- const __easycom_5 = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m], ["__scopeId", "data-v-dcf8cb8f"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-line/components/uv-line/uv-line.vue"]]);
- const props$6 = {
- props: {
- // input的label提示语
- label: {
- type: String,
- default: ""
- },
- // 绑定的值
- prop: {
- type: String,
- default: ""
- },
- // 是否显示表单域的下划线边框
- borderBottom: {
- type: [Boolean],
- default: false
- },
- // label的位置,left-左边,top-上边
- labelPosition: {
- type: String,
- default: ""
- },
- // label的宽度,单位px
- labelWidth: {
- type: [String, Number],
- default: ""
- },
- // 右侧图标
- rightIcon: {
- type: String,
- default: ""
- },
- // 左侧图标
- leftIcon: {
- type: String,
- default: ""
- },
- // 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置
- required: {
- type: Boolean,
- default: false
- },
- leftIconStyle: {
- type: [String, Object],
- default: ""
- },
- ...(_D = (_C = uni.$uv) == null ? void 0 : _C.props) == null ? void 0 : _D.formItem
- }
- };
- const _sfc_main$m = {
- name: "uv-form-item",
- emits: ["click"],
- mixins: [mpMixin, mixin, props$6],
- data() {
- return {
- // 错误提示语
- message: "",
- parentData: {
- // 提示文本的位置
- labelPosition: "left",
- // 提示文本对齐方式
- labelAlign: "left",
- // 提示文本的样式
- labelStyle: {},
- // 提示文本的宽度
- labelWidth: 45,
- // 错误提示方式
- errorType: "message"
- }
- };
- },
- created() {
- this.init();
- },
- methods: {
- init() {
- this.updateParentData();
- if (!this.parent) {
- this.$uv.error("uv-form-item需要结合uv-form组件使用");
- }
- },
- // 获取父组件的参数
- updateParentData() {
- this.getParentData("uv-form");
- },
- // 移除uv-form-item的校验结果
- clearValidate() {
- this.message = null;
- },
- // 清空当前的组件的校验结果,并重置为初始值
- resetField() {
- const value2 = this.$uv.getProperty(this.parent.originalModel, this.prop);
- this.$uv.setProperty(this.parent.model, this.prop, value2);
- this.message = null;
- },
- // 点击组件
- clickHandler() {
- this.$emit("click");
- }
- }
- };
- function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
- const _component_uv_line = resolveEasycom(vue.resolveDynamicComponent("uv-line"), __easycom_5);
- return vue.openBlock(), vue.createElementBlock("view", { class: "uv-form-item" }, [
- vue.createElementVNode(
- "view",
- {
- class: "uv-form-item__body",
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args)),
- style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle), {
- flexDirection: (_ctx.labelPosition || $data.parentData.labelPosition) === "left" ? "row" : "column"
- }])
- },
- [
- vue.createCommentVNode(' 微信小程序中,将一个参数设置空字符串,结果会变成字符串"true" '),
- vue.renderSlot(_ctx.$slots, "label", {}, () => [
- _ctx.required || _ctx.leftIcon || _ctx.label ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: "uv-form-item__body__left",
- style: vue.normalizeStyle({
- width: _ctx.$uv.addUnit(_ctx.labelWidth || $data.parentData.labelWidth),
- marginBottom: $data.parentData.labelPosition === "left" ? 0 : "5px"
- })
- },
- [
- vue.createCommentVNode(" 为了块对齐 "),
- vue.createElementVNode("view", { class: "uv-form-item__body__left__content" }, [
- vue.createCommentVNode(" nvue不支持伪元素before "),
- _ctx.required ? (vue.openBlock(), vue.createElementBlock("text", {
- key: 0,
- class: "uv-form-item__body__left__content__required"
- }, "*")) : vue.createCommentVNode("v-if", true),
- _ctx.leftIcon ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "uv-form-item__body__left__content__icon"
- }, [
- vue.createVNode(_component_uv_icon, {
- name: _ctx.leftIcon,
- "custom-style": _ctx.leftIconStyle
- }, null, 8, ["name", "custom-style"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode(
- "text",
- {
- class: "uv-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: "uv-form-item__body__right" }, [
- vue.createElementVNode("view", { class: "uv-form-item__body__right__content" }, [
- vue.createElementVNode("view", { class: "uv-form-item__body__right__content__slot" }, [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ]),
- vue.createElementVNode("view", { class: "item__body__right__content__icon" }, [
- vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
- ])
- ])
- ])
- ],
- 4
- /* STYLE */
- ),
- vue.renderSlot(_ctx.$slots, "error", {}, () => [
- !!$data.message && $data.parentData.errorType === "message" ? (vue.openBlock(), vue.createBlock(_component_uv_transition, {
- key: 0,
- show: true,
- duration: 100,
- mode: "fade"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "text",
- {
- class: "uv-form-item__body__right__message",
- style: vue.normalizeStyle({
- marginLeft: _ctx.$uv.addUnit($data.parentData.labelPosition === "top" ? 0 : _ctx.labelWidth || $data.parentData.labelWidth)
- })
- },
- vue.toDisplayString($data.message),
- 5
- /* TEXT, STYLE */
- )
- ]),
- _: 1
- /* STABLE */
- })) : vue.createCommentVNode("v-if", true)
- ], true),
- _ctx.borderBottom ? (vue.openBlock(), vue.createBlock(_component_uv_line, {
- key: 0,
- color: $data.message && $data.parentData.errorType === "border-bottom" ? "#f56c6c" : "#d6d7d9"
- }, null, 8, ["color"])) : vue.createCommentVNode("v-if", true)
- ]);
- }
- const __easycom_3 = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__scopeId", "data-v-d1e73275"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-form/components/uv-form-item/uv-form-item.vue"]]);
- const props$5 = {
- props: {
- // 是否细边框
- hairline: {
- type: Boolean,
- default: true
- },
- // 按钮的预置样式,info,primary,error,warning,success
- type: {
- type: String,
- default: "info"
- },
- // 按钮尺寸,large,normal,small,mini
- size: {
- type: String,
- default: "normal"
- },
- // 按钮形状,circle(两边为半圆),square(带圆角)
- shape: {
- type: String,
- default: "square"
- },
- // 按钮是否镂空
- plain: {
- type: Boolean,
- default: false
- },
- // 是否禁止状态
- disabled: {
- type: Boolean,
- default: false
- },
- // 是否加载中
- loading: {
- type: Boolean,
- default: false
- },
- // 加载中提示文字
- loadingText: {
- type: [String, Number],
- default: ""
- },
- // 加载状态图标类型
- loadingMode: {
- type: String,
- default: "spinner"
- },
- // 加载图标大小
- loadingSize: {
- type: [String, Number],
- default: 14
- },
- // 开放能力,具体请看uniapp稳定关于button组件部分说明
- // https://uniapp.dcloud.io/component/button
- openType: {
- type: String,
- default: ""
- },
- // 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
- // 取值为submit(提交表单),reset(重置表单)
- formType: {
- type: String,
- default: ""
- },
- // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
- // 只微信小程序、QQ小程序有效
- appParameter: {
- type: String,
- default: ""
- },
- // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
- hoverStopPropagation: {
- type: Boolean,
- default: true
- },
- // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效
- lang: {
- type: String,
- default: "en"
- },
- // 会话来源,open-type="contact"时有效。只微信小程序有效
- sessionFrom: {
- type: String,
- default: ""
- },
- // 会话内消息卡片标题,open-type="contact"时有效
- // 默认当前标题,只微信小程序有效
- sendMessageTitle: {
- type: String,
- default: ""
- },
- // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效
- // 默认当前分享路径,只微信小程序有效
- sendMessagePath: {
- type: String,
- default: ""
- },
- // 会话内消息卡片图片,open-type="contact"时有效
- // 默认当前页面截图,只微信小程序有效
- sendMessageImg: {
- type: String,
- default: ""
- },
- // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
- // 用户点击后可以快速发送小程序消息,open-type="contact"时有效
- showMessageCard: {
- type: Boolean,
- default: true
- },
- // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
- dataName: {
- type: String,
- default: ""
- },
- // 节流,一定时间内只能触发一次
- throttleTime: {
- type: [String, Number],
- default: 0
- },
- // 按住后多久出现点击态,单位毫秒
- hoverStartTime: {
- type: [String, Number],
- default: 0
- },
- // 手指松开后点击态保留时间,单位毫秒
- hoverStayTime: {
- type: [String, Number],
- default: 200
- },
- // 按钮文字,之所以通过props传入,是因为slot传入的话
- // nvue中无法控制文字的样式
- text: {
- type: [String, Number],
- default: ""
- },
- // 按钮图标
- icon: {
- type: String,
- default: ""
- },
- // 按钮图标大小
- iconSize: {
- type: [String, Number],
- default: ""
- },
- // 按钮图标颜色
- iconColor: {
- type: String,
- default: "#000000"
- },
- // 按钮颜色,支持传入linear-gradient渐变色
- color: {
- type: String,
- default: ""
- },
- // 自定义按钮文本样式
- customTextStyle: {
- type: [Object, String],
- default: () => {
- }
- },
- ...(_F = (_E = uni.$uv) == null ? void 0 : _E.props) == null ? void 0 : _F.button
- }
- };
- const _sfc_main$l = {
- name: "uv-button",
- mixins: [mpMixin, mixin, props$5],
- emits: ["click"],
- 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 : "#3c9cff";
- }
- 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 fontSize2 = 14, { size } = this;
- if (size === "large")
- fontSize2 = 16;
- if (size === "normal")
- fontSize2 = 14;
- if (size === "small")
- fontSize2 = 12;
- if (size === "mini")
- fontSize2 = 10;
- return fontSize2;
- },
- // 设置图标大小
- getIconSize() {
- const size = this.iconSize ? this.iconSize : this.textSize * 1.35;
- return this.$uv.addUnit(size);
- },
- // 设置外层盒子的宽度,其他样式不需要
- btnWrapperStyle() {
- const style = {};
- const customStyle = this.$uv.addStyle(this.customStyle);
- if (customStyle.width)
- style.width = customStyle.width;
- return style;
- }
- },
- methods: {
- clickHandler() {
- if (!this.disabled && !this.loading) {
- throttle(() => {
- this.$emit("click");
- }, this.throttleTime);
- }
- }
- }
- };
- function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_loading_icon = resolveEasycom(vue.resolveDynamicComponent("uv-loading-icon"), __easycom_1$4);
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "uv-button-wrapper",
- style: vue.normalizeStyle([$options.btnWrapperStyle])
- },
- [
- vue.createElementVNode("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,
- "hover-class": !_ctx.disabled && !_ctx.loading ? "uv-button--active" : "",
- class: vue.normalizeClass(["uv-button uv-reset-button", $options.bemClass]),
- style: vue.normalizeStyle([$options.baseColor, _ctx.$uv.addStyle(_ctx.customStyle)]),
- onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
- }, [
- _ctx.loading ? (vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- [
- vue.createVNode(_component_uv_loading_icon, {
- mode: _ctx.loadingMode,
- size: _ctx.loadingSize * 1.15,
- color: $options.loadingColor
- }, null, 8, ["mode", "size", "color"]),
- vue.createElementVNode(
- "text",
- {
- class: "uv-button__loading-text",
- style: vue.normalizeStyle([
- { fontSize: $options.textSize + "px" },
- _ctx.$uv.addStyle(_ctx.customTextStyle)
- ])
- },
- 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_uv_icon, {
- key: 0,
- name: _ctx.icon,
- color: $options.iconColorCom,
- size: $options.getIconSize,
- customStyle: { marginRight: "2px" }
- }, null, 8, ["name", "color", "size"])) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
- vue.createElementVNode(
- "text",
- {
- class: "uv-button__text",
- style: vue.normalizeStyle([
- { fontSize: $options.textSize + "px" },
- _ctx.$uv.addStyle(_ctx.customTextStyle)
- ])
- },
- vue.toDisplayString(_ctx.text),
- 5
- /* TEXT, STYLE */
- )
- ], true),
- vue.renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
- ],
- 64
- /* STABLE_FRAGMENT */
- ))
- ], 14, ["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"])
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_2$2 = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$k], ["__scopeId", "data-v-ae8e42c7"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-button/components/uv-button/uv-button.vue"]]);
- const props$4 = {
- props: {
- // 当前form的需要验证字段的集合
- model: {
- type: Object,
- default: () => ({})
- },
- // 验证规则
- rules: {
- type: [Object, Function, Array],
- default: () => ({})
- },
- // 有错误时的提示方式,message-提示信息,toast-进行toast提示
- // border-bottom-下边框呈现红色,none-无提示
- errorType: {
- type: String,
- default: "message"
- },
- // 是否显示表单域的下划线边框
- borderBottom: {
- type: Boolean,
- default: true
- },
- // label的位置,left-左边,top-上边
- labelPosition: {
- type: String,
- default: "left"
- },
- // label的宽度,单位px
- labelWidth: {
- type: [String, Number],
- default: 45
- },
- // lable字体的对齐方式
- labelAlign: {
- type: String,
- default: "left"
- },
- // lable的样式,对象形式
- labelStyle: {
- type: Object,
- default: () => ({})
- },
- ...(_H = (_G = uni.$uv) == null ? void 0 : _G.props) == null ? void 0 : _H.form
- }
- };
- const formatRegExp = /%[sdj%]/g;
- let warning = function warning2() {
- };
- if (typeof process !== "undefined" && process.env && true && typeof window !== "undefined" && typeof document !== "undefined") {
- warning = function warning2(type2, errors) {
- if (typeof console !== "undefined" && console.warn) {
- if (errors.every((e) => typeof e === "string")) {
- formatAppLog("warn", "at uni_modules/uv-form/components/uv-form/valid.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$1() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- let i = 1;
- const f = args[0];
- const len = args.length;
- if (typeof f === "function") {
- return f.apply(null, args.slice(1));
- }
- if (typeof f === "string") {
- let str = String(f).replace(formatRegExp, (x) => {
- if (x === "%%") {
- return "%";
- }
- if (i >= len) {
- return x;
- }
- switch (x) {
- case "%s":
- return String(args[i++]);
- case "%d":
- return Number(args[i++]);
- case "%j":
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return "[Circular]";
- }
- break;
- default:
- return x;
- }
- });
- for (let arg = args[i]; i < len; arg = args[++i]) {
- str += ` ${arg}`;
- }
- return str;
- }
- return f;
- }
- 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((a) => {
- func2(a, 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((k) => {
- ret.push.apply(ret, objArr[k]);
- });
- 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((e) => e);
- 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((e) => e);
- return pending;
- }
- function complementError(rule) {
- return function(oe) {
- if (oe && oe.message) {
- oe.field = oe.field || rule.fullField;
- return oe;
- }
- return {
- message: typeof oe === "function" ? oe() : oe,
- field: oe.field || rule.fullField
- };
- };
- }
- function deepMerge(target, source) {
- if (source) {
- for (const s in source) {
- if (source.hasOwnProperty(s)) {
- const value2 = source[s];
- if (typeof value2 === "object" && typeof target[s] === "object") {
- target[s] = { ...target[s], ...value2 };
- } else {
- target[s] = value2;
- }
- }
- }
- }
- return target;
- }
- function required(rule, value2, source, errors, options, type2) {
- if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value2, type2 || rule.type))) {
- errors.push(format$1(options.messages.required, rule.fullField));
- }
- }
- function whitespace(rule, value2, source, errors, options) {
- if (/^\s+$/.test(value2) || value2 === "") {
- errors.push(format$1(options.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 integer2(value2) {
- return /^(-)?\d+$/.test(value2);
- },
- float: function float(value2) {
- return /^(-)?\d+(\.\d+)?$/.test(value2);
- },
- array: function array2(value2) {
- return Array.isArray(value2);
- },
- regexp: function regexp2(value2) {
- if (value2 instanceof RegExp) {
- return true;
- }
- try {
- return !!new RegExp(value2);
- } catch (e) {
- return false;
- }
- },
- date: function date2(value2) {
- return typeof value2.getTime === "function" && typeof value2.getMonth === "function" && typeof value2.getYear === "function";
- },
- number: function number2(value2) {
- if (isNaN(value2)) {
- return false;
- }
- return typeof +value2 === "number";
- },
- object: function object2(value2) {
- return typeof value2 === "object" && !types.array(value2);
- },
- method: function method2(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, options) {
- if (rule.required && value2 === void 0) {
- required(rule, value2, source, errors, options);
- 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$1(options.messages.types[ruleType], rule.fullField, rule.type));
- }
- } else if (ruleType && typeof value2 !== rule.type) {
- errors.push(format$1(options.messages.types[ruleType], rule.fullField, rule.type));
- }
- }
- function range(rule, value2, source, errors, options) {
- 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$1(options.messages[key].len, rule.fullField, rule.len));
- }
- } else if (min && !max && val < rule.min) {
- errors.push(format$1(options.messages[key].min, rule.fullField, rule.min));
- } else if (max && !min && val > rule.max) {
- errors.push(format$1(options.messages[key].max, rule.fullField, rule.max));
- } else if (min && max && (val < rule.min || val > rule.max)) {
- errors.push(format$1(options.messages[key].range, rule.fullField, rule.min, rule.max));
- }
- }
- const ENUM = "enum";
- function enumerable(rule, value2, source, errors, options) {
- rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
- if (rule[ENUM].indexOf(value2) === -1) {
- errors.push(format$1(options.messages[ENUM], rule.fullField, rule[ENUM].join(", ")));
- }
- }
- function pattern$1(rule, value2, source, errors, options) {
- if (rule.pattern) {
- if (rule.pattern instanceof RegExp) {
- rule.pattern.lastIndex = 0;
- if (!rule.pattern.test(value2)) {
- errors.push(format$1(options.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$1(options.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, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2, "string") && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options, "string");
- if (!isEmptyValue(value2, "string")) {
- rules.type(rule, value2, source, errors, options);
- rules.range(rule, value2, source, errors, options);
- rules.pattern(rule, value2, source, errors, options);
- if (rule.whitespace === true) {
- rules.whitespace(rule, value2, source, errors, options);
- }
- }
- }
- callback(errors);
- }
- function method(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function number$1(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (value2 === "") {
- value2 = void 0;
- }
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options);
- rules.range(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function _boolean(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function regexp(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (!isEmptyValue(value2)) {
- rules.type(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function integer(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options);
- rules.range(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function floatFn(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options);
- rules.range(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function array(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2, "array") && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options, "array");
- if (!isEmptyValue(value2, "array")) {
- rules.type(rule, value2, source, errors, options);
- rules.range(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function object(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (value2 !== void 0) {
- rules.type(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- const ENUM$1 = "enum";
- function enumerable$1(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (value2 !== void 0) {
- rules[ENUM$1](rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function pattern$2(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2, "string") && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (!isEmptyValue(value2, "string")) {
- rules.pattern(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function date(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- if (!isEmptyValue(value2)) {
- let dateObject;
- if (typeof value2 === "number") {
- dateObject = new Date(value2);
- } else {
- dateObject = value2;
- }
- rules.type(rule, dateObject, source, errors, options);
- if (dateObject) {
- rules.range(rule, dateObject.getTime(), source, errors, options);
- }
- }
- }
- callback(errors);
- }
- function required$1(rule, value2, callback, source, options) {
- const errors = [];
- const type2 = Array.isArray(value2) ? "array" : typeof value2;
- rules.required(rule, value2, source, errors, options, type2);
- callback(errors);
- }
- function type$1(rule, value2, callback, source, options) {
- const ruleType = rule.type;
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2, ruleType) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options, ruleType);
- if (!isEmptyValue(value2, ruleType)) {
- rules.type(rule, value2, source, errors, options);
- }
- }
- callback(errors);
- }
- function any(rule, value2, callback, source, options) {
- const errors = [];
- const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value2) && !rule.required) {
- return callback();
- }
- rules.required(rule, value2, source, errors, options);
- }
- callback(errors);
- }
- const validators = {
- string,
- method,
- number: number$1,
- boolean: _boolean,
- regexp,
- integer,
- float: floatFn,
- array,
- object,
- enum: enumerable$1,
- pattern: pattern$2,
- date,
- 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 clone() {
- const cloned = JSON.parse(JSON.stringify(this));
- cloned.clone = this.clone;
- return cloned;
- }
- };
- }
- const messages$1 = newMessages();
- function Schema(descriptor) {
- this.rules = null;
- this._messages = messages$1;
- 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 z;
- let item;
- for (z in rules2) {
- if (rules2.hasOwnProperty(z)) {
- item = rules2[z];
- this.rules[z] = Array.isArray(item) ? item : [item];
- }
- }
- },
- validate: function validate(source_, o, oc) {
- const _this = this;
- if (o === void 0) {
- o = {};
- }
- if (oc === void 0) {
- oc = function oc2() {
- };
- }
- let source = source_;
- let options = o;
- let callback = oc;
- if (typeof options === "function") {
- callback = options;
- options = {};
- }
- if (!this.rules || Object.keys(this.rules).length === 0) {
- if (callback) {
- callback();
- }
- return Promise.resolve();
- }
- function complete(results) {
- let i;
- let errors = [];
- let fields = {};
- function add(e) {
- if (Array.isArray(e)) {
- let _errors;
- errors = (_errors = errors).concat.apply(_errors, e);
- } else {
- errors.push(e);
- }
- }
- for (i = 0; i < results.length; i++) {
- add(results[i]);
- }
- if (!errors.length) {
- errors = null;
- fields = null;
- } else {
- fields = convertFieldsError(errors);
- }
- callback(errors, fields);
- }
- if (options.messages) {
- let messages$1$1 = this.messages();
- if (messages$1$1 === messages$1) {
- messages$1$1 = newMessages();
- }
- deepMerge(messages$1$1, options.messages);
- options.messages = messages$1$1;
- } else {
- options.messages = this.messages();
- }
- let arr;
- let value2;
- const series = {};
- const keys = options.keys || Object.keys(this.rules);
- keys.forEach((z) => {
- arr = _this.rules[z];
- value2 = source[z];
- arr.forEach((r) => {
- let rule = r;
- if (typeof rule.transform === "function") {
- if (source === source_) {
- source = { ...source };
- }
- value2 = source[z] = rule.transform(value2);
- }
- if (typeof rule === "function") {
- rule = {
- validator: rule
- };
- } else {
- rule = { ...rule };
- }
- rule.validator = _this.getValidationMethod(rule);
- rule.field = z;
- rule.fullField = rule.fullField || z;
- rule.type = _this.getType(rule);
- if (!rule.validator) {
- return;
- }
- series[z] = series[z] || [];
- series[z].push({
- rule,
- value: value2,
- source,
- field: z
- });
- });
- });
- const errorFields = {};
- return asyncMap(series, options, (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(e) {
- if (e === void 0) {
- e = [];
- }
- let errors = e;
- if (!Array.isArray(errors)) {
- errors = [errors];
- }
- if (!options.suppressWarning && errors.length) {
- Schema.warning("async-validator:", errors);
- }
- if (errors.length && rule.message) {
- errors = [].concat(rule.message);
- }
- errors = errors.map(complementError(rule));
- if (options.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 (options.error) {
- errors = [options.error(rule, format$1(options.messages.required, rule.field))];
- } else {
- errors = [];
- }
- return doIt(errors);
- }
- let fieldsSchema = {};
- if (rule.defaultField) {
- for (const k in data.value) {
- if (data.value.hasOwnProperty(k)) {
- fieldsSchema[k] = rule.defaultField;
- }
- }
- }
- fieldsSchema = { ...fieldsSchema, ...data.rule.fields };
- for (const f in fieldsSchema) {
- if (fieldsSchema.hasOwnProperty(f)) {
- const fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
- fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
- }
- }
- const schema = new Schema(fieldsSchema);
- schema.messages(options.messages);
- if (data.rule.options) {
- data.rule.options.messages = options.messages;
- data.rule.options.error = options.error;
- }
- schema.validate(data.value, data.rule.options || options, (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, options);
- } else if (rule.validator) {
- res = rule.validator(rule, data.value, cb, data.source, options);
- 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(), (e) => cb(e));
- }
- }, (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$1("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 register2(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$1;
- Schema.warning = function() {
- };
- const _sfc_main$k = {
- name: "uv-form",
- mixins: [mpMixin, mixin, props$4],
- provide() {
- return {
- uForm: this
- };
- },
- data() {
- return {
- formRules: {},
- // 规则校验器
- validator: {},
- // 原始的model快照,用于resetFields方法重置表单时使用
- originalModel: null
- };
- },
- watch: {
- // 监听规则的变化
- rules: {
- immediate: true,
- handler(n2) {
- this.setRules(n2);
- }
- },
- // 监听属性的变化,通知子组件uv-form-item重新获取信息
- propsChange(n2) {
- var _a;
- if ((_a = this.children) == null ? void 0 : _a.length) {
- this.children.map((child) => {
- typeof child.updateParentData == "function" && child.updateParentData();
- });
- }
- },
- // 监听model的初始值作为重置表单的快照
- model: {
- immediate: true,
- handler(n2) {
- if (!this.originalModel) {
- this.originalModel = this.$uv.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) {
- this.$uv.error("设置rules,model必须设置!如果已经设置,请刷新页面。");
- return;
- }
- this.formRules = rules2;
- this.validator = new Schema(rules2);
- },
- // 清空所有uv-form-item组件的内容,本质上是调用了uv-form-item组件中的resetField()方法
- resetFields() {
- this.resetModel();
- },
- // 重置model为初始值的快照
- resetModel(obj) {
- this.children.map((child) => {
- const prop = child == null ? void 0 : child.prop;
- const value2 = this.$uv.getProperty(this.originalModel, prop);
- this.$uv.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) {
- this.$nextTick(() => {
- const errorsRes = [];
- value2 = [].concat(value2);
- this.children.map((child) => {
- const childErrors = [];
- if (value2.includes(child.prop)) {
- const propertyVal = this.$uv.getProperty(
- this.model,
- child.prop
- );
- const propertyChain = child.prop.split(".");
- const propertyName = propertyChain[propertyChain.length - 1];
- const rule = this.formRules[child.prop];
- if (!rule)
- return;
- const rules2 = [].concat(rule);
- for (let i = 0; i < rules2.length; i++) {
- const ruleItem = rules2[i];
- const trigger = [].concat(ruleItem == null ? void 0 : ruleItem.trigger);
- if (event && !trigger.includes(event))
- continue;
- const validator = new Schema({
- [propertyName]: ruleItem
- });
- validator.validate(
- {
- [propertyName]: propertyVal
- },
- (errors, fields) => {
- if (this.$uv.test.array(errors)) {
- errorsRes.push(...errors);
- childErrors.push(...errors);
- }
- this.$nextTick(() => {
- var _a, _b;
- child.message = ((_a = childErrors[0]) == null ? void 0 : _a.message) ? (_b = childErrors[0]) == null ? void 0 : _b.message : null;
- });
- }
- );
- }
- }
- });
- typeof callback === "function" && callback(errorsRes);
- });
- },
- // 校验全部数据
- validate(callback) {
- 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" && this.$uv.toast(errors[0].message);
- reject(errors);
- } else {
- resolve(true);
- }
- });
- });
- });
- }
- }
- };
- function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "uv-form" }, [
- vue.renderSlot(_ctx.$slots, "default")
- ]);
- }
- const __easycom_6 = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$j], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-form/components/uv-form/uv-form.vue"]]);
- function login$3(data, e) {
- let url2 = baseUrl + "/index.php/index/Me/subuserloginbytelno";
- dorequest(
- "post",
- url2,
- {
- telno: data.telno,
- pw: data.pw
- }
- ).then((res) => {
- res = res.data;
- if (0 == res.code) {
- e.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- }
- if (200 == res.code) {
- let userinfo = res.resultData;
- userinfo.fmembercount = 4;
- userinfo.fmemberid = 0;
- saveuserinfo(userinfo);
- uni.redirectTo({
- url: "/pages/index/index"
- });
- }
- });
- }
- function register$3(data, e, callback = null) {
- let url2 = baseUrl + "/index.php/index/Me/subnewusername";
- return dorequest(
- "post",
- url2,
- {
- telno: data.telno,
- userpw: data.userpw
- }
- );
- }
- const _sfc_main$j = {
- data() {
- return {
- throttleTime: 1,
- logininfo: {
- telno: "",
- pw: ""
- },
- rules: {
- "telno": [
- {
- type: "string",
- required: true,
- message: this.$t("telno_null"),
- trigger: ["blur", "change"]
- },
- {
- pattern: /\d{5,}/,
- message: this.$t("telno_error"),
- trigger: ["blur", "change"]
- }
- ],
- "pw": {
- type: "string",
- required: true,
- message: this.$t("password_null"),
- trigger: ["blur", "change"]
- }
- },
- showpasswod: false,
- passwordtype: "password"
- };
- },
- methods: {
- submit() {
- var that = this;
- this.$refs.form.validate().then((res) => {
- login$3(this.logininfo, that);
- }).catch((errors) => {
- formatAppLog("log", "at pages/login/login.vue:77", errors);
- });
- },
- setshowpasswod() {
- this.showpasswod = !this.showpasswod;
- if (this.showpasswod) {
- this.passwordtype = "text";
- } else {
- this.passwordtype = "password";
- }
- },
- toregister() {
- uni.navigateTo({
- url: "/pages/register/register"
- });
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t("login")
- });
- this.throttleTime = getApp().globalData.throttleTime;
- },
- created() {
- }
- };
- function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
- const _component_uv_input = resolveEasycom(vue.resolveDynamicComponent("uv-input"), __easycom_6$1);
- const _component_uv_form_item = resolveEasycom(vue.resolveDynamicComponent("uv-form-item"), __easycom_3);
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
- const _component_uv_form = resolveEasycom(vue.resolveDynamicComponent("uv-form"), __easycom_6);
- const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "page" }, [
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- customStyle: "margin-top: 35%",
- class: "form"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_form, {
- labelPosition: "left",
- model: $data.logininfo,
- rules: $data.rules,
- ref: "form"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("telno")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_form_item, {
- prop: "telno",
- borderBottom: ""
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_input, {
- modelValue: $data.logininfo.telno,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.logininfo.telno = $event),
- modelModifiers: { trim: true },
- border: "none"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1",
- customStyle: "margin-top: 20px"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("password")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_form_item, {
- prop: "pw",
- borderBottom: ""
- }, {
- right: vue.withCtx(() => [
- vue.withDirectives(vue.createVNode(_component_uv_icon, {
- name: "eye-off-outline",
- color: "#2979ff",
- size: "18",
- onClick: $options.setshowpasswod
- }, null, 8, ["onClick"]), [
- [vue.vShow, !$data.showpasswod]
- ]),
- vue.withDirectives(vue.createVNode(_component_uv_icon, {
- name: "eye",
- color: "#2979ff",
- size: "18",
- onClick: $options.setshowpasswod
- }, null, 8, ["onClick"]), [
- [vue.vShow, $data.showpasswod]
- ])
- ]),
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_input, {
- modelValue: $data.logininfo.pw,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.logininfo.pw = $event),
- modelModifiers: { trim: true },
- type: $data.passwordtype,
- border: "none"
- }, null, 8, ["modelValue", "type"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- throttleTime: $data.throttleTime,
- text: _ctx.$t("login"),
- customStyle: "margin-top: 2rem",
- onClick: $options.submit
- }, null, 8, ["throttleTime", "text", "onClick"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"]),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- plain: true,
- text: _ctx.$t("register"),
- customStyle: "margin-top: 20px",
- onClick: $options.toregister
- }, null, 8, ["text", "onClick"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesLoginLogin = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i], ["__file", "D:/workspace/uniapp/health2/pages/login/login.vue"]]);
- const _sfc_main$i = {
- data() {
- return {
- throttleTime: 1,
- logininfo: {
- telno: "",
- pw1: "",
- pw2: ""
- },
- rules: {
- "telno": [
- {
- type: "string",
- required: true,
- message: this.$t("telno_null"),
- trigger: ["blur"]
- },
- {
- pattern: /\d{5,}/,
- message: this.$t("telno_error"),
- trigger: ["blur"]
- }
- ],
- "pw1": {
- type: "string",
- required: true,
- message: this.$t("password_null"),
- trigger: ["blur"]
- },
- "pw2": [{
- type: "string",
- required: true,
- message: this.$t("password_null"),
- trigger: ["blur"]
- }, {
- validator: (rule, value2, callback) => {
- if (value2 != this.logininfo.pw1) {
- return false;
- }
- return true;
- },
- message: this.$t("password_repeat_error"),
- trigger: ["blur"]
- }]
- },
- showpasswod1: false,
- passwordtype1: "password",
- showpasswod2: false,
- passwordtype2: "password"
- };
- },
- methods: {
- submit() {
- var that = this;
- this.$refs.form.validate().then((res) => {
- let data = { telno: that.logininfo.telno, userpw: that.logininfo.pw1 };
- register$3(data).then((res2) => {
- res2 = res2.data;
- if (0 == res2.code) {
- that.$refs.toast.show({
- type: "error",
- message: that.$t("register_error")
- });
- }
- if (200 == res2.code) {
- let data2 = { telno: that.logininfo.telno, pw: that.logininfo.pw1 };
- login$3(data2, that);
- }
- });
- }).catch((errors) => {
- formatAppLog("log", "at pages/register/register.vue:123", errors);
- });
- },
- setshowpasswod1() {
- this.showpasswod1 = !this.showpasswod1;
- if (this.showpasswod1) {
- this.passwordtype1 = "text";
- } else {
- this.passwordtype1 = "password";
- }
- },
- setshowpasswod2() {
- this.showpasswod2 = !this.showpasswod2;
- if (this.showpasswod2) {
- this.passwordtype2 = "text";
- } else {
- this.passwordtype2 = "password";
- }
- },
- tolgoin() {
- uni.navigateTo({
- url: "/pages/login/login"
- });
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t("register")
- });
- this.throttleTime = getApp().globalData.throttleTime;
- }
- };
- function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
- const _component_uv_input = resolveEasycom(vue.resolveDynamicComponent("uv-input"), __easycom_6$1);
- const _component_uv_form_item = resolveEasycom(vue.resolveDynamicComponent("uv-form-item"), __easycom_3);
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
- const _component_uv_form = resolveEasycom(vue.resolveDynamicComponent("uv-form"), __easycom_6);
- const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
- return vue.openBlock(), vue.createElementBlock("view", null, [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "page" }, [
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- customStyle: "margin-top: 35%",
- class: "form"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_form, {
- labelPosition: "left",
- model: $data.logininfo,
- rules: $data.rules,
- ref: "form"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("telno")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_form_item, {
- prop: "telno",
- borderBottom: ""
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_input, {
- modelValue: $data.logininfo.telno,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.logininfo.telno = $event),
- modelModifiers: { trim: true },
- border: "none"
- }, null, 8, ["modelValue"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1",
- customStyle: "margin-top: 20px"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("password")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_form_item, {
- prop: "pw1",
- borderBottom: ""
- }, {
- right: vue.withCtx(() => [
- vue.withDirectives(vue.createVNode(_component_uv_icon, {
- name: "eye-off-outline",
- color: "#2979ff",
- size: "18",
- onClick: $options.setshowpasswod1
- }, null, 8, ["onClick"]), [
- [vue.vShow, !$data.showpasswod1]
- ]),
- vue.withDirectives(vue.createVNode(_component_uv_icon, {
- name: "eye",
- color: "#2979ff",
- size: "18",
- onClick: $options.setshowpasswod1
- }, null, 8, ["onClick"]), [
- [vue.vShow, $data.showpasswod1]
- ])
- ]),
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_input, {
- modelValue: $data.logininfo.pw1,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.logininfo.pw1 = $event),
- modelModifiers: { trim: true },
- type: $data.passwordtype1,
- border: "none"
- }, null, 8, ["modelValue", "type"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1",
- customStyle: "margin-top: 20px"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("password_repeat")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_form_item, {
- prop: "pw2",
- borderBottom: ""
- }, {
- right: vue.withCtx(() => [
- vue.withDirectives(vue.createVNode(_component_uv_icon, {
- name: "eye-off-outline",
- color: "#2979ff",
- size: "18",
- onClick: $options.setshowpasswod2
- }, null, 8, ["onClick"]), [
- [vue.vShow, !$data.showpasswod2]
- ]),
- vue.withDirectives(vue.createVNode(_component_uv_icon, {
- name: "eye",
- color: "#2979ff",
- size: "18",
- onClick: $options.setshowpasswod2
- }, null, 8, ["onClick"]), [
- [vue.vShow, $data.showpasswod2]
- ])
- ]),
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_input, {
- modelValue: $data.logininfo.pw2,
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.logininfo.pw2 = $event),
- modelModifiers: { trim: true },
- type: $data.passwordtype2,
- border: "none"
- }, null, 8, ["modelValue", "type"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- text: _ctx.$t("register"),
- customStyle: "margin-top: 20px",
- onClick: $options.submit
- }, null, 8, ["text", "onClick"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }, 8, ["model", "rules"]),
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- plain: true,
- throttleTime: $data.throttleTime,
- text: _ctx.$t("login"),
- customStyle: "margin-top: 2rem",
- onClick: _ctx.toregister
- }, null, 8, ["throttleTime", "text", "onClick"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ])
- ]);
- }
- const PagesRegisterRegister = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__file", "D:/workspace/uniapp/health2/pages/register/register.vue"]]);
- const _sfc_main$h = {
- data() {
- return {};
- },
- methods: {}
- };
- function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view");
- }
- const PagesMemberMember = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g], ["__file", "D:/workspace/uniapp/health2/pages/member/member.vue"]]);
- const _sfc_main$g = {
- data() {
- return {
- userinfo: {},
- selectuser_list: [
- {
- title: this.$t("father"),
- gender: "1",
- selected: false
- },
- {
- title: this.$t("mother"),
- gender: "2",
- selected: false
- },
- {
- title: this.$t("husband"),
- gender: "1",
- selected: false
- },
- {
- title: this.$t("wife"),
- gender: "2",
- selected: false
- },
- {
- title: "",
- gender: "1",
- selected: false
- },
- {
- title: "",
- gender: "2",
- selected: false
- }
- ],
- other_member_1: "",
- other_member_2: "",
- showdiv: false,
- memberlist: [],
- letcount: 0
- };
- },
- methods: {
- adduser() {
- },
- itemselect(index2) {
- this.selectuser_list[index2 - 1].selected = !this.selectuser_list[index2 - 1].selected;
- if (index2 == 5) {
- this.selectuser_list[index2 - 1].title = other_member_1;
- }
- if (index2 == 6) {
- this.selectuser_list[index2 - 1].title = other_member_2;
- }
- },
- addother(gender) {
- let title = "";
- let fmemberid = this.memberlist.length + 1;
- let subanswerinfo = {
- userid: this.userinfo.id,
- fmemberid,
- stemid: 3,
- answertype: 1
- };
- if (1 == gender) {
- if (this.other_member_1.length <= 0) {
- this.$refs.toast.show({
- type: "error",
- message: this.$t("member_title_null")
- });
- return false;
- }
- title = this.other_member_1;
- subanswerinfo.answeroption = this.$t("man");
- subanswerinfo.answeroptionid = 64;
- }
- if (2 == gender) {
- formatAppLog("log", "at pages/member/add.vue:219", this.other_member_2, this.other_member_2.length);
- if (this.other_member_2.length <= 0) {
- this.$refs.toast.show({
- type: "error",
- message: this.$t("member_title_null")
- });
- return false;
- }
- title = this.other_member_2;
- subanswerinfo.answeroption = this.$t("female");
- subanswerinfo.answeroptionid = 65;
- }
- let subanswerlist = [];
- subanswerlist.push(subanswerinfo);
- var subinfo = {
- answer: JSON.stringify(subanswerlist),
- userid: this.userinfo.id,
- fmemberid: this.memberlist.length,
- srid: 0,
- scaleid: 1,
- membername: title,
- gender
- };
- submembergenderbyuserid(subinfo).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- }
- if (200 == res.code) {
- this.$refs.toast.show({
- type: "success",
- message: this.$t("do_success")
- });
- uni.navigateTo({
- url: "/pages/index/index"
- });
- }
- });
- },
- setshowdiv() {
- this.showdiv = !this.showdiv;
- },
- addmemberbylist() {
- let selectlist = [];
- this.selectuser_list.map((item) => {
- if (item.selected) {
- selectlist.push(item);
- }
- });
- this.letcount = this.memberlist.length - 2 + selectlist.length;
- if (this.letcount > this.userinfo.fmembercount) {
- this.$refs.toast.show({
- type: "error",
- message: this.$t("member_num_than_max")
- });
- return false;
- }
- selectlist.map((item, index2) => {
- item.fmemberid = this.selectuser_list.length + index2;
- var answerinfo = {
- userid: this.userinfo.id,
- fmemberid: item.fmemberid,
- stemid: 3,
- answertype: 1
- };
- if (item.gender == 1) {
- answerinfo.answeroption = this.$t("man");
- answerinfo.answeroptionid = 64;
- } else {
- answerinfo.answeroption = this.$t("female");
- answerinfo.answeroptionid = 65;
- }
- item.answer = JSON.stringify([answerinfo]);
- });
- let data = {
- memberlist: selectlist,
- mcount: selectlist.length,
- userid: this.userinfo.id
- };
- subfmemberlistbyuserid(data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- }
- if (200 == res.code) {
- this.$refs.toast.show({
- type: "success",
- message: this.$t("do_success")
- });
- uni.navigateTo({
- url: "/pages/index/index"
- });
- }
- });
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t("add_member")
- });
- this.userinfo = uni.getStorageSync("userinfo");
- this.memberlist = uni.getStorageSync("memberlist");
- }
- };
- function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
- const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
- const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
- const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
- const _component_uv_line = resolveEasycom(vue.resolveDynamicComponent("uv-line"), __easycom_5);
- const _component_uv_input = resolveEasycom(vue.resolveDynamicComponent("uv-input"), __easycom_6$1);
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "titlearea" }, [
- vue.createElementVNode(
- "view",
- { class: "firsttitle" },
- vue.toDisplayString(_ctx.$t("member_add_text_1")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "view",
- { class: "title_2" },
- vue.toDisplayString(_ctx.$t("member_add_text_2")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "memberarea2" }, [
- vue.createVNode(_component_uv_row, { class: "item" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, { span: "7" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("add_member_text1")
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("add_member_text2")
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("add_member_text3")
- }, null, 8, ["text"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, { span: "5" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_row, { justify: "around" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "6",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_image, {
- src: "/static/image/selecttype/man.png",
- shape: "circle",
- width: "60",
- height: "60"
- }),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass({ paretareabutton_select: $data.selectuser_list[0].selected, addbtn: !$data.selectuser_list[0].selected }),
- onClick: _cache[0] || (_cache[0] = ($event) => $options.itemselect(1))
- },
- vue.toDisplayString(_ctx.$t("father")),
- 3
- /* TEXT, CLASS */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "6",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_image, {
- src: "/static/image/selecttype/woman.png",
- shape: "circle",
- width: "60",
- height: "60"
- }),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass({ paretareabutton_select: $data.selectuser_list[1].selected, addbtn: !$data.selectuser_list[1].selected }),
- onClick: _cache[1] || (_cache[1] = ($event) => $options.itemselect(2))
- },
- vue.toDisplayString(_ctx.$t("mother")),
- 3
- /* TEXT, CLASS */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_line, { length: "80%" }),
- vue.createVNode(_component_uv_row, { class: "item" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, { span: "7" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("add_member_text4")
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("add_member_text5")
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("add_member_text6")
- }, null, 8, ["text"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, { span: "5" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_row, { justify: "around" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "6",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_image, {
- src: "/static/image/selecttype/man.png",
- shape: "circle",
- width: "60",
- height: "60"
- }),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass({ paretareabutton_select: $data.selectuser_list[2].selected, addbtn: !$data.selectuser_list[2].selected }),
- onClick: _cache[2] || (_cache[2] = ($event) => $options.itemselect(3))
- },
- vue.toDisplayString(_ctx.$t("husband")),
- 3
- /* TEXT, CLASS */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "6",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_image, {
- src: "/static/image/selecttype/woman.png",
- shape: "circle",
- width: "60",
- height: "60"
- }),
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass({ paretareabutton_select: $data.selectuser_list[3].selected, addbtn: !$data.selectuser_list[3].selected }),
- onClick: _cache[3] || (_cache[3] = ($event) => $options.itemselect(4))
- },
- vue.toDisplayString(_ctx.$t("wife")),
- 3
- /* TEXT, CLASS */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- vue.createCommentVNode(` <view class="memberarea"> \r
- <view class="parentarea">\r
- <uv-row>\r
- <uv-col span="7">\r
- <uv-text text="父母有没有"></uv-text>\r
- <uv-text text="心梗脑梗的风险?"></uv-text>\r
- <uv-text text="帮他们评测!"></uv-text>\r
- </uv-col>\r
- <uv-col span="5">\r
- <uv-row justify="around">\r
- <uv-col span="6" align="center">\r
- <uv-image src="/static/image/selecttype/man.png" shape="circle" width="60" height="60"></uv-image>\r
- <view :class="{paretareabutton_select:selectuser_list[0].selected,addbtn:!selectuser_list[0].selected}" @click="itemselect(1)">\r
- {{ $t('father') }}\r
- </view>\r
- </uv-col>\r
- <uv-col span="6" align="center">\r
- <uv-image src="/static/image/selecttype/woman.png" shape="circle" width="60" height="60"></uv-image>\r
- <view :class="{paretareabutton_select:selectuser_list[1].selected,addbtn:!selectuser_list[1].selected}" @click="itemselect(2)">\r
- {{ $t('mother') }}\r
- </view>\r
- </uv-col>\r
- </uv-row>\r
- </uv-col>\r
- </uv-row>\r
- </view>\r
- <view class="parentarea">\r
- <uv-row>\r
- <uv-col span="7">\r
- <uv-text text="爱人工作繁忙"></uv-text>\r
- <uv-text text="应酬多,压力大,常喝酒"></uv-text>\r
- <uv-text text="有没有心脑血管的隐患?"></uv-text>\r
- </uv-col>\r
- <uv-col span="5">\r
- <uv-row justify="around">\r
- <uv-col span="6" align="center">\r
- <uv-image src="/static/image/selecttype/man.png" shape="circle" width="60" height="60"></uv-image>\r
- <view :class="{paretareabutton_select:selectuser_list[2].selected,addbtn:!selectuser_list[2].selected}" @click="itemselect(3)">\r
- {{ $t('husband') }}\r
- </view>\r
- </uv-col>\r
- <uv-col span="6" align="center">\r
- <uv-image src="/static/image/selecttype/woman.png" shape="circle" width="60" height="60"></uv-image>\r
- <view :class="{paretareabutton_select:selectuser_list[3].selected,addbtn:!selectuser_list[3].selected}" @click="itemselect(4)">\r
- {{ $t('wife') }}\r
- </view>\r
- </uv-col>\r
- </uv-row>\r
- </uv-col>\r
- </uv-row>\r
- </view>\r
- </view> `),
- vue.createElementVNode("view", { class: "othermember" }, [
- vue.createElementVNode(
- "view",
- {
- class: "show_view",
- onClick: _cache[4] || (_cache[4] = (...args) => $options.setshowdiv && $options.setshowdiv(...args))
- },
- vue.toDisplayString(_ctx.$t("other_member")),
- 1
- /* TEXT */
- )
- ]),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "selectarea" },
- [
- vue.createVNode(_component_uv_row, { justify: "around" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "6",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_image, {
- src: "/static/image/selecttype/man.png",
- shape: "circle",
- width: "100",
- height: "100"
- }),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("add_member_text7"),
- align: "center"
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_input, {
- placeholder: _ctx.$t("add_member_text9"),
- border: "bottom",
- modelValue: $data.other_member_1,
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.other_member_1 = $event),
- customStyle: "width:80px"
- }, null, 8, ["placeholder", "modelValue"]),
- vue.createElementVNode("view", {
- class: "paretareabutton_select",
- onClick: _cache[6] || (_cache[6] = ($event) => $options.addother(1))
- }, [
- vue.createVNode(_component_uv_icon, {
- name: "plus",
- color: "#fff",
- size: "10"
- })
- ])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "6",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_image, {
- src: "/static/image/selecttype/woman.png",
- shape: "circle",
- width: "100",
- height: "100"
- }),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("add_member_text8"),
- align: "center"
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_input, {
- placeholder: _ctx.$t("add_member_text9"),
- border: "bottom",
- modelValue: $data.other_member_2,
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.other_member_2 = $event),
- customStyle: "width:80px"
- }, null, 8, ["placeholder", "modelValue"]),
- vue.createElementVNode("view", {
- class: "paretareabutton_select",
- onClick: _cache[8] || (_cache[8] = ($event) => $options.addother(2))
- }, [
- vue.createVNode(_component_uv_icon, {
- name: "plus",
- color: "#fff",
- size: "10"
- })
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $data.showdiv]
- ]),
- vue.createElementVNode("view", { class: "buttonarea" }, [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- shape: "square",
- text: _ctx.$t("submit"),
- customStyle: "background:#648EB8;width:80%",
- onClick: $options.addmemberbylist
- }, null, 8, ["text", "onClick"])
- ]),
- vue.createElementVNode("br")
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesMemberAdd = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f], ["__scopeId", "data-v-154867a4"], ["__file", "D:/workspace/uniapp/health2/pages/member/add.vue"]]);
- const uvBadgeProps = {
- props: {
- // 是否显示圆点
- isDot: {
- type: Boolean,
- default: false
- },
- // 显示的内容
- value: {
- type: [Number, String],
- default: ""
- },
- // 是否显示
- show: {
- type: Boolean,
- default: true
- },
- // 最大值,超过最大值会显示 '{max}+'
- max: {
- type: [Number, String],
- default: 999
- },
- // 主题类型,error|warning|success|primary
- type: {
- type: [String, void 0, null],
- default: "error"
- },
- // 当数值为 0 时,是否展示 Badge
- showZero: {
- type: Boolean,
- default: false
- },
- // 背景颜色,优先级比type高,如设置,type参数会失效
- bgColor: {
- type: [String, null],
- default: null
- },
- // 字体颜色
- color: {
- type: [String, null],
- default: null
- },
- // 徽标形状,circle-四角均为圆角,horn-左下角为直角
- shape: {
- type: [String, void 0, null],
- default: "circle"
- },
- // 设置数字的显示方式,overflow|ellipsis|limit
- // overflow会根据max字段判断,超出显示`${max}+`
- // ellipsis会根据max判断,超出显示`${max}...`
- // limit会依据1000作为判断条件,超出1000,显示`${value/1000}K`,比如2.2k、3.34w,最多保留2位小数
- numberType: {
- type: [String, void 0, null],
- default: "overflow"
- },
- // 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,absolute为true时有效
- offset: {
- type: Array,
- default: () => []
- },
- // 是否反转背景和字体颜色
- inverted: {
- type: Boolean,
- default: false
- },
- // 是否绝对定位
- absolute: {
- type: Boolean,
- default: false
- },
- ...(_J = (_I = uni.$uv) == null ? void 0 : _I.props) == null ? void 0 : _J.badge
- }
- };
- const _sfc_main$f = {
- name: "uv-badge",
- mixins: [mpMixin, mixin, uvBadgeProps],
- 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 = this.$uv.addUnit(top);
- style.right = this.$uv.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);
- }
- },
- propsType() {
- return this.type || "error";
- }
- }
- };
- function _sfc_render$e(_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 ? "uv-badge--dot" : "uv-badge--not-dot", _ctx.inverted && "uv-badge--inverted", _ctx.shape === "horn" && "uv-badge--horn", `uv-badge--${$options.propsType}${_ctx.inverted ? "--inverted" : ""}`], "uv-badge"]),
- style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle), $options.badgeStyle])
- },
- vue.toDisplayString(_ctx.isDot ? "" : $options.showValue),
- 7
- /* TEXT, CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e], ["__scopeId", "data-v-91e4945b"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-badge/components/uv-badge/uv-badge.vue"]]);
- const props$3 = {
- props: {
- // 滑块的移动过渡时间,单位ms
- duration: {
- type: Number,
- default: 300
- },
- // tabs标签数组
- list: {
- type: Array,
- default: () => []
- },
- // 滑块颜色
- lineColor: {
- type: String,
- default: "#3c9cff"
- },
- // 菜单选择中时的样式
- activeStyle: {
- type: [String, Object],
- default: () => ({
- color: "#303133"
- })
- },
- // 菜单非选中时的样式
- inactiveStyle: {
- type: [String, Object],
- default: () => ({
- color: "#606266"
- })
- },
- // 滑块长度
- lineWidth: {
- type: [String, Number],
- default: 20
- },
- // 滑块高度
- lineHeight: {
- type: [String, Number],
- default: 3
- },
- // 滑块背景显示大小,当滑块背景设置为图片时使用
- lineBgSize: {
- type: String,
- default: "cover"
- },
- // 菜单item的样式
- itemStyle: {
- type: [String, Object],
- default: () => ({
- height: "44px",
- fontSize: "15px"
- })
- },
- // 菜单是否可滚动
- scrollable: {
- type: Boolean,
- default: true
- },
- // 当前选中标签的索引
- current: {
- type: [Number, String],
- default: 0
- },
- // 默认读取的键名
- keyName: {
- type: String,
- default: "name"
- },
- ...(_L = (_K = uni.$uv) == null ? void 0 : _K.props) == null ? void 0 : _L.tabs
- }
- };
- const _sfc_main$e = {
- name: "uv-tabs",
- emits: ["click", "change"],
- mixins: [mpMixin, mixin, props$3],
- 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) {
- this.innerCurrent = newValue;
- this.$nextTick(() => {
- this.resize();
- });
- }
- }
- },
- // list变化时,重新渲染list各项信息
- list(newValue, oldValue) {
- formatAppLog("log", "at uni_modules/uv-tabs/components/uv-tabs/uv-tabs.vue:149", newValue, oldValue);
- this.$nextTick(() => {
- this.resize();
- });
- }
- },
- computed: {
- textStyle() {
- return (index2) => {
- const style = {};
- const customeStyle = index2 == this.innerCurrent ? this.$uv.addStyle(this.activeStyle) : this.$uv.addStyle(
- this.inactiveStyle
- );
- if (this.list[index2].disabled) {
- style.color = "#c8c9cc";
- }
- return this.$uv.deepMerge(customeStyle, style);
- };
- },
- propsBadge() {
- return uvBadgeProps;
- }
- },
- async mounted() {
- this.init();
- },
- methods: {
- 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);
- let lineWidth = this.$uv.getPx(this.lineWidth);
- if (this.$uv.test.number(this.lineWidth) && this.$uv.unit) {
- lineWidth = this.$uv.getPx(`${this.lineWidth}${this.$uv.unit}`);
- }
- this.lineOffsetLeft = lineOffsetLeft + (tabItem.rect.width - lineWidth) / 2;
- if (this.firstTime) {
- setTimeout(() => {
- this.firstTime = false;
- }, 20);
- }
- },
- // nvue下设置滑块的位置
- animation(x, duration = 0) {
- },
- // 点击某一个标签
- clickHandler(item, index2) {
- this.$emit("click", {
- ...item,
- index: index2
- });
- if (item.disabled)
- return;
- if (this.innerCurrent != index2) {
- this.$emit("change", {
- ...item,
- index: index2
- });
- }
- this.innerCurrent = index2;
- this.$nextTick(() => {
- this.resize();
- });
- },
- init() {
- this.$uv.sleep().then(() => {
- this.resize();
- });
- },
- setScrollLeft() {
- const tabRect = this.list[this.innerCurrent];
- const offsetLeft = this.list.slice(0, this.innerCurrent).reduce((total, curr) => {
- return total + curr.rect.width;
- }, 0);
- const windowWidth = this.$uv.sys().windowWidth;
- let scrollLeft = offsetLeft - (this.tabsRect.width - tabRect.rect.width) / 2 - (windowWidth - this.tabsRect.right) / 2 + this.tabsRect.left / 2;
- scrollLeft = Math.min(scrollLeft, this.scrollViewWidth - this.tabsRect.width);
- this.scrollLeft = Math.max(0, scrollLeft);
- },
- // 获取所有标签的尺寸
- resize() {
- if (this.list.length === 0) {
- return;
- }
- Promise.all([this.getTabsRect(), this.getAllItemRect()]).then(([tabsRect, itemRect = []]) => {
- this.tabsRect = tabsRect;
- this.scrollViewWidth = 0;
- itemRect.map((item, index2) => {
- this.scrollViewWidth += item.width;
- this.list[index2].rect = item;
- });
- this.setLineLeft();
- this.setScrollLeft();
- });
- },
- // 获取导航菜单的尺寸
- getTabsRect() {
- return new Promise((resolve) => {
- this.queryRect("uv-tabs__wrapper__scroll-view").then((size) => resolve(size));
- });
- },
- // 获取所有标签的尺寸
- getAllItemRect() {
- return new Promise((resolve) => {
- const promiseAllArr = this.list.map((item, index2) => this.queryRect(
- `uv-tabs__wrapper__nav__item-${index2}`,
- true
- ));
- Promise.all(promiseAllArr).then((sizes) => resolve(sizes));
- });
- },
- // 获取各个标签的尺寸
- queryRect(el, item) {
- return new Promise((resolve) => {
- this.$uvGetRect(`.${el}`).then((size) => {
- resolve(size);
- });
- });
- }
- }
- };
- function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_badge = resolveEasycom(vue.resolveDynamicComponent("uv-badge"), __easycom_0$1);
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: "uv-tabs",
- style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle)])
- },
- [
- vue.createElementVNode("view", { class: "uv-tabs__wrapper" }, [
- vue.renderSlot(_ctx.$slots, "left", {}, void 0, true),
- vue.createElementVNode("view", { class: "uv-tabs__wrapper__scroll-view-wrapper" }, [
- vue.createElementVNode("scroll-view", {
- "scroll-x": _ctx.scrollable,
- "scroll-left": $data.scrollLeft,
- "scroll-with-animation": "",
- class: "uv-tabs__wrapper__scroll-view",
- "show-scrollbar": false,
- ref: "uv-tabs__wrapper__scroll-view"
- }, [
- vue.createElementVNode(
- "view",
- {
- class: "uv-tabs__wrapper__nav",
- ref: "uv-tabs__wrapper__nav",
- style: vue.normalizeStyle({
- flex: _ctx.scrollable ? "" : 1
- })
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList(_ctx.list, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", {
- class: vue.normalizeClass(["uv-tabs__wrapper__nav__item", [`uv-tabs__wrapper__nav__item-${index2}`, item.disabled && "uv-tabs__wrapper__nav__item--disabled"]]),
- key: index2,
- onClick: ($event) => $options.clickHandler(item, index2),
- ref_for: true,
- ref: `uv-tabs__wrapper__nav__item-${index2}`,
- style: vue.normalizeStyle([{ flex: _ctx.scrollable ? "" : 1 }, _ctx.$uv.addStyle(_ctx.itemStyle)])
- }, [
- vue.createElementVNode(
- "text",
- {
- class: vue.normalizeClass([[item.disabled && "uv-tabs__wrapper__nav__item__text--disabled"], "uv-tabs__wrapper__nav__item__text"]),
- style: vue.normalizeStyle([$options.textStyle(index2)])
- },
- vue.toDisplayString(item[_ctx.keyName]),
- 7
- /* TEXT, CLASS, STYLE */
- ),
- vue.createVNode(_component_uv_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"])
- ], 14, ["onClick"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- )),
- vue.createElementVNode(
- "view",
- {
- class: "uv-tabs__wrapper__nav__line",
- ref: "uv-tabs__wrapper__nav__line",
- style: vue.normalizeStyle([{
- width: _ctx.$uv.addUnit(_ctx.lineWidth),
- transform: `translate(${$data.lineOffsetLeft}px)`,
- transitionDuration: `${$data.firstTime ? 0 : _ctx.duration}ms`,
- height: $data.firstTime ? 0 : _ctx.$uv.addUnit(_ctx.lineHeight),
- background: _ctx.lineColor,
- backgroundSize: _ctx.lineBgSize
- }])
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )
- ], 8, ["scroll-x", "scroll-left"])
- ]),
- vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
- ])
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_4 = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d], ["__scopeId", "data-v-fd5fcf14"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-tabs/components/uv-tabs/uv-tabs.vue"]]);
- function queryuserhealthinfobyuid(data, e, callback = null) {
- let url2 = baseUrl + "/index.php/index/Healthmanger/queryuserhealthinfobyuid";
- return dorequest("post", url2, data, function(res) {
- if (callback) {
- callback(res);
- } else {
- if (0 == res.code) {
- e.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- }
- }
- });
- }
- function querymergereportlistbyuserid(data) {
- let url2 = baseUrl + "/index.php/index/Scale/querymergereportlistbyuserid";
- return dorequest(
- "post",
- url2,
- {
- userid: data.userid,
- fmemberid: data.fmemberid
- }
- );
- }
- function querystemperinfobyuserid(data) {
- let url2 = baseUrl + "/index.php/index/Healthmanger/querystemperinfobyuserid";
- return dorequest(
- "post",
- url2,
- {
- userid: data.userid,
- fmemberid: data.fmemberid
- }
- );
- }
- function querybmipercentage(bmi) {
- let url2 = baseUrl + "/index.php/index/Healthmanger/querybimpercentage";
- return dorequest(
- "post",
- url2,
- {
- bmi
- }
- );
- }
- function querypercentagebystemid(data) {
- let url2 = baseUrl + "/index.php/index/Healthmanger/querypercentagebystemid";
- return dorequest(
- "post",
- url2,
- {
- stemid: data.stemid,
- answeroptionid: data.answeroptionid
- }
- );
- }
- const _sfc_main$d = {
- data() {
- return {
- list: [],
- healthlist: [],
- info: {},
- userinfo: {},
- selectuser: {},
- labellist: [],
- activeStyle: {
- color: "#648EB8",
- fontWeight: "bold",
- transform: "scale(1.05)"
- // borderBottom:"2rpx double #648eb8"
- },
- selectitem: false,
- customStyleRiskmsg: {
- fontSize: "20px",
- marginBottom: "10rpx"
- },
- customStyleErrorText: {
- fontSize: "18px",
- marginBottom: "10rpx",
- color: "#648eb8"
- },
- share_userid: false,
- share_fmemberid: false
- };
- },
- methods: {
- getlist() {
- let data = {
- userid: this.share_userid ? this.share_userid : this.userinfo.id,
- fmemberid: this.share_fmemberid ? this.share_fmemberid : this.selectuser.fmemberid
- };
- querymergereportlistbyuserid(data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- let list = res.resultData;
- list.map((item, index2) => {
- item.noticelist = [];
- item.advicelist = [];
- if (parseInt(item.scoreresult) > parseInt(item.risklimit)) {
- item.havrisk = 1;
- item.answerlist.map((alitem, alindex) => {
- if (alitem.noticememo != "") {
- if (alitem.noticetype == 1) {
- item.noticelist.push(alitem.noticememo);
- }
- if (alitem.noticetype == 2) {
- item.advicelist.push(alitem.noticememo);
- }
- }
- });
- } else {
- item.havrisk = 0;
- }
- this.labellist.push({ name: item.diseasename });
- });
- this.list = list;
- this.selectitem = list[0];
- });
- },
- getinfo() {
- let data = {
- userid: this.share_userid ? this.share_userid : this.userinfo.id,
- fmemberid: this.share_fmemberid ? this.share_fmemberid : this.selectuser.fmemberid
- };
- queryuserhealthinfobyuid(data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- if (200 == res.code) {
- this.info = res.resultData;
- }
- });
- },
- gethealthlist() {
- let data = {
- userid: this.share_userid ? this.share_userid : this.userinfo.id,
- fmemberid: this.share_fmemberid ? this.share_fmemberid : this.selectuser.fmemberid
- };
- querystemperinfobyuserid(data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- if (200 == res.code) {
- let list = res.resultData;
- list.map((item) => {
- if (item.hvalue == 1) {
- item.strvalue = this.$t("y");
- } else {
- item.strvalue = this.$t("n");
- }
- });
- this.healthlist = list;
- }
- });
- },
- click(item) {
- let index2 = item.index;
- this.selectitem = this.list[index2];
- },
- change() {
- },
- share(data) {
- uni.share({
- provider: "weixin",
- scene: "WXSceneSession",
- type: 0,
- href: "testapp://pages/report/report?userid=" + this.userid + "&fmemberid=" + this.selectuser.fmemberid,
- //title: this.$t('navigationBarTitleText')+"分享",
- title: "分享",
- summary: "心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。",
- imageUrl: data.shareimg,
- success: function(res) {
- addlog({
- json: JSON.stringify(res),
- type: "uniapp信息"
- });
- formatAppLog("log", "at pages/report/report.vue:298", "success:" + JSON.stringify(res));
- },
- fail: function(err) {
- addlog({
- json: JSON.stringify(err),
- type: "uniapp错误"
- });
- formatAppLog("log", "at pages/report/report.vue:305", "fail:" + JSON.stringify(err));
- }
- });
- }
- },
- mounted() {
- this.userinfo = uni.getStorageSync("userinfo");
- this.selectuser = uni.getStorageSync("selectuser");
- uni.setNavigationBarTitle({
- title: this.$t("show_report")
- });
- this.getlist();
- this.getinfo();
- this.gethealthlist();
- },
- onLoad: function(option) {
- this.share_userid = option.userid;
- this.share_fmemberid = option.fmemberid;
- },
- onBackPress: function(option) {
- if (this.share_userid) {
- uni.redirectTo({
- url: "/pages/index/show"
- });
- } else {
- tohome();
- }
- return true;
- }
- };
- function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
- const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
- const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
- const _component_uv_tabs = resolveEasycom(vue.resolveDynamicComponent("uv-tabs"), __easycom_4);
- const _component_uv_line = resolveEasycom(vue.resolveDynamicComponent("uv-line"), __easycom_5);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "page" }, [
- vue.createElementVNode("view", { class: "bottomarc" }),
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- customStyle: "margin-top: 6%"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "10",
- offset: "1",
- class: "box1"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- class: "item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "4",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("illness_title")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "4",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("report_score")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "4",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("report_result")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.list, (item, index2) => {
- return vue.openBlock(), vue.createBlock(
- _component_uv_row,
- {
- justify: "space-between",
- key: index2,
- class: "item"
- },
- {
- default: vue.withCtx(() => [
- vue.createVNode(
- _component_uv_col,
- {
- span: "4",
- align: "center"
- },
- {
- default: vue.withCtx(() => [
- vue.createTextVNode(
- vue.toDisplayString(item.diseasename),
- 1
- /* TEXT */
- )
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- ),
- vue.createVNode(
- _component_uv_col,
- { span: "4" },
- {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- type: item.havrisk > 0 ? "error" : "success",
- text: item.scoreresult ? item.scoreresult : 0,
- align: "center"
- }, null, 8, ["type", "text"])
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- ),
- vue.createVNode(
- _component_uv_col,
- { span: "4" },
- {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- type: item.havrisk > 0 ? "error" : "success",
- text: item.havrisk > 0 ? _ctx.$t("risk") : _ctx.$t("low_risk"),
- align: "center"
- }, null, 8, ["type", "text"])
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- )
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createElementVNode("view", { class: "advicearea" }, [
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- class: "item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "12",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "advicelabel" },
- vue.toDisplayString(_ctx.$t("report_detail")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- $data.labellist.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createVNode(_component_uv_tabs, {
- list: $data.labellist,
- onClick: $options.click,
- customStyle: "align-items: center",
- itemStyle: "font-size:20px;height:40px;",
- current: "0",
- onChange: $options.change,
- activeStyle: $data.activeStyle,
- lineWidth: "30"
- }, null, 8, ["list", "onClick", "onChange", "activeStyle"])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "info_div" }, [
- $data.selectitem ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: ""
- }, [
- vue.createElementVNode(
- "view",
- { class: "diseasetitlestr" },
- vue.toDisplayString($data.selectitem.titlestr),
- 1
- /* TEXT */
- ),
- vue.withDirectives(vue.createElementVNode(
- "view",
- null,
- [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("report_text_1") + $data.selectitem.risklimit + _ctx.$t("report_text_1_1"),
- align: "center",
- type: "success"
- }, null, 8, ["text"])
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $data.selectitem.havrisk == 0]
- ]),
- $data.selectitem.havrisk == 1 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
- vue.createVNode(_component_uv_text, {
- text: $data.selectitem.riskmsg,
- align: "center",
- type: "error",
- customStyle: $data.customStyleRiskmsg
- }, null, 8, ["text", "customStyle"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("report_error_text_1"),
- align: "center",
- customStyle: $data.customStyleErrorText
- }, null, 8, ["text", "customStyle"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("report_error_text_2"),
- align: "center",
- customStyle: $data.customStyleErrorText
- }, null, 8, ["text", "customStyle"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("report_error_text_3"),
- align: "center",
- customStyle: $data.customStyleErrorText
- }, null, 8, ["text", "customStyle"]),
- vue.createVNode(_component_uv_row, { customStyle: "margin-top:20rpx" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, { span: "12" }, {
- default: vue.withCtx(() => [
- vue.withDirectives(vue.createElementVNode(
- "view",
- null,
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.selectitem.noticelist, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
- vue.createVNode(_component_uv_text, {
- text: index2 + 1 + "、" + item
- }, null, 8, ["text"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $data.selectitem.noticelist.length > 0]
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ])) : vue.createCommentVNode("v-if", true),
- vue.withDirectives(vue.createElementVNode(
- "view",
- { class: "noticearea" },
- [
- vue.createVNode(_component_uv_row, { customStyle: "" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "12",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "noticelabel" },
- vue.toDisplayString(_ctx.$t("health_advice")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_row, { customStyle: "" }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, { span: "12" }, {
- default: vue.withCtx(() => [
- vue.withDirectives(vue.createElementVNode(
- "view",
- null,
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.selectitem.advicelist, (item, index2) => {
- return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
- vue.createVNode(_component_uv_text, {
- text: index2 + 1 + "、" + item
- }, null, 8, ["text"])
- ]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $data.selectitem.advicelist.length > 0]
- ])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ],
- 512
- /* NEED_PATCH */
- ), [
- [vue.vShow, $data.selectitem.havrisk == 1]
- ])
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", { class: "report_explain" }, [
- vue.createElementVNode("view", { class: "advicearea" }, [
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- class: "item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "12",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- { class: "advicelabel" },
- vue.toDisplayString(_ctx.$t("report_explain")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- vue.createElementVNode("view", { class: "info_div1" }, [
- $data.info.age >= 40 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
- key: 0,
- text: _ctx.$t("report_explain_text_1"),
- type: "info",
- align: "center"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- $data.info.gender == "男" ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
- key: 1,
- text: _ctx.$t("report_explain_text_2"),
- type: "info",
- align: "center"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- $data.info.bmi > 24 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
- key: 2,
- text: _ctx.$t("report_explain_text_3") + $data.info.bmi + _ctx.$t("report_explain_text_3_1") + $data.info.height + _ctx.$t("report_explain_text_3_2") + $data.info.weightbmi24 + _ctx.$t("report_explain_text_3_3"),
- type: "info",
- align: "center"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- $data.info.sbp >= 140 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
- key: 3,
- text: _ctx.$t("report_explain_text_4"),
- type: "info"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
- ]),
- vue.createElementVNode("view", { class: "info_div1" }, [
- $data.info.fhstroke > 0 || $data.info.fhheart > 0 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
- key: 0,
- text: _ctx.$t("report_explain_text_5"),
- type: "info",
- align: "center"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- $data.info.issmoke > 0 || $data.info.isdrink > 0 || $data.info.isunsport > 0 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
- key: 1,
- text: _ctx.$t("report_explain_text_6"),
- type: "info",
- align: "center"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- $data.info.age >= 40 && $data.info.issmoke > 0 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
- key: 2,
- text: _ctx.$t("report_explain_text_7"),
- type: "info",
- align: "center"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- $data.info.isinspectabodomen > 0 || $data.info.isteghtness > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 3,
- class: ""
- }, [
- $data.info.isinspectabodomen > 1 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
- key: 0,
- text: _ctx.$t("report_explain_text_8"),
- type: "info",
- align: "center"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
- $data.info.isteghtness > 1 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
- key: 1,
- text: _ctx.$t("report_explain_text_9"),
- type: "info",
- align: "center"
- }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- vue.createVNode(_component_uv_line, { color: "#933333" }),
- vue.createElementVNode("view", { class: "healthinfolist" }, [
- vue.createElementVNode("view", { class: "grid" }, [
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- class: "item"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "3",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("healthy_habits"),
- bold: true,
- align: "center"
- }, null, 8, ["text"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "2",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("y_n"),
- bold: true,
- align: "center"
- }, null, 8, ["text"])
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "7",
- align: "center"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("healthy_personal_ratios"),
- bold: true,
- align: "center"
- }, null, 8, ["text"])
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- }),
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.healthlist, (item, index2) => {
- return vue.openBlock(), vue.createBlock(
- _component_uv_row,
- {
- justify: "space-between",
- class: "item",
- key: index2
- },
- {
- default: vue.withCtx(() => [
- vue.createVNode(
- _component_uv_col,
- {
- span: "3",
- align: "center"
- },
- {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- text: item.disstr,
- align: "center",
- size: "12"
- }, null, 8, ["text"])
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- ),
- vue.createVNode(
- _component_uv_col,
- {
- span: "2",
- align: "center"
- },
- {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- text: item.strvalue,
- align: "center",
- size: "12"
- }, null, 8, ["text"])
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- ),
- vue.createVNode(
- _component_uv_col,
- {
- span: "4",
- align: "center"
- },
- {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("all_people") + item.allpre + "%",
- align: "center",
- size: "12"
- }, null, 8, ["text"])
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- ),
- vue.createVNode(
- _component_uv_col,
- {
- span: "3",
- align: "center"
- },
- {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("group_people") + item.agepre + "%",
- align: "center",
- size: "12"
- }, null, 8, ["text"])
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- )
- ]),
- _: 2
- /* DYNAMIC */
- },
- 1024
- /* DYNAMIC_SLOTS */
- );
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("report_text_4"),
- align: "center",
- type: "info",
- bold: true
- }, null, 8, ["text"])
- ]),
- vue.createCommentVNode(` <uv-line color="#933333"></uv-line>\r
- <view class="info_div1">\r
- <uv-text :text="$t('report_text_5')" align="center" :bold="true"></uv-text>\r
- <br />\r
- <uv-text :text="$t('report_text_6')" type="info"></uv-text>\r
- <uv-text :text="$t('report_text_7')" type="info"></uv-text>\r
- <uv-text :text="$t('report_text_8')" type="info"></uv-text>\r
- </view> `),
- vue.createVNode(_component_uv_line, { color: "#933333" }),
- vue.createElementVNode("view", { class: "info_div1" }, [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("report_text_9"),
- bold: true,
- align: "center"
- }, null, 8, ["text"])
- ]),
- vue.createVNode(_component_uv_line, { color: "#933333" }),
- vue.createElementVNode("br"),
- vue.createCommentVNode(' <share @dosharewechat="share"></share> '),
- vue.createElementVNode("br")
- ])
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesReportReport = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c], ["__scopeId", "data-v-12a8021c"], ["__file", "D:/workspace/uniapp/health2/pages/report/report.vue"]]);
- const props$2 = {
- props: {
- bgColor: {
- type: String,
- default: "transparent"
- }
- }
- };
- const _sfc_main$c = {
- name: "uv-status-bar",
- mixins: [mpMixin, mixin, props$2],
- data() {
- return {};
- },
- computed: {
- style() {
- const style = {};
- style.height = this.$uv.addUnit(this.$uv.sys().statusBarHeight, "px");
- if (this.bgColor) {
- if (this.bgColor.indexOf("gradient") > -1) {
- style.backgroundImage = this.bgColor;
- } else {
- style.background = this.bgColor;
- }
- }
- return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- }
- }
- };
- function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- style: vue.normalizeStyle([$options.style]),
- class: "uv-status-bar"
- },
- [
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
- ],
- 4
- /* STYLE */
- );
- }
- const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b], ["__scopeId", "data-v-f5bd6f5a"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-status-bar/components/uv-status-bar/uv-status-bar.vue"]]);
- const _sfc_main$b = {
- name: "uv-safe-bottom",
- mixins: [mpMixin, mixin],
- data() {
- return {
- safeAreaBottomHeight: 0,
- isNvue: false
- };
- },
- computed: {
- style() {
- const style = {};
- return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- }
- },
- mounted() {
- }
- };
- function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock(
- "view",
- {
- class: vue.normalizeClass(["uv-safe-bottom", [!$data.isNvue && "uv-safe-area-inset-bottom"]]),
- style: vue.normalizeStyle([$options.style])
- },
- null,
- 6
- /* CLASS, STYLE */
- );
- }
- const __easycom_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a], ["__scopeId", "data-v-560f16b2"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-safe-bottom/components/uv-safe-bottom/uv-safe-bottom.vue"]]);
- const _sfc_main$a = {
- name: "uv-popup",
- components: {},
- mixins: [mpMixin, mixin],
- emits: ["change", "maskClick"],
- props: {
- // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
- // message: 消息提示 ; dialog : 对话框
- mode: {
- type: String,
- default: "center"
- },
- // 动画时长,单位ms
- duration: {
- type: [String, Number],
- default: 300
- },
- // 层级
- zIndex: {
- type: [String, Number],
- default: 10075
- },
- bgColor: {
- type: String,
- default: "#ffffff"
- },
- safeArea: {
- type: Boolean,
- default: true
- },
- // 是否显示遮罩
- overlay: {
- type: Boolean,
- default: true
- },
- // 点击遮罩是否关闭弹窗
- closeOnClickOverlay: {
- type: Boolean,
- default: true
- },
- // 遮罩的透明度,0-1之间
- overlayOpacity: {
- type: [Number, String],
- default: 0.4
- },
- // 自定义遮罩的样式
- overlayStyle: {
- type: [Object, String],
- default: ""
- },
- // 是否为iPhoneX留出底部安全距离
- safeAreaInsetBottom: {
- type: Boolean,
- default: true
- },
- // 是否留出顶部安全距离(状态栏高度)
- safeAreaInsetTop: {
- type: Boolean,
- default: false
- },
- // 是否显示关闭图标
- closeable: {
- type: Boolean,
- default: false
- },
- // 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角
- closeIconPos: {
- type: String,
- default: "top-right"
- },
- // mode=center,也即中部弹出时,是否使用缩放模式
- zoom: {
- type: Boolean,
- default: true
- },
- round: {
- type: [Number, String],
- default: 0
- },
- ...(_N = (_M = uni.$uv) == null ? void 0 : _M.props) == null ? void 0 : _N.popup
- },
- watch: {
- /**
- * 监听type类型
- */
- type: {
- handler: function(type2) {
- if (!this.config[type2])
- return;
- this[this.config[type2]](true);
- },
- immediate: true
- },
- isDesktop: {
- handler: function(newVal) {
- if (!this.config[newVal])
- return;
- this[this.config[this.mode]](true);
- },
- immediate: true
- },
- // H5 下禁止底部滚动
- showPopup(show) {
- }
- },
- data() {
- return {
- ani: [],
- showPopup: false,
- showTrans: false,
- popupWidth: 0,
- popupHeight: 0,
- config: {
- top: "top",
- bottom: "bottom",
- center: "center",
- left: "left",
- right: "right",
- message: "top",
- dialog: "center",
- share: "bottom"
- },
- transitionStyle: {
- position: "fixed",
- left: 0,
- right: 0
- },
- maskShow: true,
- mkclick: true,
- popupClass: this.isDesktop ? "fixforpc-top" : "top",
- direction: ""
- };
- },
- computed: {
- isDesktop() {
- return this.popupWidth >= 500 && this.popupHeight >= 500;
- },
- bg() {
- if (this.bgColor === "" || this.bgColor === "none" || this.$uv.getPx(this.round) > 0) {
- return "transparent";
- }
- return this.bgColor;
- },
- contentStyle() {
- const style = {};
- if (this.bgColor) {
- style.backgroundColor = this.bg;
- }
- if (this.round) {
- const value2 = this.$uv.addUnit(this.round);
- const mode = this.direction ? this.direction : this.mode;
- style.backgroundColor = this.bgColor;
- if (mode === "top") {
- style.borderBottomLeftRadius = value2;
- style.borderBottomRightRadius = value2;
- } else if (mode === "bottom") {
- style.borderTopLeftRadius = value2;
- style.borderTopRightRadius = value2;
- } else if (mode === "center") {
- style.borderRadius = value2;
- }
- }
- return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
- }
- },
- // TODO vue3
- unmounted() {
- this.setH5Visible();
- },
- created() {
- this.messageChild = null;
- this.clearPropagation = false;
- },
- methods: {
- setH5Visible() {
- },
- /**
- * 公用方法,不显示遮罩层
- */
- closeMask() {
- this.maskShow = false;
- },
- // TODO nvue 取消冒泡
- clear(e) {
- e.stopPropagation();
- this.clearPropagation = true;
- },
- open(direction) {
- if (this.showPopup) {
- return;
- }
- let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
- if (!(direction && innerType.indexOf(direction) !== -1)) {
- direction = this.mode;
- } else {
- this.direction = direction;
- }
- if (!this.config[direction]) {
- return this.$uv.error(`缺少类型:${direction}`);
- }
- this[this.config[direction]]();
- this.$emit("change", {
- show: true,
- type: direction
- });
- },
- close(type2) {
- this.showTrans = false;
- this.$emit("change", {
- show: false,
- type: this.mode
- });
- clearTimeout(this.timer);
- this.timer = setTimeout(() => {
- this.showPopup = false;
- }, 300);
- },
- // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
- touchstart() {
- this.clearPropagation = false;
- },
- onTap() {
- if (this.clearPropagation) {
- this.clearPropagation = false;
- return;
- }
- this.$emit("maskClick");
- if (!this.closeOnClickOverlay)
- return;
- this.close();
- },
- /**
- * 顶部弹出样式处理
- */
- top(type2) {
- this.popupClass = this.isDesktop ? "fixforpc-top" : "top";
- this.ani = ["slide-top"];
- this.transitionStyle = {
- position: "fixed",
- zIndex: this.zIndex,
- left: 0,
- right: 0,
- backgroundColor: this.bg
- };
- if (type2)
- return;
- this.showPopup = true;
- this.showTrans = true;
- this.$nextTick(() => {
- if (this.messageChild && this.mode === "message") {
- this.messageChild.timerClose();
- }
- });
- },
- /**
- * 底部弹出样式处理
- */
- bottom(type2) {
- this.popupClass = "bottom";
- this.ani = ["slide-bottom"];
- this.transitionStyle = {
- position: "fixed",
- zIndex: this.zIndex,
- left: 0,
- right: 0,
- bottom: 0,
- backgroundColor: this.bg
- };
- if (type2)
- return;
- this.showPopup = true;
- this.showTrans = true;
- },
- /**
- * 中间弹出样式处理
- */
- center(type2) {
- this.popupClass = "center";
- this.ani = this.zoom ? ["zoom-in", "fade"] : ["fade"];
- this.transitionStyle = {
- position: "fixed",
- zIndex: this.zIndex,
- display: "flex",
- flexDirection: "column",
- bottom: 0,
- left: 0,
- right: 0,
- top: 0,
- justifyContent: "center",
- alignItems: "center"
- };
- if (type2)
- return;
- this.showPopup = true;
- this.showTrans = true;
- },
- left(type2) {
- this.popupClass = "left";
- this.ani = ["slide-left"];
- this.transitionStyle = {
- position: "fixed",
- zIndex: this.zIndex,
- left: 0,
- bottom: 0,
- top: 0,
- backgroundColor: this.bg,
- display: "flex",
- flexDirection: "column"
- };
- if (type2)
- return;
- this.showPopup = true;
- this.showTrans = true;
- },
- right(type2) {
- this.popupClass = "right";
- this.ani = ["slide-right"];
- this.transitionStyle = {
- position: "fixed",
- zIndex: this.zIndex,
- bottom: 0,
- right: 0,
- top: 0,
- backgroundColor: this.bg,
- display: "flex",
- flexDirection: "column"
- };
- if (type2)
- return;
- this.showPopup = true;
- this.showTrans = true;
- }
- }
- };
- function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_overlay = resolveEasycom(vue.resolveDynamicComponent("uv-overlay"), __easycom_0$3);
- const _component_uv_status_bar = resolveEasycom(vue.resolveDynamicComponent("uv-status-bar"), __easycom_1$1);
- const _component_uv_safe_bottom = resolveEasycom(vue.resolveDynamicComponent("uv-safe-bottom"), __easycom_2$1);
- const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
- const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
- return $data.showPopup ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uv-popup", [$data.popupClass, $options.isDesktop ? "fixforpc-z-index" : ""]]),
- style: vue.normalizeStyle([{ zIndex: $props.zIndex }])
- },
- [
- vue.createElementVNode(
- "view",
- {
- onTouchstart: _cache[2] || (_cache[2] = (...args) => $options.touchstart && $options.touchstart(...args))
- },
- [
- vue.createCommentVNode(" 遮罩层 "),
- $data.maskShow && $props.overlay ? (vue.openBlock(), vue.createBlock(_component_uv_overlay, {
- key: "1",
- show: $data.showTrans,
- duration: $props.duration,
- "custom-style": $props.overlayStyle,
- opacity: $props.overlayOpacity,
- zIndex: $props.zIndex,
- onClick: $options.onTap
- }, null, 8, ["show", "duration", "custom-style", "opacity", "zIndex", "onClick"])) : vue.createCommentVNode("v-if", true),
- vue.createVNode(_component_uv_transition, {
- key: "2",
- mode: $data.ani,
- name: "content",
- "custom-style": $data.transitionStyle,
- duration: $props.duration,
- show: $data.showTrans,
- onClick: $options.onTap
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode(
- "view",
- {
- class: vue.normalizeClass(["uv-popup__content", [$data.popupClass]]),
- style: vue.normalizeStyle([$options.contentStyle]),
- onClick: _cache[1] || (_cache[1] = (...args) => $options.clear && $options.clear(...args))
- },
- [
- $props.safeAreaInsetTop ? (vue.openBlock(), vue.createBlock(_component_uv_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true),
- vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
- $props.safeAreaInsetBottom ? (vue.openBlock(), vue.createBlock(_component_uv_safe_bottom, { key: 1 })) : vue.createCommentVNode("v-if", true),
- $props.closeable ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 2,
- onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.close && $options.close(...args), ["stop"])),
- class: vue.normalizeClass(["uv-popup__content__close", ["uv-popup__content__close--" + $props.closeIconPos]]),
- "hover-class": "uv-popup__content__close--hover",
- "hover-stay-time": "150"
- },
- [
- vue.createVNode(_component_uv_icon, {
- name: "close",
- color: "#909399",
- size: "18",
- bold: ""
- })
- ],
- 2
- /* CLASS */
- )) : vue.createCommentVNode("v-if", true)
- ],
- 6
- /* CLASS, STYLE */
- )
- ]),
- _: 3
- /* FORWARDED */
- }, 8, ["mode", "custom-style", "duration", "show", "onClick"])
- ],
- 32
- /* NEED_HYDRATION */
- )
- ],
- 6
- /* CLASS, STYLE */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__scopeId", "data-v-01a3ad6e"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-popup/components/uv-popup/uv-popup.vue"]]);
- const _sfc_main$9 = {
- name: "radio",
- props: {
- //值
- selectvalue: {
- type: String,
- required: true,
- validator: function(value2) {
- return value2.length > 0;
- }
- },
- //标签
- label: {
- type: String,
- required: true,
- validator: function(value2) {
- return value2.length > 0;
- }
- },
- checked: {
- type: Boolean
- }
- },
- data() {
- return {};
- }
- };
- function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
- return vue.openBlock(), vue.createElementBlock("view", { class: "row" }, [
- vue.createElementVNode("view", null, [
- vue.createElementVNode(
- "label",
- { for: "" },
- vue.toDisplayString($props.label),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", null, [
- vue.createElementVNode("radio", {
- value: $props.selectvalue,
- checked: $props.checked,
- color: "rgb(100, 142, 184)",
- style: { "border-radius": "0" }
- }, null, 8, ["value", "checked"])
- ])
- ]);
- }
- const Radio = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__scopeId", "data-v-b6b9d1fa"], ["__file", "D:/workspace/uniapp/health2/components/radio.vue"]]);
- const _sfc_main$8 = {
- components: {
- Radio
- },
- data() {
- return {
- userinfo: {},
- selectuser: {},
- stemitem: {},
- scaleid: 0,
- srid: 0,
- sindex: 0,
- stemindexlabel: 1,
- selectanswer: "",
- answeroptionid: "",
- customStyle: {
- fontSize: "30px",
- width: "100%"
- },
- selectbutton2: {
- fontSize: "30px",
- width: "500rpx",
- background: "#648EB8",
- border: "0px"
- },
- selectbutton3: {
- fontSize: "20px",
- fontWeight: "bold",
- letterSpacing: "0.5em"
- },
- percent: 0,
- timer: false
- };
- },
- computed: {
- surplusstems() {
- let stemlist = uni.getStorageSync("stemlist");
- let value2 = 1;
- stemlist.map((item, index2) => {
- if (item.id == this.stemitem.id) {
- value2 = stemlist.length - index2;
- }
- });
- return value2;
- },
- comstatus() {
- let stemlist = uni.getStorageSync("stemlist");
- let sindex = parseInt(this.sindex);
- let count = stemlist.length - 2;
- if (sindex + 1 == count) {
- return true;
- } else {
- return false;
- }
- }
- },
- methods: {
- init() {
- this.userinfo = uni.getStorageSync("userinfo");
- this.selectuser = uni.getStorageSync("selectuser");
- this.stemitem = uni.getStorageSync("stemitem");
- },
- change(e) {
- let value2 = e.detail.value;
- let list = this.stemitem.alist;
- this.selectanswer = list[value2];
- },
- donext() {
- if ("" == this.selectanswer) {
- this.$refs.toast.show({
- type: "error",
- message: this.$t("please_completion_problem")
- });
- return false;
- }
- var answer = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- stemid: this.stemitem.id,
- answertype: 1,
- answeroptionid: this.selectanswer.id,
- answeroption: this.selectanswer.option
- };
- let data = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- srid: this.srid,
- scaleid: this.scaleid
- };
- subanswerbyuserid(answer, data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- if (200 == res.code) {
- uni.setStorage({
- key: "srid",
- data: res.resultData
- });
- let data2 = {
- stemid: this.stemitem.id,
- answeroptionid: this.selectanswer.id
- };
- formatAppLog("log", "at pages/topic/common.vue:181", this.comstatus);
- if (this.comstatus) {
- let srid = this.srid;
- subcomstatus(srid).then();
- uni.removeStorage({
- key: "stemitem"
- });
- uni.redirectTo({
- url: "/pages/report/report"
- });
- } else {
- querypercentagebystemid(data2).then((res2) => {
- res2 = res2.data;
- if (0 == res2.code) {
- let result = tostemlistnext(this.sindex, 1);
- if (!result) {
- this.$refs.toast.show({
- type: "error",
- message: this.$t("system_error")
- });
- return false;
- }
- }
- if (200 == res2.code) {
- this.percent = res2.resultData + "%";
- this.showinfo();
- let that = this;
- this.timer = setTimeout(function() {
- that.closeinfo();
- tostemlistnext(that.sindex, 1);
- }, 3e3);
- }
- });
- }
- }
- });
- },
- showinfo() {
- this.$refs.popup.open();
- },
- closeinfo() {
- this.$refs.popup.close();
- },
- maskClick() {
- clearTimeout(this.timer);
- this.$refs.popup.close();
- tostemlistnext(this.sindex, 1);
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t("scale_evaluation")
- });
- this.init();
- },
- onLoad: function(option) {
- this.scaleid = option.scaleid;
- this.srid = option.srid;
- this.sindex = option.sindex;
- },
- onBackPress: function(option) {
- tohome();
- return true;
- }
- };
- function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_Radio = vue.resolveComponent("Radio");
- const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
- const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
- const _component_uv_popup = resolveEasycom(vue.resolveDynamicComponent("uv-popup"), __easycom_2);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "titlearea" }, [
- vue.createElementVNode(
- "text",
- { class: "title_2" },
- vue.toDisplayString(_ctx.$t("completion_problem_for_valuating_people")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "title_member" },
- vue.toDisplayString(_ctx.$t("valuating_people")) + ":" + vue.toDisplayString($data.selectuser.membername),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "info_div" }, [
- vue.createElementVNode("view", { class: "text_div" }, [
- vue.createElementVNode(
- "text",
- { class: "title1" },
- vue.toDisplayString($data.stemitem.stem),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "text_div" }, [
- vue.createElementVNode(
- "text",
- { class: "title2" },
- vue.toDisplayString($data.stemitem.disstr),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode("view", { class: "info_div" }, [
- 1 == $data.stemitem.stemtype ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: ""
- }, [
- vue.createCommentVNode(" 单选 ")
- ])) : vue.createCommentVNode("v-if", true),
- 2 == $data.stemitem.stemtype ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: ""
- }, [
- vue.createCommentVNode(" 多选 ")
- ])) : vue.createCommentVNode("v-if", true),
- vue.createCommentVNode(` <uv-radio-group v-model="selectanswer" placement="column" @change="change" >\r
- <uv-radio \r
- shape="square"\r
- iconSize="30"\r
- labelSize="30"\r
- size="30"\r
- :customStyle="{margin: '10px'}" \r
- v-for="(item, index) in stemitem.alist" \r
- :key="index" \r
- :name="item">\r
- <slot name="default">\r
- <text class="select_label"> {{item.option}} 1</text>\r
- </slot>\r
- </uv-radio>\r
- </uv-radio-group> `),
- vue.createElementVNode(
- "radio-group",
- {
- onChange: _cache[0] || (_cache[0] = (...args) => $options.change && $options.change(...args)),
- style: { "width": "90%" }
- },
- [
- (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- null,
- vue.renderList($data.stemitem.alist, (item, index2) => {
- return vue.openBlock(), vue.createBlock(_component_Radio, {
- selectvalue: index2,
- label: item.option,
- key: index2
- }, null, 8, ["selectvalue", "label"]);
- }),
- 128
- /* KEYED_FRAGMENT */
- ))
- ],
- 32
- /* NEED_HYDRATION */
- )
- ]),
- vue.createElementVNode("view", { class: "donext_div" }, [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- text: _ctx.$t("next_step"),
- onClick: $options.donext,
- customStyle: $data.selectbutton2,
- customTextStyle: $data.selectbutton3
- }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
- ]),
- $data.sindex == 11 && $data.scaleid == 4 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 0,
- class: "completedis"
- }, [
- vue.createElementVNode(
- "text",
- { class: "pregresstext" },
- vue.toDisplayString(_ctx.$t("completion_text_1")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "pregresstext" },
- vue.toDisplayString(_ctx.$t("completion_text_2")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- $options.surplusstems < 9 && $options.surplusstems > 1 ? (vue.openBlock(), vue.createElementBlock("view", {
- key: 1,
- class: "progressarea"
- }, [
- vue.createElementVNode(
- "text",
- { class: "pregresstext" },
- vue.toDisplayString($options.surplusstems - 1) + vue.toDisplayString(_ctx.$t("questions_remaining")),
- 1
- /* TEXT */
- )
- ])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", null, [
- vue.createVNode(_component_uv_popup, {
- ref: "popup",
- mode: "bottom",
- onMaskClick: $options.maskClick
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "over_percent_div" }, [
- vue.createElementVNode("view", { class: "content" }, [
- vue.createVNode(_component_uv_text, {
- text: $data.stemitem.stem,
- align: "center",
- size: "25"
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("have") + $data.percent,
- type: "success",
- bold: "true",
- align: "center",
- size: "30"
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("same_as_you"),
- align: "center",
- size: "25"
- }, null, 8, ["text"])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["onMaskClick"])
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesTopicCommon = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__file", "D:/workspace/uniapp/health2/pages/topic/common.vue"]]);
- function isString$1(value2) {
- return "string" == typeof value2;
- }
- function isObject$2(value2) {
- return "object" == typeof value2;
- }
- function isArray$1(value2) {
- return "array" == typeof value2;
- }
- function isLawfulType(type2, value2) {
- let valye_type = typeof value2;
- if (isString$1(type2)) {
- type2 = type2.toLowerCase();
- return type2 == valye_type;
- }
- if (isArray$1(type2)) {
- return type2.indexOf(valye_type) ? true : false;
- }
- return false;
- }
- function isFunction$1(value2) {
- return "function" == typeof value2;
- }
- let config = {
- canvasid: {
- type: "string",
- required: true,
- validator: function(value2) {
- return value2.length > 0;
- },
- value: ""
- },
- canvascursorid: {
- type: "string",
- required: true,
- validator: function(value2) {
- return value2.length > 0;
- },
- value: ""
- },
- minvalue: {
- type: "number",
- required: true,
- validator: function(value2) {
- return value2 > 0;
- },
- value: 0
- },
- maxvalue: {
- type: "number",
- required: true,
- validator: function(value2) {
- return value2 > 0;
- },
- value: 0
- },
- interval: {
- type: "number",
- required: true,
- validator: function(value2) {
- return value2 > 0;
- },
- value: 0
- },
- defaultvalue: {
- type: "number",
- required: true,
- validator: function(value2) {
- return value2 > 0;
- },
- value: 0
- },
- precision: {
- //小数点位数
- type: "number",
- validator: function(value2) {
- let values = [0, 1, 2];
- return values.indexOf(value2) >= 0;
- },
- value: 0
- }
- };
- let screenWidth = 0;
- let screenHeight = 0;
- let heightDecimal = 50;
- let heightDigit = 25;
- let ratio = 10;
- let fontSize = 20;
- let canvasHeight = 80;
- let harfline = 5;
- let lineWidth1 = 1;
- let lineWidth2 = 2;
- let rulecolor1 = "#FFA500";
- let rulecolor2 = "#FF8C00";
- let cursorcolor = "#0000FF";
- let canvasWidth = 0;
- let value = 0;
- let scroll_left = 0;
- function getvalue(key) {
- return typeof config[key].value != "undefined" ? config[key].value : false;
- }
- function setconfig(param) {
- if (!isObject$2(param)) {
- throw new Error("drawruler param error");
- }
- Object.entries(config).forEach(([k, v]) => {
- if (v.required) {
- if (!param[k]) {
- throw new Error("param " + k + " required");
- }
- }
- let value2 = param[k];
- if (v.type) {
- if (!isLawfulType(v.type, value2)) {
- throw new Error("param " + k + " type error");
- }
- }
- if (isFunction$1(v.validator)) {
- if (!v.validator(value2)) {
- throw new Error("param " + k + " value error");
- }
- }
- v.value = value2;
- config[k] = v;
- });
- }
- function dodrawruler() {
- var context = uni.createCanvasContext(getvalue("canvasid"));
- let minvalue = getvalue("minvalue");
- let maxvalue = getvalue("maxvalue");
- let interval = getvalue("interval");
- let origionX = 0;
- origionX = screenWidth / 2;
- let origion = { x: origionX, y: 0 };
- let i = minvalue;
- while (i <= maxvalue) {
- context.beginPath();
- let movetoX = origion.x + (i - minvalue) * ratio;
- let movetoY = 0;
- context.moveTo(movetoX, movetoY);
- let linetoX = origion.x + (i - minvalue) * ratio;
- let linetoY = i % ratio == 0 ? heightDecimal : heightDigit;
- context.lineTo(linetoX, linetoY);
- context.setLineWidth(lineWidth2);
- context.setStrokeStyle(i % ratio == 0 ? rulecolor1 : rulecolor2);
- context.stroke();
- context.setFillStyle("gray");
- if (i % ratio == 0) {
- context.setFontSize(fontSize);
- context.fillText(i == 0 ? " " + i : i, origion.x + (i - minvalue) * ratio - fontSize / 2, heightDecimal + 5 + fontSize);
- }
- context.closePath();
- i += interval;
- }
- setTimeout(() => {
- context.draw();
- }, 50);
- }
- function setCanvasConfig() {
- uni.getSystemInfo({
- success: (res) => {
- screenWidth = res.windowWidth;
- screenHeight = res.windowHeight;
- }
- });
- canvasWidth = (getvalue("maxvalue") - getvalue("minvalue")) * ratio + screenWidth;
- config["canvasWidth"] = {
- value: canvasWidth
- };
- config["canvasHeight"] = {
- value: canvasHeight
- };
- }
- function getCanvasConfig() {
- let use_config = {
- canvasWidth: getvalue("canvasWidth"),
- canvasHeight: getvalue("canvasHeight"),
- screenWidth,
- screenHeight
- };
- return use_config;
- }
- function drowncursor() {
- var context = uni.createCanvasContext(getvalue("canvascursorid"));
- var center = { x: screenWidth / 2, y: 0 };
- center.y = harfline * Math.sqrt(3);
- var right = { x: center.x - harfline, y: 0 };
- var left = { x: center.x + harfline, y: 0 };
- context.beginPath();
- context.moveTo(right.x, 0);
- context.lineTo(left.x, 0);
- context.lineTo(center.x, center.y);
- context.closePath();
- context.setFillStyle(cursorcolor);
- context.fill();
- context.moveTo(center.x, 0);
- context.lineTo(center.x, 50);
- context.setLineWidth(lineWidth1);
- context.setStrokeStyle(cursorcolor);
- context.stroke();
- context.draw(true);
- let defaultvalue = getvalue("defaultvalue");
- if (defaultvalue > 0) {
- let minvalue = getvalue("minvalue");
- value = defaultvalue;
- scroll_left = (value - minvalue) * 10;
- } else {
- let midvalue = (getvalue("maxvalue") - getvalue("minvalue")) / 2;
- value = midvalue + getvalue("minvalue");
- scroll_left = canvasWidth / 2 - screenWidth / 2;
- }
- }
- function getcursorvalue() {
- return value;
- }
- function getscrollleft() {
- return scroll_left;
- }
- function drawruler(param) {
- setconfig(param);
- setCanvasConfig();
- dodrawruler();
- drowncursor();
- }
- function setcursorvalue(scrollLeft, minvalue = 0) {
- if (minvalue <= 0) {
- minvalue = getvalue("minvalue");
- }
- let precision = getvalue("precision");
- let value2 = 0;
- if (precision == 0) {
- value2 = Math.round(scrollLeft / 10) + minvalue;
- } else {
- value2 = parseFloat((scrollLeft / 10).toFixed(precision)) + minvalue;
- }
- return value2;
- }
- const _sfc_main$7 = {
- data() {
- return {
- minage: 18,
- maxage: 80,
- userinfo: {},
- selectuser: {},
- viewage: 35,
- selectbutton1: {
- fontSize: "30px",
- width: "500rpx",
- borderColor: "#648EB8",
- color: "#648EB8"
- },
- selectbutton2: {
- fontSize: "30px",
- width: "500rpx",
- background: "#648EB8",
- border: "0px"
- },
- selectbutton3: {
- fontSize: "20px",
- fontWeight: "bold",
- letterSpacing: "0.5em"
- },
- scaleid: 0,
- srid: 0,
- sindex: 0,
- stemid: 1,
- answertype: 0,
- canvasHeight: 80,
- canvasWidth: 1e3,
- scroll_left: 0
- };
- },
- computed: {
- columns() {
- let list = [];
- for (var i = this.minage; i <= this.maxage; i++) {
- let label = i + this.$t("select_age_1");
- if (i <= this.minage) {
- label = i + this.$t("select_age_3");
- }
- if (i >= this.maxage) {
- label = i + this.$t("select_age_2");
- }
- let item = {
- label,
- value: i
- };
- list.push(item);
- }
- return [list];
- },
- style() {
- let value2 = {
- canvasHeight: this.canvasHeight + "px",
- canvasWidth: this.canvasWidth + "px",
- screenWidth: this.screenWidth + "px"
- };
- return value2;
- }
- },
- methods: {
- init() {
- this.userinfo = uni.getStorageSync("userinfo");
- this.selectuser = uni.getStorageSync("selectuser");
- },
- showselectage() {
- this.$refs.picker.open();
- let index2 = this.viewage - this.minage;
- this.$refs.picker.setIndexs([index2], true);
- },
- confirm(e) {
- let value2 = e.value[0].value;
- this.viewage = value2;
- },
- change(e) {
- let value2 = e.value[0].value;
- this.viewage = value2;
- },
- donext() {
- let answer = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- stemid: this.stemid,
- answertype: this.answertype,
- answervalue: this.viewage
- };
- let data = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- srid: this.srid,
- scaleid: this.scaleid
- };
- subanswerbyuserid(answer, data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- if (200 == res.code) {
- uni.setStorage({
- key: "srid",
- data: res.resultData
- });
- tostemlistnext(this.sindex, 1);
- }
- });
- },
- drawruler() {
- let param = {
- canvasid: "canvas_ruler",
- canvascursorid: "canvas-cursor",
- minvalue: this.minage,
- maxvalue: this.maxage,
- interval: 1,
- defaultvalue: this.viewage,
- precision: 0
- };
- drawruler(param);
- this.viewage = getcursorvalue();
- this.canvasHeight = getCanvasConfig().canvasHeight;
- this.canvasWidth = getCanvasConfig().canvasWidth;
- this.screenWidth = getCanvasConfig().screenWidth;
- this.scroll_left = getscrollleft();
- },
- scroll(e) {
- this.viewage = setcursorvalue(e.detail.scrollLeft);
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t("select_age")
- });
- this.init();
- },
- onLoad: function(option) {
- this.scaleid = option.scaleid;
- this.srid = option.srid;
- this.sindex = option.sindex;
- },
- onBackPress: function(option) {
- tohome();
- return true;
- },
- onReady() {
- this.drawruler();
- }
- };
- function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "titlearea" }, [
- vue.createElementVNode(
- "text",
- { class: "title_2" },
- vue.toDisplayString(_ctx.$t("selectage_test1")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "title_member" },
- vue.toDisplayString(_ctx.$t("report_user")) + ":" + vue.toDisplayString($data.selectuser.membername),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectage_test2")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "agevalue" }, [
- vue.createElementVNode("view", { class: "" }, [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("select_age")) + ": ",
- 1
- /* TEXT */
- ),
- vue.withDirectives(vue.createElementVNode(
- "text",
- { class: "strage" },
- "29" + vue.toDisplayString(_ctx.$t("select_age_3")),
- 513
- /* TEXT, NEED_PATCH */
- ), [
- [vue.vShow, $data.viewage <= 29]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "text",
- { class: "strage" },
- vue.toDisplayString($data.viewage) + vue.toDisplayString(_ctx.$t("select_age_1")),
- 513
- /* TEXT, NEED_PATCH */
- ), [
- [vue.vShow, $data.viewage > 29 && $data.viewage < 70]
- ]),
- vue.withDirectives(vue.createElementVNode(
- "text",
- { class: "strage" },
- "70" + vue.toDisplayString(_ctx.$t("select_age_2")),
- 513
- /* TEXT, NEED_PATCH */
- ), [
- [vue.vShow, $data.viewage >= 70]
- ])
- ]),
- vue.createCommentVNode(` <uv-button type="primary" :plain="true" :text="$t('select')" @click="showselectage" :customStyle="selectbutton1" :customTextStyle="selectbutton3"></uv-button> `)
- ]),
- vue.createCommentVNode(' <view class="">\r\n <uv-picker ref="picker" :columns="columns" @confirm="confirm" @change="change" keyName="label" :showToolbar="false" fontSize="25px"></uv-picker>\r\n </view> '),
- vue.createElementVNode(
- "view",
- {
- class: "showdiv",
- id: "showdiv",
- style: vue.normalizeStyle({ height: $options.style.canvasHeight })
- },
- [
- vue.createElementVNode("scroll-view", {
- style: { "width": "100%", "height": "100%" },
- "scroll-x": true,
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.scroll && $options.scroll(...args)),
- "scroll-left": $data.scroll_left,
- "show-scrollbar": false
- }, [
- vue.createElementVNode("canvas", {
- style: vue.normalizeStyle({ width: $options.style.canvasWidth, height: $options.style.canvasHeight }),
- "canvas-id": "canvas_ruler",
- id: "canvas_ruler",
- width: $data.canvasWidth
- }, null, 12, ["width"])
- ], 40, ["scroll-left"]),
- vue.createElementVNode(
- "canvas",
- {
- style: vue.normalizeStyle({ width: $options.style.screenWidth, height: $options.style.canvasHeight }),
- "canvas-id": "canvas-cursor",
- id: "canvas-cursor"
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "donext_div" }, [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- text: _ctx.$t("next_step"),
- onClick: $options.donext,
- customStyle: $data.selectbutton2,
- customTextStyle: $data.selectbutton3
- }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesTopicSelectage = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__scopeId", "data-v-f28d192f"], ["__file", "D:/workspace/uniapp/health2/pages/topic/selectage.vue"]]);
- const _sfc_main$6 = {
- data() {
- return {
- userinfo: {},
- selectuser: {},
- scaleid: 0,
- srid: 0,
- scaleid: 0,
- stemid: 3,
- answertype: 1
- };
- },
- methods: {
- init() {
- this.userinfo = uni.getStorageSync("userinfo");
- this.selectuser = uni.getStorageSync("selectuser");
- },
- selectsex(sex) {
- let answervalue = false;
- let answeroptionid = false;
- switch (sex) {
- case 1:
- answervalue = this.$t("man");
- answeroptionid = 64;
- break;
- case 2:
- answervalue = this.$t("female");
- answeroptionid = 65;
- break;
- default:
- return;
- }
- let answer = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- stemid: this.stemid,
- answertype: this.answertype,
- answervalue,
- answeroptionid
- };
- let data = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- srid: this.srid,
- scaleid: this.scaleid
- };
- subanswerbyuserid(answer, data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- if (200 == res.code) {
- uni.setStorage({
- key: "srid",
- data: res.resultData
- });
- let data1 = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- gender: sex
- };
- submembergenderwithuid(data1);
- tostemlistnext(this.sindex, 1);
- }
- });
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t("select_sex")
- });
- this.init();
- },
- onLoad: function(option) {
- this.scaleid = option.scaleid;
- this.srid = option.srid;
- this.sindex = option.sindex;
- },
- onBackPress: function(option) {
- tohome();
- return true;
- }
- };
- function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
- const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
- const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "titlearea" }, [
- vue.createElementVNode(
- "text",
- { class: "title_2" },
- vue.toDisplayString(_ctx.$t("select_gender_for_valuating_people")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "title_member" },
- vue.toDisplayString(_ctx.$t("valuating_people")) + ":" + vue.toDisplayString($data.selectuser.membername),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- " " + vue.toDisplayString(_ctx.$t("select_gender_text_1")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", null, [
- vue.createVNode(_component_uv_row, {
- justify: "space-between",
- customStyle: "margin-top: 6%"
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_col, {
- span: "6",
- align: "center",
- onClick: _cache[0] || (_cache[0] = ($event) => $options.selectsex(1))
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_image, {
- class: "img",
- src: "/static/image/selecttype/man.png",
- mode: "aspectFill",
- shape: "circle",
- "lazy-load": true,
- width: "150",
- height: "150"
- }),
- vue.createElementVNode(
- "view",
- { class: "mybtn" },
- vue.toDisplayString(_ctx.$t("is_man")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- }),
- vue.createVNode(_component_uv_col, {
- span: "6",
- align: "center",
- onClick: _cache[1] || (_cache[1] = ($event) => $options.selectsex(2))
- }, {
- default: vue.withCtx(() => [
- vue.createVNode(_component_uv_image, {
- class: "img",
- src: "/static/image/selecttype/woman.png",
- mode: "aspectFill",
- shape: "circle",
- "lazy-load": true,
- width: "150",
- height: "150"
- }),
- vue.createElementVNode(
- "view",
- { class: "mybtn" },
- vue.toDisplayString(_ctx.$t("is_female")),
- 1
- /* TEXT */
- )
- ]),
- _: 1
- /* STABLE */
- })
- ]),
- _: 1
- /* STABLE */
- })
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesTopicSelectsex = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__scopeId", "data-v-08ad11aa"], ["__file", "D:/workspace/uniapp/health2/pages/topic/selectsex.vue"]]);
- const _sfc_main$5 = {
- data() {
- return {
- columns: [],
- userinfo: {},
- selectuser: {},
- scaleid: 0,
- srid: 0,
- sindex: 0,
- heightvalue: 170,
- weightvalue: 50,
- minheight: 90,
- maxheight: 210,
- minweight: 35,
- maxweight: 125,
- selecttype: "height",
- selectbutton2: {
- fontSize: "30px",
- width: "500rpx",
- background: "#648EB8",
- border: "0px"
- },
- selectbutton3: {
- fontSize: "20px",
- fontWeight: "bold",
- letterSpacing: "0.5em"
- },
- over_percent: "11%",
- timer: false,
- canvasHeight: 80,
- canvasWidth_1: 1e3,
- canvasWidth_2: 1e3,
- scroll_left_1: 0,
- scroll_left_2: 0
- };
- },
- methods: {
- init() {
- this.userinfo = uni.getStorageSync("userinfo");
- this.selectuser = uni.getStorageSync("selectuser");
- },
- setheight() {
- this.columns = this.heightlist;
- this.$refs.picker.open();
- let index2 = this.heightvalue - this.minheight;
- this.$refs.picker.setIndexs([index2], true);
- this.selecttype = "height";
- },
- setweight() {
- this.columns = this.weightlist;
- this.$refs.picker.open();
- let index2 = (this.weightvalue - this.minweight) * 2;
- this.$refs.picker.setIndexs([index2], true);
- this.selecttype = "weight";
- },
- change(e) {
- let value2 = e.value[0].value;
- switch (this.selecttype) {
- case "height":
- this.heightvalue = value2;
- break;
- case "weight":
- this.weightvalue = value2;
- break;
- }
- },
- donext() {
- var usrBMI = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- stemid: 2,
- answertype: 0,
- answervalue: this.bmi
- };
- var userheight = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- stemid: 27,
- answertype: 0,
- answervalue: this.heightvalue
- };
- var userweight = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- stemid: 28,
- answertype: 0,
- answervalue: this.weightvalue
- };
- let answer = [];
- answer.push(usrBMI);
- answer.push(userheight);
- answer.push(userweight);
- let data = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- srid: this.srid,
- scaleid: this.scaleid
- };
- subanswerbyuserid(answer, data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- if (200 == res.code) {
- uni.setStorage({
- key: "srid",
- data: res.resultData
- });
- querybmipercentage(this.bmi).then((res2) => {
- res2 = res2.data;
- if (0 == res2.code) {
- this.$refs.toast.show({
- type: "error",
- message: res2.errmsg
- });
- return false;
- }
- if (200 == res2.code) {
- this.over_percent = res2.resultData + "%";
- this.showinfo();
- let that = this;
- this.timer = setTimeout(function() {
- that.closeinfo();
- formatAppLog("log", "at pages/topic/selectcanvas.vue:205", 123);
- tostemlistnext(that.sindex, 1);
- }, 3e3);
- }
- });
- }
- });
- },
- showinfo() {
- this.$refs.popup.open();
- },
- closeinfo() {
- this.$refs.popup.close();
- },
- maskClick() {
- clearTimeout(this.timer);
- this.$refs.popup.close();
- tostemlistnext(this.sindex, 1);
- },
- drawruler1() {
- let param = {
- canvasid: "canvas_ruler",
- canvascursorid: "canvas-cursor",
- minvalue: this.minheight,
- maxvalue: this.maxheight,
- interval: 1,
- defaultvalue: this.heightvalue,
- precision: 0
- };
- drawruler(param);
- this.heightvalue = getcursorvalue();
- this.canvasHeight = getCanvasConfig().canvasHeight;
- this.canvasWidth_1 = getCanvasConfig().canvasWidth;
- this.screenWidth = getCanvasConfig().screenWidth;
- this.scroll_left_1 = getscrollleft();
- },
- scroll1(e) {
- this.heightvalue = setcursorvalue(e.detail.scrollLeft, this.minheight);
- },
- drawruler2() {
- let param = {
- canvasid: "canvas_ruler_2",
- canvascursorid: "canvas-cursor_2",
- minvalue: this.minweight,
- maxvalue: this.maxweight,
- interval: 1,
- defaultvalue: this.weightvalue,
- precision: 0
- };
- drawruler(param);
- this.weightvalue = getcursorvalue();
- this.canvasHeight = getCanvasConfig().canvasHeight;
- this.canvasWidth_2 = getCanvasConfig().canvasWidth;
- this.screenWidth = getCanvasConfig().screenWidth;
- this.scroll_left_2 = getscrollleft();
- },
- scroll2(e) {
- this.weightvalue = setcursorvalue(e.detail.scrollLeft);
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t("calculate_BMI")
- });
- this.init();
- },
- computed: {
- bmi() {
- var value2 = (this.weightvalue / (this.heightvalue / 100 * (this.heightvalue / 100))).toFixed(1);
- return value2;
- },
- heightlist() {
- let list = [];
- for (var i = this.minheight; i <= this.maxheight; i++) {
- let item = {
- label: i,
- value: i
- };
- list.push(item);
- }
- return [list];
- },
- weightlist() {
- let list = [];
- for (var i = this.minweight; i <= this.maxweight; i += 0.5) {
- let item = {
- label: i,
- value: i
- };
- list.push(item);
- }
- return [list];
- },
- style() {
- let value2 = {
- canvasHeight: this.canvasHeight + "px",
- canvasWidth_1: this.canvasWidth_1 + "px",
- canvasWidth_2: this.canvasWidth_2 + "px",
- screenWidth: this.screenWidth + "px"
- };
- return value2;
- }
- },
- onLoad: function(option) {
- this.scaleid = option.scaleid;
- this.srid = option.srid;
- this.sindex = option.sindex;
- },
- onBackPress: function(option) {
- tohome();
- return true;
- },
- onReady() {
- this.drawruler1();
- this.drawruler2();
- }
- };
- function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
- const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
- const _component_uv_popup = resolveEasycom(vue.resolveDynamicComponent("uv-popup"), __easycom_2);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "titlearea" }, [
- vue.createElementVNode(
- "text",
- { class: "title_2" },
- vue.toDisplayString(_ctx.$t("selectcanvas_text1")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "title_member" },
- vue.toDisplayString(_ctx.$t("report_user")) + ":" + vue.toDisplayString($data.selectuser.membername),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectcanvas_text2")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectcanvas_text3")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "info_div" }, [
- vue.createElementVNode("view", { class: "text_div" }, [
- vue.createElementVNode("text", { class: "title1" }, "BMI:"),
- vue.createElementVNode(
- "text",
- { class: "text" },
- vue.toDisplayString($options.bmi),
- 1
- /* TEXT */
- )
- ])
- ]),
- vue.createElementVNode("view", { class: "info_div" }, [
- vue.createElementVNode("view", { class: "text_div" }, [
- vue.createElementVNode(
- "text",
- { class: "title3" },
- vue.toDisplayString(_ctx.$t("height")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text" },
- " " + vue.toDisplayString($data.heightvalue),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "title2" }, " CM")
- ]),
- vue.createCommentVNode(` <view class="mybtn" @click="setheight">{{$t('select')}}</view> `),
- vue.createElementVNode(
- "view",
- {
- class: "showdiv",
- id: "showdiv",
- style: vue.normalizeStyle({ height: $options.style.canvasHeight })
- },
- [
- vue.createElementVNode("scroll-view", {
- style: { "width": "100%", "height": "100%" },
- "scroll-x": true,
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.scroll1 && $options.scroll1(...args)),
- "scroll-left": $data.scroll_left_1,
- "show-scrollbar": false
- }, [
- vue.createElementVNode("canvas", {
- style: vue.normalizeStyle({ width: $options.style.canvasWidth_1, height: $options.style.canvasHeight }),
- "canvas-id": "canvas_ruler",
- id: "canvas_ruler",
- width: $data.canvasWidth_1
- }, null, 12, ["width"])
- ], 40, ["scroll-left"]),
- vue.createElementVNode(
- "canvas",
- {
- style: vue.normalizeStyle({ width: $options.style.screenWidth_1, height: $options.style.canvasHeight }),
- "canvas-id": "canvas-cursor",
- id: "canvas-cursor"
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )
- ]),
- vue.createElementVNode("view", { class: "info_div" }, [
- vue.createElementVNode("view", { class: "text_div" }, [
- vue.createElementVNode(
- "text",
- { class: "title3" },
- vue.toDisplayString(_ctx.$t("weight")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text" },
- " " + vue.toDisplayString($data.weightvalue),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "title2" }, " KG")
- ]),
- vue.createCommentVNode(` <view class="mybtn" @click="setweight">{{$t('select')}}</view> `),
- vue.createElementVNode(
- "view",
- {
- class: "showdiv",
- id: "showdiv",
- style: vue.normalizeStyle({ height: $options.style.canvasHeight })
- },
- [
- vue.createElementVNode("scroll-view", {
- style: { "width": "100%", "height": "100%" },
- "scroll-x": true,
- onScroll: _cache[1] || (_cache[1] = (...args) => $options.scroll2 && $options.scroll2(...args)),
- "scroll-left": $data.scroll_left_2,
- "show-scrollbar": false
- }, [
- vue.createElementVNode("canvas", {
- style: vue.normalizeStyle({ width: $options.style.canvasWidth_2, height: $options.style.canvasHeight }),
- "canvas-id": "canvas_ruler_2",
- id: "canvas_ruler_2",
- width: $data.canvasWidth_2
- }, null, 12, ["width"])
- ], 40, ["scroll-left"]),
- vue.createElementVNode(
- "canvas",
- {
- style: vue.normalizeStyle({ width: $options.style.screenWidth_2, height: $options.style.canvasHeight }),
- "canvas-id": "canvas-cursor_2",
- id: "canvas-cursor_2"
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )
- ]),
- vue.createCommentVNode(' <view class="">\r\n <uv-picker ref="picker" :columns="columns" @change="change" keyName="label" :showToolbar="false" fontSize="25px"></uv-picker>\r\n </view> '),
- vue.createElementVNode("view", { class: "donext_div" }, [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- text: _ctx.$t("next_step"),
- onClick: $options.donext,
- customStyle: $data.selectbutton2,
- customTextStyle: $data.selectbutton3
- }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
- ]),
- vue.createElementVNode("view", null, [
- vue.createVNode(_component_uv_popup, {
- ref: "popup",
- mode: "bottom",
- onMaskClick: $options.maskClick
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "over_percent_div" }, [
- vue.createElementVNode("view", { class: "content" }, [
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("show_info_text1"),
- align: "center",
- size: "25"
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: $data.over_percent,
- type: "success",
- bold: "true",
- align: "center",
- size: "30"
- }, null, 8, ["text"]),
- vue.createVNode(_component_uv_text, {
- text: _ctx.$t("show_info_text2"),
- align: "center",
- size: "25"
- }, null, 8, ["text"])
- ])
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["onMaskClick"])
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesTopicSelectcanvas = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-b2d22efc"], ["__file", "D:/workspace/uniapp/health2/pages/topic/selectcanvas.vue"]]);
- const props$1 = {
- props: {
- // 是否展示工具条
- show: {
- type: Boolean,
- default: true
- },
- // 是否显示下边框
- showBorder: {
- type: Boolean,
- default: false
- },
- // 取消按钮的文字
- cancelText: {
- type: String,
- default: "取消"
- },
- // 确认按钮的文字
- confirmText: {
- type: String,
- default: "确认"
- },
- // 取消按钮的颜色
- cancelColor: {
- type: String,
- default: "#909193"
- },
- // 确认按钮的颜色
- confirmColor: {
- type: String,
- default: "#3c9cff"
- },
- // 标题文字
- title: {
- type: String,
- default: ""
- },
- ...(_P = (_O = uni.$uv) == null ? void 0 : _O.props) == null ? void 0 : _P.toolbar
- }
- };
- const _sfc_main$4 = {
- name: "uv-toolbar",
- emits: ["confirm", "cancel"],
- mixins: [mpMixin, mixin, props$1],
- methods: {
- // 点击取消按钮
- cancel() {
- this.$emit("cancel");
- },
- // 点击确定按钮
- confirm() {
- this.$emit("confirm");
- }
- }
- };
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
- return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
- "view",
- {
- key: 0,
- class: vue.normalizeClass(["uv-toolbar", { "uv-border-bottom": _ctx.showBorder }]),
- onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers((...args) => _ctx.noop && _ctx.noop(...args), ["stop", "prevent"]))
- },
- [
- vue.createElementVNode("view", {
- class: "uv-toolbar__cancel__wrapper",
- "hover-class": "uv-hover-class"
- }, [
- vue.createElementVNode(
- "text",
- {
- class: "uv-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: "uv-toolbar__title uv-line-1"
- },
- vue.toDisplayString(_ctx.title),
- 1
- /* TEXT */
- )) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("view", {
- class: "uv-toolbar__confirm__wrapper",
- "hover-class": "uv-hover-class"
- }, [
- vue.createElementVNode(
- "text",
- {
- class: "uv-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 */
- )
- ])
- ],
- 34
- /* CLASS, NEED_HYDRATION */
- )) : vue.createCommentVNode("v-if", true);
- }
- const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-298cf9e4"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-toolbar/components/uv-toolbar/uv-toolbar.vue"]]);
- const props = {
- props: {
- // 是否展示顶部的操作栏
- showToolbar: {
- type: Boolean,
- default: true
- },
- // 顶部标题
- title: {
- type: String,
- default: ""
- },
- // 弹窗圆角
- round: {
- type: [String, Number],
- default: 0
- },
- // 对象数组,设置每一列的数据
- columns: {
- type: Array,
- default: () => []
- },
- // 是否显示加载中状态
- loading: {
- type: Boolean,
- default: false
- },
- // 各列中,单个选项的高度
- itemHeight: {
- type: [String, Number],
- default: 44
- },
- // 取消按钮的文字
- cancelText: {
- type: String,
- default: "取消"
- },
- // 确认按钮的文字
- confirmText: {
- type: String,
- default: "确定"
- },
- // 取消按钮的颜色
- cancelColor: {
- type: String,
- default: "#909193"
- },
- // 确认按钮的颜色
- confirmColor: {
- type: String,
- default: "#3c9cff"
- },
- // 文字颜色
- color: {
- type: String,
- default: ""
- },
- // 选中文字的颜色
- activeColor: {
- type: String,
- default: ""
- },
- // 每列中可见选项的数量
- visibleItemCount: {
- type: [String, Number],
- default: 5
- },
- // 选项对象中,需要展示的属性键名
- keyName: {
- type: String,
- default: "text"
- },
- // 是否允许点击遮罩关闭选择器
- closeOnClickOverlay: {
- type: Boolean,
- default: true
- },
- // 是否允许点击确认关闭选择器
- closeOnClickConfirm: {
- type: Boolean,
- default: true
- },
- // 各列的默认索引
- defaultIndex: {
- type: Array,
- default: () => []
- },
- // 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件,只在微信2.21.1及以上有效
- immediateChange: {
- type: Boolean,
- default: true
- },
- fontSize: {
- type: String,
- default: "16px"
- },
- ...(_R = (_Q = uni.$uv) == null ? void 0 : _Q.props) == null ? void 0 : _R.picker
- }
- };
- const _sfc_main$3 = {
- name: "uv-picker",
- emits: ["confirm", "cancel", "close", "change"],
- mixins: [mpMixin, mixin, props],
- computed: {
- // 为了解决支付宝不生效
- textStyle() {
- return (index2, index1) => {
- const style = {};
- style.display = "block";
- if (this.color) {
- style.color = this.color;
- }
- if (this.activeColor && index1 === this.innerIndex[index2]) {
- style.color = this.activeColor;
- }
- return style;
- };
- }
- },
- data() {
- return {
- // 上一次选择的列索引
- lastIndex: [],
- // 索引值 ,对应picker-view的value
- innerIndex: [],
- // 各列的值
- innerColumns: [],
- // 上一次的变化列索引
- columnIndex: 0
- };
- },
- watch: {
- // 监听默认索引的变化,重新设置对应的值
- defaultIndex: {
- immediate: true,
- handler(n2) {
- this.setIndexs(n2, true);
- }
- },
- // 监听columns参数的变化
- columns: {
- deep: true,
- immediate: true,
- handler(n2) {
- this.setColumns(n2);
- }
- }
- },
- methods: {
- open() {
- this.$refs.pickerPopup.open();
- },
- close() {
- this.$refs.pickerPopup.close();
- },
- popupChange(e) {
- if (!e.show)
- this.$emit("close");
- },
- // 获取item需要显示的文字,判别为对象还是文本
- getItemText(item) {
- if (this.$uv.test.object(item)) {
- return item[this.keyName];
- } else {
- return item;
- }
- },
- // 点击工具栏的取消按钮
- cancel() {
- this.$emit("cancel");
- this.close();
- },
- // 点击工具栏的确定按钮
- confirm() {
- this.$emit("confirm", this.$uv.deepClone({
- indexs: this.innerIndex,
- value: this.innerColumns.map((item, index2) => item[this.innerIndex[index2]]),
- values: this.innerColumns
- }));
- if (this.closeOnClickConfirm) {
- this.close();
- }
- },
- // 选择器某一列的数据发生变化时触发
- changeHandler(e) {
- const {
- value: value2
- } = e.detail;
- let index2 = 0, columnIndex = 0;
- for (let i = 0; i < value2.length; i++) {
- let item = value2[i];
- if (item !== (this.lastIndex[i] || 0)) {
- columnIndex = i;
- index2 = item;
- break;
- }
- }
- this.columnIndex = columnIndex;
- const values = this.innerColumns;
- this.setLastIndex(value2);
- this.setIndexs(value2);
- this.$emit("change", {
- value: this.innerColumns.map((item, index3) => item[value2[index3]]),
- index: index2,
- indexs: value2,
- // values为当前变化列的数组内容
- values,
- columnIndex
- });
- },
- // 设置index索引,此方法可被外部调用设置
- setIndexs(index2, setLastIndex) {
- this.innerIndex = this.$uv.deepClone(index2);
- if (setLastIndex) {
- this.setLastIndex(index2);
- }
- },
- // 记录上一次的各列索引位置
- setLastIndex(index2) {
- this.lastIndex = this.$uv.deepClone(index2);
- },
- // 设置对应列选项的所有值
- setColumnValues(columnIndex, values) {
- this.innerColumns.splice(columnIndex, 1, values);
- let tmpIndex = this.$uv.deepClone(this.innerIndex);
- for (let i = 0; i < this.innerColumns.length; i++) {
- if (i > this.columnIndex) {
- tmpIndex[i] = 0;
- }
- }
- this.setIndexs(tmpIndex);
- },
- // 获取对应列的所有选项
- getColumnValues(columnIndex) {
- (async () => {
- await this.$uv.sleep();
- })();
- return this.innerColumns[columnIndex];
- },
- // 设置整体各列的columns的值
- setColumns(columns) {
- this.innerColumns = this.$uv.deepClone(columns);
- if (this.innerIndex.length === 0) {
- this.innerIndex = new Array(columns.length).fill(0);
- }
- },
- // 获取各列选中值对应的索引
- getIndexs() {
- return this.innerIndex;
- },
- // 获取各列选中的值
- getValues() {
- (async () => {
- await this.$uv.sleep();
- })();
- return this.innerColumns.map((item, index2) => item[this.innerIndex[index2]]);
- }
- }
- };
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toolbar = resolveEasycom(vue.resolveDynamicComponent("uv-toolbar"), __easycom_0);
- const _component_uv_loading_icon = resolveEasycom(vue.resolveDynamicComponent("uv-loading-icon"), __easycom_1$4);
- const _component_uv_popup = resolveEasycom(vue.resolveDynamicComponent("uv-popup"), __easycom_2);
- return vue.openBlock(), vue.createBlock(_component_uv_popup, {
- ref: "pickerPopup",
- mode: "bottom",
- round: _ctx.round,
- "close-on-click-overlay": _ctx.closeOnClickOverlay,
- onChange: $options.popupChange
- }, {
- default: vue.withCtx(() => [
- vue.createElementVNode("view", { class: "uv-picker" }, [
- _ctx.showToolbar ? (vue.openBlock(), vue.createBlock(_component_uv_toolbar, {
- key: 0,
- cancelColor: _ctx.cancelColor,
- confirmColor: _ctx.confirmColor,
- cancelText: _ctx.cancelText,
- confirmText: _ctx.confirmText,
- title: _ctx.title,
- onCancel: $options.cancel,
- onConfirm: $options.confirm
- }, null, 8, ["cancelColor", "confirmColor", "cancelText", "confirmText", "title", "onCancel", "onConfirm"])) : vue.createCommentVNode("v-if", true),
- vue.createElementVNode("picker-view", {
- class: "uv-picker__view",
- indicatorStyle: `height: ${_ctx.$uv.addUnit(_ctx.itemHeight)}`,
- value: $data.innerIndex,
- immediateChange: _ctx.immediateChange,
- style: vue.normalizeStyle({
- height: `${_ctx.$uv.addUnit(_ctx.visibleItemCount * _ctx.itemHeight)}`
- }),
- onChange: _cache[0] || (_cache[0] = (...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: "uv-picker__view__column"
- }, [
- _ctx.$uv.test.array(item) ? (vue.openBlock(true), vue.createElementBlock(
- vue.Fragment,
- { key: 0 },
- vue.renderList(item, (item1, index1) => {
- return vue.openBlock(), vue.createElementBlock(
- "text",
- {
- class: "uv-picker__view__column__item uv-line-1",
- key: index1,
- style: vue.normalizeStyle([{
- height: _ctx.$uv.addUnit(_ctx.itemHeight),
- lineHeight: _ctx.$uv.addUnit(_ctx.itemHeight),
- fontWeight: index1 === $data.innerIndex[index2] ? "bold" : "normal",
- fontSize: _ctx.$uv.addUnit(_ctx.fontSize)
- }, $options.textStyle(index2, index1)])
- },
- vue.toDisplayString($options.getItemText(item1)),
- 5
- /* TEXT, 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: "uv-picker--loading"
- }, [
- vue.createVNode(_component_uv_loading_icon, { mode: "circle" })
- ])) : vue.createCommentVNode("v-if", true)
- ])
- ]),
- _: 1
- /* STABLE */
- }, 8, ["round", "close-on-click-overlay", "onChange"]);
- }
- const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-f74a1703"], ["__file", "D:/workspace/uniapp/health2/uni_modules/uv-picker/components/uv-picker/uv-picker.vue"]]);
- const _sfc_main$2 = {
- data() {
- return {
- userinfo: {},
- selectuser: {},
- minhm: 60,
- maxhm: 210,
- value: 110,
- label: "",
- label_text: "",
- scaleid: 0,
- srid: 0,
- sindex: 0,
- answertype: 0,
- stemid: 6,
- columns_limit_list: [
- {
- uplimit: 119,
- dowlimit: 60,
- viewstr: "110",
- sbpstr: this.$t("hg_text1")
- },
- {
- uplimit: 110,
- dowlimit: 110,
- viewstr: "110",
- sbpstr: this.$t("hg_text2")
- },
- {
- uplimit: 119,
- dowlimit: 111,
- viewstr: "110~120",
- sbpstr: this.$t("hg_text3")
- },
- {
- uplimit: 129,
- dowlimit: 120,
- viewstr: "120~130",
- sbpstr: this.$t("hg_text3")
- },
- {
- uplimit: 139,
- dowlimit: 130,
- viewstr: "130~140",
- sbpstr: this.$t("hg_text3")
- },
- {
- uplimit: 219,
- dowlimit: 140,
- viewstr: "140",
- sbpstr: this.$t("hg_text4")
- }
- ],
- selectbutton1: {
- fontSize: "30px",
- width: "500rpx",
- borderColor: "#648EB8",
- color: "#648EB8"
- },
- selectbutton2: {
- fontSize: "30px",
- width: "500rpx",
- background: "#648EB8",
- border: "0px"
- },
- selectbutton3: {
- fontSize: "20px",
- fontWeight: "bold",
- letterSpacing: "0.5em"
- },
- canvasHeight: 80,
- canvasWidth: 1e3,
- scroll_left: 0
- };
- },
- computed: {
- columns() {
- let list = [];
- for (var i = this.minhm; i <= this.maxhm; i++) {
- let label = i + this.$t("hg_text2");
- this.columns_limit_list.map((item2, index2) => {
- if (i >= item2.dowlimit && i <= item2.uplimit) {
- label = item2.viewstr + item2.sbpstr;
- return label;
- }
- });
- let item = {
- label,
- value: i
- };
- list.push(item);
- }
- return [list];
- },
- style() {
- let value2 = {
- canvasHeight: this.canvasHeight + "px",
- canvasWidth: this.canvasWidth + "px",
- screenWidth: this.screenWidth + "px"
- };
- return value2;
- }
- },
- methods: {
- init() {
- this.userinfo = uni.getStorageSync("userinfo");
- this.selectuser = uni.getStorageSync("selectuser");
- this.showlabel();
- },
- change(e) {
- let value2 = e.value[0].value;
- this.value = value2;
- this.label = e.value[0].label;
- },
- showselectage() {
- this.$refs.picker.open();
- let index2 = this.value - this.minhm;
- this.$refs.picker.setIndexs([index2], true);
- },
- // showlabel(){
- // let index = this.value-this.minhm
- // this.label = this.columns[0][index].label
- // },
- showlabel() {
- if (this.value < 110) {
- this.label = 110;
- this.label_text = this.$t("hg_text1");
- }
- for (let i = 0; i < 3; i++) {
- let min = 110 + i * 10;
- let max = 110 + (i + 1) * 10;
- if (this.value < max && this.value >= min) {
- this.label = min + "~" + max;
- this.label_text = this.$t("hg_text3");
- }
- }
- if (this.value >= 140) {
- this.label = 140;
- this.label_text = this.$t("hg_text4");
- }
- if (this.value == 110) {
- this.label = 110;
- this.label_text = this.$t("hg_text2");
- }
- },
- donext() {
- let answer = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- stemid: this.stemid,
- answertype: this.answertype,
- answervalue: this.value
- };
- let data = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- srid: this.srid,
- scaleid: this.scaleid
- };
- subanswerbyuserid(answer, data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- if (200 == res.code) {
- uni.setStorage({
- key: "srid",
- data: res.resultData
- });
- tostemlistnext(this.sindex, 1);
- }
- });
- },
- drawruler() {
- let param = {
- canvasid: "canvas_ruler",
- canvascursorid: "canvas-cursor",
- minvalue: this.minhm,
- maxvalue: this.maxhm,
- interval: 1,
- defaultvalue: this.value,
- precision: 0
- };
- drawruler(param);
- this.value = getcursorvalue();
- this.canvasHeight = getCanvasConfig().canvasHeight;
- this.canvasWidth = getCanvasConfig().canvasWidth;
- this.screenWidth = getCanvasConfig().screenWidth;
- this.scroll_left = getscrollleft();
- },
- scroll(e) {
- this.value = setcursorvalue(e.detail.scrollLeft);
- this.showlabel();
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t("blood_pressure")
- });
- this.init();
- },
- onLoad: function(option) {
- this.scaleid = option.scaleid;
- this.srid = option.srid;
- this.sindex = option.sindex;
- },
- onBackPress: function(option) {
- tohome();
- return true;
- },
- onReady() {
- this.drawruler();
- }
- };
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_picker = resolveEasycom(vue.resolveDynamicComponent("uv-picker"), __easycom_1);
- const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "titlearea" }, [
- vue.createElementVNode(
- "text",
- { class: "title_2" },
- vue.toDisplayString(_ctx.$t("selectsbp_text1")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "title_member" },
- vue.toDisplayString(_ctx.$t("report_user")) + ":" + vue.toDisplayString($data.selectuser.membername),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectsbp_text2")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectsbp_text3")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectsbp_text4")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "agevalue" }, [
- vue.createElementVNode("view", { class: "" }, [
- vue.createTextVNode(
- vue.toDisplayString(_ctx.$t("blood_pressure")) + ": " + vue.toDisplayString($data.label) + " ",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "title2" },
- vue.toDisplayString($data.label_text),
- 1
- /* TEXT */
- )
- ]),
- vue.createCommentVNode(` <uv-button type="primary" :plain="true" :text="$t('select')" @click="showselectage" :customStyle="selectbutton1" :customTextStyle="selectbutton3"></uv-button> `),
- vue.createElementVNode(
- "view",
- {
- class: "showdiv",
- id: "showdiv",
- style: vue.normalizeStyle({ height: $options.style.canvasHeight })
- },
- [
- vue.createElementVNode("scroll-view", {
- style: { "width": "100%", "height": "100%" },
- "scroll-x": true,
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.scroll && $options.scroll(...args)),
- "scroll-left": $data.scroll_left,
- "show-scrollbar": false
- }, [
- vue.createElementVNode("canvas", {
- style: vue.normalizeStyle({ width: $options.style.canvasWidth, height: $options.style.canvasHeight }),
- "canvas-id": "canvas_ruler",
- id: "canvas_ruler",
- width: $data.canvasWidth
- }, null, 12, ["width"])
- ], 40, ["scroll-left"]),
- vue.createElementVNode(
- "canvas",
- {
- style: vue.normalizeStyle({ width: $options.style.screenWidth, height: $options.style.canvasHeight }),
- "canvas-id": "canvas-cursor",
- id: "canvas-cursor"
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- )
- ]),
- vue.createElementVNode("view", { class: "" }, [
- vue.createVNode(_component_uv_picker, {
- ref: "picker",
- columns: $options.columns,
- onChange: $options.change,
- keyName: "value",
- showToolbar: false,
- fontSize: "25px"
- }, null, 8, ["columns", "onChange"])
- ]),
- vue.createElementVNode("view", { class: "donext_div" }, [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- text: _ctx.$t("next_step"),
- onClick: $options.donext,
- customStyle: $data.selectbutton2,
- customTextStyle: $data.selectbutton3
- }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesTopicSelectsbp = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-7cfdaaac"], ["__file", "D:/workspace/uniapp/health2/pages/topic/selectsbp.vue"]]);
- const _sfc_main$1 = {
- data() {
- return {
- userinfo: {},
- selectuser: {},
- scaleid: 0,
- srid: 0,
- sindex: 0,
- value: 80,
- minvalue: 40,
- maxvalue: 120,
- selectbutton2: {
- fontSize: "30px",
- width: "500rpx",
- background: "#648EB8",
- border: "0px"
- },
- selectbutton3: {
- fontSize: "20px",
- fontWeight: "bold",
- letterSpacing: "0.5em"
- },
- canvasHeight: 80,
- canvasWidth: 1e3,
- scroll_left: 0
- };
- },
- computed: {
- columns() {
- let list = [];
- for (var i = this.minvalue; i <= this.maxvalue; i++) {
- let label = i;
- if (i == this.minvalue) {
- label = this.$t("less_than") + i;
- }
- if (i == this.maxvalue) {
- label = this.$t("greater_than") + i;
- }
- let item = {
- label,
- value: i
- };
- list.push(item);
- }
- return [list];
- },
- chi() {
- var chicun = Math.round(this.value * 0.3);
- let value2 = parseInt(chicun / 10);
- return value2;
- },
- cun() {
- var chicun = Math.round(this.value * 0.3);
- let value2 = chicun % 10;
- return value2;
- },
- style() {
- let value2 = {
- canvasHeight: this.canvasHeight + "px",
- canvasWidth: this.canvasWidth + "px",
- screenWidth: this.screenWidth + "px"
- };
- return value2;
- }
- },
- methods: {
- init() {
- this.userinfo = uni.getStorageSync("userinfo");
- this.selectuser = uni.getStorageSync("selectuser");
- },
- change(e) {
- let value2 = e.value[0].value;
- this.value = value2;
- },
- donext() {
- let answer = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- stemid: 30,
- answertype: 0,
- answervalue: this.value
- };
- let data = {
- userid: this.userinfo.id,
- fmemberid: this.selectuser.fmemberid,
- srid: this.srid,
- scaleid: this.scaleid
- };
- subanswerbyuserid(answer, data).then((res) => {
- res = res.data;
- if (0 == res.code) {
- this.$refs.toast.show({
- type: "error",
- message: res.errmsg
- });
- return false;
- }
- if (200 == res.code) {
- uni.setStorage({
- key: "srid",
- data: res.resultData
- });
- tostemlistnext(this.sindex, 1);
- }
- });
- },
- setvalue() {
- this.$refs.picker.open();
- let index2 = this.value - this.minvalue;
- this.$refs.picker.setIndexs([index2], true);
- },
- drawruler() {
- let param = {
- canvasid: "canvas_ruler",
- canvascursorid: "canvas-cursor",
- minvalue: this.minvalue,
- maxvalue: this.maxvalue,
- interval: 1,
- defaultvalue: this.value,
- precision: 0
- };
- drawruler(param);
- this.value = getcursorvalue();
- this.canvasHeight = getCanvasConfig().canvasHeight;
- this.canvasWidth = getCanvasConfig().canvasWidth;
- this.screenWidth = getCanvasConfig().screenWidth;
- this.scroll_left = getscrollleft();
- },
- scroll(e) {
- this.value = setcursorvalue(e.detail.scrollLeft);
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t("waistline")
- });
- this.init();
- },
- onLoad: function(option) {
- this.scaleid = option.scaleid;
- this.srid = option.srid;
- this.sindex = option.sindex;
- },
- onBackPress: function(option) {
- tohome();
- return true;
- },
- onReady() {
- this.drawruler();
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
- const _component_uv_picker = resolveEasycom(vue.resolveDynamicComponent("uv-picker"), __easycom_1);
- const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
- return vue.openBlock(), vue.createElementBlock(
- vue.Fragment,
- null,
- [
- vue.createVNode(
- _component_uv_toast,
- { ref: "toast" },
- null,
- 512
- /* NEED_PATCH */
- ),
- vue.createElementVNode("view", { class: "titlearea" }, [
- vue.createElementVNode(
- "text",
- { class: "title_2" },
- vue.toDisplayString(_ctx.$t("selectwaistline_text1")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "title_member" },
- vue.toDisplayString(_ctx.$t("report_user")) + ":" + vue.toDisplayString($data.selectuser.membername),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectwaistline_text2")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectwaistline_text3")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectwaistline_text4")),
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- {
- class: "title_desstr",
- decode: "true"
- },
- vue.toDisplayString(_ctx.$t("selectwaistline_text5")),
- 1
- /* TEXT */
- )
- ]),
- vue.createElementVNode("view", { class: "info_div info_div_1" }, [
- vue.createElementVNode("view", { class: "text_div" }, [
- vue.createElementVNode(
- "text",
- { class: "title3" },
- vue.toDisplayString(_ctx.$t("waistline")) + ":",
- 1
- /* TEXT */
- ),
- vue.createElementVNode(
- "text",
- { class: "text" },
- vue.toDisplayString($data.value),
- 1
- /* TEXT */
- ),
- vue.createElementVNode("text", { class: "title3" }, "CM")
- ]),
- vue.createCommentVNode(` <view class="text_div">\r
- <text class="text">{{chi}}</text>\r
- <text class="title3">{{$t('waistline_text1')}}</text>\r
- <text class="text">{{cun}}</text>\r
- <text class="title3">{{$t('waistline_text2')}}</text>\r
- </view> `)
- ]),
- vue.createCommentVNode(` <view class="info_div info_div_2">\r
- <view class="mybtn" @click="setvalue">{{$t('select')}}</view>\r
- </view> `),
- vue.createElementVNode(
- "view",
- {
- class: "showdiv",
- id: "showdiv",
- style: vue.normalizeStyle({ height: $options.style.canvasHeight })
- },
- [
- vue.createElementVNode("scroll-view", {
- style: { "width": "100%", "height": "100%" },
- "scroll-x": true,
- onScroll: _cache[0] || (_cache[0] = (...args) => $options.scroll && $options.scroll(...args)),
- "scroll-left": $data.scroll_left,
- "show-scrollbar": false
- }, [
- vue.createElementVNode("canvas", {
- style: vue.normalizeStyle({ width: $options.style.canvasWidth, height: $options.style.canvasHeight }),
- "canvas-id": "canvas_ruler",
- id: "canvas_ruler",
- width: $data.canvasWidth
- }, null, 12, ["width"])
- ], 40, ["scroll-left"]),
- vue.createElementVNode(
- "canvas",
- {
- style: vue.normalizeStyle({ width: $options.style.screenWidth, height: $options.style.canvasHeight }),
- "canvas-id": "canvas-cursor",
- id: "canvas-cursor"
- },
- null,
- 4
- /* STYLE */
- )
- ],
- 4
- /* STYLE */
- ),
- vue.createElementVNode("view", { class: "" }, [
- vue.createVNode(_component_uv_picker, {
- ref: "picker",
- columns: $options.columns,
- onChange: $options.change,
- keyName: "label",
- showToolbar: false,
- fontSize: "25px"
- }, null, 8, ["columns", "onChange"])
- ]),
- vue.createElementVNode("view", { class: "donext_div" }, [
- vue.createVNode(_component_uv_button, {
- type: "primary",
- text: _ctx.$t("next_step"),
- onClick: $options.donext,
- customStyle: $data.selectbutton2,
- customTextStyle: $data.selectbutton3
- }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
- ])
- ],
- 64
- /* STABLE_FRAGMENT */
- );
- }
- const PagesTopicSelectwaistline = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "D:/workspace/uniapp/health2/pages/topic/selectwaistline.vue"]]);
- __definePage("pages/index/show", PagesIndexShow);
- __definePage("pages/index/index", PagesIndexIndex);
- __definePage("pages/login/login", PagesLoginLogin);
- __definePage("pages/register/register", PagesRegisterRegister);
- __definePage("pages/member/member", PagesMemberMember);
- __definePage("pages/member/add", PagesMemberAdd);
- __definePage("pages/report/report", PagesReportReport);
- __definePage("pages/topic/common", PagesTopicCommon);
- __definePage("pages/topic/selectage", PagesTopicSelectage);
- __definePage("pages/topic/selectsex", PagesTopicSelectsex);
- __definePage("pages/topic/selectcanvas", PagesTopicSelectcanvas);
- __definePage("pages/topic/selectsbp", PagesTopicSelectsbp);
- __definePage("pages/topic/selectwaistline", PagesTopicSelectwaistline);
- const _sfc_main = {
- globalData: {
- throttleTime: 1e3
- //节流时间 毫秒
- },
- onLaunch: function() {
- },
- onShow: function() {
- formatAppLog("log", "at App.vue:20", "App Show");
- },
- onHide: function() {
- formatAppLog("log", "at App.vue:23", "App Hide");
- }
- };
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/workspace/uniapp/health2/App.vue"]]);
- /*!
- * @intlify/shared v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const inBrowser = typeof window !== "undefined";
- let mark;
- let measure;
- {
- const perf = inBrowser && window.performance;
- if (perf && perf.mark && perf.measure && perf.clearMarks && perf.clearMeasures) {
- mark = (tag) => perf.mark(tag);
- measure = (name, startTag, endTag) => {
- perf.measure(name, startTag, endTag);
- perf.clearMarks(startTag);
- perf.clearMarks(endTag);
- };
- }
- }
- const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g;
- function format(message, ...args) {
- if (args.length === 1 && isObject$1(args[0])) {
- args = args[0];
- }
- if (!args || !args.hasOwnProperty) {
- args = {};
- }
- return message.replace(RE_ARGS, (match, identifier) => {
- return args.hasOwnProperty(identifier) ? args[identifier] : "";
- });
- }
- const hasSymbol = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
- const makeSymbol = (name) => hasSymbol ? Symbol(name) : name;
- const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });
- const friendlyJSONstringify = (json) => JSON.stringify(json).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027");
- const isNumber = (val) => typeof val === "number" && isFinite(val);
- const isDate = (val) => toTypeString(val) === "[object Date]";
- const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
- const isEmptyObject = (val) => isPlainObject(val) && Object.keys(val).length === 0;
- function warn(msg, err) {
- if (typeof console !== "undefined") {
- console.warn(`[intlify] ` + msg);
- if (err) {
- console.warn(err.stack);
- }
- }
- }
- const assign = Object.assign;
- let _globalThis;
- const getGlobalThis = () => {
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
- };
- function escapeHtml(rawText) {
- return rawText.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
- }
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- function hasOwn$1(obj, key) {
- return hasOwnProperty$1.call(obj, key);
- }
- const isArray = Array.isArray;
- const isFunction = (val) => typeof val === "function";
- const isString = (val) => typeof val === "string";
- const isBoolean = (val) => typeof val === "boolean";
- const isObject$1 = (val) => (
- // eslint-disable-line
- val !== null && typeof val === "object"
- );
- const objectToString = Object.prototype.toString;
- const toTypeString = (value2) => objectToString.call(value2);
- const isPlainObject = (val) => toTypeString(val) === "[object Object]";
- const toDisplayString = (val) => {
- return val == null ? "" : isArray(val) || isPlainObject(val) && val.toString === objectToString ? JSON.stringify(val, null, 2) : String(val);
- };
- const RANGE = 2;
- function generateCodeFrame(source, start = 0, end = source.length) {
- const lines = source.split(/\r?\n/);
- let count = 0;
- const res = [];
- for (let i = 0; i < lines.length; i++) {
- count += lines[i].length + 1;
- if (count >= start) {
- for (let j = i - RANGE; j <= i + RANGE || end > count; j++) {
- if (j < 0 || j >= lines.length)
- continue;
- const line = j + 1;
- res.push(`${line}${" ".repeat(3 - String(line).length)}| ${lines[j]}`);
- const lineLength = lines[j].length;
- if (j === i) {
- const pad = start - (count - lineLength) + 1;
- const length = Math.max(1, end > count ? lineLength - pad : end - start);
- res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
- } else if (j > i) {
- if (end > count) {
- const length = Math.max(Math.min(end - count, lineLength), 1);
- res.push(` | ` + "^".repeat(length));
- }
- count += lineLength + 1;
- }
- }
- break;
- }
- }
- return res.join("\n");
- }
- function createEmitter() {
- const events = /* @__PURE__ */ new Map();
- const emitter = {
- events,
- on(event, handler) {
- const handlers = events.get(event);
- const added = handlers && handlers.push(handler);
- if (!added) {
- events.set(event, [handler]);
- }
- },
- off(event, handler) {
- const handlers = events.get(event);
- if (handlers) {
- handlers.splice(handlers.indexOf(handler) >>> 0, 1);
- }
- },
- emit(event, payload) {
- (events.get(event) || []).slice().map((handler) => handler(payload));
- (events.get("*") || []).slice().map((handler) => handler(event, payload));
- }
- };
- return emitter;
- }
- /*!
- * @intlify/message-resolver v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const hasOwnProperty = Object.prototype.hasOwnProperty;
- function hasOwn(obj, key) {
- return hasOwnProperty.call(obj, key);
- }
- const isObject = (val) => (
- // eslint-disable-line
- val !== null && typeof val === "object"
- );
- const pathStateMachine = [];
- pathStateMachine[
- 0
- /* BEFORE_PATH */
- ] = {
- [
- "w"
- /* WORKSPACE */
- ]: [
- 0
- /* BEFORE_PATH */
- ],
- [
- "i"
- /* IDENT */
- ]: [
- 3,
- 0
- /* APPEND */
- ],
- [
- "["
- /* LEFT_BRACKET */
- ]: [
- 4
- /* IN_SUB_PATH */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: [
- 7
- /* AFTER_PATH */
- ]
- };
- pathStateMachine[
- 1
- /* IN_PATH */
- ] = {
- [
- "w"
- /* WORKSPACE */
- ]: [
- 1
- /* IN_PATH */
- ],
- [
- "."
- /* DOT */
- ]: [
- 2
- /* BEFORE_IDENT */
- ],
- [
- "["
- /* LEFT_BRACKET */
- ]: [
- 4
- /* IN_SUB_PATH */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: [
- 7
- /* AFTER_PATH */
- ]
- };
- pathStateMachine[
- 2
- /* BEFORE_IDENT */
- ] = {
- [
- "w"
- /* WORKSPACE */
- ]: [
- 2
- /* BEFORE_IDENT */
- ],
- [
- "i"
- /* IDENT */
- ]: [
- 3,
- 0
- /* APPEND */
- ],
- [
- "0"
- /* ZERO */
- ]: [
- 3,
- 0
- /* APPEND */
- ]
- };
- pathStateMachine[
- 3
- /* IN_IDENT */
- ] = {
- [
- "i"
- /* IDENT */
- ]: [
- 3,
- 0
- /* APPEND */
- ],
- [
- "0"
- /* ZERO */
- ]: [
- 3,
- 0
- /* APPEND */
- ],
- [
- "w"
- /* WORKSPACE */
- ]: [
- 1,
- 1
- /* PUSH */
- ],
- [
- "."
- /* DOT */
- ]: [
- 2,
- 1
- /* PUSH */
- ],
- [
- "["
- /* LEFT_BRACKET */
- ]: [
- 4,
- 1
- /* PUSH */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: [
- 7,
- 1
- /* PUSH */
- ]
- };
- pathStateMachine[
- 4
- /* IN_SUB_PATH */
- ] = {
- [
- "'"
- /* SINGLE_QUOTE */
- ]: [
- 5,
- 0
- /* APPEND */
- ],
- [
- '"'
- /* DOUBLE_QUOTE */
- ]: [
- 6,
- 0
- /* APPEND */
- ],
- [
- "["
- /* LEFT_BRACKET */
- ]: [
- 4,
- 2
- /* INC_SUB_PATH_DEPTH */
- ],
- [
- "]"
- /* RIGHT_BRACKET */
- ]: [
- 1,
- 3
- /* PUSH_SUB_PATH */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: 8,
- [
- "l"
- /* ELSE */
- ]: [
- 4,
- 0
- /* APPEND */
- ]
- };
- pathStateMachine[
- 5
- /* IN_SINGLE_QUOTE */
- ] = {
- [
- "'"
- /* SINGLE_QUOTE */
- ]: [
- 4,
- 0
- /* APPEND */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: 8,
- [
- "l"
- /* ELSE */
- ]: [
- 5,
- 0
- /* APPEND */
- ]
- };
- pathStateMachine[
- 6
- /* IN_DOUBLE_QUOTE */
- ] = {
- [
- '"'
- /* DOUBLE_QUOTE */
- ]: [
- 4,
- 0
- /* APPEND */
- ],
- [
- "o"
- /* END_OF_FAIL */
- ]: 8,
- [
- "l"
- /* ELSE */
- ]: [
- 6,
- 0
- /* APPEND */
- ]
- };
- const literalValueRE = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
- function isLiteral(exp) {
- return literalValueRE.test(exp);
- }
- function stripQuotes(str) {
- const a = str.charCodeAt(0);
- const b = str.charCodeAt(str.length - 1);
- return a === b && (a === 34 || a === 39) ? str.slice(1, -1) : str;
- }
- function getPathCharType(ch) {
- if (ch === void 0 || ch === null) {
- return "o";
- }
- const code2 = ch.charCodeAt(0);
- switch (code2) {
- case 91:
- case 93:
- case 46:
- case 34:
- case 39:
- return ch;
- case 95:
- case 36:
- case 45:
- return "i";
- case 9:
- case 10:
- case 13:
- case 160:
- case 65279:
- case 8232:
- case 8233:
- return "w";
- }
- return "i";
- }
- function formatSubPath(path) {
- const trimmed = path.trim();
- if (path.charAt(0) === "0" && isNaN(parseInt(path))) {
- return false;
- }
- return isLiteral(trimmed) ? stripQuotes(trimmed) : "*" + trimmed;
- }
- function parse(path) {
- const keys = [];
- let index2 = -1;
- let mode = 0;
- let subPathDepth = 0;
- let c;
- let key;
- let newChar;
- let type2;
- let transition;
- let action;
- let typeMap;
- const actions = [];
- actions[
- 0
- /* APPEND */
- ] = () => {
- if (key === void 0) {
- key = newChar;
- } else {
- key += newChar;
- }
- };
- actions[
- 1
- /* PUSH */
- ] = () => {
- if (key !== void 0) {
- keys.push(key);
- key = void 0;
- }
- };
- actions[
- 2
- /* INC_SUB_PATH_DEPTH */
- ] = () => {
- actions[
- 0
- /* APPEND */
- ]();
- subPathDepth++;
- };
- actions[
- 3
- /* PUSH_SUB_PATH */
- ] = () => {
- if (subPathDepth > 0) {
- subPathDepth--;
- mode = 4;
- actions[
- 0
- /* APPEND */
- ]();
- } else {
- subPathDepth = 0;
- if (key === void 0) {
- return false;
- }
- key = formatSubPath(key);
- if (key === false) {
- return false;
- } else {
- actions[
- 1
- /* PUSH */
- ]();
- }
- }
- };
- function maybeUnescapeQuote() {
- const nextChar = path[index2 + 1];
- if (mode === 5 && nextChar === "'" || mode === 6 && nextChar === '"') {
- index2++;
- newChar = "\\" + nextChar;
- actions[
- 0
- /* APPEND */
- ]();
- return true;
- }
- }
- while (mode !== null) {
- index2++;
- c = path[index2];
- if (c === "\\" && maybeUnescapeQuote()) {
- continue;
- }
- type2 = getPathCharType(c);
- typeMap = pathStateMachine[mode];
- transition = typeMap[type2] || typeMap[
- "l"
- /* ELSE */
- ] || 8;
- if (transition === 8) {
- return;
- }
- mode = transition[0];
- if (transition[1] !== void 0) {
- action = actions[transition[1]];
- if (action) {
- newChar = c;
- if (action() === false) {
- return;
- }
- }
- }
- if (mode === 7) {
- return keys;
- }
- }
- }
- const cache = /* @__PURE__ */ new Map();
- function resolveValue(obj, path) {
- if (!isObject(obj)) {
- return null;
- }
- let hit = cache.get(path);
- if (!hit) {
- hit = parse(path);
- if (hit) {
- cache.set(path, hit);
- }
- }
- if (!hit) {
- return null;
- }
- const len = hit.length;
- let last = obj;
- let i = 0;
- while (i < len) {
- const val = last[hit[i]];
- if (val === void 0) {
- return null;
- }
- last = val;
- i++;
- }
- return last;
- }
- function handleFlatJson(obj) {
- if (!isObject(obj)) {
- return obj;
- }
- for (const key in obj) {
- if (!hasOwn(obj, key)) {
- continue;
- }
- if (!key.includes(
- "."
- /* DOT */
- )) {
- if (isObject(obj[key])) {
- handleFlatJson(obj[key]);
- }
- } else {
- const subKeys = key.split(
- "."
- /* DOT */
- );
- const lastIndex = subKeys.length - 1;
- let currentObj = obj;
- for (let i = 0; i < lastIndex; i++) {
- if (!(subKeys[i] in currentObj)) {
- currentObj[subKeys[i]] = {};
- }
- currentObj = currentObj[subKeys[i]];
- }
- currentObj[subKeys[lastIndex]] = obj[key];
- delete obj[key];
- if (isObject(currentObj[subKeys[lastIndex]])) {
- handleFlatJson(currentObj[subKeys[lastIndex]]);
- }
- }
- }
- return obj;
- }
- /*!
- * @intlify/runtime v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const DEFAULT_MODIFIER = (str) => str;
- const DEFAULT_MESSAGE = (ctx) => "";
- const DEFAULT_MESSAGE_DATA_TYPE = "text";
- const DEFAULT_NORMALIZE = (values) => values.length === 0 ? "" : values.join("");
- const DEFAULT_INTERPOLATE = toDisplayString;
- function pluralDefault(choice, choicesLength) {
- choice = Math.abs(choice);
- if (choicesLength === 2) {
- return choice ? choice > 1 ? 1 : 0 : 1;
- }
- return choice ? Math.min(choice, 2) : 0;
- }
- function getPluralIndex(options) {
- const index2 = isNumber(options.pluralIndex) ? options.pluralIndex : -1;
- return options.named && (isNumber(options.named.count) || isNumber(options.named.n)) ? isNumber(options.named.count) ? options.named.count : isNumber(options.named.n) ? options.named.n : index2 : index2;
- }
- function normalizeNamed(pluralIndex, props2) {
- if (!props2.count) {
- props2.count = pluralIndex;
- }
- if (!props2.n) {
- props2.n = pluralIndex;
- }
- }
- function createMessageContext(options = {}) {
- const locale = options.locale;
- const pluralIndex = getPluralIndex(options);
- const pluralRule = isObject$1(options.pluralRules) && isString(locale) && isFunction(options.pluralRules[locale]) ? options.pluralRules[locale] : pluralDefault;
- const orgPluralRule = isObject$1(options.pluralRules) && isString(locale) && isFunction(options.pluralRules[locale]) ? pluralDefault : void 0;
- const plural = (messages2) => messages2[pluralRule(pluralIndex, messages2.length, orgPluralRule)];
- const _list = options.list || [];
- const list = (index2) => _list[index2];
- const _named = options.named || {};
- isNumber(options.pluralIndex) && normalizeNamed(pluralIndex, _named);
- const named = (key) => _named[key];
- function message(key) {
- const msg = isFunction(options.messages) ? options.messages(key) : isObject$1(options.messages) ? options.messages[key] : false;
- return !msg ? options.parent ? options.parent.message(key) : DEFAULT_MESSAGE : msg;
- }
- const _modifier = (name) => options.modifiers ? options.modifiers[name] : DEFAULT_MODIFIER;
- const normalize = isPlainObject(options.processor) && isFunction(options.processor.normalize) ? options.processor.normalize : DEFAULT_NORMALIZE;
- const interpolate = isPlainObject(options.processor) && isFunction(options.processor.interpolate) ? options.processor.interpolate : DEFAULT_INTERPOLATE;
- const type2 = isPlainObject(options.processor) && isString(options.processor.type) ? options.processor.type : DEFAULT_MESSAGE_DATA_TYPE;
- const ctx = {
- [
- "list"
- /* LIST */
- ]: list,
- [
- "named"
- /* NAMED */
- ]: named,
- [
- "plural"
- /* PLURAL */
- ]: plural,
- [
- "linked"
- /* LINKED */
- ]: (key, modifier) => {
- const msg = message(key)(ctx);
- return isString(modifier) ? _modifier(modifier)(msg) : msg;
- },
- [
- "message"
- /* MESSAGE */
- ]: message,
- [
- "type"
- /* TYPE */
- ]: type2,
- [
- "interpolate"
- /* INTERPOLATE */
- ]: interpolate,
- [
- "normalize"
- /* NORMALIZE */
- ]: normalize
- };
- return ctx;
- }
- /*!
- * @intlify/message-compiler v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const errorMessages$2 = {
- // tokenizer error messages
- [
- 0
- /* EXPECTED_TOKEN */
- ]: `Expected token: '{0}'`,
- [
- 1
- /* INVALID_TOKEN_IN_PLACEHOLDER */
- ]: `Invalid token in placeholder: '{0}'`,
- [
- 2
- /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */
- ]: `Unterminated single quote in placeholder`,
- [
- 3
- /* UNKNOWN_ESCAPE_SEQUENCE */
- ]: `Unknown escape sequence: \\{0}`,
- [
- 4
- /* INVALID_UNICODE_ESCAPE_SEQUENCE */
- ]: `Invalid unicode escape sequence: {0}`,
- [
- 5
- /* UNBALANCED_CLOSING_BRACE */
- ]: `Unbalanced closing brace`,
- [
- 6
- /* UNTERMINATED_CLOSING_BRACE */
- ]: `Unterminated closing brace`,
- [
- 7
- /* EMPTY_PLACEHOLDER */
- ]: `Empty placeholder`,
- [
- 8
- /* NOT_ALLOW_NEST_PLACEHOLDER */
- ]: `Not allowed nest placeholder`,
- [
- 9
- /* INVALID_LINKED_FORMAT */
- ]: `Invalid linked format`,
- // parser error messages
- [
- 10
- /* MUST_HAVE_MESSAGES_IN_PLURAL */
- ]: `Plural must have messages`,
- [
- 11
- /* UNEXPECTED_EMPTY_LINKED_MODIFIER */
- ]: `Unexpected empty linked modifier`,
- [
- 12
- /* UNEXPECTED_EMPTY_LINKED_KEY */
- ]: `Unexpected empty linked key`,
- [
- 13
- /* UNEXPECTED_LEXICAL_ANALYSIS */
- ]: `Unexpected lexical analysis in token: '{0}'`
- };
- function createCompileError(code2, loc, options = {}) {
- const { domain, messages: messages2, args } = options;
- const msg = format((messages2 || errorMessages$2)[code2] || "", ...args || []);
- const error2 = new SyntaxError(String(msg));
- error2.code = code2;
- if (loc) {
- error2.location = loc;
- }
- error2.domain = domain;
- return error2;
- }
- /*!
- * @intlify/devtools-if v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const IntlifyDevToolsHooks = {
- I18nInit: "i18n:init",
- FunctionTranslate: "function:translate"
- };
- /*!
- * @intlify/core-base v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- let devtools = null;
- function setDevToolsHook(hook) {
- devtools = hook;
- }
- function initI18nDevTools(i18n2, version, meta) {
- devtools && devtools.emit(IntlifyDevToolsHooks.I18nInit, {
- timestamp: Date.now(),
- i18n: i18n2,
- version,
- meta
- });
- }
- const translateDevTools = /* @__PURE__ */ createDevToolsHook(IntlifyDevToolsHooks.FunctionTranslate);
- function createDevToolsHook(hook) {
- return (payloads) => devtools && devtools.emit(hook, payloads);
- }
- const warnMessages$1 = {
- [
- 0
- /* NOT_FOUND_KEY */
- ]: `Not found '{key}' key in '{locale}' locale messages.`,
- [
- 1
- /* FALLBACK_TO_TRANSLATE */
- ]: `Fall back to translate '{key}' key with '{target}' locale.`,
- [
- 2
- /* CANNOT_FORMAT_NUMBER */
- ]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
- [
- 3
- /* FALLBACK_TO_NUMBER_FORMAT */
- ]: `Fall back to number format '{key}' key with '{target}' locale.`,
- [
- 4
- /* CANNOT_FORMAT_DATE */
- ]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
- [
- 5
- /* FALLBACK_TO_DATE_FORMAT */
- ]: `Fall back to datetime format '{key}' key with '{target}' locale.`
- };
- function getWarnMessage$1(code2, ...args) {
- return format(warnMessages$1[code2], ...args);
- }
- const VERSION$1 = "9.1.9";
- const NOT_REOSLVED = -1;
- const MISSING_RESOLVE_VALUE = "";
- function getDefaultLinkedModifiers() {
- return {
- upper: (val) => isString(val) ? val.toUpperCase() : val,
- lower: (val) => isString(val) ? val.toLowerCase() : val,
- // prettier-ignore
- capitalize: (val) => isString(val) ? `${val.charAt(0).toLocaleUpperCase()}${val.substr(1)}` : val
- };
- }
- let _compiler;
- let _additionalMeta = null;
- const setAdditionalMeta = (meta) => {
- _additionalMeta = meta;
- };
- const getAdditionalMeta = () => _additionalMeta;
- let _cid = 0;
- function createCoreContext(options = {}) {
- const version = isString(options.version) ? options.version : VERSION$1;
- const locale = isString(options.locale) ? options.locale : "en-US";
- const fallbackLocale = isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || isString(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale;
- const messages2 = isPlainObject(options.messages) ? options.messages : { [locale]: {} };
- const datetimeFormats = isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [locale]: {} };
- const numberFormats = isPlainObject(options.numberFormats) ? options.numberFormats : { [locale]: {} };
- const modifiers = assign({}, options.modifiers || {}, getDefaultLinkedModifiers());
- const pluralRules = options.pluralRules || {};
- const missing = isFunction(options.missing) ? options.missing : null;
- const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
- const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
- const fallbackFormat = !!options.fallbackFormat;
- const unresolving = !!options.unresolving;
- const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
- const processor = isPlainObject(options.processor) ? options.processor : null;
- const warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
- const escapeParameter = !!options.escapeParameter;
- const messageCompiler = isFunction(options.messageCompiler) ? options.messageCompiler : _compiler;
- const onWarn = isFunction(options.onWarn) ? options.onWarn : warn;
- const internalOptions = options;
- const __datetimeFormatters = isObject$1(internalOptions.__datetimeFormatters) ? internalOptions.__datetimeFormatters : /* @__PURE__ */ new Map();
- const __numberFormatters = isObject$1(internalOptions.__numberFormatters) ? internalOptions.__numberFormatters : /* @__PURE__ */ new Map();
- const __meta = isObject$1(internalOptions.__meta) ? internalOptions.__meta : {};
- _cid++;
- const context = {
- version,
- cid: _cid,
- locale,
- fallbackLocale,
- messages: messages2,
- datetimeFormats,
- numberFormats,
- modifiers,
- pluralRules,
- missing,
- missingWarn,
- fallbackWarn,
- fallbackFormat,
- unresolving,
- postTranslation,
- processor,
- warnHtmlMessage,
- escapeParameter,
- messageCompiler,
- onWarn,
- __datetimeFormatters,
- __numberFormatters,
- __meta
- };
- {
- context.__v_emitter = internalOptions.__v_emitter != null ? internalOptions.__v_emitter : void 0;
- }
- {
- initI18nDevTools(context, version, __meta);
- }
- return context;
- }
- function isTranslateFallbackWarn(fallback, key) {
- return fallback instanceof RegExp ? fallback.test(key) : fallback;
- }
- function isTranslateMissingWarn(missing, key) {
- return missing instanceof RegExp ? missing.test(key) : missing;
- }
- function handleMissing(context, key, locale, missingWarn, type2) {
- const { missing, onWarn } = context;
- {
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("missing", {
- locale,
- key,
- type: type2,
- groupId: `${type2}:${key}`
- });
- }
- }
- if (missing !== null) {
- const ret = missing(context, locale, key, type2);
- return isString(ret) ? ret : key;
- } else {
- if (isTranslateMissingWarn(missingWarn, key)) {
- onWarn(getWarnMessage$1(0, { key, locale }));
- }
- return key;
- }
- }
- function getLocaleChain(ctx, fallback, start) {
- const context = ctx;
- if (!context.__localeChainCache) {
- context.__localeChainCache = /* @__PURE__ */ new Map();
- }
- let chain = context.__localeChainCache.get(start);
- if (!chain) {
- chain = [];
- let block = [start];
- while (isArray(block)) {
- block = appendBlockToChain(chain, block, fallback);
- }
- const defaults = isArray(fallback) ? fallback : isPlainObject(fallback) ? fallback["default"] ? fallback["default"] : null : fallback;
- block = isString(defaults) ? [defaults] : defaults;
- if (isArray(block)) {
- appendBlockToChain(chain, block, false);
- }
- context.__localeChainCache.set(start, chain);
- }
- return chain;
- }
- function appendBlockToChain(chain, block, blocks) {
- let follow = true;
- for (let i = 0; i < block.length && isBoolean(follow); i++) {
- const locale = block[i];
- if (isString(locale)) {
- follow = appendLocaleToChain(chain, block[i], blocks);
- }
- }
- return follow;
- }
- function appendLocaleToChain(chain, locale, blocks) {
- let follow;
- const tokens = locale.split("-");
- do {
- const target = tokens.join("-");
- follow = appendItemToChain(chain, target, blocks);
- tokens.splice(-1, 1);
- } while (tokens.length && follow === true);
- return follow;
- }
- function appendItemToChain(chain, target, blocks) {
- let follow = false;
- if (!chain.includes(target)) {
- follow = true;
- if (target) {
- follow = target[target.length - 1] !== "!";
- const locale = target.replace(/!/g, "");
- chain.push(locale);
- if ((isArray(blocks) || isPlainObject(blocks)) && blocks[locale]) {
- follow = blocks[locale];
- }
- }
- }
- return follow;
- }
- function updateFallbackLocale(ctx, locale, fallback) {
- const context = ctx;
- context.__localeChainCache = /* @__PURE__ */ new Map();
- getLocaleChain(ctx, fallback, locale);
- }
- function createCoreError(code2) {
- return createCompileError(code2, null, { messages: errorMessages$1 });
- }
- const errorMessages$1 = {
- [
- 14
- /* INVALID_ARGUMENT */
- ]: "Invalid arguments",
- [
- 15
- /* INVALID_DATE_ARGUMENT */
- ]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
- [
- 16
- /* INVALID_ISO_DATE_ARGUMENT */
- ]: "The argument provided is not a valid ISO date string"
- };
- const NOOP_MESSAGE_FUNCTION = () => "";
- const isMessageFunction = (val) => isFunction(val);
- function translate(context, ...args) {
- const { fallbackFormat, postTranslation, unresolving, fallbackLocale, messages: messages2 } = context;
- const [key, options] = parseTranslateArgs(...args);
- const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
- const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
- const escapeParameter = isBoolean(options.escapeParameter) ? options.escapeParameter : context.escapeParameter;
- const resolvedMessage = !!options.resolvedMessage;
- const defaultMsgOrKey = isString(options.default) || isBoolean(options.default) ? !isBoolean(options.default) ? options.default : key : fallbackFormat ? key : "";
- const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== "";
- const locale = isString(options.locale) ? options.locale : context.locale;
- escapeParameter && escapeParams(options);
- let [format2, targetLocale, message] = !resolvedMessage ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) : [
- key,
- locale,
- messages2[locale] || {}
- ];
- let cacheBaseKey = key;
- if (!resolvedMessage && !(isString(format2) || isMessageFunction(format2))) {
- if (enableDefaultMsg) {
- format2 = defaultMsgOrKey;
- cacheBaseKey = format2;
- }
- }
- if (!resolvedMessage && (!(isString(format2) || isMessageFunction(format2)) || !isString(targetLocale))) {
- return unresolving ? NOT_REOSLVED : key;
- }
- if (isString(format2) && context.messageCompiler == null) {
- warn(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${key}'.`);
- return key;
- }
- let occurred = false;
- const errorDetector = () => {
- occurred = true;
- };
- const msg = !isMessageFunction(format2) ? compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, errorDetector) : format2;
- if (occurred) {
- return format2;
- }
- const ctxOptions = getMessageContextOptions(context, targetLocale, message, options);
- const msgContext = createMessageContext(ctxOptions);
- const messaged = evaluateMessage(context, msg, msgContext);
- const ret = postTranslation ? postTranslation(messaged) : messaged;
- {
- const payloads = {
- timestamp: Date.now(),
- key: isString(key) ? key : isMessageFunction(format2) ? format2.key : "",
- locale: targetLocale || (isMessageFunction(format2) ? format2.locale : ""),
- format: isString(format2) ? format2 : isMessageFunction(format2) ? format2.source : "",
- message: ret
- };
- payloads.meta = assign({}, context.__meta, getAdditionalMeta() || {});
- translateDevTools(payloads);
- }
- return ret;
- }
- function escapeParams(options) {
- if (isArray(options.list)) {
- options.list = options.list.map((item) => isString(item) ? escapeHtml(item) : item);
- } else if (isObject$1(options.named)) {
- Object.keys(options.named).forEach((key) => {
- if (isString(options.named[key])) {
- options.named[key] = escapeHtml(options.named[key]);
- }
- });
- }
- }
- function resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {
- const { messages: messages2, onWarn } = context;
- const locales = getLocaleChain(context, fallbackLocale, locale);
- let message = {};
- let targetLocale;
- let format2 = null;
- let from = locale;
- let to = null;
- const type2 = "translate";
- for (let i = 0; i < locales.length; i++) {
- targetLocale = to = locales[i];
- if (locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
- onWarn(getWarnMessage$1(1, {
- key,
- target: targetLocale
- }));
- }
- if (locale !== targetLocale) {
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("fallback", {
- type: type2,
- key,
- from,
- to,
- groupId: `${type2}:${key}`
- });
- }
- }
- message = messages2[targetLocale] || {};
- let start = null;
- let startTag;
- let endTag;
- if (inBrowser) {
- start = window.performance.now();
- startTag = "intlify-message-resolve-start";
- endTag = "intlify-message-resolve-end";
- mark && mark(startTag);
- }
- if ((format2 = resolveValue(message, key)) === null) {
- format2 = message[key];
- }
- if (inBrowser) {
- const end = window.performance.now();
- const emitter = context.__v_emitter;
- if (emitter && start && format2) {
- emitter.emit("message-resolve", {
- type: "message-resolve",
- key,
- message: format2,
- time: end - start,
- groupId: `${type2}:${key}`
- });
- }
- if (startTag && endTag && mark && measure) {
- mark(endTag);
- measure("intlify message resolve", startTag, endTag);
- }
- }
- if (isString(format2) || isFunction(format2))
- break;
- const missingRet = handleMissing(context, key, targetLocale, missingWarn, type2);
- if (missingRet !== key) {
- format2 = missingRet;
- }
- from = to;
- }
- return [format2, targetLocale, message];
- }
- function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, errorDetector) {
- const { messageCompiler, warnHtmlMessage } = context;
- if (isMessageFunction(format2)) {
- const msg2 = format2;
- msg2.locale = msg2.locale || targetLocale;
- msg2.key = msg2.key || key;
- return msg2;
- }
- let start = null;
- let startTag;
- let endTag;
- if (inBrowser) {
- start = window.performance.now();
- startTag = "intlify-message-compilation-start";
- endTag = "intlify-message-compilation-end";
- mark && mark(startTag);
- }
- const msg = messageCompiler(format2, getCompileOptions(context, targetLocale, cacheBaseKey, format2, warnHtmlMessage, errorDetector));
- if (inBrowser) {
- const end = window.performance.now();
- const emitter = context.__v_emitter;
- if (emitter && start) {
- emitter.emit("message-compilation", {
- type: "message-compilation",
- message: format2,
- time: end - start,
- groupId: `${"translate"}:${key}`
- });
- }
- if (startTag && endTag && mark && measure) {
- mark(endTag);
- measure("intlify message compilation", startTag, endTag);
- }
- }
- msg.locale = targetLocale;
- msg.key = key;
- msg.source = format2;
- return msg;
- }
- function evaluateMessage(context, msg, msgCtx) {
- let start = null;
- let startTag;
- let endTag;
- if (inBrowser) {
- start = window.performance.now();
- startTag = "intlify-message-evaluation-start";
- endTag = "intlify-message-evaluation-end";
- mark && mark(startTag);
- }
- const messaged = msg(msgCtx);
- if (inBrowser) {
- const end = window.performance.now();
- const emitter = context.__v_emitter;
- if (emitter && start) {
- emitter.emit("message-evaluation", {
- type: "message-evaluation",
- value: messaged,
- time: end - start,
- groupId: `${"translate"}:${msg.key}`
- });
- }
- if (startTag && endTag && mark && measure) {
- mark(endTag);
- measure("intlify message evaluation", startTag, endTag);
- }
- }
- return messaged;
- }
- function parseTranslateArgs(...args) {
- const [arg1, arg2, arg3] = args;
- const options = {};
- if (!isString(arg1) && !isNumber(arg1) && !isMessageFunction(arg1)) {
- throw createCoreError(
- 14
- /* INVALID_ARGUMENT */
- );
- }
- const key = isNumber(arg1) ? String(arg1) : isMessageFunction(arg1) ? arg1 : arg1;
- if (isNumber(arg2)) {
- options.plural = arg2;
- } else if (isString(arg2)) {
- options.default = arg2;
- } else if (isPlainObject(arg2) && !isEmptyObject(arg2)) {
- options.named = arg2;
- } else if (isArray(arg2)) {
- options.list = arg2;
- }
- if (isNumber(arg3)) {
- options.plural = arg3;
- } else if (isString(arg3)) {
- options.default = arg3;
- } else if (isPlainObject(arg3)) {
- assign(options, arg3);
- }
- return [key, options];
- }
- function getCompileOptions(context, locale, key, source, warnHtmlMessage, errorDetector) {
- return {
- warnHtmlMessage,
- onError: (err) => {
- errorDetector && errorDetector(err);
- {
- const message = `Message compilation error: ${err.message}`;
- const codeFrame = err.location && generateCodeFrame(source, err.location.start.offset, err.location.end.offset);
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("compile-error", {
- message: source,
- error: err.message,
- start: err.location && err.location.start.offset,
- end: err.location && err.location.end.offset,
- groupId: `${"translate"}:${key}`
- });
- }
- console.error(codeFrame ? `${message}
- ${codeFrame}` : message);
- }
- },
- onCacheKey: (source2) => generateFormatCacheKey(locale, key, source2)
- };
- }
- function getMessageContextOptions(context, locale, message, options) {
- const { modifiers, pluralRules } = context;
- const resolveMessage = (key) => {
- const val = resolveValue(message, key);
- if (isString(val)) {
- let occurred = false;
- const errorDetector = () => {
- occurred = true;
- };
- const msg = compileMessageFormat(context, key, locale, val, key, errorDetector);
- return !occurred ? msg : NOOP_MESSAGE_FUNCTION;
- } else if (isMessageFunction(val)) {
- return val;
- } else {
- return NOOP_MESSAGE_FUNCTION;
- }
- };
- const ctxOptions = {
- locale,
- modifiers,
- pluralRules,
- messages: resolveMessage
- };
- if (context.processor) {
- ctxOptions.processor = context.processor;
- }
- if (options.list) {
- ctxOptions.list = options.list;
- }
- if (options.named) {
- ctxOptions.named = options.named;
- }
- if (isNumber(options.plural)) {
- ctxOptions.pluralIndex = options.plural;
- }
- return ctxOptions;
- }
- const intlDefined = typeof Intl !== "undefined";
- const Availabilities = {
- dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== "undefined",
- numberFormat: intlDefined && typeof Intl.NumberFormat !== "undefined"
- };
- function datetime(context, ...args) {
- const { datetimeFormats, unresolving, fallbackLocale, onWarn } = context;
- const { __datetimeFormatters } = context;
- if (!Availabilities.dateTimeFormat) {
- onWarn(getWarnMessage$1(
- 4
- /* CANNOT_FORMAT_DATE */
- ));
- return MISSING_RESOLVE_VALUE;
- }
- const [key, value2, options, overrides] = parseDateTimeArgs(...args);
- const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
- const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
- const part = !!options.part;
- const locale = isString(options.locale) ? options.locale : context.locale;
- const locales = getLocaleChain(context, fallbackLocale, locale);
- if (!isString(key) || key === "") {
- return new Intl.DateTimeFormat(locale).format(value2);
- }
- let datetimeFormat = {};
- let targetLocale;
- let format2 = null;
- let from = locale;
- let to = null;
- const type2 = "datetime format";
- for (let i = 0; i < locales.length; i++) {
- targetLocale = to = locales[i];
- if (locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
- onWarn(getWarnMessage$1(5, {
- key,
- target: targetLocale
- }));
- }
- if (locale !== targetLocale) {
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("fallback", {
- type: type2,
- key,
- from,
- to,
- groupId: `${type2}:${key}`
- });
- }
- }
- datetimeFormat = datetimeFormats[targetLocale] || {};
- format2 = datetimeFormat[key];
- if (isPlainObject(format2))
- break;
- handleMissing(context, key, targetLocale, missingWarn, type2);
- from = to;
- }
- if (!isPlainObject(format2) || !isString(targetLocale)) {
- return unresolving ? NOT_REOSLVED : key;
- }
- let id = `${targetLocale}__${key}`;
- if (!isEmptyObject(overrides)) {
- id = `${id}__${JSON.stringify(overrides)}`;
- }
- let formatter = __datetimeFormatters.get(id);
- if (!formatter) {
- formatter = new Intl.DateTimeFormat(targetLocale, assign({}, format2, overrides));
- __datetimeFormatters.set(id, formatter);
- }
- return !part ? formatter.format(value2) : formatter.formatToParts(value2);
- }
- function parseDateTimeArgs(...args) {
- const [arg1, arg2, arg3, arg4] = args;
- let options = {};
- let overrides = {};
- let value2;
- if (isString(arg1)) {
- if (!/\d{4}-\d{2}-\d{2}(T.*)?/.test(arg1)) {
- throw createCoreError(
- 16
- /* INVALID_ISO_DATE_ARGUMENT */
- );
- }
- value2 = new Date(arg1);
- try {
- value2.toISOString();
- } catch (e) {
- throw createCoreError(
- 16
- /* INVALID_ISO_DATE_ARGUMENT */
- );
- }
- } else if (isDate(arg1)) {
- if (isNaN(arg1.getTime())) {
- throw createCoreError(
- 15
- /* INVALID_DATE_ARGUMENT */
- );
- }
- value2 = arg1;
- } else if (isNumber(arg1)) {
- value2 = arg1;
- } else {
- throw createCoreError(
- 14
- /* INVALID_ARGUMENT */
- );
- }
- if (isString(arg2)) {
- options.key = arg2;
- } else if (isPlainObject(arg2)) {
- options = arg2;
- }
- if (isString(arg3)) {
- options.locale = arg3;
- } else if (isPlainObject(arg3)) {
- overrides = arg3;
- }
- if (isPlainObject(arg4)) {
- overrides = arg4;
- }
- return [options.key || "", value2, options, overrides];
- }
- function clearDateTimeFormat(ctx, locale, format2) {
- const context = ctx;
- for (const key in format2) {
- const id = `${locale}__${key}`;
- if (!context.__datetimeFormatters.has(id)) {
- continue;
- }
- context.__datetimeFormatters.delete(id);
- }
- }
- function number(context, ...args) {
- const { numberFormats, unresolving, fallbackLocale, onWarn } = context;
- const { __numberFormatters } = context;
- if (!Availabilities.numberFormat) {
- onWarn(getWarnMessage$1(
- 2
- /* CANNOT_FORMAT_NUMBER */
- ));
- return MISSING_RESOLVE_VALUE;
- }
- const [key, value2, options, overrides] = parseNumberArgs(...args);
- const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
- const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
- const part = !!options.part;
- const locale = isString(options.locale) ? options.locale : context.locale;
- const locales = getLocaleChain(context, fallbackLocale, locale);
- if (!isString(key) || key === "") {
- return new Intl.NumberFormat(locale).format(value2);
- }
- let numberFormat = {};
- let targetLocale;
- let format2 = null;
- let from = locale;
- let to = null;
- const type2 = "number format";
- for (let i = 0; i < locales.length; i++) {
- targetLocale = to = locales[i];
- if (locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
- onWarn(getWarnMessage$1(3, {
- key,
- target: targetLocale
- }));
- }
- if (locale !== targetLocale) {
- const emitter = context.__v_emitter;
- if (emitter) {
- emitter.emit("fallback", {
- type: type2,
- key,
- from,
- to,
- groupId: `${type2}:${key}`
- });
- }
- }
- numberFormat = numberFormats[targetLocale] || {};
- format2 = numberFormat[key];
- if (isPlainObject(format2))
- break;
- handleMissing(context, key, targetLocale, missingWarn, type2);
- from = to;
- }
- if (!isPlainObject(format2) || !isString(targetLocale)) {
- return unresolving ? NOT_REOSLVED : key;
- }
- let id = `${targetLocale}__${key}`;
- if (!isEmptyObject(overrides)) {
- id = `${id}__${JSON.stringify(overrides)}`;
- }
- let formatter = __numberFormatters.get(id);
- if (!formatter) {
- formatter = new Intl.NumberFormat(targetLocale, assign({}, format2, overrides));
- __numberFormatters.set(id, formatter);
- }
- return !part ? formatter.format(value2) : formatter.formatToParts(value2);
- }
- function parseNumberArgs(...args) {
- const [arg1, arg2, arg3, arg4] = args;
- let options = {};
- let overrides = {};
- if (!isNumber(arg1)) {
- throw createCoreError(
- 14
- /* INVALID_ARGUMENT */
- );
- }
- const value2 = arg1;
- if (isString(arg2)) {
- options.key = arg2;
- } else if (isPlainObject(arg2)) {
- options = arg2;
- }
- if (isString(arg3)) {
- options.locale = arg3;
- } else if (isPlainObject(arg3)) {
- overrides = arg3;
- }
- if (isPlainObject(arg4)) {
- overrides = arg4;
- }
- return [options.key || "", value2, options, overrides];
- }
- function clearNumberFormat(ctx, locale, format2) {
- const context = ctx;
- for (const key in format2) {
- const id = `${locale}__${key}`;
- if (!context.__numberFormatters.has(id)) {
- continue;
- }
- context.__numberFormatters.delete(id);
- }
- }
- function getDevtoolsGlobalHook() {
- return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
- }
- function getTarget() {
- return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
- }
- const isProxyAvailable = typeof Proxy === "function";
- const HOOK_SETUP = "devtools-plugin:setup";
- const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
- class ApiProxy {
- constructor(plugin, hook) {
- this.target = null;
- this.targetQueue = [];
- this.onQueue = [];
- this.plugin = plugin;
- this.hook = hook;
- const defaultSettings = {};
- if (plugin.settings) {
- for (const id in plugin.settings) {
- const item = plugin.settings[id];
- defaultSettings[id] = item.defaultValue;
- }
- }
- const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
- let currentSettings = { ...defaultSettings };
- try {
- const raw = localStorage.getItem(localSettingsSaveId);
- const data = JSON.parse(raw);
- Object.assign(currentSettings, data);
- } catch (e) {
- }
- this.fallbacks = {
- getSettings() {
- return currentSettings;
- },
- setSettings(value2) {
- try {
- localStorage.setItem(localSettingsSaveId, JSON.stringify(value2));
- } catch (e) {
- }
- currentSettings = value2;
- }
- };
- hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value2) => {
- if (pluginId === this.plugin.id) {
- this.fallbacks.setSettings(value2);
- }
- });
- this.proxiedOn = new Proxy({}, {
- get: (_target, prop) => {
- if (this.target) {
- return this.target.on[prop];
- } else {
- return (...args) => {
- this.onQueue.push({
- method: prop,
- args
- });
- };
- }
- }
- });
- this.proxiedTarget = new Proxy({}, {
- get: (_target, prop) => {
- if (this.target) {
- return this.target[prop];
- } else if (prop === "on") {
- return this.proxiedOn;
- } else if (Object.keys(this.fallbacks).includes(prop)) {
- return (...args) => {
- this.targetQueue.push({
- method: prop,
- args,
- resolve: () => {
- }
- });
- return this.fallbacks[prop](...args);
- };
- } else {
- return (...args) => {
- return new Promise((resolve) => {
- this.targetQueue.push({
- method: prop,
- args,
- resolve
- });
- });
- };
- }
- }
- });
- }
- async setRealTarget(target) {
- this.target = target;
- for (const item of this.onQueue) {
- this.target.on[item.method](...item.args);
- }
- for (const item of this.targetQueue) {
- item.resolve(await this.target[item.method](...item.args));
- }
- }
- }
- function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
- const target = getTarget();
- const hook = getDevtoolsGlobalHook();
- const enableProxy = isProxyAvailable && pluginDescriptor.enableEarlyProxy;
- if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
- hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
- } else {
- const proxy = enableProxy ? new ApiProxy(pluginDescriptor, hook) : null;
- const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
- list.push({
- pluginDescriptor,
- setupFn,
- proxy
- });
- if (proxy)
- setupFn(proxy.proxiedTarget);
- }
- }
- /*!
- * @intlify/vue-devtools v9.1.9
- * (c) 2021 kazuya kawaguchi
- * Released under the MIT License.
- */
- const VueDevToolsLabels = {
- [
- "vue-devtools-plugin-vue-i18n"
- /* PLUGIN */
- ]: "Vue I18n devtools",
- [
- "vue-i18n-resource-inspector"
- /* CUSTOM_INSPECTOR */
- ]: "I18n Resources",
- [
- "vue-i18n-timeline"
- /* TIMELINE */
- ]: "Vue I18n"
- };
- const VueDevToolsPlaceholders = {
- [
- "vue-i18n-resource-inspector"
- /* CUSTOM_INSPECTOR */
- ]: "Search for scopes ..."
- };
- const VueDevToolsTimelineColors = {
- [
- "vue-i18n-timeline"
- /* TIMELINE */
- ]: 16764185
- };
- /*!
- * vue-i18n v9.1.9
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */
- const VERSION = "9.1.9";
- function initFeatureFlags() {
- let needWarn = false;
- {
- needWarn = true;
- }
- if (needWarn) {
- console.warn(`You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.`);
- }
- }
- const warnMessages = {
- [
- 6
- /* FALLBACK_TO_ROOT */
- ]: `Fall back to {type} '{key}' with root locale.`,
- [
- 7
- /* NOT_SUPPORTED_PRESERVE */
- ]: `Not supported 'preserve'.`,
- [
- 8
- /* NOT_SUPPORTED_FORMATTER */
- ]: `Not supported 'formatter'.`,
- [
- 9
- /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
- ]: `Not supported 'preserveDirectiveContent'.`,
- [
- 10
- /* NOT_SUPPORTED_GET_CHOICE_INDEX */
- ]: `Not supported 'getChoiceIndex'.`,
- [
- 11
- /* COMPONENT_NAME_LEGACY_COMPATIBLE */
- ]: `Component name legacy compatible: '{name}' -> 'i18n'`,
- [
- 12
- /* NOT_FOUND_PARENT_SCOPE */
- ]: `Not found parent scope. use the global scope.`
- };
- function getWarnMessage(code2, ...args) {
- return format(warnMessages[code2], ...args);
- }
- function createI18nError(code2, ...args) {
- return createCompileError(code2, null, { messages: errorMessages, args });
- }
- const errorMessages = {
- [
- 14
- /* UNEXPECTED_RETURN_TYPE */
- ]: "Unexpected return type in composer",
- [
- 15
- /* INVALID_ARGUMENT */
- ]: "Invalid argument",
- [
- 16
- /* MUST_BE_CALL_SETUP_TOP */
- ]: "Must be called at the top of a `setup` function",
- [
- 17
- /* NOT_INSLALLED */
- ]: "Need to install with `app.use` function",
- [
- 22
- /* UNEXPECTED_ERROR */
- ]: "Unexpected error",
- [
- 18
- /* NOT_AVAILABLE_IN_LEGACY_MODE */
- ]: "Not available in legacy mode",
- [
- 19
- /* REQUIRED_VALUE */
- ]: `Required in value: {0}`,
- [
- 20
- /* INVALID_VALUE */
- ]: `Invalid value`,
- [
- 21
- /* CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN */
- ]: `Cannot setup vue-devtools plugin`
- };
- const DEVTOOLS_META = "__INTLIFY_META__";
- const TransrateVNodeSymbol = makeSymbol("__transrateVNode");
- const DatetimePartsSymbol = makeSymbol("__datetimeParts");
- const NumberPartsSymbol = makeSymbol("__numberParts");
- const EnableEmitter = makeSymbol("__enableEmitter");
- const DisableEmitter = makeSymbol("__disableEmitter");
- const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
- makeSymbol("__intlifyMeta");
- const InejctWithOption = makeSymbol("__injectWithOption");
- let composerID = 0;
- function defineCoreMissingHandler(missing) {
- return (ctx, locale, key, type2) => {
- return missing(locale, key, vue.getCurrentInstance() || void 0, type2);
- };
- }
- function getLocaleMessages(locale, options) {
- const { messages: messages2, __i18n } = options;
- const ret = isPlainObject(messages2) ? messages2 : isArray(__i18n) ? {} : { [locale]: {} };
- if (isArray(__i18n)) {
- __i18n.forEach(({ locale: locale2, resource }) => {
- if (locale2) {
- ret[locale2] = ret[locale2] || {};
- deepCopy(resource, ret[locale2]);
- } else {
- deepCopy(resource, ret);
- }
- });
- }
- if (options.flatJson) {
- for (const key in ret) {
- if (hasOwn$1(ret, key)) {
- handleFlatJson(ret[key]);
- }
- }
- }
- return ret;
- }
- const isNotObjectOrIsArray = (val) => !isObject$1(val) || isArray(val);
- function deepCopy(src, des) {
- if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
- throw createI18nError(
- 20
- /* INVALID_VALUE */
- );
- }
- for (const key in src) {
- if (hasOwn$1(src, key)) {
- if (isNotObjectOrIsArray(src[key]) || isNotObjectOrIsArray(des[key])) {
- des[key] = src[key];
- } else {
- deepCopy(src[key], des[key]);
- }
- }
- }
- }
- const getMetaInfo = () => {
- const instance = vue.getCurrentInstance();
- return instance && instance.type[DEVTOOLS_META] ? { [DEVTOOLS_META]: instance.type[DEVTOOLS_META] } : null;
- };
- function createComposer(options = {}) {
- const { __root } = options;
- const _isGlobal = __root === void 0;
- let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
- const _locale = vue.ref(
- // prettier-ignore
- __root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : "en-US"
- );
- const _fallbackLocale = vue.ref(
- // prettier-ignore
- __root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
- );
- const _messages = vue.ref(getLocaleMessages(_locale.value, options));
- const _datetimeFormats = vue.ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
- const _numberFormats = vue.ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
- let _missingWarn = __root ? __root.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
- let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
- let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
- let _fallbackFormat = !!options.fallbackFormat;
- let _missing = isFunction(options.missing) ? options.missing : null;
- let _runtimeMissing = isFunction(options.missing) ? defineCoreMissingHandler(options.missing) : null;
- let _postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
- let _warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
- let _escapeParameter = !!options.escapeParameter;
- const _modifiers = __root ? __root.modifiers : isPlainObject(options.modifiers) ? options.modifiers : {};
- let _pluralRules = options.pluralRules || __root && __root.pluralRules;
- let _context;
- function getCoreContext() {
- return createCoreContext({
- version: VERSION,
- locale: _locale.value,
- fallbackLocale: _fallbackLocale.value,
- messages: _messages.value,
- messageCompiler: function compileToFunction(source) {
- return (ctx) => {
- return ctx.normalize([source]);
- };
- },
- datetimeFormats: _datetimeFormats.value,
- numberFormats: _numberFormats.value,
- modifiers: _modifiers,
- pluralRules: _pluralRules,
- missing: _runtimeMissing === null ? void 0 : _runtimeMissing,
- missingWarn: _missingWarn,
- fallbackWarn: _fallbackWarn,
- fallbackFormat: _fallbackFormat,
- unresolving: true,
- postTranslation: _postTranslation === null ? void 0 : _postTranslation,
- warnHtmlMessage: _warnHtmlMessage,
- escapeParameter: _escapeParameter,
- __datetimeFormatters: isPlainObject(_context) ? _context.__datetimeFormatters : void 0,
- __numberFormatters: isPlainObject(_context) ? _context.__numberFormatters : void 0,
- __v_emitter: isPlainObject(_context) ? _context.__v_emitter : void 0,
- __meta: { framework: "vue" }
- });
- }
- _context = getCoreContext();
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
- function trackReactivityValues() {
- return [
- _locale.value,
- _fallbackLocale.value,
- _messages.value,
- _datetimeFormats.value,
- _numberFormats.value
- ];
- }
- const locale = vue.computed({
- get: () => _locale.value,
- set: (val) => {
- _locale.value = val;
- _context.locale = _locale.value;
- }
- });
- const fallbackLocale = vue.computed({
- get: () => _fallbackLocale.value,
- set: (val) => {
- _fallbackLocale.value = val;
- _context.fallbackLocale = _fallbackLocale.value;
- updateFallbackLocale(_context, _locale.value, val);
- }
- });
- const messages2 = vue.computed(() => _messages.value);
- const datetimeFormats = vue.computed(() => _datetimeFormats.value);
- const numberFormats = vue.computed(() => _numberFormats.value);
- function getPostTranslationHandler() {
- return isFunction(_postTranslation) ? _postTranslation : null;
- }
- function setPostTranslationHandler(handler) {
- _postTranslation = handler;
- _context.postTranslation = handler;
- }
- function getMissingHandler() {
- return _missing;
- }
- function setMissingHandler(handler) {
- if (handler !== null) {
- _runtimeMissing = defineCoreMissingHandler(handler);
- }
- _missing = handler;
- _context.missing = _runtimeMissing;
- }
- function isResolvedTranslateMessage(type2, arg) {
- return type2 !== "translate" || !!arg.resolvedMessage === false;
- }
- function wrapWithDeps(fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) {
- trackReactivityValues();
- let ret;
- {
- try {
- setAdditionalMeta(getMetaInfo());
- ret = fn(_context);
- } finally {
- setAdditionalMeta(null);
- }
- }
- if (isNumber(ret) && ret === NOT_REOSLVED) {
- const [key, arg2] = argumentParser();
- if (__root && isString(key) && isResolvedTranslateMessage(warnType, arg2)) {
- if (_fallbackRoot && (isTranslateFallbackWarn(_fallbackWarn, key) || isTranslateMissingWarn(_missingWarn, key))) {
- warn(getWarnMessage(6, {
- key,
- type: warnType
- }));
- }
- {
- const { __v_emitter: emitter } = _context;
- if (emitter && _fallbackRoot) {
- emitter.emit("fallback", {
- type: warnType,
- key,
- to: "global",
- groupId: `${warnType}:${key}`
- });
- }
- }
- }
- return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key);
- } else if (successCondition(ret)) {
- return ret;
- } else {
- throw createI18nError(
- 14
- /* UNEXPECTED_RETURN_TYPE */
- );
- }
- }
- function t(...args) {
- return wrapWithDeps((context) => translate(context, ...args), () => parseTranslateArgs(...args), "translate", (root) => root.t(...args), (key) => key, (val) => isString(val));
- }
- function rt(...args) {
- const [arg1, arg2, arg3] = args;
- if (arg3 && !isObject$1(arg3)) {
- throw createI18nError(
- 15
- /* INVALID_ARGUMENT */
- );
- }
- return t(...[arg1, arg2, assign({ resolvedMessage: true }, arg3 || {})]);
- }
- function d(...args) {
- return wrapWithDeps((context) => datetime(context, ...args), () => parseDateTimeArgs(...args), "datetime format", (root) => root.d(...args), () => MISSING_RESOLVE_VALUE, (val) => isString(val));
- }
- function n2(...args) {
- return wrapWithDeps((context) => number(context, ...args), () => parseNumberArgs(...args), "number format", (root) => root.n(...args), () => MISSING_RESOLVE_VALUE, (val) => isString(val));
- }
- function normalize(values) {
- return values.map((val) => isString(val) ? vue.createVNode(vue.Text, null, val, 0) : val);
- }
- const interpolate = (val) => val;
- const processor = {
- normalize,
- interpolate,
- type: "vnode"
- };
- function transrateVNode(...args) {
- return wrapWithDeps(
- (context) => {
- let ret;
- const _context2 = context;
- try {
- _context2.processor = processor;
- ret = translate(_context2, ...args);
- } finally {
- _context2.processor = null;
- }
- return ret;
- },
- () => parseTranslateArgs(...args),
- "translate",
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (root) => root[TransrateVNodeSymbol](...args),
- (key) => [vue.createVNode(vue.Text, null, key, 0)],
- (val) => isArray(val)
- );
- }
- function numberParts(...args) {
- return wrapWithDeps(
- (context) => number(context, ...args),
- () => parseNumberArgs(...args),
- "number format",
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (root) => root[NumberPartsSymbol](...args),
- () => [],
- (val) => isString(val) || isArray(val)
- );
- }
- function datetimeParts(...args) {
- return wrapWithDeps(
- (context) => datetime(context, ...args),
- () => parseDateTimeArgs(...args),
- "datetime format",
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (root) => root[DatetimePartsSymbol](...args),
- () => [],
- (val) => isString(val) || isArray(val)
- );
- }
- function setPluralRules(rules2) {
- _pluralRules = rules2;
- _context.pluralRules = _pluralRules;
- }
- function te(key, locale2) {
- const targetLocale = isString(locale2) ? locale2 : _locale.value;
- const message = getLocaleMessage(targetLocale);
- return resolveValue(message, key) !== null;
- }
- function resolveMessages(key) {
- let messages3 = null;
- const locales = getLocaleChain(_context, _fallbackLocale.value, _locale.value);
- for (let i = 0; i < locales.length; i++) {
- const targetLocaleMessages = _messages.value[locales[i]] || {};
- const messageValue = resolveValue(targetLocaleMessages, key);
- if (messageValue != null) {
- messages3 = messageValue;
- break;
- }
- }
- return messages3;
- }
- function tm(key) {
- const messages3 = resolveMessages(key);
- return messages3 != null ? messages3 : __root ? __root.tm(key) || {} : {};
- }
- function getLocaleMessage(locale2) {
- return _messages.value[locale2] || {};
- }
- function setLocaleMessage(locale2, message) {
- _messages.value[locale2] = message;
- _context.messages = _messages.value;
- }
- function mergeLocaleMessage(locale2, message) {
- _messages.value[locale2] = _messages.value[locale2] || {};
- deepCopy(message, _messages.value[locale2]);
- _context.messages = _messages.value;
- }
- function getDateTimeFormat(locale2) {
- return _datetimeFormats.value[locale2] || {};
- }
- function setDateTimeFormat(locale2, format2) {
- _datetimeFormats.value[locale2] = format2;
- _context.datetimeFormats = _datetimeFormats.value;
- clearDateTimeFormat(_context, locale2, format2);
- }
- function mergeDateTimeFormat(locale2, format2) {
- _datetimeFormats.value[locale2] = assign(_datetimeFormats.value[locale2] || {}, format2);
- _context.datetimeFormats = _datetimeFormats.value;
- clearDateTimeFormat(_context, locale2, format2);
- }
- function getNumberFormat(locale2) {
- return _numberFormats.value[locale2] || {};
- }
- function setNumberFormat(locale2, format2) {
- _numberFormats.value[locale2] = format2;
- _context.numberFormats = _numberFormats.value;
- clearNumberFormat(_context, locale2, format2);
- }
- function mergeNumberFormat(locale2, format2) {
- _numberFormats.value[locale2] = assign(_numberFormats.value[locale2] || {}, format2);
- _context.numberFormats = _numberFormats.value;
- clearNumberFormat(_context, locale2, format2);
- }
- composerID++;
- if (__root) {
- vue.watch(__root.locale, (val) => {
- if (_inheritLocale) {
- _locale.value = val;
- _context.locale = val;
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
- }
- });
- vue.watch(__root.fallbackLocale, (val) => {
- if (_inheritLocale) {
- _fallbackLocale.value = val;
- _context.fallbackLocale = val;
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
- }
- });
- }
- const composer = {
- id: composerID,
- locale,
- fallbackLocale,
- get inheritLocale() {
- return _inheritLocale;
- },
- set inheritLocale(val) {
- _inheritLocale = val;
- if (val && __root) {
- _locale.value = __root.locale.value;
- _fallbackLocale.value = __root.fallbackLocale.value;
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
- }
- },
- get availableLocales() {
- return Object.keys(_messages.value).sort();
- },
- messages: messages2,
- datetimeFormats,
- numberFormats,
- get modifiers() {
- return _modifiers;
- },
- get pluralRules() {
- return _pluralRules || {};
- },
- get isGlobal() {
- return _isGlobal;
- },
- get missingWarn() {
- return _missingWarn;
- },
- set missingWarn(val) {
- _missingWarn = val;
- _context.missingWarn = _missingWarn;
- },
- get fallbackWarn() {
- return _fallbackWarn;
- },
- set fallbackWarn(val) {
- _fallbackWarn = val;
- _context.fallbackWarn = _fallbackWarn;
- },
- get fallbackRoot() {
- return _fallbackRoot;
- },
- set fallbackRoot(val) {
- _fallbackRoot = val;
- },
- get fallbackFormat() {
- return _fallbackFormat;
- },
- set fallbackFormat(val) {
- _fallbackFormat = val;
- _context.fallbackFormat = _fallbackFormat;
- },
- get warnHtmlMessage() {
- return _warnHtmlMessage;
- },
- set warnHtmlMessage(val) {
- _warnHtmlMessage = val;
- _context.warnHtmlMessage = val;
- },
- get escapeParameter() {
- return _escapeParameter;
- },
- set escapeParameter(val) {
- _escapeParameter = val;
- _context.escapeParameter = val;
- },
- t,
- rt,
- d,
- n: n2,
- te,
- tm,
- getLocaleMessage,
- setLocaleMessage,
- mergeLocaleMessage,
- getDateTimeFormat,
- setDateTimeFormat,
- mergeDateTimeFormat,
- getNumberFormat,
- setNumberFormat,
- mergeNumberFormat,
- getPostTranslationHandler,
- setPostTranslationHandler,
- getMissingHandler,
- setMissingHandler,
- [TransrateVNodeSymbol]: transrateVNode,
- [NumberPartsSymbol]: numberParts,
- [DatetimePartsSymbol]: datetimeParts,
- [SetPluralRulesSymbol]: setPluralRules,
- [InejctWithOption]: options.__injectWithOption
- // eslint-disable-line @typescript-eslint/no-explicit-any
- };
- {
- composer[EnableEmitter] = (emitter) => {
- _context.__v_emitter = emitter;
- };
- composer[DisableEmitter] = () => {
- _context.__v_emitter = void 0;
- };
- }
- return composer;
- }
- function convertComposerOptions(options) {
- const locale = isString(options.locale) ? options.locale : "en-US";
- const fallbackLocale = isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale;
- const missing = isFunction(options.missing) ? options.missing : void 0;
- const missingWarn = isBoolean(options.silentTranslationWarn) || isRegExp(options.silentTranslationWarn) ? !options.silentTranslationWarn : true;
- const fallbackWarn = isBoolean(options.silentFallbackWarn) || isRegExp(options.silentFallbackWarn) ? !options.silentFallbackWarn : true;
- const fallbackRoot = isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
- const fallbackFormat = !!options.formatFallbackMessages;
- const modifiers = isPlainObject(options.modifiers) ? options.modifiers : {};
- const pluralizationRules = options.pluralizationRules;
- const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : void 0;
- const warnHtmlMessage = isString(options.warnHtmlInMessage) ? options.warnHtmlInMessage !== "off" : true;
- const escapeParameter = !!options.escapeParameterHtml;
- const inheritLocale = isBoolean(options.sync) ? options.sync : true;
- if (options.formatter) {
- warn(getWarnMessage(
- 8
- /* NOT_SUPPORTED_FORMATTER */
- ));
- }
- if (options.preserveDirectiveContent) {
- warn(getWarnMessage(
- 9
- /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
- ));
- }
- let messages2 = options.messages;
- if (isPlainObject(options.sharedMessages)) {
- const sharedMessages = options.sharedMessages;
- const locales = Object.keys(sharedMessages);
- messages2 = locales.reduce((messages3, locale2) => {
- const message = messages3[locale2] || (messages3[locale2] = {});
- assign(message, sharedMessages[locale2]);
- return messages3;
- }, messages2 || {});
- }
- const { __i18n, __root, __injectWithOption } = options;
- const datetimeFormats = options.datetimeFormats;
- const numberFormats = options.numberFormats;
- const flatJson = options.flatJson;
- return {
- locale,
- fallbackLocale,
- messages: messages2,
- flatJson,
- datetimeFormats,
- numberFormats,
- missing,
- missingWarn,
- fallbackWarn,
- fallbackRoot,
- fallbackFormat,
- modifiers,
- pluralRules: pluralizationRules,
- postTranslation,
- warnHtmlMessage,
- escapeParameter,
- inheritLocale,
- __i18n,
- __root,
- __injectWithOption
- };
- }
- function createVueI18n(options = {}) {
- const composer = createComposer(convertComposerOptions(options));
- const vueI18n = {
- // id
- id: composer.id,
- // locale
- get locale() {
- return composer.locale.value;
- },
- set locale(val) {
- composer.locale.value = val;
- },
- // fallbackLocale
- get fallbackLocale() {
- return composer.fallbackLocale.value;
- },
- set fallbackLocale(val) {
- composer.fallbackLocale.value = val;
- },
- // messages
- get messages() {
- return composer.messages.value;
- },
- // datetimeFormats
- get datetimeFormats() {
- return composer.datetimeFormats.value;
- },
- // numberFormats
- get numberFormats() {
- return composer.numberFormats.value;
- },
- // availableLocales
- get availableLocales() {
- return composer.availableLocales;
- },
- // formatter
- get formatter() {
- warn(getWarnMessage(
- 8
- /* NOT_SUPPORTED_FORMATTER */
- ));
- return {
- interpolate() {
- return [];
- }
- };
- },
- set formatter(val) {
- warn(getWarnMessage(
- 8
- /* NOT_SUPPORTED_FORMATTER */
- ));
- },
- // missing
- get missing() {
- return composer.getMissingHandler();
- },
- set missing(handler) {
- composer.setMissingHandler(handler);
- },
- // silentTranslationWarn
- get silentTranslationWarn() {
- return isBoolean(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn;
- },
- set silentTranslationWarn(val) {
- composer.missingWarn = isBoolean(val) ? !val : val;
- },
- // silentFallbackWarn
- get silentFallbackWarn() {
- return isBoolean(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn;
- },
- set silentFallbackWarn(val) {
- composer.fallbackWarn = isBoolean(val) ? !val : val;
- },
- // modifiers
- get modifiers() {
- return composer.modifiers;
- },
- // formatFallbackMessages
- get formatFallbackMessages() {
- return composer.fallbackFormat;
- },
- set formatFallbackMessages(val) {
- composer.fallbackFormat = val;
- },
- // postTranslation
- get postTranslation() {
- return composer.getPostTranslationHandler();
- },
- set postTranslation(handler) {
- composer.setPostTranslationHandler(handler);
- },
- // sync
- get sync() {
- return composer.inheritLocale;
- },
- set sync(val) {
- composer.inheritLocale = val;
- },
- // warnInHtmlMessage
- get warnHtmlInMessage() {
- return composer.warnHtmlMessage ? "warn" : "off";
- },
- set warnHtmlInMessage(val) {
- composer.warnHtmlMessage = val !== "off";
- },
- // escapeParameterHtml
- get escapeParameterHtml() {
- return composer.escapeParameter;
- },
- set escapeParameterHtml(val) {
- composer.escapeParameter = val;
- },
- // preserveDirectiveContent
- get preserveDirectiveContent() {
- warn(getWarnMessage(
- 9
- /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
- ));
- return true;
- },
- set preserveDirectiveContent(val) {
- warn(getWarnMessage(
- 9
- /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
- ));
- },
- // pluralizationRules
- get pluralizationRules() {
- return composer.pluralRules || {};
- },
- // for internal
- __composer: composer,
- // t
- t(...args) {
- const [arg1, arg2, arg3] = args;
- const options2 = {};
- let list = null;
- let named = null;
- if (!isString(arg1)) {
- throw createI18nError(
- 15
- /* INVALID_ARGUMENT */
- );
- }
- const key = arg1;
- if (isString(arg2)) {
- options2.locale = arg2;
- } else if (isArray(arg2)) {
- list = arg2;
- } else if (isPlainObject(arg2)) {
- named = arg2;
- }
- if (isArray(arg3)) {
- list = arg3;
- } else if (isPlainObject(arg3)) {
- named = arg3;
- }
- return composer.t(key, list || named || {}, options2);
- },
- rt(...args) {
- return composer.rt(...args);
- },
- // tc
- tc(...args) {
- const [arg1, arg2, arg3] = args;
- const options2 = { plural: 1 };
- let list = null;
- let named = null;
- if (!isString(arg1)) {
- throw createI18nError(
- 15
- /* INVALID_ARGUMENT */
- );
- }
- const key = arg1;
- if (isString(arg2)) {
- options2.locale = arg2;
- } else if (isNumber(arg2)) {
- options2.plural = arg2;
- } else if (isArray(arg2)) {
- list = arg2;
- } else if (isPlainObject(arg2)) {
- named = arg2;
- }
- if (isString(arg3)) {
- options2.locale = arg3;
- } else if (isArray(arg3)) {
- list = arg3;
- } else if (isPlainObject(arg3)) {
- named = arg3;
- }
- return composer.t(key, list || named || {}, options2);
- },
- // te
- te(key, locale) {
- return composer.te(key, locale);
- },
- // tm
- tm(key) {
- return composer.tm(key);
- },
- // getLocaleMessage
- getLocaleMessage(locale) {
- return composer.getLocaleMessage(locale);
- },
- // setLocaleMessage
- setLocaleMessage(locale, message) {
- composer.setLocaleMessage(locale, message);
- },
- // mergeLocaleMessage
- mergeLocaleMessage(locale, message) {
- composer.mergeLocaleMessage(locale, message);
- },
- // d
- d(...args) {
- return composer.d(...args);
- },
- // getDateTimeFormat
- getDateTimeFormat(locale) {
- return composer.getDateTimeFormat(locale);
- },
- // setDateTimeFormat
- setDateTimeFormat(locale, format2) {
- composer.setDateTimeFormat(locale, format2);
- },
- // mergeDateTimeFormat
- mergeDateTimeFormat(locale, format2) {
- composer.mergeDateTimeFormat(locale, format2);
- },
- // n
- n(...args) {
- return composer.n(...args);
- },
- // getNumberFormat
- getNumberFormat(locale) {
- return composer.getNumberFormat(locale);
- },
- // setNumberFormat
- setNumberFormat(locale, format2) {
- composer.setNumberFormat(locale, format2);
- },
- // mergeNumberFormat
- mergeNumberFormat(locale, format2) {
- composer.mergeNumberFormat(locale, format2);
- },
- // getChoiceIndex
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- getChoiceIndex(choice, choicesLength) {
- warn(getWarnMessage(
- 10
- /* NOT_SUPPORTED_GET_CHOICE_INDEX */
- ));
- return -1;
- },
- // for internal
- __onComponentInstanceCreated(target) {
- const { componentInstanceCreatedListener } = options;
- if (componentInstanceCreatedListener) {
- componentInstanceCreatedListener(target, vueI18n);
- }
- }
- };
- {
- vueI18n.__enableEmitter = (emitter) => {
- const __composer = composer;
- __composer[EnableEmitter] && __composer[EnableEmitter](emitter);
- };
- vueI18n.__disableEmitter = () => {
- const __composer = composer;
- __composer[DisableEmitter] && __composer[DisableEmitter]();
- };
- }
- return vueI18n;
- }
- const baseFormatProps = {
- tag: {
- type: [String, Object]
- },
- locale: {
- type: String
- },
- scope: {
- type: String,
- validator: (val) => val === "parent" || val === "global",
- default: "parent"
- },
- i18n: {
- type: Object
- }
- };
- const Translation = {
- /* eslint-disable */
- name: "i18n-t",
- props: assign({
- keypath: {
- type: String,
- required: true
- },
- plural: {
- type: [Number, String],
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- validator: (val) => isNumber(val) || !isNaN(val)
- }
- }, baseFormatProps),
- /* eslint-enable */
- setup(props2, context) {
- const { slots, attrs } = context;
- const i18n2 = props2.i18n || useI18n({
- useScope: props2.scope,
- __useComponent: true
- });
- const keys = Object.keys(slots).filter((key) => key !== "_");
- return () => {
- const options = {};
- if (props2.locale) {
- options.locale = props2.locale;
- }
- if (props2.plural !== void 0) {
- options.plural = isString(props2.plural) ? +props2.plural : props2.plural;
- }
- const arg = getInterpolateArg(context, keys);
- const children = i18n2[TransrateVNodeSymbol](props2.keypath, arg, options);
- const assignedAttrs = assign({}, attrs);
- return isString(props2.tag) ? vue.h(props2.tag, assignedAttrs, children) : isObject$1(props2.tag) ? vue.h(props2.tag, assignedAttrs, children) : vue.h(vue.Fragment, assignedAttrs, children);
- };
- }
- };
- function getInterpolateArg({ slots }, keys) {
- if (keys.length === 1 && keys[0] === "default") {
- return slots.default ? slots.default() : [];
- } else {
- return keys.reduce((arg, key) => {
- const slot = slots[key];
- if (slot) {
- arg[key] = slot();
- }
- return arg;
- }, {});
- }
- }
- function renderFormatter(props2, context, slotKeys, partFormatter) {
- const { slots, attrs } = context;
- return () => {
- const options = { part: true };
- let overrides = {};
- if (props2.locale) {
- options.locale = props2.locale;
- }
- if (isString(props2.format)) {
- options.key = props2.format;
- } else if (isObject$1(props2.format)) {
- if (isString(props2.format.key)) {
- options.key = props2.format.key;
- }
- overrides = Object.keys(props2.format).reduce((options2, prop) => {
- return slotKeys.includes(prop) ? assign({}, options2, { [prop]: props2.format[prop] }) : options2;
- }, {});
- }
- const parts = partFormatter(...[props2.value, options, overrides]);
- let children = [options.key];
- if (isArray(parts)) {
- children = parts.map((part, index2) => {
- const slot = slots[part.type];
- return slot ? slot({ [part.type]: part.value, index: index2, parts }) : [part.value];
- });
- } else if (isString(parts)) {
- children = [parts];
- }
- const assignedAttrs = assign({}, attrs);
- return isString(props2.tag) ? vue.h(props2.tag, assignedAttrs, children) : isObject$1(props2.tag) ? vue.h(props2.tag, assignedAttrs, children) : vue.h(vue.Fragment, assignedAttrs, children);
- };
- }
- const NUMBER_FORMAT_KEYS = [
- "localeMatcher",
- "style",
- "unit",
- "unitDisplay",
- "currency",
- "currencyDisplay",
- "useGrouping",
- "numberingSystem",
- "minimumIntegerDigits",
- "minimumFractionDigits",
- "maximumFractionDigits",
- "minimumSignificantDigits",
- "maximumSignificantDigits",
- "notation",
- "formatMatcher"
- ];
- const NumberFormat = {
- /* eslint-disable */
- name: "i18n-n",
- props: assign({
- value: {
- type: Number,
- required: true
- },
- format: {
- type: [String, Object]
- }
- }, baseFormatProps),
- /* eslint-enable */
- setup(props2, context) {
- const i18n2 = props2.i18n || useI18n({ useScope: "parent", __useComponent: true });
- return renderFormatter(props2, context, NUMBER_FORMAT_KEYS, (...args) => (
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- i18n2[NumberPartsSymbol](...args)
- ));
- }
- };
- const DATETIME_FORMAT_KEYS = [
- "dateStyle",
- "timeStyle",
- "fractionalSecondDigits",
- "calendar",
- "dayPeriod",
- "numberingSystem",
- "localeMatcher",
- "timeZone",
- "hour12",
- "hourCycle",
- "formatMatcher",
- "weekday",
- "era",
- "year",
- "month",
- "day",
- "hour",
- "minute",
- "second",
- "timeZoneName"
- ];
- const DatetimeFormat = {
- /* eslint-disable */
- name: "i18n-d",
- props: assign({
- value: {
- type: [Number, Date],
- required: true
- },
- format: {
- type: [String, Object]
- }
- }, baseFormatProps),
- /* eslint-enable */
- setup(props2, context) {
- const i18n2 = props2.i18n || useI18n({ useScope: "parent", __useComponent: true });
- return renderFormatter(props2, context, DATETIME_FORMAT_KEYS, (...args) => (
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- i18n2[DatetimePartsSymbol](...args)
- ));
- }
- };
- function getComposer$2(i18n2, instance) {
- const i18nInternal = i18n2;
- if (i18n2.mode === "composition") {
- return i18nInternal.__getInstance(instance) || i18n2.global;
- } else {
- const vueI18n = i18nInternal.__getInstance(instance);
- return vueI18n != null ? vueI18n.__composer : i18n2.global.__composer;
- }
- }
- function vTDirective(i18n2) {
- const bind = (el, { instance, value: value2, modifiers }) => {
- if (!instance || !instance.$) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- const composer = getComposer$2(i18n2, instance.$);
- if (modifiers.preserve) {
- warn(getWarnMessage(
- 7
- /* NOT_SUPPORTED_PRESERVE */
- ));
- }
- const parsedValue = parseValue(value2);
- el.textContent = composer.t(...makeParams(parsedValue));
- };
- return {
- beforeMount: bind,
- beforeUpdate: bind
- };
- }
- function parseValue(value2) {
- if (isString(value2)) {
- return { path: value2 };
- } else if (isPlainObject(value2)) {
- if (!("path" in value2)) {
- throw createI18nError(19, "path");
- }
- return value2;
- } else {
- throw createI18nError(
- 20
- /* INVALID_VALUE */
- );
- }
- }
- function makeParams(value2) {
- const { path, locale, args, choice, plural } = value2;
- const options = {};
- const named = args || {};
- if (isString(locale)) {
- options.locale = locale;
- }
- if (isNumber(choice)) {
- options.plural = choice;
- }
- if (isNumber(plural)) {
- options.plural = plural;
- }
- return [path, named, options];
- }
- function apply(app, i18n2, ...options) {
- const pluginOptions = isPlainObject(options[0]) ? options[0] : {};
- const useI18nComponentName = !!pluginOptions.useI18nComponentName;
- const globalInstall = isBoolean(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
- if (globalInstall && useI18nComponentName) {
- warn(getWarnMessage(11, {
- name: Translation.name
- }));
- }
- if (globalInstall) {
- app.component(!useI18nComponentName ? Translation.name : "i18n", Translation);
- app.component(NumberFormat.name, NumberFormat);
- app.component(DatetimeFormat.name, DatetimeFormat);
- }
- app.directive("t", vTDirective(i18n2));
- }
- const VUE_I18N_COMPONENT_TYPES = "vue-i18n: composer properties";
- let devtoolsApi;
- async function enableDevTools(app, i18n2) {
- return new Promise((resolve, reject) => {
- try {
- setupDevtoolsPlugin({
- id: "vue-devtools-plugin-vue-i18n",
- label: VueDevToolsLabels[
- "vue-devtools-plugin-vue-i18n"
- /* PLUGIN */
- ],
- packageName: "vue-i18n",
- homepage: "https://vue-i18n.intlify.dev",
- logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
- componentStateTypes: [VUE_I18N_COMPONENT_TYPES],
- app
- }, (api) => {
- devtoolsApi = api;
- api.on.visitComponentTree(({ componentInstance, treeNode }) => {
- updateComponentTreeTags(componentInstance, treeNode, i18n2);
- });
- api.on.inspectComponent(({ componentInstance, instanceData }) => {
- if (componentInstance.vnode.el.__VUE_I18N__ && instanceData) {
- if (i18n2.mode === "legacy") {
- if (componentInstance.vnode.el.__VUE_I18N__ !== i18n2.global.__composer) {
- inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
- }
- } else {
- inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
- }
- }
- });
- api.addInspector({
- id: "vue-i18n-resource-inspector",
- label: VueDevToolsLabels[
- "vue-i18n-resource-inspector"
- /* CUSTOM_INSPECTOR */
- ],
- icon: "language",
- treeFilterPlaceholder: VueDevToolsPlaceholders[
- "vue-i18n-resource-inspector"
- /* CUSTOM_INSPECTOR */
- ]
- });
- api.on.getInspectorTree((payload) => {
- if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
- registerScope(payload, i18n2);
- }
- });
- api.on.getInspectorState((payload) => {
- if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
- inspectScope(payload, i18n2);
- }
- });
- api.on.editInspectorState((payload) => {
- if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
- editScope(payload, i18n2);
- }
- });
- api.addTimelineLayer({
- id: "vue-i18n-timeline",
- label: VueDevToolsLabels[
- "vue-i18n-timeline"
- /* TIMELINE */
- ],
- color: VueDevToolsTimelineColors[
- "vue-i18n-timeline"
- /* TIMELINE */
- ]
- });
- resolve(true);
- });
- } catch (e) {
- console.error(e);
- reject(false);
- }
- });
- }
- function updateComponentTreeTags(instance, treeNode, i18n2) {
- const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
- if (instance && instance.vnode.el.__VUE_I18N__) {
- if (instance.vnode.el.__VUE_I18N__ !== global2) {
- const label = instance.type.name || instance.type.displayName || instance.type.__file;
- const tag = {
- label: `i18n (${label} Scope)`,
- textColor: 0,
- backgroundColor: 16764185
- };
- treeNode.tags.push(tag);
- }
- }
- }
- function inspectComposer(instanceData, composer) {
- const type2 = VUE_I18N_COMPONENT_TYPES;
- instanceData.state.push({
- type: type2,
- key: "locale",
- editable: true,
- value: composer.locale.value
- });
- instanceData.state.push({
- type: type2,
- key: "availableLocales",
- editable: false,
- value: composer.availableLocales
- });
- instanceData.state.push({
- type: type2,
- key: "fallbackLocale",
- editable: true,
- value: composer.fallbackLocale.value
- });
- instanceData.state.push({
- type: type2,
- key: "inheritLocale",
- editable: true,
- value: composer.inheritLocale
- });
- instanceData.state.push({
- type: type2,
- key: "messages",
- editable: false,
- value: getLocaleMessageValue(composer.messages.value)
- });
- instanceData.state.push({
- type: type2,
- key: "datetimeFormats",
- editable: false,
- value: composer.datetimeFormats.value
- });
- instanceData.state.push({
- type: type2,
- key: "numberFormats",
- editable: false,
- value: composer.numberFormats.value
- });
- }
- function getLocaleMessageValue(messages2) {
- const value2 = {};
- Object.keys(messages2).forEach((key) => {
- const v = messages2[key];
- if (isFunction(v) && "source" in v) {
- value2[key] = getMessageFunctionDetails(v);
- } else if (isObject$1(v)) {
- value2[key] = getLocaleMessageValue(v);
- } else {
- value2[key] = v;
- }
- });
- return value2;
- }
- const ESC = {
- "<": "<",
- ">": ">",
- '"': """,
- "&": "&"
- };
- function escape(s) {
- return s.replace(/[<>"&]/g, escapeChar);
- }
- function escapeChar(a) {
- return ESC[a] || a;
- }
- function getMessageFunctionDetails(func2) {
- const argString = func2.source ? `("${escape(func2.source)}")` : `(?)`;
- return {
- _custom: {
- type: "function",
- display: `<span>ƒ</span> ${argString}`
- }
- };
- }
- function registerScope(payload, i18n2) {
- payload.rootNodes.push({
- id: "global",
- label: "Global Scope"
- });
- const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
- for (const [keyInstance, instance] of i18n2.__instances) {
- const composer = i18n2.mode === "composition" ? instance : instance.__composer;
- if (global2 === composer) {
- continue;
- }
- const label = keyInstance.type.name || keyInstance.type.displayName || keyInstance.type.__file;
- payload.rootNodes.push({
- id: composer.id.toString(),
- label: `${label} Scope`
- });
- }
- }
- function getComposer$1(nodeId, i18n2) {
- if (nodeId === "global") {
- return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
- } else {
- const instance = Array.from(i18n2.__instances.values()).find((item) => item.id.toString() === nodeId);
- if (instance) {
- return i18n2.mode === "composition" ? instance : instance.__composer;
- } else {
- return null;
- }
- }
- }
- function inspectScope(payload, i18n2) {
- const composer = getComposer$1(payload.nodeId, i18n2);
- if (composer) {
- payload.state = makeScopeInspectState(composer);
- }
- }
- function makeScopeInspectState(composer) {
- const state = {};
- const localeType = "Locale related info";
- const localeStates = [
- {
- type: localeType,
- key: "locale",
- editable: true,
- value: composer.locale.value
- },
- {
- type: localeType,
- key: "fallbackLocale",
- editable: true,
- value: composer.fallbackLocale.value
- },
- {
- type: localeType,
- key: "availableLocales",
- editable: false,
- value: composer.availableLocales
- },
- {
- type: localeType,
- key: "inheritLocale",
- editable: true,
- value: composer.inheritLocale
- }
- ];
- state[localeType] = localeStates;
- const localeMessagesType = "Locale messages info";
- const localeMessagesStates = [
- {
- type: localeMessagesType,
- key: "messages",
- editable: false,
- value: getLocaleMessageValue(composer.messages.value)
- }
- ];
- state[localeMessagesType] = localeMessagesStates;
- const datetimeFormatsType = "Datetime formats info";
- const datetimeFormatsStates = [
- {
- type: datetimeFormatsType,
- key: "datetimeFormats",
- editable: false,
- value: composer.datetimeFormats.value
- }
- ];
- state[datetimeFormatsType] = datetimeFormatsStates;
- const numberFormatsType = "Datetime formats info";
- const numberFormatsStates = [
- {
- type: numberFormatsType,
- key: "numberFormats",
- editable: false,
- value: composer.numberFormats.value
- }
- ];
- state[numberFormatsType] = numberFormatsStates;
- return state;
- }
- function addTimelineEvent(event, payload) {
- if (devtoolsApi) {
- let groupId;
- if (payload && "groupId" in payload) {
- groupId = payload.groupId;
- delete payload.groupId;
- }
- devtoolsApi.addTimelineEvent({
- layerId: "vue-i18n-timeline",
- event: {
- title: event,
- groupId,
- time: Date.now(),
- meta: {},
- data: payload || {},
- logType: event === "compile-error" ? "error" : event === "fallback" || event === "missing" ? "warning" : "default"
- }
- });
- }
- }
- function editScope(payload, i18n2) {
- const composer = getComposer$1(payload.nodeId, i18n2);
- if (composer) {
- const [field] = payload.path;
- if (field === "locale" && isString(payload.state.value)) {
- composer.locale.value = payload.state.value;
- } else if (field === "fallbackLocale" && (isString(payload.state.value) || isArray(payload.state.value) || isObject$1(payload.state.value))) {
- composer.fallbackLocale.value = payload.state.value;
- } else if (field === "inheritLocale" && isBoolean(payload.state.value)) {
- composer.inheritLocale = payload.state.value;
- }
- }
- }
- function defineMixin(vuei18n, composer, i18n2) {
- return {
- beforeCreate() {
- const instance = vue.getCurrentInstance();
- if (!instance) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- const options = this.$options;
- if (options.i18n) {
- const optionsI18n = options.i18n;
- if (options.__i18n) {
- optionsI18n.__i18n = options.__i18n;
- }
- optionsI18n.__root = composer;
- if (this === this.$root) {
- this.$i18n = mergeToRoot(vuei18n, optionsI18n);
- } else {
- optionsI18n.__injectWithOption = true;
- this.$i18n = createVueI18n(optionsI18n);
- }
- } else if (options.__i18n) {
- if (this === this.$root) {
- this.$i18n = mergeToRoot(vuei18n, options);
- } else {
- this.$i18n = createVueI18n({
- __i18n: options.__i18n,
- __injectWithOption: true,
- __root: composer
- });
- }
- } else {
- this.$i18n = vuei18n;
- }
- vuei18n.__onComponentInstanceCreated(this.$i18n);
- i18n2.__setInstance(instance, this.$i18n);
- this.$t = (...args) => this.$i18n.t(...args);
- this.$rt = (...args) => this.$i18n.rt(...args);
- this.$tc = (...args) => this.$i18n.tc(...args);
- this.$te = (key, locale) => this.$i18n.te(key, locale);
- this.$d = (...args) => this.$i18n.d(...args);
- this.$n = (...args) => this.$i18n.n(...args);
- this.$tm = (key) => this.$i18n.tm(key);
- },
- mounted() {
- {
- this.$el.__VUE_I18N__ = this.$i18n.__composer;
- const emitter = this.__v_emitter = createEmitter();
- const _vueI18n = this.$i18n;
- _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
- emitter.on("*", addTimelineEvent);
- }
- },
- beforeUnmount() {
- const instance = vue.getCurrentInstance();
- if (!instance) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- {
- if (this.__v_emitter) {
- this.__v_emitter.off("*", addTimelineEvent);
- delete this.__v_emitter;
- }
- const _vueI18n = this.$i18n;
- _vueI18n.__disableEmitter && _vueI18n.__disableEmitter();
- delete this.$el.__VUE_I18N__;
- }
- delete this.$t;
- delete this.$rt;
- delete this.$tc;
- delete this.$te;
- delete this.$d;
- delete this.$n;
- delete this.$tm;
- i18n2.__deleteInstance(instance);
- delete this.$i18n;
- }
- };
- }
- function mergeToRoot(root, options) {
- root.locale = options.locale || root.locale;
- root.fallbackLocale = options.fallbackLocale || root.fallbackLocale;
- root.missing = options.missing || root.missing;
- root.silentTranslationWarn = options.silentTranslationWarn || root.silentFallbackWarn;
- root.silentFallbackWarn = options.silentFallbackWarn || root.silentFallbackWarn;
- root.formatFallbackMessages = options.formatFallbackMessages || root.formatFallbackMessages;
- root.postTranslation = options.postTranslation || root.postTranslation;
- root.warnHtmlInMessage = options.warnHtmlInMessage || root.warnHtmlInMessage;
- root.escapeParameterHtml = options.escapeParameterHtml || root.escapeParameterHtml;
- root.sync = options.sync || root.sync;
- root.__composer[SetPluralRulesSymbol](options.pluralizationRules || root.pluralizationRules);
- const messages2 = getLocaleMessages(root.locale, {
- messages: options.messages,
- __i18n: options.__i18n
- });
- Object.keys(messages2).forEach((locale) => root.mergeLocaleMessage(locale, messages2[locale]));
- if (options.datetimeFormats) {
- Object.keys(options.datetimeFormats).forEach((locale) => root.mergeDateTimeFormat(locale, options.datetimeFormats[locale]));
- }
- if (options.numberFormats) {
- Object.keys(options.numberFormats).forEach((locale) => root.mergeNumberFormat(locale, options.numberFormats[locale]));
- }
- return root;
- }
- function createI18n(options = {}) {
- const __legacyMode = isBoolean(options.legacy) ? options.legacy : true;
- const __globalInjection = !!options.globalInjection;
- const __instances = /* @__PURE__ */ new Map();
- const __global = __legacyMode ? createVueI18n(options) : createComposer(options);
- const symbol = makeSymbol("vue-i18n");
- const i18n2 = {
- // mode
- get mode() {
- return __legacyMode ? "legacy" : "composition";
- },
- // install plugin
- async install(app, ...options2) {
- {
- app.__VUE_I18N__ = i18n2;
- }
- app.__VUE_I18N_SYMBOL__ = symbol;
- app.provide(app.__VUE_I18N_SYMBOL__, i18n2);
- if (!__legacyMode && __globalInjection) {
- injectGlobalFields(app, i18n2.global);
- }
- {
- apply(app, i18n2, ...options2);
- }
- if (__legacyMode) {
- app.mixin(defineMixin(__global, __global.__composer, i18n2));
- }
- {
- const ret = await enableDevTools(app, i18n2);
- if (!ret) {
- throw createI18nError(
- 21
- /* CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN */
- );
- }
- const emitter = createEmitter();
- if (__legacyMode) {
- const _vueI18n = __global;
- _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
- } else {
- const _composer = __global;
- _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
- }
- emitter.on("*", addTimelineEvent);
- }
- },
- // global accessor
- get global() {
- return __global;
- },
- // @internal
- __instances,
- // @internal
- __getInstance(component) {
- return __instances.get(component) || null;
- },
- // @internal
- __setInstance(component, instance) {
- __instances.set(component, instance);
- },
- // @internal
- __deleteInstance(component) {
- __instances.delete(component);
- }
- };
- return i18n2;
- }
- function useI18n(options = {}) {
- const instance = vue.getCurrentInstance();
- if (instance == null) {
- throw createI18nError(
- 16
- /* MUST_BE_CALL_SETUP_TOP */
- );
- }
- if (!instance.appContext.app.__VUE_I18N_SYMBOL__) {
- throw createI18nError(
- 17
- /* NOT_INSLALLED */
- );
- }
- const i18n2 = vue.inject(instance.appContext.app.__VUE_I18N_SYMBOL__);
- if (!i18n2) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
- const scope = isEmptyObject(options) ? "__i18n" in instance.type ? "local" : "global" : !options.useScope ? "local" : options.useScope;
- if (scope === "global") {
- let messages2 = isObject$1(options.messages) ? options.messages : {};
- if ("__i18nGlobal" in instance.type) {
- messages2 = getLocaleMessages(global2.locale.value, {
- messages: messages2,
- __i18n: instance.type.__i18nGlobal
- });
- }
- const locales = Object.keys(messages2);
- if (locales.length) {
- locales.forEach((locale) => {
- global2.mergeLocaleMessage(locale, messages2[locale]);
- });
- }
- if (isObject$1(options.datetimeFormats)) {
- const locales2 = Object.keys(options.datetimeFormats);
- if (locales2.length) {
- locales2.forEach((locale) => {
- global2.mergeDateTimeFormat(locale, options.datetimeFormats[locale]);
- });
- }
- }
- if (isObject$1(options.numberFormats)) {
- const locales2 = Object.keys(options.numberFormats);
- if (locales2.length) {
- locales2.forEach((locale) => {
- global2.mergeNumberFormat(locale, options.numberFormats[locale]);
- });
- }
- }
- return global2;
- }
- if (scope === "parent") {
- let composer2 = getComposer(i18n2, instance, options.__useComponent);
- if (composer2 == null) {
- {
- warn(getWarnMessage(
- 12
- /* NOT_FOUND_PARENT_SCOPE */
- ));
- }
- composer2 = global2;
- }
- return composer2;
- }
- if (i18n2.mode === "legacy") {
- throw createI18nError(
- 18
- /* NOT_AVAILABLE_IN_LEGACY_MODE */
- );
- }
- const i18nInternal = i18n2;
- let composer = i18nInternal.__getInstance(instance);
- if (composer == null) {
- const type2 = instance.type;
- const composerOptions = assign({}, options);
- if (type2.__i18n) {
- composerOptions.__i18n = type2.__i18n;
- }
- if (global2) {
- composerOptions.__root = global2;
- }
- composer = createComposer(composerOptions);
- setupLifeCycle(i18nInternal, instance, composer);
- i18nInternal.__setInstance(instance, composer);
- }
- return composer;
- }
- function getComposer(i18n2, target, useComponent = false) {
- let composer = null;
- const root = target.root;
- let current = target.parent;
- while (current != null) {
- const i18nInternal = i18n2;
- if (i18n2.mode === "composition") {
- composer = i18nInternal.__getInstance(current);
- } else {
- const vueI18n = i18nInternal.__getInstance(current);
- if (vueI18n != null) {
- composer = vueI18n.__composer;
- }
- if (useComponent && composer && !composer[InejctWithOption]) {
- composer = null;
- }
- }
- if (composer != null) {
- break;
- }
- if (root === current) {
- break;
- }
- current = current.parent;
- }
- return composer;
- }
- function setupLifeCycle(i18n2, target, composer) {
- let emitter = null;
- vue.onMounted(() => {
- if (target.vnode.el) {
- target.vnode.el.__VUE_I18N__ = composer;
- emitter = createEmitter();
- const _composer = composer;
- _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
- emitter.on("*", addTimelineEvent);
- }
- }, target);
- vue.onUnmounted(() => {
- if (target.vnode.el && target.vnode.el.__VUE_I18N__) {
- emitter && emitter.off("*", addTimelineEvent);
- const _composer = composer;
- _composer[DisableEmitter] && _composer[DisableEmitter]();
- delete target.vnode.el.__VUE_I18N__;
- }
- i18n2.__deleteInstance(target);
- }, target);
- }
- const globalExportProps = [
- "locale",
- "fallbackLocale",
- "availableLocales"
- ];
- const globalExportMethods = ["t", "rt", "d", "n", "tm"];
- function injectGlobalFields(app, composer) {
- const i18n2 = /* @__PURE__ */ Object.create(null);
- globalExportProps.forEach((prop) => {
- const desc = Object.getOwnPropertyDescriptor(composer, prop);
- if (!desc) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- const wrap = vue.isRef(desc.value) ? {
- get() {
- return desc.value.value;
- },
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- set(val) {
- desc.value.value = val;
- }
- } : {
- get() {
- return desc.get && desc.get();
- }
- };
- Object.defineProperty(i18n2, prop, wrap);
- });
- app.config.globalProperties.$i18n = i18n2;
- globalExportMethods.forEach((method2) => {
- const desc = Object.getOwnPropertyDescriptor(composer, method2);
- if (!desc || !desc.value) {
- throw createI18nError(
- 22
- /* UNEXPECTED_ERROR */
- );
- }
- Object.defineProperty(app.config.globalProperties, `$${method2}`, desc);
- });
- }
- {
- initFeatureFlags();
- }
- {
- const target = getGlobalThis();
- target.__INTLIFY__ = true;
- setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
- }
- const hello$2 = "你好";
- const login$2 = "登录";
- const register$2 = "注册";
- const password$2 = "密码";
- const password_repeat$2 = "重复密码";
- const telno$2 = "手机号";
- const new_member$2 = "新成员";
- const navigationBarTitleText$2 = "心脑检测";
- const add_member$2 = "添加家庭成员";
- const father$2 = "爸爸";
- const mother$2 = "妈妈";
- const husband$2 = "老公";
- const wife$2 = "老婆";
- const other_member$2 = "其它亲友";
- const add_member_text1$2 = "父母有没有";
- const add_member_text2$2 = "心梗脑梗的风险?";
- const add_member_text3$2 = "帮他们评测!";
- const add_member_text4$2 = "爱人工作繁忙";
- const add_member_text5$2 = "应酬多,压力大,常喝酒";
- const add_member_text6$2 = "有没有心脑血管的隐患?";
- const add_member_text7$2 = "其它男性亲友";
- const add_member_text8$2 = "其它女性亲友";
- const add_member_text9$2 = "请自行输入";
- const submit$2 = "提交";
- const show_report$2 = "评测结果";
- const do_success$2 = "操作成功";
- const illness_title$2 = "病名";
- const report_score$2 = "评测分数";
- const report_result$2 = "筛查结果";
- const report_error_text_1$2 = "หากโรคอยู่แค่ชั้นผิวหนัง เพียงประคบร้อนก็รักษาได้! ก่อนหน้าคุณเราได้ช่วยให้ผู้ใช้มากมายค้นพบกับความเสี่ยง ขอเพียงให้ความสำคัญและสื่อสารกับแพทย์อย่างกระตือรือร้น ก็จะสามารถหลีกเลี่ยงความเสี่ยงต่อสุขภาพและชีวิตที่แท้จริงได้";
- const report_error_text_2$2 = "เผชิญหน้าด้วยความคิดบวก ไปเข้ารับการตรวจที่เกี่ยวข้อง ณ โรงพยาบาลที่ได้มาตรฐานในพื้นที่!";
- const report_error_text_3$2 = "ปรับพฤติกรรมการดำเนินชีวิตตามคำแนะนำด้านสุขภาพ เพื่อลดความเสี่ยง";
- const report_text_1$2 = "คะแนนยังไม่เกิน";
- const report_text_1_1$2 = "คะแนน ปัจจุบันความเสี่ยงต่อการเกิดโรคยังไม่สูง";
- const health_advice$2 = "คำแนะนำด้านสุขภาพ";
- const report_explain$2 = "评测说明";
- const report_detail$2 = "รายละเอียดการตรวจคัดกรอง";
- const report_explain_text_1$2 = "您已超过40岁,进入心脑血管的风险人群,此外,患糖尿病的机率也大大增加。";
- const report_explain_text_2$2 = "男性的糖尿病风险高于女性,您更加要注意健康。";
- const report_explain_text_3$2 = "您的BMI:";
- const report_explain_text_3_1$2 = ",体型偏胖,您的身高";
- const report_explain_text_3_2$2 = "厘米,您减重到";
- const report_explain_text_3_3$2 = "公斤会更健康。";
- const report_explain_text_4$2 = "您的血压也偏高,这将引发更多的健康问题,您需要与医生沟通,将血压降低。";
- const report_explain_text_5$2 = "您有心脑血管家庭史,在生活习惯上要更加注意。";
- const report_explain_text_6$2 = "您在烟酒、运动等方面有不良的生活习惯,建议调整。";
- const report_explain_text_7$2 = "现在您已超过40岁,为健康着想,如果不能戒烟,也建议逐步减少吸烟量。";
- const report_explain_text_8$2 = "您有上腹部疼痛并呕吐的风险症状,建议去正规医院检查。";
- const report_explain_text_9$2 = "您有心前区疼痛且不缓解的症状,建议去正规医院检查。";
- const report_explain_text_10$2 = "上方评分是根据国家糖尿病防治指南及中国心肌梗塞风险评分等心脑血管早期筛查标准为您做的评分,评分体系不同,后面是具体的解读,供您参考。";
- const healthy_habits$2 = "健康习惯";
- const y_n$2 = "是/否";
- const healthy_personal_ratios$2 = "健康人员比例";
- const all_people$2 = "全员";
- const group_people$2 = "分组";
- const report_text_4$2 = "分组是指同性别、同年龄段(不满40,40~49,超过50)用户的统计数据。";
- const report_text_5$2 = "您已是会员,您享有如下权益。";
- const report_text_6$2 = "在一年期内可以无限次评测。";
- const report_text_7$2 = "同时可以给3位亲属无限次评测。";
- const report_text_8$2 = "如果您第一次评测的结果显示您三项均无风险,系统将会您增加1-2位亲属名额,同时您第一次分享本报告页,进来的朋友可以成为免费会员,免费会员数量和您的年龄相关。";
- const report_text_9$2 = "已完成,返回首页为家人评测,开启健康管理。";
- const y$2 = "是";
- const n$2 = "否";
- const select_age$2 = "อายุ";
- const select_age_1$2 = "岁";
- const select_age_2$2 = "岁以上";
- const select_age_3$2 = "岁以下";
- const select_sex$2 = "เพศ";
- const calculate_BMI$2 = "计算BMI";
- const select$2 = "选择";
- const height$2 = "ส่วนสูง";
- const weight$2 = "น้ำหนัก";
- const selectcanvas_text1$2 = "请输入被评测人身高体重";
- const selectcanvas_text2$2 = "BMI是人体的胖瘦程度的量化指标,其大小与许多疾病风险程度相关联。";
- const selectcanvas_text3$2 = "身高取整数,体重按0.5公斤选取即可。";
- const report_user$2 = "ผู้รับการประเมินผล";
- const selectage_test1$2 = "请选择被评测人年龄";
- const selectage_test2$2 = "从29岁开始,一些对健康影响较大的慢性病的风险就开始增加,年龄无法改变,但可以改变生活习惯。";
- const next_step$2 = "下一步";
- const show_info_text1$2 = "您的BMI已超过";
- const show_info_text2$2 = "ผู้ใช้";
- const less_than$2 = "小于";
- const greater_than$2 = "大于";
- const selectwaistline_text1$2 = "请左右滑动选择被评测人腰围";
- const selectwaistline_text2$2 = "腰围是内脏脂肪含量是否过多体现,内脏脂肪过多是多种疾病的诱因。";
- const selectwaistline_text3$2 = "JAMA最新发表的研究指出,腰臀比超过一定数值,并且收缩压过高的人群,心血管死亡风险明显上升,所以,保持腰臀比不仅仅是爱美的需求,对身体健康也非常重要。";
- const selectwaistline_text4$2 = "关于腰臀比的研究有定量的研究结果时,我们也会更新评测内容。";
- const selectwaistline_text5$2 = "评测只需要您正确提供腰围的范围即可,如果不清楚,提交你合身的裤子的尺码即可,坐标下方有尺码值供参考。";
- const waistline$2 = "เส้นรอบเอว";
- const waistline_text1$2 = "尺";
- const waistline_text2$2 = "寸";
- const scale_evaluation$2 = "量表评测";
- const selectsbp_text1$2 = "请输入评测对象血压所在范围";
- const selectsbp_text2$2 = "与疾病相关的主要指标是高压,您只需提供高压数据,选择范围正确即可";
- const selectsbp_text3$2 = "如果有服降压药,请提供矫治前的高压数据,高血压患者一般在140以上";
- const selectsbp_text4$2 = "如果你确认不知道血压,没有高血压,你可以填写常规范围,110-120,如果当评测结果在合格线左右3分范围内,您需要测量血压重新评估";
- const hg_text1$2 = "mmHg以下";
- const hg_text2$2 = "mmHg";
- const hg_text3$2 = "mmHg之间";
- const hg_text4$2 = "mmHg之上";
- const blood_pressure$2 = "ความดันโลหิต";
- const low_risk$2 = "低风险";
- const risk$2 = "有风险";
- const valuating_people$2 = "ผู้รับการประเมินผล";
- const completion_text_1$2 = "糖尿病、脑梗的风险筛查已完成!";
- const completion_text_2$2 = "请继续完成余下问题。";
- const questions_remaining$2 = "个问题剩余";
- const have$2 = "有";
- const same_as_you$2 = "用户和您相同";
- const select_gender_for_valuating_people$2 = "请选择评测对象性别";
- const select_gender_text_1$2 = "研究表明,针对某一疾病,男女两性风险不同。例如糖尿病,男性患病风险更高,需要更加注意饮食习惯与控制腰围。";
- const is_man$2 = "เป็นเพศชาย";
- const is_female$2 = "เป็นเพศหญิง";
- const man$2 = "男";
- const female$2 = "女";
- const index_text_1$2 = "给爸爸、妈妈、爱人测一测";
- const index_text_2$2 = "健康的生活习惯是预防心脑血管疾病最好的策略!";
- const index_text_3$2 = "早期筛检";
- const index_text_4$2 = "主动预防";
- const index_text_5$2 = "保家人健康 保家庭平安";
- const index_text_6$2 = "排除风险 安心!放心";
- const index_btn_1$2 = "เริ่มประเมินผล";
- const index_btn_2$2 = "ตรวจดูรายงาน";
- const index_btn_3$2 = "ประเมินผลใหม่";
- const share$2 = "分享";
- const share_text$2 = "心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。";
- const member_add_text_1$2 = "每个人都关心家人健康";
- const member_add_text_2$2 = "但我们可以做得更多";
- const telno_null$2 = "手机号必填";
- const password_null$2 = "密码必填";
- const telno_error$2 = "手机号错误";
- const password_repeat_error$2 = "重复密码不相同";
- const register_error$2 = "注册失败";
- const member_num_than_max$2 = "家人不能超过上限";
- const member_title_null$2 = "亲友名未填";
- const completion_problem_for_valuating_people$2 = "请为评测对象完成问题";
- const please_completion_problem$2 = "请填写完内容";
- const system_error$2 = "系统错误";
- const not_selected$2 = "未选择";
- const EN = {
- hello: hello$2,
- login: login$2,
- register: register$2,
- password: password$2,
- password_repeat: password_repeat$2,
- telno: telno$2,
- new_member: new_member$2,
- navigationBarTitleText: navigationBarTitleText$2,
- add_member: add_member$2,
- father: father$2,
- mother: mother$2,
- husband: husband$2,
- wife: wife$2,
- other_member: other_member$2,
- add_member_text1: add_member_text1$2,
- add_member_text2: add_member_text2$2,
- add_member_text3: add_member_text3$2,
- add_member_text4: add_member_text4$2,
- add_member_text5: add_member_text5$2,
- add_member_text6: add_member_text6$2,
- add_member_text7: add_member_text7$2,
- add_member_text8: add_member_text8$2,
- add_member_text9: add_member_text9$2,
- submit: submit$2,
- show_report: show_report$2,
- do_success: do_success$2,
- illness_title: illness_title$2,
- report_score: report_score$2,
- report_result: report_result$2,
- report_error_text_1: report_error_text_1$2,
- report_error_text_2: report_error_text_2$2,
- report_error_text_3: report_error_text_3$2,
- report_text_1: report_text_1$2,
- report_text_1_1: report_text_1_1$2,
- health_advice: health_advice$2,
- report_explain: report_explain$2,
- report_detail: report_detail$2,
- report_explain_text_1: report_explain_text_1$2,
- report_explain_text_2: report_explain_text_2$2,
- report_explain_text_3: report_explain_text_3$2,
- report_explain_text_3_1: report_explain_text_3_1$2,
- report_explain_text_3_2: report_explain_text_3_2$2,
- report_explain_text_3_3: report_explain_text_3_3$2,
- report_explain_text_4: report_explain_text_4$2,
- report_explain_text_5: report_explain_text_5$2,
- report_explain_text_6: report_explain_text_6$2,
- report_explain_text_7: report_explain_text_7$2,
- report_explain_text_8: report_explain_text_8$2,
- report_explain_text_9: report_explain_text_9$2,
- report_explain_text_10: report_explain_text_10$2,
- healthy_habits: healthy_habits$2,
- y_n: y_n$2,
- healthy_personal_ratios: healthy_personal_ratios$2,
- all_people: all_people$2,
- group_people: group_people$2,
- report_text_4: report_text_4$2,
- report_text_5: report_text_5$2,
- report_text_6: report_text_6$2,
- report_text_7: report_text_7$2,
- report_text_8: report_text_8$2,
- report_text_9: report_text_9$2,
- y: y$2,
- n: n$2,
- select_age: select_age$2,
- select_age_1: select_age_1$2,
- select_age_2: select_age_2$2,
- select_age_3: select_age_3$2,
- select_sex: select_sex$2,
- calculate_BMI: calculate_BMI$2,
- select: select$2,
- height: height$2,
- weight: weight$2,
- selectcanvas_text1: selectcanvas_text1$2,
- selectcanvas_text2: selectcanvas_text2$2,
- selectcanvas_text3: selectcanvas_text3$2,
- report_user: report_user$2,
- selectage_test1: selectage_test1$2,
- selectage_test2: selectage_test2$2,
- next_step: next_step$2,
- show_info_text1: show_info_text1$2,
- show_info_text2: show_info_text2$2,
- less_than: less_than$2,
- greater_than: greater_than$2,
- selectwaistline_text1: selectwaistline_text1$2,
- selectwaistline_text2: selectwaistline_text2$2,
- selectwaistline_text3: selectwaistline_text3$2,
- selectwaistline_text4: selectwaistline_text4$2,
- selectwaistline_text5: selectwaistline_text5$2,
- waistline: waistline$2,
- waistline_text1: waistline_text1$2,
- waistline_text2: waistline_text2$2,
- scale_evaluation: scale_evaluation$2,
- selectsbp_text1: selectsbp_text1$2,
- selectsbp_text2: selectsbp_text2$2,
- selectsbp_text3: selectsbp_text3$2,
- selectsbp_text4: selectsbp_text4$2,
- hg_text1: hg_text1$2,
- hg_text2: hg_text2$2,
- hg_text3: hg_text3$2,
- hg_text4: hg_text4$2,
- blood_pressure: blood_pressure$2,
- low_risk: low_risk$2,
- risk: risk$2,
- valuating_people: valuating_people$2,
- completion_text_1: completion_text_1$2,
- completion_text_2: completion_text_2$2,
- questions_remaining: questions_remaining$2,
- have: have$2,
- same_as_you: same_as_you$2,
- select_gender_for_valuating_people: select_gender_for_valuating_people$2,
- select_gender_text_1: select_gender_text_1$2,
- is_man: is_man$2,
- is_female: is_female$2,
- man: man$2,
- female: female$2,
- index_text_1: index_text_1$2,
- index_text_2: index_text_2$2,
- index_text_3: index_text_3$2,
- index_text_4: index_text_4$2,
- index_text_5: index_text_5$2,
- index_text_6: index_text_6$2,
- index_btn_1: index_btn_1$2,
- index_btn_2: index_btn_2$2,
- index_btn_3: index_btn_3$2,
- share: share$2,
- share_text: share_text$2,
- member_add_text_1: member_add_text_1$2,
- member_add_text_2: member_add_text_2$2,
- telno_null: telno_null$2,
- password_null: password_null$2,
- telno_error: telno_error$2,
- password_repeat_error: password_repeat_error$2,
- register_error: register_error$2,
- member_num_than_max: member_num_than_max$2,
- member_title_null: member_title_null$2,
- completion_problem_for_valuating_people: completion_problem_for_valuating_people$2,
- please_completion_problem: please_completion_problem$2,
- system_error: system_error$2,
- not_selected: not_selected$2
- };
- const hello$1 = "你好";
- const login$1 = "登录";
- const register$1 = "注册";
- const password$1 = "密码";
- const password_repeat$1 = "重复密码";
- const telno$1 = "手机号";
- const new_member$1 = "新成员";
- const navigationBarTitleText$1 = "心脑检测";
- const add_member$1 = "添加家庭成员";
- const father$1 = "爸爸";
- const mother$1 = "妈妈";
- const husband$1 = "老公";
- const wife$1 = "老婆";
- const other_member$1 = "其它亲友";
- const add_member_text1$1 = "父母有没有";
- const add_member_text2$1 = "心梗脑梗的风险?";
- const add_member_text3$1 = "帮他们评测!";
- const add_member_text4$1 = "爱人工作繁忙";
- const add_member_text5$1 = "应酬多,压力大,常喝酒";
- const add_member_text6$1 = "有没有心脑血管的隐患?";
- const add_member_text7$1 = "其它男性亲友";
- const add_member_text8$1 = "其它女性亲友";
- const add_member_text9$1 = "请自行输入";
- const submit$1 = "提交";
- const show_report$1 = "评测结果";
- const do_success$1 = "操作成功";
- const illness_title$1 = "病名";
- const report_score$1 = "评测分数";
- const report_result$1 = "筛查结果";
- const report_error_text_1$1 = "疾在腠理,汤熨之所及也!在您之前我们已经帮很多位用户发现了风险,只要重视并积极与医生沟通,就能避免真正的健康和生命风险。";
- const report_error_text_2$1 = "积极面对,去当地正规医院做相应检查!";
- const report_error_text_3$1 = "按健康建议调整生活习惯,降低风险。";
- const report_text_1$1 = "评分未超过";
- const report_text_1_1$1 = "分,目前患病风险不高。";
- const health_advice$1 = "健康建议";
- const report_explain$1 = "评测说明";
- const report_detail$1 = "筛查详情";
- const report_explain_text_1$1 = "您已超过40岁,进入心脑血管的风险人群,此外,患糖尿病的机率也大大增加。";
- const report_explain_text_2$1 = "男性的糖尿病风险高于女性,您更加要注意健康。";
- const report_explain_text_3$1 = "您的BMI:";
- const report_explain_text_3_1$1 = ",体型偏胖,您的身高";
- const report_explain_text_3_2$1 = "厘米,您减重到";
- const report_explain_text_3_3$1 = "公斤会更健康。";
- const report_explain_text_4$1 = "您的血压也偏高,这将引发更多的健康问题,您需要与医生沟通,将血压降低。";
- const report_explain_text_5$1 = "您有心脑血管家庭史,在生活习惯上要更加注意。";
- const report_explain_text_6$1 = "您在烟酒、运动等方面有不良的生活习惯,建议调整。";
- const report_explain_text_7$1 = "现在您已超过40岁,为健康着想,如果不能戒烟,也建议逐步减少吸烟量。";
- const report_explain_text_8$1 = "您有上腹部疼痛并呕吐的风险症状,建议去正规医院检查。";
- const report_explain_text_9$1 = "您有心前区疼痛且不缓解的症状,建议去正规医院检查。";
- const report_explain_text_10$1 = "上方评分是根据国家糖尿病防治指南及中国心肌梗塞风险评分等心脑血管早期筛查标准为您做的评分,评分体系不同,后面是具体的解读,供您参考。";
- const healthy_habits$1 = "健康习惯";
- const y_n$1 = "是/否";
- const healthy_personal_ratios$1 = "健康人员比例";
- const all_people$1 = "全员";
- const group_people$1 = "分组";
- const report_text_4$1 = "分组是指同性别、同年龄段(不满40,40~49,超过50)用户的统计数据。";
- const report_text_5$1 = "您已是会员,您享有如下权益。";
- const report_text_6$1 = "在一年期内可以无限次评测。";
- const report_text_7$1 = "同时可以给3位亲属无限次评测。";
- const report_text_8$1 = "如果您第一次评测的结果显示您三项均无风险,系统将会您增加1-2位亲属名额,同时您第一次分享本报告页,进来的朋友可以成为免费会员,免费会员数量和您的年龄相关。";
- const report_text_9$1 = "已完成,返回首页为家人评测,开启健康管理。";
- const y$1 = "是";
- const n$1 = "否";
- const select_age$1 = "年龄";
- const select_age_1$1 = "岁";
- const select_age_2$1 = "岁以上";
- const select_age_3$1 = "岁以下";
- const select_sex$1 = "性别";
- const calculate_BMI$1 = "计算BMI";
- const select$1 = "选择";
- const height$1 = "身高";
- const weight$1 = "体重";
- const selectcanvas_text1$1 = "请输入被评测人身高体重";
- const selectcanvas_text2$1 = "BMI是人体的胖瘦程度的量化指标,其大小与许多疾病风险程度相关联。";
- const selectcanvas_text3$1 = "身高取整数,体重按0.5公斤选取即可。";
- const report_user$1 = "评测对象";
- const selectage_test1$1 = "请选择被评测人年龄";
- const selectage_test2$1 = "从29岁开始,一些对健康影响较大的慢性病的风险就开始增加,年龄无法改变,但可以改变生活习惯。";
- const next_step$1 = "下一步";
- const show_info_text1$1 = "您的BMI已超过";
- const show_info_text2$1 = "用户";
- const less_than$1 = "小于";
- const greater_than$1 = "大于";
- const selectwaistline_text1$1 = "请左右滑动选择被评测人腰围";
- const selectwaistline_text2$1 = "腰围是内脏脂肪含量是否过多体现,内脏脂肪过多是多种疾病的诱因。";
- const selectwaistline_text3$1 = "JAMA最新发表的研究指出,腰臀比超过一定数值,并且收缩压过高的人群,心血管死亡风险明显上升,所以,保持腰臀比不仅仅是爱美的需求,对身体健康也非常重要。";
- const selectwaistline_text4$1 = "关于腰臀比的研究有定量的研究结果时,我们也会更新评测内容。";
- const selectwaistline_text5$1 = "评测只需要您正确提供腰围的范围即可,如果不清楚,提交你合身的裤子的尺码即可,坐标下方有尺码值供参考。";
- const waistline$1 = "腰围";
- const waistline_text1$1 = "尺";
- const waistline_text2$1 = "寸";
- const scale_evaluation$1 = "量表评测";
- const selectsbp_text1$1 = "请输入评测对象血压所在范围";
- const selectsbp_text2$1 = "与疾病相关的主要指标是高压,您只需提供高压数据,选择范围正确即可";
- const selectsbp_text3$1 = "如果有服降压药,请提供矫治前的高压数据,高血压患者一般在140以上";
- const selectsbp_text4$1 = "如果你确认不知道血压,没有高血压,你可以填写常规范围,110-120,如果当评测结果在合格线左右3分范围内,您需要测量血压重新评估";
- const hg_text1$1 = "mmHg以下";
- const hg_text2$1 = "mmHg";
- const hg_text3$1 = "mmHg之间";
- const hg_text4$1 = "mmHg之上";
- const blood_pressure$1 = "血压";
- const low_risk$1 = "低风险";
- const risk$1 = "有风险";
- const valuating_people$1 = "评测对象";
- const completion_text_1$1 = "糖尿病、脑梗的风险筛查已完成!";
- const completion_text_2$1 = "请继续完成余下问题。";
- const questions_remaining$1 = "个问题剩余";
- const have$1 = "有";
- const same_as_you$1 = "用户和您相同";
- const select_gender_for_valuating_people$1 = "请选择评测对象性别";
- const select_gender_text_1$1 = "研究表明,针对某一疾病,男女两性风险不同。例如糖尿病,男性患病风险更高,需要更加注意饮食习惯与控制腰围。";
- const is_man$1 = "是男性";
- const is_female$1 = "是女性";
- const man$1 = "男";
- const female$1 = "女";
- const index_text_1$1 = "给爸爸、妈妈、爱人测一测";
- const index_text_2$1 = "健康的生活习惯是预防心脑血管疾病最好的策略!";
- const index_text_3$1 = "早期筛检";
- const index_text_4$1 = "主动预防";
- const index_text_5$1 = "保家人健康 保家庭平安";
- const index_text_6$1 = "排除风险 安心!放心";
- const index_btn_1$1 = "开始评测";
- const index_btn_2$1 = "查看报告";
- const index_btn_3$1 = "重新评测";
- const share$1 = "分享";
- const share_text$1 = "心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。";
- const member_add_text_1$1 = "每个人都关心家人健康";
- const member_add_text_2$1 = "但我们可以做得更多";
- const telno_null$1 = "手机号必填";
- const password_null$1 = "密码必填";
- const telno_error$1 = "手机号错误";
- const password_repeat_error$1 = "重复密码不相同";
- const register_error$1 = "注册失败";
- const member_num_than_max$1 = "家人不能超过上限";
- const member_title_null$1 = "亲友名未填";
- const completion_problem_for_valuating_people$1 = "请为评测对象完成问题";
- const please_completion_problem$1 = "请填写完内容";
- const system_error$1 = "系统错误";
- const not_selected$1 = "未选择";
- const ZH = {
- hello: hello$1,
- login: login$1,
- register: register$1,
- password: password$1,
- password_repeat: password_repeat$1,
- telno: telno$1,
- new_member: new_member$1,
- navigationBarTitleText: navigationBarTitleText$1,
- add_member: add_member$1,
- father: father$1,
- mother: mother$1,
- husband: husband$1,
- wife: wife$1,
- other_member: other_member$1,
- add_member_text1: add_member_text1$1,
- add_member_text2: add_member_text2$1,
- add_member_text3: add_member_text3$1,
- add_member_text4: add_member_text4$1,
- add_member_text5: add_member_text5$1,
- add_member_text6: add_member_text6$1,
- add_member_text7: add_member_text7$1,
- add_member_text8: add_member_text8$1,
- add_member_text9: add_member_text9$1,
- submit: submit$1,
- show_report: show_report$1,
- do_success: do_success$1,
- illness_title: illness_title$1,
- report_score: report_score$1,
- report_result: report_result$1,
- report_error_text_1: report_error_text_1$1,
- report_error_text_2: report_error_text_2$1,
- report_error_text_3: report_error_text_3$1,
- report_text_1: report_text_1$1,
- report_text_1_1: report_text_1_1$1,
- health_advice: health_advice$1,
- report_explain: report_explain$1,
- report_detail: report_detail$1,
- report_explain_text_1: report_explain_text_1$1,
- report_explain_text_2: report_explain_text_2$1,
- report_explain_text_3: report_explain_text_3$1,
- report_explain_text_3_1: report_explain_text_3_1$1,
- report_explain_text_3_2: report_explain_text_3_2$1,
- report_explain_text_3_3: report_explain_text_3_3$1,
- report_explain_text_4: report_explain_text_4$1,
- report_explain_text_5: report_explain_text_5$1,
- report_explain_text_6: report_explain_text_6$1,
- report_explain_text_7: report_explain_text_7$1,
- report_explain_text_8: report_explain_text_8$1,
- report_explain_text_9: report_explain_text_9$1,
- report_explain_text_10: report_explain_text_10$1,
- healthy_habits: healthy_habits$1,
- y_n: y_n$1,
- healthy_personal_ratios: healthy_personal_ratios$1,
- all_people: all_people$1,
- group_people: group_people$1,
- report_text_4: report_text_4$1,
- report_text_5: report_text_5$1,
- report_text_6: report_text_6$1,
- report_text_7: report_text_7$1,
- report_text_8: report_text_8$1,
- report_text_9: report_text_9$1,
- y: y$1,
- n: n$1,
- select_age: select_age$1,
- select_age_1: select_age_1$1,
- select_age_2: select_age_2$1,
- select_age_3: select_age_3$1,
- select_sex: select_sex$1,
- calculate_BMI: calculate_BMI$1,
- select: select$1,
- height: height$1,
- weight: weight$1,
- selectcanvas_text1: selectcanvas_text1$1,
- selectcanvas_text2: selectcanvas_text2$1,
- selectcanvas_text3: selectcanvas_text3$1,
- report_user: report_user$1,
- selectage_test1: selectage_test1$1,
- selectage_test2: selectage_test2$1,
- next_step: next_step$1,
- show_info_text1: show_info_text1$1,
- show_info_text2: show_info_text2$1,
- less_than: less_than$1,
- greater_than: greater_than$1,
- selectwaistline_text1: selectwaistline_text1$1,
- selectwaistline_text2: selectwaistline_text2$1,
- selectwaistline_text3: selectwaistline_text3$1,
- selectwaistline_text4: selectwaistline_text4$1,
- selectwaistline_text5: selectwaistline_text5$1,
- waistline: waistline$1,
- waistline_text1: waistline_text1$1,
- waistline_text2: waistline_text2$1,
- scale_evaluation: scale_evaluation$1,
- selectsbp_text1: selectsbp_text1$1,
- selectsbp_text2: selectsbp_text2$1,
- selectsbp_text3: selectsbp_text3$1,
- selectsbp_text4: selectsbp_text4$1,
- hg_text1: hg_text1$1,
- hg_text2: hg_text2$1,
- hg_text3: hg_text3$1,
- hg_text4: hg_text4$1,
- blood_pressure: blood_pressure$1,
- low_risk: low_risk$1,
- risk: risk$1,
- valuating_people: valuating_people$1,
- completion_text_1: completion_text_1$1,
- completion_text_2: completion_text_2$1,
- questions_remaining: questions_remaining$1,
- have: have$1,
- same_as_you: same_as_you$1,
- select_gender_for_valuating_people: select_gender_for_valuating_people$1,
- select_gender_text_1: select_gender_text_1$1,
- is_man: is_man$1,
- is_female: is_female$1,
- man: man$1,
- female: female$1,
- index_text_1: index_text_1$1,
- index_text_2: index_text_2$1,
- index_text_3: index_text_3$1,
- index_text_4: index_text_4$1,
- index_text_5: index_text_5$1,
- index_text_6: index_text_6$1,
- index_btn_1: index_btn_1$1,
- index_btn_2: index_btn_2$1,
- index_btn_3: index_btn_3$1,
- share: share$1,
- share_text: share_text$1,
- member_add_text_1: member_add_text_1$1,
- member_add_text_2: member_add_text_2$1,
- telno_null: telno_null$1,
- password_null: password_null$1,
- telno_error: telno_error$1,
- password_repeat_error: password_repeat_error$1,
- register_error: register_error$1,
- member_num_than_max: member_num_than_max$1,
- member_title_null: member_title_null$1,
- completion_problem_for_valuating_people: completion_problem_for_valuating_people$1,
- please_completion_problem: please_completion_problem$1,
- system_error: system_error$1,
- not_selected: not_selected$1
- };
- const hello = "สวัสดี";
- const login = "เข้าสู่ระบบ";
- const register = "ลงทะเบียน";
- const password = "รหัสผ่าน";
- const password_repeat = "ทำซ้ำรหัสผ่าน";
- const telno = "หมายเลขโทรศัพท์มือถือ";
- const new_member = "สมาชิกใหม่";
- const navigationBarTitleText = "การตรวจหัวใจและสมอง";
- const add_member = "เพิ่มสมาชิกในครอบครัว";
- const father = "พ่อ";
- const mother = "แม่จ๋า";
- const husband = "สามี";
- const wife = "ภรรยา";
- const other_member = "ญาติและเพื่อนอื่น ๆ";
- const add_member_text1 = "พ่อแม่เสี่ยงเป็นโรคกล้ามเนื้อหัวใจตายหรือไม่";
- const add_member_text2 = "ความเสี่ยงในการควบคุมจิตใจ";
- const add_member_text3 = "ช่วยให้พวกเขาประเมิน!";
- const add_member_text4 = "งานยุ่ง";
- const add_member_text5 = "ดื่มเป็นประจำ";
- const add_member_text6 = "มีอันตรายที่ซ่อนอยู่หรือไม่มีหัวใจและหลอดเลือดสมอง?";
- const add_member_text7 = "ญาติและเพื่อนชายอื่น ๆ";
- const add_member_text8 = "ญาติและเพื่อนหญิงอื่น ๆ";
- const add_member_text9 = "กรุณากรอกข้อมูลด้วยตัวเอง";
- const submit = "ส่ง";
- const show_report = "ผลการประเมิน";
- const do_success = "ความสำเร็จในการดำเนินงาน";
- const illness_title = "ชนิดโรค";
- const report_score = "คะแนนประเมินผล";
- const report_result = "ผลการตรวจคัดกรอง";
- const report_error_text_1 = "หากโรคอยู่แค่ชั้นผิวหนัง เพียงประคบร้อนก็รักษาได้! ก่อนหน้าคุณเราได้ช่วยให้ผู้ใช้มากมายค้นพบกับความเสี่ยง ขอเพียงให้ความสำคัญและสื่อสารกับแพทย์อย่างกระตือรือร้น ก็จะสามารถหลีกเลี่ยงความเสี่ยงต่อสุขภาพและชีวิตที่แท้จริงได้。";
- const report_error_text_2 = "เผชิญหน้าด้วยความคิดบวก ไปเข้ารับการตรวจที่เกี่ยวข้อง ณ โรงพยาบาลที่ได้มาตรฐานในพื้นที่!";
- const report_error_text_3 = "ปรับพฤติกรรมการดำเนินชีวิตตามคำแนะนำด้านสุขภาพ เพื่อลดความเสี่ยง。";
- const report_text_1 = "คะแนนยังไม่เกิน ";
- const report_text_1_1 = "คะแนน ปัจจุบันความเสี่ยงต่อการเกิดโรคยังไม่สูง。";
- const health_advice = "คำแนะนำด้านสุขภาพ";
- const report_explain = "หมายเหตุการประเมิน";
- const report_detail = "รายละเอียดการตรวจคัดกรอง";
- const report_explain_text_1 = "คุณอายุเกิน 40 ปี กลุ่มเสี่ยงที่เข้าสู่หลอดเลือดหัวใจและสมอง นอกจากนี้ โอกาสในการเป็นโรคเบาหวานก็เพิ่มขึ้นอย่างมาก。";
- const report_explain_text_2 = "ผู้ชายมีความเสี่ยงต่อโรคเบาหวานสูงกว่าผู้หญิง, คุณควรดูแลสุขภาพมากขึ้น。";
- const report_explain_text_3 = "BMI ของคุณ:";
- const report_explain_text_3_1 = ",รูปร่างค่อนข้างอ้วน,ความสูงของคุณ";
- const report_explain_text_3_2 = "เซนติเมตร,คุณลดน้ำหนักถึง";
- const report_explain_text_3_3 = "กิโลกรัม,จะมีสุขภาพที่ดีขึ้น。";
- const report_explain_text_4 = "ความดันโลหิตของคุณยังสูงซึ่งจะก่อให้เกิดปัญหาสุขภาพมากขึ้นคุณจำเป็นต้องสื่อสารกับแพทย์ของคุณเพื่อลดความดันโลหิต。";
- const report_explain_text_5 = "คุณมีประวัติครอบครัวเกี่ยวกับหัวใจและหลอดเลือดสมอง,ให้ความสำคัญกับพฤติกรรมการใช้ชีวิตมากขึ้น。";
- const report_explain_text_6 = "คุณมีนิสัยการใช้ชีวิตที่ไม่ดีเช่นบุหรี่และเหล้าขาดการออกกำลังกาย,แนะนำการปรับ。";
- const report_explain_text_7 = "ตอนนี้คุณอายุเกิน 40 ปีแล้ว,คิดถึงสุขภาพ,หากไม่สามารถเลิกบุหรี่ได้ก็แนะนำให้ค่อยๆ ลดปริมาณ。";
- const report_explain_text_8 = "มีอาการเสี่ยงปวดท้องส่วนบน อาเจียน จึงแนะนำให้ไปตรวจที่โรงพยาบาลปกติ。";
- const report_explain_text_9 = "หากคุณมีอาการเจ็บปวดและไม่บรรเทาในบริเวณก่อนหัวใจแนะนำให้ไปตรวจที่โรงพยาบาลปกติ。";
- const report_explain_text_10 = "การให้คะแนนด้านบนเป็นการให้คะแนนสำหรับคุณตามเกณฑ์การตรวจคัดกรองโรคหัวใจและหลอดเลือดหัวใจและหลอดเลือดในช่วงต้นเช่นคู่มือการป้องกันโรคเบาหวานและการให้คะแนนความเสี่ยงของกล้ามเนื้อกล้ามเนื้อ, ระบบการให้คะแนนที่แตกต่างกัน, ตามด้วยการตีความที่เฉพาะเจาะจงสำหรับการอ้างอิงของคุณ。";
- const healthy_habits = "พฤติกรรมสุขภาพ";
- const y_n = "ใช่ / ไม่";
- const healthy_personal_ratios = "สัดส่วนบุคลากรด้านสุขภาพ";
- const all_people = "ทั้งหมด";
- const group_people = "กลุ่มย่อย";
- const report_text_4 = "การจัดกลุ่ม หมายถึงสถิติของผู้ใช้ที่เป็นเพศเดียวกันและอายุเดียวกัน (น้อยกว่า 40,40 ~ 49, มากกว่า 50)。";
- const report_text_5 = "คุณเป็นสมาชิกแล้วและคุณมีสิทธิประโยชน์ดังต่อไปนี้。";
- const report_text_6 = "สามารถประเมินได้ไม่จำกัดจำนวนครั้งตลอดระยะเวลา 1 ปี。";
- const report_text_7 = "สามารถรีวิวได้ไม่จำกัดจำนวนครั้งภายในระยะเวลาหนึ่งปี สามารถให้ญาติ 3 คนได้ไม่จำกัดครั้ง。";
- const report_text_8 = "หากผลการตรวจสอบครั้งแรกของคุณแสดงให้เห็นว่า คุณไม่มีความเสี่ยงทั้งสามระบบจะเพิ่มญาติ 1-2 คนในเวลาเดียวกันคุณจะแบ่งปันหน้ารายงานนี้ เป็นครั้งแรกเพื่อนของคุณ ที่เข้ามาจะเป็นสมาชิกฟรีจำนวนสมาชิก และอายุของคุณ ที่เกี่ยวข้อง";
- const report_text_9 = "ทำมาแล้ว กลับไปที่หน้าแรก ประเมินผลครอบครัว เปิดการจัดการสุขภาพ。";
- const y = "ใช่";
- const n = "ไม่";
- const select_age = "อายุ";
- const select_age_1 = "อายุ";
- const select_age_2 = "อายุมากกว่า";
- const select_age_3 = "อายุต่ำกว่า";
- const select_sex = "เพศ";
- const calculate_BMI = "คำนวณค่าดัชนีมวลกาย";
- const select = "เลือก";
- const height = "ส่วนสูง";
- const weight = "น้ำหนักตัว";
- const selectcanvas_text1 = "กรุณาใส่ส่วนสูง น้ำหนัก";
- const selectcanvas_text2 = "ดัชนีมวลกายเป็นตัวบ่งชี้เชิงปริมาณของระดับความอ้วนและความผอมของร่างกายมนุษย์และมีขนาดที่เชื่อมโยงกับระดับความเสี่ยงของโรคต่างๆ。";
- const selectcanvas_text3 = "ความสูงใช้จำนวนเต็มน้ำหนักที่เลือกโดย 0.5 กิโลกรัมก็โอเค。";
- const report_user = "วัตถุประเมิน";
- const selectage_test1 = "โปรดเลือกอายุของผู้ที่ได้รับการประเมิน";
- const selectage_test2 = "ความเสี่ยงต่อการเกิดโรคเรื้อรังบางชนิดที่ส่งผลกระทบต่อสุขภาพมากเริ่มเพิ่มขึ้นตั้งแต่อายุ 29 ปี,ไม่สามารถเปลี่ยนอายุได้ แต่สามารถเปลี่ยนพฤติกรรมการใช้ชีวิตได้。";
- const next_step = "ขั้นตอนต่อไป";
- const show_info_text1 = "BMI ของคุณเกินเกณฑ์แล้ว";
- const show_info_text2 = "ผู้ใช้";
- const less_than = "น้อยกว่า";
- const greater_than = "มากกว่า";
- const selectwaistline_text1 = "โปรดเลื่อนไปทางซ้ายหรือขวาเพื่อเลือกเส้นรอบเอวของผู้รับการประเมินผล";
- const selectwaistline_text2 = "เส้นรอบเอว คือสิ่งสะท้อนว่าปริมาณไขมันในช่องท้องมากเกินไปหรือไม่ โดยปริมาณไขมันในช่องท้องที่มากเกินไปเป็นสาเหตุที่ก่อให้เกิดโรคต่าง ๆ";
- const selectwaistline_text3 = "งานวิจัยที่ตีพิมพ์ล่าสุดในวารสาร JAMA ชี้ว่า กลุ่มบุคคลที่มีอัตราส่วนรอบเอวต่อรอบสะโพกเกินค่าที่กำหนด อีกทั้งค่าความดันโลหิตตัวบนสูงเกินไป ความเสี่ยงต่อการเสียชีวิตจากโรคหัวใจและหลอดเลือดจะเพิ่มขึ้นอย่างเห็นได้ชัด ด้วยเหตุนี้ การคงอัตราส่วนรอบเอวต่อรอบสะโพกจึงไม่เพียงเป็นสิ่งจำเป็นต่อความรักสวยรักงามเท่านั้น ยังมีความสำคัญมากต่อสุขภาพร่างกายอีกด้วย";
- const selectwaistline_text4 = "เมื่อมีผลการวิจัยเชิงปริมาณที่เกี่ยวข้องกับงานวิจัยอัตราส่วนรอบเอวต่อรอบสะโพก เราจะอัปเดตเนื้อหาการประเมินผลด้วยเช่นกัน。";
- const selectwaistline_text5 = "ในการประเมินผล ขอเพียงคุณระบุช่วงของเส้นรอบเอวที่ถูกต้องเท่านั้นเป็นพอ หากไม่แน่ใจ สามารถส่งเป็นขนาดกางเกงที่พอดีกับตัวคุณได้ ทั้งนี้มีค่าขนาดสำหรับใช้ประกอบการพิจารณาอยู่ที่ด้านล่างพิกัด。";
- const waistline = "เส้นรอบเอว";
- const waistline_text1 = "尺";
- const waistline_text2 = "寸";
- const scale_evaluation = "การประเมินผล";
- const selectsbp_text1 = "โปรดกรอกช่วงความดันโลหิตของผู้รับการประเมินผล";
- const selectsbp_text2 = "ดัชนีหลักที่มีความเกี่ยวข้องกับโรคคือความดันโลหิตสูง คุณแค่ต้องระบุข้อมูลความดันโลหิตสูง และเลือกช่วงให้ถูกต้องเท่านั้น";
- const selectsbp_text3 = "หากมีการทานยาลดความดัน โปรดระบุข้อมูลความดันโลหิตสูงก่อนที่จะเข้ารับการรักษา ผู้ป่วยโรคความดันโลหิตสูงโดยทั่วไปค่าจะสูงกว่า 140 ขึ้นไป";
- const selectsbp_text4 = "หากคุณยืนยันว่าไม่รู้ค่าความดันโลหิต ไม่มีความดันโลหิตสูง คุณสามารถกรอกช่วงปกติได้ คือ 110-120 หากผลการประเมินผลอยู่ในช่วง 3 คะแนน ทางด้านซ้ายหรือขวาของเส้นเกณฑ์มาตรฐาน คุณต้องวัดความดันโลหิตเพื่อประเมินผลใหม่";
- const hg_text1 = "mmHgต่อไปนี้";
- const hg_text2 = "mmHg";
- const hg_text3 = "mmHgภายใน";
- const hg_text4 = "mmHgมากกว่า";
- const blood_pressure = "ความดันโลหิต";
- const low_risk = "ความเสี่ยงต่ำ";
- const risk = "มีความเสี่ยง";
- const valuating_people = "ผู้รับการประเมินผล";
- const completion_text_1 = "การประเมินความเสี่ยงของโรคเบาหวานและโรคหลอดเลือดสมองเสร็จสมบูรณ์!";
- const completion_text_2 = "กรุณาดำเนินการต่อให้เสร็จสิ้น。";
- const questions_remaining = "คำถามที่เหลือ";
- const have = "มี";
- const same_as_you = "ผู้ใช้เช่นเดียวกับคุณ";
- const select_gender_for_valuating_people = "โปรดเลือกเพศของผู้รับการประเมินผล";
- const select_gender_text_1 = "งานวิจัยชี้ว่า ความเสี่ยงต่อโรคบางชนิดในเพศชายและเพศหญิงจะแตกต่างกัน เช่น โรคเบาหวาน ความเสี่ยงต่อการเกิดโรคในเพศชายจะสูงกว่า จึงต้องใส่ใจพฤติกรรมการบริโภคอาหารให้มากขึ้นและควบคุมเส้นรอบเอว。";
- const is_man = "เป็นเพศชาย";
- const is_female = "เป็นเพศหญิง";
- const man = "ชาย";
- const female = "ผู้หญิง";
- const index_text_1 = "ทำแบบประเมินให้บิดา มารดา และบุคคลในครอบครัว";
- const index_text_2 = "พฤติกรรมการดำเนินชีวิตที่ดีต่อสุขภาพ คือกลยุทธ์ที่ดีที่สุดในการป้องกันโรคหลอดเลือดหัวใจและสมอง!!";
- const index_text_3 = "ตรวจคัดกรองระยะเริ่มต้น";
- const index_text_4 = "ป้องกันเชิงรุก";
- const index_text_5 = "รักษาสุขภาพบุคคลในครอบครัวให้แข็งแรง ปกป้องครอบครัวให้ปลอดภัย";
- const index_text_6 = "ขจัดความเสี่ยง สบายใจ! ไร้กังวล!";
- const index_btn_1 = "เริ่มประเมินผล";
- const index_btn_2 = "ตรวจดูรายงาน";
- const index_btn_3 = "ประเมินผลใหม่";
- const share = "แบ่งปัน";
- const share_text = "การตรวจคัดกรองโรคหัวใจและหลอดเลือดสมองในระยะแรกง่ายและง่ายมีประโยชน์และไม่เป็นอันตรายแบ่งปันให้เพื่อนและครอบครัว。";
- const member_add_text_1 = "ทุกคนห่วงใยครอบครัว";
- const member_add_text_2 = "แต่เราทำได้มากกว่านี้";
- const telno_null = "หมายเลขโทรศัพท์มือถือ จำเป็น";
- const password_null = "รหัสผ่าน จำเป็น";
- const telno_error = "หมายเลขโทรศัพท์มือถือไม่ถูกต้อง";
- const password_repeat_error = "รหัสผ่านซ้ำไม่ตรงกัน";
- const register_error = "ลงทะเบียนไม่สำเร็จ";
- const member_num_than_max = "ปริมาณต้องไม่เกินเพดานที่กำหนด";
- const member_title_null = "ชื่อญาติและเพื่อนยังไม่ได้กรอก";
- const completion_problem_for_valuating_people = "กรุณากรอกคำตอบของวัตถุประเมิน";
- const please_completion_problem = "กรุณากรอกข้อมูลให้ครบถ้วน";
- const system_error = "ข้อผิดพลาดของระบบ";
- const not_selected = "ไม่มีตัวเลือก";
- const TH = {
- hello,
- login,
- register,
- password,
- password_repeat,
- telno,
- new_member,
- navigationBarTitleText,
- add_member,
- father,
- mother,
- husband,
- wife,
- other_member,
- add_member_text1,
- add_member_text2,
- add_member_text3,
- add_member_text4,
- add_member_text5,
- add_member_text6,
- add_member_text7,
- add_member_text8,
- add_member_text9,
- submit,
- show_report,
- do_success,
- illness_title,
- report_score,
- report_result,
- report_error_text_1,
- report_error_text_2,
- report_error_text_3,
- report_text_1,
- report_text_1_1,
- health_advice,
- report_explain,
- report_detail,
- report_explain_text_1,
- report_explain_text_2,
- report_explain_text_3,
- report_explain_text_3_1,
- report_explain_text_3_2,
- report_explain_text_3_3,
- report_explain_text_4,
- report_explain_text_5,
- report_explain_text_6,
- report_explain_text_7,
- report_explain_text_8,
- report_explain_text_9,
- report_explain_text_10,
- healthy_habits,
- y_n,
- healthy_personal_ratios,
- all_people,
- group_people,
- report_text_4,
- report_text_5,
- report_text_6,
- report_text_7,
- report_text_8,
- report_text_9,
- y,
- n,
- select_age,
- select_age_1,
- select_age_2,
- select_age_3,
- select_sex,
- calculate_BMI,
- select,
- height,
- weight,
- selectcanvas_text1,
- selectcanvas_text2,
- selectcanvas_text3,
- report_user,
- selectage_test1,
- selectage_test2,
- next_step,
- show_info_text1,
- show_info_text2,
- less_than,
- greater_than,
- selectwaistline_text1,
- selectwaistline_text2,
- selectwaistline_text3,
- selectwaistline_text4,
- selectwaistline_text5,
- waistline,
- waistline_text1,
- waistline_text2,
- scale_evaluation,
- selectsbp_text1,
- selectsbp_text2,
- selectsbp_text3,
- selectsbp_text4,
- hg_text1,
- hg_text2,
- hg_text3,
- hg_text4,
- blood_pressure,
- low_risk,
- risk,
- valuating_people,
- completion_text_1,
- completion_text_2,
- questions_remaining,
- have,
- same_as_you,
- select_gender_for_valuating_people,
- select_gender_text_1,
- is_man,
- is_female,
- man,
- female,
- index_text_1,
- index_text_2,
- index_text_3,
- index_text_4,
- index_text_5,
- index_text_6,
- index_btn_1,
- index_btn_2,
- index_btn_3,
- share,
- share_text,
- member_add_text_1,
- member_add_text_2,
- telno_null,
- password_null,
- telno_error,
- password_repeat_error,
- register_error,
- member_num_than_max,
- member_title_null,
- completion_problem_for_valuating_people,
- please_completion_problem,
- system_error,
- not_selected
- };
- const messages = {
- zh: {
- ...ZH
- },
- en: {
- ...EN
- },
- th: {
- ...TH
- }
- };
- const i18n = createI18n({
- locale: "th",
- legacy: false,
- globalInjection: true,
- messages
- });
- function createApp() {
- const app = vue.createVueApp(App);
- app.use(i18n);
- 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);
|