app-service.js 558 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535
  1. if (typeof Promise !== "undefined" && !Promise.prototype.finally) {
  2. Promise.prototype.finally = function(callback) {
  3. const promise = this.constructor;
  4. return this.then(
  5. (value) => promise.resolve(callback()).then(() => value),
  6. (reason) => promise.resolve(callback()).then(() => {
  7. throw reason;
  8. })
  9. );
  10. };
  11. }
  12. ;
  13. if (typeof uni !== "undefined" && uni && uni.requireGlobal) {
  14. const global2 = uni.requireGlobal();
  15. ArrayBuffer = global2.ArrayBuffer;
  16. Int8Array = global2.Int8Array;
  17. Uint8Array = global2.Uint8Array;
  18. Uint8ClampedArray = global2.Uint8ClampedArray;
  19. Int16Array = global2.Int16Array;
  20. Uint16Array = global2.Uint16Array;
  21. Int32Array = global2.Int32Array;
  22. Uint32Array = global2.Uint32Array;
  23. Float32Array = global2.Float32Array;
  24. Float64Array = global2.Float64Array;
  25. BigInt64Array = global2.BigInt64Array;
  26. BigUint64Array = global2.BigUint64Array;
  27. }
  28. ;
  29. if (uni.restoreGlobal) {
  30. uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval);
  31. }
  32. (function(vue) {
  33. 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;
  34. "use strict";
  35. function formatAppLog(type2, filename, ...args) {
  36. if (uni.__log__) {
  37. uni.__log__(type2, filename, ...args);
  38. } else {
  39. console[type2].apply(console, [...args, filename]);
  40. }
  41. }
  42. function resolveEasycom(component, easycom) {
  43. return typeof component === "string" ? easycom : component;
  44. }
  45. const baseUrl = "https://app.chienxutech.com:30443";
  46. function dorequest(method2, url2, data, header = {}) {
  47. return uni.request({
  48. method: method2,
  49. url: url2,
  50. data
  51. });
  52. }
  53. function addlog(data, e, callback = null) {
  54. let url2 = baseUrl + "/index.php/index/Logmanger/addlog";
  55. dorequest("post", url2, data).then((res) => {
  56. if (callback) {
  57. callback(res);
  58. } else {
  59. res = res.data;
  60. if (0 == res.code) {
  61. e.$refs.toast.show({
  62. type: "error",
  63. message: res.errmsg
  64. });
  65. }
  66. }
  67. });
  68. }
  69. function islogin() {
  70. let userinfo = uni.getStorageSync("userinfo");
  71. if (!userinfo) {
  72. return false;
  73. }
  74. return true;
  75. }
  76. function saveuserinfo(info) {
  77. uni.setStorage({
  78. key: "userinfo",
  79. data: info,
  80. success: function() {
  81. },
  82. fail: function(error2) {
  83. formatAppLog("log", "at common/js/common.js:42", "error");
  84. addlog({
  85. json: "用户信息保存失败",
  86. type: "uniapp错误"
  87. });
  88. }
  89. });
  90. }
  91. function tostemlistnext(startindex, next = 0, scaleid_1 = false, srid_1 = false) {
  92. startindex = parseInt(startindex) + next;
  93. let stemlist = uni.getStorageSync("stemlist");
  94. if (!stemlist) {
  95. return false;
  96. }
  97. let item = stemlist[startindex];
  98. if (!item) {
  99. return false;
  100. }
  101. uni.setStorage({
  102. key: "stemitem",
  103. data: item
  104. });
  105. if (item == void 0) {
  106. return false;
  107. }
  108. if (scaleid_1 !== false && srid_1 !== false) {
  109. if (item.stemtype < 101) {
  110. uni.navigateTo({
  111. url: "/pages/topic/common?scaleid=" + scaleid_1 + "&srid=" + srid_1 + `&sindex=` + startindex
  112. });
  113. } else {
  114. let url2 = "/pages/topic/" + item.stemdefinepage + "?scaleid=" + scaleid_1 + "&srid=" + srid_1 + `&sindex=` + startindex;
  115. uni.navigateTo({
  116. url: url2
  117. });
  118. }
  119. } else {
  120. let scaleid = 4;
  121. let srid = uni.getStorageSync("srid");
  122. if (item.stemtype < 101) {
  123. uni.navigateTo({
  124. url: "/pages/topic/common?scaleid=" + scaleid + "&srid=" + srid + `&sindex=` + startindex
  125. });
  126. } else {
  127. let url2 = "/pages/topic/" + item.stemdefinepage + "?scaleid=" + scaleid + "&srid=" + srid + `&sindex=` + startindex;
  128. uni.navigateTo({
  129. url: url2
  130. });
  131. }
  132. }
  133. return true;
  134. }
  135. function tohome() {
  136. uni.redirectTo({
  137. url: "/pages/index/index"
  138. });
  139. }
  140. const _export_sfc = (sfc, props2) => {
  141. const target = sfc.__vccOpts || sfc;
  142. for (const [key, val] of props2) {
  143. target[key] = val;
  144. }
  145. return target;
  146. };
  147. if (islogin()) {
  148. uni.redirectTo({
  149. url: "/pages/index/index"
  150. });
  151. } else {
  152. uni.redirectTo({
  153. url: "/pages/login/login"
  154. });
  155. }
  156. const _sfc_main$D = {};
  157. function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
  158. return null;
  159. }
  160. const PagesIndexShow = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$C], ["__file", "D:/workspace/uniapp/health2/pages/index/show.vue"]]);
  161. const mpMixin = {};
  162. function email(value2) {
  163. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value2);
  164. }
  165. function mobile(value2) {
  166. return /^1([3589]\d|4[5-9]|6[1-2,4-7]|7[0-8])\d{8}$/.test(value2);
  167. }
  168. function url(value2) {
  169. 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);
  170. }
  171. function date$1(value2) {
  172. if (!value2)
  173. return false;
  174. if (number$2(value2))
  175. value2 = +value2;
  176. return !/Invalid|NaN/.test(new Date(value2).toString());
  177. }
  178. function dateISO(value2) {
  179. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value2);
  180. }
  181. function number$2(value2) {
  182. return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value2);
  183. }
  184. function string$1(value2) {
  185. return typeof value2 === "string";
  186. }
  187. function digits(value2) {
  188. return /^\d+$/.test(value2);
  189. }
  190. function idCard(value2) {
  191. 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(
  192. value2
  193. );
  194. }
  195. function carNo(value2) {
  196. const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  197. const creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  198. if (value2.length === 7) {
  199. return creg.test(value2);
  200. }
  201. if (value2.length === 8) {
  202. return xreg.test(value2);
  203. }
  204. return false;
  205. }
  206. function amount(value2) {
  207. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value2);
  208. }
  209. function chinese(value2) {
  210. const reg = /^[\u4e00-\u9fa5]+$/gi;
  211. return reg.test(value2);
  212. }
  213. function letter(value2) {
  214. return /^[a-zA-Z]*$/.test(value2);
  215. }
  216. function enOrNum(value2) {
  217. const reg = /^[0-9a-zA-Z]*$/g;
  218. return reg.test(value2);
  219. }
  220. function contains(value2, param) {
  221. return value2.indexOf(param) >= 0;
  222. }
  223. function range$2(value2, param) {
  224. return value2 >= param[0] && value2 <= param[1];
  225. }
  226. function rangeLength(value2, param) {
  227. return value2.length >= param[0] && value2.length <= param[1];
  228. }
  229. function landline(value2) {
  230. const reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  231. return reg.test(value2);
  232. }
  233. function empty(value2) {
  234. switch (typeof value2) {
  235. case "undefined":
  236. return true;
  237. case "string":
  238. if (value2.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, "").length == 0)
  239. return true;
  240. break;
  241. case "boolean":
  242. if (!value2)
  243. return true;
  244. break;
  245. case "number":
  246. if (value2 === 0 || isNaN(value2))
  247. return true;
  248. break;
  249. case "object":
  250. if (value2 === null || value2.length === 0)
  251. return true;
  252. for (const i in value2) {
  253. return false;
  254. }
  255. return true;
  256. }
  257. return false;
  258. }
  259. function jsonString(value2) {
  260. if (typeof value2 === "string") {
  261. try {
  262. const obj = JSON.parse(value2);
  263. if (typeof obj === "object" && obj) {
  264. return true;
  265. }
  266. return false;
  267. } catch (e) {
  268. return false;
  269. }
  270. }
  271. return false;
  272. }
  273. function array$1(value2) {
  274. if (typeof Array.isArray === "function") {
  275. return Array.isArray(value2);
  276. }
  277. return Object.prototype.toString.call(value2) === "[object Array]";
  278. }
  279. function object$1(value2) {
  280. return Object.prototype.toString.call(value2) === "[object Object]";
  281. }
  282. function code(value2, len = 6) {
  283. return new RegExp(`^\\d{${len}}$`).test(value2);
  284. }
  285. function func(value2) {
  286. return typeof value2 === "function";
  287. }
  288. function promise(value2) {
  289. return object$1(value2) && func(value2.then) && func(value2.catch);
  290. }
  291. function image(value2) {
  292. const newValue = value2.split("?")[0];
  293. const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
  294. return IMAGE_REGEXP.test(newValue);
  295. }
  296. function video(value2) {
  297. const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i;
  298. return VIDEO_REGEXP.test(value2);
  299. }
  300. function regExp(o) {
  301. return o && Object.prototype.toString.call(o) === "[object RegExp]";
  302. }
  303. const test = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  304. __proto__: null,
  305. amount,
  306. array: array$1,
  307. carNo,
  308. chinese,
  309. code,
  310. contains,
  311. date: date$1,
  312. dateISO,
  313. digits,
  314. email,
  315. empty,
  316. enOrNum,
  317. func,
  318. idCard,
  319. image,
  320. jsonString,
  321. landline,
  322. letter,
  323. mobile,
  324. number: number$2,
  325. object: object$1,
  326. promise,
  327. range: range$2,
  328. rangeLength,
  329. regExp,
  330. string: string$1,
  331. url,
  332. video
  333. }, Symbol.toStringTag, { value: "Module" }));
  334. function strip(num, precision = 15) {
  335. return +parseFloat(Number(num).toPrecision(precision));
  336. }
  337. function digitLength(num) {
  338. const eSplit = num.toString().split(/[eE]/);
  339. const len = (eSplit[0].split(".")[1] || "").length - +(eSplit[1] || 0);
  340. return len > 0 ? len : 0;
  341. }
  342. function float2Fixed(num) {
  343. if (num.toString().indexOf("e") === -1) {
  344. return Number(num.toString().replace(".", ""));
  345. }
  346. const dLen = digitLength(num);
  347. return dLen > 0 ? strip(Number(num) * Math.pow(10, dLen)) : Number(num);
  348. }
  349. function checkBoundary(num) {
  350. {
  351. if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
  352. formatAppLog("warn", "at uni_modules/uv-ui-tools/libs/function/digit.js:45", `${num} 超出了精度限制,结果可能不正确`);
  353. }
  354. }
  355. }
  356. function iteratorOperation(arr, operation) {
  357. const [num1, num2, ...others] = arr;
  358. let res = operation(num1, num2);
  359. others.forEach((num) => {
  360. res = operation(res, num);
  361. });
  362. return res;
  363. }
  364. function times(...nums) {
  365. if (nums.length > 2) {
  366. return iteratorOperation(nums, times);
  367. }
  368. const [num1, num2] = nums;
  369. const num1Changed = float2Fixed(num1);
  370. const num2Changed = float2Fixed(num2);
  371. const baseNum = digitLength(num1) + digitLength(num2);
  372. const leftValue = num1Changed * num2Changed;
  373. checkBoundary(leftValue);
  374. return leftValue / Math.pow(10, baseNum);
  375. }
  376. function divide(...nums) {
  377. if (nums.length > 2) {
  378. return iteratorOperation(nums, divide);
  379. }
  380. const [num1, num2] = nums;
  381. const num1Changed = float2Fixed(num1);
  382. const num2Changed = float2Fixed(num2);
  383. checkBoundary(num1Changed);
  384. checkBoundary(num2Changed);
  385. return times(num1Changed / num2Changed, strip(Math.pow(10, digitLength(num2) - digitLength(num1))));
  386. }
  387. function round(num, ratio2) {
  388. const base = Math.pow(10, ratio2);
  389. let result = divide(Math.round(Math.abs(times(num, base))), base);
  390. if (num < 0 && result !== 0) {
  391. result = times(result, -1);
  392. }
  393. return result;
  394. }
  395. function range$1(min = 0, max = 0, value2 = 0) {
  396. return Math.max(min, Math.min(max, Number(value2)));
  397. }
  398. function getPx(value2, unit = false) {
  399. if (number$2(value2)) {
  400. return unit ? `${value2}px` : Number(value2);
  401. }
  402. if (/(rpx|upx)$/.test(value2)) {
  403. return unit ? `${uni.upx2px(parseInt(value2))}px` : Number(uni.upx2px(parseInt(value2)));
  404. }
  405. return unit ? `${parseInt(value2)}px` : parseInt(value2);
  406. }
  407. function sleep(value2 = 30) {
  408. return new Promise((resolve) => {
  409. setTimeout(() => {
  410. resolve();
  411. }, value2);
  412. });
  413. }
  414. function os() {
  415. return uni.getSystemInfoSync().platform.toLowerCase();
  416. }
  417. function sys() {
  418. return uni.getSystemInfoSync();
  419. }
  420. function random(min, max) {
  421. if (min >= 0 && max > 0 && max >= min) {
  422. const gab = max - min + 1;
  423. return Math.floor(Math.random() * gab + min);
  424. }
  425. return 0;
  426. }
  427. function guid(len = 32, firstU = true, radix = null) {
  428. const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
  429. const uuid = [];
  430. radix = radix || chars.length;
  431. if (len) {
  432. for (let i = 0; i < len; i++)
  433. uuid[i] = chars[0 | Math.random() * radix];
  434. } else {
  435. let r;
  436. uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
  437. uuid[14] = "4";
  438. for (let i = 0; i < 36; i++) {
  439. if (!uuid[i]) {
  440. r = 0 | Math.random() * 16;
  441. uuid[i] = chars[i == 19 ? r & 3 | 8 : r];
  442. }
  443. }
  444. }
  445. if (firstU) {
  446. uuid.shift();
  447. return `u${uuid.join("")}`;
  448. }
  449. return uuid.join("");
  450. }
  451. function $parent(name = void 0) {
  452. let parent = this.$parent;
  453. while (parent) {
  454. if (parent.$options && parent.$options.name !== name) {
  455. parent = parent.$parent;
  456. } else {
  457. return parent;
  458. }
  459. }
  460. return false;
  461. }
  462. function addStyle(customStyle, target = "object") {
  463. if (empty(customStyle) || typeof customStyle === "object" && target === "object" || target === "string" && typeof customStyle === "string") {
  464. return customStyle;
  465. }
  466. if (target === "object") {
  467. customStyle = trim(customStyle);
  468. const styleArray = customStyle.split(";");
  469. const style = {};
  470. for (let i = 0; i < styleArray.length; i++) {
  471. if (styleArray[i]) {
  472. const item = styleArray[i].split(":");
  473. style[trim(item[0])] = trim(item[1]);
  474. }
  475. }
  476. return style;
  477. }
  478. let string2 = "";
  479. for (const i in customStyle) {
  480. const key = i.replace(/([A-Z])/g, "-$1").toLowerCase();
  481. string2 += `${key}:${customStyle[i]};`;
  482. }
  483. return trim(string2);
  484. }
  485. 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") {
  486. value2 = String(value2);
  487. return number$2(value2) ? `${value2}${unit}` : value2;
  488. }
  489. function deepClone(obj, cache2 = /* @__PURE__ */ new WeakMap()) {
  490. if (obj === null || typeof obj !== "object")
  491. return obj;
  492. if (cache2.has(obj))
  493. return cache2.get(obj);
  494. let clone;
  495. if (obj instanceof Date) {
  496. clone = new Date(obj.getTime());
  497. } else if (obj instanceof RegExp) {
  498. clone = new RegExp(obj);
  499. } else if (obj instanceof Map) {
  500. clone = new Map(Array.from(obj, ([key, value2]) => [key, deepClone(value2, cache2)]));
  501. } else if (obj instanceof Set) {
  502. clone = new Set(Array.from(obj, (value2) => deepClone(value2, cache2)));
  503. } else if (Array.isArray(obj)) {
  504. clone = obj.map((value2) => deepClone(value2, cache2));
  505. } else if (Object.prototype.toString.call(obj) === "[object Object]") {
  506. clone = Object.create(Object.getPrototypeOf(obj));
  507. cache2.set(obj, clone);
  508. for (const [key, value2] of Object.entries(obj)) {
  509. clone[key] = deepClone(value2, cache2);
  510. }
  511. } else {
  512. clone = Object.assign({}, obj);
  513. }
  514. cache2.set(obj, clone);
  515. return clone;
  516. }
  517. function deepMerge$1(target = {}, source = {}) {
  518. target = deepClone(target);
  519. if (typeof target !== "object" || target === null || typeof source !== "object" || source === null)
  520. return target;
  521. const merged = Array.isArray(target) ? target.slice() : Object.assign({}, target);
  522. for (const prop in source) {
  523. if (!source.hasOwnProperty(prop))
  524. continue;
  525. const sourceValue = source[prop];
  526. const targetValue = merged[prop];
  527. if (sourceValue instanceof Date) {
  528. merged[prop] = new Date(sourceValue);
  529. } else if (sourceValue instanceof RegExp) {
  530. merged[prop] = new RegExp(sourceValue);
  531. } else if (sourceValue instanceof Map) {
  532. merged[prop] = new Map(sourceValue);
  533. } else if (sourceValue instanceof Set) {
  534. merged[prop] = new Set(sourceValue);
  535. } else if (typeof sourceValue === "object" && sourceValue !== null) {
  536. merged[prop] = deepMerge$1(targetValue, sourceValue);
  537. } else {
  538. merged[prop] = sourceValue;
  539. }
  540. }
  541. return merged;
  542. }
  543. function error(err) {
  544. {
  545. formatAppLog("error", "at uni_modules/uv-ui-tools/libs/function/index.js:250", `uvui提示:${err}`);
  546. }
  547. }
  548. function randomArray(array2 = []) {
  549. return array2.sort(() => Math.random() - 0.5);
  550. }
  551. if (!String.prototype.padStart) {
  552. String.prototype.padStart = function(maxLength, fillString = " ") {
  553. if (Object.prototype.toString.call(fillString) !== "[object String]") {
  554. throw new TypeError(
  555. "fillString must be String"
  556. );
  557. }
  558. const str = this;
  559. if (str.length >= maxLength)
  560. return String(str);
  561. const fillLength = maxLength - str.length;
  562. let times2 = Math.ceil(fillLength / fillString.length);
  563. while (times2 >>= 1) {
  564. fillString += fillString;
  565. if (times2 === 1) {
  566. fillString += fillString;
  567. }
  568. }
  569. return fillString.slice(0, fillLength) + str;
  570. };
  571. }
  572. function timeFormat(dateTime = null, formatStr = "yyyy-mm-dd") {
  573. let date2;
  574. if (!dateTime) {
  575. date2 = /* @__PURE__ */ new Date();
  576. } else if (/^\d{10}$/.test(dateTime == null ? void 0 : dateTime.toString().trim())) {
  577. date2 = new Date(dateTime * 1e3);
  578. } else if (typeof dateTime === "string" && /^\d+$/.test(dateTime.trim())) {
  579. date2 = new Date(Number(dateTime));
  580. } else if (typeof dateTime === "string" && dateTime.includes("-") && !dateTime.includes("T")) {
  581. date2 = new Date(dateTime.replace(/-/g, "/"));
  582. } else {
  583. date2 = new Date(dateTime);
  584. }
  585. const timeSource = {
  586. "y": date2.getFullYear().toString(),
  587. // 年
  588. "m": (date2.getMonth() + 1).toString().padStart(2, "0"),
  589. // 月
  590. "d": date2.getDate().toString().padStart(2, "0"),
  591. // 日
  592. "h": date2.getHours().toString().padStart(2, "0"),
  593. // 时
  594. "M": date2.getMinutes().toString().padStart(2, "0"),
  595. // 分
  596. "s": date2.getSeconds().toString().padStart(2, "0")
  597. // 秒
  598. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  599. };
  600. for (const key in timeSource) {
  601. const [ret] = new RegExp(`${key}+`).exec(formatStr) || [];
  602. if (ret) {
  603. const beginIndex = key === "y" && ret.length === 2 ? 2 : 0;
  604. formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex));
  605. }
  606. }
  607. return formatStr;
  608. }
  609. function timeFrom(timestamp = null, format2 = "yyyy-mm-dd") {
  610. if (timestamp == null)
  611. timestamp = Number(/* @__PURE__ */ new Date());
  612. timestamp = parseInt(timestamp);
  613. if (timestamp.toString().length == 10)
  614. timestamp *= 1e3;
  615. let timer = (/* @__PURE__ */ new Date()).getTime() - timestamp;
  616. timer = parseInt(timer / 1e3);
  617. let tips = "";
  618. switch (true) {
  619. case timer < 300:
  620. tips = "刚刚";
  621. break;
  622. case (timer >= 300 && timer < 3600):
  623. tips = `${parseInt(timer / 60)}分钟前`;
  624. break;
  625. case (timer >= 3600 && timer < 86400):
  626. tips = `${parseInt(timer / 3600)}小时前`;
  627. break;
  628. case (timer >= 86400 && timer < 2592e3):
  629. tips = `${parseInt(timer / 86400)}天前`;
  630. break;
  631. default:
  632. if (format2 === false) {
  633. if (timer >= 2592e3 && timer < 365 * 86400) {
  634. tips = `${parseInt(timer / (86400 * 30))}个月前`;
  635. } else {
  636. tips = `${parseInt(timer / (86400 * 365))}年前`;
  637. }
  638. } else {
  639. tips = timeFormat(timestamp, format2);
  640. }
  641. }
  642. return tips;
  643. }
  644. function trim(str, pos = "both") {
  645. str = String(str);
  646. if (pos == "both") {
  647. return str.replace(/^\s+|\s+$/g, "");
  648. }
  649. if (pos == "left") {
  650. return str.replace(/^\s*/, "");
  651. }
  652. if (pos == "right") {
  653. return str.replace(/(\s*$)/g, "");
  654. }
  655. if (pos == "all") {
  656. return str.replace(/\s+/g, "");
  657. }
  658. return str;
  659. }
  660. function queryParams(data = {}, isPrefix = true, arrayFormat = "brackets") {
  661. const prefix = isPrefix ? "?" : "";
  662. const _result = [];
  663. if (["indices", "brackets", "repeat", "comma"].indexOf(arrayFormat) == -1)
  664. arrayFormat = "brackets";
  665. for (const key in data) {
  666. const value2 = data[key];
  667. if (["", void 0, null].indexOf(value2) >= 0) {
  668. continue;
  669. }
  670. if (value2.constructor === Array) {
  671. switch (arrayFormat) {
  672. case "indices":
  673. for (let i = 0; i < value2.length; i++) {
  674. _result.push(`${key}[${i}]=${value2[i]}`);
  675. }
  676. break;
  677. case "brackets":
  678. value2.forEach((_value) => {
  679. _result.push(`${key}[]=${_value}`);
  680. });
  681. break;
  682. case "repeat":
  683. value2.forEach((_value) => {
  684. _result.push(`${key}=${_value}`);
  685. });
  686. break;
  687. case "comma":
  688. let commaStr = "";
  689. value2.forEach((_value) => {
  690. commaStr += (commaStr ? "," : "") + _value;
  691. });
  692. _result.push(`${key}=${commaStr}`);
  693. break;
  694. default:
  695. value2.forEach((_value) => {
  696. _result.push(`${key}[]=${_value}`);
  697. });
  698. }
  699. } else {
  700. _result.push(`${key}=${value2}`);
  701. }
  702. }
  703. return _result.length ? prefix + _result.join("&") : "";
  704. }
  705. function toast(title, duration = 2e3) {
  706. uni.showToast({
  707. title: String(title),
  708. icon: "none",
  709. duration
  710. });
  711. }
  712. function type2icon(type2 = "success", fill = false) {
  713. if (["primary", "info", "error", "warning", "success"].indexOf(type2) == -1)
  714. type2 = "success";
  715. let iconName = "";
  716. switch (type2) {
  717. case "primary":
  718. iconName = "info-circle";
  719. break;
  720. case "info":
  721. iconName = "info-circle";
  722. break;
  723. case "error":
  724. iconName = "close-circle";
  725. break;
  726. case "warning":
  727. iconName = "error-circle";
  728. break;
  729. case "success":
  730. iconName = "checkmark-circle";
  731. break;
  732. default:
  733. iconName = "checkmark-circle";
  734. }
  735. if (fill)
  736. iconName += "-fill";
  737. return iconName;
  738. }
  739. function priceFormat(number2, decimals = 0, decimalPoint = ".", thousandsSeparator = ",") {
  740. number2 = `${number2}`.replace(/[^0-9+-Ee.]/g, "");
  741. const n2 = !isFinite(+number2) ? 0 : +number2;
  742. const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
  743. const sep = typeof thousandsSeparator === "undefined" ? "," : thousandsSeparator;
  744. const dec = typeof decimalPoint === "undefined" ? "." : decimalPoint;
  745. let s = "";
  746. s = (prec ? round(n2, prec) + "" : `${Math.round(n2)}`).split(".");
  747. const re = /(-?\d+)(\d{3})/;
  748. while (re.test(s[0])) {
  749. s[0] = s[0].replace(re, `$1${sep}$2`);
  750. }
  751. if ((s[1] || "").length < prec) {
  752. s[1] = s[1] || "";
  753. s[1] += new Array(prec - s[1].length + 1).join("0");
  754. }
  755. return s.join(dec);
  756. }
  757. function getDuration(value2, unit = true) {
  758. const valueNum = parseInt(value2);
  759. if (unit) {
  760. if (/s$/.test(value2))
  761. return value2;
  762. return value2 > 30 ? `${value2}ms` : `${value2}s`;
  763. }
  764. if (/ms$/.test(value2))
  765. return valueNum;
  766. if (/s$/.test(value2))
  767. return valueNum > 30 ? valueNum : valueNum * 1e3;
  768. return valueNum;
  769. }
  770. function padZero(value2) {
  771. return `00${value2}`.slice(-2);
  772. }
  773. function formValidate(instance, event) {
  774. const formItem = $parent.call(instance, "uv-form-item");
  775. const form = $parent.call(instance, "uv-form");
  776. if (formItem && form) {
  777. form.validateField(formItem.prop, () => {
  778. }, event);
  779. }
  780. }
  781. function getProperty(obj, key) {
  782. if (!obj) {
  783. return;
  784. }
  785. if (typeof key !== "string" || key === "") {
  786. return "";
  787. }
  788. if (key.indexOf(".") !== -1) {
  789. const keys = key.split(".");
  790. let firstObj = obj[keys[0]] || {};
  791. for (let i = 1; i < keys.length; i++) {
  792. if (firstObj) {
  793. firstObj = firstObj[keys[i]];
  794. }
  795. }
  796. return firstObj;
  797. }
  798. return obj[key];
  799. }
  800. function setProperty(obj, key, value2) {
  801. if (!obj) {
  802. return;
  803. }
  804. const inFn = function(_obj, keys, v) {
  805. if (keys.length === 1) {
  806. _obj[keys[0]] = v;
  807. return;
  808. }
  809. while (keys.length > 1) {
  810. const k = keys[0];
  811. if (!_obj[k] || typeof _obj[k] !== "object") {
  812. _obj[k] = {};
  813. }
  814. keys.shift();
  815. inFn(_obj[k], keys, v);
  816. }
  817. };
  818. if (typeof key !== "string" || key === "")
  819. ;
  820. else if (key.indexOf(".") !== -1) {
  821. const keys = key.split(".");
  822. inFn(obj, keys, value2);
  823. } else {
  824. obj[key] = value2;
  825. }
  826. }
  827. function page() {
  828. var _a;
  829. const pages2 = getCurrentPages();
  830. const route2 = (_a = pages2[pages2.length - 1]) == null ? void 0 : _a.route;
  831. return `/${route2 ? route2 : ""}`;
  832. }
  833. function pages() {
  834. const pages2 = getCurrentPages();
  835. return pages2;
  836. }
  837. function getHistoryPage(back = 0) {
  838. const pages2 = getCurrentPages();
  839. const len = pages2.length;
  840. return pages2[len - 1 + back];
  841. }
  842. function setConfig({
  843. props: props2 = {},
  844. config: config2 = {},
  845. color = {},
  846. zIndex = {}
  847. }) {
  848. const {
  849. deepMerge: deepMerge2
  850. } = uni.$uv;
  851. uni.$uv.config = deepMerge2(uni.$uv.config, config2);
  852. uni.$uv.props = deepMerge2(uni.$uv.props, props2);
  853. uni.$uv.color = deepMerge2(uni.$uv.color, color);
  854. uni.$uv.zIndex = deepMerge2(uni.$uv.zIndex, zIndex);
  855. }
  856. const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  857. __proto__: null,
  858. $parent,
  859. addStyle,
  860. addUnit,
  861. deepClone,
  862. deepMerge: deepMerge$1,
  863. error,
  864. formValidate,
  865. getDuration,
  866. getHistoryPage,
  867. getProperty,
  868. getPx,
  869. guid,
  870. os,
  871. padZero,
  872. page,
  873. pages,
  874. priceFormat,
  875. queryParams,
  876. random,
  877. randomArray,
  878. range: range$1,
  879. setConfig,
  880. setProperty,
  881. sleep,
  882. sys,
  883. timeFormat,
  884. timeFrom,
  885. toast,
  886. trim,
  887. type2icon
  888. }, Symbol.toStringTag, { value: "Module" }));
  889. class Router {
  890. constructor() {
  891. this.config = {
  892. type: "navigateTo",
  893. url: "",
  894. delta: 1,
  895. // navigateBack页面后退时,回退的层数
  896. params: {},
  897. // 传递的参数
  898. animationType: "pop-in",
  899. // 窗口动画,只在APP有效
  900. animationDuration: 300,
  901. // 窗口动画持续时间,单位毫秒,只在APP有效
  902. intercept: false,
  903. // 是否需要拦截
  904. events: {}
  905. // 页面间通信接口,用于监听被打开页面发送到当前页面的数据。hbuilderx 2.8.9+ 开始支持。
  906. };
  907. this.route = this.route.bind(this);
  908. }
  909. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  910. addRootPath(url2) {
  911. return url2[0] === "/" ? url2 : `/${url2}`;
  912. }
  913. // 整合路由参数
  914. mixinParam(url2, params) {
  915. url2 = url2 && this.addRootPath(url2);
  916. let query = "";
  917. if (/.*\/.*\?.*=.*/.test(url2)) {
  918. query = queryParams(params, false);
  919. return url2 += `&${query}`;
  920. }
  921. query = queryParams(params);
  922. return url2 += query;
  923. }
  924. // 对外的方法名称
  925. async route(options = {}, params = {}) {
  926. let mergeConfig = {};
  927. if (typeof options === "string") {
  928. mergeConfig.url = this.mixinParam(options, params);
  929. mergeConfig.type = "navigateTo";
  930. } else {
  931. mergeConfig = deepMerge$1(this.config, options);
  932. mergeConfig.url = this.mixinParam(options.url, options.params);
  933. }
  934. if (mergeConfig.url === page())
  935. return;
  936. if (params.intercept) {
  937. mergeConfig.intercept = params.intercept;
  938. }
  939. mergeConfig.params = params;
  940. mergeConfig = deepMerge$1(this.config, mergeConfig);
  941. if (typeof mergeConfig.intercept === "function") {
  942. const isNext = await new Promise((resolve, reject) => {
  943. mergeConfig.intercept(mergeConfig, resolve);
  944. });
  945. isNext && this.openPage(mergeConfig);
  946. } else {
  947. this.openPage(mergeConfig);
  948. }
  949. }
  950. // 执行路由跳转
  951. openPage(config2) {
  952. const {
  953. url: url2,
  954. type: type2,
  955. delta,
  956. animationType,
  957. animationDuration,
  958. events
  959. } = config2;
  960. if (config2.type == "navigateTo" || config2.type == "to") {
  961. uni.navigateTo({
  962. url: url2,
  963. animationType,
  964. animationDuration,
  965. events
  966. });
  967. }
  968. if (config2.type == "redirectTo" || config2.type == "redirect") {
  969. uni.redirectTo({
  970. url: url2
  971. });
  972. }
  973. if (config2.type == "switchTab" || config2.type == "tab") {
  974. uni.switchTab({
  975. url: url2
  976. });
  977. }
  978. if (config2.type == "reLaunch" || config2.type == "launch") {
  979. uni.reLaunch({
  980. url: url2
  981. });
  982. }
  983. if (config2.type == "navigateBack" || config2.type == "back") {
  984. uni.navigateBack({
  985. delta
  986. });
  987. }
  988. }
  989. }
  990. const route = new Router().route;
  991. let timeout = null;
  992. function debounce(func2, wait = 500, immediate = false) {
  993. if (timeout !== null)
  994. clearTimeout(timeout);
  995. if (immediate) {
  996. const callNow = !timeout;
  997. timeout = setTimeout(() => {
  998. timeout = null;
  999. }, wait);
  1000. if (callNow)
  1001. typeof func2 === "function" && func2();
  1002. } else {
  1003. timeout = setTimeout(() => {
  1004. typeof func2 === "function" && func2();
  1005. }, wait);
  1006. }
  1007. }
  1008. let flag;
  1009. function throttle(func2, wait = 500, immediate = true) {
  1010. if (immediate) {
  1011. if (!flag) {
  1012. flag = true;
  1013. typeof func2 === "function" && func2();
  1014. setTimeout(() => {
  1015. flag = false;
  1016. }, wait);
  1017. }
  1018. } else if (!flag) {
  1019. flag = true;
  1020. setTimeout(() => {
  1021. flag = false;
  1022. typeof func2 === "function" && func2();
  1023. }, wait);
  1024. }
  1025. }
  1026. const mixin = {
  1027. // 定义每个组件都可能需要用到的外部样式以及类名
  1028. props: {
  1029. // 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
  1030. customStyle: {
  1031. type: [Object, String],
  1032. default: () => ({})
  1033. },
  1034. customClass: {
  1035. type: String,
  1036. default: ""
  1037. },
  1038. // 跳转的页面路径
  1039. url: {
  1040. type: String,
  1041. default: ""
  1042. },
  1043. // 页面跳转的类型
  1044. linkType: {
  1045. type: String,
  1046. default: "navigateTo"
  1047. }
  1048. },
  1049. data() {
  1050. return {};
  1051. },
  1052. onLoad() {
  1053. this.$uv.getRect = this.$uvGetRect;
  1054. },
  1055. created() {
  1056. this.$uv.getRect = this.$uvGetRect;
  1057. },
  1058. computed: {
  1059. $uv() {
  1060. var _a, _b;
  1061. return {
  1062. ...index,
  1063. test,
  1064. route,
  1065. debounce,
  1066. throttle,
  1067. unit: (_b = (_a = uni == null ? void 0 : uni.$uv) == null ? void 0 : _a.config) == null ? void 0 : _b.unit
  1068. };
  1069. },
  1070. /**
  1071. * 生成bem规则类名
  1072. * 由于微信小程序,H5,nvue之间绑定class的差异,无法通过:class="[bem()]"的形式进行同用
  1073. * 故采用如下折中做法,最后返回的是数组(一般平台)或字符串(支付宝和字节跳动平台),类似['a', 'b', 'c']或'a b c'的形式
  1074. * @param {String} name 组件名称
  1075. * @param {Array} fixed 一直会存在的类名
  1076. * @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名
  1077. * @returns {Array|string}
  1078. */
  1079. bem() {
  1080. return function(name, fixed, change) {
  1081. const prefix = `uv-${name}--`;
  1082. const classes = {};
  1083. if (fixed) {
  1084. fixed.map((item) => {
  1085. classes[prefix + this[item]] = true;
  1086. });
  1087. }
  1088. if (change) {
  1089. change.map((item) => {
  1090. this[item] ? classes[prefix + item] = this[item] : delete classes[prefix + item];
  1091. });
  1092. }
  1093. return Object.keys(classes);
  1094. };
  1095. }
  1096. },
  1097. methods: {
  1098. // 跳转某一个页面
  1099. openPage(urlKey = "url") {
  1100. const url2 = this[urlKey];
  1101. if (url2) {
  1102. uni[this.linkType]({
  1103. url: url2
  1104. });
  1105. }
  1106. },
  1107. // 查询节点信息
  1108. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  1109. // 解决办法为在组件根部再套一个没有任何作用的view元素
  1110. $uvGetRect(selector, all) {
  1111. return new Promise((resolve) => {
  1112. uni.createSelectorQuery().in(this)[all ? "selectAll" : "select"](selector).boundingClientRect((rect) => {
  1113. if (all && Array.isArray(rect) && rect.length) {
  1114. resolve(rect);
  1115. }
  1116. if (!all && rect) {
  1117. resolve(rect);
  1118. }
  1119. }).exec();
  1120. });
  1121. },
  1122. getParentData(parentName = "") {
  1123. if (!this.parent)
  1124. this.parent = {};
  1125. this.parent = this.$uv.$parent.call(this, parentName);
  1126. if (this.parent.children) {
  1127. this.parent.children.indexOf(this) === -1 && this.parent.children.push(this);
  1128. }
  1129. if (this.parent && this.parentData) {
  1130. Object.keys(this.parentData).map((key) => {
  1131. this.parentData[key] = this.parent[key];
  1132. });
  1133. }
  1134. },
  1135. // 阻止事件冒泡
  1136. preventEvent(e) {
  1137. e && typeof e.stopPropagation === "function" && e.stopPropagation();
  1138. },
  1139. // 空操作
  1140. noop(e) {
  1141. this.preventEvent(e);
  1142. }
  1143. },
  1144. onReachBottom() {
  1145. uni.$emit("uvOnReachBottom");
  1146. },
  1147. beforeDestroy() {
  1148. if (this.parent && array$1(this.parent.children)) {
  1149. const childrenList = this.parent.children;
  1150. childrenList.map((child, index2) => {
  1151. if (child === this) {
  1152. childrenList.splice(index2, 1);
  1153. }
  1154. });
  1155. }
  1156. },
  1157. // 兼容vue3
  1158. unmounted() {
  1159. if (this.parent && array$1(this.parent.children)) {
  1160. const childrenList = this.parent.children;
  1161. childrenList.map((child, index2) => {
  1162. if (child === this) {
  1163. childrenList.splice(index2, 1);
  1164. }
  1165. });
  1166. }
  1167. }
  1168. };
  1169. class MPAnimation {
  1170. constructor(options, _this) {
  1171. this.options = options;
  1172. this.animation = uni.createAnimation({
  1173. ...options
  1174. });
  1175. this.currentStepAnimates = {};
  1176. this.next = 0;
  1177. this.$ = _this;
  1178. }
  1179. _nvuePushAnimates(type2, args) {
  1180. let aniObj = this.currentStepAnimates[this.next];
  1181. let styles = {};
  1182. if (!aniObj) {
  1183. styles = {
  1184. styles: {},
  1185. config: {}
  1186. };
  1187. } else {
  1188. styles = aniObj;
  1189. }
  1190. if (animateTypes1.includes(type2)) {
  1191. if (!styles.styles.transform) {
  1192. styles.styles.transform = "";
  1193. }
  1194. let unit = "";
  1195. if (type2 === "rotate") {
  1196. unit = "deg";
  1197. }
  1198. styles.styles.transform += `${type2}(${args + unit}) `;
  1199. } else {
  1200. styles.styles[type2] = `${args}`;
  1201. }
  1202. this.currentStepAnimates[this.next] = styles;
  1203. }
  1204. _animateRun(styles = {}, config2 = {}) {
  1205. let ref = this.$.$refs["ani"].ref;
  1206. if (!ref)
  1207. return;
  1208. return new Promise((resolve, reject) => {
  1209. nvueAnimation.transition(ref, {
  1210. styles,
  1211. ...config2
  1212. }, (res) => {
  1213. resolve();
  1214. });
  1215. });
  1216. }
  1217. _nvueNextAnimate(animates, step = 0, fn) {
  1218. let obj = animates[step];
  1219. if (obj) {
  1220. let {
  1221. styles,
  1222. config: config2
  1223. } = obj;
  1224. this._animateRun(styles, config2).then(() => {
  1225. step += 1;
  1226. this._nvueNextAnimate(animates, step, fn);
  1227. });
  1228. } else {
  1229. this.currentStepAnimates = {};
  1230. typeof fn === "function" && fn();
  1231. this.isEnd = true;
  1232. }
  1233. }
  1234. step(config2 = {}) {
  1235. this.animation.step(config2);
  1236. return this;
  1237. }
  1238. run(fn) {
  1239. this.$.animationData = this.animation.export();
  1240. this.$.timer = setTimeout(() => {
  1241. typeof fn === "function" && fn();
  1242. }, this.$.durationTime);
  1243. }
  1244. }
  1245. const animateTypes1 = [
  1246. "matrix",
  1247. "matrix3d",
  1248. "rotate",
  1249. "rotate3d",
  1250. "rotateX",
  1251. "rotateY",
  1252. "rotateZ",
  1253. "scale",
  1254. "scale3d",
  1255. "scaleX",
  1256. "scaleY",
  1257. "scaleZ",
  1258. "skew",
  1259. "skewX",
  1260. "skewY",
  1261. "translate",
  1262. "translate3d",
  1263. "translateX",
  1264. "translateY",
  1265. "translateZ"
  1266. ];
  1267. const animateTypes2 = ["opacity", "backgroundColor"];
  1268. const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
  1269. animateTypes1.concat(animateTypes2, animateTypes3).forEach((type2) => {
  1270. MPAnimation.prototype[type2] = function(...args) {
  1271. this.animation[type2](...args);
  1272. return this;
  1273. };
  1274. });
  1275. function createAnimation(option, _this) {
  1276. if (!_this)
  1277. return;
  1278. clearTimeout(_this.timer);
  1279. return new MPAnimation(option, _this);
  1280. }
  1281. const _sfc_main$C = {
  1282. name: "uv-transition",
  1283. mixins: [mpMixin, mixin],
  1284. emits: ["click", "change"],
  1285. props: {
  1286. // 是否展示组件
  1287. show: {
  1288. type: Boolean,
  1289. default: false
  1290. },
  1291. // 使用的动画模式
  1292. mode: {
  1293. type: [Array, String, null],
  1294. default() {
  1295. return "fade";
  1296. }
  1297. },
  1298. // 动画的执行时间,单位ms
  1299. duration: {
  1300. type: [String, Number],
  1301. default: 300
  1302. },
  1303. // 使用的动画过渡函数
  1304. timingFunction: {
  1305. type: String,
  1306. default: "ease-out"
  1307. },
  1308. customClass: {
  1309. type: String,
  1310. default: ""
  1311. },
  1312. // nvue模式下 是否直接显示,在uv-list等cell下面使用就需要设置
  1313. cellChild: {
  1314. type: Boolean,
  1315. default: false
  1316. }
  1317. },
  1318. data() {
  1319. return {
  1320. isShow: false,
  1321. transform: "",
  1322. opacity: 1,
  1323. animationData: {},
  1324. durationTime: 300,
  1325. config: {}
  1326. };
  1327. },
  1328. watch: {
  1329. show: {
  1330. handler(newVal) {
  1331. if (newVal) {
  1332. this.open();
  1333. } else {
  1334. if (this.isShow) {
  1335. this.close();
  1336. }
  1337. }
  1338. },
  1339. immediate: true
  1340. }
  1341. },
  1342. computed: {
  1343. // 初始化动画条件
  1344. transformStyles() {
  1345. const style = {
  1346. transform: this.transform,
  1347. opacity: this.opacity,
  1348. ...this.$uv.addStyle(this.customStyle),
  1349. "transition-duration": `${this.duration / 1e3}s`
  1350. };
  1351. return this.$uv.addStyle(style, "string");
  1352. }
  1353. },
  1354. created() {
  1355. this.config = {
  1356. duration: this.duration,
  1357. timingFunction: this.timingFunction,
  1358. transformOrigin: "50% 50%",
  1359. delay: 0
  1360. };
  1361. this.durationTime = this.duration;
  1362. },
  1363. methods: {
  1364. /**
  1365. * ref 触发 初始化动画
  1366. */
  1367. init(obj = {}) {
  1368. if (obj.duration) {
  1369. this.durationTime = obj.duration;
  1370. }
  1371. this.animation = createAnimation(Object.assign(this.config, obj), this);
  1372. },
  1373. /**
  1374. * 点击组件触发回调
  1375. */
  1376. onClick() {
  1377. this.$emit("click", {
  1378. detail: this.isShow
  1379. });
  1380. },
  1381. /**
  1382. * ref 触发 动画分组
  1383. * @param {Object} obj
  1384. */
  1385. step(obj, config2 = {}) {
  1386. if (!this.animation)
  1387. return;
  1388. for (let i in obj) {
  1389. try {
  1390. if (typeof obj[i] === "object") {
  1391. this.animation[i](...obj[i]);
  1392. } else {
  1393. this.animation[i](obj[i]);
  1394. }
  1395. } catch (e) {
  1396. formatAppLog("error", "at uni_modules/uv-transition/components/uv-transition/uv-transition.vue:166", `方法 ${i} 不存在`);
  1397. }
  1398. }
  1399. this.animation.step(config2);
  1400. return this;
  1401. },
  1402. /**
  1403. * ref 触发 执行动画
  1404. */
  1405. run(fn) {
  1406. if (!this.animation)
  1407. return;
  1408. this.animation.run(fn);
  1409. },
  1410. // 开始过度动画
  1411. open() {
  1412. clearTimeout(this.timer);
  1413. this.transform = "";
  1414. this.isShow = true;
  1415. let { opacity, transform } = this.styleInit(false);
  1416. if (typeof opacity !== "undefined") {
  1417. this.opacity = opacity;
  1418. }
  1419. this.transform = transform;
  1420. this.$nextTick(() => {
  1421. this.timer = setTimeout(() => {
  1422. this.animation = createAnimation(this.config, this);
  1423. this.tranfromInit(false).step();
  1424. this.animation.run();
  1425. this.$emit("change", {
  1426. detail: this.isShow
  1427. });
  1428. }, 20);
  1429. });
  1430. },
  1431. // 关闭过渡动画
  1432. close(type2) {
  1433. if (!this.animation)
  1434. return;
  1435. this.tranfromInit(true).step().run(() => {
  1436. this.isShow = false;
  1437. this.animationData = null;
  1438. this.animation = null;
  1439. let { opacity, transform } = this.styleInit(false);
  1440. this.opacity = opacity || 1;
  1441. this.transform = transform;
  1442. this.$emit("change", {
  1443. detail: this.isShow
  1444. });
  1445. });
  1446. },
  1447. // 处理动画开始前的默认样式
  1448. styleInit(type2) {
  1449. let styles = {
  1450. transform: ""
  1451. };
  1452. let buildStyle = (type3, mode) => {
  1453. if (mode === "fade") {
  1454. styles.opacity = this.animationType(type3)[mode];
  1455. } else {
  1456. styles.transform += this.animationType(type3)[mode] + " ";
  1457. }
  1458. };
  1459. if (typeof this.mode === "string") {
  1460. buildStyle(type2, this.mode);
  1461. } else {
  1462. this.mode.forEach((mode) => {
  1463. buildStyle(type2, mode);
  1464. });
  1465. }
  1466. return styles;
  1467. },
  1468. // 处理内置组合动画
  1469. tranfromInit(type2) {
  1470. let buildTranfrom = (type3, mode) => {
  1471. let aniNum = null;
  1472. if (mode === "fade") {
  1473. aniNum = type3 ? 0 : 1;
  1474. } else {
  1475. aniNum = type3 ? "-100%" : "0";
  1476. if (mode === "zoom-in") {
  1477. aniNum = type3 ? 0.8 : 1;
  1478. }
  1479. if (mode === "zoom-out") {
  1480. aniNum = type3 ? 1.2 : 1;
  1481. }
  1482. if (mode === "slide-right") {
  1483. aniNum = type3 ? "100%" : "0";
  1484. }
  1485. if (mode === "slide-bottom") {
  1486. aniNum = type3 ? "100%" : "0";
  1487. }
  1488. }
  1489. this.animation[this.animationMode()[mode]](aniNum);
  1490. };
  1491. if (typeof this.mode === "string") {
  1492. buildTranfrom(type2, this.mode);
  1493. } else {
  1494. this.mode.forEach((mode) => {
  1495. buildTranfrom(type2, mode);
  1496. });
  1497. }
  1498. return this.animation;
  1499. },
  1500. animationType(type2) {
  1501. return {
  1502. fade: type2 ? 1 : 0,
  1503. "slide-top": `translateY(${type2 ? "0" : "-100%"})`,
  1504. "slide-right": `translateX(${type2 ? "0" : "100%"})`,
  1505. "slide-bottom": `translateY(${type2 ? "0" : "100%"})`,
  1506. "slide-left": `translateX(${type2 ? "0" : "-100%"})`,
  1507. "zoom-in": `scaleX(${type2 ? 1 : 0.8}) scaleY(${type2 ? 1 : 0.8})`,
  1508. "zoom-out": `scaleX(${type2 ? 1 : 1.2}) scaleY(${type2 ? 1 : 1.2})`
  1509. };
  1510. },
  1511. // 内置动画类型与实际动画对应字典
  1512. animationMode() {
  1513. return {
  1514. fade: "opacity",
  1515. "slide-top": "translateY",
  1516. "slide-right": "translateX",
  1517. "slide-bottom": "translateY",
  1518. "slide-left": "translateX",
  1519. "zoom-in": "scale",
  1520. "zoom-out": "scale"
  1521. };
  1522. },
  1523. // 驼峰转中横线
  1524. toLine(name) {
  1525. return name.replace(/([A-Z])/g, "-$1").toLowerCase();
  1526. }
  1527. }
  1528. };
  1529. function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
  1530. return $data.isShow ? (vue.openBlock(), vue.createElementBlock("view", {
  1531. key: 0,
  1532. ref: "ani",
  1533. animation: $data.animationData,
  1534. class: vue.normalizeClass($props.customClass),
  1535. style: vue.normalizeStyle($options.transformStyles),
  1536. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  1537. }, [
  1538. vue.renderSlot(_ctx.$slots, "default")
  1539. ], 14, ["animation"])) : vue.createCommentVNode("v-if", true);
  1540. }
  1541. 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"]]);
  1542. const props$i = {
  1543. props: {
  1544. // 是否显示遮罩
  1545. show: {
  1546. type: Boolean,
  1547. default: false
  1548. },
  1549. // 层级z-index
  1550. zIndex: {
  1551. type: [String, Number],
  1552. default: 10070
  1553. },
  1554. // 遮罩的过渡时间,单位为ms
  1555. duration: {
  1556. type: [String, Number],
  1557. default: 300
  1558. },
  1559. // 不透明度值,当做rgba的第四个参数
  1560. opacity: {
  1561. type: [String, Number],
  1562. default: 0.5
  1563. },
  1564. ...(_f = (_e = uni.$uv) == null ? void 0 : _e.props) == null ? void 0 : _f.overlay
  1565. }
  1566. };
  1567. const _sfc_main$B = {
  1568. name: "uv-overlay",
  1569. emits: ["click"],
  1570. mixins: [mpMixin, mixin, props$i],
  1571. watch: {
  1572. show(newVal) {
  1573. }
  1574. },
  1575. computed: {
  1576. overlayStyle() {
  1577. const style = {
  1578. position: "fixed",
  1579. top: 0,
  1580. left: 0,
  1581. right: 0,
  1582. zIndex: this.zIndex,
  1583. bottom: 0,
  1584. "background-color": `rgba(0, 0, 0, ${this.opacity})`
  1585. };
  1586. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  1587. }
  1588. },
  1589. methods: {
  1590. clickHandler() {
  1591. this.$emit("click");
  1592. },
  1593. clear() {
  1594. }
  1595. }
  1596. };
  1597. function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
  1598. const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
  1599. return vue.openBlock(), vue.createBlock(_component_uv_transition, {
  1600. show: _ctx.show,
  1601. mode: "fade",
  1602. "custom-class": "uv-overlay",
  1603. duration: _ctx.duration,
  1604. "custom-style": $options.overlayStyle,
  1605. onClick: $options.clickHandler,
  1606. onTouchmove: vue.withModifiers($options.clear, ["stop", "prevent"])
  1607. }, {
  1608. default: vue.withCtx(() => [
  1609. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  1610. ]),
  1611. _: 3
  1612. /* FORWARDED */
  1613. }, 8, ["show", "duration", "custom-style", "onClick", "onTouchmove"]);
  1614. }
  1615. 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"]]);
  1616. function colorGradient(startColor = "rgb(0, 0, 0)", endColor = "rgb(255, 255, 255)", step = 10) {
  1617. const startRGB = hexToRgb(startColor, false);
  1618. const startR = startRGB[0];
  1619. const startG = startRGB[1];
  1620. const startB = startRGB[2];
  1621. const endRGB = hexToRgb(endColor, false);
  1622. const endR = endRGB[0];
  1623. const endG = endRGB[1];
  1624. const endB = endRGB[2];
  1625. const sR = (endR - startR) / step;
  1626. const sG = (endG - startG) / step;
  1627. const sB = (endB - startB) / step;
  1628. const colorArr = [];
  1629. for (let i = 0; i < step; i++) {
  1630. let hex = rgbToHex(`rgb(${Math.round(sR * i + startR)},${Math.round(sG * i + startG)},${Math.round(sB * i + startB)})`);
  1631. if (i === 0)
  1632. hex = rgbToHex(startColor);
  1633. if (i === step - 1)
  1634. hex = rgbToHex(endColor);
  1635. colorArr.push(hex);
  1636. }
  1637. return colorArr;
  1638. }
  1639. function hexToRgb(sColor, str = true) {
  1640. const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  1641. sColor = String(sColor).toLowerCase();
  1642. if (sColor && reg.test(sColor)) {
  1643. if (sColor.length === 4) {
  1644. let sColorNew = "#";
  1645. for (let i = 1; i < 4; i += 1) {
  1646. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  1647. }
  1648. sColor = sColorNew;
  1649. }
  1650. const sColorChange = [];
  1651. for (let i = 1; i < 7; i += 2) {
  1652. sColorChange.push(parseInt(`0x${sColor.slice(i, i + 2)}`));
  1653. }
  1654. if (!str) {
  1655. return sColorChange;
  1656. }
  1657. return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`;
  1658. }
  1659. if (/^(rgb|RGB)/.test(sColor)) {
  1660. const arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  1661. return arr.map((val) => Number(val));
  1662. }
  1663. return sColor;
  1664. }
  1665. function rgbToHex(rgb) {
  1666. const _this = rgb;
  1667. const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  1668. if (/^(rgb|RGB)/.test(_this)) {
  1669. const aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  1670. let strHex = "#";
  1671. for (let i = 0; i < aColor.length; i++) {
  1672. let hex = Number(aColor[i]).toString(16);
  1673. hex = String(hex).length == 1 ? `${0}${hex}` : hex;
  1674. if (hex === "0") {
  1675. hex += hex;
  1676. }
  1677. strHex += hex;
  1678. }
  1679. if (strHex.length !== 7) {
  1680. strHex = _this;
  1681. }
  1682. return strHex;
  1683. }
  1684. if (reg.test(_this)) {
  1685. const aNum = _this.replace(/#/, "").split("");
  1686. if (aNum.length === 6) {
  1687. return _this;
  1688. }
  1689. if (aNum.length === 3) {
  1690. let numHex = "#";
  1691. for (let i = 0; i < aNum.length; i += 1) {
  1692. numHex += aNum[i] + aNum[i];
  1693. }
  1694. return numHex;
  1695. }
  1696. } else {
  1697. return _this;
  1698. }
  1699. }
  1700. const props$h = {
  1701. props: {
  1702. // 是否显示组件
  1703. show: {
  1704. type: Boolean,
  1705. default: true
  1706. },
  1707. // 颜色
  1708. color: {
  1709. type: String,
  1710. default: "#909193"
  1711. },
  1712. // 提示文字颜色
  1713. textColor: {
  1714. type: String,
  1715. default: "#909193"
  1716. },
  1717. // 文字和图标是否垂直排列
  1718. vertical: {
  1719. type: Boolean,
  1720. default: false
  1721. },
  1722. // 模式选择,circle-圆形,spinner-花朵形,semicircle-半圆形
  1723. mode: {
  1724. type: String,
  1725. default: "spinner"
  1726. },
  1727. // 图标大小,单位默认px
  1728. size: {
  1729. type: [String, Number],
  1730. default: 24
  1731. },
  1732. // 文字大小
  1733. textSize: {
  1734. type: [String, Number],
  1735. default: 15
  1736. },
  1737. // 文字样式
  1738. textStyle: {
  1739. type: Object,
  1740. default() {
  1741. return {};
  1742. }
  1743. },
  1744. // 文字内容
  1745. text: {
  1746. type: [String, Number],
  1747. default: ""
  1748. },
  1749. // 动画模式 https://www.runoob.com/cssref/css3-pr-animation-timing-function.html
  1750. timingFunction: {
  1751. type: String,
  1752. default: "linear"
  1753. },
  1754. // 动画执行周期时间
  1755. duration: {
  1756. type: [String, Number],
  1757. default: 1200
  1758. },
  1759. // mode=circle时的暗边颜色
  1760. inactiveColor: {
  1761. type: String,
  1762. default: ""
  1763. },
  1764. ...(_h = (_g = uni.$uv) == null ? void 0 : _g.props) == null ? void 0 : _h.loadingIcon
  1765. }
  1766. };
  1767. const _sfc_main$A = {
  1768. name: "uv-loading-icon",
  1769. mixins: [mpMixin, mixin, props$h],
  1770. data() {
  1771. return {
  1772. // Array.form可以通过一个伪数组对象创建指定长度的数组
  1773. // https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/from
  1774. array12: Array.from({
  1775. length: 12
  1776. }),
  1777. // 这里需要设置默认值为360,否则在安卓nvue上,会延迟一个duration周期后才执行
  1778. // 在iOS nvue上,则会一开始默认执行两个周期的动画
  1779. aniAngel: 360,
  1780. // 动画旋转角度
  1781. webviewHide: false,
  1782. // 监听webview的状态,如果隐藏了页面,则停止动画,以免性能消耗
  1783. loading: false
  1784. // 是否运行中,针对nvue使用
  1785. };
  1786. },
  1787. computed: {
  1788. // 当为circle类型时,给其另外三边设置一个更轻一些的颜色
  1789. // 之所以需要这么做的原因是,比如父组件传了color为红色,那么需要另外的三个边为浅红色
  1790. // 而不能是固定的某一个其他颜色(因为这个固定的颜色可能浅蓝,导致效果没有那么细腻良好)
  1791. otherBorderColor() {
  1792. const lightColor = colorGradient(this.color, "#ffffff", 100)[80];
  1793. if (this.mode === "circle") {
  1794. return this.inactiveColor ? this.inactiveColor : lightColor;
  1795. } else {
  1796. return "transparent";
  1797. }
  1798. }
  1799. },
  1800. watch: {
  1801. show(n2) {
  1802. }
  1803. },
  1804. mounted() {
  1805. this.init();
  1806. },
  1807. methods: {
  1808. init() {
  1809. setTimeout(() => {
  1810. this.show && this.addEventListenerToWebview();
  1811. }, 20);
  1812. },
  1813. // 监听webview的显示与隐藏
  1814. addEventListenerToWebview() {
  1815. const pages2 = getCurrentPages();
  1816. const page2 = pages2[pages2.length - 1];
  1817. const currentWebview = page2.$getAppWebview();
  1818. currentWebview.addEventListener("hide", () => {
  1819. this.webviewHide = true;
  1820. });
  1821. currentWebview.addEventListener("show", () => {
  1822. this.webviewHide = false;
  1823. });
  1824. }
  1825. }
  1826. };
  1827. function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
  1828. return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
  1829. "view",
  1830. {
  1831. key: 0,
  1832. class: vue.normalizeClass(["uv-loading-icon", [_ctx.vertical && "uv-loading-icon--vertical"]]),
  1833. style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle)])
  1834. },
  1835. [
  1836. !$data.webviewHide ? (vue.openBlock(), vue.createElementBlock(
  1837. "view",
  1838. {
  1839. key: 0,
  1840. class: vue.normalizeClass(["uv-loading-icon__spinner", [`uv-loading-icon__spinner--${_ctx.mode}`]]),
  1841. ref: "ani",
  1842. style: vue.normalizeStyle({
  1843. color: _ctx.color,
  1844. width: _ctx.$uv.addUnit(_ctx.size),
  1845. height: _ctx.$uv.addUnit(_ctx.size),
  1846. borderTopColor: _ctx.color,
  1847. borderBottomColor: $options.otherBorderColor,
  1848. borderLeftColor: $options.otherBorderColor,
  1849. borderRightColor: $options.otherBorderColor,
  1850. "animation-duration": `${_ctx.duration}ms`,
  1851. "animation-timing-function": _ctx.mode === "semicircle" || _ctx.mode === "circle" ? _ctx.timingFunction : ""
  1852. })
  1853. },
  1854. [
  1855. _ctx.mode === "spinner" ? (vue.openBlock(true), vue.createElementBlock(
  1856. vue.Fragment,
  1857. { key: 0 },
  1858. vue.renderList($data.array12, (item, index2) => {
  1859. return vue.openBlock(), vue.createElementBlock("view", {
  1860. key: index2,
  1861. class: "uv-loading-icon__dot"
  1862. });
  1863. }),
  1864. 128
  1865. /* KEYED_FRAGMENT */
  1866. )) : vue.createCommentVNode("v-if", true)
  1867. ],
  1868. 6
  1869. /* CLASS, STYLE */
  1870. )) : vue.createCommentVNode("v-if", true),
  1871. _ctx.text ? (vue.openBlock(), vue.createElementBlock(
  1872. "text",
  1873. {
  1874. key: 1,
  1875. class: "uv-loading-icon__text",
  1876. style: vue.normalizeStyle([{
  1877. fontSize: _ctx.$uv.addUnit(_ctx.textSize),
  1878. color: _ctx.textColor
  1879. }, _ctx.$uv.addStyle(_ctx.textStyle)])
  1880. },
  1881. vue.toDisplayString(_ctx.text),
  1882. 5
  1883. /* TEXT, STYLE */
  1884. )) : vue.createCommentVNode("v-if", true)
  1885. ],
  1886. 6
  1887. /* CLASS, STYLE */
  1888. )) : vue.createCommentVNode("v-if", true);
  1889. }
  1890. 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"]]);
  1891. const icons = {
  1892. "uvicon-level": "e68f",
  1893. "uvicon-checkbox-mark": "e659",
  1894. "uvicon-folder": "e694",
  1895. "uvicon-movie": "e67c",
  1896. "uvicon-star-fill": "e61e",
  1897. "uvicon-star": "e618",
  1898. "uvicon-phone-fill": "e6ac",
  1899. "uvicon-phone": "e6ba",
  1900. "uvicon-apple-fill": "e635",
  1901. "uvicon-backspace": "e64d",
  1902. "uvicon-attach": "e640",
  1903. "uvicon-empty-data": "e671",
  1904. "uvicon-empty-address": "e68a",
  1905. "uvicon-empty-favor": "e662",
  1906. "uvicon-empty-car": "e657",
  1907. "uvicon-empty-order": "e66b",
  1908. "uvicon-empty-list": "e672",
  1909. "uvicon-empty-search": "e677",
  1910. "uvicon-empty-permission": "e67d",
  1911. "uvicon-empty-news": "e67e",
  1912. "uvicon-empty-history": "e685",
  1913. "uvicon-empty-coupon": "e69b",
  1914. "uvicon-empty-page": "e60e",
  1915. "uvicon-empty-wifi-off": "e6cc",
  1916. "uvicon-reload": "e627",
  1917. "uvicon-order": "e695",
  1918. "uvicon-server-man": "e601",
  1919. "uvicon-search": "e632",
  1920. "uvicon-more-dot-fill": "e66f",
  1921. "uvicon-scan": "e631",
  1922. "uvicon-map": "e665",
  1923. "uvicon-map-fill": "e6a8",
  1924. "uvicon-tags": "e621",
  1925. "uvicon-tags-fill": "e613",
  1926. "uvicon-eye": "e664",
  1927. "uvicon-eye-fill": "e697",
  1928. "uvicon-eye-off": "e69c",
  1929. "uvicon-eye-off-outline": "e688",
  1930. "uvicon-mic": "e66d",
  1931. "uvicon-mic-off": "e691",
  1932. "uvicon-calendar": "e65c",
  1933. "uvicon-trash": "e623",
  1934. "uvicon-trash-fill": "e6ce",
  1935. "uvicon-play-left": "e6bf",
  1936. "uvicon-play-right": "e6b3",
  1937. "uvicon-minus": "e614",
  1938. "uvicon-plus": "e625",
  1939. "uvicon-info-circle": "e69f",
  1940. "uvicon-info-circle-fill": "e6a7",
  1941. "uvicon-question-circle": "e622",
  1942. "uvicon-question-circle-fill": "e6bc",
  1943. "uvicon-close": "e65a",
  1944. "uvicon-checkmark": "e64a",
  1945. "uvicon-checkmark-circle": "e643",
  1946. "uvicon-checkmark-circle-fill": "e668",
  1947. "uvicon-setting": "e602",
  1948. "uvicon-setting-fill": "e6d0",
  1949. "uvicon-heart": "e6a2",
  1950. "uvicon-heart-fill": "e68b",
  1951. "uvicon-camera": "e642",
  1952. "uvicon-camera-fill": "e650",
  1953. "uvicon-more-circle": "e69e",
  1954. "uvicon-more-circle-fill": "e684",
  1955. "uvicon-chat": "e656",
  1956. "uvicon-chat-fill": "e63f",
  1957. "uvicon-bag": "e647",
  1958. "uvicon-error-circle": "e66e",
  1959. "uvicon-error-circle-fill": "e655",
  1960. "uvicon-close-circle": "e64e",
  1961. "uvicon-close-circle-fill": "e666",
  1962. "uvicon-share": "e629",
  1963. "uvicon-share-fill": "e6bb",
  1964. "uvicon-share-square": "e6c4",
  1965. "uvicon-shopping-cart": "e6cb",
  1966. "uvicon-shopping-cart-fill": "e630",
  1967. "uvicon-bell": "e651",
  1968. "uvicon-bell-fill": "e604",
  1969. "uvicon-list": "e690",
  1970. "uvicon-list-dot": "e6a9",
  1971. "uvicon-zhifubao-circle-fill": "e617",
  1972. "uvicon-weixin-circle-fill": "e6cd",
  1973. "uvicon-weixin-fill": "e620",
  1974. "uvicon-qq-fill": "e608",
  1975. "uvicon-qq-circle-fill": "e6b9",
  1976. "uvicon-moments-circel-fill": "e6c2",
  1977. "uvicon-moments": "e6a0",
  1978. "uvicon-car": "e64f",
  1979. "uvicon-car-fill": "e648",
  1980. "uvicon-warning-fill": "e6c7",
  1981. "uvicon-warning": "e6c1",
  1982. "uvicon-clock-fill": "e64b",
  1983. "uvicon-clock": "e66c",
  1984. "uvicon-edit-pen": "e65d",
  1985. "uvicon-edit-pen-fill": "e679",
  1986. "uvicon-email": "e673",
  1987. "uvicon-email-fill": "e683",
  1988. "uvicon-minus-circle": "e6a5",
  1989. "uvicon-plus-circle": "e603",
  1990. "uvicon-plus-circle-fill": "e611",
  1991. "uvicon-file-text": "e687",
  1992. "uvicon-file-text-fill": "e67f",
  1993. "uvicon-pushpin": "e6d1",
  1994. "uvicon-pushpin-fill": "e6b6",
  1995. "uvicon-grid": "e68c",
  1996. "uvicon-grid-fill": "e698",
  1997. "uvicon-play-circle": "e6af",
  1998. "uvicon-play-circle-fill": "e62a",
  1999. "uvicon-pause-circle-fill": "e60c",
  2000. "uvicon-pause": "e61c",
  2001. "uvicon-pause-circle": "e696",
  2002. "uvicon-gift-fill": "e6b0",
  2003. "uvicon-gift": "e680",
  2004. "uvicon-kefu-ermai": "e660",
  2005. "uvicon-server-fill": "e610",
  2006. "uvicon-coupon-fill": "e64c",
  2007. "uvicon-coupon": "e65f",
  2008. "uvicon-integral": "e693",
  2009. "uvicon-integral-fill": "e6b1",
  2010. "uvicon-home-fill": "e68e",
  2011. "uvicon-home": "e67b",
  2012. "uvicon-account": "e63a",
  2013. "uvicon-account-fill": "e653",
  2014. "uvicon-thumb-down-fill": "e628",
  2015. "uvicon-thumb-down": "e60a",
  2016. "uvicon-thumb-up": "e612",
  2017. "uvicon-thumb-up-fill": "e62c",
  2018. "uvicon-lock-fill": "e6a6",
  2019. "uvicon-lock-open": "e68d",
  2020. "uvicon-lock-opened-fill": "e6a1",
  2021. "uvicon-lock": "e69d",
  2022. "uvicon-red-packet": "e6c3",
  2023. "uvicon-photo-fill": "e6b4",
  2024. "uvicon-photo": "e60d",
  2025. "uvicon-volume-off-fill": "e6c8",
  2026. "uvicon-volume-off": "e6bd",
  2027. "uvicon-volume-fill": "e624",
  2028. "uvicon-volume": "e605",
  2029. "uvicon-download": "e670",
  2030. "uvicon-arrow-up-fill": "e636",
  2031. "uvicon-arrow-down-fill": "e638",
  2032. "uvicon-play-left-fill": "e6ae",
  2033. "uvicon-play-right-fill": "e6ad",
  2034. "uvicon-arrow-downward": "e634",
  2035. "uvicon-arrow-leftward": "e63b",
  2036. "uvicon-arrow-rightward": "e644",
  2037. "uvicon-arrow-upward": "e641",
  2038. "uvicon-arrow-down": "e63e",
  2039. "uvicon-arrow-right": "e63c",
  2040. "uvicon-arrow-left": "e646",
  2041. "uvicon-arrow-up": "e633",
  2042. "uvicon-skip-back-left": "e6c5",
  2043. "uvicon-skip-forward-right": "e61f",
  2044. "uvicon-arrow-left-double": "e637",
  2045. "uvicon-man": "e675",
  2046. "uvicon-woman": "e626",
  2047. "uvicon-en": "e6b8",
  2048. "uvicon-twitte": "e607",
  2049. "uvicon-twitter-circle-fill": "e6cf"
  2050. };
  2051. const props$g = {
  2052. props: {
  2053. // 图标类名
  2054. name: {
  2055. type: String,
  2056. default: ""
  2057. },
  2058. // 图标颜色,可接受主题色
  2059. color: {
  2060. type: String,
  2061. default: "#606266"
  2062. },
  2063. // 字体大小,单位px
  2064. size: {
  2065. type: [String, Number],
  2066. default: "16px"
  2067. },
  2068. // 是否显示粗体
  2069. bold: {
  2070. type: Boolean,
  2071. default: false
  2072. },
  2073. // 点击图标的时候传递事件出去的index(用于区分点击了哪一个)
  2074. index: {
  2075. type: [String, Number],
  2076. default: null
  2077. },
  2078. // 触摸图标时的类名
  2079. hoverClass: {
  2080. type: String,
  2081. default: ""
  2082. },
  2083. // 自定义扩展前缀,方便用户扩展自己的图标库
  2084. customPrefix: {
  2085. type: String,
  2086. default: "uvicon"
  2087. },
  2088. // 图标右边或者下面的文字
  2089. label: {
  2090. type: [String, Number],
  2091. default: ""
  2092. },
  2093. // label的位置,只能右边或者下边
  2094. labelPos: {
  2095. type: String,
  2096. default: "right"
  2097. },
  2098. // label的大小
  2099. labelSize: {
  2100. type: [String, Number],
  2101. default: "15px"
  2102. },
  2103. // label的颜色
  2104. labelColor: {
  2105. type: String,
  2106. default: "#606266"
  2107. },
  2108. // label与图标的距离
  2109. space: {
  2110. type: [String, Number],
  2111. default: "3px"
  2112. },
  2113. // 图片的mode
  2114. imgMode: {
  2115. type: String,
  2116. default: "aspectFit"
  2117. },
  2118. // 用于显示图片小图标时,图片的宽度
  2119. width: {
  2120. type: [String, Number],
  2121. default: ""
  2122. },
  2123. // 用于显示图片小图标时,图片的高度
  2124. height: {
  2125. type: [String, Number],
  2126. default: ""
  2127. },
  2128. // 用于解决某些情况下,让图标垂直居中的用途
  2129. top: {
  2130. type: [String, Number],
  2131. default: 0
  2132. },
  2133. // 是否阻止事件传播
  2134. stop: {
  2135. type: Boolean,
  2136. default: false
  2137. },
  2138. ...(_j = (_i = uni.$uv) == null ? void 0 : _i.props) == null ? void 0 : _j.icon
  2139. }
  2140. };
  2141. const _sfc_main$z = {
  2142. name: "uv-icon",
  2143. emits: ["click"],
  2144. mixins: [mpMixin, mixin, props$g],
  2145. data() {
  2146. return {
  2147. colorType: [
  2148. "primary",
  2149. "success",
  2150. "info",
  2151. "error",
  2152. "warning"
  2153. ]
  2154. };
  2155. },
  2156. computed: {
  2157. uClasses() {
  2158. let classes = [];
  2159. classes.push(this.customPrefix);
  2160. classes.push(this.customPrefix + "-" + this.name);
  2161. if (this.color && this.colorType.includes(this.color))
  2162. classes.push("uv-icon__icon--" + this.color);
  2163. return classes;
  2164. },
  2165. iconStyle() {
  2166. let style = {};
  2167. style = {
  2168. fontSize: this.$uv.addUnit(this.size),
  2169. lineHeight: this.$uv.addUnit(this.size),
  2170. fontWeight: this.bold ? "bold" : "normal",
  2171. // 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
  2172. top: this.$uv.addUnit(this.top)
  2173. };
  2174. if (this.color && !this.colorType.includes(this.color))
  2175. style.color = this.color;
  2176. return style;
  2177. },
  2178. // 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
  2179. isImg() {
  2180. const isBase64 = this.name.indexOf("data:") > -1 && this.name.indexOf("base64") > -1;
  2181. return this.name.indexOf("/") !== -1 || isBase64;
  2182. },
  2183. imgStyle() {
  2184. let style = {};
  2185. style.width = this.width ? this.$uv.addUnit(this.width) : this.$uv.addUnit(this.size);
  2186. style.height = this.height ? this.$uv.addUnit(this.height) : this.$uv.addUnit(this.size);
  2187. return style;
  2188. },
  2189. // 通过图标名,查找对应的图标
  2190. icon() {
  2191. const code2 = icons["uvicon-" + this.name];
  2192. return code2 ? unescape(`%u${code2}`) : ["uvicon"].indexOf(this.customPrefix) > -1 ? this.name : "";
  2193. }
  2194. },
  2195. methods: {
  2196. clickHandler(e) {
  2197. this.$emit("click", this.index);
  2198. this.stop && this.preventEvent(e);
  2199. }
  2200. }
  2201. };
  2202. function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
  2203. return vue.openBlock(), vue.createElementBlock(
  2204. "view",
  2205. {
  2206. class: vue.normalizeClass(["uv-icon", ["uv-icon--" + _ctx.labelPos]]),
  2207. onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
  2208. },
  2209. [
  2210. $options.isImg ? (vue.openBlock(), vue.createElementBlock("image", {
  2211. key: 0,
  2212. class: "uv-icon__img",
  2213. src: _ctx.name,
  2214. mode: _ctx.imgMode,
  2215. style: vue.normalizeStyle([$options.imgStyle, _ctx.$uv.addStyle(_ctx.customStyle)])
  2216. }, null, 12, ["src", "mode"])) : (vue.openBlock(), vue.createElementBlock("text", {
  2217. key: 1,
  2218. class: vue.normalizeClass(["uv-icon__icon", $options.uClasses]),
  2219. style: vue.normalizeStyle([$options.iconStyle, _ctx.$uv.addStyle(_ctx.customStyle)]),
  2220. "hover-class": _ctx.hoverClass
  2221. }, vue.toDisplayString($options.icon), 15, ["hover-class"])),
  2222. vue.createCommentVNode(' 这里进行空字符串判断,如果仅仅是v-if="label",可能会出现传递0的时候,结果也无法显示 '),
  2223. _ctx.label !== "" ? (vue.openBlock(), vue.createElementBlock(
  2224. "text",
  2225. {
  2226. key: 2,
  2227. class: "uv-icon__label",
  2228. style: vue.normalizeStyle({
  2229. color: _ctx.labelColor,
  2230. fontSize: _ctx.$uv.addUnit(_ctx.labelSize),
  2231. marginLeft: _ctx.labelPos == "right" ? _ctx.$uv.addUnit(_ctx.space) : 0,
  2232. marginTop: _ctx.labelPos == "bottom" ? _ctx.$uv.addUnit(_ctx.space) : 0,
  2233. marginRight: _ctx.labelPos == "left" ? _ctx.$uv.addUnit(_ctx.space) : 0,
  2234. marginBottom: _ctx.labelPos == "top" ? _ctx.$uv.addUnit(_ctx.space) : 0
  2235. })
  2236. },
  2237. vue.toDisplayString(_ctx.label),
  2238. 5
  2239. /* TEXT, STYLE */
  2240. )) : vue.createCommentVNode("v-if", true)
  2241. ],
  2242. 2
  2243. /* CLASS */
  2244. );
  2245. }
  2246. 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"]]);
  2247. const props$f = {
  2248. props: {
  2249. // 背景颜色(默认transparent)
  2250. bgColor: {
  2251. type: String,
  2252. default: "transparent"
  2253. },
  2254. // 分割槽高度,单位px(默认20)
  2255. height: {
  2256. type: [String, Number],
  2257. default: 20
  2258. },
  2259. // 与上一个组件的距离
  2260. marginTop: {
  2261. type: [String, Number],
  2262. default: 0
  2263. },
  2264. // 与下一个组件的距离
  2265. marginBottom: {
  2266. type: [String, Number],
  2267. default: 0
  2268. },
  2269. ...(_l = (_k = uni.$uv) == null ? void 0 : _k.props) == null ? void 0 : _l.gap
  2270. }
  2271. };
  2272. const _sfc_main$y = {
  2273. name: "uv-gap",
  2274. mixins: [mpMixin, mixin, props$f],
  2275. computed: {
  2276. gapStyle() {
  2277. const style = {
  2278. backgroundColor: this.bgColor,
  2279. height: this.$uv.addUnit(this.height),
  2280. marginTop: this.$uv.addUnit(this.marginTop),
  2281. marginBottom: this.$uv.addUnit(this.marginBottom)
  2282. };
  2283. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  2284. }
  2285. }
  2286. };
  2287. function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
  2288. return vue.openBlock(), vue.createElementBlock(
  2289. "view",
  2290. {
  2291. class: "uv-gap",
  2292. style: vue.normalizeStyle([$options.gapStyle])
  2293. },
  2294. null,
  2295. 4
  2296. /* STYLE */
  2297. );
  2298. }
  2299. 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"]]);
  2300. const _sfc_main$x = {
  2301. name: "uv-toast",
  2302. mixins: [mpMixin, mixin],
  2303. data() {
  2304. return {
  2305. isShow: false,
  2306. timer: null,
  2307. // 定时器
  2308. config: {
  2309. message: "",
  2310. // 显示文本
  2311. type: "",
  2312. // 主题类型,primary,success,error,warning,black
  2313. duration: 2e3,
  2314. // 显示的时间,毫秒
  2315. icon: true,
  2316. // 显示的图标
  2317. position: "center",
  2318. // toast出现的位置
  2319. complete: null,
  2320. // 执行完后的回调函数
  2321. overlay: true,
  2322. // 是否防止触摸穿透
  2323. loading: false,
  2324. // 是否加载中状态
  2325. zIndex: 10090
  2326. //弹出的层级
  2327. },
  2328. tmpConfig: {},
  2329. // 将用户配置和内置配置合并后的临时配置变量
  2330. rect: {},
  2331. opacity: 0
  2332. };
  2333. },
  2334. computed: {
  2335. iconName() {
  2336. if (!this.tmpConfig.icon || this.tmpConfig.icon == "none") {
  2337. return "";
  2338. }
  2339. if (["error", "warning", "success", "primary"].includes(this.tmpConfig.type)) {
  2340. return this.$uv.type2icon(this.tmpConfig.type);
  2341. } else {
  2342. return "";
  2343. }
  2344. },
  2345. overlayStyle() {
  2346. const style = {
  2347. justifyContent: "center",
  2348. alignItems: "center",
  2349. display: "flex",
  2350. zIndex: this.tmpConfig.zIndex
  2351. };
  2352. style.backgroundColor = "rgba(0, 0, 0, 0)";
  2353. return style;
  2354. },
  2355. iconStyle() {
  2356. const style = {};
  2357. style.marginRight = "4px";
  2358. return style;
  2359. },
  2360. aniStyle() {
  2361. const style = {
  2362. position: "fixed",
  2363. zIndex: this.tmpConfig.zIndex
  2364. };
  2365. return style;
  2366. },
  2367. // 内容盒子的样式
  2368. contentStyle() {
  2369. this.$uv.sys();
  2370. const style = {
  2371. position: "fixed",
  2372. top: "50%",
  2373. left: "50%"
  2374. };
  2375. let value2 = 0;
  2376. if (this.tmpConfig.position === "top") {
  2377. style.top = "25%";
  2378. } else if (this.tmpConfig.position === "bottom") {
  2379. style.top = "75%";
  2380. } else {
  2381. value2 = "-50%";
  2382. }
  2383. style.transform = `translate(-50%,${value2})`;
  2384. return style;
  2385. }
  2386. },
  2387. created() {
  2388. ["primary", "success", "error", "warning", "default", "loading"].map((item) => {
  2389. this[item] = (message) => this.show({
  2390. type: item,
  2391. message
  2392. });
  2393. });
  2394. },
  2395. methods: {
  2396. // 显示toast组件,由父组件通过this.$refs.xxx.show(options)形式调用
  2397. show(options) {
  2398. this.tmpConfig = this.$uv.deepMerge(this.config, options);
  2399. this.clearTimer();
  2400. this.isShow = true;
  2401. this.timer = setTimeout(() => {
  2402. this.clearTimer();
  2403. typeof this.tmpConfig.complete === "function" && this.tmpConfig.complete();
  2404. }, this.tmpConfig.duration);
  2405. },
  2406. // 查询内容高度
  2407. queryRect() {
  2408. return new Promise((resolve) => {
  2409. const ref = this.$refs["uvToastContent"];
  2410. dom.getComponentRect(ref, (res) => {
  2411. resolve(res.size);
  2412. });
  2413. });
  2414. },
  2415. // 隐藏toast组件,由父组件通过this.$refs.xxx.hide()形式调用
  2416. hide() {
  2417. this.clearTimer();
  2418. },
  2419. clearTimer() {
  2420. this.isShow = false;
  2421. clearTimeout(this.timer);
  2422. this.timer = null;
  2423. }
  2424. },
  2425. unmounted() {
  2426. this.clearTimer();
  2427. }
  2428. };
  2429. function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
  2430. const _component_uv_overlay = resolveEasycom(vue.resolveDynamicComponent("uv-overlay"), __easycom_0$3);
  2431. const _component_uv_loading_icon = resolveEasycom(vue.resolveDynamicComponent("uv-loading-icon"), __easycom_1$4);
  2432. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  2433. const _component_uv_gap = resolveEasycom(vue.resolveDynamicComponent("uv-gap"), __easycom_3$3);
  2434. const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
  2435. return vue.openBlock(), vue.createElementBlock("view", { class: "uv-toast" }, [
  2436. vue.createVNode(_component_uv_overlay, {
  2437. show: $data.isShow && $data.tmpConfig.overlay,
  2438. "custom-style": $options.overlayStyle
  2439. }, null, 8, ["show", "custom-style"]),
  2440. vue.createVNode(_component_uv_transition, {
  2441. show: $data.isShow,
  2442. mode: "fade",
  2443. "custom-style": $options.aniStyle
  2444. }, {
  2445. default: vue.withCtx(() => [
  2446. vue.createElementVNode(
  2447. "view",
  2448. {
  2449. class: vue.normalizeClass(["uv-toast__content", ["uv-type-" + $data.tmpConfig.type, $data.tmpConfig.type === "loading" || $data.tmpConfig.loading ? "uv-toast__content--loading" : ""]]),
  2450. ref: "uvToastContent",
  2451. style: vue.normalizeStyle([$options.contentStyle])
  2452. },
  2453. [
  2454. $data.tmpConfig.type === "loading" ? (vue.openBlock(), vue.createBlock(_component_uv_loading_icon, {
  2455. key: 0,
  2456. mode: "circle",
  2457. color: "rgb(255, 255, 255)",
  2458. inactiveColor: "rgb(120, 120, 120)",
  2459. size: "25"
  2460. })) : $data.tmpConfig.type !== "defalut" && $options.iconName ? (vue.openBlock(), vue.createBlock(_component_uv_icon, {
  2461. key: 1,
  2462. name: $options.iconName,
  2463. size: "17",
  2464. color: $data.tmpConfig.type,
  2465. customStyle: $options.iconStyle
  2466. }, null, 8, ["name", "color", "customStyle"])) : vue.createCommentVNode("v-if", true),
  2467. $data.tmpConfig.type === "loading" || $data.tmpConfig.loading ? (vue.openBlock(), vue.createBlock(_component_uv_gap, {
  2468. key: 2,
  2469. height: "12",
  2470. bgColor: "transparent"
  2471. })) : vue.createCommentVNode("v-if", true),
  2472. vue.createElementVNode(
  2473. "text",
  2474. {
  2475. class: vue.normalizeClass(["uv-toast__content__text", ["uv-toast__content__text--" + $data.tmpConfig.type]]),
  2476. style: { "max-width": "400rpx" }
  2477. },
  2478. vue.toDisplayString($data.tmpConfig.message),
  2479. 3
  2480. /* TEXT, CLASS */
  2481. )
  2482. ],
  2483. 6
  2484. /* CLASS, STYLE */
  2485. )
  2486. ]),
  2487. _: 1
  2488. /* STABLE */
  2489. }, 8, ["show", "custom-style"])
  2490. ]);
  2491. }
  2492. 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"]]);
  2493. const props$e = {
  2494. props: {
  2495. // 文字颜色
  2496. color: {
  2497. type: String,
  2498. default: ""
  2499. },
  2500. // 字体大小,单位px
  2501. fontSize: {
  2502. type: [String, Number],
  2503. default: 14
  2504. },
  2505. // 是否显示下划线
  2506. underLine: {
  2507. type: Boolean,
  2508. default: false
  2509. },
  2510. // 要跳转的链接
  2511. href: {
  2512. type: String,
  2513. default: ""
  2514. },
  2515. // 小程序中复制到粘贴板的提示语
  2516. mpTips: {
  2517. type: String,
  2518. default: "链接已复制,请在浏览器打开"
  2519. },
  2520. // 下划线颜色
  2521. lineColor: {
  2522. type: String,
  2523. default: ""
  2524. },
  2525. // 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
  2526. text: {
  2527. type: String,
  2528. default: ""
  2529. },
  2530. ...(_n = (_m = uni.$uv) == null ? void 0 : _m.props) == null ? void 0 : _n.link
  2531. }
  2532. };
  2533. const _sfc_main$w = {
  2534. name: "uv-link",
  2535. emits: ["click"],
  2536. mixins: [mpMixin, mixin, props$e],
  2537. computed: {
  2538. linkStyle() {
  2539. const style = {
  2540. color: this.color,
  2541. fontSize: this.$uv.addUnit(this.fontSize),
  2542. // line-height设置为比字体大小多2px
  2543. lineHeight: this.$uv.addUnit(this.$uv.getPx(this.fontSize) + 2),
  2544. textDecoration: this.underLine ? "underline" : "none"
  2545. };
  2546. return style;
  2547. }
  2548. },
  2549. methods: {
  2550. openLink() {
  2551. plus.runtime.openURL(this.href);
  2552. this.$emit("click");
  2553. }
  2554. }
  2555. };
  2556. function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
  2557. return vue.openBlock(), vue.createElementBlock(
  2558. "text",
  2559. {
  2560. class: "uv-link",
  2561. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.openLink && $options.openLink(...args), ["stop"])),
  2562. style: vue.normalizeStyle([$options.linkStyle, _ctx.$uv.addStyle(_ctx.customStyle)])
  2563. },
  2564. vue.toDisplayString(_ctx.text),
  2565. 5
  2566. /* TEXT, STYLE */
  2567. );
  2568. }
  2569. 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"]]);
  2570. const value$1 = {
  2571. computed: {
  2572. // 经处理后需要显示的值
  2573. value() {
  2574. const {
  2575. text,
  2576. mode,
  2577. format: format2,
  2578. href
  2579. } = this;
  2580. if (mode === "price") {
  2581. if (!/^\d+(\.\d+)?$/.test(text)) {
  2582. error("金额模式下,text参数需要为金额格式");
  2583. }
  2584. if (func(format2)) {
  2585. return format2(text);
  2586. }
  2587. return priceFormat(text, 2);
  2588. }
  2589. if (mode === "date") {
  2590. !date$1(text) && error("日期模式下,text参数需要为日期或时间戳格式");
  2591. if (func(format2)) {
  2592. return format2(text);
  2593. }
  2594. if (format2) {
  2595. return timeFormat(text, format2);
  2596. }
  2597. return timeFormat(text, "yyyy-mm-dd");
  2598. }
  2599. if (mode === "phone") {
  2600. if (func(format2)) {
  2601. return format2(text);
  2602. }
  2603. if (format2 === "encrypt") {
  2604. return `${text.substr(0, 3)}****${text.substr(7)}`;
  2605. }
  2606. return text;
  2607. }
  2608. if (mode === "name") {
  2609. !(typeof text === "string") && error("姓名模式下,text参数需要为字符串格式");
  2610. if (func(format2)) {
  2611. return format2(text);
  2612. }
  2613. if (format2 === "encrypt") {
  2614. return this.formatName(text);
  2615. }
  2616. return text;
  2617. }
  2618. if (mode === "link") {
  2619. !url(href) && error("超链接模式下,href参数需要为URL格式");
  2620. return text;
  2621. }
  2622. return text;
  2623. }
  2624. },
  2625. methods: {
  2626. // 默认的姓名脱敏规则
  2627. formatName(name) {
  2628. let value2 = "";
  2629. if (name.length === 2) {
  2630. value2 = name.substr(0, 1) + "*";
  2631. } else if (name.length > 2) {
  2632. let char = "";
  2633. for (let i = 0, len = name.length - 2; i < len; i++) {
  2634. char += "*";
  2635. }
  2636. value2 = name.substr(0, 1) + char + name.substr(-1, 1);
  2637. } else {
  2638. value2 = name;
  2639. }
  2640. return value2;
  2641. }
  2642. }
  2643. };
  2644. const props$d = {
  2645. props: {
  2646. // 主题颜色
  2647. type: {
  2648. type: String,
  2649. default: ""
  2650. },
  2651. // 是否显示
  2652. show: {
  2653. type: Boolean,
  2654. default: true
  2655. },
  2656. // 显示的值
  2657. text: {
  2658. type: [String, Number],
  2659. default: ""
  2660. },
  2661. // 前置图标
  2662. prefixIcon: {
  2663. type: String,
  2664. default: ""
  2665. },
  2666. // 后置图标
  2667. suffixIcon: {
  2668. type: String,
  2669. default: ""
  2670. },
  2671. // 文本处理的匹配模式
  2672. // text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
  2673. mode: {
  2674. type: String,
  2675. default: ""
  2676. },
  2677. // mode=link下,配置的链接
  2678. href: {
  2679. type: String,
  2680. default: ""
  2681. },
  2682. // 格式化规则
  2683. format: {
  2684. type: [String, Function],
  2685. default: ""
  2686. },
  2687. // mode=phone时,点击文本是否拨打电话
  2688. call: {
  2689. type: Boolean,
  2690. default: true
  2691. },
  2692. // 小程序的打开方式
  2693. openType: {
  2694. type: String,
  2695. default: ""
  2696. },
  2697. // 是否粗体,默认normal
  2698. bold: {
  2699. type: Boolean,
  2700. default: false
  2701. },
  2702. // 是否块状
  2703. block: {
  2704. type: Boolean,
  2705. default: false
  2706. },
  2707. // 文本显示的行数,如果设置,超出此行数,将会显示省略号
  2708. lines: {
  2709. type: [String, Number],
  2710. default: ""
  2711. },
  2712. // 文本颜色
  2713. color: {
  2714. type: String,
  2715. default: "#303133"
  2716. },
  2717. // 字体大小
  2718. size: {
  2719. type: [String, Number],
  2720. default: 15
  2721. },
  2722. // 图标的样式
  2723. iconStyle: {
  2724. type: [Object, String],
  2725. default: () => ({
  2726. fontSize: "15px"
  2727. })
  2728. },
  2729. // 文字装饰,下划线,中划线等,可选值 none|underline|line-through
  2730. decoration: {
  2731. type: String,
  2732. default: "none"
  2733. },
  2734. // 外边距,对象、字符串,数值形式均可
  2735. margin: {
  2736. type: [Object, String, Number],
  2737. default: 0
  2738. },
  2739. // 文本行高
  2740. lineHeight: {
  2741. type: [String, Number],
  2742. default: ""
  2743. },
  2744. // 文本对齐方式,可选值left|center|right
  2745. align: {
  2746. type: String,
  2747. default: "left"
  2748. },
  2749. // 文字换行,可选值break-word|normal|anywhere
  2750. wordWrap: {
  2751. type: String,
  2752. default: "normal"
  2753. },
  2754. ...(_p = (_o = uni.$uv) == null ? void 0 : _o.props) == null ? void 0 : _p.text
  2755. }
  2756. };
  2757. const _sfc_main$v = {
  2758. name: "uv-text",
  2759. emits: ["click"],
  2760. mixins: [mpMixin, mixin, value$1, props$d],
  2761. computed: {
  2762. valueStyle() {
  2763. const style = {
  2764. textDecoration: this.decoration,
  2765. fontWeight: this.bold ? "bold" : "normal",
  2766. wordWrap: this.wordWrap,
  2767. fontSize: this.$uv.addUnit(this.size)
  2768. };
  2769. !this.type && (style.color = this.color);
  2770. this.isNvue && this.lines && (style.lines = this.lines);
  2771. if (this.isNvue && this.mode != "price" && !this.prefixIcon && !this.suffixIcon) {
  2772. style.flex = 1;
  2773. style.textAlign = this.align === "left" ? "flex-start" : this.align === "center" ? "center" : "right";
  2774. }
  2775. this.lineHeight && (style.lineHeight = this.$uv.addUnit(this.lineHeight));
  2776. !this.isNvue && this.block && (style.display = "block");
  2777. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  2778. },
  2779. isNvue() {
  2780. let nvue = false;
  2781. return nvue;
  2782. },
  2783. isMp() {
  2784. let mp = false;
  2785. return mp;
  2786. }
  2787. },
  2788. data() {
  2789. return {};
  2790. },
  2791. methods: {
  2792. clickHandler() {
  2793. if (this.call && this.mode === "phone") {
  2794. uni.makePhoneCall({
  2795. phoneNumber: this.text
  2796. });
  2797. }
  2798. this.$emit("click");
  2799. }
  2800. }
  2801. };
  2802. function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
  2803. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  2804. const _component_uv_link = resolveEasycom(vue.resolveDynamicComponent("uv-link"), __easycom_1$3);
  2805. return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
  2806. "view",
  2807. {
  2808. key: 0,
  2809. class: vue.normalizeClass(["uv-text", []]),
  2810. style: vue.normalizeStyle({
  2811. margin: _ctx.margin,
  2812. justifyContent: _ctx.align === "left" ? "flex-start" : _ctx.align === "center" ? "center" : "flex-end"
  2813. }),
  2814. onClick: _cache[6] || (_cache[6] = (...args) => $options.clickHandler && $options.clickHandler(...args))
  2815. },
  2816. [
  2817. _ctx.mode === "price" ? (vue.openBlock(), vue.createElementBlock(
  2818. "text",
  2819. {
  2820. key: 0,
  2821. class: vue.normalizeClass(["uv-text__price", _ctx.type && `uv-text__value--${_ctx.type}`]),
  2822. style: vue.normalizeStyle([$options.valueStyle])
  2823. },
  2824. "¥",
  2825. 6
  2826. /* CLASS, STYLE */
  2827. )) : vue.createCommentVNode("v-if", true),
  2828. _ctx.prefixIcon ? (vue.openBlock(), vue.createElementBlock("view", {
  2829. key: 1,
  2830. class: "uv-text__prefix-icon"
  2831. }, [
  2832. vue.createVNode(_component_uv_icon, {
  2833. name: _ctx.prefixIcon,
  2834. customStyle: _ctx.$uv.addStyle(_ctx.iconStyle)
  2835. }, null, 8, ["name", "customStyle"])
  2836. ])) : vue.createCommentVNode("v-if", true),
  2837. _ctx.mode === "link" ? (vue.openBlock(), vue.createBlock(_component_uv_link, {
  2838. key: 2,
  2839. text: _ctx.value,
  2840. href: _ctx.href,
  2841. underLine: ""
  2842. }, null, 8, ["text", "href"])) : _ctx.openType && $options.isMp ? (vue.openBlock(), vue.createElementBlock("button", {
  2843. key: 3,
  2844. class: "uv-reset-button uv-text__value",
  2845. style: vue.normalizeStyle([$options.valueStyle]),
  2846. openType: _ctx.openType,
  2847. onGetuserinfo: _cache[0] || (_cache[0] = (...args) => _ctx.onGetUserInfo && _ctx.onGetUserInfo(...args)),
  2848. onContact: _cache[1] || (_cache[1] = (...args) => _ctx.onContact && _ctx.onContact(...args)),
  2849. onGetphonenumber: _cache[2] || (_cache[2] = (...args) => _ctx.onGetPhoneNumber && _ctx.onGetPhoneNumber(...args)),
  2850. onError: _cache[3] || (_cache[3] = (...args) => _ctx.onError && _ctx.onError(...args)),
  2851. onLaunchapp: _cache[4] || (_cache[4] = (...args) => _ctx.onLaunchApp && _ctx.onLaunchApp(...args)),
  2852. onOpensetting: _cache[5] || (_cache[5] = (...args) => _ctx.onOpenSetting && _ctx.onOpenSetting(...args)),
  2853. lang: _ctx.lang,
  2854. "session-from": _ctx.sessionFrom,
  2855. "send-message-title": _ctx.sendMessageTitle,
  2856. "send-message-path": _ctx.sendMessagePath,
  2857. "send-message-img": _ctx.sendMessageImg,
  2858. "show-message-card": _ctx.showMessageCard,
  2859. "app-parameter": _ctx.appParameter
  2860. }, 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(
  2861. "text",
  2862. {
  2863. key: 4,
  2864. class: vue.normalizeClass(["uv-text__value", [
  2865. _ctx.type && `uv-text__value--${_ctx.type}`,
  2866. _ctx.lines && `uv-line-${_ctx.lines}`
  2867. ]]),
  2868. style: vue.normalizeStyle([$options.valueStyle])
  2869. },
  2870. vue.toDisplayString(_ctx.value),
  2871. 7
  2872. /* TEXT, CLASS, STYLE */
  2873. )),
  2874. _ctx.suffixIcon ? (vue.openBlock(), vue.createElementBlock("view", {
  2875. key: 5,
  2876. class: "uv-text__suffix-icon"
  2877. }, [
  2878. vue.createVNode(_component_uv_icon, {
  2879. name: _ctx.suffixIcon,
  2880. customStyle: _ctx.$uv.addStyle(_ctx.iconStyle)
  2881. }, null, 8, ["name", "customStyle"])
  2882. ])) : vue.createCommentVNode("v-if", true)
  2883. ],
  2884. 4
  2885. /* STYLE */
  2886. )) : vue.createCommentVNode("v-if", true);
  2887. }
  2888. 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"]]);
  2889. const props$c = {
  2890. props: {
  2891. // 图片地址
  2892. src: {
  2893. type: String,
  2894. default: ""
  2895. },
  2896. // 裁剪模式
  2897. mode: {
  2898. type: String,
  2899. default: "aspectFill"
  2900. },
  2901. // 宽度,单位任意
  2902. width: {
  2903. type: [String, Number],
  2904. default: "300"
  2905. },
  2906. // 高度,单位任意
  2907. height: {
  2908. type: [String, Number],
  2909. default: "225"
  2910. },
  2911. // 图片形状,circle-圆形,square-方形
  2912. shape: {
  2913. type: String,
  2914. default: "square"
  2915. },
  2916. // 圆角,单位任意
  2917. radius: {
  2918. type: [String, Number],
  2919. default: 0
  2920. },
  2921. // 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序
  2922. lazyLoad: {
  2923. type: Boolean,
  2924. default: true
  2925. },
  2926. // 是否开启observer懒加载,nvue不生效
  2927. observeLazyLoad: {
  2928. type: Boolean,
  2929. default: false
  2930. },
  2931. // 开启长按图片显示识别微信小程序码菜单
  2932. showMenuByLongpress: {
  2933. type: Boolean,
  2934. default: true
  2935. },
  2936. // 加载中的图标,或者小图片
  2937. loadingIcon: {
  2938. type: String,
  2939. default: "photo"
  2940. },
  2941. // 加载失败的图标,或者小图片
  2942. errorIcon: {
  2943. type: String,
  2944. default: "error-circle"
  2945. },
  2946. // 是否显示加载中的图标或者自定义的slot
  2947. showLoading: {
  2948. type: Boolean,
  2949. default: true
  2950. },
  2951. // 是否显示加载错误的图标或者自定义的slot
  2952. showError: {
  2953. type: Boolean,
  2954. default: true
  2955. },
  2956. // 是否需要淡入效果
  2957. fade: {
  2958. type: Boolean,
  2959. default: true
  2960. },
  2961. // 只支持网络资源,只对微信小程序有效
  2962. webp: {
  2963. type: Boolean,
  2964. default: false
  2965. },
  2966. // 过渡时间,单位ms
  2967. duration: {
  2968. type: [String, Number],
  2969. default: 500
  2970. },
  2971. // 背景颜色,用于深色页面加载图片时,为了和背景色融合
  2972. bgColor: {
  2973. type: String,
  2974. default: "#f3f4f6"
  2975. },
  2976. // nvue模式下 是否直接显示,在uv-list等cell下面使用就需要设置
  2977. cellChild: {
  2978. type: Boolean,
  2979. default: false
  2980. },
  2981. ...(_r = (_q = uni.$uv) == null ? void 0 : _q.props) == null ? void 0 : _r.image
  2982. }
  2983. };
  2984. const _sfc_main$u = {
  2985. name: "uv-image",
  2986. emits: ["click", "load", "error"],
  2987. mixins: [mpMixin, mixin, props$c],
  2988. data() {
  2989. return {
  2990. // 图片是否加载错误,如果是,则显示错误占位图
  2991. isError: false,
  2992. // 初始化组件时,默认为加载中状态
  2993. loading: true,
  2994. // 图片加载完成时,去掉背景颜色,因为如果是png图片,就会显示灰色的背景
  2995. backgroundStyle: {},
  2996. // 用于fade模式的控制组件显示与否
  2997. show: false,
  2998. // 是否开启图片出现在可视范围进行加载(另一种懒加载)
  2999. observeShow: !this.observeLazyLoad,
  3000. elIndex: "",
  3001. // 因为props的值无法修改,故需要一个中间值
  3002. imgWidth: this.width,
  3003. // 因为props的值无法修改,故需要一个中间值
  3004. imgHeight: this.height,
  3005. thresholdValue: 50
  3006. };
  3007. },
  3008. watch: {
  3009. src: {
  3010. immediate: true,
  3011. handler(n2) {
  3012. if (!n2) {
  3013. this.isError = true;
  3014. } else {
  3015. this.isError = false;
  3016. this.loading = true;
  3017. }
  3018. }
  3019. },
  3020. width(newVal) {
  3021. this.show = false;
  3022. this.$uv.sleep(2).then((res) => {
  3023. this.show = true;
  3024. });
  3025. this.imgWidth = newVal;
  3026. },
  3027. height(newVal) {
  3028. this.show = false;
  3029. this.$uv.sleep(2).then((res) => {
  3030. this.show = true;
  3031. });
  3032. this.imgHeight = newVal;
  3033. }
  3034. },
  3035. computed: {
  3036. wrapStyle() {
  3037. let style = {};
  3038. if (this.mode !== "heightFix") {
  3039. style.width = this.$uv.addUnit(this.imgWidth);
  3040. }
  3041. if (this.mode !== "widthFix") {
  3042. style.height = this.$uv.addUnit(this.imgHeight);
  3043. }
  3044. style.borderRadius = this.shape == "circle" ? "10000px" : this.$uv.addUnit(this.radius);
  3045. style.overflow = this.radius > 0 ? "hidden" : "visible";
  3046. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  3047. },
  3048. imageStyle() {
  3049. let style = {};
  3050. style.borderRadius = this.shape == "circle" ? "10000px" : this.$uv.addUnit(this.radius);
  3051. return style;
  3052. }
  3053. },
  3054. created() {
  3055. this.elIndex = this.$uv.guid();
  3056. this.observer = {};
  3057. this.observerName = "lazyLoadContentObserver";
  3058. },
  3059. mounted() {
  3060. this.show = true;
  3061. this.$nextTick(() => {
  3062. if (this.observeLazyLoad)
  3063. this.observerFn();
  3064. });
  3065. },
  3066. methods: {
  3067. // 点击图片
  3068. onClick() {
  3069. this.$emit("click");
  3070. },
  3071. // 图片加载失败
  3072. onErrorHandler(err) {
  3073. this.loading = false;
  3074. this.isError = true;
  3075. this.$emit("error", err);
  3076. },
  3077. // 图片加载完成,标记loading结束
  3078. onLoadHandler(event) {
  3079. if (this.mode == "widthFix")
  3080. this.imgHeight = "auto";
  3081. if (this.mode == "heightFix")
  3082. this.imgWidth = "auto";
  3083. this.loading = false;
  3084. this.isError = false;
  3085. this.$emit("load", event);
  3086. this.removeBgColor();
  3087. },
  3088. // 移除图片的背景色
  3089. removeBgColor() {
  3090. this.backgroundStyle = {
  3091. backgroundColor: "transparent"
  3092. };
  3093. },
  3094. // 观察图片是否在可见视口
  3095. observerFn() {
  3096. this.$nextTick(() => {
  3097. uni.$once("onLazyLoadReachBottom", () => {
  3098. if (!this.observeShow)
  3099. this.observeShow = true;
  3100. });
  3101. });
  3102. setTimeout(() => {
  3103. this.disconnectObserver(this.observerName);
  3104. const contentObserver = uni.createIntersectionObserver(this);
  3105. contentObserver.relativeToViewport({
  3106. bottom: this.thresholdValue
  3107. }).observe(`.uv-image--${this.elIndex}`, (res) => {
  3108. if (res.intersectionRatio > 0) {
  3109. this.observeShow = true;
  3110. this.disconnectObserver(this.observerName);
  3111. }
  3112. });
  3113. this[this.observerName] = contentObserver;
  3114. }, 50);
  3115. },
  3116. disconnectObserver(observerName) {
  3117. const observer = this[observerName];
  3118. observer && observer.disconnect();
  3119. }
  3120. }
  3121. };
  3122. function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
  3123. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  3124. const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
  3125. return $data.show ? (vue.openBlock(), vue.createBlock(_component_uv_transition, {
  3126. key: 0,
  3127. show: $data.show,
  3128. mode: "fade",
  3129. duration: _ctx.fade ? _ctx.duration : 0,
  3130. "cell-child": _ctx.cellChild,
  3131. "custom-style": $options.wrapStyle
  3132. }, {
  3133. default: vue.withCtx(() => [
  3134. vue.createElementVNode(
  3135. "view",
  3136. {
  3137. class: vue.normalizeClass(["uv-image", [`uv-image--${$data.elIndex}`]]),
  3138. onClick: _cache[2] || (_cache[2] = (...args) => $options.onClick && $options.onClick(...args)),
  3139. style: vue.normalizeStyle([$options.wrapStyle, $data.backgroundStyle])
  3140. },
  3141. [
  3142. !$data.isError && $data.observeShow ? (vue.openBlock(), vue.createElementBlock("image", {
  3143. key: 0,
  3144. src: _ctx.src,
  3145. mode: _ctx.mode,
  3146. onError: _cache[0] || (_cache[0] = (...args) => $options.onErrorHandler && $options.onErrorHandler(...args)),
  3147. onLoad: _cache[1] || (_cache[1] = (...args) => $options.onLoadHandler && $options.onLoadHandler(...args)),
  3148. "show-menuv-by-longpress": _ctx.showMenuByLongpress,
  3149. "lazy-load": _ctx.lazyLoad,
  3150. class: "uv-image__image",
  3151. style: vue.normalizeStyle([$options.imageStyle]),
  3152. webp: _ctx.webp
  3153. }, null, 44, ["src", "mode", "show-menuv-by-longpress", "lazy-load", "webp"])) : vue.createCommentVNode("v-if", true),
  3154. _ctx.showLoading && $data.loading ? (vue.openBlock(), vue.createElementBlock(
  3155. "view",
  3156. {
  3157. key: 1,
  3158. class: "uv-image__loading",
  3159. style: vue.normalizeStyle({
  3160. borderRadius: _ctx.shape == "circle" ? "50%" : _ctx.$uv.addUnit(_ctx.radius),
  3161. backgroundColor: _ctx.bgColor,
  3162. width: _ctx.$uv.addUnit(_ctx.width),
  3163. height: _ctx.$uv.addUnit(_ctx.height)
  3164. })
  3165. },
  3166. [
  3167. vue.renderSlot(_ctx.$slots, "loading", {}, () => [
  3168. vue.createVNode(_component_uv_icon, {
  3169. name: _ctx.loadingIcon,
  3170. width: _ctx.width,
  3171. height: _ctx.height
  3172. }, null, 8, ["name", "width", "height"])
  3173. ], true)
  3174. ],
  3175. 4
  3176. /* STYLE */
  3177. )) : vue.createCommentVNode("v-if", true),
  3178. _ctx.showError && $data.isError && !$data.loading ? (vue.openBlock(), vue.createElementBlock(
  3179. "view",
  3180. {
  3181. key: 2,
  3182. class: "uv-image__error",
  3183. style: vue.normalizeStyle({
  3184. borderRadius: _ctx.shape == "circle" ? "50%" : _ctx.$uv.addUnit(_ctx.radius),
  3185. width: _ctx.$uv.addUnit(_ctx.width),
  3186. height: _ctx.$uv.addUnit(_ctx.height)
  3187. })
  3188. },
  3189. [
  3190. vue.renderSlot(_ctx.$slots, "error", {}, () => [
  3191. vue.createVNode(_component_uv_icon, {
  3192. name: _ctx.errorIcon,
  3193. width: _ctx.width,
  3194. height: _ctx.height
  3195. }, null, 8, ["name", "width", "height"])
  3196. ], true)
  3197. ],
  3198. 4
  3199. /* STYLE */
  3200. )) : vue.createCommentVNode("v-if", true)
  3201. ],
  3202. 6
  3203. /* CLASS, STYLE */
  3204. )
  3205. ]),
  3206. _: 3
  3207. /* FORWARDED */
  3208. }, 8, ["show", "duration", "cell-child", "custom-style"])) : vue.createCommentVNode("v-if", true);
  3209. }
  3210. 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"]]);
  3211. const props$b = {
  3212. props: {
  3213. // 指示器的整体宽度
  3214. indicatorWidth: {
  3215. type: [String, Number],
  3216. default: 50
  3217. },
  3218. // 滑块的宽度
  3219. indicatorBarWidth: {
  3220. type: [String, Number],
  3221. default: 20
  3222. },
  3223. // 是否显示面板指示器
  3224. indicator: {
  3225. type: Boolean,
  3226. default: true
  3227. },
  3228. // 指示器非激活颜色
  3229. indicatorColor: {
  3230. type: String,
  3231. default: "#f2f2f2"
  3232. },
  3233. // 指示器的激活颜色
  3234. indicatorActiveColor: {
  3235. type: String,
  3236. default: "#3c9cff"
  3237. },
  3238. // 指示器样式,可通过bottom,left,right进行定位
  3239. indicatorStyle: {
  3240. type: [String, Object],
  3241. default: ""
  3242. },
  3243. ...(_t = (_s = uni.$uv) == null ? void 0 : _s.props) == null ? void 0 : _t.scrollList
  3244. }
  3245. };
  3246. const block0 = (Comp) => {
  3247. (Comp.$wxs || (Comp.$wxs = [])).push("wxs");
  3248. (Comp.$wxsModules || (Comp.$wxsModules = {}))["wxs"] = "1f01b1f2";
  3249. };
  3250. const _sfc_main$t = {
  3251. name: "uv-scroll-list",
  3252. mixins: [mpMixin, mixin, props$b],
  3253. data() {
  3254. return {
  3255. scrollInfo: {
  3256. scrollLeft: 0,
  3257. scrollWidth: 0
  3258. },
  3259. scrollWidth: 0
  3260. };
  3261. },
  3262. computed: {
  3263. // 指示器为线型的样式
  3264. barStyle() {
  3265. const style = {};
  3266. style.width = this.$uv.addUnit(this.indicatorBarWidth);
  3267. style.backgroundColor = this.indicatorActiveColor;
  3268. return style;
  3269. },
  3270. lineStyle() {
  3271. const style = {};
  3272. style.width = this.$uv.addUnit(this.indicatorWidth);
  3273. style.backgroundColor = this.indicatorColor;
  3274. return style;
  3275. }
  3276. },
  3277. mounted() {
  3278. this.init();
  3279. },
  3280. methods: {
  3281. init() {
  3282. this.getComponentWidth();
  3283. },
  3284. scrollEvent(status) {
  3285. this.$emit(status);
  3286. },
  3287. // 获取组件的宽度
  3288. async getComponentWidth() {
  3289. await this.$uv.sleep(30);
  3290. this.$uvGetRect(".uv-scroll-list").then((size) => {
  3291. this.scrollWidth = size.width;
  3292. });
  3293. }
  3294. }
  3295. };
  3296. function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
  3297. return vue.openBlock(), vue.createElementBlock(
  3298. "view",
  3299. {
  3300. class: "uv-scroll-list",
  3301. ref: "uv-scroll-list"
  3302. },
  3303. [
  3304. vue.createCommentVNode(" 以上平台,支持wxs "),
  3305. vue.createElementVNode("scroll-view", {
  3306. class: "uv-scroll-list__scroll-view",
  3307. "scroll-x": "",
  3308. onScroll: _cache[0] || (_cache[0] = (...args) => _ctx.wxs.scroll && _ctx.wxs.scroll(...args)),
  3309. onScrolltoupper: _cache[1] || (_cache[1] = (...args) => _ctx.wxs.scrolltoupper && _ctx.wxs.scrolltoupper(...args)),
  3310. onScrolltolower: _cache[2] || (_cache[2] = (...args) => _ctx.wxs.scrolltolower && _ctx.wxs.scrolltolower(...args)),
  3311. "data-scrollWidth": $data.scrollWidth,
  3312. "data-barWidth": _ctx.$uv.getPx(_ctx.indicatorBarWidth),
  3313. "data-indicatorWidth": _ctx.$uv.getPx(_ctx.indicatorWidth),
  3314. "show-scrollbar": false,
  3315. "upper-threshold": 0,
  3316. "lower-threshold": 0,
  3317. "data-unit": _ctx.$uv.unit
  3318. }, [
  3319. vue.createElementVNode("view", { class: "uv-scroll-list__scroll-view__content" }, [
  3320. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  3321. ])
  3322. ], 40, ["data-scrollWidth", "data-barWidth", "data-indicatorWidth", "data-unit"]),
  3323. _ctx.indicator ? (vue.openBlock(), vue.createElementBlock(
  3324. "view",
  3325. {
  3326. key: 0,
  3327. class: "uv-scroll-list__indicator",
  3328. style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.indicatorStyle)])
  3329. },
  3330. [
  3331. vue.createElementVNode(
  3332. "view",
  3333. {
  3334. class: "uv-scroll-list__indicator__line",
  3335. style: vue.normalizeStyle([$options.lineStyle])
  3336. },
  3337. [
  3338. vue.createElementVNode(
  3339. "view",
  3340. {
  3341. class: "uv-scroll-list__indicator__line__bar",
  3342. style: vue.normalizeStyle([$options.barStyle]),
  3343. ref: "uv-scroll-list__indicator__line__bar"
  3344. },
  3345. null,
  3346. 4
  3347. /* STYLE */
  3348. )
  3349. ],
  3350. 4
  3351. /* STYLE */
  3352. )
  3353. ],
  3354. 4
  3355. /* STYLE */
  3356. )) : vue.createCommentVNode("v-if", true),
  3357. vue.createCommentVNode(" 避免报错 ")
  3358. ],
  3359. 512
  3360. /* NEED_PATCH */
  3361. );
  3362. }
  3363. if (typeof block0 === "function")
  3364. block0(_sfc_main$t);
  3365. 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"]]);
  3366. const props$a = {
  3367. props: {
  3368. // 占父容器宽度的多少等分,总分为12份
  3369. span: {
  3370. type: [String, Number],
  3371. default: 12
  3372. },
  3373. // 指定栅格左侧的间隔数(总12栏)
  3374. offset: {
  3375. type: [String, Number],
  3376. default: 0
  3377. },
  3378. // 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
  3379. justify: {
  3380. type: String,
  3381. default: "start"
  3382. },
  3383. // 垂直对齐方式,可选值为top、center、bottom、stretch
  3384. align: {
  3385. type: String,
  3386. default: "stretch"
  3387. },
  3388. // 文字对齐方式
  3389. textAlign: {
  3390. type: String,
  3391. default: "left"
  3392. },
  3393. ...(_v = (_u = uni.$uv) == null ? void 0 : _u.props) == null ? void 0 : _v.col
  3394. }
  3395. };
  3396. const _sfc_main$s = {
  3397. name: "uv-col",
  3398. emits: ["click"],
  3399. mixins: [mpMixin, mixin, props$a],
  3400. data() {
  3401. return {
  3402. width: 0,
  3403. parentData: {
  3404. gutter: 0
  3405. },
  3406. gridNum: 12
  3407. };
  3408. },
  3409. computed: {
  3410. uJustify() {
  3411. if (this.justify == "end" || this.justify == "start")
  3412. return "flex-" + this.justify;
  3413. else if (this.justify == "around" || this.justify == "between")
  3414. return "space-" + this.justify;
  3415. else
  3416. return this.justify;
  3417. },
  3418. uAlignItem() {
  3419. if (this.align == "top")
  3420. return "flex-start";
  3421. if (this.align == "bottom")
  3422. return "flex-end";
  3423. else
  3424. return this.align;
  3425. },
  3426. colStyle() {
  3427. const style = {
  3428. // 这里写成"padding: 0 10px"的形式是因为nvue的需要
  3429. paddingLeft: this.$uv.addUnit(this.$uv.getPx(this.parentData.gutter) / 2),
  3430. paddingRight: this.$uv.addUnit(this.$uv.getPx(this.parentData.gutter) / 2),
  3431. alignItems: this.uAlignItem,
  3432. justifyContent: this.uJustify,
  3433. textAlign: this.textAlign,
  3434. // 在非nvue上,使用百分比形式
  3435. flex: `0 0 ${100 / this.gridNum * this.span}%`,
  3436. marginLeft: 100 / 12 * this.offset + "%"
  3437. };
  3438. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  3439. }
  3440. },
  3441. mounted() {
  3442. this.init();
  3443. },
  3444. methods: {
  3445. async init() {
  3446. this.updateParentData();
  3447. this.width = await this.parent.getComponentWidth();
  3448. },
  3449. updateParentData() {
  3450. this.getParentData("uv-row");
  3451. },
  3452. clickHandler(e) {
  3453. this.$emit("click");
  3454. }
  3455. }
  3456. };
  3457. function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
  3458. return vue.openBlock(), vue.createElementBlock(
  3459. "view",
  3460. {
  3461. class: vue.normalizeClass(["uv-col", [
  3462. "uv-col-" + _ctx.span
  3463. ]]),
  3464. ref: "uv-col",
  3465. style: vue.normalizeStyle([$options.colStyle]),
  3466. onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
  3467. },
  3468. [
  3469. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  3470. ],
  3471. 6
  3472. /* CLASS, STYLE */
  3473. );
  3474. }
  3475. 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"]]);
  3476. const props$9 = {
  3477. props: {
  3478. // 给col添加间距,左右边距各占一半
  3479. gutter: {
  3480. type: [String, Number],
  3481. default: 0
  3482. },
  3483. // 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
  3484. justify: {
  3485. type: String,
  3486. default: "start"
  3487. },
  3488. // 垂直对齐方式,可选值为top、center、bottom
  3489. align: {
  3490. type: String,
  3491. default: "center"
  3492. },
  3493. ...(_x = (_w = uni.$uv) == null ? void 0 : _w.props) == null ? void 0 : _x.row
  3494. }
  3495. };
  3496. const _sfc_main$r = {
  3497. name: "uv-row",
  3498. emits: ["click"],
  3499. mixins: [mpMixin, mixin, props$9],
  3500. data() {
  3501. return {};
  3502. },
  3503. computed: {
  3504. uJustify() {
  3505. if (this.justify == "end" || this.justify == "start")
  3506. return "flex-" + this.justify;
  3507. else if (this.justify == "around" || this.justify == "between")
  3508. return "space-" + this.justify;
  3509. else
  3510. return this.justify;
  3511. },
  3512. uAlignItem() {
  3513. if (this.align == "top")
  3514. return "flex-start";
  3515. if (this.align == "bottom")
  3516. return "flex-end";
  3517. else
  3518. return this.align;
  3519. },
  3520. rowStyle() {
  3521. const style = {
  3522. alignItems: this.uAlignItem,
  3523. justifyContent: this.uJustify
  3524. };
  3525. if (this.gutter) {
  3526. style.marginLeft = this.$uv.addUnit(-Number(this.gutter) / 2);
  3527. style.marginRight = this.$uv.addUnit(-Number(this.gutter) / 2);
  3528. }
  3529. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  3530. }
  3531. },
  3532. methods: {
  3533. clickHandler(e) {
  3534. this.$emit("click");
  3535. },
  3536. async getComponentWidth() {
  3537. await this.$uv.sleep();
  3538. return new Promise((resolve) => {
  3539. this.$uvGetRect(".uv-row").then((res) => {
  3540. resolve(res.width);
  3541. });
  3542. });
  3543. }
  3544. }
  3545. };
  3546. function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
  3547. return vue.openBlock(), vue.createElementBlock(
  3548. "view",
  3549. {
  3550. class: "uv-row",
  3551. ref: "uv-row",
  3552. style: vue.normalizeStyle([$options.rowStyle]),
  3553. onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
  3554. },
  3555. [
  3556. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  3557. ],
  3558. 4
  3559. /* STYLE */
  3560. );
  3561. }
  3562. 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"]]);
  3563. function getlist(data) {
  3564. let url2 = baseUrl + "/index.php/index/Fmember/queryfmemberlistbyuserid";
  3565. return dorequest("post", url2, data);
  3566. }
  3567. function submembergenderbyuserid(data) {
  3568. let url2 = baseUrl + "/index.php/index/Fmember/submembergenderbyuserid";
  3569. return dorequest("post", url2, data);
  3570. }
  3571. function subfmemberlistbyuserid(data) {
  3572. let url2 = baseUrl + "/index.php/index/Fmember/subfmemberlistbyuserid";
  3573. return dorequest("post", url2, data);
  3574. }
  3575. function submembergenderwithuid(data) {
  3576. let url2 = baseUrl + "/index.php/index/Fmember/subgenderbyuserid";
  3577. let usedata = {
  3578. userid: data.userid,
  3579. fmemberid: data.fmemberid,
  3580. gender: data.gender
  3581. };
  3582. return dorequest("post", url2, usedata);
  3583. }
  3584. function querymergescalebyuserid(data) {
  3585. let url2 = baseUrl + "/index.php/index/Scale/querymergescalebyuserid";
  3586. return dorequest("post", url2, data);
  3587. }
  3588. function subanswerbyuserid(answer, data) {
  3589. let url2 = baseUrl + "/index.php/index/Scale/subanswerbyuserid";
  3590. let list = [];
  3591. if (!(answer instanceof Array)) {
  3592. let item = {
  3593. userid: data.userid,
  3594. fmemberid: data.fmemberid,
  3595. stemid: answer.stemid,
  3596. answertype: answer.answertype,
  3597. answervalue: answer.answervalue
  3598. };
  3599. if (answer.answeroptionid) {
  3600. item.answeroptionid = answer.answeroptionid;
  3601. }
  3602. if (answer.answeroption) {
  3603. item.answeroption = answer.answeroption;
  3604. }
  3605. list.push(item);
  3606. } else {
  3607. list = answer;
  3608. }
  3609. let usedata = {
  3610. answer: JSON.stringify(list),
  3611. userid: data.userid,
  3612. fmemberid: data.fmemberid,
  3613. srid: data.srid,
  3614. scaleid: data.scaleid
  3615. };
  3616. return dorequest("post", url2, usedata);
  3617. }
  3618. function subcomstatus(srid) {
  3619. let url2 = baseUrl + "/index.php/index/Scale/subcomstatus";
  3620. let usedata = {
  3621. srid
  3622. };
  3623. return dorequest("post", url2, usedata);
  3624. }
  3625. const _sfc_main$q = {
  3626. data() {
  3627. return {
  3628. shareimg: "https://backup-1306866048.cos.ap-nanjing.myqcloud.com/workercard/20231228/658d1042e1395.jpg"
  3629. };
  3630. },
  3631. methods: {
  3632. showshare() {
  3633. },
  3634. dosharewechat() {
  3635. this.$emit("dosharewechat", { shareimg: this.shareimg });
  3636. }
  3637. }
  3638. };
  3639. function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
  3640. const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
  3641. const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
  3642. const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
  3643. return vue.openBlock(), vue.createElementBlock("view", { class: "share_div" }, [
  3644. vue.createVNode(_component_uv_row, null, {
  3645. default: vue.withCtx(() => [
  3646. vue.createVNode(_component_uv_col, {
  3647. span: "10",
  3648. class: "text",
  3649. align: "center"
  3650. }, {
  3651. default: vue.withCtx(() => [
  3652. vue.createTextVNode(" 心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。 ")
  3653. ]),
  3654. _: 1
  3655. /* STABLE */
  3656. }),
  3657. vue.createVNode(_component_uv_col, { span: "2" }, {
  3658. default: vue.withCtx(() => [
  3659. vue.createElementVNode("view", {
  3660. class: "",
  3661. onClick: _cache[0] || (_cache[0] = (...args) => $options.dosharewechat && $options.dosharewechat(...args)),
  3662. align: "center"
  3663. }, [
  3664. vue.createVNode(_component_uv_image, {
  3665. class: "img",
  3666. src: "/static/image/wxfriend.png",
  3667. mode: "aspectFill",
  3668. shape: "circle",
  3669. "lazy-load": true,
  3670. width: "50",
  3671. height: "50"
  3672. }),
  3673. vue.createCommentVNode(' <uv-icon name="share" label="分享" size="50" labelPos="bottom" color="#648EB8" labelColor="#648EB8" labelSize="18"></uv-icon> ')
  3674. ])
  3675. ]),
  3676. _: 1
  3677. /* STABLE */
  3678. })
  3679. ]),
  3680. _: 1
  3681. /* STABLE */
  3682. })
  3683. ]);
  3684. }
  3685. 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"]]);
  3686. const _sfc_main$p = {
  3687. data() {
  3688. return {
  3689. userinfo: {},
  3690. userlist: [],
  3691. reportinfo: {},
  3692. selectuser: false
  3693. };
  3694. },
  3695. components: {
  3696. share: share$3
  3697. },
  3698. methods: {
  3699. getlist() {
  3700. let data = { userid: this.userinfo.id };
  3701. getlist(data).then((res) => {
  3702. res = res.data;
  3703. if (0 == res.code) {
  3704. this.$refs.toast.show({
  3705. type: "error",
  3706. message: res.errmsg
  3707. });
  3708. }
  3709. if (200 == res.code) {
  3710. let userlist = res.resultData;
  3711. let fmemberid = this.selectuser ? this.selectuser.fmemberid : this.userinfo.fmemberid;
  3712. if (this.selectuser) {
  3713. userlist.map((item, index2) => {
  3714. item.selected = 0;
  3715. if (item.fmemberid == fmemberid) {
  3716. item.selected = 1;
  3717. return;
  3718. }
  3719. });
  3720. } else {
  3721. userlist[0].selected = 1;
  3722. uni.setStorage({
  3723. key: "selectuser",
  3724. data: userlist[0]
  3725. });
  3726. this.selectuser = userlist[0];
  3727. uni.setStorage({
  3728. key: "selectuser",
  3729. data: this.selectuser
  3730. });
  3731. }
  3732. userlist.map((item, index2) => {
  3733. if (!item.gender) {
  3734. item.photourl = "/static/image/member.svg";
  3735. } else {
  3736. switch (item.gender) {
  3737. case "1":
  3738. item.photourl = "/static/image/selecttype/man.png";
  3739. break;
  3740. case "2":
  3741. item.photourl = "/static/image/selecttype/woman.png";
  3742. break;
  3743. }
  3744. }
  3745. });
  3746. this.userlist = userlist;
  3747. uni.setStorage({
  3748. key: "memberlist",
  3749. data: this.userlist
  3750. });
  3751. }
  3752. });
  3753. },
  3754. selected(index2) {
  3755. let that = this;
  3756. this.userlist.map((item, index1) => {
  3757. if (index1 == index2) {
  3758. item.selected = 1;
  3759. that.selectuser = item;
  3760. } else {
  3761. item.selected = 0;
  3762. }
  3763. });
  3764. uni.setStorage({
  3765. key: "selectuser",
  3766. data: this.selectuser
  3767. });
  3768. this.querymergescalebyuserid();
  3769. },
  3770. insertmembe() {
  3771. let count = this.userlist.length - 1;
  3772. if (count >= this.userinfo.fmembercount) {
  3773. this.$refs.toast.show({
  3774. type: "error",
  3775. message: this.$t("member_num_than_max")
  3776. });
  3777. } else {
  3778. uni.navigateTo({
  3779. url: "/pages/member/add"
  3780. });
  3781. }
  3782. },
  3783. querymergescalebyuserid() {
  3784. let userid = this.userinfo.id;
  3785. let fmemberid = this.selectuser.fmemberid ? this.selectuser.fmemberid : 0;
  3786. let data = { userid, fmemberid };
  3787. querymergescalebyuserid(data).then((res) => {
  3788. res = res.data;
  3789. if (0 == res.code) {
  3790. this.$refs.toast.show({
  3791. type: "error",
  3792. message: res.errmsg
  3793. });
  3794. return false;
  3795. }
  3796. if (200 == res.code) {
  3797. this.reportinfo = res.resultData;
  3798. }
  3799. });
  3800. },
  3801. showreport() {
  3802. uni.navigateTo({
  3803. url: "/pages/report/report"
  3804. });
  3805. },
  3806. init() {
  3807. this.userinfo = uni.getStorageSync("userinfo");
  3808. this.selectuser = uni.getStorageSync("selectuser");
  3809. this.getlist();
  3810. this.querymergescalebyuserid();
  3811. },
  3812. tostem() {
  3813. if (this.reportinfo.stemlist == void 0) {
  3814. return;
  3815. }
  3816. uni.setStorage({
  3817. key: "stemlist",
  3818. data: this.reportinfo.stemlist
  3819. });
  3820. if (this.reportinfo.srid == void 0) {
  3821. this.reportinfo.srid = 0;
  3822. }
  3823. this.reportinfo.stemlist;
  3824. let srid = this.reportinfo.srid;
  3825. uni.setStorage({
  3826. key: "srid",
  3827. data: srid
  3828. });
  3829. let stepprogress = this.reportinfo.stepprogress;
  3830. tostemlistnext(stepprogress);
  3831. },
  3832. restem() {
  3833. uni.setStorage({
  3834. key: "stemlist",
  3835. data: this.reportinfo.stemlist
  3836. });
  3837. if (this.reportinfo.srid == void 0) {
  3838. this.reportinfo.srid = 0;
  3839. }
  3840. this.reportinfo.stemlist;
  3841. let srid = 0;
  3842. uni.setStorage({
  3843. key: "srid",
  3844. data: srid
  3845. });
  3846. let stepprogress = 0;
  3847. var scaleid = 4;
  3848. tostemlistnext(stepprogress, 0, scaleid, srid);
  3849. },
  3850. share(data) {
  3851. uni.share({
  3852. provider: "weixin",
  3853. scene: "WXSceneSession",
  3854. type: 0,
  3855. href: "testapp://",
  3856. //title: this.$t('navigationBarTitleText')+"分享",
  3857. title: this.$t("share"),
  3858. summary: this.$t("share_text"),
  3859. imageUrl: data.shareimg,
  3860. success: function(res) {
  3861. addlog({
  3862. json: JSON.stringify(res),
  3863. type: "uniapp信息"
  3864. });
  3865. formatAppLog("log", "at pages/index/index.vue:348", "success:" + JSON.stringify(res));
  3866. },
  3867. fail: function(err) {
  3868. addlog({
  3869. json: JSON.stringify(err),
  3870. type: "uniapp错误"
  3871. });
  3872. formatAppLog("log", "at pages/index/index.vue:355", "fail:" + JSON.stringify(err));
  3873. }
  3874. });
  3875. }
  3876. },
  3877. mounted() {
  3878. this.init();
  3879. },
  3880. onPullDownRefresh() {
  3881. this.init();
  3882. setTimeout(function() {
  3883. uni.stopPullDownRefresh();
  3884. }, 1e3);
  3885. }
  3886. };
  3887. function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
  3888. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  3889. const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
  3890. const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
  3891. const _component_uv_scroll_list = resolveEasycom(vue.resolveDynamicComponent("uv-scroll-list"), __easycom_3$2);
  3892. const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
  3893. const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
  3894. return vue.openBlock(), vue.createElementBlock(
  3895. vue.Fragment,
  3896. null,
  3897. [
  3898. vue.createCommentVNode(` <custom-navigation-bar class="bar">\r
  3899. {{$t('navigationBarTitleText')}}\r
  3900. </custom-navigation-bar> `),
  3901. vue.createCommentVNode(` <page-meta>\r
  3902. <navigation-bar\r
  3903. :title="$t('navigationBarTitleText')"\r
  3904. front-color="#fff"\r
  3905. background-color="#648EB8"\r
  3906. title-align="center"\r
  3907. />\r
  3908. </page-meta> `),
  3909. vue.createVNode(
  3910. _component_uv_toast,
  3911. { ref: "toast" },
  3912. null,
  3913. 512
  3914. /* NEED_PATCH */
  3915. ),
  3916. vue.createElementVNode("view", { class: "page" }, [
  3917. vue.createElementVNode("view", { class: "bar" }, [
  3918. vue.createVNode(_component_uv_text, {
  3919. text: _ctx.$t("navigationBarTitleText"),
  3920. align: "center",
  3921. color: "#fff",
  3922. size: "20"
  3923. }, null, 8, ["text"])
  3924. ]),
  3925. vue.createElementVNode("view", { class: "bottomarc" }),
  3926. vue.createElementVNode("view", null, [
  3927. vue.createVNode(_component_uv_row, {
  3928. justify: "space-between",
  3929. customStyle: "margin-top: 6%"
  3930. }, {
  3931. default: vue.withCtx(() => [
  3932. vue.createVNode(_component_uv_col, {
  3933. span: "10",
  3934. offset: "1",
  3935. class: "box1"
  3936. }, {
  3937. default: vue.withCtx(() => [
  3938. vue.createElementVNode(
  3939. "view",
  3940. { class: "hometitle" },
  3941. vue.toDisplayString(_ctx.$t("index_text_1")),
  3942. 1
  3943. /* TEXT */
  3944. ),
  3945. vue.createElementVNode("view", { class: "userlist" }, [
  3946. vue.createVNode(_component_uv_row, null, {
  3947. default: vue.withCtx(() => [
  3948. vue.createVNode(_component_uv_col, {
  3949. span: "10",
  3950. class: "scroll_div"
  3951. }, {
  3952. default: vue.withCtx(() => [
  3953. vue.createVNode(_component_uv_scroll_list, { indicator: false }, {
  3954. default: vue.withCtx(() => [
  3955. (vue.openBlock(true), vue.createElementBlock(
  3956. vue.Fragment,
  3957. null,
  3958. vue.renderList($data.userlist, (item, index2) => {
  3959. return vue.openBlock(), vue.createElementBlock("view", {
  3960. key: index2,
  3961. class: "item"
  3962. }, [
  3963. vue.createVNode(_component_uv_image, {
  3964. class: vue.normalizeClass(["img", { memberphoto_select: item.selected }]),
  3965. src: item.photourl,
  3966. mode: "aspectFill",
  3967. shape: "circle",
  3968. "lazy-load": true,
  3969. width: "60",
  3970. height: "60",
  3971. onClick: ($event) => $options.selected(index2)
  3972. }, null, 8, ["src", "class", "onClick"]),
  3973. vue.createVNode(_component_uv_text, {
  3974. text: item.membername,
  3975. align: "center",
  3976. customStyle: "margin-top:0.3rem"
  3977. }, null, 8, ["text"])
  3978. ]);
  3979. }),
  3980. 128
  3981. /* KEYED_FRAGMENT */
  3982. ))
  3983. ]),
  3984. _: 1
  3985. /* STABLE */
  3986. })
  3987. ]),
  3988. _: 1
  3989. /* STABLE */
  3990. }),
  3991. vue.createVNode(_component_uv_col, { span: "2" }, {
  3992. default: vue.withCtx(() => [
  3993. vue.createElementVNode("view", { class: "addmember" }, [
  3994. vue.createVNode(_component_uv_image, {
  3995. class: "img",
  3996. src: "/static/image/fabu1.png",
  3997. mode: "aspectFill",
  3998. shape: "circle",
  3999. "lazy-load": true,
  4000. width: "50",
  4001. height: "50",
  4002. onClick: $options.insertmembe
  4003. }, null, 8, ["onClick"]),
  4004. vue.createVNode(_component_uv_text, {
  4005. text: _ctx.$t("new_member"),
  4006. align: "center",
  4007. customStyle: "margin-top:0.3rem"
  4008. }, null, 8, ["text"])
  4009. ])
  4010. ]),
  4011. _: 1
  4012. /* STABLE */
  4013. })
  4014. ]),
  4015. _: 1
  4016. /* STABLE */
  4017. })
  4018. ])
  4019. ]),
  4020. _: 1
  4021. /* STABLE */
  4022. })
  4023. ]),
  4024. _: 1
  4025. /* STABLE */
  4026. }),
  4027. vue.createElementVNode("view", { class: "" }, [
  4028. vue.createVNode(_component_uv_row, {
  4029. justify: "space-between",
  4030. customStyle: "margin-top: 2rem"
  4031. }, {
  4032. default: vue.withCtx(() => [
  4033. vue.createVNode(_component_uv_col, {
  4034. span: "10",
  4035. offset: "1"
  4036. }, {
  4037. default: vue.withCtx(() => [
  4038. vue.createElementVNode("view", { class: "box2" }, [
  4039. vue.createElementVNode(
  4040. "view",
  4041. { class: "scalename" },
  4042. vue.toDisplayString(_ctx.$t("index_text_2")),
  4043. 1
  4044. /* TEXT */
  4045. ),
  4046. vue.createElementVNode("view", { class: "div1" }, [
  4047. vue.createVNode(_component_uv_row, null, {
  4048. default: vue.withCtx(() => [
  4049. vue.createVNode(_component_uv_col, { span: "6" }, {
  4050. default: vue.withCtx(() => [
  4051. vue.createElementVNode("image", {
  4052. class: "img",
  4053. src: "http://qiniusave.chienxutech.com/sdzyy/img/xgng3.png"
  4054. })
  4055. ]),
  4056. _: 1
  4057. /* STABLE */
  4058. }),
  4059. vue.createVNode(_component_uv_col, { span: "6" }, {
  4060. default: vue.withCtx(() => [
  4061. vue.createElementVNode("view", { class: "" }, [
  4062. vue.createVNode(_component_uv_text, {
  4063. text: _ctx.$t("index_text_3")
  4064. }, null, 8, ["text"]),
  4065. vue.createVNode(_component_uv_text, {
  4066. text: _ctx.$t("index_text_4"),
  4067. align: "center",
  4068. customStyle: "margin-top:30px;margin-bottom:40px"
  4069. }, null, 8, ["text"]),
  4070. vue.createVNode(_component_uv_text, {
  4071. text: _ctx.$t("index_text_5"),
  4072. align: "center",
  4073. size: "12",
  4074. color: "#1a1a1a"
  4075. }, null, 8, ["text"])
  4076. ])
  4077. ]),
  4078. _: 1
  4079. /* STABLE */
  4080. })
  4081. ]),
  4082. _: 1
  4083. /* STABLE */
  4084. })
  4085. ]),
  4086. vue.createElementVNode(
  4087. "view",
  4088. { class: "scalename" },
  4089. vue.toDisplayString(_ctx.$t("index_text_6")),
  4090. 1
  4091. /* TEXT */
  4092. ),
  4093. $data.selectuser ? (vue.openBlock(), vue.createElementBlock("view", {
  4094. key: 0,
  4095. class: "btns"
  4096. }, [
  4097. vue.createCommentVNode(' <view v-show="1!=selectuser.fmemberid"> '),
  4098. vue.createElementVNode("view", null, [
  4099. vue.withDirectives(vue.createVNode(
  4100. _component_uv_row,
  4101. null,
  4102. {
  4103. default: vue.withCtx(() => [
  4104. vue.createVNode(_component_uv_col, {
  4105. span: "6",
  4106. offset: "3"
  4107. }, {
  4108. default: vue.withCtx(() => [
  4109. vue.createElementVNode(
  4110. "view",
  4111. {
  4112. class: "mybtn",
  4113. onClick: _cache[0] || (_cache[0] = (...args) => $options.tostem && $options.tostem(...args))
  4114. },
  4115. vue.toDisplayString(_ctx.$t("index_btn_1")),
  4116. 1
  4117. /* TEXT */
  4118. )
  4119. ]),
  4120. _: 1
  4121. /* STABLE */
  4122. })
  4123. ]),
  4124. _: 1
  4125. /* STABLE */
  4126. },
  4127. 512
  4128. /* NEED_PATCH */
  4129. ), [
  4130. [vue.vShow, 0 == $data.reportinfo.comstatus]
  4131. ]),
  4132. vue.withDirectives(vue.createVNode(
  4133. _component_uv_row,
  4134. { gutter: "20" },
  4135. {
  4136. default: vue.withCtx(() => [
  4137. vue.createVNode(_component_uv_col, { span: "6" }, {
  4138. default: vue.withCtx(() => [
  4139. vue.createElementVNode(
  4140. "view",
  4141. {
  4142. class: "mybtn",
  4143. onClick: _cache[1] || (_cache[1] = (...args) => $options.showreport && $options.showreport(...args))
  4144. },
  4145. vue.toDisplayString(_ctx.$t("index_btn_2")),
  4146. 1
  4147. /* TEXT */
  4148. )
  4149. ]),
  4150. _: 1
  4151. /* STABLE */
  4152. }),
  4153. vue.createVNode(_component_uv_col, { span: "6" }, {
  4154. default: vue.withCtx(() => [
  4155. vue.createElementVNode(
  4156. "view",
  4157. {
  4158. class: "mybtn",
  4159. onClick: _cache[2] || (_cache[2] = (...args) => $options.restem && $options.restem(...args))
  4160. },
  4161. vue.toDisplayString(_ctx.$t("index_btn_3")),
  4162. 1
  4163. /* TEXT */
  4164. )
  4165. ]),
  4166. _: 1
  4167. /* STABLE */
  4168. })
  4169. ]),
  4170. _: 1
  4171. /* STABLE */
  4172. },
  4173. 512
  4174. /* NEED_PATCH */
  4175. ), [
  4176. [vue.vShow, 1 == $data.reportinfo.comstatus]
  4177. ])
  4178. ])
  4179. ])) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
  4180. vue.createElementVNode(
  4181. "p",
  4182. null,
  4183. vue.toDisplayString(_ctx.$t("not_selected")),
  4184. 1
  4185. /* TEXT */
  4186. )
  4187. ])),
  4188. vue.createCommentVNode(" mergerscale.comstatus ")
  4189. ])
  4190. ]),
  4191. _: 1
  4192. /* STABLE */
  4193. })
  4194. ]),
  4195. _: 1
  4196. /* STABLE */
  4197. }),
  4198. 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> ')
  4199. ])
  4200. ])
  4201. ])
  4202. ],
  4203. 64
  4204. /* STABLE_FRAGMENT */
  4205. );
  4206. }
  4207. 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"]]);
  4208. const props$8 = {
  4209. props: {
  4210. value: {
  4211. type: [String, Number],
  4212. default: ""
  4213. },
  4214. modelValue: {
  4215. type: [String, Number],
  4216. default: ""
  4217. },
  4218. // 输入框类型
  4219. // number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
  4220. // idcard-身份证输入键盘,微信、支付宝、百度、QQ小程序
  4221. // digit-带小数点的数字键盘,App的nvue页面、微信、支付宝、百度、头条、QQ小程序
  4222. // text-文本输入键盘
  4223. type: {
  4224. type: String,
  4225. default: "text"
  4226. },
  4227. // 是否禁用输入框
  4228. disabled: {
  4229. type: Boolean,
  4230. default: false
  4231. },
  4232. // 禁用状态时的背景色
  4233. disabledColor: {
  4234. type: String,
  4235. default: "#f5f7fa"
  4236. },
  4237. // 是否显示清除控件
  4238. clearable: {
  4239. type: Boolean,
  4240. default: false
  4241. },
  4242. // 是否密码类型
  4243. password: {
  4244. type: Boolean,
  4245. default: false
  4246. },
  4247. // 最大输入长度,设置为 -1 的时候不限制最大长度
  4248. maxlength: {
  4249. type: [String, Number],
  4250. default: -1
  4251. },
  4252. // 输入框为空时的占位符
  4253. placeholder: {
  4254. type: String,
  4255. default: null
  4256. },
  4257. // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
  4258. placeholderClass: {
  4259. type: String,
  4260. default: "input-placeholder"
  4261. },
  4262. // 指定placeholder的样式
  4263. placeholderStyle: {
  4264. type: [String, Object],
  4265. default: "color: #c0c4cc"
  4266. },
  4267. // 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
  4268. // https://uniapp.dcloud.io/component/input
  4269. // https://uniapp.dcloud.io/component/textarea
  4270. confirmType: {
  4271. type: String,
  4272. default: "done"
  4273. },
  4274. // 点击键盘右下角按钮时是否保持键盘不收起,H5无效
  4275. confirmHold: {
  4276. type: Boolean,
  4277. default: false
  4278. },
  4279. // focus时,点击页面的时候不收起键盘,微信小程序有效
  4280. holdKeyboard: {
  4281. type: Boolean,
  4282. default: false
  4283. },
  4284. // 自动获取焦点
  4285. // 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
  4286. focus: {
  4287. type: Boolean,
  4288. default: false
  4289. },
  4290. // 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
  4291. autoBlur: {
  4292. type: Boolean,
  4293. default: false
  4294. },
  4295. // 指定focus时光标的位置
  4296. cursor: {
  4297. type: [String, Number],
  4298. default: -1
  4299. },
  4300. // 输入框聚焦时底部与键盘的距离
  4301. cursorSpacing: {
  4302. type: [String, Number],
  4303. default: 30
  4304. },
  4305. // 光标起始位置,自动聚集时有效,需与selection-end搭配使用
  4306. selectionStart: {
  4307. type: [String, Number],
  4308. default: -1
  4309. },
  4310. // 光标结束位置,自动聚集时有效,需与selection-start搭配使用
  4311. selectionEnd: {
  4312. type: [String, Number],
  4313. default: -1
  4314. },
  4315. // 键盘弹起时,是否自动上推页面
  4316. adjustPosition: {
  4317. type: Boolean,
  4318. default: true
  4319. },
  4320. // 输入框内容对齐方式,可选值为:left|center|right
  4321. inputAlign: {
  4322. type: String,
  4323. default: "left"
  4324. },
  4325. // 输入框字体的大小
  4326. fontSize: {
  4327. type: [String, Number],
  4328. default: "14px"
  4329. },
  4330. // 输入框字体颜色
  4331. color: {
  4332. type: String,
  4333. default: "#303133"
  4334. },
  4335. // 输入框前置图标
  4336. prefixIcon: {
  4337. type: String,
  4338. default: ""
  4339. },
  4340. // 前置图标样式,对象或字符串
  4341. prefixIconStyle: {
  4342. type: [String, Object],
  4343. default: ""
  4344. },
  4345. // 输入框后置图标
  4346. suffixIcon: {
  4347. type: String,
  4348. default: ""
  4349. },
  4350. // 后置图标样式,对象或字符串
  4351. suffixIconStyle: {
  4352. type: [String, Object],
  4353. default: ""
  4354. },
  4355. // 边框类型,surround-四周边框,bottom-底部边框,none-无边框
  4356. border: {
  4357. type: String,
  4358. default: "surround"
  4359. },
  4360. // 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
  4361. readonly: {
  4362. type: Boolean,
  4363. default: false
  4364. },
  4365. // 输入框形状,circle-圆形,square-方形
  4366. shape: {
  4367. type: String,
  4368. default: "square"
  4369. },
  4370. // 用于处理或者过滤输入框内容的方法
  4371. formatter: {
  4372. type: [Function, null],
  4373. default: null
  4374. },
  4375. // 是否忽略组件内对文本合成系统事件的处理
  4376. ignoreCompositionEvent: {
  4377. type: Boolean,
  4378. default: true
  4379. },
  4380. ...(_z = (_y = uni.$uv) == null ? void 0 : _y.props) == null ? void 0 : _z.input
  4381. }
  4382. };
  4383. const _sfc_main$o = {
  4384. name: "uv-input",
  4385. mixins: [mpMixin, mixin, props$8],
  4386. data() {
  4387. return {
  4388. // 输入框的值
  4389. innerValue: "",
  4390. // 是否处于获得焦点状态
  4391. focused: false,
  4392. // 过滤处理方法
  4393. innerFormatter: (value2) => value2
  4394. };
  4395. },
  4396. created() {
  4397. this.innerValue = this.modelValue;
  4398. },
  4399. watch: {
  4400. value(newVal) {
  4401. this.innerValue = newVal;
  4402. },
  4403. modelValue(newVal) {
  4404. this.innerValue = newVal;
  4405. }
  4406. },
  4407. computed: {
  4408. // 是否显示清除控件
  4409. isShowClear() {
  4410. const { clearable, readonly, focused, innerValue } = this;
  4411. return !!clearable && !readonly && !!focused && innerValue !== "";
  4412. },
  4413. // 组件的类名
  4414. inputClass() {
  4415. let classes = [], { border, disabled, shape } = this;
  4416. border === "surround" && (classes = classes.concat(["uv-border", "uv-input--radius"]));
  4417. classes.push(`uv-input--${shape}`);
  4418. border === "bottom" && (classes = classes.concat([
  4419. "uv-border-bottom",
  4420. "uv-input--no-radius"
  4421. ]));
  4422. return classes.join(" ");
  4423. },
  4424. // 组件的样式
  4425. wrapperStyle() {
  4426. const style = {};
  4427. if (this.disabled) {
  4428. style.backgroundColor = this.disabledColor;
  4429. }
  4430. if (this.border === "none") {
  4431. style.padding = "0";
  4432. } else {
  4433. style.paddingTop = "6px";
  4434. style.paddingBottom = "6px";
  4435. style.paddingLeft = "9px";
  4436. style.paddingRight = "9px";
  4437. }
  4438. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  4439. },
  4440. // 输入框的样式
  4441. inputStyle() {
  4442. const style = {
  4443. color: this.color,
  4444. fontSize: this.$uv.addUnit(this.fontSize),
  4445. textAlign: this.inputAlign
  4446. };
  4447. if (this.disabled || this.readonly) {
  4448. style["pointer-events"] = "none";
  4449. }
  4450. return style;
  4451. }
  4452. },
  4453. methods: {
  4454. // 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用
  4455. setFormatter(e) {
  4456. this.innerFormatter = e;
  4457. },
  4458. // 当键盘输入时,触发input事件
  4459. onInput(e) {
  4460. let { value: value2 = "" } = e.detail || {};
  4461. const formatter = this.formatter || this.innerFormatter;
  4462. const formatValue = formatter(value2);
  4463. this.innerValue = value2;
  4464. this.$nextTick(() => {
  4465. this.innerValue = formatValue;
  4466. this.valueChange();
  4467. });
  4468. },
  4469. // 输入框失去焦点时触发
  4470. onBlur(event) {
  4471. this.$emit("blur", event.detail.value);
  4472. this.$uv.sleep(100).then(() => {
  4473. this.focused = false;
  4474. });
  4475. this.$uv.formValidate(this, "blur");
  4476. },
  4477. // 输入框聚焦时触发
  4478. onFocus(event) {
  4479. this.focused = true;
  4480. this.$emit("focus");
  4481. },
  4482. // 点击完成按钮时触发
  4483. onConfirm(event) {
  4484. this.$emit("confirm", this.innerValue);
  4485. },
  4486. // 键盘高度发生变化的时候触发此事件
  4487. // 兼容性:微信小程序2.7.0+、App 3.1.0+
  4488. onkeyboardheightchange(e) {
  4489. this.$emit("keyboardheightchange", e);
  4490. },
  4491. // 内容发生变化,进行处理
  4492. valueChange() {
  4493. if (this.isClear)
  4494. this.innerValue = "";
  4495. const value2 = this.innerValue;
  4496. this.$nextTick(() => {
  4497. this.$emit("input", value2);
  4498. this.$emit("update:modelValue", value2);
  4499. this.$emit("change", value2);
  4500. this.$uv.formValidate(this, "change");
  4501. });
  4502. },
  4503. // 点击清除控件
  4504. onClear() {
  4505. this.innerValue = "";
  4506. this.isClear = true;
  4507. this.$uv.sleep(200).then((res) => {
  4508. this.isClear = false;
  4509. });
  4510. this.$nextTick(() => {
  4511. this.$emit("clear");
  4512. this.valueChange();
  4513. });
  4514. },
  4515. /**
  4516. * 在安卓nvue上,事件无法冒泡
  4517. * 在某些时间,我们希望监听uv-from-item的点击事件,此时会导致点击uv-form-item内的uv-input后
  4518. * 无法触发uv-form-item的点击事件,这里通过手动调用uv-form-item的方法进行触发
  4519. */
  4520. clickHandler() {
  4521. }
  4522. }
  4523. };
  4524. function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
  4525. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  4526. return vue.openBlock(), vue.createElementBlock(
  4527. "view",
  4528. {
  4529. class: vue.normalizeClass(["uv-input", $options.inputClass]),
  4530. style: vue.normalizeStyle([$options.wrapperStyle])
  4531. },
  4532. [
  4533. vue.createElementVNode("view", { class: "uv-input__content" }, [
  4534. vue.createElementVNode("view", { class: "uv-input__content__prefix-icon" }, [
  4535. vue.renderSlot(_ctx.$slots, "prefix", {}, () => [
  4536. _ctx.prefixIcon ? (vue.openBlock(), vue.createBlock(_component_uv_icon, {
  4537. key: 0,
  4538. name: _ctx.prefixIcon,
  4539. size: "18",
  4540. customStyle: _ctx.prefixIconStyle
  4541. }, null, 8, ["name", "customStyle"])) : vue.createCommentVNode("v-if", true)
  4542. ], true)
  4543. ]),
  4544. vue.createElementVNode("view", {
  4545. class: "uv-input__content__field-wrapper",
  4546. onClick: _cache[5] || (_cache[5] = (...args) => $options.clickHandler && $options.clickHandler(...args))
  4547. }, [
  4548. vue.createCommentVNode(" 根据uni-app的input组件文档,H5和APP中只要声明了password参数(无论true还是false),type均失效,此时\r\n 为了防止type=number时,又存在password属性,type无效,此时需要设置password为undefined\r\n "),
  4549. vue.createElementVNode("input", {
  4550. class: "uv-input__content__field-wrapper__field",
  4551. style: vue.normalizeStyle([$options.inputStyle]),
  4552. type: _ctx.type,
  4553. focus: _ctx.focus,
  4554. cursor: _ctx.cursor,
  4555. value: $data.innerValue,
  4556. "auto-blur": _ctx.autoBlur,
  4557. disabled: _ctx.disabled || _ctx.readonly,
  4558. maxlength: _ctx.maxlength,
  4559. placeholder: _ctx.placeholder,
  4560. "placeholder-style": _ctx.placeholderStyle,
  4561. "placeholder-class": _ctx.placeholderClass,
  4562. "confirm-type": _ctx.confirmType,
  4563. "confirm-hold": _ctx.confirmHold,
  4564. "hold-keyboard": _ctx.holdKeyboard,
  4565. "cursor-spacing": _ctx.cursorSpacing,
  4566. "adjust-position": _ctx.adjustPosition,
  4567. "selection-end": _ctx.selectionEnd,
  4568. "selection-start": _ctx.selectionStart,
  4569. password: _ctx.password || _ctx.type === "password" || void 0,
  4570. ignoreCompositionEvent: _ctx.ignoreCompositionEvent,
  4571. onInput: _cache[0] || (_cache[0] = (...args) => $options.onInput && $options.onInput(...args)),
  4572. onBlur: _cache[1] || (_cache[1] = (...args) => $options.onBlur && $options.onBlur(...args)),
  4573. onFocus: _cache[2] || (_cache[2] = (...args) => $options.onFocus && $options.onFocus(...args)),
  4574. onConfirm: _cache[3] || (_cache[3] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
  4575. onKeyboardheightchange: _cache[4] || (_cache[4] = (...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
  4576. }, 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"])
  4577. ]),
  4578. $options.isShowClear ? (vue.openBlock(), vue.createElementBlock("view", {
  4579. key: 0,
  4580. class: "uv-input__content__clear",
  4581. onClick: _cache[6] || (_cache[6] = (...args) => $options.onClear && $options.onClear(...args))
  4582. }, [
  4583. vue.createVNode(_component_uv_icon, {
  4584. name: "close",
  4585. size: "11",
  4586. color: "#ffffff",
  4587. customStyle: "line-height: 12px"
  4588. })
  4589. ])) : vue.createCommentVNode("v-if", true),
  4590. vue.createElementVNode("view", { class: "uv-input__content__subfix-icon" }, [
  4591. vue.renderSlot(_ctx.$slots, "suffix", {}, () => [
  4592. _ctx.suffixIcon ? (vue.openBlock(), vue.createBlock(_component_uv_icon, {
  4593. key: 0,
  4594. name: _ctx.suffixIcon,
  4595. size: "18",
  4596. customStyle: _ctx.suffixIconStyle
  4597. }, null, 8, ["name", "customStyle"])) : vue.createCommentVNode("v-if", true)
  4598. ], true)
  4599. ])
  4600. ])
  4601. ],
  4602. 6
  4603. /* CLASS, STYLE */
  4604. );
  4605. }
  4606. 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"]]);
  4607. const props$7 = {
  4608. props: {
  4609. color: {
  4610. type: String,
  4611. default: "#d6d7d9"
  4612. },
  4613. // 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等
  4614. length: {
  4615. type: [String, Number],
  4616. default: "100%"
  4617. },
  4618. // 线条方向,col-竖向,row-横向
  4619. direction: {
  4620. type: String,
  4621. default: "row"
  4622. },
  4623. // 是否显示细边框
  4624. hairline: {
  4625. type: Boolean,
  4626. default: true
  4627. },
  4628. // 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
  4629. margin: {
  4630. type: [String, Number],
  4631. default: 0
  4632. },
  4633. // 是否虚线,true-虚线,false-实线
  4634. dashed: {
  4635. type: Boolean,
  4636. default: false
  4637. },
  4638. ...(_B = (_A = uni.$uv) == null ? void 0 : _A.props) == null ? void 0 : _B.line
  4639. }
  4640. };
  4641. const _sfc_main$n = {
  4642. name: "uv-line",
  4643. mixins: [mpMixin, mixin, props$7],
  4644. computed: {
  4645. lineStyle() {
  4646. const style = {};
  4647. style.margin = this.margin;
  4648. if (this.direction === "row") {
  4649. style.borderBottomWidth = "1px";
  4650. style.borderBottomStyle = this.dashed ? "dashed" : "solid";
  4651. style.width = this.$uv.addUnit(this.length);
  4652. if (this.hairline)
  4653. style.transform = "scaleY(0.5)";
  4654. } else {
  4655. style.borderLeftWidth = "1px";
  4656. style.borderLeftStyle = this.dashed ? "dashed" : "solid";
  4657. style.height = this.$uv.addUnit(this.length);
  4658. if (this.hairline)
  4659. style.transform = "scaleX(0.5)";
  4660. }
  4661. style.borderColor = this.color;
  4662. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  4663. }
  4664. }
  4665. };
  4666. function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
  4667. return vue.openBlock(), vue.createElementBlock(
  4668. "view",
  4669. {
  4670. class: "uv-line",
  4671. style: vue.normalizeStyle([$options.lineStyle])
  4672. },
  4673. null,
  4674. 4
  4675. /* STYLE */
  4676. );
  4677. }
  4678. 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"]]);
  4679. const props$6 = {
  4680. props: {
  4681. // input的label提示语
  4682. label: {
  4683. type: String,
  4684. default: ""
  4685. },
  4686. // 绑定的值
  4687. prop: {
  4688. type: String,
  4689. default: ""
  4690. },
  4691. // 是否显示表单域的下划线边框
  4692. borderBottom: {
  4693. type: [Boolean],
  4694. default: false
  4695. },
  4696. // label的位置,left-左边,top-上边
  4697. labelPosition: {
  4698. type: String,
  4699. default: ""
  4700. },
  4701. // label的宽度,单位px
  4702. labelWidth: {
  4703. type: [String, Number],
  4704. default: ""
  4705. },
  4706. // 右侧图标
  4707. rightIcon: {
  4708. type: String,
  4709. default: ""
  4710. },
  4711. // 左侧图标
  4712. leftIcon: {
  4713. type: String,
  4714. default: ""
  4715. },
  4716. // 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置
  4717. required: {
  4718. type: Boolean,
  4719. default: false
  4720. },
  4721. leftIconStyle: {
  4722. type: [String, Object],
  4723. default: ""
  4724. },
  4725. ...(_D = (_C = uni.$uv) == null ? void 0 : _C.props) == null ? void 0 : _D.formItem
  4726. }
  4727. };
  4728. const _sfc_main$m = {
  4729. name: "uv-form-item",
  4730. emits: ["click"],
  4731. mixins: [mpMixin, mixin, props$6],
  4732. data() {
  4733. return {
  4734. // 错误提示语
  4735. message: "",
  4736. parentData: {
  4737. // 提示文本的位置
  4738. labelPosition: "left",
  4739. // 提示文本对齐方式
  4740. labelAlign: "left",
  4741. // 提示文本的样式
  4742. labelStyle: {},
  4743. // 提示文本的宽度
  4744. labelWidth: 45,
  4745. // 错误提示方式
  4746. errorType: "message"
  4747. }
  4748. };
  4749. },
  4750. created() {
  4751. this.init();
  4752. },
  4753. methods: {
  4754. init() {
  4755. this.updateParentData();
  4756. if (!this.parent) {
  4757. this.$uv.error("uv-form-item需要结合uv-form组件使用");
  4758. }
  4759. },
  4760. // 获取父组件的参数
  4761. updateParentData() {
  4762. this.getParentData("uv-form");
  4763. },
  4764. // 移除uv-form-item的校验结果
  4765. clearValidate() {
  4766. this.message = null;
  4767. },
  4768. // 清空当前的组件的校验结果,并重置为初始值
  4769. resetField() {
  4770. const value2 = this.$uv.getProperty(this.parent.originalModel, this.prop);
  4771. this.$uv.setProperty(this.parent.model, this.prop, value2);
  4772. this.message = null;
  4773. },
  4774. // 点击组件
  4775. clickHandler() {
  4776. this.$emit("click");
  4777. }
  4778. }
  4779. };
  4780. function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
  4781. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  4782. const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
  4783. const _component_uv_line = resolveEasycom(vue.resolveDynamicComponent("uv-line"), __easycom_5);
  4784. return vue.openBlock(), vue.createElementBlock("view", { class: "uv-form-item" }, [
  4785. vue.createElementVNode(
  4786. "view",
  4787. {
  4788. class: "uv-form-item__body",
  4789. onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args)),
  4790. style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle), {
  4791. flexDirection: (_ctx.labelPosition || $data.parentData.labelPosition) === "left" ? "row" : "column"
  4792. }])
  4793. },
  4794. [
  4795. vue.createCommentVNode(' 微信小程序中,将一个参数设置空字符串,结果会变成字符串"true" '),
  4796. vue.renderSlot(_ctx.$slots, "label", {}, () => [
  4797. _ctx.required || _ctx.leftIcon || _ctx.label ? (vue.openBlock(), vue.createElementBlock(
  4798. "view",
  4799. {
  4800. key: 0,
  4801. class: "uv-form-item__body__left",
  4802. style: vue.normalizeStyle({
  4803. width: _ctx.$uv.addUnit(_ctx.labelWidth || $data.parentData.labelWidth),
  4804. marginBottom: $data.parentData.labelPosition === "left" ? 0 : "5px"
  4805. })
  4806. },
  4807. [
  4808. vue.createCommentVNode(" 为了块对齐 "),
  4809. vue.createElementVNode("view", { class: "uv-form-item__body__left__content" }, [
  4810. vue.createCommentVNode(" nvue不支持伪元素before "),
  4811. _ctx.required ? (vue.openBlock(), vue.createElementBlock("text", {
  4812. key: 0,
  4813. class: "uv-form-item__body__left__content__required"
  4814. }, "*")) : vue.createCommentVNode("v-if", true),
  4815. _ctx.leftIcon ? (vue.openBlock(), vue.createElementBlock("view", {
  4816. key: 1,
  4817. class: "uv-form-item__body__left__content__icon"
  4818. }, [
  4819. vue.createVNode(_component_uv_icon, {
  4820. name: _ctx.leftIcon,
  4821. "custom-style": _ctx.leftIconStyle
  4822. }, null, 8, ["name", "custom-style"])
  4823. ])) : vue.createCommentVNode("v-if", true),
  4824. vue.createElementVNode(
  4825. "text",
  4826. {
  4827. class: "uv-form-item__body__left__content__label",
  4828. style: vue.normalizeStyle([$data.parentData.labelStyle, {
  4829. justifyContent: $data.parentData.labelAlign === "left" ? "flex-start" : $data.parentData.labelAlign === "center" ? "center" : "flex-end"
  4830. }])
  4831. },
  4832. vue.toDisplayString(_ctx.label),
  4833. 5
  4834. /* TEXT, STYLE */
  4835. )
  4836. ])
  4837. ],
  4838. 4
  4839. /* STYLE */
  4840. )) : vue.createCommentVNode("v-if", true)
  4841. ], true),
  4842. vue.createElementVNode("view", { class: "uv-form-item__body__right" }, [
  4843. vue.createElementVNode("view", { class: "uv-form-item__body__right__content" }, [
  4844. vue.createElementVNode("view", { class: "uv-form-item__body__right__content__slot" }, [
  4845. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  4846. ]),
  4847. vue.createElementVNode("view", { class: "item__body__right__content__icon" }, [
  4848. vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
  4849. ])
  4850. ])
  4851. ])
  4852. ],
  4853. 4
  4854. /* STYLE */
  4855. ),
  4856. vue.renderSlot(_ctx.$slots, "error", {}, () => [
  4857. !!$data.message && $data.parentData.errorType === "message" ? (vue.openBlock(), vue.createBlock(_component_uv_transition, {
  4858. key: 0,
  4859. show: true,
  4860. duration: 100,
  4861. mode: "fade"
  4862. }, {
  4863. default: vue.withCtx(() => [
  4864. vue.createElementVNode(
  4865. "text",
  4866. {
  4867. class: "uv-form-item__body__right__message",
  4868. style: vue.normalizeStyle({
  4869. marginLeft: _ctx.$uv.addUnit($data.parentData.labelPosition === "top" ? 0 : _ctx.labelWidth || $data.parentData.labelWidth)
  4870. })
  4871. },
  4872. vue.toDisplayString($data.message),
  4873. 5
  4874. /* TEXT, STYLE */
  4875. )
  4876. ]),
  4877. _: 1
  4878. /* STABLE */
  4879. })) : vue.createCommentVNode("v-if", true)
  4880. ], true),
  4881. _ctx.borderBottom ? (vue.openBlock(), vue.createBlock(_component_uv_line, {
  4882. key: 0,
  4883. color: $data.message && $data.parentData.errorType === "border-bottom" ? "#f56c6c" : "#d6d7d9"
  4884. }, null, 8, ["color"])) : vue.createCommentVNode("v-if", true)
  4885. ]);
  4886. }
  4887. 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"]]);
  4888. const props$5 = {
  4889. props: {
  4890. // 是否细边框
  4891. hairline: {
  4892. type: Boolean,
  4893. default: true
  4894. },
  4895. // 按钮的预置样式,info,primary,error,warning,success
  4896. type: {
  4897. type: String,
  4898. default: "info"
  4899. },
  4900. // 按钮尺寸,large,normal,small,mini
  4901. size: {
  4902. type: String,
  4903. default: "normal"
  4904. },
  4905. // 按钮形状,circle(两边为半圆),square(带圆角)
  4906. shape: {
  4907. type: String,
  4908. default: "square"
  4909. },
  4910. // 按钮是否镂空
  4911. plain: {
  4912. type: Boolean,
  4913. default: false
  4914. },
  4915. // 是否禁止状态
  4916. disabled: {
  4917. type: Boolean,
  4918. default: false
  4919. },
  4920. // 是否加载中
  4921. loading: {
  4922. type: Boolean,
  4923. default: false
  4924. },
  4925. // 加载中提示文字
  4926. loadingText: {
  4927. type: [String, Number],
  4928. default: ""
  4929. },
  4930. // 加载状态图标类型
  4931. loadingMode: {
  4932. type: String,
  4933. default: "spinner"
  4934. },
  4935. // 加载图标大小
  4936. loadingSize: {
  4937. type: [String, Number],
  4938. default: 14
  4939. },
  4940. // 开放能力,具体请看uniapp稳定关于button组件部分说明
  4941. // https://uniapp.dcloud.io/component/button
  4942. openType: {
  4943. type: String,
  4944. default: ""
  4945. },
  4946. // 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
  4947. // 取值为submit(提交表单),reset(重置表单)
  4948. formType: {
  4949. type: String,
  4950. default: ""
  4951. },
  4952. // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
  4953. // 只微信小程序、QQ小程序有效
  4954. appParameter: {
  4955. type: String,
  4956. default: ""
  4957. },
  4958. // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
  4959. hoverStopPropagation: {
  4960. type: Boolean,
  4961. default: true
  4962. },
  4963. // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效
  4964. lang: {
  4965. type: String,
  4966. default: "en"
  4967. },
  4968. // 会话来源,open-type="contact"时有效。只微信小程序有效
  4969. sessionFrom: {
  4970. type: String,
  4971. default: ""
  4972. },
  4973. // 会话内消息卡片标题,open-type="contact"时有效
  4974. // 默认当前标题,只微信小程序有效
  4975. sendMessageTitle: {
  4976. type: String,
  4977. default: ""
  4978. },
  4979. // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效
  4980. // 默认当前分享路径,只微信小程序有效
  4981. sendMessagePath: {
  4982. type: String,
  4983. default: ""
  4984. },
  4985. // 会话内消息卡片图片,open-type="contact"时有效
  4986. // 默认当前页面截图,只微信小程序有效
  4987. sendMessageImg: {
  4988. type: String,
  4989. default: ""
  4990. },
  4991. // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
  4992. // 用户点击后可以快速发送小程序消息,open-type="contact"时有效
  4993. showMessageCard: {
  4994. type: Boolean,
  4995. default: true
  4996. },
  4997. // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
  4998. dataName: {
  4999. type: String,
  5000. default: ""
  5001. },
  5002. // 节流,一定时间内只能触发一次
  5003. throttleTime: {
  5004. type: [String, Number],
  5005. default: 0
  5006. },
  5007. // 按住后多久出现点击态,单位毫秒
  5008. hoverStartTime: {
  5009. type: [String, Number],
  5010. default: 0
  5011. },
  5012. // 手指松开后点击态保留时间,单位毫秒
  5013. hoverStayTime: {
  5014. type: [String, Number],
  5015. default: 200
  5016. },
  5017. // 按钮文字,之所以通过props传入,是因为slot传入的话
  5018. // nvue中无法控制文字的样式
  5019. text: {
  5020. type: [String, Number],
  5021. default: ""
  5022. },
  5023. // 按钮图标
  5024. icon: {
  5025. type: String,
  5026. default: ""
  5027. },
  5028. // 按钮图标大小
  5029. iconSize: {
  5030. type: [String, Number],
  5031. default: ""
  5032. },
  5033. // 按钮图标颜色
  5034. iconColor: {
  5035. type: String,
  5036. default: "#000000"
  5037. },
  5038. // 按钮颜色,支持传入linear-gradient渐变色
  5039. color: {
  5040. type: String,
  5041. default: ""
  5042. },
  5043. // 自定义按钮文本样式
  5044. customTextStyle: {
  5045. type: [Object, String],
  5046. default: () => {
  5047. }
  5048. },
  5049. ...(_F = (_E = uni.$uv) == null ? void 0 : _E.props) == null ? void 0 : _F.button
  5050. }
  5051. };
  5052. const _sfc_main$l = {
  5053. name: "uv-button",
  5054. mixins: [mpMixin, mixin, props$5],
  5055. emits: ["click"],
  5056. data() {
  5057. return {};
  5058. },
  5059. computed: {
  5060. // 生成bem风格的类名
  5061. bemClass() {
  5062. if (!this.color) {
  5063. return this.bem(
  5064. "button",
  5065. ["type", "shape", "size"],
  5066. ["disabled", "plain", "hairline"]
  5067. );
  5068. } else {
  5069. return this.bem(
  5070. "button",
  5071. ["shape", "size"],
  5072. ["disabled", "plain", "hairline"]
  5073. );
  5074. }
  5075. },
  5076. loadingColor() {
  5077. if (this.plain) {
  5078. return this.color ? this.color : "#3c9cff";
  5079. }
  5080. if (this.type === "info") {
  5081. return "#c9c9c9";
  5082. }
  5083. return "rgb(200, 200, 200)";
  5084. },
  5085. iconColorCom() {
  5086. if (this.iconColor)
  5087. return this.iconColor;
  5088. if (this.plain) {
  5089. return this.color ? this.color : this.type;
  5090. } else {
  5091. return this.type === "info" ? "#000000" : "#ffffff";
  5092. }
  5093. },
  5094. baseColor() {
  5095. let style = {};
  5096. if (this.color) {
  5097. style.color = this.plain ? this.color : "white";
  5098. if (!this.plain) {
  5099. style["background-color"] = this.color;
  5100. }
  5101. if (this.color.indexOf("gradient") !== -1) {
  5102. style.borderTopWidth = 0;
  5103. style.borderRightWidth = 0;
  5104. style.borderBottomWidth = 0;
  5105. style.borderLeftWidth = 0;
  5106. if (!this.plain) {
  5107. style.backgroundImage = this.color;
  5108. }
  5109. } else {
  5110. style.borderColor = this.color;
  5111. style.borderWidth = "1px";
  5112. style.borderStyle = "solid";
  5113. }
  5114. }
  5115. return style;
  5116. },
  5117. // nvue版本按钮的字体不会继承父组件的颜色,需要对每一个text组件进行单独的设置
  5118. nvueTextStyle() {
  5119. let style = {};
  5120. if (this.type === "info") {
  5121. style.color = "#323233";
  5122. }
  5123. if (this.color) {
  5124. style.color = this.plain ? this.color : "white";
  5125. }
  5126. style.fontSize = this.textSize + "px";
  5127. return style;
  5128. },
  5129. // 字体大小
  5130. textSize() {
  5131. let fontSize2 = 14, { size } = this;
  5132. if (size === "large")
  5133. fontSize2 = 16;
  5134. if (size === "normal")
  5135. fontSize2 = 14;
  5136. if (size === "small")
  5137. fontSize2 = 12;
  5138. if (size === "mini")
  5139. fontSize2 = 10;
  5140. return fontSize2;
  5141. },
  5142. // 设置图标大小
  5143. getIconSize() {
  5144. const size = this.iconSize ? this.iconSize : this.textSize * 1.35;
  5145. return this.$uv.addUnit(size);
  5146. },
  5147. // 设置外层盒子的宽度,其他样式不需要
  5148. btnWrapperStyle() {
  5149. const style = {};
  5150. const customStyle = this.$uv.addStyle(this.customStyle);
  5151. if (customStyle.width)
  5152. style.width = customStyle.width;
  5153. return style;
  5154. }
  5155. },
  5156. methods: {
  5157. clickHandler() {
  5158. if (!this.disabled && !this.loading) {
  5159. throttle(() => {
  5160. this.$emit("click");
  5161. }, this.throttleTime);
  5162. }
  5163. }
  5164. }
  5165. };
  5166. function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
  5167. const _component_uv_loading_icon = resolveEasycom(vue.resolveDynamicComponent("uv-loading-icon"), __easycom_1$4);
  5168. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  5169. return vue.openBlock(), vue.createElementBlock(
  5170. "view",
  5171. {
  5172. class: "uv-button-wrapper",
  5173. style: vue.normalizeStyle([$options.btnWrapperStyle])
  5174. },
  5175. [
  5176. vue.createElementVNode("button", {
  5177. "hover-start-time": Number(_ctx.hoverStartTime),
  5178. "hover-stay-time": Number(_ctx.hoverStayTime),
  5179. "form-type": _ctx.formType,
  5180. "open-type": _ctx.openType,
  5181. "app-parameter": _ctx.appParameter,
  5182. "hover-stop-propagation": _ctx.hoverStopPropagation,
  5183. "send-message-title": _ctx.sendMessageTitle,
  5184. "send-message-path": _ctx.sendMessagePath,
  5185. lang: _ctx.lang,
  5186. "data-name": _ctx.dataName,
  5187. "session-from": _ctx.sessionFrom,
  5188. "send-message-img": _ctx.sendMessageImg,
  5189. "show-message-card": _ctx.showMessageCard,
  5190. "hover-class": !_ctx.disabled && !_ctx.loading ? "uv-button--active" : "",
  5191. class: vue.normalizeClass(["uv-button uv-reset-button", $options.bemClass]),
  5192. style: vue.normalizeStyle([$options.baseColor, _ctx.$uv.addStyle(_ctx.customStyle)]),
  5193. onClick: _cache[0] || (_cache[0] = (...args) => $options.clickHandler && $options.clickHandler(...args))
  5194. }, [
  5195. _ctx.loading ? (vue.openBlock(), vue.createElementBlock(
  5196. vue.Fragment,
  5197. { key: 0 },
  5198. [
  5199. vue.createVNode(_component_uv_loading_icon, {
  5200. mode: _ctx.loadingMode,
  5201. size: _ctx.loadingSize * 1.15,
  5202. color: $options.loadingColor
  5203. }, null, 8, ["mode", "size", "color"]),
  5204. vue.createElementVNode(
  5205. "text",
  5206. {
  5207. class: "uv-button__loading-text",
  5208. style: vue.normalizeStyle([
  5209. { fontSize: $options.textSize + "px" },
  5210. _ctx.$uv.addStyle(_ctx.customTextStyle)
  5211. ])
  5212. },
  5213. vue.toDisplayString(_ctx.loadingText || _ctx.text),
  5214. 5
  5215. /* TEXT, STYLE */
  5216. )
  5217. ],
  5218. 64
  5219. /* STABLE_FRAGMENT */
  5220. )) : (vue.openBlock(), vue.createElementBlock(
  5221. vue.Fragment,
  5222. { key: 1 },
  5223. [
  5224. _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_uv_icon, {
  5225. key: 0,
  5226. name: _ctx.icon,
  5227. color: $options.iconColorCom,
  5228. size: $options.getIconSize,
  5229. customStyle: { marginRight: "2px" }
  5230. }, null, 8, ["name", "color", "size"])) : vue.createCommentVNode("v-if", true),
  5231. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  5232. vue.createElementVNode(
  5233. "text",
  5234. {
  5235. class: "uv-button__text",
  5236. style: vue.normalizeStyle([
  5237. { fontSize: $options.textSize + "px" },
  5238. _ctx.$uv.addStyle(_ctx.customTextStyle)
  5239. ])
  5240. },
  5241. vue.toDisplayString(_ctx.text),
  5242. 5
  5243. /* TEXT, STYLE */
  5244. )
  5245. ], true),
  5246. vue.renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
  5247. ],
  5248. 64
  5249. /* STABLE_FRAGMENT */
  5250. ))
  5251. ], 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"])
  5252. ],
  5253. 4
  5254. /* STYLE */
  5255. );
  5256. }
  5257. 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"]]);
  5258. const props$4 = {
  5259. props: {
  5260. // 当前form的需要验证字段的集合
  5261. model: {
  5262. type: Object,
  5263. default: () => ({})
  5264. },
  5265. // 验证规则
  5266. rules: {
  5267. type: [Object, Function, Array],
  5268. default: () => ({})
  5269. },
  5270. // 有错误时的提示方式,message-提示信息,toast-进行toast提示
  5271. // border-bottom-下边框呈现红色,none-无提示
  5272. errorType: {
  5273. type: String,
  5274. default: "message"
  5275. },
  5276. // 是否显示表单域的下划线边框
  5277. borderBottom: {
  5278. type: Boolean,
  5279. default: true
  5280. },
  5281. // label的位置,left-左边,top-上边
  5282. labelPosition: {
  5283. type: String,
  5284. default: "left"
  5285. },
  5286. // label的宽度,单位px
  5287. labelWidth: {
  5288. type: [String, Number],
  5289. default: 45
  5290. },
  5291. // lable字体的对齐方式
  5292. labelAlign: {
  5293. type: String,
  5294. default: "left"
  5295. },
  5296. // lable的样式,对象形式
  5297. labelStyle: {
  5298. type: Object,
  5299. default: () => ({})
  5300. },
  5301. ...(_H = (_G = uni.$uv) == null ? void 0 : _G.props) == null ? void 0 : _H.form
  5302. }
  5303. };
  5304. const formatRegExp = /%[sdj%]/g;
  5305. let warning = function warning2() {
  5306. };
  5307. if (typeof process !== "undefined" && process.env && true && typeof window !== "undefined" && typeof document !== "undefined") {
  5308. warning = function warning2(type2, errors) {
  5309. if (typeof console !== "undefined" && console.warn) {
  5310. if (errors.every((e) => typeof e === "string")) {
  5311. formatAppLog("warn", "at uni_modules/uv-form/components/uv-form/valid.js:28", type2, errors);
  5312. }
  5313. }
  5314. };
  5315. }
  5316. function convertFieldsError(errors) {
  5317. if (!errors || !errors.length)
  5318. return null;
  5319. const fields = {};
  5320. errors.forEach((error2) => {
  5321. const { field } = error2;
  5322. fields[field] = fields[field] || [];
  5323. fields[field].push(error2);
  5324. });
  5325. return fields;
  5326. }
  5327. function format$1() {
  5328. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  5329. args[_key] = arguments[_key];
  5330. }
  5331. let i = 1;
  5332. const f = args[0];
  5333. const len = args.length;
  5334. if (typeof f === "function") {
  5335. return f.apply(null, args.slice(1));
  5336. }
  5337. if (typeof f === "string") {
  5338. let str = String(f).replace(formatRegExp, (x) => {
  5339. if (x === "%%") {
  5340. return "%";
  5341. }
  5342. if (i >= len) {
  5343. return x;
  5344. }
  5345. switch (x) {
  5346. case "%s":
  5347. return String(args[i++]);
  5348. case "%d":
  5349. return Number(args[i++]);
  5350. case "%j":
  5351. try {
  5352. return JSON.stringify(args[i++]);
  5353. } catch (_) {
  5354. return "[Circular]";
  5355. }
  5356. break;
  5357. default:
  5358. return x;
  5359. }
  5360. });
  5361. for (let arg = args[i]; i < len; arg = args[++i]) {
  5362. str += ` ${arg}`;
  5363. }
  5364. return str;
  5365. }
  5366. return f;
  5367. }
  5368. function isNativeStringType(type2) {
  5369. return type2 === "string" || type2 === "url" || type2 === "hex" || type2 === "email" || type2 === "pattern";
  5370. }
  5371. function isEmptyValue(value2, type2) {
  5372. if (value2 === void 0 || value2 === null) {
  5373. return true;
  5374. }
  5375. if (type2 === "array" && Array.isArray(value2) && !value2.length) {
  5376. return true;
  5377. }
  5378. if (isNativeStringType(type2) && typeof value2 === "string" && !value2) {
  5379. return true;
  5380. }
  5381. return false;
  5382. }
  5383. function asyncParallelArray(arr, func2, callback) {
  5384. const results = [];
  5385. let total = 0;
  5386. const arrLength = arr.length;
  5387. function count(errors) {
  5388. results.push.apply(results, errors);
  5389. total++;
  5390. if (total === arrLength) {
  5391. callback(results);
  5392. }
  5393. }
  5394. arr.forEach((a) => {
  5395. func2(a, count);
  5396. });
  5397. }
  5398. function asyncSerialArray(arr, func2, callback) {
  5399. let index2 = 0;
  5400. const arrLength = arr.length;
  5401. function next(errors) {
  5402. if (errors && errors.length) {
  5403. callback(errors);
  5404. return;
  5405. }
  5406. const original = index2;
  5407. index2 += 1;
  5408. if (original < arrLength) {
  5409. func2(arr[original], next);
  5410. } else {
  5411. callback([]);
  5412. }
  5413. }
  5414. next([]);
  5415. }
  5416. function flattenObjArr(objArr) {
  5417. const ret = [];
  5418. Object.keys(objArr).forEach((k) => {
  5419. ret.push.apply(ret, objArr[k]);
  5420. });
  5421. return ret;
  5422. }
  5423. function asyncMap(objArr, option, func2, callback) {
  5424. if (option.first) {
  5425. const _pending = new Promise((resolve, reject) => {
  5426. const next = function next2(errors) {
  5427. callback(errors);
  5428. return errors.length ? reject({
  5429. errors,
  5430. fields: convertFieldsError(errors)
  5431. }) : resolve();
  5432. };
  5433. const flattenArr = flattenObjArr(objArr);
  5434. asyncSerialArray(flattenArr, func2, next);
  5435. });
  5436. _pending.catch((e) => e);
  5437. return _pending;
  5438. }
  5439. let firstFields = option.firstFields || [];
  5440. if (firstFields === true) {
  5441. firstFields = Object.keys(objArr);
  5442. }
  5443. const objArrKeys = Object.keys(objArr);
  5444. const objArrLength = objArrKeys.length;
  5445. let total = 0;
  5446. const results = [];
  5447. const pending = new Promise((resolve, reject) => {
  5448. const next = function next2(errors) {
  5449. results.push.apply(results, errors);
  5450. total++;
  5451. if (total === objArrLength) {
  5452. callback(results);
  5453. return results.length ? reject({
  5454. errors: results,
  5455. fields: convertFieldsError(results)
  5456. }) : resolve();
  5457. }
  5458. };
  5459. if (!objArrKeys.length) {
  5460. callback(results);
  5461. resolve();
  5462. }
  5463. objArrKeys.forEach((key) => {
  5464. const arr = objArr[key];
  5465. if (firstFields.indexOf(key) !== -1) {
  5466. asyncSerialArray(arr, func2, next);
  5467. } else {
  5468. asyncParallelArray(arr, func2, next);
  5469. }
  5470. });
  5471. });
  5472. pending.catch((e) => e);
  5473. return pending;
  5474. }
  5475. function complementError(rule) {
  5476. return function(oe) {
  5477. if (oe && oe.message) {
  5478. oe.field = oe.field || rule.fullField;
  5479. return oe;
  5480. }
  5481. return {
  5482. message: typeof oe === "function" ? oe() : oe,
  5483. field: oe.field || rule.fullField
  5484. };
  5485. };
  5486. }
  5487. function deepMerge(target, source) {
  5488. if (source) {
  5489. for (const s in source) {
  5490. if (source.hasOwnProperty(s)) {
  5491. const value2 = source[s];
  5492. if (typeof value2 === "object" && typeof target[s] === "object") {
  5493. target[s] = { ...target[s], ...value2 };
  5494. } else {
  5495. target[s] = value2;
  5496. }
  5497. }
  5498. }
  5499. }
  5500. return target;
  5501. }
  5502. function required(rule, value2, source, errors, options, type2) {
  5503. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value2, type2 || rule.type))) {
  5504. errors.push(format$1(options.messages.required, rule.fullField));
  5505. }
  5506. }
  5507. function whitespace(rule, value2, source, errors, options) {
  5508. if (/^\s+$/.test(value2) || value2 === "") {
  5509. errors.push(format$1(options.messages.whitespace, rule.fullField));
  5510. }
  5511. }
  5512. const pattern = {
  5513. // http://emailregex.com/
  5514. 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,}))$/,
  5515. url: new RegExp(
  5516. "^(?!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]*)?$",
  5517. "i"
  5518. ),
  5519. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  5520. };
  5521. var types = {
  5522. integer: function integer2(value2) {
  5523. return /^(-)?\d+$/.test(value2);
  5524. },
  5525. float: function float(value2) {
  5526. return /^(-)?\d+(\.\d+)?$/.test(value2);
  5527. },
  5528. array: function array2(value2) {
  5529. return Array.isArray(value2);
  5530. },
  5531. regexp: function regexp2(value2) {
  5532. if (value2 instanceof RegExp) {
  5533. return true;
  5534. }
  5535. try {
  5536. return !!new RegExp(value2);
  5537. } catch (e) {
  5538. return false;
  5539. }
  5540. },
  5541. date: function date2(value2) {
  5542. return typeof value2.getTime === "function" && typeof value2.getMonth === "function" && typeof value2.getYear === "function";
  5543. },
  5544. number: function number2(value2) {
  5545. if (isNaN(value2)) {
  5546. return false;
  5547. }
  5548. return typeof +value2 === "number";
  5549. },
  5550. object: function object2(value2) {
  5551. return typeof value2 === "object" && !types.array(value2);
  5552. },
  5553. method: function method2(value2) {
  5554. return typeof value2 === "function";
  5555. },
  5556. email: function email2(value2) {
  5557. return typeof value2 === "string" && !!value2.match(pattern.email) && value2.length < 255;
  5558. },
  5559. url: function url2(value2) {
  5560. return typeof value2 === "string" && !!value2.match(pattern.url);
  5561. },
  5562. hex: function hex(value2) {
  5563. return typeof value2 === "string" && !!value2.match(pattern.hex);
  5564. }
  5565. };
  5566. function type(rule, value2, source, errors, options) {
  5567. if (rule.required && value2 === void 0) {
  5568. required(rule, value2, source, errors, options);
  5569. return;
  5570. }
  5571. const custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"];
  5572. const ruleType = rule.type;
  5573. if (custom.indexOf(ruleType) > -1) {
  5574. if (!types[ruleType](value2)) {
  5575. errors.push(format$1(options.messages.types[ruleType], rule.fullField, rule.type));
  5576. }
  5577. } else if (ruleType && typeof value2 !== rule.type) {
  5578. errors.push(format$1(options.messages.types[ruleType], rule.fullField, rule.type));
  5579. }
  5580. }
  5581. function range(rule, value2, source, errors, options) {
  5582. const len = typeof rule.len === "number";
  5583. const min = typeof rule.min === "number";
  5584. const max = typeof rule.max === "number";
  5585. const spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  5586. let val = value2;
  5587. let key = null;
  5588. const num = typeof value2 === "number";
  5589. const str = typeof value2 === "string";
  5590. const arr = Array.isArray(value2);
  5591. if (num) {
  5592. key = "number";
  5593. } else if (str) {
  5594. key = "string";
  5595. } else if (arr) {
  5596. key = "array";
  5597. }
  5598. if (!key) {
  5599. return false;
  5600. }
  5601. if (arr) {
  5602. val = value2.length;
  5603. }
  5604. if (str) {
  5605. val = value2.replace(spRegexp, "_").length;
  5606. }
  5607. if (len) {
  5608. if (val !== rule.len) {
  5609. errors.push(format$1(options.messages[key].len, rule.fullField, rule.len));
  5610. }
  5611. } else if (min && !max && val < rule.min) {
  5612. errors.push(format$1(options.messages[key].min, rule.fullField, rule.min));
  5613. } else if (max && !min && val > rule.max) {
  5614. errors.push(format$1(options.messages[key].max, rule.fullField, rule.max));
  5615. } else if (min && max && (val < rule.min || val > rule.max)) {
  5616. errors.push(format$1(options.messages[key].range, rule.fullField, rule.min, rule.max));
  5617. }
  5618. }
  5619. const ENUM = "enum";
  5620. function enumerable(rule, value2, source, errors, options) {
  5621. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  5622. if (rule[ENUM].indexOf(value2) === -1) {
  5623. errors.push(format$1(options.messages[ENUM], rule.fullField, rule[ENUM].join(", ")));
  5624. }
  5625. }
  5626. function pattern$1(rule, value2, source, errors, options) {
  5627. if (rule.pattern) {
  5628. if (rule.pattern instanceof RegExp) {
  5629. rule.pattern.lastIndex = 0;
  5630. if (!rule.pattern.test(value2)) {
  5631. errors.push(format$1(options.messages.pattern.mismatch, rule.fullField, value2, rule.pattern));
  5632. }
  5633. } else if (typeof rule.pattern === "string") {
  5634. const _pattern = new RegExp(rule.pattern);
  5635. if (!_pattern.test(value2)) {
  5636. errors.push(format$1(options.messages.pattern.mismatch, rule.fullField, value2, rule.pattern));
  5637. }
  5638. }
  5639. }
  5640. }
  5641. const rules = {
  5642. required,
  5643. whitespace,
  5644. type,
  5645. range,
  5646. enum: enumerable,
  5647. pattern: pattern$1
  5648. };
  5649. function string(rule, value2, callback, source, options) {
  5650. const errors = [];
  5651. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5652. if (validate) {
  5653. if (isEmptyValue(value2, "string") && !rule.required) {
  5654. return callback();
  5655. }
  5656. rules.required(rule, value2, source, errors, options, "string");
  5657. if (!isEmptyValue(value2, "string")) {
  5658. rules.type(rule, value2, source, errors, options);
  5659. rules.range(rule, value2, source, errors, options);
  5660. rules.pattern(rule, value2, source, errors, options);
  5661. if (rule.whitespace === true) {
  5662. rules.whitespace(rule, value2, source, errors, options);
  5663. }
  5664. }
  5665. }
  5666. callback(errors);
  5667. }
  5668. function method(rule, value2, callback, source, options) {
  5669. const errors = [];
  5670. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5671. if (validate) {
  5672. if (isEmptyValue(value2) && !rule.required) {
  5673. return callback();
  5674. }
  5675. rules.required(rule, value2, source, errors, options);
  5676. if (value2 !== void 0) {
  5677. rules.type(rule, value2, source, errors, options);
  5678. }
  5679. }
  5680. callback(errors);
  5681. }
  5682. function number$1(rule, value2, callback, source, options) {
  5683. const errors = [];
  5684. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5685. if (validate) {
  5686. if (value2 === "") {
  5687. value2 = void 0;
  5688. }
  5689. if (isEmptyValue(value2) && !rule.required) {
  5690. return callback();
  5691. }
  5692. rules.required(rule, value2, source, errors, options);
  5693. if (value2 !== void 0) {
  5694. rules.type(rule, value2, source, errors, options);
  5695. rules.range(rule, value2, source, errors, options);
  5696. }
  5697. }
  5698. callback(errors);
  5699. }
  5700. function _boolean(rule, value2, callback, source, options) {
  5701. const errors = [];
  5702. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5703. if (validate) {
  5704. if (isEmptyValue(value2) && !rule.required) {
  5705. return callback();
  5706. }
  5707. rules.required(rule, value2, source, errors, options);
  5708. if (value2 !== void 0) {
  5709. rules.type(rule, value2, source, errors, options);
  5710. }
  5711. }
  5712. callback(errors);
  5713. }
  5714. function regexp(rule, value2, callback, source, options) {
  5715. const errors = [];
  5716. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5717. if (validate) {
  5718. if (isEmptyValue(value2) && !rule.required) {
  5719. return callback();
  5720. }
  5721. rules.required(rule, value2, source, errors, options);
  5722. if (!isEmptyValue(value2)) {
  5723. rules.type(rule, value2, source, errors, options);
  5724. }
  5725. }
  5726. callback(errors);
  5727. }
  5728. function integer(rule, value2, callback, source, options) {
  5729. const errors = [];
  5730. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5731. if (validate) {
  5732. if (isEmptyValue(value2) && !rule.required) {
  5733. return callback();
  5734. }
  5735. rules.required(rule, value2, source, errors, options);
  5736. if (value2 !== void 0) {
  5737. rules.type(rule, value2, source, errors, options);
  5738. rules.range(rule, value2, source, errors, options);
  5739. }
  5740. }
  5741. callback(errors);
  5742. }
  5743. function floatFn(rule, value2, callback, source, options) {
  5744. const errors = [];
  5745. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5746. if (validate) {
  5747. if (isEmptyValue(value2) && !rule.required) {
  5748. return callback();
  5749. }
  5750. rules.required(rule, value2, source, errors, options);
  5751. if (value2 !== void 0) {
  5752. rules.type(rule, value2, source, errors, options);
  5753. rules.range(rule, value2, source, errors, options);
  5754. }
  5755. }
  5756. callback(errors);
  5757. }
  5758. function array(rule, value2, callback, source, options) {
  5759. const errors = [];
  5760. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5761. if (validate) {
  5762. if (isEmptyValue(value2, "array") && !rule.required) {
  5763. return callback();
  5764. }
  5765. rules.required(rule, value2, source, errors, options, "array");
  5766. if (!isEmptyValue(value2, "array")) {
  5767. rules.type(rule, value2, source, errors, options);
  5768. rules.range(rule, value2, source, errors, options);
  5769. }
  5770. }
  5771. callback(errors);
  5772. }
  5773. function object(rule, value2, callback, source, options) {
  5774. const errors = [];
  5775. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5776. if (validate) {
  5777. if (isEmptyValue(value2) && !rule.required) {
  5778. return callback();
  5779. }
  5780. rules.required(rule, value2, source, errors, options);
  5781. if (value2 !== void 0) {
  5782. rules.type(rule, value2, source, errors, options);
  5783. }
  5784. }
  5785. callback(errors);
  5786. }
  5787. const ENUM$1 = "enum";
  5788. function enumerable$1(rule, value2, callback, source, options) {
  5789. const errors = [];
  5790. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5791. if (validate) {
  5792. if (isEmptyValue(value2) && !rule.required) {
  5793. return callback();
  5794. }
  5795. rules.required(rule, value2, source, errors, options);
  5796. if (value2 !== void 0) {
  5797. rules[ENUM$1](rule, value2, source, errors, options);
  5798. }
  5799. }
  5800. callback(errors);
  5801. }
  5802. function pattern$2(rule, value2, callback, source, options) {
  5803. const errors = [];
  5804. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5805. if (validate) {
  5806. if (isEmptyValue(value2, "string") && !rule.required) {
  5807. return callback();
  5808. }
  5809. rules.required(rule, value2, source, errors, options);
  5810. if (!isEmptyValue(value2, "string")) {
  5811. rules.pattern(rule, value2, source, errors, options);
  5812. }
  5813. }
  5814. callback(errors);
  5815. }
  5816. function date(rule, value2, callback, source, options) {
  5817. const errors = [];
  5818. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5819. if (validate) {
  5820. if (isEmptyValue(value2) && !rule.required) {
  5821. return callback();
  5822. }
  5823. rules.required(rule, value2, source, errors, options);
  5824. if (!isEmptyValue(value2)) {
  5825. let dateObject;
  5826. if (typeof value2 === "number") {
  5827. dateObject = new Date(value2);
  5828. } else {
  5829. dateObject = value2;
  5830. }
  5831. rules.type(rule, dateObject, source, errors, options);
  5832. if (dateObject) {
  5833. rules.range(rule, dateObject.getTime(), source, errors, options);
  5834. }
  5835. }
  5836. }
  5837. callback(errors);
  5838. }
  5839. function required$1(rule, value2, callback, source, options) {
  5840. const errors = [];
  5841. const type2 = Array.isArray(value2) ? "array" : typeof value2;
  5842. rules.required(rule, value2, source, errors, options, type2);
  5843. callback(errors);
  5844. }
  5845. function type$1(rule, value2, callback, source, options) {
  5846. const ruleType = rule.type;
  5847. const errors = [];
  5848. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5849. if (validate) {
  5850. if (isEmptyValue(value2, ruleType) && !rule.required) {
  5851. return callback();
  5852. }
  5853. rules.required(rule, value2, source, errors, options, ruleType);
  5854. if (!isEmptyValue(value2, ruleType)) {
  5855. rules.type(rule, value2, source, errors, options);
  5856. }
  5857. }
  5858. callback(errors);
  5859. }
  5860. function any(rule, value2, callback, source, options) {
  5861. const errors = [];
  5862. const validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5863. if (validate) {
  5864. if (isEmptyValue(value2) && !rule.required) {
  5865. return callback();
  5866. }
  5867. rules.required(rule, value2, source, errors, options);
  5868. }
  5869. callback(errors);
  5870. }
  5871. const validators = {
  5872. string,
  5873. method,
  5874. number: number$1,
  5875. boolean: _boolean,
  5876. regexp,
  5877. integer,
  5878. float: floatFn,
  5879. array,
  5880. object,
  5881. enum: enumerable$1,
  5882. pattern: pattern$2,
  5883. date,
  5884. url: type$1,
  5885. hex: type$1,
  5886. email: type$1,
  5887. required: required$1,
  5888. any
  5889. };
  5890. function newMessages() {
  5891. return {
  5892. default: "Validation error on field %s",
  5893. required: "%s is required",
  5894. enum: "%s must be one of %s",
  5895. whitespace: "%s cannot be empty",
  5896. date: {
  5897. format: "%s date %s is invalid for format %s",
  5898. parse: "%s date could not be parsed, %s is invalid ",
  5899. invalid: "%s date %s is invalid"
  5900. },
  5901. types: {
  5902. string: "%s is not a %s",
  5903. method: "%s is not a %s (function)",
  5904. array: "%s is not an %s",
  5905. object: "%s is not an %s",
  5906. number: "%s is not a %s",
  5907. date: "%s is not a %s",
  5908. boolean: "%s is not a %s",
  5909. integer: "%s is not an %s",
  5910. float: "%s is not a %s",
  5911. regexp: "%s is not a valid %s",
  5912. email: "%s is not a valid %s",
  5913. url: "%s is not a valid %s",
  5914. hex: "%s is not a valid %s"
  5915. },
  5916. string: {
  5917. len: "%s must be exactly %s characters",
  5918. min: "%s must be at least %s characters",
  5919. max: "%s cannot be longer than %s characters",
  5920. range: "%s must be between %s and %s characters"
  5921. },
  5922. number: {
  5923. len: "%s must equal %s",
  5924. min: "%s cannot be less than %s",
  5925. max: "%s cannot be greater than %s",
  5926. range: "%s must be between %s and %s"
  5927. },
  5928. array: {
  5929. len: "%s must be exactly %s in length",
  5930. min: "%s cannot be less than %s in length",
  5931. max: "%s cannot be greater than %s in length",
  5932. range: "%s must be between %s and %s in length"
  5933. },
  5934. pattern: {
  5935. mismatch: "%s value %s does not match pattern %s"
  5936. },
  5937. clone: function clone() {
  5938. const cloned = JSON.parse(JSON.stringify(this));
  5939. cloned.clone = this.clone;
  5940. return cloned;
  5941. }
  5942. };
  5943. }
  5944. const messages$1 = newMessages();
  5945. function Schema(descriptor) {
  5946. this.rules = null;
  5947. this._messages = messages$1;
  5948. this.define(descriptor);
  5949. }
  5950. Schema.prototype = {
  5951. messages: function messages2(_messages) {
  5952. if (_messages) {
  5953. this._messages = deepMerge(newMessages(), _messages);
  5954. }
  5955. return this._messages;
  5956. },
  5957. define: function define(rules2) {
  5958. if (!rules2) {
  5959. throw new Error("Cannot configure a schema with no rules");
  5960. }
  5961. if (typeof rules2 !== "object" || Array.isArray(rules2)) {
  5962. throw new Error("Rules must be an object");
  5963. }
  5964. this.rules = {};
  5965. let z;
  5966. let item;
  5967. for (z in rules2) {
  5968. if (rules2.hasOwnProperty(z)) {
  5969. item = rules2[z];
  5970. this.rules[z] = Array.isArray(item) ? item : [item];
  5971. }
  5972. }
  5973. },
  5974. validate: function validate(source_, o, oc) {
  5975. const _this = this;
  5976. if (o === void 0) {
  5977. o = {};
  5978. }
  5979. if (oc === void 0) {
  5980. oc = function oc2() {
  5981. };
  5982. }
  5983. let source = source_;
  5984. let options = o;
  5985. let callback = oc;
  5986. if (typeof options === "function") {
  5987. callback = options;
  5988. options = {};
  5989. }
  5990. if (!this.rules || Object.keys(this.rules).length === 0) {
  5991. if (callback) {
  5992. callback();
  5993. }
  5994. return Promise.resolve();
  5995. }
  5996. function complete(results) {
  5997. let i;
  5998. let errors = [];
  5999. let fields = {};
  6000. function add(e) {
  6001. if (Array.isArray(e)) {
  6002. let _errors;
  6003. errors = (_errors = errors).concat.apply(_errors, e);
  6004. } else {
  6005. errors.push(e);
  6006. }
  6007. }
  6008. for (i = 0; i < results.length; i++) {
  6009. add(results[i]);
  6010. }
  6011. if (!errors.length) {
  6012. errors = null;
  6013. fields = null;
  6014. } else {
  6015. fields = convertFieldsError(errors);
  6016. }
  6017. callback(errors, fields);
  6018. }
  6019. if (options.messages) {
  6020. let messages$1$1 = this.messages();
  6021. if (messages$1$1 === messages$1) {
  6022. messages$1$1 = newMessages();
  6023. }
  6024. deepMerge(messages$1$1, options.messages);
  6025. options.messages = messages$1$1;
  6026. } else {
  6027. options.messages = this.messages();
  6028. }
  6029. let arr;
  6030. let value2;
  6031. const series = {};
  6032. const keys = options.keys || Object.keys(this.rules);
  6033. keys.forEach((z) => {
  6034. arr = _this.rules[z];
  6035. value2 = source[z];
  6036. arr.forEach((r) => {
  6037. let rule = r;
  6038. if (typeof rule.transform === "function") {
  6039. if (source === source_) {
  6040. source = { ...source };
  6041. }
  6042. value2 = source[z] = rule.transform(value2);
  6043. }
  6044. if (typeof rule === "function") {
  6045. rule = {
  6046. validator: rule
  6047. };
  6048. } else {
  6049. rule = { ...rule };
  6050. }
  6051. rule.validator = _this.getValidationMethod(rule);
  6052. rule.field = z;
  6053. rule.fullField = rule.fullField || z;
  6054. rule.type = _this.getType(rule);
  6055. if (!rule.validator) {
  6056. return;
  6057. }
  6058. series[z] = series[z] || [];
  6059. series[z].push({
  6060. rule,
  6061. value: value2,
  6062. source,
  6063. field: z
  6064. });
  6065. });
  6066. });
  6067. const errorFields = {};
  6068. return asyncMap(series, options, (data, doIt) => {
  6069. const { rule } = data;
  6070. let deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
  6071. deep = deep && (rule.required || !rule.required && data.value);
  6072. rule.field = data.field;
  6073. function addFullfield(key, schema) {
  6074. return { ...schema, fullField: `${rule.fullField}.${key}` };
  6075. }
  6076. function cb(e) {
  6077. if (e === void 0) {
  6078. e = [];
  6079. }
  6080. let errors = e;
  6081. if (!Array.isArray(errors)) {
  6082. errors = [errors];
  6083. }
  6084. if (!options.suppressWarning && errors.length) {
  6085. Schema.warning("async-validator:", errors);
  6086. }
  6087. if (errors.length && rule.message) {
  6088. errors = [].concat(rule.message);
  6089. }
  6090. errors = errors.map(complementError(rule));
  6091. if (options.first && errors.length) {
  6092. errorFields[rule.field] = 1;
  6093. return doIt(errors);
  6094. }
  6095. if (!deep) {
  6096. doIt(errors);
  6097. } else {
  6098. if (rule.required && !data.value) {
  6099. if (rule.message) {
  6100. errors = [].concat(rule.message).map(complementError(rule));
  6101. } else if (options.error) {
  6102. errors = [options.error(rule, format$1(options.messages.required, rule.field))];
  6103. } else {
  6104. errors = [];
  6105. }
  6106. return doIt(errors);
  6107. }
  6108. let fieldsSchema = {};
  6109. if (rule.defaultField) {
  6110. for (const k in data.value) {
  6111. if (data.value.hasOwnProperty(k)) {
  6112. fieldsSchema[k] = rule.defaultField;
  6113. }
  6114. }
  6115. }
  6116. fieldsSchema = { ...fieldsSchema, ...data.rule.fields };
  6117. for (const f in fieldsSchema) {
  6118. if (fieldsSchema.hasOwnProperty(f)) {
  6119. const fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  6120. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  6121. }
  6122. }
  6123. const schema = new Schema(fieldsSchema);
  6124. schema.messages(options.messages);
  6125. if (data.rule.options) {
  6126. data.rule.options.messages = options.messages;
  6127. data.rule.options.error = options.error;
  6128. }
  6129. schema.validate(data.value, data.rule.options || options, (errs) => {
  6130. const finalErrors = [];
  6131. if (errors && errors.length) {
  6132. finalErrors.push.apply(finalErrors, errors);
  6133. }
  6134. if (errs && errs.length) {
  6135. finalErrors.push.apply(finalErrors, errs);
  6136. }
  6137. doIt(finalErrors.length ? finalErrors : null);
  6138. });
  6139. }
  6140. }
  6141. let res;
  6142. if (rule.asyncValidator) {
  6143. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  6144. } else if (rule.validator) {
  6145. res = rule.validator(rule, data.value, cb, data.source, options);
  6146. if (res === true) {
  6147. cb();
  6148. } else if (res === false) {
  6149. cb(rule.message || `${rule.field} fails`);
  6150. } else if (res instanceof Array) {
  6151. cb(res);
  6152. } else if (res instanceof Error) {
  6153. cb(res.message);
  6154. }
  6155. }
  6156. if (res && res.then) {
  6157. res.then(() => cb(), (e) => cb(e));
  6158. }
  6159. }, (results) => {
  6160. complete(results);
  6161. });
  6162. },
  6163. getType: function getType(rule) {
  6164. if (rule.type === void 0 && rule.pattern instanceof RegExp) {
  6165. rule.type = "pattern";
  6166. }
  6167. if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) {
  6168. throw new Error(format$1("Unknown rule type %s", rule.type));
  6169. }
  6170. return rule.type || "string";
  6171. },
  6172. getValidationMethod: function getValidationMethod(rule) {
  6173. if (typeof rule.validator === "function") {
  6174. return rule.validator;
  6175. }
  6176. const keys = Object.keys(rule);
  6177. const messageIndex = keys.indexOf("message");
  6178. if (messageIndex !== -1) {
  6179. keys.splice(messageIndex, 1);
  6180. }
  6181. if (keys.length === 1 && keys[0] === "required") {
  6182. return validators.required;
  6183. }
  6184. return validators[this.getType(rule)] || false;
  6185. }
  6186. };
  6187. Schema.register = function register2(type2, validator) {
  6188. if (typeof validator !== "function") {
  6189. throw new Error("Cannot register a validator by type, validator is not a function");
  6190. }
  6191. validators[type2] = validator;
  6192. };
  6193. Schema.warning = warning;
  6194. Schema.messages = messages$1;
  6195. Schema.warning = function() {
  6196. };
  6197. const _sfc_main$k = {
  6198. name: "uv-form",
  6199. mixins: [mpMixin, mixin, props$4],
  6200. provide() {
  6201. return {
  6202. uForm: this
  6203. };
  6204. },
  6205. data() {
  6206. return {
  6207. formRules: {},
  6208. // 规则校验器
  6209. validator: {},
  6210. // 原始的model快照,用于resetFields方法重置表单时使用
  6211. originalModel: null
  6212. };
  6213. },
  6214. watch: {
  6215. // 监听规则的变化
  6216. rules: {
  6217. immediate: true,
  6218. handler(n2) {
  6219. this.setRules(n2);
  6220. }
  6221. },
  6222. // 监听属性的变化,通知子组件uv-form-item重新获取信息
  6223. propsChange(n2) {
  6224. var _a;
  6225. if ((_a = this.children) == null ? void 0 : _a.length) {
  6226. this.children.map((child) => {
  6227. typeof child.updateParentData == "function" && child.updateParentData();
  6228. });
  6229. }
  6230. },
  6231. // 监听model的初始值作为重置表单的快照
  6232. model: {
  6233. immediate: true,
  6234. handler(n2) {
  6235. if (!this.originalModel) {
  6236. this.originalModel = this.$uv.deepClone(n2);
  6237. }
  6238. }
  6239. }
  6240. },
  6241. computed: {
  6242. propsChange() {
  6243. return [
  6244. this.errorType,
  6245. this.borderBottom,
  6246. this.labelPosition,
  6247. this.labelWidth,
  6248. this.labelAlign,
  6249. this.labelStyle
  6250. ];
  6251. }
  6252. },
  6253. created() {
  6254. this.children = [];
  6255. },
  6256. methods: {
  6257. // 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则
  6258. setRules(rules2) {
  6259. if (Object.keys(rules2).length === 0)
  6260. return;
  6261. if (Object.keys(this.model).length === 0) {
  6262. this.$uv.error("设置rules,model必须设置!如果已经设置,请刷新页面。");
  6263. return;
  6264. }
  6265. this.formRules = rules2;
  6266. this.validator = new Schema(rules2);
  6267. },
  6268. // 清空所有uv-form-item组件的内容,本质上是调用了uv-form-item组件中的resetField()方法
  6269. resetFields() {
  6270. this.resetModel();
  6271. },
  6272. // 重置model为初始值的快照
  6273. resetModel(obj) {
  6274. this.children.map((child) => {
  6275. const prop = child == null ? void 0 : child.prop;
  6276. const value2 = this.$uv.getProperty(this.originalModel, prop);
  6277. this.$uv.setProperty(this.model, prop, value2);
  6278. });
  6279. },
  6280. // 清空校验结果
  6281. clearValidate(props2) {
  6282. props2 = [].concat(props2);
  6283. this.children.map((child) => {
  6284. if (props2[0] === void 0 || props2.includes(child.prop)) {
  6285. child.message = null;
  6286. }
  6287. });
  6288. },
  6289. // 对部分表单字段进行校验
  6290. async validateField(value2, callback, event = null) {
  6291. this.$nextTick(() => {
  6292. const errorsRes = [];
  6293. value2 = [].concat(value2);
  6294. this.children.map((child) => {
  6295. const childErrors = [];
  6296. if (value2.includes(child.prop)) {
  6297. const propertyVal = this.$uv.getProperty(
  6298. this.model,
  6299. child.prop
  6300. );
  6301. const propertyChain = child.prop.split(".");
  6302. const propertyName = propertyChain[propertyChain.length - 1];
  6303. const rule = this.formRules[child.prop];
  6304. if (!rule)
  6305. return;
  6306. const rules2 = [].concat(rule);
  6307. for (let i = 0; i < rules2.length; i++) {
  6308. const ruleItem = rules2[i];
  6309. const trigger = [].concat(ruleItem == null ? void 0 : ruleItem.trigger);
  6310. if (event && !trigger.includes(event))
  6311. continue;
  6312. const validator = new Schema({
  6313. [propertyName]: ruleItem
  6314. });
  6315. validator.validate(
  6316. {
  6317. [propertyName]: propertyVal
  6318. },
  6319. (errors, fields) => {
  6320. if (this.$uv.test.array(errors)) {
  6321. errorsRes.push(...errors);
  6322. childErrors.push(...errors);
  6323. }
  6324. this.$nextTick(() => {
  6325. var _a, _b;
  6326. child.message = ((_a = childErrors[0]) == null ? void 0 : _a.message) ? (_b = childErrors[0]) == null ? void 0 : _b.message : null;
  6327. });
  6328. }
  6329. );
  6330. }
  6331. }
  6332. });
  6333. typeof callback === "function" && callback(errorsRes);
  6334. });
  6335. },
  6336. // 校验全部数据
  6337. validate(callback) {
  6338. return new Promise((resolve, reject) => {
  6339. this.$nextTick(() => {
  6340. const formItemProps = this.children.map(
  6341. (item) => item.prop
  6342. );
  6343. this.validateField(formItemProps, (errors) => {
  6344. if (errors.length) {
  6345. this.errorType === "toast" && this.$uv.toast(errors[0].message);
  6346. reject(errors);
  6347. } else {
  6348. resolve(true);
  6349. }
  6350. });
  6351. });
  6352. });
  6353. }
  6354. }
  6355. };
  6356. function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
  6357. return vue.openBlock(), vue.createElementBlock("view", { class: "uv-form" }, [
  6358. vue.renderSlot(_ctx.$slots, "default")
  6359. ]);
  6360. }
  6361. 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"]]);
  6362. function login$3(data, e) {
  6363. let url2 = baseUrl + "/index.php/index/Me/subuserloginbytelno";
  6364. dorequest(
  6365. "post",
  6366. url2,
  6367. {
  6368. telno: data.telno,
  6369. pw: data.pw
  6370. }
  6371. ).then((res) => {
  6372. res = res.data;
  6373. if (0 == res.code) {
  6374. e.$refs.toast.show({
  6375. type: "error",
  6376. message: res.errmsg
  6377. });
  6378. }
  6379. if (200 == res.code) {
  6380. let userinfo = res.resultData;
  6381. userinfo.fmembercount = 4;
  6382. userinfo.fmemberid = 0;
  6383. saveuserinfo(userinfo);
  6384. uni.redirectTo({
  6385. url: "/pages/index/index"
  6386. });
  6387. }
  6388. });
  6389. }
  6390. function register$3(data, e, callback = null) {
  6391. let url2 = baseUrl + "/index.php/index/Me/subnewusername";
  6392. return dorequest(
  6393. "post",
  6394. url2,
  6395. {
  6396. telno: data.telno,
  6397. userpw: data.userpw
  6398. }
  6399. );
  6400. }
  6401. const _sfc_main$j = {
  6402. data() {
  6403. return {
  6404. throttleTime: 1,
  6405. logininfo: {
  6406. telno: "",
  6407. pw: ""
  6408. },
  6409. rules: {
  6410. "telno": [
  6411. {
  6412. type: "string",
  6413. required: true,
  6414. message: this.$t("telno_null"),
  6415. trigger: ["blur", "change"]
  6416. },
  6417. {
  6418. pattern: /\d{5,}/,
  6419. message: this.$t("telno_error"),
  6420. trigger: ["blur", "change"]
  6421. }
  6422. ],
  6423. "pw": {
  6424. type: "string",
  6425. required: true,
  6426. message: this.$t("password_null"),
  6427. trigger: ["blur", "change"]
  6428. }
  6429. },
  6430. showpasswod: false,
  6431. passwordtype: "password"
  6432. };
  6433. },
  6434. methods: {
  6435. submit() {
  6436. var that = this;
  6437. this.$refs.form.validate().then((res) => {
  6438. login$3(this.logininfo, that);
  6439. }).catch((errors) => {
  6440. formatAppLog("log", "at pages/login/login.vue:77", errors);
  6441. });
  6442. },
  6443. setshowpasswod() {
  6444. this.showpasswod = !this.showpasswod;
  6445. if (this.showpasswod) {
  6446. this.passwordtype = "text";
  6447. } else {
  6448. this.passwordtype = "password";
  6449. }
  6450. },
  6451. toregister() {
  6452. uni.navigateTo({
  6453. url: "/pages/register/register"
  6454. });
  6455. }
  6456. },
  6457. mounted() {
  6458. uni.setNavigationBarTitle({
  6459. title: this.$t("login")
  6460. });
  6461. this.throttleTime = getApp().globalData.throttleTime;
  6462. },
  6463. created() {
  6464. }
  6465. };
  6466. function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
  6467. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  6468. const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
  6469. const _component_uv_input = resolveEasycom(vue.resolveDynamicComponent("uv-input"), __easycom_6$1);
  6470. const _component_uv_form_item = resolveEasycom(vue.resolveDynamicComponent("uv-form-item"), __easycom_3);
  6471. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  6472. const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
  6473. const _component_uv_form = resolveEasycom(vue.resolveDynamicComponent("uv-form"), __easycom_6);
  6474. const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
  6475. return vue.openBlock(), vue.createElementBlock(
  6476. vue.Fragment,
  6477. null,
  6478. [
  6479. vue.createVNode(
  6480. _component_uv_toast,
  6481. { ref: "toast" },
  6482. null,
  6483. 512
  6484. /* NEED_PATCH */
  6485. ),
  6486. vue.createElementVNode("view", { class: "page" }, [
  6487. vue.createVNode(_component_uv_row, {
  6488. justify: "space-between",
  6489. customStyle: "margin-top: 35%",
  6490. class: "form"
  6491. }, {
  6492. default: vue.withCtx(() => [
  6493. vue.createVNode(_component_uv_col, {
  6494. span: "10",
  6495. offset: "1"
  6496. }, {
  6497. default: vue.withCtx(() => [
  6498. vue.createVNode(_component_uv_form, {
  6499. labelPosition: "left",
  6500. model: $data.logininfo,
  6501. rules: $data.rules,
  6502. ref: "form"
  6503. }, {
  6504. default: vue.withCtx(() => [
  6505. vue.createVNode(_component_uv_col, {
  6506. span: "10",
  6507. offset: "1"
  6508. }, {
  6509. default: vue.withCtx(() => [
  6510. vue.createTextVNode(
  6511. vue.toDisplayString(_ctx.$t("telno")),
  6512. 1
  6513. /* TEXT */
  6514. )
  6515. ]),
  6516. _: 1
  6517. /* STABLE */
  6518. }),
  6519. vue.createVNode(_component_uv_col, {
  6520. span: "10",
  6521. offset: "1"
  6522. }, {
  6523. default: vue.withCtx(() => [
  6524. vue.createVNode(_component_uv_form_item, {
  6525. prop: "telno",
  6526. borderBottom: ""
  6527. }, {
  6528. default: vue.withCtx(() => [
  6529. vue.createVNode(_component_uv_input, {
  6530. modelValue: $data.logininfo.telno,
  6531. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.logininfo.telno = $event),
  6532. modelModifiers: { trim: true },
  6533. border: "none"
  6534. }, null, 8, ["modelValue"])
  6535. ]),
  6536. _: 1
  6537. /* STABLE */
  6538. })
  6539. ]),
  6540. _: 1
  6541. /* STABLE */
  6542. }),
  6543. vue.createVNode(_component_uv_col, {
  6544. span: "10",
  6545. offset: "1",
  6546. customStyle: "margin-top: 20px"
  6547. }, {
  6548. default: vue.withCtx(() => [
  6549. vue.createTextVNode(
  6550. vue.toDisplayString(_ctx.$t("password")),
  6551. 1
  6552. /* TEXT */
  6553. )
  6554. ]),
  6555. _: 1
  6556. /* STABLE */
  6557. }),
  6558. vue.createVNode(_component_uv_col, {
  6559. span: "10",
  6560. offset: "1"
  6561. }, {
  6562. default: vue.withCtx(() => [
  6563. vue.createVNode(_component_uv_form_item, {
  6564. prop: "pw",
  6565. borderBottom: ""
  6566. }, {
  6567. right: vue.withCtx(() => [
  6568. vue.withDirectives(vue.createVNode(_component_uv_icon, {
  6569. name: "eye-off-outline",
  6570. color: "#2979ff",
  6571. size: "18",
  6572. onClick: $options.setshowpasswod
  6573. }, null, 8, ["onClick"]), [
  6574. [vue.vShow, !$data.showpasswod]
  6575. ]),
  6576. vue.withDirectives(vue.createVNode(_component_uv_icon, {
  6577. name: "eye",
  6578. color: "#2979ff",
  6579. size: "18",
  6580. onClick: $options.setshowpasswod
  6581. }, null, 8, ["onClick"]), [
  6582. [vue.vShow, $data.showpasswod]
  6583. ])
  6584. ]),
  6585. default: vue.withCtx(() => [
  6586. vue.createVNode(_component_uv_input, {
  6587. modelValue: $data.logininfo.pw,
  6588. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.logininfo.pw = $event),
  6589. modelModifiers: { trim: true },
  6590. type: $data.passwordtype,
  6591. border: "none"
  6592. }, null, 8, ["modelValue", "type"])
  6593. ]),
  6594. _: 1
  6595. /* STABLE */
  6596. })
  6597. ]),
  6598. _: 1
  6599. /* STABLE */
  6600. }),
  6601. vue.createVNode(_component_uv_col, {
  6602. span: "10",
  6603. offset: "1"
  6604. }, {
  6605. default: vue.withCtx(() => [
  6606. vue.createVNode(_component_uv_button, {
  6607. type: "primary",
  6608. throttleTime: $data.throttleTime,
  6609. text: _ctx.$t("login"),
  6610. customStyle: "margin-top: 2rem",
  6611. onClick: $options.submit
  6612. }, null, 8, ["throttleTime", "text", "onClick"])
  6613. ]),
  6614. _: 1
  6615. /* STABLE */
  6616. })
  6617. ]),
  6618. _: 1
  6619. /* STABLE */
  6620. }, 8, ["model", "rules"]),
  6621. vue.createVNode(_component_uv_col, {
  6622. span: "10",
  6623. offset: "1"
  6624. }, {
  6625. default: vue.withCtx(() => [
  6626. vue.createVNode(_component_uv_button, {
  6627. type: "primary",
  6628. plain: true,
  6629. text: _ctx.$t("register"),
  6630. customStyle: "margin-top: 20px",
  6631. onClick: $options.toregister
  6632. }, null, 8, ["text", "onClick"])
  6633. ]),
  6634. _: 1
  6635. /* STABLE */
  6636. })
  6637. ]),
  6638. _: 1
  6639. /* STABLE */
  6640. })
  6641. ]),
  6642. _: 1
  6643. /* STABLE */
  6644. })
  6645. ])
  6646. ],
  6647. 64
  6648. /* STABLE_FRAGMENT */
  6649. );
  6650. }
  6651. const PagesLoginLogin = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i], ["__file", "D:/workspace/uniapp/health2/pages/login/login.vue"]]);
  6652. const _sfc_main$i = {
  6653. data() {
  6654. return {
  6655. throttleTime: 1,
  6656. logininfo: {
  6657. telno: "",
  6658. pw1: "",
  6659. pw2: ""
  6660. },
  6661. rules: {
  6662. "telno": [
  6663. {
  6664. type: "string",
  6665. required: true,
  6666. message: this.$t("telno_null"),
  6667. trigger: ["blur"]
  6668. },
  6669. {
  6670. pattern: /\d{5,}/,
  6671. message: this.$t("telno_error"),
  6672. trigger: ["blur"]
  6673. }
  6674. ],
  6675. "pw1": {
  6676. type: "string",
  6677. required: true,
  6678. message: this.$t("password_null"),
  6679. trigger: ["blur"]
  6680. },
  6681. "pw2": [{
  6682. type: "string",
  6683. required: true,
  6684. message: this.$t("password_null"),
  6685. trigger: ["blur"]
  6686. }, {
  6687. validator: (rule, value2, callback) => {
  6688. if (value2 != this.logininfo.pw1) {
  6689. return false;
  6690. }
  6691. return true;
  6692. },
  6693. message: this.$t("password_repeat_error"),
  6694. trigger: ["blur"]
  6695. }]
  6696. },
  6697. showpasswod1: false,
  6698. passwordtype1: "password",
  6699. showpasswod2: false,
  6700. passwordtype2: "password"
  6701. };
  6702. },
  6703. methods: {
  6704. submit() {
  6705. var that = this;
  6706. this.$refs.form.validate().then((res) => {
  6707. let data = { telno: that.logininfo.telno, userpw: that.logininfo.pw1 };
  6708. register$3(data).then((res2) => {
  6709. res2 = res2.data;
  6710. if (0 == res2.code) {
  6711. that.$refs.toast.show({
  6712. type: "error",
  6713. message: that.$t("register_error")
  6714. });
  6715. }
  6716. if (200 == res2.code) {
  6717. let data2 = { telno: that.logininfo.telno, pw: that.logininfo.pw1 };
  6718. login$3(data2, that);
  6719. }
  6720. });
  6721. }).catch((errors) => {
  6722. formatAppLog("log", "at pages/register/register.vue:123", errors);
  6723. });
  6724. },
  6725. setshowpasswod1() {
  6726. this.showpasswod1 = !this.showpasswod1;
  6727. if (this.showpasswod1) {
  6728. this.passwordtype1 = "text";
  6729. } else {
  6730. this.passwordtype1 = "password";
  6731. }
  6732. },
  6733. setshowpasswod2() {
  6734. this.showpasswod2 = !this.showpasswod2;
  6735. if (this.showpasswod2) {
  6736. this.passwordtype2 = "text";
  6737. } else {
  6738. this.passwordtype2 = "password";
  6739. }
  6740. },
  6741. tolgoin() {
  6742. uni.navigateTo({
  6743. url: "/pages/login/login"
  6744. });
  6745. }
  6746. },
  6747. mounted() {
  6748. uni.setNavigationBarTitle({
  6749. title: this.$t("register")
  6750. });
  6751. this.throttleTime = getApp().globalData.throttleTime;
  6752. }
  6753. };
  6754. function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
  6755. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  6756. const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
  6757. const _component_uv_input = resolveEasycom(vue.resolveDynamicComponent("uv-input"), __easycom_6$1);
  6758. const _component_uv_form_item = resolveEasycom(vue.resolveDynamicComponent("uv-form-item"), __easycom_3);
  6759. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  6760. const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
  6761. const _component_uv_form = resolveEasycom(vue.resolveDynamicComponent("uv-form"), __easycom_6);
  6762. const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
  6763. return vue.openBlock(), vue.createElementBlock("view", null, [
  6764. vue.createVNode(
  6765. _component_uv_toast,
  6766. { ref: "toast" },
  6767. null,
  6768. 512
  6769. /* NEED_PATCH */
  6770. ),
  6771. vue.createElementVNode("view", { class: "page" }, [
  6772. vue.createVNode(_component_uv_row, {
  6773. justify: "space-between",
  6774. customStyle: "margin-top: 35%",
  6775. class: "form"
  6776. }, {
  6777. default: vue.withCtx(() => [
  6778. vue.createVNode(_component_uv_col, {
  6779. span: "10",
  6780. offset: "1"
  6781. }, {
  6782. default: vue.withCtx(() => [
  6783. vue.createVNode(_component_uv_form, {
  6784. labelPosition: "left",
  6785. model: $data.logininfo,
  6786. rules: $data.rules,
  6787. ref: "form"
  6788. }, {
  6789. default: vue.withCtx(() => [
  6790. vue.createVNode(_component_uv_col, {
  6791. span: "10",
  6792. offset: "1"
  6793. }, {
  6794. default: vue.withCtx(() => [
  6795. vue.createTextVNode(
  6796. vue.toDisplayString(_ctx.$t("telno")),
  6797. 1
  6798. /* TEXT */
  6799. )
  6800. ]),
  6801. _: 1
  6802. /* STABLE */
  6803. }),
  6804. vue.createVNode(_component_uv_col, {
  6805. span: "10",
  6806. offset: "1"
  6807. }, {
  6808. default: vue.withCtx(() => [
  6809. vue.createVNode(_component_uv_form_item, {
  6810. prop: "telno",
  6811. borderBottom: ""
  6812. }, {
  6813. default: vue.withCtx(() => [
  6814. vue.createVNode(_component_uv_input, {
  6815. modelValue: $data.logininfo.telno,
  6816. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.logininfo.telno = $event),
  6817. modelModifiers: { trim: true },
  6818. border: "none"
  6819. }, null, 8, ["modelValue"])
  6820. ]),
  6821. _: 1
  6822. /* STABLE */
  6823. })
  6824. ]),
  6825. _: 1
  6826. /* STABLE */
  6827. }),
  6828. vue.createVNode(_component_uv_col, {
  6829. span: "10",
  6830. offset: "1",
  6831. customStyle: "margin-top: 20px"
  6832. }, {
  6833. default: vue.withCtx(() => [
  6834. vue.createTextVNode(
  6835. vue.toDisplayString(_ctx.$t("password")),
  6836. 1
  6837. /* TEXT */
  6838. )
  6839. ]),
  6840. _: 1
  6841. /* STABLE */
  6842. }),
  6843. vue.createVNode(_component_uv_col, {
  6844. span: "10",
  6845. offset: "1"
  6846. }, {
  6847. default: vue.withCtx(() => [
  6848. vue.createVNode(_component_uv_form_item, {
  6849. prop: "pw1",
  6850. borderBottom: ""
  6851. }, {
  6852. right: vue.withCtx(() => [
  6853. vue.withDirectives(vue.createVNode(_component_uv_icon, {
  6854. name: "eye-off-outline",
  6855. color: "#2979ff",
  6856. size: "18",
  6857. onClick: $options.setshowpasswod1
  6858. }, null, 8, ["onClick"]), [
  6859. [vue.vShow, !$data.showpasswod1]
  6860. ]),
  6861. vue.withDirectives(vue.createVNode(_component_uv_icon, {
  6862. name: "eye",
  6863. color: "#2979ff",
  6864. size: "18",
  6865. onClick: $options.setshowpasswod1
  6866. }, null, 8, ["onClick"]), [
  6867. [vue.vShow, $data.showpasswod1]
  6868. ])
  6869. ]),
  6870. default: vue.withCtx(() => [
  6871. vue.createVNode(_component_uv_input, {
  6872. modelValue: $data.logininfo.pw1,
  6873. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.logininfo.pw1 = $event),
  6874. modelModifiers: { trim: true },
  6875. type: $data.passwordtype1,
  6876. border: "none"
  6877. }, null, 8, ["modelValue", "type"])
  6878. ]),
  6879. _: 1
  6880. /* STABLE */
  6881. })
  6882. ]),
  6883. _: 1
  6884. /* STABLE */
  6885. }),
  6886. vue.createVNode(_component_uv_col, {
  6887. span: "10",
  6888. offset: "1",
  6889. customStyle: "margin-top: 20px"
  6890. }, {
  6891. default: vue.withCtx(() => [
  6892. vue.createTextVNode(
  6893. vue.toDisplayString(_ctx.$t("password_repeat")),
  6894. 1
  6895. /* TEXT */
  6896. )
  6897. ]),
  6898. _: 1
  6899. /* STABLE */
  6900. }),
  6901. vue.createVNode(_component_uv_col, {
  6902. span: "10",
  6903. offset: "1"
  6904. }, {
  6905. default: vue.withCtx(() => [
  6906. vue.createVNode(_component_uv_form_item, {
  6907. prop: "pw2",
  6908. borderBottom: ""
  6909. }, {
  6910. right: vue.withCtx(() => [
  6911. vue.withDirectives(vue.createVNode(_component_uv_icon, {
  6912. name: "eye-off-outline",
  6913. color: "#2979ff",
  6914. size: "18",
  6915. onClick: $options.setshowpasswod2
  6916. }, null, 8, ["onClick"]), [
  6917. [vue.vShow, !$data.showpasswod2]
  6918. ]),
  6919. vue.withDirectives(vue.createVNode(_component_uv_icon, {
  6920. name: "eye",
  6921. color: "#2979ff",
  6922. size: "18",
  6923. onClick: $options.setshowpasswod2
  6924. }, null, 8, ["onClick"]), [
  6925. [vue.vShow, $data.showpasswod2]
  6926. ])
  6927. ]),
  6928. default: vue.withCtx(() => [
  6929. vue.createVNode(_component_uv_input, {
  6930. modelValue: $data.logininfo.pw2,
  6931. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.logininfo.pw2 = $event),
  6932. modelModifiers: { trim: true },
  6933. type: $data.passwordtype2,
  6934. border: "none"
  6935. }, null, 8, ["modelValue", "type"])
  6936. ]),
  6937. _: 1
  6938. /* STABLE */
  6939. })
  6940. ]),
  6941. _: 1
  6942. /* STABLE */
  6943. }),
  6944. vue.createVNode(_component_uv_col, {
  6945. span: "10",
  6946. offset: "1"
  6947. }, {
  6948. default: vue.withCtx(() => [
  6949. vue.createVNode(_component_uv_button, {
  6950. type: "primary",
  6951. text: _ctx.$t("register"),
  6952. customStyle: "margin-top: 20px",
  6953. onClick: $options.submit
  6954. }, null, 8, ["text", "onClick"])
  6955. ]),
  6956. _: 1
  6957. /* STABLE */
  6958. })
  6959. ]),
  6960. _: 1
  6961. /* STABLE */
  6962. }, 8, ["model", "rules"]),
  6963. vue.createVNode(_component_uv_col, {
  6964. span: "10",
  6965. offset: "1"
  6966. }, {
  6967. default: vue.withCtx(() => [
  6968. vue.createVNode(_component_uv_button, {
  6969. type: "primary",
  6970. plain: true,
  6971. throttleTime: $data.throttleTime,
  6972. text: _ctx.$t("login"),
  6973. customStyle: "margin-top: 2rem",
  6974. onClick: _ctx.toregister
  6975. }, null, 8, ["throttleTime", "text", "onClick"])
  6976. ]),
  6977. _: 1
  6978. /* STABLE */
  6979. })
  6980. ]),
  6981. _: 1
  6982. /* STABLE */
  6983. })
  6984. ]),
  6985. _: 1
  6986. /* STABLE */
  6987. })
  6988. ])
  6989. ]);
  6990. }
  6991. const PagesRegisterRegister = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__file", "D:/workspace/uniapp/health2/pages/register/register.vue"]]);
  6992. const _sfc_main$h = {
  6993. data() {
  6994. return {};
  6995. },
  6996. methods: {}
  6997. };
  6998. function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
  6999. return vue.openBlock(), vue.createElementBlock("view");
  7000. }
  7001. const PagesMemberMember = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g], ["__file", "D:/workspace/uniapp/health2/pages/member/member.vue"]]);
  7002. const _sfc_main$g = {
  7003. data() {
  7004. return {
  7005. userinfo: {},
  7006. selectuser_list: [
  7007. {
  7008. title: this.$t("father"),
  7009. gender: "1",
  7010. selected: false
  7011. },
  7012. {
  7013. title: this.$t("mother"),
  7014. gender: "2",
  7015. selected: false
  7016. },
  7017. {
  7018. title: this.$t("husband"),
  7019. gender: "1",
  7020. selected: false
  7021. },
  7022. {
  7023. title: this.$t("wife"),
  7024. gender: "2",
  7025. selected: false
  7026. },
  7027. {
  7028. title: "",
  7029. gender: "1",
  7030. selected: false
  7031. },
  7032. {
  7033. title: "",
  7034. gender: "2",
  7035. selected: false
  7036. }
  7037. ],
  7038. other_member_1: "",
  7039. other_member_2: "",
  7040. showdiv: false,
  7041. memberlist: [],
  7042. letcount: 0
  7043. };
  7044. },
  7045. methods: {
  7046. adduser() {
  7047. },
  7048. itemselect(index2) {
  7049. this.selectuser_list[index2 - 1].selected = !this.selectuser_list[index2 - 1].selected;
  7050. if (index2 == 5) {
  7051. this.selectuser_list[index2 - 1].title = other_member_1;
  7052. }
  7053. if (index2 == 6) {
  7054. this.selectuser_list[index2 - 1].title = other_member_2;
  7055. }
  7056. },
  7057. addother(gender) {
  7058. let title = "";
  7059. let fmemberid = this.memberlist.length + 1;
  7060. let subanswerinfo = {
  7061. userid: this.userinfo.id,
  7062. fmemberid,
  7063. stemid: 3,
  7064. answertype: 1
  7065. };
  7066. if (1 == gender) {
  7067. if (this.other_member_1.length <= 0) {
  7068. this.$refs.toast.show({
  7069. type: "error",
  7070. message: this.$t("member_title_null")
  7071. });
  7072. return false;
  7073. }
  7074. title = this.other_member_1;
  7075. subanswerinfo.answeroption = this.$t("man");
  7076. subanswerinfo.answeroptionid = 64;
  7077. }
  7078. if (2 == gender) {
  7079. formatAppLog("log", "at pages/member/add.vue:219", this.other_member_2, this.other_member_2.length);
  7080. if (this.other_member_2.length <= 0) {
  7081. this.$refs.toast.show({
  7082. type: "error",
  7083. message: this.$t("member_title_null")
  7084. });
  7085. return false;
  7086. }
  7087. title = this.other_member_2;
  7088. subanswerinfo.answeroption = this.$t("female");
  7089. subanswerinfo.answeroptionid = 65;
  7090. }
  7091. let subanswerlist = [];
  7092. subanswerlist.push(subanswerinfo);
  7093. var subinfo = {
  7094. answer: JSON.stringify(subanswerlist),
  7095. userid: this.userinfo.id,
  7096. fmemberid: this.memberlist.length,
  7097. srid: 0,
  7098. scaleid: 1,
  7099. membername: title,
  7100. gender
  7101. };
  7102. submembergenderbyuserid(subinfo).then((res) => {
  7103. res = res.data;
  7104. if (0 == res.code) {
  7105. this.$refs.toast.show({
  7106. type: "error",
  7107. message: res.errmsg
  7108. });
  7109. }
  7110. if (200 == res.code) {
  7111. this.$refs.toast.show({
  7112. type: "success",
  7113. message: this.$t("do_success")
  7114. });
  7115. uni.navigateTo({
  7116. url: "/pages/index/index"
  7117. });
  7118. }
  7119. });
  7120. },
  7121. setshowdiv() {
  7122. this.showdiv = !this.showdiv;
  7123. },
  7124. addmemberbylist() {
  7125. let selectlist = [];
  7126. this.selectuser_list.map((item) => {
  7127. if (item.selected) {
  7128. selectlist.push(item);
  7129. }
  7130. });
  7131. this.letcount = this.memberlist.length - 2 + selectlist.length;
  7132. if (this.letcount > this.userinfo.fmembercount) {
  7133. this.$refs.toast.show({
  7134. type: "error",
  7135. message: this.$t("member_num_than_max")
  7136. });
  7137. return false;
  7138. }
  7139. selectlist.map((item, index2) => {
  7140. item.fmemberid = this.selectuser_list.length + index2;
  7141. var answerinfo = {
  7142. userid: this.userinfo.id,
  7143. fmemberid: item.fmemberid,
  7144. stemid: 3,
  7145. answertype: 1
  7146. };
  7147. if (item.gender == 1) {
  7148. answerinfo.answeroption = this.$t("man");
  7149. answerinfo.answeroptionid = 64;
  7150. } else {
  7151. answerinfo.answeroption = this.$t("female");
  7152. answerinfo.answeroptionid = 65;
  7153. }
  7154. item.answer = JSON.stringify([answerinfo]);
  7155. });
  7156. let data = {
  7157. memberlist: selectlist,
  7158. mcount: selectlist.length,
  7159. userid: this.userinfo.id
  7160. };
  7161. subfmemberlistbyuserid(data).then((res) => {
  7162. res = res.data;
  7163. if (0 == res.code) {
  7164. this.$refs.toast.show({
  7165. type: "error",
  7166. message: res.errmsg
  7167. });
  7168. }
  7169. if (200 == res.code) {
  7170. this.$refs.toast.show({
  7171. type: "success",
  7172. message: this.$t("do_success")
  7173. });
  7174. uni.navigateTo({
  7175. url: "/pages/index/index"
  7176. });
  7177. }
  7178. });
  7179. }
  7180. },
  7181. mounted() {
  7182. uni.setNavigationBarTitle({
  7183. title: this.$t("add_member")
  7184. });
  7185. this.userinfo = uni.getStorageSync("userinfo");
  7186. this.memberlist = uni.getStorageSync("memberlist");
  7187. }
  7188. };
  7189. function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
  7190. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  7191. const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
  7192. const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
  7193. const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
  7194. const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
  7195. const _component_uv_line = resolveEasycom(vue.resolveDynamicComponent("uv-line"), __easycom_5);
  7196. const _component_uv_input = resolveEasycom(vue.resolveDynamicComponent("uv-input"), __easycom_6$1);
  7197. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  7198. const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
  7199. return vue.openBlock(), vue.createElementBlock(
  7200. vue.Fragment,
  7201. null,
  7202. [
  7203. vue.createVNode(
  7204. _component_uv_toast,
  7205. { ref: "toast" },
  7206. null,
  7207. 512
  7208. /* NEED_PATCH */
  7209. ),
  7210. vue.createElementVNode("view", { class: "titlearea" }, [
  7211. vue.createElementVNode(
  7212. "view",
  7213. { class: "firsttitle" },
  7214. vue.toDisplayString(_ctx.$t("member_add_text_1")),
  7215. 1
  7216. /* TEXT */
  7217. ),
  7218. vue.createElementVNode(
  7219. "view",
  7220. { class: "title_2" },
  7221. vue.toDisplayString(_ctx.$t("member_add_text_2")),
  7222. 1
  7223. /* TEXT */
  7224. )
  7225. ]),
  7226. vue.createElementVNode("view", { class: "memberarea2" }, [
  7227. vue.createVNode(_component_uv_row, { class: "item" }, {
  7228. default: vue.withCtx(() => [
  7229. vue.createVNode(_component_uv_col, { span: "7" }, {
  7230. default: vue.withCtx(() => [
  7231. vue.createVNode(_component_uv_text, {
  7232. text: _ctx.$t("add_member_text1")
  7233. }, null, 8, ["text"]),
  7234. vue.createVNode(_component_uv_text, {
  7235. text: _ctx.$t("add_member_text2")
  7236. }, null, 8, ["text"]),
  7237. vue.createVNode(_component_uv_text, {
  7238. text: _ctx.$t("add_member_text3")
  7239. }, null, 8, ["text"])
  7240. ]),
  7241. _: 1
  7242. /* STABLE */
  7243. }),
  7244. vue.createVNode(_component_uv_col, { span: "5" }, {
  7245. default: vue.withCtx(() => [
  7246. vue.createVNode(_component_uv_row, { justify: "around" }, {
  7247. default: vue.withCtx(() => [
  7248. vue.createVNode(_component_uv_col, {
  7249. span: "6",
  7250. align: "center"
  7251. }, {
  7252. default: vue.withCtx(() => [
  7253. vue.createVNode(_component_uv_image, {
  7254. src: "/static/image/selecttype/man.png",
  7255. shape: "circle",
  7256. width: "60",
  7257. height: "60"
  7258. }),
  7259. vue.createElementVNode(
  7260. "view",
  7261. {
  7262. class: vue.normalizeClass({ paretareabutton_select: $data.selectuser_list[0].selected, addbtn: !$data.selectuser_list[0].selected }),
  7263. onClick: _cache[0] || (_cache[0] = ($event) => $options.itemselect(1))
  7264. },
  7265. vue.toDisplayString(_ctx.$t("father")),
  7266. 3
  7267. /* TEXT, CLASS */
  7268. )
  7269. ]),
  7270. _: 1
  7271. /* STABLE */
  7272. }),
  7273. vue.createVNode(_component_uv_col, {
  7274. span: "6",
  7275. align: "center"
  7276. }, {
  7277. default: vue.withCtx(() => [
  7278. vue.createVNode(_component_uv_image, {
  7279. src: "/static/image/selecttype/woman.png",
  7280. shape: "circle",
  7281. width: "60",
  7282. height: "60"
  7283. }),
  7284. vue.createElementVNode(
  7285. "view",
  7286. {
  7287. class: vue.normalizeClass({ paretareabutton_select: $data.selectuser_list[1].selected, addbtn: !$data.selectuser_list[1].selected }),
  7288. onClick: _cache[1] || (_cache[1] = ($event) => $options.itemselect(2))
  7289. },
  7290. vue.toDisplayString(_ctx.$t("mother")),
  7291. 3
  7292. /* TEXT, CLASS */
  7293. )
  7294. ]),
  7295. _: 1
  7296. /* STABLE */
  7297. })
  7298. ]),
  7299. _: 1
  7300. /* STABLE */
  7301. })
  7302. ]),
  7303. _: 1
  7304. /* STABLE */
  7305. })
  7306. ]),
  7307. _: 1
  7308. /* STABLE */
  7309. }),
  7310. vue.createVNode(_component_uv_line, { length: "80%" }),
  7311. vue.createVNode(_component_uv_row, { class: "item" }, {
  7312. default: vue.withCtx(() => [
  7313. vue.createVNode(_component_uv_col, { span: "7" }, {
  7314. default: vue.withCtx(() => [
  7315. vue.createVNode(_component_uv_text, {
  7316. text: _ctx.$t("add_member_text4")
  7317. }, null, 8, ["text"]),
  7318. vue.createVNode(_component_uv_text, {
  7319. text: _ctx.$t("add_member_text5")
  7320. }, null, 8, ["text"]),
  7321. vue.createVNode(_component_uv_text, {
  7322. text: _ctx.$t("add_member_text6")
  7323. }, null, 8, ["text"])
  7324. ]),
  7325. _: 1
  7326. /* STABLE */
  7327. }),
  7328. vue.createVNode(_component_uv_col, { span: "5" }, {
  7329. default: vue.withCtx(() => [
  7330. vue.createVNode(_component_uv_row, { justify: "around" }, {
  7331. default: vue.withCtx(() => [
  7332. vue.createVNode(_component_uv_col, {
  7333. span: "6",
  7334. align: "center"
  7335. }, {
  7336. default: vue.withCtx(() => [
  7337. vue.createVNode(_component_uv_image, {
  7338. src: "/static/image/selecttype/man.png",
  7339. shape: "circle",
  7340. width: "60",
  7341. height: "60"
  7342. }),
  7343. vue.createElementVNode(
  7344. "view",
  7345. {
  7346. class: vue.normalizeClass({ paretareabutton_select: $data.selectuser_list[2].selected, addbtn: !$data.selectuser_list[2].selected }),
  7347. onClick: _cache[2] || (_cache[2] = ($event) => $options.itemselect(3))
  7348. },
  7349. vue.toDisplayString(_ctx.$t("husband")),
  7350. 3
  7351. /* TEXT, CLASS */
  7352. )
  7353. ]),
  7354. _: 1
  7355. /* STABLE */
  7356. }),
  7357. vue.createVNode(_component_uv_col, {
  7358. span: "6",
  7359. align: "center"
  7360. }, {
  7361. default: vue.withCtx(() => [
  7362. vue.createVNode(_component_uv_image, {
  7363. src: "/static/image/selecttype/woman.png",
  7364. shape: "circle",
  7365. width: "60",
  7366. height: "60"
  7367. }),
  7368. vue.createElementVNode(
  7369. "view",
  7370. {
  7371. class: vue.normalizeClass({ paretareabutton_select: $data.selectuser_list[3].selected, addbtn: !$data.selectuser_list[3].selected }),
  7372. onClick: _cache[3] || (_cache[3] = ($event) => $options.itemselect(4))
  7373. },
  7374. vue.toDisplayString(_ctx.$t("wife")),
  7375. 3
  7376. /* TEXT, CLASS */
  7377. )
  7378. ]),
  7379. _: 1
  7380. /* STABLE */
  7381. })
  7382. ]),
  7383. _: 1
  7384. /* STABLE */
  7385. })
  7386. ]),
  7387. _: 1
  7388. /* STABLE */
  7389. })
  7390. ]),
  7391. _: 1
  7392. /* STABLE */
  7393. })
  7394. ]),
  7395. vue.createCommentVNode(` <view class="memberarea"> \r
  7396. <view class="parentarea">\r
  7397. <uv-row>\r
  7398. <uv-col span="7">\r
  7399. <uv-text text="父母有没有"></uv-text>\r
  7400. <uv-text text="心梗脑梗的风险?"></uv-text>\r
  7401. <uv-text text="帮他们评测!"></uv-text>\r
  7402. </uv-col>\r
  7403. <uv-col span="5">\r
  7404. <uv-row justify="around">\r
  7405. <uv-col span="6" align="center">\r
  7406. <uv-image src="/static/image/selecttype/man.png" shape="circle" width="60" height="60"></uv-image>\r
  7407. <view :class="{paretareabutton_select:selectuser_list[0].selected,addbtn:!selectuser_list[0].selected}" @click="itemselect(1)">\r
  7408. {{ $t('father') }}\r
  7409. </view>\r
  7410. </uv-col>\r
  7411. <uv-col span="6" align="center">\r
  7412. <uv-image src="/static/image/selecttype/woman.png" shape="circle" width="60" height="60"></uv-image>\r
  7413. <view :class="{paretareabutton_select:selectuser_list[1].selected,addbtn:!selectuser_list[1].selected}" @click="itemselect(2)">\r
  7414. {{ $t('mother') }}\r
  7415. </view>\r
  7416. </uv-col>\r
  7417. </uv-row>\r
  7418. </uv-col>\r
  7419. </uv-row>\r
  7420. </view>\r
  7421. <view class="parentarea">\r
  7422. <uv-row>\r
  7423. <uv-col span="7">\r
  7424. <uv-text text="爱人工作繁忙"></uv-text>\r
  7425. <uv-text text="应酬多,压力大,常喝酒"></uv-text>\r
  7426. <uv-text text="有没有心脑血管的隐患?"></uv-text>\r
  7427. </uv-col>\r
  7428. <uv-col span="5">\r
  7429. <uv-row justify="around">\r
  7430. <uv-col span="6" align="center">\r
  7431. <uv-image src="/static/image/selecttype/man.png" shape="circle" width="60" height="60"></uv-image>\r
  7432. <view :class="{paretareabutton_select:selectuser_list[2].selected,addbtn:!selectuser_list[2].selected}" @click="itemselect(3)">\r
  7433. {{ $t('husband') }}\r
  7434. </view>\r
  7435. </uv-col>\r
  7436. <uv-col span="6" align="center">\r
  7437. <uv-image src="/static/image/selecttype/woman.png" shape="circle" width="60" height="60"></uv-image>\r
  7438. <view :class="{paretareabutton_select:selectuser_list[3].selected,addbtn:!selectuser_list[3].selected}" @click="itemselect(4)">\r
  7439. {{ $t('wife') }}\r
  7440. </view>\r
  7441. </uv-col>\r
  7442. </uv-row>\r
  7443. </uv-col>\r
  7444. </uv-row>\r
  7445. </view>\r
  7446. </view> `),
  7447. vue.createElementVNode("view", { class: "othermember" }, [
  7448. vue.createElementVNode(
  7449. "view",
  7450. {
  7451. class: "show_view",
  7452. onClick: _cache[4] || (_cache[4] = (...args) => $options.setshowdiv && $options.setshowdiv(...args))
  7453. },
  7454. vue.toDisplayString(_ctx.$t("other_member")),
  7455. 1
  7456. /* TEXT */
  7457. )
  7458. ]),
  7459. vue.withDirectives(vue.createElementVNode(
  7460. "view",
  7461. { class: "selectarea" },
  7462. [
  7463. vue.createVNode(_component_uv_row, { justify: "around" }, {
  7464. default: vue.withCtx(() => [
  7465. vue.createVNode(_component_uv_col, {
  7466. span: "6",
  7467. align: "center"
  7468. }, {
  7469. default: vue.withCtx(() => [
  7470. vue.createVNode(_component_uv_image, {
  7471. src: "/static/image/selecttype/man.png",
  7472. shape: "circle",
  7473. width: "100",
  7474. height: "100"
  7475. }),
  7476. vue.createVNode(_component_uv_text, {
  7477. text: _ctx.$t("add_member_text7"),
  7478. align: "center"
  7479. }, null, 8, ["text"]),
  7480. vue.createVNode(_component_uv_input, {
  7481. placeholder: _ctx.$t("add_member_text9"),
  7482. border: "bottom",
  7483. modelValue: $data.other_member_1,
  7484. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.other_member_1 = $event),
  7485. customStyle: "width:80px"
  7486. }, null, 8, ["placeholder", "modelValue"]),
  7487. vue.createElementVNode("view", {
  7488. class: "paretareabutton_select",
  7489. onClick: _cache[6] || (_cache[6] = ($event) => $options.addother(1))
  7490. }, [
  7491. vue.createVNode(_component_uv_icon, {
  7492. name: "plus",
  7493. color: "#fff",
  7494. size: "10"
  7495. })
  7496. ])
  7497. ]),
  7498. _: 1
  7499. /* STABLE */
  7500. }),
  7501. vue.createVNode(_component_uv_col, {
  7502. span: "6",
  7503. align: "center"
  7504. }, {
  7505. default: vue.withCtx(() => [
  7506. vue.createVNode(_component_uv_image, {
  7507. src: "/static/image/selecttype/woman.png",
  7508. shape: "circle",
  7509. width: "100",
  7510. height: "100"
  7511. }),
  7512. vue.createVNode(_component_uv_text, {
  7513. text: _ctx.$t("add_member_text8"),
  7514. align: "center"
  7515. }, null, 8, ["text"]),
  7516. vue.createVNode(_component_uv_input, {
  7517. placeholder: _ctx.$t("add_member_text9"),
  7518. border: "bottom",
  7519. modelValue: $data.other_member_2,
  7520. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.other_member_2 = $event),
  7521. customStyle: "width:80px"
  7522. }, null, 8, ["placeholder", "modelValue"]),
  7523. vue.createElementVNode("view", {
  7524. class: "paretareabutton_select",
  7525. onClick: _cache[8] || (_cache[8] = ($event) => $options.addother(2))
  7526. }, [
  7527. vue.createVNode(_component_uv_icon, {
  7528. name: "plus",
  7529. color: "#fff",
  7530. size: "10"
  7531. })
  7532. ])
  7533. ]),
  7534. _: 1
  7535. /* STABLE */
  7536. })
  7537. ]),
  7538. _: 1
  7539. /* STABLE */
  7540. })
  7541. ],
  7542. 512
  7543. /* NEED_PATCH */
  7544. ), [
  7545. [vue.vShow, $data.showdiv]
  7546. ]),
  7547. vue.createElementVNode("view", { class: "buttonarea" }, [
  7548. vue.createVNode(_component_uv_button, {
  7549. type: "primary",
  7550. shape: "square",
  7551. text: _ctx.$t("submit"),
  7552. customStyle: "background:#648EB8;width:80%",
  7553. onClick: $options.addmemberbylist
  7554. }, null, 8, ["text", "onClick"])
  7555. ]),
  7556. vue.createElementVNode("br")
  7557. ],
  7558. 64
  7559. /* STABLE_FRAGMENT */
  7560. );
  7561. }
  7562. 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"]]);
  7563. const uvBadgeProps = {
  7564. props: {
  7565. // 是否显示圆点
  7566. isDot: {
  7567. type: Boolean,
  7568. default: false
  7569. },
  7570. // 显示的内容
  7571. value: {
  7572. type: [Number, String],
  7573. default: ""
  7574. },
  7575. // 是否显示
  7576. show: {
  7577. type: Boolean,
  7578. default: true
  7579. },
  7580. // 最大值,超过最大值会显示 '{max}+'
  7581. max: {
  7582. type: [Number, String],
  7583. default: 999
  7584. },
  7585. // 主题类型,error|warning|success|primary
  7586. type: {
  7587. type: [String, void 0, null],
  7588. default: "error"
  7589. },
  7590. // 当数值为 0 时,是否展示 Badge
  7591. showZero: {
  7592. type: Boolean,
  7593. default: false
  7594. },
  7595. // 背景颜色,优先级比type高,如设置,type参数会失效
  7596. bgColor: {
  7597. type: [String, null],
  7598. default: null
  7599. },
  7600. // 字体颜色
  7601. color: {
  7602. type: [String, null],
  7603. default: null
  7604. },
  7605. // 徽标形状,circle-四角均为圆角,horn-左下角为直角
  7606. shape: {
  7607. type: [String, void 0, null],
  7608. default: "circle"
  7609. },
  7610. // 设置数字的显示方式,overflow|ellipsis|limit
  7611. // overflow会根据max字段判断,超出显示`${max}+`
  7612. // ellipsis会根据max判断,超出显示`${max}...`
  7613. // limit会依据1000作为判断条件,超出1000,显示`${value/1000}K`,比如2.2k、3.34w,最多保留2位小数
  7614. numberType: {
  7615. type: [String, void 0, null],
  7616. default: "overflow"
  7617. },
  7618. // 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,absolute为true时有效
  7619. offset: {
  7620. type: Array,
  7621. default: () => []
  7622. },
  7623. // 是否反转背景和字体颜色
  7624. inverted: {
  7625. type: Boolean,
  7626. default: false
  7627. },
  7628. // 是否绝对定位
  7629. absolute: {
  7630. type: Boolean,
  7631. default: false
  7632. },
  7633. ...(_J = (_I = uni.$uv) == null ? void 0 : _I.props) == null ? void 0 : _J.badge
  7634. }
  7635. };
  7636. const _sfc_main$f = {
  7637. name: "uv-badge",
  7638. mixins: [mpMixin, mixin, uvBadgeProps],
  7639. computed: {
  7640. // 是否将badge中心与父组件右上角重合
  7641. boxStyle() {
  7642. let style = {};
  7643. return style;
  7644. },
  7645. // 整个组件的样式
  7646. badgeStyle() {
  7647. const style = {};
  7648. if (this.color) {
  7649. style.color = this.color;
  7650. }
  7651. if (this.bgColor && !this.inverted) {
  7652. style.backgroundColor = this.bgColor;
  7653. }
  7654. if (this.absolute) {
  7655. style.position = "absolute";
  7656. if (this.offset.length) {
  7657. const top = this.offset[0];
  7658. const right = this.offset[1] || top;
  7659. style.top = this.$uv.addUnit(top);
  7660. style.right = this.$uv.addUnit(right);
  7661. }
  7662. }
  7663. return style;
  7664. },
  7665. showValue() {
  7666. switch (this.numberType) {
  7667. case "overflow":
  7668. return Number(this.value) > Number(this.max) ? this.max + "+" : this.value;
  7669. case "ellipsis":
  7670. return Number(this.value) > Number(this.max) ? "..." : this.value;
  7671. case "limit":
  7672. 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;
  7673. default:
  7674. return Number(this.value);
  7675. }
  7676. },
  7677. propsType() {
  7678. return this.type || "error";
  7679. }
  7680. }
  7681. };
  7682. function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
  7683. return _ctx.show && ((Number(_ctx.value) === 0 ? _ctx.showZero : true) || _ctx.isDot) ? (vue.openBlock(), vue.createElementBlock(
  7684. "text",
  7685. {
  7686. key: 0,
  7687. 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"]),
  7688. style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle), $options.badgeStyle])
  7689. },
  7690. vue.toDisplayString(_ctx.isDot ? "" : $options.showValue),
  7691. 7
  7692. /* TEXT, CLASS, STYLE */
  7693. )) : vue.createCommentVNode("v-if", true);
  7694. }
  7695. 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"]]);
  7696. const props$3 = {
  7697. props: {
  7698. // 滑块的移动过渡时间,单位ms
  7699. duration: {
  7700. type: Number,
  7701. default: 300
  7702. },
  7703. // tabs标签数组
  7704. list: {
  7705. type: Array,
  7706. default: () => []
  7707. },
  7708. // 滑块颜色
  7709. lineColor: {
  7710. type: String,
  7711. default: "#3c9cff"
  7712. },
  7713. // 菜单选择中时的样式
  7714. activeStyle: {
  7715. type: [String, Object],
  7716. default: () => ({
  7717. color: "#303133"
  7718. })
  7719. },
  7720. // 菜单非选中时的样式
  7721. inactiveStyle: {
  7722. type: [String, Object],
  7723. default: () => ({
  7724. color: "#606266"
  7725. })
  7726. },
  7727. // 滑块长度
  7728. lineWidth: {
  7729. type: [String, Number],
  7730. default: 20
  7731. },
  7732. // 滑块高度
  7733. lineHeight: {
  7734. type: [String, Number],
  7735. default: 3
  7736. },
  7737. // 滑块背景显示大小,当滑块背景设置为图片时使用
  7738. lineBgSize: {
  7739. type: String,
  7740. default: "cover"
  7741. },
  7742. // 菜单item的样式
  7743. itemStyle: {
  7744. type: [String, Object],
  7745. default: () => ({
  7746. height: "44px",
  7747. fontSize: "15px"
  7748. })
  7749. },
  7750. // 菜单是否可滚动
  7751. scrollable: {
  7752. type: Boolean,
  7753. default: true
  7754. },
  7755. // 当前选中标签的索引
  7756. current: {
  7757. type: [Number, String],
  7758. default: 0
  7759. },
  7760. // 默认读取的键名
  7761. keyName: {
  7762. type: String,
  7763. default: "name"
  7764. },
  7765. ...(_L = (_K = uni.$uv) == null ? void 0 : _K.props) == null ? void 0 : _L.tabs
  7766. }
  7767. };
  7768. const _sfc_main$e = {
  7769. name: "uv-tabs",
  7770. emits: ["click", "change"],
  7771. mixins: [mpMixin, mixin, props$3],
  7772. data() {
  7773. return {
  7774. firstTime: true,
  7775. scrollLeft: 0,
  7776. scrollViewWidth: 0,
  7777. lineOffsetLeft: 0,
  7778. tabsRect: {
  7779. left: 0
  7780. },
  7781. innerCurrent: 0,
  7782. moving: false
  7783. };
  7784. },
  7785. watch: {
  7786. current: {
  7787. immediate: true,
  7788. handler(newValue, oldValue) {
  7789. if (newValue !== this.innerCurrent) {
  7790. this.innerCurrent = newValue;
  7791. this.$nextTick(() => {
  7792. this.resize();
  7793. });
  7794. }
  7795. }
  7796. },
  7797. // list变化时,重新渲染list各项信息
  7798. list(newValue, oldValue) {
  7799. formatAppLog("log", "at uni_modules/uv-tabs/components/uv-tabs/uv-tabs.vue:149", newValue, oldValue);
  7800. this.$nextTick(() => {
  7801. this.resize();
  7802. });
  7803. }
  7804. },
  7805. computed: {
  7806. textStyle() {
  7807. return (index2) => {
  7808. const style = {};
  7809. const customeStyle = index2 == this.innerCurrent ? this.$uv.addStyle(this.activeStyle) : this.$uv.addStyle(
  7810. this.inactiveStyle
  7811. );
  7812. if (this.list[index2].disabled) {
  7813. style.color = "#c8c9cc";
  7814. }
  7815. return this.$uv.deepMerge(customeStyle, style);
  7816. };
  7817. },
  7818. propsBadge() {
  7819. return uvBadgeProps;
  7820. }
  7821. },
  7822. async mounted() {
  7823. this.init();
  7824. },
  7825. methods: {
  7826. setLineLeft() {
  7827. const tabItem = this.list[this.innerCurrent];
  7828. if (!tabItem) {
  7829. return;
  7830. }
  7831. let lineOffsetLeft = this.list.slice(0, this.innerCurrent).reduce((total, curr) => total + curr.rect.width, 0);
  7832. let lineWidth = this.$uv.getPx(this.lineWidth);
  7833. if (this.$uv.test.number(this.lineWidth) && this.$uv.unit) {
  7834. lineWidth = this.$uv.getPx(`${this.lineWidth}${this.$uv.unit}`);
  7835. }
  7836. this.lineOffsetLeft = lineOffsetLeft + (tabItem.rect.width - lineWidth) / 2;
  7837. if (this.firstTime) {
  7838. setTimeout(() => {
  7839. this.firstTime = false;
  7840. }, 20);
  7841. }
  7842. },
  7843. // nvue下设置滑块的位置
  7844. animation(x, duration = 0) {
  7845. },
  7846. // 点击某一个标签
  7847. clickHandler(item, index2) {
  7848. this.$emit("click", {
  7849. ...item,
  7850. index: index2
  7851. });
  7852. if (item.disabled)
  7853. return;
  7854. if (this.innerCurrent != index2) {
  7855. this.$emit("change", {
  7856. ...item,
  7857. index: index2
  7858. });
  7859. }
  7860. this.innerCurrent = index2;
  7861. this.$nextTick(() => {
  7862. this.resize();
  7863. });
  7864. },
  7865. init() {
  7866. this.$uv.sleep().then(() => {
  7867. this.resize();
  7868. });
  7869. },
  7870. setScrollLeft() {
  7871. const tabRect = this.list[this.innerCurrent];
  7872. const offsetLeft = this.list.slice(0, this.innerCurrent).reduce((total, curr) => {
  7873. return total + curr.rect.width;
  7874. }, 0);
  7875. const windowWidth = this.$uv.sys().windowWidth;
  7876. let scrollLeft = offsetLeft - (this.tabsRect.width - tabRect.rect.width) / 2 - (windowWidth - this.tabsRect.right) / 2 + this.tabsRect.left / 2;
  7877. scrollLeft = Math.min(scrollLeft, this.scrollViewWidth - this.tabsRect.width);
  7878. this.scrollLeft = Math.max(0, scrollLeft);
  7879. },
  7880. // 获取所有标签的尺寸
  7881. resize() {
  7882. if (this.list.length === 0) {
  7883. return;
  7884. }
  7885. Promise.all([this.getTabsRect(), this.getAllItemRect()]).then(([tabsRect, itemRect = []]) => {
  7886. this.tabsRect = tabsRect;
  7887. this.scrollViewWidth = 0;
  7888. itemRect.map((item, index2) => {
  7889. this.scrollViewWidth += item.width;
  7890. this.list[index2].rect = item;
  7891. });
  7892. this.setLineLeft();
  7893. this.setScrollLeft();
  7894. });
  7895. },
  7896. // 获取导航菜单的尺寸
  7897. getTabsRect() {
  7898. return new Promise((resolve) => {
  7899. this.queryRect("uv-tabs__wrapper__scroll-view").then((size) => resolve(size));
  7900. });
  7901. },
  7902. // 获取所有标签的尺寸
  7903. getAllItemRect() {
  7904. return new Promise((resolve) => {
  7905. const promiseAllArr = this.list.map((item, index2) => this.queryRect(
  7906. `uv-tabs__wrapper__nav__item-${index2}`,
  7907. true
  7908. ));
  7909. Promise.all(promiseAllArr).then((sizes) => resolve(sizes));
  7910. });
  7911. },
  7912. // 获取各个标签的尺寸
  7913. queryRect(el, item) {
  7914. return new Promise((resolve) => {
  7915. this.$uvGetRect(`.${el}`).then((size) => {
  7916. resolve(size);
  7917. });
  7918. });
  7919. }
  7920. }
  7921. };
  7922. function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
  7923. const _component_uv_badge = resolveEasycom(vue.resolveDynamicComponent("uv-badge"), __easycom_0$1);
  7924. return vue.openBlock(), vue.createElementBlock(
  7925. "view",
  7926. {
  7927. class: "uv-tabs",
  7928. style: vue.normalizeStyle([_ctx.$uv.addStyle(_ctx.customStyle)])
  7929. },
  7930. [
  7931. vue.createElementVNode("view", { class: "uv-tabs__wrapper" }, [
  7932. vue.renderSlot(_ctx.$slots, "left", {}, void 0, true),
  7933. vue.createElementVNode("view", { class: "uv-tabs__wrapper__scroll-view-wrapper" }, [
  7934. vue.createElementVNode("scroll-view", {
  7935. "scroll-x": _ctx.scrollable,
  7936. "scroll-left": $data.scrollLeft,
  7937. "scroll-with-animation": "",
  7938. class: "uv-tabs__wrapper__scroll-view",
  7939. "show-scrollbar": false,
  7940. ref: "uv-tabs__wrapper__scroll-view"
  7941. }, [
  7942. vue.createElementVNode(
  7943. "view",
  7944. {
  7945. class: "uv-tabs__wrapper__nav",
  7946. ref: "uv-tabs__wrapper__nav",
  7947. style: vue.normalizeStyle({
  7948. flex: _ctx.scrollable ? "" : 1
  7949. })
  7950. },
  7951. [
  7952. (vue.openBlock(true), vue.createElementBlock(
  7953. vue.Fragment,
  7954. null,
  7955. vue.renderList(_ctx.list, (item, index2) => {
  7956. return vue.openBlock(), vue.createElementBlock("view", {
  7957. class: vue.normalizeClass(["uv-tabs__wrapper__nav__item", [`uv-tabs__wrapper__nav__item-${index2}`, item.disabled && "uv-tabs__wrapper__nav__item--disabled"]]),
  7958. key: index2,
  7959. onClick: ($event) => $options.clickHandler(item, index2),
  7960. ref_for: true,
  7961. ref: `uv-tabs__wrapper__nav__item-${index2}`,
  7962. style: vue.normalizeStyle([{ flex: _ctx.scrollable ? "" : 1 }, _ctx.$uv.addStyle(_ctx.itemStyle)])
  7963. }, [
  7964. vue.createElementVNode(
  7965. "text",
  7966. {
  7967. class: vue.normalizeClass([[item.disabled && "uv-tabs__wrapper__nav__item__text--disabled"], "uv-tabs__wrapper__nav__item__text"]),
  7968. style: vue.normalizeStyle([$options.textStyle(index2)])
  7969. },
  7970. vue.toDisplayString(item[_ctx.keyName]),
  7971. 7
  7972. /* TEXT, CLASS, STYLE */
  7973. ),
  7974. vue.createVNode(_component_uv_badge, {
  7975. show: !!(item.badge && (item.badge.show || item.badge.isDot || item.badge.value)),
  7976. isDot: item.badge && item.badge.isDot || $options.propsBadge.isDot,
  7977. value: item.badge && item.badge.value || $options.propsBadge.value,
  7978. max: item.badge && item.badge.max || $options.propsBadge.max,
  7979. type: item.badge && item.badge.type || $options.propsBadge.type,
  7980. showZero: item.badge && item.badge.showZero || $options.propsBadge.showZero,
  7981. bgColor: item.badge && item.badge.bgColor || $options.propsBadge.bgColor,
  7982. color: item.badge && item.badge.color || $options.propsBadge.color,
  7983. shape: item.badge && item.badge.shape || $options.propsBadge.shape,
  7984. numberType: item.badge && item.badge.numberType || $options.propsBadge.numberType,
  7985. inverted: item.badge && item.badge.inverted || $options.propsBadge.inverted,
  7986. customStyle: "margin-left: 4px;"
  7987. }, null, 8, ["show", "isDot", "value", "max", "type", "showZero", "bgColor", "color", "shape", "numberType", "inverted"])
  7988. ], 14, ["onClick"]);
  7989. }),
  7990. 128
  7991. /* KEYED_FRAGMENT */
  7992. )),
  7993. vue.createElementVNode(
  7994. "view",
  7995. {
  7996. class: "uv-tabs__wrapper__nav__line",
  7997. ref: "uv-tabs__wrapper__nav__line",
  7998. style: vue.normalizeStyle([{
  7999. width: _ctx.$uv.addUnit(_ctx.lineWidth),
  8000. transform: `translate(${$data.lineOffsetLeft}px)`,
  8001. transitionDuration: `${$data.firstTime ? 0 : _ctx.duration}ms`,
  8002. height: $data.firstTime ? 0 : _ctx.$uv.addUnit(_ctx.lineHeight),
  8003. background: _ctx.lineColor,
  8004. backgroundSize: _ctx.lineBgSize
  8005. }])
  8006. },
  8007. null,
  8008. 4
  8009. /* STYLE */
  8010. )
  8011. ],
  8012. 4
  8013. /* STYLE */
  8014. )
  8015. ], 8, ["scroll-x", "scroll-left"])
  8016. ]),
  8017. vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
  8018. ])
  8019. ],
  8020. 4
  8021. /* STYLE */
  8022. );
  8023. }
  8024. 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"]]);
  8025. function queryuserhealthinfobyuid(data, e, callback = null) {
  8026. let url2 = baseUrl + "/index.php/index/Healthmanger/queryuserhealthinfobyuid";
  8027. return dorequest("post", url2, data, function(res) {
  8028. if (callback) {
  8029. callback(res);
  8030. } else {
  8031. if (0 == res.code) {
  8032. e.$refs.toast.show({
  8033. type: "error",
  8034. message: res.errmsg
  8035. });
  8036. }
  8037. }
  8038. });
  8039. }
  8040. function querymergereportlistbyuserid(data) {
  8041. let url2 = baseUrl + "/index.php/index/Scale/querymergereportlistbyuserid";
  8042. return dorequest(
  8043. "post",
  8044. url2,
  8045. {
  8046. userid: data.userid,
  8047. fmemberid: data.fmemberid
  8048. }
  8049. );
  8050. }
  8051. function querystemperinfobyuserid(data) {
  8052. let url2 = baseUrl + "/index.php/index/Healthmanger/querystemperinfobyuserid";
  8053. return dorequest(
  8054. "post",
  8055. url2,
  8056. {
  8057. userid: data.userid,
  8058. fmemberid: data.fmemberid
  8059. }
  8060. );
  8061. }
  8062. function querybmipercentage(bmi) {
  8063. let url2 = baseUrl + "/index.php/index/Healthmanger/querybimpercentage";
  8064. return dorequest(
  8065. "post",
  8066. url2,
  8067. {
  8068. bmi
  8069. }
  8070. );
  8071. }
  8072. function querypercentagebystemid(data) {
  8073. let url2 = baseUrl + "/index.php/index/Healthmanger/querypercentagebystemid";
  8074. return dorequest(
  8075. "post",
  8076. url2,
  8077. {
  8078. stemid: data.stemid,
  8079. answeroptionid: data.answeroptionid
  8080. }
  8081. );
  8082. }
  8083. const _sfc_main$d = {
  8084. data() {
  8085. return {
  8086. list: [],
  8087. healthlist: [],
  8088. info: {},
  8089. userinfo: {},
  8090. selectuser: {},
  8091. labellist: [],
  8092. activeStyle: {
  8093. color: "#648EB8",
  8094. fontWeight: "bold",
  8095. transform: "scale(1.05)"
  8096. // borderBottom:"2rpx double #648eb8"
  8097. },
  8098. selectitem: false,
  8099. customStyleRiskmsg: {
  8100. fontSize: "20px",
  8101. marginBottom: "10rpx"
  8102. },
  8103. customStyleErrorText: {
  8104. fontSize: "18px",
  8105. marginBottom: "10rpx",
  8106. color: "#648eb8"
  8107. },
  8108. share_userid: false,
  8109. share_fmemberid: false
  8110. };
  8111. },
  8112. methods: {
  8113. getlist() {
  8114. let data = {
  8115. userid: this.share_userid ? this.share_userid : this.userinfo.id,
  8116. fmemberid: this.share_fmemberid ? this.share_fmemberid : this.selectuser.fmemberid
  8117. };
  8118. querymergereportlistbyuserid(data).then((res) => {
  8119. res = res.data;
  8120. if (0 == res.code) {
  8121. this.$refs.toast.show({
  8122. type: "error",
  8123. message: res.errmsg
  8124. });
  8125. return false;
  8126. }
  8127. let list = res.resultData;
  8128. list.map((item, index2) => {
  8129. item.noticelist = [];
  8130. item.advicelist = [];
  8131. if (parseInt(item.scoreresult) > parseInt(item.risklimit)) {
  8132. item.havrisk = 1;
  8133. item.answerlist.map((alitem, alindex) => {
  8134. if (alitem.noticememo != "") {
  8135. if (alitem.noticetype == 1) {
  8136. item.noticelist.push(alitem.noticememo);
  8137. }
  8138. if (alitem.noticetype == 2) {
  8139. item.advicelist.push(alitem.noticememo);
  8140. }
  8141. }
  8142. });
  8143. } else {
  8144. item.havrisk = 0;
  8145. }
  8146. this.labellist.push({ name: item.diseasename });
  8147. });
  8148. this.list = list;
  8149. this.selectitem = list[0];
  8150. });
  8151. },
  8152. getinfo() {
  8153. let data = {
  8154. userid: this.share_userid ? this.share_userid : this.userinfo.id,
  8155. fmemberid: this.share_fmemberid ? this.share_fmemberid : this.selectuser.fmemberid
  8156. };
  8157. queryuserhealthinfobyuid(data).then((res) => {
  8158. res = res.data;
  8159. if (0 == res.code) {
  8160. this.$refs.toast.show({
  8161. type: "error",
  8162. message: res.errmsg
  8163. });
  8164. return false;
  8165. }
  8166. if (200 == res.code) {
  8167. this.info = res.resultData;
  8168. }
  8169. });
  8170. },
  8171. gethealthlist() {
  8172. let data = {
  8173. userid: this.share_userid ? this.share_userid : this.userinfo.id,
  8174. fmemberid: this.share_fmemberid ? this.share_fmemberid : this.selectuser.fmemberid
  8175. };
  8176. querystemperinfobyuserid(data).then((res) => {
  8177. res = res.data;
  8178. if (0 == res.code) {
  8179. this.$refs.toast.show({
  8180. type: "error",
  8181. message: res.errmsg
  8182. });
  8183. return false;
  8184. }
  8185. if (200 == res.code) {
  8186. let list = res.resultData;
  8187. list.map((item) => {
  8188. if (item.hvalue == 1) {
  8189. item.strvalue = this.$t("y");
  8190. } else {
  8191. item.strvalue = this.$t("n");
  8192. }
  8193. });
  8194. this.healthlist = list;
  8195. }
  8196. });
  8197. },
  8198. click(item) {
  8199. let index2 = item.index;
  8200. this.selectitem = this.list[index2];
  8201. },
  8202. change() {
  8203. },
  8204. share(data) {
  8205. uni.share({
  8206. provider: "weixin",
  8207. scene: "WXSceneSession",
  8208. type: 0,
  8209. href: "testapp://pages/report/report?userid=" + this.userid + "&fmemberid=" + this.selectuser.fmemberid,
  8210. //title: this.$t('navigationBarTitleText')+"分享",
  8211. title: "分享",
  8212. summary: "心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。",
  8213. imageUrl: data.shareimg,
  8214. success: function(res) {
  8215. addlog({
  8216. json: JSON.stringify(res),
  8217. type: "uniapp信息"
  8218. });
  8219. formatAppLog("log", "at pages/report/report.vue:298", "success:" + JSON.stringify(res));
  8220. },
  8221. fail: function(err) {
  8222. addlog({
  8223. json: JSON.stringify(err),
  8224. type: "uniapp错误"
  8225. });
  8226. formatAppLog("log", "at pages/report/report.vue:305", "fail:" + JSON.stringify(err));
  8227. }
  8228. });
  8229. }
  8230. },
  8231. mounted() {
  8232. this.userinfo = uni.getStorageSync("userinfo");
  8233. this.selectuser = uni.getStorageSync("selectuser");
  8234. uni.setNavigationBarTitle({
  8235. title: this.$t("show_report")
  8236. });
  8237. this.getlist();
  8238. this.getinfo();
  8239. this.gethealthlist();
  8240. },
  8241. onLoad: function(option) {
  8242. this.share_userid = option.userid;
  8243. this.share_fmemberid = option.fmemberid;
  8244. },
  8245. onBackPress: function(option) {
  8246. if (this.share_userid) {
  8247. uni.redirectTo({
  8248. url: "/pages/index/show"
  8249. });
  8250. } else {
  8251. tohome();
  8252. }
  8253. return true;
  8254. }
  8255. };
  8256. function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
  8257. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  8258. const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
  8259. const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
  8260. const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
  8261. const _component_uv_tabs = resolveEasycom(vue.resolveDynamicComponent("uv-tabs"), __easycom_4);
  8262. const _component_uv_line = resolveEasycom(vue.resolveDynamicComponent("uv-line"), __easycom_5);
  8263. return vue.openBlock(), vue.createElementBlock(
  8264. vue.Fragment,
  8265. null,
  8266. [
  8267. vue.createVNode(
  8268. _component_uv_toast,
  8269. { ref: "toast" },
  8270. null,
  8271. 512
  8272. /* NEED_PATCH */
  8273. ),
  8274. vue.createElementVNode("view", { class: "page" }, [
  8275. vue.createElementVNode("view", { class: "bottomarc" }),
  8276. vue.createVNode(_component_uv_row, {
  8277. justify: "space-between",
  8278. customStyle: "margin-top: 6%"
  8279. }, {
  8280. default: vue.withCtx(() => [
  8281. vue.createVNode(_component_uv_col, {
  8282. span: "10",
  8283. offset: "1",
  8284. class: "box1"
  8285. }, {
  8286. default: vue.withCtx(() => [
  8287. vue.createVNode(_component_uv_row, {
  8288. justify: "space-between",
  8289. class: "item"
  8290. }, {
  8291. default: vue.withCtx(() => [
  8292. vue.createVNode(_component_uv_col, {
  8293. span: "4",
  8294. align: "center"
  8295. }, {
  8296. default: vue.withCtx(() => [
  8297. vue.createTextVNode(
  8298. vue.toDisplayString(_ctx.$t("illness_title")),
  8299. 1
  8300. /* TEXT */
  8301. )
  8302. ]),
  8303. _: 1
  8304. /* STABLE */
  8305. }),
  8306. vue.createVNode(_component_uv_col, {
  8307. span: "4",
  8308. align: "center"
  8309. }, {
  8310. default: vue.withCtx(() => [
  8311. vue.createTextVNode(
  8312. vue.toDisplayString(_ctx.$t("report_score")),
  8313. 1
  8314. /* TEXT */
  8315. )
  8316. ]),
  8317. _: 1
  8318. /* STABLE */
  8319. }),
  8320. vue.createVNode(_component_uv_col, {
  8321. span: "4",
  8322. align: "center"
  8323. }, {
  8324. default: vue.withCtx(() => [
  8325. vue.createTextVNode(
  8326. vue.toDisplayString(_ctx.$t("report_result")),
  8327. 1
  8328. /* TEXT */
  8329. )
  8330. ]),
  8331. _: 1
  8332. /* STABLE */
  8333. })
  8334. ]),
  8335. _: 1
  8336. /* STABLE */
  8337. }),
  8338. (vue.openBlock(true), vue.createElementBlock(
  8339. vue.Fragment,
  8340. null,
  8341. vue.renderList($data.list, (item, index2) => {
  8342. return vue.openBlock(), vue.createBlock(
  8343. _component_uv_row,
  8344. {
  8345. justify: "space-between",
  8346. key: index2,
  8347. class: "item"
  8348. },
  8349. {
  8350. default: vue.withCtx(() => [
  8351. vue.createVNode(
  8352. _component_uv_col,
  8353. {
  8354. span: "4",
  8355. align: "center"
  8356. },
  8357. {
  8358. default: vue.withCtx(() => [
  8359. vue.createTextVNode(
  8360. vue.toDisplayString(item.diseasename),
  8361. 1
  8362. /* TEXT */
  8363. )
  8364. ]),
  8365. _: 2
  8366. /* DYNAMIC */
  8367. },
  8368. 1024
  8369. /* DYNAMIC_SLOTS */
  8370. ),
  8371. vue.createVNode(
  8372. _component_uv_col,
  8373. { span: "4" },
  8374. {
  8375. default: vue.withCtx(() => [
  8376. vue.createVNode(_component_uv_text, {
  8377. type: item.havrisk > 0 ? "error" : "success",
  8378. text: item.scoreresult ? item.scoreresult : 0,
  8379. align: "center"
  8380. }, null, 8, ["type", "text"])
  8381. ]),
  8382. _: 2
  8383. /* DYNAMIC */
  8384. },
  8385. 1024
  8386. /* DYNAMIC_SLOTS */
  8387. ),
  8388. vue.createVNode(
  8389. _component_uv_col,
  8390. { span: "4" },
  8391. {
  8392. default: vue.withCtx(() => [
  8393. vue.createVNode(_component_uv_text, {
  8394. type: item.havrisk > 0 ? "error" : "success",
  8395. text: item.havrisk > 0 ? _ctx.$t("risk") : _ctx.$t("low_risk"),
  8396. align: "center"
  8397. }, null, 8, ["type", "text"])
  8398. ]),
  8399. _: 2
  8400. /* DYNAMIC */
  8401. },
  8402. 1024
  8403. /* DYNAMIC_SLOTS */
  8404. )
  8405. ]),
  8406. _: 2
  8407. /* DYNAMIC */
  8408. },
  8409. 1024
  8410. /* DYNAMIC_SLOTS */
  8411. );
  8412. }),
  8413. 128
  8414. /* KEYED_FRAGMENT */
  8415. ))
  8416. ]),
  8417. _: 1
  8418. /* STABLE */
  8419. })
  8420. ]),
  8421. _: 1
  8422. /* STABLE */
  8423. }),
  8424. vue.createElementVNode("view", { class: "advicearea" }, [
  8425. vue.createVNode(_component_uv_row, {
  8426. justify: "space-between",
  8427. class: "item"
  8428. }, {
  8429. default: vue.withCtx(() => [
  8430. vue.createVNode(_component_uv_col, {
  8431. span: "12",
  8432. align: "center"
  8433. }, {
  8434. default: vue.withCtx(() => [
  8435. vue.createElementVNode(
  8436. "view",
  8437. { class: "advicelabel" },
  8438. vue.toDisplayString(_ctx.$t("report_detail")),
  8439. 1
  8440. /* TEXT */
  8441. )
  8442. ]),
  8443. _: 1
  8444. /* STABLE */
  8445. })
  8446. ]),
  8447. _: 1
  8448. /* STABLE */
  8449. })
  8450. ]),
  8451. $data.labellist.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  8452. vue.createVNode(_component_uv_tabs, {
  8453. list: $data.labellist,
  8454. onClick: $options.click,
  8455. customStyle: "align-items: center",
  8456. itemStyle: "font-size:20px;height:40px;",
  8457. current: "0",
  8458. onChange: $options.change,
  8459. activeStyle: $data.activeStyle,
  8460. lineWidth: "30"
  8461. }, null, 8, ["list", "onClick", "onChange", "activeStyle"])
  8462. ])) : vue.createCommentVNode("v-if", true),
  8463. vue.createElementVNode("view", { class: "info_div" }, [
  8464. $data.selectitem ? (vue.openBlock(), vue.createElementBlock("view", {
  8465. key: 0,
  8466. class: ""
  8467. }, [
  8468. vue.createElementVNode(
  8469. "view",
  8470. { class: "diseasetitlestr" },
  8471. vue.toDisplayString($data.selectitem.titlestr),
  8472. 1
  8473. /* TEXT */
  8474. ),
  8475. vue.withDirectives(vue.createElementVNode(
  8476. "view",
  8477. null,
  8478. [
  8479. vue.createVNode(_component_uv_text, {
  8480. text: _ctx.$t("report_text_1") + $data.selectitem.risklimit + _ctx.$t("report_text_1_1"),
  8481. align: "center",
  8482. type: "success"
  8483. }, null, 8, ["text"])
  8484. ],
  8485. 512
  8486. /* NEED_PATCH */
  8487. ), [
  8488. [vue.vShow, $data.selectitem.havrisk == 0]
  8489. ]),
  8490. $data.selectitem.havrisk == 1 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  8491. vue.createVNode(_component_uv_text, {
  8492. text: $data.selectitem.riskmsg,
  8493. align: "center",
  8494. type: "error",
  8495. customStyle: $data.customStyleRiskmsg
  8496. }, null, 8, ["text", "customStyle"]),
  8497. vue.createVNode(_component_uv_text, {
  8498. text: _ctx.$t("report_error_text_1"),
  8499. align: "center",
  8500. customStyle: $data.customStyleErrorText
  8501. }, null, 8, ["text", "customStyle"]),
  8502. vue.createVNode(_component_uv_text, {
  8503. text: _ctx.$t("report_error_text_2"),
  8504. align: "center",
  8505. customStyle: $data.customStyleErrorText
  8506. }, null, 8, ["text", "customStyle"]),
  8507. vue.createVNode(_component_uv_text, {
  8508. text: _ctx.$t("report_error_text_3"),
  8509. align: "center",
  8510. customStyle: $data.customStyleErrorText
  8511. }, null, 8, ["text", "customStyle"]),
  8512. vue.createVNode(_component_uv_row, { customStyle: "margin-top:20rpx" }, {
  8513. default: vue.withCtx(() => [
  8514. vue.createVNode(_component_uv_col, { span: "12" }, {
  8515. default: vue.withCtx(() => [
  8516. vue.withDirectives(vue.createElementVNode(
  8517. "view",
  8518. null,
  8519. [
  8520. (vue.openBlock(true), vue.createElementBlock(
  8521. vue.Fragment,
  8522. null,
  8523. vue.renderList($data.selectitem.noticelist, (item, index2) => {
  8524. return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
  8525. vue.createVNode(_component_uv_text, {
  8526. text: index2 + 1 + "、" + item
  8527. }, null, 8, ["text"])
  8528. ]);
  8529. }),
  8530. 128
  8531. /* KEYED_FRAGMENT */
  8532. ))
  8533. ],
  8534. 512
  8535. /* NEED_PATCH */
  8536. ), [
  8537. [vue.vShow, $data.selectitem.noticelist.length > 0]
  8538. ])
  8539. ]),
  8540. _: 1
  8541. /* STABLE */
  8542. })
  8543. ]),
  8544. _: 1
  8545. /* STABLE */
  8546. })
  8547. ])) : vue.createCommentVNode("v-if", true),
  8548. vue.withDirectives(vue.createElementVNode(
  8549. "view",
  8550. { class: "noticearea" },
  8551. [
  8552. vue.createVNode(_component_uv_row, { customStyle: "" }, {
  8553. default: vue.withCtx(() => [
  8554. vue.createVNode(_component_uv_col, {
  8555. span: "12",
  8556. align: "center"
  8557. }, {
  8558. default: vue.withCtx(() => [
  8559. vue.createElementVNode(
  8560. "view",
  8561. { class: "noticelabel" },
  8562. vue.toDisplayString(_ctx.$t("health_advice")),
  8563. 1
  8564. /* TEXT */
  8565. )
  8566. ]),
  8567. _: 1
  8568. /* STABLE */
  8569. })
  8570. ]),
  8571. _: 1
  8572. /* STABLE */
  8573. }),
  8574. vue.createVNode(_component_uv_row, { customStyle: "" }, {
  8575. default: vue.withCtx(() => [
  8576. vue.createVNode(_component_uv_col, { span: "12" }, {
  8577. default: vue.withCtx(() => [
  8578. vue.withDirectives(vue.createElementVNode(
  8579. "view",
  8580. null,
  8581. [
  8582. (vue.openBlock(true), vue.createElementBlock(
  8583. vue.Fragment,
  8584. null,
  8585. vue.renderList($data.selectitem.advicelist, (item, index2) => {
  8586. return vue.openBlock(), vue.createElementBlock("view", { key: index2 }, [
  8587. vue.createVNode(_component_uv_text, {
  8588. text: index2 + 1 + "、" + item
  8589. }, null, 8, ["text"])
  8590. ]);
  8591. }),
  8592. 128
  8593. /* KEYED_FRAGMENT */
  8594. ))
  8595. ],
  8596. 512
  8597. /* NEED_PATCH */
  8598. ), [
  8599. [vue.vShow, $data.selectitem.advicelist.length > 0]
  8600. ])
  8601. ]),
  8602. _: 1
  8603. /* STABLE */
  8604. })
  8605. ]),
  8606. _: 1
  8607. /* STABLE */
  8608. })
  8609. ],
  8610. 512
  8611. /* NEED_PATCH */
  8612. ), [
  8613. [vue.vShow, $data.selectitem.havrisk == 1]
  8614. ])
  8615. ])) : vue.createCommentVNode("v-if", true),
  8616. vue.createElementVNode("view", { class: "report_explain" }, [
  8617. vue.createElementVNode("view", { class: "advicearea" }, [
  8618. vue.createVNode(_component_uv_row, {
  8619. justify: "space-between",
  8620. class: "item"
  8621. }, {
  8622. default: vue.withCtx(() => [
  8623. vue.createVNode(_component_uv_col, {
  8624. span: "12",
  8625. align: "center"
  8626. }, {
  8627. default: vue.withCtx(() => [
  8628. vue.createElementVNode(
  8629. "view",
  8630. { class: "advicelabel" },
  8631. vue.toDisplayString(_ctx.$t("report_explain")),
  8632. 1
  8633. /* TEXT */
  8634. )
  8635. ]),
  8636. _: 1
  8637. /* STABLE */
  8638. })
  8639. ]),
  8640. _: 1
  8641. /* STABLE */
  8642. })
  8643. ]),
  8644. vue.createElementVNode("view", { class: "info_div1" }, [
  8645. $data.info.age >= 40 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
  8646. key: 0,
  8647. text: _ctx.$t("report_explain_text_1"),
  8648. type: "info",
  8649. align: "center"
  8650. }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
  8651. $data.info.gender == "男" ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
  8652. key: 1,
  8653. text: _ctx.$t("report_explain_text_2"),
  8654. type: "info",
  8655. align: "center"
  8656. }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
  8657. $data.info.bmi > 24 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
  8658. key: 2,
  8659. 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"),
  8660. type: "info",
  8661. align: "center"
  8662. }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
  8663. $data.info.sbp >= 140 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
  8664. key: 3,
  8665. text: _ctx.$t("report_explain_text_4"),
  8666. type: "info"
  8667. }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
  8668. ]),
  8669. vue.createElementVNode("view", { class: "info_div1" }, [
  8670. $data.info.fhstroke > 0 || $data.info.fhheart > 0 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
  8671. key: 0,
  8672. text: _ctx.$t("report_explain_text_5"),
  8673. type: "info",
  8674. align: "center"
  8675. }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
  8676. $data.info.issmoke > 0 || $data.info.isdrink > 0 || $data.info.isunsport > 0 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
  8677. key: 1,
  8678. text: _ctx.$t("report_explain_text_6"),
  8679. type: "info",
  8680. align: "center"
  8681. }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
  8682. $data.info.age >= 40 && $data.info.issmoke > 0 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
  8683. key: 2,
  8684. text: _ctx.$t("report_explain_text_7"),
  8685. type: "info",
  8686. align: "center"
  8687. }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
  8688. $data.info.isinspectabodomen > 0 || $data.info.isteghtness > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  8689. key: 3,
  8690. class: ""
  8691. }, [
  8692. $data.info.isinspectabodomen > 1 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
  8693. key: 0,
  8694. text: _ctx.$t("report_explain_text_8"),
  8695. type: "info",
  8696. align: "center"
  8697. }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
  8698. $data.info.isteghtness > 1 ? (vue.openBlock(), vue.createBlock(_component_uv_text, {
  8699. key: 1,
  8700. text: _ctx.$t("report_explain_text_9"),
  8701. type: "info",
  8702. align: "center"
  8703. }, null, 8, ["text"])) : vue.createCommentVNode("v-if", true)
  8704. ])) : vue.createCommentVNode("v-if", true)
  8705. ])
  8706. ]),
  8707. vue.createVNode(_component_uv_line, { color: "#933333" }),
  8708. vue.createElementVNode("view", { class: "healthinfolist" }, [
  8709. vue.createElementVNode("view", { class: "grid" }, [
  8710. vue.createVNode(_component_uv_row, {
  8711. justify: "space-between",
  8712. class: "item"
  8713. }, {
  8714. default: vue.withCtx(() => [
  8715. vue.createVNode(_component_uv_col, {
  8716. span: "3",
  8717. align: "center"
  8718. }, {
  8719. default: vue.withCtx(() => [
  8720. vue.createVNode(_component_uv_text, {
  8721. text: _ctx.$t("healthy_habits"),
  8722. bold: true,
  8723. align: "center"
  8724. }, null, 8, ["text"])
  8725. ]),
  8726. _: 1
  8727. /* STABLE */
  8728. }),
  8729. vue.createVNode(_component_uv_col, {
  8730. span: "2",
  8731. align: "center"
  8732. }, {
  8733. default: vue.withCtx(() => [
  8734. vue.createVNode(_component_uv_text, {
  8735. text: _ctx.$t("y_n"),
  8736. bold: true,
  8737. align: "center"
  8738. }, null, 8, ["text"])
  8739. ]),
  8740. _: 1
  8741. /* STABLE */
  8742. }),
  8743. vue.createVNode(_component_uv_col, {
  8744. span: "7",
  8745. align: "center"
  8746. }, {
  8747. default: vue.withCtx(() => [
  8748. vue.createVNode(_component_uv_text, {
  8749. text: _ctx.$t("healthy_personal_ratios"),
  8750. bold: true,
  8751. align: "center"
  8752. }, null, 8, ["text"])
  8753. ]),
  8754. _: 1
  8755. /* STABLE */
  8756. })
  8757. ]),
  8758. _: 1
  8759. /* STABLE */
  8760. }),
  8761. (vue.openBlock(true), vue.createElementBlock(
  8762. vue.Fragment,
  8763. null,
  8764. vue.renderList($data.healthlist, (item, index2) => {
  8765. return vue.openBlock(), vue.createBlock(
  8766. _component_uv_row,
  8767. {
  8768. justify: "space-between",
  8769. class: "item",
  8770. key: index2
  8771. },
  8772. {
  8773. default: vue.withCtx(() => [
  8774. vue.createVNode(
  8775. _component_uv_col,
  8776. {
  8777. span: "3",
  8778. align: "center"
  8779. },
  8780. {
  8781. default: vue.withCtx(() => [
  8782. vue.createVNode(_component_uv_text, {
  8783. text: item.disstr,
  8784. align: "center",
  8785. size: "12"
  8786. }, null, 8, ["text"])
  8787. ]),
  8788. _: 2
  8789. /* DYNAMIC */
  8790. },
  8791. 1024
  8792. /* DYNAMIC_SLOTS */
  8793. ),
  8794. vue.createVNode(
  8795. _component_uv_col,
  8796. {
  8797. span: "2",
  8798. align: "center"
  8799. },
  8800. {
  8801. default: vue.withCtx(() => [
  8802. vue.createVNode(_component_uv_text, {
  8803. text: item.strvalue,
  8804. align: "center",
  8805. size: "12"
  8806. }, null, 8, ["text"])
  8807. ]),
  8808. _: 2
  8809. /* DYNAMIC */
  8810. },
  8811. 1024
  8812. /* DYNAMIC_SLOTS */
  8813. ),
  8814. vue.createVNode(
  8815. _component_uv_col,
  8816. {
  8817. span: "4",
  8818. align: "center"
  8819. },
  8820. {
  8821. default: vue.withCtx(() => [
  8822. vue.createVNode(_component_uv_text, {
  8823. text: _ctx.$t("all_people") + item.allpre + "%",
  8824. align: "center",
  8825. size: "12"
  8826. }, null, 8, ["text"])
  8827. ]),
  8828. _: 2
  8829. /* DYNAMIC */
  8830. },
  8831. 1024
  8832. /* DYNAMIC_SLOTS */
  8833. ),
  8834. vue.createVNode(
  8835. _component_uv_col,
  8836. {
  8837. span: "3",
  8838. align: "center"
  8839. },
  8840. {
  8841. default: vue.withCtx(() => [
  8842. vue.createVNode(_component_uv_text, {
  8843. text: _ctx.$t("group_people") + item.agepre + "%",
  8844. align: "center",
  8845. size: "12"
  8846. }, null, 8, ["text"])
  8847. ]),
  8848. _: 2
  8849. /* DYNAMIC */
  8850. },
  8851. 1024
  8852. /* DYNAMIC_SLOTS */
  8853. )
  8854. ]),
  8855. _: 2
  8856. /* DYNAMIC */
  8857. },
  8858. 1024
  8859. /* DYNAMIC_SLOTS */
  8860. );
  8861. }),
  8862. 128
  8863. /* KEYED_FRAGMENT */
  8864. ))
  8865. ]),
  8866. vue.createVNode(_component_uv_text, {
  8867. text: _ctx.$t("report_text_4"),
  8868. align: "center",
  8869. type: "info",
  8870. bold: true
  8871. }, null, 8, ["text"])
  8872. ]),
  8873. vue.createCommentVNode(` <uv-line color="#933333"></uv-line>\r
  8874. <view class="info_div1">\r
  8875. <uv-text :text="$t('report_text_5')" align="center" :bold="true"></uv-text>\r
  8876. <br />\r
  8877. <uv-text :text="$t('report_text_6')" type="info"></uv-text>\r
  8878. <uv-text :text="$t('report_text_7')" type="info"></uv-text>\r
  8879. <uv-text :text="$t('report_text_8')" type="info"></uv-text>\r
  8880. </view> `),
  8881. vue.createVNode(_component_uv_line, { color: "#933333" }),
  8882. vue.createElementVNode("view", { class: "info_div1" }, [
  8883. vue.createVNode(_component_uv_text, {
  8884. text: _ctx.$t("report_text_9"),
  8885. bold: true,
  8886. align: "center"
  8887. }, null, 8, ["text"])
  8888. ]),
  8889. vue.createVNode(_component_uv_line, { color: "#933333" }),
  8890. vue.createElementVNode("br"),
  8891. vue.createCommentVNode(' <share @dosharewechat="share"></share> '),
  8892. vue.createElementVNode("br")
  8893. ])
  8894. ])
  8895. ],
  8896. 64
  8897. /* STABLE_FRAGMENT */
  8898. );
  8899. }
  8900. 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"]]);
  8901. const props$2 = {
  8902. props: {
  8903. bgColor: {
  8904. type: String,
  8905. default: "transparent"
  8906. }
  8907. }
  8908. };
  8909. const _sfc_main$c = {
  8910. name: "uv-status-bar",
  8911. mixins: [mpMixin, mixin, props$2],
  8912. data() {
  8913. return {};
  8914. },
  8915. computed: {
  8916. style() {
  8917. const style = {};
  8918. style.height = this.$uv.addUnit(this.$uv.sys().statusBarHeight, "px");
  8919. if (this.bgColor) {
  8920. if (this.bgColor.indexOf("gradient") > -1) {
  8921. style.backgroundImage = this.bgColor;
  8922. } else {
  8923. style.background = this.bgColor;
  8924. }
  8925. }
  8926. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  8927. }
  8928. }
  8929. };
  8930. function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
  8931. return vue.openBlock(), vue.createElementBlock(
  8932. "view",
  8933. {
  8934. style: vue.normalizeStyle([$options.style]),
  8935. class: "uv-status-bar"
  8936. },
  8937. [
  8938. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  8939. ],
  8940. 4
  8941. /* STYLE */
  8942. );
  8943. }
  8944. 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"]]);
  8945. const _sfc_main$b = {
  8946. name: "uv-safe-bottom",
  8947. mixins: [mpMixin, mixin],
  8948. data() {
  8949. return {
  8950. safeAreaBottomHeight: 0,
  8951. isNvue: false
  8952. };
  8953. },
  8954. computed: {
  8955. style() {
  8956. const style = {};
  8957. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  8958. }
  8959. },
  8960. mounted() {
  8961. }
  8962. };
  8963. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  8964. return vue.openBlock(), vue.createElementBlock(
  8965. "view",
  8966. {
  8967. class: vue.normalizeClass(["uv-safe-bottom", [!$data.isNvue && "uv-safe-area-inset-bottom"]]),
  8968. style: vue.normalizeStyle([$options.style])
  8969. },
  8970. null,
  8971. 6
  8972. /* CLASS, STYLE */
  8973. );
  8974. }
  8975. 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"]]);
  8976. const _sfc_main$a = {
  8977. name: "uv-popup",
  8978. components: {},
  8979. mixins: [mpMixin, mixin],
  8980. emits: ["change", "maskClick"],
  8981. props: {
  8982. // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
  8983. // message: 消息提示 ; dialog : 对话框
  8984. mode: {
  8985. type: String,
  8986. default: "center"
  8987. },
  8988. // 动画时长,单位ms
  8989. duration: {
  8990. type: [String, Number],
  8991. default: 300
  8992. },
  8993. // 层级
  8994. zIndex: {
  8995. type: [String, Number],
  8996. default: 10075
  8997. },
  8998. bgColor: {
  8999. type: String,
  9000. default: "#ffffff"
  9001. },
  9002. safeArea: {
  9003. type: Boolean,
  9004. default: true
  9005. },
  9006. // 是否显示遮罩
  9007. overlay: {
  9008. type: Boolean,
  9009. default: true
  9010. },
  9011. // 点击遮罩是否关闭弹窗
  9012. closeOnClickOverlay: {
  9013. type: Boolean,
  9014. default: true
  9015. },
  9016. // 遮罩的透明度,0-1之间
  9017. overlayOpacity: {
  9018. type: [Number, String],
  9019. default: 0.4
  9020. },
  9021. // 自定义遮罩的样式
  9022. overlayStyle: {
  9023. type: [Object, String],
  9024. default: ""
  9025. },
  9026. // 是否为iPhoneX留出底部安全距离
  9027. safeAreaInsetBottom: {
  9028. type: Boolean,
  9029. default: true
  9030. },
  9031. // 是否留出顶部安全距离(状态栏高度)
  9032. safeAreaInsetTop: {
  9033. type: Boolean,
  9034. default: false
  9035. },
  9036. // 是否显示关闭图标
  9037. closeable: {
  9038. type: Boolean,
  9039. default: false
  9040. },
  9041. // 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角
  9042. closeIconPos: {
  9043. type: String,
  9044. default: "top-right"
  9045. },
  9046. // mode=center,也即中部弹出时,是否使用缩放模式
  9047. zoom: {
  9048. type: Boolean,
  9049. default: true
  9050. },
  9051. round: {
  9052. type: [Number, String],
  9053. default: 0
  9054. },
  9055. ...(_N = (_M = uni.$uv) == null ? void 0 : _M.props) == null ? void 0 : _N.popup
  9056. },
  9057. watch: {
  9058. /**
  9059. * 监听type类型
  9060. */
  9061. type: {
  9062. handler: function(type2) {
  9063. if (!this.config[type2])
  9064. return;
  9065. this[this.config[type2]](true);
  9066. },
  9067. immediate: true
  9068. },
  9069. isDesktop: {
  9070. handler: function(newVal) {
  9071. if (!this.config[newVal])
  9072. return;
  9073. this[this.config[this.mode]](true);
  9074. },
  9075. immediate: true
  9076. },
  9077. // H5 下禁止底部滚动
  9078. showPopup(show) {
  9079. }
  9080. },
  9081. data() {
  9082. return {
  9083. ani: [],
  9084. showPopup: false,
  9085. showTrans: false,
  9086. popupWidth: 0,
  9087. popupHeight: 0,
  9088. config: {
  9089. top: "top",
  9090. bottom: "bottom",
  9091. center: "center",
  9092. left: "left",
  9093. right: "right",
  9094. message: "top",
  9095. dialog: "center",
  9096. share: "bottom"
  9097. },
  9098. transitionStyle: {
  9099. position: "fixed",
  9100. left: 0,
  9101. right: 0
  9102. },
  9103. maskShow: true,
  9104. mkclick: true,
  9105. popupClass: this.isDesktop ? "fixforpc-top" : "top",
  9106. direction: ""
  9107. };
  9108. },
  9109. computed: {
  9110. isDesktop() {
  9111. return this.popupWidth >= 500 && this.popupHeight >= 500;
  9112. },
  9113. bg() {
  9114. if (this.bgColor === "" || this.bgColor === "none" || this.$uv.getPx(this.round) > 0) {
  9115. return "transparent";
  9116. }
  9117. return this.bgColor;
  9118. },
  9119. contentStyle() {
  9120. const style = {};
  9121. if (this.bgColor) {
  9122. style.backgroundColor = this.bg;
  9123. }
  9124. if (this.round) {
  9125. const value2 = this.$uv.addUnit(this.round);
  9126. const mode = this.direction ? this.direction : this.mode;
  9127. style.backgroundColor = this.bgColor;
  9128. if (mode === "top") {
  9129. style.borderBottomLeftRadius = value2;
  9130. style.borderBottomRightRadius = value2;
  9131. } else if (mode === "bottom") {
  9132. style.borderTopLeftRadius = value2;
  9133. style.borderTopRightRadius = value2;
  9134. } else if (mode === "center") {
  9135. style.borderRadius = value2;
  9136. }
  9137. }
  9138. return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
  9139. }
  9140. },
  9141. // TODO vue3
  9142. unmounted() {
  9143. this.setH5Visible();
  9144. },
  9145. created() {
  9146. this.messageChild = null;
  9147. this.clearPropagation = false;
  9148. },
  9149. methods: {
  9150. setH5Visible() {
  9151. },
  9152. /**
  9153. * 公用方法,不显示遮罩层
  9154. */
  9155. closeMask() {
  9156. this.maskShow = false;
  9157. },
  9158. // TODO nvue 取消冒泡
  9159. clear(e) {
  9160. e.stopPropagation();
  9161. this.clearPropagation = true;
  9162. },
  9163. open(direction) {
  9164. if (this.showPopup) {
  9165. return;
  9166. }
  9167. let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
  9168. if (!(direction && innerType.indexOf(direction) !== -1)) {
  9169. direction = this.mode;
  9170. } else {
  9171. this.direction = direction;
  9172. }
  9173. if (!this.config[direction]) {
  9174. return this.$uv.error(`缺少类型:${direction}`);
  9175. }
  9176. this[this.config[direction]]();
  9177. this.$emit("change", {
  9178. show: true,
  9179. type: direction
  9180. });
  9181. },
  9182. close(type2) {
  9183. this.showTrans = false;
  9184. this.$emit("change", {
  9185. show: false,
  9186. type: this.mode
  9187. });
  9188. clearTimeout(this.timer);
  9189. this.timer = setTimeout(() => {
  9190. this.showPopup = false;
  9191. }, 300);
  9192. },
  9193. // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
  9194. touchstart() {
  9195. this.clearPropagation = false;
  9196. },
  9197. onTap() {
  9198. if (this.clearPropagation) {
  9199. this.clearPropagation = false;
  9200. return;
  9201. }
  9202. this.$emit("maskClick");
  9203. if (!this.closeOnClickOverlay)
  9204. return;
  9205. this.close();
  9206. },
  9207. /**
  9208. * 顶部弹出样式处理
  9209. */
  9210. top(type2) {
  9211. this.popupClass = this.isDesktop ? "fixforpc-top" : "top";
  9212. this.ani = ["slide-top"];
  9213. this.transitionStyle = {
  9214. position: "fixed",
  9215. zIndex: this.zIndex,
  9216. left: 0,
  9217. right: 0,
  9218. backgroundColor: this.bg
  9219. };
  9220. if (type2)
  9221. return;
  9222. this.showPopup = true;
  9223. this.showTrans = true;
  9224. this.$nextTick(() => {
  9225. if (this.messageChild && this.mode === "message") {
  9226. this.messageChild.timerClose();
  9227. }
  9228. });
  9229. },
  9230. /**
  9231. * 底部弹出样式处理
  9232. */
  9233. bottom(type2) {
  9234. this.popupClass = "bottom";
  9235. this.ani = ["slide-bottom"];
  9236. this.transitionStyle = {
  9237. position: "fixed",
  9238. zIndex: this.zIndex,
  9239. left: 0,
  9240. right: 0,
  9241. bottom: 0,
  9242. backgroundColor: this.bg
  9243. };
  9244. if (type2)
  9245. return;
  9246. this.showPopup = true;
  9247. this.showTrans = true;
  9248. },
  9249. /**
  9250. * 中间弹出样式处理
  9251. */
  9252. center(type2) {
  9253. this.popupClass = "center";
  9254. this.ani = this.zoom ? ["zoom-in", "fade"] : ["fade"];
  9255. this.transitionStyle = {
  9256. position: "fixed",
  9257. zIndex: this.zIndex,
  9258. display: "flex",
  9259. flexDirection: "column",
  9260. bottom: 0,
  9261. left: 0,
  9262. right: 0,
  9263. top: 0,
  9264. justifyContent: "center",
  9265. alignItems: "center"
  9266. };
  9267. if (type2)
  9268. return;
  9269. this.showPopup = true;
  9270. this.showTrans = true;
  9271. },
  9272. left(type2) {
  9273. this.popupClass = "left";
  9274. this.ani = ["slide-left"];
  9275. this.transitionStyle = {
  9276. position: "fixed",
  9277. zIndex: this.zIndex,
  9278. left: 0,
  9279. bottom: 0,
  9280. top: 0,
  9281. backgroundColor: this.bg,
  9282. display: "flex",
  9283. flexDirection: "column"
  9284. };
  9285. if (type2)
  9286. return;
  9287. this.showPopup = true;
  9288. this.showTrans = true;
  9289. },
  9290. right(type2) {
  9291. this.popupClass = "right";
  9292. this.ani = ["slide-right"];
  9293. this.transitionStyle = {
  9294. position: "fixed",
  9295. zIndex: this.zIndex,
  9296. bottom: 0,
  9297. right: 0,
  9298. top: 0,
  9299. backgroundColor: this.bg,
  9300. display: "flex",
  9301. flexDirection: "column"
  9302. };
  9303. if (type2)
  9304. return;
  9305. this.showPopup = true;
  9306. this.showTrans = true;
  9307. }
  9308. }
  9309. };
  9310. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  9311. const _component_uv_overlay = resolveEasycom(vue.resolveDynamicComponent("uv-overlay"), __easycom_0$3);
  9312. const _component_uv_status_bar = resolveEasycom(vue.resolveDynamicComponent("uv-status-bar"), __easycom_1$1);
  9313. const _component_uv_safe_bottom = resolveEasycom(vue.resolveDynamicComponent("uv-safe-bottom"), __easycom_2$1);
  9314. const _component_uv_icon = resolveEasycom(vue.resolveDynamicComponent("uv-icon"), __easycom_3$4);
  9315. const _component_uv_transition = resolveEasycom(vue.resolveDynamicComponent("uv-transition"), __easycom_4$1);
  9316. return $data.showPopup ? (vue.openBlock(), vue.createElementBlock(
  9317. "view",
  9318. {
  9319. key: 0,
  9320. class: vue.normalizeClass(["uv-popup", [$data.popupClass, $options.isDesktop ? "fixforpc-z-index" : ""]]),
  9321. style: vue.normalizeStyle([{ zIndex: $props.zIndex }])
  9322. },
  9323. [
  9324. vue.createElementVNode(
  9325. "view",
  9326. {
  9327. onTouchstart: _cache[2] || (_cache[2] = (...args) => $options.touchstart && $options.touchstart(...args))
  9328. },
  9329. [
  9330. vue.createCommentVNode(" 遮罩层 "),
  9331. $data.maskShow && $props.overlay ? (vue.openBlock(), vue.createBlock(_component_uv_overlay, {
  9332. key: "1",
  9333. show: $data.showTrans,
  9334. duration: $props.duration,
  9335. "custom-style": $props.overlayStyle,
  9336. opacity: $props.overlayOpacity,
  9337. zIndex: $props.zIndex,
  9338. onClick: $options.onTap
  9339. }, null, 8, ["show", "duration", "custom-style", "opacity", "zIndex", "onClick"])) : vue.createCommentVNode("v-if", true),
  9340. vue.createVNode(_component_uv_transition, {
  9341. key: "2",
  9342. mode: $data.ani,
  9343. name: "content",
  9344. "custom-style": $data.transitionStyle,
  9345. duration: $props.duration,
  9346. show: $data.showTrans,
  9347. onClick: $options.onTap
  9348. }, {
  9349. default: vue.withCtx(() => [
  9350. vue.createElementVNode(
  9351. "view",
  9352. {
  9353. class: vue.normalizeClass(["uv-popup__content", [$data.popupClass]]),
  9354. style: vue.normalizeStyle([$options.contentStyle]),
  9355. onClick: _cache[1] || (_cache[1] = (...args) => $options.clear && $options.clear(...args))
  9356. },
  9357. [
  9358. $props.safeAreaInsetTop ? (vue.openBlock(), vue.createBlock(_component_uv_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true),
  9359. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
  9360. $props.safeAreaInsetBottom ? (vue.openBlock(), vue.createBlock(_component_uv_safe_bottom, { key: 1 })) : vue.createCommentVNode("v-if", true),
  9361. $props.closeable ? (vue.openBlock(), vue.createElementBlock(
  9362. "view",
  9363. {
  9364. key: 2,
  9365. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.close && $options.close(...args), ["stop"])),
  9366. class: vue.normalizeClass(["uv-popup__content__close", ["uv-popup__content__close--" + $props.closeIconPos]]),
  9367. "hover-class": "uv-popup__content__close--hover",
  9368. "hover-stay-time": "150"
  9369. },
  9370. [
  9371. vue.createVNode(_component_uv_icon, {
  9372. name: "close",
  9373. color: "#909399",
  9374. size: "18",
  9375. bold: ""
  9376. })
  9377. ],
  9378. 2
  9379. /* CLASS */
  9380. )) : vue.createCommentVNode("v-if", true)
  9381. ],
  9382. 6
  9383. /* CLASS, STYLE */
  9384. )
  9385. ]),
  9386. _: 3
  9387. /* FORWARDED */
  9388. }, 8, ["mode", "custom-style", "duration", "show", "onClick"])
  9389. ],
  9390. 32
  9391. /* NEED_HYDRATION */
  9392. )
  9393. ],
  9394. 6
  9395. /* CLASS, STYLE */
  9396. )) : vue.createCommentVNode("v-if", true);
  9397. }
  9398. 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"]]);
  9399. const _sfc_main$9 = {
  9400. name: "radio",
  9401. props: {
  9402. //值
  9403. selectvalue: {
  9404. type: String,
  9405. required: true,
  9406. validator: function(value2) {
  9407. return value2.length > 0;
  9408. }
  9409. },
  9410. //标签
  9411. label: {
  9412. type: String,
  9413. required: true,
  9414. validator: function(value2) {
  9415. return value2.length > 0;
  9416. }
  9417. },
  9418. checked: {
  9419. type: Boolean
  9420. }
  9421. },
  9422. data() {
  9423. return {};
  9424. }
  9425. };
  9426. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  9427. return vue.openBlock(), vue.createElementBlock("view", { class: "row" }, [
  9428. vue.createElementVNode("view", null, [
  9429. vue.createElementVNode(
  9430. "label",
  9431. { for: "" },
  9432. vue.toDisplayString($props.label),
  9433. 1
  9434. /* TEXT */
  9435. )
  9436. ]),
  9437. vue.createElementVNode("view", null, [
  9438. vue.createElementVNode("radio", {
  9439. value: $props.selectvalue,
  9440. checked: $props.checked,
  9441. color: "rgb(100, 142, 184)",
  9442. style: { "border-radius": "0" }
  9443. }, null, 8, ["value", "checked"])
  9444. ])
  9445. ]);
  9446. }
  9447. const Radio = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__scopeId", "data-v-b6b9d1fa"], ["__file", "D:/workspace/uniapp/health2/components/radio.vue"]]);
  9448. const _sfc_main$8 = {
  9449. components: {
  9450. Radio
  9451. },
  9452. data() {
  9453. return {
  9454. userinfo: {},
  9455. selectuser: {},
  9456. stemitem: {},
  9457. scaleid: 0,
  9458. srid: 0,
  9459. sindex: 0,
  9460. stemindexlabel: 1,
  9461. selectanswer: "",
  9462. answeroptionid: "",
  9463. customStyle: {
  9464. fontSize: "30px",
  9465. width: "100%"
  9466. },
  9467. selectbutton2: {
  9468. fontSize: "30px",
  9469. width: "500rpx",
  9470. background: "#648EB8",
  9471. border: "0px"
  9472. },
  9473. selectbutton3: {
  9474. fontSize: "20px",
  9475. fontWeight: "bold",
  9476. letterSpacing: "0.5em"
  9477. },
  9478. percent: 0,
  9479. timer: false
  9480. };
  9481. },
  9482. computed: {
  9483. surplusstems() {
  9484. let stemlist = uni.getStorageSync("stemlist");
  9485. let value2 = 1;
  9486. stemlist.map((item, index2) => {
  9487. if (item.id == this.stemitem.id) {
  9488. value2 = stemlist.length - index2;
  9489. }
  9490. });
  9491. return value2;
  9492. },
  9493. comstatus() {
  9494. let stemlist = uni.getStorageSync("stemlist");
  9495. let sindex = parseInt(this.sindex);
  9496. let count = stemlist.length - 2;
  9497. if (sindex + 1 == count) {
  9498. return true;
  9499. } else {
  9500. return false;
  9501. }
  9502. }
  9503. },
  9504. methods: {
  9505. init() {
  9506. this.userinfo = uni.getStorageSync("userinfo");
  9507. this.selectuser = uni.getStorageSync("selectuser");
  9508. this.stemitem = uni.getStorageSync("stemitem");
  9509. },
  9510. change(e) {
  9511. let value2 = e.detail.value;
  9512. let list = this.stemitem.alist;
  9513. this.selectanswer = list[value2];
  9514. },
  9515. donext() {
  9516. if ("" == this.selectanswer) {
  9517. this.$refs.toast.show({
  9518. type: "error",
  9519. message: this.$t("please_completion_problem")
  9520. });
  9521. return false;
  9522. }
  9523. var answer = {
  9524. userid: this.userinfo.id,
  9525. fmemberid: this.selectuser.fmemberid,
  9526. stemid: this.stemitem.id,
  9527. answertype: 1,
  9528. answeroptionid: this.selectanswer.id,
  9529. answeroption: this.selectanswer.option
  9530. };
  9531. let data = {
  9532. userid: this.userinfo.id,
  9533. fmemberid: this.selectuser.fmemberid,
  9534. srid: this.srid,
  9535. scaleid: this.scaleid
  9536. };
  9537. subanswerbyuserid(answer, data).then((res) => {
  9538. res = res.data;
  9539. if (0 == res.code) {
  9540. this.$refs.toast.show({
  9541. type: "error",
  9542. message: res.errmsg
  9543. });
  9544. return false;
  9545. }
  9546. if (200 == res.code) {
  9547. uni.setStorage({
  9548. key: "srid",
  9549. data: res.resultData
  9550. });
  9551. let data2 = {
  9552. stemid: this.stemitem.id,
  9553. answeroptionid: this.selectanswer.id
  9554. };
  9555. formatAppLog("log", "at pages/topic/common.vue:181", this.comstatus);
  9556. if (this.comstatus) {
  9557. let srid = this.srid;
  9558. subcomstatus(srid).then();
  9559. uni.removeStorage({
  9560. key: "stemitem"
  9561. });
  9562. uni.redirectTo({
  9563. url: "/pages/report/report"
  9564. });
  9565. } else {
  9566. querypercentagebystemid(data2).then((res2) => {
  9567. res2 = res2.data;
  9568. if (0 == res2.code) {
  9569. let result = tostemlistnext(this.sindex, 1);
  9570. if (!result) {
  9571. this.$refs.toast.show({
  9572. type: "error",
  9573. message: this.$t("system_error")
  9574. });
  9575. return false;
  9576. }
  9577. }
  9578. if (200 == res2.code) {
  9579. this.percent = res2.resultData + "%";
  9580. this.showinfo();
  9581. let that = this;
  9582. this.timer = setTimeout(function() {
  9583. that.closeinfo();
  9584. tostemlistnext(that.sindex, 1);
  9585. }, 3e3);
  9586. }
  9587. });
  9588. }
  9589. }
  9590. });
  9591. },
  9592. showinfo() {
  9593. this.$refs.popup.open();
  9594. },
  9595. closeinfo() {
  9596. this.$refs.popup.close();
  9597. },
  9598. maskClick() {
  9599. clearTimeout(this.timer);
  9600. this.$refs.popup.close();
  9601. tostemlistnext(this.sindex, 1);
  9602. }
  9603. },
  9604. mounted() {
  9605. uni.setNavigationBarTitle({
  9606. title: this.$t("scale_evaluation")
  9607. });
  9608. this.init();
  9609. },
  9610. onLoad: function(option) {
  9611. this.scaleid = option.scaleid;
  9612. this.srid = option.srid;
  9613. this.sindex = option.sindex;
  9614. },
  9615. onBackPress: function(option) {
  9616. tohome();
  9617. return true;
  9618. }
  9619. };
  9620. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  9621. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  9622. const _component_Radio = vue.resolveComponent("Radio");
  9623. const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
  9624. const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
  9625. const _component_uv_popup = resolveEasycom(vue.resolveDynamicComponent("uv-popup"), __easycom_2);
  9626. return vue.openBlock(), vue.createElementBlock(
  9627. vue.Fragment,
  9628. null,
  9629. [
  9630. vue.createVNode(
  9631. _component_uv_toast,
  9632. { ref: "toast" },
  9633. null,
  9634. 512
  9635. /* NEED_PATCH */
  9636. ),
  9637. vue.createElementVNode("view", { class: "titlearea" }, [
  9638. vue.createElementVNode(
  9639. "text",
  9640. { class: "title_2" },
  9641. vue.toDisplayString(_ctx.$t("completion_problem_for_valuating_people")),
  9642. 1
  9643. /* TEXT */
  9644. ),
  9645. vue.createElementVNode(
  9646. "text",
  9647. { class: "title_member" },
  9648. vue.toDisplayString(_ctx.$t("valuating_people")) + ":" + vue.toDisplayString($data.selectuser.membername),
  9649. 1
  9650. /* TEXT */
  9651. )
  9652. ]),
  9653. vue.createElementVNode("view", { class: "info_div" }, [
  9654. vue.createElementVNode("view", { class: "text_div" }, [
  9655. vue.createElementVNode(
  9656. "text",
  9657. { class: "title1" },
  9658. vue.toDisplayString($data.stemitem.stem),
  9659. 1
  9660. /* TEXT */
  9661. )
  9662. ]),
  9663. vue.createElementVNode("view", { class: "text_div" }, [
  9664. vue.createElementVNode(
  9665. "text",
  9666. { class: "title2" },
  9667. vue.toDisplayString($data.stemitem.disstr),
  9668. 1
  9669. /* TEXT */
  9670. )
  9671. ])
  9672. ]),
  9673. vue.createElementVNode("view", { class: "info_div" }, [
  9674. 1 == $data.stemitem.stemtype ? (vue.openBlock(), vue.createElementBlock("view", {
  9675. key: 0,
  9676. class: ""
  9677. }, [
  9678. vue.createCommentVNode(" 单选 ")
  9679. ])) : vue.createCommentVNode("v-if", true),
  9680. 2 == $data.stemitem.stemtype ? (vue.openBlock(), vue.createElementBlock("view", {
  9681. key: 1,
  9682. class: ""
  9683. }, [
  9684. vue.createCommentVNode(" 多选 ")
  9685. ])) : vue.createCommentVNode("v-if", true),
  9686. vue.createCommentVNode(` <uv-radio-group v-model="selectanswer" placement="column" @change="change" >\r
  9687. <uv-radio \r
  9688. shape="square"\r
  9689. iconSize="30"\r
  9690. labelSize="30"\r
  9691. size="30"\r
  9692. :customStyle="{margin: '10px'}" \r
  9693. v-for="(item, index) in stemitem.alist" \r
  9694. :key="index" \r
  9695. :name="item">\r
  9696. <slot name="default">\r
  9697. <text class="select_label"> {{item.option}} 1</text>\r
  9698. </slot>\r
  9699. </uv-radio>\r
  9700. </uv-radio-group> `),
  9701. vue.createElementVNode(
  9702. "radio-group",
  9703. {
  9704. onChange: _cache[0] || (_cache[0] = (...args) => $options.change && $options.change(...args)),
  9705. style: { "width": "90%" }
  9706. },
  9707. [
  9708. (vue.openBlock(true), vue.createElementBlock(
  9709. vue.Fragment,
  9710. null,
  9711. vue.renderList($data.stemitem.alist, (item, index2) => {
  9712. return vue.openBlock(), vue.createBlock(_component_Radio, {
  9713. selectvalue: index2,
  9714. label: item.option,
  9715. key: index2
  9716. }, null, 8, ["selectvalue", "label"]);
  9717. }),
  9718. 128
  9719. /* KEYED_FRAGMENT */
  9720. ))
  9721. ],
  9722. 32
  9723. /* NEED_HYDRATION */
  9724. )
  9725. ]),
  9726. vue.createElementVNode("view", { class: "donext_div" }, [
  9727. vue.createVNode(_component_uv_button, {
  9728. type: "primary",
  9729. text: _ctx.$t("next_step"),
  9730. onClick: $options.donext,
  9731. customStyle: $data.selectbutton2,
  9732. customTextStyle: $data.selectbutton3
  9733. }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
  9734. ]),
  9735. $data.sindex == 11 && $data.scaleid == 4 ? (vue.openBlock(), vue.createElementBlock("view", {
  9736. key: 0,
  9737. class: "completedis"
  9738. }, [
  9739. vue.createElementVNode(
  9740. "text",
  9741. { class: "pregresstext" },
  9742. vue.toDisplayString(_ctx.$t("completion_text_1")),
  9743. 1
  9744. /* TEXT */
  9745. ),
  9746. vue.createElementVNode(
  9747. "text",
  9748. { class: "pregresstext" },
  9749. vue.toDisplayString(_ctx.$t("completion_text_2")),
  9750. 1
  9751. /* TEXT */
  9752. )
  9753. ])) : vue.createCommentVNode("v-if", true),
  9754. $options.surplusstems < 9 && $options.surplusstems > 1 ? (vue.openBlock(), vue.createElementBlock("view", {
  9755. key: 1,
  9756. class: "progressarea"
  9757. }, [
  9758. vue.createElementVNode(
  9759. "text",
  9760. { class: "pregresstext" },
  9761. vue.toDisplayString($options.surplusstems - 1) + vue.toDisplayString(_ctx.$t("questions_remaining")),
  9762. 1
  9763. /* TEXT */
  9764. )
  9765. ])) : vue.createCommentVNode("v-if", true),
  9766. vue.createElementVNode("view", null, [
  9767. vue.createVNode(_component_uv_popup, {
  9768. ref: "popup",
  9769. mode: "bottom",
  9770. onMaskClick: $options.maskClick
  9771. }, {
  9772. default: vue.withCtx(() => [
  9773. vue.createElementVNode("view", { class: "over_percent_div" }, [
  9774. vue.createElementVNode("view", { class: "content" }, [
  9775. vue.createVNode(_component_uv_text, {
  9776. text: $data.stemitem.stem,
  9777. align: "center",
  9778. size: "25"
  9779. }, null, 8, ["text"]),
  9780. vue.createVNode(_component_uv_text, {
  9781. text: _ctx.$t("have") + $data.percent,
  9782. type: "success",
  9783. bold: "true",
  9784. align: "center",
  9785. size: "30"
  9786. }, null, 8, ["text"]),
  9787. vue.createVNode(_component_uv_text, {
  9788. text: _ctx.$t("same_as_you"),
  9789. align: "center",
  9790. size: "25"
  9791. }, null, 8, ["text"])
  9792. ])
  9793. ])
  9794. ]),
  9795. _: 1
  9796. /* STABLE */
  9797. }, 8, ["onMaskClick"])
  9798. ])
  9799. ],
  9800. 64
  9801. /* STABLE_FRAGMENT */
  9802. );
  9803. }
  9804. const PagesTopicCommon = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__file", "D:/workspace/uniapp/health2/pages/topic/common.vue"]]);
  9805. function isString$1(value2) {
  9806. return "string" == typeof value2;
  9807. }
  9808. function isObject$2(value2) {
  9809. return "object" == typeof value2;
  9810. }
  9811. function isArray$1(value2) {
  9812. return "array" == typeof value2;
  9813. }
  9814. function isLawfulType(type2, value2) {
  9815. let valye_type = typeof value2;
  9816. if (isString$1(type2)) {
  9817. type2 = type2.toLowerCase();
  9818. return type2 == valye_type;
  9819. }
  9820. if (isArray$1(type2)) {
  9821. return type2.indexOf(valye_type) ? true : false;
  9822. }
  9823. return false;
  9824. }
  9825. function isFunction$1(value2) {
  9826. return "function" == typeof value2;
  9827. }
  9828. let config = {
  9829. canvasid: {
  9830. type: "string",
  9831. required: true,
  9832. validator: function(value2) {
  9833. return value2.length > 0;
  9834. },
  9835. value: ""
  9836. },
  9837. canvascursorid: {
  9838. type: "string",
  9839. required: true,
  9840. validator: function(value2) {
  9841. return value2.length > 0;
  9842. },
  9843. value: ""
  9844. },
  9845. minvalue: {
  9846. type: "number",
  9847. required: true,
  9848. validator: function(value2) {
  9849. return value2 > 0;
  9850. },
  9851. value: 0
  9852. },
  9853. maxvalue: {
  9854. type: "number",
  9855. required: true,
  9856. validator: function(value2) {
  9857. return value2 > 0;
  9858. },
  9859. value: 0
  9860. },
  9861. interval: {
  9862. type: "number",
  9863. required: true,
  9864. validator: function(value2) {
  9865. return value2 > 0;
  9866. },
  9867. value: 0
  9868. },
  9869. defaultvalue: {
  9870. type: "number",
  9871. required: true,
  9872. validator: function(value2) {
  9873. return value2 > 0;
  9874. },
  9875. value: 0
  9876. },
  9877. precision: {
  9878. //小数点位数
  9879. type: "number",
  9880. validator: function(value2) {
  9881. let values = [0, 1, 2];
  9882. return values.indexOf(value2) >= 0;
  9883. },
  9884. value: 0
  9885. }
  9886. };
  9887. let screenWidth = 0;
  9888. let screenHeight = 0;
  9889. let heightDecimal = 50;
  9890. let heightDigit = 25;
  9891. let ratio = 10;
  9892. let fontSize = 20;
  9893. let canvasHeight = 80;
  9894. let harfline = 5;
  9895. let lineWidth1 = 1;
  9896. let lineWidth2 = 2;
  9897. let rulecolor1 = "#FFA500";
  9898. let rulecolor2 = "#FF8C00";
  9899. let cursorcolor = "#0000FF";
  9900. let canvasWidth = 0;
  9901. let value = 0;
  9902. let scroll_left = 0;
  9903. function getvalue(key) {
  9904. return typeof config[key].value != "undefined" ? config[key].value : false;
  9905. }
  9906. function setconfig(param) {
  9907. if (!isObject$2(param)) {
  9908. throw new Error("drawruler param error");
  9909. }
  9910. Object.entries(config).forEach(([k, v]) => {
  9911. if (v.required) {
  9912. if (!param[k]) {
  9913. throw new Error("param " + k + " required");
  9914. }
  9915. }
  9916. let value2 = param[k];
  9917. if (v.type) {
  9918. if (!isLawfulType(v.type, value2)) {
  9919. throw new Error("param " + k + " type error");
  9920. }
  9921. }
  9922. if (isFunction$1(v.validator)) {
  9923. if (!v.validator(value2)) {
  9924. throw new Error("param " + k + " value error");
  9925. }
  9926. }
  9927. v.value = value2;
  9928. config[k] = v;
  9929. });
  9930. }
  9931. function dodrawruler() {
  9932. var context = uni.createCanvasContext(getvalue("canvasid"));
  9933. let minvalue = getvalue("minvalue");
  9934. let maxvalue = getvalue("maxvalue");
  9935. let interval = getvalue("interval");
  9936. let origionX = 0;
  9937. origionX = screenWidth / 2;
  9938. let origion = { x: origionX, y: 0 };
  9939. let i = minvalue;
  9940. while (i <= maxvalue) {
  9941. context.beginPath();
  9942. let movetoX = origion.x + (i - minvalue) * ratio;
  9943. let movetoY = 0;
  9944. context.moveTo(movetoX, movetoY);
  9945. let linetoX = origion.x + (i - minvalue) * ratio;
  9946. let linetoY = i % ratio == 0 ? heightDecimal : heightDigit;
  9947. context.lineTo(linetoX, linetoY);
  9948. context.setLineWidth(lineWidth2);
  9949. context.setStrokeStyle(i % ratio == 0 ? rulecolor1 : rulecolor2);
  9950. context.stroke();
  9951. context.setFillStyle("gray");
  9952. if (i % ratio == 0) {
  9953. context.setFontSize(fontSize);
  9954. context.fillText(i == 0 ? " " + i : i, origion.x + (i - minvalue) * ratio - fontSize / 2, heightDecimal + 5 + fontSize);
  9955. }
  9956. context.closePath();
  9957. i += interval;
  9958. }
  9959. setTimeout(() => {
  9960. context.draw();
  9961. }, 50);
  9962. }
  9963. function setCanvasConfig() {
  9964. uni.getSystemInfo({
  9965. success: (res) => {
  9966. screenWidth = res.windowWidth;
  9967. screenHeight = res.windowHeight;
  9968. }
  9969. });
  9970. canvasWidth = (getvalue("maxvalue") - getvalue("minvalue")) * ratio + screenWidth;
  9971. config["canvasWidth"] = {
  9972. value: canvasWidth
  9973. };
  9974. config["canvasHeight"] = {
  9975. value: canvasHeight
  9976. };
  9977. }
  9978. function getCanvasConfig() {
  9979. let use_config = {
  9980. canvasWidth: getvalue("canvasWidth"),
  9981. canvasHeight: getvalue("canvasHeight"),
  9982. screenWidth,
  9983. screenHeight
  9984. };
  9985. return use_config;
  9986. }
  9987. function drowncursor() {
  9988. var context = uni.createCanvasContext(getvalue("canvascursorid"));
  9989. var center = { x: screenWidth / 2, y: 0 };
  9990. center.y = harfline * Math.sqrt(3);
  9991. var right = { x: center.x - harfline, y: 0 };
  9992. var left = { x: center.x + harfline, y: 0 };
  9993. context.beginPath();
  9994. context.moveTo(right.x, 0);
  9995. context.lineTo(left.x, 0);
  9996. context.lineTo(center.x, center.y);
  9997. context.closePath();
  9998. context.setFillStyle(cursorcolor);
  9999. context.fill();
  10000. context.moveTo(center.x, 0);
  10001. context.lineTo(center.x, 50);
  10002. context.setLineWidth(lineWidth1);
  10003. context.setStrokeStyle(cursorcolor);
  10004. context.stroke();
  10005. context.draw(true);
  10006. let defaultvalue = getvalue("defaultvalue");
  10007. if (defaultvalue > 0) {
  10008. let minvalue = getvalue("minvalue");
  10009. value = defaultvalue;
  10010. scroll_left = (value - minvalue) * 10;
  10011. } else {
  10012. let midvalue = (getvalue("maxvalue") - getvalue("minvalue")) / 2;
  10013. value = midvalue + getvalue("minvalue");
  10014. scroll_left = canvasWidth / 2 - screenWidth / 2;
  10015. }
  10016. }
  10017. function getcursorvalue() {
  10018. return value;
  10019. }
  10020. function getscrollleft() {
  10021. return scroll_left;
  10022. }
  10023. function drawruler(param) {
  10024. setconfig(param);
  10025. setCanvasConfig();
  10026. dodrawruler();
  10027. drowncursor();
  10028. }
  10029. function setcursorvalue(scrollLeft, minvalue = 0) {
  10030. if (minvalue <= 0) {
  10031. minvalue = getvalue("minvalue");
  10032. }
  10033. let precision = getvalue("precision");
  10034. let value2 = 0;
  10035. if (precision == 0) {
  10036. value2 = Math.round(scrollLeft / 10) + minvalue;
  10037. } else {
  10038. value2 = parseFloat((scrollLeft / 10).toFixed(precision)) + minvalue;
  10039. }
  10040. return value2;
  10041. }
  10042. const _sfc_main$7 = {
  10043. data() {
  10044. return {
  10045. minage: 18,
  10046. maxage: 80,
  10047. userinfo: {},
  10048. selectuser: {},
  10049. viewage: 35,
  10050. selectbutton1: {
  10051. fontSize: "30px",
  10052. width: "500rpx",
  10053. borderColor: "#648EB8",
  10054. color: "#648EB8"
  10055. },
  10056. selectbutton2: {
  10057. fontSize: "30px",
  10058. width: "500rpx",
  10059. background: "#648EB8",
  10060. border: "0px"
  10061. },
  10062. selectbutton3: {
  10063. fontSize: "20px",
  10064. fontWeight: "bold",
  10065. letterSpacing: "0.5em"
  10066. },
  10067. scaleid: 0,
  10068. srid: 0,
  10069. sindex: 0,
  10070. stemid: 1,
  10071. answertype: 0,
  10072. canvasHeight: 80,
  10073. canvasWidth: 1e3,
  10074. scroll_left: 0
  10075. };
  10076. },
  10077. computed: {
  10078. columns() {
  10079. let list = [];
  10080. for (var i = this.minage; i <= this.maxage; i++) {
  10081. let label = i + this.$t("select_age_1");
  10082. if (i <= this.minage) {
  10083. label = i + this.$t("select_age_3");
  10084. }
  10085. if (i >= this.maxage) {
  10086. label = i + this.$t("select_age_2");
  10087. }
  10088. let item = {
  10089. label,
  10090. value: i
  10091. };
  10092. list.push(item);
  10093. }
  10094. return [list];
  10095. },
  10096. style() {
  10097. let value2 = {
  10098. canvasHeight: this.canvasHeight + "px",
  10099. canvasWidth: this.canvasWidth + "px",
  10100. screenWidth: this.screenWidth + "px"
  10101. };
  10102. return value2;
  10103. }
  10104. },
  10105. methods: {
  10106. init() {
  10107. this.userinfo = uni.getStorageSync("userinfo");
  10108. this.selectuser = uni.getStorageSync("selectuser");
  10109. },
  10110. showselectage() {
  10111. this.$refs.picker.open();
  10112. let index2 = this.viewage - this.minage;
  10113. this.$refs.picker.setIndexs([index2], true);
  10114. },
  10115. confirm(e) {
  10116. let value2 = e.value[0].value;
  10117. this.viewage = value2;
  10118. },
  10119. change(e) {
  10120. let value2 = e.value[0].value;
  10121. this.viewage = value2;
  10122. },
  10123. donext() {
  10124. let answer = {
  10125. userid: this.userinfo.id,
  10126. fmemberid: this.selectuser.fmemberid,
  10127. stemid: this.stemid,
  10128. answertype: this.answertype,
  10129. answervalue: this.viewage
  10130. };
  10131. let data = {
  10132. userid: this.userinfo.id,
  10133. fmemberid: this.selectuser.fmemberid,
  10134. srid: this.srid,
  10135. scaleid: this.scaleid
  10136. };
  10137. subanswerbyuserid(answer, data).then((res) => {
  10138. res = res.data;
  10139. if (0 == res.code) {
  10140. this.$refs.toast.show({
  10141. type: "error",
  10142. message: res.errmsg
  10143. });
  10144. return false;
  10145. }
  10146. if (200 == res.code) {
  10147. uni.setStorage({
  10148. key: "srid",
  10149. data: res.resultData
  10150. });
  10151. tostemlistnext(this.sindex, 1);
  10152. }
  10153. });
  10154. },
  10155. drawruler() {
  10156. let param = {
  10157. canvasid: "canvas_ruler",
  10158. canvascursorid: "canvas-cursor",
  10159. minvalue: this.minage,
  10160. maxvalue: this.maxage,
  10161. interval: 1,
  10162. defaultvalue: this.viewage,
  10163. precision: 0
  10164. };
  10165. drawruler(param);
  10166. this.viewage = getcursorvalue();
  10167. this.canvasHeight = getCanvasConfig().canvasHeight;
  10168. this.canvasWidth = getCanvasConfig().canvasWidth;
  10169. this.screenWidth = getCanvasConfig().screenWidth;
  10170. this.scroll_left = getscrollleft();
  10171. },
  10172. scroll(e) {
  10173. this.viewage = setcursorvalue(e.detail.scrollLeft);
  10174. }
  10175. },
  10176. mounted() {
  10177. uni.setNavigationBarTitle({
  10178. title: this.$t("select_age")
  10179. });
  10180. this.init();
  10181. },
  10182. onLoad: function(option) {
  10183. this.scaleid = option.scaleid;
  10184. this.srid = option.srid;
  10185. this.sindex = option.sindex;
  10186. },
  10187. onBackPress: function(option) {
  10188. tohome();
  10189. return true;
  10190. },
  10191. onReady() {
  10192. this.drawruler();
  10193. }
  10194. };
  10195. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  10196. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  10197. const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
  10198. return vue.openBlock(), vue.createElementBlock(
  10199. vue.Fragment,
  10200. null,
  10201. [
  10202. vue.createVNode(
  10203. _component_uv_toast,
  10204. { ref: "toast" },
  10205. null,
  10206. 512
  10207. /* NEED_PATCH */
  10208. ),
  10209. vue.createElementVNode("view", { class: "titlearea" }, [
  10210. vue.createElementVNode(
  10211. "text",
  10212. { class: "title_2" },
  10213. vue.toDisplayString(_ctx.$t("selectage_test1")),
  10214. 1
  10215. /* TEXT */
  10216. ),
  10217. vue.createElementVNode(
  10218. "text",
  10219. { class: "title_member" },
  10220. vue.toDisplayString(_ctx.$t("report_user")) + ":" + vue.toDisplayString($data.selectuser.membername),
  10221. 1
  10222. /* TEXT */
  10223. ),
  10224. vue.createElementVNode(
  10225. "text",
  10226. {
  10227. class: "title_desstr",
  10228. decode: "true"
  10229. },
  10230. vue.toDisplayString(_ctx.$t("selectage_test2")),
  10231. 1
  10232. /* TEXT */
  10233. )
  10234. ]),
  10235. vue.createElementVNode("view", { class: "agevalue" }, [
  10236. vue.createElementVNode("view", { class: "" }, [
  10237. vue.createTextVNode(
  10238. vue.toDisplayString(_ctx.$t("select_age")) + ": ",
  10239. 1
  10240. /* TEXT */
  10241. ),
  10242. vue.withDirectives(vue.createElementVNode(
  10243. "text",
  10244. { class: "strage" },
  10245. "29" + vue.toDisplayString(_ctx.$t("select_age_3")),
  10246. 513
  10247. /* TEXT, NEED_PATCH */
  10248. ), [
  10249. [vue.vShow, $data.viewage <= 29]
  10250. ]),
  10251. vue.withDirectives(vue.createElementVNode(
  10252. "text",
  10253. { class: "strage" },
  10254. vue.toDisplayString($data.viewage) + vue.toDisplayString(_ctx.$t("select_age_1")),
  10255. 513
  10256. /* TEXT, NEED_PATCH */
  10257. ), [
  10258. [vue.vShow, $data.viewage > 29 && $data.viewage < 70]
  10259. ]),
  10260. vue.withDirectives(vue.createElementVNode(
  10261. "text",
  10262. { class: "strage" },
  10263. "70" + vue.toDisplayString(_ctx.$t("select_age_2")),
  10264. 513
  10265. /* TEXT, NEED_PATCH */
  10266. ), [
  10267. [vue.vShow, $data.viewage >= 70]
  10268. ])
  10269. ]),
  10270. vue.createCommentVNode(` <uv-button type="primary" :plain="true" :text="$t('select')" @click="showselectage" :customStyle="selectbutton1" :customTextStyle="selectbutton3"></uv-button> `)
  10271. ]),
  10272. 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> '),
  10273. vue.createElementVNode(
  10274. "view",
  10275. {
  10276. class: "showdiv",
  10277. id: "showdiv",
  10278. style: vue.normalizeStyle({ height: $options.style.canvasHeight })
  10279. },
  10280. [
  10281. vue.createElementVNode("scroll-view", {
  10282. style: { "width": "100%", "height": "100%" },
  10283. "scroll-x": true,
  10284. onScroll: _cache[0] || (_cache[0] = (...args) => $options.scroll && $options.scroll(...args)),
  10285. "scroll-left": $data.scroll_left,
  10286. "show-scrollbar": false
  10287. }, [
  10288. vue.createElementVNode("canvas", {
  10289. style: vue.normalizeStyle({ width: $options.style.canvasWidth, height: $options.style.canvasHeight }),
  10290. "canvas-id": "canvas_ruler",
  10291. id: "canvas_ruler",
  10292. width: $data.canvasWidth
  10293. }, null, 12, ["width"])
  10294. ], 40, ["scroll-left"]),
  10295. vue.createElementVNode(
  10296. "canvas",
  10297. {
  10298. style: vue.normalizeStyle({ width: $options.style.screenWidth, height: $options.style.canvasHeight }),
  10299. "canvas-id": "canvas-cursor",
  10300. id: "canvas-cursor"
  10301. },
  10302. null,
  10303. 4
  10304. /* STYLE */
  10305. )
  10306. ],
  10307. 4
  10308. /* STYLE */
  10309. ),
  10310. vue.createElementVNode("view", { class: "donext_div" }, [
  10311. vue.createVNode(_component_uv_button, {
  10312. type: "primary",
  10313. text: _ctx.$t("next_step"),
  10314. onClick: $options.donext,
  10315. customStyle: $data.selectbutton2,
  10316. customTextStyle: $data.selectbutton3
  10317. }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
  10318. ])
  10319. ],
  10320. 64
  10321. /* STABLE_FRAGMENT */
  10322. );
  10323. }
  10324. 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"]]);
  10325. const _sfc_main$6 = {
  10326. data() {
  10327. return {
  10328. userinfo: {},
  10329. selectuser: {},
  10330. scaleid: 0,
  10331. srid: 0,
  10332. scaleid: 0,
  10333. stemid: 3,
  10334. answertype: 1
  10335. };
  10336. },
  10337. methods: {
  10338. init() {
  10339. this.userinfo = uni.getStorageSync("userinfo");
  10340. this.selectuser = uni.getStorageSync("selectuser");
  10341. },
  10342. selectsex(sex) {
  10343. let answervalue = false;
  10344. let answeroptionid = false;
  10345. switch (sex) {
  10346. case 1:
  10347. answervalue = this.$t("man");
  10348. answeroptionid = 64;
  10349. break;
  10350. case 2:
  10351. answervalue = this.$t("female");
  10352. answeroptionid = 65;
  10353. break;
  10354. default:
  10355. return;
  10356. }
  10357. let answer = {
  10358. userid: this.userinfo.id,
  10359. fmemberid: this.selectuser.fmemberid,
  10360. stemid: this.stemid,
  10361. answertype: this.answertype,
  10362. answervalue,
  10363. answeroptionid
  10364. };
  10365. let data = {
  10366. userid: this.userinfo.id,
  10367. fmemberid: this.selectuser.fmemberid,
  10368. srid: this.srid,
  10369. scaleid: this.scaleid
  10370. };
  10371. subanswerbyuserid(answer, data).then((res) => {
  10372. res = res.data;
  10373. if (0 == res.code) {
  10374. this.$refs.toast.show({
  10375. type: "error",
  10376. message: res.errmsg
  10377. });
  10378. return false;
  10379. }
  10380. if (200 == res.code) {
  10381. uni.setStorage({
  10382. key: "srid",
  10383. data: res.resultData
  10384. });
  10385. let data1 = {
  10386. userid: this.userinfo.id,
  10387. fmemberid: this.selectuser.fmemberid,
  10388. gender: sex
  10389. };
  10390. submembergenderwithuid(data1);
  10391. tostemlistnext(this.sindex, 1);
  10392. }
  10393. });
  10394. }
  10395. },
  10396. mounted() {
  10397. uni.setNavigationBarTitle({
  10398. title: this.$t("select_sex")
  10399. });
  10400. this.init();
  10401. },
  10402. onLoad: function(option) {
  10403. this.scaleid = option.scaleid;
  10404. this.srid = option.srid;
  10405. this.sindex = option.sindex;
  10406. },
  10407. onBackPress: function(option) {
  10408. tohome();
  10409. return true;
  10410. }
  10411. };
  10412. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  10413. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  10414. const _component_uv_image = resolveEasycom(vue.resolveDynamicComponent("uv-image"), __easycom_1$2);
  10415. const _component_uv_col = resolveEasycom(vue.resolveDynamicComponent("uv-col"), __easycom_2$3);
  10416. const _component_uv_row = resolveEasycom(vue.resolveDynamicComponent("uv-row"), __easycom_3$1);
  10417. return vue.openBlock(), vue.createElementBlock(
  10418. vue.Fragment,
  10419. null,
  10420. [
  10421. vue.createVNode(
  10422. _component_uv_toast,
  10423. { ref: "toast" },
  10424. null,
  10425. 512
  10426. /* NEED_PATCH */
  10427. ),
  10428. vue.createElementVNode("view", { class: "titlearea" }, [
  10429. vue.createElementVNode(
  10430. "text",
  10431. { class: "title_2" },
  10432. vue.toDisplayString(_ctx.$t("select_gender_for_valuating_people")),
  10433. 1
  10434. /* TEXT */
  10435. ),
  10436. vue.createElementVNode(
  10437. "text",
  10438. { class: "title_member" },
  10439. vue.toDisplayString(_ctx.$t("valuating_people")) + ":" + vue.toDisplayString($data.selectuser.membername),
  10440. 1
  10441. /* TEXT */
  10442. ),
  10443. vue.createElementVNode(
  10444. "text",
  10445. {
  10446. class: "title_desstr",
  10447. decode: "true"
  10448. },
  10449. "      " + vue.toDisplayString(_ctx.$t("select_gender_text_1")),
  10450. 1
  10451. /* TEXT */
  10452. )
  10453. ]),
  10454. vue.createElementVNode("view", null, [
  10455. vue.createVNode(_component_uv_row, {
  10456. justify: "space-between",
  10457. customStyle: "margin-top: 6%"
  10458. }, {
  10459. default: vue.withCtx(() => [
  10460. vue.createVNode(_component_uv_col, {
  10461. span: "6",
  10462. align: "center",
  10463. onClick: _cache[0] || (_cache[0] = ($event) => $options.selectsex(1))
  10464. }, {
  10465. default: vue.withCtx(() => [
  10466. vue.createVNode(_component_uv_image, {
  10467. class: "img",
  10468. src: "/static/image/selecttype/man.png",
  10469. mode: "aspectFill",
  10470. shape: "circle",
  10471. "lazy-load": true,
  10472. width: "150",
  10473. height: "150"
  10474. }),
  10475. vue.createElementVNode(
  10476. "view",
  10477. { class: "mybtn" },
  10478. vue.toDisplayString(_ctx.$t("is_man")),
  10479. 1
  10480. /* TEXT */
  10481. )
  10482. ]),
  10483. _: 1
  10484. /* STABLE */
  10485. }),
  10486. vue.createVNode(_component_uv_col, {
  10487. span: "6",
  10488. align: "center",
  10489. onClick: _cache[1] || (_cache[1] = ($event) => $options.selectsex(2))
  10490. }, {
  10491. default: vue.withCtx(() => [
  10492. vue.createVNode(_component_uv_image, {
  10493. class: "img",
  10494. src: "/static/image/selecttype/woman.png",
  10495. mode: "aspectFill",
  10496. shape: "circle",
  10497. "lazy-load": true,
  10498. width: "150",
  10499. height: "150"
  10500. }),
  10501. vue.createElementVNode(
  10502. "view",
  10503. { class: "mybtn" },
  10504. vue.toDisplayString(_ctx.$t("is_female")),
  10505. 1
  10506. /* TEXT */
  10507. )
  10508. ]),
  10509. _: 1
  10510. /* STABLE */
  10511. })
  10512. ]),
  10513. _: 1
  10514. /* STABLE */
  10515. })
  10516. ])
  10517. ],
  10518. 64
  10519. /* STABLE_FRAGMENT */
  10520. );
  10521. }
  10522. 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"]]);
  10523. const _sfc_main$5 = {
  10524. data() {
  10525. return {
  10526. columns: [],
  10527. userinfo: {},
  10528. selectuser: {},
  10529. scaleid: 0,
  10530. srid: 0,
  10531. sindex: 0,
  10532. heightvalue: 170,
  10533. weightvalue: 50,
  10534. minheight: 90,
  10535. maxheight: 210,
  10536. minweight: 35,
  10537. maxweight: 125,
  10538. selecttype: "height",
  10539. selectbutton2: {
  10540. fontSize: "30px",
  10541. width: "500rpx",
  10542. background: "#648EB8",
  10543. border: "0px"
  10544. },
  10545. selectbutton3: {
  10546. fontSize: "20px",
  10547. fontWeight: "bold",
  10548. letterSpacing: "0.5em"
  10549. },
  10550. over_percent: "11%",
  10551. timer: false,
  10552. canvasHeight: 80,
  10553. canvasWidth_1: 1e3,
  10554. canvasWidth_2: 1e3,
  10555. scroll_left_1: 0,
  10556. scroll_left_2: 0
  10557. };
  10558. },
  10559. methods: {
  10560. init() {
  10561. this.userinfo = uni.getStorageSync("userinfo");
  10562. this.selectuser = uni.getStorageSync("selectuser");
  10563. },
  10564. setheight() {
  10565. this.columns = this.heightlist;
  10566. this.$refs.picker.open();
  10567. let index2 = this.heightvalue - this.minheight;
  10568. this.$refs.picker.setIndexs([index2], true);
  10569. this.selecttype = "height";
  10570. },
  10571. setweight() {
  10572. this.columns = this.weightlist;
  10573. this.$refs.picker.open();
  10574. let index2 = (this.weightvalue - this.minweight) * 2;
  10575. this.$refs.picker.setIndexs([index2], true);
  10576. this.selecttype = "weight";
  10577. },
  10578. change(e) {
  10579. let value2 = e.value[0].value;
  10580. switch (this.selecttype) {
  10581. case "height":
  10582. this.heightvalue = value2;
  10583. break;
  10584. case "weight":
  10585. this.weightvalue = value2;
  10586. break;
  10587. }
  10588. },
  10589. donext() {
  10590. var usrBMI = {
  10591. userid: this.userinfo.id,
  10592. fmemberid: this.selectuser.fmemberid,
  10593. stemid: 2,
  10594. answertype: 0,
  10595. answervalue: this.bmi
  10596. };
  10597. var userheight = {
  10598. userid: this.userinfo.id,
  10599. fmemberid: this.selectuser.fmemberid,
  10600. stemid: 27,
  10601. answertype: 0,
  10602. answervalue: this.heightvalue
  10603. };
  10604. var userweight = {
  10605. userid: this.userinfo.id,
  10606. fmemberid: this.selectuser.fmemberid,
  10607. stemid: 28,
  10608. answertype: 0,
  10609. answervalue: this.weightvalue
  10610. };
  10611. let answer = [];
  10612. answer.push(usrBMI);
  10613. answer.push(userheight);
  10614. answer.push(userweight);
  10615. let data = {
  10616. userid: this.userinfo.id,
  10617. fmemberid: this.selectuser.fmemberid,
  10618. srid: this.srid,
  10619. scaleid: this.scaleid
  10620. };
  10621. subanswerbyuserid(answer, data).then((res) => {
  10622. res = res.data;
  10623. if (0 == res.code) {
  10624. this.$refs.toast.show({
  10625. type: "error",
  10626. message: res.errmsg
  10627. });
  10628. return false;
  10629. }
  10630. if (200 == res.code) {
  10631. uni.setStorage({
  10632. key: "srid",
  10633. data: res.resultData
  10634. });
  10635. querybmipercentage(this.bmi).then((res2) => {
  10636. res2 = res2.data;
  10637. if (0 == res2.code) {
  10638. this.$refs.toast.show({
  10639. type: "error",
  10640. message: res2.errmsg
  10641. });
  10642. return false;
  10643. }
  10644. if (200 == res2.code) {
  10645. this.over_percent = res2.resultData + "%";
  10646. this.showinfo();
  10647. let that = this;
  10648. this.timer = setTimeout(function() {
  10649. that.closeinfo();
  10650. formatAppLog("log", "at pages/topic/selectcanvas.vue:205", 123);
  10651. tostemlistnext(that.sindex, 1);
  10652. }, 3e3);
  10653. }
  10654. });
  10655. }
  10656. });
  10657. },
  10658. showinfo() {
  10659. this.$refs.popup.open();
  10660. },
  10661. closeinfo() {
  10662. this.$refs.popup.close();
  10663. },
  10664. maskClick() {
  10665. clearTimeout(this.timer);
  10666. this.$refs.popup.close();
  10667. tostemlistnext(this.sindex, 1);
  10668. },
  10669. drawruler1() {
  10670. let param = {
  10671. canvasid: "canvas_ruler",
  10672. canvascursorid: "canvas-cursor",
  10673. minvalue: this.minheight,
  10674. maxvalue: this.maxheight,
  10675. interval: 1,
  10676. defaultvalue: this.heightvalue,
  10677. precision: 0
  10678. };
  10679. drawruler(param);
  10680. this.heightvalue = getcursorvalue();
  10681. this.canvasHeight = getCanvasConfig().canvasHeight;
  10682. this.canvasWidth_1 = getCanvasConfig().canvasWidth;
  10683. this.screenWidth = getCanvasConfig().screenWidth;
  10684. this.scroll_left_1 = getscrollleft();
  10685. },
  10686. scroll1(e) {
  10687. this.heightvalue = setcursorvalue(e.detail.scrollLeft, this.minheight);
  10688. },
  10689. drawruler2() {
  10690. let param = {
  10691. canvasid: "canvas_ruler_2",
  10692. canvascursorid: "canvas-cursor_2",
  10693. minvalue: this.minweight,
  10694. maxvalue: this.maxweight,
  10695. interval: 1,
  10696. defaultvalue: this.weightvalue,
  10697. precision: 0
  10698. };
  10699. drawruler(param);
  10700. this.weightvalue = getcursorvalue();
  10701. this.canvasHeight = getCanvasConfig().canvasHeight;
  10702. this.canvasWidth_2 = getCanvasConfig().canvasWidth;
  10703. this.screenWidth = getCanvasConfig().screenWidth;
  10704. this.scroll_left_2 = getscrollleft();
  10705. },
  10706. scroll2(e) {
  10707. this.weightvalue = setcursorvalue(e.detail.scrollLeft);
  10708. }
  10709. },
  10710. mounted() {
  10711. uni.setNavigationBarTitle({
  10712. title: this.$t("calculate_BMI")
  10713. });
  10714. this.init();
  10715. },
  10716. computed: {
  10717. bmi() {
  10718. var value2 = (this.weightvalue / (this.heightvalue / 100 * (this.heightvalue / 100))).toFixed(1);
  10719. return value2;
  10720. },
  10721. heightlist() {
  10722. let list = [];
  10723. for (var i = this.minheight; i <= this.maxheight; i++) {
  10724. let item = {
  10725. label: i,
  10726. value: i
  10727. };
  10728. list.push(item);
  10729. }
  10730. return [list];
  10731. },
  10732. weightlist() {
  10733. let list = [];
  10734. for (var i = this.minweight; i <= this.maxweight; i += 0.5) {
  10735. let item = {
  10736. label: i,
  10737. value: i
  10738. };
  10739. list.push(item);
  10740. }
  10741. return [list];
  10742. },
  10743. style() {
  10744. let value2 = {
  10745. canvasHeight: this.canvasHeight + "px",
  10746. canvasWidth_1: this.canvasWidth_1 + "px",
  10747. canvasWidth_2: this.canvasWidth_2 + "px",
  10748. screenWidth: this.screenWidth + "px"
  10749. };
  10750. return value2;
  10751. }
  10752. },
  10753. onLoad: function(option) {
  10754. this.scaleid = option.scaleid;
  10755. this.srid = option.srid;
  10756. this.sindex = option.sindex;
  10757. },
  10758. onBackPress: function(option) {
  10759. tohome();
  10760. return true;
  10761. },
  10762. onReady() {
  10763. this.drawruler1();
  10764. this.drawruler2();
  10765. }
  10766. };
  10767. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  10768. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  10769. const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
  10770. const _component_uv_text = resolveEasycom(vue.resolveDynamicComponent("uv-text"), __easycom_2$4);
  10771. const _component_uv_popup = resolveEasycom(vue.resolveDynamicComponent("uv-popup"), __easycom_2);
  10772. return vue.openBlock(), vue.createElementBlock(
  10773. vue.Fragment,
  10774. null,
  10775. [
  10776. vue.createVNode(
  10777. _component_uv_toast,
  10778. { ref: "toast" },
  10779. null,
  10780. 512
  10781. /* NEED_PATCH */
  10782. ),
  10783. vue.createElementVNode("view", { class: "titlearea" }, [
  10784. vue.createElementVNode(
  10785. "text",
  10786. { class: "title_2" },
  10787. vue.toDisplayString(_ctx.$t("selectcanvas_text1")),
  10788. 1
  10789. /* TEXT */
  10790. ),
  10791. vue.createElementVNode(
  10792. "text",
  10793. { class: "title_member" },
  10794. vue.toDisplayString(_ctx.$t("report_user")) + ":" + vue.toDisplayString($data.selectuser.membername),
  10795. 1
  10796. /* TEXT */
  10797. ),
  10798. vue.createElementVNode(
  10799. "text",
  10800. {
  10801. class: "title_desstr",
  10802. decode: "true"
  10803. },
  10804. vue.toDisplayString(_ctx.$t("selectcanvas_text2")),
  10805. 1
  10806. /* TEXT */
  10807. ),
  10808. vue.createElementVNode(
  10809. "text",
  10810. {
  10811. class: "title_desstr",
  10812. decode: "true"
  10813. },
  10814. vue.toDisplayString(_ctx.$t("selectcanvas_text3")),
  10815. 1
  10816. /* TEXT */
  10817. )
  10818. ]),
  10819. vue.createElementVNode("view", { class: "info_div" }, [
  10820. vue.createElementVNode("view", { class: "text_div" }, [
  10821. vue.createElementVNode("text", { class: "title1" }, "BMI:"),
  10822. vue.createElementVNode(
  10823. "text",
  10824. { class: "text" },
  10825. vue.toDisplayString($options.bmi),
  10826. 1
  10827. /* TEXT */
  10828. )
  10829. ])
  10830. ]),
  10831. vue.createElementVNode("view", { class: "info_div" }, [
  10832. vue.createElementVNode("view", { class: "text_div" }, [
  10833. vue.createElementVNode(
  10834. "text",
  10835. { class: "title3" },
  10836. vue.toDisplayString(_ctx.$t("height")) + ":",
  10837. 1
  10838. /* TEXT */
  10839. ),
  10840. vue.createElementVNode(
  10841. "text",
  10842. { class: "text" },
  10843. " " + vue.toDisplayString($data.heightvalue),
  10844. 1
  10845. /* TEXT */
  10846. ),
  10847. vue.createElementVNode("text", { class: "title2" }, " CM")
  10848. ]),
  10849. vue.createCommentVNode(` <view class="mybtn" @click="setheight">{{$t('select')}}</view> `),
  10850. vue.createElementVNode(
  10851. "view",
  10852. {
  10853. class: "showdiv",
  10854. id: "showdiv",
  10855. style: vue.normalizeStyle({ height: $options.style.canvasHeight })
  10856. },
  10857. [
  10858. vue.createElementVNode("scroll-view", {
  10859. style: { "width": "100%", "height": "100%" },
  10860. "scroll-x": true,
  10861. onScroll: _cache[0] || (_cache[0] = (...args) => $options.scroll1 && $options.scroll1(...args)),
  10862. "scroll-left": $data.scroll_left_1,
  10863. "show-scrollbar": false
  10864. }, [
  10865. vue.createElementVNode("canvas", {
  10866. style: vue.normalizeStyle({ width: $options.style.canvasWidth_1, height: $options.style.canvasHeight }),
  10867. "canvas-id": "canvas_ruler",
  10868. id: "canvas_ruler",
  10869. width: $data.canvasWidth_1
  10870. }, null, 12, ["width"])
  10871. ], 40, ["scroll-left"]),
  10872. vue.createElementVNode(
  10873. "canvas",
  10874. {
  10875. style: vue.normalizeStyle({ width: $options.style.screenWidth_1, height: $options.style.canvasHeight }),
  10876. "canvas-id": "canvas-cursor",
  10877. id: "canvas-cursor"
  10878. },
  10879. null,
  10880. 4
  10881. /* STYLE */
  10882. )
  10883. ],
  10884. 4
  10885. /* STYLE */
  10886. )
  10887. ]),
  10888. vue.createElementVNode("view", { class: "info_div" }, [
  10889. vue.createElementVNode("view", { class: "text_div" }, [
  10890. vue.createElementVNode(
  10891. "text",
  10892. { class: "title3" },
  10893. vue.toDisplayString(_ctx.$t("weight")) + ":",
  10894. 1
  10895. /* TEXT */
  10896. ),
  10897. vue.createElementVNode(
  10898. "text",
  10899. { class: "text" },
  10900. " " + vue.toDisplayString($data.weightvalue),
  10901. 1
  10902. /* TEXT */
  10903. ),
  10904. vue.createElementVNode("text", { class: "title2" }, " KG")
  10905. ]),
  10906. vue.createCommentVNode(` <view class="mybtn" @click="setweight">{{$t('select')}}</view> `),
  10907. vue.createElementVNode(
  10908. "view",
  10909. {
  10910. class: "showdiv",
  10911. id: "showdiv",
  10912. style: vue.normalizeStyle({ height: $options.style.canvasHeight })
  10913. },
  10914. [
  10915. vue.createElementVNode("scroll-view", {
  10916. style: { "width": "100%", "height": "100%" },
  10917. "scroll-x": true,
  10918. onScroll: _cache[1] || (_cache[1] = (...args) => $options.scroll2 && $options.scroll2(...args)),
  10919. "scroll-left": $data.scroll_left_2,
  10920. "show-scrollbar": false
  10921. }, [
  10922. vue.createElementVNode("canvas", {
  10923. style: vue.normalizeStyle({ width: $options.style.canvasWidth_2, height: $options.style.canvasHeight }),
  10924. "canvas-id": "canvas_ruler_2",
  10925. id: "canvas_ruler_2",
  10926. width: $data.canvasWidth_2
  10927. }, null, 12, ["width"])
  10928. ], 40, ["scroll-left"]),
  10929. vue.createElementVNode(
  10930. "canvas",
  10931. {
  10932. style: vue.normalizeStyle({ width: $options.style.screenWidth_2, height: $options.style.canvasHeight }),
  10933. "canvas-id": "canvas-cursor_2",
  10934. id: "canvas-cursor_2"
  10935. },
  10936. null,
  10937. 4
  10938. /* STYLE */
  10939. )
  10940. ],
  10941. 4
  10942. /* STYLE */
  10943. )
  10944. ]),
  10945. 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> '),
  10946. vue.createElementVNode("view", { class: "donext_div" }, [
  10947. vue.createVNode(_component_uv_button, {
  10948. type: "primary",
  10949. text: _ctx.$t("next_step"),
  10950. onClick: $options.donext,
  10951. customStyle: $data.selectbutton2,
  10952. customTextStyle: $data.selectbutton3
  10953. }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
  10954. ]),
  10955. vue.createElementVNode("view", null, [
  10956. vue.createVNode(_component_uv_popup, {
  10957. ref: "popup",
  10958. mode: "bottom",
  10959. onMaskClick: $options.maskClick
  10960. }, {
  10961. default: vue.withCtx(() => [
  10962. vue.createElementVNode("view", { class: "over_percent_div" }, [
  10963. vue.createElementVNode("view", { class: "content" }, [
  10964. vue.createVNode(_component_uv_text, {
  10965. text: _ctx.$t("show_info_text1"),
  10966. align: "center",
  10967. size: "25"
  10968. }, null, 8, ["text"]),
  10969. vue.createVNode(_component_uv_text, {
  10970. text: $data.over_percent,
  10971. type: "success",
  10972. bold: "true",
  10973. align: "center",
  10974. size: "30"
  10975. }, null, 8, ["text"]),
  10976. vue.createVNode(_component_uv_text, {
  10977. text: _ctx.$t("show_info_text2"),
  10978. align: "center",
  10979. size: "25"
  10980. }, null, 8, ["text"])
  10981. ])
  10982. ])
  10983. ]),
  10984. _: 1
  10985. /* STABLE */
  10986. }, 8, ["onMaskClick"])
  10987. ])
  10988. ],
  10989. 64
  10990. /* STABLE_FRAGMENT */
  10991. );
  10992. }
  10993. 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"]]);
  10994. const props$1 = {
  10995. props: {
  10996. // 是否展示工具条
  10997. show: {
  10998. type: Boolean,
  10999. default: true
  11000. },
  11001. // 是否显示下边框
  11002. showBorder: {
  11003. type: Boolean,
  11004. default: false
  11005. },
  11006. // 取消按钮的文字
  11007. cancelText: {
  11008. type: String,
  11009. default: "取消"
  11010. },
  11011. // 确认按钮的文字
  11012. confirmText: {
  11013. type: String,
  11014. default: "确认"
  11015. },
  11016. // 取消按钮的颜色
  11017. cancelColor: {
  11018. type: String,
  11019. default: "#909193"
  11020. },
  11021. // 确认按钮的颜色
  11022. confirmColor: {
  11023. type: String,
  11024. default: "#3c9cff"
  11025. },
  11026. // 标题文字
  11027. title: {
  11028. type: String,
  11029. default: ""
  11030. },
  11031. ...(_P = (_O = uni.$uv) == null ? void 0 : _O.props) == null ? void 0 : _P.toolbar
  11032. }
  11033. };
  11034. const _sfc_main$4 = {
  11035. name: "uv-toolbar",
  11036. emits: ["confirm", "cancel"],
  11037. mixins: [mpMixin, mixin, props$1],
  11038. methods: {
  11039. // 点击取消按钮
  11040. cancel() {
  11041. this.$emit("cancel");
  11042. },
  11043. // 点击确定按钮
  11044. confirm() {
  11045. this.$emit("confirm");
  11046. }
  11047. }
  11048. };
  11049. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  11050. return _ctx.show ? (vue.openBlock(), vue.createElementBlock(
  11051. "view",
  11052. {
  11053. key: 0,
  11054. class: vue.normalizeClass(["uv-toolbar", { "uv-border-bottom": _ctx.showBorder }]),
  11055. onTouchmove: _cache[2] || (_cache[2] = vue.withModifiers((...args) => _ctx.noop && _ctx.noop(...args), ["stop", "prevent"]))
  11056. },
  11057. [
  11058. vue.createElementVNode("view", {
  11059. class: "uv-toolbar__cancel__wrapper",
  11060. "hover-class": "uv-hover-class"
  11061. }, [
  11062. vue.createElementVNode(
  11063. "text",
  11064. {
  11065. class: "uv-toolbar__wrapper__cancel",
  11066. onClick: _cache[0] || (_cache[0] = (...args) => $options.cancel && $options.cancel(...args)),
  11067. style: vue.normalizeStyle({
  11068. color: _ctx.cancelColor
  11069. })
  11070. },
  11071. vue.toDisplayString(_ctx.cancelText),
  11072. 5
  11073. /* TEXT, STYLE */
  11074. )
  11075. ]),
  11076. _ctx.title ? (vue.openBlock(), vue.createElementBlock(
  11077. "text",
  11078. {
  11079. key: 0,
  11080. class: "uv-toolbar__title uv-line-1"
  11081. },
  11082. vue.toDisplayString(_ctx.title),
  11083. 1
  11084. /* TEXT */
  11085. )) : vue.createCommentVNode("v-if", true),
  11086. vue.createElementVNode("view", {
  11087. class: "uv-toolbar__confirm__wrapper",
  11088. "hover-class": "uv-hover-class"
  11089. }, [
  11090. vue.createElementVNode(
  11091. "text",
  11092. {
  11093. class: "uv-toolbar__wrapper__confirm",
  11094. onClick: _cache[1] || (_cache[1] = (...args) => $options.confirm && $options.confirm(...args)),
  11095. style: vue.normalizeStyle({
  11096. color: _ctx.confirmColor
  11097. })
  11098. },
  11099. vue.toDisplayString(_ctx.confirmText),
  11100. 5
  11101. /* TEXT, STYLE */
  11102. )
  11103. ])
  11104. ],
  11105. 34
  11106. /* CLASS, NEED_HYDRATION */
  11107. )) : vue.createCommentVNode("v-if", true);
  11108. }
  11109. 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"]]);
  11110. const props = {
  11111. props: {
  11112. // 是否展示顶部的操作栏
  11113. showToolbar: {
  11114. type: Boolean,
  11115. default: true
  11116. },
  11117. // 顶部标题
  11118. title: {
  11119. type: String,
  11120. default: ""
  11121. },
  11122. // 弹窗圆角
  11123. round: {
  11124. type: [String, Number],
  11125. default: 0
  11126. },
  11127. // 对象数组,设置每一列的数据
  11128. columns: {
  11129. type: Array,
  11130. default: () => []
  11131. },
  11132. // 是否显示加载中状态
  11133. loading: {
  11134. type: Boolean,
  11135. default: false
  11136. },
  11137. // 各列中,单个选项的高度
  11138. itemHeight: {
  11139. type: [String, Number],
  11140. default: 44
  11141. },
  11142. // 取消按钮的文字
  11143. cancelText: {
  11144. type: String,
  11145. default: "取消"
  11146. },
  11147. // 确认按钮的文字
  11148. confirmText: {
  11149. type: String,
  11150. default: "确定"
  11151. },
  11152. // 取消按钮的颜色
  11153. cancelColor: {
  11154. type: String,
  11155. default: "#909193"
  11156. },
  11157. // 确认按钮的颜色
  11158. confirmColor: {
  11159. type: String,
  11160. default: "#3c9cff"
  11161. },
  11162. // 文字颜色
  11163. color: {
  11164. type: String,
  11165. default: ""
  11166. },
  11167. // 选中文字的颜色
  11168. activeColor: {
  11169. type: String,
  11170. default: ""
  11171. },
  11172. // 每列中可见选项的数量
  11173. visibleItemCount: {
  11174. type: [String, Number],
  11175. default: 5
  11176. },
  11177. // 选项对象中,需要展示的属性键名
  11178. keyName: {
  11179. type: String,
  11180. default: "text"
  11181. },
  11182. // 是否允许点击遮罩关闭选择器
  11183. closeOnClickOverlay: {
  11184. type: Boolean,
  11185. default: true
  11186. },
  11187. // 是否允许点击确认关闭选择器
  11188. closeOnClickConfirm: {
  11189. type: Boolean,
  11190. default: true
  11191. },
  11192. // 各列的默认索引
  11193. defaultIndex: {
  11194. type: Array,
  11195. default: () => []
  11196. },
  11197. // 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件,只在微信2.21.1及以上有效
  11198. immediateChange: {
  11199. type: Boolean,
  11200. default: true
  11201. },
  11202. fontSize: {
  11203. type: String,
  11204. default: "16px"
  11205. },
  11206. ...(_R = (_Q = uni.$uv) == null ? void 0 : _Q.props) == null ? void 0 : _R.picker
  11207. }
  11208. };
  11209. const _sfc_main$3 = {
  11210. name: "uv-picker",
  11211. emits: ["confirm", "cancel", "close", "change"],
  11212. mixins: [mpMixin, mixin, props],
  11213. computed: {
  11214. // 为了解决支付宝不生效
  11215. textStyle() {
  11216. return (index2, index1) => {
  11217. const style = {};
  11218. style.display = "block";
  11219. if (this.color) {
  11220. style.color = this.color;
  11221. }
  11222. if (this.activeColor && index1 === this.innerIndex[index2]) {
  11223. style.color = this.activeColor;
  11224. }
  11225. return style;
  11226. };
  11227. }
  11228. },
  11229. data() {
  11230. return {
  11231. // 上一次选择的列索引
  11232. lastIndex: [],
  11233. // 索引值 ,对应picker-view的value
  11234. innerIndex: [],
  11235. // 各列的值
  11236. innerColumns: [],
  11237. // 上一次的变化列索引
  11238. columnIndex: 0
  11239. };
  11240. },
  11241. watch: {
  11242. // 监听默认索引的变化,重新设置对应的值
  11243. defaultIndex: {
  11244. immediate: true,
  11245. handler(n2) {
  11246. this.setIndexs(n2, true);
  11247. }
  11248. },
  11249. // 监听columns参数的变化
  11250. columns: {
  11251. deep: true,
  11252. immediate: true,
  11253. handler(n2) {
  11254. this.setColumns(n2);
  11255. }
  11256. }
  11257. },
  11258. methods: {
  11259. open() {
  11260. this.$refs.pickerPopup.open();
  11261. },
  11262. close() {
  11263. this.$refs.pickerPopup.close();
  11264. },
  11265. popupChange(e) {
  11266. if (!e.show)
  11267. this.$emit("close");
  11268. },
  11269. // 获取item需要显示的文字,判别为对象还是文本
  11270. getItemText(item) {
  11271. if (this.$uv.test.object(item)) {
  11272. return item[this.keyName];
  11273. } else {
  11274. return item;
  11275. }
  11276. },
  11277. // 点击工具栏的取消按钮
  11278. cancel() {
  11279. this.$emit("cancel");
  11280. this.close();
  11281. },
  11282. // 点击工具栏的确定按钮
  11283. confirm() {
  11284. this.$emit("confirm", this.$uv.deepClone({
  11285. indexs: this.innerIndex,
  11286. value: this.innerColumns.map((item, index2) => item[this.innerIndex[index2]]),
  11287. values: this.innerColumns
  11288. }));
  11289. if (this.closeOnClickConfirm) {
  11290. this.close();
  11291. }
  11292. },
  11293. // 选择器某一列的数据发生变化时触发
  11294. changeHandler(e) {
  11295. const {
  11296. value: value2
  11297. } = e.detail;
  11298. let index2 = 0, columnIndex = 0;
  11299. for (let i = 0; i < value2.length; i++) {
  11300. let item = value2[i];
  11301. if (item !== (this.lastIndex[i] || 0)) {
  11302. columnIndex = i;
  11303. index2 = item;
  11304. break;
  11305. }
  11306. }
  11307. this.columnIndex = columnIndex;
  11308. const values = this.innerColumns;
  11309. this.setLastIndex(value2);
  11310. this.setIndexs(value2);
  11311. this.$emit("change", {
  11312. value: this.innerColumns.map((item, index3) => item[value2[index3]]),
  11313. index: index2,
  11314. indexs: value2,
  11315. // values为当前变化列的数组内容
  11316. values,
  11317. columnIndex
  11318. });
  11319. },
  11320. // 设置index索引,此方法可被外部调用设置
  11321. setIndexs(index2, setLastIndex) {
  11322. this.innerIndex = this.$uv.deepClone(index2);
  11323. if (setLastIndex) {
  11324. this.setLastIndex(index2);
  11325. }
  11326. },
  11327. // 记录上一次的各列索引位置
  11328. setLastIndex(index2) {
  11329. this.lastIndex = this.$uv.deepClone(index2);
  11330. },
  11331. // 设置对应列选项的所有值
  11332. setColumnValues(columnIndex, values) {
  11333. this.innerColumns.splice(columnIndex, 1, values);
  11334. let tmpIndex = this.$uv.deepClone(this.innerIndex);
  11335. for (let i = 0; i < this.innerColumns.length; i++) {
  11336. if (i > this.columnIndex) {
  11337. tmpIndex[i] = 0;
  11338. }
  11339. }
  11340. this.setIndexs(tmpIndex);
  11341. },
  11342. // 获取对应列的所有选项
  11343. getColumnValues(columnIndex) {
  11344. (async () => {
  11345. await this.$uv.sleep();
  11346. })();
  11347. return this.innerColumns[columnIndex];
  11348. },
  11349. // 设置整体各列的columns的值
  11350. setColumns(columns) {
  11351. this.innerColumns = this.$uv.deepClone(columns);
  11352. if (this.innerIndex.length === 0) {
  11353. this.innerIndex = new Array(columns.length).fill(0);
  11354. }
  11355. },
  11356. // 获取各列选中值对应的索引
  11357. getIndexs() {
  11358. return this.innerIndex;
  11359. },
  11360. // 获取各列选中的值
  11361. getValues() {
  11362. (async () => {
  11363. await this.$uv.sleep();
  11364. })();
  11365. return this.innerColumns.map((item, index2) => item[this.innerIndex[index2]]);
  11366. }
  11367. }
  11368. };
  11369. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  11370. const _component_uv_toolbar = resolveEasycom(vue.resolveDynamicComponent("uv-toolbar"), __easycom_0);
  11371. const _component_uv_loading_icon = resolveEasycom(vue.resolveDynamicComponent("uv-loading-icon"), __easycom_1$4);
  11372. const _component_uv_popup = resolveEasycom(vue.resolveDynamicComponent("uv-popup"), __easycom_2);
  11373. return vue.openBlock(), vue.createBlock(_component_uv_popup, {
  11374. ref: "pickerPopup",
  11375. mode: "bottom",
  11376. round: _ctx.round,
  11377. "close-on-click-overlay": _ctx.closeOnClickOverlay,
  11378. onChange: $options.popupChange
  11379. }, {
  11380. default: vue.withCtx(() => [
  11381. vue.createElementVNode("view", { class: "uv-picker" }, [
  11382. _ctx.showToolbar ? (vue.openBlock(), vue.createBlock(_component_uv_toolbar, {
  11383. key: 0,
  11384. cancelColor: _ctx.cancelColor,
  11385. confirmColor: _ctx.confirmColor,
  11386. cancelText: _ctx.cancelText,
  11387. confirmText: _ctx.confirmText,
  11388. title: _ctx.title,
  11389. onCancel: $options.cancel,
  11390. onConfirm: $options.confirm
  11391. }, null, 8, ["cancelColor", "confirmColor", "cancelText", "confirmText", "title", "onCancel", "onConfirm"])) : vue.createCommentVNode("v-if", true),
  11392. vue.createElementVNode("picker-view", {
  11393. class: "uv-picker__view",
  11394. indicatorStyle: `height: ${_ctx.$uv.addUnit(_ctx.itemHeight)}`,
  11395. value: $data.innerIndex,
  11396. immediateChange: _ctx.immediateChange,
  11397. style: vue.normalizeStyle({
  11398. height: `${_ctx.$uv.addUnit(_ctx.visibleItemCount * _ctx.itemHeight)}`
  11399. }),
  11400. onChange: _cache[0] || (_cache[0] = (...args) => $options.changeHandler && $options.changeHandler(...args))
  11401. }, [
  11402. (vue.openBlock(true), vue.createElementBlock(
  11403. vue.Fragment,
  11404. null,
  11405. vue.renderList($data.innerColumns, (item, index2) => {
  11406. return vue.openBlock(), vue.createElementBlock("picker-view-column", {
  11407. key: index2,
  11408. class: "uv-picker__view__column"
  11409. }, [
  11410. _ctx.$uv.test.array(item) ? (vue.openBlock(true), vue.createElementBlock(
  11411. vue.Fragment,
  11412. { key: 0 },
  11413. vue.renderList(item, (item1, index1) => {
  11414. return vue.openBlock(), vue.createElementBlock(
  11415. "text",
  11416. {
  11417. class: "uv-picker__view__column__item uv-line-1",
  11418. key: index1,
  11419. style: vue.normalizeStyle([{
  11420. height: _ctx.$uv.addUnit(_ctx.itemHeight),
  11421. lineHeight: _ctx.$uv.addUnit(_ctx.itemHeight),
  11422. fontWeight: index1 === $data.innerIndex[index2] ? "bold" : "normal",
  11423. fontSize: _ctx.$uv.addUnit(_ctx.fontSize)
  11424. }, $options.textStyle(index2, index1)])
  11425. },
  11426. vue.toDisplayString($options.getItemText(item1)),
  11427. 5
  11428. /* TEXT, STYLE */
  11429. );
  11430. }),
  11431. 128
  11432. /* KEYED_FRAGMENT */
  11433. )) : vue.createCommentVNode("v-if", true)
  11434. ]);
  11435. }),
  11436. 128
  11437. /* KEYED_FRAGMENT */
  11438. ))
  11439. ], 44, ["indicatorStyle", "value", "immediateChange"]),
  11440. _ctx.loading ? (vue.openBlock(), vue.createElementBlock("view", {
  11441. key: 1,
  11442. class: "uv-picker--loading"
  11443. }, [
  11444. vue.createVNode(_component_uv_loading_icon, { mode: "circle" })
  11445. ])) : vue.createCommentVNode("v-if", true)
  11446. ])
  11447. ]),
  11448. _: 1
  11449. /* STABLE */
  11450. }, 8, ["round", "close-on-click-overlay", "onChange"]);
  11451. }
  11452. 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"]]);
  11453. const _sfc_main$2 = {
  11454. data() {
  11455. return {
  11456. userinfo: {},
  11457. selectuser: {},
  11458. minhm: 60,
  11459. maxhm: 210,
  11460. value: 110,
  11461. label: "",
  11462. label_text: "",
  11463. scaleid: 0,
  11464. srid: 0,
  11465. sindex: 0,
  11466. answertype: 0,
  11467. stemid: 6,
  11468. columns_limit_list: [
  11469. {
  11470. uplimit: 119,
  11471. dowlimit: 60,
  11472. viewstr: "110",
  11473. sbpstr: this.$t("hg_text1")
  11474. },
  11475. {
  11476. uplimit: 110,
  11477. dowlimit: 110,
  11478. viewstr: "110",
  11479. sbpstr: this.$t("hg_text2")
  11480. },
  11481. {
  11482. uplimit: 119,
  11483. dowlimit: 111,
  11484. viewstr: "110~120",
  11485. sbpstr: this.$t("hg_text3")
  11486. },
  11487. {
  11488. uplimit: 129,
  11489. dowlimit: 120,
  11490. viewstr: "120~130",
  11491. sbpstr: this.$t("hg_text3")
  11492. },
  11493. {
  11494. uplimit: 139,
  11495. dowlimit: 130,
  11496. viewstr: "130~140",
  11497. sbpstr: this.$t("hg_text3")
  11498. },
  11499. {
  11500. uplimit: 219,
  11501. dowlimit: 140,
  11502. viewstr: "140",
  11503. sbpstr: this.$t("hg_text4")
  11504. }
  11505. ],
  11506. selectbutton1: {
  11507. fontSize: "30px",
  11508. width: "500rpx",
  11509. borderColor: "#648EB8",
  11510. color: "#648EB8"
  11511. },
  11512. selectbutton2: {
  11513. fontSize: "30px",
  11514. width: "500rpx",
  11515. background: "#648EB8",
  11516. border: "0px"
  11517. },
  11518. selectbutton3: {
  11519. fontSize: "20px",
  11520. fontWeight: "bold",
  11521. letterSpacing: "0.5em"
  11522. },
  11523. canvasHeight: 80,
  11524. canvasWidth: 1e3,
  11525. scroll_left: 0
  11526. };
  11527. },
  11528. computed: {
  11529. columns() {
  11530. let list = [];
  11531. for (var i = this.minhm; i <= this.maxhm; i++) {
  11532. let label = i + this.$t("hg_text2");
  11533. this.columns_limit_list.map((item2, index2) => {
  11534. if (i >= item2.dowlimit && i <= item2.uplimit) {
  11535. label = item2.viewstr + item2.sbpstr;
  11536. return label;
  11537. }
  11538. });
  11539. let item = {
  11540. label,
  11541. value: i
  11542. };
  11543. list.push(item);
  11544. }
  11545. return [list];
  11546. },
  11547. style() {
  11548. let value2 = {
  11549. canvasHeight: this.canvasHeight + "px",
  11550. canvasWidth: this.canvasWidth + "px",
  11551. screenWidth: this.screenWidth + "px"
  11552. };
  11553. return value2;
  11554. }
  11555. },
  11556. methods: {
  11557. init() {
  11558. this.userinfo = uni.getStorageSync("userinfo");
  11559. this.selectuser = uni.getStorageSync("selectuser");
  11560. this.showlabel();
  11561. },
  11562. change(e) {
  11563. let value2 = e.value[0].value;
  11564. this.value = value2;
  11565. this.label = e.value[0].label;
  11566. },
  11567. showselectage() {
  11568. this.$refs.picker.open();
  11569. let index2 = this.value - this.minhm;
  11570. this.$refs.picker.setIndexs([index2], true);
  11571. },
  11572. // showlabel(){
  11573. // let index = this.value-this.minhm
  11574. // this.label = this.columns[0][index].label
  11575. // },
  11576. showlabel() {
  11577. if (this.value < 110) {
  11578. this.label = 110;
  11579. this.label_text = this.$t("hg_text1");
  11580. }
  11581. for (let i = 0; i < 3; i++) {
  11582. let min = 110 + i * 10;
  11583. let max = 110 + (i + 1) * 10;
  11584. if (this.value < max && this.value >= min) {
  11585. this.label = min + "~" + max;
  11586. this.label_text = this.$t("hg_text3");
  11587. }
  11588. }
  11589. if (this.value >= 140) {
  11590. this.label = 140;
  11591. this.label_text = this.$t("hg_text4");
  11592. }
  11593. if (this.value == 110) {
  11594. this.label = 110;
  11595. this.label_text = this.$t("hg_text2");
  11596. }
  11597. },
  11598. donext() {
  11599. let answer = {
  11600. userid: this.userinfo.id,
  11601. fmemberid: this.selectuser.fmemberid,
  11602. stemid: this.stemid,
  11603. answertype: this.answertype,
  11604. answervalue: this.value
  11605. };
  11606. let data = {
  11607. userid: this.userinfo.id,
  11608. fmemberid: this.selectuser.fmemberid,
  11609. srid: this.srid,
  11610. scaleid: this.scaleid
  11611. };
  11612. subanswerbyuserid(answer, data).then((res) => {
  11613. res = res.data;
  11614. if (0 == res.code) {
  11615. this.$refs.toast.show({
  11616. type: "error",
  11617. message: res.errmsg
  11618. });
  11619. return false;
  11620. }
  11621. if (200 == res.code) {
  11622. uni.setStorage({
  11623. key: "srid",
  11624. data: res.resultData
  11625. });
  11626. tostemlistnext(this.sindex, 1);
  11627. }
  11628. });
  11629. },
  11630. drawruler() {
  11631. let param = {
  11632. canvasid: "canvas_ruler",
  11633. canvascursorid: "canvas-cursor",
  11634. minvalue: this.minhm,
  11635. maxvalue: this.maxhm,
  11636. interval: 1,
  11637. defaultvalue: this.value,
  11638. precision: 0
  11639. };
  11640. drawruler(param);
  11641. this.value = getcursorvalue();
  11642. this.canvasHeight = getCanvasConfig().canvasHeight;
  11643. this.canvasWidth = getCanvasConfig().canvasWidth;
  11644. this.screenWidth = getCanvasConfig().screenWidth;
  11645. this.scroll_left = getscrollleft();
  11646. },
  11647. scroll(e) {
  11648. this.value = setcursorvalue(e.detail.scrollLeft);
  11649. this.showlabel();
  11650. }
  11651. },
  11652. mounted() {
  11653. uni.setNavigationBarTitle({
  11654. title: this.$t("blood_pressure")
  11655. });
  11656. this.init();
  11657. },
  11658. onLoad: function(option) {
  11659. this.scaleid = option.scaleid;
  11660. this.srid = option.srid;
  11661. this.sindex = option.sindex;
  11662. },
  11663. onBackPress: function(option) {
  11664. tohome();
  11665. return true;
  11666. },
  11667. onReady() {
  11668. this.drawruler();
  11669. }
  11670. };
  11671. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  11672. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  11673. const _component_uv_picker = resolveEasycom(vue.resolveDynamicComponent("uv-picker"), __easycom_1);
  11674. const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
  11675. return vue.openBlock(), vue.createElementBlock(
  11676. vue.Fragment,
  11677. null,
  11678. [
  11679. vue.createVNode(
  11680. _component_uv_toast,
  11681. { ref: "toast" },
  11682. null,
  11683. 512
  11684. /* NEED_PATCH */
  11685. ),
  11686. vue.createElementVNode("view", { class: "titlearea" }, [
  11687. vue.createElementVNode(
  11688. "text",
  11689. { class: "title_2" },
  11690. vue.toDisplayString(_ctx.$t("selectsbp_text1")),
  11691. 1
  11692. /* TEXT */
  11693. ),
  11694. vue.createElementVNode(
  11695. "text",
  11696. { class: "title_member" },
  11697. vue.toDisplayString(_ctx.$t("report_user")) + ":" + vue.toDisplayString($data.selectuser.membername),
  11698. 1
  11699. /* TEXT */
  11700. ),
  11701. vue.createElementVNode(
  11702. "text",
  11703. {
  11704. class: "title_desstr",
  11705. decode: "true"
  11706. },
  11707. vue.toDisplayString(_ctx.$t("selectsbp_text2")),
  11708. 1
  11709. /* TEXT */
  11710. ),
  11711. vue.createElementVNode(
  11712. "text",
  11713. {
  11714. class: "title_desstr",
  11715. decode: "true"
  11716. },
  11717. vue.toDisplayString(_ctx.$t("selectsbp_text3")),
  11718. 1
  11719. /* TEXT */
  11720. ),
  11721. vue.createElementVNode(
  11722. "text",
  11723. {
  11724. class: "title_desstr",
  11725. decode: "true"
  11726. },
  11727. vue.toDisplayString(_ctx.$t("selectsbp_text4")),
  11728. 1
  11729. /* TEXT */
  11730. )
  11731. ]),
  11732. vue.createElementVNode("view", { class: "agevalue" }, [
  11733. vue.createElementVNode("view", { class: "" }, [
  11734. vue.createTextVNode(
  11735. vue.toDisplayString(_ctx.$t("blood_pressure")) + ":  " + vue.toDisplayString($data.label) + "  ",
  11736. 1
  11737. /* TEXT */
  11738. ),
  11739. vue.createElementVNode(
  11740. "text",
  11741. { class: "title2" },
  11742. vue.toDisplayString($data.label_text),
  11743. 1
  11744. /* TEXT */
  11745. )
  11746. ]),
  11747. vue.createCommentVNode(` <uv-button type="primary" :plain="true" :text="$t('select')" @click="showselectage" :customStyle="selectbutton1" :customTextStyle="selectbutton3"></uv-button> `),
  11748. vue.createElementVNode(
  11749. "view",
  11750. {
  11751. class: "showdiv",
  11752. id: "showdiv",
  11753. style: vue.normalizeStyle({ height: $options.style.canvasHeight })
  11754. },
  11755. [
  11756. vue.createElementVNode("scroll-view", {
  11757. style: { "width": "100%", "height": "100%" },
  11758. "scroll-x": true,
  11759. onScroll: _cache[0] || (_cache[0] = (...args) => $options.scroll && $options.scroll(...args)),
  11760. "scroll-left": $data.scroll_left,
  11761. "show-scrollbar": false
  11762. }, [
  11763. vue.createElementVNode("canvas", {
  11764. style: vue.normalizeStyle({ width: $options.style.canvasWidth, height: $options.style.canvasHeight }),
  11765. "canvas-id": "canvas_ruler",
  11766. id: "canvas_ruler",
  11767. width: $data.canvasWidth
  11768. }, null, 12, ["width"])
  11769. ], 40, ["scroll-left"]),
  11770. vue.createElementVNode(
  11771. "canvas",
  11772. {
  11773. style: vue.normalizeStyle({ width: $options.style.screenWidth, height: $options.style.canvasHeight }),
  11774. "canvas-id": "canvas-cursor",
  11775. id: "canvas-cursor"
  11776. },
  11777. null,
  11778. 4
  11779. /* STYLE */
  11780. )
  11781. ],
  11782. 4
  11783. /* STYLE */
  11784. )
  11785. ]),
  11786. vue.createElementVNode("view", { class: "" }, [
  11787. vue.createVNode(_component_uv_picker, {
  11788. ref: "picker",
  11789. columns: $options.columns,
  11790. onChange: $options.change,
  11791. keyName: "value",
  11792. showToolbar: false,
  11793. fontSize: "25px"
  11794. }, null, 8, ["columns", "onChange"])
  11795. ]),
  11796. vue.createElementVNode("view", { class: "donext_div" }, [
  11797. vue.createVNode(_component_uv_button, {
  11798. type: "primary",
  11799. text: _ctx.$t("next_step"),
  11800. onClick: $options.donext,
  11801. customStyle: $data.selectbutton2,
  11802. customTextStyle: $data.selectbutton3
  11803. }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
  11804. ])
  11805. ],
  11806. 64
  11807. /* STABLE_FRAGMENT */
  11808. );
  11809. }
  11810. 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"]]);
  11811. const _sfc_main$1 = {
  11812. data() {
  11813. return {
  11814. userinfo: {},
  11815. selectuser: {},
  11816. scaleid: 0,
  11817. srid: 0,
  11818. sindex: 0,
  11819. value: 80,
  11820. minvalue: 40,
  11821. maxvalue: 120,
  11822. selectbutton2: {
  11823. fontSize: "30px",
  11824. width: "500rpx",
  11825. background: "#648EB8",
  11826. border: "0px"
  11827. },
  11828. selectbutton3: {
  11829. fontSize: "20px",
  11830. fontWeight: "bold",
  11831. letterSpacing: "0.5em"
  11832. },
  11833. canvasHeight: 80,
  11834. canvasWidth: 1e3,
  11835. scroll_left: 0
  11836. };
  11837. },
  11838. computed: {
  11839. columns() {
  11840. let list = [];
  11841. for (var i = this.minvalue; i <= this.maxvalue; i++) {
  11842. let label = i;
  11843. if (i == this.minvalue) {
  11844. label = this.$t("less_than") + i;
  11845. }
  11846. if (i == this.maxvalue) {
  11847. label = this.$t("greater_than") + i;
  11848. }
  11849. let item = {
  11850. label,
  11851. value: i
  11852. };
  11853. list.push(item);
  11854. }
  11855. return [list];
  11856. },
  11857. chi() {
  11858. var chicun = Math.round(this.value * 0.3);
  11859. let value2 = parseInt(chicun / 10);
  11860. return value2;
  11861. },
  11862. cun() {
  11863. var chicun = Math.round(this.value * 0.3);
  11864. let value2 = chicun % 10;
  11865. return value2;
  11866. },
  11867. style() {
  11868. let value2 = {
  11869. canvasHeight: this.canvasHeight + "px",
  11870. canvasWidth: this.canvasWidth + "px",
  11871. screenWidth: this.screenWidth + "px"
  11872. };
  11873. return value2;
  11874. }
  11875. },
  11876. methods: {
  11877. init() {
  11878. this.userinfo = uni.getStorageSync("userinfo");
  11879. this.selectuser = uni.getStorageSync("selectuser");
  11880. },
  11881. change(e) {
  11882. let value2 = e.value[0].value;
  11883. this.value = value2;
  11884. },
  11885. donext() {
  11886. let answer = {
  11887. userid: this.userinfo.id,
  11888. fmemberid: this.selectuser.fmemberid,
  11889. stemid: 30,
  11890. answertype: 0,
  11891. answervalue: this.value
  11892. };
  11893. let data = {
  11894. userid: this.userinfo.id,
  11895. fmemberid: this.selectuser.fmemberid,
  11896. srid: this.srid,
  11897. scaleid: this.scaleid
  11898. };
  11899. subanswerbyuserid(answer, data).then((res) => {
  11900. res = res.data;
  11901. if (0 == res.code) {
  11902. this.$refs.toast.show({
  11903. type: "error",
  11904. message: res.errmsg
  11905. });
  11906. return false;
  11907. }
  11908. if (200 == res.code) {
  11909. uni.setStorage({
  11910. key: "srid",
  11911. data: res.resultData
  11912. });
  11913. tostemlistnext(this.sindex, 1);
  11914. }
  11915. });
  11916. },
  11917. setvalue() {
  11918. this.$refs.picker.open();
  11919. let index2 = this.value - this.minvalue;
  11920. this.$refs.picker.setIndexs([index2], true);
  11921. },
  11922. drawruler() {
  11923. let param = {
  11924. canvasid: "canvas_ruler",
  11925. canvascursorid: "canvas-cursor",
  11926. minvalue: this.minvalue,
  11927. maxvalue: this.maxvalue,
  11928. interval: 1,
  11929. defaultvalue: this.value,
  11930. precision: 0
  11931. };
  11932. drawruler(param);
  11933. this.value = getcursorvalue();
  11934. this.canvasHeight = getCanvasConfig().canvasHeight;
  11935. this.canvasWidth = getCanvasConfig().canvasWidth;
  11936. this.screenWidth = getCanvasConfig().screenWidth;
  11937. this.scroll_left = getscrollleft();
  11938. },
  11939. scroll(e) {
  11940. this.value = setcursorvalue(e.detail.scrollLeft);
  11941. }
  11942. },
  11943. mounted() {
  11944. uni.setNavigationBarTitle({
  11945. title: this.$t("waistline")
  11946. });
  11947. this.init();
  11948. },
  11949. onLoad: function(option) {
  11950. this.scaleid = option.scaleid;
  11951. this.srid = option.srid;
  11952. this.sindex = option.sindex;
  11953. },
  11954. onBackPress: function(option) {
  11955. tohome();
  11956. return true;
  11957. },
  11958. onReady() {
  11959. this.drawruler();
  11960. }
  11961. };
  11962. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  11963. const _component_uv_toast = resolveEasycom(vue.resolveDynamicComponent("uv-toast"), __easycom_0$2);
  11964. const _component_uv_picker = resolveEasycom(vue.resolveDynamicComponent("uv-picker"), __easycom_1);
  11965. const _component_uv_button = resolveEasycom(vue.resolveDynamicComponent("uv-button"), __easycom_2$2);
  11966. return vue.openBlock(), vue.createElementBlock(
  11967. vue.Fragment,
  11968. null,
  11969. [
  11970. vue.createVNode(
  11971. _component_uv_toast,
  11972. { ref: "toast" },
  11973. null,
  11974. 512
  11975. /* NEED_PATCH */
  11976. ),
  11977. vue.createElementVNode("view", { class: "titlearea" }, [
  11978. vue.createElementVNode(
  11979. "text",
  11980. { class: "title_2" },
  11981. vue.toDisplayString(_ctx.$t("selectwaistline_text1")),
  11982. 1
  11983. /* TEXT */
  11984. ),
  11985. vue.createElementVNode(
  11986. "text",
  11987. { class: "title_member" },
  11988. vue.toDisplayString(_ctx.$t("report_user")) + ":" + vue.toDisplayString($data.selectuser.membername),
  11989. 1
  11990. /* TEXT */
  11991. ),
  11992. vue.createElementVNode(
  11993. "text",
  11994. {
  11995. class: "title_desstr",
  11996. decode: "true"
  11997. },
  11998. vue.toDisplayString(_ctx.$t("selectwaistline_text2")),
  11999. 1
  12000. /* TEXT */
  12001. ),
  12002. vue.createElementVNode(
  12003. "text",
  12004. {
  12005. class: "title_desstr",
  12006. decode: "true"
  12007. },
  12008. vue.toDisplayString(_ctx.$t("selectwaistline_text3")),
  12009. 1
  12010. /* TEXT */
  12011. ),
  12012. vue.createElementVNode(
  12013. "text",
  12014. {
  12015. class: "title_desstr",
  12016. decode: "true"
  12017. },
  12018. vue.toDisplayString(_ctx.$t("selectwaistline_text4")),
  12019. 1
  12020. /* TEXT */
  12021. ),
  12022. vue.createElementVNode(
  12023. "text",
  12024. {
  12025. class: "title_desstr",
  12026. decode: "true"
  12027. },
  12028. vue.toDisplayString(_ctx.$t("selectwaistline_text5")),
  12029. 1
  12030. /* TEXT */
  12031. )
  12032. ]),
  12033. vue.createElementVNode("view", { class: "info_div info_div_1" }, [
  12034. vue.createElementVNode("view", { class: "text_div" }, [
  12035. vue.createElementVNode(
  12036. "text",
  12037. { class: "title3" },
  12038. vue.toDisplayString(_ctx.$t("waistline")) + ":",
  12039. 1
  12040. /* TEXT */
  12041. ),
  12042. vue.createElementVNode(
  12043. "text",
  12044. { class: "text" },
  12045. vue.toDisplayString($data.value),
  12046. 1
  12047. /* TEXT */
  12048. ),
  12049. vue.createElementVNode("text", { class: "title3" }, "CM")
  12050. ]),
  12051. vue.createCommentVNode(` <view class="text_div">\r
  12052. <text class="text">{{chi}}</text>\r
  12053. <text class="title3">{{$t('waistline_text1')}}</text>\r
  12054. <text class="text">{{cun}}</text>\r
  12055. <text class="title3">{{$t('waistline_text2')}}</text>\r
  12056. </view> `)
  12057. ]),
  12058. vue.createCommentVNode(` <view class="info_div info_div_2">\r
  12059. <view class="mybtn" @click="setvalue">{{$t('select')}}</view>\r
  12060. </view> `),
  12061. vue.createElementVNode(
  12062. "view",
  12063. {
  12064. class: "showdiv",
  12065. id: "showdiv",
  12066. style: vue.normalizeStyle({ height: $options.style.canvasHeight })
  12067. },
  12068. [
  12069. vue.createElementVNode("scroll-view", {
  12070. style: { "width": "100%", "height": "100%" },
  12071. "scroll-x": true,
  12072. onScroll: _cache[0] || (_cache[0] = (...args) => $options.scroll && $options.scroll(...args)),
  12073. "scroll-left": $data.scroll_left,
  12074. "show-scrollbar": false
  12075. }, [
  12076. vue.createElementVNode("canvas", {
  12077. style: vue.normalizeStyle({ width: $options.style.canvasWidth, height: $options.style.canvasHeight }),
  12078. "canvas-id": "canvas_ruler",
  12079. id: "canvas_ruler",
  12080. width: $data.canvasWidth
  12081. }, null, 12, ["width"])
  12082. ], 40, ["scroll-left"]),
  12083. vue.createElementVNode(
  12084. "canvas",
  12085. {
  12086. style: vue.normalizeStyle({ width: $options.style.screenWidth, height: $options.style.canvasHeight }),
  12087. "canvas-id": "canvas-cursor",
  12088. id: "canvas-cursor"
  12089. },
  12090. null,
  12091. 4
  12092. /* STYLE */
  12093. )
  12094. ],
  12095. 4
  12096. /* STYLE */
  12097. ),
  12098. vue.createElementVNode("view", { class: "" }, [
  12099. vue.createVNode(_component_uv_picker, {
  12100. ref: "picker",
  12101. columns: $options.columns,
  12102. onChange: $options.change,
  12103. keyName: "label",
  12104. showToolbar: false,
  12105. fontSize: "25px"
  12106. }, null, 8, ["columns", "onChange"])
  12107. ]),
  12108. vue.createElementVNode("view", { class: "donext_div" }, [
  12109. vue.createVNode(_component_uv_button, {
  12110. type: "primary",
  12111. text: _ctx.$t("next_step"),
  12112. onClick: $options.donext,
  12113. customStyle: $data.selectbutton2,
  12114. customTextStyle: $data.selectbutton3
  12115. }, null, 8, ["text", "onClick", "customStyle", "customTextStyle"])
  12116. ])
  12117. ],
  12118. 64
  12119. /* STABLE_FRAGMENT */
  12120. );
  12121. }
  12122. const PagesTopicSelectwaistline = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "D:/workspace/uniapp/health2/pages/topic/selectwaistline.vue"]]);
  12123. __definePage("pages/index/show", PagesIndexShow);
  12124. __definePage("pages/index/index", PagesIndexIndex);
  12125. __definePage("pages/login/login", PagesLoginLogin);
  12126. __definePage("pages/register/register", PagesRegisterRegister);
  12127. __definePage("pages/member/member", PagesMemberMember);
  12128. __definePage("pages/member/add", PagesMemberAdd);
  12129. __definePage("pages/report/report", PagesReportReport);
  12130. __definePage("pages/topic/common", PagesTopicCommon);
  12131. __definePage("pages/topic/selectage", PagesTopicSelectage);
  12132. __definePage("pages/topic/selectsex", PagesTopicSelectsex);
  12133. __definePage("pages/topic/selectcanvas", PagesTopicSelectcanvas);
  12134. __definePage("pages/topic/selectsbp", PagesTopicSelectsbp);
  12135. __definePage("pages/topic/selectwaistline", PagesTopicSelectwaistline);
  12136. const _sfc_main = {
  12137. globalData: {
  12138. throttleTime: 1e3
  12139. //节流时间 毫秒
  12140. },
  12141. onLaunch: function() {
  12142. },
  12143. onShow: function() {
  12144. formatAppLog("log", "at App.vue:20", "App Show");
  12145. },
  12146. onHide: function() {
  12147. formatAppLog("log", "at App.vue:23", "App Hide");
  12148. }
  12149. };
  12150. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/workspace/uniapp/health2/App.vue"]]);
  12151. /*!
  12152. * @intlify/shared v9.1.9
  12153. * (c) 2021 kazuya kawaguchi
  12154. * Released under the MIT License.
  12155. */
  12156. const inBrowser = typeof window !== "undefined";
  12157. let mark;
  12158. let measure;
  12159. {
  12160. const perf = inBrowser && window.performance;
  12161. if (perf && perf.mark && perf.measure && perf.clearMarks && perf.clearMeasures) {
  12162. mark = (tag) => perf.mark(tag);
  12163. measure = (name, startTag, endTag) => {
  12164. perf.measure(name, startTag, endTag);
  12165. perf.clearMarks(startTag);
  12166. perf.clearMarks(endTag);
  12167. };
  12168. }
  12169. }
  12170. const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g;
  12171. function format(message, ...args) {
  12172. if (args.length === 1 && isObject$1(args[0])) {
  12173. args = args[0];
  12174. }
  12175. if (!args || !args.hasOwnProperty) {
  12176. args = {};
  12177. }
  12178. return message.replace(RE_ARGS, (match, identifier) => {
  12179. return args.hasOwnProperty(identifier) ? args[identifier] : "";
  12180. });
  12181. }
  12182. const hasSymbol = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
  12183. const makeSymbol = (name) => hasSymbol ? Symbol(name) : name;
  12184. const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });
  12185. const friendlyJSONstringify = (json) => JSON.stringify(json).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027");
  12186. const isNumber = (val) => typeof val === "number" && isFinite(val);
  12187. const isDate = (val) => toTypeString(val) === "[object Date]";
  12188. const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
  12189. const isEmptyObject = (val) => isPlainObject(val) && Object.keys(val).length === 0;
  12190. function warn(msg, err) {
  12191. if (typeof console !== "undefined") {
  12192. console.warn(`[intlify] ` + msg);
  12193. if (err) {
  12194. console.warn(err.stack);
  12195. }
  12196. }
  12197. }
  12198. const assign = Object.assign;
  12199. let _globalThis;
  12200. const getGlobalThis = () => {
  12201. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  12202. };
  12203. function escapeHtml(rawText) {
  12204. return rawText.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
  12205. }
  12206. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  12207. function hasOwn$1(obj, key) {
  12208. return hasOwnProperty$1.call(obj, key);
  12209. }
  12210. const isArray = Array.isArray;
  12211. const isFunction = (val) => typeof val === "function";
  12212. const isString = (val) => typeof val === "string";
  12213. const isBoolean = (val) => typeof val === "boolean";
  12214. const isObject$1 = (val) => (
  12215. // eslint-disable-line
  12216. val !== null && typeof val === "object"
  12217. );
  12218. const objectToString = Object.prototype.toString;
  12219. const toTypeString = (value2) => objectToString.call(value2);
  12220. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  12221. const toDisplayString = (val) => {
  12222. return val == null ? "" : isArray(val) || isPlainObject(val) && val.toString === objectToString ? JSON.stringify(val, null, 2) : String(val);
  12223. };
  12224. const RANGE = 2;
  12225. function generateCodeFrame(source, start = 0, end = source.length) {
  12226. const lines = source.split(/\r?\n/);
  12227. let count = 0;
  12228. const res = [];
  12229. for (let i = 0; i < lines.length; i++) {
  12230. count += lines[i].length + 1;
  12231. if (count >= start) {
  12232. for (let j = i - RANGE; j <= i + RANGE || end > count; j++) {
  12233. if (j < 0 || j >= lines.length)
  12234. continue;
  12235. const line = j + 1;
  12236. res.push(`${line}${" ".repeat(3 - String(line).length)}| ${lines[j]}`);
  12237. const lineLength = lines[j].length;
  12238. if (j === i) {
  12239. const pad = start - (count - lineLength) + 1;
  12240. const length = Math.max(1, end > count ? lineLength - pad : end - start);
  12241. res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
  12242. } else if (j > i) {
  12243. if (end > count) {
  12244. const length = Math.max(Math.min(end - count, lineLength), 1);
  12245. res.push(` | ` + "^".repeat(length));
  12246. }
  12247. count += lineLength + 1;
  12248. }
  12249. }
  12250. break;
  12251. }
  12252. }
  12253. return res.join("\n");
  12254. }
  12255. function createEmitter() {
  12256. const events = /* @__PURE__ */ new Map();
  12257. const emitter = {
  12258. events,
  12259. on(event, handler) {
  12260. const handlers = events.get(event);
  12261. const added = handlers && handlers.push(handler);
  12262. if (!added) {
  12263. events.set(event, [handler]);
  12264. }
  12265. },
  12266. off(event, handler) {
  12267. const handlers = events.get(event);
  12268. if (handlers) {
  12269. handlers.splice(handlers.indexOf(handler) >>> 0, 1);
  12270. }
  12271. },
  12272. emit(event, payload) {
  12273. (events.get(event) || []).slice().map((handler) => handler(payload));
  12274. (events.get("*") || []).slice().map((handler) => handler(event, payload));
  12275. }
  12276. };
  12277. return emitter;
  12278. }
  12279. /*!
  12280. * @intlify/message-resolver v9.1.9
  12281. * (c) 2021 kazuya kawaguchi
  12282. * Released under the MIT License.
  12283. */
  12284. const hasOwnProperty = Object.prototype.hasOwnProperty;
  12285. function hasOwn(obj, key) {
  12286. return hasOwnProperty.call(obj, key);
  12287. }
  12288. const isObject = (val) => (
  12289. // eslint-disable-line
  12290. val !== null && typeof val === "object"
  12291. );
  12292. const pathStateMachine = [];
  12293. pathStateMachine[
  12294. 0
  12295. /* BEFORE_PATH */
  12296. ] = {
  12297. [
  12298. "w"
  12299. /* WORKSPACE */
  12300. ]: [
  12301. 0
  12302. /* BEFORE_PATH */
  12303. ],
  12304. [
  12305. "i"
  12306. /* IDENT */
  12307. ]: [
  12308. 3,
  12309. 0
  12310. /* APPEND */
  12311. ],
  12312. [
  12313. "["
  12314. /* LEFT_BRACKET */
  12315. ]: [
  12316. 4
  12317. /* IN_SUB_PATH */
  12318. ],
  12319. [
  12320. "o"
  12321. /* END_OF_FAIL */
  12322. ]: [
  12323. 7
  12324. /* AFTER_PATH */
  12325. ]
  12326. };
  12327. pathStateMachine[
  12328. 1
  12329. /* IN_PATH */
  12330. ] = {
  12331. [
  12332. "w"
  12333. /* WORKSPACE */
  12334. ]: [
  12335. 1
  12336. /* IN_PATH */
  12337. ],
  12338. [
  12339. "."
  12340. /* DOT */
  12341. ]: [
  12342. 2
  12343. /* BEFORE_IDENT */
  12344. ],
  12345. [
  12346. "["
  12347. /* LEFT_BRACKET */
  12348. ]: [
  12349. 4
  12350. /* IN_SUB_PATH */
  12351. ],
  12352. [
  12353. "o"
  12354. /* END_OF_FAIL */
  12355. ]: [
  12356. 7
  12357. /* AFTER_PATH */
  12358. ]
  12359. };
  12360. pathStateMachine[
  12361. 2
  12362. /* BEFORE_IDENT */
  12363. ] = {
  12364. [
  12365. "w"
  12366. /* WORKSPACE */
  12367. ]: [
  12368. 2
  12369. /* BEFORE_IDENT */
  12370. ],
  12371. [
  12372. "i"
  12373. /* IDENT */
  12374. ]: [
  12375. 3,
  12376. 0
  12377. /* APPEND */
  12378. ],
  12379. [
  12380. "0"
  12381. /* ZERO */
  12382. ]: [
  12383. 3,
  12384. 0
  12385. /* APPEND */
  12386. ]
  12387. };
  12388. pathStateMachine[
  12389. 3
  12390. /* IN_IDENT */
  12391. ] = {
  12392. [
  12393. "i"
  12394. /* IDENT */
  12395. ]: [
  12396. 3,
  12397. 0
  12398. /* APPEND */
  12399. ],
  12400. [
  12401. "0"
  12402. /* ZERO */
  12403. ]: [
  12404. 3,
  12405. 0
  12406. /* APPEND */
  12407. ],
  12408. [
  12409. "w"
  12410. /* WORKSPACE */
  12411. ]: [
  12412. 1,
  12413. 1
  12414. /* PUSH */
  12415. ],
  12416. [
  12417. "."
  12418. /* DOT */
  12419. ]: [
  12420. 2,
  12421. 1
  12422. /* PUSH */
  12423. ],
  12424. [
  12425. "["
  12426. /* LEFT_BRACKET */
  12427. ]: [
  12428. 4,
  12429. 1
  12430. /* PUSH */
  12431. ],
  12432. [
  12433. "o"
  12434. /* END_OF_FAIL */
  12435. ]: [
  12436. 7,
  12437. 1
  12438. /* PUSH */
  12439. ]
  12440. };
  12441. pathStateMachine[
  12442. 4
  12443. /* IN_SUB_PATH */
  12444. ] = {
  12445. [
  12446. "'"
  12447. /* SINGLE_QUOTE */
  12448. ]: [
  12449. 5,
  12450. 0
  12451. /* APPEND */
  12452. ],
  12453. [
  12454. '"'
  12455. /* DOUBLE_QUOTE */
  12456. ]: [
  12457. 6,
  12458. 0
  12459. /* APPEND */
  12460. ],
  12461. [
  12462. "["
  12463. /* LEFT_BRACKET */
  12464. ]: [
  12465. 4,
  12466. 2
  12467. /* INC_SUB_PATH_DEPTH */
  12468. ],
  12469. [
  12470. "]"
  12471. /* RIGHT_BRACKET */
  12472. ]: [
  12473. 1,
  12474. 3
  12475. /* PUSH_SUB_PATH */
  12476. ],
  12477. [
  12478. "o"
  12479. /* END_OF_FAIL */
  12480. ]: 8,
  12481. [
  12482. "l"
  12483. /* ELSE */
  12484. ]: [
  12485. 4,
  12486. 0
  12487. /* APPEND */
  12488. ]
  12489. };
  12490. pathStateMachine[
  12491. 5
  12492. /* IN_SINGLE_QUOTE */
  12493. ] = {
  12494. [
  12495. "'"
  12496. /* SINGLE_QUOTE */
  12497. ]: [
  12498. 4,
  12499. 0
  12500. /* APPEND */
  12501. ],
  12502. [
  12503. "o"
  12504. /* END_OF_FAIL */
  12505. ]: 8,
  12506. [
  12507. "l"
  12508. /* ELSE */
  12509. ]: [
  12510. 5,
  12511. 0
  12512. /* APPEND */
  12513. ]
  12514. };
  12515. pathStateMachine[
  12516. 6
  12517. /* IN_DOUBLE_QUOTE */
  12518. ] = {
  12519. [
  12520. '"'
  12521. /* DOUBLE_QUOTE */
  12522. ]: [
  12523. 4,
  12524. 0
  12525. /* APPEND */
  12526. ],
  12527. [
  12528. "o"
  12529. /* END_OF_FAIL */
  12530. ]: 8,
  12531. [
  12532. "l"
  12533. /* ELSE */
  12534. ]: [
  12535. 6,
  12536. 0
  12537. /* APPEND */
  12538. ]
  12539. };
  12540. const literalValueRE = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
  12541. function isLiteral(exp) {
  12542. return literalValueRE.test(exp);
  12543. }
  12544. function stripQuotes(str) {
  12545. const a = str.charCodeAt(0);
  12546. const b = str.charCodeAt(str.length - 1);
  12547. return a === b && (a === 34 || a === 39) ? str.slice(1, -1) : str;
  12548. }
  12549. function getPathCharType(ch) {
  12550. if (ch === void 0 || ch === null) {
  12551. return "o";
  12552. }
  12553. const code2 = ch.charCodeAt(0);
  12554. switch (code2) {
  12555. case 91:
  12556. case 93:
  12557. case 46:
  12558. case 34:
  12559. case 39:
  12560. return ch;
  12561. case 95:
  12562. case 36:
  12563. case 45:
  12564. return "i";
  12565. case 9:
  12566. case 10:
  12567. case 13:
  12568. case 160:
  12569. case 65279:
  12570. case 8232:
  12571. case 8233:
  12572. return "w";
  12573. }
  12574. return "i";
  12575. }
  12576. function formatSubPath(path) {
  12577. const trimmed = path.trim();
  12578. if (path.charAt(0) === "0" && isNaN(parseInt(path))) {
  12579. return false;
  12580. }
  12581. return isLiteral(trimmed) ? stripQuotes(trimmed) : "*" + trimmed;
  12582. }
  12583. function parse(path) {
  12584. const keys = [];
  12585. let index2 = -1;
  12586. let mode = 0;
  12587. let subPathDepth = 0;
  12588. let c;
  12589. let key;
  12590. let newChar;
  12591. let type2;
  12592. let transition;
  12593. let action;
  12594. let typeMap;
  12595. const actions = [];
  12596. actions[
  12597. 0
  12598. /* APPEND */
  12599. ] = () => {
  12600. if (key === void 0) {
  12601. key = newChar;
  12602. } else {
  12603. key += newChar;
  12604. }
  12605. };
  12606. actions[
  12607. 1
  12608. /* PUSH */
  12609. ] = () => {
  12610. if (key !== void 0) {
  12611. keys.push(key);
  12612. key = void 0;
  12613. }
  12614. };
  12615. actions[
  12616. 2
  12617. /* INC_SUB_PATH_DEPTH */
  12618. ] = () => {
  12619. actions[
  12620. 0
  12621. /* APPEND */
  12622. ]();
  12623. subPathDepth++;
  12624. };
  12625. actions[
  12626. 3
  12627. /* PUSH_SUB_PATH */
  12628. ] = () => {
  12629. if (subPathDepth > 0) {
  12630. subPathDepth--;
  12631. mode = 4;
  12632. actions[
  12633. 0
  12634. /* APPEND */
  12635. ]();
  12636. } else {
  12637. subPathDepth = 0;
  12638. if (key === void 0) {
  12639. return false;
  12640. }
  12641. key = formatSubPath(key);
  12642. if (key === false) {
  12643. return false;
  12644. } else {
  12645. actions[
  12646. 1
  12647. /* PUSH */
  12648. ]();
  12649. }
  12650. }
  12651. };
  12652. function maybeUnescapeQuote() {
  12653. const nextChar = path[index2 + 1];
  12654. if (mode === 5 && nextChar === "'" || mode === 6 && nextChar === '"') {
  12655. index2++;
  12656. newChar = "\\" + nextChar;
  12657. actions[
  12658. 0
  12659. /* APPEND */
  12660. ]();
  12661. return true;
  12662. }
  12663. }
  12664. while (mode !== null) {
  12665. index2++;
  12666. c = path[index2];
  12667. if (c === "\\" && maybeUnescapeQuote()) {
  12668. continue;
  12669. }
  12670. type2 = getPathCharType(c);
  12671. typeMap = pathStateMachine[mode];
  12672. transition = typeMap[type2] || typeMap[
  12673. "l"
  12674. /* ELSE */
  12675. ] || 8;
  12676. if (transition === 8) {
  12677. return;
  12678. }
  12679. mode = transition[0];
  12680. if (transition[1] !== void 0) {
  12681. action = actions[transition[1]];
  12682. if (action) {
  12683. newChar = c;
  12684. if (action() === false) {
  12685. return;
  12686. }
  12687. }
  12688. }
  12689. if (mode === 7) {
  12690. return keys;
  12691. }
  12692. }
  12693. }
  12694. const cache = /* @__PURE__ */ new Map();
  12695. function resolveValue(obj, path) {
  12696. if (!isObject(obj)) {
  12697. return null;
  12698. }
  12699. let hit = cache.get(path);
  12700. if (!hit) {
  12701. hit = parse(path);
  12702. if (hit) {
  12703. cache.set(path, hit);
  12704. }
  12705. }
  12706. if (!hit) {
  12707. return null;
  12708. }
  12709. const len = hit.length;
  12710. let last = obj;
  12711. let i = 0;
  12712. while (i < len) {
  12713. const val = last[hit[i]];
  12714. if (val === void 0) {
  12715. return null;
  12716. }
  12717. last = val;
  12718. i++;
  12719. }
  12720. return last;
  12721. }
  12722. function handleFlatJson(obj) {
  12723. if (!isObject(obj)) {
  12724. return obj;
  12725. }
  12726. for (const key in obj) {
  12727. if (!hasOwn(obj, key)) {
  12728. continue;
  12729. }
  12730. if (!key.includes(
  12731. "."
  12732. /* DOT */
  12733. )) {
  12734. if (isObject(obj[key])) {
  12735. handleFlatJson(obj[key]);
  12736. }
  12737. } else {
  12738. const subKeys = key.split(
  12739. "."
  12740. /* DOT */
  12741. );
  12742. const lastIndex = subKeys.length - 1;
  12743. let currentObj = obj;
  12744. for (let i = 0; i < lastIndex; i++) {
  12745. if (!(subKeys[i] in currentObj)) {
  12746. currentObj[subKeys[i]] = {};
  12747. }
  12748. currentObj = currentObj[subKeys[i]];
  12749. }
  12750. currentObj[subKeys[lastIndex]] = obj[key];
  12751. delete obj[key];
  12752. if (isObject(currentObj[subKeys[lastIndex]])) {
  12753. handleFlatJson(currentObj[subKeys[lastIndex]]);
  12754. }
  12755. }
  12756. }
  12757. return obj;
  12758. }
  12759. /*!
  12760. * @intlify/runtime v9.1.9
  12761. * (c) 2021 kazuya kawaguchi
  12762. * Released under the MIT License.
  12763. */
  12764. const DEFAULT_MODIFIER = (str) => str;
  12765. const DEFAULT_MESSAGE = (ctx) => "";
  12766. const DEFAULT_MESSAGE_DATA_TYPE = "text";
  12767. const DEFAULT_NORMALIZE = (values) => values.length === 0 ? "" : values.join("");
  12768. const DEFAULT_INTERPOLATE = toDisplayString;
  12769. function pluralDefault(choice, choicesLength) {
  12770. choice = Math.abs(choice);
  12771. if (choicesLength === 2) {
  12772. return choice ? choice > 1 ? 1 : 0 : 1;
  12773. }
  12774. return choice ? Math.min(choice, 2) : 0;
  12775. }
  12776. function getPluralIndex(options) {
  12777. const index2 = isNumber(options.pluralIndex) ? options.pluralIndex : -1;
  12778. 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;
  12779. }
  12780. function normalizeNamed(pluralIndex, props2) {
  12781. if (!props2.count) {
  12782. props2.count = pluralIndex;
  12783. }
  12784. if (!props2.n) {
  12785. props2.n = pluralIndex;
  12786. }
  12787. }
  12788. function createMessageContext(options = {}) {
  12789. const locale = options.locale;
  12790. const pluralIndex = getPluralIndex(options);
  12791. const pluralRule = isObject$1(options.pluralRules) && isString(locale) && isFunction(options.pluralRules[locale]) ? options.pluralRules[locale] : pluralDefault;
  12792. const orgPluralRule = isObject$1(options.pluralRules) && isString(locale) && isFunction(options.pluralRules[locale]) ? pluralDefault : void 0;
  12793. const plural = (messages2) => messages2[pluralRule(pluralIndex, messages2.length, orgPluralRule)];
  12794. const _list = options.list || [];
  12795. const list = (index2) => _list[index2];
  12796. const _named = options.named || {};
  12797. isNumber(options.pluralIndex) && normalizeNamed(pluralIndex, _named);
  12798. const named = (key) => _named[key];
  12799. function message(key) {
  12800. const msg = isFunction(options.messages) ? options.messages(key) : isObject$1(options.messages) ? options.messages[key] : false;
  12801. return !msg ? options.parent ? options.parent.message(key) : DEFAULT_MESSAGE : msg;
  12802. }
  12803. const _modifier = (name) => options.modifiers ? options.modifiers[name] : DEFAULT_MODIFIER;
  12804. const normalize = isPlainObject(options.processor) && isFunction(options.processor.normalize) ? options.processor.normalize : DEFAULT_NORMALIZE;
  12805. const interpolate = isPlainObject(options.processor) && isFunction(options.processor.interpolate) ? options.processor.interpolate : DEFAULT_INTERPOLATE;
  12806. const type2 = isPlainObject(options.processor) && isString(options.processor.type) ? options.processor.type : DEFAULT_MESSAGE_DATA_TYPE;
  12807. const ctx = {
  12808. [
  12809. "list"
  12810. /* LIST */
  12811. ]: list,
  12812. [
  12813. "named"
  12814. /* NAMED */
  12815. ]: named,
  12816. [
  12817. "plural"
  12818. /* PLURAL */
  12819. ]: plural,
  12820. [
  12821. "linked"
  12822. /* LINKED */
  12823. ]: (key, modifier) => {
  12824. const msg = message(key)(ctx);
  12825. return isString(modifier) ? _modifier(modifier)(msg) : msg;
  12826. },
  12827. [
  12828. "message"
  12829. /* MESSAGE */
  12830. ]: message,
  12831. [
  12832. "type"
  12833. /* TYPE */
  12834. ]: type2,
  12835. [
  12836. "interpolate"
  12837. /* INTERPOLATE */
  12838. ]: interpolate,
  12839. [
  12840. "normalize"
  12841. /* NORMALIZE */
  12842. ]: normalize
  12843. };
  12844. return ctx;
  12845. }
  12846. /*!
  12847. * @intlify/message-compiler v9.1.9
  12848. * (c) 2021 kazuya kawaguchi
  12849. * Released under the MIT License.
  12850. */
  12851. const errorMessages$2 = {
  12852. // tokenizer error messages
  12853. [
  12854. 0
  12855. /* EXPECTED_TOKEN */
  12856. ]: `Expected token: '{0}'`,
  12857. [
  12858. 1
  12859. /* INVALID_TOKEN_IN_PLACEHOLDER */
  12860. ]: `Invalid token in placeholder: '{0}'`,
  12861. [
  12862. 2
  12863. /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */
  12864. ]: `Unterminated single quote in placeholder`,
  12865. [
  12866. 3
  12867. /* UNKNOWN_ESCAPE_SEQUENCE */
  12868. ]: `Unknown escape sequence: \\{0}`,
  12869. [
  12870. 4
  12871. /* INVALID_UNICODE_ESCAPE_SEQUENCE */
  12872. ]: `Invalid unicode escape sequence: {0}`,
  12873. [
  12874. 5
  12875. /* UNBALANCED_CLOSING_BRACE */
  12876. ]: `Unbalanced closing brace`,
  12877. [
  12878. 6
  12879. /* UNTERMINATED_CLOSING_BRACE */
  12880. ]: `Unterminated closing brace`,
  12881. [
  12882. 7
  12883. /* EMPTY_PLACEHOLDER */
  12884. ]: `Empty placeholder`,
  12885. [
  12886. 8
  12887. /* NOT_ALLOW_NEST_PLACEHOLDER */
  12888. ]: `Not allowed nest placeholder`,
  12889. [
  12890. 9
  12891. /* INVALID_LINKED_FORMAT */
  12892. ]: `Invalid linked format`,
  12893. // parser error messages
  12894. [
  12895. 10
  12896. /* MUST_HAVE_MESSAGES_IN_PLURAL */
  12897. ]: `Plural must have messages`,
  12898. [
  12899. 11
  12900. /* UNEXPECTED_EMPTY_LINKED_MODIFIER */
  12901. ]: `Unexpected empty linked modifier`,
  12902. [
  12903. 12
  12904. /* UNEXPECTED_EMPTY_LINKED_KEY */
  12905. ]: `Unexpected empty linked key`,
  12906. [
  12907. 13
  12908. /* UNEXPECTED_LEXICAL_ANALYSIS */
  12909. ]: `Unexpected lexical analysis in token: '{0}'`
  12910. };
  12911. function createCompileError(code2, loc, options = {}) {
  12912. const { domain, messages: messages2, args } = options;
  12913. const msg = format((messages2 || errorMessages$2)[code2] || "", ...args || []);
  12914. const error2 = new SyntaxError(String(msg));
  12915. error2.code = code2;
  12916. if (loc) {
  12917. error2.location = loc;
  12918. }
  12919. error2.domain = domain;
  12920. return error2;
  12921. }
  12922. /*!
  12923. * @intlify/devtools-if v9.1.9
  12924. * (c) 2021 kazuya kawaguchi
  12925. * Released under the MIT License.
  12926. */
  12927. const IntlifyDevToolsHooks = {
  12928. I18nInit: "i18n:init",
  12929. FunctionTranslate: "function:translate"
  12930. };
  12931. /*!
  12932. * @intlify/core-base v9.1.9
  12933. * (c) 2021 kazuya kawaguchi
  12934. * Released under the MIT License.
  12935. */
  12936. let devtools = null;
  12937. function setDevToolsHook(hook) {
  12938. devtools = hook;
  12939. }
  12940. function initI18nDevTools(i18n2, version, meta) {
  12941. devtools && devtools.emit(IntlifyDevToolsHooks.I18nInit, {
  12942. timestamp: Date.now(),
  12943. i18n: i18n2,
  12944. version,
  12945. meta
  12946. });
  12947. }
  12948. const translateDevTools = /* @__PURE__ */ createDevToolsHook(IntlifyDevToolsHooks.FunctionTranslate);
  12949. function createDevToolsHook(hook) {
  12950. return (payloads) => devtools && devtools.emit(hook, payloads);
  12951. }
  12952. const warnMessages$1 = {
  12953. [
  12954. 0
  12955. /* NOT_FOUND_KEY */
  12956. ]: `Not found '{key}' key in '{locale}' locale messages.`,
  12957. [
  12958. 1
  12959. /* FALLBACK_TO_TRANSLATE */
  12960. ]: `Fall back to translate '{key}' key with '{target}' locale.`,
  12961. [
  12962. 2
  12963. /* CANNOT_FORMAT_NUMBER */
  12964. ]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
  12965. [
  12966. 3
  12967. /* FALLBACK_TO_NUMBER_FORMAT */
  12968. ]: `Fall back to number format '{key}' key with '{target}' locale.`,
  12969. [
  12970. 4
  12971. /* CANNOT_FORMAT_DATE */
  12972. ]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
  12973. [
  12974. 5
  12975. /* FALLBACK_TO_DATE_FORMAT */
  12976. ]: `Fall back to datetime format '{key}' key with '{target}' locale.`
  12977. };
  12978. function getWarnMessage$1(code2, ...args) {
  12979. return format(warnMessages$1[code2], ...args);
  12980. }
  12981. const VERSION$1 = "9.1.9";
  12982. const NOT_REOSLVED = -1;
  12983. const MISSING_RESOLVE_VALUE = "";
  12984. function getDefaultLinkedModifiers() {
  12985. return {
  12986. upper: (val) => isString(val) ? val.toUpperCase() : val,
  12987. lower: (val) => isString(val) ? val.toLowerCase() : val,
  12988. // prettier-ignore
  12989. capitalize: (val) => isString(val) ? `${val.charAt(0).toLocaleUpperCase()}${val.substr(1)}` : val
  12990. };
  12991. }
  12992. let _compiler;
  12993. let _additionalMeta = null;
  12994. const setAdditionalMeta = (meta) => {
  12995. _additionalMeta = meta;
  12996. };
  12997. const getAdditionalMeta = () => _additionalMeta;
  12998. let _cid = 0;
  12999. function createCoreContext(options = {}) {
  13000. const version = isString(options.version) ? options.version : VERSION$1;
  13001. const locale = isString(options.locale) ? options.locale : "en-US";
  13002. const fallbackLocale = isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || isString(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale;
  13003. const messages2 = isPlainObject(options.messages) ? options.messages : { [locale]: {} };
  13004. const datetimeFormats = isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [locale]: {} };
  13005. const numberFormats = isPlainObject(options.numberFormats) ? options.numberFormats : { [locale]: {} };
  13006. const modifiers = assign({}, options.modifiers || {}, getDefaultLinkedModifiers());
  13007. const pluralRules = options.pluralRules || {};
  13008. const missing = isFunction(options.missing) ? options.missing : null;
  13009. const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
  13010. const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
  13011. const fallbackFormat = !!options.fallbackFormat;
  13012. const unresolving = !!options.unresolving;
  13013. const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
  13014. const processor = isPlainObject(options.processor) ? options.processor : null;
  13015. const warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
  13016. const escapeParameter = !!options.escapeParameter;
  13017. const messageCompiler = isFunction(options.messageCompiler) ? options.messageCompiler : _compiler;
  13018. const onWarn = isFunction(options.onWarn) ? options.onWarn : warn;
  13019. const internalOptions = options;
  13020. const __datetimeFormatters = isObject$1(internalOptions.__datetimeFormatters) ? internalOptions.__datetimeFormatters : /* @__PURE__ */ new Map();
  13021. const __numberFormatters = isObject$1(internalOptions.__numberFormatters) ? internalOptions.__numberFormatters : /* @__PURE__ */ new Map();
  13022. const __meta = isObject$1(internalOptions.__meta) ? internalOptions.__meta : {};
  13023. _cid++;
  13024. const context = {
  13025. version,
  13026. cid: _cid,
  13027. locale,
  13028. fallbackLocale,
  13029. messages: messages2,
  13030. datetimeFormats,
  13031. numberFormats,
  13032. modifiers,
  13033. pluralRules,
  13034. missing,
  13035. missingWarn,
  13036. fallbackWarn,
  13037. fallbackFormat,
  13038. unresolving,
  13039. postTranslation,
  13040. processor,
  13041. warnHtmlMessage,
  13042. escapeParameter,
  13043. messageCompiler,
  13044. onWarn,
  13045. __datetimeFormatters,
  13046. __numberFormatters,
  13047. __meta
  13048. };
  13049. {
  13050. context.__v_emitter = internalOptions.__v_emitter != null ? internalOptions.__v_emitter : void 0;
  13051. }
  13052. {
  13053. initI18nDevTools(context, version, __meta);
  13054. }
  13055. return context;
  13056. }
  13057. function isTranslateFallbackWarn(fallback, key) {
  13058. return fallback instanceof RegExp ? fallback.test(key) : fallback;
  13059. }
  13060. function isTranslateMissingWarn(missing, key) {
  13061. return missing instanceof RegExp ? missing.test(key) : missing;
  13062. }
  13063. function handleMissing(context, key, locale, missingWarn, type2) {
  13064. const { missing, onWarn } = context;
  13065. {
  13066. const emitter = context.__v_emitter;
  13067. if (emitter) {
  13068. emitter.emit("missing", {
  13069. locale,
  13070. key,
  13071. type: type2,
  13072. groupId: `${type2}:${key}`
  13073. });
  13074. }
  13075. }
  13076. if (missing !== null) {
  13077. const ret = missing(context, locale, key, type2);
  13078. return isString(ret) ? ret : key;
  13079. } else {
  13080. if (isTranslateMissingWarn(missingWarn, key)) {
  13081. onWarn(getWarnMessage$1(0, { key, locale }));
  13082. }
  13083. return key;
  13084. }
  13085. }
  13086. function getLocaleChain(ctx, fallback, start) {
  13087. const context = ctx;
  13088. if (!context.__localeChainCache) {
  13089. context.__localeChainCache = /* @__PURE__ */ new Map();
  13090. }
  13091. let chain = context.__localeChainCache.get(start);
  13092. if (!chain) {
  13093. chain = [];
  13094. let block = [start];
  13095. while (isArray(block)) {
  13096. block = appendBlockToChain(chain, block, fallback);
  13097. }
  13098. const defaults = isArray(fallback) ? fallback : isPlainObject(fallback) ? fallback["default"] ? fallback["default"] : null : fallback;
  13099. block = isString(defaults) ? [defaults] : defaults;
  13100. if (isArray(block)) {
  13101. appendBlockToChain(chain, block, false);
  13102. }
  13103. context.__localeChainCache.set(start, chain);
  13104. }
  13105. return chain;
  13106. }
  13107. function appendBlockToChain(chain, block, blocks) {
  13108. let follow = true;
  13109. for (let i = 0; i < block.length && isBoolean(follow); i++) {
  13110. const locale = block[i];
  13111. if (isString(locale)) {
  13112. follow = appendLocaleToChain(chain, block[i], blocks);
  13113. }
  13114. }
  13115. return follow;
  13116. }
  13117. function appendLocaleToChain(chain, locale, blocks) {
  13118. let follow;
  13119. const tokens = locale.split("-");
  13120. do {
  13121. const target = tokens.join("-");
  13122. follow = appendItemToChain(chain, target, blocks);
  13123. tokens.splice(-1, 1);
  13124. } while (tokens.length && follow === true);
  13125. return follow;
  13126. }
  13127. function appendItemToChain(chain, target, blocks) {
  13128. let follow = false;
  13129. if (!chain.includes(target)) {
  13130. follow = true;
  13131. if (target) {
  13132. follow = target[target.length - 1] !== "!";
  13133. const locale = target.replace(/!/g, "");
  13134. chain.push(locale);
  13135. if ((isArray(blocks) || isPlainObject(blocks)) && blocks[locale]) {
  13136. follow = blocks[locale];
  13137. }
  13138. }
  13139. }
  13140. return follow;
  13141. }
  13142. function updateFallbackLocale(ctx, locale, fallback) {
  13143. const context = ctx;
  13144. context.__localeChainCache = /* @__PURE__ */ new Map();
  13145. getLocaleChain(ctx, fallback, locale);
  13146. }
  13147. function createCoreError(code2) {
  13148. return createCompileError(code2, null, { messages: errorMessages$1 });
  13149. }
  13150. const errorMessages$1 = {
  13151. [
  13152. 14
  13153. /* INVALID_ARGUMENT */
  13154. ]: "Invalid arguments",
  13155. [
  13156. 15
  13157. /* INVALID_DATE_ARGUMENT */
  13158. ]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
  13159. [
  13160. 16
  13161. /* INVALID_ISO_DATE_ARGUMENT */
  13162. ]: "The argument provided is not a valid ISO date string"
  13163. };
  13164. const NOOP_MESSAGE_FUNCTION = () => "";
  13165. const isMessageFunction = (val) => isFunction(val);
  13166. function translate(context, ...args) {
  13167. const { fallbackFormat, postTranslation, unresolving, fallbackLocale, messages: messages2 } = context;
  13168. const [key, options] = parseTranslateArgs(...args);
  13169. const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
  13170. const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
  13171. const escapeParameter = isBoolean(options.escapeParameter) ? options.escapeParameter : context.escapeParameter;
  13172. const resolvedMessage = !!options.resolvedMessage;
  13173. const defaultMsgOrKey = isString(options.default) || isBoolean(options.default) ? !isBoolean(options.default) ? options.default : key : fallbackFormat ? key : "";
  13174. const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== "";
  13175. const locale = isString(options.locale) ? options.locale : context.locale;
  13176. escapeParameter && escapeParams(options);
  13177. let [format2, targetLocale, message] = !resolvedMessage ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) : [
  13178. key,
  13179. locale,
  13180. messages2[locale] || {}
  13181. ];
  13182. let cacheBaseKey = key;
  13183. if (!resolvedMessage && !(isString(format2) || isMessageFunction(format2))) {
  13184. if (enableDefaultMsg) {
  13185. format2 = defaultMsgOrKey;
  13186. cacheBaseKey = format2;
  13187. }
  13188. }
  13189. if (!resolvedMessage && (!(isString(format2) || isMessageFunction(format2)) || !isString(targetLocale))) {
  13190. return unresolving ? NOT_REOSLVED : key;
  13191. }
  13192. if (isString(format2) && context.messageCompiler == null) {
  13193. 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}'.`);
  13194. return key;
  13195. }
  13196. let occurred = false;
  13197. const errorDetector = () => {
  13198. occurred = true;
  13199. };
  13200. const msg = !isMessageFunction(format2) ? compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, errorDetector) : format2;
  13201. if (occurred) {
  13202. return format2;
  13203. }
  13204. const ctxOptions = getMessageContextOptions(context, targetLocale, message, options);
  13205. const msgContext = createMessageContext(ctxOptions);
  13206. const messaged = evaluateMessage(context, msg, msgContext);
  13207. const ret = postTranslation ? postTranslation(messaged) : messaged;
  13208. {
  13209. const payloads = {
  13210. timestamp: Date.now(),
  13211. key: isString(key) ? key : isMessageFunction(format2) ? format2.key : "",
  13212. locale: targetLocale || (isMessageFunction(format2) ? format2.locale : ""),
  13213. format: isString(format2) ? format2 : isMessageFunction(format2) ? format2.source : "",
  13214. message: ret
  13215. };
  13216. payloads.meta = assign({}, context.__meta, getAdditionalMeta() || {});
  13217. translateDevTools(payloads);
  13218. }
  13219. return ret;
  13220. }
  13221. function escapeParams(options) {
  13222. if (isArray(options.list)) {
  13223. options.list = options.list.map((item) => isString(item) ? escapeHtml(item) : item);
  13224. } else if (isObject$1(options.named)) {
  13225. Object.keys(options.named).forEach((key) => {
  13226. if (isString(options.named[key])) {
  13227. options.named[key] = escapeHtml(options.named[key]);
  13228. }
  13229. });
  13230. }
  13231. }
  13232. function resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {
  13233. const { messages: messages2, onWarn } = context;
  13234. const locales = getLocaleChain(context, fallbackLocale, locale);
  13235. let message = {};
  13236. let targetLocale;
  13237. let format2 = null;
  13238. let from = locale;
  13239. let to = null;
  13240. const type2 = "translate";
  13241. for (let i = 0; i < locales.length; i++) {
  13242. targetLocale = to = locales[i];
  13243. if (locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
  13244. onWarn(getWarnMessage$1(1, {
  13245. key,
  13246. target: targetLocale
  13247. }));
  13248. }
  13249. if (locale !== targetLocale) {
  13250. const emitter = context.__v_emitter;
  13251. if (emitter) {
  13252. emitter.emit("fallback", {
  13253. type: type2,
  13254. key,
  13255. from,
  13256. to,
  13257. groupId: `${type2}:${key}`
  13258. });
  13259. }
  13260. }
  13261. message = messages2[targetLocale] || {};
  13262. let start = null;
  13263. let startTag;
  13264. let endTag;
  13265. if (inBrowser) {
  13266. start = window.performance.now();
  13267. startTag = "intlify-message-resolve-start";
  13268. endTag = "intlify-message-resolve-end";
  13269. mark && mark(startTag);
  13270. }
  13271. if ((format2 = resolveValue(message, key)) === null) {
  13272. format2 = message[key];
  13273. }
  13274. if (inBrowser) {
  13275. const end = window.performance.now();
  13276. const emitter = context.__v_emitter;
  13277. if (emitter && start && format2) {
  13278. emitter.emit("message-resolve", {
  13279. type: "message-resolve",
  13280. key,
  13281. message: format2,
  13282. time: end - start,
  13283. groupId: `${type2}:${key}`
  13284. });
  13285. }
  13286. if (startTag && endTag && mark && measure) {
  13287. mark(endTag);
  13288. measure("intlify message resolve", startTag, endTag);
  13289. }
  13290. }
  13291. if (isString(format2) || isFunction(format2))
  13292. break;
  13293. const missingRet = handleMissing(context, key, targetLocale, missingWarn, type2);
  13294. if (missingRet !== key) {
  13295. format2 = missingRet;
  13296. }
  13297. from = to;
  13298. }
  13299. return [format2, targetLocale, message];
  13300. }
  13301. function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, errorDetector) {
  13302. const { messageCompiler, warnHtmlMessage } = context;
  13303. if (isMessageFunction(format2)) {
  13304. const msg2 = format2;
  13305. msg2.locale = msg2.locale || targetLocale;
  13306. msg2.key = msg2.key || key;
  13307. return msg2;
  13308. }
  13309. let start = null;
  13310. let startTag;
  13311. let endTag;
  13312. if (inBrowser) {
  13313. start = window.performance.now();
  13314. startTag = "intlify-message-compilation-start";
  13315. endTag = "intlify-message-compilation-end";
  13316. mark && mark(startTag);
  13317. }
  13318. const msg = messageCompiler(format2, getCompileOptions(context, targetLocale, cacheBaseKey, format2, warnHtmlMessage, errorDetector));
  13319. if (inBrowser) {
  13320. const end = window.performance.now();
  13321. const emitter = context.__v_emitter;
  13322. if (emitter && start) {
  13323. emitter.emit("message-compilation", {
  13324. type: "message-compilation",
  13325. message: format2,
  13326. time: end - start,
  13327. groupId: `${"translate"}:${key}`
  13328. });
  13329. }
  13330. if (startTag && endTag && mark && measure) {
  13331. mark(endTag);
  13332. measure("intlify message compilation", startTag, endTag);
  13333. }
  13334. }
  13335. msg.locale = targetLocale;
  13336. msg.key = key;
  13337. msg.source = format2;
  13338. return msg;
  13339. }
  13340. function evaluateMessage(context, msg, msgCtx) {
  13341. let start = null;
  13342. let startTag;
  13343. let endTag;
  13344. if (inBrowser) {
  13345. start = window.performance.now();
  13346. startTag = "intlify-message-evaluation-start";
  13347. endTag = "intlify-message-evaluation-end";
  13348. mark && mark(startTag);
  13349. }
  13350. const messaged = msg(msgCtx);
  13351. if (inBrowser) {
  13352. const end = window.performance.now();
  13353. const emitter = context.__v_emitter;
  13354. if (emitter && start) {
  13355. emitter.emit("message-evaluation", {
  13356. type: "message-evaluation",
  13357. value: messaged,
  13358. time: end - start,
  13359. groupId: `${"translate"}:${msg.key}`
  13360. });
  13361. }
  13362. if (startTag && endTag && mark && measure) {
  13363. mark(endTag);
  13364. measure("intlify message evaluation", startTag, endTag);
  13365. }
  13366. }
  13367. return messaged;
  13368. }
  13369. function parseTranslateArgs(...args) {
  13370. const [arg1, arg2, arg3] = args;
  13371. const options = {};
  13372. if (!isString(arg1) && !isNumber(arg1) && !isMessageFunction(arg1)) {
  13373. throw createCoreError(
  13374. 14
  13375. /* INVALID_ARGUMENT */
  13376. );
  13377. }
  13378. const key = isNumber(arg1) ? String(arg1) : isMessageFunction(arg1) ? arg1 : arg1;
  13379. if (isNumber(arg2)) {
  13380. options.plural = arg2;
  13381. } else if (isString(arg2)) {
  13382. options.default = arg2;
  13383. } else if (isPlainObject(arg2) && !isEmptyObject(arg2)) {
  13384. options.named = arg2;
  13385. } else if (isArray(arg2)) {
  13386. options.list = arg2;
  13387. }
  13388. if (isNumber(arg3)) {
  13389. options.plural = arg3;
  13390. } else if (isString(arg3)) {
  13391. options.default = arg3;
  13392. } else if (isPlainObject(arg3)) {
  13393. assign(options, arg3);
  13394. }
  13395. return [key, options];
  13396. }
  13397. function getCompileOptions(context, locale, key, source, warnHtmlMessage, errorDetector) {
  13398. return {
  13399. warnHtmlMessage,
  13400. onError: (err) => {
  13401. errorDetector && errorDetector(err);
  13402. {
  13403. const message = `Message compilation error: ${err.message}`;
  13404. const codeFrame = err.location && generateCodeFrame(source, err.location.start.offset, err.location.end.offset);
  13405. const emitter = context.__v_emitter;
  13406. if (emitter) {
  13407. emitter.emit("compile-error", {
  13408. message: source,
  13409. error: err.message,
  13410. start: err.location && err.location.start.offset,
  13411. end: err.location && err.location.end.offset,
  13412. groupId: `${"translate"}:${key}`
  13413. });
  13414. }
  13415. console.error(codeFrame ? `${message}
  13416. ${codeFrame}` : message);
  13417. }
  13418. },
  13419. onCacheKey: (source2) => generateFormatCacheKey(locale, key, source2)
  13420. };
  13421. }
  13422. function getMessageContextOptions(context, locale, message, options) {
  13423. const { modifiers, pluralRules } = context;
  13424. const resolveMessage = (key) => {
  13425. const val = resolveValue(message, key);
  13426. if (isString(val)) {
  13427. let occurred = false;
  13428. const errorDetector = () => {
  13429. occurred = true;
  13430. };
  13431. const msg = compileMessageFormat(context, key, locale, val, key, errorDetector);
  13432. return !occurred ? msg : NOOP_MESSAGE_FUNCTION;
  13433. } else if (isMessageFunction(val)) {
  13434. return val;
  13435. } else {
  13436. return NOOP_MESSAGE_FUNCTION;
  13437. }
  13438. };
  13439. const ctxOptions = {
  13440. locale,
  13441. modifiers,
  13442. pluralRules,
  13443. messages: resolveMessage
  13444. };
  13445. if (context.processor) {
  13446. ctxOptions.processor = context.processor;
  13447. }
  13448. if (options.list) {
  13449. ctxOptions.list = options.list;
  13450. }
  13451. if (options.named) {
  13452. ctxOptions.named = options.named;
  13453. }
  13454. if (isNumber(options.plural)) {
  13455. ctxOptions.pluralIndex = options.plural;
  13456. }
  13457. return ctxOptions;
  13458. }
  13459. const intlDefined = typeof Intl !== "undefined";
  13460. const Availabilities = {
  13461. dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== "undefined",
  13462. numberFormat: intlDefined && typeof Intl.NumberFormat !== "undefined"
  13463. };
  13464. function datetime(context, ...args) {
  13465. const { datetimeFormats, unresolving, fallbackLocale, onWarn } = context;
  13466. const { __datetimeFormatters } = context;
  13467. if (!Availabilities.dateTimeFormat) {
  13468. onWarn(getWarnMessage$1(
  13469. 4
  13470. /* CANNOT_FORMAT_DATE */
  13471. ));
  13472. return MISSING_RESOLVE_VALUE;
  13473. }
  13474. const [key, value2, options, overrides] = parseDateTimeArgs(...args);
  13475. const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
  13476. const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
  13477. const part = !!options.part;
  13478. const locale = isString(options.locale) ? options.locale : context.locale;
  13479. const locales = getLocaleChain(context, fallbackLocale, locale);
  13480. if (!isString(key) || key === "") {
  13481. return new Intl.DateTimeFormat(locale).format(value2);
  13482. }
  13483. let datetimeFormat = {};
  13484. let targetLocale;
  13485. let format2 = null;
  13486. let from = locale;
  13487. let to = null;
  13488. const type2 = "datetime format";
  13489. for (let i = 0; i < locales.length; i++) {
  13490. targetLocale = to = locales[i];
  13491. if (locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
  13492. onWarn(getWarnMessage$1(5, {
  13493. key,
  13494. target: targetLocale
  13495. }));
  13496. }
  13497. if (locale !== targetLocale) {
  13498. const emitter = context.__v_emitter;
  13499. if (emitter) {
  13500. emitter.emit("fallback", {
  13501. type: type2,
  13502. key,
  13503. from,
  13504. to,
  13505. groupId: `${type2}:${key}`
  13506. });
  13507. }
  13508. }
  13509. datetimeFormat = datetimeFormats[targetLocale] || {};
  13510. format2 = datetimeFormat[key];
  13511. if (isPlainObject(format2))
  13512. break;
  13513. handleMissing(context, key, targetLocale, missingWarn, type2);
  13514. from = to;
  13515. }
  13516. if (!isPlainObject(format2) || !isString(targetLocale)) {
  13517. return unresolving ? NOT_REOSLVED : key;
  13518. }
  13519. let id = `${targetLocale}__${key}`;
  13520. if (!isEmptyObject(overrides)) {
  13521. id = `${id}__${JSON.stringify(overrides)}`;
  13522. }
  13523. let formatter = __datetimeFormatters.get(id);
  13524. if (!formatter) {
  13525. formatter = new Intl.DateTimeFormat(targetLocale, assign({}, format2, overrides));
  13526. __datetimeFormatters.set(id, formatter);
  13527. }
  13528. return !part ? formatter.format(value2) : formatter.formatToParts(value2);
  13529. }
  13530. function parseDateTimeArgs(...args) {
  13531. const [arg1, arg2, arg3, arg4] = args;
  13532. let options = {};
  13533. let overrides = {};
  13534. let value2;
  13535. if (isString(arg1)) {
  13536. if (!/\d{4}-\d{2}-\d{2}(T.*)?/.test(arg1)) {
  13537. throw createCoreError(
  13538. 16
  13539. /* INVALID_ISO_DATE_ARGUMENT */
  13540. );
  13541. }
  13542. value2 = new Date(arg1);
  13543. try {
  13544. value2.toISOString();
  13545. } catch (e) {
  13546. throw createCoreError(
  13547. 16
  13548. /* INVALID_ISO_DATE_ARGUMENT */
  13549. );
  13550. }
  13551. } else if (isDate(arg1)) {
  13552. if (isNaN(arg1.getTime())) {
  13553. throw createCoreError(
  13554. 15
  13555. /* INVALID_DATE_ARGUMENT */
  13556. );
  13557. }
  13558. value2 = arg1;
  13559. } else if (isNumber(arg1)) {
  13560. value2 = arg1;
  13561. } else {
  13562. throw createCoreError(
  13563. 14
  13564. /* INVALID_ARGUMENT */
  13565. );
  13566. }
  13567. if (isString(arg2)) {
  13568. options.key = arg2;
  13569. } else if (isPlainObject(arg2)) {
  13570. options = arg2;
  13571. }
  13572. if (isString(arg3)) {
  13573. options.locale = arg3;
  13574. } else if (isPlainObject(arg3)) {
  13575. overrides = arg3;
  13576. }
  13577. if (isPlainObject(arg4)) {
  13578. overrides = arg4;
  13579. }
  13580. return [options.key || "", value2, options, overrides];
  13581. }
  13582. function clearDateTimeFormat(ctx, locale, format2) {
  13583. const context = ctx;
  13584. for (const key in format2) {
  13585. const id = `${locale}__${key}`;
  13586. if (!context.__datetimeFormatters.has(id)) {
  13587. continue;
  13588. }
  13589. context.__datetimeFormatters.delete(id);
  13590. }
  13591. }
  13592. function number(context, ...args) {
  13593. const { numberFormats, unresolving, fallbackLocale, onWarn } = context;
  13594. const { __numberFormatters } = context;
  13595. if (!Availabilities.numberFormat) {
  13596. onWarn(getWarnMessage$1(
  13597. 2
  13598. /* CANNOT_FORMAT_NUMBER */
  13599. ));
  13600. return MISSING_RESOLVE_VALUE;
  13601. }
  13602. const [key, value2, options, overrides] = parseNumberArgs(...args);
  13603. const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
  13604. const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
  13605. const part = !!options.part;
  13606. const locale = isString(options.locale) ? options.locale : context.locale;
  13607. const locales = getLocaleChain(context, fallbackLocale, locale);
  13608. if (!isString(key) || key === "") {
  13609. return new Intl.NumberFormat(locale).format(value2);
  13610. }
  13611. let numberFormat = {};
  13612. let targetLocale;
  13613. let format2 = null;
  13614. let from = locale;
  13615. let to = null;
  13616. const type2 = "number format";
  13617. for (let i = 0; i < locales.length; i++) {
  13618. targetLocale = to = locales[i];
  13619. if (locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) {
  13620. onWarn(getWarnMessage$1(3, {
  13621. key,
  13622. target: targetLocale
  13623. }));
  13624. }
  13625. if (locale !== targetLocale) {
  13626. const emitter = context.__v_emitter;
  13627. if (emitter) {
  13628. emitter.emit("fallback", {
  13629. type: type2,
  13630. key,
  13631. from,
  13632. to,
  13633. groupId: `${type2}:${key}`
  13634. });
  13635. }
  13636. }
  13637. numberFormat = numberFormats[targetLocale] || {};
  13638. format2 = numberFormat[key];
  13639. if (isPlainObject(format2))
  13640. break;
  13641. handleMissing(context, key, targetLocale, missingWarn, type2);
  13642. from = to;
  13643. }
  13644. if (!isPlainObject(format2) || !isString(targetLocale)) {
  13645. return unresolving ? NOT_REOSLVED : key;
  13646. }
  13647. let id = `${targetLocale}__${key}`;
  13648. if (!isEmptyObject(overrides)) {
  13649. id = `${id}__${JSON.stringify(overrides)}`;
  13650. }
  13651. let formatter = __numberFormatters.get(id);
  13652. if (!formatter) {
  13653. formatter = new Intl.NumberFormat(targetLocale, assign({}, format2, overrides));
  13654. __numberFormatters.set(id, formatter);
  13655. }
  13656. return !part ? formatter.format(value2) : formatter.formatToParts(value2);
  13657. }
  13658. function parseNumberArgs(...args) {
  13659. const [arg1, arg2, arg3, arg4] = args;
  13660. let options = {};
  13661. let overrides = {};
  13662. if (!isNumber(arg1)) {
  13663. throw createCoreError(
  13664. 14
  13665. /* INVALID_ARGUMENT */
  13666. );
  13667. }
  13668. const value2 = arg1;
  13669. if (isString(arg2)) {
  13670. options.key = arg2;
  13671. } else if (isPlainObject(arg2)) {
  13672. options = arg2;
  13673. }
  13674. if (isString(arg3)) {
  13675. options.locale = arg3;
  13676. } else if (isPlainObject(arg3)) {
  13677. overrides = arg3;
  13678. }
  13679. if (isPlainObject(arg4)) {
  13680. overrides = arg4;
  13681. }
  13682. return [options.key || "", value2, options, overrides];
  13683. }
  13684. function clearNumberFormat(ctx, locale, format2) {
  13685. const context = ctx;
  13686. for (const key in format2) {
  13687. const id = `${locale}__${key}`;
  13688. if (!context.__numberFormatters.has(id)) {
  13689. continue;
  13690. }
  13691. context.__numberFormatters.delete(id);
  13692. }
  13693. }
  13694. function getDevtoolsGlobalHook() {
  13695. return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
  13696. }
  13697. function getTarget() {
  13698. return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
  13699. }
  13700. const isProxyAvailable = typeof Proxy === "function";
  13701. const HOOK_SETUP = "devtools-plugin:setup";
  13702. const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
  13703. class ApiProxy {
  13704. constructor(plugin, hook) {
  13705. this.target = null;
  13706. this.targetQueue = [];
  13707. this.onQueue = [];
  13708. this.plugin = plugin;
  13709. this.hook = hook;
  13710. const defaultSettings = {};
  13711. if (plugin.settings) {
  13712. for (const id in plugin.settings) {
  13713. const item = plugin.settings[id];
  13714. defaultSettings[id] = item.defaultValue;
  13715. }
  13716. }
  13717. const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
  13718. let currentSettings = { ...defaultSettings };
  13719. try {
  13720. const raw = localStorage.getItem(localSettingsSaveId);
  13721. const data = JSON.parse(raw);
  13722. Object.assign(currentSettings, data);
  13723. } catch (e) {
  13724. }
  13725. this.fallbacks = {
  13726. getSettings() {
  13727. return currentSettings;
  13728. },
  13729. setSettings(value2) {
  13730. try {
  13731. localStorage.setItem(localSettingsSaveId, JSON.stringify(value2));
  13732. } catch (e) {
  13733. }
  13734. currentSettings = value2;
  13735. }
  13736. };
  13737. hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value2) => {
  13738. if (pluginId === this.plugin.id) {
  13739. this.fallbacks.setSettings(value2);
  13740. }
  13741. });
  13742. this.proxiedOn = new Proxy({}, {
  13743. get: (_target, prop) => {
  13744. if (this.target) {
  13745. return this.target.on[prop];
  13746. } else {
  13747. return (...args) => {
  13748. this.onQueue.push({
  13749. method: prop,
  13750. args
  13751. });
  13752. };
  13753. }
  13754. }
  13755. });
  13756. this.proxiedTarget = new Proxy({}, {
  13757. get: (_target, prop) => {
  13758. if (this.target) {
  13759. return this.target[prop];
  13760. } else if (prop === "on") {
  13761. return this.proxiedOn;
  13762. } else if (Object.keys(this.fallbacks).includes(prop)) {
  13763. return (...args) => {
  13764. this.targetQueue.push({
  13765. method: prop,
  13766. args,
  13767. resolve: () => {
  13768. }
  13769. });
  13770. return this.fallbacks[prop](...args);
  13771. };
  13772. } else {
  13773. return (...args) => {
  13774. return new Promise((resolve) => {
  13775. this.targetQueue.push({
  13776. method: prop,
  13777. args,
  13778. resolve
  13779. });
  13780. });
  13781. };
  13782. }
  13783. }
  13784. });
  13785. }
  13786. async setRealTarget(target) {
  13787. this.target = target;
  13788. for (const item of this.onQueue) {
  13789. this.target.on[item.method](...item.args);
  13790. }
  13791. for (const item of this.targetQueue) {
  13792. item.resolve(await this.target[item.method](...item.args));
  13793. }
  13794. }
  13795. }
  13796. function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
  13797. const target = getTarget();
  13798. const hook = getDevtoolsGlobalHook();
  13799. const enableProxy = isProxyAvailable && pluginDescriptor.enableEarlyProxy;
  13800. if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
  13801. hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
  13802. } else {
  13803. const proxy = enableProxy ? new ApiProxy(pluginDescriptor, hook) : null;
  13804. const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
  13805. list.push({
  13806. pluginDescriptor,
  13807. setupFn,
  13808. proxy
  13809. });
  13810. if (proxy)
  13811. setupFn(proxy.proxiedTarget);
  13812. }
  13813. }
  13814. /*!
  13815. * @intlify/vue-devtools v9.1.9
  13816. * (c) 2021 kazuya kawaguchi
  13817. * Released under the MIT License.
  13818. */
  13819. const VueDevToolsLabels = {
  13820. [
  13821. "vue-devtools-plugin-vue-i18n"
  13822. /* PLUGIN */
  13823. ]: "Vue I18n devtools",
  13824. [
  13825. "vue-i18n-resource-inspector"
  13826. /* CUSTOM_INSPECTOR */
  13827. ]: "I18n Resources",
  13828. [
  13829. "vue-i18n-timeline"
  13830. /* TIMELINE */
  13831. ]: "Vue I18n"
  13832. };
  13833. const VueDevToolsPlaceholders = {
  13834. [
  13835. "vue-i18n-resource-inspector"
  13836. /* CUSTOM_INSPECTOR */
  13837. ]: "Search for scopes ..."
  13838. };
  13839. const VueDevToolsTimelineColors = {
  13840. [
  13841. "vue-i18n-timeline"
  13842. /* TIMELINE */
  13843. ]: 16764185
  13844. };
  13845. /*!
  13846. * vue-i18n v9.1.9
  13847. * (c) 2022 kazuya kawaguchi
  13848. * Released under the MIT License.
  13849. */
  13850. const VERSION = "9.1.9";
  13851. function initFeatureFlags() {
  13852. let needWarn = false;
  13853. {
  13854. needWarn = true;
  13855. }
  13856. if (needWarn) {
  13857. 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.`);
  13858. }
  13859. }
  13860. const warnMessages = {
  13861. [
  13862. 6
  13863. /* FALLBACK_TO_ROOT */
  13864. ]: `Fall back to {type} '{key}' with root locale.`,
  13865. [
  13866. 7
  13867. /* NOT_SUPPORTED_PRESERVE */
  13868. ]: `Not supported 'preserve'.`,
  13869. [
  13870. 8
  13871. /* NOT_SUPPORTED_FORMATTER */
  13872. ]: `Not supported 'formatter'.`,
  13873. [
  13874. 9
  13875. /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
  13876. ]: `Not supported 'preserveDirectiveContent'.`,
  13877. [
  13878. 10
  13879. /* NOT_SUPPORTED_GET_CHOICE_INDEX */
  13880. ]: `Not supported 'getChoiceIndex'.`,
  13881. [
  13882. 11
  13883. /* COMPONENT_NAME_LEGACY_COMPATIBLE */
  13884. ]: `Component name legacy compatible: '{name}' -> 'i18n'`,
  13885. [
  13886. 12
  13887. /* NOT_FOUND_PARENT_SCOPE */
  13888. ]: `Not found parent scope. use the global scope.`
  13889. };
  13890. function getWarnMessage(code2, ...args) {
  13891. return format(warnMessages[code2], ...args);
  13892. }
  13893. function createI18nError(code2, ...args) {
  13894. return createCompileError(code2, null, { messages: errorMessages, args });
  13895. }
  13896. const errorMessages = {
  13897. [
  13898. 14
  13899. /* UNEXPECTED_RETURN_TYPE */
  13900. ]: "Unexpected return type in composer",
  13901. [
  13902. 15
  13903. /* INVALID_ARGUMENT */
  13904. ]: "Invalid argument",
  13905. [
  13906. 16
  13907. /* MUST_BE_CALL_SETUP_TOP */
  13908. ]: "Must be called at the top of a `setup` function",
  13909. [
  13910. 17
  13911. /* NOT_INSLALLED */
  13912. ]: "Need to install with `app.use` function",
  13913. [
  13914. 22
  13915. /* UNEXPECTED_ERROR */
  13916. ]: "Unexpected error",
  13917. [
  13918. 18
  13919. /* NOT_AVAILABLE_IN_LEGACY_MODE */
  13920. ]: "Not available in legacy mode",
  13921. [
  13922. 19
  13923. /* REQUIRED_VALUE */
  13924. ]: `Required in value: {0}`,
  13925. [
  13926. 20
  13927. /* INVALID_VALUE */
  13928. ]: `Invalid value`,
  13929. [
  13930. 21
  13931. /* CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN */
  13932. ]: `Cannot setup vue-devtools plugin`
  13933. };
  13934. const DEVTOOLS_META = "__INTLIFY_META__";
  13935. const TransrateVNodeSymbol = makeSymbol("__transrateVNode");
  13936. const DatetimePartsSymbol = makeSymbol("__datetimeParts");
  13937. const NumberPartsSymbol = makeSymbol("__numberParts");
  13938. const EnableEmitter = makeSymbol("__enableEmitter");
  13939. const DisableEmitter = makeSymbol("__disableEmitter");
  13940. const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
  13941. makeSymbol("__intlifyMeta");
  13942. const InejctWithOption = makeSymbol("__injectWithOption");
  13943. let composerID = 0;
  13944. function defineCoreMissingHandler(missing) {
  13945. return (ctx, locale, key, type2) => {
  13946. return missing(locale, key, vue.getCurrentInstance() || void 0, type2);
  13947. };
  13948. }
  13949. function getLocaleMessages(locale, options) {
  13950. const { messages: messages2, __i18n } = options;
  13951. const ret = isPlainObject(messages2) ? messages2 : isArray(__i18n) ? {} : { [locale]: {} };
  13952. if (isArray(__i18n)) {
  13953. __i18n.forEach(({ locale: locale2, resource }) => {
  13954. if (locale2) {
  13955. ret[locale2] = ret[locale2] || {};
  13956. deepCopy(resource, ret[locale2]);
  13957. } else {
  13958. deepCopy(resource, ret);
  13959. }
  13960. });
  13961. }
  13962. if (options.flatJson) {
  13963. for (const key in ret) {
  13964. if (hasOwn$1(ret, key)) {
  13965. handleFlatJson(ret[key]);
  13966. }
  13967. }
  13968. }
  13969. return ret;
  13970. }
  13971. const isNotObjectOrIsArray = (val) => !isObject$1(val) || isArray(val);
  13972. function deepCopy(src, des) {
  13973. if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
  13974. throw createI18nError(
  13975. 20
  13976. /* INVALID_VALUE */
  13977. );
  13978. }
  13979. for (const key in src) {
  13980. if (hasOwn$1(src, key)) {
  13981. if (isNotObjectOrIsArray(src[key]) || isNotObjectOrIsArray(des[key])) {
  13982. des[key] = src[key];
  13983. } else {
  13984. deepCopy(src[key], des[key]);
  13985. }
  13986. }
  13987. }
  13988. }
  13989. const getMetaInfo = () => {
  13990. const instance = vue.getCurrentInstance();
  13991. return instance && instance.type[DEVTOOLS_META] ? { [DEVTOOLS_META]: instance.type[DEVTOOLS_META] } : null;
  13992. };
  13993. function createComposer(options = {}) {
  13994. const { __root } = options;
  13995. const _isGlobal = __root === void 0;
  13996. let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
  13997. const _locale = vue.ref(
  13998. // prettier-ignore
  13999. __root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : "en-US"
  14000. );
  14001. const _fallbackLocale = vue.ref(
  14002. // prettier-ignore
  14003. __root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
  14004. );
  14005. const _messages = vue.ref(getLocaleMessages(_locale.value, options));
  14006. const _datetimeFormats = vue.ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
  14007. const _numberFormats = vue.ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
  14008. let _missingWarn = __root ? __root.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
  14009. let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
  14010. let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
  14011. let _fallbackFormat = !!options.fallbackFormat;
  14012. let _missing = isFunction(options.missing) ? options.missing : null;
  14013. let _runtimeMissing = isFunction(options.missing) ? defineCoreMissingHandler(options.missing) : null;
  14014. let _postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
  14015. let _warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
  14016. let _escapeParameter = !!options.escapeParameter;
  14017. const _modifiers = __root ? __root.modifiers : isPlainObject(options.modifiers) ? options.modifiers : {};
  14018. let _pluralRules = options.pluralRules || __root && __root.pluralRules;
  14019. let _context;
  14020. function getCoreContext() {
  14021. return createCoreContext({
  14022. version: VERSION,
  14023. locale: _locale.value,
  14024. fallbackLocale: _fallbackLocale.value,
  14025. messages: _messages.value,
  14026. messageCompiler: function compileToFunction(source) {
  14027. return (ctx) => {
  14028. return ctx.normalize([source]);
  14029. };
  14030. },
  14031. datetimeFormats: _datetimeFormats.value,
  14032. numberFormats: _numberFormats.value,
  14033. modifiers: _modifiers,
  14034. pluralRules: _pluralRules,
  14035. missing: _runtimeMissing === null ? void 0 : _runtimeMissing,
  14036. missingWarn: _missingWarn,
  14037. fallbackWarn: _fallbackWarn,
  14038. fallbackFormat: _fallbackFormat,
  14039. unresolving: true,
  14040. postTranslation: _postTranslation === null ? void 0 : _postTranslation,
  14041. warnHtmlMessage: _warnHtmlMessage,
  14042. escapeParameter: _escapeParameter,
  14043. __datetimeFormatters: isPlainObject(_context) ? _context.__datetimeFormatters : void 0,
  14044. __numberFormatters: isPlainObject(_context) ? _context.__numberFormatters : void 0,
  14045. __v_emitter: isPlainObject(_context) ? _context.__v_emitter : void 0,
  14046. __meta: { framework: "vue" }
  14047. });
  14048. }
  14049. _context = getCoreContext();
  14050. updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
  14051. function trackReactivityValues() {
  14052. return [
  14053. _locale.value,
  14054. _fallbackLocale.value,
  14055. _messages.value,
  14056. _datetimeFormats.value,
  14057. _numberFormats.value
  14058. ];
  14059. }
  14060. const locale = vue.computed({
  14061. get: () => _locale.value,
  14062. set: (val) => {
  14063. _locale.value = val;
  14064. _context.locale = _locale.value;
  14065. }
  14066. });
  14067. const fallbackLocale = vue.computed({
  14068. get: () => _fallbackLocale.value,
  14069. set: (val) => {
  14070. _fallbackLocale.value = val;
  14071. _context.fallbackLocale = _fallbackLocale.value;
  14072. updateFallbackLocale(_context, _locale.value, val);
  14073. }
  14074. });
  14075. const messages2 = vue.computed(() => _messages.value);
  14076. const datetimeFormats = vue.computed(() => _datetimeFormats.value);
  14077. const numberFormats = vue.computed(() => _numberFormats.value);
  14078. function getPostTranslationHandler() {
  14079. return isFunction(_postTranslation) ? _postTranslation : null;
  14080. }
  14081. function setPostTranslationHandler(handler) {
  14082. _postTranslation = handler;
  14083. _context.postTranslation = handler;
  14084. }
  14085. function getMissingHandler() {
  14086. return _missing;
  14087. }
  14088. function setMissingHandler(handler) {
  14089. if (handler !== null) {
  14090. _runtimeMissing = defineCoreMissingHandler(handler);
  14091. }
  14092. _missing = handler;
  14093. _context.missing = _runtimeMissing;
  14094. }
  14095. function isResolvedTranslateMessage(type2, arg) {
  14096. return type2 !== "translate" || !!arg.resolvedMessage === false;
  14097. }
  14098. function wrapWithDeps(fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) {
  14099. trackReactivityValues();
  14100. let ret;
  14101. {
  14102. try {
  14103. setAdditionalMeta(getMetaInfo());
  14104. ret = fn(_context);
  14105. } finally {
  14106. setAdditionalMeta(null);
  14107. }
  14108. }
  14109. if (isNumber(ret) && ret === NOT_REOSLVED) {
  14110. const [key, arg2] = argumentParser();
  14111. if (__root && isString(key) && isResolvedTranslateMessage(warnType, arg2)) {
  14112. if (_fallbackRoot && (isTranslateFallbackWarn(_fallbackWarn, key) || isTranslateMissingWarn(_missingWarn, key))) {
  14113. warn(getWarnMessage(6, {
  14114. key,
  14115. type: warnType
  14116. }));
  14117. }
  14118. {
  14119. const { __v_emitter: emitter } = _context;
  14120. if (emitter && _fallbackRoot) {
  14121. emitter.emit("fallback", {
  14122. type: warnType,
  14123. key,
  14124. to: "global",
  14125. groupId: `${warnType}:${key}`
  14126. });
  14127. }
  14128. }
  14129. }
  14130. return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key);
  14131. } else if (successCondition(ret)) {
  14132. return ret;
  14133. } else {
  14134. throw createI18nError(
  14135. 14
  14136. /* UNEXPECTED_RETURN_TYPE */
  14137. );
  14138. }
  14139. }
  14140. function t(...args) {
  14141. return wrapWithDeps((context) => translate(context, ...args), () => parseTranslateArgs(...args), "translate", (root) => root.t(...args), (key) => key, (val) => isString(val));
  14142. }
  14143. function rt(...args) {
  14144. const [arg1, arg2, arg3] = args;
  14145. if (arg3 && !isObject$1(arg3)) {
  14146. throw createI18nError(
  14147. 15
  14148. /* INVALID_ARGUMENT */
  14149. );
  14150. }
  14151. return t(...[arg1, arg2, assign({ resolvedMessage: true }, arg3 || {})]);
  14152. }
  14153. function d(...args) {
  14154. return wrapWithDeps((context) => datetime(context, ...args), () => parseDateTimeArgs(...args), "datetime format", (root) => root.d(...args), () => MISSING_RESOLVE_VALUE, (val) => isString(val));
  14155. }
  14156. function n2(...args) {
  14157. return wrapWithDeps((context) => number(context, ...args), () => parseNumberArgs(...args), "number format", (root) => root.n(...args), () => MISSING_RESOLVE_VALUE, (val) => isString(val));
  14158. }
  14159. function normalize(values) {
  14160. return values.map((val) => isString(val) ? vue.createVNode(vue.Text, null, val, 0) : val);
  14161. }
  14162. const interpolate = (val) => val;
  14163. const processor = {
  14164. normalize,
  14165. interpolate,
  14166. type: "vnode"
  14167. };
  14168. function transrateVNode(...args) {
  14169. return wrapWithDeps(
  14170. (context) => {
  14171. let ret;
  14172. const _context2 = context;
  14173. try {
  14174. _context2.processor = processor;
  14175. ret = translate(_context2, ...args);
  14176. } finally {
  14177. _context2.processor = null;
  14178. }
  14179. return ret;
  14180. },
  14181. () => parseTranslateArgs(...args),
  14182. "translate",
  14183. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  14184. (root) => root[TransrateVNodeSymbol](...args),
  14185. (key) => [vue.createVNode(vue.Text, null, key, 0)],
  14186. (val) => isArray(val)
  14187. );
  14188. }
  14189. function numberParts(...args) {
  14190. return wrapWithDeps(
  14191. (context) => number(context, ...args),
  14192. () => parseNumberArgs(...args),
  14193. "number format",
  14194. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  14195. (root) => root[NumberPartsSymbol](...args),
  14196. () => [],
  14197. (val) => isString(val) || isArray(val)
  14198. );
  14199. }
  14200. function datetimeParts(...args) {
  14201. return wrapWithDeps(
  14202. (context) => datetime(context, ...args),
  14203. () => parseDateTimeArgs(...args),
  14204. "datetime format",
  14205. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  14206. (root) => root[DatetimePartsSymbol](...args),
  14207. () => [],
  14208. (val) => isString(val) || isArray(val)
  14209. );
  14210. }
  14211. function setPluralRules(rules2) {
  14212. _pluralRules = rules2;
  14213. _context.pluralRules = _pluralRules;
  14214. }
  14215. function te(key, locale2) {
  14216. const targetLocale = isString(locale2) ? locale2 : _locale.value;
  14217. const message = getLocaleMessage(targetLocale);
  14218. return resolveValue(message, key) !== null;
  14219. }
  14220. function resolveMessages(key) {
  14221. let messages3 = null;
  14222. const locales = getLocaleChain(_context, _fallbackLocale.value, _locale.value);
  14223. for (let i = 0; i < locales.length; i++) {
  14224. const targetLocaleMessages = _messages.value[locales[i]] || {};
  14225. const messageValue = resolveValue(targetLocaleMessages, key);
  14226. if (messageValue != null) {
  14227. messages3 = messageValue;
  14228. break;
  14229. }
  14230. }
  14231. return messages3;
  14232. }
  14233. function tm(key) {
  14234. const messages3 = resolveMessages(key);
  14235. return messages3 != null ? messages3 : __root ? __root.tm(key) || {} : {};
  14236. }
  14237. function getLocaleMessage(locale2) {
  14238. return _messages.value[locale2] || {};
  14239. }
  14240. function setLocaleMessage(locale2, message) {
  14241. _messages.value[locale2] = message;
  14242. _context.messages = _messages.value;
  14243. }
  14244. function mergeLocaleMessage(locale2, message) {
  14245. _messages.value[locale2] = _messages.value[locale2] || {};
  14246. deepCopy(message, _messages.value[locale2]);
  14247. _context.messages = _messages.value;
  14248. }
  14249. function getDateTimeFormat(locale2) {
  14250. return _datetimeFormats.value[locale2] || {};
  14251. }
  14252. function setDateTimeFormat(locale2, format2) {
  14253. _datetimeFormats.value[locale2] = format2;
  14254. _context.datetimeFormats = _datetimeFormats.value;
  14255. clearDateTimeFormat(_context, locale2, format2);
  14256. }
  14257. function mergeDateTimeFormat(locale2, format2) {
  14258. _datetimeFormats.value[locale2] = assign(_datetimeFormats.value[locale2] || {}, format2);
  14259. _context.datetimeFormats = _datetimeFormats.value;
  14260. clearDateTimeFormat(_context, locale2, format2);
  14261. }
  14262. function getNumberFormat(locale2) {
  14263. return _numberFormats.value[locale2] || {};
  14264. }
  14265. function setNumberFormat(locale2, format2) {
  14266. _numberFormats.value[locale2] = format2;
  14267. _context.numberFormats = _numberFormats.value;
  14268. clearNumberFormat(_context, locale2, format2);
  14269. }
  14270. function mergeNumberFormat(locale2, format2) {
  14271. _numberFormats.value[locale2] = assign(_numberFormats.value[locale2] || {}, format2);
  14272. _context.numberFormats = _numberFormats.value;
  14273. clearNumberFormat(_context, locale2, format2);
  14274. }
  14275. composerID++;
  14276. if (__root) {
  14277. vue.watch(__root.locale, (val) => {
  14278. if (_inheritLocale) {
  14279. _locale.value = val;
  14280. _context.locale = val;
  14281. updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
  14282. }
  14283. });
  14284. vue.watch(__root.fallbackLocale, (val) => {
  14285. if (_inheritLocale) {
  14286. _fallbackLocale.value = val;
  14287. _context.fallbackLocale = val;
  14288. updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
  14289. }
  14290. });
  14291. }
  14292. const composer = {
  14293. id: composerID,
  14294. locale,
  14295. fallbackLocale,
  14296. get inheritLocale() {
  14297. return _inheritLocale;
  14298. },
  14299. set inheritLocale(val) {
  14300. _inheritLocale = val;
  14301. if (val && __root) {
  14302. _locale.value = __root.locale.value;
  14303. _fallbackLocale.value = __root.fallbackLocale.value;
  14304. updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
  14305. }
  14306. },
  14307. get availableLocales() {
  14308. return Object.keys(_messages.value).sort();
  14309. },
  14310. messages: messages2,
  14311. datetimeFormats,
  14312. numberFormats,
  14313. get modifiers() {
  14314. return _modifiers;
  14315. },
  14316. get pluralRules() {
  14317. return _pluralRules || {};
  14318. },
  14319. get isGlobal() {
  14320. return _isGlobal;
  14321. },
  14322. get missingWarn() {
  14323. return _missingWarn;
  14324. },
  14325. set missingWarn(val) {
  14326. _missingWarn = val;
  14327. _context.missingWarn = _missingWarn;
  14328. },
  14329. get fallbackWarn() {
  14330. return _fallbackWarn;
  14331. },
  14332. set fallbackWarn(val) {
  14333. _fallbackWarn = val;
  14334. _context.fallbackWarn = _fallbackWarn;
  14335. },
  14336. get fallbackRoot() {
  14337. return _fallbackRoot;
  14338. },
  14339. set fallbackRoot(val) {
  14340. _fallbackRoot = val;
  14341. },
  14342. get fallbackFormat() {
  14343. return _fallbackFormat;
  14344. },
  14345. set fallbackFormat(val) {
  14346. _fallbackFormat = val;
  14347. _context.fallbackFormat = _fallbackFormat;
  14348. },
  14349. get warnHtmlMessage() {
  14350. return _warnHtmlMessage;
  14351. },
  14352. set warnHtmlMessage(val) {
  14353. _warnHtmlMessage = val;
  14354. _context.warnHtmlMessage = val;
  14355. },
  14356. get escapeParameter() {
  14357. return _escapeParameter;
  14358. },
  14359. set escapeParameter(val) {
  14360. _escapeParameter = val;
  14361. _context.escapeParameter = val;
  14362. },
  14363. t,
  14364. rt,
  14365. d,
  14366. n: n2,
  14367. te,
  14368. tm,
  14369. getLocaleMessage,
  14370. setLocaleMessage,
  14371. mergeLocaleMessage,
  14372. getDateTimeFormat,
  14373. setDateTimeFormat,
  14374. mergeDateTimeFormat,
  14375. getNumberFormat,
  14376. setNumberFormat,
  14377. mergeNumberFormat,
  14378. getPostTranslationHandler,
  14379. setPostTranslationHandler,
  14380. getMissingHandler,
  14381. setMissingHandler,
  14382. [TransrateVNodeSymbol]: transrateVNode,
  14383. [NumberPartsSymbol]: numberParts,
  14384. [DatetimePartsSymbol]: datetimeParts,
  14385. [SetPluralRulesSymbol]: setPluralRules,
  14386. [InejctWithOption]: options.__injectWithOption
  14387. // eslint-disable-line @typescript-eslint/no-explicit-any
  14388. };
  14389. {
  14390. composer[EnableEmitter] = (emitter) => {
  14391. _context.__v_emitter = emitter;
  14392. };
  14393. composer[DisableEmitter] = () => {
  14394. _context.__v_emitter = void 0;
  14395. };
  14396. }
  14397. return composer;
  14398. }
  14399. function convertComposerOptions(options) {
  14400. const locale = isString(options.locale) ? options.locale : "en-US";
  14401. const fallbackLocale = isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale;
  14402. const missing = isFunction(options.missing) ? options.missing : void 0;
  14403. const missingWarn = isBoolean(options.silentTranslationWarn) || isRegExp(options.silentTranslationWarn) ? !options.silentTranslationWarn : true;
  14404. const fallbackWarn = isBoolean(options.silentFallbackWarn) || isRegExp(options.silentFallbackWarn) ? !options.silentFallbackWarn : true;
  14405. const fallbackRoot = isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
  14406. const fallbackFormat = !!options.formatFallbackMessages;
  14407. const modifiers = isPlainObject(options.modifiers) ? options.modifiers : {};
  14408. const pluralizationRules = options.pluralizationRules;
  14409. const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : void 0;
  14410. const warnHtmlMessage = isString(options.warnHtmlInMessage) ? options.warnHtmlInMessage !== "off" : true;
  14411. const escapeParameter = !!options.escapeParameterHtml;
  14412. const inheritLocale = isBoolean(options.sync) ? options.sync : true;
  14413. if (options.formatter) {
  14414. warn(getWarnMessage(
  14415. 8
  14416. /* NOT_SUPPORTED_FORMATTER */
  14417. ));
  14418. }
  14419. if (options.preserveDirectiveContent) {
  14420. warn(getWarnMessage(
  14421. 9
  14422. /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
  14423. ));
  14424. }
  14425. let messages2 = options.messages;
  14426. if (isPlainObject(options.sharedMessages)) {
  14427. const sharedMessages = options.sharedMessages;
  14428. const locales = Object.keys(sharedMessages);
  14429. messages2 = locales.reduce((messages3, locale2) => {
  14430. const message = messages3[locale2] || (messages3[locale2] = {});
  14431. assign(message, sharedMessages[locale2]);
  14432. return messages3;
  14433. }, messages2 || {});
  14434. }
  14435. const { __i18n, __root, __injectWithOption } = options;
  14436. const datetimeFormats = options.datetimeFormats;
  14437. const numberFormats = options.numberFormats;
  14438. const flatJson = options.flatJson;
  14439. return {
  14440. locale,
  14441. fallbackLocale,
  14442. messages: messages2,
  14443. flatJson,
  14444. datetimeFormats,
  14445. numberFormats,
  14446. missing,
  14447. missingWarn,
  14448. fallbackWarn,
  14449. fallbackRoot,
  14450. fallbackFormat,
  14451. modifiers,
  14452. pluralRules: pluralizationRules,
  14453. postTranslation,
  14454. warnHtmlMessage,
  14455. escapeParameter,
  14456. inheritLocale,
  14457. __i18n,
  14458. __root,
  14459. __injectWithOption
  14460. };
  14461. }
  14462. function createVueI18n(options = {}) {
  14463. const composer = createComposer(convertComposerOptions(options));
  14464. const vueI18n = {
  14465. // id
  14466. id: composer.id,
  14467. // locale
  14468. get locale() {
  14469. return composer.locale.value;
  14470. },
  14471. set locale(val) {
  14472. composer.locale.value = val;
  14473. },
  14474. // fallbackLocale
  14475. get fallbackLocale() {
  14476. return composer.fallbackLocale.value;
  14477. },
  14478. set fallbackLocale(val) {
  14479. composer.fallbackLocale.value = val;
  14480. },
  14481. // messages
  14482. get messages() {
  14483. return composer.messages.value;
  14484. },
  14485. // datetimeFormats
  14486. get datetimeFormats() {
  14487. return composer.datetimeFormats.value;
  14488. },
  14489. // numberFormats
  14490. get numberFormats() {
  14491. return composer.numberFormats.value;
  14492. },
  14493. // availableLocales
  14494. get availableLocales() {
  14495. return composer.availableLocales;
  14496. },
  14497. // formatter
  14498. get formatter() {
  14499. warn(getWarnMessage(
  14500. 8
  14501. /* NOT_SUPPORTED_FORMATTER */
  14502. ));
  14503. return {
  14504. interpolate() {
  14505. return [];
  14506. }
  14507. };
  14508. },
  14509. set formatter(val) {
  14510. warn(getWarnMessage(
  14511. 8
  14512. /* NOT_SUPPORTED_FORMATTER */
  14513. ));
  14514. },
  14515. // missing
  14516. get missing() {
  14517. return composer.getMissingHandler();
  14518. },
  14519. set missing(handler) {
  14520. composer.setMissingHandler(handler);
  14521. },
  14522. // silentTranslationWarn
  14523. get silentTranslationWarn() {
  14524. return isBoolean(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn;
  14525. },
  14526. set silentTranslationWarn(val) {
  14527. composer.missingWarn = isBoolean(val) ? !val : val;
  14528. },
  14529. // silentFallbackWarn
  14530. get silentFallbackWarn() {
  14531. return isBoolean(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn;
  14532. },
  14533. set silentFallbackWarn(val) {
  14534. composer.fallbackWarn = isBoolean(val) ? !val : val;
  14535. },
  14536. // modifiers
  14537. get modifiers() {
  14538. return composer.modifiers;
  14539. },
  14540. // formatFallbackMessages
  14541. get formatFallbackMessages() {
  14542. return composer.fallbackFormat;
  14543. },
  14544. set formatFallbackMessages(val) {
  14545. composer.fallbackFormat = val;
  14546. },
  14547. // postTranslation
  14548. get postTranslation() {
  14549. return composer.getPostTranslationHandler();
  14550. },
  14551. set postTranslation(handler) {
  14552. composer.setPostTranslationHandler(handler);
  14553. },
  14554. // sync
  14555. get sync() {
  14556. return composer.inheritLocale;
  14557. },
  14558. set sync(val) {
  14559. composer.inheritLocale = val;
  14560. },
  14561. // warnInHtmlMessage
  14562. get warnHtmlInMessage() {
  14563. return composer.warnHtmlMessage ? "warn" : "off";
  14564. },
  14565. set warnHtmlInMessage(val) {
  14566. composer.warnHtmlMessage = val !== "off";
  14567. },
  14568. // escapeParameterHtml
  14569. get escapeParameterHtml() {
  14570. return composer.escapeParameter;
  14571. },
  14572. set escapeParameterHtml(val) {
  14573. composer.escapeParameter = val;
  14574. },
  14575. // preserveDirectiveContent
  14576. get preserveDirectiveContent() {
  14577. warn(getWarnMessage(
  14578. 9
  14579. /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
  14580. ));
  14581. return true;
  14582. },
  14583. set preserveDirectiveContent(val) {
  14584. warn(getWarnMessage(
  14585. 9
  14586. /* NOT_SUPPORTED_PRESERVE_DIRECTIVE */
  14587. ));
  14588. },
  14589. // pluralizationRules
  14590. get pluralizationRules() {
  14591. return composer.pluralRules || {};
  14592. },
  14593. // for internal
  14594. __composer: composer,
  14595. // t
  14596. t(...args) {
  14597. const [arg1, arg2, arg3] = args;
  14598. const options2 = {};
  14599. let list = null;
  14600. let named = null;
  14601. if (!isString(arg1)) {
  14602. throw createI18nError(
  14603. 15
  14604. /* INVALID_ARGUMENT */
  14605. );
  14606. }
  14607. const key = arg1;
  14608. if (isString(arg2)) {
  14609. options2.locale = arg2;
  14610. } else if (isArray(arg2)) {
  14611. list = arg2;
  14612. } else if (isPlainObject(arg2)) {
  14613. named = arg2;
  14614. }
  14615. if (isArray(arg3)) {
  14616. list = arg3;
  14617. } else if (isPlainObject(arg3)) {
  14618. named = arg3;
  14619. }
  14620. return composer.t(key, list || named || {}, options2);
  14621. },
  14622. rt(...args) {
  14623. return composer.rt(...args);
  14624. },
  14625. // tc
  14626. tc(...args) {
  14627. const [arg1, arg2, arg3] = args;
  14628. const options2 = { plural: 1 };
  14629. let list = null;
  14630. let named = null;
  14631. if (!isString(arg1)) {
  14632. throw createI18nError(
  14633. 15
  14634. /* INVALID_ARGUMENT */
  14635. );
  14636. }
  14637. const key = arg1;
  14638. if (isString(arg2)) {
  14639. options2.locale = arg2;
  14640. } else if (isNumber(arg2)) {
  14641. options2.plural = arg2;
  14642. } else if (isArray(arg2)) {
  14643. list = arg2;
  14644. } else if (isPlainObject(arg2)) {
  14645. named = arg2;
  14646. }
  14647. if (isString(arg3)) {
  14648. options2.locale = arg3;
  14649. } else if (isArray(arg3)) {
  14650. list = arg3;
  14651. } else if (isPlainObject(arg3)) {
  14652. named = arg3;
  14653. }
  14654. return composer.t(key, list || named || {}, options2);
  14655. },
  14656. // te
  14657. te(key, locale) {
  14658. return composer.te(key, locale);
  14659. },
  14660. // tm
  14661. tm(key) {
  14662. return composer.tm(key);
  14663. },
  14664. // getLocaleMessage
  14665. getLocaleMessage(locale) {
  14666. return composer.getLocaleMessage(locale);
  14667. },
  14668. // setLocaleMessage
  14669. setLocaleMessage(locale, message) {
  14670. composer.setLocaleMessage(locale, message);
  14671. },
  14672. // mergeLocaleMessage
  14673. mergeLocaleMessage(locale, message) {
  14674. composer.mergeLocaleMessage(locale, message);
  14675. },
  14676. // d
  14677. d(...args) {
  14678. return composer.d(...args);
  14679. },
  14680. // getDateTimeFormat
  14681. getDateTimeFormat(locale) {
  14682. return composer.getDateTimeFormat(locale);
  14683. },
  14684. // setDateTimeFormat
  14685. setDateTimeFormat(locale, format2) {
  14686. composer.setDateTimeFormat(locale, format2);
  14687. },
  14688. // mergeDateTimeFormat
  14689. mergeDateTimeFormat(locale, format2) {
  14690. composer.mergeDateTimeFormat(locale, format2);
  14691. },
  14692. // n
  14693. n(...args) {
  14694. return composer.n(...args);
  14695. },
  14696. // getNumberFormat
  14697. getNumberFormat(locale) {
  14698. return composer.getNumberFormat(locale);
  14699. },
  14700. // setNumberFormat
  14701. setNumberFormat(locale, format2) {
  14702. composer.setNumberFormat(locale, format2);
  14703. },
  14704. // mergeNumberFormat
  14705. mergeNumberFormat(locale, format2) {
  14706. composer.mergeNumberFormat(locale, format2);
  14707. },
  14708. // getChoiceIndex
  14709. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  14710. getChoiceIndex(choice, choicesLength) {
  14711. warn(getWarnMessage(
  14712. 10
  14713. /* NOT_SUPPORTED_GET_CHOICE_INDEX */
  14714. ));
  14715. return -1;
  14716. },
  14717. // for internal
  14718. __onComponentInstanceCreated(target) {
  14719. const { componentInstanceCreatedListener } = options;
  14720. if (componentInstanceCreatedListener) {
  14721. componentInstanceCreatedListener(target, vueI18n);
  14722. }
  14723. }
  14724. };
  14725. {
  14726. vueI18n.__enableEmitter = (emitter) => {
  14727. const __composer = composer;
  14728. __composer[EnableEmitter] && __composer[EnableEmitter](emitter);
  14729. };
  14730. vueI18n.__disableEmitter = () => {
  14731. const __composer = composer;
  14732. __composer[DisableEmitter] && __composer[DisableEmitter]();
  14733. };
  14734. }
  14735. return vueI18n;
  14736. }
  14737. const baseFormatProps = {
  14738. tag: {
  14739. type: [String, Object]
  14740. },
  14741. locale: {
  14742. type: String
  14743. },
  14744. scope: {
  14745. type: String,
  14746. validator: (val) => val === "parent" || val === "global",
  14747. default: "parent"
  14748. },
  14749. i18n: {
  14750. type: Object
  14751. }
  14752. };
  14753. const Translation = {
  14754. /* eslint-disable */
  14755. name: "i18n-t",
  14756. props: assign({
  14757. keypath: {
  14758. type: String,
  14759. required: true
  14760. },
  14761. plural: {
  14762. type: [Number, String],
  14763. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  14764. validator: (val) => isNumber(val) || !isNaN(val)
  14765. }
  14766. }, baseFormatProps),
  14767. /* eslint-enable */
  14768. setup(props2, context) {
  14769. const { slots, attrs } = context;
  14770. const i18n2 = props2.i18n || useI18n({
  14771. useScope: props2.scope,
  14772. __useComponent: true
  14773. });
  14774. const keys = Object.keys(slots).filter((key) => key !== "_");
  14775. return () => {
  14776. const options = {};
  14777. if (props2.locale) {
  14778. options.locale = props2.locale;
  14779. }
  14780. if (props2.plural !== void 0) {
  14781. options.plural = isString(props2.plural) ? +props2.plural : props2.plural;
  14782. }
  14783. const arg = getInterpolateArg(context, keys);
  14784. const children = i18n2[TransrateVNodeSymbol](props2.keypath, arg, options);
  14785. const assignedAttrs = assign({}, attrs);
  14786. 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);
  14787. };
  14788. }
  14789. };
  14790. function getInterpolateArg({ slots }, keys) {
  14791. if (keys.length === 1 && keys[0] === "default") {
  14792. return slots.default ? slots.default() : [];
  14793. } else {
  14794. return keys.reduce((arg, key) => {
  14795. const slot = slots[key];
  14796. if (slot) {
  14797. arg[key] = slot();
  14798. }
  14799. return arg;
  14800. }, {});
  14801. }
  14802. }
  14803. function renderFormatter(props2, context, slotKeys, partFormatter) {
  14804. const { slots, attrs } = context;
  14805. return () => {
  14806. const options = { part: true };
  14807. let overrides = {};
  14808. if (props2.locale) {
  14809. options.locale = props2.locale;
  14810. }
  14811. if (isString(props2.format)) {
  14812. options.key = props2.format;
  14813. } else if (isObject$1(props2.format)) {
  14814. if (isString(props2.format.key)) {
  14815. options.key = props2.format.key;
  14816. }
  14817. overrides = Object.keys(props2.format).reduce((options2, prop) => {
  14818. return slotKeys.includes(prop) ? assign({}, options2, { [prop]: props2.format[prop] }) : options2;
  14819. }, {});
  14820. }
  14821. const parts = partFormatter(...[props2.value, options, overrides]);
  14822. let children = [options.key];
  14823. if (isArray(parts)) {
  14824. children = parts.map((part, index2) => {
  14825. const slot = slots[part.type];
  14826. return slot ? slot({ [part.type]: part.value, index: index2, parts }) : [part.value];
  14827. });
  14828. } else if (isString(parts)) {
  14829. children = [parts];
  14830. }
  14831. const assignedAttrs = assign({}, attrs);
  14832. 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);
  14833. };
  14834. }
  14835. const NUMBER_FORMAT_KEYS = [
  14836. "localeMatcher",
  14837. "style",
  14838. "unit",
  14839. "unitDisplay",
  14840. "currency",
  14841. "currencyDisplay",
  14842. "useGrouping",
  14843. "numberingSystem",
  14844. "minimumIntegerDigits",
  14845. "minimumFractionDigits",
  14846. "maximumFractionDigits",
  14847. "minimumSignificantDigits",
  14848. "maximumSignificantDigits",
  14849. "notation",
  14850. "formatMatcher"
  14851. ];
  14852. const NumberFormat = {
  14853. /* eslint-disable */
  14854. name: "i18n-n",
  14855. props: assign({
  14856. value: {
  14857. type: Number,
  14858. required: true
  14859. },
  14860. format: {
  14861. type: [String, Object]
  14862. }
  14863. }, baseFormatProps),
  14864. /* eslint-enable */
  14865. setup(props2, context) {
  14866. const i18n2 = props2.i18n || useI18n({ useScope: "parent", __useComponent: true });
  14867. return renderFormatter(props2, context, NUMBER_FORMAT_KEYS, (...args) => (
  14868. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  14869. i18n2[NumberPartsSymbol](...args)
  14870. ));
  14871. }
  14872. };
  14873. const DATETIME_FORMAT_KEYS = [
  14874. "dateStyle",
  14875. "timeStyle",
  14876. "fractionalSecondDigits",
  14877. "calendar",
  14878. "dayPeriod",
  14879. "numberingSystem",
  14880. "localeMatcher",
  14881. "timeZone",
  14882. "hour12",
  14883. "hourCycle",
  14884. "formatMatcher",
  14885. "weekday",
  14886. "era",
  14887. "year",
  14888. "month",
  14889. "day",
  14890. "hour",
  14891. "minute",
  14892. "second",
  14893. "timeZoneName"
  14894. ];
  14895. const DatetimeFormat = {
  14896. /* eslint-disable */
  14897. name: "i18n-d",
  14898. props: assign({
  14899. value: {
  14900. type: [Number, Date],
  14901. required: true
  14902. },
  14903. format: {
  14904. type: [String, Object]
  14905. }
  14906. }, baseFormatProps),
  14907. /* eslint-enable */
  14908. setup(props2, context) {
  14909. const i18n2 = props2.i18n || useI18n({ useScope: "parent", __useComponent: true });
  14910. return renderFormatter(props2, context, DATETIME_FORMAT_KEYS, (...args) => (
  14911. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  14912. i18n2[DatetimePartsSymbol](...args)
  14913. ));
  14914. }
  14915. };
  14916. function getComposer$2(i18n2, instance) {
  14917. const i18nInternal = i18n2;
  14918. if (i18n2.mode === "composition") {
  14919. return i18nInternal.__getInstance(instance) || i18n2.global;
  14920. } else {
  14921. const vueI18n = i18nInternal.__getInstance(instance);
  14922. return vueI18n != null ? vueI18n.__composer : i18n2.global.__composer;
  14923. }
  14924. }
  14925. function vTDirective(i18n2) {
  14926. const bind = (el, { instance, value: value2, modifiers }) => {
  14927. if (!instance || !instance.$) {
  14928. throw createI18nError(
  14929. 22
  14930. /* UNEXPECTED_ERROR */
  14931. );
  14932. }
  14933. const composer = getComposer$2(i18n2, instance.$);
  14934. if (modifiers.preserve) {
  14935. warn(getWarnMessage(
  14936. 7
  14937. /* NOT_SUPPORTED_PRESERVE */
  14938. ));
  14939. }
  14940. const parsedValue = parseValue(value2);
  14941. el.textContent = composer.t(...makeParams(parsedValue));
  14942. };
  14943. return {
  14944. beforeMount: bind,
  14945. beforeUpdate: bind
  14946. };
  14947. }
  14948. function parseValue(value2) {
  14949. if (isString(value2)) {
  14950. return { path: value2 };
  14951. } else if (isPlainObject(value2)) {
  14952. if (!("path" in value2)) {
  14953. throw createI18nError(19, "path");
  14954. }
  14955. return value2;
  14956. } else {
  14957. throw createI18nError(
  14958. 20
  14959. /* INVALID_VALUE */
  14960. );
  14961. }
  14962. }
  14963. function makeParams(value2) {
  14964. const { path, locale, args, choice, plural } = value2;
  14965. const options = {};
  14966. const named = args || {};
  14967. if (isString(locale)) {
  14968. options.locale = locale;
  14969. }
  14970. if (isNumber(choice)) {
  14971. options.plural = choice;
  14972. }
  14973. if (isNumber(plural)) {
  14974. options.plural = plural;
  14975. }
  14976. return [path, named, options];
  14977. }
  14978. function apply(app, i18n2, ...options) {
  14979. const pluginOptions = isPlainObject(options[0]) ? options[0] : {};
  14980. const useI18nComponentName = !!pluginOptions.useI18nComponentName;
  14981. const globalInstall = isBoolean(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
  14982. if (globalInstall && useI18nComponentName) {
  14983. warn(getWarnMessage(11, {
  14984. name: Translation.name
  14985. }));
  14986. }
  14987. if (globalInstall) {
  14988. app.component(!useI18nComponentName ? Translation.name : "i18n", Translation);
  14989. app.component(NumberFormat.name, NumberFormat);
  14990. app.component(DatetimeFormat.name, DatetimeFormat);
  14991. }
  14992. app.directive("t", vTDirective(i18n2));
  14993. }
  14994. const VUE_I18N_COMPONENT_TYPES = "vue-i18n: composer properties";
  14995. let devtoolsApi;
  14996. async function enableDevTools(app, i18n2) {
  14997. return new Promise((resolve, reject) => {
  14998. try {
  14999. setupDevtoolsPlugin({
  15000. id: "vue-devtools-plugin-vue-i18n",
  15001. label: VueDevToolsLabels[
  15002. "vue-devtools-plugin-vue-i18n"
  15003. /* PLUGIN */
  15004. ],
  15005. packageName: "vue-i18n",
  15006. homepage: "https://vue-i18n.intlify.dev",
  15007. logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
  15008. componentStateTypes: [VUE_I18N_COMPONENT_TYPES],
  15009. app
  15010. }, (api) => {
  15011. devtoolsApi = api;
  15012. api.on.visitComponentTree(({ componentInstance, treeNode }) => {
  15013. updateComponentTreeTags(componentInstance, treeNode, i18n2);
  15014. });
  15015. api.on.inspectComponent(({ componentInstance, instanceData }) => {
  15016. if (componentInstance.vnode.el.__VUE_I18N__ && instanceData) {
  15017. if (i18n2.mode === "legacy") {
  15018. if (componentInstance.vnode.el.__VUE_I18N__ !== i18n2.global.__composer) {
  15019. inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
  15020. }
  15021. } else {
  15022. inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
  15023. }
  15024. }
  15025. });
  15026. api.addInspector({
  15027. id: "vue-i18n-resource-inspector",
  15028. label: VueDevToolsLabels[
  15029. "vue-i18n-resource-inspector"
  15030. /* CUSTOM_INSPECTOR */
  15031. ],
  15032. icon: "language",
  15033. treeFilterPlaceholder: VueDevToolsPlaceholders[
  15034. "vue-i18n-resource-inspector"
  15035. /* CUSTOM_INSPECTOR */
  15036. ]
  15037. });
  15038. api.on.getInspectorTree((payload) => {
  15039. if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
  15040. registerScope(payload, i18n2);
  15041. }
  15042. });
  15043. api.on.getInspectorState((payload) => {
  15044. if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
  15045. inspectScope(payload, i18n2);
  15046. }
  15047. });
  15048. api.on.editInspectorState((payload) => {
  15049. if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
  15050. editScope(payload, i18n2);
  15051. }
  15052. });
  15053. api.addTimelineLayer({
  15054. id: "vue-i18n-timeline",
  15055. label: VueDevToolsLabels[
  15056. "vue-i18n-timeline"
  15057. /* TIMELINE */
  15058. ],
  15059. color: VueDevToolsTimelineColors[
  15060. "vue-i18n-timeline"
  15061. /* TIMELINE */
  15062. ]
  15063. });
  15064. resolve(true);
  15065. });
  15066. } catch (e) {
  15067. console.error(e);
  15068. reject(false);
  15069. }
  15070. });
  15071. }
  15072. function updateComponentTreeTags(instance, treeNode, i18n2) {
  15073. const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
  15074. if (instance && instance.vnode.el.__VUE_I18N__) {
  15075. if (instance.vnode.el.__VUE_I18N__ !== global2) {
  15076. const label = instance.type.name || instance.type.displayName || instance.type.__file;
  15077. const tag = {
  15078. label: `i18n (${label} Scope)`,
  15079. textColor: 0,
  15080. backgroundColor: 16764185
  15081. };
  15082. treeNode.tags.push(tag);
  15083. }
  15084. }
  15085. }
  15086. function inspectComposer(instanceData, composer) {
  15087. const type2 = VUE_I18N_COMPONENT_TYPES;
  15088. instanceData.state.push({
  15089. type: type2,
  15090. key: "locale",
  15091. editable: true,
  15092. value: composer.locale.value
  15093. });
  15094. instanceData.state.push({
  15095. type: type2,
  15096. key: "availableLocales",
  15097. editable: false,
  15098. value: composer.availableLocales
  15099. });
  15100. instanceData.state.push({
  15101. type: type2,
  15102. key: "fallbackLocale",
  15103. editable: true,
  15104. value: composer.fallbackLocale.value
  15105. });
  15106. instanceData.state.push({
  15107. type: type2,
  15108. key: "inheritLocale",
  15109. editable: true,
  15110. value: composer.inheritLocale
  15111. });
  15112. instanceData.state.push({
  15113. type: type2,
  15114. key: "messages",
  15115. editable: false,
  15116. value: getLocaleMessageValue(composer.messages.value)
  15117. });
  15118. instanceData.state.push({
  15119. type: type2,
  15120. key: "datetimeFormats",
  15121. editable: false,
  15122. value: composer.datetimeFormats.value
  15123. });
  15124. instanceData.state.push({
  15125. type: type2,
  15126. key: "numberFormats",
  15127. editable: false,
  15128. value: composer.numberFormats.value
  15129. });
  15130. }
  15131. function getLocaleMessageValue(messages2) {
  15132. const value2 = {};
  15133. Object.keys(messages2).forEach((key) => {
  15134. const v = messages2[key];
  15135. if (isFunction(v) && "source" in v) {
  15136. value2[key] = getMessageFunctionDetails(v);
  15137. } else if (isObject$1(v)) {
  15138. value2[key] = getLocaleMessageValue(v);
  15139. } else {
  15140. value2[key] = v;
  15141. }
  15142. });
  15143. return value2;
  15144. }
  15145. const ESC = {
  15146. "<": "&lt;",
  15147. ">": "&gt;",
  15148. '"': "&quot;",
  15149. "&": "&amp;"
  15150. };
  15151. function escape(s) {
  15152. return s.replace(/[<>"&]/g, escapeChar);
  15153. }
  15154. function escapeChar(a) {
  15155. return ESC[a] || a;
  15156. }
  15157. function getMessageFunctionDetails(func2) {
  15158. const argString = func2.source ? `("${escape(func2.source)}")` : `(?)`;
  15159. return {
  15160. _custom: {
  15161. type: "function",
  15162. display: `<span>ƒ</span> ${argString}`
  15163. }
  15164. };
  15165. }
  15166. function registerScope(payload, i18n2) {
  15167. payload.rootNodes.push({
  15168. id: "global",
  15169. label: "Global Scope"
  15170. });
  15171. const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
  15172. for (const [keyInstance, instance] of i18n2.__instances) {
  15173. const composer = i18n2.mode === "composition" ? instance : instance.__composer;
  15174. if (global2 === composer) {
  15175. continue;
  15176. }
  15177. const label = keyInstance.type.name || keyInstance.type.displayName || keyInstance.type.__file;
  15178. payload.rootNodes.push({
  15179. id: composer.id.toString(),
  15180. label: `${label} Scope`
  15181. });
  15182. }
  15183. }
  15184. function getComposer$1(nodeId, i18n2) {
  15185. if (nodeId === "global") {
  15186. return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
  15187. } else {
  15188. const instance = Array.from(i18n2.__instances.values()).find((item) => item.id.toString() === nodeId);
  15189. if (instance) {
  15190. return i18n2.mode === "composition" ? instance : instance.__composer;
  15191. } else {
  15192. return null;
  15193. }
  15194. }
  15195. }
  15196. function inspectScope(payload, i18n2) {
  15197. const composer = getComposer$1(payload.nodeId, i18n2);
  15198. if (composer) {
  15199. payload.state = makeScopeInspectState(composer);
  15200. }
  15201. }
  15202. function makeScopeInspectState(composer) {
  15203. const state = {};
  15204. const localeType = "Locale related info";
  15205. const localeStates = [
  15206. {
  15207. type: localeType,
  15208. key: "locale",
  15209. editable: true,
  15210. value: composer.locale.value
  15211. },
  15212. {
  15213. type: localeType,
  15214. key: "fallbackLocale",
  15215. editable: true,
  15216. value: composer.fallbackLocale.value
  15217. },
  15218. {
  15219. type: localeType,
  15220. key: "availableLocales",
  15221. editable: false,
  15222. value: composer.availableLocales
  15223. },
  15224. {
  15225. type: localeType,
  15226. key: "inheritLocale",
  15227. editable: true,
  15228. value: composer.inheritLocale
  15229. }
  15230. ];
  15231. state[localeType] = localeStates;
  15232. const localeMessagesType = "Locale messages info";
  15233. const localeMessagesStates = [
  15234. {
  15235. type: localeMessagesType,
  15236. key: "messages",
  15237. editable: false,
  15238. value: getLocaleMessageValue(composer.messages.value)
  15239. }
  15240. ];
  15241. state[localeMessagesType] = localeMessagesStates;
  15242. const datetimeFormatsType = "Datetime formats info";
  15243. const datetimeFormatsStates = [
  15244. {
  15245. type: datetimeFormatsType,
  15246. key: "datetimeFormats",
  15247. editable: false,
  15248. value: composer.datetimeFormats.value
  15249. }
  15250. ];
  15251. state[datetimeFormatsType] = datetimeFormatsStates;
  15252. const numberFormatsType = "Datetime formats info";
  15253. const numberFormatsStates = [
  15254. {
  15255. type: numberFormatsType,
  15256. key: "numberFormats",
  15257. editable: false,
  15258. value: composer.numberFormats.value
  15259. }
  15260. ];
  15261. state[numberFormatsType] = numberFormatsStates;
  15262. return state;
  15263. }
  15264. function addTimelineEvent(event, payload) {
  15265. if (devtoolsApi) {
  15266. let groupId;
  15267. if (payload && "groupId" in payload) {
  15268. groupId = payload.groupId;
  15269. delete payload.groupId;
  15270. }
  15271. devtoolsApi.addTimelineEvent({
  15272. layerId: "vue-i18n-timeline",
  15273. event: {
  15274. title: event,
  15275. groupId,
  15276. time: Date.now(),
  15277. meta: {},
  15278. data: payload || {},
  15279. logType: event === "compile-error" ? "error" : event === "fallback" || event === "missing" ? "warning" : "default"
  15280. }
  15281. });
  15282. }
  15283. }
  15284. function editScope(payload, i18n2) {
  15285. const composer = getComposer$1(payload.nodeId, i18n2);
  15286. if (composer) {
  15287. const [field] = payload.path;
  15288. if (field === "locale" && isString(payload.state.value)) {
  15289. composer.locale.value = payload.state.value;
  15290. } else if (field === "fallbackLocale" && (isString(payload.state.value) || isArray(payload.state.value) || isObject$1(payload.state.value))) {
  15291. composer.fallbackLocale.value = payload.state.value;
  15292. } else if (field === "inheritLocale" && isBoolean(payload.state.value)) {
  15293. composer.inheritLocale = payload.state.value;
  15294. }
  15295. }
  15296. }
  15297. function defineMixin(vuei18n, composer, i18n2) {
  15298. return {
  15299. beforeCreate() {
  15300. const instance = vue.getCurrentInstance();
  15301. if (!instance) {
  15302. throw createI18nError(
  15303. 22
  15304. /* UNEXPECTED_ERROR */
  15305. );
  15306. }
  15307. const options = this.$options;
  15308. if (options.i18n) {
  15309. const optionsI18n = options.i18n;
  15310. if (options.__i18n) {
  15311. optionsI18n.__i18n = options.__i18n;
  15312. }
  15313. optionsI18n.__root = composer;
  15314. if (this === this.$root) {
  15315. this.$i18n = mergeToRoot(vuei18n, optionsI18n);
  15316. } else {
  15317. optionsI18n.__injectWithOption = true;
  15318. this.$i18n = createVueI18n(optionsI18n);
  15319. }
  15320. } else if (options.__i18n) {
  15321. if (this === this.$root) {
  15322. this.$i18n = mergeToRoot(vuei18n, options);
  15323. } else {
  15324. this.$i18n = createVueI18n({
  15325. __i18n: options.__i18n,
  15326. __injectWithOption: true,
  15327. __root: composer
  15328. });
  15329. }
  15330. } else {
  15331. this.$i18n = vuei18n;
  15332. }
  15333. vuei18n.__onComponentInstanceCreated(this.$i18n);
  15334. i18n2.__setInstance(instance, this.$i18n);
  15335. this.$t = (...args) => this.$i18n.t(...args);
  15336. this.$rt = (...args) => this.$i18n.rt(...args);
  15337. this.$tc = (...args) => this.$i18n.tc(...args);
  15338. this.$te = (key, locale) => this.$i18n.te(key, locale);
  15339. this.$d = (...args) => this.$i18n.d(...args);
  15340. this.$n = (...args) => this.$i18n.n(...args);
  15341. this.$tm = (key) => this.$i18n.tm(key);
  15342. },
  15343. mounted() {
  15344. {
  15345. this.$el.__VUE_I18N__ = this.$i18n.__composer;
  15346. const emitter = this.__v_emitter = createEmitter();
  15347. const _vueI18n = this.$i18n;
  15348. _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
  15349. emitter.on("*", addTimelineEvent);
  15350. }
  15351. },
  15352. beforeUnmount() {
  15353. const instance = vue.getCurrentInstance();
  15354. if (!instance) {
  15355. throw createI18nError(
  15356. 22
  15357. /* UNEXPECTED_ERROR */
  15358. );
  15359. }
  15360. {
  15361. if (this.__v_emitter) {
  15362. this.__v_emitter.off("*", addTimelineEvent);
  15363. delete this.__v_emitter;
  15364. }
  15365. const _vueI18n = this.$i18n;
  15366. _vueI18n.__disableEmitter && _vueI18n.__disableEmitter();
  15367. delete this.$el.__VUE_I18N__;
  15368. }
  15369. delete this.$t;
  15370. delete this.$rt;
  15371. delete this.$tc;
  15372. delete this.$te;
  15373. delete this.$d;
  15374. delete this.$n;
  15375. delete this.$tm;
  15376. i18n2.__deleteInstance(instance);
  15377. delete this.$i18n;
  15378. }
  15379. };
  15380. }
  15381. function mergeToRoot(root, options) {
  15382. root.locale = options.locale || root.locale;
  15383. root.fallbackLocale = options.fallbackLocale || root.fallbackLocale;
  15384. root.missing = options.missing || root.missing;
  15385. root.silentTranslationWarn = options.silentTranslationWarn || root.silentFallbackWarn;
  15386. root.silentFallbackWarn = options.silentFallbackWarn || root.silentFallbackWarn;
  15387. root.formatFallbackMessages = options.formatFallbackMessages || root.formatFallbackMessages;
  15388. root.postTranslation = options.postTranslation || root.postTranslation;
  15389. root.warnHtmlInMessage = options.warnHtmlInMessage || root.warnHtmlInMessage;
  15390. root.escapeParameterHtml = options.escapeParameterHtml || root.escapeParameterHtml;
  15391. root.sync = options.sync || root.sync;
  15392. root.__composer[SetPluralRulesSymbol](options.pluralizationRules || root.pluralizationRules);
  15393. const messages2 = getLocaleMessages(root.locale, {
  15394. messages: options.messages,
  15395. __i18n: options.__i18n
  15396. });
  15397. Object.keys(messages2).forEach((locale) => root.mergeLocaleMessage(locale, messages2[locale]));
  15398. if (options.datetimeFormats) {
  15399. Object.keys(options.datetimeFormats).forEach((locale) => root.mergeDateTimeFormat(locale, options.datetimeFormats[locale]));
  15400. }
  15401. if (options.numberFormats) {
  15402. Object.keys(options.numberFormats).forEach((locale) => root.mergeNumberFormat(locale, options.numberFormats[locale]));
  15403. }
  15404. return root;
  15405. }
  15406. function createI18n(options = {}) {
  15407. const __legacyMode = isBoolean(options.legacy) ? options.legacy : true;
  15408. const __globalInjection = !!options.globalInjection;
  15409. const __instances = /* @__PURE__ */ new Map();
  15410. const __global = __legacyMode ? createVueI18n(options) : createComposer(options);
  15411. const symbol = makeSymbol("vue-i18n");
  15412. const i18n2 = {
  15413. // mode
  15414. get mode() {
  15415. return __legacyMode ? "legacy" : "composition";
  15416. },
  15417. // install plugin
  15418. async install(app, ...options2) {
  15419. {
  15420. app.__VUE_I18N__ = i18n2;
  15421. }
  15422. app.__VUE_I18N_SYMBOL__ = symbol;
  15423. app.provide(app.__VUE_I18N_SYMBOL__, i18n2);
  15424. if (!__legacyMode && __globalInjection) {
  15425. injectGlobalFields(app, i18n2.global);
  15426. }
  15427. {
  15428. apply(app, i18n2, ...options2);
  15429. }
  15430. if (__legacyMode) {
  15431. app.mixin(defineMixin(__global, __global.__composer, i18n2));
  15432. }
  15433. {
  15434. const ret = await enableDevTools(app, i18n2);
  15435. if (!ret) {
  15436. throw createI18nError(
  15437. 21
  15438. /* CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN */
  15439. );
  15440. }
  15441. const emitter = createEmitter();
  15442. if (__legacyMode) {
  15443. const _vueI18n = __global;
  15444. _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
  15445. } else {
  15446. const _composer = __global;
  15447. _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
  15448. }
  15449. emitter.on("*", addTimelineEvent);
  15450. }
  15451. },
  15452. // global accessor
  15453. get global() {
  15454. return __global;
  15455. },
  15456. // @internal
  15457. __instances,
  15458. // @internal
  15459. __getInstance(component) {
  15460. return __instances.get(component) || null;
  15461. },
  15462. // @internal
  15463. __setInstance(component, instance) {
  15464. __instances.set(component, instance);
  15465. },
  15466. // @internal
  15467. __deleteInstance(component) {
  15468. __instances.delete(component);
  15469. }
  15470. };
  15471. return i18n2;
  15472. }
  15473. function useI18n(options = {}) {
  15474. const instance = vue.getCurrentInstance();
  15475. if (instance == null) {
  15476. throw createI18nError(
  15477. 16
  15478. /* MUST_BE_CALL_SETUP_TOP */
  15479. );
  15480. }
  15481. if (!instance.appContext.app.__VUE_I18N_SYMBOL__) {
  15482. throw createI18nError(
  15483. 17
  15484. /* NOT_INSLALLED */
  15485. );
  15486. }
  15487. const i18n2 = vue.inject(instance.appContext.app.__VUE_I18N_SYMBOL__);
  15488. if (!i18n2) {
  15489. throw createI18nError(
  15490. 22
  15491. /* UNEXPECTED_ERROR */
  15492. );
  15493. }
  15494. const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
  15495. const scope = isEmptyObject(options) ? "__i18n" in instance.type ? "local" : "global" : !options.useScope ? "local" : options.useScope;
  15496. if (scope === "global") {
  15497. let messages2 = isObject$1(options.messages) ? options.messages : {};
  15498. if ("__i18nGlobal" in instance.type) {
  15499. messages2 = getLocaleMessages(global2.locale.value, {
  15500. messages: messages2,
  15501. __i18n: instance.type.__i18nGlobal
  15502. });
  15503. }
  15504. const locales = Object.keys(messages2);
  15505. if (locales.length) {
  15506. locales.forEach((locale) => {
  15507. global2.mergeLocaleMessage(locale, messages2[locale]);
  15508. });
  15509. }
  15510. if (isObject$1(options.datetimeFormats)) {
  15511. const locales2 = Object.keys(options.datetimeFormats);
  15512. if (locales2.length) {
  15513. locales2.forEach((locale) => {
  15514. global2.mergeDateTimeFormat(locale, options.datetimeFormats[locale]);
  15515. });
  15516. }
  15517. }
  15518. if (isObject$1(options.numberFormats)) {
  15519. const locales2 = Object.keys(options.numberFormats);
  15520. if (locales2.length) {
  15521. locales2.forEach((locale) => {
  15522. global2.mergeNumberFormat(locale, options.numberFormats[locale]);
  15523. });
  15524. }
  15525. }
  15526. return global2;
  15527. }
  15528. if (scope === "parent") {
  15529. let composer2 = getComposer(i18n2, instance, options.__useComponent);
  15530. if (composer2 == null) {
  15531. {
  15532. warn(getWarnMessage(
  15533. 12
  15534. /* NOT_FOUND_PARENT_SCOPE */
  15535. ));
  15536. }
  15537. composer2 = global2;
  15538. }
  15539. return composer2;
  15540. }
  15541. if (i18n2.mode === "legacy") {
  15542. throw createI18nError(
  15543. 18
  15544. /* NOT_AVAILABLE_IN_LEGACY_MODE */
  15545. );
  15546. }
  15547. const i18nInternal = i18n2;
  15548. let composer = i18nInternal.__getInstance(instance);
  15549. if (composer == null) {
  15550. const type2 = instance.type;
  15551. const composerOptions = assign({}, options);
  15552. if (type2.__i18n) {
  15553. composerOptions.__i18n = type2.__i18n;
  15554. }
  15555. if (global2) {
  15556. composerOptions.__root = global2;
  15557. }
  15558. composer = createComposer(composerOptions);
  15559. setupLifeCycle(i18nInternal, instance, composer);
  15560. i18nInternal.__setInstance(instance, composer);
  15561. }
  15562. return composer;
  15563. }
  15564. function getComposer(i18n2, target, useComponent = false) {
  15565. let composer = null;
  15566. const root = target.root;
  15567. let current = target.parent;
  15568. while (current != null) {
  15569. const i18nInternal = i18n2;
  15570. if (i18n2.mode === "composition") {
  15571. composer = i18nInternal.__getInstance(current);
  15572. } else {
  15573. const vueI18n = i18nInternal.__getInstance(current);
  15574. if (vueI18n != null) {
  15575. composer = vueI18n.__composer;
  15576. }
  15577. if (useComponent && composer && !composer[InejctWithOption]) {
  15578. composer = null;
  15579. }
  15580. }
  15581. if (composer != null) {
  15582. break;
  15583. }
  15584. if (root === current) {
  15585. break;
  15586. }
  15587. current = current.parent;
  15588. }
  15589. return composer;
  15590. }
  15591. function setupLifeCycle(i18n2, target, composer) {
  15592. let emitter = null;
  15593. vue.onMounted(() => {
  15594. if (target.vnode.el) {
  15595. target.vnode.el.__VUE_I18N__ = composer;
  15596. emitter = createEmitter();
  15597. const _composer = composer;
  15598. _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
  15599. emitter.on("*", addTimelineEvent);
  15600. }
  15601. }, target);
  15602. vue.onUnmounted(() => {
  15603. if (target.vnode.el && target.vnode.el.__VUE_I18N__) {
  15604. emitter && emitter.off("*", addTimelineEvent);
  15605. const _composer = composer;
  15606. _composer[DisableEmitter] && _composer[DisableEmitter]();
  15607. delete target.vnode.el.__VUE_I18N__;
  15608. }
  15609. i18n2.__deleteInstance(target);
  15610. }, target);
  15611. }
  15612. const globalExportProps = [
  15613. "locale",
  15614. "fallbackLocale",
  15615. "availableLocales"
  15616. ];
  15617. const globalExportMethods = ["t", "rt", "d", "n", "tm"];
  15618. function injectGlobalFields(app, composer) {
  15619. const i18n2 = /* @__PURE__ */ Object.create(null);
  15620. globalExportProps.forEach((prop) => {
  15621. const desc = Object.getOwnPropertyDescriptor(composer, prop);
  15622. if (!desc) {
  15623. throw createI18nError(
  15624. 22
  15625. /* UNEXPECTED_ERROR */
  15626. );
  15627. }
  15628. const wrap = vue.isRef(desc.value) ? {
  15629. get() {
  15630. return desc.value.value;
  15631. },
  15632. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  15633. set(val) {
  15634. desc.value.value = val;
  15635. }
  15636. } : {
  15637. get() {
  15638. return desc.get && desc.get();
  15639. }
  15640. };
  15641. Object.defineProperty(i18n2, prop, wrap);
  15642. });
  15643. app.config.globalProperties.$i18n = i18n2;
  15644. globalExportMethods.forEach((method2) => {
  15645. const desc = Object.getOwnPropertyDescriptor(composer, method2);
  15646. if (!desc || !desc.value) {
  15647. throw createI18nError(
  15648. 22
  15649. /* UNEXPECTED_ERROR */
  15650. );
  15651. }
  15652. Object.defineProperty(app.config.globalProperties, `$${method2}`, desc);
  15653. });
  15654. }
  15655. {
  15656. initFeatureFlags();
  15657. }
  15658. {
  15659. const target = getGlobalThis();
  15660. target.__INTLIFY__ = true;
  15661. setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
  15662. }
  15663. const hello$2 = "你好";
  15664. const login$2 = "登录";
  15665. const register$2 = "注册";
  15666. const password$2 = "密码";
  15667. const password_repeat$2 = "重复密码";
  15668. const telno$2 = "手机号";
  15669. const new_member$2 = "新成员";
  15670. const navigationBarTitleText$2 = "心脑检测";
  15671. const add_member$2 = "添加家庭成员";
  15672. const father$2 = "爸爸";
  15673. const mother$2 = "妈妈";
  15674. const husband$2 = "老公";
  15675. const wife$2 = "老婆";
  15676. const other_member$2 = "其它亲友";
  15677. const add_member_text1$2 = "父母有没有";
  15678. const add_member_text2$2 = "心梗脑梗的风险?";
  15679. const add_member_text3$2 = "帮他们评测!";
  15680. const add_member_text4$2 = "爱人工作繁忙";
  15681. const add_member_text5$2 = "应酬多,压力大,常喝酒";
  15682. const add_member_text6$2 = "有没有心脑血管的隐患?";
  15683. const add_member_text7$2 = "其它男性亲友";
  15684. const add_member_text8$2 = "其它女性亲友";
  15685. const add_member_text9$2 = "请自行输入";
  15686. const submit$2 = "提交";
  15687. const show_report$2 = "评测结果";
  15688. const do_success$2 = "操作成功";
  15689. const illness_title$2 = "病名";
  15690. const report_score$2 = "评测分数";
  15691. const report_result$2 = "筛查结果";
  15692. const report_error_text_1$2 = "หากโรคอยู่แค่ชั้นผิวหนัง เพียงประคบร้อนก็รักษาได้! ก่อนหน้าคุณเราได้ช่วยให้ผู้ใช้มากมายค้นพบกับความเสี่ยง ขอเพียงให้ความสำคัญและสื่อสารกับแพทย์อย่างกระตือรือร้น ก็จะสามารถหลีกเลี่ยงความเสี่ยงต่อสุขภาพและชีวิตที่แท้จริงได้";
  15693. const report_error_text_2$2 = "เผชิญหน้าด้วยความคิดบวก ไปเข้ารับการตรวจที่เกี่ยวข้อง ณ โรงพยาบาลที่ได้มาตรฐานในพื้นที่!";
  15694. const report_error_text_3$2 = "ปรับพฤติกรรมการดำเนินชีวิตตามคำแนะนำด้านสุขภาพ เพื่อลดความเสี่ยง";
  15695. const report_text_1$2 = "คะแนนยังไม่เกิน";
  15696. const report_text_1_1$2 = "คะแนน ปัจจุบันความเสี่ยงต่อการเกิดโรคยังไม่สูง";
  15697. const health_advice$2 = "คำแนะนำด้านสุขภาพ";
  15698. const report_explain$2 = "评测说明";
  15699. const report_detail$2 = "รายละเอียดการตรวจคัดกรอง";
  15700. const report_explain_text_1$2 = "您已超过40岁,进入心脑血管的风险人群,此外,患糖尿病的机率也大大增加。";
  15701. const report_explain_text_2$2 = "男性的糖尿病风险高于女性,您更加要注意健康。";
  15702. const report_explain_text_3$2 = "您的BMI:";
  15703. const report_explain_text_3_1$2 = ",体型偏胖,您的身高";
  15704. const report_explain_text_3_2$2 = "厘米,您减重到";
  15705. const report_explain_text_3_3$2 = "公斤会更健康。";
  15706. const report_explain_text_4$2 = "您的血压也偏高,这将引发更多的健康问题,您需要与医生沟通,将血压降低。";
  15707. const report_explain_text_5$2 = "您有心脑血管家庭史,在生活习惯上要更加注意。";
  15708. const report_explain_text_6$2 = "您在烟酒、运动等方面有不良的生活习惯,建议调整。";
  15709. const report_explain_text_7$2 = "现在您已超过40岁,为健康着想,如果不能戒烟,也建议逐步减少吸烟量。";
  15710. const report_explain_text_8$2 = "您有上腹部疼痛并呕吐的风险症状,建议去正规医院检查。";
  15711. const report_explain_text_9$2 = "您有心前区疼痛且不缓解的症状,建议去正规医院检查。";
  15712. const report_explain_text_10$2 = "上方评分是根据国家糖尿病防治指南及中国心肌梗塞风险评分等心脑血管早期筛查标准为您做的评分,评分体系不同,后面是具体的解读,供您参考。";
  15713. const healthy_habits$2 = "健康习惯";
  15714. const y_n$2 = "是/否";
  15715. const healthy_personal_ratios$2 = "健康人员比例";
  15716. const all_people$2 = "全员";
  15717. const group_people$2 = "分组";
  15718. const report_text_4$2 = "分组是指同性别、同年龄段(不满40,40~49,超过50)用户的统计数据。";
  15719. const report_text_5$2 = "您已是会员,您享有如下权益。";
  15720. const report_text_6$2 = "在一年期内可以无限次评测。";
  15721. const report_text_7$2 = "同时可以给3位亲属无限次评测。";
  15722. const report_text_8$2 = "如果您第一次评测的结果显示您三项均无风险,系统将会您增加1-2位亲属名额,同时您第一次分享本报告页,进来的朋友可以成为免费会员,免费会员数量和您的年龄相关。";
  15723. const report_text_9$2 = "已完成,返回首页为家人评测,开启健康管理。";
  15724. const y$2 = "是";
  15725. const n$2 = "否";
  15726. const select_age$2 = "อายุ";
  15727. const select_age_1$2 = "岁";
  15728. const select_age_2$2 = "岁以上";
  15729. const select_age_3$2 = "岁以下";
  15730. const select_sex$2 = "เพศ";
  15731. const calculate_BMI$2 = "计算BMI";
  15732. const select$2 = "选择";
  15733. const height$2 = "ส่วนสูง";
  15734. const weight$2 = "น้ำหนัก";
  15735. const selectcanvas_text1$2 = "请输入被评测人身高体重";
  15736. const selectcanvas_text2$2 = "BMI是人体的胖瘦程度的量化指标,其大小与许多疾病风险程度相关联。";
  15737. const selectcanvas_text3$2 = "身高取整数,体重按0.5公斤选取即可。";
  15738. const report_user$2 = "ผู้รับการประเมินผล";
  15739. const selectage_test1$2 = "请选择被评测人年龄";
  15740. const selectage_test2$2 = "从29岁开始,一些对健康影响较大的慢性病的风险就开始增加,年龄无法改变,但可以改变生活习惯。";
  15741. const next_step$2 = "下一步";
  15742. const show_info_text1$2 = "您的BMI已超过";
  15743. const show_info_text2$2 = "ผู้ใช้";
  15744. const less_than$2 = "小于";
  15745. const greater_than$2 = "大于";
  15746. const selectwaistline_text1$2 = "请左右滑动选择被评测人腰围";
  15747. const selectwaistline_text2$2 = "腰围是内脏脂肪含量是否过多体现,内脏脂肪过多是多种疾病的诱因。";
  15748. const selectwaistline_text3$2 = "JAMA最新发表的研究指出,腰臀比超过一定数值,并且收缩压过高的人群,心血管死亡风险明显上升,所以,保持腰臀比不仅仅是爱美的需求,对身体健康也非常重要。";
  15749. const selectwaistline_text4$2 = "关于腰臀比的研究有定量的研究结果时,我们也会更新评测内容。";
  15750. const selectwaistline_text5$2 = "评测只需要您正确提供腰围的范围即可,如果不清楚,提交你合身的裤子的尺码即可,坐标下方有尺码值供参考。";
  15751. const waistline$2 = "เส้นรอบเอว";
  15752. const waistline_text1$2 = "尺";
  15753. const waistline_text2$2 = "寸";
  15754. const scale_evaluation$2 = "量表评测";
  15755. const selectsbp_text1$2 = "请输入评测对象血压所在范围";
  15756. const selectsbp_text2$2 = "与疾病相关的主要指标是高压,您只需提供高压数据,选择范围正确即可";
  15757. const selectsbp_text3$2 = "如果有服降压药,请提供矫治前的高压数据,高血压患者一般在140以上";
  15758. const selectsbp_text4$2 = "如果你确认不知道血压,没有高血压,你可以填写常规范围,110-120,如果当评测结果在合格线左右3分范围内,您需要测量血压重新评估";
  15759. const hg_text1$2 = "mmHg以下";
  15760. const hg_text2$2 = "mmHg";
  15761. const hg_text3$2 = "mmHg之间";
  15762. const hg_text4$2 = "mmHg之上";
  15763. const blood_pressure$2 = "ความดันโลหิต";
  15764. const low_risk$2 = "低风险";
  15765. const risk$2 = "有风险";
  15766. const valuating_people$2 = "ผู้รับการประเมินผล";
  15767. const completion_text_1$2 = "糖尿病、脑梗的风险筛查已完成!";
  15768. const completion_text_2$2 = "请继续完成余下问题。";
  15769. const questions_remaining$2 = "个问题剩余";
  15770. const have$2 = "有";
  15771. const same_as_you$2 = "用户和您相同";
  15772. const select_gender_for_valuating_people$2 = "请选择评测对象性别";
  15773. const select_gender_text_1$2 = "研究表明,针对某一疾病,男女两性风险不同。例如糖尿病,男性患病风险更高,需要更加注意饮食习惯与控制腰围。";
  15774. const is_man$2 = "เป็นเพศชาย";
  15775. const is_female$2 = "เป็นเพศหญิง";
  15776. const man$2 = "男";
  15777. const female$2 = "女";
  15778. const index_text_1$2 = "给爸爸、妈妈、爱人测一测";
  15779. const index_text_2$2 = "健康的生活习惯是预防心脑血管疾病最好的策略!";
  15780. const index_text_3$2 = "早期筛检";
  15781. const index_text_4$2 = "主动预防";
  15782. const index_text_5$2 = "保家人健康 保家庭平安";
  15783. const index_text_6$2 = "排除风险 安心!放心";
  15784. const index_btn_1$2 = "เริ่มประเมินผล";
  15785. const index_btn_2$2 = "ตรวจดูรายงาน";
  15786. const index_btn_3$2 = "ประเมินผลใหม่";
  15787. const share$2 = "分享";
  15788. const share_text$2 = "心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。";
  15789. const member_add_text_1$2 = "每个人都关心家人健康";
  15790. const member_add_text_2$2 = "但我们可以做得更多";
  15791. const telno_null$2 = "手机号必填";
  15792. const password_null$2 = "密码必填";
  15793. const telno_error$2 = "手机号错误";
  15794. const password_repeat_error$2 = "重复密码不相同";
  15795. const register_error$2 = "注册失败";
  15796. const member_num_than_max$2 = "家人不能超过上限";
  15797. const member_title_null$2 = "亲友名未填";
  15798. const completion_problem_for_valuating_people$2 = "请为评测对象完成问题";
  15799. const please_completion_problem$2 = "请填写完内容";
  15800. const system_error$2 = "系统错误";
  15801. const not_selected$2 = "未选择";
  15802. const EN = {
  15803. hello: hello$2,
  15804. login: login$2,
  15805. register: register$2,
  15806. password: password$2,
  15807. password_repeat: password_repeat$2,
  15808. telno: telno$2,
  15809. new_member: new_member$2,
  15810. navigationBarTitleText: navigationBarTitleText$2,
  15811. add_member: add_member$2,
  15812. father: father$2,
  15813. mother: mother$2,
  15814. husband: husband$2,
  15815. wife: wife$2,
  15816. other_member: other_member$2,
  15817. add_member_text1: add_member_text1$2,
  15818. add_member_text2: add_member_text2$2,
  15819. add_member_text3: add_member_text3$2,
  15820. add_member_text4: add_member_text4$2,
  15821. add_member_text5: add_member_text5$2,
  15822. add_member_text6: add_member_text6$2,
  15823. add_member_text7: add_member_text7$2,
  15824. add_member_text8: add_member_text8$2,
  15825. add_member_text9: add_member_text9$2,
  15826. submit: submit$2,
  15827. show_report: show_report$2,
  15828. do_success: do_success$2,
  15829. illness_title: illness_title$2,
  15830. report_score: report_score$2,
  15831. report_result: report_result$2,
  15832. report_error_text_1: report_error_text_1$2,
  15833. report_error_text_2: report_error_text_2$2,
  15834. report_error_text_3: report_error_text_3$2,
  15835. report_text_1: report_text_1$2,
  15836. report_text_1_1: report_text_1_1$2,
  15837. health_advice: health_advice$2,
  15838. report_explain: report_explain$2,
  15839. report_detail: report_detail$2,
  15840. report_explain_text_1: report_explain_text_1$2,
  15841. report_explain_text_2: report_explain_text_2$2,
  15842. report_explain_text_3: report_explain_text_3$2,
  15843. report_explain_text_3_1: report_explain_text_3_1$2,
  15844. report_explain_text_3_2: report_explain_text_3_2$2,
  15845. report_explain_text_3_3: report_explain_text_3_3$2,
  15846. report_explain_text_4: report_explain_text_4$2,
  15847. report_explain_text_5: report_explain_text_5$2,
  15848. report_explain_text_6: report_explain_text_6$2,
  15849. report_explain_text_7: report_explain_text_7$2,
  15850. report_explain_text_8: report_explain_text_8$2,
  15851. report_explain_text_9: report_explain_text_9$2,
  15852. report_explain_text_10: report_explain_text_10$2,
  15853. healthy_habits: healthy_habits$2,
  15854. y_n: y_n$2,
  15855. healthy_personal_ratios: healthy_personal_ratios$2,
  15856. all_people: all_people$2,
  15857. group_people: group_people$2,
  15858. report_text_4: report_text_4$2,
  15859. report_text_5: report_text_5$2,
  15860. report_text_6: report_text_6$2,
  15861. report_text_7: report_text_7$2,
  15862. report_text_8: report_text_8$2,
  15863. report_text_9: report_text_9$2,
  15864. y: y$2,
  15865. n: n$2,
  15866. select_age: select_age$2,
  15867. select_age_1: select_age_1$2,
  15868. select_age_2: select_age_2$2,
  15869. select_age_3: select_age_3$2,
  15870. select_sex: select_sex$2,
  15871. calculate_BMI: calculate_BMI$2,
  15872. select: select$2,
  15873. height: height$2,
  15874. weight: weight$2,
  15875. selectcanvas_text1: selectcanvas_text1$2,
  15876. selectcanvas_text2: selectcanvas_text2$2,
  15877. selectcanvas_text3: selectcanvas_text3$2,
  15878. report_user: report_user$2,
  15879. selectage_test1: selectage_test1$2,
  15880. selectage_test2: selectage_test2$2,
  15881. next_step: next_step$2,
  15882. show_info_text1: show_info_text1$2,
  15883. show_info_text2: show_info_text2$2,
  15884. less_than: less_than$2,
  15885. greater_than: greater_than$2,
  15886. selectwaistline_text1: selectwaistline_text1$2,
  15887. selectwaistline_text2: selectwaistline_text2$2,
  15888. selectwaistline_text3: selectwaistline_text3$2,
  15889. selectwaistline_text4: selectwaistline_text4$2,
  15890. selectwaistline_text5: selectwaistline_text5$2,
  15891. waistline: waistline$2,
  15892. waistline_text1: waistline_text1$2,
  15893. waistline_text2: waistline_text2$2,
  15894. scale_evaluation: scale_evaluation$2,
  15895. selectsbp_text1: selectsbp_text1$2,
  15896. selectsbp_text2: selectsbp_text2$2,
  15897. selectsbp_text3: selectsbp_text3$2,
  15898. selectsbp_text4: selectsbp_text4$2,
  15899. hg_text1: hg_text1$2,
  15900. hg_text2: hg_text2$2,
  15901. hg_text3: hg_text3$2,
  15902. hg_text4: hg_text4$2,
  15903. blood_pressure: blood_pressure$2,
  15904. low_risk: low_risk$2,
  15905. risk: risk$2,
  15906. valuating_people: valuating_people$2,
  15907. completion_text_1: completion_text_1$2,
  15908. completion_text_2: completion_text_2$2,
  15909. questions_remaining: questions_remaining$2,
  15910. have: have$2,
  15911. same_as_you: same_as_you$2,
  15912. select_gender_for_valuating_people: select_gender_for_valuating_people$2,
  15913. select_gender_text_1: select_gender_text_1$2,
  15914. is_man: is_man$2,
  15915. is_female: is_female$2,
  15916. man: man$2,
  15917. female: female$2,
  15918. index_text_1: index_text_1$2,
  15919. index_text_2: index_text_2$2,
  15920. index_text_3: index_text_3$2,
  15921. index_text_4: index_text_4$2,
  15922. index_text_5: index_text_5$2,
  15923. index_text_6: index_text_6$2,
  15924. index_btn_1: index_btn_1$2,
  15925. index_btn_2: index_btn_2$2,
  15926. index_btn_3: index_btn_3$2,
  15927. share: share$2,
  15928. share_text: share_text$2,
  15929. member_add_text_1: member_add_text_1$2,
  15930. member_add_text_2: member_add_text_2$2,
  15931. telno_null: telno_null$2,
  15932. password_null: password_null$2,
  15933. telno_error: telno_error$2,
  15934. password_repeat_error: password_repeat_error$2,
  15935. register_error: register_error$2,
  15936. member_num_than_max: member_num_than_max$2,
  15937. member_title_null: member_title_null$2,
  15938. completion_problem_for_valuating_people: completion_problem_for_valuating_people$2,
  15939. please_completion_problem: please_completion_problem$2,
  15940. system_error: system_error$2,
  15941. not_selected: not_selected$2
  15942. };
  15943. const hello$1 = "你好";
  15944. const login$1 = "登录";
  15945. const register$1 = "注册";
  15946. const password$1 = "密码";
  15947. const password_repeat$1 = "重复密码";
  15948. const telno$1 = "手机号";
  15949. const new_member$1 = "新成员";
  15950. const navigationBarTitleText$1 = "心脑检测";
  15951. const add_member$1 = "添加家庭成员";
  15952. const father$1 = "爸爸";
  15953. const mother$1 = "妈妈";
  15954. const husband$1 = "老公";
  15955. const wife$1 = "老婆";
  15956. const other_member$1 = "其它亲友";
  15957. const add_member_text1$1 = "父母有没有";
  15958. const add_member_text2$1 = "心梗脑梗的风险?";
  15959. const add_member_text3$1 = "帮他们评测!";
  15960. const add_member_text4$1 = "爱人工作繁忙";
  15961. const add_member_text5$1 = "应酬多,压力大,常喝酒";
  15962. const add_member_text6$1 = "有没有心脑血管的隐患?";
  15963. const add_member_text7$1 = "其它男性亲友";
  15964. const add_member_text8$1 = "其它女性亲友";
  15965. const add_member_text9$1 = "请自行输入";
  15966. const submit$1 = "提交";
  15967. const show_report$1 = "评测结果";
  15968. const do_success$1 = "操作成功";
  15969. const illness_title$1 = "病名";
  15970. const report_score$1 = "评测分数";
  15971. const report_result$1 = "筛查结果";
  15972. const report_error_text_1$1 = "疾在腠理,汤熨之所及也!在您之前我们已经帮很多位用户发现了风险,只要重视并积极与医生沟通,就能避免真正的健康和生命风险。";
  15973. const report_error_text_2$1 = "积极面对,去当地正规医院做相应检查!";
  15974. const report_error_text_3$1 = "按健康建议调整生活习惯,降低风险。";
  15975. const report_text_1$1 = "评分未超过";
  15976. const report_text_1_1$1 = "分,目前患病风险不高。";
  15977. const health_advice$1 = "健康建议";
  15978. const report_explain$1 = "评测说明";
  15979. const report_detail$1 = "筛查详情";
  15980. const report_explain_text_1$1 = "您已超过40岁,进入心脑血管的风险人群,此外,患糖尿病的机率也大大增加。";
  15981. const report_explain_text_2$1 = "男性的糖尿病风险高于女性,您更加要注意健康。";
  15982. const report_explain_text_3$1 = "您的BMI:";
  15983. const report_explain_text_3_1$1 = ",体型偏胖,您的身高";
  15984. const report_explain_text_3_2$1 = "厘米,您减重到";
  15985. const report_explain_text_3_3$1 = "公斤会更健康。";
  15986. const report_explain_text_4$1 = "您的血压也偏高,这将引发更多的健康问题,您需要与医生沟通,将血压降低。";
  15987. const report_explain_text_5$1 = "您有心脑血管家庭史,在生活习惯上要更加注意。";
  15988. const report_explain_text_6$1 = "您在烟酒、运动等方面有不良的生活习惯,建议调整。";
  15989. const report_explain_text_7$1 = "现在您已超过40岁,为健康着想,如果不能戒烟,也建议逐步减少吸烟量。";
  15990. const report_explain_text_8$1 = "您有上腹部疼痛并呕吐的风险症状,建议去正规医院检查。";
  15991. const report_explain_text_9$1 = "您有心前区疼痛且不缓解的症状,建议去正规医院检查。";
  15992. const report_explain_text_10$1 = "上方评分是根据国家糖尿病防治指南及中国心肌梗塞风险评分等心脑血管早期筛查标准为您做的评分,评分体系不同,后面是具体的解读,供您参考。";
  15993. const healthy_habits$1 = "健康习惯";
  15994. const y_n$1 = "是/否";
  15995. const healthy_personal_ratios$1 = "健康人员比例";
  15996. const all_people$1 = "全员";
  15997. const group_people$1 = "分组";
  15998. const report_text_4$1 = "分组是指同性别、同年龄段(不满40,40~49,超过50)用户的统计数据。";
  15999. const report_text_5$1 = "您已是会员,您享有如下权益。";
  16000. const report_text_6$1 = "在一年期内可以无限次评测。";
  16001. const report_text_7$1 = "同时可以给3位亲属无限次评测。";
  16002. const report_text_8$1 = "如果您第一次评测的结果显示您三项均无风险,系统将会您增加1-2位亲属名额,同时您第一次分享本报告页,进来的朋友可以成为免费会员,免费会员数量和您的年龄相关。";
  16003. const report_text_9$1 = "已完成,返回首页为家人评测,开启健康管理。";
  16004. const y$1 = "是";
  16005. const n$1 = "否";
  16006. const select_age$1 = "年龄";
  16007. const select_age_1$1 = "岁";
  16008. const select_age_2$1 = "岁以上";
  16009. const select_age_3$1 = "岁以下";
  16010. const select_sex$1 = "性别";
  16011. const calculate_BMI$1 = "计算BMI";
  16012. const select$1 = "选择";
  16013. const height$1 = "身高";
  16014. const weight$1 = "体重";
  16015. const selectcanvas_text1$1 = "请输入被评测人身高体重";
  16016. const selectcanvas_text2$1 = "BMI是人体的胖瘦程度的量化指标,其大小与许多疾病风险程度相关联。";
  16017. const selectcanvas_text3$1 = "身高取整数,体重按0.5公斤选取即可。";
  16018. const report_user$1 = "评测对象";
  16019. const selectage_test1$1 = "请选择被评测人年龄";
  16020. const selectage_test2$1 = "从29岁开始,一些对健康影响较大的慢性病的风险就开始增加,年龄无法改变,但可以改变生活习惯。";
  16021. const next_step$1 = "下一步";
  16022. const show_info_text1$1 = "您的BMI已超过";
  16023. const show_info_text2$1 = "用户";
  16024. const less_than$1 = "小于";
  16025. const greater_than$1 = "大于";
  16026. const selectwaistline_text1$1 = "请左右滑动选择被评测人腰围";
  16027. const selectwaistline_text2$1 = "腰围是内脏脂肪含量是否过多体现,内脏脂肪过多是多种疾病的诱因。";
  16028. const selectwaistline_text3$1 = "JAMA最新发表的研究指出,腰臀比超过一定数值,并且收缩压过高的人群,心血管死亡风险明显上升,所以,保持腰臀比不仅仅是爱美的需求,对身体健康也非常重要。";
  16029. const selectwaistline_text4$1 = "关于腰臀比的研究有定量的研究结果时,我们也会更新评测内容。";
  16030. const selectwaistline_text5$1 = "评测只需要您正确提供腰围的范围即可,如果不清楚,提交你合身的裤子的尺码即可,坐标下方有尺码值供参考。";
  16031. const waistline$1 = "腰围";
  16032. const waistline_text1$1 = "尺";
  16033. const waistline_text2$1 = "寸";
  16034. const scale_evaluation$1 = "量表评测";
  16035. const selectsbp_text1$1 = "请输入评测对象血压所在范围";
  16036. const selectsbp_text2$1 = "与疾病相关的主要指标是高压,您只需提供高压数据,选择范围正确即可";
  16037. const selectsbp_text3$1 = "如果有服降压药,请提供矫治前的高压数据,高血压患者一般在140以上";
  16038. const selectsbp_text4$1 = "如果你确认不知道血压,没有高血压,你可以填写常规范围,110-120,如果当评测结果在合格线左右3分范围内,您需要测量血压重新评估";
  16039. const hg_text1$1 = "mmHg以下";
  16040. const hg_text2$1 = "mmHg";
  16041. const hg_text3$1 = "mmHg之间";
  16042. const hg_text4$1 = "mmHg之上";
  16043. const blood_pressure$1 = "血压";
  16044. const low_risk$1 = "低风险";
  16045. const risk$1 = "有风险";
  16046. const valuating_people$1 = "评测对象";
  16047. const completion_text_1$1 = "糖尿病、脑梗的风险筛查已完成!";
  16048. const completion_text_2$1 = "请继续完成余下问题。";
  16049. const questions_remaining$1 = "个问题剩余";
  16050. const have$1 = "有";
  16051. const same_as_you$1 = "用户和您相同";
  16052. const select_gender_for_valuating_people$1 = "请选择评测对象性别";
  16053. const select_gender_text_1$1 = "研究表明,针对某一疾病,男女两性风险不同。例如糖尿病,男性患病风险更高,需要更加注意饮食习惯与控制腰围。";
  16054. const is_man$1 = "是男性";
  16055. const is_female$1 = "是女性";
  16056. const man$1 = "男";
  16057. const female$1 = "女";
  16058. const index_text_1$1 = "给爸爸、妈妈、爱人测一测";
  16059. const index_text_2$1 = "健康的生活习惯是预防心脑血管疾病最好的策略!";
  16060. const index_text_3$1 = "早期筛检";
  16061. const index_text_4$1 = "主动预防";
  16062. const index_text_5$1 = "保家人健康 保家庭平安";
  16063. const index_text_6$1 = "排除风险 安心!放心";
  16064. const index_btn_1$1 = "开始评测";
  16065. const index_btn_2$1 = "查看报告";
  16066. const index_btn_3$1 = "重新评测";
  16067. const share$1 = "分享";
  16068. const share_text$1 = "心脑血管早期筛查,简单易得,有利无害,分享给朋友家人。";
  16069. const member_add_text_1$1 = "每个人都关心家人健康";
  16070. const member_add_text_2$1 = "但我们可以做得更多";
  16071. const telno_null$1 = "手机号必填";
  16072. const password_null$1 = "密码必填";
  16073. const telno_error$1 = "手机号错误";
  16074. const password_repeat_error$1 = "重复密码不相同";
  16075. const register_error$1 = "注册失败";
  16076. const member_num_than_max$1 = "家人不能超过上限";
  16077. const member_title_null$1 = "亲友名未填";
  16078. const completion_problem_for_valuating_people$1 = "请为评测对象完成问题";
  16079. const please_completion_problem$1 = "请填写完内容";
  16080. const system_error$1 = "系统错误";
  16081. const not_selected$1 = "未选择";
  16082. const ZH = {
  16083. hello: hello$1,
  16084. login: login$1,
  16085. register: register$1,
  16086. password: password$1,
  16087. password_repeat: password_repeat$1,
  16088. telno: telno$1,
  16089. new_member: new_member$1,
  16090. navigationBarTitleText: navigationBarTitleText$1,
  16091. add_member: add_member$1,
  16092. father: father$1,
  16093. mother: mother$1,
  16094. husband: husband$1,
  16095. wife: wife$1,
  16096. other_member: other_member$1,
  16097. add_member_text1: add_member_text1$1,
  16098. add_member_text2: add_member_text2$1,
  16099. add_member_text3: add_member_text3$1,
  16100. add_member_text4: add_member_text4$1,
  16101. add_member_text5: add_member_text5$1,
  16102. add_member_text6: add_member_text6$1,
  16103. add_member_text7: add_member_text7$1,
  16104. add_member_text8: add_member_text8$1,
  16105. add_member_text9: add_member_text9$1,
  16106. submit: submit$1,
  16107. show_report: show_report$1,
  16108. do_success: do_success$1,
  16109. illness_title: illness_title$1,
  16110. report_score: report_score$1,
  16111. report_result: report_result$1,
  16112. report_error_text_1: report_error_text_1$1,
  16113. report_error_text_2: report_error_text_2$1,
  16114. report_error_text_3: report_error_text_3$1,
  16115. report_text_1: report_text_1$1,
  16116. report_text_1_1: report_text_1_1$1,
  16117. health_advice: health_advice$1,
  16118. report_explain: report_explain$1,
  16119. report_detail: report_detail$1,
  16120. report_explain_text_1: report_explain_text_1$1,
  16121. report_explain_text_2: report_explain_text_2$1,
  16122. report_explain_text_3: report_explain_text_3$1,
  16123. report_explain_text_3_1: report_explain_text_3_1$1,
  16124. report_explain_text_3_2: report_explain_text_3_2$1,
  16125. report_explain_text_3_3: report_explain_text_3_3$1,
  16126. report_explain_text_4: report_explain_text_4$1,
  16127. report_explain_text_5: report_explain_text_5$1,
  16128. report_explain_text_6: report_explain_text_6$1,
  16129. report_explain_text_7: report_explain_text_7$1,
  16130. report_explain_text_8: report_explain_text_8$1,
  16131. report_explain_text_9: report_explain_text_9$1,
  16132. report_explain_text_10: report_explain_text_10$1,
  16133. healthy_habits: healthy_habits$1,
  16134. y_n: y_n$1,
  16135. healthy_personal_ratios: healthy_personal_ratios$1,
  16136. all_people: all_people$1,
  16137. group_people: group_people$1,
  16138. report_text_4: report_text_4$1,
  16139. report_text_5: report_text_5$1,
  16140. report_text_6: report_text_6$1,
  16141. report_text_7: report_text_7$1,
  16142. report_text_8: report_text_8$1,
  16143. report_text_9: report_text_9$1,
  16144. y: y$1,
  16145. n: n$1,
  16146. select_age: select_age$1,
  16147. select_age_1: select_age_1$1,
  16148. select_age_2: select_age_2$1,
  16149. select_age_3: select_age_3$1,
  16150. select_sex: select_sex$1,
  16151. calculate_BMI: calculate_BMI$1,
  16152. select: select$1,
  16153. height: height$1,
  16154. weight: weight$1,
  16155. selectcanvas_text1: selectcanvas_text1$1,
  16156. selectcanvas_text2: selectcanvas_text2$1,
  16157. selectcanvas_text3: selectcanvas_text3$1,
  16158. report_user: report_user$1,
  16159. selectage_test1: selectage_test1$1,
  16160. selectage_test2: selectage_test2$1,
  16161. next_step: next_step$1,
  16162. show_info_text1: show_info_text1$1,
  16163. show_info_text2: show_info_text2$1,
  16164. less_than: less_than$1,
  16165. greater_than: greater_than$1,
  16166. selectwaistline_text1: selectwaistline_text1$1,
  16167. selectwaistline_text2: selectwaistline_text2$1,
  16168. selectwaistline_text3: selectwaistline_text3$1,
  16169. selectwaistline_text4: selectwaistline_text4$1,
  16170. selectwaistline_text5: selectwaistline_text5$1,
  16171. waistline: waistline$1,
  16172. waistline_text1: waistline_text1$1,
  16173. waistline_text2: waistline_text2$1,
  16174. scale_evaluation: scale_evaluation$1,
  16175. selectsbp_text1: selectsbp_text1$1,
  16176. selectsbp_text2: selectsbp_text2$1,
  16177. selectsbp_text3: selectsbp_text3$1,
  16178. selectsbp_text4: selectsbp_text4$1,
  16179. hg_text1: hg_text1$1,
  16180. hg_text2: hg_text2$1,
  16181. hg_text3: hg_text3$1,
  16182. hg_text4: hg_text4$1,
  16183. blood_pressure: blood_pressure$1,
  16184. low_risk: low_risk$1,
  16185. risk: risk$1,
  16186. valuating_people: valuating_people$1,
  16187. completion_text_1: completion_text_1$1,
  16188. completion_text_2: completion_text_2$1,
  16189. questions_remaining: questions_remaining$1,
  16190. have: have$1,
  16191. same_as_you: same_as_you$1,
  16192. select_gender_for_valuating_people: select_gender_for_valuating_people$1,
  16193. select_gender_text_1: select_gender_text_1$1,
  16194. is_man: is_man$1,
  16195. is_female: is_female$1,
  16196. man: man$1,
  16197. female: female$1,
  16198. index_text_1: index_text_1$1,
  16199. index_text_2: index_text_2$1,
  16200. index_text_3: index_text_3$1,
  16201. index_text_4: index_text_4$1,
  16202. index_text_5: index_text_5$1,
  16203. index_text_6: index_text_6$1,
  16204. index_btn_1: index_btn_1$1,
  16205. index_btn_2: index_btn_2$1,
  16206. index_btn_3: index_btn_3$1,
  16207. share: share$1,
  16208. share_text: share_text$1,
  16209. member_add_text_1: member_add_text_1$1,
  16210. member_add_text_2: member_add_text_2$1,
  16211. telno_null: telno_null$1,
  16212. password_null: password_null$1,
  16213. telno_error: telno_error$1,
  16214. password_repeat_error: password_repeat_error$1,
  16215. register_error: register_error$1,
  16216. member_num_than_max: member_num_than_max$1,
  16217. member_title_null: member_title_null$1,
  16218. completion_problem_for_valuating_people: completion_problem_for_valuating_people$1,
  16219. please_completion_problem: please_completion_problem$1,
  16220. system_error: system_error$1,
  16221. not_selected: not_selected$1
  16222. };
  16223. const hello = "สวัสดี";
  16224. const login = "เข้าสู่ระบบ";
  16225. const register = "ลงทะเบียน";
  16226. const password = "รหัสผ่าน";
  16227. const password_repeat = "ทำซ้ำรหัสผ่าน";
  16228. const telno = "หมายเลขโทรศัพท์มือถือ";
  16229. const new_member = "สมาชิกใหม่";
  16230. const navigationBarTitleText = "การตรวจหัวใจและสมอง";
  16231. const add_member = "เพิ่มสมาชิกในครอบครัว";
  16232. const father = "พ่อ";
  16233. const mother = "แม่จ๋า";
  16234. const husband = "สามี";
  16235. const wife = "ภรรยา";
  16236. const other_member = "ญาติและเพื่อนอื่น ๆ";
  16237. const add_member_text1 = "พ่อแม่เสี่ยงเป็นโรคกล้ามเนื้อหัวใจตายหรือไม่";
  16238. const add_member_text2 = "ความเสี่ยงในการควบคุมจิตใจ";
  16239. const add_member_text3 = "ช่วยให้พวกเขาประเมิน!";
  16240. const add_member_text4 = "งานยุ่ง";
  16241. const add_member_text5 = "ดื่มเป็นประจำ";
  16242. const add_member_text6 = "มีอันตรายที่ซ่อนอยู่หรือไม่มีหัวใจและหลอดเลือดสมอง?";
  16243. const add_member_text7 = "ญาติและเพื่อนชายอื่น ๆ";
  16244. const add_member_text8 = "ญาติและเพื่อนหญิงอื่น ๆ";
  16245. const add_member_text9 = "กรุณากรอกข้อมูลด้วยตัวเอง";
  16246. const submit = "ส่ง";
  16247. const show_report = "ผลการประเมิน";
  16248. const do_success = "ความสำเร็จในการดำเนินงาน";
  16249. const illness_title = "ชนิดโรค";
  16250. const report_score = "คะแนนประเมินผล";
  16251. const report_result = "ผลการตรวจคัดกรอง";
  16252. const report_error_text_1 = "หากโรคอยู่แค่ชั้นผิวหนัง เพียงประคบร้อนก็รักษาได้! ก่อนหน้าคุณเราได้ช่วยให้ผู้ใช้มากมายค้นพบกับความเสี่ยง ขอเพียงให้ความสำคัญและสื่อสารกับแพทย์อย่างกระตือรือร้น ก็จะสามารถหลีกเลี่ยงความเสี่ยงต่อสุขภาพและชีวิตที่แท้จริงได้。";
  16253. const report_error_text_2 = "เผชิญหน้าด้วยความคิดบวก ไปเข้ารับการตรวจที่เกี่ยวข้อง ณ โรงพยาบาลที่ได้มาตรฐานในพื้นที่!";
  16254. const report_error_text_3 = "ปรับพฤติกรรมการดำเนินชีวิตตามคำแนะนำด้านสุขภาพ เพื่อลดความเสี่ยง。";
  16255. const report_text_1 = "คะแนนยังไม่เกิน ";
  16256. const report_text_1_1 = "คะแนน ปัจจุบันความเสี่ยงต่อการเกิดโรคยังไม่สูง。";
  16257. const health_advice = "คำแนะนำด้านสุขภาพ";
  16258. const report_explain = "หมายเหตุการประเมิน";
  16259. const report_detail = "รายละเอียดการตรวจคัดกรอง";
  16260. const report_explain_text_1 = "คุณอายุเกิน 40 ปี กลุ่มเสี่ยงที่เข้าสู่หลอดเลือดหัวใจและสมอง นอกจากนี้ โอกาสในการเป็นโรคเบาหวานก็เพิ่มขึ้นอย่างมาก。";
  16261. const report_explain_text_2 = "ผู้ชายมีความเสี่ยงต่อโรคเบาหวานสูงกว่าผู้หญิง, คุณควรดูแลสุขภาพมากขึ้น。";
  16262. const report_explain_text_3 = "BMI ของคุณ:";
  16263. const report_explain_text_3_1 = ",รูปร่างค่อนข้างอ้วน,ความสูงของคุณ";
  16264. const report_explain_text_3_2 = "เซนติเมตร,คุณลดน้ำหนักถึง";
  16265. const report_explain_text_3_3 = "กิโลกรัม,จะมีสุขภาพที่ดีขึ้น。";
  16266. const report_explain_text_4 = "ความดันโลหิตของคุณยังสูงซึ่งจะก่อให้เกิดปัญหาสุขภาพมากขึ้นคุณจำเป็นต้องสื่อสารกับแพทย์ของคุณเพื่อลดความดันโลหิต。";
  16267. const report_explain_text_5 = "คุณมีประวัติครอบครัวเกี่ยวกับหัวใจและหลอดเลือดสมอง,ให้ความสำคัญกับพฤติกรรมการใช้ชีวิตมากขึ้น。";
  16268. const report_explain_text_6 = "คุณมีนิสัยการใช้ชีวิตที่ไม่ดีเช่นบุหรี่และเหล้าขาดการออกกำลังกาย,แนะนำการปรับ。";
  16269. const report_explain_text_7 = "ตอนนี้คุณอายุเกิน 40 ปีแล้ว,คิดถึงสุขภาพ,หากไม่สามารถเลิกบุหรี่ได้ก็แนะนำให้ค่อยๆ ลดปริมาณ。";
  16270. const report_explain_text_8 = "มีอาการเสี่ยงปวดท้องส่วนบน อาเจียน จึงแนะนำให้ไปตรวจที่โรงพยาบาลปกติ。";
  16271. const report_explain_text_9 = "หากคุณมีอาการเจ็บปวดและไม่บรรเทาในบริเวณก่อนหัวใจแนะนำให้ไปตรวจที่โรงพยาบาลปกติ。";
  16272. const report_explain_text_10 = "การให้คะแนนด้านบนเป็นการให้คะแนนสำหรับคุณตามเกณฑ์การตรวจคัดกรองโรคหัวใจและหลอดเลือดหัวใจและหลอดเลือดในช่วงต้นเช่นคู่มือการป้องกันโรคเบาหวานและการให้คะแนนความเสี่ยงของกล้ามเนื้อกล้ามเนื้อ, ระบบการให้คะแนนที่แตกต่างกัน, ตามด้วยการตีความที่เฉพาะเจาะจงสำหรับการอ้างอิงของคุณ。";
  16273. const healthy_habits = "พฤติกรรมสุขภาพ";
  16274. const y_n = "ใช่ / ไม่";
  16275. const healthy_personal_ratios = "สัดส่วนบุคลากรด้านสุขภาพ";
  16276. const all_people = "ทั้งหมด";
  16277. const group_people = "กลุ่มย่อย";
  16278. const report_text_4 = "การจัดกลุ่ม หมายถึงสถิติของผู้ใช้ที่เป็นเพศเดียวกันและอายุเดียวกัน (น้อยกว่า 40,40 ~ 49, มากกว่า 50)。";
  16279. const report_text_5 = "คุณเป็นสมาชิกแล้วและคุณมีสิทธิประโยชน์ดังต่อไปนี้。";
  16280. const report_text_6 = "สามารถประเมินได้ไม่จำกัดจำนวนครั้งตลอดระยะเวลา 1 ปี。";
  16281. const report_text_7 = "สามารถรีวิวได้ไม่จำกัดจำนวนครั้งภายในระยะเวลาหนึ่งปี สามารถให้ญาติ 3 คนได้ไม่จำกัดครั้ง。";
  16282. const report_text_8 = "หากผลการตรวจสอบครั้งแรกของคุณแสดงให้เห็นว่า คุณไม่มีความเสี่ยงทั้งสามระบบจะเพิ่มญาติ 1-2 คนในเวลาเดียวกันคุณจะแบ่งปันหน้ารายงานนี้ เป็นครั้งแรกเพื่อนของคุณ ที่เข้ามาจะเป็นสมาชิกฟรีจำนวนสมาชิก และอายุของคุณ ที่เกี่ยวข้อง";
  16283. const report_text_9 = "ทำมาแล้ว กลับไปที่หน้าแรก ประเมินผลครอบครัว เปิดการจัดการสุขภาพ。";
  16284. const y = "ใช่";
  16285. const n = "ไม่";
  16286. const select_age = "อายุ";
  16287. const select_age_1 = "อายุ";
  16288. const select_age_2 = "อายุมากกว่า";
  16289. const select_age_3 = "อายุต่ำกว่า";
  16290. const select_sex = "เพศ";
  16291. const calculate_BMI = "คำนวณค่าดัชนีมวลกาย";
  16292. const select = "เลือก";
  16293. const height = "ส่วนสูง";
  16294. const weight = "น้ำหนักตัว";
  16295. const selectcanvas_text1 = "กรุณาใส่ส่วนสูง น้ำหนัก";
  16296. const selectcanvas_text2 = "ดัชนีมวลกายเป็นตัวบ่งชี้เชิงปริมาณของระดับความอ้วนและความผอมของร่างกายมนุษย์และมีขนาดที่เชื่อมโยงกับระดับความเสี่ยงของโรคต่างๆ。";
  16297. const selectcanvas_text3 = "ความสูงใช้จำนวนเต็มน้ำหนักที่เลือกโดย 0.5 กิโลกรัมก็โอเค。";
  16298. const report_user = "วัตถุประเมิน";
  16299. const selectage_test1 = "โปรดเลือกอายุของผู้ที่ได้รับการประเมิน";
  16300. const selectage_test2 = "ความเสี่ยงต่อการเกิดโรคเรื้อรังบางชนิดที่ส่งผลกระทบต่อสุขภาพมากเริ่มเพิ่มขึ้นตั้งแต่อายุ 29 ปี,ไม่สามารถเปลี่ยนอายุได้ แต่สามารถเปลี่ยนพฤติกรรมการใช้ชีวิตได้。";
  16301. const next_step = "ขั้นตอนต่อไป";
  16302. const show_info_text1 = "BMI ของคุณเกินเกณฑ์แล้ว";
  16303. const show_info_text2 = "ผู้ใช้";
  16304. const less_than = "น้อยกว่า";
  16305. const greater_than = "มากกว่า";
  16306. const selectwaistline_text1 = "โปรดเลื่อนไปทางซ้ายหรือขวาเพื่อเลือกเส้นรอบเอวของผู้รับการประเมินผล";
  16307. const selectwaistline_text2 = "เส้นรอบเอว คือสิ่งสะท้อนว่าปริมาณไขมันในช่องท้องมากเกินไปหรือไม่ โดยปริมาณไขมันในช่องท้องที่มากเกินไปเป็นสาเหตุที่ก่อให้เกิดโรคต่าง ๆ";
  16308. const selectwaistline_text3 = "งานวิจัยที่ตีพิมพ์ล่าสุดในวารสาร JAMA ชี้ว่า กลุ่มบุคคลที่มีอัตราส่วนรอบเอวต่อรอบสะโพกเกินค่าที่กำหนด อีกทั้งค่าความดันโลหิตตัวบนสูงเกินไป ความเสี่ยงต่อการเสียชีวิตจากโรคหัวใจและหลอดเลือดจะเพิ่มขึ้นอย่างเห็นได้ชัด ด้วยเหตุนี้ การคงอัตราส่วนรอบเอวต่อรอบสะโพกจึงไม่เพียงเป็นสิ่งจำเป็นต่อความรักสวยรักงามเท่านั้น ยังมีความสำคัญมากต่อสุขภาพร่างกายอีกด้วย";
  16309. const selectwaistline_text4 = "เมื่อมีผลการวิจัยเชิงปริมาณที่เกี่ยวข้องกับงานวิจัยอัตราส่วนรอบเอวต่อรอบสะโพก เราจะอัปเดตเนื้อหาการประเมินผลด้วยเช่นกัน。";
  16310. const selectwaistline_text5 = "ในการประเมินผล ขอเพียงคุณระบุช่วงของเส้นรอบเอวที่ถูกต้องเท่านั้นเป็นพอ หากไม่แน่ใจ สามารถส่งเป็นขนาดกางเกงที่พอดีกับตัวคุณได้ ทั้งนี้มีค่าขนาดสำหรับใช้ประกอบการพิจารณาอยู่ที่ด้านล่างพิกัด。";
  16311. const waistline = "เส้นรอบเอว";
  16312. const waistline_text1 = "尺";
  16313. const waistline_text2 = "寸";
  16314. const scale_evaluation = "การประเมินผล";
  16315. const selectsbp_text1 = "โปรดกรอกช่วงความดันโลหิตของผู้รับการประเมินผล";
  16316. const selectsbp_text2 = "ดัชนีหลักที่มีความเกี่ยวข้องกับโรคคือความดันโลหิตสูง คุณแค่ต้องระบุข้อมูลความดันโลหิตสูง และเลือกช่วงให้ถูกต้องเท่านั้น";
  16317. const selectsbp_text3 = "หากมีการทานยาลดความดัน โปรดระบุข้อมูลความดันโลหิตสูงก่อนที่จะเข้ารับการรักษา ผู้ป่วยโรคความดันโลหิตสูงโดยทั่วไปค่าจะสูงกว่า 140 ขึ้นไป";
  16318. const selectsbp_text4 = "หากคุณยืนยันว่าไม่รู้ค่าความดันโลหิต ไม่มีความดันโลหิตสูง คุณสามารถกรอกช่วงปกติได้ คือ 110-120 หากผลการประเมินผลอยู่ในช่วง 3 คะแนน ทางด้านซ้ายหรือขวาของเส้นเกณฑ์มาตรฐาน คุณต้องวัดความดันโลหิตเพื่อประเมินผลใหม่";
  16319. const hg_text1 = "mmHgต่อไปนี้";
  16320. const hg_text2 = "mmHg";
  16321. const hg_text3 = "mmHgภายใน";
  16322. const hg_text4 = "mmHgมากกว่า";
  16323. const blood_pressure = "ความดันโลหิต";
  16324. const low_risk = "ความเสี่ยงต่ำ";
  16325. const risk = "มีความเสี่ยง";
  16326. const valuating_people = "ผู้รับการประเมินผล";
  16327. const completion_text_1 = "การประเมินความเสี่ยงของโรคเบาหวานและโรคหลอดเลือดสมองเสร็จสมบูรณ์!";
  16328. const completion_text_2 = "กรุณาดำเนินการต่อให้เสร็จสิ้น。";
  16329. const questions_remaining = "คำถามที่เหลือ";
  16330. const have = "มี";
  16331. const same_as_you = "ผู้ใช้เช่นเดียวกับคุณ";
  16332. const select_gender_for_valuating_people = "โปรดเลือกเพศของผู้รับการประเมินผล";
  16333. const select_gender_text_1 = "งานวิจัยชี้ว่า ความเสี่ยงต่อโรคบางชนิดในเพศชายและเพศหญิงจะแตกต่างกัน เช่น โรคเบาหวาน ความเสี่ยงต่อการเกิดโรคในเพศชายจะสูงกว่า จึงต้องใส่ใจพฤติกรรมการบริโภคอาหารให้มากขึ้นและควบคุมเส้นรอบเอว。";
  16334. const is_man = "เป็นเพศชาย";
  16335. const is_female = "เป็นเพศหญิง";
  16336. const man = "ชาย";
  16337. const female = "ผู้หญิง";
  16338. const index_text_1 = "ทำแบบประเมินให้บิดา มารดา และบุคคลในครอบครัว";
  16339. const index_text_2 = "พฤติกรรมการดำเนินชีวิตที่ดีต่อสุขภาพ คือกลยุทธ์ที่ดีที่สุดในการป้องกันโรคหลอดเลือดหัวใจและสมอง!!";
  16340. const index_text_3 = "ตรวจคัดกรองระยะเริ่มต้น";
  16341. const index_text_4 = "ป้องกันเชิงรุก";
  16342. const index_text_5 = "รักษาสุขภาพบุคคลในครอบครัวให้แข็งแรง ปกป้องครอบครัวให้ปลอดภัย";
  16343. const index_text_6 = "ขจัดความเสี่ยง สบายใจ! ไร้กังวล!";
  16344. const index_btn_1 = "เริ่มประเมินผล";
  16345. const index_btn_2 = "ตรวจดูรายงาน";
  16346. const index_btn_3 = "ประเมินผลใหม่";
  16347. const share = "แบ่งปัน";
  16348. const share_text = "การตรวจคัดกรองโรคหัวใจและหลอดเลือดสมองในระยะแรกง่ายและง่ายมีประโยชน์และไม่เป็นอันตรายแบ่งปันให้เพื่อนและครอบครัว。";
  16349. const member_add_text_1 = "ทุกคนห่วงใยครอบครัว";
  16350. const member_add_text_2 = "แต่เราทำได้มากกว่านี้";
  16351. const telno_null = "หมายเลขโทรศัพท์มือถือ จำเป็น";
  16352. const password_null = "รหัสผ่าน จำเป็น";
  16353. const telno_error = "หมายเลขโทรศัพท์มือถือไม่ถูกต้อง";
  16354. const password_repeat_error = "รหัสผ่านซ้ำไม่ตรงกัน";
  16355. const register_error = "ลงทะเบียนไม่สำเร็จ";
  16356. const member_num_than_max = "ปริมาณต้องไม่เกินเพดานที่กำหนด";
  16357. const member_title_null = "ชื่อญาติและเพื่อนยังไม่ได้กรอก";
  16358. const completion_problem_for_valuating_people = "กรุณากรอกคำตอบของวัตถุประเมิน";
  16359. const please_completion_problem = "กรุณากรอกข้อมูลให้ครบถ้วน";
  16360. const system_error = "ข้อผิดพลาดของระบบ";
  16361. const not_selected = "ไม่มีตัวเลือก";
  16362. const TH = {
  16363. hello,
  16364. login,
  16365. register,
  16366. password,
  16367. password_repeat,
  16368. telno,
  16369. new_member,
  16370. navigationBarTitleText,
  16371. add_member,
  16372. father,
  16373. mother,
  16374. husband,
  16375. wife,
  16376. other_member,
  16377. add_member_text1,
  16378. add_member_text2,
  16379. add_member_text3,
  16380. add_member_text4,
  16381. add_member_text5,
  16382. add_member_text6,
  16383. add_member_text7,
  16384. add_member_text8,
  16385. add_member_text9,
  16386. submit,
  16387. show_report,
  16388. do_success,
  16389. illness_title,
  16390. report_score,
  16391. report_result,
  16392. report_error_text_1,
  16393. report_error_text_2,
  16394. report_error_text_3,
  16395. report_text_1,
  16396. report_text_1_1,
  16397. health_advice,
  16398. report_explain,
  16399. report_detail,
  16400. report_explain_text_1,
  16401. report_explain_text_2,
  16402. report_explain_text_3,
  16403. report_explain_text_3_1,
  16404. report_explain_text_3_2,
  16405. report_explain_text_3_3,
  16406. report_explain_text_4,
  16407. report_explain_text_5,
  16408. report_explain_text_6,
  16409. report_explain_text_7,
  16410. report_explain_text_8,
  16411. report_explain_text_9,
  16412. report_explain_text_10,
  16413. healthy_habits,
  16414. y_n,
  16415. healthy_personal_ratios,
  16416. all_people,
  16417. group_people,
  16418. report_text_4,
  16419. report_text_5,
  16420. report_text_6,
  16421. report_text_7,
  16422. report_text_8,
  16423. report_text_9,
  16424. y,
  16425. n,
  16426. select_age,
  16427. select_age_1,
  16428. select_age_2,
  16429. select_age_3,
  16430. select_sex,
  16431. calculate_BMI,
  16432. select,
  16433. height,
  16434. weight,
  16435. selectcanvas_text1,
  16436. selectcanvas_text2,
  16437. selectcanvas_text3,
  16438. report_user,
  16439. selectage_test1,
  16440. selectage_test2,
  16441. next_step,
  16442. show_info_text1,
  16443. show_info_text2,
  16444. less_than,
  16445. greater_than,
  16446. selectwaistline_text1,
  16447. selectwaistline_text2,
  16448. selectwaistline_text3,
  16449. selectwaistline_text4,
  16450. selectwaistline_text5,
  16451. waistline,
  16452. waistline_text1,
  16453. waistline_text2,
  16454. scale_evaluation,
  16455. selectsbp_text1,
  16456. selectsbp_text2,
  16457. selectsbp_text3,
  16458. selectsbp_text4,
  16459. hg_text1,
  16460. hg_text2,
  16461. hg_text3,
  16462. hg_text4,
  16463. blood_pressure,
  16464. low_risk,
  16465. risk,
  16466. valuating_people,
  16467. completion_text_1,
  16468. completion_text_2,
  16469. questions_remaining,
  16470. have,
  16471. same_as_you,
  16472. select_gender_for_valuating_people,
  16473. select_gender_text_1,
  16474. is_man,
  16475. is_female,
  16476. man,
  16477. female,
  16478. index_text_1,
  16479. index_text_2,
  16480. index_text_3,
  16481. index_text_4,
  16482. index_text_5,
  16483. index_text_6,
  16484. index_btn_1,
  16485. index_btn_2,
  16486. index_btn_3,
  16487. share,
  16488. share_text,
  16489. member_add_text_1,
  16490. member_add_text_2,
  16491. telno_null,
  16492. password_null,
  16493. telno_error,
  16494. password_repeat_error,
  16495. register_error,
  16496. member_num_than_max,
  16497. member_title_null,
  16498. completion_problem_for_valuating_people,
  16499. please_completion_problem,
  16500. system_error,
  16501. not_selected
  16502. };
  16503. const messages = {
  16504. zh: {
  16505. ...ZH
  16506. },
  16507. en: {
  16508. ...EN
  16509. },
  16510. th: {
  16511. ...TH
  16512. }
  16513. };
  16514. const i18n = createI18n({
  16515. locale: "th",
  16516. legacy: false,
  16517. globalInjection: true,
  16518. messages
  16519. });
  16520. function createApp() {
  16521. const app = vue.createVueApp(App);
  16522. app.use(i18n);
  16523. return {
  16524. app
  16525. };
  16526. }
  16527. const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
  16528. uni.Vuex = __Vuex__;
  16529. uni.Pinia = __Pinia__;
  16530. __app__.provide("__globalStyles", __uniConfig.styles);
  16531. __app__._component.mpType = "app";
  16532. __app__._component.render = () => {
  16533. };
  16534. __app__.mount("#app");
  16535. })(Vue);