app-service.js 585 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074
  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, shared) {
  33. "use strict";
  34. const ON_SHOW = "onShow";
  35. const ON_HIDE = "onHide";
  36. const ON_LAUNCH = "onLaunch";
  37. const ON_LOAD = "onLoad";
  38. function formatAppLog(type, filename, ...args) {
  39. if (uni.__log__) {
  40. uni.__log__(type, filename, ...args);
  41. } else {
  42. console[type].apply(console, [...args, filename]);
  43. }
  44. }
  45. function resolveEasycom(component, easycom) {
  46. return shared.isString(component) ? easycom : component;
  47. }
  48. const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) => {
  49. !vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
  50. };
  51. const onShow = /* @__PURE__ */ createHook(ON_SHOW);
  52. const onHide = /* @__PURE__ */ createHook(ON_HIDE);
  53. const onLaunch = /* @__PURE__ */ createHook(ON_LAUNCH);
  54. const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
  55. const icons = {
  56. "id": "2852637",
  57. "name": "uniui图标库",
  58. "font_family": "uniicons",
  59. "css_prefix_text": "uniui-",
  60. "description": "",
  61. "glyphs": [
  62. {
  63. "icon_id": "25027049",
  64. "name": "yanse",
  65. "font_class": "color",
  66. "unicode": "e6cf",
  67. "unicode_decimal": 59087
  68. },
  69. {
  70. "icon_id": "25027048",
  71. "name": "wallet",
  72. "font_class": "wallet",
  73. "unicode": "e6b1",
  74. "unicode_decimal": 59057
  75. },
  76. {
  77. "icon_id": "25015720",
  78. "name": "settings-filled",
  79. "font_class": "settings-filled",
  80. "unicode": "e6ce",
  81. "unicode_decimal": 59086
  82. },
  83. {
  84. "icon_id": "25015434",
  85. "name": "shimingrenzheng-filled",
  86. "font_class": "auth-filled",
  87. "unicode": "e6cc",
  88. "unicode_decimal": 59084
  89. },
  90. {
  91. "icon_id": "24934246",
  92. "name": "shop-filled",
  93. "font_class": "shop-filled",
  94. "unicode": "e6cd",
  95. "unicode_decimal": 59085
  96. },
  97. {
  98. "icon_id": "24934159",
  99. "name": "staff-filled-01",
  100. "font_class": "staff-filled",
  101. "unicode": "e6cb",
  102. "unicode_decimal": 59083
  103. },
  104. {
  105. "icon_id": "24932461",
  106. "name": "VIP-filled",
  107. "font_class": "vip-filled",
  108. "unicode": "e6c6",
  109. "unicode_decimal": 59078
  110. },
  111. {
  112. "icon_id": "24932462",
  113. "name": "plus_circle_fill",
  114. "font_class": "plus-filled",
  115. "unicode": "e6c7",
  116. "unicode_decimal": 59079
  117. },
  118. {
  119. "icon_id": "24932463",
  120. "name": "folder_add-filled",
  121. "font_class": "folder-add-filled",
  122. "unicode": "e6c8",
  123. "unicode_decimal": 59080
  124. },
  125. {
  126. "icon_id": "24932464",
  127. "name": "yanse-filled",
  128. "font_class": "color-filled",
  129. "unicode": "e6c9",
  130. "unicode_decimal": 59081
  131. },
  132. {
  133. "icon_id": "24932465",
  134. "name": "tune-filled",
  135. "font_class": "tune-filled",
  136. "unicode": "e6ca",
  137. "unicode_decimal": 59082
  138. },
  139. {
  140. "icon_id": "24932455",
  141. "name": "a-rilidaka-filled",
  142. "font_class": "calendar-filled",
  143. "unicode": "e6c0",
  144. "unicode_decimal": 59072
  145. },
  146. {
  147. "icon_id": "24932456",
  148. "name": "notification-filled",
  149. "font_class": "notification-filled",
  150. "unicode": "e6c1",
  151. "unicode_decimal": 59073
  152. },
  153. {
  154. "icon_id": "24932457",
  155. "name": "wallet-filled",
  156. "font_class": "wallet-filled",
  157. "unicode": "e6c2",
  158. "unicode_decimal": 59074
  159. },
  160. {
  161. "icon_id": "24932458",
  162. "name": "paihangbang-filled",
  163. "font_class": "medal-filled",
  164. "unicode": "e6c3",
  165. "unicode_decimal": 59075
  166. },
  167. {
  168. "icon_id": "24932459",
  169. "name": "gift-filled",
  170. "font_class": "gift-filled",
  171. "unicode": "e6c4",
  172. "unicode_decimal": 59076
  173. },
  174. {
  175. "icon_id": "24932460",
  176. "name": "fire-filled",
  177. "font_class": "fire-filled",
  178. "unicode": "e6c5",
  179. "unicode_decimal": 59077
  180. },
  181. {
  182. "icon_id": "24928001",
  183. "name": "refreshempty",
  184. "font_class": "refreshempty",
  185. "unicode": "e6bf",
  186. "unicode_decimal": 59071
  187. },
  188. {
  189. "icon_id": "24926853",
  190. "name": "location-ellipse",
  191. "font_class": "location-filled",
  192. "unicode": "e6af",
  193. "unicode_decimal": 59055
  194. },
  195. {
  196. "icon_id": "24926735",
  197. "name": "person-filled",
  198. "font_class": "person-filled",
  199. "unicode": "e69d",
  200. "unicode_decimal": 59037
  201. },
  202. {
  203. "icon_id": "24926703",
  204. "name": "personadd-filled",
  205. "font_class": "personadd-filled",
  206. "unicode": "e698",
  207. "unicode_decimal": 59032
  208. },
  209. {
  210. "icon_id": "24923351",
  211. "name": "back",
  212. "font_class": "back",
  213. "unicode": "e6b9",
  214. "unicode_decimal": 59065
  215. },
  216. {
  217. "icon_id": "24923352",
  218. "name": "forward",
  219. "font_class": "forward",
  220. "unicode": "e6ba",
  221. "unicode_decimal": 59066
  222. },
  223. {
  224. "icon_id": "24923353",
  225. "name": "arrowthinright",
  226. "font_class": "arrow-right",
  227. "unicode": "e6bb",
  228. "unicode_decimal": 59067
  229. },
  230. {
  231. "icon_id": "24923353",
  232. "name": "arrowthinright",
  233. "font_class": "arrowthinright",
  234. "unicode": "e6bb",
  235. "unicode_decimal": 59067
  236. },
  237. {
  238. "icon_id": "24923354",
  239. "name": "arrowthinleft",
  240. "font_class": "arrow-left",
  241. "unicode": "e6bc",
  242. "unicode_decimal": 59068
  243. },
  244. {
  245. "icon_id": "24923354",
  246. "name": "arrowthinleft",
  247. "font_class": "arrowthinleft",
  248. "unicode": "e6bc",
  249. "unicode_decimal": 59068
  250. },
  251. {
  252. "icon_id": "24923355",
  253. "name": "arrowthinup",
  254. "font_class": "arrow-up",
  255. "unicode": "e6bd",
  256. "unicode_decimal": 59069
  257. },
  258. {
  259. "icon_id": "24923355",
  260. "name": "arrowthinup",
  261. "font_class": "arrowthinup",
  262. "unicode": "e6bd",
  263. "unicode_decimal": 59069
  264. },
  265. {
  266. "icon_id": "24923356",
  267. "name": "arrowthindown",
  268. "font_class": "arrow-down",
  269. "unicode": "e6be",
  270. "unicode_decimal": 59070
  271. },
  272. {
  273. "icon_id": "24923356",
  274. "name": "arrowthindown",
  275. "font_class": "arrowthindown",
  276. "unicode": "e6be",
  277. "unicode_decimal": 59070
  278. },
  279. {
  280. "icon_id": "24923349",
  281. "name": "arrowdown",
  282. "font_class": "bottom",
  283. "unicode": "e6b8",
  284. "unicode_decimal": 59064
  285. },
  286. {
  287. "icon_id": "24923349",
  288. "name": "arrowdown",
  289. "font_class": "arrowdown",
  290. "unicode": "e6b8",
  291. "unicode_decimal": 59064
  292. },
  293. {
  294. "icon_id": "24923346",
  295. "name": "arrowright",
  296. "font_class": "right",
  297. "unicode": "e6b5",
  298. "unicode_decimal": 59061
  299. },
  300. {
  301. "icon_id": "24923346",
  302. "name": "arrowright",
  303. "font_class": "arrowright",
  304. "unicode": "e6b5",
  305. "unicode_decimal": 59061
  306. },
  307. {
  308. "icon_id": "24923347",
  309. "name": "arrowup",
  310. "font_class": "top",
  311. "unicode": "e6b6",
  312. "unicode_decimal": 59062
  313. },
  314. {
  315. "icon_id": "24923347",
  316. "name": "arrowup",
  317. "font_class": "arrowup",
  318. "unicode": "e6b6",
  319. "unicode_decimal": 59062
  320. },
  321. {
  322. "icon_id": "24923348",
  323. "name": "arrowleft",
  324. "font_class": "left",
  325. "unicode": "e6b7",
  326. "unicode_decimal": 59063
  327. },
  328. {
  329. "icon_id": "24923348",
  330. "name": "arrowleft",
  331. "font_class": "arrowleft",
  332. "unicode": "e6b7",
  333. "unicode_decimal": 59063
  334. },
  335. {
  336. "icon_id": "24923334",
  337. "name": "eye",
  338. "font_class": "eye",
  339. "unicode": "e651",
  340. "unicode_decimal": 58961
  341. },
  342. {
  343. "icon_id": "24923335",
  344. "name": "eye-filled",
  345. "font_class": "eye-filled",
  346. "unicode": "e66a",
  347. "unicode_decimal": 58986
  348. },
  349. {
  350. "icon_id": "24923336",
  351. "name": "eye-slash",
  352. "font_class": "eye-slash",
  353. "unicode": "e6b3",
  354. "unicode_decimal": 59059
  355. },
  356. {
  357. "icon_id": "24923337",
  358. "name": "eye-slash-filled",
  359. "font_class": "eye-slash-filled",
  360. "unicode": "e6b4",
  361. "unicode_decimal": 59060
  362. },
  363. {
  364. "icon_id": "24923305",
  365. "name": "info-filled",
  366. "font_class": "info-filled",
  367. "unicode": "e649",
  368. "unicode_decimal": 58953
  369. },
  370. {
  371. "icon_id": "24923299",
  372. "name": "reload-01",
  373. "font_class": "reload",
  374. "unicode": "e6b2",
  375. "unicode_decimal": 59058
  376. },
  377. {
  378. "icon_id": "24923195",
  379. "name": "mic_slash_fill",
  380. "font_class": "micoff-filled",
  381. "unicode": "e6b0",
  382. "unicode_decimal": 59056
  383. },
  384. {
  385. "icon_id": "24923165",
  386. "name": "map-pin-ellipse",
  387. "font_class": "map-pin-ellipse",
  388. "unicode": "e6ac",
  389. "unicode_decimal": 59052
  390. },
  391. {
  392. "icon_id": "24923166",
  393. "name": "map-pin",
  394. "font_class": "map-pin",
  395. "unicode": "e6ad",
  396. "unicode_decimal": 59053
  397. },
  398. {
  399. "icon_id": "24923167",
  400. "name": "location",
  401. "font_class": "location",
  402. "unicode": "e6ae",
  403. "unicode_decimal": 59054
  404. },
  405. {
  406. "icon_id": "24923064",
  407. "name": "starhalf",
  408. "font_class": "starhalf",
  409. "unicode": "e683",
  410. "unicode_decimal": 59011
  411. },
  412. {
  413. "icon_id": "24923065",
  414. "name": "star",
  415. "font_class": "star",
  416. "unicode": "e688",
  417. "unicode_decimal": 59016
  418. },
  419. {
  420. "icon_id": "24923066",
  421. "name": "star-filled",
  422. "font_class": "star-filled",
  423. "unicode": "e68f",
  424. "unicode_decimal": 59023
  425. },
  426. {
  427. "icon_id": "24899646",
  428. "name": "a-rilidaka",
  429. "font_class": "calendar",
  430. "unicode": "e6a0",
  431. "unicode_decimal": 59040
  432. },
  433. {
  434. "icon_id": "24899647",
  435. "name": "fire",
  436. "font_class": "fire",
  437. "unicode": "e6a1",
  438. "unicode_decimal": 59041
  439. },
  440. {
  441. "icon_id": "24899648",
  442. "name": "paihangbang",
  443. "font_class": "medal",
  444. "unicode": "e6a2",
  445. "unicode_decimal": 59042
  446. },
  447. {
  448. "icon_id": "24899649",
  449. "name": "font",
  450. "font_class": "font",
  451. "unicode": "e6a3",
  452. "unicode_decimal": 59043
  453. },
  454. {
  455. "icon_id": "24899650",
  456. "name": "gift",
  457. "font_class": "gift",
  458. "unicode": "e6a4",
  459. "unicode_decimal": 59044
  460. },
  461. {
  462. "icon_id": "24899651",
  463. "name": "link",
  464. "font_class": "link",
  465. "unicode": "e6a5",
  466. "unicode_decimal": 59045
  467. },
  468. {
  469. "icon_id": "24899652",
  470. "name": "notification",
  471. "font_class": "notification",
  472. "unicode": "e6a6",
  473. "unicode_decimal": 59046
  474. },
  475. {
  476. "icon_id": "24899653",
  477. "name": "staff",
  478. "font_class": "staff",
  479. "unicode": "e6a7",
  480. "unicode_decimal": 59047
  481. },
  482. {
  483. "icon_id": "24899654",
  484. "name": "VIP",
  485. "font_class": "vip",
  486. "unicode": "e6a8",
  487. "unicode_decimal": 59048
  488. },
  489. {
  490. "icon_id": "24899655",
  491. "name": "folder_add",
  492. "font_class": "folder-add",
  493. "unicode": "e6a9",
  494. "unicode_decimal": 59049
  495. },
  496. {
  497. "icon_id": "24899656",
  498. "name": "tune",
  499. "font_class": "tune",
  500. "unicode": "e6aa",
  501. "unicode_decimal": 59050
  502. },
  503. {
  504. "icon_id": "24899657",
  505. "name": "shimingrenzheng",
  506. "font_class": "auth",
  507. "unicode": "e6ab",
  508. "unicode_decimal": 59051
  509. },
  510. {
  511. "icon_id": "24899565",
  512. "name": "person",
  513. "font_class": "person",
  514. "unicode": "e699",
  515. "unicode_decimal": 59033
  516. },
  517. {
  518. "icon_id": "24899566",
  519. "name": "email-filled",
  520. "font_class": "email-filled",
  521. "unicode": "e69a",
  522. "unicode_decimal": 59034
  523. },
  524. {
  525. "icon_id": "24899567",
  526. "name": "phone-filled",
  527. "font_class": "phone-filled",
  528. "unicode": "e69b",
  529. "unicode_decimal": 59035
  530. },
  531. {
  532. "icon_id": "24899568",
  533. "name": "phone",
  534. "font_class": "phone",
  535. "unicode": "e69c",
  536. "unicode_decimal": 59036
  537. },
  538. {
  539. "icon_id": "24899570",
  540. "name": "email",
  541. "font_class": "email",
  542. "unicode": "e69e",
  543. "unicode_decimal": 59038
  544. },
  545. {
  546. "icon_id": "24899571",
  547. "name": "personadd",
  548. "font_class": "personadd",
  549. "unicode": "e69f",
  550. "unicode_decimal": 59039
  551. },
  552. {
  553. "icon_id": "24899558",
  554. "name": "chatboxes-filled",
  555. "font_class": "chatboxes-filled",
  556. "unicode": "e692",
  557. "unicode_decimal": 59026
  558. },
  559. {
  560. "icon_id": "24899559",
  561. "name": "contact",
  562. "font_class": "contact",
  563. "unicode": "e693",
  564. "unicode_decimal": 59027
  565. },
  566. {
  567. "icon_id": "24899560",
  568. "name": "chatbubble-filled",
  569. "font_class": "chatbubble-filled",
  570. "unicode": "e694",
  571. "unicode_decimal": 59028
  572. },
  573. {
  574. "icon_id": "24899561",
  575. "name": "contact-filled",
  576. "font_class": "contact-filled",
  577. "unicode": "e695",
  578. "unicode_decimal": 59029
  579. },
  580. {
  581. "icon_id": "24899562",
  582. "name": "chatboxes",
  583. "font_class": "chatboxes",
  584. "unicode": "e696",
  585. "unicode_decimal": 59030
  586. },
  587. {
  588. "icon_id": "24899563",
  589. "name": "chatbubble",
  590. "font_class": "chatbubble",
  591. "unicode": "e697",
  592. "unicode_decimal": 59031
  593. },
  594. {
  595. "icon_id": "24881290",
  596. "name": "upload-filled",
  597. "font_class": "upload-filled",
  598. "unicode": "e68e",
  599. "unicode_decimal": 59022
  600. },
  601. {
  602. "icon_id": "24881292",
  603. "name": "upload",
  604. "font_class": "upload",
  605. "unicode": "e690",
  606. "unicode_decimal": 59024
  607. },
  608. {
  609. "icon_id": "24881293",
  610. "name": "weixin",
  611. "font_class": "weixin",
  612. "unicode": "e691",
  613. "unicode_decimal": 59025
  614. },
  615. {
  616. "icon_id": "24881274",
  617. "name": "compose",
  618. "font_class": "compose",
  619. "unicode": "e67f",
  620. "unicode_decimal": 59007
  621. },
  622. {
  623. "icon_id": "24881275",
  624. "name": "qq",
  625. "font_class": "qq",
  626. "unicode": "e680",
  627. "unicode_decimal": 59008
  628. },
  629. {
  630. "icon_id": "24881276",
  631. "name": "download-filled",
  632. "font_class": "download-filled",
  633. "unicode": "e681",
  634. "unicode_decimal": 59009
  635. },
  636. {
  637. "icon_id": "24881277",
  638. "name": "pengyouquan",
  639. "font_class": "pyq",
  640. "unicode": "e682",
  641. "unicode_decimal": 59010
  642. },
  643. {
  644. "icon_id": "24881279",
  645. "name": "sound",
  646. "font_class": "sound",
  647. "unicode": "e684",
  648. "unicode_decimal": 59012
  649. },
  650. {
  651. "icon_id": "24881280",
  652. "name": "trash-filled",
  653. "font_class": "trash-filled",
  654. "unicode": "e685",
  655. "unicode_decimal": 59013
  656. },
  657. {
  658. "icon_id": "24881281",
  659. "name": "sound-filled",
  660. "font_class": "sound-filled",
  661. "unicode": "e686",
  662. "unicode_decimal": 59014
  663. },
  664. {
  665. "icon_id": "24881282",
  666. "name": "trash",
  667. "font_class": "trash",
  668. "unicode": "e687",
  669. "unicode_decimal": 59015
  670. },
  671. {
  672. "icon_id": "24881284",
  673. "name": "videocam-filled",
  674. "font_class": "videocam-filled",
  675. "unicode": "e689",
  676. "unicode_decimal": 59017
  677. },
  678. {
  679. "icon_id": "24881285",
  680. "name": "spinner-cycle",
  681. "font_class": "spinner-cycle",
  682. "unicode": "e68a",
  683. "unicode_decimal": 59018
  684. },
  685. {
  686. "icon_id": "24881286",
  687. "name": "weibo",
  688. "font_class": "weibo",
  689. "unicode": "e68b",
  690. "unicode_decimal": 59019
  691. },
  692. {
  693. "icon_id": "24881288",
  694. "name": "videocam",
  695. "font_class": "videocam",
  696. "unicode": "e68c",
  697. "unicode_decimal": 59020
  698. },
  699. {
  700. "icon_id": "24881289",
  701. "name": "download",
  702. "font_class": "download",
  703. "unicode": "e68d",
  704. "unicode_decimal": 59021
  705. },
  706. {
  707. "icon_id": "24879601",
  708. "name": "help",
  709. "font_class": "help",
  710. "unicode": "e679",
  711. "unicode_decimal": 59001
  712. },
  713. {
  714. "icon_id": "24879602",
  715. "name": "navigate-filled",
  716. "font_class": "navigate-filled",
  717. "unicode": "e67a",
  718. "unicode_decimal": 59002
  719. },
  720. {
  721. "icon_id": "24879603",
  722. "name": "plusempty",
  723. "font_class": "plusempty",
  724. "unicode": "e67b",
  725. "unicode_decimal": 59003
  726. },
  727. {
  728. "icon_id": "24879604",
  729. "name": "smallcircle",
  730. "font_class": "smallcircle",
  731. "unicode": "e67c",
  732. "unicode_decimal": 59004
  733. },
  734. {
  735. "icon_id": "24879605",
  736. "name": "minus-filled",
  737. "font_class": "minus-filled",
  738. "unicode": "e67d",
  739. "unicode_decimal": 59005
  740. },
  741. {
  742. "icon_id": "24879606",
  743. "name": "micoff",
  744. "font_class": "micoff",
  745. "unicode": "e67e",
  746. "unicode_decimal": 59006
  747. },
  748. {
  749. "icon_id": "24879588",
  750. "name": "closeempty",
  751. "font_class": "closeempty",
  752. "unicode": "e66c",
  753. "unicode_decimal": 58988
  754. },
  755. {
  756. "icon_id": "24879589",
  757. "name": "clear",
  758. "font_class": "clear",
  759. "unicode": "e66d",
  760. "unicode_decimal": 58989
  761. },
  762. {
  763. "icon_id": "24879590",
  764. "name": "navigate",
  765. "font_class": "navigate",
  766. "unicode": "e66e",
  767. "unicode_decimal": 58990
  768. },
  769. {
  770. "icon_id": "24879591",
  771. "name": "minus",
  772. "font_class": "minus",
  773. "unicode": "e66f",
  774. "unicode_decimal": 58991
  775. },
  776. {
  777. "icon_id": "24879592",
  778. "name": "image",
  779. "font_class": "image",
  780. "unicode": "e670",
  781. "unicode_decimal": 58992
  782. },
  783. {
  784. "icon_id": "24879593",
  785. "name": "mic",
  786. "font_class": "mic",
  787. "unicode": "e671",
  788. "unicode_decimal": 58993
  789. },
  790. {
  791. "icon_id": "24879594",
  792. "name": "paperplane",
  793. "font_class": "paperplane",
  794. "unicode": "e672",
  795. "unicode_decimal": 58994
  796. },
  797. {
  798. "icon_id": "24879595",
  799. "name": "close",
  800. "font_class": "close",
  801. "unicode": "e673",
  802. "unicode_decimal": 58995
  803. },
  804. {
  805. "icon_id": "24879596",
  806. "name": "help-filled",
  807. "font_class": "help-filled",
  808. "unicode": "e674",
  809. "unicode_decimal": 58996
  810. },
  811. {
  812. "icon_id": "24879597",
  813. "name": "plus-filled",
  814. "font_class": "paperplane-filled",
  815. "unicode": "e675",
  816. "unicode_decimal": 58997
  817. },
  818. {
  819. "icon_id": "24879598",
  820. "name": "plus",
  821. "font_class": "plus",
  822. "unicode": "e676",
  823. "unicode_decimal": 58998
  824. },
  825. {
  826. "icon_id": "24879599",
  827. "name": "mic-filled",
  828. "font_class": "mic-filled",
  829. "unicode": "e677",
  830. "unicode_decimal": 58999
  831. },
  832. {
  833. "icon_id": "24879600",
  834. "name": "image-filled",
  835. "font_class": "image-filled",
  836. "unicode": "e678",
  837. "unicode_decimal": 59e3
  838. },
  839. {
  840. "icon_id": "24855900",
  841. "name": "locked-filled",
  842. "font_class": "locked-filled",
  843. "unicode": "e668",
  844. "unicode_decimal": 58984
  845. },
  846. {
  847. "icon_id": "24855901",
  848. "name": "info",
  849. "font_class": "info",
  850. "unicode": "e669",
  851. "unicode_decimal": 58985
  852. },
  853. {
  854. "icon_id": "24855903",
  855. "name": "locked",
  856. "font_class": "locked",
  857. "unicode": "e66b",
  858. "unicode_decimal": 58987
  859. },
  860. {
  861. "icon_id": "24855884",
  862. "name": "camera-filled",
  863. "font_class": "camera-filled",
  864. "unicode": "e658",
  865. "unicode_decimal": 58968
  866. },
  867. {
  868. "icon_id": "24855885",
  869. "name": "chat-filled",
  870. "font_class": "chat-filled",
  871. "unicode": "e659",
  872. "unicode_decimal": 58969
  873. },
  874. {
  875. "icon_id": "24855886",
  876. "name": "camera",
  877. "font_class": "camera",
  878. "unicode": "e65a",
  879. "unicode_decimal": 58970
  880. },
  881. {
  882. "icon_id": "24855887",
  883. "name": "circle",
  884. "font_class": "circle",
  885. "unicode": "e65b",
  886. "unicode_decimal": 58971
  887. },
  888. {
  889. "icon_id": "24855888",
  890. "name": "checkmarkempty",
  891. "font_class": "checkmarkempty",
  892. "unicode": "e65c",
  893. "unicode_decimal": 58972
  894. },
  895. {
  896. "icon_id": "24855889",
  897. "name": "chat",
  898. "font_class": "chat",
  899. "unicode": "e65d",
  900. "unicode_decimal": 58973
  901. },
  902. {
  903. "icon_id": "24855890",
  904. "name": "circle-filled",
  905. "font_class": "circle-filled",
  906. "unicode": "e65e",
  907. "unicode_decimal": 58974
  908. },
  909. {
  910. "icon_id": "24855891",
  911. "name": "flag",
  912. "font_class": "flag",
  913. "unicode": "e65f",
  914. "unicode_decimal": 58975
  915. },
  916. {
  917. "icon_id": "24855892",
  918. "name": "flag-filled",
  919. "font_class": "flag-filled",
  920. "unicode": "e660",
  921. "unicode_decimal": 58976
  922. },
  923. {
  924. "icon_id": "24855893",
  925. "name": "gear-filled",
  926. "font_class": "gear-filled",
  927. "unicode": "e661",
  928. "unicode_decimal": 58977
  929. },
  930. {
  931. "icon_id": "24855894",
  932. "name": "home",
  933. "font_class": "home",
  934. "unicode": "e662",
  935. "unicode_decimal": 58978
  936. },
  937. {
  938. "icon_id": "24855895",
  939. "name": "home-filled",
  940. "font_class": "home-filled",
  941. "unicode": "e663",
  942. "unicode_decimal": 58979
  943. },
  944. {
  945. "icon_id": "24855896",
  946. "name": "gear",
  947. "font_class": "gear",
  948. "unicode": "e664",
  949. "unicode_decimal": 58980
  950. },
  951. {
  952. "icon_id": "24855897",
  953. "name": "smallcircle-filled",
  954. "font_class": "smallcircle-filled",
  955. "unicode": "e665",
  956. "unicode_decimal": 58981
  957. },
  958. {
  959. "icon_id": "24855898",
  960. "name": "map-filled",
  961. "font_class": "map-filled",
  962. "unicode": "e666",
  963. "unicode_decimal": 58982
  964. },
  965. {
  966. "icon_id": "24855899",
  967. "name": "map",
  968. "font_class": "map",
  969. "unicode": "e667",
  970. "unicode_decimal": 58983
  971. },
  972. {
  973. "icon_id": "24855825",
  974. "name": "refresh-filled",
  975. "font_class": "refresh-filled",
  976. "unicode": "e656",
  977. "unicode_decimal": 58966
  978. },
  979. {
  980. "icon_id": "24855826",
  981. "name": "refresh",
  982. "font_class": "refresh",
  983. "unicode": "e657",
  984. "unicode_decimal": 58967
  985. },
  986. {
  987. "icon_id": "24855808",
  988. "name": "cloud-upload",
  989. "font_class": "cloud-upload",
  990. "unicode": "e645",
  991. "unicode_decimal": 58949
  992. },
  993. {
  994. "icon_id": "24855809",
  995. "name": "cloud-download-filled",
  996. "font_class": "cloud-download-filled",
  997. "unicode": "e646",
  998. "unicode_decimal": 58950
  999. },
  1000. {
  1001. "icon_id": "24855810",
  1002. "name": "cloud-download",
  1003. "font_class": "cloud-download",
  1004. "unicode": "e647",
  1005. "unicode_decimal": 58951
  1006. },
  1007. {
  1008. "icon_id": "24855811",
  1009. "name": "cloud-upload-filled",
  1010. "font_class": "cloud-upload-filled",
  1011. "unicode": "e648",
  1012. "unicode_decimal": 58952
  1013. },
  1014. {
  1015. "icon_id": "24855813",
  1016. "name": "redo",
  1017. "font_class": "redo",
  1018. "unicode": "e64a",
  1019. "unicode_decimal": 58954
  1020. },
  1021. {
  1022. "icon_id": "24855814",
  1023. "name": "images-filled",
  1024. "font_class": "images-filled",
  1025. "unicode": "e64b",
  1026. "unicode_decimal": 58955
  1027. },
  1028. {
  1029. "icon_id": "24855815",
  1030. "name": "undo-filled",
  1031. "font_class": "undo-filled",
  1032. "unicode": "e64c",
  1033. "unicode_decimal": 58956
  1034. },
  1035. {
  1036. "icon_id": "24855816",
  1037. "name": "more",
  1038. "font_class": "more",
  1039. "unicode": "e64d",
  1040. "unicode_decimal": 58957
  1041. },
  1042. {
  1043. "icon_id": "24855817",
  1044. "name": "more-filled",
  1045. "font_class": "more-filled",
  1046. "unicode": "e64e",
  1047. "unicode_decimal": 58958
  1048. },
  1049. {
  1050. "icon_id": "24855818",
  1051. "name": "undo",
  1052. "font_class": "undo",
  1053. "unicode": "e64f",
  1054. "unicode_decimal": 58959
  1055. },
  1056. {
  1057. "icon_id": "24855819",
  1058. "name": "images",
  1059. "font_class": "images",
  1060. "unicode": "e650",
  1061. "unicode_decimal": 58960
  1062. },
  1063. {
  1064. "icon_id": "24855821",
  1065. "name": "paperclip",
  1066. "font_class": "paperclip",
  1067. "unicode": "e652",
  1068. "unicode_decimal": 58962
  1069. },
  1070. {
  1071. "icon_id": "24855822",
  1072. "name": "settings",
  1073. "font_class": "settings",
  1074. "unicode": "e653",
  1075. "unicode_decimal": 58963
  1076. },
  1077. {
  1078. "icon_id": "24855823",
  1079. "name": "search",
  1080. "font_class": "search",
  1081. "unicode": "e654",
  1082. "unicode_decimal": 58964
  1083. },
  1084. {
  1085. "icon_id": "24855824",
  1086. "name": "redo-filled",
  1087. "font_class": "redo-filled",
  1088. "unicode": "e655",
  1089. "unicode_decimal": 58965
  1090. },
  1091. {
  1092. "icon_id": "24841702",
  1093. "name": "list",
  1094. "font_class": "list",
  1095. "unicode": "e644",
  1096. "unicode_decimal": 58948
  1097. },
  1098. {
  1099. "icon_id": "24841489",
  1100. "name": "mail-open-filled",
  1101. "font_class": "mail-open-filled",
  1102. "unicode": "e63a",
  1103. "unicode_decimal": 58938
  1104. },
  1105. {
  1106. "icon_id": "24841491",
  1107. "name": "hand-thumbsdown-filled",
  1108. "font_class": "hand-down-filled",
  1109. "unicode": "e63c",
  1110. "unicode_decimal": 58940
  1111. },
  1112. {
  1113. "icon_id": "24841492",
  1114. "name": "hand-thumbsdown",
  1115. "font_class": "hand-down",
  1116. "unicode": "e63d",
  1117. "unicode_decimal": 58941
  1118. },
  1119. {
  1120. "icon_id": "24841493",
  1121. "name": "hand-thumbsup-filled",
  1122. "font_class": "hand-up-filled",
  1123. "unicode": "e63e",
  1124. "unicode_decimal": 58942
  1125. },
  1126. {
  1127. "icon_id": "24841494",
  1128. "name": "hand-thumbsup",
  1129. "font_class": "hand-up",
  1130. "unicode": "e63f",
  1131. "unicode_decimal": 58943
  1132. },
  1133. {
  1134. "icon_id": "24841496",
  1135. "name": "heart-filled",
  1136. "font_class": "heart-filled",
  1137. "unicode": "e641",
  1138. "unicode_decimal": 58945
  1139. },
  1140. {
  1141. "icon_id": "24841498",
  1142. "name": "mail-open",
  1143. "font_class": "mail-open",
  1144. "unicode": "e643",
  1145. "unicode_decimal": 58947
  1146. },
  1147. {
  1148. "icon_id": "24841488",
  1149. "name": "heart",
  1150. "font_class": "heart",
  1151. "unicode": "e639",
  1152. "unicode_decimal": 58937
  1153. },
  1154. {
  1155. "icon_id": "24839963",
  1156. "name": "loop",
  1157. "font_class": "loop",
  1158. "unicode": "e633",
  1159. "unicode_decimal": 58931
  1160. },
  1161. {
  1162. "icon_id": "24839866",
  1163. "name": "pulldown",
  1164. "font_class": "pulldown",
  1165. "unicode": "e632",
  1166. "unicode_decimal": 58930
  1167. },
  1168. {
  1169. "icon_id": "24813798",
  1170. "name": "scan",
  1171. "font_class": "scan",
  1172. "unicode": "e62a",
  1173. "unicode_decimal": 58922
  1174. },
  1175. {
  1176. "icon_id": "24813786",
  1177. "name": "bars",
  1178. "font_class": "bars",
  1179. "unicode": "e627",
  1180. "unicode_decimal": 58919
  1181. },
  1182. {
  1183. "icon_id": "24813788",
  1184. "name": "cart-filled",
  1185. "font_class": "cart-filled",
  1186. "unicode": "e629",
  1187. "unicode_decimal": 58921
  1188. },
  1189. {
  1190. "icon_id": "24813790",
  1191. "name": "checkbox",
  1192. "font_class": "checkbox",
  1193. "unicode": "e62b",
  1194. "unicode_decimal": 58923
  1195. },
  1196. {
  1197. "icon_id": "24813791",
  1198. "name": "checkbox-filled",
  1199. "font_class": "checkbox-filled",
  1200. "unicode": "e62c",
  1201. "unicode_decimal": 58924
  1202. },
  1203. {
  1204. "icon_id": "24813794",
  1205. "name": "shop",
  1206. "font_class": "shop",
  1207. "unicode": "e62f",
  1208. "unicode_decimal": 58927
  1209. },
  1210. {
  1211. "icon_id": "24813795",
  1212. "name": "headphones",
  1213. "font_class": "headphones",
  1214. "unicode": "e630",
  1215. "unicode_decimal": 58928
  1216. },
  1217. {
  1218. "icon_id": "24813796",
  1219. "name": "cart",
  1220. "font_class": "cart",
  1221. "unicode": "e631",
  1222. "unicode_decimal": 58929
  1223. }
  1224. ]
  1225. };
  1226. const _export_sfc = (sfc, props) => {
  1227. const target = sfc.__vccOpts || sfc;
  1228. for (const [key, val] of props) {
  1229. target[key] = val;
  1230. }
  1231. return target;
  1232. };
  1233. const getVal$1 = (val) => {
  1234. const reg = /^[0-9]*$/g;
  1235. return typeof val === "number" || reg.test(val) ? val + "px" : val;
  1236. };
  1237. const _sfc_main$p = {
  1238. name: "UniIcons",
  1239. emits: ["click"],
  1240. props: {
  1241. type: {
  1242. type: String,
  1243. default: ""
  1244. },
  1245. color: {
  1246. type: String,
  1247. default: "#333333"
  1248. },
  1249. size: {
  1250. type: [Number, String],
  1251. default: 16
  1252. },
  1253. customPrefix: {
  1254. type: String,
  1255. default: ""
  1256. }
  1257. },
  1258. data() {
  1259. return {
  1260. icons: icons.glyphs
  1261. };
  1262. },
  1263. computed: {
  1264. unicode() {
  1265. let code = this.icons.find((v2) => v2.font_class === this.type);
  1266. if (code) {
  1267. return unescape(`%u${code.unicode}`);
  1268. }
  1269. return "";
  1270. },
  1271. iconSize() {
  1272. return getVal$1(this.size);
  1273. }
  1274. },
  1275. methods: {
  1276. _onClick() {
  1277. this.$emit("click");
  1278. }
  1279. }
  1280. };
  1281. function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
  1282. return vue.openBlock(), vue.createElementBlock(
  1283. "text",
  1284. {
  1285. style: vue.normalizeStyle({ color: $props.color, "font-size": $options.iconSize }),
  1286. class: vue.normalizeClass(["uni-icons", ["uniui-" + $props.type, $props.customPrefix, $props.customPrefix ? $props.type : ""]]),
  1287. onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
  1288. },
  1289. null,
  1290. 6
  1291. /* CLASS, STYLE */
  1292. );
  1293. }
  1294. const __easycom_0$3 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$g], ["__scopeId", "data-v-d31e1c47"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-icons/components/uni-icons/uni-icons.vue"]]);
  1295. const _sfc_main$o = {
  1296. name: "uniFormsItem",
  1297. options: {
  1298. virtualHost: true
  1299. },
  1300. provide() {
  1301. return {
  1302. uniFormItem: this
  1303. };
  1304. },
  1305. inject: {
  1306. form: {
  1307. from: "uniForm",
  1308. default: null
  1309. }
  1310. },
  1311. props: {
  1312. // 表单校验规则
  1313. rules: {
  1314. type: Array,
  1315. default() {
  1316. return null;
  1317. }
  1318. },
  1319. // 表单域的属性名,在使用校验规则时必填
  1320. name: {
  1321. type: [String, Array],
  1322. default: ""
  1323. },
  1324. required: {
  1325. type: Boolean,
  1326. default: false
  1327. },
  1328. label: {
  1329. type: String,
  1330. default: ""
  1331. },
  1332. // label的宽度 ,默认 80
  1333. labelWidth: {
  1334. type: [String, Number],
  1335. default: ""
  1336. },
  1337. // label 居中方式,默认 left 取值 left/center/right
  1338. labelAlign: {
  1339. type: String,
  1340. default: ""
  1341. },
  1342. // 强制显示错误信息
  1343. errorMessage: {
  1344. type: [String, Boolean],
  1345. default: ""
  1346. },
  1347. // 1.4.0 弃用,统一使用 form 的校验时机
  1348. // validateTrigger: {
  1349. // type: String,
  1350. // default: ''
  1351. // },
  1352. // 1.4.0 弃用,统一使用 form 的label 位置
  1353. // labelPosition: {
  1354. // type: String,
  1355. // default: ''
  1356. // },
  1357. // 1.4.0 以下属性已经废弃,请使用 #label 插槽代替
  1358. leftIcon: String,
  1359. iconColor: {
  1360. type: String,
  1361. default: "#606266"
  1362. }
  1363. },
  1364. data() {
  1365. return {
  1366. errMsg: "",
  1367. userRules: null,
  1368. localLabelAlign: "left",
  1369. localLabelWidth: "65px",
  1370. localLabelPos: "left",
  1371. border: false,
  1372. isFirstBorder: false
  1373. };
  1374. },
  1375. computed: {
  1376. // 处理错误信息
  1377. msg() {
  1378. return this.errorMessage || this.errMsg;
  1379. }
  1380. },
  1381. watch: {
  1382. // 规则发生变化通知子组件更新
  1383. "form.formRules"(val) {
  1384. this.init();
  1385. },
  1386. "form.labelWidth"(val) {
  1387. this.localLabelWidth = this._labelWidthUnit(val);
  1388. },
  1389. "form.labelPosition"(val) {
  1390. this.localLabelPos = this._labelPosition();
  1391. },
  1392. "form.labelAlign"(val) {
  1393. }
  1394. },
  1395. created() {
  1396. this.init(true);
  1397. if (this.name && this.form) {
  1398. this.$watch(
  1399. () => {
  1400. const val = this.form._getDataValue(this.name, this.form.localData);
  1401. return val;
  1402. },
  1403. (value, oldVal) => {
  1404. const isEqual2 = this.form._isEqual(value, oldVal);
  1405. if (!isEqual2) {
  1406. const val = this.itemSetValue(value);
  1407. this.onFieldChange(val, false);
  1408. }
  1409. },
  1410. {
  1411. immediate: false
  1412. }
  1413. );
  1414. }
  1415. },
  1416. unmounted() {
  1417. this.__isUnmounted = true;
  1418. this.unInit();
  1419. },
  1420. methods: {
  1421. /**
  1422. * 外部调用方法
  1423. * 设置规则 ,主要用于小程序自定义检验规则
  1424. * @param {Array} rules 规则源数据
  1425. */
  1426. setRules(rules = null) {
  1427. this.userRules = rules;
  1428. this.init(false);
  1429. },
  1430. // 兼容老版本表单组件
  1431. setValue() {
  1432. },
  1433. /**
  1434. * 外部调用方法
  1435. * 校验数据
  1436. * @param {any} value 需要校验的数据
  1437. * @param {boolean} 是否立即校验
  1438. * @return {Array|null} 校验内容
  1439. */
  1440. async onFieldChange(value, formtrigger = true) {
  1441. const {
  1442. formData,
  1443. localData,
  1444. errShowType,
  1445. validateCheck,
  1446. validateTrigger,
  1447. _isRequiredField,
  1448. _realName
  1449. } = this.form;
  1450. const name = _realName(this.name);
  1451. if (!value) {
  1452. value = this.form.formData[name];
  1453. }
  1454. const ruleLen = this.itemRules.rules && this.itemRules.rules.length;
  1455. if (!this.validator || !ruleLen || ruleLen === 0)
  1456. return;
  1457. const isRequiredField2 = _isRequiredField(this.itemRules.rules || []);
  1458. let result = null;
  1459. if (validateTrigger === "bind" || formtrigger) {
  1460. result = await this.validator.validateUpdate(
  1461. {
  1462. [name]: value
  1463. },
  1464. formData
  1465. );
  1466. if (!isRequiredField2 && (value === void 0 || value === "")) {
  1467. result = null;
  1468. }
  1469. if (result && result.errorMessage) {
  1470. if (errShowType === "undertext") {
  1471. this.errMsg = !result ? "" : result.errorMessage;
  1472. }
  1473. if (errShowType === "toast") {
  1474. uni.showToast({
  1475. title: result.errorMessage || "校验错误",
  1476. icon: "none"
  1477. });
  1478. }
  1479. if (errShowType === "modal") {
  1480. uni.showModal({
  1481. title: "提示",
  1482. content: result.errorMessage || "校验错误"
  1483. });
  1484. }
  1485. } else {
  1486. this.errMsg = "";
  1487. }
  1488. validateCheck(result ? result : null);
  1489. } else {
  1490. this.errMsg = "";
  1491. }
  1492. return result ? result : null;
  1493. },
  1494. /**
  1495. * 初始组件数据
  1496. */
  1497. init(type = false) {
  1498. const {
  1499. validator,
  1500. formRules,
  1501. childrens,
  1502. formData,
  1503. localData,
  1504. _realName,
  1505. labelWidth,
  1506. _getDataValue,
  1507. _setDataValue
  1508. } = this.form || {};
  1509. this.localLabelAlign = this._justifyContent();
  1510. this.localLabelWidth = this._labelWidthUnit(labelWidth);
  1511. this.localLabelPos = this._labelPosition();
  1512. this.form && type && childrens.push(this);
  1513. if (!validator || !formRules)
  1514. return;
  1515. if (!this.form.isFirstBorder) {
  1516. this.form.isFirstBorder = true;
  1517. this.isFirstBorder = true;
  1518. }
  1519. if (this.group) {
  1520. if (!this.group.isFirstBorder) {
  1521. this.group.isFirstBorder = true;
  1522. this.isFirstBorder = true;
  1523. }
  1524. }
  1525. this.border = this.form.border;
  1526. const name = _realName(this.name);
  1527. const itemRule = this.userRules || this.rules;
  1528. if (typeof formRules === "object" && itemRule) {
  1529. formRules[name] = {
  1530. rules: itemRule
  1531. };
  1532. validator.updateSchema(formRules);
  1533. }
  1534. const itemRules = formRules[name] || {};
  1535. this.itemRules = itemRules;
  1536. this.validator = validator;
  1537. this.itemSetValue(_getDataValue(this.name, localData));
  1538. },
  1539. unInit() {
  1540. if (this.form) {
  1541. const {
  1542. childrens,
  1543. formData,
  1544. _realName
  1545. } = this.form;
  1546. childrens.forEach((item, index) => {
  1547. if (item === this) {
  1548. this.form.childrens.splice(index, 1);
  1549. delete formData[_realName(item.name)];
  1550. }
  1551. });
  1552. }
  1553. },
  1554. // 设置item 的值
  1555. itemSetValue(value) {
  1556. const name = this.form._realName(this.name);
  1557. const rules = this.itemRules.rules || [];
  1558. const val = this.form._getValue(name, value, rules);
  1559. this.form._setDataValue(name, this.form.formData, val);
  1560. return val;
  1561. },
  1562. /**
  1563. * 移除该表单项的校验结果
  1564. */
  1565. clearValidate() {
  1566. this.errMsg = "";
  1567. },
  1568. // 是否显示星号
  1569. _isRequired() {
  1570. return this.required;
  1571. },
  1572. // 处理对齐方式
  1573. _justifyContent() {
  1574. if (this.form) {
  1575. const {
  1576. labelAlign
  1577. } = this.form;
  1578. let labelAli = this.labelAlign ? this.labelAlign : labelAlign;
  1579. if (labelAli === "left")
  1580. return "flex-start";
  1581. if (labelAli === "center")
  1582. return "center";
  1583. if (labelAli === "right")
  1584. return "flex-end";
  1585. }
  1586. return "flex-start";
  1587. },
  1588. // 处理 label宽度单位 ,继承父元素的值
  1589. _labelWidthUnit(labelWidth) {
  1590. return this.num2px(this.labelWidth ? this.labelWidth : labelWidth || (this.label ? 65 : "auto"));
  1591. },
  1592. // 处理 label 位置
  1593. _labelPosition() {
  1594. if (this.form)
  1595. return this.form.labelPosition || "left";
  1596. return "left";
  1597. },
  1598. /**
  1599. * 触发时机
  1600. * @param {Object} rule 当前规则内时机
  1601. * @param {Object} itemRlue 当前组件时机
  1602. * @param {Object} parentRule 父组件时机
  1603. */
  1604. isTrigger(rule, itemRlue, parentRule) {
  1605. if (rule === "submit" || !rule) {
  1606. if (rule === void 0) {
  1607. if (itemRlue !== "bind") {
  1608. if (!itemRlue) {
  1609. return parentRule === "" ? "bind" : "submit";
  1610. }
  1611. return "submit";
  1612. }
  1613. return "bind";
  1614. }
  1615. return "submit";
  1616. }
  1617. return "bind";
  1618. },
  1619. num2px(num) {
  1620. if (typeof num === "number") {
  1621. return `${num}px`;
  1622. }
  1623. return num;
  1624. }
  1625. }
  1626. };
  1627. function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
  1628. return vue.openBlock(), vue.createElementBlock(
  1629. "view",
  1630. {
  1631. class: vue.normalizeClass(["uni-forms-item", ["is-direction-" + $data.localLabelPos, $data.border ? "uni-forms-item--border" : "", $data.border && $data.isFirstBorder ? "is-first-border" : ""]])
  1632. },
  1633. [
  1634. vue.renderSlot(_ctx.$slots, "label", {}, () => [
  1635. vue.createElementVNode(
  1636. "view",
  1637. {
  1638. class: vue.normalizeClass(["uni-forms-item__label", { "no-label": !$props.label && !$props.required }]),
  1639. style: vue.normalizeStyle({ width: $data.localLabelWidth, justifyContent: $data.localLabelAlign })
  1640. },
  1641. [
  1642. $props.required ? (vue.openBlock(), vue.createElementBlock("text", {
  1643. key: 0,
  1644. class: "is-required"
  1645. }, "*")) : vue.createCommentVNode("v-if", true),
  1646. vue.createElementVNode(
  1647. "text",
  1648. null,
  1649. vue.toDisplayString($props.label),
  1650. 1
  1651. /* TEXT */
  1652. )
  1653. ],
  1654. 6
  1655. /* CLASS, STYLE */
  1656. )
  1657. ], true),
  1658. vue.createElementVNode("view", { class: "uni-forms-item__content" }, [
  1659. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
  1660. vue.createElementVNode(
  1661. "view",
  1662. {
  1663. class: vue.normalizeClass(["uni-forms-item__error", { "msg--active": $options.msg }])
  1664. },
  1665. [
  1666. vue.createElementVNode(
  1667. "text",
  1668. null,
  1669. vue.toDisplayString($options.msg),
  1670. 1
  1671. /* TEXT */
  1672. )
  1673. ],
  1674. 2
  1675. /* CLASS */
  1676. )
  1677. ])
  1678. ],
  1679. 2
  1680. /* CLASS */
  1681. );
  1682. }
  1683. const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$f], ["__scopeId", "data-v-462874dd"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue"]]);
  1684. var pattern = {
  1685. email: /^\S+?@\S+?\.\S+?$/,
  1686. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  1687. url: new RegExp(
  1688. "^(?!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]*)?$",
  1689. "i"
  1690. )
  1691. };
  1692. const FORMAT_MAPPING = {
  1693. "int": "integer",
  1694. "bool": "boolean",
  1695. "double": "number",
  1696. "long": "number",
  1697. "password": "string"
  1698. // "fileurls": 'array'
  1699. };
  1700. function formatMessage(args, resources = "") {
  1701. var defaultMessage = ["label"];
  1702. defaultMessage.forEach((item) => {
  1703. if (args[item] === void 0) {
  1704. args[item] = "";
  1705. }
  1706. });
  1707. let str = resources;
  1708. for (let key in args) {
  1709. let reg = new RegExp("{" + key + "}");
  1710. str = str.replace(reg, args[key]);
  1711. }
  1712. return str;
  1713. }
  1714. function isEmptyValue(value, type) {
  1715. if (value === void 0 || value === null) {
  1716. return true;
  1717. }
  1718. if (typeof value === "string" && !value) {
  1719. return true;
  1720. }
  1721. if (Array.isArray(value) && !value.length) {
  1722. return true;
  1723. }
  1724. if (type === "object" && !Object.keys(value).length) {
  1725. return true;
  1726. }
  1727. return false;
  1728. }
  1729. const types = {
  1730. integer(value) {
  1731. return types.number(value) && parseInt(value, 10) === value;
  1732. },
  1733. string(value) {
  1734. return typeof value === "string";
  1735. },
  1736. number(value) {
  1737. if (isNaN(value)) {
  1738. return false;
  1739. }
  1740. return typeof value === "number";
  1741. },
  1742. "boolean": function(value) {
  1743. return typeof value === "boolean";
  1744. },
  1745. "float": function(value) {
  1746. return types.number(value) && !types.integer(value);
  1747. },
  1748. array(value) {
  1749. return Array.isArray(value);
  1750. },
  1751. object(value) {
  1752. return typeof value === "object" && !types.array(value);
  1753. },
  1754. date(value) {
  1755. return value instanceof Date;
  1756. },
  1757. timestamp(value) {
  1758. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  1759. return false;
  1760. }
  1761. return true;
  1762. },
  1763. file(value) {
  1764. return typeof value.url === "string";
  1765. },
  1766. email(value) {
  1767. return typeof value === "string" && !!value.match(pattern.email) && value.length < 255;
  1768. },
  1769. url(value) {
  1770. return typeof value === "string" && !!value.match(pattern.url);
  1771. },
  1772. pattern(reg, value) {
  1773. try {
  1774. return new RegExp(reg).test(value);
  1775. } catch (e2) {
  1776. return false;
  1777. }
  1778. },
  1779. method(value) {
  1780. return typeof value === "function";
  1781. },
  1782. idcard(value) {
  1783. return typeof value === "string" && !!value.match(pattern.idcard);
  1784. },
  1785. "url-https"(value) {
  1786. return this.url(value) && value.startsWith("https://");
  1787. },
  1788. "url-scheme"(value) {
  1789. return value.startsWith("://");
  1790. },
  1791. "url-web"(value) {
  1792. return false;
  1793. }
  1794. };
  1795. class RuleValidator {
  1796. constructor(message) {
  1797. this._message = message;
  1798. }
  1799. async validateRule(fieldKey, fieldValue, value, data, allData) {
  1800. var result = null;
  1801. let rules = fieldValue.rules;
  1802. let hasRequired = rules.findIndex((item) => {
  1803. return item.required;
  1804. });
  1805. if (hasRequired < 0) {
  1806. if (value === null || value === void 0) {
  1807. return result;
  1808. }
  1809. if (typeof value === "string" && !value.length) {
  1810. return result;
  1811. }
  1812. }
  1813. var message = this._message;
  1814. if (rules === void 0) {
  1815. return message["default"];
  1816. }
  1817. for (var i2 = 0; i2 < rules.length; i2++) {
  1818. let rule = rules[i2];
  1819. let vt2 = this._getValidateType(rule);
  1820. Object.assign(rule, {
  1821. label: fieldValue.label || `["${fieldKey}"]`
  1822. });
  1823. if (RuleValidatorHelper[vt2]) {
  1824. result = RuleValidatorHelper[vt2](rule, value, message);
  1825. if (result != null) {
  1826. break;
  1827. }
  1828. }
  1829. if (rule.validateExpr) {
  1830. let now = Date.now();
  1831. let resultExpr = rule.validateExpr(value, allData, now);
  1832. if (resultExpr === false) {
  1833. result = this._getMessage(rule, rule.errorMessage || this._message["default"]);
  1834. break;
  1835. }
  1836. }
  1837. if (rule.validateFunction) {
  1838. result = await this.validateFunction(rule, value, data, allData, vt2);
  1839. if (result !== null) {
  1840. break;
  1841. }
  1842. }
  1843. }
  1844. if (result !== null) {
  1845. result = message.TAG + result;
  1846. }
  1847. return result;
  1848. }
  1849. async validateFunction(rule, value, data, allData, vt2) {
  1850. let result = null;
  1851. try {
  1852. let callbackMessage = null;
  1853. const res = await rule.validateFunction(rule, value, allData || data, (message) => {
  1854. callbackMessage = message;
  1855. });
  1856. if (callbackMessage || typeof res === "string" && res || res === false) {
  1857. result = this._getMessage(rule, callbackMessage || res, vt2);
  1858. }
  1859. } catch (e2) {
  1860. result = this._getMessage(rule, e2.message, vt2);
  1861. }
  1862. return result;
  1863. }
  1864. _getMessage(rule, message, vt2) {
  1865. return formatMessage(rule, message || rule.errorMessage || this._message[vt2] || message["default"]);
  1866. }
  1867. _getValidateType(rule) {
  1868. var result = "";
  1869. if (rule.required) {
  1870. result = "required";
  1871. } else if (rule.format) {
  1872. result = "format";
  1873. } else if (rule.arrayType) {
  1874. result = "arrayTypeFormat";
  1875. } else if (rule.range) {
  1876. result = "range";
  1877. } else if (rule.maximum !== void 0 || rule.minimum !== void 0) {
  1878. result = "rangeNumber";
  1879. } else if (rule.maxLength !== void 0 || rule.minLength !== void 0) {
  1880. result = "rangeLength";
  1881. } else if (rule.pattern) {
  1882. result = "pattern";
  1883. } else if (rule.validateFunction) {
  1884. result = "validateFunction";
  1885. }
  1886. return result;
  1887. }
  1888. }
  1889. const RuleValidatorHelper = {
  1890. required(rule, value, message) {
  1891. if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
  1892. return formatMessage(rule, rule.errorMessage || message.required);
  1893. }
  1894. return null;
  1895. },
  1896. range(rule, value, message) {
  1897. const {
  1898. range,
  1899. errorMessage
  1900. } = rule;
  1901. let list = new Array(range.length);
  1902. for (let i2 = 0; i2 < range.length; i2++) {
  1903. const item = range[i2];
  1904. if (types.object(item) && item.value !== void 0) {
  1905. list[i2] = item.value;
  1906. } else {
  1907. list[i2] = item;
  1908. }
  1909. }
  1910. let result = false;
  1911. if (Array.isArray(value)) {
  1912. result = new Set(value.concat(list)).size === list.length;
  1913. } else {
  1914. if (list.indexOf(value) > -1) {
  1915. result = true;
  1916. }
  1917. }
  1918. if (!result) {
  1919. return formatMessage(rule, errorMessage || message["enum"]);
  1920. }
  1921. return null;
  1922. },
  1923. rangeNumber(rule, value, message) {
  1924. if (!types.number(value)) {
  1925. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  1926. }
  1927. let {
  1928. minimum,
  1929. maximum,
  1930. exclusiveMinimum,
  1931. exclusiveMaximum
  1932. } = rule;
  1933. let min = exclusiveMinimum ? value <= minimum : value < minimum;
  1934. let max = exclusiveMaximum ? value >= maximum : value > maximum;
  1935. if (minimum !== void 0 && min) {
  1936. return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMinimum ? "exclusiveMinimum" : "minimum"]);
  1937. } else if (maximum !== void 0 && max) {
  1938. return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMaximum ? "exclusiveMaximum" : "maximum"]);
  1939. } else if (minimum !== void 0 && maximum !== void 0 && (min || max)) {
  1940. return formatMessage(rule, rule.errorMessage || message["number"].range);
  1941. }
  1942. return null;
  1943. },
  1944. rangeLength(rule, value, message) {
  1945. if (!types.string(value) && !types.array(value)) {
  1946. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  1947. }
  1948. let min = rule.minLength;
  1949. let max = rule.maxLength;
  1950. let val = value.length;
  1951. if (min !== void 0 && val < min) {
  1952. return formatMessage(rule, rule.errorMessage || message["length"].minLength);
  1953. } else if (max !== void 0 && val > max) {
  1954. return formatMessage(rule, rule.errorMessage || message["length"].maxLength);
  1955. } else if (min !== void 0 && max !== void 0 && (val < min || val > max)) {
  1956. return formatMessage(rule, rule.errorMessage || message["length"].range);
  1957. }
  1958. return null;
  1959. },
  1960. pattern(rule, value, message) {
  1961. if (!types["pattern"](rule.pattern, value)) {
  1962. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  1963. }
  1964. return null;
  1965. },
  1966. format(rule, value, message) {
  1967. var customTypes = Object.keys(types);
  1968. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  1969. if (customTypes.indexOf(format) > -1) {
  1970. if (!types[format](value)) {
  1971. return formatMessage(rule, rule.errorMessage || message.typeError);
  1972. }
  1973. }
  1974. return null;
  1975. },
  1976. arrayTypeFormat(rule, value, message) {
  1977. if (!Array.isArray(value)) {
  1978. return formatMessage(rule, rule.errorMessage || message.typeError);
  1979. }
  1980. for (let i2 = 0; i2 < value.length; i2++) {
  1981. const element = value[i2];
  1982. let formatResult = this.format(rule, element, message);
  1983. if (formatResult !== null) {
  1984. return formatResult;
  1985. }
  1986. }
  1987. return null;
  1988. }
  1989. };
  1990. class SchemaValidator extends RuleValidator {
  1991. constructor(schema, options) {
  1992. super(SchemaValidator.message);
  1993. this._schema = schema;
  1994. this._options = options || null;
  1995. }
  1996. updateSchema(schema) {
  1997. this._schema = schema;
  1998. }
  1999. async validate(data, allData) {
  2000. let result = this._checkFieldInSchema(data);
  2001. if (!result) {
  2002. result = await this.invokeValidate(data, false, allData);
  2003. }
  2004. return result.length ? result[0] : null;
  2005. }
  2006. async validateAll(data, allData) {
  2007. let result = this._checkFieldInSchema(data);
  2008. if (!result) {
  2009. result = await this.invokeValidate(data, true, allData);
  2010. }
  2011. return result;
  2012. }
  2013. async validateUpdate(data, allData) {
  2014. let result = this._checkFieldInSchema(data);
  2015. if (!result) {
  2016. result = await this.invokeValidateUpdate(data, false, allData);
  2017. }
  2018. return result.length ? result[0] : null;
  2019. }
  2020. async invokeValidate(data, all, allData) {
  2021. let result = [];
  2022. let schema = this._schema;
  2023. for (let key in schema) {
  2024. let value = schema[key];
  2025. let errorMessage = await this.validateRule(key, value, data[key], data, allData);
  2026. if (errorMessage != null) {
  2027. result.push({
  2028. key,
  2029. errorMessage
  2030. });
  2031. if (!all)
  2032. break;
  2033. }
  2034. }
  2035. return result;
  2036. }
  2037. async invokeValidateUpdate(data, all, allData) {
  2038. let result = [];
  2039. for (let key in data) {
  2040. let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData);
  2041. if (errorMessage != null) {
  2042. result.push({
  2043. key,
  2044. errorMessage
  2045. });
  2046. if (!all)
  2047. break;
  2048. }
  2049. }
  2050. return result;
  2051. }
  2052. _checkFieldInSchema(data) {
  2053. var keys = Object.keys(data);
  2054. var keys2 = Object.keys(this._schema);
  2055. if (new Set(keys.concat(keys2)).size === keys2.length) {
  2056. return "";
  2057. }
  2058. var noExistFields = keys.filter((key) => {
  2059. return keys2.indexOf(key) < 0;
  2060. });
  2061. var errorMessage = formatMessage({
  2062. field: JSON.stringify(noExistFields)
  2063. }, SchemaValidator.message.TAG + SchemaValidator.message["defaultInvalid"]);
  2064. return [{
  2065. key: "invalid",
  2066. errorMessage
  2067. }];
  2068. }
  2069. }
  2070. function Message() {
  2071. return {
  2072. TAG: "",
  2073. default: "验证错误",
  2074. defaultInvalid: "提交的字段{field}在数据库中并不存在",
  2075. validateFunction: "验证无效",
  2076. required: "{label}必填",
  2077. "enum": "{label}超出范围",
  2078. timestamp: "{label}格式无效",
  2079. whitespace: "{label}不能为空",
  2080. typeError: "{label}类型无效",
  2081. date: {
  2082. format: "{label}日期{value}格式无效",
  2083. parse: "{label}日期无法解析,{value}无效",
  2084. invalid: "{label}日期{value}无效"
  2085. },
  2086. length: {
  2087. minLength: "{label}长度不能少于{minLength}",
  2088. maxLength: "{label}长度不能超过{maxLength}",
  2089. range: "{label}必须介于{minLength}和{maxLength}之间"
  2090. },
  2091. number: {
  2092. minimum: "{label}不能小于{minimum}",
  2093. maximum: "{label}不能大于{maximum}",
  2094. exclusiveMinimum: "{label}不能小于等于{minimum}",
  2095. exclusiveMaximum: "{label}不能大于等于{maximum}",
  2096. range: "{label}必须介于{minimum}and{maximum}之间"
  2097. },
  2098. pattern: {
  2099. mismatch: "{label}格式不匹配"
  2100. }
  2101. };
  2102. }
  2103. SchemaValidator.message = new Message();
  2104. const deepCopy = (val) => {
  2105. return JSON.parse(JSON.stringify(val));
  2106. };
  2107. const typeFilter = (format) => {
  2108. return format === "int" || format === "double" || format === "number" || format === "timestamp";
  2109. };
  2110. const getValue = (key, value, rules) => {
  2111. const isRuleNumType = rules.find((val) => val.format && typeFilter(val.format));
  2112. const isRuleBoolType = rules.find((val) => val.format && val.format === "boolean" || val.format === "bool");
  2113. if (!!isRuleNumType) {
  2114. if (!value && value !== 0) {
  2115. value = null;
  2116. } else {
  2117. value = isNumber(Number(value)) ? Number(value) : value;
  2118. }
  2119. }
  2120. if (!!isRuleBoolType) {
  2121. value = isBoolean(value) ? value : false;
  2122. }
  2123. return value;
  2124. };
  2125. const setDataValue = (field, formdata, value) => {
  2126. formdata[field] = value;
  2127. return value || "";
  2128. };
  2129. const getDataValue = (field, data) => {
  2130. return objGet(data, field);
  2131. };
  2132. const realName = (name, data = {}) => {
  2133. const base_name = _basePath(name);
  2134. if (typeof base_name === "object" && Array.isArray(base_name) && base_name.length > 1) {
  2135. const realname = base_name.reduce((a2, b2) => a2 += `#${b2}`, "_formdata_");
  2136. return realname;
  2137. }
  2138. return base_name[0] || name;
  2139. };
  2140. const isRealName = (name) => {
  2141. const reg = /^_formdata_#*/;
  2142. return reg.test(name);
  2143. };
  2144. const rawData = (object = {}, name) => {
  2145. let newData = JSON.parse(JSON.stringify(object));
  2146. let formData = {};
  2147. for (let i2 in newData) {
  2148. let path = name2arr(i2);
  2149. objSet(formData, path, newData[i2]);
  2150. }
  2151. return formData;
  2152. };
  2153. const name2arr = (name) => {
  2154. let field = name.replace("_formdata_#", "");
  2155. field = field.split("#").map((v2) => isNumber(v2) ? Number(v2) : v2);
  2156. return field;
  2157. };
  2158. const objSet = (object, path, value) => {
  2159. if (typeof object !== "object")
  2160. return object;
  2161. _basePath(path).reduce((o2, k2, i2, _2) => {
  2162. if (i2 === _2.length - 1) {
  2163. o2[k2] = value;
  2164. return null;
  2165. } else if (k2 in o2) {
  2166. return o2[k2];
  2167. } else {
  2168. o2[k2] = /^[0-9]{1,}$/.test(_2[i2 + 1]) ? [] : {};
  2169. return o2[k2];
  2170. }
  2171. }, object);
  2172. return object;
  2173. };
  2174. function _basePath(path) {
  2175. if (Array.isArray(path))
  2176. return path;
  2177. return path.replace(/\[/g, ".").replace(/\]/g, "").split(".");
  2178. }
  2179. const objGet = (object, path, defaultVal = "undefined") => {
  2180. let newPath = _basePath(path);
  2181. let val = newPath.reduce((o2, k2) => {
  2182. return (o2 || {})[k2];
  2183. }, object);
  2184. return !val || val !== void 0 ? val : defaultVal;
  2185. };
  2186. const isNumber = (num) => {
  2187. return !isNaN(Number(num));
  2188. };
  2189. const isBoolean = (bool) => {
  2190. return typeof bool === "boolean";
  2191. };
  2192. const isRequiredField = (rules) => {
  2193. let isNoField = false;
  2194. for (let i2 = 0; i2 < rules.length; i2++) {
  2195. const ruleData = rules[i2];
  2196. if (ruleData.required) {
  2197. isNoField = true;
  2198. break;
  2199. }
  2200. }
  2201. return isNoField;
  2202. };
  2203. const isEqual = (a2, b2) => {
  2204. if (a2 === b2) {
  2205. return a2 !== 0 || 1 / a2 === 1 / b2;
  2206. }
  2207. if (a2 == null || b2 == null) {
  2208. return a2 === b2;
  2209. }
  2210. var classNameA = toString.call(a2), classNameB = toString.call(b2);
  2211. if (classNameA !== classNameB) {
  2212. return false;
  2213. }
  2214. switch (classNameA) {
  2215. case "[object RegExp]":
  2216. case "[object String]":
  2217. return "" + a2 === "" + b2;
  2218. case "[object Number]":
  2219. if (+a2 !== +a2) {
  2220. return +b2 !== +b2;
  2221. }
  2222. return +a2 === 0 ? 1 / +a2 === 1 / b2 : +a2 === +b2;
  2223. case "[object Date]":
  2224. case "[object Boolean]":
  2225. return +a2 === +b2;
  2226. }
  2227. if (classNameA == "[object Object]") {
  2228. var propsA = Object.getOwnPropertyNames(a2), propsB = Object.getOwnPropertyNames(b2);
  2229. if (propsA.length != propsB.length) {
  2230. return false;
  2231. }
  2232. for (var i2 = 0; i2 < propsA.length; i2++) {
  2233. var propName = propsA[i2];
  2234. if (a2[propName] !== b2[propName]) {
  2235. return false;
  2236. }
  2237. }
  2238. return true;
  2239. }
  2240. if (classNameA == "[object Array]") {
  2241. if (a2.toString() == b2.toString()) {
  2242. return true;
  2243. }
  2244. return false;
  2245. }
  2246. };
  2247. const _sfc_main$n = {
  2248. name: "uniForms",
  2249. emits: ["validate", "submit"],
  2250. options: {
  2251. virtualHost: true
  2252. },
  2253. props: {
  2254. // 即将弃用
  2255. value: {
  2256. type: Object,
  2257. default() {
  2258. return null;
  2259. }
  2260. },
  2261. // vue3 替换 value 属性
  2262. modelValue: {
  2263. type: Object,
  2264. default() {
  2265. return null;
  2266. }
  2267. },
  2268. // 1.4.0 开始将不支持 v-model ,且废弃 value 和 modelValue
  2269. model: {
  2270. type: Object,
  2271. default() {
  2272. return null;
  2273. }
  2274. },
  2275. // 表单校验规则
  2276. rules: {
  2277. type: Object,
  2278. default() {
  2279. return {};
  2280. }
  2281. },
  2282. //校验错误信息提示方式 默认 undertext 取值 [undertext|toast|modal]
  2283. errShowType: {
  2284. type: String,
  2285. default: "undertext"
  2286. },
  2287. // 校验触发器方式 默认 bind 取值 [bind|submit]
  2288. validateTrigger: {
  2289. type: String,
  2290. default: "submit"
  2291. },
  2292. // label 位置,默认 left 取值 top/left
  2293. labelPosition: {
  2294. type: String,
  2295. default: "left"
  2296. },
  2297. // label 宽度
  2298. labelWidth: {
  2299. type: [String, Number],
  2300. default: ""
  2301. },
  2302. // label 居中方式,默认 left 取值 left/center/right
  2303. labelAlign: {
  2304. type: String,
  2305. default: "left"
  2306. },
  2307. border: {
  2308. type: Boolean,
  2309. default: false
  2310. }
  2311. },
  2312. provide() {
  2313. return {
  2314. uniForm: this
  2315. };
  2316. },
  2317. data() {
  2318. return {
  2319. // 表单本地值的记录,不应该与传如的值进行关联
  2320. formData: {},
  2321. formRules: {}
  2322. };
  2323. },
  2324. computed: {
  2325. // 计算数据源变化的
  2326. localData() {
  2327. const localVal = this.model || this.modelValue || this.value;
  2328. if (localVal) {
  2329. return deepCopy(localVal);
  2330. }
  2331. return {};
  2332. }
  2333. },
  2334. watch: {
  2335. // 监听数据变化 ,暂时不使用,需要单独赋值
  2336. // localData: {},
  2337. // 监听规则变化
  2338. rules: {
  2339. handler: function(val, oldVal) {
  2340. this.setRules(val);
  2341. },
  2342. deep: true,
  2343. immediate: true
  2344. }
  2345. },
  2346. created() {
  2347. let getbinddata = getApp().$vm.$.appContext.config.globalProperties.binddata;
  2348. if (!getbinddata) {
  2349. getApp().$vm.$.appContext.config.globalProperties.binddata = function(name, value, formName) {
  2350. if (formName) {
  2351. this.$refs[formName].setValue(name, value);
  2352. } else {
  2353. let formVm;
  2354. for (let i2 in this.$refs) {
  2355. const vm = this.$refs[i2];
  2356. if (vm && vm.$options && vm.$options.name === "uniForms") {
  2357. formVm = vm;
  2358. break;
  2359. }
  2360. }
  2361. if (!formVm)
  2362. return formatAppLog("error", "at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:182", "当前 uni-froms 组件缺少 ref 属性");
  2363. formVm.setValue(name, value);
  2364. }
  2365. };
  2366. }
  2367. this.childrens = [];
  2368. this.inputChildrens = [];
  2369. this.setRules(this.rules);
  2370. },
  2371. methods: {
  2372. /**
  2373. * 外部调用方法
  2374. * 设置规则 ,主要用于小程序自定义检验规则
  2375. * @param {Array} rules 规则源数据
  2376. */
  2377. setRules(rules) {
  2378. this.formRules = Object.assign({}, this.formRules, rules);
  2379. this.validator = new SchemaValidator(rules);
  2380. },
  2381. /**
  2382. * 外部调用方法
  2383. * 设置数据,用于设置表单数据,公开给用户使用 , 不支持在动态表单中使用
  2384. * @param {Object} key
  2385. * @param {Object} value
  2386. */
  2387. setValue(key, value) {
  2388. let example = this.childrens.find((child) => child.name === key);
  2389. if (!example)
  2390. return null;
  2391. this.formData[key] = getValue(key, value, this.formRules[key] && this.formRules[key].rules || []);
  2392. return example.onFieldChange(this.formData[key]);
  2393. },
  2394. /**
  2395. * 外部调用方法
  2396. * 手动提交校验表单
  2397. * 对整个表单进行校验的方法,参数为一个回调函数。
  2398. * @param {Array} keepitem 保留不参与校验的字段
  2399. * @param {type} callback 方法回调
  2400. */
  2401. validate(keepitem, callback) {
  2402. return this.checkAll(this.formData, keepitem, callback);
  2403. },
  2404. /**
  2405. * 外部调用方法
  2406. * 部分表单校验
  2407. * @param {Array|String} props 需要校验的字段
  2408. * @param {Function} 回调函数
  2409. */
  2410. validateField(props = [], callback) {
  2411. props = [].concat(props);
  2412. let invalidFields = {};
  2413. this.childrens.forEach((item) => {
  2414. const name = realName(item.name);
  2415. if (props.indexOf(name) !== -1) {
  2416. invalidFields = Object.assign({}, invalidFields, {
  2417. [name]: this.formData[name]
  2418. });
  2419. }
  2420. });
  2421. return this.checkAll(invalidFields, [], callback);
  2422. },
  2423. /**
  2424. * 外部调用方法
  2425. * 移除表单项的校验结果。传入待移除的表单项的 prop 属性或者 prop 组成的数组,如不传则移除整个表单的校验结果
  2426. * @param {Array|String} props 需要移除校验的字段 ,不填为所有
  2427. */
  2428. clearValidate(props = []) {
  2429. props = [].concat(props);
  2430. this.childrens.forEach((item) => {
  2431. if (props.length === 0) {
  2432. item.errMsg = "";
  2433. } else {
  2434. const name = realName(item.name);
  2435. if (props.indexOf(name) !== -1) {
  2436. item.errMsg = "";
  2437. }
  2438. }
  2439. });
  2440. },
  2441. /**
  2442. * 外部调用方法 ,即将废弃
  2443. * 手动提交校验表单
  2444. * 对整个表单进行校验的方法,参数为一个回调函数。
  2445. * @param {Array} keepitem 保留不参与校验的字段
  2446. * @param {type} callback 方法回调
  2447. */
  2448. submit(keepitem, callback, type) {
  2449. for (let i2 in this.dataValue) {
  2450. const itemData = this.childrens.find((v2) => v2.name === i2);
  2451. if (itemData) {
  2452. if (this.formData[i2] === void 0) {
  2453. this.formData[i2] = this._getValue(i2, this.dataValue[i2]);
  2454. }
  2455. }
  2456. }
  2457. if (!type) {
  2458. formatAppLog("warn", "at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:289", "submit 方法即将废弃,请使用validate方法代替!");
  2459. }
  2460. return this.checkAll(this.formData, keepitem, callback, "submit");
  2461. },
  2462. // 校验所有
  2463. async checkAll(invalidFields, keepitem, callback, type) {
  2464. if (!this.validator)
  2465. return;
  2466. let childrens = [];
  2467. for (let i2 in invalidFields) {
  2468. const item = this.childrens.find((v2) => realName(v2.name) === i2);
  2469. if (item) {
  2470. childrens.push(item);
  2471. }
  2472. }
  2473. if (!callback && typeof keepitem === "function") {
  2474. callback = keepitem;
  2475. }
  2476. let promise;
  2477. if (!callback && typeof callback !== "function" && Promise) {
  2478. promise = new Promise((resolve, reject) => {
  2479. callback = function(valid, invalidFields2) {
  2480. !valid ? resolve(invalidFields2) : reject(valid);
  2481. };
  2482. });
  2483. }
  2484. let results = [];
  2485. let tempFormData = JSON.parse(JSON.stringify(invalidFields));
  2486. for (let i2 in childrens) {
  2487. const child = childrens[i2];
  2488. let name = realName(child.name);
  2489. const result = await child.onFieldChange(tempFormData[name]);
  2490. if (result) {
  2491. results.push(result);
  2492. if (this.errShowType === "toast" || this.errShowType === "modal")
  2493. break;
  2494. }
  2495. }
  2496. if (Array.isArray(results)) {
  2497. if (results.length === 0)
  2498. results = null;
  2499. }
  2500. if (Array.isArray(keepitem)) {
  2501. keepitem.forEach((v2) => {
  2502. let vName = realName(v2);
  2503. let value = getDataValue(v2, this.localData);
  2504. if (value !== void 0) {
  2505. tempFormData[vName] = value;
  2506. }
  2507. });
  2508. }
  2509. if (type === "submit") {
  2510. this.$emit("submit", {
  2511. detail: {
  2512. value: tempFormData,
  2513. errors: results
  2514. }
  2515. });
  2516. } else {
  2517. this.$emit("validate", results);
  2518. }
  2519. let resetFormData = {};
  2520. resetFormData = rawData(tempFormData, this.name);
  2521. callback && typeof callback === "function" && callback(results, resetFormData);
  2522. if (promise && callback) {
  2523. return promise;
  2524. } else {
  2525. return null;
  2526. }
  2527. },
  2528. /**
  2529. * 返回validate事件
  2530. * @param {Object} result
  2531. */
  2532. validateCheck(result) {
  2533. this.$emit("validate", result);
  2534. },
  2535. _getValue: getValue,
  2536. _isRequiredField: isRequiredField,
  2537. _setDataValue: setDataValue,
  2538. _getDataValue: getDataValue,
  2539. _realName: realName,
  2540. _isRealName: isRealName,
  2541. _isEqual: isEqual
  2542. }
  2543. };
  2544. function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
  2545. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-forms" }, [
  2546. vue.createElementVNode("form", null, [
  2547. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  2548. ])
  2549. ]);
  2550. }
  2551. const __easycom_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$e], ["__scopeId", "data-v-9a1e3c32"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-forms/components/uni-forms/uni-forms.vue"]]);
  2552. var hostUrl = "http://zhongyao.fscuc.cn";
  2553. var hostUrl2 = "http://zy-web.fscuc.cn";
  2554. const service = (params2 = {}) => {
  2555. return new Promise((resolve, reject) => {
  2556. formatAppLog("log", "at static/js/request.js:12", "params.data.data", params2.data.data);
  2557. let query = "";
  2558. let tokens = "";
  2559. if (params2.data.data) {
  2560. params2.data.data;
  2561. }
  2562. if (params2.data.token) {
  2563. tokens = params2.data.token;
  2564. }
  2565. if (params2.data.query)
  2566. ;
  2567. else {
  2568. query = params2.url;
  2569. }
  2570. formatAppLog("log", "at static/js/request.js:29", "params.data.token", tokens);
  2571. uni.request({
  2572. url: hostUrl + query,
  2573. // 接收请求的API
  2574. header: {
  2575. "Authorization": "Bearer " + tokens
  2576. // 'Accept': 'application/json, text/plain, */*',
  2577. // 'Content-Type': 'application/json',
  2578. // 'Access-Control-Allow-Origin': '*',
  2579. },
  2580. method: params2.method || "POST",
  2581. // 接收请求的方式,如果不传默认为POST
  2582. data: params2.data.data,
  2583. //JSON.stringify(params.data.data), // 接收请求的data,不传默认为空
  2584. success: (res) => {
  2585. if (res.statusCode !== 200 && res.statusCode !== 201) {
  2586. return uni.$showMsg("请求失败!请联系平台客服", 2e3);
  2587. } else {
  2588. resolve(res);
  2589. }
  2590. },
  2591. fail: (err) => {
  2592. return uni.$showMsg("请求接口失败!", 2e3);
  2593. }
  2594. });
  2595. });
  2596. };
  2597. const login = (params2 = {}) => {
  2598. return new Promise((resolve, reject) => {
  2599. formatAppLog("log", "at static/js/request.js:64", "request login ", hostUrl);
  2600. uni.request({
  2601. url: hostUrl + "/login/v2",
  2602. method: params2.method || "POST",
  2603. data: JSON.stringify(params2),
  2604. success: (res) => {
  2605. if (res.statusCode !== 200 && res.statusCode !== 201) {
  2606. return uni.$showMsg("请求失败!请联系平台客服", 2e3);
  2607. } else {
  2608. resolve(res);
  2609. }
  2610. },
  2611. fail: (err) => {
  2612. return uni.$showMsg("请求接口失败!", 2e3);
  2613. }
  2614. });
  2615. });
  2616. };
  2617. const sendToUser = (params2 = {}) => {
  2618. return new Promise((resolve, reject) => {
  2619. uni.request({
  2620. url: hostUrl2 + "/userPrescription/sendToUser",
  2621. method: "POST",
  2622. data: params2.data,
  2623. headers: { Authorization: "Bearer " + params2.token },
  2624. success: (res) => {
  2625. if (res.statusCode !== 200 && res.statusCode !== 201) {
  2626. return uni.$showMsg("请求失败!请联系平台客服", 2e3);
  2627. } else {
  2628. resolve(res);
  2629. }
  2630. },
  2631. fail: (err) => {
  2632. return uni.$showMsg("请求接口失败!", 2e3);
  2633. }
  2634. });
  2635. });
  2636. };
  2637. const selectOrderDetail = (params2 = {}) => {
  2638. return new Promise((resolve, reject) => {
  2639. uni.request({
  2640. // url: 'http://zhongyao.fscuc.cn' + '/login/v2',
  2641. url: hostUrl + `/prescription/prescriptionCore/selectOrderDetail?id=${params2.data.id}&preNo=${params2.data.preNo}&depolyStatus=${params2.data.depolyStatus}`,
  2642. method: params2.method || "POST",
  2643. data: JSON.stringify(params2),
  2644. header: {
  2645. "Authorization": "Bearer " + params2.data.token
  2646. },
  2647. success: (res) => {
  2648. if (res.statusCode !== 200 && res.statusCode !== 201) {
  2649. return uni.$showMsg("请求失败!请联系平台客服", 2e3);
  2650. } else {
  2651. resolve(res);
  2652. }
  2653. },
  2654. fail: (err) => {
  2655. return uni.$showMsg("请求接口失败!", 2e3);
  2656. }
  2657. });
  2658. });
  2659. };
  2660. const releaseOrder = (params2 = {}) => {
  2661. return new Promise((resolve, reject) => {
  2662. uni.request({
  2663. // url: 'http://zhongyao.fscuc.cn' + '/login/v2',
  2664. url: hostUrl + `/pharmacistStatus/releaseOrder?ids=${params2.data.ids}`,
  2665. method: params2.method || "POST",
  2666. data: JSON.stringify(params2),
  2667. header: {
  2668. "Authorization": "Bearer " + params2.data.token
  2669. },
  2670. success: (res) => {
  2671. if (res.statusCode !== 200 && res.statusCode !== 201) {
  2672. return uni.$showMsg("请求失败!请联系平台客服", 2e3);
  2673. } else {
  2674. resolve(res);
  2675. }
  2676. },
  2677. fail: (err) => {
  2678. return uni.$showMsg("请求接口失败!", 2e3);
  2679. }
  2680. });
  2681. });
  2682. };
  2683. const receiveOrderList = (data) => {
  2684. return service({
  2685. url: "/prescription/prescriptionCore/receiveOrderList",
  2686. method: "POST",
  2687. data
  2688. });
  2689. };
  2690. const updateWorkStatus = (data) => {
  2691. return service({
  2692. url: "/pharmacistStatus/updateWorkStatus",
  2693. method: "POST",
  2694. data
  2695. });
  2696. };
  2697. const updateOnlineStatus = (data) => {
  2698. return service({
  2699. url: "/pharmacistOnlineStatus/updateOnlineStatus",
  2700. method: "POST",
  2701. data
  2702. });
  2703. };
  2704. const saveDepoly = (data) => {
  2705. return service({
  2706. url: "/file/saveCoreFile",
  2707. method: "POST",
  2708. data
  2709. });
  2710. };
  2711. const saveReview = (data) => {
  2712. return service({
  2713. url: "/prescription/prescriptionCore/reviewPrescription",
  2714. method: "POST",
  2715. data
  2716. });
  2717. };
  2718. const __default__$5 = {
  2719. name: ""
  2720. };
  2721. const _sfc_main$m = /* @__PURE__ */ Object.assign(__default__$5, {
  2722. setup(__props) {
  2723. const showPassword = vue.ref(false);
  2724. const formData = vue.ref({
  2725. username: "",
  2726. password: "",
  2727. remember: false
  2728. });
  2729. onLoad(() => {
  2730. const sRemember = false;
  2731. if (uni.getStorageSync("remember")) {
  2732. JSON.parse(uni.getStorageSync("remember"));
  2733. }
  2734. formatAppLog("log", "at pages/login/login.vue:59", "onLoad sRemember", sRemember);
  2735. });
  2736. const submit = async () => {
  2737. formatAppLog("log", "at pages/login/login.vue:68", "formData", formData.value);
  2738. if (formData.value.name && formData.value.password && formData.value.remember === true) {
  2739. uni.setStorageSync("username", formData.value.name);
  2740. uni.setStorageSync("password", formData.value.password);
  2741. uni.setStorageSync("remember", formData.value.remember);
  2742. uni.setStorageSync("workStatus", formData.value.remember);
  2743. }
  2744. const params2 = {
  2745. username: formData.value.username,
  2746. password: formData.value.password,
  2747. code: "2"
  2748. };
  2749. let { data: res } = await login(params2);
  2750. formatAppLog("log", "at pages/login/login.vue:82", "res", res.code);
  2751. if (res.code === 200 && res.token && res.userId) {
  2752. uni.setStorageSync("token", res.token);
  2753. uni.setStorageSync("userId", res.userId);
  2754. formatAppLog("log", "at pages/login/login.vue:88", "11");
  2755. formatAppLog("log", "at pages/login/login.vue:89", "res.token", res.token);
  2756. const param = {
  2757. token: res.token,
  2758. data: JSON.stringify({ pharmacistUserId: res.userId, onlineStatus: 0 })
  2759. };
  2760. formatAppLog("log", "at pages/login/login.vue:95", "res.param", param);
  2761. await updateOnlineStatus(param);
  2762. uni.redirectTo({
  2763. url: "/pages/index/index"
  2764. });
  2765. } else {
  2766. formatAppLog("log", "at pages/login/login.vue:102", "登录失败");
  2767. uni.$showMsg("登录失败", 1500);
  2768. }
  2769. };
  2770. const handleChange = () => {
  2771. formData.value.remember = !formData.value.remember;
  2772. formatAppLog("log", "at pages/login/login.vue:112", "formData.value.username", formData.value.username);
  2773. formatAppLog("log", "at pages/login/login.vue:113", "formData.value.password", formData.value.password);
  2774. formatAppLog("log", "at pages/login/login.vue:114", "formData.value.remember", formData.value.remember);
  2775. if (formData.value.remember === true) {
  2776. uni.setStorageSync("username", formData.value.username);
  2777. uni.setStorageSync("password", formData.value.password);
  2778. uni.setStorageSync("remember", true);
  2779. } else {
  2780. uni.removeStorageSync("username");
  2781. uni.removeStorageSync("password");
  2782. uni.removeStorageSync("remember");
  2783. }
  2784. };
  2785. const changePassword = () => {
  2786. showPassword.value = !showPassword.value;
  2787. };
  2788. vue.onMounted(() => {
  2789. const username = uni.getStorageSync("username");
  2790. const password = uni.getStorageSync("password");
  2791. const remember = uni.getStorageSync("remember");
  2792. if (typeof username === typeof password === "string" && remember) {
  2793. formData.value.username = username;
  2794. formData.value.password = password;
  2795. formData.value.remember = remember;
  2796. }
  2797. });
  2798. return (_ctx, _cache) => {
  2799. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$3);
  2800. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_1$2);
  2801. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$1);
  2802. return vue.openBlock(), vue.createElementBlock("view", { class: "main" }, [
  2803. vue.createElementVNode("view", { class: "login" }, [
  2804. vue.createElementVNode("view", { class: "logo" }, [
  2805. vue.createElementVNode("image", {
  2806. class: "faceu",
  2807. aspectFill: "",
  2808. src: "/static/login@2x.png"
  2809. })
  2810. ]),
  2811. vue.createElementVNode("view", { class: "title" }, [
  2812. vue.createElementVNode("text", { class: "text" }, "中药处方煎配溯源管理")
  2813. ]),
  2814. vue.createVNode(_component_uni_forms, { model: formData.value }, {
  2815. default: vue.withCtx(() => [
  2816. vue.createVNode(_component_uni_forms_item, { name: "name" }, {
  2817. default: vue.withCtx(() => [
  2818. vue.createVNode(_component_uni_icons, {
  2819. class: "item",
  2820. type: "person-filled",
  2821. color: "#999999",
  2822. size: "30"
  2823. }),
  2824. vue.createElementVNode("view", { class: "input" }, [
  2825. vue.withDirectives(vue.createElementVNode(
  2826. "input",
  2827. {
  2828. type: "text",
  2829. class: "item",
  2830. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value.username = $event),
  2831. placeholder: "请输入账号"
  2832. },
  2833. null,
  2834. 512
  2835. /* NEED_PATCH */
  2836. ), [
  2837. [vue.vModelText, formData.value.username]
  2838. ])
  2839. ])
  2840. ]),
  2841. _: 1
  2842. /* STABLE */
  2843. }),
  2844. vue.createVNode(_component_uni_forms_item, { name: "password" }, {
  2845. default: vue.withCtx(() => [
  2846. vue.createVNode(_component_uni_icons, {
  2847. type: "locked",
  2848. class: "item",
  2849. color: "#999999",
  2850. size: "30"
  2851. }),
  2852. vue.createElementVNode("view", { class: "input" }, [
  2853. vue.withDirectives(vue.createElementVNode("input", {
  2854. class: "item",
  2855. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formData.value.password = $event),
  2856. password: showPassword.value,
  2857. placeholder: "请输入密码"
  2858. }, null, 8, ["password"]), [
  2859. [vue.vModelText, formData.value.password]
  2860. ]),
  2861. vue.createVNode(_component_uni_icons, {
  2862. "custom-prefix": "iconfont",
  2863. class: "item",
  2864. type: showPassword.value ? "icon-biyanjing" : "icon-yanjing",
  2865. color: "#999999",
  2866. size: "30",
  2867. onClick: changePassword
  2868. }, null, 8, ["type"])
  2869. ])
  2870. ]),
  2871. _: 1
  2872. /* STABLE */
  2873. }),
  2874. vue.createElementVNode("label", {
  2875. for: "",
  2876. class: "radio"
  2877. }, [
  2878. vue.createElementVNode("switch", {
  2879. checked: formData.value.remember,
  2880. style: { "transform": "scale(0.7)" },
  2881. onChange: handleChange
  2882. }, null, 40, ["checked"]),
  2883. vue.createTextVNode(" 记住密码 ")
  2884. ])
  2885. ]),
  2886. _: 1
  2887. /* STABLE */
  2888. }, 8, ["model"]),
  2889. vue.createElementVNode("button", {
  2890. class: "button",
  2891. onClick: submit
  2892. }, "登录")
  2893. ])
  2894. ]);
  2895. };
  2896. }
  2897. });
  2898. const PagesLoginLogin = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "/Users/sunwubin/source/pharmacy/pages/login/login.vue"]]);
  2899. function obj2strClass(obj) {
  2900. let classess = "";
  2901. for (let key in obj) {
  2902. const val = obj[key];
  2903. if (val) {
  2904. classess += `${key} `;
  2905. }
  2906. }
  2907. return classess;
  2908. }
  2909. function obj2strStyle(obj) {
  2910. let style = "";
  2911. for (let key in obj) {
  2912. const val = obj[key];
  2913. style += `${key}:${val};`;
  2914. }
  2915. return style;
  2916. }
  2917. const _sfc_main$l = {
  2918. name: "uni-easyinput",
  2919. emits: ["click", "iconClick", "update:modelValue", "input", "focus", "blur", "confirm", "clear", "eyes", "change", "keyboardheightchange"],
  2920. model: {
  2921. prop: "modelValue",
  2922. event: "update:modelValue"
  2923. },
  2924. options: {
  2925. virtualHost: true
  2926. },
  2927. inject: {
  2928. form: {
  2929. from: "uniForm",
  2930. default: null
  2931. },
  2932. formItem: {
  2933. from: "uniFormItem",
  2934. default: null
  2935. }
  2936. },
  2937. props: {
  2938. name: String,
  2939. value: [Number, String],
  2940. modelValue: [Number, String],
  2941. type: {
  2942. type: String,
  2943. default: "text"
  2944. },
  2945. clearable: {
  2946. type: Boolean,
  2947. default: true
  2948. },
  2949. autoHeight: {
  2950. type: Boolean,
  2951. default: false
  2952. },
  2953. placeholder: {
  2954. type: String,
  2955. default: " "
  2956. },
  2957. placeholderStyle: String,
  2958. focus: {
  2959. type: Boolean,
  2960. default: false
  2961. },
  2962. disabled: {
  2963. type: Boolean,
  2964. default: false
  2965. },
  2966. maxlength: {
  2967. type: [Number, String],
  2968. default: 140
  2969. },
  2970. confirmType: {
  2971. type: String,
  2972. default: "done"
  2973. },
  2974. clearSize: {
  2975. type: [Number, String],
  2976. default: 24
  2977. },
  2978. inputBorder: {
  2979. type: Boolean,
  2980. default: true
  2981. },
  2982. prefixIcon: {
  2983. type: String,
  2984. default: ""
  2985. },
  2986. suffixIcon: {
  2987. type: String,
  2988. default: ""
  2989. },
  2990. trim: {
  2991. type: [Boolean, String],
  2992. default: false
  2993. },
  2994. cursorSpacing: {
  2995. type: Number,
  2996. default: 0
  2997. },
  2998. passwordIcon: {
  2999. type: Boolean,
  3000. default: true
  3001. },
  3002. primaryColor: {
  3003. type: String,
  3004. default: "#2979ff"
  3005. },
  3006. styles: {
  3007. type: Object,
  3008. default() {
  3009. return {
  3010. color: "#333",
  3011. backgroundColor: "#fff",
  3012. disableColor: "#F7F6F6",
  3013. borderColor: "#e5e5e5"
  3014. };
  3015. }
  3016. },
  3017. errorMessage: {
  3018. type: [String, Boolean],
  3019. default: ""
  3020. }
  3021. },
  3022. data() {
  3023. return {
  3024. focused: false,
  3025. val: "",
  3026. showMsg: "",
  3027. border: false,
  3028. isFirstBorder: false,
  3029. showClearIcon: false,
  3030. showPassword: false,
  3031. focusShow: false,
  3032. localMsg: "",
  3033. isEnter: false
  3034. // 用于判断当前是否是使用回车操作
  3035. };
  3036. },
  3037. computed: {
  3038. // 输入框内是否有值
  3039. isVal() {
  3040. const val = this.val;
  3041. if (val || val === 0) {
  3042. return true;
  3043. }
  3044. return false;
  3045. },
  3046. msg() {
  3047. return this.localMsg || this.errorMessage;
  3048. },
  3049. // 因为uniapp的input组件的maxlength组件必须要数值,这里转为数值,用户可以传入字符串数值
  3050. inputMaxlength() {
  3051. return Number(this.maxlength);
  3052. },
  3053. // 处理外层样式的style
  3054. boxStyle() {
  3055. return `color:${this.inputBorder && this.msg ? "#e43d33" : this.styles.color};`;
  3056. },
  3057. // input 内容的类和样式处理
  3058. inputContentClass() {
  3059. return obj2strClass({
  3060. "is-input-border": this.inputBorder,
  3061. "is-input-error-border": this.inputBorder && this.msg,
  3062. "is-textarea": this.type === "textarea",
  3063. "is-disabled": this.disabled,
  3064. "is-focused": this.focusShow
  3065. });
  3066. },
  3067. inputContentStyle() {
  3068. const focusColor = this.focusShow ? this.primaryColor : this.styles.borderColor;
  3069. const borderColor = this.inputBorder && this.msg ? "#dd524d" : focusColor;
  3070. return obj2strStyle({
  3071. "border-color": borderColor || "#e5e5e5",
  3072. "background-color": this.disabled ? this.styles.disableColor : this.styles.backgroundColor
  3073. });
  3074. },
  3075. // input右侧样式
  3076. inputStyle() {
  3077. const paddingRight = this.type === "password" || this.clearable || this.prefixIcon ? "" : "10px";
  3078. return obj2strStyle({
  3079. "padding-right": paddingRight,
  3080. "padding-left": this.prefixIcon ? "" : "10px"
  3081. });
  3082. }
  3083. },
  3084. watch: {
  3085. value(newVal) {
  3086. this.val = newVal;
  3087. },
  3088. modelValue(newVal) {
  3089. this.val = newVal;
  3090. },
  3091. focus(newVal) {
  3092. this.$nextTick(() => {
  3093. this.focused = this.focus;
  3094. this.focusShow = this.focus;
  3095. });
  3096. }
  3097. },
  3098. created() {
  3099. this.init();
  3100. if (this.form && this.formItem) {
  3101. this.$watch("formItem.errMsg", (newVal) => {
  3102. this.localMsg = newVal;
  3103. });
  3104. }
  3105. },
  3106. mounted() {
  3107. this.$nextTick(() => {
  3108. this.focused = this.focus;
  3109. this.focusShow = this.focus;
  3110. });
  3111. },
  3112. methods: {
  3113. /**
  3114. * 初始化变量值
  3115. */
  3116. init() {
  3117. if (this.value || this.value === 0) {
  3118. this.val = this.value;
  3119. } else if (this.modelValue || this.modelValue === 0 || this.modelValue === "") {
  3120. this.val = this.modelValue;
  3121. } else {
  3122. this.val = null;
  3123. }
  3124. },
  3125. /**
  3126. * 点击图标时触发
  3127. * @param {Object} type
  3128. */
  3129. onClickIcon(type) {
  3130. this.$emit("iconClick", type);
  3131. },
  3132. /**
  3133. * 显示隐藏内容,密码框时生效
  3134. */
  3135. onEyes() {
  3136. this.showPassword = !this.showPassword;
  3137. this.$emit("eyes", this.showPassword);
  3138. },
  3139. /**
  3140. * 输入时触发
  3141. * @param {Object} event
  3142. */
  3143. onInput(event) {
  3144. let value = event.detail.value;
  3145. if (this.trim) {
  3146. if (typeof this.trim === "boolean" && this.trim) {
  3147. value = this.trimStr(value);
  3148. }
  3149. if (typeof this.trim === "string") {
  3150. value = this.trimStr(value, this.trim);
  3151. }
  3152. }
  3153. if (this.errMsg)
  3154. this.errMsg = "";
  3155. this.val = value;
  3156. this.$emit("input", value);
  3157. this.$emit("update:modelValue", value);
  3158. },
  3159. /**
  3160. * 外部调用方法
  3161. * 获取焦点时触发
  3162. * @param {Object} event
  3163. */
  3164. onFocus() {
  3165. this.$nextTick(() => {
  3166. this.focused = true;
  3167. });
  3168. this.$emit("focus", null);
  3169. },
  3170. _Focus(event) {
  3171. this.focusShow = true;
  3172. this.$emit("focus", event);
  3173. },
  3174. /**
  3175. * 外部调用方法
  3176. * 失去焦点时触发
  3177. * @param {Object} event
  3178. */
  3179. onBlur() {
  3180. this.focused = false;
  3181. this.$emit("focus", null);
  3182. },
  3183. _Blur(event) {
  3184. event.detail.value;
  3185. this.focusShow = false;
  3186. this.$emit("blur", event);
  3187. if (this.isEnter === false) {
  3188. this.$emit("change", this.val);
  3189. }
  3190. if (this.form && this.formItem) {
  3191. const { validateTrigger } = this.form;
  3192. if (validateTrigger === "blur") {
  3193. this.formItem.onFieldChange();
  3194. }
  3195. }
  3196. },
  3197. /**
  3198. * 按下键盘的发送键
  3199. * @param {Object} e
  3200. */
  3201. onConfirm(e2) {
  3202. this.$emit("confirm", this.val);
  3203. this.isEnter = true;
  3204. this.$emit("change", this.val);
  3205. this.$nextTick(() => {
  3206. this.isEnter = false;
  3207. });
  3208. },
  3209. /**
  3210. * 清理内容
  3211. * @param {Object} event
  3212. */
  3213. onClear(event) {
  3214. this.val = "";
  3215. this.$emit("input", "");
  3216. this.$emit("update:modelValue", "");
  3217. this.$emit("clear");
  3218. },
  3219. /**
  3220. * 键盘高度发生变化的时候触发此事件
  3221. * 兼容性:微信小程序2.7.0+、App 3.1.0+
  3222. * @param {Object} event
  3223. */
  3224. onkeyboardheightchange(event) {
  3225. this.$emit("keyboardheightchange", event);
  3226. },
  3227. /**
  3228. * 去除空格
  3229. */
  3230. trimStr(str, pos = "both") {
  3231. if (pos === "both") {
  3232. return str.trim();
  3233. } else if (pos === "left") {
  3234. return str.trimLeft();
  3235. } else if (pos === "right") {
  3236. return str.trimRight();
  3237. } else if (pos === "start") {
  3238. return str.trimStart();
  3239. } else if (pos === "end") {
  3240. return str.trimEnd();
  3241. } else if (pos === "all") {
  3242. return str.replace(/\s+/g, "");
  3243. } else if (pos === "none") {
  3244. return str;
  3245. }
  3246. return str;
  3247. }
  3248. }
  3249. };
  3250. function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
  3251. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$3);
  3252. return vue.openBlock(), vue.createElementBlock(
  3253. "view",
  3254. {
  3255. class: vue.normalizeClass(["uni-easyinput", { "uni-easyinput-error": $options.msg }]),
  3256. style: vue.normalizeStyle($options.boxStyle)
  3257. },
  3258. [
  3259. vue.createElementVNode(
  3260. "view",
  3261. {
  3262. class: vue.normalizeClass(["uni-easyinput__content", $options.inputContentClass]),
  3263. style: vue.normalizeStyle($options.inputContentStyle)
  3264. },
  3265. [
  3266. $props.prefixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  3267. key: 0,
  3268. class: "content-clear-icon",
  3269. type: $props.prefixIcon,
  3270. color: "#c0c4cc",
  3271. onClick: _cache[0] || (_cache[0] = ($event) => $options.onClickIcon("prefix")),
  3272. size: "22"
  3273. }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true),
  3274. $props.type === "textarea" ? (vue.openBlock(), vue.createElementBlock("textarea", {
  3275. key: 1,
  3276. class: vue.normalizeClass(["uni-easyinput__content-textarea", { "input-padding": $props.inputBorder }]),
  3277. name: $props.name,
  3278. value: $data.val,
  3279. placeholder: $props.placeholder,
  3280. placeholderStyle: $props.placeholderStyle,
  3281. disabled: $props.disabled,
  3282. "placeholder-class": "uni-easyinput__placeholder-class",
  3283. maxlength: $options.inputMaxlength,
  3284. focus: $data.focused,
  3285. autoHeight: $props.autoHeight,
  3286. "cursor-spacing": $props.cursorSpacing,
  3287. onInput: _cache[1] || (_cache[1] = (...args) => $options.onInput && $options.onInput(...args)),
  3288. onBlur: _cache[2] || (_cache[2] = (...args) => $options._Blur && $options._Blur(...args)),
  3289. onFocus: _cache[3] || (_cache[3] = (...args) => $options._Focus && $options._Focus(...args)),
  3290. onConfirm: _cache[4] || (_cache[4] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
  3291. onKeyboardheightchange: _cache[5] || (_cache[5] = (...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
  3292. }, null, 42, ["name", "value", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "autoHeight", "cursor-spacing"])) : (vue.openBlock(), vue.createElementBlock("input", {
  3293. key: 2,
  3294. type: $props.type === "password" ? "text" : $props.type,
  3295. class: "uni-easyinput__content-input",
  3296. style: vue.normalizeStyle($options.inputStyle),
  3297. name: $props.name,
  3298. value: $data.val,
  3299. password: !$data.showPassword && $props.type === "password",
  3300. placeholder: $props.placeholder,
  3301. placeholderStyle: $props.placeholderStyle,
  3302. "placeholder-class": "uni-easyinput__placeholder-class",
  3303. disabled: $props.disabled,
  3304. maxlength: $options.inputMaxlength,
  3305. focus: $data.focused,
  3306. confirmType: $props.confirmType,
  3307. "cursor-spacing": $props.cursorSpacing,
  3308. onFocus: _cache[6] || (_cache[6] = (...args) => $options._Focus && $options._Focus(...args)),
  3309. onBlur: _cache[7] || (_cache[7] = (...args) => $options._Blur && $options._Blur(...args)),
  3310. onInput: _cache[8] || (_cache[8] = (...args) => $options.onInput && $options.onInput(...args)),
  3311. onConfirm: _cache[9] || (_cache[9] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
  3312. onKeyboardheightchange: _cache[10] || (_cache[10] = (...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
  3313. }, null, 44, ["type", "name", "value", "password", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "confirmType", "cursor-spacing"])),
  3314. $props.type === "password" && $props.passwordIcon ? (vue.openBlock(), vue.createElementBlock(
  3315. vue.Fragment,
  3316. { key: 3 },
  3317. [
  3318. vue.createCommentVNode(" 开启密码时显示小眼睛 "),
  3319. $options.isVal ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  3320. key: 0,
  3321. class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
  3322. type: $data.showPassword ? "eye-slash-filled" : "eye-filled",
  3323. size: 22,
  3324. color: $data.focusShow ? $props.primaryColor : "#c0c4cc",
  3325. onClick: $options.onEyes
  3326. }, null, 8, ["class", "type", "color", "onClick"])) : vue.createCommentVNode("v-if", true)
  3327. ],
  3328. 64
  3329. /* STABLE_FRAGMENT */
  3330. )) : $props.suffixIcon ? (vue.openBlock(), vue.createElementBlock(
  3331. vue.Fragment,
  3332. { key: 4 },
  3333. [
  3334. $props.suffixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  3335. key: 0,
  3336. class: "content-clear-icon",
  3337. type: $props.suffixIcon,
  3338. color: "#c0c4cc",
  3339. onClick: _cache[11] || (_cache[11] = ($event) => $options.onClickIcon("suffix")),
  3340. size: "22"
  3341. }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true)
  3342. ],
  3343. 64
  3344. /* STABLE_FRAGMENT */
  3345. )) : (vue.openBlock(), vue.createElementBlock(
  3346. vue.Fragment,
  3347. { key: 5 },
  3348. [
  3349. $props.clearable && $options.isVal && !$props.disabled && $props.type !== "textarea" ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  3350. key: 0,
  3351. class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
  3352. type: "clear",
  3353. size: $props.clearSize,
  3354. color: $options.msg ? "#dd524d" : $data.focusShow ? $props.primaryColor : "#c0c4cc",
  3355. onClick: $options.onClear
  3356. }, null, 8, ["class", "size", "color", "onClick"])) : vue.createCommentVNode("v-if", true)
  3357. ],
  3358. 64
  3359. /* STABLE_FRAGMENT */
  3360. )),
  3361. vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
  3362. ],
  3363. 6
  3364. /* CLASS, STYLE */
  3365. )
  3366. ],
  3367. 6
  3368. /* CLASS, STYLE */
  3369. );
  3370. }
  3371. const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$d], ["__scopeId", "data-v-09fd5285"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue"]]);
  3372. let Calendar$1 = class Calendar {
  3373. constructor({
  3374. selected,
  3375. startDate,
  3376. endDate,
  3377. range
  3378. } = {}) {
  3379. this.date = this.getDateObj(/* @__PURE__ */ new Date());
  3380. this.selected = selected || [];
  3381. this.startDate = startDate;
  3382. this.endDate = endDate;
  3383. this.range = range;
  3384. this.cleanMultipleStatus();
  3385. this.weeks = {};
  3386. this.lastHover = false;
  3387. }
  3388. /**
  3389. * 设置日期
  3390. * @param {Object} date
  3391. */
  3392. setDate(date) {
  3393. const selectDate = this.getDateObj(date);
  3394. this.getWeeks(selectDate.fullDate);
  3395. }
  3396. /**
  3397. * 清理多选状态
  3398. */
  3399. cleanMultipleStatus() {
  3400. this.multipleStatus = {
  3401. before: "",
  3402. after: "",
  3403. data: []
  3404. };
  3405. }
  3406. setStartDate(startDate) {
  3407. this.startDate = startDate;
  3408. }
  3409. setEndDate(endDate) {
  3410. this.endDate = endDate;
  3411. }
  3412. getPreMonthObj(date) {
  3413. date = fixIosDateFormat(date);
  3414. date = new Date(date);
  3415. const oldMonth = date.getMonth();
  3416. date.setMonth(oldMonth - 1);
  3417. const newMonth = date.getMonth();
  3418. if (oldMonth !== 0 && newMonth - oldMonth === 0) {
  3419. date.setMonth(newMonth - 1);
  3420. }
  3421. return this.getDateObj(date);
  3422. }
  3423. getNextMonthObj(date) {
  3424. date = fixIosDateFormat(date);
  3425. date = new Date(date);
  3426. const oldMonth = date.getMonth();
  3427. date.setMonth(oldMonth + 1);
  3428. const newMonth = date.getMonth();
  3429. if (newMonth - oldMonth > 1) {
  3430. date.setMonth(newMonth - 1);
  3431. }
  3432. return this.getDateObj(date);
  3433. }
  3434. /**
  3435. * 获取指定格式Date对象
  3436. */
  3437. getDateObj(date) {
  3438. date = fixIosDateFormat(date);
  3439. date = new Date(date);
  3440. return {
  3441. fullDate: getDate(date),
  3442. year: date.getFullYear(),
  3443. month: addZero(date.getMonth() + 1),
  3444. date: addZero(date.getDate()),
  3445. day: date.getDay()
  3446. };
  3447. }
  3448. /**
  3449. * 获取上一个月日期集合
  3450. */
  3451. getPreMonthDays(amount, dateObj) {
  3452. const result = [];
  3453. for (let i2 = amount - 1; i2 >= 0; i2--) {
  3454. const month = dateObj.month > 1 ? dateObj.month - 1 : 12;
  3455. const year = month === 12 ? dateObj.year - 1 : dateObj.year;
  3456. const date = new Date(year, month, -i2).getDate();
  3457. const fullDate = `${year}-${addZero(month)}-${addZero(date)}`;
  3458. let multiples = this.multipleStatus.data;
  3459. let multiplesStatus = -1;
  3460. if (this.range && multiples) {
  3461. multiplesStatus = multiples.findIndex((item) => {
  3462. return this.dateEqual(item, fullDate);
  3463. });
  3464. }
  3465. const checked = multiplesStatus !== -1;
  3466. const extraInfo = this.selected && this.selected.find((item) => {
  3467. if (this.dateEqual(fullDate, item.date)) {
  3468. return item;
  3469. }
  3470. });
  3471. result.push({
  3472. fullDate,
  3473. year,
  3474. month,
  3475. date,
  3476. multiple: this.range ? checked : false,
  3477. beforeMultiple: this.isLogicBefore(fullDate, this.multipleStatus.before, this.multipleStatus.after),
  3478. afterMultiple: this.isLogicAfter(fullDate, this.multipleStatus.before, this.multipleStatus.after),
  3479. disable: this.startDate && !dateCompare(this.startDate, fullDate) || this.endDate && !dateCompare(fullDate, this.endDate),
  3480. isToday: fullDate === this.date.fullDate,
  3481. userChecked: false,
  3482. extraInfo
  3483. });
  3484. }
  3485. return result;
  3486. }
  3487. /**
  3488. * 获取本月日期集合
  3489. */
  3490. getCurrentMonthDays(amount, dateObj) {
  3491. const result = [];
  3492. const fullDate = this.date.fullDate;
  3493. for (let i2 = 1; i2 <= amount; i2++) {
  3494. const currentDate = `${dateObj.year}-${dateObj.month}-${addZero(i2)}`;
  3495. const isToday = fullDate === currentDate;
  3496. const extraInfo = this.selected && this.selected.find((item) => {
  3497. if (this.dateEqual(currentDate, item.date)) {
  3498. return item;
  3499. }
  3500. });
  3501. if (this.startDate) {
  3502. dateCompare(this.startDate, currentDate);
  3503. }
  3504. if (this.endDate) {
  3505. dateCompare(currentDate, this.endDate);
  3506. }
  3507. let multiples = this.multipleStatus.data;
  3508. let multiplesStatus = -1;
  3509. if (this.range && multiples) {
  3510. multiplesStatus = multiples.findIndex((item) => {
  3511. return this.dateEqual(item, currentDate);
  3512. });
  3513. }
  3514. const checked = multiplesStatus !== -1;
  3515. result.push({
  3516. fullDate: currentDate,
  3517. year: dateObj.year,
  3518. month: dateObj.month,
  3519. date: i2,
  3520. multiple: this.range ? checked : false,
  3521. beforeMultiple: this.isLogicBefore(currentDate, this.multipleStatus.before, this.multipleStatus.after),
  3522. afterMultiple: this.isLogicAfter(currentDate, this.multipleStatus.before, this.multipleStatus.after),
  3523. disable: this.startDate && !dateCompare(this.startDate, currentDate) || this.endDate && !dateCompare(currentDate, this.endDate),
  3524. isToday,
  3525. userChecked: false,
  3526. extraInfo
  3527. });
  3528. }
  3529. return result;
  3530. }
  3531. /**
  3532. * 获取下一个月日期集合
  3533. */
  3534. _getNextMonthDays(amount, dateObj) {
  3535. const result = [];
  3536. dateObj.month + 1;
  3537. for (let i2 = 1; i2 <= amount; i2++) {
  3538. const month = dateObj.month === 12 ? 1 : dateObj.month * 1 + 1;
  3539. const year = month === 1 ? dateObj.year + 1 : dateObj.year;
  3540. const fullDate = `${year}-${addZero(month)}-${addZero(i2)}`;
  3541. let multiples = this.multipleStatus.data;
  3542. let multiplesStatus = -1;
  3543. if (this.range && multiples) {
  3544. multiplesStatus = multiples.findIndex((item) => {
  3545. return this.dateEqual(item, fullDate);
  3546. });
  3547. }
  3548. const checked = multiplesStatus !== -1;
  3549. const extraInfo = this.selected && this.selected.find((item) => {
  3550. if (this.dateEqual(fullDate, item.date)) {
  3551. return item;
  3552. }
  3553. });
  3554. result.push({
  3555. fullDate,
  3556. year,
  3557. date: i2,
  3558. month,
  3559. multiple: this.range ? checked : false,
  3560. beforeMultiple: this.isLogicBefore(fullDate, this.multipleStatus.before, this.multipleStatus.after),
  3561. afterMultiple: this.isLogicAfter(fullDate, this.multipleStatus.before, this.multipleStatus.after),
  3562. disable: this.startDate && !dateCompare(this.startDate, fullDate) || this.endDate && !dateCompare(fullDate, this.endDate),
  3563. isToday: fullDate === this.date.fullDate,
  3564. userChecked: false,
  3565. extraInfo
  3566. });
  3567. }
  3568. return result;
  3569. }
  3570. /**
  3571. * 获取当前日期详情
  3572. * @param {Object} date
  3573. */
  3574. getInfo(date) {
  3575. if (!date) {
  3576. date = /* @__PURE__ */ new Date();
  3577. }
  3578. return this.calendar.find((item) => item.fullDate === this.getDateObj(date).fullDate);
  3579. }
  3580. /**
  3581. * 比较时间是否相等
  3582. */
  3583. dateEqual(before, after) {
  3584. before = new Date(fixIosDateFormat(before));
  3585. after = new Date(fixIosDateFormat(after));
  3586. return before.valueOf() === after.valueOf();
  3587. }
  3588. /**
  3589. * 比较真实起始日期
  3590. */
  3591. isLogicBefore(currentDate, before, after) {
  3592. let logicBefore = before;
  3593. if (before && after) {
  3594. logicBefore = dateCompare(before, after) ? before : after;
  3595. }
  3596. return this.dateEqual(logicBefore, currentDate);
  3597. }
  3598. isLogicAfter(currentDate, before, after) {
  3599. let logicAfter = after;
  3600. if (before && after) {
  3601. logicAfter = dateCompare(before, after) ? after : before;
  3602. }
  3603. return this.dateEqual(logicAfter, currentDate);
  3604. }
  3605. /**
  3606. * 获取日期范围内所有日期
  3607. * @param {Object} begin
  3608. * @param {Object} end
  3609. */
  3610. geDateAll(begin, end) {
  3611. var arr = [];
  3612. var ab = begin.split("-");
  3613. var ae2 = end.split("-");
  3614. var db = /* @__PURE__ */ new Date();
  3615. db.setFullYear(ab[0], ab[1] - 1, ab[2]);
  3616. var de2 = /* @__PURE__ */ new Date();
  3617. de2.setFullYear(ae2[0], ae2[1] - 1, ae2[2]);
  3618. var unixDb = db.getTime() - 24 * 60 * 60 * 1e3;
  3619. var unixDe = de2.getTime() - 24 * 60 * 60 * 1e3;
  3620. for (var k2 = unixDb; k2 <= unixDe; ) {
  3621. k2 = k2 + 24 * 60 * 60 * 1e3;
  3622. arr.push(this.getDateObj(new Date(parseInt(k2))).fullDate);
  3623. }
  3624. return arr;
  3625. }
  3626. /**
  3627. * 获取多选状态
  3628. */
  3629. setMultiple(fullDate) {
  3630. if (!this.range)
  3631. return;
  3632. let {
  3633. before,
  3634. after
  3635. } = this.multipleStatus;
  3636. if (before && after) {
  3637. if (!this.lastHover) {
  3638. this.lastHover = true;
  3639. return;
  3640. }
  3641. this.multipleStatus.before = fullDate;
  3642. this.multipleStatus.after = "";
  3643. this.multipleStatus.data = [];
  3644. this.multipleStatus.fulldate = "";
  3645. this.lastHover = false;
  3646. } else {
  3647. if (!before) {
  3648. this.multipleStatus.before = fullDate;
  3649. this.lastHover = false;
  3650. } else {
  3651. this.multipleStatus.after = fullDate;
  3652. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  3653. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  3654. } else {
  3655. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  3656. }
  3657. this.lastHover = true;
  3658. }
  3659. }
  3660. this.getWeeks(fullDate);
  3661. }
  3662. /**
  3663. * 鼠标 hover 更新多选状态
  3664. */
  3665. setHoverMultiple(fullDate) {
  3666. if (!this.range || this.lastHover)
  3667. return;
  3668. const { before } = this.multipleStatus;
  3669. if (!before) {
  3670. this.multipleStatus.before = fullDate;
  3671. } else {
  3672. this.multipleStatus.after = fullDate;
  3673. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  3674. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  3675. } else {
  3676. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  3677. }
  3678. }
  3679. this.getWeeks(fullDate);
  3680. }
  3681. /**
  3682. * 更新默认值多选状态
  3683. */
  3684. setDefaultMultiple(before, after) {
  3685. this.multipleStatus.before = before;
  3686. this.multipleStatus.after = after;
  3687. if (before && after) {
  3688. if (dateCompare(before, after)) {
  3689. this.multipleStatus.data = this.geDateAll(before, after);
  3690. this.getWeeks(after);
  3691. } else {
  3692. this.multipleStatus.data = this.geDateAll(after, before);
  3693. this.getWeeks(before);
  3694. }
  3695. }
  3696. }
  3697. /**
  3698. * 获取每周数据
  3699. * @param {Object} dateData
  3700. */
  3701. getWeeks(dateData) {
  3702. const {
  3703. year,
  3704. month
  3705. } = this.getDateObj(dateData);
  3706. const preMonthDayAmount = new Date(year, month - 1, 1).getDay();
  3707. const preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData));
  3708. const currentMonthDayAmount = new Date(year, month, 0).getDate();
  3709. const currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData));
  3710. const nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount;
  3711. const nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData));
  3712. const calendarDays = [...preMonthDays, ...currentMonthDays, ...nextMonthDays];
  3713. const weeks = new Array(6);
  3714. for (let i2 = 0; i2 < calendarDays.length; i2++) {
  3715. const index = Math.floor(i2 / 7);
  3716. if (!weeks[index]) {
  3717. weeks[index] = new Array(7);
  3718. }
  3719. weeks[index][i2 % 7] = calendarDays[i2];
  3720. }
  3721. this.calendar = calendarDays;
  3722. this.weeks = weeks;
  3723. }
  3724. };
  3725. function getDateTime(date, hideSecond) {
  3726. return `${getDate(date)} ${getTime(date, hideSecond)}`;
  3727. }
  3728. function getDate(date) {
  3729. date = fixIosDateFormat(date);
  3730. date = new Date(date);
  3731. const year = date.getFullYear();
  3732. const month = date.getMonth() + 1;
  3733. const day = date.getDate();
  3734. return `${year}-${addZero(month)}-${addZero(day)}`;
  3735. }
  3736. function getTime(date, hideSecond) {
  3737. date = fixIosDateFormat(date);
  3738. date = new Date(date);
  3739. const hour = date.getHours();
  3740. const minute = date.getMinutes();
  3741. const second = date.getSeconds();
  3742. return hideSecond ? `${addZero(hour)}:${addZero(minute)}` : `${addZero(hour)}:${addZero(minute)}:${addZero(second)}`;
  3743. }
  3744. function addZero(num) {
  3745. if (num < 10) {
  3746. num = `0${num}`;
  3747. }
  3748. return num;
  3749. }
  3750. function getDefaultSecond(hideSecond) {
  3751. return hideSecond ? "00:00" : "00:00:00";
  3752. }
  3753. function dateCompare(startDate, endDate) {
  3754. startDate = new Date(fixIosDateFormat(startDate));
  3755. endDate = new Date(fixIosDateFormat(endDate));
  3756. return startDate <= endDate;
  3757. }
  3758. function checkDate(date) {
  3759. const dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g;
  3760. return date.match(dateReg);
  3761. }
  3762. const dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9]:[0-5]?[0-9])?$/;
  3763. function fixIosDateFormat(value) {
  3764. if (typeof value === "string" && dateTimeReg.test(value)) {
  3765. value = value.replace(/-/g, "/");
  3766. }
  3767. return value;
  3768. }
  3769. const _sfc_main$k = {
  3770. props: {
  3771. weeks: {
  3772. type: Object,
  3773. default() {
  3774. return {};
  3775. }
  3776. },
  3777. calendar: {
  3778. type: Object,
  3779. default: () => {
  3780. return {};
  3781. }
  3782. },
  3783. selected: {
  3784. type: Array,
  3785. default: () => {
  3786. return [];
  3787. }
  3788. },
  3789. checkHover: {
  3790. type: Boolean,
  3791. default: false
  3792. }
  3793. },
  3794. methods: {
  3795. choiceDate(weeks) {
  3796. this.$emit("change", weeks);
  3797. },
  3798. handleMousemove(weeks) {
  3799. this.$emit("handleMouse", weeks);
  3800. }
  3801. }
  3802. };
  3803. function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
  3804. return vue.openBlock(), vue.createElementBlock(
  3805. "view",
  3806. {
  3807. class: vue.normalizeClass(["uni-calendar-item__weeks-box", {
  3808. "uni-calendar-item--disable": $props.weeks.disable,
  3809. "uni-calendar-item--before-checked-x": $props.weeks.beforeMultiple,
  3810. "uni-calendar-item--multiple": $props.weeks.multiple,
  3811. "uni-calendar-item--after-checked-x": $props.weeks.afterMultiple
  3812. }]),
  3813. onClick: _cache[0] || (_cache[0] = ($event) => $options.choiceDate($props.weeks)),
  3814. onMouseenter: _cache[1] || (_cache[1] = ($event) => $options.handleMousemove($props.weeks))
  3815. },
  3816. [
  3817. vue.createElementVNode(
  3818. "view",
  3819. {
  3820. class: vue.normalizeClass(["uni-calendar-item__weeks-box-item", {
  3821. "uni-calendar-item--checked": $props.calendar.fullDate === $props.weeks.fullDate && ($props.calendar.userChecked || !$props.checkHover),
  3822. "uni-calendar-item--checked-range-text": $props.checkHover,
  3823. "uni-calendar-item--before-checked": $props.weeks.beforeMultiple,
  3824. "uni-calendar-item--multiple": $props.weeks.multiple,
  3825. "uni-calendar-item--after-checked": $props.weeks.afterMultiple,
  3826. "uni-calendar-item--disable": $props.weeks.disable
  3827. }])
  3828. },
  3829. [
  3830. $props.selected && $props.weeks.extraInfo ? (vue.openBlock(), vue.createElementBlock("text", {
  3831. key: 0,
  3832. class: "uni-calendar-item__weeks-box-circle"
  3833. })) : vue.createCommentVNode("v-if", true),
  3834. vue.createElementVNode(
  3835. "text",
  3836. { class: "uni-calendar-item__weeks-box-text uni-calendar-item__weeks-box-text-disable uni-calendar-item--checked-text" },
  3837. vue.toDisplayString($props.weeks.date),
  3838. 1
  3839. /* TEXT */
  3840. )
  3841. ],
  3842. 2
  3843. /* CLASS */
  3844. ),
  3845. vue.createElementVNode(
  3846. "view",
  3847. {
  3848. class: vue.normalizeClass({ "uni-calendar-item--today": $props.weeks.isToday })
  3849. },
  3850. null,
  3851. 2
  3852. /* CLASS */
  3853. )
  3854. ],
  3855. 34
  3856. /* CLASS, HYDRATE_EVENTS */
  3857. );
  3858. }
  3859. const calendarItem = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$c], ["__scopeId", "data-v-3c762a01"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue"]]);
  3860. const isObject = (val) => val !== null && typeof val === "object";
  3861. const defaultDelimiters = ["{", "}"];
  3862. class BaseFormatter {
  3863. constructor() {
  3864. this._caches = /* @__PURE__ */ Object.create(null);
  3865. }
  3866. interpolate(message, values, delimiters = defaultDelimiters) {
  3867. if (!values) {
  3868. return [message];
  3869. }
  3870. let tokens = this._caches[message];
  3871. if (!tokens) {
  3872. tokens = parse(message, delimiters);
  3873. this._caches[message] = tokens;
  3874. }
  3875. return compile(tokens, values);
  3876. }
  3877. }
  3878. const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3879. const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3880. function parse(format, [startDelimiter, endDelimiter]) {
  3881. const tokens = [];
  3882. let position = 0;
  3883. let text = "";
  3884. while (position < format.length) {
  3885. let char = format[position++];
  3886. if (char === startDelimiter) {
  3887. if (text) {
  3888. tokens.push({ type: "text", value: text });
  3889. }
  3890. text = "";
  3891. let sub = "";
  3892. char = format[position++];
  3893. while (char !== void 0 && char !== endDelimiter) {
  3894. sub += char;
  3895. char = format[position++];
  3896. }
  3897. const isClosed = char === endDelimiter;
  3898. const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
  3899. tokens.push({ value: sub, type });
  3900. } else {
  3901. text += char;
  3902. }
  3903. }
  3904. text && tokens.push({ type: "text", value: text });
  3905. return tokens;
  3906. }
  3907. function compile(tokens, values) {
  3908. const compiled = [];
  3909. let index = 0;
  3910. const mode = Array.isArray(values) ? "list" : isObject(values) ? "named" : "unknown";
  3911. if (mode === "unknown") {
  3912. return compiled;
  3913. }
  3914. while (index < tokens.length) {
  3915. const token2 = tokens[index];
  3916. switch (token2.type) {
  3917. case "text":
  3918. compiled.push(token2.value);
  3919. break;
  3920. case "list":
  3921. compiled.push(values[parseInt(token2.value, 10)]);
  3922. break;
  3923. case "named":
  3924. if (mode === "named") {
  3925. compiled.push(values[token2.value]);
  3926. } else {
  3927. {
  3928. console.warn(`Type of token '${token2.type}' and format of value '${mode}' don't match!`);
  3929. }
  3930. }
  3931. break;
  3932. case "unknown":
  3933. {
  3934. console.warn(`Detect 'unknown' type of token!`);
  3935. }
  3936. break;
  3937. }
  3938. index++;
  3939. }
  3940. return compiled;
  3941. }
  3942. const LOCALE_ZH_HANS = "zh-Hans";
  3943. const LOCALE_ZH_HANT = "zh-Hant";
  3944. const LOCALE_EN = "en";
  3945. const LOCALE_FR = "fr";
  3946. const LOCALE_ES = "es";
  3947. const hasOwnProperty = Object.prototype.hasOwnProperty;
  3948. const hasOwn = (val, key) => hasOwnProperty.call(val, key);
  3949. const defaultFormatter = new BaseFormatter();
  3950. function include(str, parts) {
  3951. return !!parts.find((part) => str.indexOf(part) !== -1);
  3952. }
  3953. function startsWith(str, parts) {
  3954. return parts.find((part) => str.indexOf(part) === 0);
  3955. }
  3956. function normalizeLocale(locale, messages2) {
  3957. if (!locale) {
  3958. return;
  3959. }
  3960. locale = locale.trim().replace(/_/g, "-");
  3961. if (messages2 && messages2[locale]) {
  3962. return locale;
  3963. }
  3964. locale = locale.toLowerCase();
  3965. if (locale === "chinese") {
  3966. return LOCALE_ZH_HANS;
  3967. }
  3968. if (locale.indexOf("zh") === 0) {
  3969. if (locale.indexOf("-hans") > -1) {
  3970. return LOCALE_ZH_HANS;
  3971. }
  3972. if (locale.indexOf("-hant") > -1) {
  3973. return LOCALE_ZH_HANT;
  3974. }
  3975. if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
  3976. return LOCALE_ZH_HANT;
  3977. }
  3978. return LOCALE_ZH_HANS;
  3979. }
  3980. let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  3981. if (messages2 && Object.keys(messages2).length > 0) {
  3982. locales = Object.keys(messages2);
  3983. }
  3984. const lang = startsWith(locale, locales);
  3985. if (lang) {
  3986. return lang;
  3987. }
  3988. }
  3989. class I18n {
  3990. constructor({ locale, fallbackLocale, messages: messages2, watcher, formater }) {
  3991. this.locale = LOCALE_EN;
  3992. this.fallbackLocale = LOCALE_EN;
  3993. this.message = {};
  3994. this.messages = {};
  3995. this.watchers = [];
  3996. if (fallbackLocale) {
  3997. this.fallbackLocale = fallbackLocale;
  3998. }
  3999. this.formater = formater || defaultFormatter;
  4000. this.messages = messages2 || {};
  4001. this.setLocale(locale || LOCALE_EN);
  4002. if (watcher) {
  4003. this.watchLocale(watcher);
  4004. }
  4005. }
  4006. setLocale(locale) {
  4007. const oldLocale = this.locale;
  4008. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  4009. if (!this.messages[this.locale]) {
  4010. this.messages[this.locale] = {};
  4011. }
  4012. this.message = this.messages[this.locale];
  4013. if (oldLocale !== this.locale) {
  4014. this.watchers.forEach((watcher) => {
  4015. watcher(this.locale, oldLocale);
  4016. });
  4017. }
  4018. }
  4019. getLocale() {
  4020. return this.locale;
  4021. }
  4022. watchLocale(fn) {
  4023. const index = this.watchers.push(fn) - 1;
  4024. return () => {
  4025. this.watchers.splice(index, 1);
  4026. };
  4027. }
  4028. add(locale, message, override = true) {
  4029. const curMessages = this.messages[locale];
  4030. if (curMessages) {
  4031. if (override) {
  4032. Object.assign(curMessages, message);
  4033. } else {
  4034. Object.keys(message).forEach((key) => {
  4035. if (!hasOwn(curMessages, key)) {
  4036. curMessages[key] = message[key];
  4037. }
  4038. });
  4039. }
  4040. } else {
  4041. this.messages[locale] = message;
  4042. }
  4043. }
  4044. f(message, values, delimiters) {
  4045. return this.formater.interpolate(message, values, delimiters).join("");
  4046. }
  4047. t(key, locale, values) {
  4048. let message = this.message;
  4049. if (typeof locale === "string") {
  4050. locale = normalizeLocale(locale, this.messages);
  4051. locale && (message = this.messages[locale]);
  4052. } else {
  4053. values = locale;
  4054. }
  4055. if (!hasOwn(message, key)) {
  4056. console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
  4057. return key;
  4058. }
  4059. return this.formater.interpolate(message[key], values).join("");
  4060. }
  4061. }
  4062. function watchAppLocale(appVm, i18n) {
  4063. if (appVm.$watchLocale) {
  4064. appVm.$watchLocale((newLocale) => {
  4065. i18n.setLocale(newLocale);
  4066. });
  4067. } else {
  4068. appVm.$watch(() => appVm.$locale, (newLocale) => {
  4069. i18n.setLocale(newLocale);
  4070. });
  4071. }
  4072. }
  4073. function getDefaultLocale() {
  4074. if (typeof uni !== "undefined" && uni.getLocale) {
  4075. return uni.getLocale();
  4076. }
  4077. if (typeof global !== "undefined" && global.getLocale) {
  4078. return global.getLocale();
  4079. }
  4080. return LOCALE_EN;
  4081. }
  4082. function initVueI18n(locale, messages2 = {}, fallbackLocale, watcher) {
  4083. if (typeof locale !== "string") {
  4084. [locale, messages2] = [
  4085. messages2,
  4086. locale
  4087. ];
  4088. }
  4089. if (typeof locale !== "string") {
  4090. locale = getDefaultLocale();
  4091. }
  4092. if (typeof fallbackLocale !== "string") {
  4093. fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
  4094. }
  4095. const i18n = new I18n({
  4096. locale,
  4097. fallbackLocale,
  4098. messages: messages2,
  4099. watcher
  4100. });
  4101. let t2 = (key, values) => {
  4102. if (typeof getApp !== "function") {
  4103. t2 = function(key2, values2) {
  4104. return i18n.t(key2, values2);
  4105. };
  4106. } else {
  4107. let isWatchedAppLocale = false;
  4108. t2 = function(key2, values2) {
  4109. const appVm = getApp().$vm;
  4110. if (appVm) {
  4111. appVm.$locale;
  4112. if (!isWatchedAppLocale) {
  4113. isWatchedAppLocale = true;
  4114. watchAppLocale(appVm, i18n);
  4115. }
  4116. }
  4117. return i18n.t(key2, values2);
  4118. };
  4119. }
  4120. return t2(key, values);
  4121. };
  4122. return {
  4123. i18n,
  4124. f(message, values, delimiters) {
  4125. return i18n.f(message, values, delimiters);
  4126. },
  4127. t(key, values) {
  4128. return t2(key, values);
  4129. },
  4130. add(locale2, message, override = true) {
  4131. return i18n.add(locale2, message, override);
  4132. },
  4133. watch(fn) {
  4134. return i18n.watchLocale(fn);
  4135. },
  4136. getLocale() {
  4137. return i18n.getLocale();
  4138. },
  4139. setLocale(newLocale) {
  4140. return i18n.setLocale(newLocale);
  4141. }
  4142. };
  4143. }
  4144. const en$1 = {
  4145. "uni-datetime-picker.selectDate": "select date",
  4146. "uni-datetime-picker.selectTime": "select time",
  4147. "uni-datetime-picker.selectDateTime": "select date and time",
  4148. "uni-datetime-picker.startDate": "start date",
  4149. "uni-datetime-picker.endDate": "end date",
  4150. "uni-datetime-picker.startTime": "start time",
  4151. "uni-datetime-picker.endTime": "end time",
  4152. "uni-datetime-picker.ok": "ok",
  4153. "uni-datetime-picker.clear": "clear",
  4154. "uni-datetime-picker.cancel": "cancel",
  4155. "uni-datetime-picker.year": "-",
  4156. "uni-datetime-picker.month": "",
  4157. "uni-calender.MON": "MON",
  4158. "uni-calender.TUE": "TUE",
  4159. "uni-calender.WED": "WED",
  4160. "uni-calender.THU": "THU",
  4161. "uni-calender.FRI": "FRI",
  4162. "uni-calender.SAT": "SAT",
  4163. "uni-calender.SUN": "SUN",
  4164. "uni-calender.confirm": "confirm"
  4165. };
  4166. const zhHans$1 = {
  4167. "uni-datetime-picker.selectDate": "选择日期",
  4168. "uni-datetime-picker.selectTime": "选择时间",
  4169. "uni-datetime-picker.selectDateTime": "选择日期时间",
  4170. "uni-datetime-picker.startDate": "开始时间",
  4171. "uni-datetime-picker.endDate": "结束时间",
  4172. "uni-datetime-picker.startTime": "开始时间",
  4173. "uni-datetime-picker.endTime": "结束时间",
  4174. "uni-datetime-picker.ok": "确定",
  4175. "uni-datetime-picker.clear": "清除",
  4176. "uni-datetime-picker.cancel": "取消",
  4177. "uni-datetime-picker.year": "年",
  4178. "uni-datetime-picker.month": "月",
  4179. "uni-calender.SUN": "日",
  4180. "uni-calender.MON": "一",
  4181. "uni-calender.TUE": "二",
  4182. "uni-calender.WED": "三",
  4183. "uni-calender.THU": "四",
  4184. "uni-calender.FRI": "五",
  4185. "uni-calender.SAT": "六",
  4186. "uni-calender.confirm": "确认"
  4187. };
  4188. const zhHant$1 = {
  4189. "uni-datetime-picker.selectDate": "選擇日期",
  4190. "uni-datetime-picker.selectTime": "選擇時間",
  4191. "uni-datetime-picker.selectDateTime": "選擇日期時間",
  4192. "uni-datetime-picker.startDate": "開始日期",
  4193. "uni-datetime-picker.endDate": "結束日期",
  4194. "uni-datetime-picker.startTime": "開始时间",
  4195. "uni-datetime-picker.endTime": "結束时间",
  4196. "uni-datetime-picker.ok": "確定",
  4197. "uni-datetime-picker.clear": "清除",
  4198. "uni-datetime-picker.cancel": "取消",
  4199. "uni-datetime-picker.year": "年",
  4200. "uni-datetime-picker.month": "月",
  4201. "uni-calender.SUN": "日",
  4202. "uni-calender.MON": "一",
  4203. "uni-calender.TUE": "二",
  4204. "uni-calender.WED": "三",
  4205. "uni-calender.THU": "四",
  4206. "uni-calender.FRI": "五",
  4207. "uni-calender.SAT": "六",
  4208. "uni-calender.confirm": "確認"
  4209. };
  4210. const i18nMessages = {
  4211. en: en$1,
  4212. "zh-Hans": zhHans$1,
  4213. "zh-Hant": zhHant$1
  4214. };
  4215. const { t: t$4 } = initVueI18n(i18nMessages);
  4216. const _sfc_main$j = {
  4217. name: "UniDatetimePicker",
  4218. data() {
  4219. return {
  4220. indicatorStyle: `height: 50px;`,
  4221. visible: false,
  4222. fixNvueBug: {},
  4223. dateShow: true,
  4224. timeShow: true,
  4225. title: "日期和时间",
  4226. // 输入框当前时间
  4227. time: "",
  4228. // 当前的年月日时分秒
  4229. year: 1920,
  4230. month: 0,
  4231. day: 0,
  4232. hour: 0,
  4233. minute: 0,
  4234. second: 0,
  4235. // 起始时间
  4236. startYear: 1920,
  4237. startMonth: 1,
  4238. startDay: 1,
  4239. startHour: 0,
  4240. startMinute: 0,
  4241. startSecond: 0,
  4242. // 结束时间
  4243. endYear: 2120,
  4244. endMonth: 12,
  4245. endDay: 31,
  4246. endHour: 23,
  4247. endMinute: 59,
  4248. endSecond: 59
  4249. };
  4250. },
  4251. props: {
  4252. type: {
  4253. type: String,
  4254. default: "datetime"
  4255. },
  4256. value: {
  4257. type: [String, Number],
  4258. default: ""
  4259. },
  4260. modelValue: {
  4261. type: [String, Number],
  4262. default: ""
  4263. },
  4264. start: {
  4265. type: [Number, String],
  4266. default: ""
  4267. },
  4268. end: {
  4269. type: [Number, String],
  4270. default: ""
  4271. },
  4272. returnType: {
  4273. type: String,
  4274. default: "string"
  4275. },
  4276. disabled: {
  4277. type: [Boolean, String],
  4278. default: false
  4279. },
  4280. border: {
  4281. type: [Boolean, String],
  4282. default: true
  4283. },
  4284. hideSecond: {
  4285. type: [Boolean, String],
  4286. default: false
  4287. }
  4288. },
  4289. watch: {
  4290. modelValue: {
  4291. handler(newVal) {
  4292. if (newVal) {
  4293. this.parseValue(fixIosDateFormat(newVal));
  4294. this.initTime(false);
  4295. } else {
  4296. this.time = "";
  4297. this.parseValue(Date.now());
  4298. }
  4299. },
  4300. immediate: true
  4301. },
  4302. type: {
  4303. handler(newValue) {
  4304. if (newValue === "date") {
  4305. this.dateShow = true;
  4306. this.timeShow = false;
  4307. this.title = "日期";
  4308. } else if (newValue === "time") {
  4309. this.dateShow = false;
  4310. this.timeShow = true;
  4311. this.title = "时间";
  4312. } else {
  4313. this.dateShow = true;
  4314. this.timeShow = true;
  4315. this.title = "日期和时间";
  4316. }
  4317. },
  4318. immediate: true
  4319. },
  4320. start: {
  4321. handler(newVal) {
  4322. this.parseDatetimeRange(fixIosDateFormat(newVal), "start");
  4323. },
  4324. immediate: true
  4325. },
  4326. end: {
  4327. handler(newVal) {
  4328. this.parseDatetimeRange(fixIosDateFormat(newVal), "end");
  4329. },
  4330. immediate: true
  4331. },
  4332. // 月、日、时、分、秒可选范围变化后,检查当前值是否在范围内,不在则当前值重置为可选范围第一项
  4333. months(newVal) {
  4334. this.checkValue("month", this.month, newVal);
  4335. },
  4336. days(newVal) {
  4337. this.checkValue("day", this.day, newVal);
  4338. },
  4339. hours(newVal) {
  4340. this.checkValue("hour", this.hour, newVal);
  4341. },
  4342. minutes(newVal) {
  4343. this.checkValue("minute", this.minute, newVal);
  4344. },
  4345. seconds(newVal) {
  4346. this.checkValue("second", this.second, newVal);
  4347. }
  4348. },
  4349. computed: {
  4350. // 当前年、月、日、时、分、秒选择范围
  4351. years() {
  4352. return this.getCurrentRange("year");
  4353. },
  4354. months() {
  4355. return this.getCurrentRange("month");
  4356. },
  4357. days() {
  4358. return this.getCurrentRange("day");
  4359. },
  4360. hours() {
  4361. return this.getCurrentRange("hour");
  4362. },
  4363. minutes() {
  4364. return this.getCurrentRange("minute");
  4365. },
  4366. seconds() {
  4367. return this.getCurrentRange("second");
  4368. },
  4369. // picker 当前值数组
  4370. ymd() {
  4371. return [this.year - this.minYear, this.month - this.minMonth, this.day - this.minDay];
  4372. },
  4373. hms() {
  4374. return [this.hour - this.minHour, this.minute - this.minMinute, this.second - this.minSecond];
  4375. },
  4376. // 当前 date 是 start
  4377. currentDateIsStart() {
  4378. return this.year === this.startYear && this.month === this.startMonth && this.day === this.startDay;
  4379. },
  4380. // 当前 date 是 end
  4381. currentDateIsEnd() {
  4382. return this.year === this.endYear && this.month === this.endMonth && this.day === this.endDay;
  4383. },
  4384. // 当前年、月、日、时、分、秒的最小值和最大值
  4385. minYear() {
  4386. return this.startYear;
  4387. },
  4388. maxYear() {
  4389. return this.endYear;
  4390. },
  4391. minMonth() {
  4392. if (this.year === this.startYear) {
  4393. return this.startMonth;
  4394. } else {
  4395. return 1;
  4396. }
  4397. },
  4398. maxMonth() {
  4399. if (this.year === this.endYear) {
  4400. return this.endMonth;
  4401. } else {
  4402. return 12;
  4403. }
  4404. },
  4405. minDay() {
  4406. if (this.year === this.startYear && this.month === this.startMonth) {
  4407. return this.startDay;
  4408. } else {
  4409. return 1;
  4410. }
  4411. },
  4412. maxDay() {
  4413. if (this.year === this.endYear && this.month === this.endMonth) {
  4414. return this.endDay;
  4415. } else {
  4416. return this.daysInMonth(this.year, this.month);
  4417. }
  4418. },
  4419. minHour() {
  4420. if (this.type === "datetime") {
  4421. if (this.currentDateIsStart) {
  4422. return this.startHour;
  4423. } else {
  4424. return 0;
  4425. }
  4426. }
  4427. if (this.type === "time") {
  4428. return this.startHour;
  4429. }
  4430. },
  4431. maxHour() {
  4432. if (this.type === "datetime") {
  4433. if (this.currentDateIsEnd) {
  4434. return this.endHour;
  4435. } else {
  4436. return 23;
  4437. }
  4438. }
  4439. if (this.type === "time") {
  4440. return this.endHour;
  4441. }
  4442. },
  4443. minMinute() {
  4444. if (this.type === "datetime") {
  4445. if (this.currentDateIsStart && this.hour === this.startHour) {
  4446. return this.startMinute;
  4447. } else {
  4448. return 0;
  4449. }
  4450. }
  4451. if (this.type === "time") {
  4452. if (this.hour === this.startHour) {
  4453. return this.startMinute;
  4454. } else {
  4455. return 0;
  4456. }
  4457. }
  4458. },
  4459. maxMinute() {
  4460. if (this.type === "datetime") {
  4461. if (this.currentDateIsEnd && this.hour === this.endHour) {
  4462. return this.endMinute;
  4463. } else {
  4464. return 59;
  4465. }
  4466. }
  4467. if (this.type === "time") {
  4468. if (this.hour === this.endHour) {
  4469. return this.endMinute;
  4470. } else {
  4471. return 59;
  4472. }
  4473. }
  4474. },
  4475. minSecond() {
  4476. if (this.type === "datetime") {
  4477. if (this.currentDateIsStart && this.hour === this.startHour && this.minute === this.startMinute) {
  4478. return this.startSecond;
  4479. } else {
  4480. return 0;
  4481. }
  4482. }
  4483. if (this.type === "time") {
  4484. if (this.hour === this.startHour && this.minute === this.startMinute) {
  4485. return this.startSecond;
  4486. } else {
  4487. return 0;
  4488. }
  4489. }
  4490. },
  4491. maxSecond() {
  4492. if (this.type === "datetime") {
  4493. if (this.currentDateIsEnd && this.hour === this.endHour && this.minute === this.endMinute) {
  4494. return this.endSecond;
  4495. } else {
  4496. return 59;
  4497. }
  4498. }
  4499. if (this.type === "time") {
  4500. if (this.hour === this.endHour && this.minute === this.endMinute) {
  4501. return this.endSecond;
  4502. } else {
  4503. return 59;
  4504. }
  4505. }
  4506. },
  4507. /**
  4508. * for i18n
  4509. */
  4510. selectTimeText() {
  4511. return t$4("uni-datetime-picker.selectTime");
  4512. },
  4513. okText() {
  4514. return t$4("uni-datetime-picker.ok");
  4515. },
  4516. clearText() {
  4517. return t$4("uni-datetime-picker.clear");
  4518. },
  4519. cancelText() {
  4520. return t$4("uni-datetime-picker.cancel");
  4521. }
  4522. },
  4523. mounted() {
  4524. },
  4525. methods: {
  4526. /**
  4527. * @param {Object} item
  4528. * 小于 10 在前面加个 0
  4529. */
  4530. lessThanTen(item) {
  4531. return item < 10 ? "0" + item : item;
  4532. },
  4533. /**
  4534. * 解析时分秒字符串,例如:00:00:00
  4535. * @param {String} timeString
  4536. */
  4537. parseTimeType(timeString) {
  4538. if (timeString) {
  4539. let timeArr = timeString.split(":");
  4540. this.hour = Number(timeArr[0]);
  4541. this.minute = Number(timeArr[1]);
  4542. this.second = Number(timeArr[2]);
  4543. }
  4544. },
  4545. /**
  4546. * 解析选择器初始值,类型可以是字符串、时间戳,例如:2000-10-02、'08:30:00'、 1610695109000
  4547. * @param {String | Number} datetime
  4548. */
  4549. initPickerValue(datetime) {
  4550. let defaultValue = null;
  4551. if (datetime) {
  4552. defaultValue = this.compareValueWithStartAndEnd(datetime, this.start, this.end);
  4553. } else {
  4554. defaultValue = Date.now();
  4555. defaultValue = this.compareValueWithStartAndEnd(defaultValue, this.start, this.end);
  4556. }
  4557. this.parseValue(defaultValue);
  4558. },
  4559. /**
  4560. * 初始值规则:
  4561. * - 用户设置初始值 value
  4562. * - 设置了起始时间 start、终止时间 end,并 start < value < end,初始值为 value, 否则初始值为 start
  4563. * - 只设置了起始时间 start,并 start < value,初始值为 value,否则初始值为 start
  4564. * - 只设置了终止时间 end,并 value < end,初始值为 value,否则初始值为 end
  4565. * - 无起始终止时间,则初始值为 value
  4566. * - 无初始值 value,则初始值为当前本地时间 Date.now()
  4567. * @param {Object} value
  4568. * @param {Object} dateBase
  4569. */
  4570. compareValueWithStartAndEnd(value, start, end) {
  4571. let winner = null;
  4572. value = this.superTimeStamp(value);
  4573. start = this.superTimeStamp(start);
  4574. end = this.superTimeStamp(end);
  4575. if (start && end) {
  4576. if (value < start) {
  4577. winner = new Date(start);
  4578. } else if (value > end) {
  4579. winner = new Date(end);
  4580. } else {
  4581. winner = new Date(value);
  4582. }
  4583. } else if (start && !end) {
  4584. winner = start <= value ? new Date(value) : new Date(start);
  4585. } else if (!start && end) {
  4586. winner = value <= end ? new Date(value) : new Date(end);
  4587. } else {
  4588. winner = new Date(value);
  4589. }
  4590. return winner;
  4591. },
  4592. /**
  4593. * 转换为可比较的时间戳,接受日期、时分秒、时间戳
  4594. * @param {Object} value
  4595. */
  4596. superTimeStamp(value) {
  4597. let dateBase = "";
  4598. if (this.type === "time" && value && typeof value === "string") {
  4599. const now = /* @__PURE__ */ new Date();
  4600. const year = now.getFullYear();
  4601. const month = now.getMonth() + 1;
  4602. const day = now.getDate();
  4603. dateBase = year + "/" + month + "/" + day + " ";
  4604. }
  4605. if (Number(value)) {
  4606. value = parseInt(value);
  4607. dateBase = 0;
  4608. }
  4609. return this.createTimeStamp(dateBase + value);
  4610. },
  4611. /**
  4612. * 解析默认值 value,字符串、时间戳
  4613. * @param {Object} defaultTime
  4614. */
  4615. parseValue(value) {
  4616. if (!value) {
  4617. return;
  4618. }
  4619. if (this.type === "time" && typeof value === "string") {
  4620. this.parseTimeType(value);
  4621. } else {
  4622. let defaultDate = null;
  4623. defaultDate = new Date(value);
  4624. if (this.type !== "time") {
  4625. this.year = defaultDate.getFullYear();
  4626. this.month = defaultDate.getMonth() + 1;
  4627. this.day = defaultDate.getDate();
  4628. }
  4629. if (this.type !== "date") {
  4630. this.hour = defaultDate.getHours();
  4631. this.minute = defaultDate.getMinutes();
  4632. this.second = defaultDate.getSeconds();
  4633. }
  4634. }
  4635. if (this.hideSecond) {
  4636. this.second = 0;
  4637. }
  4638. },
  4639. /**
  4640. * 解析可选择时间范围 start、end,年月日字符串、时间戳
  4641. * @param {Object} defaultTime
  4642. */
  4643. parseDatetimeRange(point, pointType) {
  4644. if (!point) {
  4645. if (pointType === "start") {
  4646. this.startYear = 1920;
  4647. this.startMonth = 1;
  4648. this.startDay = 1;
  4649. this.startHour = 0;
  4650. this.startMinute = 0;
  4651. this.startSecond = 0;
  4652. }
  4653. if (pointType === "end") {
  4654. this.endYear = 2120;
  4655. this.endMonth = 12;
  4656. this.endDay = 31;
  4657. this.endHour = 23;
  4658. this.endMinute = 59;
  4659. this.endSecond = 59;
  4660. }
  4661. return;
  4662. }
  4663. if (this.type === "time") {
  4664. const pointArr = point.split(":");
  4665. this[pointType + "Hour"] = Number(pointArr[0]);
  4666. this[pointType + "Minute"] = Number(pointArr[1]);
  4667. this[pointType + "Second"] = Number(pointArr[2]);
  4668. } else {
  4669. if (!point) {
  4670. pointType === "start" ? this.startYear = this.year - 60 : this.endYear = this.year + 60;
  4671. return;
  4672. }
  4673. if (Number(point)) {
  4674. point = parseInt(point);
  4675. }
  4676. const hasTime = /[0-9]:[0-9]/;
  4677. if (this.type === "datetime" && pointType === "end" && typeof point === "string" && !hasTime.test(
  4678. point
  4679. )) {
  4680. point = point + " 23:59:59";
  4681. }
  4682. const pointDate = new Date(point);
  4683. this[pointType + "Year"] = pointDate.getFullYear();
  4684. this[pointType + "Month"] = pointDate.getMonth() + 1;
  4685. this[pointType + "Day"] = pointDate.getDate();
  4686. if (this.type === "datetime") {
  4687. this[pointType + "Hour"] = pointDate.getHours();
  4688. this[pointType + "Minute"] = pointDate.getMinutes();
  4689. this[pointType + "Second"] = pointDate.getSeconds();
  4690. }
  4691. }
  4692. },
  4693. // 获取 年、月、日、时、分、秒 当前可选范围
  4694. getCurrentRange(value) {
  4695. const range = [];
  4696. for (let i2 = this["min" + this.capitalize(value)]; i2 <= this["max" + this.capitalize(value)]; i2++) {
  4697. range.push(i2);
  4698. }
  4699. return range;
  4700. },
  4701. // 字符串首字母大写
  4702. capitalize(str) {
  4703. return str.charAt(0).toUpperCase() + str.slice(1);
  4704. },
  4705. // 检查当前值是否在范围内,不在则当前值重置为可选范围第一项
  4706. checkValue(name, value, values) {
  4707. if (values.indexOf(value) === -1) {
  4708. this[name] = values[0];
  4709. }
  4710. },
  4711. // 每个月的实际天数
  4712. daysInMonth(year, month) {
  4713. return new Date(year, month, 0).getDate();
  4714. },
  4715. //兼容 iOS、safari 日期格式
  4716. fixIosDateFormat(value) {
  4717. if (typeof value === "string") {
  4718. value = value.replace(/-/g, "/");
  4719. }
  4720. return value;
  4721. },
  4722. /**
  4723. * 生成时间戳
  4724. * @param {Object} time
  4725. */
  4726. createTimeStamp(time) {
  4727. if (!time)
  4728. return;
  4729. if (typeof time === "number") {
  4730. return time;
  4731. } else {
  4732. time = time.replace(/-/g, "/");
  4733. if (this.type === "date") {
  4734. time = time + " 00:00:00";
  4735. }
  4736. return Date.parse(time);
  4737. }
  4738. },
  4739. /**
  4740. * 生成日期或时间的字符串
  4741. */
  4742. createDomSting() {
  4743. const yymmdd = this.year + "-" + this.lessThanTen(this.month) + "-" + this.lessThanTen(this.day);
  4744. let hhmmss = this.lessThanTen(this.hour) + ":" + this.lessThanTen(this.minute);
  4745. if (!this.hideSecond) {
  4746. hhmmss = hhmmss + ":" + this.lessThanTen(this.second);
  4747. }
  4748. if (this.type === "date") {
  4749. return yymmdd;
  4750. } else if (this.type === "time") {
  4751. return hhmmss;
  4752. } else {
  4753. return yymmdd + " " + hhmmss;
  4754. }
  4755. },
  4756. /**
  4757. * 初始化返回值,并抛出 change 事件
  4758. */
  4759. initTime(emit = true) {
  4760. this.time = this.createDomSting();
  4761. if (!emit)
  4762. return;
  4763. if (this.returnType === "timestamp" && this.type !== "time") {
  4764. this.$emit("change", this.createTimeStamp(this.time));
  4765. this.$emit("input", this.createTimeStamp(this.time));
  4766. this.$emit("update:modelValue", this.createTimeStamp(this.time));
  4767. } else {
  4768. this.$emit("change", this.time);
  4769. this.$emit("input", this.time);
  4770. this.$emit("update:modelValue", this.time);
  4771. }
  4772. },
  4773. /**
  4774. * 用户选择日期或时间更新 data
  4775. * @param {Object} e
  4776. */
  4777. bindDateChange(e2) {
  4778. const val = e2.detail.value;
  4779. this.year = this.years[val[0]];
  4780. this.month = this.months[val[1]];
  4781. this.day = this.days[val[2]];
  4782. },
  4783. bindTimeChange(e2) {
  4784. const val = e2.detail.value;
  4785. this.hour = this.hours[val[0]];
  4786. this.minute = this.minutes[val[1]];
  4787. this.second = this.seconds[val[2]];
  4788. },
  4789. /**
  4790. * 初始化弹出层
  4791. */
  4792. initTimePicker() {
  4793. if (this.disabled)
  4794. return;
  4795. const value = fixIosDateFormat(this.time);
  4796. this.initPickerValue(value);
  4797. this.visible = !this.visible;
  4798. },
  4799. /**
  4800. * 触发或关闭弹框
  4801. */
  4802. tiggerTimePicker(e2) {
  4803. this.visible = !this.visible;
  4804. },
  4805. /**
  4806. * 用户点击“清空”按钮,清空当前值
  4807. */
  4808. clearTime() {
  4809. this.time = "";
  4810. this.$emit("change", this.time);
  4811. this.$emit("input", this.time);
  4812. this.$emit("update:modelValue", this.time);
  4813. this.tiggerTimePicker();
  4814. },
  4815. /**
  4816. * 用户点击“确定”按钮
  4817. */
  4818. setTime() {
  4819. this.initTime();
  4820. this.tiggerTimePicker();
  4821. }
  4822. }
  4823. };
  4824. function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
  4825. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-datetime-picker" }, [
  4826. vue.createElementVNode("view", {
  4827. onClick: _cache[0] || (_cache[0] = (...args) => $options.initTimePicker && $options.initTimePicker(...args))
  4828. }, [
  4829. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  4830. vue.createElementVNode(
  4831. "view",
  4832. {
  4833. class: vue.normalizeClass(["uni-datetime-picker-timebox-pointer", { "uni-datetime-picker-disabled": $props.disabled, "uni-datetime-picker-timebox": $props.border }])
  4834. },
  4835. [
  4836. vue.createElementVNode(
  4837. "text",
  4838. { class: "uni-datetime-picker-text" },
  4839. vue.toDisplayString($data.time),
  4840. 1
  4841. /* TEXT */
  4842. ),
  4843. !$data.time ? (vue.openBlock(), vue.createElementBlock("view", {
  4844. key: 0,
  4845. class: "uni-datetime-picker-time"
  4846. }, [
  4847. vue.createElementVNode(
  4848. "text",
  4849. { class: "uni-datetime-picker-text" },
  4850. vue.toDisplayString($options.selectTimeText),
  4851. 1
  4852. /* TEXT */
  4853. )
  4854. ])) : vue.createCommentVNode("v-if", true)
  4855. ],
  4856. 2
  4857. /* CLASS */
  4858. )
  4859. ], true)
  4860. ]),
  4861. $data.visible ? (vue.openBlock(), vue.createElementBlock("view", {
  4862. key: 0,
  4863. id: "mask",
  4864. class: "uni-datetime-picker-mask",
  4865. onClick: _cache[1] || (_cache[1] = (...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args))
  4866. })) : vue.createCommentVNode("v-if", true),
  4867. $data.visible ? (vue.openBlock(), vue.createElementBlock(
  4868. "view",
  4869. {
  4870. key: 1,
  4871. class: vue.normalizeClass(["uni-datetime-picker-popup", [$data.dateShow && $data.timeShow ? "" : "fix-nvue-height"]]),
  4872. style: vue.normalizeStyle($data.fixNvueBug)
  4873. },
  4874. [
  4875. vue.createElementVNode("view", { class: "uni-title" }, [
  4876. vue.createElementVNode(
  4877. "text",
  4878. { class: "uni-datetime-picker-text" },
  4879. vue.toDisplayString($options.selectTimeText),
  4880. 1
  4881. /* TEXT */
  4882. )
  4883. ]),
  4884. $data.dateShow ? (vue.openBlock(), vue.createElementBlock("view", {
  4885. key: 0,
  4886. class: "uni-datetime-picker__container-box"
  4887. }, [
  4888. vue.createElementVNode("picker-view", {
  4889. class: "uni-datetime-picker-view",
  4890. "indicator-style": $data.indicatorStyle,
  4891. value: $options.ymd,
  4892. onChange: _cache[2] || (_cache[2] = (...args) => $options.bindDateChange && $options.bindDateChange(...args))
  4893. }, [
  4894. vue.createElementVNode("picker-view-column", null, [
  4895. (vue.openBlock(true), vue.createElementBlock(
  4896. vue.Fragment,
  4897. null,
  4898. vue.renderList($options.years, (item, index) => {
  4899. return vue.openBlock(), vue.createElementBlock("view", {
  4900. class: "uni-datetime-picker-item",
  4901. key: index
  4902. }, [
  4903. vue.createElementVNode(
  4904. "text",
  4905. { class: "uni-datetime-picker-item" },
  4906. vue.toDisplayString($options.lessThanTen(item)),
  4907. 1
  4908. /* TEXT */
  4909. )
  4910. ]);
  4911. }),
  4912. 128
  4913. /* KEYED_FRAGMENT */
  4914. ))
  4915. ]),
  4916. vue.createElementVNode("picker-view-column", null, [
  4917. (vue.openBlock(true), vue.createElementBlock(
  4918. vue.Fragment,
  4919. null,
  4920. vue.renderList($options.months, (item, index) => {
  4921. return vue.openBlock(), vue.createElementBlock("view", {
  4922. class: "uni-datetime-picker-item",
  4923. key: index
  4924. }, [
  4925. vue.createElementVNode(
  4926. "text",
  4927. { class: "uni-datetime-picker-item" },
  4928. vue.toDisplayString($options.lessThanTen(item)),
  4929. 1
  4930. /* TEXT */
  4931. )
  4932. ]);
  4933. }),
  4934. 128
  4935. /* KEYED_FRAGMENT */
  4936. ))
  4937. ]),
  4938. vue.createElementVNode("picker-view-column", null, [
  4939. (vue.openBlock(true), vue.createElementBlock(
  4940. vue.Fragment,
  4941. null,
  4942. vue.renderList($options.days, (item, index) => {
  4943. return vue.openBlock(), vue.createElementBlock("view", {
  4944. class: "uni-datetime-picker-item",
  4945. key: index
  4946. }, [
  4947. vue.createElementVNode(
  4948. "text",
  4949. { class: "uni-datetime-picker-item" },
  4950. vue.toDisplayString($options.lessThanTen(item)),
  4951. 1
  4952. /* TEXT */
  4953. )
  4954. ]);
  4955. }),
  4956. 128
  4957. /* KEYED_FRAGMENT */
  4958. ))
  4959. ])
  4960. ], 40, ["indicator-style", "value"]),
  4961. vue.createCommentVNode(" 兼容 nvue 不支持伪类 "),
  4962. vue.createElementVNode("text", { class: "uni-datetime-picker-sign sign-left" }, "-"),
  4963. vue.createElementVNode("text", { class: "uni-datetime-picker-sign sign-right" }, "-")
  4964. ])) : vue.createCommentVNode("v-if", true),
  4965. $data.timeShow ? (vue.openBlock(), vue.createElementBlock("view", {
  4966. key: 1,
  4967. class: "uni-datetime-picker__container-box"
  4968. }, [
  4969. vue.createElementVNode("picker-view", {
  4970. class: vue.normalizeClass(["uni-datetime-picker-view", [$props.hideSecond ? "time-hide-second" : ""]]),
  4971. "indicator-style": $data.indicatorStyle,
  4972. value: $options.hms,
  4973. onChange: _cache[3] || (_cache[3] = (...args) => $options.bindTimeChange && $options.bindTimeChange(...args))
  4974. }, [
  4975. vue.createElementVNode("picker-view-column", null, [
  4976. (vue.openBlock(true), vue.createElementBlock(
  4977. vue.Fragment,
  4978. null,
  4979. vue.renderList($options.hours, (item, index) => {
  4980. return vue.openBlock(), vue.createElementBlock("view", {
  4981. class: "uni-datetime-picker-item",
  4982. key: index
  4983. }, [
  4984. vue.createElementVNode(
  4985. "text",
  4986. { class: "uni-datetime-picker-item" },
  4987. vue.toDisplayString($options.lessThanTen(item)),
  4988. 1
  4989. /* TEXT */
  4990. )
  4991. ]);
  4992. }),
  4993. 128
  4994. /* KEYED_FRAGMENT */
  4995. ))
  4996. ]),
  4997. vue.createElementVNode("picker-view-column", null, [
  4998. (vue.openBlock(true), vue.createElementBlock(
  4999. vue.Fragment,
  5000. null,
  5001. vue.renderList($options.minutes, (item, index) => {
  5002. return vue.openBlock(), vue.createElementBlock("view", {
  5003. class: "uni-datetime-picker-item",
  5004. key: index
  5005. }, [
  5006. vue.createElementVNode(
  5007. "text",
  5008. { class: "uni-datetime-picker-item" },
  5009. vue.toDisplayString($options.lessThanTen(item)),
  5010. 1
  5011. /* TEXT */
  5012. )
  5013. ]);
  5014. }),
  5015. 128
  5016. /* KEYED_FRAGMENT */
  5017. ))
  5018. ]),
  5019. !$props.hideSecond ? (vue.openBlock(), vue.createElementBlock("picker-view-column", { key: 0 }, [
  5020. (vue.openBlock(true), vue.createElementBlock(
  5021. vue.Fragment,
  5022. null,
  5023. vue.renderList($options.seconds, (item, index) => {
  5024. return vue.openBlock(), vue.createElementBlock("view", {
  5025. class: "uni-datetime-picker-item",
  5026. key: index
  5027. }, [
  5028. vue.createElementVNode(
  5029. "text",
  5030. { class: "uni-datetime-picker-item" },
  5031. vue.toDisplayString($options.lessThanTen(item)),
  5032. 1
  5033. /* TEXT */
  5034. )
  5035. ]);
  5036. }),
  5037. 128
  5038. /* KEYED_FRAGMENT */
  5039. ))
  5040. ])) : vue.createCommentVNode("v-if", true)
  5041. ], 42, ["indicator-style", "value"]),
  5042. vue.createCommentVNode(" 兼容 nvue 不支持伪类 "),
  5043. vue.createElementVNode(
  5044. "text",
  5045. {
  5046. class: vue.normalizeClass(["uni-datetime-picker-sign", [$props.hideSecond ? "sign-center" : "sign-left"]])
  5047. },
  5048. ":",
  5049. 2
  5050. /* CLASS */
  5051. ),
  5052. !$props.hideSecond ? (vue.openBlock(), vue.createElementBlock("text", {
  5053. key: 0,
  5054. class: "uni-datetime-picker-sign sign-right"
  5055. }, ":")) : vue.createCommentVNode("v-if", true)
  5056. ])) : vue.createCommentVNode("v-if", true),
  5057. vue.createElementVNode("view", { class: "uni-datetime-picker-btn" }, [
  5058. vue.createElementVNode("view", {
  5059. onClick: _cache[4] || (_cache[4] = (...args) => $options.clearTime && $options.clearTime(...args))
  5060. }, [
  5061. vue.createElementVNode(
  5062. "text",
  5063. { class: "uni-datetime-picker-btn-text" },
  5064. vue.toDisplayString($options.clearText),
  5065. 1
  5066. /* TEXT */
  5067. )
  5068. ]),
  5069. vue.createElementVNode("view", { class: "uni-datetime-picker-btn-group" }, [
  5070. vue.createElementVNode("view", {
  5071. class: "uni-datetime-picker-cancel",
  5072. onClick: _cache[5] || (_cache[5] = (...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args))
  5073. }, [
  5074. vue.createElementVNode(
  5075. "text",
  5076. { class: "uni-datetime-picker-btn-text" },
  5077. vue.toDisplayString($options.cancelText),
  5078. 1
  5079. /* TEXT */
  5080. )
  5081. ]),
  5082. vue.createElementVNode("view", {
  5083. onClick: _cache[6] || (_cache[6] = (...args) => $options.setTime && $options.setTime(...args))
  5084. }, [
  5085. vue.createElementVNode(
  5086. "text",
  5087. { class: "uni-datetime-picker-btn-text" },
  5088. vue.toDisplayString($options.okText),
  5089. 1
  5090. /* TEXT */
  5091. )
  5092. ])
  5093. ])
  5094. ])
  5095. ],
  5096. 6
  5097. /* CLASS, STYLE */
  5098. )) : vue.createCommentVNode("v-if", true)
  5099. ]);
  5100. }
  5101. const TimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$b], ["__scopeId", "data-v-1d532b70"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue"]]);
  5102. const { t: t$3 } = initVueI18n(i18nMessages);
  5103. const _sfc_main$i = {
  5104. components: {
  5105. calendarItem,
  5106. timePicker: TimePicker
  5107. },
  5108. props: {
  5109. date: {
  5110. type: String,
  5111. default: ""
  5112. },
  5113. defTime: {
  5114. type: [String, Object],
  5115. default: ""
  5116. },
  5117. selectableTimes: {
  5118. type: [Object],
  5119. default() {
  5120. return {};
  5121. }
  5122. },
  5123. selected: {
  5124. type: Array,
  5125. default() {
  5126. return [];
  5127. }
  5128. },
  5129. startDate: {
  5130. type: String,
  5131. default: ""
  5132. },
  5133. endDate: {
  5134. type: String,
  5135. default: ""
  5136. },
  5137. startPlaceholder: {
  5138. type: String,
  5139. default: ""
  5140. },
  5141. endPlaceholder: {
  5142. type: String,
  5143. default: ""
  5144. },
  5145. range: {
  5146. type: Boolean,
  5147. default: false
  5148. },
  5149. hasTime: {
  5150. type: Boolean,
  5151. default: false
  5152. },
  5153. insert: {
  5154. type: Boolean,
  5155. default: true
  5156. },
  5157. showMonth: {
  5158. type: Boolean,
  5159. default: true
  5160. },
  5161. clearDate: {
  5162. type: Boolean,
  5163. default: true
  5164. },
  5165. checkHover: {
  5166. type: Boolean,
  5167. default: true
  5168. },
  5169. hideSecond: {
  5170. type: [Boolean],
  5171. default: false
  5172. },
  5173. pleStatus: {
  5174. type: Object,
  5175. default() {
  5176. return {
  5177. before: "",
  5178. after: "",
  5179. data: [],
  5180. fulldate: ""
  5181. };
  5182. }
  5183. },
  5184. defaultValue: {
  5185. type: [String, Object, Array],
  5186. default: ""
  5187. }
  5188. },
  5189. data() {
  5190. return {
  5191. show: false,
  5192. weeks: [],
  5193. calendar: {},
  5194. nowDate: {},
  5195. aniMaskShow: false,
  5196. firstEnter: true,
  5197. time: "",
  5198. timeRange: {
  5199. startTime: "",
  5200. endTime: ""
  5201. },
  5202. tempSingleDate: "",
  5203. tempRange: {
  5204. before: "",
  5205. after: ""
  5206. }
  5207. };
  5208. },
  5209. watch: {
  5210. date: {
  5211. immediate: true,
  5212. handler(newVal) {
  5213. if (!this.range) {
  5214. this.tempSingleDate = newVal;
  5215. setTimeout(() => {
  5216. this.init(newVal);
  5217. }, 100);
  5218. }
  5219. }
  5220. },
  5221. defTime: {
  5222. immediate: true,
  5223. handler(newVal) {
  5224. if (!this.range) {
  5225. this.time = newVal;
  5226. } else {
  5227. this.timeRange.startTime = newVal.start;
  5228. this.timeRange.endTime = newVal.end;
  5229. }
  5230. }
  5231. },
  5232. startDate(val) {
  5233. if (!this.cale) {
  5234. return;
  5235. }
  5236. this.cale.setStartDate(val);
  5237. this.cale.setDate(this.nowDate.fullDate);
  5238. this.weeks = this.cale.weeks;
  5239. },
  5240. endDate(val) {
  5241. if (!this.cale) {
  5242. return;
  5243. }
  5244. this.cale.setEndDate(val);
  5245. this.cale.setDate(this.nowDate.fullDate);
  5246. this.weeks = this.cale.weeks;
  5247. },
  5248. selected(newVal) {
  5249. if (!this.cale) {
  5250. return;
  5251. }
  5252. this.cale.setSelectInfo(this.nowDate.fullDate, newVal);
  5253. this.weeks = this.cale.weeks;
  5254. },
  5255. pleStatus: {
  5256. immediate: true,
  5257. handler(newVal) {
  5258. const {
  5259. before,
  5260. after,
  5261. fulldate,
  5262. which
  5263. } = newVal;
  5264. this.tempRange.before = before;
  5265. this.tempRange.after = after;
  5266. setTimeout(() => {
  5267. if (fulldate) {
  5268. this.cale.setHoverMultiple(fulldate);
  5269. if (before && after) {
  5270. this.cale.lastHover = true;
  5271. if (this.rangeWithinMonth(after, before))
  5272. return;
  5273. this.setDate(before);
  5274. } else {
  5275. this.cale.setMultiple(fulldate);
  5276. this.setDate(this.nowDate.fullDate);
  5277. this.calendar.fullDate = "";
  5278. this.cale.lastHover = false;
  5279. }
  5280. } else {
  5281. if (!this.cale) {
  5282. return;
  5283. }
  5284. this.cale.setDefaultMultiple(before, after);
  5285. if (which === "left" && before) {
  5286. this.setDate(before);
  5287. this.weeks = this.cale.weeks;
  5288. } else if (after) {
  5289. this.setDate(after);
  5290. this.weeks = this.cale.weeks;
  5291. }
  5292. this.cale.lastHover = true;
  5293. }
  5294. }, 16);
  5295. }
  5296. }
  5297. },
  5298. computed: {
  5299. timepickerStartTime() {
  5300. const activeDate = this.range ? this.tempRange.before : this.calendar.fullDate;
  5301. return activeDate === this.startDate ? this.selectableTimes.start : "";
  5302. },
  5303. timepickerEndTime() {
  5304. const activeDate = this.range ? this.tempRange.after : this.calendar.fullDate;
  5305. return activeDate === this.endDate ? this.selectableTimes.end : "";
  5306. },
  5307. /**
  5308. * for i18n
  5309. */
  5310. selectDateText() {
  5311. return t$3("uni-datetime-picker.selectDate");
  5312. },
  5313. startDateText() {
  5314. return this.startPlaceholder || t$3("uni-datetime-picker.startDate");
  5315. },
  5316. endDateText() {
  5317. return this.endPlaceholder || t$3("uni-datetime-picker.endDate");
  5318. },
  5319. okText() {
  5320. return t$3("uni-datetime-picker.ok");
  5321. },
  5322. yearText() {
  5323. return t$3("uni-datetime-picker.year");
  5324. },
  5325. monthText() {
  5326. return t$3("uni-datetime-picker.month");
  5327. },
  5328. MONText() {
  5329. return t$3("uni-calender.MON");
  5330. },
  5331. TUEText() {
  5332. return t$3("uni-calender.TUE");
  5333. },
  5334. WEDText() {
  5335. return t$3("uni-calender.WED");
  5336. },
  5337. THUText() {
  5338. return t$3("uni-calender.THU");
  5339. },
  5340. FRIText() {
  5341. return t$3("uni-calender.FRI");
  5342. },
  5343. SATText() {
  5344. return t$3("uni-calender.SAT");
  5345. },
  5346. SUNText() {
  5347. return t$3("uni-calender.SUN");
  5348. },
  5349. confirmText() {
  5350. return t$3("uni-calender.confirm");
  5351. }
  5352. },
  5353. created() {
  5354. this.cale = new Calendar$1({
  5355. selected: this.selected,
  5356. startDate: this.startDate,
  5357. endDate: this.endDate,
  5358. range: this.range
  5359. });
  5360. this.init(this.date);
  5361. },
  5362. methods: {
  5363. leaveCale() {
  5364. this.firstEnter = true;
  5365. },
  5366. handleMouse(weeks) {
  5367. if (weeks.disable)
  5368. return;
  5369. if (this.cale.lastHover)
  5370. return;
  5371. let {
  5372. before,
  5373. after
  5374. } = this.cale.multipleStatus;
  5375. if (!before)
  5376. return;
  5377. this.calendar = weeks;
  5378. this.cale.setHoverMultiple(this.calendar.fullDate);
  5379. this.weeks = this.cale.weeks;
  5380. if (this.firstEnter) {
  5381. this.$emit("firstEnterCale", this.cale.multipleStatus);
  5382. this.firstEnter = false;
  5383. }
  5384. },
  5385. rangeWithinMonth(A2, B2) {
  5386. const [yearA, monthA] = A2.split("-");
  5387. const [yearB, monthB] = B2.split("-");
  5388. return yearA === yearB && monthA === monthB;
  5389. },
  5390. // 蒙版点击事件
  5391. maskClick() {
  5392. this.close();
  5393. this.$emit("maskClose");
  5394. },
  5395. clearCalender() {
  5396. if (this.range) {
  5397. this.timeRange.startTime = "";
  5398. this.timeRange.endTime = "";
  5399. this.tempRange.before = "";
  5400. this.tempRange.after = "";
  5401. this.cale.multipleStatus.before = "";
  5402. this.cale.multipleStatus.after = "";
  5403. this.cale.multipleStatus.data = [];
  5404. this.cale.lastHover = false;
  5405. } else {
  5406. this.time = "";
  5407. this.tempSingleDate = "";
  5408. }
  5409. this.calendar.fullDate = "";
  5410. this.setDate(/* @__PURE__ */ new Date());
  5411. },
  5412. bindDateChange(e2) {
  5413. const value = e2.detail.value + "-1";
  5414. this.setDate(value);
  5415. },
  5416. /**
  5417. * 初始化日期显示
  5418. * @param {Object} date
  5419. */
  5420. init(date) {
  5421. if (!this.cale) {
  5422. return;
  5423. }
  5424. this.cale.setDate(date || /* @__PURE__ */ new Date());
  5425. this.weeks = this.cale.weeks;
  5426. this.nowDate = this.cale.getInfo(date);
  5427. this.calendar = { ...this.nowDate };
  5428. if (!date) {
  5429. this.calendar.fullDate = "";
  5430. if (this.defaultValue && !this.range) {
  5431. const defaultDate = new Date(this.defaultValue);
  5432. const fullDate = getDate(defaultDate);
  5433. const year = defaultDate.getFullYear();
  5434. const month = defaultDate.getMonth() + 1;
  5435. const date2 = defaultDate.getDate();
  5436. const day = defaultDate.getDay();
  5437. this.calendar = {
  5438. fullDate,
  5439. year,
  5440. month,
  5441. date: date2,
  5442. day
  5443. }, this.tempSingleDate = fullDate;
  5444. this.time = getTime(defaultDate, this.hideSecond);
  5445. }
  5446. }
  5447. },
  5448. /**
  5449. * 打开日历弹窗
  5450. */
  5451. open() {
  5452. if (this.clearDate && !this.insert) {
  5453. this.cale.cleanMultipleStatus();
  5454. this.init(this.date);
  5455. }
  5456. this.show = true;
  5457. this.$nextTick(() => {
  5458. setTimeout(() => {
  5459. this.aniMaskShow = true;
  5460. }, 50);
  5461. });
  5462. },
  5463. /**
  5464. * 关闭日历弹窗
  5465. */
  5466. close() {
  5467. this.aniMaskShow = false;
  5468. this.$nextTick(() => {
  5469. setTimeout(() => {
  5470. this.show = false;
  5471. this.$emit("close");
  5472. }, 300);
  5473. });
  5474. },
  5475. /**
  5476. * 确认按钮
  5477. */
  5478. confirm() {
  5479. this.setEmit("confirm");
  5480. this.close();
  5481. },
  5482. /**
  5483. * 变化触发
  5484. */
  5485. change() {
  5486. if (!this.insert)
  5487. return;
  5488. this.setEmit("change");
  5489. },
  5490. /**
  5491. * 选择月份触发
  5492. */
  5493. monthSwitch() {
  5494. let {
  5495. year,
  5496. month
  5497. } = this.nowDate;
  5498. this.$emit("monthSwitch", {
  5499. year,
  5500. month: Number(month)
  5501. });
  5502. },
  5503. /**
  5504. * 派发事件
  5505. * @param {Object} name
  5506. */
  5507. setEmit(name) {
  5508. if (!this.range) {
  5509. if (!this.calendar.fullDate) {
  5510. this.calendar = this.cale.getInfo(/* @__PURE__ */ new Date());
  5511. this.tempSingleDate = this.calendar.fullDate;
  5512. }
  5513. if (this.hasTime && !this.time) {
  5514. this.time = getTime(/* @__PURE__ */ new Date(), this.hideSecond);
  5515. }
  5516. }
  5517. let {
  5518. year,
  5519. month,
  5520. date,
  5521. fullDate,
  5522. extraInfo
  5523. } = this.calendar;
  5524. this.$emit(name, {
  5525. range: this.cale.multipleStatus,
  5526. year,
  5527. month,
  5528. date,
  5529. time: this.time,
  5530. timeRange: this.timeRange,
  5531. fulldate: fullDate,
  5532. extraInfo: extraInfo || {}
  5533. });
  5534. },
  5535. /**
  5536. * 选择天触发
  5537. * @param {Object} weeks
  5538. */
  5539. choiceDate(weeks) {
  5540. if (weeks.disable)
  5541. return;
  5542. this.calendar = weeks;
  5543. this.calendar.userChecked = true;
  5544. this.cale.setMultiple(this.calendar.fullDate, true);
  5545. this.weeks = this.cale.weeks;
  5546. this.tempSingleDate = this.calendar.fullDate;
  5547. const beforeDate = new Date(this.cale.multipleStatus.before).getTime();
  5548. const afterDate = new Date(this.cale.multipleStatus.after).getTime();
  5549. if (beforeDate > afterDate && afterDate) {
  5550. this.tempRange.before = this.cale.multipleStatus.after;
  5551. this.tempRange.after = this.cale.multipleStatus.before;
  5552. } else {
  5553. this.tempRange.before = this.cale.multipleStatus.before;
  5554. this.tempRange.after = this.cale.multipleStatus.after;
  5555. }
  5556. this.change();
  5557. },
  5558. changeMonth(type) {
  5559. let newDate;
  5560. if (type === "pre") {
  5561. newDate = this.cale.getPreMonthObj(this.nowDate.fullDate).fullDate;
  5562. } else if (type === "next") {
  5563. newDate = this.cale.getNextMonthObj(this.nowDate.fullDate).fullDate;
  5564. }
  5565. this.setDate(newDate);
  5566. this.monthSwitch();
  5567. },
  5568. /**
  5569. * 设置日期
  5570. * @param {Object} date
  5571. */
  5572. setDate(date) {
  5573. this.cale.setDate(date);
  5574. this.weeks = this.cale.weeks;
  5575. this.nowDate = this.cale.getInfo(date);
  5576. }
  5577. }
  5578. };
  5579. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  5580. const _component_calendar_item = vue.resolveComponent("calendar-item");
  5581. const _component_time_picker = vue.resolveComponent("time-picker");
  5582. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$3);
  5583. return vue.openBlock(), vue.createElementBlock(
  5584. "view",
  5585. {
  5586. class: "uni-calendar",
  5587. onMouseleave: _cache[9] || (_cache[9] = (...args) => $options.leaveCale && $options.leaveCale(...args))
  5588. },
  5589. [
  5590. !$props.insert && $data.show ? (vue.openBlock(), vue.createElementBlock(
  5591. "view",
  5592. {
  5593. key: 0,
  5594. class: vue.normalizeClass(["uni-calendar__mask", { "uni-calendar--mask-show": $data.aniMaskShow }]),
  5595. onClick: _cache[0] || (_cache[0] = (...args) => $options.maskClick && $options.maskClick(...args))
  5596. },
  5597. null,
  5598. 2
  5599. /* CLASS */
  5600. )) : vue.createCommentVNode("v-if", true),
  5601. $props.insert || $data.show ? (vue.openBlock(), vue.createElementBlock(
  5602. "view",
  5603. {
  5604. key: 1,
  5605. class: vue.normalizeClass(["uni-calendar__content", { "uni-calendar--fixed": !$props.insert, "uni-calendar--ani-show": $data.aniMaskShow, "uni-calendar__content-mobile": $data.aniMaskShow }])
  5606. },
  5607. [
  5608. vue.createElementVNode(
  5609. "view",
  5610. {
  5611. class: vue.normalizeClass(["uni-calendar__header", { "uni-calendar__header-mobile": !$props.insert }])
  5612. },
  5613. [
  5614. vue.createElementVNode("view", {
  5615. class: "uni-calendar__header-btn-box",
  5616. onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => $options.changeMonth("pre"), ["stop"]))
  5617. }, [
  5618. vue.createElementVNode("view", { class: "uni-calendar__header-btn uni-calendar--left" })
  5619. ]),
  5620. vue.createElementVNode("picker", {
  5621. mode: "date",
  5622. value: $props.date,
  5623. fields: "month",
  5624. onChange: _cache[2] || (_cache[2] = (...args) => $options.bindDateChange && $options.bindDateChange(...args))
  5625. }, [
  5626. vue.createElementVNode(
  5627. "text",
  5628. { class: "uni-calendar__header-text" },
  5629. vue.toDisplayString(($data.nowDate.year || "") + $options.yearText + ($data.nowDate.month || "") + $options.monthText),
  5630. 1
  5631. /* TEXT */
  5632. )
  5633. ], 40, ["value"]),
  5634. vue.createElementVNode("view", {
  5635. class: "uni-calendar__header-btn-box",
  5636. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => $options.changeMonth("next"), ["stop"]))
  5637. }, [
  5638. vue.createElementVNode("view", { class: "uni-calendar__header-btn uni-calendar--right" })
  5639. ]),
  5640. !$props.insert ? (vue.openBlock(), vue.createElementBlock("view", {
  5641. key: 0,
  5642. class: "dialog-close",
  5643. onClick: _cache[4] || (_cache[4] = (...args) => $options.close && $options.close(...args))
  5644. }, [
  5645. vue.createElementVNode("view", {
  5646. class: "dialog-close-plus",
  5647. "data-id": "close"
  5648. }),
  5649. vue.createElementVNode("view", {
  5650. class: "dialog-close-plus dialog-close-rotate",
  5651. "data-id": "close"
  5652. })
  5653. ])) : vue.createCommentVNode("v-if", true)
  5654. ],
  5655. 2
  5656. /* CLASS */
  5657. ),
  5658. vue.createElementVNode("view", { class: "uni-calendar__box" }, [
  5659. $props.showMonth ? (vue.openBlock(), vue.createElementBlock("view", {
  5660. key: 0,
  5661. class: "uni-calendar__box-bg"
  5662. }, [
  5663. vue.createElementVNode(
  5664. "text",
  5665. { class: "uni-calendar__box-bg-text" },
  5666. vue.toDisplayString($data.nowDate.month),
  5667. 1
  5668. /* TEXT */
  5669. )
  5670. ])) : vue.createCommentVNode("v-if", true),
  5671. vue.createElementVNode("view", {
  5672. class: "uni-calendar__weeks",
  5673. style: { "padding-bottom": "7px" }
  5674. }, [
  5675. vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
  5676. vue.createElementVNode(
  5677. "text",
  5678. { class: "uni-calendar__weeks-day-text" },
  5679. vue.toDisplayString($options.SUNText),
  5680. 1
  5681. /* TEXT */
  5682. )
  5683. ]),
  5684. vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
  5685. vue.createElementVNode(
  5686. "text",
  5687. { class: "uni-calendar__weeks-day-text" },
  5688. vue.toDisplayString($options.MONText),
  5689. 1
  5690. /* TEXT */
  5691. )
  5692. ]),
  5693. vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
  5694. vue.createElementVNode(
  5695. "text",
  5696. { class: "uni-calendar__weeks-day-text" },
  5697. vue.toDisplayString($options.TUEText),
  5698. 1
  5699. /* TEXT */
  5700. )
  5701. ]),
  5702. vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
  5703. vue.createElementVNode(
  5704. "text",
  5705. { class: "uni-calendar__weeks-day-text" },
  5706. vue.toDisplayString($options.WEDText),
  5707. 1
  5708. /* TEXT */
  5709. )
  5710. ]),
  5711. vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
  5712. vue.createElementVNode(
  5713. "text",
  5714. { class: "uni-calendar__weeks-day-text" },
  5715. vue.toDisplayString($options.THUText),
  5716. 1
  5717. /* TEXT */
  5718. )
  5719. ]),
  5720. vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
  5721. vue.createElementVNode(
  5722. "text",
  5723. { class: "uni-calendar__weeks-day-text" },
  5724. vue.toDisplayString($options.FRIText),
  5725. 1
  5726. /* TEXT */
  5727. )
  5728. ]),
  5729. vue.createElementVNode("view", { class: "uni-calendar__weeks-day" }, [
  5730. vue.createElementVNode(
  5731. "text",
  5732. { class: "uni-calendar__weeks-day-text" },
  5733. vue.toDisplayString($options.SATText),
  5734. 1
  5735. /* TEXT */
  5736. )
  5737. ])
  5738. ]),
  5739. (vue.openBlock(true), vue.createElementBlock(
  5740. vue.Fragment,
  5741. null,
  5742. vue.renderList($data.weeks, (item, weekIndex) => {
  5743. return vue.openBlock(), vue.createElementBlock("view", {
  5744. class: "uni-calendar__weeks",
  5745. key: weekIndex
  5746. }, [
  5747. (vue.openBlock(true), vue.createElementBlock(
  5748. vue.Fragment,
  5749. null,
  5750. vue.renderList(item, (weeks, weeksIndex) => {
  5751. return vue.openBlock(), vue.createElementBlock("view", {
  5752. class: "uni-calendar__weeks-item",
  5753. key: weeksIndex
  5754. }, [
  5755. vue.createVNode(_component_calendar_item, {
  5756. class: "uni-calendar-item--hook",
  5757. weeks,
  5758. calendar: $data.calendar,
  5759. selected: $props.selected,
  5760. checkHover: $props.range,
  5761. onChange: $options.choiceDate,
  5762. onHandleMouse: $options.handleMouse
  5763. }, null, 8, ["weeks", "calendar", "selected", "checkHover", "onChange", "onHandleMouse"])
  5764. ]);
  5765. }),
  5766. 128
  5767. /* KEYED_FRAGMENT */
  5768. ))
  5769. ]);
  5770. }),
  5771. 128
  5772. /* KEYED_FRAGMENT */
  5773. ))
  5774. ]),
  5775. !$props.insert && !$props.range && $props.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
  5776. key: 0,
  5777. class: "uni-date-changed uni-calendar--fixed-top",
  5778. style: { "padding": "0 80px" }
  5779. }, [
  5780. vue.createElementVNode(
  5781. "view",
  5782. { class: "uni-date-changed--time-date" },
  5783. vue.toDisplayString($data.tempSingleDate ? $data.tempSingleDate : $options.selectDateText),
  5784. 1
  5785. /* TEXT */
  5786. ),
  5787. vue.createVNode(_component_time_picker, {
  5788. type: "time",
  5789. start: $options.timepickerStartTime,
  5790. end: $options.timepickerEndTime,
  5791. modelValue: $data.time,
  5792. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.time = $event),
  5793. disabled: !$data.tempSingleDate,
  5794. border: false,
  5795. "hide-second": $props.hideSecond,
  5796. class: "time-picker-style"
  5797. }, null, 8, ["start", "end", "modelValue", "disabled", "hide-second"])
  5798. ])) : vue.createCommentVNode("v-if", true),
  5799. !$props.insert && $props.range && $props.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
  5800. key: 1,
  5801. class: "uni-date-changed uni-calendar--fixed-top"
  5802. }, [
  5803. vue.createElementVNode("view", { class: "uni-date-changed--time-start" }, [
  5804. vue.createElementVNode(
  5805. "view",
  5806. { class: "uni-date-changed--time-date" },
  5807. vue.toDisplayString($data.tempRange.before ? $data.tempRange.before : $options.startDateText),
  5808. 1
  5809. /* TEXT */
  5810. ),
  5811. vue.createVNode(_component_time_picker, {
  5812. type: "time",
  5813. start: $options.timepickerStartTime,
  5814. modelValue: $data.timeRange.startTime,
  5815. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.timeRange.startTime = $event),
  5816. border: false,
  5817. "hide-second": $props.hideSecond,
  5818. disabled: !$data.tempRange.before,
  5819. class: "time-picker-style"
  5820. }, null, 8, ["start", "modelValue", "hide-second", "disabled"])
  5821. ]),
  5822. vue.createElementVNode("view", { style: { "line-height": "50px" } }, [
  5823. vue.createVNode(_component_uni_icons, {
  5824. type: "arrowthinright",
  5825. color: "#999"
  5826. })
  5827. ]),
  5828. vue.createElementVNode("view", { class: "uni-date-changed--time-end" }, [
  5829. vue.createElementVNode(
  5830. "view",
  5831. { class: "uni-date-changed--time-date" },
  5832. vue.toDisplayString($data.tempRange.after ? $data.tempRange.after : $options.endDateText),
  5833. 1
  5834. /* TEXT */
  5835. ),
  5836. vue.createVNode(_component_time_picker, {
  5837. type: "time",
  5838. end: $options.timepickerEndTime,
  5839. modelValue: $data.timeRange.endTime,
  5840. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.timeRange.endTime = $event),
  5841. border: false,
  5842. "hide-second": $props.hideSecond,
  5843. disabled: !$data.tempRange.after,
  5844. class: "time-picker-style"
  5845. }, null, 8, ["end", "modelValue", "hide-second", "disabled"])
  5846. ])
  5847. ])) : vue.createCommentVNode("v-if", true),
  5848. !$props.insert ? (vue.openBlock(), vue.createElementBlock("view", {
  5849. key: 2,
  5850. class: "uni-date-changed uni-date-btn--ok"
  5851. }, [
  5852. vue.createElementVNode(
  5853. "view",
  5854. {
  5855. class: "uni-datetime-picker--btn",
  5856. onClick: _cache[8] || (_cache[8] = (...args) => $options.confirm && $options.confirm(...args))
  5857. },
  5858. vue.toDisplayString($options.confirmText),
  5859. 1
  5860. /* TEXT */
  5861. )
  5862. ])) : vue.createCommentVNode("v-if", true)
  5863. ],
  5864. 2
  5865. /* CLASS */
  5866. )) : vue.createCommentVNode("v-if", true)
  5867. ],
  5868. 32
  5869. /* HYDRATE_EVENTS */
  5870. );
  5871. }
  5872. const Calendar = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$a], ["__scopeId", "data-v-1d379219"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue"]]);
  5873. const _sfc_main$h = {
  5874. name: "UniDatetimePicker",
  5875. options: {
  5876. virtualHost: true
  5877. },
  5878. components: {
  5879. Calendar,
  5880. TimePicker
  5881. },
  5882. data() {
  5883. return {
  5884. isRange: false,
  5885. hasTime: false,
  5886. displayValue: "",
  5887. inputDate: "",
  5888. calendarDate: "",
  5889. pickerTime: "",
  5890. calendarRange: {
  5891. startDate: "",
  5892. startTime: "",
  5893. endDate: "",
  5894. endTime: ""
  5895. },
  5896. displayRangeValue: {
  5897. startDate: "",
  5898. endDate: ""
  5899. },
  5900. tempRange: {
  5901. startDate: "",
  5902. startTime: "",
  5903. endDate: "",
  5904. endTime: ""
  5905. },
  5906. // 左右日历同步数据
  5907. startMultipleStatus: {
  5908. before: "",
  5909. after: "",
  5910. data: [],
  5911. fulldate: ""
  5912. },
  5913. endMultipleStatus: {
  5914. before: "",
  5915. after: "",
  5916. data: [],
  5917. fulldate: ""
  5918. },
  5919. pickerVisible: false,
  5920. pickerPositionStyle: null,
  5921. isEmitValue: false,
  5922. isPhone: false,
  5923. isFirstShow: true,
  5924. i18nT: () => {
  5925. }
  5926. };
  5927. },
  5928. props: {
  5929. type: {
  5930. type: String,
  5931. default: "datetime"
  5932. },
  5933. value: {
  5934. type: [String, Number, Array, Date],
  5935. default: ""
  5936. },
  5937. modelValue: {
  5938. type: [String, Number, Array, Date],
  5939. default: ""
  5940. },
  5941. start: {
  5942. type: [Number, String],
  5943. default: ""
  5944. },
  5945. end: {
  5946. type: [Number, String],
  5947. default: ""
  5948. },
  5949. returnType: {
  5950. type: String,
  5951. default: "string"
  5952. },
  5953. placeholder: {
  5954. type: String,
  5955. default: ""
  5956. },
  5957. startPlaceholder: {
  5958. type: String,
  5959. default: ""
  5960. },
  5961. endPlaceholder: {
  5962. type: String,
  5963. default: ""
  5964. },
  5965. rangeSeparator: {
  5966. type: String,
  5967. default: "-"
  5968. },
  5969. border: {
  5970. type: [Boolean],
  5971. default: true
  5972. },
  5973. disabled: {
  5974. type: [Boolean],
  5975. default: false
  5976. },
  5977. clearIcon: {
  5978. type: [Boolean],
  5979. default: true
  5980. },
  5981. hideSecond: {
  5982. type: [Boolean],
  5983. default: false
  5984. },
  5985. defaultValue: {
  5986. type: [String, Object, Array],
  5987. default: ""
  5988. }
  5989. },
  5990. watch: {
  5991. type: {
  5992. immediate: true,
  5993. handler(newVal) {
  5994. this.hasTime = newVal.indexOf("time") !== -1;
  5995. this.isRange = newVal.indexOf("range") !== -1;
  5996. }
  5997. },
  5998. modelValue: {
  5999. immediate: true,
  6000. handler(newVal) {
  6001. if (this.isEmitValue) {
  6002. this.isEmitValue = false;
  6003. return;
  6004. }
  6005. this.initPicker(newVal);
  6006. }
  6007. },
  6008. start: {
  6009. immediate: true,
  6010. handler(newVal) {
  6011. if (!newVal)
  6012. return;
  6013. this.calendarRange.startDate = getDate(newVal);
  6014. if (this.hasTime) {
  6015. this.calendarRange.startTime = getTime(newVal);
  6016. }
  6017. }
  6018. },
  6019. end: {
  6020. immediate: true,
  6021. handler(newVal) {
  6022. if (!newVal)
  6023. return;
  6024. this.calendarRange.endDate = getDate(newVal);
  6025. if (this.hasTime) {
  6026. this.calendarRange.endTime = getTime(newVal, this.hideSecond);
  6027. }
  6028. }
  6029. }
  6030. },
  6031. computed: {
  6032. timepickerStartTime() {
  6033. const activeDate = this.isRange ? this.tempRange.startDate : this.inputDate;
  6034. return activeDate === this.calendarRange.startDate ? this.calendarRange.startTime : "";
  6035. },
  6036. timepickerEndTime() {
  6037. const activeDate = this.isRange ? this.tempRange.endDate : this.inputDate;
  6038. return activeDate === this.calendarRange.endDate ? this.calendarRange.endTime : "";
  6039. },
  6040. mobileCalendarTime() {
  6041. const timeRange = {
  6042. start: this.tempRange.startTime,
  6043. end: this.tempRange.endTime
  6044. };
  6045. return this.isRange ? timeRange : this.pickerTime;
  6046. },
  6047. mobSelectableTime() {
  6048. return {
  6049. start: this.calendarRange.startTime,
  6050. end: this.calendarRange.endTime
  6051. };
  6052. },
  6053. datePopupWidth() {
  6054. return this.isRange ? 653 : 301;
  6055. },
  6056. /**
  6057. * for i18n
  6058. */
  6059. singlePlaceholderText() {
  6060. return this.placeholder || (this.type === "date" ? this.selectDateText : this.selectDateTimeText);
  6061. },
  6062. startPlaceholderText() {
  6063. return this.startPlaceholder || this.startDateText;
  6064. },
  6065. endPlaceholderText() {
  6066. return this.endPlaceholder || this.endDateText;
  6067. },
  6068. selectDateText() {
  6069. return this.i18nT("uni-datetime-picker.selectDate");
  6070. },
  6071. selectDateTimeText() {
  6072. return this.i18nT("uni-datetime-picker.selectDateTime");
  6073. },
  6074. selectTimeText() {
  6075. return this.i18nT("uni-datetime-picker.selectTime");
  6076. },
  6077. startDateText() {
  6078. return this.startPlaceholder || this.i18nT("uni-datetime-picker.startDate");
  6079. },
  6080. startTimeText() {
  6081. return this.i18nT("uni-datetime-picker.startTime");
  6082. },
  6083. endDateText() {
  6084. return this.endPlaceholder || this.i18nT("uni-datetime-picker.endDate");
  6085. },
  6086. endTimeText() {
  6087. return this.i18nT("uni-datetime-picker.endTime");
  6088. },
  6089. okText() {
  6090. return this.i18nT("uni-datetime-picker.ok");
  6091. },
  6092. clearText() {
  6093. return this.i18nT("uni-datetime-picker.clear");
  6094. },
  6095. showClearIcon() {
  6096. return this.clearIcon && !this.disabled && (this.displayValue || this.displayRangeValue.startDate && this.displayRangeValue.endDate);
  6097. }
  6098. },
  6099. created() {
  6100. this.initI18nT();
  6101. this.platform();
  6102. },
  6103. methods: {
  6104. initI18nT() {
  6105. const vueI18n = initVueI18n(i18nMessages);
  6106. this.i18nT = vueI18n.t;
  6107. },
  6108. initPicker(newVal) {
  6109. if (!newVal && !this.defaultValue || Array.isArray(newVal) && !newVal.length) {
  6110. this.$nextTick(() => {
  6111. this.clear(false);
  6112. });
  6113. return;
  6114. }
  6115. if (!Array.isArray(newVal) && !this.isRange) {
  6116. if (newVal) {
  6117. this.displayValue = this.inputDate = this.calendarDate = getDate(newVal);
  6118. if (this.hasTime) {
  6119. this.pickerTime = getTime(newVal, this.hideSecond);
  6120. this.displayValue = `${this.displayValue} ${this.pickerTime}`;
  6121. }
  6122. } else if (this.defaultValue) {
  6123. this.inputDate = this.calendarDate = getDate(this.defaultValue);
  6124. if (this.hasTime) {
  6125. this.pickerTime = getTime(this.defaultValue, this.hideSecond);
  6126. }
  6127. }
  6128. } else {
  6129. const [before, after] = newVal;
  6130. if (!before && !after)
  6131. return;
  6132. const beforeDate = getDate(before);
  6133. const beforeTime = getTime(before, this.hideSecond);
  6134. const afterDate = getDate(after);
  6135. const afterTime = getTime(after, this.hideSecond);
  6136. const startDate = beforeDate;
  6137. const endDate = afterDate;
  6138. this.displayRangeValue.startDate = this.tempRange.startDate = startDate;
  6139. this.displayRangeValue.endDate = this.tempRange.endDate = endDate;
  6140. if (this.hasTime) {
  6141. this.displayRangeValue.startDate = `${beforeDate} ${beforeTime}`;
  6142. this.displayRangeValue.endDate = `${afterDate} ${afterTime}`;
  6143. this.tempRange.startTime = beforeTime;
  6144. this.tempRange.endTime = afterTime;
  6145. }
  6146. const defaultRange = {
  6147. before: beforeDate,
  6148. after: afterDate
  6149. };
  6150. this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, defaultRange, {
  6151. which: "right"
  6152. });
  6153. this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, defaultRange, {
  6154. which: "left"
  6155. });
  6156. }
  6157. },
  6158. updateLeftCale(e2) {
  6159. const left = this.$refs.left;
  6160. left.cale.setHoverMultiple(e2.after);
  6161. left.setDate(this.$refs.left.nowDate.fullDate);
  6162. },
  6163. updateRightCale(e2) {
  6164. const right = this.$refs.right;
  6165. right.cale.setHoverMultiple(e2.after);
  6166. right.setDate(this.$refs.right.nowDate.fullDate);
  6167. },
  6168. platform() {
  6169. if (typeof navigator !== "undefined") {
  6170. this.isPhone = navigator.userAgent.toLowerCase().indexOf("mobile") !== -1;
  6171. return;
  6172. }
  6173. const { windowWidth } = uni.getSystemInfoSync();
  6174. this.isPhone = windowWidth <= 500;
  6175. this.windowWidth = windowWidth;
  6176. },
  6177. show() {
  6178. if (this.disabled) {
  6179. return;
  6180. }
  6181. this.platform();
  6182. if (this.isPhone) {
  6183. setTimeout(() => {
  6184. this.$refs.mobile.open();
  6185. }, 0);
  6186. return;
  6187. }
  6188. this.pickerPositionStyle = {
  6189. top: "10px"
  6190. };
  6191. const dateEditor = uni.createSelectorQuery().in(this).select(".uni-date-editor");
  6192. dateEditor.boundingClientRect((rect) => {
  6193. if (this.windowWidth - rect.left < this.datePopupWidth) {
  6194. this.pickerPositionStyle.right = 0;
  6195. }
  6196. }).exec();
  6197. setTimeout(() => {
  6198. this.pickerVisible = !this.pickerVisible;
  6199. if (!this.isPhone && this.isRange && this.isFirstShow) {
  6200. this.isFirstShow = false;
  6201. const {
  6202. startDate,
  6203. endDate
  6204. } = this.calendarRange;
  6205. if (startDate && endDate) {
  6206. if (this.diffDate(startDate, endDate) < 30) {
  6207. this.$refs.right.changeMonth("pre");
  6208. }
  6209. } else {
  6210. this.$refs.right.changeMonth("next");
  6211. this.$refs.right.cale.lastHover = false;
  6212. }
  6213. }
  6214. }, 50);
  6215. },
  6216. close() {
  6217. setTimeout(() => {
  6218. this.pickerVisible = false;
  6219. this.$emit("maskClick", this.value);
  6220. this.$refs.mobile && this.$refs.mobile.close();
  6221. }, 20);
  6222. },
  6223. setEmit(value) {
  6224. if (this.returnType === "timestamp" || this.returnType === "date") {
  6225. if (!Array.isArray(value)) {
  6226. if (!this.hasTime) {
  6227. value = value + " 00:00:00";
  6228. }
  6229. value = this.createTimestamp(value);
  6230. if (this.returnType === "date") {
  6231. value = new Date(value);
  6232. }
  6233. } else {
  6234. if (!this.hasTime) {
  6235. value[0] = value[0] + " 00:00:00";
  6236. value[1] = value[1] + " 00:00:00";
  6237. }
  6238. value[0] = this.createTimestamp(value[0]);
  6239. value[1] = this.createTimestamp(value[1]);
  6240. if (this.returnType === "date") {
  6241. value[0] = new Date(value[0]);
  6242. value[1] = new Date(value[1]);
  6243. }
  6244. }
  6245. }
  6246. this.$emit("update:modelValue", value);
  6247. this.$emit("input", value);
  6248. this.$emit("change", value);
  6249. this.isEmitValue = true;
  6250. },
  6251. createTimestamp(date) {
  6252. date = fixIosDateFormat(date);
  6253. return Date.parse(new Date(date));
  6254. },
  6255. singleChange(e2) {
  6256. this.calendarDate = this.inputDate = e2.fulldate;
  6257. if (this.hasTime)
  6258. return;
  6259. this.confirmSingleChange();
  6260. },
  6261. confirmSingleChange() {
  6262. if (!checkDate(this.inputDate)) {
  6263. const now = /* @__PURE__ */ new Date();
  6264. this.calendarDate = this.inputDate = getDate(now);
  6265. this.pickerTime = getTime(now, this.hideSecond);
  6266. }
  6267. let startLaterInputDate = false;
  6268. let startDate, startTime;
  6269. if (this.start) {
  6270. let startString = this.start;
  6271. if (typeof this.start === "number") {
  6272. startString = getDateTime(this.start, this.hideSecond);
  6273. }
  6274. [startDate, startTime] = startString.split(" ");
  6275. if (this.start && !dateCompare(startDate, this.inputDate)) {
  6276. startLaterInputDate = true;
  6277. this.inputDate = startDate;
  6278. }
  6279. }
  6280. let endEarlierInputDate = false;
  6281. let endDate, endTime;
  6282. if (this.end) {
  6283. let endString = this.end;
  6284. if (typeof this.end === "number") {
  6285. endString = getDateTime(this.end, this.hideSecond);
  6286. }
  6287. [endDate, endTime] = endString.split(" ");
  6288. if (this.end && !dateCompare(this.inputDate, endDate)) {
  6289. endEarlierInputDate = true;
  6290. this.inputDate = endDate;
  6291. }
  6292. }
  6293. if (this.hasTime) {
  6294. if (startLaterInputDate) {
  6295. this.pickerTime = startTime || getDefaultSecond(this.hideSecond);
  6296. }
  6297. if (endEarlierInputDate) {
  6298. this.pickerTime = endTime || getDefaultSecond(this.hideSecond);
  6299. }
  6300. if (!this.pickerTime) {
  6301. this.pickerTime = getTime(Date.now(), this.hideSecond);
  6302. }
  6303. this.displayValue = `${this.inputDate} ${this.pickerTime}`;
  6304. } else {
  6305. this.displayValue = this.inputDate;
  6306. }
  6307. this.setEmit(this.displayValue);
  6308. this.pickerVisible = false;
  6309. },
  6310. leftChange(e2) {
  6311. const {
  6312. before,
  6313. after
  6314. } = e2.range;
  6315. this.rangeChange(before, after);
  6316. const obj = {
  6317. before: e2.range.before,
  6318. after: e2.range.after,
  6319. data: e2.range.data,
  6320. fulldate: e2.fulldate
  6321. };
  6322. this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, obj);
  6323. },
  6324. rightChange(e2) {
  6325. const {
  6326. before,
  6327. after
  6328. } = e2.range;
  6329. this.rangeChange(before, after);
  6330. const obj = {
  6331. before: e2.range.before,
  6332. after: e2.range.after,
  6333. data: e2.range.data,
  6334. fulldate: e2.fulldate
  6335. };
  6336. this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, obj);
  6337. },
  6338. mobileChange(e2) {
  6339. if (this.isRange) {
  6340. const { before, after } = e2.range;
  6341. if (!before || !after) {
  6342. return;
  6343. }
  6344. this.handleStartAndEnd(before, after, true);
  6345. if (this.hasTime) {
  6346. const {
  6347. startTime,
  6348. endTime
  6349. } = e2.timeRange;
  6350. this.tempRange.startTime = startTime;
  6351. this.tempRange.endTime = endTime;
  6352. }
  6353. this.confirmRangeChange();
  6354. } else {
  6355. if (this.hasTime) {
  6356. this.displayValue = e2.fulldate + " " + e2.time;
  6357. } else {
  6358. this.displayValue = e2.fulldate;
  6359. }
  6360. this.setEmit(this.displayValue);
  6361. }
  6362. this.$refs.mobile.close();
  6363. },
  6364. rangeChange(before, after) {
  6365. if (!(before && after))
  6366. return;
  6367. this.handleStartAndEnd(before, after, true);
  6368. if (this.hasTime)
  6369. return;
  6370. this.confirmRangeChange();
  6371. },
  6372. confirmRangeChange() {
  6373. if (!this.tempRange.startDate || !this.tempRange.endDate) {
  6374. this.pickerVisible = false;
  6375. return;
  6376. }
  6377. if (!checkDate(this.tempRange.startDate)) {
  6378. this.tempRange.startDate = getDate(Date.now());
  6379. }
  6380. if (!checkDate(this.tempRange.endDate)) {
  6381. this.tempRange.endDate = getDate(Date.now());
  6382. }
  6383. let start, end;
  6384. let startDateLaterRangeStartDate = false;
  6385. let startDateLaterRangeEndDate = false;
  6386. let startDate, startTime;
  6387. if (this.start) {
  6388. let startString = this.start;
  6389. if (typeof this.start === "number") {
  6390. startString = getDateTime(this.start, this.hideSecond);
  6391. }
  6392. [startDate, startTime] = startString.split(" ");
  6393. if (this.start && !dateCompare(this.start, this.tempRange.startDate)) {
  6394. startDateLaterRangeStartDate = true;
  6395. this.tempRange.startDate = startDate;
  6396. }
  6397. if (this.start && !dateCompare(this.start, this.tempRange.endDate)) {
  6398. startDateLaterRangeEndDate = true;
  6399. this.tempRange.endDate = startDate;
  6400. }
  6401. }
  6402. let endDateEarlierRangeStartDate = false;
  6403. let endDateEarlierRangeEndDate = false;
  6404. let endDate, endTime;
  6405. if (this.end) {
  6406. let endString = this.end;
  6407. if (typeof this.end === "number") {
  6408. endString = getDateTime(this.end, this.hideSecond);
  6409. }
  6410. [endDate, endTime] = endString.split(" ");
  6411. if (this.end && !dateCompare(this.tempRange.startDate, this.end)) {
  6412. endDateEarlierRangeStartDate = true;
  6413. this.tempRange.startDate = endDate;
  6414. }
  6415. if (this.end && !dateCompare(this.tempRange.endDate, this.end)) {
  6416. endDateEarlierRangeEndDate = true;
  6417. this.tempRange.endDate = endDate;
  6418. }
  6419. }
  6420. if (!this.hasTime) {
  6421. start = this.displayRangeValue.startDate = this.tempRange.startDate;
  6422. end = this.displayRangeValue.endDate = this.tempRange.endDate;
  6423. } else {
  6424. if (startDateLaterRangeStartDate) {
  6425. this.tempRange.startTime = startTime || getDefaultSecond(this.hideSecond);
  6426. } else if (endDateEarlierRangeStartDate) {
  6427. this.tempRange.startTime = endTime || getDefaultSecond(this.hideSecond);
  6428. }
  6429. if (!this.tempRange.startTime) {
  6430. this.tempRange.startTime = getTime(Date.now(), this.hideSecond);
  6431. }
  6432. if (startDateLaterRangeEndDate) {
  6433. this.tempRange.endTime = startTime || getDefaultSecond(this.hideSecond);
  6434. } else if (endDateEarlierRangeEndDate) {
  6435. this.tempRange.endTime = endTime || getDefaultSecond(this.hideSecond);
  6436. }
  6437. if (!this.tempRange.endTime) {
  6438. this.tempRange.endTime = getTime(Date.now(), this.hideSecond);
  6439. }
  6440. start = this.displayRangeValue.startDate = `${this.tempRange.startDate} ${this.tempRange.startTime}`;
  6441. end = this.displayRangeValue.endDate = `${this.tempRange.endDate} ${this.tempRange.endTime}`;
  6442. }
  6443. if (!dateCompare(start, end)) {
  6444. [start, end] = [end, start];
  6445. }
  6446. this.displayRangeValue.startDate = start;
  6447. this.displayRangeValue.endDate = end;
  6448. const displayRange = [start, end];
  6449. this.setEmit(displayRange);
  6450. this.pickerVisible = false;
  6451. },
  6452. handleStartAndEnd(before, after, temp = false) {
  6453. if (!(before && after))
  6454. return;
  6455. const type = temp ? "tempRange" : "range";
  6456. const isStartEarlierEnd = dateCompare(before, after);
  6457. this[type].startDate = isStartEarlierEnd ? before : after;
  6458. this[type].endDate = isStartEarlierEnd ? after : before;
  6459. },
  6460. /**
  6461. * 比较时间大小
  6462. */
  6463. dateCompare(startDate, endDate) {
  6464. startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
  6465. endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
  6466. return startDate <= endDate;
  6467. },
  6468. /**
  6469. * 比较时间差
  6470. */
  6471. diffDate(startDate, endDate) {
  6472. startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
  6473. endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
  6474. const diff = (endDate - startDate) / (24 * 60 * 60 * 1e3);
  6475. return Math.abs(diff);
  6476. },
  6477. clear(needEmit = true) {
  6478. if (!this.isRange) {
  6479. this.displayValue = "";
  6480. this.inputDate = "";
  6481. this.pickerTime = "";
  6482. if (this.isPhone) {
  6483. this.$refs.mobile && this.$refs.mobile.clearCalender();
  6484. } else {
  6485. this.$refs.pcSingle && this.$refs.pcSingle.clearCalender();
  6486. }
  6487. if (needEmit) {
  6488. this.$emit("change", "");
  6489. this.$emit("input", "");
  6490. this.$emit("update:modelValue", "");
  6491. }
  6492. } else {
  6493. this.displayRangeValue.startDate = "";
  6494. this.displayRangeValue.endDate = "";
  6495. this.tempRange.startDate = "";
  6496. this.tempRange.startTime = "";
  6497. this.tempRange.endDate = "";
  6498. this.tempRange.endTime = "";
  6499. if (this.isPhone) {
  6500. this.$refs.mobile && this.$refs.mobile.clearCalender();
  6501. } else {
  6502. this.$refs.left && this.$refs.left.clearCalender();
  6503. this.$refs.right && this.$refs.right.clearCalender();
  6504. this.$refs.right && this.$refs.right.changeMonth("next");
  6505. }
  6506. if (needEmit) {
  6507. this.$emit("change", []);
  6508. this.$emit("input", []);
  6509. this.$emit("update:modelValue", []);
  6510. }
  6511. }
  6512. }
  6513. }
  6514. };
  6515. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  6516. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$3);
  6517. const _component_time_picker = vue.resolveComponent("time-picker");
  6518. const _component_Calendar = vue.resolveComponent("Calendar");
  6519. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-date" }, [
  6520. vue.createElementVNode("view", {
  6521. class: "uni-date-editor",
  6522. onClick: _cache[1] || (_cache[1] = (...args) => $options.show && $options.show(...args))
  6523. }, [
  6524. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  6525. vue.createElementVNode(
  6526. "view",
  6527. {
  6528. class: vue.normalizeClass(["uni-date-editor--x", { "uni-date-editor--x__disabled": $props.disabled, "uni-date-x--border": $props.border }])
  6529. },
  6530. [
  6531. !$data.isRange ? (vue.openBlock(), vue.createElementBlock("view", {
  6532. key: 0,
  6533. class: "uni-date-x uni-date-single"
  6534. }, [
  6535. vue.createVNode(_component_uni_icons, {
  6536. class: "icon-calendar",
  6537. type: "calendar",
  6538. color: "#c0c4cc",
  6539. size: "22"
  6540. }),
  6541. vue.createElementVNode(
  6542. "view",
  6543. { class: "uni-date__x-input" },
  6544. vue.toDisplayString($data.displayValue || $options.singlePlaceholderText),
  6545. 1
  6546. /* TEXT */
  6547. )
  6548. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  6549. key: 1,
  6550. class: "uni-date-x uni-date-range"
  6551. }, [
  6552. vue.createVNode(_component_uni_icons, {
  6553. class: "icon-calendar",
  6554. type: "calendar",
  6555. color: "#c0c4cc",
  6556. size: "22"
  6557. }),
  6558. vue.createElementVNode(
  6559. "view",
  6560. { class: "uni-date__x-input text-center" },
  6561. vue.toDisplayString($data.displayRangeValue.startDate || $options.startPlaceholderText),
  6562. 1
  6563. /* TEXT */
  6564. ),
  6565. vue.createElementVNode(
  6566. "view",
  6567. { class: "range-separator" },
  6568. vue.toDisplayString($props.rangeSeparator),
  6569. 1
  6570. /* TEXT */
  6571. ),
  6572. vue.createElementVNode(
  6573. "view",
  6574. { class: "uni-date__x-input text-center" },
  6575. vue.toDisplayString($data.displayRangeValue.endDate || $options.endPlaceholderText),
  6576. 1
  6577. /* TEXT */
  6578. )
  6579. ])),
  6580. $options.showClearIcon ? (vue.openBlock(), vue.createElementBlock("view", {
  6581. key: 2,
  6582. class: "uni-date__icon-clear",
  6583. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop"]))
  6584. }, [
  6585. vue.createVNode(_component_uni_icons, {
  6586. type: "clear",
  6587. color: "#c0c4cc",
  6588. size: "22"
  6589. })
  6590. ])) : vue.createCommentVNode("v-if", true)
  6591. ],
  6592. 2
  6593. /* CLASS */
  6594. )
  6595. ], true)
  6596. ]),
  6597. vue.withDirectives(vue.createElementVNode(
  6598. "view",
  6599. {
  6600. class: "uni-date-mask--pc",
  6601. onClick: _cache[2] || (_cache[2] = (...args) => $options.close && $options.close(...args))
  6602. },
  6603. null,
  6604. 512
  6605. /* NEED_PATCH */
  6606. ), [
  6607. [vue.vShow, $data.pickerVisible]
  6608. ]),
  6609. !$data.isPhone ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
  6610. "view",
  6611. {
  6612. key: 0,
  6613. ref: "datePicker",
  6614. class: "uni-date-picker__container"
  6615. },
  6616. [
  6617. !$data.isRange ? (vue.openBlock(), vue.createElementBlock(
  6618. "view",
  6619. {
  6620. key: 0,
  6621. class: "uni-date-single--x",
  6622. style: vue.normalizeStyle($data.pickerPositionStyle)
  6623. },
  6624. [
  6625. vue.createElementVNode("view", { class: "uni-popper__arrow" }),
  6626. $data.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
  6627. key: 0,
  6628. class: "uni-date-changed popup-x-header"
  6629. }, [
  6630. vue.withDirectives(vue.createElementVNode("input", {
  6631. class: "uni-date__input text-center",
  6632. type: "text",
  6633. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.inputDate = $event),
  6634. placeholder: $options.selectDateText
  6635. }, null, 8, ["placeholder"]), [
  6636. [vue.vModelText, $data.inputDate]
  6637. ]),
  6638. vue.createVNode(_component_time_picker, {
  6639. type: "time",
  6640. modelValue: $data.pickerTime,
  6641. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.pickerTime = $event),
  6642. border: false,
  6643. disabled: !$data.inputDate,
  6644. start: $options.timepickerStartTime,
  6645. end: $options.timepickerEndTime,
  6646. hideSecond: $props.hideSecond,
  6647. style: { "width": "100%" }
  6648. }, {
  6649. default: vue.withCtx(() => [
  6650. vue.withDirectives(vue.createElementVNode("input", {
  6651. class: "uni-date__input text-center",
  6652. type: "text",
  6653. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.pickerTime = $event),
  6654. placeholder: $options.selectTimeText,
  6655. disabled: !$data.inputDate
  6656. }, null, 8, ["placeholder", "disabled"]), [
  6657. [vue.vModelText, $data.pickerTime]
  6658. ])
  6659. ]),
  6660. _: 1
  6661. /* STABLE */
  6662. }, 8, ["modelValue", "disabled", "start", "end", "hideSecond"])
  6663. ])) : vue.createCommentVNode("v-if", true),
  6664. vue.createVNode(_component_Calendar, {
  6665. ref: "pcSingle",
  6666. showMonth: false,
  6667. "start-date": $data.calendarRange.startDate,
  6668. "end-date": $data.calendarRange.endDate,
  6669. date: $data.calendarDate,
  6670. onChange: $options.singleChange,
  6671. "default-value": $props.defaultValue,
  6672. style: { "padding": "0 8px" }
  6673. }, null, 8, ["start-date", "end-date", "date", "onChange", "default-value"]),
  6674. $data.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
  6675. key: 1,
  6676. class: "popup-x-footer"
  6677. }, [
  6678. vue.createElementVNode(
  6679. "text",
  6680. {
  6681. class: "confirm-text",
  6682. onClick: _cache[6] || (_cache[6] = (...args) => $options.confirmSingleChange && $options.confirmSingleChange(...args))
  6683. },
  6684. vue.toDisplayString($options.okText),
  6685. 1
  6686. /* TEXT */
  6687. )
  6688. ])) : vue.createCommentVNode("v-if", true)
  6689. ],
  6690. 4
  6691. /* STYLE */
  6692. )) : (vue.openBlock(), vue.createElementBlock(
  6693. "view",
  6694. {
  6695. key: 1,
  6696. class: "uni-date-range--x",
  6697. style: vue.normalizeStyle($data.pickerPositionStyle)
  6698. },
  6699. [
  6700. vue.createElementVNode("view", { class: "uni-popper__arrow" }),
  6701. $data.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
  6702. key: 0,
  6703. class: "popup-x-header uni-date-changed"
  6704. }, [
  6705. vue.createElementVNode("view", { class: "popup-x-header--datetime" }, [
  6706. vue.withDirectives(vue.createElementVNode("input", {
  6707. class: "uni-date__input uni-date-range__input",
  6708. type: "text",
  6709. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.tempRange.startDate = $event),
  6710. placeholder: $options.startDateText
  6711. }, null, 8, ["placeholder"]), [
  6712. [vue.vModelText, $data.tempRange.startDate]
  6713. ]),
  6714. vue.createVNode(_component_time_picker, {
  6715. type: "time",
  6716. modelValue: $data.tempRange.startTime,
  6717. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.tempRange.startTime = $event),
  6718. start: $options.timepickerStartTime,
  6719. border: false,
  6720. disabled: !$data.tempRange.startDate,
  6721. hideSecond: $props.hideSecond
  6722. }, {
  6723. default: vue.withCtx(() => [
  6724. vue.withDirectives(vue.createElementVNode("input", {
  6725. class: "uni-date__input uni-date-range__input",
  6726. type: "text",
  6727. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.tempRange.startTime = $event),
  6728. placeholder: $options.startTimeText,
  6729. disabled: !$data.tempRange.startDate
  6730. }, null, 8, ["placeholder", "disabled"]), [
  6731. [vue.vModelText, $data.tempRange.startTime]
  6732. ])
  6733. ]),
  6734. _: 1
  6735. /* STABLE */
  6736. }, 8, ["modelValue", "start", "disabled", "hideSecond"])
  6737. ]),
  6738. vue.createVNode(_component_uni_icons, {
  6739. type: "arrowthinright",
  6740. color: "#999",
  6741. style: { "line-height": "40px" }
  6742. }),
  6743. vue.createElementVNode("view", { class: "popup-x-header--datetime" }, [
  6744. vue.withDirectives(vue.createElementVNode("input", {
  6745. class: "uni-date__input uni-date-range__input",
  6746. type: "text",
  6747. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $data.tempRange.endDate = $event),
  6748. placeholder: $options.endDateText
  6749. }, null, 8, ["placeholder"]), [
  6750. [vue.vModelText, $data.tempRange.endDate]
  6751. ]),
  6752. vue.createVNode(_component_time_picker, {
  6753. type: "time",
  6754. modelValue: $data.tempRange.endTime,
  6755. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.tempRange.endTime = $event),
  6756. end: $options.timepickerEndTime,
  6757. border: false,
  6758. disabled: !$data.tempRange.endDate,
  6759. hideSecond: $props.hideSecond
  6760. }, {
  6761. default: vue.withCtx(() => [
  6762. vue.withDirectives(vue.createElementVNode("input", {
  6763. class: "uni-date__input uni-date-range__input",
  6764. type: "text",
  6765. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.tempRange.endTime = $event),
  6766. placeholder: $options.endTimeText,
  6767. disabled: !$data.tempRange.endDate
  6768. }, null, 8, ["placeholder", "disabled"]), [
  6769. [vue.vModelText, $data.tempRange.endTime]
  6770. ])
  6771. ]),
  6772. _: 1
  6773. /* STABLE */
  6774. }, 8, ["modelValue", "end", "disabled", "hideSecond"])
  6775. ])
  6776. ])) : vue.createCommentVNode("v-if", true),
  6777. vue.createElementVNode("view", { class: "popup-x-body" }, [
  6778. vue.createVNode(_component_Calendar, {
  6779. ref: "left",
  6780. showMonth: false,
  6781. "start-date": $data.calendarRange.startDate,
  6782. "end-date": $data.calendarRange.endDate,
  6783. range: true,
  6784. pleStatus: $data.endMultipleStatus,
  6785. onChange: $options.leftChange,
  6786. onFirstEnterCale: $options.updateRightCale,
  6787. style: { "padding": "0 8px" }
  6788. }, null, 8, ["start-date", "end-date", "pleStatus", "onChange", "onFirstEnterCale"]),
  6789. vue.createVNode(_component_Calendar, {
  6790. ref: "right",
  6791. showMonth: false,
  6792. "start-date": $data.calendarRange.startDate,
  6793. "end-date": $data.calendarRange.endDate,
  6794. range: true,
  6795. onChange: $options.rightChange,
  6796. pleStatus: $data.startMultipleStatus,
  6797. onFirstEnterCale: $options.updateLeftCale,
  6798. style: { "padding": "0 8px", "border-left": "1px solid #F1F1F1" }
  6799. }, null, 8, ["start-date", "end-date", "onChange", "pleStatus", "onFirstEnterCale"])
  6800. ]),
  6801. $data.hasTime ? (vue.openBlock(), vue.createElementBlock("view", {
  6802. key: 1,
  6803. class: "popup-x-footer"
  6804. }, [
  6805. vue.createElementVNode(
  6806. "text",
  6807. {
  6808. onClick: _cache[13] || (_cache[13] = (...args) => $options.clear && $options.clear(...args))
  6809. },
  6810. vue.toDisplayString($options.clearText),
  6811. 1
  6812. /* TEXT */
  6813. ),
  6814. vue.createElementVNode(
  6815. "text",
  6816. {
  6817. class: "confirm-text",
  6818. onClick: _cache[14] || (_cache[14] = (...args) => $options.confirmRangeChange && $options.confirmRangeChange(...args))
  6819. },
  6820. vue.toDisplayString($options.okText),
  6821. 1
  6822. /* TEXT */
  6823. )
  6824. ])) : vue.createCommentVNode("v-if", true)
  6825. ],
  6826. 4
  6827. /* STYLE */
  6828. ))
  6829. ],
  6830. 512
  6831. /* NEED_PATCH */
  6832. )), [
  6833. [vue.vShow, $data.pickerVisible]
  6834. ]) : vue.createCommentVNode("v-if", true),
  6835. $data.isPhone ? (vue.openBlock(), vue.createBlock(_component_Calendar, {
  6836. key: 1,
  6837. ref: "mobile",
  6838. clearDate: false,
  6839. date: $data.calendarDate,
  6840. defTime: $options.mobileCalendarTime,
  6841. "start-date": $data.calendarRange.startDate,
  6842. "end-date": $data.calendarRange.endDate,
  6843. selectableTimes: $options.mobSelectableTime,
  6844. startPlaceholder: $props.startPlaceholder,
  6845. endPlaceholder: $props.endPlaceholder,
  6846. "default-value": $props.defaultValue,
  6847. pleStatus: $data.endMultipleStatus,
  6848. showMonth: false,
  6849. range: $data.isRange,
  6850. hasTime: $data.hasTime,
  6851. insert: false,
  6852. hideSecond: $props.hideSecond,
  6853. onConfirm: $options.mobileChange,
  6854. onMaskClose: $options.close
  6855. }, null, 8, ["date", "defTime", "start-date", "end-date", "selectableTimes", "startPlaceholder", "endPlaceholder", "default-value", "pleStatus", "range", "hasTime", "hideSecond", "onConfirm", "onMaskClose"])) : vue.createCommentVNode("v-if", true)
  6856. ]);
  6857. }
  6858. const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$9], ["__scopeId", "data-v-9802168a"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue"]]);
  6859. const _sfc_main$g = {
  6860. name: "UniTag",
  6861. emits: ["click"],
  6862. props: {
  6863. type: {
  6864. // 标签类型default、primary、success、warning、error、royal
  6865. type: String,
  6866. default: "default"
  6867. },
  6868. size: {
  6869. // 标签大小 normal, small
  6870. type: String,
  6871. default: "normal"
  6872. },
  6873. // 标签内容
  6874. text: {
  6875. type: String,
  6876. default: ""
  6877. },
  6878. disabled: {
  6879. // 是否为禁用状态
  6880. type: [Boolean, String],
  6881. default: false
  6882. },
  6883. inverted: {
  6884. // 是否为空心
  6885. type: [Boolean, String],
  6886. default: false
  6887. },
  6888. circle: {
  6889. // 是否为圆角样式
  6890. type: [Boolean, String],
  6891. default: false
  6892. },
  6893. mark: {
  6894. // 是否为标记样式
  6895. type: [Boolean, String],
  6896. default: false
  6897. },
  6898. customStyle: {
  6899. type: String,
  6900. default: ""
  6901. }
  6902. },
  6903. computed: {
  6904. classes() {
  6905. const {
  6906. type,
  6907. disabled,
  6908. inverted,
  6909. circle,
  6910. mark,
  6911. size,
  6912. isTrue
  6913. } = this;
  6914. const classArr = [
  6915. "uni-tag--" + type,
  6916. "uni-tag--" + size,
  6917. isTrue(disabled) ? "uni-tag--disabled" : "",
  6918. isTrue(inverted) ? "uni-tag--" + type + "--inverted" : "",
  6919. isTrue(circle) ? "uni-tag--circle" : "",
  6920. isTrue(mark) ? "uni-tag--mark" : "",
  6921. // type === 'default' ? 'uni-tag--default' : 'uni-tag-text',
  6922. isTrue(inverted) ? "uni-tag--inverted uni-tag-text--" + type : "",
  6923. size === "small" ? "uni-tag-text--small" : ""
  6924. ];
  6925. return classArr.join(" ");
  6926. }
  6927. },
  6928. methods: {
  6929. isTrue(value) {
  6930. return value === true || value === "true";
  6931. },
  6932. onClick() {
  6933. if (this.isTrue(this.disabled))
  6934. return;
  6935. this.$emit("click");
  6936. }
  6937. }
  6938. };
  6939. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  6940. return $props.text ? (vue.openBlock(), vue.createElementBlock(
  6941. "text",
  6942. {
  6943. key: 0,
  6944. class: vue.normalizeClass(["uni-tag", $options.classes]),
  6945. style: vue.normalizeStyle($props.customStyle),
  6946. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  6947. },
  6948. vue.toDisplayString($props.text),
  6949. 7
  6950. /* TEXT, CLASS, STYLE */
  6951. )) : vue.createCommentVNode("v-if", true);
  6952. }
  6953. const __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$8], ["__scopeId", "data-v-1f94d070"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-tag/components/uni-tag/uni-tag.vue"]]);
  6954. const popup = {
  6955. data() {
  6956. return {};
  6957. },
  6958. created() {
  6959. this.popup = this.getParent();
  6960. },
  6961. methods: {
  6962. /**
  6963. * 获取父元素实例
  6964. */
  6965. getParent(name = "uniPopup") {
  6966. let parent = this.$parent;
  6967. let parentName = parent.$options.name;
  6968. while (parentName !== name) {
  6969. parent = parent.$parent;
  6970. if (!parent)
  6971. return false;
  6972. parentName = parent.$options.name;
  6973. }
  6974. return parent;
  6975. }
  6976. }
  6977. };
  6978. const en = {
  6979. "uni-popup.cancel": "cancel",
  6980. "uni-popup.ok": "ok",
  6981. "uni-popup.placeholder": "pleace enter",
  6982. "uni-popup.title": "Hint",
  6983. "uni-popup.shareTitle": "Share to"
  6984. };
  6985. const zhHans = {
  6986. "uni-popup.cancel": "取消",
  6987. "uni-popup.ok": "确定",
  6988. "uni-popup.placeholder": "请输入",
  6989. "uni-popup.title": "提示",
  6990. "uni-popup.shareTitle": "分享到"
  6991. };
  6992. const zhHant = {
  6993. "uni-popup.cancel": "取消",
  6994. "uni-popup.ok": "確定",
  6995. "uni-popup.placeholder": "請輸入",
  6996. "uni-popup.title": "提示",
  6997. "uni-popup.shareTitle": "分享到"
  6998. };
  6999. const messages = {
  7000. en,
  7001. "zh-Hans": zhHans,
  7002. "zh-Hant": zhHant
  7003. };
  7004. const { t: t$2 } = initVueI18n(messages);
  7005. const _sfc_main$f = {
  7006. name: "uniPopupDialog",
  7007. mixins: [popup],
  7008. emits: ["confirm", "close"],
  7009. props: {
  7010. inputType: {
  7011. type: String,
  7012. default: "text"
  7013. },
  7014. value: {
  7015. type: [String, Number],
  7016. default: ""
  7017. },
  7018. placeholder: {
  7019. type: [String, Number],
  7020. default: ""
  7021. },
  7022. type: {
  7023. type: String,
  7024. default: "error"
  7025. },
  7026. mode: {
  7027. type: String,
  7028. default: "base"
  7029. },
  7030. title: {
  7031. type: String,
  7032. default: ""
  7033. },
  7034. content: {
  7035. type: String,
  7036. default: ""
  7037. },
  7038. beforeClose: {
  7039. type: Boolean,
  7040. default: false
  7041. },
  7042. cancelText: {
  7043. type: String,
  7044. default: ""
  7045. },
  7046. confirmText: {
  7047. type: String,
  7048. default: ""
  7049. }
  7050. },
  7051. data() {
  7052. return {
  7053. dialogType: "error",
  7054. focus: false,
  7055. val: ""
  7056. };
  7057. },
  7058. computed: {
  7059. okText() {
  7060. return this.confirmText || t$2("uni-popup.ok");
  7061. },
  7062. closeText() {
  7063. return this.cancelText || t$2("uni-popup.cancel");
  7064. },
  7065. placeholderText() {
  7066. return this.placeholder || t$2("uni-popup.placeholder");
  7067. },
  7068. titleText() {
  7069. return this.title || t$2("uni-popup.title");
  7070. }
  7071. },
  7072. watch: {
  7073. type(val) {
  7074. this.dialogType = val;
  7075. },
  7076. mode(val) {
  7077. if (val === "input") {
  7078. this.dialogType = "info";
  7079. }
  7080. },
  7081. value(val) {
  7082. this.val = val;
  7083. }
  7084. },
  7085. created() {
  7086. this.popup.disableMask();
  7087. if (this.mode === "input") {
  7088. this.dialogType = "info";
  7089. this.val = this.value;
  7090. } else {
  7091. this.dialogType = this.type;
  7092. }
  7093. },
  7094. mounted() {
  7095. this.focus = true;
  7096. },
  7097. methods: {
  7098. /**
  7099. * 点击确认按钮
  7100. */
  7101. onOk() {
  7102. if (this.mode === "input") {
  7103. this.$emit("confirm", this.val);
  7104. } else {
  7105. this.$emit("confirm");
  7106. }
  7107. if (this.beforeClose)
  7108. return;
  7109. this.popup.close();
  7110. },
  7111. /**
  7112. * 点击取消按钮
  7113. */
  7114. closeDialog() {
  7115. this.$emit("close");
  7116. if (this.beforeClose)
  7117. return;
  7118. this.popup.close();
  7119. },
  7120. close() {
  7121. this.popup.close();
  7122. }
  7123. }
  7124. };
  7125. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  7126. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-popup-dialog" }, [
  7127. vue.createElementVNode("view", { class: "uni-dialog-title" }, [
  7128. vue.createElementVNode(
  7129. "text",
  7130. {
  7131. class: vue.normalizeClass(["uni-dialog-title-text", ["uni-popup__" + $data.dialogType]])
  7132. },
  7133. vue.toDisplayString($options.titleText),
  7134. 3
  7135. /* TEXT, CLASS */
  7136. )
  7137. ]),
  7138. $props.mode === "base" ? (vue.openBlock(), vue.createElementBlock("view", {
  7139. key: 0,
  7140. class: "uni-dialog-content"
  7141. }, [
  7142. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  7143. vue.createElementVNode(
  7144. "text",
  7145. { class: "uni-dialog-content-text" },
  7146. vue.toDisplayString($props.content),
  7147. 1
  7148. /* TEXT */
  7149. )
  7150. ], true)
  7151. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  7152. key: 1,
  7153. class: "uni-dialog-content"
  7154. }, [
  7155. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  7156. vue.withDirectives(vue.createElementVNode("input", {
  7157. class: "uni-dialog-input",
  7158. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.val = $event),
  7159. type: $props.inputType,
  7160. placeholder: $options.placeholderText,
  7161. focus: $data.focus
  7162. }, null, 8, ["type", "placeholder", "focus"]), [
  7163. [vue.vModelDynamic, $data.val]
  7164. ])
  7165. ], true)
  7166. ])),
  7167. vue.createElementVNode("view", { class: "uni-dialog-button-group" }, [
  7168. vue.createElementVNode("view", {
  7169. class: "uni-dialog-button",
  7170. onClick: _cache[1] || (_cache[1] = (...args) => $options.closeDialog && $options.closeDialog(...args))
  7171. }, [
  7172. vue.createElementVNode(
  7173. "text",
  7174. { class: "uni-dialog-button-text" },
  7175. vue.toDisplayString($options.closeText),
  7176. 1
  7177. /* TEXT */
  7178. )
  7179. ]),
  7180. vue.createElementVNode("view", {
  7181. class: "uni-dialog-button uni-border-left",
  7182. onClick: _cache[2] || (_cache[2] = (...args) => $options.onOk && $options.onOk(...args))
  7183. }, [
  7184. vue.createElementVNode(
  7185. "text",
  7186. { class: "uni-dialog-button-text uni-button-color" },
  7187. vue.toDisplayString($options.okText),
  7188. 1
  7189. /* TEXT */
  7190. )
  7191. ])
  7192. ])
  7193. ]);
  7194. }
  7195. const __easycom_4 = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$7], ["__scopeId", "data-v-d78c88b7"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue"]]);
  7196. class MPAnimation {
  7197. constructor(options, _this) {
  7198. this.options = options;
  7199. this.animation = uni.createAnimation({
  7200. ...options
  7201. });
  7202. this.currentStepAnimates = {};
  7203. this.next = 0;
  7204. this.$ = _this;
  7205. }
  7206. _nvuePushAnimates(type, args) {
  7207. let aniObj = this.currentStepAnimates[this.next];
  7208. let styles = {};
  7209. if (!aniObj) {
  7210. styles = {
  7211. styles: {},
  7212. config: {}
  7213. };
  7214. } else {
  7215. styles = aniObj;
  7216. }
  7217. if (animateTypes1.includes(type)) {
  7218. if (!styles.styles.transform) {
  7219. styles.styles.transform = "";
  7220. }
  7221. let unit = "";
  7222. if (type === "rotate") {
  7223. unit = "deg";
  7224. }
  7225. styles.styles.transform += `${type}(${args + unit}) `;
  7226. } else {
  7227. styles.styles[type] = `${args}`;
  7228. }
  7229. this.currentStepAnimates[this.next] = styles;
  7230. }
  7231. _animateRun(styles = {}, config = {}) {
  7232. let ref = this.$.$refs["ani"].ref;
  7233. if (!ref)
  7234. return;
  7235. return new Promise((resolve, reject) => {
  7236. nvueAnimation.transition(ref, {
  7237. styles,
  7238. ...config
  7239. }, (res) => {
  7240. resolve();
  7241. });
  7242. });
  7243. }
  7244. _nvueNextAnimate(animates, step = 0, fn) {
  7245. let obj = animates[step];
  7246. if (obj) {
  7247. let {
  7248. styles,
  7249. config
  7250. } = obj;
  7251. this._animateRun(styles, config).then(() => {
  7252. step += 1;
  7253. this._nvueNextAnimate(animates, step, fn);
  7254. });
  7255. } else {
  7256. this.currentStepAnimates = {};
  7257. typeof fn === "function" && fn();
  7258. this.isEnd = true;
  7259. }
  7260. }
  7261. step(config = {}) {
  7262. this.animation.step(config);
  7263. return this;
  7264. }
  7265. run(fn) {
  7266. this.$.animationData = this.animation.export();
  7267. this.$.timer = setTimeout(() => {
  7268. typeof fn === "function" && fn();
  7269. }, this.$.durationTime);
  7270. }
  7271. }
  7272. const animateTypes1 = [
  7273. "matrix",
  7274. "matrix3d",
  7275. "rotate",
  7276. "rotate3d",
  7277. "rotateX",
  7278. "rotateY",
  7279. "rotateZ",
  7280. "scale",
  7281. "scale3d",
  7282. "scaleX",
  7283. "scaleY",
  7284. "scaleZ",
  7285. "skew",
  7286. "skewX",
  7287. "skewY",
  7288. "translate",
  7289. "translate3d",
  7290. "translateX",
  7291. "translateY",
  7292. "translateZ"
  7293. ];
  7294. const animateTypes2 = ["opacity", "backgroundColor"];
  7295. const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
  7296. animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
  7297. MPAnimation.prototype[type] = function(...args) {
  7298. this.animation[type](...args);
  7299. return this;
  7300. };
  7301. });
  7302. function createAnimation(option, _this) {
  7303. if (!_this)
  7304. return;
  7305. clearTimeout(_this.timer);
  7306. return new MPAnimation(option, _this);
  7307. }
  7308. const _sfc_main$e = {
  7309. name: "uniTransition",
  7310. emits: ["click", "change"],
  7311. props: {
  7312. show: {
  7313. type: Boolean,
  7314. default: false
  7315. },
  7316. modeClass: {
  7317. type: [Array, String],
  7318. default() {
  7319. return "fade";
  7320. }
  7321. },
  7322. duration: {
  7323. type: Number,
  7324. default: 300
  7325. },
  7326. styles: {
  7327. type: Object,
  7328. default() {
  7329. return {};
  7330. }
  7331. },
  7332. customClass: {
  7333. type: String,
  7334. default: ""
  7335. },
  7336. onceRender: {
  7337. type: Boolean,
  7338. default: false
  7339. }
  7340. },
  7341. data() {
  7342. return {
  7343. isShow: false,
  7344. transform: "",
  7345. opacity: 1,
  7346. animationData: {},
  7347. durationTime: 300,
  7348. config: {}
  7349. };
  7350. },
  7351. watch: {
  7352. show: {
  7353. handler(newVal) {
  7354. if (newVal) {
  7355. this.open();
  7356. } else {
  7357. if (this.isShow) {
  7358. this.close();
  7359. }
  7360. }
  7361. },
  7362. immediate: true
  7363. }
  7364. },
  7365. computed: {
  7366. // 生成样式数据
  7367. stylesObject() {
  7368. let styles = {
  7369. ...this.styles,
  7370. "transition-duration": this.duration / 1e3 + "s"
  7371. };
  7372. let transform = "";
  7373. for (let i2 in styles) {
  7374. let line = this.toLine(i2);
  7375. transform += line + ":" + styles[i2] + ";";
  7376. }
  7377. return transform;
  7378. },
  7379. // 初始化动画条件
  7380. transformStyles() {
  7381. return "transform:" + this.transform + ";opacity:" + this.opacity + ";" + this.stylesObject;
  7382. }
  7383. },
  7384. created() {
  7385. this.config = {
  7386. duration: this.duration,
  7387. timingFunction: "ease",
  7388. transformOrigin: "50% 50%",
  7389. delay: 0
  7390. };
  7391. this.durationTime = this.duration;
  7392. },
  7393. methods: {
  7394. /**
  7395. * ref 触发 初始化动画
  7396. */
  7397. init(obj = {}) {
  7398. if (obj.duration) {
  7399. this.durationTime = obj.duration;
  7400. }
  7401. this.animation = createAnimation(Object.assign(this.config, obj), this);
  7402. },
  7403. /**
  7404. * 点击组件触发回调
  7405. */
  7406. onClick() {
  7407. this.$emit("click", {
  7408. detail: this.isShow
  7409. });
  7410. },
  7411. /**
  7412. * ref 触发 动画分组
  7413. * @param {Object} obj
  7414. */
  7415. step(obj, config = {}) {
  7416. if (!this.animation)
  7417. return;
  7418. for (let i2 in obj) {
  7419. try {
  7420. if (typeof obj[i2] === "object") {
  7421. this.animation[i2](...obj[i2]);
  7422. } else {
  7423. this.animation[i2](obj[i2]);
  7424. }
  7425. } catch (e2) {
  7426. formatAppLog("error", "at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:148", `方法 ${i2} 不存在`);
  7427. }
  7428. }
  7429. this.animation.step(config);
  7430. return this;
  7431. },
  7432. /**
  7433. * ref 触发 执行动画
  7434. */
  7435. run(fn) {
  7436. if (!this.animation)
  7437. return;
  7438. this.animation.run(fn);
  7439. },
  7440. // 开始过度动画
  7441. open() {
  7442. clearTimeout(this.timer);
  7443. this.transform = "";
  7444. this.isShow = true;
  7445. let { opacity, transform } = this.styleInit(false);
  7446. if (typeof opacity !== "undefined") {
  7447. this.opacity = opacity;
  7448. }
  7449. this.transform = transform;
  7450. this.$nextTick(() => {
  7451. this.timer = setTimeout(() => {
  7452. this.animation = createAnimation(this.config, this);
  7453. this.tranfromInit(false).step();
  7454. this.animation.run();
  7455. this.$emit("change", {
  7456. detail: this.isShow
  7457. });
  7458. }, 20);
  7459. });
  7460. },
  7461. // 关闭过度动画
  7462. close(type) {
  7463. if (!this.animation)
  7464. return;
  7465. this.tranfromInit(true).step().run(() => {
  7466. this.isShow = false;
  7467. this.animationData = null;
  7468. this.animation = null;
  7469. let { opacity, transform } = this.styleInit(false);
  7470. this.opacity = opacity || 1;
  7471. this.transform = transform;
  7472. this.$emit("change", {
  7473. detail: this.isShow
  7474. });
  7475. });
  7476. },
  7477. // 处理动画开始前的默认样式
  7478. styleInit(type) {
  7479. let styles = {
  7480. transform: ""
  7481. };
  7482. let buildStyle = (type2, mode) => {
  7483. if (mode === "fade") {
  7484. styles.opacity = this.animationType(type2)[mode];
  7485. } else {
  7486. styles.transform += this.animationType(type2)[mode] + " ";
  7487. }
  7488. };
  7489. if (typeof this.modeClass === "string") {
  7490. buildStyle(type, this.modeClass);
  7491. } else {
  7492. this.modeClass.forEach((mode) => {
  7493. buildStyle(type, mode);
  7494. });
  7495. }
  7496. return styles;
  7497. },
  7498. // 处理内置组合动画
  7499. tranfromInit(type) {
  7500. let buildTranfrom = (type2, mode) => {
  7501. let aniNum = null;
  7502. if (mode === "fade") {
  7503. aniNum = type2 ? 0 : 1;
  7504. } else {
  7505. aniNum = type2 ? "-100%" : "0";
  7506. if (mode === "zoom-in") {
  7507. aniNum = type2 ? 0.8 : 1;
  7508. }
  7509. if (mode === "zoom-out") {
  7510. aniNum = type2 ? 1.2 : 1;
  7511. }
  7512. if (mode === "slide-right") {
  7513. aniNum = type2 ? "100%" : "0";
  7514. }
  7515. if (mode === "slide-bottom") {
  7516. aniNum = type2 ? "100%" : "0";
  7517. }
  7518. }
  7519. this.animation[this.animationMode()[mode]](aniNum);
  7520. };
  7521. if (typeof this.modeClass === "string") {
  7522. buildTranfrom(type, this.modeClass);
  7523. } else {
  7524. this.modeClass.forEach((mode) => {
  7525. buildTranfrom(type, mode);
  7526. });
  7527. }
  7528. return this.animation;
  7529. },
  7530. animationType(type) {
  7531. return {
  7532. fade: type ? 1 : 0,
  7533. "slide-top": `translateY(${type ? "0" : "-100%"})`,
  7534. "slide-right": `translateX(${type ? "0" : "100%"})`,
  7535. "slide-bottom": `translateY(${type ? "0" : "100%"})`,
  7536. "slide-left": `translateX(${type ? "0" : "-100%"})`,
  7537. "zoom-in": `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
  7538. "zoom-out": `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
  7539. };
  7540. },
  7541. // 内置动画类型与实际动画对应字典
  7542. animationMode() {
  7543. return {
  7544. fade: "opacity",
  7545. "slide-top": "translateY",
  7546. "slide-right": "translateX",
  7547. "slide-bottom": "translateY",
  7548. "slide-left": "translateX",
  7549. "zoom-in": "scale",
  7550. "zoom-out": "scale"
  7551. };
  7552. },
  7553. // 驼峰转中横线
  7554. toLine(name) {
  7555. return name.replace(/([A-Z])/g, "-$1").toLowerCase();
  7556. }
  7557. }
  7558. };
  7559. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  7560. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("view", {
  7561. ref: "ani",
  7562. animation: $data.animationData,
  7563. class: vue.normalizeClass($props.customClass),
  7564. style: vue.normalizeStyle($options.transformStyles),
  7565. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  7566. }, [
  7567. vue.renderSlot(_ctx.$slots, "default")
  7568. ], 14, ["animation"])), [
  7569. [vue.vShow, $data.isShow]
  7570. ]);
  7571. }
  7572. const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$6], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-transition/components/uni-transition/uni-transition.vue"]]);
  7573. const _sfc_main$d = {
  7574. name: "uniPopup",
  7575. components: {},
  7576. emits: ["change", "maskClick"],
  7577. props: {
  7578. // 开启动画
  7579. animation: {
  7580. type: Boolean,
  7581. default: true
  7582. },
  7583. // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
  7584. // message: 消息提示 ; dialog : 对话框
  7585. type: {
  7586. type: String,
  7587. default: "center"
  7588. },
  7589. // maskClick
  7590. isMaskClick: {
  7591. type: Boolean,
  7592. default: null
  7593. },
  7594. // TODO 2 个版本后废弃属性 ,使用 isMaskClick
  7595. maskClick: {
  7596. type: Boolean,
  7597. default: null
  7598. },
  7599. backgroundColor: {
  7600. type: String,
  7601. default: "none"
  7602. },
  7603. safeArea: {
  7604. type: Boolean,
  7605. default: true
  7606. },
  7607. maskBackgroundColor: {
  7608. type: String,
  7609. default: "rgba(0, 0, 0, 0.4)"
  7610. }
  7611. },
  7612. watch: {
  7613. /**
  7614. * 监听type类型
  7615. */
  7616. type: {
  7617. handler: function(type) {
  7618. if (!this.config[type])
  7619. return;
  7620. this[this.config[type]](true);
  7621. },
  7622. immediate: true
  7623. },
  7624. isDesktop: {
  7625. handler: function(newVal) {
  7626. if (!this.config[newVal])
  7627. return;
  7628. this[this.config[this.type]](true);
  7629. },
  7630. immediate: true
  7631. },
  7632. /**
  7633. * 监听遮罩是否可点击
  7634. * @param {Object} val
  7635. */
  7636. maskClick: {
  7637. handler: function(val) {
  7638. this.mkclick = val;
  7639. },
  7640. immediate: true
  7641. },
  7642. isMaskClick: {
  7643. handler: function(val) {
  7644. this.mkclick = val;
  7645. },
  7646. immediate: true
  7647. },
  7648. // H5 下禁止底部滚动
  7649. showPopup(show) {
  7650. }
  7651. },
  7652. data() {
  7653. return {
  7654. duration: 300,
  7655. ani: [],
  7656. showPopup: false,
  7657. showTrans: false,
  7658. popupWidth: 0,
  7659. popupHeight: 0,
  7660. config: {
  7661. top: "top",
  7662. bottom: "bottom",
  7663. center: "center",
  7664. left: "left",
  7665. right: "right",
  7666. message: "top",
  7667. dialog: "center",
  7668. share: "bottom"
  7669. },
  7670. maskClass: {
  7671. position: "fixed",
  7672. bottom: 0,
  7673. top: 0,
  7674. left: 0,
  7675. right: 0,
  7676. backgroundColor: "rgba(0, 0, 0, 0.4)"
  7677. },
  7678. transClass: {
  7679. position: "fixed",
  7680. left: 0,
  7681. right: 0
  7682. },
  7683. maskShow: true,
  7684. mkclick: true,
  7685. popupstyle: this.isDesktop ? "fixforpc-top" : "top"
  7686. };
  7687. },
  7688. computed: {
  7689. isDesktop() {
  7690. return this.popupWidth >= 500 && this.popupHeight >= 500;
  7691. },
  7692. bg() {
  7693. if (this.backgroundColor === "" || this.backgroundColor === "none") {
  7694. return "transparent";
  7695. }
  7696. return this.backgroundColor;
  7697. }
  7698. },
  7699. mounted() {
  7700. const fixSize = () => {
  7701. const {
  7702. windowWidth,
  7703. windowHeight,
  7704. windowTop,
  7705. safeArea,
  7706. screenHeight,
  7707. safeAreaInsets
  7708. } = uni.getSystemInfoSync();
  7709. this.popupWidth = windowWidth;
  7710. this.popupHeight = windowHeight + (windowTop || 0);
  7711. if (safeArea && this.safeArea) {
  7712. this.safeAreaInsets = safeAreaInsets.bottom;
  7713. } else {
  7714. this.safeAreaInsets = 0;
  7715. }
  7716. };
  7717. fixSize();
  7718. },
  7719. // TODO vue3
  7720. unmounted() {
  7721. this.setH5Visible();
  7722. },
  7723. created() {
  7724. if (this.isMaskClick === null && this.maskClick === null) {
  7725. this.mkclick = true;
  7726. } else {
  7727. this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
  7728. }
  7729. if (this.animation) {
  7730. this.duration = 300;
  7731. } else {
  7732. this.duration = 0;
  7733. }
  7734. this.messageChild = null;
  7735. this.clearPropagation = false;
  7736. this.maskClass.backgroundColor = this.maskBackgroundColor;
  7737. },
  7738. methods: {
  7739. setH5Visible() {
  7740. },
  7741. /**
  7742. * 公用方法,不显示遮罩层
  7743. */
  7744. closeMask() {
  7745. this.maskShow = false;
  7746. },
  7747. /**
  7748. * 公用方法,遮罩层禁止点击
  7749. */
  7750. disableMask() {
  7751. this.mkclick = false;
  7752. },
  7753. // TODO nvue 取消冒泡
  7754. clear(e2) {
  7755. e2.stopPropagation();
  7756. this.clearPropagation = true;
  7757. },
  7758. open(direction) {
  7759. if (this.showPopup) {
  7760. return;
  7761. }
  7762. let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
  7763. if (!(direction && innerType.indexOf(direction) !== -1)) {
  7764. direction = this.type;
  7765. }
  7766. if (!this.config[direction]) {
  7767. formatAppLog("error", "at uni_modules/uni-popup/components/uni-popup/uni-popup.vue:279", "缺少类型:", direction);
  7768. return;
  7769. }
  7770. this[this.config[direction]]();
  7771. this.$emit("change", {
  7772. show: true,
  7773. type: direction
  7774. });
  7775. },
  7776. close(type) {
  7777. this.showTrans = false;
  7778. this.$emit("change", {
  7779. show: false,
  7780. type: this.type
  7781. });
  7782. clearTimeout(this.timer);
  7783. this.timer = setTimeout(() => {
  7784. this.showPopup = false;
  7785. }, 300);
  7786. },
  7787. // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
  7788. touchstart() {
  7789. this.clearPropagation = false;
  7790. },
  7791. onTap() {
  7792. if (this.clearPropagation) {
  7793. this.clearPropagation = false;
  7794. return;
  7795. }
  7796. this.$emit("maskClick");
  7797. if (!this.mkclick)
  7798. return;
  7799. this.close();
  7800. },
  7801. /**
  7802. * 顶部弹出样式处理
  7803. */
  7804. top(type) {
  7805. this.popupstyle = this.isDesktop ? "fixforpc-top" : "top";
  7806. this.ani = ["slide-top"];
  7807. this.transClass = {
  7808. position: "fixed",
  7809. left: 0,
  7810. right: 0,
  7811. backgroundColor: this.bg
  7812. };
  7813. if (type)
  7814. return;
  7815. this.showPopup = true;
  7816. this.showTrans = true;
  7817. this.$nextTick(() => {
  7818. if (this.messageChild && this.type === "message") {
  7819. this.messageChild.timerClose();
  7820. }
  7821. });
  7822. },
  7823. /**
  7824. * 底部弹出样式处理
  7825. */
  7826. bottom(type) {
  7827. this.popupstyle = "bottom";
  7828. this.ani = ["slide-bottom"];
  7829. this.transClass = {
  7830. position: "fixed",
  7831. left: 0,
  7832. right: 0,
  7833. bottom: 0,
  7834. paddingBottom: this.safeAreaInsets + "px",
  7835. backgroundColor: this.bg
  7836. };
  7837. if (type)
  7838. return;
  7839. this.showPopup = true;
  7840. this.showTrans = true;
  7841. },
  7842. /**
  7843. * 中间弹出样式处理
  7844. */
  7845. center(type) {
  7846. this.popupstyle = "center";
  7847. this.ani = ["zoom-out", "fade"];
  7848. this.transClass = {
  7849. position: "fixed",
  7850. display: "flex",
  7851. flexDirection: "column",
  7852. bottom: 0,
  7853. left: 0,
  7854. right: 0,
  7855. top: 0,
  7856. justifyContent: "center",
  7857. alignItems: "center"
  7858. };
  7859. if (type)
  7860. return;
  7861. this.showPopup = true;
  7862. this.showTrans = true;
  7863. },
  7864. left(type) {
  7865. this.popupstyle = "left";
  7866. this.ani = ["slide-left"];
  7867. this.transClass = {
  7868. position: "fixed",
  7869. left: 0,
  7870. bottom: 0,
  7871. top: 0,
  7872. backgroundColor: this.bg,
  7873. display: "flex",
  7874. flexDirection: "column"
  7875. };
  7876. if (type)
  7877. return;
  7878. this.showPopup = true;
  7879. this.showTrans = true;
  7880. },
  7881. right(type) {
  7882. this.popupstyle = "right";
  7883. this.ani = ["slide-right"];
  7884. this.transClass = {
  7885. position: "fixed",
  7886. bottom: 0,
  7887. right: 0,
  7888. top: 0,
  7889. backgroundColor: this.bg,
  7890. display: "flex",
  7891. flexDirection: "column"
  7892. };
  7893. if (type)
  7894. return;
  7895. this.showPopup = true;
  7896. this.showTrans = true;
  7897. }
  7898. }
  7899. };
  7900. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  7901. const _component_uni_transition = resolveEasycom(vue.resolveDynamicComponent("uni-transition"), __easycom_0$1);
  7902. return $data.showPopup ? (vue.openBlock(), vue.createElementBlock(
  7903. "view",
  7904. {
  7905. key: 0,
  7906. class: vue.normalizeClass(["uni-popup", [$data.popupstyle, $options.isDesktop ? "fixforpc-z-index" : ""]])
  7907. },
  7908. [
  7909. vue.createElementVNode(
  7910. "view",
  7911. {
  7912. onTouchstart: _cache[1] || (_cache[1] = (...args) => $options.touchstart && $options.touchstart(...args))
  7913. },
  7914. [
  7915. $data.maskShow ? (vue.openBlock(), vue.createBlock(_component_uni_transition, {
  7916. key: "1",
  7917. name: "mask",
  7918. "mode-class": "fade",
  7919. styles: $data.maskClass,
  7920. duration: $data.duration,
  7921. show: $data.showTrans,
  7922. onClick: $options.onTap
  7923. }, null, 8, ["styles", "duration", "show", "onClick"])) : vue.createCommentVNode("v-if", true),
  7924. vue.createVNode(_component_uni_transition, {
  7925. key: "2",
  7926. "mode-class": $data.ani,
  7927. name: "content",
  7928. styles: $data.transClass,
  7929. duration: $data.duration,
  7930. show: $data.showTrans,
  7931. onClick: $options.onTap
  7932. }, {
  7933. default: vue.withCtx(() => [
  7934. vue.createElementVNode(
  7935. "view",
  7936. {
  7937. class: vue.normalizeClass(["uni-popup__wrapper", [$data.popupstyle]]),
  7938. style: vue.normalizeStyle({ backgroundColor: $options.bg }),
  7939. onClick: _cache[0] || (_cache[0] = (...args) => $options.clear && $options.clear(...args))
  7940. },
  7941. [
  7942. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  7943. ],
  7944. 6
  7945. /* CLASS, STYLE */
  7946. )
  7947. ]),
  7948. _: 3
  7949. /* FORWARDED */
  7950. }, 8, ["mode-class", "styles", "duration", "show", "onClick"])
  7951. ],
  7952. 32
  7953. /* HYDRATE_EVENTS */
  7954. )
  7955. ],
  7956. 2
  7957. /* CLASS */
  7958. )) : vue.createCommentVNode("v-if", true);
  7959. }
  7960. const __easycom_5 = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$5], ["__scopeId", "data-v-4dd3c44b"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-popup/components/uni-popup/uni-popup.vue"]]);
  7961. const __default__$4 = {
  7962. name: "NavBar"
  7963. };
  7964. const _sfc_main$c = /* @__PURE__ */ Object.assign(__default__$4, {
  7965. props: {
  7966. userInfo: {
  7967. default: function() {
  7968. return {};
  7969. },
  7970. type: Object
  7971. }
  7972. },
  7973. emits: ["updateUser"],
  7974. setup(__props, { emit }) {
  7975. const props = __props;
  7976. const { proxy } = vue.getCurrentInstance();
  7977. formatAppLog("log", "at components/nav-bar/nav-bar.vue:54", "props.userInfo.workStatus", props.userInfo.workStatus);
  7978. vue.onMounted(() => {
  7979. });
  7980. const dialogToggle = () => {
  7981. proxy.$refs.alertDialog.open();
  7982. };
  7983. const dialogConfirm = () => {
  7984. handleChange();
  7985. };
  7986. const dialogClose = () => {
  7987. formatAppLog("log", "at components/nav-bar/nav-bar.vue:69", "guanbi");
  7988. };
  7989. const handleChange = async () => {
  7990. formatAppLog("log", "at components/nav-bar/nav-bar.vue:74", "props.userInfo.workStatus》》》", props.userInfo.workStatus);
  7991. uni.getStorageSync("token");
  7992. const userId = uni.getStorageSync("userId");
  7993. if (props.userInfo.workStatus) {
  7994. const params2 = {
  7995. token: uni.getStorageSync("token"),
  7996. data: {
  7997. pharmacistUserId: userId,
  7998. workStatus: props.userInfo.workStatus === "1" ? "0" : "1"
  7999. }
  8000. };
  8001. formatAppLog("log", "at components/nav-bar/nav-bar.vue:85", "params.data.workStatus", params2);
  8002. const { data: res } = await updateWorkStatus(params2);
  8003. if (res.code === 200) {
  8004. uni.setStorageSync("workStatus", params2.data.workStatus);
  8005. emit("updateUser", params2.data.workStatus);
  8006. }
  8007. emit("updateUser", props.userInfo.workStatus);
  8008. }
  8009. };
  8010. const handleScanbara = () => {
  8011. uni.scanCode({
  8012. scanType: ["barCode"],
  8013. success: function(res) {
  8014. formatAppLog("log", "at components/nav-bar/nav-bar.vue:101", "条码类型:" + res.scanType);
  8015. formatAppLog("log", "at components/nav-bar/nav-bar.vue:102", "条码内容:" + res.result);
  8016. if (res.result) {
  8017. uni.navigateTo({
  8018. url: `/pages/review/review?preNo=${res.result}&depolyStatus=2`
  8019. });
  8020. }
  8021. }
  8022. });
  8023. };
  8024. const handleLogout = async () => {
  8025. formatAppLog("log", "at components/nav-bar/nav-bar.vue:113", "handleLogout", 555);
  8026. const tokens = uni.getStorageSync("token");
  8027. const userId = uni.getStorageSync("userId");
  8028. const params2 = {
  8029. token: tokens,
  8030. data: {
  8031. pharmacistUserId: userId,
  8032. onlineStatus: 1
  8033. }
  8034. };
  8035. await updateOnlineStatus(params2);
  8036. uni.redirectTo({
  8037. url: "/pages/login/login"
  8038. });
  8039. };
  8040. return (_ctx, _cache) => {
  8041. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$3);
  8042. const _component_uni_popup_dialog = resolveEasycom(vue.resolveDynamicComponent("uni-popup-dialog"), __easycom_4);
  8043. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_5);
  8044. return vue.openBlock(), vue.createElementBlock(
  8045. vue.Fragment,
  8046. null,
  8047. [
  8048. vue.createElementVNode("view", { class: "nav" }, [
  8049. vue.createElementVNode("view", { class: "navbar" }, [
  8050. vue.createElementVNode("button", {
  8051. class: "scanbara",
  8052. onClick: handleScanbara
  8053. }, "复核扫码"),
  8054. vue.createElementVNode(
  8055. "view",
  8056. { class: "status" },
  8057. vue.toDisplayString(props.userInfo.workStatus === "0" ? "接单中" : "暂停接单"),
  8058. 1
  8059. /* TEXT */
  8060. ),
  8061. vue.createElementVNode("view", { class: "userinfo" }, [
  8062. vue.createElementVNode(
  8063. "button",
  8064. {
  8065. class: "lef",
  8066. onClick: dialogToggle
  8067. },
  8068. vue.toDisplayString(props.userInfo.workStatus === "0" ? "暂停接单" : "开始接单"),
  8069. 1
  8070. /* TEXT */
  8071. ),
  8072. vue.createElementVNode("image", {
  8073. class: "mid",
  8074. aspectFill: "",
  8075. src: "https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/cat-1.png"
  8076. }),
  8077. vue.createElementVNode("view", { class: "rig" }, [
  8078. vue.createElementVNode(
  8079. "text",
  8080. { class: "name" },
  8081. vue.toDisplayString(props.userInfo.name ? props.userInfo.name : "张三三"),
  8082. 1
  8083. /* TEXT */
  8084. ),
  8085. vue.createElementVNode("view", {
  8086. size: "mini",
  8087. onClick: handleLogout,
  8088. class: "logout"
  8089. }, [
  8090. vue.createTextVNode("退出"),
  8091. vue.createVNode(_component_uni_icons, {
  8092. class: "item",
  8093. type: "forward",
  8094. color: "#ff",
  8095. size: "16"
  8096. })
  8097. ])
  8098. ])
  8099. ])
  8100. ])
  8101. ]),
  8102. props.userInfo.workStatus === "0" ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  8103. vue.createVNode(
  8104. _component_uni_popup,
  8105. {
  8106. ref: "alertDialog",
  8107. type: "dialog"
  8108. },
  8109. {
  8110. default: vue.withCtx(() => [
  8111. vue.createVNode(_component_uni_popup_dialog, {
  8112. type: "center",
  8113. cancelText: "取消",
  8114. confirmText: "同意",
  8115. title: "温馨提示",
  8116. content: "你确定要暂停接单吗?",
  8117. onConfirm: dialogConfirm,
  8118. onClose: dialogClose
  8119. })
  8120. ]),
  8121. _: 1
  8122. /* STABLE */
  8123. },
  8124. 512
  8125. /* NEED_PATCH */
  8126. )
  8127. ])) : (vue.openBlock(), vue.createElementBlock("view", { key: 1 }, [
  8128. vue.createVNode(
  8129. _component_uni_popup,
  8130. {
  8131. ref: "alertDialog",
  8132. type: "dialog"
  8133. },
  8134. {
  8135. default: vue.withCtx(() => [
  8136. vue.createVNode(_component_uni_popup_dialog, {
  8137. type: "center",
  8138. cancelText: "取消",
  8139. confirmText: "同意",
  8140. title: "温馨提示",
  8141. content: "你确定要开始接单吗?",
  8142. onConfirm: dialogConfirm,
  8143. onClose: dialogClose
  8144. })
  8145. ]),
  8146. _: 1
  8147. /* STABLE */
  8148. },
  8149. 512
  8150. /* NEED_PATCH */
  8151. )
  8152. ]))
  8153. ],
  8154. 64
  8155. /* STABLE_FRAGMENT */
  8156. );
  8157. };
  8158. }
  8159. });
  8160. const NavBar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-e9345f2e"], ["__file", "/Users/sunwubin/source/pharmacy/components/nav-bar/nav-bar.vue"]]);
  8161. const __default__$3 = {
  8162. name: "OrderCard"
  8163. };
  8164. const _sfc_main$b = /* @__PURE__ */ Object.assign(__default__$3, {
  8165. props: {
  8166. v: {
  8167. default: function() {
  8168. return {
  8169. name: "",
  8170. deployState: 0,
  8171. preNo: ""
  8172. };
  8173. },
  8174. type: Object
  8175. },
  8176. // 当前tab
  8177. c: {
  8178. default: 0,
  8179. type: Number
  8180. }
  8181. },
  8182. setup(__props) {
  8183. const props = __props;
  8184. formatAppLog("log", "at components/order-card/order-card.vue:67", "props.v", props.v);
  8185. const deployStateName = vue.computed(() => {
  8186. switch (props.v.deployState) {
  8187. case "1":
  8188. return "抓药";
  8189. case "2":
  8190. return "复核";
  8191. case "3":
  8192. return "浸泡";
  8193. case "4":
  8194. return "煎煮";
  8195. case "5":
  8196. return "打包";
  8197. default:
  8198. return "异常状态";
  8199. }
  8200. });
  8201. const handleDetail = () => {
  8202. formatAppLog("log", "at components/order-card/order-card.vue:86", "handleDetail", props.v, props.c);
  8203. if (props.c === 0) {
  8204. uni.navigateTo({
  8205. url: `/pages/edit/edit?id=${props.v.id}`
  8206. // url:`/pages/review/review?id=&preNo=${props.v.preNo}&deployState=${props.v.deployState}`
  8207. });
  8208. } else {
  8209. uni.navigateTo({
  8210. url: `/pages/detail/detail?id=${props.v.id}`
  8211. });
  8212. }
  8213. };
  8214. return (_ctx, _cache) => {
  8215. return vue.openBlock(), vue.createElementBlock("view", {
  8216. class: "container",
  8217. onClick: handleDetail
  8218. }, [
  8219. vue.createElementVNode("view", { class: "t" }, [
  8220. vue.createElementVNode("view", { class: "d1" }),
  8221. vue.createElementVNode("view", { class: "d2" }, [
  8222. vue.createElementVNode(
  8223. "view",
  8224. { class: "dtim" },
  8225. "时间:" + vue.toDisplayString(props.v.prescriptionTime),
  8226. 1
  8227. /* TEXT */
  8228. )
  8229. ]),
  8230. vue.createElementVNode("view", { class: "d3" }, [
  8231. vue.createElementVNode(
  8232. "view",
  8233. { class: "presno" },
  8234. "处方号:" + vue.toDisplayString(props.v.preNo),
  8235. 1
  8236. /* TEXT */
  8237. )
  8238. ]),
  8239. vue.createElementVNode("view", { class: "d4" }, [
  8240. vue.createElementVNode(
  8241. "view",
  8242. {
  8243. class: vue.normalizeClass(["source", { "zy": props.v.preMzZy === "1" }])
  8244. },
  8245. vue.toDisplayString(props.v.preMzZy === "1" ? "门诊" : "住院"),
  8246. 3
  8247. /* TEXT, CLASS */
  8248. )
  8249. ])
  8250. ]),
  8251. vue.createElementVNode("view", { class: "m" }, [
  8252. vue.createElementVNode("image", {
  8253. class: "faceu",
  8254. aspectFill: "",
  8255. src: props.v.sex === "男" ? "/static/hz.png" : "/static/hy.png"
  8256. }, null, 8, ["src"]),
  8257. vue.createElementVNode("view", { class: "patie" }, [
  8258. vue.createElementVNode(
  8259. "view",
  8260. { class: "name" },
  8261. vue.toDisplayString(props.v.name),
  8262. 1
  8263. /* TEXT */
  8264. ),
  8265. vue.createElementVNode("view", { class: "seage" }, [
  8266. vue.createElementVNode("image", {
  8267. class: "img",
  8268. aspectFill: "",
  8269. src: props.v.sex === "男" ? "/static/male.png" : "/static/female.png"
  8270. }, null, 8, ["src"]),
  8271. vue.createElementVNode(
  8272. "view",
  8273. { class: "sex" },
  8274. vue.toDisplayString(props.v.sex),
  8275. 1
  8276. /* TEXT */
  8277. ),
  8278. vue.createElementVNode("view", { class: "sep" }, "|"),
  8279. vue.createElementVNode(
  8280. "view",
  8281. { class: "age" },
  8282. vue.toDisplayString(__props.v.age) + "岁",
  8283. 1
  8284. /* TEXT */
  8285. )
  8286. ]),
  8287. vue.createElementVNode(
  8288. "view",
  8289. { class: "case" },
  8290. vue.toDisplayString(props.v.disName) + " - " + vue.toDisplayString(props.v.symName),
  8291. 1
  8292. /* TEXT */
  8293. )
  8294. ]),
  8295. vue.createElementVNode("view", { class: "pres" }, [
  8296. vue.createElementVNode(
  8297. "view",
  8298. { class: "department" },
  8299. "就诊科室:" + vue.toDisplayString(props.v.department),
  8300. 1
  8301. /* TEXT */
  8302. ),
  8303. vue.createElementVNode("view", { class: "presInfo" }, [
  8304. vue.createTextVNode(" 处方信息: "),
  8305. vue.createElementVNode(
  8306. "text",
  8307. { class: "tips" },
  8308. vue.toDisplayString(props.v.dosageForm) + "," + vue.toDisplayString(props.v.number) + "剂 ",
  8309. 1
  8310. /* TEXT */
  8311. )
  8312. ])
  8313. ])
  8314. ]),
  8315. vue.createElementVNode("view", { class: "b" }, [
  8316. vue.createElementVNode(
  8317. "view",
  8318. { class: "zt" },
  8319. "当前处方状态: " + vue.toDisplayString(vue.unref(deployStateName)),
  8320. 1
  8321. /* TEXT */
  8322. ),
  8323. vue.createElementVNode(
  8324. "view",
  8325. { class: "je" },
  8326. "处方金额:" + vue.toDisplayString(props.v.prescriptionSum) + "元",
  8327. 1
  8328. /* TEXT */
  8329. )
  8330. ])
  8331. ]);
  8332. };
  8333. }
  8334. });
  8335. const OrderCard = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-1ab9fcf6"], ["__file", "/Users/sunwubin/source/pharmacy/components/order-card/order-card.vue"]]);
  8336. const _sfc_main$a = {
  8337. __name: "index",
  8338. setup(__props) {
  8339. const userInfo = vue.ref({});
  8340. const searchVal = vue.ref("");
  8341. const tabList = vue.ref([
  8342. { title: "今日待完成", status: 0 },
  8343. { title: "历史处方", status: 1 }
  8344. ]);
  8345. const currentStatus = vue.ref(0);
  8346. const tabActive = vue.ref(0);
  8347. const tabName = vue.ref("今日待完成");
  8348. const orderList = vue.ref([
  8349. { id: 1, prescriptionTime: "2023-07-06 14:54", faceurl: "/static/hz.png", name: "张三三", sex: "女", age: 23, disName: "胃脘痛病", symName: "脾胃虚寒证", deployState: "调配", preNo: 10230516091026, department: "中医内科", dosageForm: "汤剂", number: 3, prescriptionSum: 135.62, preMzZy: "1" },
  8350. { id: 2, prescriptionTime: "2023-07-06 14:54", faceurl: "/static/hz.png", name: "张三三", sex: "女", age: 23, disName: "胃脘痛病", symName: "脾胃虚寒证", deployState: "调配", preNo: 10230516091026, department: "中医内科", dosageForm: "汤剂", number: 3, prescriptionSum: 135.62, preMzZy: "1" },
  8351. { id: 3, prescriptionTime: "2023-07-06 14:54", faceurl: "/static/hz.png", name: "张三三", sex: "女", age: 23, disName: "胃脘痛病", symName: "脾胃虚寒证", deployState: "调配", preNo: 10230516091026, department: "中医内科", dosageForm: "汤剂", number: 3, prescriptionSum: 135.62, preMzZy: "2" },
  8352. { id: 4, prescriptionTime: "2023-07-06 14:54", faceurl: "/static/hz.png", name: "张三三", sex: "女", age: 23, disName: "胃脘痛病", symName: "脾胃虚寒证", deployState: "调配", preNo: 10230516091026, department: "中医内科", dosageForm: "汤剂", number: 3, prescriptionSum: 135.62, preMzZy: "1" },
  8353. { id: 5, prescriptionTime: "2023-07-06 14:54", faceurl: "/static/hz.png", name: "张三三", sex: "女", age: 23, disName: "胃脘痛病", symName: "脾胃虚寒证", deployState: "调配", preNo: 10230516091026, department: "中医内科", dosageForm: "汤剂", number: 3, prescriptionSum: 135.62, preMzZy: "2" }
  8354. ]);
  8355. const isBottom = vue.ref(false);
  8356. const officeArr = vue.ref(["全部", "中医骨伤科门诊一", "中医内科门诊一", "中医儿科门诊"]);
  8357. const officeIndex = vue.ref(0);
  8358. const typeArr = vue.ref(["姓名:", "处方号:"]);
  8359. const typeIndex = vue.ref(0);
  8360. const searchTime = vue.ref([]);
  8361. const searchDepartment = vue.ref("");
  8362. const searchName = vue.ref("");
  8363. const searchPreNo = vue.ref("");
  8364. const searchSex = vue.ref("");
  8365. const searchPreMzZy = vue.ref("");
  8366. const searchStatus = vue.ref("");
  8367. const searchTags = vue.ref([]);
  8368. const tags = vue.ref(["全部", "门诊", "住院", "男", "女", "煎煮", "发药"]);
  8369. vue.ref([
  8370. { name: "抓药", id: "1" },
  8371. { name: "复核", id: "2" },
  8372. { name: "浸泡", id: "3" },
  8373. { name: "煎煮", id: "4" },
  8374. { name: "打包", id: "5" }
  8375. ]);
  8376. const page = vue.ref(0);
  8377. const total = vue.ref(0);
  8378. const pageSize = vue.ref(10);
  8379. vue.ref("");
  8380. vue.getCurrentInstance();
  8381. vue.onMounted(() => {
  8382. });
  8383. onLoad(async () => {
  8384. const token2 = uni.getStorageSync("token");
  8385. userInfo.value.name = uni.getStorageSync("username");
  8386. userInfo.value.workStatus = uni.getStorageSync("workStatus");
  8387. const params2 = {
  8388. token: token2,
  8389. data: JSON.stringify({
  8390. currentUserId: parseInt(uni.getStorageSync("userId")) || 0,
  8391. page: page.value,
  8392. pageSize: pageSize.value,
  8393. status: currentStatus.value
  8394. })
  8395. };
  8396. const { data: res } = await receiveOrderList(params2);
  8397. if (res.code === 200) {
  8398. total.value = res.total;
  8399. orderList.value = res.rows;
  8400. }
  8401. });
  8402. const updateUser = (v2) => {
  8403. formatAppLog("log", "at pages/index/index.vue:192", "updateUserStatus", v2);
  8404. userInfo.value.workStatus = v2;
  8405. };
  8406. const updateList = (v2) => {
  8407. formatAppLog("log", "at pages/index/index.vue:197", "updateList", v2);
  8408. };
  8409. const handleSearch = async () => {
  8410. const token2 = uni.getStorageSync("token");
  8411. formatAppLog("log", "at pages/index/index.vue:202", "handleSearch token", token2);
  8412. formatAppLog("log", "at pages/index/index.vue:203", "handleSearch searchVal", searchVal.value);
  8413. formatAppLog("log", "at pages/index/index.vue:204", "currentStatus.value", currentStatus.value);
  8414. searchVal.value = searchVal.value.trim();
  8415. if (currentStatus.value === 0 && searchVal.value) {
  8416. const params2 = {
  8417. token: token2,
  8418. data: JSON.stringify({
  8419. currentUserId: parseInt(uni.getStorageSync("userId")) || 0,
  8420. name: searchVal.value,
  8421. page: page.value,
  8422. pageSize: pageSize.value,
  8423. status: currentStatus.value
  8424. })
  8425. };
  8426. const { data: res } = await receiveOrderList(params2);
  8427. if (res.code === 200) {
  8428. total.value = res.total;
  8429. orderList.value = res.rows;
  8430. }
  8431. }
  8432. if (currentStatus.value === 1) {
  8433. const params2 = {
  8434. token: token2,
  8435. data: JSON.stringify({
  8436. currentUserId: parseInt(uni.getStorageSync("userId")) || 0,
  8437. startTime: searchTime.value[0] || "",
  8438. endTime: searchTime.value[1] || "",
  8439. name: searchVal.value || "",
  8440. preNo: searchPreNo.value || "",
  8441. prescriptionStatus: searchStatus.value || "",
  8442. sex: searchSex.value || "",
  8443. preMzZy: searchPreMzZy.value || "",
  8444. page: page.value,
  8445. pageSize: pageSize.value,
  8446. status: currentStatus.value || 0
  8447. })
  8448. };
  8449. formatAppLog("log", "at pages/index/index.vue:240", "params", params2);
  8450. const { data: res } = await receiveOrderList(params2);
  8451. if (res.code === 200) {
  8452. total.value = res.total;
  8453. orderList.value = res.rows;
  8454. }
  8455. }
  8456. };
  8457. const handleRefresh = async () => {
  8458. formatAppLog("log", "at pages/index/index.vue:251", "yijianshifang >orderList>>", orderList.value);
  8459. let ids = "";
  8460. orderList.value.forEach((v2) => {
  8461. if (v2.id) {
  8462. ids = ids + v2.id + ",";
  8463. formatAppLog("log", "at pages/index/index.vue:255", "yijianshifang >orderList>>", ids);
  8464. }
  8465. });
  8466. formatAppLog("log", "at pages/index/index.vue:258", "yijianshifang >orderList>>666", ids);
  8467. const params2 = {
  8468. token: uni.getStorageSync("token"),
  8469. data: { ids }
  8470. };
  8471. const { data: res } = await releaseOrder(params2);
  8472. if (res.code === 200) {
  8473. params2 = {
  8474. token,
  8475. data: JSON.stringify({
  8476. currentUserId: parseInt(uni.getStorageSync("userId")),
  8477. page: page.value,
  8478. pageSize: pageSize.value,
  8479. status: currentStatus.value
  8480. })
  8481. };
  8482. const { data: res2 } = await receiveOrderList(params2);
  8483. if (res2.code === 200) {
  8484. total.value = res2.total;
  8485. orderList.value = res2.rows;
  8486. }
  8487. }
  8488. };
  8489. const handleGetOffice = (e2) => {
  8490. formatAppLog("log", "at pages/index/index.vue:284", "handleGetOffice", e2.detail.value);
  8491. formatAppLog("log", "at pages/index/index.vue:285", "officeIndex", officeIndex);
  8492. formatAppLog("log", "at pages/index/index.vue:286", "officeIndex", officeIndex);
  8493. officeIndex.value = e2.detail.value;
  8494. };
  8495. const handleGetType = (e2) => {
  8496. formatAppLog("log", "at pages/index/index.vue:291", "handleGetType", e2.detail.value);
  8497. formatAppLog("log", "at pages/index/index.vue:292", "typeIndex", typeIndex);
  8498. formatAppLog("log", "at pages/index/index.vue:293", "typeArr", typeIndex);
  8499. typeIndex.value = e2.detail.value;
  8500. if (typeIndex.value === 1) {
  8501. searchName.value = "";
  8502. } else {
  8503. searchPreNo.value = "";
  8504. }
  8505. };
  8506. const handleGetTags = (v2) => {
  8507. formatAppLog("log", "at pages/index/index.vue:303", "handleGetTags", v2);
  8508. if (!searchTags.value.includes(v2)) {
  8509. searchTags.value.push(v2);
  8510. } else {
  8511. searchTags.value.splice(searchTags.value.indexOf(v2), 1);
  8512. }
  8513. switch (v2) {
  8514. case "全部":
  8515. if (searchTags.value.includes(v2)) {
  8516. searchTags.value = ["全部"];
  8517. searchTime.value = [];
  8518. searchDepartment.value = "";
  8519. searchName.value = "";
  8520. searchPreNo.value = "";
  8521. searchSex.value = "";
  8522. searchPreMzZy.value = "";
  8523. searchStatus.value = "";
  8524. }
  8525. break;
  8526. case "门诊":
  8527. if (searchTags.value.includes(v2) && searchTags.value.includes("住院")) {
  8528. searchTags.value.splice(searchTags.value.indexOf("住院"), 1);
  8529. }
  8530. if (searchTags.value.includes("全部")) {
  8531. searchTags.value.splice(searchTags.value.indexOf("全部"), 1);
  8532. }
  8533. searchPreMzZy.value = "1";
  8534. break;
  8535. case "住院":
  8536. if (searchTags.value.includes(v2) && searchTags.value.includes("门诊")) {
  8537. searchTags.value.splice(searchTags.value.indexOf("门诊"), 1);
  8538. }
  8539. if (searchTags.value.includes("全部")) {
  8540. searchTags.value.splice(searchTags.value.indexOf("全部"), 1);
  8541. }
  8542. searchPreMzZy.value = "2";
  8543. break;
  8544. case "男":
  8545. if (searchTags.value.includes(v2) && searchTags.value.includes("女")) {
  8546. searchTags.value.splice(searchTags.value.indexOf("女"), 1);
  8547. }
  8548. if (searchTags.value.includes("全部")) {
  8549. searchTags.value.splice(searchTags.value.indexOf("全部"), 1);
  8550. }
  8551. searchSex.value = "男";
  8552. break;
  8553. case "女":
  8554. if (searchTags.value.includes(v2) && searchTags.value.includes("男")) {
  8555. searchTags.value.splice(searchTags.value.indexOf("男"), 1);
  8556. }
  8557. if (searchTags.value.includes("全部")) {
  8558. searchTags.value.splice(searchTags.value.indexOf("全部"), 1);
  8559. }
  8560. searchSex.value = "女";
  8561. break;
  8562. case "煎煮":
  8563. if (searchTags.value.includes(v2) && searchTags.value.includes("发药")) {
  8564. searchTags.value.splice(searchTags.value.indexOf("发药"), 1);
  8565. }
  8566. if (searchTags.value.includes("全部")) {
  8567. searchTags.value.splice(searchTags.value.indexOf("全部"), 1);
  8568. }
  8569. searchStatus.value = "煎煮";
  8570. break;
  8571. case "发药":
  8572. if (searchTags.value.includes(v2) && searchTags.value.includes("煎煮")) {
  8573. searchTags.value.splice(searchTags.value.indexOf("煎煮"), 1);
  8574. }
  8575. if (searchTags.value.includes("全部")) {
  8576. searchTags.value.splice(searchTags.value.indexOf("全部"), 1);
  8577. }
  8578. searchStatus.value = "发药";
  8579. break;
  8580. default:
  8581. searchTags.value = ["全部"];
  8582. }
  8583. };
  8584. const checkIndex = async (index) => {
  8585. tabActive.value = index;
  8586. tabName.value = tabList.value[index].title;
  8587. currentStatus.value = parseInt(tabList.value[index].status);
  8588. const token2 = uni.getStorageSync("token");
  8589. const params2 = {
  8590. token: token2,
  8591. data: {
  8592. status: currentStatus.value,
  8593. page: page.value,
  8594. pageSize: pageSize.value
  8595. }
  8596. };
  8597. formatAppLog("log", "at pages/index/index.vue:395", "checkIndex params", params2);
  8598. const { data: res } = await receiveOrderList(params2);
  8599. if (res.code === 200) {
  8600. total.value = res.total;
  8601. orderList.value = res.rows;
  8602. }
  8603. };
  8604. return (_ctx, _cache) => {
  8605. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$2);
  8606. const _component_uni_datetime_picker = resolveEasycom(vue.resolveDynamicComponent("uni-datetime-picker"), __easycom_1$1);
  8607. const _component_uni_tag = resolveEasycom(vue.resolveDynamicComponent("uni-tag"), __easycom_2);
  8608. return vue.openBlock(), vue.createElementBlock("view", { class: "main" }, [
  8609. vue.createVNode(NavBar, {
  8610. "user-info": userInfo.value,
  8611. onUpdateUser: updateUser
  8612. }, null, 8, ["user-info"]),
  8613. vue.createElementVNode("view", { class: "body" }, [
  8614. vue.createElementVNode("view", { class: "tab-box" }, [
  8615. vue.createElementVNode("view", { class: "tab-bar" }, [
  8616. (vue.openBlock(true), vue.createElementBlock(
  8617. vue.Fragment,
  8618. null,
  8619. vue.renderList(tabList.value, (tab, index) => {
  8620. return vue.openBlock(), vue.createElementBlock("view", {
  8621. class: vue.normalizeClass(["tab_item", { "active": tabActive.value == index }]),
  8622. key: index,
  8623. onClick: ($event) => checkIndex(index)
  8624. }, [
  8625. vue.createElementVNode(
  8626. "text",
  8627. { class: "text" },
  8628. vue.toDisplayString(tab.title) + vue.toDisplayString(index === 0 ? "(" + orderList.value.length + ")" : ""),
  8629. 1
  8630. /* TEXT */
  8631. )
  8632. ], 10, ["onClick"]);
  8633. }),
  8634. 128
  8635. /* KEYED_FRAGMENT */
  8636. ))
  8637. ]),
  8638. vue.createElementVNode("view", { class: "search-bar" }, [
  8639. tabActive.value === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  8640. key: 0,
  8641. class: "today"
  8642. }, [
  8643. vue.createElementVNode("view", { class: "search" }, [
  8644. vue.createVNode(_component_uni_easyinput, {
  8645. prefixIcon: "search",
  8646. modelValue: searchVal.value,
  8647. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchVal.value = $event),
  8648. placeholder: "请输入姓名"
  8649. }, null, 8, ["modelValue"])
  8650. ]),
  8651. vue.createElementVNode("button", {
  8652. type: "primary",
  8653. onClick: handleSearch,
  8654. class: "search-button"
  8655. }, "搜索"),
  8656. vue.createElementVNode("button", {
  8657. type: "primary",
  8658. disabled: userInfo.value.workStatus === "1" ? false : true,
  8659. onClick: handleRefresh,
  8660. class: vue.normalizeClass(userInfo.value.workStatus === "1" ? "refresh" : "refresh active")
  8661. }, "一键释放", 10, ["disabled"])
  8662. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  8663. key: 1,
  8664. class: "history"
  8665. }, [
  8666. vue.createElementVNode("view", { class: "searchchoice" }, [
  8667. vue.createElementVNode("view", { class: "row1" }, [
  8668. vue.createElementVNode("view", { class: "timequan" }, [
  8669. vue.createElementVNode("text", { class: "time_t" }, "时间区间:"),
  8670. vue.createVNode(_component_uni_datetime_picker, {
  8671. modelValue: searchTime.value,
  8672. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchTime.value = $event),
  8673. type: "datetimerange",
  8674. "hide-second": true,
  8675. class: "datepick",
  8676. rangeSeparator: " - "
  8677. }, null, 8, ["modelValue"]),
  8678. vue.createCommentVNode(` <timeSlot
  8679. ref="timeslot"
  8680. :title="'选择时间段'"
  8681. @confirm="confirmTime">
  8682. </timeSlot> `),
  8683. vue.createCommentVNode(' <el-date-picker\n v-model="searchTime"\n type="datetimerange"\n range-separator="-"\n start-placeholder="开始时间"\n end-placeholder="结束时间"\n /> ')
  8684. ])
  8685. ]),
  8686. vue.createElementVNode("view", { class: "row2" }, [
  8687. vue.createElementVNode("view", { class: "office" }, [
  8688. vue.createElementVNode("view", { class: "time_t" }, " 科室: "),
  8689. vue.createElementVNode("picker", {
  8690. onChange: handleGetOffice,
  8691. value: officeIndex.value,
  8692. range: officeArr.value
  8693. }, [
  8694. vue.createElementVNode(
  8695. "view",
  8696. { class: "uni-input" },
  8697. vue.toDisplayString(officeArr.value[officeIndex.value]),
  8698. 1
  8699. /* TEXT */
  8700. )
  8701. ], 40, ["value", "range"])
  8702. ]),
  8703. vue.createElementVNode("view", { class: "presid" }, [
  8704. vue.createElementVNode("picker", {
  8705. onChange: handleGetType,
  8706. value: typeIndex.value,
  8707. range: typeArr.value
  8708. }, [
  8709. vue.createElementVNode(
  8710. "view",
  8711. { class: "uni-input" },
  8712. vue.toDisplayString(typeArr.value[typeIndex.value]),
  8713. 1
  8714. /* TEXT */
  8715. )
  8716. ], 40, ["value", "range"])
  8717. ]),
  8718. typeIndex.value === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  8719. key: 0,
  8720. class: "search"
  8721. }, [
  8722. vue.createVNode(_component_uni_easyinput, {
  8723. prefixIcon: "search",
  8724. modelValue: searchName.value,
  8725. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchName.value = $event),
  8726. placeholder: "请输入姓名"
  8727. }, null, 8, ["modelValue"])
  8728. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  8729. key: 1,
  8730. class: "search"
  8731. }, [
  8732. vue.createVNode(_component_uni_easyinput, {
  8733. prefixIcon: "search",
  8734. modelValue: searchPreNo.value,
  8735. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => searchPreNo.value = $event),
  8736. placeholder: "请输入处方号"
  8737. }, null, 8, ["modelValue"])
  8738. ])),
  8739. vue.createElementVNode("button", {
  8740. type: "primary",
  8741. onClick: handleSearch,
  8742. class: "search-button"
  8743. }, "搜索")
  8744. ]),
  8745. vue.createElementVNode("view", { class: "row3" }, [
  8746. (vue.openBlock(true), vue.createElementBlock(
  8747. vue.Fragment,
  8748. null,
  8749. vue.renderList(tags.value, (v2, i2) => {
  8750. return vue.openBlock(), vue.createElementBlock("view", {
  8751. class: "tag-view",
  8752. key: i2
  8753. }, [
  8754. vue.createVNode(_component_uni_tag, {
  8755. circle: true,
  8756. inverted: !searchTags.value.includes(v2),
  8757. text: v2,
  8758. onClick: ($event) => handleGetTags(v2)
  8759. }, null, 8, ["inverted", "text", "onClick"])
  8760. ]);
  8761. }),
  8762. 128
  8763. /* KEYED_FRAGMENT */
  8764. ))
  8765. ])
  8766. ])
  8767. ]))
  8768. ])
  8769. ]),
  8770. vue.createElementVNode("view", { class: "tab-content" }, [
  8771. vue.createElementVNode("view", { class: "order-list" }, [
  8772. orderList.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
  8773. key: 0,
  8774. class: "order-list-wrap",
  8775. "scroll-y": "true",
  8776. "scroll-top": 50
  8777. }, [
  8778. (vue.openBlock(true), vue.createElementBlock(
  8779. vue.Fragment,
  8780. null,
  8781. vue.renderList(orderList.value, (v2, i2) => {
  8782. return vue.openBlock(), vue.createElementBlock(
  8783. vue.Fragment,
  8784. { key: i2 },
  8785. [
  8786. v2 ? (vue.openBlock(), vue.createBlock(OrderCard, {
  8787. key: 0,
  8788. v: v2,
  8789. index: i2,
  8790. c: tabActive.value,
  8791. class: "order-card",
  8792. onUpdateList: updateList
  8793. }, null, 8, ["v", "index", "c"])) : vue.createCommentVNode("v-if", true)
  8794. ],
  8795. 64
  8796. /* STABLE_FRAGMENT */
  8797. );
  8798. }),
  8799. 128
  8800. /* KEYED_FRAGMENT */
  8801. ))
  8802. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  8803. key: 1,
  8804. class: "text"
  8805. }, [
  8806. vue.createElementVNode("image", {
  8807. class: "zwsj",
  8808. aspectFill: "",
  8809. src: "/static/zwsj.png"
  8810. }, null, 8, ["src"])
  8811. ]))
  8812. ]),
  8813. isBottom.value ? (vue.openBlock(), vue.createElementBlock("view", {
  8814. key: 0,
  8815. class: "order-bottom"
  8816. }, [
  8817. vue.createElementVNode("view", { class: "text" }, "-- 没有更多数据 --")
  8818. ])) : vue.createCommentVNode("v-if", true)
  8819. ])
  8820. ])
  8821. ]);
  8822. };
  8823. }
  8824. };
  8825. const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "/Users/sunwubin/source/pharmacy/pages/index/index.vue"]]);
  8826. const _sfc_main$9 = {
  8827. name: "UniStatusBar",
  8828. data() {
  8829. return {
  8830. statusBarHeight: uni.getSystemInfoSync().statusBarHeight + "px"
  8831. };
  8832. }
  8833. };
  8834. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  8835. return vue.openBlock(), vue.createElementBlock(
  8836. "view",
  8837. {
  8838. style: vue.normalizeStyle({ height: $data.statusBarHeight }),
  8839. class: "uni-status-bar"
  8840. },
  8841. [
  8842. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  8843. ],
  8844. 4
  8845. /* STYLE */
  8846. );
  8847. }
  8848. const statusBar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$4], ["__scopeId", "data-v-7920e3e0"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar.vue"]]);
  8849. const getVal = (val) => typeof val === "number" ? val + "px" : val;
  8850. const _sfc_main$8 = {
  8851. name: "UniNavBar",
  8852. components: {
  8853. statusBar
  8854. },
  8855. emits: ["clickLeft", "clickRight", "clickTitle"],
  8856. props: {
  8857. dark: {
  8858. type: Boolean,
  8859. default: false
  8860. },
  8861. title: {
  8862. type: String,
  8863. default: ""
  8864. },
  8865. leftText: {
  8866. type: String,
  8867. default: ""
  8868. },
  8869. rightText: {
  8870. type: String,
  8871. default: ""
  8872. },
  8873. leftIcon: {
  8874. type: String,
  8875. default: ""
  8876. },
  8877. rightIcon: {
  8878. type: String,
  8879. default: ""
  8880. },
  8881. fixed: {
  8882. type: [Boolean, String],
  8883. default: false
  8884. },
  8885. color: {
  8886. type: String,
  8887. default: ""
  8888. },
  8889. backgroundColor: {
  8890. type: String,
  8891. default: ""
  8892. },
  8893. statusBar: {
  8894. type: [Boolean, String],
  8895. default: false
  8896. },
  8897. shadow: {
  8898. type: [Boolean, String],
  8899. default: false
  8900. },
  8901. border: {
  8902. type: [Boolean, String],
  8903. default: true
  8904. },
  8905. height: {
  8906. type: [Number, String],
  8907. default: 44
  8908. },
  8909. leftWidth: {
  8910. type: [Number, String],
  8911. default: 60
  8912. },
  8913. rightWidth: {
  8914. type: [Number, String],
  8915. default: 60
  8916. },
  8917. stat: {
  8918. type: [Boolean, String],
  8919. default: ""
  8920. }
  8921. },
  8922. computed: {
  8923. themeBgColor() {
  8924. if (this.dark) {
  8925. if (this.backgroundColor) {
  8926. return this.backgroundColor;
  8927. } else {
  8928. return this.dark ? "#333" : "#FFF";
  8929. }
  8930. }
  8931. return this.backgroundColor || "#FFF";
  8932. },
  8933. themeColor() {
  8934. if (this.dark) {
  8935. if (this.color) {
  8936. return this.color;
  8937. } else {
  8938. return this.dark ? "#fff" : "#333";
  8939. }
  8940. }
  8941. return this.color || "#333";
  8942. },
  8943. navbarHeight() {
  8944. return getVal(this.height);
  8945. },
  8946. leftIconWidth() {
  8947. return getVal(this.leftWidth);
  8948. },
  8949. rightIconWidth() {
  8950. return getVal(this.rightWidth);
  8951. }
  8952. },
  8953. mounted() {
  8954. if (uni.report && this.stat && this.title !== "") {
  8955. uni.report("title", this.title);
  8956. }
  8957. },
  8958. methods: {
  8959. onClickLeft() {
  8960. this.$emit("clickLeft");
  8961. },
  8962. onClickRight() {
  8963. this.$emit("clickRight");
  8964. },
  8965. onClickTitle() {
  8966. this.$emit("clickTitle");
  8967. }
  8968. }
  8969. };
  8970. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  8971. const _component_status_bar = vue.resolveComponent("status-bar");
  8972. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$3);
  8973. return vue.openBlock(), vue.createElementBlock(
  8974. "view",
  8975. {
  8976. class: vue.normalizeClass(["uni-navbar", { "uni-dark": $props.dark, "uni-nvue-fixed": $props.fixed }])
  8977. },
  8978. [
  8979. vue.createElementVNode(
  8980. "view",
  8981. {
  8982. class: vue.normalizeClass(["uni-navbar__content", { "uni-navbar--fixed": $props.fixed, "uni-navbar--shadow": $props.shadow, "uni-navbar--border": $props.border }]),
  8983. style: vue.normalizeStyle({ "background-color": $options.themeBgColor, "border-bottom-color": $options.themeColor })
  8984. },
  8985. [
  8986. $props.statusBar ? (vue.openBlock(), vue.createBlock(_component_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true),
  8987. vue.createElementVNode(
  8988. "view",
  8989. {
  8990. style: vue.normalizeStyle({ color: $options.themeColor, backgroundColor: $options.themeBgColor, height: $options.navbarHeight }),
  8991. class: "uni-navbar__header"
  8992. },
  8993. [
  8994. vue.createElementVNode(
  8995. "view",
  8996. {
  8997. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClickLeft && $options.onClickLeft(...args)),
  8998. class: "uni-navbar__header-btns uni-navbar__header-btns-left",
  8999. style: vue.normalizeStyle({ width: $options.leftIconWidth })
  9000. },
  9001. [
  9002. vue.renderSlot(_ctx.$slots, "left", {}, () => [
  9003. $props.leftIcon.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  9004. key: 0,
  9005. class: "uni-navbar__content_view"
  9006. }, [
  9007. vue.createVNode(_component_uni_icons, {
  9008. color: $options.themeColor,
  9009. type: $props.leftIcon,
  9010. size: "34"
  9011. }, null, 8, ["color", "type"])
  9012. ])) : vue.createCommentVNode("v-if", true),
  9013. $props.leftText.length ? (vue.openBlock(), vue.createElementBlock(
  9014. "view",
  9015. {
  9016. key: 1,
  9017. class: vue.normalizeClass([{ "uni-navbar-btn-icon-left": !$props.leftIcon.length > 0 }, "uni-navbar-btn-text"])
  9018. },
  9019. [
  9020. vue.createElementVNode(
  9021. "text",
  9022. {
  9023. style: vue.normalizeStyle({ color: $options.themeColor, fontSize: "34px" })
  9024. },
  9025. vue.toDisplayString($props.leftText),
  9026. 5
  9027. /* TEXT, STYLE */
  9028. )
  9029. ],
  9030. 2
  9031. /* CLASS */
  9032. )) : vue.createCommentVNode("v-if", true)
  9033. ], true)
  9034. ],
  9035. 4
  9036. /* STYLE */
  9037. ),
  9038. vue.createElementVNode("view", {
  9039. class: "uni-navbar__header-container",
  9040. onClick: _cache[1] || (_cache[1] = (...args) => $options.onClickTitle && $options.onClickTitle(...args))
  9041. }, [
  9042. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  9043. $props.title.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  9044. key: 0,
  9045. class: "uni-navbar__header-container-inner"
  9046. }, [
  9047. vue.createElementVNode(
  9048. "text",
  9049. {
  9050. class: "uni-nav-bar-text uni-ellipsis-1",
  9051. style: vue.normalizeStyle({ color: $options.themeColor })
  9052. },
  9053. vue.toDisplayString($props.title),
  9054. 5
  9055. /* TEXT, STYLE */
  9056. )
  9057. ])) : vue.createCommentVNode("v-if", true)
  9058. ], true)
  9059. ]),
  9060. vue.createElementVNode(
  9061. "view",
  9062. {
  9063. onClick: _cache[2] || (_cache[2] = (...args) => $options.onClickRight && $options.onClickRight(...args)),
  9064. class: "uni-navbar__header-btns uni-navbar__header-btns-right",
  9065. style: vue.normalizeStyle({ width: $options.rightIconWidth })
  9066. },
  9067. [
  9068. vue.renderSlot(_ctx.$slots, "right", {}, () => [
  9069. $props.rightIcon.length ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  9070. vue.createVNode(_component_uni_icons, {
  9071. color: $options.themeColor,
  9072. type: $props.rightIcon,
  9073. size: "22"
  9074. }, null, 8, ["color", "type"])
  9075. ])) : vue.createCommentVNode("v-if", true),
  9076. $props.rightText.length && !$props.rightIcon.length ? (vue.openBlock(), vue.createElementBlock("view", {
  9077. key: 1,
  9078. class: "uni-navbar-btn-text"
  9079. }, [
  9080. vue.createElementVNode(
  9081. "text",
  9082. {
  9083. class: "uni-nav-bar-right-text",
  9084. style: vue.normalizeStyle({ color: $options.themeColor })
  9085. },
  9086. vue.toDisplayString($props.rightText),
  9087. 5
  9088. /* TEXT, STYLE */
  9089. )
  9090. ])) : vue.createCommentVNode("v-if", true)
  9091. ], true)
  9092. ],
  9093. 4
  9094. /* STYLE */
  9095. )
  9096. ],
  9097. 4
  9098. /* STYLE */
  9099. )
  9100. ],
  9101. 6
  9102. /* CLASS, STYLE */
  9103. ),
  9104. $props.fixed ? (vue.openBlock(), vue.createElementBlock("view", {
  9105. key: 0,
  9106. class: "uni-navbar__placeholder"
  9107. }, [
  9108. $props.statusBar ? (vue.openBlock(), vue.createBlock(_component_status_bar, { key: 0 })) : vue.createCommentVNode("v-if", true),
  9109. vue.createElementVNode(
  9110. "view",
  9111. {
  9112. class: "uni-navbar__placeholder-view",
  9113. style: vue.normalizeStyle({ height: $options.navbarHeight })
  9114. },
  9115. null,
  9116. 4
  9117. /* STYLE */
  9118. )
  9119. ])) : vue.createCommentVNode("v-if", true)
  9120. ],
  9121. 2
  9122. /* CLASS */
  9123. );
  9124. }
  9125. const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$3], ["__scopeId", "data-v-26544265"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue"]]);
  9126. var __assign = function() {
  9127. return (__assign = Object.assign || function(t2) {
  9128. for (var e2, i2 = 1, r2 = arguments.length; i2 < r2; i2++)
  9129. for (var o2 in e2 = arguments[i2])
  9130. Object.prototype.hasOwnProperty.call(e2, o2) && (t2[o2] = e2[o2]);
  9131. return t2;
  9132. }).apply(this, arguments);
  9133. };
  9134. function __awaiter(t2, n2, h2, a2) {
  9135. return new (h2 = h2 || Promise)(function(i2, e2) {
  9136. function r2(t3) {
  9137. try {
  9138. s2(a2.next(t3));
  9139. } catch (t4) {
  9140. e2(t4);
  9141. }
  9142. }
  9143. function o2(t3) {
  9144. try {
  9145. s2(a2.throw(t3));
  9146. } catch (t4) {
  9147. e2(t4);
  9148. }
  9149. }
  9150. function s2(t3) {
  9151. var e3;
  9152. t3.done ? i2(t3.value) : ((e3 = t3.value) instanceof h2 ? e3 : new h2(function(t4) {
  9153. t4(e3);
  9154. })).then(r2, o2);
  9155. }
  9156. s2((a2 = a2.apply(t2, n2 || [])).next());
  9157. });
  9158. }
  9159. function __generator(i2, r2) {
  9160. var o2, s2, n2, h2 = { label: 0, sent: function() {
  9161. if (1 & n2[0])
  9162. throw n2[1];
  9163. return n2[1];
  9164. }, trys: [], ops: [] }, t2 = { next: e2(0), throw: e2(1), return: e2(2) };
  9165. return "function" == typeof Symbol && (t2[Symbol.iterator] = function() {
  9166. return this;
  9167. }), t2;
  9168. function e2(e3) {
  9169. return function(t3) {
  9170. return function(e4) {
  9171. if (o2)
  9172. throw new TypeError("Generator is already executing.");
  9173. for (; h2; )
  9174. try {
  9175. if (o2 = 1, s2 && (n2 = 2 & e4[0] ? s2.return : e4[0] ? s2.throw || ((n2 = s2.return) && n2.call(s2), 0) : s2.next) && !(n2 = n2.call(s2, e4[1])).done)
  9176. return n2;
  9177. switch (s2 = 0, (e4 = n2 ? [2 & e4[0], n2.value] : e4)[0]) {
  9178. case 0:
  9179. case 1:
  9180. n2 = e4;
  9181. break;
  9182. case 4:
  9183. return h2.label++, { value: e4[1], done: false };
  9184. case 5:
  9185. h2.label++, s2 = e4[1], e4 = [0];
  9186. continue;
  9187. case 7:
  9188. e4 = h2.ops.pop(), h2.trys.pop();
  9189. continue;
  9190. default:
  9191. if (!(n2 = 0 < (n2 = h2.trys).length && n2[n2.length - 1]) && (6 === e4[0] || 2 === e4[0])) {
  9192. h2 = 0;
  9193. continue;
  9194. }
  9195. if (3 === e4[0] && (!n2 || e4[1] > n2[0] && e4[1] < n2[3])) {
  9196. h2.label = e4[1];
  9197. break;
  9198. }
  9199. if (6 === e4[0] && h2.label < n2[1]) {
  9200. h2.label = n2[1], n2 = e4;
  9201. break;
  9202. }
  9203. if (n2 && h2.label < n2[2]) {
  9204. h2.label = n2[2], h2.ops.push(e4);
  9205. break;
  9206. }
  9207. n2[2] && h2.ops.pop(), h2.trys.pop();
  9208. continue;
  9209. }
  9210. e4 = r2.call(i2, h2);
  9211. } catch (t4) {
  9212. e4 = [6, t4], s2 = 0;
  9213. } finally {
  9214. o2 = n2 = 0;
  9215. }
  9216. if (5 & e4[0])
  9217. throw e4[1];
  9218. return { value: e4[0] ? e4[1] : void 0, done: true };
  9219. }([e3, t3]);
  9220. };
  9221. }
  9222. }
  9223. var PATTERNS = [[2, 1, 2, 2, 2, 2, 0, 0], [2, 2, 2, 1, 2, 2, 0, 0], [2, 2, 2, 2, 2, 1, 0, 0], [1, 2, 1, 2, 2, 3, 0, 0], [1, 2, 1, 3, 2, 2, 0, 0], [1, 3, 1, 2, 2, 2, 0, 0], [1, 2, 2, 2, 1, 3, 0, 0], [1, 2, 2, 3, 1, 2, 0, 0], [1, 3, 2, 2, 1, 2, 0, 0], [2, 2, 1, 2, 1, 3, 0, 0], [2, 2, 1, 3, 1, 2, 0, 0], [2, 3, 1, 2, 1, 2, 0, 0], [1, 1, 2, 2, 3, 2, 0, 0], [1, 2, 2, 1, 3, 2, 0, 0], [1, 2, 2, 2, 3, 1, 0, 0], [1, 1, 3, 2, 2, 2, 0, 0], [1, 2, 3, 1, 2, 2, 0, 0], [1, 2, 3, 2, 2, 1, 0, 0], [2, 2, 3, 2, 1, 1, 0, 0], [2, 2, 1, 1, 3, 2, 0, 0], [2, 2, 1, 2, 3, 1, 0, 0], [2, 1, 3, 2, 1, 2, 0, 0], [2, 2, 3, 1, 1, 2, 0, 0], [3, 1, 2, 1, 3, 1, 0, 0], [3, 1, 1, 2, 2, 2, 0, 0], [3, 2, 1, 1, 2, 2, 0, 0], [3, 2, 1, 2, 2, 1, 0, 0], [3, 1, 2, 2, 1, 2, 0, 0], [3, 2, 2, 1, 1, 2, 0, 0], [3, 2, 2, 2, 1, 1, 0, 0], [2, 1, 2, 1, 2, 3, 0, 0], [2, 1, 2, 3, 2, 1, 0, 0], [2, 3, 2, 1, 2, 1, 0, 0], [1, 1, 1, 3, 2, 3, 0, 0], [1, 3, 1, 1, 2, 3, 0, 0], [1, 3, 1, 3, 2, 1, 0, 0], [1, 1, 2, 3, 1, 3, 0, 0], [1, 3, 2, 1, 1, 3, 0, 0], [1, 3, 2, 3, 1, 1, 0, 0], [2, 1, 1, 3, 1, 3, 0, 0], [2, 3, 1, 1, 1, 3, 0, 0], [2, 3, 1, 3, 1, 1, 0, 0], [1, 1, 2, 1, 3, 3, 0, 0], [1, 1, 2, 3, 3, 1, 0, 0], [1, 3, 2, 1, 3, 1, 0, 0], [1, 1, 3, 1, 2, 3, 0, 0], [1, 1, 3, 3, 2, 1, 0, 0], [1, 3, 3, 1, 2, 1, 0, 0], [3, 1, 3, 1, 2, 1, 0, 0], [2, 1, 1, 3, 3, 1, 0, 0], [2, 3, 1, 1, 3, 1, 0, 0], [2, 1, 3, 1, 1, 3, 0, 0], [2, 1, 3, 3, 1, 1, 0, 0], [2, 1, 3, 1, 3, 1, 0, 0], [3, 1, 1, 1, 2, 3, 0, 0], [3, 1, 1, 3, 2, 1, 0, 0], [3, 3, 1, 1, 2, 1, 0, 0], [3, 1, 2, 1, 1, 3, 0, 0], [3, 1, 2, 3, 1, 1, 0, 0], [3, 3, 2, 1, 1, 1, 0, 0], [3, 1, 4, 1, 1, 1, 0, 0], [2, 2, 1, 4, 1, 1, 0, 0], [4, 3, 1, 1, 1, 1, 0, 0], [1, 1, 1, 2, 2, 4, 0, 0], [1, 1, 1, 4, 2, 2, 0, 0], [1, 2, 1, 1, 2, 4, 0, 0], [1, 2, 1, 4, 2, 1, 0, 0], [1, 4, 1, 1, 2, 2, 0, 0], [1, 4, 1, 2, 2, 1, 0, 0], [1, 1, 2, 2, 1, 4, 0, 0], [1, 1, 2, 4, 1, 2, 0, 0], [1, 2, 2, 1, 1, 4, 0, 0], [1, 2, 2, 4, 1, 1, 0, 0], [1, 4, 2, 1, 1, 2, 0, 0], [1, 4, 2, 2, 1, 1, 0, 0], [2, 4, 1, 2, 1, 1, 0, 0], [2, 2, 1, 1, 1, 4, 0, 0], [4, 1, 3, 1, 1, 1, 0, 0], [2, 4, 1, 1, 1, 2, 0, 0], [1, 3, 4, 1, 1, 1, 0, 0], [1, 1, 1, 2, 4, 2, 0, 0], [1, 2, 1, 1, 4, 2, 0, 0], [1, 2, 1, 2, 4, 1, 0, 0], [1, 1, 4, 2, 1, 2, 0, 0], [1, 2, 4, 1, 1, 2, 0, 0], [1, 2, 4, 2, 1, 1, 0, 0], [4, 1, 1, 2, 1, 2, 0, 0], [4, 2, 1, 1, 1, 2, 0, 0], [4, 2, 1, 2, 1, 1, 0, 0], [2, 1, 2, 1, 4, 1, 0, 0], [2, 1, 4, 1, 2, 1, 0, 0], [4, 1, 2, 1, 2, 1, 0, 0], [1, 1, 1, 1, 4, 3, 0, 0], [1, 1, 1, 3, 4, 1, 0, 0], [1, 3, 1, 1, 4, 1, 0, 0], [1, 1, 4, 1, 1, 3, 0, 0], [1, 1, 4, 3, 1, 1, 0, 0], [4, 1, 1, 1, 1, 3, 0, 0], [4, 1, 1, 3, 1, 1, 0, 0], [1, 1, 3, 1, 4, 1, 0, 0], [1, 1, 4, 1, 3, 1, 0, 0], [3, 1, 1, 1, 4, 1, 0, 0], [4, 1, 1, 1, 3, 1, 0, 0], [2, 1, 1, 4, 1, 2, 0, 0], [2, 1, 1, 2, 1, 4, 0, 0], [2, 1, 1, 2, 3, 2, 0, 0], [2, 3, 3, 1, 1, 1, 2, 0]], UNIT_CONVERSION = function(t2) {
  9224. return uni.upx2px(Number(t2));
  9225. }, getPixelRatio = function(t2) {
  9226. return uni.getSystemInfoSync()[t2 || "pixelRatio"];
  9227. }, getTimeDate = function() {
  9228. var t2 = /* @__PURE__ */ new Date();
  9229. return t2.toLocaleDateString().replace(/\//g, "-") + " " + t2.toTimeString().slice(0, 8);
  9230. }, GETSIZE = { "MP-ALIPAY": function(t2) {
  9231. return UNIT_CONVERSION(t2) * getPixelRatio();
  9232. }, "MP-WEIXIN": function(t2) {
  9233. return UNIT_CONVERSION(t2);
  9234. }, "MP-BAIDU": function(t2) {
  9235. return UNIT_CONVERSION(t2);
  9236. }, "MP-TOUTIAO": function(t2) {
  9237. return UNIT_CONVERSION(t2);
  9238. }, "MP-QQ": function(t2) {
  9239. return UNIT_CONVERSION(t2);
  9240. }, "MP-LARK": function(t2) {
  9241. return UNIT_CONVERSION(t2);
  9242. }, "MP-KUAISHOU": function(t2) {
  9243. return UNIT_CONVERSION(t2);
  9244. }, "MP-360": function(t2) {
  9245. return UNIT_CONVERSION(t2);
  9246. }, "QUICKAPP-WEBVIEW": function(t2) {
  9247. return UNIT_CONVERSION(t2);
  9248. }, "QUICKAPP-WEBVIEW-UNION": function(t2) {
  9249. return UNIT_CONVERSION(t2);
  9250. }, "QUICKAPP-WEBVIEW-HUAWEI": function(t2) {
  9251. return UNIT_CONVERSION(t2);
  9252. }, MP: function(t2) {
  9253. return UNIT_CONVERSION(t2);
  9254. }, "APP-PLUS": function(t2) {
  9255. return UNIT_CONVERSION(t2);
  9256. }, NVUE: function(t2) {
  9257. return UNIT_CONVERSION(t2);
  9258. }, H5: function(t2) {
  9259. return UNIT_CONVERSION(t2);
  9260. }, none: function(t2) {
  9261. return UNIT_CONVERSION(t2);
  9262. } }, UtF16TO8 = function(t2) {
  9263. for (var e2, i2 = t2.toString(), r2 = "", o2 = 0; o2 < i2.length; o2++)
  9264. 1 <= (e2 = i2.charCodeAt(o2)) && e2 <= 127 ? r2 += i2.charAt(o2) : (2047 < e2 ? (r2 += String.fromCharCode(224 | e2 >> 12 & 15), r2 += String.fromCharCode(128 | e2 >> 6 & 63)) : r2 += String.fromCharCode(192 | e2 >> 6 & 31), r2 += String.fromCharCode(128 | e2 >> 0 & 63));
  9265. return r2;
  9266. }, SaveCodeImg = function(t2) {
  9267. var i2 = UNIT_CONVERSION(Number(t2.width)), r2 = UNIT_CONVERSION(Number(t2.height)), e2 = getPixelRatio("pixelRatio"), o2 = i2 * e2, s2 = r2 * e2;
  9268. return "MP-ALIPAY" == t2.source && (i2 = o2, r2 = s2), formatAppLog("log", "at uni_modules/wmf-code/js_sdk/index.js:1", i2, r2), new Promise(function(e3) {
  9269. "[object String]" == Object.prototype.toString.call(t2.id) ? uni.canvasToTempFilePath({ canvasId: t2.id, width: i2, height: r2, destWidth: o2, destHeight: s2, fileType: t2.type || "jpg", quality: t2.quality || 1, complete: function(t3) {
  9270. e3(t3);
  9271. } }, t2.ctx) : "[object Object]" == Object.prototype.toString.call(t2.id) && t2.id.toTempFilePath(0, 0, i2, r2, o2, s2, t2.type || "png", 1, function(t3) {
  9272. e3(t3);
  9273. });
  9274. });
  9275. }, SetGradient = function(t2, e2, i2, r2) {
  9276. i2 = t2.createLinearGradient(0, 0, e2, i2);
  9277. return 1 === r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(1, r2[0])), 2 === r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(1, r2[1])), 3 === r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(0.5, r2[1]), i2.addColorStop(1, r2[2])), 4 === r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(0.35, r2[1]), i2.addColorStop(0.7, r2[2]), i2.addColorStop(1, r2[3])), 5 === r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(0.35, r2[1]), i2.addColorStop(0.6, r2[2]), i2.addColorStop(0.8, r2[3]), i2.addColorStop(1, r2[4])), 6 === r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(0.25, r2[1]), i2.addColorStop(0.45, r2[2]), i2.addColorStop(0.65, r2[3]), i2.addColorStop(0.85, r2[4]), i2.addColorStop(1, r2[5])), 7 === r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(0.15, r2[1]), i2.addColorStop(0.35, r2[2]), i2.addColorStop(0.45, r2[3]), i2.addColorStop(0.65, r2[4]), i2.addColorStop(0.85, r2[5]), i2.addColorStop(1, r2[6])), 8 === r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(0.1, r2[1]), i2.addColorStop(0.25, r2[2]), i2.addColorStop(0.45, r2[3]), i2.addColorStop(0.65, r2[4]), i2.addColorStop(0.85, r2[5]), i2.addColorStop(0.9, r2[6]), i2.addColorStop(1, r2[7])), 9 === r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(0.2, r2[1]), i2.addColorStop(0.3, r2[2]), i2.addColorStop(0.5, r2[3]), i2.addColorStop(0.6, r2[4]), i2.addColorStop(0.7, r2[5]), i2.addColorStop(0.8, r2[6]), i2.addColorStop(0.9, r2[7]), i2.addColorStop(1, r2[8])), 10 <= r2.length && (i2.addColorStop(0, r2[0]), i2.addColorStop(0.1, r2[1]), i2.addColorStop(0.2, r2[2]), i2.addColorStop(0.3, r2[3]), i2.addColorStop(0.4, r2[4]), i2.addColorStop(0.5, r2[5]), i2.addColorStop(0.6, r2[6]), i2.addColorStop(0.7, r2[7]), i2.addColorStop(0.85, r2[8]), i2.addColorStop(1, r2[9])), i2;
  9278. }, StringToCode128 = function(t2) {
  9279. var s2 = { currcs: 5 }, e2 = GetBytes(t2), i2 = 126 == e2[0] ? 1 : 0, t2 = 0 < e2.length ? CodeSetAllowedFor(e2[i2++]) : 2, i2 = 0 < e2.length ? CodeSetAllowedFor(e2[i2++]) : 2;
  9280. s2.currcs = getBestStartSet(t2, i2), s2.currcs = function(t3, e3) {
  9281. for (var i3 = 0; i3 < t3.length; i3++) {
  9282. var r3 = t3[i3];
  9283. if ((r3 < 48 || 57 < r3) && 126 != r3)
  9284. return e3;
  9285. }
  9286. return 5;
  9287. }(e2, s2.currcs);
  9288. var r2 = [];
  9289. switch (s2.currcs) {
  9290. case 3:
  9291. r2.push(103);
  9292. break;
  9293. case 4:
  9294. r2.push(104);
  9295. break;
  9296. default:
  9297. r2.push(105);
  9298. }
  9299. for (var o2 = 0; o2 < e2.length; o2++) {
  9300. var n2 = e2[o2];
  9301. n2 in REPLACE_CODES && (r2.push(REPLACE_CODES[n2]), n2 = e2[++o2]);
  9302. var h2 = e2.length > o2 + 1 ? e2[o2 + 1] : -1, r2 = r2.concat(function(t3, e3, i3) {
  9303. var r3 = [], o3 = -1;
  9304. if (charCompatible(t3, i3))
  9305. 5 == i3 && (-1 == e3 ? (o3 = 100, i3 = 4) : charCompatible(e3, i3) || (i3 = charCompatible(e3, 3) ? (o3 = 101, 3) : (o3 = 100, 4)));
  9306. else if (-1 == e3 || charCompatible(e3, i3))
  9307. o3 = 98;
  9308. else
  9309. switch (i3) {
  9310. case 3:
  9311. o3 = 100, i3 = 4;
  9312. break;
  9313. case 4:
  9314. o3 = 101, i3 = 3;
  9315. }
  9316. return -1 != o3 ? (r3.push(o3), r3.push(codeValue(t3))) : 5 == i3 ? r3.push(codeValue(t3, e3)) : r3.push(codeValue(t3)), s2.currcs = i3, r3;
  9317. }(n2, h2, s2.currcs));
  9318. 5 == s2.currcs && o2++;
  9319. }
  9320. for (var a2 = r2[0], l2 = 1; l2 < r2.length; l2++)
  9321. a2 += l2 * r2[l2];
  9322. return r2.push(a2 % 103), r2.push(106), r2;
  9323. }, GetBytes = function(t2) {
  9324. for (var e2 = [], i2 = 0; i2 < t2.length; i2++)
  9325. e2.push(t2.charCodeAt(i2));
  9326. return e2;
  9327. }, CodeSetAllowedFor = function(t2) {
  9328. return 48 <= t2 && t2 <= 57 ? 1 : 32 <= t2 && t2 <= 95 ? 2 : t2 < 32 ? 3 : 4;
  9329. }, getBestStartSet = function(t2, e2) {
  9330. var i2 = 0;
  9331. return i2 += 3 == t2 ? 1 : 0, i2 += 4 == t2 ? -1 : 0, i2 += 3 == e2 ? 1 : 0, 0 < (i2 += 4 == e2 ? -1 : 0) ? 3 : 4;
  9332. }, codeValue = function(t2, e2) {
  9333. return void 0 === e2 ? 32 <= t2 ? t2 - 32 : t2 + 64 : parseInt(String.fromCharCode(t2) + String.fromCharCode(e2));
  9334. }, charCompatible = function(t2, e2) {
  9335. t2 = codeSetAllowedFor(t2);
  9336. return 1 == t2 || (2 == t2 || (3 == t2 && 3 == e2 || 4 == t2 && 4 == e2));
  9337. }, codeSetAllowedFor = function(t2) {
  9338. return 48 <= t2 && t2 <= 57 ? 1 : 32 <= t2 && t2 <= 95 ? 2 : t2 < 32 ? 3 : 4;
  9339. }, REPLACE_CODES = { CHAR_TILDE: 102 }, BarCode128 = StringToCode128, OperationCode = function(t2, e2) {
  9340. var i2, r2;
  9341. t2.code ? t2.id ? (r2 = (/* @__PURE__ */ new Date()).getTime(), "[object String]" == Object.prototype.toString.call(t2.id) ? (i2 = uni.createCanvasContext(t2.id, t2.ctx || null), BarCodeCanvas(r2, t2, i2, e2)) : "[object Object]" == Object.prototype.toString.call(t2.id) && (i2 = t2.id, BarCodeCanvas(r2, t2, i2, e2))) : formatAppLog("warn", "at uni_modules/wmf-code/js_sdk/index.js:1", "没有找到条形码canvas id或者实列!") : formatAppLog("warn", "at uni_modules/wmf-code/js_sdk/index.js:1", "没有找到条形码code");
  9342. }, BarCodeCanvas = function(t2, e2, i2, r2) {
  9343. var o2 = e2.text ? (e2.text.size || 40) + (e2.text.padding || 20) : 0, s2 = GETSIZE[e2.source || "none"](e2.width), n2 = GETSIZE[e2.source || "none"](e2.height), h2 = UtF16TO8(e2.code);
  9344. i2.setFillStyle(e2.bgColor || "#FFFFFF"), "horizontal" == e2.orient ? i2.fillRect(0, 0, s2, GETSIZE[e2.source || "none"](e2.height + o2)) : i2.fillRect(0, 0, GETSIZE[e2.source || "none"](e2.height + o2), s2), i2.setFillStyle(e2.bgColor || "#FFFFFF");
  9345. o2 = new GraphicContentInit(i2, s2, n2);
  9346. e2.color ? SetBarCodeColors(i2, s2, n2, e2.color || ["#000000"], e2.orient) : i2.setFillStyle("#000000"), SetBarCodeType[e2.type || "CODE128"](h2, o2, n2, e2.orient, e2.text), e2.text && setBarCodeText(i2, e2.text, s2, n2, e2.source || "H5", e2.orient || "horizontal"), starDraw$1(i2, e2, t2, r2);
  9347. }, starDraw$1 = function(t2, s2, n2, h2) {
  9348. var e2 = this;
  9349. setTimeout(function() {
  9350. t2.draw(false, function(o2) {
  9351. return __awaiter(e2, void 0, void 0, function() {
  9352. var e3, i2, r2;
  9353. return __generator(this, function(t3) {
  9354. switch (t3.label) {
  9355. case 0:
  9356. return h2 ? (e3 = h2, i2 = [__assign({}, o2)], r2 = { createTime: getTimeDate(), takeUpTime: (/* @__PURE__ */ new Date()).getTime() - n2 }, [4, SaveCodeImg({ width: "vertical" == s2.orient ? s2.height : s2.width, height: "vertical" == s2.orient ? s2.width : s2.height, id: s2.id, source: s2.source, ctx: s2.ctx || null })]) : [3, 2];
  9357. case 1:
  9358. return e3.apply(void 0, [__assign.apply(void 0, i2.concat([(r2.img = t3.sent(), r2.model = getPixelRatio("model"), r2.system = getPixelRatio("system"), r2.platform = getPixelRatio("platform"), r2.code = s2.code, r2.source = s2.source, r2.with = UNIT_CONVERSION(s2.width), r2.height = UNIT_CONVERSION(s2.height), r2.id = "[object String]" == Object.prototype.toString.call(s2.id) ? s2.id : "nvue", r2)]))]), [3, 3];
  9359. case 2:
  9360. t3.label = 3;
  9361. case 3:
  9362. return [2];
  9363. }
  9364. });
  9365. });
  9366. });
  9367. });
  9368. }, SetBarCodeColors = function(t2, e2, i2, r2, o2) {
  9369. r2 = SetGradient(t2, "vertical" == (o2 = void 0 === o2 ? "horizontal" : o2) ? i2 : e2, "vertical" == o2 ? e2 : i2, r2);
  9370. t2.setFillStyle(r2);
  9371. }, setBarCodeText = function(t2, e2, i2, r2, o2, s2) {
  9372. var n2 = e2.color || ["#000000"], h2 = SetGradient(t2, i2, r2, n2);
  9373. t2.setGlobalAlpha((null == e2 ? void 0 : e2.opacity) || 1), t2.setTextAlign("center"), t2.setTextBaseline("middle"), t2.setFillStyle("#000000"), t2.setFontSize(UNIT_CONVERSION(e2.size || 40)), "H5" == o2 ? t2.setFillStyle(h2) : t2.setFillStyle(n2[0]);
  9374. n2 = "bottom" == e2.position ? r2 + UNIT_CONVERSION((e2.padding || 40) + (e2.size || 20) / 2) : UNIT_CONVERSION(e2.size) / 2;
  9375. "vertical" == s2 ? (t2.rotate(90 * Math.PI / 180), "bottom" == e2.position ? (t2.translate(i2, -r2), t2.fillText(e2.content, -i2 / 2, -UNIT_CONVERSION(e2.padding || 20 + (e2.size || 40) / 2))) : (t2.translate(-i2 / 2, -n2), t2.fillText(e2.content, i2, -n2))) : t2.fillText(e2.content, i2 / 2, n2), t2.setGlobalAlpha(1);
  9376. }, SetBarCodeType = { CODE128: function(t2, e2, i2, r2, o2) {
  9377. void 0 === r2 && (r2 = "horizontal");
  9378. var s2 = BarCode128(t2), n2 = e2.area.width / (11 * (s2.length - 3) + 35), h2 = e2.area.left, t2 = 0;
  9379. o2 && "bottom" != o2.position && (t2 = UNIT_CONVERSION(((null == o2 ? void 0 : o2.size) || 40) + ((null == o2 ? void 0 : o2.padding) || 20)));
  9380. for (var a2 = e2.area.top + t2, l2 = i2 - e2.area.top, c2 = 0; c2 < s2.length; c2++)
  9381. for (var d2 = s2[c2], f2 = 0; f2 < 8; f2 += 2) {
  9382. var u2 = PATTERNS[d2][f2] * n2, p2 = PATTERNS[d2][f2 + 1] * n2;
  9383. 0 < u2 && e2.fillFgRect("vertical" == r2 ? a2 : h2, "vertical" == r2 ? h2 : a2, "vertical" == r2 ? l2 : u2, "vertical" == r2 ? u2 : l2), h2 += u2 + p2;
  9384. }
  9385. }, CODE39: function(t2, e2, i2) {
  9386. formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码类型:CODE39暂未实现");
  9387. }, EAN13: function(t2, e2, i2) {
  9388. -1 !== t2.search(/^[0-9]{12}$/) ? formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码类型:EAN暂未实现") : formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码:code不符合EAN13规范");
  9389. }, UPCE: function(t2, e2, i2) {
  9390. -1 !== t2.search(/^[0-9]{6}$/) ? formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码类型:EAN暂未实现") : formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码:code不符合UPCE规范");
  9391. }, UPC: function(t2, e2, i2) {
  9392. -1 !== t2.search(/^[0-9]{1}$/) ? formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码类型:EAN暂未实现") : formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码:code不符合UPC规范");
  9393. }, ITF: function(t2, e2, i2) {
  9394. -1 !== t2.search(/^([0-9]{2})+$/) ? formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码类型:ITF暂未实现") : formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码:code不符合ITF规范");
  9395. }, ITF14: function(t2, e2, i2) {
  9396. -1 !== t2.search(/^[0-9]{14}$/) ? formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码类型:ITF14暂未实现") : formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码:code不符合ITF14规范");
  9397. }, MSI: function(t2, e2, i2) {
  9398. -1 !== t2.search(/^[0-9]+$/) ? formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码类型:MSI暂未实现") : formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码:code不符合MSI规范");
  9399. }, Codabar: function(t2, e2, i2) {
  9400. -1 !== t2.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) ? formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码类型:Codabar暂未实现") : formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码:code不符合Codabar规范");
  9401. }, Pharmacode: function(t2, e2, i2) {
  9402. !isNaN(parseInt(t2, 10)) && 3 <= Number(t2) && Number(t2) <= 131070 ? formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码类型:Pharmacode暂未实现") : formatAppLog("error", "at uni_modules/wmf-code/js_sdk/index.js:1", "条形码编码:code不符合Pharmacode类型");
  9403. } }, GraphicContentInit = function() {
  9404. function t2(t3, e2, i2) {
  9405. this.borderSize = 0, this.paddingWidth = 0, this.ctx = t3, this.width = e2, this.height = i2, this.quiet = Math.round(this.width / 40), this.area = { width: e2 - 2 * this.paddingWidth - 2 * this.quiet, height: i2 - 2 * this.borderSize, top: this.borderSize - 4, left: this.borderSize + this.quiet }, this.fillBgRect(0, 0, e2, i2), this.fillBgRect(0, this.borderSize, e2, i2 - 2 * this.borderSize);
  9406. }
  9407. return t2.prototype.fillFgRect = function(t3, e2, i2, r2) {
  9408. this.FILLRECT(t3, e2, i2, r2);
  9409. }, t2.prototype.fillBgRect = function(t3, e2, i2, r2) {
  9410. this.FILLRECT(t3, e2, i2, r2);
  9411. }, t2.prototype.FILLRECT = function(t3, e2, i2, r2) {
  9412. this.ctx.fillRect(t3, e2, i2, r2);
  9413. }, t2;
  9414. }(), BarCode = OperationCode, GetImg = SaveCodeImg, GetPixelRatio = getPixelRatio, GetPx = UNIT_CONVERSION;
  9415. function isArray(arr) {
  9416. return Object.prototype.toString.call(arr) === "[object Array]";
  9417. }
  9418. function deepClone(obj) {
  9419. if ([null, void 0, NaN, false].includes(obj))
  9420. return obj;
  9421. if (typeof obj !== "object" && typeof obj !== "function") {
  9422. return obj;
  9423. }
  9424. var o2 = isArray(obj) ? [] : {};
  9425. for (let i2 in obj) {
  9426. if (obj.hasOwnProperty(i2)) {
  9427. o2[i2] = typeof obj[i2] === "object" ? deepClone(obj[i2]) : obj[i2];
  9428. }
  9429. }
  9430. return o2;
  9431. }
  9432. function getUUid(len2 = 32, firstU = true, radix = null) {
  9433. let chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
  9434. let uuid = [];
  9435. radix = radix || chars.length;
  9436. if (len2) {
  9437. for (let i2 = 0; i2 < len2; i2++)
  9438. uuid[i2] = chars[0 | Math.random() * radix];
  9439. } else {
  9440. let r2;
  9441. uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
  9442. uuid[14] = "4";
  9443. for (let i2 = 0; i2 < 36; i2++) {
  9444. if (!uuid[i2]) {
  9445. r2 = 0 | Math.random() * 16;
  9446. uuid[i2] = chars[i2 == 19 ? r2 & 3 | 8 : r2];
  9447. }
  9448. }
  9449. }
  9450. if (firstU) {
  9451. uuid.shift();
  9452. return "u" + uuid.join("");
  9453. } else {
  9454. return uuid.join("");
  9455. }
  9456. }
  9457. function platform() {
  9458. let val = null;
  9459. val = "VUE3";
  9460. val = "APP-PLUS";
  9461. return val;
  9462. }
  9463. const _sfc_main$7 = {
  9464. __name: "w-barcode",
  9465. props: {
  9466. options: {
  9467. type: Object,
  9468. required: true,
  9469. default: () => {
  9470. return {};
  9471. }
  9472. }
  9473. },
  9474. emits: ["generate", "press", "error"],
  9475. setup(__props, { expose, emit: emits }) {
  9476. const props = __props;
  9477. const opt = props.options;
  9478. const that = vue.getCurrentInstance();
  9479. const HSize = opt.text ? opt.text.size || 40 + opt.text.padding || 20 : 0;
  9480. let info = vue.reactive({
  9481. id: getUUid(),
  9482. destWidth: GetPixelRatio() * GetPx(opt.width) + "px",
  9483. destHeight: GetPixelRatio() * GetPx(opt.height + HSize) + "px",
  9484. width: GetPx(opt.width) + "px",
  9485. height: GetPx(opt.height + HSize) + "px",
  9486. orient: opt.orient || "horizontal",
  9487. listCode: []
  9488. });
  9489. vue.onMounted(() => {
  9490. SpecialTreatment(opt);
  9491. vue.nextTick(() => {
  9492. generateCode(opt);
  9493. });
  9494. });
  9495. vue.watch(() => props.options, (val) => {
  9496. SpecialTreatment(val);
  9497. const HSize2 = val.text ? val.text.size || 40 + val.text.padding || 20 : 0;
  9498. info.destWidth = GetPixelRatio() * GetPx(val.width) + "px", info.destHeight = GetPixelRatio() * GetPx(val.height + HSize2) + "px", info.orient = val.orient || "horizontal", info.width = GetPx(val.width) + "px", info.height = GetPx(val.height + HSize2) + "px", setTimeout(() => {
  9499. generateCode(val);
  9500. }, 100);
  9501. }, { deep: true });
  9502. const generateCode = (val) => {
  9503. try {
  9504. const parameter = { ...val, orient: info.orient, source: platform(), id: info.id, ctx: that };
  9505. BarCode(parameter, (res) => {
  9506. emits("generate", res);
  9507. });
  9508. } catch (err) {
  9509. formatAppLog("warn", "at uni_modules/wmf-code/components/w-barcode/w-barcode.vue:81", err);
  9510. }
  9511. };
  9512. const GetCodeImg = async () => {
  9513. try {
  9514. return await GetImg({ id: info.id, source: platform(), width: opt.orient == "vertical" ? opt.height : opt.width, height: opt.orient == "vertical" ? opt.width : opt.height, ctx: that });
  9515. } catch (e2) {
  9516. formatAppLog("warn", "at uni_modules/wmf-code/components/w-barcode/w-barcode.vue:86", e2);
  9517. }
  9518. };
  9519. const SpecialTreatment = (val) => {
  9520. let obj = deepClone(val);
  9521. obj.id = info.id;
  9522. info.listCode = [obj];
  9523. };
  9524. const longtap = (e2) => {
  9525. emits("press", e2);
  9526. };
  9527. const handleError = (e2) => {
  9528. emits("error", e2.detail);
  9529. };
  9530. expose({
  9531. GetCodeImg
  9532. });
  9533. return (_ctx, _cache) => {
  9534. return vue.openBlock(), vue.createElementBlock("view", {
  9535. onLongtap: vue.withModifiers(longtap, ["stop"])
  9536. }, [
  9537. (vue.openBlock(true), vue.createElementBlock(
  9538. vue.Fragment,
  9539. null,
  9540. vue.renderList(vue.unref(info).listCode, (item) => {
  9541. return vue.openBlock(), vue.createElementBlock("canvas", {
  9542. width: vue.unref(info).orient == "vertical" ? vue.unref(info).destHeight : vue.unref(info).destWidth,
  9543. height: vue.unref(info).orient == "vertical" ? vue.unref(info).destWidth : vue.unref(info).destHeight,
  9544. "canvas-id": item.id,
  9545. id: item.id,
  9546. style: vue.normalizeStyle({ width: vue.unref(info).orient == "vertical" ? vue.unref(info).height : vue.unref(info).width, height: vue.unref(info).orient == "vertical" ? vue.unref(info).width : vue.unref(info).height }),
  9547. key: item.id,
  9548. onError: handleError
  9549. }, null, 44, ["width", "height", "canvas-id", "id"]);
  9550. }),
  9551. 128
  9552. /* KEYED_FRAGMENT */
  9553. ))
  9554. ], 40, ["onLongtap"]);
  9555. };
  9556. }
  9557. };
  9558. const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "/Users/sunwubin/source/pharmacy/uni_modules/wmf-code/components/w-barcode/w-barcode.vue"]]);
  9559. const __default__$2 = {
  9560. name: ""
  9561. };
  9562. const _sfc_main$6 = /* @__PURE__ */ Object.assign(__default__$2, {
  9563. setup(__props) {
  9564. vue.ref(11220822134401);
  9565. const preseObj = vue.ref({
  9566. code: "",
  9567. color: ["#000"],
  9568. // 条形码的颜色
  9569. bgColor: "#FFFFFF",
  9570. // 背景色
  9571. width: 200,
  9572. // 宽度
  9573. height: 50
  9574. // 高度
  9575. });
  9576. vue.ref({
  9577. width: 112.5,
  9578. height: 112.5,
  9579. border: {
  9580. color: "#DDDDDD",
  9581. width: 1,
  9582. style: "solid",
  9583. radius: "4px"
  9584. }
  9585. });
  9586. vue.ref([]);
  9587. vue.ref({
  9588. height: 80,
  9589. displayValue: false
  9590. });
  9591. const v2 = vue.ref({
  9592. preNo: "11220822134401",
  9593. presType: "普通处方",
  9594. name: "李某",
  9595. sex: "男",
  9596. age: 35,
  9597. contactNumber: "13888888888",
  9598. status: "发药",
  9599. department: "中医内科",
  9600. disName: "胃脘痛病",
  9601. symName: "脾胃虚寒证",
  9602. prescriptionTime: "2023-06-01 15:58",
  9603. address: "浙江省某某事某某去某某事中医院门诊楼三楼302是",
  9604. rp: [
  9605. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9606. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  9607. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9608. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9609. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  9610. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9611. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9612. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9613. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9614. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" },
  9615. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9616. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  9617. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9618. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9619. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  9620. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9621. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9622. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9623. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9624. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" },
  9625. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9626. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  9627. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9628. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9629. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  9630. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9631. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9632. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9633. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9634. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" },
  9635. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9636. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  9637. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9638. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9639. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  9640. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  9641. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9642. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9643. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  9644. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" }
  9645. ],
  9646. number: 3,
  9647. pies_tips: "待见",
  9648. dosageForm: "汤剂",
  9649. prescriptionUsage: "煎服",
  9650. concentration: "200ml",
  9651. frequency: "一日三次",
  9652. medicationTime: "饭后服",
  9653. entrust: "注意多休息,饮食清单。",
  9654. prescriptionSum: "187.00",
  9655. daijianCost: "30.00",
  9656. distributionCost: "10.00",
  9657. prescriptionTotleSum: "227.00",
  9658. yljgName: "杭州某某高级中医院",
  9659. operateList: [
  9660. { py: "kf", title: "开方", operater: "" },
  9661. { py: "sh", title: "审核", operater: "" },
  9662. { py: "tp", title: "调配", operater: "" },
  9663. { py: "fh", title: "复核", operater: "" },
  9664. { py: "jp", title: "浸泡", operater: "" },
  9665. { py: "jz", title: "煎煮", operater: "" },
  9666. { py: "db", title: "打包", operater: "" },
  9667. { py: "fy", title: "发药", operater: "" }
  9668. ],
  9669. // extra_doc:'A医生',
  9670. // check_doc:'B医生',
  9671. // depoly:'调陪人',
  9672. // review:'复核人',
  9673. // steep:'浸泡',
  9674. // cook:'煎煮人',
  9675. // pack:'大宝人',
  9676. // dispen:'发药人',
  9677. // },
  9678. entrust1111: "1、本处方当日有效\n 2、取药时请您当面核对。。。。 \n 3、延长处方用量时间原油:慢性病 其他老年病 外地 其他"
  9679. });
  9680. vue.onMounted(() => {
  9681. });
  9682. onLoad(async (options) => {
  9683. formatAppLog("log", "at pages/detail/detail.vue:235", "options", options);
  9684. uni.getStorageSync("userId");
  9685. const params2 = {
  9686. token: uni.getStorageSync("token"),
  9687. data: {
  9688. id: options.id || "",
  9689. preNo: options.preId || "",
  9690. depolyStatus: options.depolyStatus || ""
  9691. }
  9692. };
  9693. formatAppLog("log", "at pages/detail/detail.vue:245", "params", params2);
  9694. const { data: res } = await selectOrderDetail(params2);
  9695. if (res.code === 200) {
  9696. v2.prescriptionTime = res.data.prescriptionTime, v2.value.name = res.data.name, v2.value.sex = res.data.sex, v2.value.age = res.data.age, v2.value.contactNumber = res.data.contactNumber;
  9697. v2.value.address = res.data.address;
  9698. v2.value.concentration = res.data.concentration;
  9699. v2.value.frequency = res.data.frequency;
  9700. v2.value.medicationTime = res.data.medicationTime;
  9701. v2.value.disName = res.data.disName, v2.value.symName = res.data.symName, v2.value.preNo = res.data.preNo, formatAppLog("log", "at pages/detail/detail.vue:263", "onLoad v.value.preNo", v2.value.preNo);
  9702. preseObj.value.code = v2.value.preNo;
  9703. v2.value.department = res.data.department, v2.value.dosageForm = res.data.dosageForm, v2.value.prescriptionUsage = res.data.prescriptionUsage, v2.value.number = res.data.number, v2.value.prescriptionSum = res.data.prescriptionSum, v2.value.prescriptionTotalSum = res.data.prescriptionTotalSum, v2.value.daijianCost = res.data.daijianCost, v2.value.distributionCost = res.data.distributionCost, v2.value.prescriptionTotleSum = res.data.prescriptionTotleSum, v2.value.entrust = res.data.entrust, v2.value.rp = res.data.detailList;
  9704. v2.value.yljgName = res.data.yljgName || "";
  9705. v2.value.status = res.data.status, formatAppLog("log", "at pages/detail/detail.vue:281", "res.data.status", res.data.status);
  9706. switch (res.data.status) {
  9707. case "1":
  9708. v2.value.status = "配药";
  9709. break;
  9710. case "2":
  9711. v2.value.status = "煎药";
  9712. break;
  9713. case "3":
  9714. v2.value.status = "发药";
  9715. break;
  9716. case "4":
  9717. v2.value.status = "配送";
  9718. break;
  9719. case "5":
  9720. v2.value.status = "已分配";
  9721. break;
  9722. case "6":
  9723. v2.value.status = "已传送";
  9724. break;
  9725. default:
  9726. v2.value.status = "配药";
  9727. }
  9728. v2.value.operateList[0].operater = res.data.doctor || "";
  9729. v2.value.operateList[1].operater = res.data.checkBy || "";
  9730. v2.value.operateList[2].operater = res.data.tiaopeiName || "";
  9731. const length = res.data.operateList;
  9732. if (length > 0) {
  9733. res.data.operateList.forEach((item) => {
  9734. switch (item.type) {
  9735. case "2":
  9736. v2.value.operateList[3].operater = item.createBy;
  9737. break;
  9738. case "3":
  9739. v2.value.operateList[4].operater = item.createBy;
  9740. break;
  9741. case "4":
  9742. v2.value.operateList[5].operater = item.createBy;
  9743. break;
  9744. case "5":
  9745. v2.value.operateList[6].operater = item.createBy;
  9746. break;
  9747. case "6":
  9748. v2.value.operateList[7].operater = item.createBy;
  9749. break;
  9750. }
  9751. });
  9752. }
  9753. }
  9754. });
  9755. const handleBack = () => {
  9756. uni.navigateBack({
  9757. delta: 1
  9758. });
  9759. };
  9760. return (_ctx, _cache) => {
  9761. const _component_uni_nav_bar = resolveEasycom(vue.resolveDynamicComponent("uni-nav-bar"), __easycom_0);
  9762. const _component_w_barcode = resolveEasycom(vue.resolveDynamicComponent("w-barcode"), __easycom_1);
  9763. const _component_uni_tag = resolveEasycom(vue.resolveDynamicComponent("uni-tag"), __easycom_2);
  9764. return vue.openBlock(), vue.createElementBlock("view", { class: "main" }, [
  9765. vue.createVNode(_component_uni_nav_bar, {
  9766. dark: "",
  9767. fixed: true,
  9768. "background-color": "#18C7B0",
  9769. "status-bar": "",
  9770. "left-icon": "left",
  9771. height: "62.5rpx",
  9772. width: "750rpx",
  9773. title: "处方详情",
  9774. onClickLeft: handleBack
  9775. }),
  9776. vue.createElementVNode("view", { class: "content" }, [
  9777. vue.createElementVNode("view", { class: "header" }, [
  9778. vue.createElementVNode("view", { class: "ti" }, [
  9779. vue.createElementVNode("view", { class: "left" }, [
  9780. vue.createElementVNode("view", { class: "baracode" }, [
  9781. vue.createVNode(_component_w_barcode, { options: preseObj.value }, null, 8, ["options"]),
  9782. vue.createElementVNode(
  9783. "view",
  9784. { class: "barnum" },
  9785. vue.toDisplayString(v2.value.preNo),
  9786. 1
  9787. /* TEXT */
  9788. )
  9789. ])
  9790. ]),
  9791. vue.createElementVNode("view", { class: "mid" }, [
  9792. vue.createElementVNode("text", { class: "title" }, "中药处方笺")
  9793. ]),
  9794. vue.createElementVNode("view", { class: "rig" }, [
  9795. vue.createElementVNode(
  9796. "text",
  9797. { class: "title" },
  9798. vue.toDisplayString(v2.value.type == "1" ? "中药处方" : v2.value.type == "1" ? "中药制剂" : ""),
  9799. 1
  9800. /* TEXT */
  9801. )
  9802. ])
  9803. ]),
  9804. vue.createElementVNode("view", { class: "patiinfo" }, [
  9805. vue.createElementVNode("view", { class: "r1" }, [
  9806. vue.createElementVNode("view", { class: "row" }, [
  9807. vue.createElementVNode("span", { class: "we" }, "姓名:"),
  9808. vue.createTextVNode(
  9809. vue.toDisplayString(v2.value.name),
  9810. 1
  9811. /* TEXT */
  9812. )
  9813. ]),
  9814. vue.createElementVNode("view", { class: "row" }, [
  9815. vue.createElementVNode("span", { class: "we" }, "性别:"),
  9816. vue.createTextVNode(
  9817. vue.toDisplayString(v2.value.sex),
  9818. 1
  9819. /* TEXT */
  9820. )
  9821. ]),
  9822. vue.createElementVNode("view", { class: "row" }, [
  9823. vue.createElementVNode("span", { class: "we" }, "年龄:"),
  9824. vue.createTextVNode(
  9825. vue.toDisplayString(v2.value.age) + "岁",
  9826. 1
  9827. /* TEXT */
  9828. )
  9829. ]),
  9830. vue.createElementVNode("view", { class: "row" }, [
  9831. vue.createElementVNode("span", { class: "we" }, "电话:"),
  9832. vue.createTextVNode(
  9833. vue.toDisplayString(v2.value.contactNumber),
  9834. 1
  9835. /* TEXT */
  9836. )
  9837. ]),
  9838. vue.createElementVNode("view", { class: "row" }, [
  9839. vue.createElementVNode("span", { class: "we" }, "当前处方状态:"),
  9840. vue.createTextVNode(
  9841. vue.toDisplayString(v2.value.state == "1" ? "配药" : v2.value.state == "2" ? "煎药" : v2.value.state == "3" ? "发药" : v2.value.state == "4" ? "配送" : ""),
  9842. 1
  9843. /* TEXT */
  9844. )
  9845. ])
  9846. ]),
  9847. vue.createElementVNode("view", { class: "r2" }, [
  9848. vue.createElementVNode("view", { class: "row" }, [
  9849. vue.createElementVNode("span", { class: "we" }, "就诊科室:"),
  9850. vue.createTextVNode(
  9851. vue.toDisplayString(v2.value.department),
  9852. 1
  9853. /* TEXT */
  9854. )
  9855. ]),
  9856. vue.createElementVNode("view", { class: "row" }, [
  9857. vue.createElementVNode("span", { class: "we" }, "临床诊断:"),
  9858. vue.createTextVNode(
  9859. vue.toDisplayString(v2.value.disName) + "—" + vue.toDisplayString(v2.value.symName),
  9860. 1
  9861. /* TEXT */
  9862. )
  9863. ]),
  9864. vue.createElementVNode("view", { class: "row" }, [
  9865. vue.createElementVNode("span", { class: "we" }, "开方时间:"),
  9866. vue.createTextVNode(
  9867. vue.toDisplayString(v2.value.prescriptionTime),
  9868. 1
  9869. /* TEXT */
  9870. )
  9871. ])
  9872. ]),
  9873. vue.createElementVNode("view", { class: "r3" }, [
  9874. vue.createElementVNode("span", { class: "we" }, "联系地址:"),
  9875. vue.createTextVNode(
  9876. vue.toDisplayString(v2.value.address),
  9877. 1
  9878. /* TEXT */
  9879. )
  9880. ])
  9881. ])
  9882. ]),
  9883. vue.createElementVNode("view", { class: "rp" }, [
  9884. vue.createElementVNode("view", { class: "title" }, [
  9885. vue.createElementVNode("text", { class: "text" }, "Rp:")
  9886. ]),
  9887. vue.createElementVNode("view", { class: "lists" }, [
  9888. (vue.openBlock(true), vue.createElementBlock(
  9889. vue.Fragment,
  9890. null,
  9891. vue.renderList(v2.value.rp, (x2, i2) => {
  9892. return vue.openBlock(), vue.createElementBlock("view", {
  9893. class: "item",
  9894. key: i2
  9895. }, [
  9896. vue.createElementVNode("view", { class: "le tag-view" }, [
  9897. vue.createVNode(_component_uni_tag, {
  9898. text: x2.matName + x2.matDose + x2.matUnitName
  9899. }, null, 8, ["text"])
  9900. ]),
  9901. vue.createElementVNode("view", { class: "rig" }, [
  9902. vue.createElementVNode(
  9903. "view",
  9904. { class: "up" },
  9905. vue.toDisplayString(x2.matUsageName),
  9906. 1
  9907. /* TEXT */
  9908. ),
  9909. vue.createElementVNode(
  9910. "view",
  9911. { class: "do" },
  9912. vue.toDisplayString(x2.sign),
  9913. 1
  9914. /* TEXT */
  9915. )
  9916. ])
  9917. ]);
  9918. }),
  9919. 128
  9920. /* KEYED_FRAGMENT */
  9921. ))
  9922. ]),
  9923. vue.createElementVNode("view", { class: "footer" }, [
  9924. vue.createElementVNode("view", { class: "js" }, [
  9925. vue.createTextVNode(
  9926. " 剂数:" + vue.toDisplayString(v2.value.number) + " ",
  9927. 1
  9928. /* TEXT */
  9929. ),
  9930. v2.value.daijianCost !== "" ? (vue.openBlock(), vue.createElementBlock("view", {
  9931. key: 0,
  9932. class: "pies_tips"
  9933. }, " (代煎) ")) : vue.createCommentVNode("v-if", true)
  9934. ]),
  9935. vue.createElementVNode(
  9936. "view",
  9937. { class: "js" },
  9938. vue.toDisplayString(v2.value.dosageForm),
  9939. 1
  9940. /* TEXT */
  9941. ),
  9942. vue.createElementVNode(
  9943. "view",
  9944. { class: "js" },
  9945. vue.toDisplayString(v2.value.prescriptionUsage),
  9946. 1
  9947. /* TEXT */
  9948. ),
  9949. vue.createElementVNode(
  9950. "view",
  9951. { class: "js" },
  9952. "每次" + vue.toDisplayString(v2.value.concentration),
  9953. 1
  9954. /* TEXT */
  9955. ),
  9956. vue.createElementVNode(
  9957. "view",
  9958. { class: "js" },
  9959. vue.toDisplayString(v2.value.frequency),
  9960. 1
  9961. /* TEXT */
  9962. ),
  9963. vue.createElementVNode(
  9964. "view",
  9965. { class: "freque" },
  9966. vue.toDisplayString(v2.value.medicationTime),
  9967. 1
  9968. /* TEXT */
  9969. )
  9970. ]),
  9971. vue.createElementVNode(
  9972. "view",
  9973. { class: "rp-tips" },
  9974. vue.toDisplayString(v2.value.entrust),
  9975. 1
  9976. /* TEXT */
  9977. )
  9978. ]),
  9979. vue.createElementVNode("view", { class: "amountarea" }, [
  9980. vue.createElementVNode("view", { class: "amount" }, [
  9981. vue.createElementVNode("view", { class: "r1" }, [
  9982. vue.createElementVNode(
  9983. "view",
  9984. { class: "pijw" },
  9985. "药品金额:" + vue.toDisplayString(v2.value.prescriptionSum),
  9986. 1
  9987. /* TEXT */
  9988. )
  9989. ]),
  9990. vue.createElementVNode("view", { class: "r2" }, [
  9991. vue.createElementVNode(
  9992. "view",
  9993. { class: "jyf" },
  9994. "煎药费:" + vue.toDisplayString(v2.value.daijianCost),
  9995. 1
  9996. /* TEXT */
  9997. ),
  9998. vue.createElementVNode(
  9999. "view",
  10000. { class: "psf" },
  10001. "配送费:" + vue.toDisplayString(v2.value.distributionCost),
  10002. 1
  10003. /* TEXT */
  10004. )
  10005. ]),
  10006. vue.createElementVNode("view", { class: "r3" }, [
  10007. vue.createTextVNode(
  10008. " 总金额:" + vue.toDisplayString(v2.value.prescriptionTotalSum) + " ",
  10009. 1
  10010. /* TEXT */
  10011. ),
  10012. vue.createCommentVNode(' <view class="zjw"></view> ')
  10013. ])
  10014. ]),
  10015. vue.createElementVNode("view", { class: "service" }, [
  10016. vue.createElementVNode("view", { class: "kf" }, [
  10017. vue.createElementVNode("span", { class: "we" }, "开方:"),
  10018. vue.createTextVNode(
  10019. vue.toDisplayString(v2.value.operateList[0].operater || ""),
  10020. 1
  10021. /* TEXT */
  10022. )
  10023. ]),
  10024. vue.createElementVNode("view", { class: "kf" }, [
  10025. vue.createElementVNode("span", { class: "we" }, "审核:"),
  10026. vue.createTextVNode(
  10027. vue.toDisplayString(v2.value.operateList[1].operater || ""),
  10028. 1
  10029. /* TEXT */
  10030. )
  10031. ]),
  10032. vue.createElementVNode("view", { class: "kf" }, [
  10033. vue.createElementVNode("span", { class: "we" }, "调配:"),
  10034. vue.createTextVNode(
  10035. vue.toDisplayString(v2.value.operateList[2].operater || ""),
  10036. 1
  10037. /* TEXT */
  10038. )
  10039. ]),
  10040. vue.createElementVNode("view", { class: "kf" }, [
  10041. vue.createElementVNode("span", { class: "we" }, "复核:"),
  10042. vue.createTextVNode(
  10043. vue.toDisplayString(v2.value.operateList[3].operater || ""),
  10044. 1
  10045. /* TEXT */
  10046. )
  10047. ]),
  10048. vue.createElementVNode("view", { class: "kf" }, [
  10049. vue.createElementVNode("span", { class: "we" }, "浸泡:"),
  10050. vue.createTextVNode(
  10051. vue.toDisplayString(v2.value.operateList[4].operater || ""),
  10052. 1
  10053. /* TEXT */
  10054. )
  10055. ]),
  10056. vue.createElementVNode("view", { class: "kf" }, [
  10057. vue.createElementVNode("span", { class: "we" }, "煎煮:"),
  10058. vue.createTextVNode(
  10059. vue.toDisplayString(v2.value.operateList[5].operater || ""),
  10060. 1
  10061. /* TEXT */
  10062. )
  10063. ]),
  10064. vue.createElementVNode("view", { class: "kf" }, [
  10065. vue.createElementVNode("span", { class: "we" }, "打包:"),
  10066. vue.createTextVNode(
  10067. vue.toDisplayString(v2.value.operateList[6].operater || ""),
  10068. 1
  10069. /* TEXT */
  10070. )
  10071. ]),
  10072. vue.createElementVNode("view", { class: "kf" }, [
  10073. vue.createElementVNode("span", { class: "we" }, "发药:"),
  10074. vue.createTextVNode(
  10075. vue.toDisplayString(v2.value.operateList[7].operater || ""),
  10076. 1
  10077. /* TEXT */
  10078. )
  10079. ])
  10080. ])
  10081. ]),
  10082. vue.createElementVNode("view", { class: "comment" }, [
  10083. vue.createElementVNode("view", { class: "z" }, "注:"),
  10084. vue.createElementVNode(
  10085. "text",
  10086. null,
  10087. vue.toDisplayString(v2.value.entrust1111),
  10088. 1
  10089. /* TEXT */
  10090. )
  10091. ])
  10092. ])
  10093. ]);
  10094. };
  10095. }
  10096. });
  10097. const PagesDetailDetail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "/Users/sunwubin/source/pharmacy/pages/detail/detail.vue"]]);
  10098. const pages = [
  10099. {
  10100. path: "pages/login/login",
  10101. style: {
  10102. navigationBarTitleText: "",
  10103. enablePullDownRefresh: false,
  10104. navigationStyle: "custom"
  10105. }
  10106. },
  10107. {
  10108. path: "pages/index/index",
  10109. style: {
  10110. navigationStyle: "custom"
  10111. }
  10112. },
  10113. {
  10114. path: "pages/detail/detail",
  10115. style: {
  10116. navigationBarTitleText: "调配详情",
  10117. navigationStyle: "custom",
  10118. enablePullDownRefresh: false
  10119. }
  10120. },
  10121. {
  10122. path: "pages/edit/edit",
  10123. style: {
  10124. navigationBarTitleText: "",
  10125. navigationStyle: "custom",
  10126. enablePullDownRefresh: false
  10127. }
  10128. },
  10129. {
  10130. path: "pages/review/review",
  10131. style: {
  10132. navigationBarTitleText: "",
  10133. enablePullDownRefresh: false,
  10134. navigationStyle: "custom"
  10135. }
  10136. }
  10137. ];
  10138. const globalStyle = {
  10139. navigationBarTextStyle: "black",
  10140. navigationBarTitleText: "中药处方煎配",
  10141. navigationBarBackgroundColor: "#F8F8F8",
  10142. backgroundColor: "#F8F8F8",
  10143. rpxCalcMaxDeviceWidth: 0,
  10144. rpxCalcBaseDeviceWidth: 686
  10145. };
  10146. const uniIdRouter = {};
  10147. const t$1 = {
  10148. pages,
  10149. globalStyle,
  10150. uniIdRouter
  10151. };
  10152. function n(e2) {
  10153. return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
  10154. }
  10155. function s(e2, t2, n2) {
  10156. return e2(n2 = { path: t2, exports: {}, require: function(e3, t3) {
  10157. return function() {
  10158. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  10159. }(null == t3 && n2.path);
  10160. } }, n2.exports), n2.exports;
  10161. }
  10162. var r = s(function(e2, t2) {
  10163. var n2;
  10164. e2.exports = (n2 = n2 || function(e3, t3) {
  10165. var n3 = Object.create || function() {
  10166. function e4() {
  10167. }
  10168. return function(t4) {
  10169. var n4;
  10170. return e4.prototype = t4, n4 = new e4(), e4.prototype = null, n4;
  10171. };
  10172. }(), s2 = {}, r2 = s2.lib = {}, i2 = r2.Base = { extend: function(e4) {
  10173. var t4 = n3(this);
  10174. return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") && this.init !== t4.init || (t4.init = function() {
  10175. t4.$super.init.apply(this, arguments);
  10176. }), t4.init.prototype = t4, t4.$super = this, t4;
  10177. }, create: function() {
  10178. var e4 = this.extend();
  10179. return e4.init.apply(e4, arguments), e4;
  10180. }, init: function() {
  10181. }, mixIn: function(e4) {
  10182. for (var t4 in e4)
  10183. e4.hasOwnProperty(t4) && (this[t4] = e4[t4]);
  10184. e4.hasOwnProperty("toString") && (this.toString = e4.toString);
  10185. }, clone: function() {
  10186. return this.init.prototype.extend(this);
  10187. } }, o2 = r2.WordArray = i2.extend({ init: function(e4, n4) {
  10188. e4 = this.words = e4 || [], this.sigBytes = n4 != t3 ? n4 : 4 * e4.length;
  10189. }, toString: function(e4) {
  10190. return (e4 || c2).stringify(this);
  10191. }, concat: function(e4) {
  10192. var t4 = this.words, n4 = e4.words, s3 = this.sigBytes, r3 = e4.sigBytes;
  10193. if (this.clamp(), s3 % 4)
  10194. for (var i3 = 0; i3 < r3; i3++) {
  10195. var o3 = n4[i3 >>> 2] >>> 24 - i3 % 4 * 8 & 255;
  10196. t4[s3 + i3 >>> 2] |= o3 << 24 - (s3 + i3) % 4 * 8;
  10197. }
  10198. else
  10199. for (i3 = 0; i3 < r3; i3 += 4)
  10200. t4[s3 + i3 >>> 2] = n4[i3 >>> 2];
  10201. return this.sigBytes += r3, this;
  10202. }, clamp: function() {
  10203. var t4 = this.words, n4 = this.sigBytes;
  10204. t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4);
  10205. }, clone: function() {
  10206. var e4 = i2.clone.call(this);
  10207. return e4.words = this.words.slice(0), e4;
  10208. }, random: function(t4) {
  10209. for (var n4, s3 = [], r3 = function(t5) {
  10210. t5 = t5;
  10211. var n5 = 987654321, s4 = 4294967295;
  10212. return function() {
  10213. var r4 = ((n5 = 36969 * (65535 & n5) + (n5 >> 16) & s4) << 16) + (t5 = 18e3 * (65535 & t5) + (t5 >> 16) & s4) & s4;
  10214. return r4 /= 4294967296, (r4 += 0.5) * (e3.random() > 0.5 ? 1 : -1);
  10215. };
  10216. }, i3 = 0; i3 < t4; i3 += 4) {
  10217. var a3 = r3(4294967296 * (n4 || e3.random()));
  10218. n4 = 987654071 * a3(), s3.push(4294967296 * a3() | 0);
  10219. }
  10220. return new o2.init(s3, t4);
  10221. } }), a2 = s2.enc = {}, c2 = a2.Hex = { stringify: function(e4) {
  10222. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  10223. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  10224. s3.push((i3 >>> 4).toString(16)), s3.push((15 & i3).toString(16));
  10225. }
  10226. return s3.join("");
  10227. }, parse: function(e4) {
  10228. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3 += 2)
  10229. n4[s3 >>> 3] |= parseInt(e4.substr(s3, 2), 16) << 24 - s3 % 8 * 4;
  10230. return new o2.init(n4, t4 / 2);
  10231. } }, u2 = a2.Latin1 = { stringify: function(e4) {
  10232. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  10233. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  10234. s3.push(String.fromCharCode(i3));
  10235. }
  10236. return s3.join("");
  10237. }, parse: function(e4) {
  10238. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3++)
  10239. n4[s3 >>> 2] |= (255 & e4.charCodeAt(s3)) << 24 - s3 % 4 * 8;
  10240. return new o2.init(n4, t4);
  10241. } }, h2 = a2.Utf8 = { stringify: function(e4) {
  10242. try {
  10243. return decodeURIComponent(escape(u2.stringify(e4)));
  10244. } catch (e5) {
  10245. throw new Error("Malformed UTF-8 data");
  10246. }
  10247. }, parse: function(e4) {
  10248. return u2.parse(unescape(encodeURIComponent(e4)));
  10249. } }, l2 = r2.BufferedBlockAlgorithm = i2.extend({ reset: function() {
  10250. this._data = new o2.init(), this._nDataBytes = 0;
  10251. }, _append: function(e4) {
  10252. "string" == typeof e4 && (e4 = h2.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes;
  10253. }, _process: function(t4) {
  10254. var n4 = this._data, s3 = n4.words, r3 = n4.sigBytes, i3 = this.blockSize, a3 = r3 / (4 * i3), c3 = (a3 = t4 ? e3.ceil(a3) : e3.max((0 | a3) - this._minBufferSize, 0)) * i3, u3 = e3.min(4 * c3, r3);
  10255. if (c3) {
  10256. for (var h3 = 0; h3 < c3; h3 += i3)
  10257. this._doProcessBlock(s3, h3);
  10258. var l3 = s3.splice(0, c3);
  10259. n4.sigBytes -= u3;
  10260. }
  10261. return new o2.init(l3, u3);
  10262. }, clone: function() {
  10263. var e4 = i2.clone.call(this);
  10264. return e4._data = this._data.clone(), e4;
  10265. }, _minBufferSize: 0 });
  10266. r2.Hasher = l2.extend({ cfg: i2.extend(), init: function(e4) {
  10267. this.cfg = this.cfg.extend(e4), this.reset();
  10268. }, reset: function() {
  10269. l2.reset.call(this), this._doReset();
  10270. }, update: function(e4) {
  10271. return this._append(e4), this._process(), this;
  10272. }, finalize: function(e4) {
  10273. return e4 && this._append(e4), this._doFinalize();
  10274. }, blockSize: 16, _createHelper: function(e4) {
  10275. return function(t4, n4) {
  10276. return new e4.init(n4).finalize(t4);
  10277. };
  10278. }, _createHmacHelper: function(e4) {
  10279. return function(t4, n4) {
  10280. return new d2.HMAC.init(e4, n4).finalize(t4);
  10281. };
  10282. } });
  10283. var d2 = s2.algo = {};
  10284. return s2;
  10285. }(Math), n2);
  10286. }), i = r, o = (s(function(e2, t2) {
  10287. var n2;
  10288. e2.exports = (n2 = i, function(e3) {
  10289. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [];
  10290. !function() {
  10291. for (var t4 = 0; t4 < 64; t4++)
  10292. a2[t4] = 4294967296 * e3.abs(e3.sin(t4 + 1)) | 0;
  10293. }();
  10294. var c2 = o2.MD5 = i2.extend({ _doReset: function() {
  10295. this._hash = new r2.init([1732584193, 4023233417, 2562383102, 271733878]);
  10296. }, _doProcessBlock: function(e4, t4) {
  10297. for (var n3 = 0; n3 < 16; n3++) {
  10298. var s3 = t4 + n3, r3 = e4[s3];
  10299. e4[s3] = 16711935 & (r3 << 8 | r3 >>> 24) | 4278255360 & (r3 << 24 | r3 >>> 8);
  10300. }
  10301. var i3 = this._hash.words, o3 = e4[t4 + 0], c3 = e4[t4 + 1], p2 = e4[t4 + 2], f2 = e4[t4 + 3], g2 = e4[t4 + 4], m2 = e4[t4 + 5], y2 = e4[t4 + 6], _2 = e4[t4 + 7], w2 = e4[t4 + 8], v2 = e4[t4 + 9], I2 = e4[t4 + 10], S2 = e4[t4 + 11], b2 = e4[t4 + 12], k2 = e4[t4 + 13], C = e4[t4 + 14], T2 = e4[t4 + 15], P2 = i3[0], A2 = i3[1], E2 = i3[2], O = i3[3];
  10302. P2 = u2(P2, A2, E2, O, o3, 7, a2[0]), O = u2(O, P2, A2, E2, c3, 12, a2[1]), E2 = u2(E2, O, P2, A2, p2, 17, a2[2]), A2 = u2(A2, E2, O, P2, f2, 22, a2[3]), P2 = u2(P2, A2, E2, O, g2, 7, a2[4]), O = u2(O, P2, A2, E2, m2, 12, a2[5]), E2 = u2(E2, O, P2, A2, y2, 17, a2[6]), A2 = u2(A2, E2, O, P2, _2, 22, a2[7]), P2 = u2(P2, A2, E2, O, w2, 7, a2[8]), O = u2(O, P2, A2, E2, v2, 12, a2[9]), E2 = u2(E2, O, P2, A2, I2, 17, a2[10]), A2 = u2(A2, E2, O, P2, S2, 22, a2[11]), P2 = u2(P2, A2, E2, O, b2, 7, a2[12]), O = u2(O, P2, A2, E2, k2, 12, a2[13]), E2 = u2(E2, O, P2, A2, C, 17, a2[14]), P2 = h2(P2, A2 = u2(A2, E2, O, P2, T2, 22, a2[15]), E2, O, c3, 5, a2[16]), O = h2(O, P2, A2, E2, y2, 9, a2[17]), E2 = h2(E2, O, P2, A2, S2, 14, a2[18]), A2 = h2(A2, E2, O, P2, o3, 20, a2[19]), P2 = h2(P2, A2, E2, O, m2, 5, a2[20]), O = h2(O, P2, A2, E2, I2, 9, a2[21]), E2 = h2(E2, O, P2, A2, T2, 14, a2[22]), A2 = h2(A2, E2, O, P2, g2, 20, a2[23]), P2 = h2(P2, A2, E2, O, v2, 5, a2[24]), O = h2(O, P2, A2, E2, C, 9, a2[25]), E2 = h2(E2, O, P2, A2, f2, 14, a2[26]), A2 = h2(A2, E2, O, P2, w2, 20, a2[27]), P2 = h2(P2, A2, E2, O, k2, 5, a2[28]), O = h2(O, P2, A2, E2, p2, 9, a2[29]), E2 = h2(E2, O, P2, A2, _2, 14, a2[30]), P2 = l2(P2, A2 = h2(A2, E2, O, P2, b2, 20, a2[31]), E2, O, m2, 4, a2[32]), O = l2(O, P2, A2, E2, w2, 11, a2[33]), E2 = l2(E2, O, P2, A2, S2, 16, a2[34]), A2 = l2(A2, E2, O, P2, C, 23, a2[35]), P2 = l2(P2, A2, E2, O, c3, 4, a2[36]), O = l2(O, P2, A2, E2, g2, 11, a2[37]), E2 = l2(E2, O, P2, A2, _2, 16, a2[38]), A2 = l2(A2, E2, O, P2, I2, 23, a2[39]), P2 = l2(P2, A2, E2, O, k2, 4, a2[40]), O = l2(O, P2, A2, E2, o3, 11, a2[41]), E2 = l2(E2, O, P2, A2, f2, 16, a2[42]), A2 = l2(A2, E2, O, P2, y2, 23, a2[43]), P2 = l2(P2, A2, E2, O, v2, 4, a2[44]), O = l2(O, P2, A2, E2, b2, 11, a2[45]), E2 = l2(E2, O, P2, A2, T2, 16, a2[46]), P2 = d2(P2, A2 = l2(A2, E2, O, P2, p2, 23, a2[47]), E2, O, o3, 6, a2[48]), O = d2(O, P2, A2, E2, _2, 10, a2[49]), E2 = d2(E2, O, P2, A2, C, 15, a2[50]), A2 = d2(A2, E2, O, P2, m2, 21, a2[51]), P2 = d2(P2, A2, E2, O, b2, 6, a2[52]), O = d2(O, P2, A2, E2, f2, 10, a2[53]), E2 = d2(E2, O, P2, A2, I2, 15, a2[54]), A2 = d2(A2, E2, O, P2, c3, 21, a2[55]), P2 = d2(P2, A2, E2, O, w2, 6, a2[56]), O = d2(O, P2, A2, E2, T2, 10, a2[57]), E2 = d2(E2, O, P2, A2, y2, 15, a2[58]), A2 = d2(A2, E2, O, P2, k2, 21, a2[59]), P2 = d2(P2, A2, E2, O, g2, 6, a2[60]), O = d2(O, P2, A2, E2, S2, 10, a2[61]), E2 = d2(E2, O, P2, A2, p2, 15, a2[62]), A2 = d2(A2, E2, O, P2, v2, 21, a2[63]), i3[0] = i3[0] + P2 | 0, i3[1] = i3[1] + A2 | 0, i3[2] = i3[2] + E2 | 0, i3[3] = i3[3] + O | 0;
  10303. }, _doFinalize: function() {
  10304. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  10305. n3[r3 >>> 5] |= 128 << 24 - r3 % 32;
  10306. var i3 = e3.floor(s3 / 4294967296), o3 = s3;
  10307. n3[15 + (r3 + 64 >>> 9 << 4)] = 16711935 & (i3 << 8 | i3 >>> 24) | 4278255360 & (i3 << 24 | i3 >>> 8), n3[14 + (r3 + 64 >>> 9 << 4)] = 16711935 & (o3 << 8 | o3 >>> 24) | 4278255360 & (o3 << 24 | o3 >>> 8), t4.sigBytes = 4 * (n3.length + 1), this._process();
  10308. for (var a3 = this._hash, c3 = a3.words, u3 = 0; u3 < 4; u3++) {
  10309. var h3 = c3[u3];
  10310. c3[u3] = 16711935 & (h3 << 8 | h3 >>> 24) | 4278255360 & (h3 << 24 | h3 >>> 8);
  10311. }
  10312. return a3;
  10313. }, clone: function() {
  10314. var e4 = i2.clone.call(this);
  10315. return e4._hash = this._hash.clone(), e4;
  10316. } });
  10317. function u2(e4, t4, n3, s3, r3, i3, o3) {
  10318. var a3 = e4 + (t4 & n3 | ~t4 & s3) + r3 + o3;
  10319. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  10320. }
  10321. function h2(e4, t4, n3, s3, r3, i3, o3) {
  10322. var a3 = e4 + (t4 & s3 | n3 & ~s3) + r3 + o3;
  10323. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  10324. }
  10325. function l2(e4, t4, n3, s3, r3, i3, o3) {
  10326. var a3 = e4 + (t4 ^ n3 ^ s3) + r3 + o3;
  10327. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  10328. }
  10329. function d2(e4, t4, n3, s3, r3, i3, o3) {
  10330. var a3 = e4 + (n3 ^ (t4 | ~s3)) + r3 + o3;
  10331. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  10332. }
  10333. t3.MD5 = i2._createHelper(c2), t3.HmacMD5 = i2._createHmacHelper(c2);
  10334. }(Math), n2.MD5);
  10335. }), s(function(e2, t2) {
  10336. var n2;
  10337. e2.exports = (n2 = i, void function() {
  10338. var e3 = n2, t3 = e3.lib.Base, s2 = e3.enc.Utf8;
  10339. e3.algo.HMAC = t3.extend({ init: function(e4, t4) {
  10340. e4 = this._hasher = new e4.init(), "string" == typeof t4 && (t4 = s2.parse(t4));
  10341. var n3 = e4.blockSize, r2 = 4 * n3;
  10342. t4.sigBytes > r2 && (t4 = e4.finalize(t4)), t4.clamp();
  10343. for (var i2 = this._oKey = t4.clone(), o2 = this._iKey = t4.clone(), a2 = i2.words, c2 = o2.words, u2 = 0; u2 < n3; u2++)
  10344. a2[u2] ^= 1549556828, c2[u2] ^= 909522486;
  10345. i2.sigBytes = o2.sigBytes = r2, this.reset();
  10346. }, reset: function() {
  10347. var e4 = this._hasher;
  10348. e4.reset(), e4.update(this._iKey);
  10349. }, update: function(e4) {
  10350. return this._hasher.update(e4), this;
  10351. }, finalize: function(e4) {
  10352. var t4 = this._hasher, n3 = t4.finalize(e4);
  10353. return t4.reset(), t4.finalize(this._oKey.clone().concat(n3));
  10354. } });
  10355. }());
  10356. }), s(function(e2, t2) {
  10357. e2.exports = i.HmacMD5;
  10358. })), a = s(function(e2, t2) {
  10359. e2.exports = i.enc.Utf8;
  10360. }), c = s(function(e2, t2) {
  10361. var n2;
  10362. e2.exports = (n2 = i, function() {
  10363. var e3 = n2, t3 = e3.lib.WordArray;
  10364. function s2(e4, n3, s3) {
  10365. for (var r2 = [], i2 = 0, o2 = 0; o2 < n3; o2++)
  10366. if (o2 % 4) {
  10367. var a2 = s3[e4.charCodeAt(o2 - 1)] << o2 % 4 * 2, c2 = s3[e4.charCodeAt(o2)] >>> 6 - o2 % 4 * 2;
  10368. r2[i2 >>> 2] |= (a2 | c2) << 24 - i2 % 4 * 8, i2++;
  10369. }
  10370. return t3.create(r2, i2);
  10371. }
  10372. e3.enc.Base64 = { stringify: function(e4) {
  10373. var t4 = e4.words, n3 = e4.sigBytes, s3 = this._map;
  10374. e4.clamp();
  10375. for (var r2 = [], i2 = 0; i2 < n3; i2 += 3)
  10376. for (var o2 = (t4[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255) << 16 | (t4[i2 + 1 >>> 2] >>> 24 - (i2 + 1) % 4 * 8 & 255) << 8 | t4[i2 + 2 >>> 2] >>> 24 - (i2 + 2) % 4 * 8 & 255, a2 = 0; a2 < 4 && i2 + 0.75 * a2 < n3; a2++)
  10377. r2.push(s3.charAt(o2 >>> 6 * (3 - a2) & 63));
  10378. var c2 = s3.charAt(64);
  10379. if (c2)
  10380. for (; r2.length % 4; )
  10381. r2.push(c2);
  10382. return r2.join("");
  10383. }, parse: function(e4) {
  10384. var t4 = e4.length, n3 = this._map, r2 = this._reverseMap;
  10385. if (!r2) {
  10386. r2 = this._reverseMap = [];
  10387. for (var i2 = 0; i2 < n3.length; i2++)
  10388. r2[n3.charCodeAt(i2)] = i2;
  10389. }
  10390. var o2 = n3.charAt(64);
  10391. if (o2) {
  10392. var a2 = e4.indexOf(o2);
  10393. -1 !== a2 && (t4 = a2);
  10394. }
  10395. return s2(e4, t4, r2);
  10396. }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
  10397. }(), n2.enc.Base64);
  10398. });
  10399. const u = "FUNCTION", h = "OBJECT", l = "CLIENT_DB", d = "pending", p = "fullfilled", f = "rejected";
  10400. function g(e2) {
  10401. return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase();
  10402. }
  10403. function m(e2) {
  10404. return "object" === g(e2);
  10405. }
  10406. function y(e2) {
  10407. return "function" == typeof e2;
  10408. }
  10409. function _(e2) {
  10410. return function() {
  10411. try {
  10412. return e2.apply(e2, arguments);
  10413. } catch (e3) {
  10414. console.error(e3);
  10415. }
  10416. };
  10417. }
  10418. const w = "REJECTED", v = "NOT_PENDING";
  10419. class I {
  10420. constructor({ createPromise: e2, retryRule: t2 = w } = {}) {
  10421. this.createPromise = e2, this.status = null, this.promise = null, this.retryRule = t2;
  10422. }
  10423. get needRetry() {
  10424. if (!this.status)
  10425. return true;
  10426. switch (this.retryRule) {
  10427. case w:
  10428. return this.status === f;
  10429. case v:
  10430. return this.status !== d;
  10431. }
  10432. }
  10433. exec() {
  10434. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then((e2) => (this.status = p, Promise.resolve(e2)), (e2) => (this.status = f, Promise.reject(e2))), this.promise) : this.promise;
  10435. }
  10436. }
  10437. function S(e2) {
  10438. return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
  10439. }
  10440. const b = true, k = "app", T = S([]), P = k, A = S(""), E = S("[]") || [];
  10441. let x = "";
  10442. try {
  10443. x = "__UNI__F501A17";
  10444. } catch (e2) {
  10445. }
  10446. let R = {};
  10447. function U(e2, t2 = {}) {
  10448. var n2, s2;
  10449. return n2 = R, s2 = e2, Object.prototype.hasOwnProperty.call(n2, s2) || (R[e2] = t2), R[e2];
  10450. }
  10451. R = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {};
  10452. const L = ["invoke", "success", "fail", "complete"], N = U("_globalUniCloudInterceptor");
  10453. function D(e2, t2) {
  10454. N[e2] || (N[e2] = {}), m(t2) && Object.keys(t2).forEach((n2) => {
  10455. L.indexOf(n2) > -1 && function(e3, t3, n3) {
  10456. let s2 = N[e3][t3];
  10457. s2 || (s2 = N[e3][t3] = []), -1 === s2.indexOf(n3) && y(n3) && s2.push(n3);
  10458. }(e2, n2, t2[n2]);
  10459. });
  10460. }
  10461. function F(e2, t2) {
  10462. N[e2] || (N[e2] = {}), m(t2) ? Object.keys(t2).forEach((n2) => {
  10463. L.indexOf(n2) > -1 && function(e3, t3, n3) {
  10464. const s2 = N[e3][t3];
  10465. if (!s2)
  10466. return;
  10467. const r2 = s2.indexOf(n3);
  10468. r2 > -1 && s2.splice(r2, 1);
  10469. }(e2, n2, t2[n2]);
  10470. }) : delete N[e2];
  10471. }
  10472. function M(e2, t2) {
  10473. return e2 && 0 !== e2.length ? e2.reduce((e3, n2) => e3.then(() => n2(t2)), Promise.resolve()) : Promise.resolve();
  10474. }
  10475. function q(e2, t2) {
  10476. return N[e2] && N[e2][t2] || [];
  10477. }
  10478. function K(e2) {
  10479. D("callObject", e2);
  10480. }
  10481. const j = U("_globalUniCloudListener"), B = "response", $ = "needLogin", W = "refreshToken", z = "clientdb", J = "cloudfunction", H = "cloudobject";
  10482. function G(e2) {
  10483. return j[e2] || (j[e2] = []), j[e2];
  10484. }
  10485. function V(e2, t2) {
  10486. const n2 = G(e2);
  10487. n2.includes(t2) || n2.push(t2);
  10488. }
  10489. function Y(e2, t2) {
  10490. const n2 = G(e2), s2 = n2.indexOf(t2);
  10491. -1 !== s2 && n2.splice(s2, 1);
  10492. }
  10493. function Q(e2, t2) {
  10494. const n2 = G(e2);
  10495. for (let e3 = 0; e3 < n2.length; e3++) {
  10496. (0, n2[e3])(t2);
  10497. }
  10498. }
  10499. let X, Z = false;
  10500. function ee() {
  10501. return X || (X = new Promise((e2) => {
  10502. Z && e2(), function t2() {
  10503. if ("function" == typeof getCurrentPages) {
  10504. const t3 = getCurrentPages();
  10505. t3 && t3[0] && (Z = true, e2());
  10506. }
  10507. Z || setTimeout(() => {
  10508. t2();
  10509. }, 30);
  10510. }();
  10511. }), X);
  10512. }
  10513. function te(e2) {
  10514. const t2 = {};
  10515. for (const n2 in e2) {
  10516. const s2 = e2[n2];
  10517. y(s2) && (t2[n2] = _(s2));
  10518. }
  10519. return t2;
  10520. }
  10521. class ne extends Error {
  10522. constructor(e2) {
  10523. super(e2.message), this.errMsg = e2.message || e2.errMsg || "unknown system error", this.code = this.errCode = e2.code || e2.errCode || "SYSTEM_ERROR", this.errSubject = this.subject = e2.subject || e2.errSubject, this.cause = e2.cause, this.requestId = e2.requestId;
  10524. }
  10525. toJson(e2 = 0) {
  10526. if (!(e2 >= 10))
  10527. return e2++, { errCode: this.errCode, errMsg: this.errMsg, errSubject: this.errSubject, cause: this.cause && this.cause.toJson ? this.cause.toJson(e2) : this.cause };
  10528. }
  10529. }
  10530. var se = { request: (e2) => uni.request(e2), uploadFile: (e2) => uni.uploadFile(e2), setStorageSync: (e2, t2) => uni.setStorageSync(e2, t2), getStorageSync: (e2) => uni.getStorageSync(e2), removeStorageSync: (e2) => uni.removeStorageSync(e2), clearStorageSync: () => uni.clearStorageSync() };
  10531. function re(e2) {
  10532. return e2 && re(e2.__v_raw) || e2;
  10533. }
  10534. function ie() {
  10535. return { token: se.getStorageSync("uni_id_token") || se.getStorageSync("uniIdToken"), tokenExpired: se.getStorageSync("uni_id_token_expired") };
  10536. }
  10537. function oe({ token: e2, tokenExpired: t2 } = {}) {
  10538. e2 && se.setStorageSync("uni_id_token", e2), t2 && se.setStorageSync("uni_id_token_expired", t2);
  10539. }
  10540. let ae, ce;
  10541. function ue() {
  10542. return ae || (ae = uni.getSystemInfoSync()), ae;
  10543. }
  10544. function he() {
  10545. let e2, t2;
  10546. try {
  10547. if (uni.getLaunchOptionsSync) {
  10548. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1)
  10549. return;
  10550. const { scene: n2, channel: s2 } = uni.getLaunchOptionsSync();
  10551. e2 = s2, t2 = n2;
  10552. }
  10553. } catch (e3) {
  10554. }
  10555. return { channel: e2, scene: t2 };
  10556. }
  10557. function le() {
  10558. const e2 = uni.getLocale && uni.getLocale() || "en";
  10559. if (ce)
  10560. return { ...ce, locale: e2, LOCALE: e2 };
  10561. const t2 = ue(), { deviceId: n2, osName: s2, uniPlatform: r2, appId: i2 } = t2, o2 = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  10562. for (let e3 = 0; e3 < o2.length; e3++) {
  10563. delete t2[o2[e3]];
  10564. }
  10565. return ce = { PLATFORM: r2, OS: s2, APPID: i2, DEVICEID: n2, ...he(), ...t2 }, { ...ce, locale: e2, LOCALE: e2 };
  10566. }
  10567. var de = { sign: function(e2, t2) {
  10568. let n2 = "";
  10569. return Object.keys(e2).sort().forEach(function(t3) {
  10570. e2[t3] && (n2 = n2 + "&" + t3 + "=" + e2[t3]);
  10571. }), n2 = n2.slice(1), o(n2, t2).toString();
  10572. }, wrappedRequest: function(e2, t2) {
  10573. return new Promise((n2, s2) => {
  10574. t2(Object.assign(e2, { complete(e3) {
  10575. e3 || (e3 = {});
  10576. const t3 = e3.data && e3.data.header && e3.data.header["x-serverless-request-id"] || e3.header && e3.header["request-id"];
  10577. if (!e3.statusCode || e3.statusCode >= 400)
  10578. return s2(new ne({ code: "SYS_ERR", message: e3.errMsg || "request:fail", requestId: t3 }));
  10579. const r2 = e3.data;
  10580. if (r2.error)
  10581. return s2(new ne({ code: r2.error.code, message: r2.error.message, requestId: t3 }));
  10582. r2.result = r2.data, r2.requestId = t3, delete r2.data, n2(r2);
  10583. } }));
  10584. });
  10585. }, toBase64: function(e2) {
  10586. return c.stringify(a.parse(e2));
  10587. } }, pe = { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" };
  10588. const { t: fe } = initVueI18n({ "zh-Hans": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, "zh-Hant": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, en: pe, fr: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, es: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, ja: pe }, "zh-Hans");
  10589. var ge = class {
  10590. constructor(e2) {
  10591. ["spaceId", "clientSecret"].forEach((t2) => {
  10592. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  10593. throw new Error(fe("uniCloud.init.paramRequired", { param: t2 }));
  10594. }), this.config = Object.assign({}, { endpoint: 0 === e2.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com" }, e2), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = se, this._getAccessTokenPromiseHub = new I({ createPromise: () => this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then((e3) => {
  10595. if (!e3.result || !e3.result.accessToken)
  10596. throw new ne({ code: "AUTH_FAILED", message: "获取accessToken失败" });
  10597. this.setAccessToken(e3.result.accessToken);
  10598. }), retryRule: v });
  10599. }
  10600. get hasAccessToken() {
  10601. return !!this.accessToken;
  10602. }
  10603. setAccessToken(e2) {
  10604. this.accessToken = e2;
  10605. }
  10606. requestWrapped(e2) {
  10607. return de.wrappedRequest(e2, this.adapter.request);
  10608. }
  10609. requestAuth(e2) {
  10610. return this.requestWrapped(e2);
  10611. }
  10612. request(e2, t2) {
  10613. return Promise.resolve().then(() => this.hasAccessToken ? t2 ? this.requestWrapped(e2) : this.requestWrapped(e2).catch((t3) => new Promise((e3, n2) => {
  10614. !t3 || "GATEWAY_INVALID_TOKEN" !== t3.code && "InvalidParameter.InvalidToken" !== t3.code ? n2(t3) : e3();
  10615. }).then(() => this.getAccessToken()).then(() => {
  10616. const t4 = this.rebuildRequest(e2);
  10617. return this.request(t4, true);
  10618. })) : this.getAccessToken().then(() => {
  10619. const t3 = this.rebuildRequest(e2);
  10620. return this.request(t3, true);
  10621. }));
  10622. }
  10623. rebuildRequest(e2) {
  10624. const t2 = Object.assign({}, e2);
  10625. return t2.data.token = this.accessToken, t2.header["x-basement-token"] = this.accessToken, t2.header["x-serverless-sign"] = de.sign(t2.data, this.config.clientSecret), t2;
  10626. }
  10627. setupRequest(e2, t2) {
  10628. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  10629. return "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = de.sign(n2, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: s2 };
  10630. }
  10631. getAccessToken() {
  10632. return this._getAccessTokenPromiseHub.exec();
  10633. }
  10634. async authorize() {
  10635. await this.getAccessToken();
  10636. }
  10637. callFunction(e2) {
  10638. const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
  10639. return this.request(this.setupRequest(t2));
  10640. }
  10641. getOSSUploadOptionsFromPath(e2) {
  10642. const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
  10643. return this.request(this.setupRequest(t2));
  10644. }
  10645. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  10646. return new Promise((o2, a2) => {
  10647. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, header: { "X-OSS-server-side-encrpytion": "AES256" }, success(e3) {
  10648. e3 && e3.statusCode < 400 ? o2(e3) : a2(new ne({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  10649. }, fail(e3) {
  10650. a2(new ne({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  10651. } });
  10652. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  10653. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  10654. });
  10655. });
  10656. }
  10657. reportOSSUpload(e2) {
  10658. const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
  10659. return this.request(this.setupRequest(t2));
  10660. }
  10661. async uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", cloudPathAsRealPath: s2 = false, onUploadProgress: r2, config: i2 }) {
  10662. if ("string" !== g(t2))
  10663. throw new ne({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  10664. if (!(t2 = t2.trim()))
  10665. throw new ne({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  10666. if (/:\/\//.test(t2))
  10667. throw new ne({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  10668. const o2 = i2 && i2.envType || this.config.envType;
  10669. if (s2 && ("/" !== t2[0] && (t2 = "/" + t2), t2.indexOf("\\") > -1))
  10670. throw new ne({ code: "INVALID_PARAM", message: "使用cloudPath作为路径时,cloudPath不可包含“\\”" });
  10671. const a2 = (await this.getOSSUploadOptionsFromPath({ env: o2, filename: s2 ? t2.split("/").pop() : t2, fileId: s2 ? t2 : void 0 })).result, c2 = "https://" + a2.cdnDomain + "/" + a2.ossPath, { securityToken: u2, accessKeyId: h2, signature: l2, host: d2, ossPath: p2, id: f2, policy: m2, ossCallbackUrl: y2 } = a2, _2 = { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: h2, Signature: l2, host: d2, id: f2, key: p2, policy: m2, success_action_status: 200 };
  10672. if (u2 && (_2["x-oss-security-token"] = u2), y2) {
  10673. const e3 = JSON.stringify({ callbackUrl: y2, callbackBody: JSON.stringify({ fileId: f2, spaceId: this.config.spaceId }), callbackBodyType: "application/json" });
  10674. _2.callback = de.toBase64(e3);
  10675. }
  10676. const w2 = { url: "https://" + a2.host, formData: _2, fileName: "file", name: "file", filePath: e2, fileType: n2 };
  10677. if (await this.uploadFileToOSS(Object.assign({}, w2, { onUploadProgress: r2 })), y2)
  10678. return { success: true, filePath: e2, fileID: c2 };
  10679. if ((await this.reportOSSUpload({ id: f2 })).success)
  10680. return { success: true, filePath: e2, fileID: c2 };
  10681. throw new ne({ code: "UPLOAD_FAILED", message: "文件上传失败" });
  10682. }
  10683. getTempFileURL({ fileList: e2 } = {}) {
  10684. return new Promise((t2, n2) => {
  10685. Array.isArray(e2) && 0 !== e2.length || n2(new ne({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t2({ fileList: e2.map((e3) => ({ fileID: e3, tempFileURL: e3 })) });
  10686. });
  10687. }
  10688. async getFileInfo({ fileList: e2 } = {}) {
  10689. if (!Array.isArray(e2) || 0 === e2.length)
  10690. throw new ne({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  10691. const t2 = { method: "serverless.file.resource.info", params: JSON.stringify({ id: e2.map((e3) => e3.split("?")[0]).join(",") }) };
  10692. return { fileList: (await this.request(this.setupRequest(t2))).result };
  10693. }
  10694. };
  10695. var me = { init(e2) {
  10696. const t2 = new ge(e2), n2 = { signInAnonymously: function() {
  10697. return t2.authorize();
  10698. }, getLoginState: function() {
  10699. return Promise.resolve(false);
  10700. } };
  10701. return t2.auth = function() {
  10702. return n2;
  10703. }, t2.customAuth = t2.auth, t2;
  10704. } };
  10705. const ye = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  10706. var _e;
  10707. !function(e2) {
  10708. e2.local = "local", e2.none = "none", e2.session = "session";
  10709. }(_e || (_e = {}));
  10710. var we = function() {
  10711. };
  10712. const ve = () => {
  10713. let e2;
  10714. if (!Promise) {
  10715. e2 = () => {
  10716. }, e2.promise = {};
  10717. const t3 = () => {
  10718. throw new ne({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });
  10719. };
  10720. return Object.defineProperty(e2.promise, "then", { get: t3 }), Object.defineProperty(e2.promise, "catch", { get: t3 }), e2;
  10721. }
  10722. const t2 = new Promise((t3, n2) => {
  10723. e2 = (e3, s2) => e3 ? n2(e3) : t3(s2);
  10724. });
  10725. return e2.promise = t2, e2;
  10726. };
  10727. function Ie(e2) {
  10728. return void 0 === e2;
  10729. }
  10730. function Se(e2) {
  10731. return "[object Null]" === Object.prototype.toString.call(e2);
  10732. }
  10733. var be;
  10734. function ke(e2) {
  10735. const t2 = (n2 = e2, "[object Array]" === Object.prototype.toString.call(n2) ? e2 : [e2]);
  10736. var n2;
  10737. for (const e3 of t2) {
  10738. const { isMatch: t3, genAdapter: n3, runtime: s2 } = e3;
  10739. if (t3())
  10740. return { adapter: n3(), runtime: s2 };
  10741. }
  10742. }
  10743. !function(e2) {
  10744. e2.WEB = "web", e2.WX_MP = "wx_mp";
  10745. }(be || (be = {}));
  10746. const Ce = { adapter: null, runtime: void 0 }, Te = ["anonymousUuidKey"];
  10747. class Pe extends we {
  10748. constructor() {
  10749. super(), Ce.adapter.root.tcbObject || (Ce.adapter.root.tcbObject = {});
  10750. }
  10751. setItem(e2, t2) {
  10752. Ce.adapter.root.tcbObject[e2] = t2;
  10753. }
  10754. getItem(e2) {
  10755. return Ce.adapter.root.tcbObject[e2];
  10756. }
  10757. removeItem(e2) {
  10758. delete Ce.adapter.root.tcbObject[e2];
  10759. }
  10760. clear() {
  10761. delete Ce.adapter.root.tcbObject;
  10762. }
  10763. }
  10764. function Ae(e2, t2) {
  10765. switch (e2) {
  10766. case "local":
  10767. return t2.localStorage || new Pe();
  10768. case "none":
  10769. return new Pe();
  10770. default:
  10771. return t2.sessionStorage || new Pe();
  10772. }
  10773. }
  10774. class Ee {
  10775. constructor(e2) {
  10776. if (!this._storage) {
  10777. this._persistence = Ce.adapter.primaryStorage || e2.persistence, this._storage = Ae(this._persistence, Ce.adapter);
  10778. const t2 = `access_token_${e2.env}`, n2 = `access_token_expire_${e2.env}`, s2 = `refresh_token_${e2.env}`, r2 = `anonymous_uuid_${e2.env}`, i2 = `login_type_${e2.env}`, o2 = `user_info_${e2.env}`;
  10779. this.keys = { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2, anonymousUuidKey: r2, loginTypeKey: i2, userInfoKey: o2 };
  10780. }
  10781. }
  10782. updatePersistence(e2) {
  10783. if (e2 === this._persistence)
  10784. return;
  10785. const t2 = "local" === this._persistence;
  10786. this._persistence = e2;
  10787. const n2 = Ae(e2, Ce.adapter);
  10788. for (const e3 in this.keys) {
  10789. const s2 = this.keys[e3];
  10790. if (t2 && Te.includes(e3))
  10791. continue;
  10792. const r2 = this._storage.getItem(s2);
  10793. Ie(r2) || Se(r2) || (n2.setItem(s2, r2), this._storage.removeItem(s2));
  10794. }
  10795. this._storage = n2;
  10796. }
  10797. setStore(e2, t2, n2) {
  10798. if (!this._storage)
  10799. return;
  10800. const s2 = { version: n2 || "localCachev1", content: t2 }, r2 = JSON.stringify(s2);
  10801. try {
  10802. this._storage.setItem(e2, r2);
  10803. } catch (e3) {
  10804. throw e3;
  10805. }
  10806. }
  10807. getStore(e2, t2) {
  10808. try {
  10809. if (!this._storage)
  10810. return;
  10811. } catch (e3) {
  10812. return "";
  10813. }
  10814. t2 = t2 || "localCachev1";
  10815. const n2 = this._storage.getItem(e2);
  10816. if (!n2)
  10817. return "";
  10818. if (n2.indexOf(t2) >= 0) {
  10819. return JSON.parse(n2).content;
  10820. }
  10821. return "";
  10822. }
  10823. removeStore(e2) {
  10824. this._storage.removeItem(e2);
  10825. }
  10826. }
  10827. const Oe = {}, xe = {};
  10828. function Re(e2) {
  10829. return Oe[e2];
  10830. }
  10831. class Ue {
  10832. constructor(e2, t2) {
  10833. this.data = t2 || null, this.name = e2;
  10834. }
  10835. }
  10836. class Le extends Ue {
  10837. constructor(e2, t2) {
  10838. super("error", { error: e2, data: t2 }), this.error = e2;
  10839. }
  10840. }
  10841. const Ne = new class {
  10842. constructor() {
  10843. this._listeners = {};
  10844. }
  10845. on(e2, t2) {
  10846. return function(e3, t3, n2) {
  10847. n2[e3] = n2[e3] || [], n2[e3].push(t3);
  10848. }(e2, t2, this._listeners), this;
  10849. }
  10850. off(e2, t2) {
  10851. return function(e3, t3, n2) {
  10852. if (n2 && n2[e3]) {
  10853. const s2 = n2[e3].indexOf(t3);
  10854. -1 !== s2 && n2[e3].splice(s2, 1);
  10855. }
  10856. }(e2, t2, this._listeners), this;
  10857. }
  10858. fire(e2, t2) {
  10859. if (e2 instanceof Le)
  10860. return console.error(e2.error), this;
  10861. const n2 = "string" == typeof e2 ? new Ue(e2, t2 || {}) : e2;
  10862. const s2 = n2.name;
  10863. if (this._listens(s2)) {
  10864. n2.target = this;
  10865. const e3 = this._listeners[s2] ? [...this._listeners[s2]] : [];
  10866. for (const t3 of e3)
  10867. t3.call(this, n2);
  10868. }
  10869. return this;
  10870. }
  10871. _listens(e2) {
  10872. return this._listeners[e2] && this._listeners[e2].length > 0;
  10873. }
  10874. }();
  10875. function De(e2, t2) {
  10876. Ne.on(e2, t2);
  10877. }
  10878. function Fe(e2, t2 = {}) {
  10879. Ne.fire(e2, t2);
  10880. }
  10881. function Me(e2, t2) {
  10882. Ne.off(e2, t2);
  10883. }
  10884. const qe = "loginStateChanged", Ke = "loginStateExpire", je = "loginTypeChanged", Be = "anonymousConverted", $e = "refreshAccessToken";
  10885. var We;
  10886. !function(e2) {
  10887. e2.ANONYMOUS = "ANONYMOUS", e2.WECHAT = "WECHAT", e2.WECHAT_PUBLIC = "WECHAT-PUBLIC", e2.WECHAT_OPEN = "WECHAT-OPEN", e2.CUSTOM = "CUSTOM", e2.EMAIL = "EMAIL", e2.USERNAME = "USERNAME", e2.NULL = "NULL";
  10888. }(We || (We = {}));
  10889. const ze = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"], Je = { "X-SDK-Version": "1.3.5" };
  10890. function He(e2, t2, n2) {
  10891. const s2 = e2[t2];
  10892. e2[t2] = function(t3) {
  10893. const r2 = {}, i2 = {};
  10894. n2.forEach((n3) => {
  10895. const { data: s3, headers: o3 } = n3.call(e2, t3);
  10896. Object.assign(r2, s3), Object.assign(i2, o3);
  10897. });
  10898. const o2 = t3.data;
  10899. return o2 && (() => {
  10900. var e3;
  10901. if (e3 = o2, "[object FormData]" !== Object.prototype.toString.call(e3))
  10902. t3.data = { ...o2, ...r2 };
  10903. else
  10904. for (const e4 in r2)
  10905. o2.append(e4, r2[e4]);
  10906. })(), t3.headers = { ...t3.headers || {}, ...i2 }, s2.call(e2, t3);
  10907. };
  10908. }
  10909. function Ge() {
  10910. const e2 = Math.random().toString(16).slice(2);
  10911. return { data: { seqId: e2 }, headers: { ...Je, "x-seqid": e2 } };
  10912. }
  10913. class Ve {
  10914. constructor(e2 = {}) {
  10915. var t2;
  10916. this.config = e2, this._reqClass = new Ce.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: `请求在${this.config.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] }), this._cache = Re(this.config.env), this._localCache = (t2 = this.config.env, xe[t2]), He(this._reqClass, "post", [Ge]), He(this._reqClass, "upload", [Ge]), He(this._reqClass, "download", [Ge]);
  10917. }
  10918. async post(e2) {
  10919. return await this._reqClass.post(e2);
  10920. }
  10921. async upload(e2) {
  10922. return await this._reqClass.upload(e2);
  10923. }
  10924. async download(e2) {
  10925. return await this._reqClass.download(e2);
  10926. }
  10927. async refreshAccessToken() {
  10928. let e2, t2;
  10929. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  10930. try {
  10931. e2 = await this._refreshAccessTokenPromise;
  10932. } catch (e3) {
  10933. t2 = e3;
  10934. }
  10935. if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t2)
  10936. throw t2;
  10937. return e2;
  10938. }
  10939. async _refreshAccessToken() {
  10940. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2, loginTypeKey: s2, anonymousUuidKey: r2 } = this._cache.keys;
  10941. this._cache.removeStore(e2), this._cache.removeStore(t2);
  10942. let i2 = this._cache.getStore(n2);
  10943. if (!i2)
  10944. throw new ne({ message: "未登录CloudBase" });
  10945. const o2 = { refresh_token: i2 }, a2 = await this.request("auth.fetchAccessTokenWithRefreshToken", o2);
  10946. if (a2.data.code) {
  10947. const { code: e3 } = a2.data;
  10948. if ("SIGN_PARAM_INVALID" === e3 || "REFRESH_TOKEN_EXPIRED" === e3 || "INVALID_REFRESH_TOKEN" === e3) {
  10949. if (this._cache.getStore(s2) === We.ANONYMOUS && "INVALID_REFRESH_TOKEN" === e3) {
  10950. const e4 = this._cache.getStore(r2), t3 = this._cache.getStore(n2), s3 = await this.send("auth.signInAnonymously", { anonymous_uuid: e4, refresh_token: t3 });
  10951. return this.setRefreshToken(s3.refresh_token), this._refreshAccessToken();
  10952. }
  10953. Fe(Ke), this._cache.removeStore(n2);
  10954. }
  10955. throw new ne({ code: a2.data.code, message: `刷新access token失败:${a2.data.code}` });
  10956. }
  10957. if (a2.data.access_token)
  10958. return Fe($e), this._cache.setStore(e2, a2.data.access_token), this._cache.setStore(t2, a2.data.access_token_expire + Date.now()), { accessToken: a2.data.access_token, accessTokenExpire: a2.data.access_token_expire };
  10959. a2.data.refresh_token && (this._cache.removeStore(n2), this._cache.setStore(n2, a2.data.refresh_token), this._refreshAccessToken());
  10960. }
  10961. async getAccessToken() {
  10962. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2 } = this._cache.keys;
  10963. if (!this._cache.getStore(n2))
  10964. throw new ne({ message: "refresh token不存在,登录状态异常" });
  10965. let s2 = this._cache.getStore(e2), r2 = this._cache.getStore(t2), i2 = true;
  10966. return this._shouldRefreshAccessTokenHook && !await this._shouldRefreshAccessTokenHook(s2, r2) && (i2 = false), (!s2 || !r2 || r2 < Date.now()) && i2 ? this.refreshAccessToken() : { accessToken: s2, accessTokenExpire: r2 };
  10967. }
  10968. async request(e2, t2, n2) {
  10969. const s2 = `x-tcb-trace_${this.config.env}`;
  10970. let r2 = "application/x-www-form-urlencoded";
  10971. const i2 = { action: e2, env: this.config.env, dataVersion: "2019-08-16", ...t2 };
  10972. if (-1 === ze.indexOf(e2)) {
  10973. const { refreshTokenKey: e3 } = this._cache.keys;
  10974. this._cache.getStore(e3) && (i2.access_token = (await this.getAccessToken()).accessToken);
  10975. }
  10976. let o2;
  10977. if ("storage.uploadFile" === e2) {
  10978. o2 = new FormData();
  10979. for (let e3 in o2)
  10980. o2.hasOwnProperty(e3) && void 0 !== o2[e3] && o2.append(e3, i2[e3]);
  10981. r2 = "multipart/form-data";
  10982. } else {
  10983. r2 = "application/json", o2 = {};
  10984. for (let e3 in i2)
  10985. void 0 !== i2[e3] && (o2[e3] = i2[e3]);
  10986. }
  10987. let a2 = { headers: { "content-type": r2 } };
  10988. n2 && n2.onUploadProgress && (a2.onUploadProgress = n2.onUploadProgress);
  10989. const c2 = this._localCache.getStore(s2);
  10990. c2 && (a2.headers["X-TCB-Trace"] = c2);
  10991. const { parse: u2, inQuery: h2, search: l2 } = t2;
  10992. let d2 = { env: this.config.env };
  10993. u2 && (d2.parse = true), h2 && (d2 = { ...h2, ...d2 });
  10994. let p2 = function(e3, t3, n3 = {}) {
  10995. const s3 = /\?/.test(t3);
  10996. let r3 = "";
  10997. for (let e4 in n3)
  10998. "" === r3 ? !s3 && (t3 += "?") : r3 += "&", r3 += `${e4}=${encodeURIComponent(n3[e4])}`;
  10999. return /^http(s)?\:\/\//.test(t3 += r3) ? t3 : `${e3}${t3}`;
  11000. }(ye, "//tcb-api.tencentcloudapi.com/web", d2);
  11001. l2 && (p2 += l2);
  11002. const f2 = await this.post({ url: p2, data: o2, ...a2 }), g2 = f2.header && f2.header["x-tcb-trace"];
  11003. if (g2 && this._localCache.setStore(s2, g2), 200 !== Number(f2.status) && 200 !== Number(f2.statusCode) || !f2.data)
  11004. throw new ne({ code: "NETWORK_ERROR", message: "network request error" });
  11005. return f2;
  11006. }
  11007. async send(e2, t2 = {}) {
  11008. const n2 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
  11009. if ("ACCESS_TOKEN_EXPIRED" === n2.data.code && -1 === ze.indexOf(e2)) {
  11010. await this.refreshAccessToken();
  11011. const n3 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
  11012. if (n3.data.code)
  11013. throw new ne({ code: n3.data.code, message: n3.data.message });
  11014. return n3.data;
  11015. }
  11016. if (n2.data.code)
  11017. throw new ne({ code: n2.data.code, message: n2.data.message });
  11018. return n2.data;
  11019. }
  11020. setRefreshToken(e2) {
  11021. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  11022. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  11023. }
  11024. }
  11025. const Ye = {};
  11026. function Qe(e2) {
  11027. return Ye[e2];
  11028. }
  11029. class Xe {
  11030. constructor(e2) {
  11031. this.config = e2, this._cache = Re(e2.env), this._request = Qe(e2.env);
  11032. }
  11033. setRefreshToken(e2) {
  11034. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  11035. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  11036. }
  11037. setAccessToken(e2, t2) {
  11038. const { accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys;
  11039. this._cache.setStore(n2, e2), this._cache.setStore(s2, t2);
  11040. }
  11041. async refreshUserInfo() {
  11042. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  11043. return this.setLocalUserInfo(e2), e2;
  11044. }
  11045. setLocalUserInfo(e2) {
  11046. const { userInfoKey: t2 } = this._cache.keys;
  11047. this._cache.setStore(t2, e2);
  11048. }
  11049. }
  11050. class Ze {
  11051. constructor(e2) {
  11052. if (!e2)
  11053. throw new ne({ code: "PARAM_ERROR", message: "envId is not defined" });
  11054. this._envId = e2, this._cache = Re(this._envId), this._request = Qe(this._envId), this.setUserInfo();
  11055. }
  11056. linkWithTicket(e2) {
  11057. if ("string" != typeof e2)
  11058. throw new ne({ code: "PARAM_ERROR", message: "ticket must be string" });
  11059. return this._request.send("auth.linkWithTicket", { ticket: e2 });
  11060. }
  11061. linkWithRedirect(e2) {
  11062. e2.signInWithRedirect();
  11063. }
  11064. updatePassword(e2, t2) {
  11065. return this._request.send("auth.updatePassword", { oldPassword: t2, newPassword: e2 });
  11066. }
  11067. updateEmail(e2) {
  11068. return this._request.send("auth.updateEmail", { newEmail: e2 });
  11069. }
  11070. updateUsername(e2) {
  11071. if ("string" != typeof e2)
  11072. throw new ne({ code: "PARAM_ERROR", message: "username must be a string" });
  11073. return this._request.send("auth.updateUsername", { username: e2 });
  11074. }
  11075. async getLinkedUidList() {
  11076. const { data: e2 } = await this._request.send("auth.getLinkedUidList", {});
  11077. let t2 = false;
  11078. const { users: n2 } = e2;
  11079. return n2.forEach((e3) => {
  11080. e3.wxOpenId && e3.wxPublicId && (t2 = true);
  11081. }), { users: n2, hasPrimaryUid: t2 };
  11082. }
  11083. setPrimaryUid(e2) {
  11084. return this._request.send("auth.setPrimaryUid", { uid: e2 });
  11085. }
  11086. unlink(e2) {
  11087. return this._request.send("auth.unlink", { platform: e2 });
  11088. }
  11089. async update(e2) {
  11090. const { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 } = e2, { data: a2 } = await this._request.send("auth.updateUserInfo", { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 });
  11091. this.setLocalUserInfo(a2);
  11092. }
  11093. async refresh() {
  11094. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  11095. return this.setLocalUserInfo(e2), e2;
  11096. }
  11097. setUserInfo() {
  11098. const { userInfoKey: e2 } = this._cache.keys, t2 = this._cache.getStore(e2);
  11099. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach((e3) => {
  11100. this[e3] = t2[e3];
  11101. }), this.location = { country: t2.country, province: t2.province, city: t2.city };
  11102. }
  11103. setLocalUserInfo(e2) {
  11104. const { userInfoKey: t2 } = this._cache.keys;
  11105. this._cache.setStore(t2, e2), this.setUserInfo();
  11106. }
  11107. }
  11108. class et {
  11109. constructor(e2) {
  11110. if (!e2)
  11111. throw new ne({ code: "PARAM_ERROR", message: "envId is not defined" });
  11112. this._cache = Re(e2);
  11113. const { refreshTokenKey: t2, accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys, r2 = this._cache.getStore(t2), i2 = this._cache.getStore(n2), o2 = this._cache.getStore(s2);
  11114. this.credential = { refreshToken: r2, accessToken: i2, accessTokenExpire: o2 }, this.user = new Ze(e2);
  11115. }
  11116. get isAnonymousAuth() {
  11117. return this.loginType === We.ANONYMOUS;
  11118. }
  11119. get isCustomAuth() {
  11120. return this.loginType === We.CUSTOM;
  11121. }
  11122. get isWeixinAuth() {
  11123. return this.loginType === We.WECHAT || this.loginType === We.WECHAT_OPEN || this.loginType === We.WECHAT_PUBLIC;
  11124. }
  11125. get loginType() {
  11126. return this._cache.getStore(this._cache.keys.loginTypeKey);
  11127. }
  11128. }
  11129. class tt extends Xe {
  11130. async signIn() {
  11131. this._cache.updatePersistence("local");
  11132. const { anonymousUuidKey: e2, refreshTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2) || void 0, s2 = this._cache.getStore(t2) || void 0, r2 = await this._request.send("auth.signInAnonymously", { anonymous_uuid: n2, refresh_token: s2 });
  11133. if (r2.uuid && r2.refresh_token) {
  11134. this._setAnonymousUUID(r2.uuid), this.setRefreshToken(r2.refresh_token), await this._request.refreshAccessToken(), Fe(qe), Fe(je, { env: this.config.env, loginType: We.ANONYMOUS, persistence: "local" });
  11135. const e3 = new et(this.config.env);
  11136. return await e3.user.refresh(), e3;
  11137. }
  11138. throw new ne({ message: "匿名登录失败" });
  11139. }
  11140. async linkAndRetrieveDataWithTicket(e2) {
  11141. const { anonymousUuidKey: t2, refreshTokenKey: n2 } = this._cache.keys, s2 = this._cache.getStore(t2), r2 = this._cache.getStore(n2), i2 = await this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: s2, refresh_token: r2, ticket: e2 });
  11142. if (i2.refresh_token)
  11143. return this._clearAnonymousUUID(), this.setRefreshToken(i2.refresh_token), await this._request.refreshAccessToken(), Fe(Be, { env: this.config.env }), Fe(je, { loginType: We.CUSTOM, persistence: "local" }), { credential: { refreshToken: i2.refresh_token } };
  11144. throw new ne({ message: "匿名转化失败" });
  11145. }
  11146. _setAnonymousUUID(e2) {
  11147. const { anonymousUuidKey: t2, loginTypeKey: n2 } = this._cache.keys;
  11148. this._cache.removeStore(t2), this._cache.setStore(t2, e2), this._cache.setStore(n2, We.ANONYMOUS);
  11149. }
  11150. _clearAnonymousUUID() {
  11151. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  11152. }
  11153. }
  11154. class nt extends Xe {
  11155. async signIn(e2) {
  11156. if ("string" != typeof e2)
  11157. throw new ne({ code: "PARAM_ERROR", message: "ticket must be a string" });
  11158. const { refreshTokenKey: t2 } = this._cache.keys, n2 = await this._request.send("auth.signInWithTicket", { ticket: e2, refresh_token: this._cache.getStore(t2) || "" });
  11159. if (n2.refresh_token)
  11160. return this.setRefreshToken(n2.refresh_token), await this._request.refreshAccessToken(), Fe(qe), Fe(je, { env: this.config.env, loginType: We.CUSTOM, persistence: this.config.persistence }), await this.refreshUserInfo(), new et(this.config.env);
  11161. throw new ne({ message: "自定义登录失败" });
  11162. }
  11163. }
  11164. class st extends Xe {
  11165. async signIn(e2, t2) {
  11166. if ("string" != typeof e2)
  11167. throw new ne({ code: "PARAM_ERROR", message: "email must be a string" });
  11168. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: "EMAIL", email: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token: i2, access_token_expire: o2 } = s2;
  11169. if (r2)
  11170. return this.setRefreshToken(r2), i2 && o2 ? this.setAccessToken(i2, o2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Fe(qe), Fe(je, { env: this.config.env, loginType: We.EMAIL, persistence: this.config.persistence }), new et(this.config.env);
  11171. throw s2.code ? new ne({ code: s2.code, message: `邮箱登录失败: ${s2.message}` }) : new ne({ message: "邮箱登录失败" });
  11172. }
  11173. async activate(e2) {
  11174. return this._request.send("auth.activateEndUserMail", { token: e2 });
  11175. }
  11176. async resetPasswordWithToken(e2, t2) {
  11177. return this._request.send("auth.resetPasswordWithToken", { token: e2, newPassword: t2 });
  11178. }
  11179. }
  11180. class rt extends Xe {
  11181. async signIn(e2, t2) {
  11182. if ("string" != typeof e2)
  11183. throw new ne({ code: "PARAM_ERROR", message: "username must be a string" });
  11184. "string" != typeof t2 && (t2 = "", console.warn("password is empty"));
  11185. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: We.USERNAME, username: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token_expire: i2, access_token: o2 } = s2;
  11186. if (r2)
  11187. return this.setRefreshToken(r2), o2 && i2 ? this.setAccessToken(o2, i2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Fe(qe), Fe(je, { env: this.config.env, loginType: We.USERNAME, persistence: this.config.persistence }), new et(this.config.env);
  11188. throw s2.code ? new ne({ code: s2.code, message: `用户名密码登录失败: ${s2.message}` }) : new ne({ message: "用户名密码登录失败" });
  11189. }
  11190. }
  11191. class it {
  11192. constructor(e2) {
  11193. this.config = e2, this._cache = Re(e2.env), this._request = Qe(e2.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), De(je, this._onLoginTypeChanged);
  11194. }
  11195. get currentUser() {
  11196. const e2 = this.hasLoginState();
  11197. return e2 && e2.user || null;
  11198. }
  11199. get loginType() {
  11200. return this._cache.getStore(this._cache.keys.loginTypeKey);
  11201. }
  11202. anonymousAuthProvider() {
  11203. return new tt(this.config);
  11204. }
  11205. customAuthProvider() {
  11206. return new nt(this.config);
  11207. }
  11208. emailAuthProvider() {
  11209. return new st(this.config);
  11210. }
  11211. usernameAuthProvider() {
  11212. return new rt(this.config);
  11213. }
  11214. async signInAnonymously() {
  11215. return new tt(this.config).signIn();
  11216. }
  11217. async signInWithEmailAndPassword(e2, t2) {
  11218. return new st(this.config).signIn(e2, t2);
  11219. }
  11220. signInWithUsernameAndPassword(e2, t2) {
  11221. return new rt(this.config).signIn(e2, t2);
  11222. }
  11223. async linkAndRetrieveDataWithTicket(e2) {
  11224. this._anonymousAuthProvider || (this._anonymousAuthProvider = new tt(this.config)), De(Be, this._onAnonymousConverted);
  11225. return await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e2);
  11226. }
  11227. async signOut() {
  11228. if (this.loginType === We.ANONYMOUS)
  11229. throw new ne({ message: "匿名用户不支持登出操作" });
  11230. const { refreshTokenKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2 } = this._cache.keys, s2 = this._cache.getStore(e2);
  11231. if (!s2)
  11232. return;
  11233. const r2 = await this._request.send("auth.logout", { refresh_token: s2 });
  11234. return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.removeStore(n2), Fe(qe), Fe(je, { env: this.config.env, loginType: We.NULL, persistence: this.config.persistence }), r2;
  11235. }
  11236. async signUpWithEmailAndPassword(e2, t2) {
  11237. return this._request.send("auth.signUpWithEmailAndPassword", { email: e2, password: t2 });
  11238. }
  11239. async sendPasswordResetEmail(e2) {
  11240. return this._request.send("auth.sendPasswordResetEmail", { email: e2 });
  11241. }
  11242. onLoginStateChanged(e2) {
  11243. De(qe, () => {
  11244. const t3 = this.hasLoginState();
  11245. e2.call(this, t3);
  11246. });
  11247. const t2 = this.hasLoginState();
  11248. e2.call(this, t2);
  11249. }
  11250. onLoginStateExpired(e2) {
  11251. De(Ke, e2.bind(this));
  11252. }
  11253. onAccessTokenRefreshed(e2) {
  11254. De($e, e2.bind(this));
  11255. }
  11256. onAnonymousConverted(e2) {
  11257. De(Be, e2.bind(this));
  11258. }
  11259. onLoginTypeChanged(e2) {
  11260. De(je, () => {
  11261. const t2 = this.hasLoginState();
  11262. e2.call(this, t2);
  11263. });
  11264. }
  11265. async getAccessToken() {
  11266. return { accessToken: (await this._request.getAccessToken()).accessToken, env: this.config.env };
  11267. }
  11268. hasLoginState() {
  11269. const { refreshTokenKey: e2 } = this._cache.keys;
  11270. return this._cache.getStore(e2) ? new et(this.config.env) : null;
  11271. }
  11272. async isUsernameRegistered(e2) {
  11273. if ("string" != typeof e2)
  11274. throw new ne({ code: "PARAM_ERROR", message: "username must be a string" });
  11275. const { data: t2 } = await this._request.send("auth.isUsernameRegistered", { username: e2 });
  11276. return t2 && t2.isRegistered;
  11277. }
  11278. getLoginState() {
  11279. return Promise.resolve(this.hasLoginState());
  11280. }
  11281. async signInWithTicket(e2) {
  11282. return new nt(this.config).signIn(e2);
  11283. }
  11284. shouldRefreshAccessToken(e2) {
  11285. this._request._shouldRefreshAccessTokenHook = e2.bind(this);
  11286. }
  11287. getUserInfo() {
  11288. return this._request.send("auth.getUserInfo", {}).then((e2) => e2.code ? e2 : { ...e2.data, requestId: e2.seqId });
  11289. }
  11290. getAuthHeader() {
  11291. const { refreshTokenKey: e2, accessTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2);
  11292. return { "x-cloudbase-credentials": this._cache.getStore(t2) + "/@@/" + n2 };
  11293. }
  11294. _onAnonymousConverted(e2) {
  11295. const { env: t2 } = e2.data;
  11296. t2 === this.config.env && this._cache.updatePersistence(this.config.persistence);
  11297. }
  11298. _onLoginTypeChanged(e2) {
  11299. const { loginType: t2, persistence: n2, env: s2 } = e2.data;
  11300. s2 === this.config.env && (this._cache.updatePersistence(n2), this._cache.setStore(this._cache.keys.loginTypeKey, t2));
  11301. }
  11302. }
  11303. const ot = function(e2, t2) {
  11304. t2 = t2 || ve();
  11305. const n2 = Qe(this.config.env), { cloudPath: s2, filePath: r2, onUploadProgress: i2, fileType: o2 = "image" } = e2;
  11306. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  11307. const { data: { url: a2, authorization: c2, token: u2, fileId: h2, cosFileId: l2 }, requestId: d2 } = e3, p2 = { key: s2, signature: c2, "x-cos-meta-fileid": l2, success_action_status: "201", "x-cos-security-token": u2 };
  11308. n2.upload({ url: a2, data: p2, file: r2, name: s2, fileType: o2, onUploadProgress: i2 }).then((e4) => {
  11309. 201 === e4.statusCode ? t2(null, { fileID: h2, requestId: d2 }) : t2(new ne({ code: "STORAGE_REQUEST_FAIL", message: `STORAGE_REQUEST_FAIL: ${e4.data}` }));
  11310. }).catch((e4) => {
  11311. t2(e4);
  11312. });
  11313. }).catch((e3) => {
  11314. t2(e3);
  11315. }), t2.promise;
  11316. }, at = function(e2, t2) {
  11317. t2 = t2 || ve();
  11318. const n2 = Qe(this.config.env), { cloudPath: s2 } = e2;
  11319. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  11320. t2(null, e3);
  11321. }).catch((e3) => {
  11322. t2(e3);
  11323. }), t2.promise;
  11324. }, ct = function({ fileList: e2 }, t2) {
  11325. if (t2 = t2 || ve(), !e2 || !Array.isArray(e2))
  11326. return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };
  11327. for (let t3 of e2)
  11328. if (!t3 || "string" != typeof t3)
  11329. return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };
  11330. const n2 = { fileid_list: e2 };
  11331. return Qe(this.config.env).send("storage.batchDeleteFile", n2).then((e3) => {
  11332. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.delete_list, requestId: e3.requestId });
  11333. }).catch((e3) => {
  11334. t2(e3);
  11335. }), t2.promise;
  11336. }, ut = function({ fileList: e2 }, t2) {
  11337. t2 = t2 || ve(), e2 && Array.isArray(e2) || t2(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });
  11338. let n2 = [];
  11339. for (let s3 of e2)
  11340. "object" == typeof s3 ? (s3.hasOwnProperty("fileID") && s3.hasOwnProperty("maxAge") || t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), n2.push({ fileid: s3.fileID, max_age: s3.maxAge })) : "string" == typeof s3 ? n2.push({ fileid: s3 }) : t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" });
  11341. const s2 = { file_list: n2 };
  11342. return Qe(this.config.env).send("storage.batchGetDownloadUrl", s2).then((e3) => {
  11343. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.download_list, requestId: e3.requestId });
  11344. }).catch((e3) => {
  11345. t2(e3);
  11346. }), t2.promise;
  11347. }, ht = async function({ fileID: e2 }, t2) {
  11348. const n2 = (await ut.call(this, { fileList: [{ fileID: e2, maxAge: 600 }] })).fileList[0];
  11349. if ("SUCCESS" !== n2.code)
  11350. return t2 ? t2(n2) : new Promise((e3) => {
  11351. e3(n2);
  11352. });
  11353. const s2 = Qe(this.config.env);
  11354. let r2 = n2.download_url;
  11355. if (r2 = encodeURI(r2), !t2)
  11356. return s2.download({ url: r2 });
  11357. t2(await s2.download({ url: r2 }));
  11358. }, lt = function({ name: e2, data: t2, query: n2, parse: s2, search: r2 }, i2) {
  11359. const o2 = i2 || ve();
  11360. let a2;
  11361. try {
  11362. a2 = t2 ? JSON.stringify(t2) : "";
  11363. } catch (e3) {
  11364. return Promise.reject(e3);
  11365. }
  11366. if (!e2)
  11367. return Promise.reject(new ne({ code: "PARAM_ERROR", message: "函数名不能为空" }));
  11368. const c2 = { inQuery: n2, parse: s2, search: r2, function_name: e2, request_data: a2 };
  11369. return Qe(this.config.env).send("functions.invokeFunction", c2).then((e3) => {
  11370. if (e3.code)
  11371. o2(null, e3);
  11372. else {
  11373. let t3 = e3.data.response_data;
  11374. if (s2)
  11375. o2(null, { result: t3, requestId: e3.requestId });
  11376. else
  11377. try {
  11378. t3 = JSON.parse(e3.data.response_data), o2(null, { result: t3, requestId: e3.requestId });
  11379. } catch (e4) {
  11380. o2(new ne({ message: "response data must be json" }));
  11381. }
  11382. }
  11383. return o2.promise;
  11384. }).catch((e3) => {
  11385. o2(e3);
  11386. }), o2.promise;
  11387. }, dt = { timeout: 15e3, persistence: "session" }, pt = {};
  11388. class ft {
  11389. constructor(e2) {
  11390. this.config = e2 || this.config, this.authObj = void 0;
  11391. }
  11392. init(e2) {
  11393. switch (Ce.adapter || (this.requestClient = new Ce.adapter.reqClass({ timeout: e2.timeout || 5e3, timeoutMsg: `请求在${(e2.timeout || 5e3) / 1e3}s内未完成,已中断` })), this.config = { ...dt, ...e2 }, true) {
  11394. case this.config.timeout > 6e5:
  11395. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  11396. break;
  11397. case this.config.timeout < 100:
  11398. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  11399. }
  11400. return new ft(this.config);
  11401. }
  11402. auth({ persistence: e2 } = {}) {
  11403. if (this.authObj)
  11404. return this.authObj;
  11405. const t2 = e2 || Ce.adapter.primaryStorage || dt.persistence;
  11406. var n2;
  11407. return t2 !== this.config.persistence && (this.config.persistence = t2), function(e3) {
  11408. const { env: t3 } = e3;
  11409. Oe[t3] = new Ee(e3), xe[t3] = new Ee({ ...e3, persistence: "local" });
  11410. }(this.config), n2 = this.config, Ye[n2.env] = new Ve(n2), this.authObj = new it(this.config), this.authObj;
  11411. }
  11412. on(e2, t2) {
  11413. return De.apply(this, [e2, t2]);
  11414. }
  11415. off(e2, t2) {
  11416. return Me.apply(this, [e2, t2]);
  11417. }
  11418. callFunction(e2, t2) {
  11419. return lt.apply(this, [e2, t2]);
  11420. }
  11421. deleteFile(e2, t2) {
  11422. return ct.apply(this, [e2, t2]);
  11423. }
  11424. getTempFileURL(e2, t2) {
  11425. return ut.apply(this, [e2, t2]);
  11426. }
  11427. downloadFile(e2, t2) {
  11428. return ht.apply(this, [e2, t2]);
  11429. }
  11430. uploadFile(e2, t2) {
  11431. return ot.apply(this, [e2, t2]);
  11432. }
  11433. getUploadMetadata(e2, t2) {
  11434. return at.apply(this, [e2, t2]);
  11435. }
  11436. registerExtension(e2) {
  11437. pt[e2.name] = e2;
  11438. }
  11439. async invokeExtension(e2, t2) {
  11440. const n2 = pt[e2];
  11441. if (!n2)
  11442. throw new ne({ message: `扩展${e2} 必须先注册` });
  11443. return await n2.invoke(t2, this);
  11444. }
  11445. useAdapters(e2) {
  11446. const { adapter: t2, runtime: n2 } = ke(e2) || {};
  11447. t2 && (Ce.adapter = t2), n2 && (Ce.runtime = n2);
  11448. }
  11449. }
  11450. var gt = new ft();
  11451. function mt(e2, t2, n2) {
  11452. void 0 === n2 && (n2 = {});
  11453. var s2 = /\?/.test(t2), r2 = "";
  11454. for (var i2 in n2)
  11455. "" === r2 ? !s2 && (t2 += "?") : r2 += "&", r2 += i2 + "=" + encodeURIComponent(n2[i2]);
  11456. return /^http(s)?:\/\//.test(t2 += r2) ? t2 : "" + e2 + t2;
  11457. }
  11458. class yt {
  11459. post(e2) {
  11460. const { url: t2, data: n2, headers: s2 } = e2;
  11461. return new Promise((e3, r2) => {
  11462. se.request({ url: mt("https:", t2), data: n2, method: "POST", header: s2, success(t3) {
  11463. e3(t3);
  11464. }, fail(e4) {
  11465. r2(e4);
  11466. } });
  11467. });
  11468. }
  11469. upload(e2) {
  11470. return new Promise((t2, n2) => {
  11471. const { url: s2, file: r2, data: i2, headers: o2, fileType: a2 } = e2, c2 = se.uploadFile({ url: mt("https:", s2), name: "file", formData: Object.assign({}, i2), filePath: r2, fileType: a2, header: o2, success(e3) {
  11472. const n3 = { statusCode: e3.statusCode, data: e3.data || {} };
  11473. 200 === e3.statusCode && i2.success_action_status && (n3.statusCode = parseInt(i2.success_action_status, 10)), t2(n3);
  11474. }, fail(e3) {
  11475. n2(new Error(e3.errMsg || "uploadFile:fail"));
  11476. } });
  11477. "function" == typeof e2.onUploadProgress && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((t3) => {
  11478. e2.onUploadProgress({ loaded: t3.totalBytesSent, total: t3.totalBytesExpectedToSend });
  11479. });
  11480. });
  11481. }
  11482. }
  11483. const _t = { setItem(e2, t2) {
  11484. se.setStorageSync(e2, t2);
  11485. }, getItem: (e2) => se.getStorageSync(e2), removeItem(e2) {
  11486. se.removeStorageSync(e2);
  11487. }, clear() {
  11488. se.clearStorageSync();
  11489. } };
  11490. var wt = { genAdapter: function() {
  11491. return { root: {}, reqClass: yt, localStorage: _t, primaryStorage: "local" };
  11492. }, isMatch: function() {
  11493. return true;
  11494. }, runtime: "uni_app" };
  11495. gt.useAdapters(wt);
  11496. const vt = gt, It = vt.init;
  11497. vt.init = function(e2) {
  11498. e2.env = e2.spaceId;
  11499. const t2 = It.call(this, e2);
  11500. t2.config.provider = "tencent", t2.config.spaceId = e2.spaceId;
  11501. const n2 = t2.auth;
  11502. return t2.auth = function(e3) {
  11503. const t3 = n2.call(this, e3);
  11504. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach((e4) => {
  11505. var n3;
  11506. t3[e4] = (n3 = t3[e4], function(e5) {
  11507. e5 = e5 || {};
  11508. const { success: t4, fail: s2, complete: r2 } = te(e5);
  11509. if (!(t4 || s2 || r2))
  11510. return n3.call(this, e5);
  11511. n3.call(this, e5).then((e6) => {
  11512. t4 && t4(e6), r2 && r2(e6);
  11513. }, (e6) => {
  11514. s2 && s2(e6), r2 && r2(e6);
  11515. });
  11516. }).bind(t3);
  11517. }), t3;
  11518. }, t2.customAuth = t2.auth, t2;
  11519. };
  11520. var St = vt;
  11521. var bt = class extends ge {
  11522. getAccessToken() {
  11523. return new Promise((e2, t2) => {
  11524. const n2 = "Anonymous_Access_token";
  11525. this.setAccessToken(n2), e2(n2);
  11526. });
  11527. }
  11528. setupRequest(e2, t2) {
  11529. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  11530. "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = de.sign(n2, this.config.clientSecret);
  11531. const r2 = le();
  11532. s2["x-client-info"] = encodeURIComponent(JSON.stringify(r2));
  11533. const { token: i2 } = ie();
  11534. return s2["x-client-token"] = i2, { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: JSON.parse(JSON.stringify(s2)) };
  11535. }
  11536. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  11537. return new Promise((o2, a2) => {
  11538. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, success(e3) {
  11539. e3 && e3.statusCode < 400 ? o2(e3) : a2(new ne({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  11540. }, fail(e3) {
  11541. a2(new ne({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  11542. } });
  11543. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  11544. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  11545. });
  11546. });
  11547. }
  11548. uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", onUploadProgress: s2 }) {
  11549. if (!t2)
  11550. throw new ne({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });
  11551. let r2;
  11552. return this.getOSSUploadOptionsFromPath({ cloudPath: t2 }).then((t3) => {
  11553. const { url: i2, formData: o2, name: a2 } = t3.result;
  11554. r2 = t3.result.fileUrl;
  11555. const c2 = { url: i2, formData: o2, name: a2, filePath: e2, fileType: n2 };
  11556. return this.uploadFileToOSS(Object.assign({}, c2, { onUploadProgress: s2 }));
  11557. }).then(() => this.reportOSSUpload({ cloudPath: t2 })).then((t3) => new Promise((n3, s3) => {
  11558. t3.success ? n3({ success: true, filePath: e2, fileID: r2 }) : s3(new ne({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  11559. }));
  11560. }
  11561. deleteFile({ fileList: e2 }) {
  11562. const t2 = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e2 }) };
  11563. return this.request(this.setupRequest(t2)).then((e3) => {
  11564. if (e3.success)
  11565. return e3.result;
  11566. throw new ne({ code: "DELETE_FILE_FAILED", message: "删除文件失败" });
  11567. });
  11568. }
  11569. getTempFileURL({ fileList: e2 } = {}) {
  11570. if (!Array.isArray(e2) || 0 === e2.length)
  11571. throw new ne({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  11572. const t2 = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e2 }) };
  11573. return this.request(this.setupRequest(t2)).then((e3) => {
  11574. if (e3.success)
  11575. return { fileList: e3.result.fileList.map((e4) => ({ fileID: e4.fileID, tempFileURL: e4.tempFileURL })) };
  11576. throw new ne({ code: "GET_TEMP_FILE_URL_FAILED", message: "获取临时文件链接失败" });
  11577. });
  11578. }
  11579. };
  11580. var kt = { init(e2) {
  11581. const t2 = new bt(e2), n2 = { signInAnonymously: function() {
  11582. return t2.authorize();
  11583. }, getLoginState: function() {
  11584. return Promise.resolve(false);
  11585. } };
  11586. return t2.auth = function() {
  11587. return n2;
  11588. }, t2.customAuth = t2.auth, t2;
  11589. } };
  11590. function Ct({ data: e2 }) {
  11591. let t2;
  11592. t2 = le();
  11593. const n2 = JSON.parse(JSON.stringify(e2 || {}));
  11594. if (Object.assign(n2, { clientInfo: t2 }), !n2.uniIdToken) {
  11595. const { token: e3 } = ie();
  11596. e3 && (n2.uniIdToken = e3);
  11597. }
  11598. return n2;
  11599. }
  11600. async function Tt({ name: e2, data: t2 } = {}) {
  11601. await this.__dev__.initLocalNetwork();
  11602. const { localAddress: n2, localPort: s2 } = this.__dev__, r2 = { aliyun: "aliyun", tencent: "tcb" }[this.config.provider], i2 = this.config.spaceId, o2 = `http://${n2}:${s2}/system/check-function`, a2 = `http://${n2}:${s2}/cloudfunctions/${e2}`;
  11603. return new Promise((t3, n3) => {
  11604. se.request({ method: "POST", url: o2, data: { name: e2, platform: P, provider: r2, spaceId: i2 }, timeout: 3e3, success(e3) {
  11605. t3(e3);
  11606. }, fail() {
  11607. t3({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });
  11608. } });
  11609. }).then(({ data: e3 } = {}) => {
  11610. const { code: t3, message: n3 } = e3 || {};
  11611. return { code: 0 === t3 ? 0 : t3 || "SYS_ERR", message: n3 || "SYS_ERR" };
  11612. }).then(({ code: n3, message: s3 }) => {
  11613. if (0 !== n3) {
  11614. switch (n3) {
  11615. case "MODULE_ENCRYPTED":
  11616. console.error(`此云函数(${e2})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);
  11617. break;
  11618. case "FUNCTION_ENCRYPTED":
  11619. console.error(`此云函数(${e2})已加密不可本地调试,自动切换为云端已部署的云函数`);
  11620. break;
  11621. case "ACTION_ENCRYPTED":
  11622. console.error(s3 || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  11623. break;
  11624. case "NETWORK_ERROR": {
  11625. const e3 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  11626. throw console.error(e3), new Error(e3);
  11627. }
  11628. case "SWITCH_TO_CLOUD":
  11629. break;
  11630. default: {
  11631. const e3 = `检测本地调试服务出现错误:${s3},请检查网络环境或重启客户端再试`;
  11632. throw console.error(e3), new Error(e3);
  11633. }
  11634. }
  11635. return this._callCloudFunction({ name: e2, data: t2 });
  11636. }
  11637. return new Promise((e3, n4) => {
  11638. const s4 = Ct.call(this, { data: t2 });
  11639. se.request({ method: "POST", url: a2, data: { provider: r2, platform: P, param: s4 }, success: ({ statusCode: t3, data: s5 } = {}) => !t3 || t3 >= 400 ? n4(new ne({ code: s5.code || "SYS_ERR", message: s5.message || "request:fail" })) : e3({ result: s5 }), fail(e4) {
  11640. n4(new ne({ code: e4.code || e4.errCode || "SYS_ERR", message: e4.message || e4.errMsg || "request:fail" }));
  11641. } });
  11642. });
  11643. });
  11644. }
  11645. const Pt = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];
  11646. var At = /[\\^$.*+?()[\]{}|]/g, Et = RegExp(At.source);
  11647. function Ot(e2, t2, n2) {
  11648. return e2.replace(new RegExp((s2 = t2) && Et.test(s2) ? s2.replace(At, "\\$&") : s2, "g"), n2);
  11649. var s2;
  11650. }
  11651. const Rt = "request", Ut = "response", Lt = "both";
  11652. const yn = { code: 2e4, message: "System error" }, _n = { code: 20101, message: "Invalid client" };
  11653. function In(e2) {
  11654. const { errSubject: t2, subject: n2, errCode: s2, errMsg: r2, code: i2, message: o2, cause: a2 } = e2 || {};
  11655. return new ne({ subject: t2 || n2 || "uni-secure-network", code: s2 || i2 || yn.code, message: r2 || o2, cause: a2 });
  11656. }
  11657. let bn;
  11658. function An({ secretType: e2 } = {}) {
  11659. return e2 === Rt || e2 === Ut || e2 === Lt;
  11660. }
  11661. function En({ name: e2, data: t2 = {} } = {}) {
  11662. return "DCloud-clientDB" === e2 && "encryption" === t2.redirectTo && "getAppClientKey" === t2.action;
  11663. }
  11664. function On({ provider: e2, spaceId: t2, functionName: n2 } = {}) {
  11665. const { appId: s2, uniPlatform: r2, osName: i2 } = ue();
  11666. let o2 = r2;
  11667. "app" === r2 && (o2 = i2);
  11668. const a2 = function({ provider: e3, spaceId: t3 } = {}) {
  11669. const n3 = T;
  11670. if (!n3)
  11671. return {};
  11672. e3 = function(e4) {
  11673. return "tencent" === e4 ? "tcb" : e4;
  11674. }(e3);
  11675. const s3 = n3.find((n4) => n4.provider === e3 && n4.spaceId === t3);
  11676. return s3 && s3.config;
  11677. }({ provider: e2, spaceId: t2 });
  11678. if (!a2 || !a2.accessControl || !a2.accessControl.enable)
  11679. return false;
  11680. const c2 = a2.accessControl.function || {}, u2 = Object.keys(c2);
  11681. if (0 === u2.length)
  11682. return true;
  11683. const h2 = function(e3, t3) {
  11684. let n3, s3, r3;
  11685. for (let i3 = 0; i3 < e3.length; i3++) {
  11686. const o3 = e3[i3];
  11687. o3 !== t3 ? "*" !== o3 ? o3.split(",").map((e4) => e4.trim()).indexOf(t3) > -1 && (s3 = o3) : r3 = o3 : n3 = o3;
  11688. }
  11689. return n3 || s3 || r3;
  11690. }(u2, n2);
  11691. if (!h2)
  11692. return false;
  11693. if ((c2[h2] || []).find((e3 = {}) => e3.appId === s2 && (e3.platform || "").toLowerCase() === o2.toLowerCase()))
  11694. return true;
  11695. throw console.error(`此应用[appId: ${s2}, platform: ${o2}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`), In(_n);
  11696. }
  11697. function xn({ functionName: e2, result: t2, logPvd: n2 }) {
  11698. if (this.__dev__.debugLog && t2 && t2.requestId) {
  11699. const s2 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e2, requestId: t2.requestId });
  11700. console.log(`[${n2}-request]${s2}[/${n2}-request]`);
  11701. }
  11702. }
  11703. function Rn(e2) {
  11704. const t2 = e2.callFunction, n2 = function(n3) {
  11705. const s2 = n3.name;
  11706. n3.data = Ct.call(e2, { data: n3.data });
  11707. const r2 = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb" }[this.config.provider], i2 = An(n3), o2 = En(n3), a2 = i2 || o2;
  11708. return t2.call(this, n3).then((e3) => (e3.errCode = 0, !a2 && xn.call(this, { functionName: s2, result: e3, logPvd: r2 }), Promise.resolve(e3)), (e3) => (!a2 && xn.call(this, { functionName: s2, result: e3, logPvd: r2 }), e3 && e3.message && (e3.message = function({ message: e4 = "", extraInfo: t3 = {}, formatter: n4 = [] } = {}) {
  11709. for (let s3 = 0; s3 < n4.length; s3++) {
  11710. const { rule: r3, content: i3, mode: o3 } = n4[s3], a3 = e4.match(r3);
  11711. if (!a3)
  11712. continue;
  11713. let c2 = i3;
  11714. for (let e5 = 1; e5 < a3.length; e5++)
  11715. c2 = Ot(c2, `{$${e5}}`, a3[e5]);
  11716. for (const e5 in t3)
  11717. c2 = Ot(c2, `{${e5}}`, t3[e5]);
  11718. return "replace" === o3 ? c2 : e4 + c2;
  11719. }
  11720. return e4;
  11721. }({ message: `[${n3.name}]: ${e3.message}`, formatter: Pt, extraInfo: { functionName: s2 } })), Promise.reject(e3)));
  11722. };
  11723. e2.callFunction = function(t3) {
  11724. const { provider: s2, spaceId: r2 } = e2.config, i2 = t3.name;
  11725. let o2, a2;
  11726. if (t3.data = t3.data || {}, e2.__dev__.debugInfo && !e2.__dev__.debugInfo.forceRemote && E ? (e2._callCloudFunction || (e2._callCloudFunction = n2, e2._callLocalFunction = Tt), o2 = Tt) : o2 = n2, o2 = o2.bind(e2), En(t3))
  11727. a2 = n2.call(e2, t3);
  11728. else if (An(t3)) {
  11729. a2 = new bn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapEncryptDataCallFunction(n2.bind(e2))(t3);
  11730. } else if (On({ provider: s2, spaceId: r2, functionName: i2 })) {
  11731. a2 = new bn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapVerifyClientCallFunction(n2.bind(e2))(t3);
  11732. } else
  11733. a2 = o2(t3);
  11734. return Object.defineProperty(a2, "result", { get: () => (console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {}) }), a2;
  11735. };
  11736. }
  11737. bn = class {
  11738. constructor() {
  11739. throw In({ message: `Platform ${P} is not enabled, please check whether secure network module is enabled in your manifest.json` });
  11740. }
  11741. };
  11742. const Un = Symbol("CLIENT_DB_INTERNAL");
  11743. function Ln(e2, t2) {
  11744. return e2.then = "DoNotReturnProxyWithAFunctionNamedThen", e2._internalType = Un, e2.inspect = null, e2.__v_raw = void 0, new Proxy(e2, { get(e3, n2, s2) {
  11745. if ("_uniClient" === n2)
  11746. return null;
  11747. if ("symbol" == typeof n2)
  11748. return e3[n2];
  11749. if (n2 in e3 || "string" != typeof n2) {
  11750. const t3 = e3[n2];
  11751. return "function" == typeof t3 ? t3.bind(e3) : t3;
  11752. }
  11753. return t2.get(e3, n2, s2);
  11754. } });
  11755. }
  11756. function Nn(e2) {
  11757. return { on: (t2, n2) => {
  11758. e2[t2] = e2[t2] || [], e2[t2].indexOf(n2) > -1 || e2[t2].push(n2);
  11759. }, off: (t2, n2) => {
  11760. e2[t2] = e2[t2] || [];
  11761. const s2 = e2[t2].indexOf(n2);
  11762. -1 !== s2 && e2[t2].splice(s2, 1);
  11763. } };
  11764. }
  11765. const Dn = ["db.Geo", "db.command", "command.aggregate"];
  11766. function Fn(e2, t2) {
  11767. return Dn.indexOf(`${e2}.${t2}`) > -1;
  11768. }
  11769. function Mn(e2) {
  11770. switch (g(e2 = re(e2))) {
  11771. case "array":
  11772. return e2.map((e3) => Mn(e3));
  11773. case "object":
  11774. return e2._internalType === Un || Object.keys(e2).forEach((t2) => {
  11775. e2[t2] = Mn(e2[t2]);
  11776. }), e2;
  11777. case "regexp":
  11778. return { $regexp: { source: e2.source, flags: e2.flags } };
  11779. case "date":
  11780. return { $date: e2.toISOString() };
  11781. default:
  11782. return e2;
  11783. }
  11784. }
  11785. function qn(e2) {
  11786. return e2 && e2.content && e2.content.$method;
  11787. }
  11788. class Kn {
  11789. constructor(e2, t2, n2) {
  11790. this.content = e2, this.prevStage = t2 || null, this.udb = null, this._database = n2;
  11791. }
  11792. toJSON() {
  11793. let e2 = this;
  11794. const t2 = [e2.content];
  11795. for (; e2.prevStage; )
  11796. e2 = e2.prevStage, t2.push(e2.content);
  11797. return { $db: t2.reverse().map((e3) => ({ $method: e3.$method, $param: Mn(e3.$param) })) };
  11798. }
  11799. toString() {
  11800. return JSON.stringify(this.toJSON());
  11801. }
  11802. getAction() {
  11803. const e2 = this.toJSON().$db.find((e3) => "action" === e3.$method);
  11804. return e2 && e2.$param && e2.$param[0];
  11805. }
  11806. getCommand() {
  11807. return { $db: this.toJSON().$db.filter((e2) => "action" !== e2.$method) };
  11808. }
  11809. get isAggregate() {
  11810. let e2 = this;
  11811. for (; e2; ) {
  11812. const t2 = qn(e2), n2 = qn(e2.prevStage);
  11813. if ("aggregate" === t2 && "collection" === n2 || "pipeline" === t2)
  11814. return true;
  11815. e2 = e2.prevStage;
  11816. }
  11817. return false;
  11818. }
  11819. get isCommand() {
  11820. let e2 = this;
  11821. for (; e2; ) {
  11822. if ("command" === qn(e2))
  11823. return true;
  11824. e2 = e2.prevStage;
  11825. }
  11826. return false;
  11827. }
  11828. get isAggregateCommand() {
  11829. let e2 = this;
  11830. for (; e2; ) {
  11831. const t2 = qn(e2), n2 = qn(e2.prevStage);
  11832. if ("aggregate" === t2 && "command" === n2)
  11833. return true;
  11834. e2 = e2.prevStage;
  11835. }
  11836. return false;
  11837. }
  11838. getNextStageFn(e2) {
  11839. const t2 = this;
  11840. return function() {
  11841. return jn({ $method: e2, $param: Mn(Array.from(arguments)) }, t2, t2._database);
  11842. };
  11843. }
  11844. get count() {
  11845. return this.isAggregate ? this.getNextStageFn("count") : function() {
  11846. return this._send("count", Array.from(arguments));
  11847. };
  11848. }
  11849. get remove() {
  11850. return this.isCommand ? this.getNextStageFn("remove") : function() {
  11851. return this._send("remove", Array.from(arguments));
  11852. };
  11853. }
  11854. get() {
  11855. return this._send("get", Array.from(arguments));
  11856. }
  11857. get add() {
  11858. return this.isCommand ? this.getNextStageFn("add") : function() {
  11859. return this._send("add", Array.from(arguments));
  11860. };
  11861. }
  11862. update() {
  11863. return this._send("update", Array.from(arguments));
  11864. }
  11865. end() {
  11866. return this._send("end", Array.from(arguments));
  11867. }
  11868. get set() {
  11869. return this.isCommand ? this.getNextStageFn("set") : function() {
  11870. throw new Error("JQL禁止使用set方法");
  11871. };
  11872. }
  11873. _send(e2, t2) {
  11874. const n2 = this.getAction(), s2 = this.getCommand();
  11875. if (s2.$db.push({ $method: e2, $param: Mn(t2) }), b) {
  11876. const e3 = s2.$db.find((e4) => "collection" === e4.$method), t3 = e3 && e3.$param;
  11877. t3 && 1 === t3.length && "string" == typeof e3.$param[0] && e3.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  11878. }
  11879. return this._database._callCloudFunction({ action: n2, command: s2 });
  11880. }
  11881. }
  11882. function jn(e2, t2, n2) {
  11883. return Ln(new Kn(e2, t2, n2), { get(e3, t3) {
  11884. let s2 = "db";
  11885. return e3 && e3.content && (s2 = e3.content.$method), Fn(s2, t3) ? jn({ $method: t3 }, e3, n2) : function() {
  11886. return jn({ $method: t3, $param: Mn(Array.from(arguments)) }, e3, n2);
  11887. };
  11888. } });
  11889. }
  11890. function Bn({ path: e2, method: t2 }) {
  11891. return class {
  11892. constructor() {
  11893. this.param = Array.from(arguments);
  11894. }
  11895. toJSON() {
  11896. return { $newDb: [...e2.map((e3) => ({ $method: e3 })), { $method: t2, $param: this.param }] };
  11897. }
  11898. toString() {
  11899. return JSON.stringify(this.toJSON());
  11900. }
  11901. };
  11902. }
  11903. function $n(e2, t2 = {}) {
  11904. return Ln(new e2(t2), { get: (e3, t3) => Fn("db", t3) ? jn({ $method: t3 }, null, e3) : function() {
  11905. return jn({ $method: t3, $param: Mn(Array.from(arguments)) }, null, e3);
  11906. } });
  11907. }
  11908. class Wn extends class {
  11909. constructor({ uniClient: e2 = {}, isJQL: t2 = false } = {}) {
  11910. this._uniClient = e2, this._authCallBacks = {}, this._dbCallBacks = {}, e2._isDefault && (this._dbCallBacks = U("_globalUniCloudDatabaseCallback")), t2 || (this.auth = Nn(this._authCallBacks)), this._isJQL = t2, Object.assign(this, Nn(this._dbCallBacks)), this.env = Ln({}, { get: (e3, t3) => ({ $env: t3 }) }), this.Geo = Ln({}, { get: (e3, t3) => Bn({ path: ["Geo"], method: t3 }) }), this.serverDate = Bn({ path: [], method: "serverDate" }), this.RegExp = Bn({ path: [], method: "RegExp" });
  11911. }
  11912. getCloudEnv(e2) {
  11913. if ("string" != typeof e2 || !e2.trim())
  11914. throw new Error("getCloudEnv参数错误");
  11915. return { $env: e2.replace("$cloudEnv_", "") };
  11916. }
  11917. _callback(e2, t2) {
  11918. const n2 = this._dbCallBacks;
  11919. n2[e2] && n2[e2].forEach((e3) => {
  11920. e3(...t2);
  11921. });
  11922. }
  11923. _callbackAuth(e2, t2) {
  11924. const n2 = this._authCallBacks;
  11925. n2[e2] && n2[e2].forEach((e3) => {
  11926. e3(...t2);
  11927. });
  11928. }
  11929. multiSend() {
  11930. const e2 = Array.from(arguments), t2 = e2.map((e3) => {
  11931. const t3 = e3.getAction(), n2 = e3.getCommand();
  11932. if ("getTemp" !== n2.$db[n2.$db.length - 1].$method)
  11933. throw new Error("multiSend只支持子命令内使用getTemp");
  11934. return { action: t3, command: n2 };
  11935. });
  11936. return this._callCloudFunction({ multiCommand: t2, queryList: e2 });
  11937. }
  11938. } {
  11939. _parseResult(e2) {
  11940. return this._isJQL ? e2.result : e2;
  11941. }
  11942. _callCloudFunction({ action: e2, command: t2, multiCommand: n2, queryList: s2 }) {
  11943. function r2(e3, t3) {
  11944. if (n2 && s2)
  11945. for (let n3 = 0; n3 < s2.length; n3++) {
  11946. const r3 = s2[n3];
  11947. r3.udb && "function" == typeof r3.udb.setResult && (t3 ? r3.udb.setResult(t3) : r3.udb.setResult(e3.result.dataList[n3]));
  11948. }
  11949. }
  11950. const i2 = this, o2 = this._isJQL ? "databaseForJQL" : "database";
  11951. function a2(e3) {
  11952. return i2._callback("error", [e3]), M(q(o2, "fail"), e3).then(() => M(q(o2, "complete"), e3)).then(() => (r2(null, e3), Q(B, { type: z, content: e3 }), Promise.reject(e3)));
  11953. }
  11954. const c2 = M(q(o2, "invoke")), u2 = this._uniClient;
  11955. return c2.then(() => u2.callFunction({ name: "DCloud-clientDB", type: l, data: { action: e2, command: t2, multiCommand: n2 } })).then((e3) => {
  11956. const { code: t3, message: n3, token: s3, tokenExpired: c3, systemInfo: u3 = [] } = e3.result;
  11957. if (u3)
  11958. for (let e4 = 0; e4 < u3.length; e4++) {
  11959. const { level: t4, message: n4, detail: s4 } = u3[e4], r3 = console["warn" === t4 ? "error" : t4] || console.log;
  11960. let i3 = "[System Info]" + n4;
  11961. s4 && (i3 = `${i3}
  11962. 详细信息:${s4}`), r3(i3);
  11963. }
  11964. if (t3) {
  11965. return a2(new ne({ code: t3, message: n3, requestId: e3.requestId }));
  11966. }
  11967. e3.result.errCode = e3.result.errCode || e3.result.code, e3.result.errMsg = e3.result.errMsg || e3.result.message, s3 && c3 && (oe({ token: s3, tokenExpired: c3 }), this._callbackAuth("refreshToken", [{ token: s3, tokenExpired: c3 }]), this._callback("refreshToken", [{ token: s3, tokenExpired: c3 }]), Q(W, { token: s3, tokenExpired: c3 }));
  11968. const h2 = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];
  11969. for (let t4 = 0; t4 < h2.length; t4++) {
  11970. const { prop: n4, tips: s4 } = h2[t4];
  11971. if (n4 in e3.result) {
  11972. const t5 = e3.result[n4];
  11973. Object.defineProperty(e3.result, n4, { get: () => (console.warn(s4), t5) });
  11974. }
  11975. }
  11976. return function(e4) {
  11977. return M(q(o2, "success"), e4).then(() => M(q(o2, "complete"), e4)).then(() => {
  11978. r2(e4, null);
  11979. const t4 = i2._parseResult(e4);
  11980. return Q(B, { type: z, content: t4 }), Promise.resolve(t4);
  11981. });
  11982. }(e3);
  11983. }, (e3) => {
  11984. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e3.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  11985. return a2(new ne({ code: e3.code || "SYSTEM_ERROR", message: e3.message, requestId: e3.requestId }));
  11986. });
  11987. }
  11988. }
  11989. const zn = "token无效,跳转登录页面", Jn = "token过期,跳转登录页面", Hn = { TOKEN_INVALID_TOKEN_EXPIRED: Jn, TOKEN_INVALID_INVALID_CLIENTID: zn, TOKEN_INVALID: zn, TOKEN_INVALID_WRONG_TOKEN: zn, TOKEN_INVALID_ANONYMOUS_USER: zn }, Gn = { "uni-id-token-expired": Jn, "uni-id-check-token-failed": zn, "uni-id-token-not-exist": zn, "uni-id-check-device-feature-failed": zn };
  11990. function Vn(e2, t2) {
  11991. let n2 = "";
  11992. return n2 = e2 ? `${e2}/${t2}` : t2, n2.replace(/^\//, "");
  11993. }
  11994. function Yn(e2 = [], t2 = "") {
  11995. const n2 = [], s2 = [];
  11996. return e2.forEach((e3) => {
  11997. true === e3.needLogin ? n2.push(Vn(t2, e3.path)) : false === e3.needLogin && s2.push(Vn(t2, e3.path));
  11998. }), { needLoginPage: n2, notNeedLoginPage: s2 };
  11999. }
  12000. function Qn(e2) {
  12001. return e2.split("?")[0].replace(/^\//, "");
  12002. }
  12003. function Xn() {
  12004. return function(e2) {
  12005. let t2 = e2 && e2.$page && e2.$page.fullPath || "";
  12006. return t2 ? ("/" !== t2.charAt(0) && (t2 = "/" + t2), t2) : t2;
  12007. }(function() {
  12008. const e2 = getCurrentPages();
  12009. return e2[e2.length - 1];
  12010. }());
  12011. }
  12012. function Zn() {
  12013. return Qn(Xn());
  12014. }
  12015. function es(e2 = "", t2 = {}) {
  12016. if (!e2)
  12017. return false;
  12018. if (!(t2 && t2.list && t2.list.length))
  12019. return false;
  12020. const n2 = t2.list, s2 = Qn(e2);
  12021. return n2.some((e3) => e3.pagePath === s2);
  12022. }
  12023. const ts = !!t$1.uniIdRouter;
  12024. const { loginPage: ns, routerNeedLogin: ss, resToLogin: rs, needLoginPage: is, notNeedLoginPage: os, loginPageInTabBar: as } = function({ pages: e2 = [], subPackages: n2 = [], uniIdRouter: s2 = {}, tabBar: r2 = {} } = t$1) {
  12025. const { loginPage: i2, needLogin: o2 = [], resToLogin: a2 = true } = s2, { needLoginPage: c2, notNeedLoginPage: u2 } = Yn(e2), { needLoginPage: h2, notNeedLoginPage: l2 } = function(e3 = []) {
  12026. const t2 = [], n3 = [];
  12027. return e3.forEach((e4) => {
  12028. const { root: s3, pages: r3 = [] } = e4, { needLoginPage: i3, notNeedLoginPage: o3 } = Yn(r3, s3);
  12029. t2.push(...i3), n3.push(...o3);
  12030. }), { needLoginPage: t2, notNeedLoginPage: n3 };
  12031. }(n2);
  12032. return { loginPage: i2, routerNeedLogin: o2, resToLogin: a2, needLoginPage: [...c2, ...h2], notNeedLoginPage: [...u2, ...l2], loginPageInTabBar: es(i2, r2) };
  12033. }();
  12034. if (is.indexOf(ns) > -1)
  12035. throw new Error(`Login page [${ns}] should not be "needLogin", please check your pages.json`);
  12036. function cs(e2) {
  12037. const t2 = Zn();
  12038. if ("/" === e2.charAt(0))
  12039. return e2;
  12040. const [n2, s2] = e2.split("?"), r2 = n2.replace(/^\//, "").split("/"), i2 = t2.split("/");
  12041. i2.pop();
  12042. for (let e3 = 0; e3 < r2.length; e3++) {
  12043. const t3 = r2[e3];
  12044. ".." === t3 ? i2.pop() : "." !== t3 && i2.push(t3);
  12045. }
  12046. return "" === i2[0] && i2.shift(), "/" + i2.join("/") + (s2 ? "?" + s2 : "");
  12047. }
  12048. function us(e2) {
  12049. const t2 = Qn(cs(e2));
  12050. return !(os.indexOf(t2) > -1) && (is.indexOf(t2) > -1 || ss.some((t3) => function(e3, t4) {
  12051. return new RegExp(t4).test(e3);
  12052. }(e2, t3)));
  12053. }
  12054. function hs({ redirect: e2 }) {
  12055. const t2 = Qn(e2), n2 = Qn(ns);
  12056. return Zn() !== n2 && t2 !== n2;
  12057. }
  12058. function ls({ api: e2, redirect: t2 } = {}) {
  12059. if (!t2 || !hs({ redirect: t2 }))
  12060. return;
  12061. const n2 = function(e3, t3) {
  12062. return "/" !== e3.charAt(0) && (e3 = "/" + e3), t3 ? e3.indexOf("?") > -1 ? e3 + `&uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3 + `?uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3;
  12063. }(ns, t2);
  12064. as ? "navigateTo" !== e2 && "redirectTo" !== e2 || (e2 = "switchTab") : "switchTab" === e2 && (e2 = "navigateTo");
  12065. const s2 = { navigateTo: uni.navigateTo, redirectTo: uni.redirectTo, switchTab: uni.switchTab, reLaunch: uni.reLaunch };
  12066. setTimeout(() => {
  12067. s2[e2]({ url: n2 });
  12068. });
  12069. }
  12070. function ds({ url: e2 } = {}) {
  12071. const t2 = { abortLoginPageJump: false, autoToLoginPage: false }, n2 = function() {
  12072. const { token: e3, tokenExpired: t3 } = ie();
  12073. let n3;
  12074. if (e3) {
  12075. if (t3 < Date.now()) {
  12076. const e4 = "uni-id-token-expired";
  12077. n3 = { errCode: e4, errMsg: Gn[e4] };
  12078. }
  12079. } else {
  12080. const e4 = "uni-id-check-token-failed";
  12081. n3 = { errCode: e4, errMsg: Gn[e4] };
  12082. }
  12083. return n3;
  12084. }();
  12085. if (us(e2) && n2) {
  12086. n2.uniIdRedirectUrl = e2;
  12087. if (G($).length > 0)
  12088. return setTimeout(() => {
  12089. Q($, n2);
  12090. }, 0), t2.abortLoginPageJump = true, t2;
  12091. t2.autoToLoginPage = true;
  12092. }
  12093. return t2;
  12094. }
  12095. function ps() {
  12096. !function() {
  12097. const e3 = Xn(), { abortLoginPageJump: t2, autoToLoginPage: n2 } = ds({ url: e3 });
  12098. t2 || n2 && ls({ api: "redirectTo", redirect: e3 });
  12099. }();
  12100. const e2 = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  12101. for (let t2 = 0; t2 < e2.length; t2++) {
  12102. const n2 = e2[t2];
  12103. uni.addInterceptor(n2, { invoke(e3) {
  12104. const { abortLoginPageJump: t3, autoToLoginPage: s2 } = ds({ url: e3.url });
  12105. return t3 ? e3 : s2 ? (ls({ api: n2, redirect: cs(e3.url) }), false) : e3;
  12106. } });
  12107. }
  12108. }
  12109. function fs() {
  12110. this.onResponse((e2) => {
  12111. const { type: t2, content: n2 } = e2;
  12112. let s2 = false;
  12113. switch (t2) {
  12114. case "cloudobject":
  12115. s2 = function(e3) {
  12116. if ("object" != typeof e3)
  12117. return false;
  12118. const { errCode: t3 } = e3 || {};
  12119. return t3 in Gn;
  12120. }(n2);
  12121. break;
  12122. case "clientdb":
  12123. s2 = function(e3) {
  12124. if ("object" != typeof e3)
  12125. return false;
  12126. const { errCode: t3 } = e3 || {};
  12127. return t3 in Hn;
  12128. }(n2);
  12129. }
  12130. s2 && function(e3 = {}) {
  12131. const t3 = G($);
  12132. ee().then(() => {
  12133. const n3 = Xn();
  12134. if (n3 && hs({ redirect: n3 }))
  12135. return t3.length > 0 ? Q($, Object.assign({ uniIdRedirectUrl: n3 }, e3)) : void (ns && ls({ api: "navigateTo", redirect: n3 }));
  12136. });
  12137. }(n2);
  12138. });
  12139. }
  12140. function gs(e2) {
  12141. !function(e3) {
  12142. e3.onResponse = function(e4) {
  12143. V(B, e4);
  12144. }, e3.offResponse = function(e4) {
  12145. Y(B, e4);
  12146. };
  12147. }(e2), function(e3) {
  12148. e3.onNeedLogin = function(e4) {
  12149. V($, e4);
  12150. }, e3.offNeedLogin = function(e4) {
  12151. Y($, e4);
  12152. }, ts && (U("_globalUniCloudStatus").needLoginInit || (U("_globalUniCloudStatus").needLoginInit = true, ee().then(() => {
  12153. ps.call(e3);
  12154. }), rs && fs.call(e3)));
  12155. }(e2), function(e3) {
  12156. e3.onRefreshToken = function(e4) {
  12157. V(W, e4);
  12158. }, e3.offRefreshToken = function(e4) {
  12159. Y(W, e4);
  12160. };
  12161. }(e2);
  12162. }
  12163. let ms;
  12164. const ys = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", _s = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  12165. function ws() {
  12166. const e2 = ie().token || "", t2 = e2.split(".");
  12167. if (!e2 || 3 !== t2.length)
  12168. return { uid: null, role: [], permission: [], tokenExpired: 0 };
  12169. let n2;
  12170. try {
  12171. n2 = JSON.parse((s2 = t2[1], decodeURIComponent(ms(s2).split("").map(function(e3) {
  12172. return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
  12173. }).join(""))));
  12174. } catch (e3) {
  12175. throw new Error("获取当前用户信息出错,详细错误信息为:" + e3.message);
  12176. }
  12177. var s2;
  12178. return n2.tokenExpired = 1e3 * n2.exp, delete n2.exp, delete n2.iat, n2;
  12179. }
  12180. ms = "function" != typeof atob ? function(e2) {
  12181. if (e2 = String(e2).replace(/[\t\n\f\r ]+/g, ""), !_s.test(e2))
  12182. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  12183. var t2;
  12184. e2 += "==".slice(2 - (3 & e2.length));
  12185. for (var n2, s2, r2 = "", i2 = 0; i2 < e2.length; )
  12186. t2 = ys.indexOf(e2.charAt(i2++)) << 18 | ys.indexOf(e2.charAt(i2++)) << 12 | (n2 = ys.indexOf(e2.charAt(i2++))) << 6 | (s2 = ys.indexOf(e2.charAt(i2++))), r2 += 64 === n2 ? String.fromCharCode(t2 >> 16 & 255) : 64 === s2 ? String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255) : String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255, 255 & t2);
  12187. return r2;
  12188. } : atob;
  12189. var vs = s(function(e2, t2) {
  12190. Object.defineProperty(t2, "__esModule", { value: true });
  12191. const n2 = "chooseAndUploadFile:ok", s2 = "chooseAndUploadFile:fail";
  12192. function r2(e3, t3) {
  12193. return e3.tempFiles.forEach((e4, n3) => {
  12194. e4.name || (e4.name = e4.path.substring(e4.path.lastIndexOf("/") + 1)), t3 && (e4.fileType = t3), e4.cloudPath = Date.now() + "_" + n3 + e4.name.substring(e4.name.lastIndexOf("."));
  12195. }), e3.tempFilePaths || (e3.tempFilePaths = e3.tempFiles.map((e4) => e4.path)), e3;
  12196. }
  12197. function i2(e3, t3, { onChooseFile: s3, onUploadProgress: r3 }) {
  12198. return t3.then((e4) => {
  12199. if (s3) {
  12200. const t4 = s3(e4);
  12201. if (void 0 !== t4)
  12202. return Promise.resolve(t4).then((t5) => void 0 === t5 ? e4 : t5);
  12203. }
  12204. return e4;
  12205. }).then((t4) => false === t4 ? { errMsg: n2, tempFilePaths: [], tempFiles: [] } : function(e4, t5, s4 = 5, r4) {
  12206. (t5 = Object.assign({}, t5)).errMsg = n2;
  12207. const i3 = t5.tempFiles, o2 = i3.length;
  12208. let a2 = 0;
  12209. return new Promise((n3) => {
  12210. for (; a2 < s4; )
  12211. c2();
  12212. function c2() {
  12213. const s5 = a2++;
  12214. if (s5 >= o2)
  12215. return void (!i3.find((e5) => !e5.url && !e5.errMsg) && n3(t5));
  12216. const u2 = i3[s5];
  12217. e4.uploadFile({ filePath: u2.path, cloudPath: u2.cloudPath, fileType: u2.fileType, onUploadProgress(e5) {
  12218. e5.index = s5, e5.tempFile = u2, e5.tempFilePath = u2.path, r4 && r4(e5);
  12219. } }).then((e5) => {
  12220. u2.url = e5.fileID, s5 < o2 && c2();
  12221. }).catch((e5) => {
  12222. u2.errMsg = e5.errMsg || e5.message, s5 < o2 && c2();
  12223. });
  12224. }
  12225. });
  12226. }(e3, t4, 5, r3));
  12227. }
  12228. t2.initChooseAndUploadFile = function(e3) {
  12229. return function(t3 = { type: "all" }) {
  12230. return "image" === t3.type ? i2(e3, function(e4) {
  12231. const { count: t4, sizeType: n3, sourceType: i3 = ["album", "camera"], extension: o2 } = e4;
  12232. return new Promise((e5, a2) => {
  12233. uni.chooseImage({ count: t4, sizeType: n3, sourceType: i3, extension: o2, success(t5) {
  12234. e5(r2(t5, "image"));
  12235. }, fail(e6) {
  12236. a2({ errMsg: e6.errMsg.replace("chooseImage:fail", s2) });
  12237. } });
  12238. });
  12239. }(t3), t3) : "video" === t3.type ? i2(e3, function(e4) {
  12240. const { camera: t4, compressed: n3, maxDuration: i3, sourceType: o2 = ["album", "camera"], extension: a2 } = e4;
  12241. return new Promise((e5, c2) => {
  12242. uni.chooseVideo({ camera: t4, compressed: n3, maxDuration: i3, sourceType: o2, extension: a2, success(t5) {
  12243. const { tempFilePath: n4, duration: s3, size: i4, height: o3, width: a3 } = t5;
  12244. e5(r2({ errMsg: "chooseVideo:ok", tempFilePaths: [n4], tempFiles: [{ name: t5.tempFile && t5.tempFile.name || "", path: n4, size: i4, type: t5.tempFile && t5.tempFile.type || "", width: a3, height: o3, duration: s3, fileType: "video", cloudPath: "" }] }, "video"));
  12245. }, fail(e6) {
  12246. c2({ errMsg: e6.errMsg.replace("chooseVideo:fail", s2) });
  12247. } });
  12248. });
  12249. }(t3), t3) : i2(e3, function(e4) {
  12250. const { count: t4, extension: n3 } = e4;
  12251. return new Promise((e5, i3) => {
  12252. let o2 = uni.chooseFile;
  12253. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o2 = wx.chooseMessageFile), "function" != typeof o2)
  12254. return i3({ errMsg: s2 + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });
  12255. o2({ type: "all", count: t4, extension: n3, success(t5) {
  12256. e5(r2(t5));
  12257. }, fail(e6) {
  12258. i3({ errMsg: e6.errMsg.replace("chooseFile:fail", s2) });
  12259. } });
  12260. });
  12261. }(t3), t3);
  12262. };
  12263. };
  12264. }), Is = n(vs);
  12265. const Ss = "manual";
  12266. function bs(e2) {
  12267. return { props: { localdata: { type: Array, default: () => [] }, options: { type: [Object, Array], default: () => ({}) }, spaceInfo: { type: Object, default: () => ({}) }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: false }, gettree: { type: [Boolean, String], default: false }, gettreepath: { type: [Boolean, String], default: false }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: false }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: false } }, data: () => ({ mixinDatacomLoading: false, mixinDatacomHasMore: false, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {} }), created() {
  12268. this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(() => {
  12269. var e3 = [];
  12270. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach((t2) => {
  12271. e3.push(this[t2]);
  12272. }), e3;
  12273. }, (e3, t2) => {
  12274. if (this.loadtime === Ss)
  12275. return;
  12276. let n2 = false;
  12277. const s2 = [];
  12278. for (let r2 = 2; r2 < e3.length; r2++)
  12279. e3[r2] !== t2[r2] && (s2.push(e3[r2]), n2 = true);
  12280. e3[0] !== t2[0] && (this.mixinDatacomPage.current = this.pageCurrent), this.mixinDatacomPage.size = this.pageSize, this.onMixinDatacomPropsChange(n2, s2);
  12281. });
  12282. }, methods: { onMixinDatacomPropsChange(e3, t2) {
  12283. }, mixinDatacomEasyGet({ getone: e3 = false, success: t2, fail: n2 } = {}) {
  12284. this.mixinDatacomLoading || (this.mixinDatacomLoading = true, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then((n3) => {
  12285. this.mixinDatacomLoading = false;
  12286. const { data: s2, count: r2 } = n3.result;
  12287. this.getcount && (this.mixinDatacomPage.count = r2), this.mixinDatacomHasMore = s2.length < this.pageSize;
  12288. const i2 = e3 ? s2.length ? s2[0] : void 0 : s2;
  12289. this.mixinDatacomResData = i2, t2 && t2(i2);
  12290. }).catch((e4) => {
  12291. this.mixinDatacomLoading = false, this.mixinDatacomErrorMessage = e4, n2 && n2(e4);
  12292. }));
  12293. }, mixinDatacomGet(t2 = {}) {
  12294. let n2 = e2.database(this.spaceInfo);
  12295. const s2 = t2.action || this.action;
  12296. s2 && (n2 = n2.action(s2));
  12297. const r2 = t2.collection || this.collection;
  12298. n2 = Array.isArray(r2) ? n2.collection(...r2) : n2.collection(r2);
  12299. const i2 = t2.where || this.where;
  12300. i2 && Object.keys(i2).length && (n2 = n2.where(i2));
  12301. const o2 = t2.field || this.field;
  12302. o2 && (n2 = n2.field(o2));
  12303. const a2 = t2.foreignKey || this.foreignKey;
  12304. a2 && (n2 = n2.foreignKey(a2));
  12305. const c2 = t2.groupby || this.groupby;
  12306. c2 && (n2 = n2.groupBy(c2));
  12307. const u2 = t2.groupField || this.groupField;
  12308. u2 && (n2 = n2.groupField(u2));
  12309. true === (void 0 !== t2.distinct ? t2.distinct : this.distinct) && (n2 = n2.distinct());
  12310. const h2 = t2.orderby || this.orderby;
  12311. h2 && (n2 = n2.orderBy(h2));
  12312. const l2 = void 0 !== t2.pageCurrent ? t2.pageCurrent : this.mixinDatacomPage.current, d2 = void 0 !== t2.pageSize ? t2.pageSize : this.mixinDatacomPage.size, p2 = void 0 !== t2.getcount ? t2.getcount : this.getcount, f2 = void 0 !== t2.gettree ? t2.gettree : this.gettree, g2 = void 0 !== t2.gettreepath ? t2.gettreepath : this.gettreepath, m2 = { getCount: p2 }, y2 = { limitLevel: void 0 !== t2.limitlevel ? t2.limitlevel : this.limitlevel, startWith: void 0 !== t2.startwith ? t2.startwith : this.startwith };
  12313. return f2 && (m2.getTree = y2), g2 && (m2.getTreePath = y2), n2 = n2.skip(d2 * (l2 - 1)).limit(d2).get(m2), n2;
  12314. } } };
  12315. }
  12316. function ks(e2) {
  12317. return function(t2, n2 = {}) {
  12318. n2 = function(e3, t3 = {}) {
  12319. return e3.customUI = t3.customUI || e3.customUI, e3.parseSystemError = t3.parseSystemError || e3.parseSystemError, Object.assign(e3.loadingOptions, t3.loadingOptions), Object.assign(e3.errorOptions, t3.errorOptions), "object" == typeof t3.secretMethods && (e3.secretMethods = t3.secretMethods), e3;
  12320. }({ customUI: false, loadingOptions: { title: "加载中...", mask: true }, errorOptions: { type: "modal", retry: false } }, n2);
  12321. const { customUI: s2, loadingOptions: r2, errorOptions: i2, parseSystemError: o2 } = n2, a2 = !s2;
  12322. return new Proxy({}, { get: (s3, c2) => function({ fn: e3, interceptorName: t3, getCallbackArgs: n3 } = {}) {
  12323. return async function(...s4) {
  12324. const r3 = n3 ? n3({ params: s4 }) : {};
  12325. let i3, o3;
  12326. try {
  12327. return await M(q(t3, "invoke"), { ...r3 }), i3 = await e3(...s4), await M(q(t3, "success"), { ...r3, result: i3 }), i3;
  12328. } catch (e4) {
  12329. throw o3 = e4, await M(q(t3, "fail"), { ...r3, error: o3 }), o3;
  12330. } finally {
  12331. await M(q(t3, "complete"), o3 ? { ...r3, error: o3 } : { ...r3, result: i3 });
  12332. }
  12333. };
  12334. }({ fn: async function s4(...u2) {
  12335. let l2;
  12336. a2 && uni.showLoading({ title: r2.title, mask: r2.mask });
  12337. const d2 = { name: t2, type: h, data: { method: c2, params: u2 } };
  12338. "object" == typeof n2.secretMethods && function(e3, t3) {
  12339. const n3 = t3.data.method, s5 = e3.secretMethods || {}, r3 = s5[n3] || s5["*"];
  12340. r3 && (t3.secretType = r3);
  12341. }(n2, d2);
  12342. let p2 = false;
  12343. try {
  12344. l2 = await e2.callFunction(d2);
  12345. } catch (e3) {
  12346. p2 = true, l2 = { result: new ne(e3) };
  12347. }
  12348. const { errSubject: f2, errCode: g2, errMsg: m2, newToken: y2 } = l2.result || {};
  12349. if (a2 && uni.hideLoading(), y2 && y2.token && y2.tokenExpired && (oe(y2), Q(W, { ...y2 })), g2) {
  12350. let e3 = m2;
  12351. if (p2 && o2) {
  12352. e3 = (await o2({ objectName: t2, methodName: c2, params: u2, errSubject: f2, errCode: g2, errMsg: m2 })).errMsg || m2;
  12353. }
  12354. if (a2)
  12355. if ("toast" === i2.type)
  12356. uni.showToast({ title: e3, icon: "none" });
  12357. else {
  12358. if ("modal" !== i2.type)
  12359. throw new Error(`Invalid errorOptions.type: ${i2.type}`);
  12360. {
  12361. const { confirm: t3 } = await async function({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3 } = {}) {
  12362. return new Promise((i3, o3) => {
  12363. uni.showModal({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3, success(e5) {
  12364. i3(e5);
  12365. }, fail() {
  12366. i3({ confirm: false, cancel: true });
  12367. } });
  12368. });
  12369. }({ title: "提示", content: e3, showCancel: i2.retry, cancelText: "取消", confirmText: i2.retry ? "重试" : "确定" });
  12370. if (i2.retry && t3)
  12371. return s4(...u2);
  12372. }
  12373. }
  12374. const n3 = new ne({ subject: f2, code: g2, message: m2, requestId: l2.requestId });
  12375. throw n3.detail = l2.result, Q(B, { type: H, content: n3 }), n3;
  12376. }
  12377. return Q(B, { type: H, content: l2.result }), l2.result;
  12378. }, interceptorName: "callObject", getCallbackArgs: function({ params: e3 } = {}) {
  12379. return { objectName: t2, methodName: c2, params: e3 };
  12380. } }) });
  12381. };
  12382. }
  12383. function Cs(e2) {
  12384. return U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e2.config.spaceId));
  12385. }
  12386. async function Ts({ openid: e2, callLoginByWeixin: t2 = false } = {}) {
  12387. Cs(this);
  12388. throw new Error(`[SecureNetwork] API \`initSecureNetworkByWeixin\` is not supported on platform \`${P}\``);
  12389. }
  12390. async function Ps(e2) {
  12391. const t2 = Cs(this);
  12392. return t2.initPromise || (t2.initPromise = Ts.call(this, e2)), t2.initPromise;
  12393. }
  12394. function As(e2) {
  12395. return function({ openid: t2, callLoginByWeixin: n2 = false } = {}) {
  12396. return Ps.call(e2, { openid: t2, callLoginByWeixin: n2 });
  12397. };
  12398. }
  12399. function Es(e2) {
  12400. const t2 = { getSystemInfo: uni.getSystemInfo, getPushClientId: uni.getPushClientId };
  12401. return function(n2) {
  12402. return new Promise((s2, r2) => {
  12403. t2[e2]({ ...n2, success(e3) {
  12404. s2(e3);
  12405. }, fail(e3) {
  12406. r2(e3);
  12407. } });
  12408. });
  12409. };
  12410. }
  12411. class Os extends class {
  12412. constructor() {
  12413. this._callback = {};
  12414. }
  12415. addListener(e2, t2) {
  12416. this._callback[e2] || (this._callback[e2] = []), this._callback[e2].push(t2);
  12417. }
  12418. on(e2, t2) {
  12419. return this.addListener(e2, t2);
  12420. }
  12421. removeListener(e2, t2) {
  12422. if (!t2)
  12423. throw new Error('The "listener" argument must be of type function. Received undefined');
  12424. const n2 = this._callback[e2];
  12425. if (!n2)
  12426. return;
  12427. const s2 = function(e3, t3) {
  12428. for (let n3 = e3.length - 1; n3 >= 0; n3--)
  12429. if (e3[n3] === t3)
  12430. return n3;
  12431. return -1;
  12432. }(n2, t2);
  12433. n2.splice(s2, 1);
  12434. }
  12435. off(e2, t2) {
  12436. return this.removeListener(e2, t2);
  12437. }
  12438. removeAllListener(e2) {
  12439. delete this._callback[e2];
  12440. }
  12441. emit(e2, ...t2) {
  12442. const n2 = this._callback[e2];
  12443. if (n2)
  12444. for (let e3 = 0; e3 < n2.length; e3++)
  12445. n2[e3](...t2);
  12446. }
  12447. } {
  12448. constructor() {
  12449. super(), this._uniPushMessageCallback = this._receivePushMessage.bind(this), this._currentMessageId = -1, this._payloadQueue = [];
  12450. }
  12451. init() {
  12452. return Promise.all([Es("getSystemInfo")(), Es("getPushClientId")()]).then(([{ appId: e2 } = {}, { cid: t2 } = {}] = []) => {
  12453. if (!e2)
  12454. throw new Error("Invalid appId, please check the manifest.json file");
  12455. if (!t2)
  12456. throw new Error("Invalid push client id");
  12457. this._appId = e2, this._pushClientId = t2, this._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), this.emit("open"), this._initMessageListener();
  12458. }, (e2) => {
  12459. throw this.emit("error", e2), this.close(), e2;
  12460. });
  12461. }
  12462. async open() {
  12463. return this.init();
  12464. }
  12465. _isUniCloudSSE(e2) {
  12466. if ("receive" !== e2.type)
  12467. return false;
  12468. const t2 = e2 && e2.data && e2.data.payload;
  12469. return !(!t2 || "UNI_CLOUD_SSE" !== t2.channel || t2.seqId !== this._seqId);
  12470. }
  12471. _receivePushMessage(e2) {
  12472. if (!this._isUniCloudSSE(e2))
  12473. return;
  12474. const t2 = e2 && e2.data && e2.data.payload, { action: n2, messageId: s2, message: r2 } = t2;
  12475. this._payloadQueue.push({ action: n2, messageId: s2, message: r2 }), this._consumMessage();
  12476. }
  12477. _consumMessage() {
  12478. for (; ; ) {
  12479. const e2 = this._payloadQueue.find((e3) => e3.messageId === this._currentMessageId + 1);
  12480. if (!e2)
  12481. break;
  12482. this._currentMessageId++, this._parseMessagePayload(e2);
  12483. }
  12484. }
  12485. _parseMessagePayload(e2) {
  12486. const { action: t2, messageId: n2, message: s2 } = e2;
  12487. "end" === t2 ? this._end({ messageId: n2, message: s2 }) : "message" === t2 && this._appendMessage({ messageId: n2, message: s2 });
  12488. }
  12489. _appendMessage({ messageId: e2, message: t2 } = {}) {
  12490. this.emit("message", t2);
  12491. }
  12492. _end({ messageId: e2, message: t2 } = {}) {
  12493. this.emit("end", t2), this.close();
  12494. }
  12495. _initMessageListener() {
  12496. uni.onPushMessage(this._uniPushMessageCallback);
  12497. }
  12498. _destroy() {
  12499. uni.offPushMessage(this._uniPushMessageCallback);
  12500. }
  12501. toJSON() {
  12502. return { appId: this._appId, pushClientId: this._pushClientId, seqId: this._seqId };
  12503. }
  12504. close() {
  12505. this._destroy(), this.emit("close");
  12506. }
  12507. }
  12508. async function xs(e2, t2) {
  12509. const n2 = `http://${e2}:${t2}/system/ping`;
  12510. try {
  12511. const e3 = await (s2 = { url: n2, timeout: 500 }, new Promise((e4, t3) => {
  12512. se.request({ ...s2, success(t4) {
  12513. e4(t4);
  12514. }, fail(e5) {
  12515. t3(e5);
  12516. } });
  12517. }));
  12518. return !(!e3.data || 0 !== e3.data.code);
  12519. } catch (e3) {
  12520. return false;
  12521. }
  12522. var s2;
  12523. }
  12524. async function Rs(e2) {
  12525. {
  12526. const { osName: e3, osVersion: t3 } = ue();
  12527. "ios" === e3 && function(e4) {
  12528. if (!e4 || "string" != typeof e4)
  12529. return 0;
  12530. const t4 = e4.match(/^(\d+)./);
  12531. return t4 && t4[1] ? parseInt(t4[1]) : 0;
  12532. }(t3) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  12533. }
  12534. const t2 = e2.__dev__;
  12535. if (!t2.debugInfo)
  12536. return;
  12537. const { address: n2, servePort: s2 } = t2.debugInfo, { address: r2 } = await async function(e3, t3) {
  12538. let n3;
  12539. for (let s3 = 0; s3 < e3.length; s3++) {
  12540. const r3 = e3[s3];
  12541. if (await xs(r3, t3)) {
  12542. n3 = r3;
  12543. break;
  12544. }
  12545. }
  12546. return { address: n3, port: t3 };
  12547. }(n2, s2);
  12548. if (r2)
  12549. return t2.localAddress = r2, void (t2.localPort = s2);
  12550. const i2 = console["error"];
  12551. let o2 = "";
  12552. if ("remote" === t2.debugInfo.initialLaunchType ? (t2.debugInfo.forceRemote = true, o2 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o2 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o2 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", 0 === P.indexOf("mp-") && (o2 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t2.debugInfo.forceRemote)
  12553. throw new Error(o2);
  12554. i2(o2);
  12555. }
  12556. function Us(e2) {
  12557. e2._initPromiseHub || (e2._initPromiseHub = new I({ createPromise: function() {
  12558. let t2 = Promise.resolve();
  12559. var n2;
  12560. n2 = 1, t2 = new Promise((e3) => {
  12561. setTimeout(() => {
  12562. e3();
  12563. }, n2);
  12564. });
  12565. const s2 = e2.auth();
  12566. return t2.then(() => s2.getLoginState()).then((e3) => e3 ? Promise.resolve() : s2.signInAnonymously());
  12567. } }));
  12568. }
  12569. const Ls = { tcb: St, tencent: St, aliyun: me, private: kt };
  12570. let Ns = new class {
  12571. init(e2) {
  12572. let t2 = {};
  12573. const n2 = Ls[e2.provider];
  12574. if (!n2)
  12575. throw new Error("未提供正确的provider参数");
  12576. t2 = n2.init(e2), function(e3) {
  12577. const t3 = {};
  12578. e3.__dev__ = t3, t3.debugLog = "app" === P;
  12579. const n3 = A;
  12580. n3 && !n3.code && (t3.debugInfo = n3);
  12581. const s2 = new I({ createPromise: function() {
  12582. return Rs(e3);
  12583. } });
  12584. t3.initLocalNetwork = function() {
  12585. return s2.exec();
  12586. };
  12587. }(t2), Us(t2), Rn(t2), function(e3) {
  12588. const t3 = e3.uploadFile;
  12589. e3.uploadFile = function(e4) {
  12590. return t3.call(this, e4);
  12591. };
  12592. }(t2), function(e3) {
  12593. e3.database = function(t3) {
  12594. if (t3 && Object.keys(t3).length > 0)
  12595. return e3.init(t3).database();
  12596. if (this._database)
  12597. return this._database;
  12598. const n3 = $n(Wn, { uniClient: e3 });
  12599. return this._database = n3, n3;
  12600. }, e3.databaseForJQL = function(t3) {
  12601. if (t3 && Object.keys(t3).length > 0)
  12602. return e3.init(t3).databaseForJQL();
  12603. if (this._databaseForJQL)
  12604. return this._databaseForJQL;
  12605. const n3 = $n(Wn, { uniClient: e3, isJQL: true });
  12606. return this._databaseForJQL = n3, n3;
  12607. };
  12608. }(t2), function(e3) {
  12609. e3.getCurrentUserInfo = ws, e3.chooseAndUploadFile = Is.initChooseAndUploadFile(e3), Object.assign(e3, { get mixinDatacom() {
  12610. return bs(e3);
  12611. } }), e3.SSEChannel = Os, e3.initSecureNetworkByWeixin = As(e3), e3.importObject = ks(e3);
  12612. }(t2);
  12613. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach((e3) => {
  12614. if (!t2[e3])
  12615. return;
  12616. const n3 = t2[e3];
  12617. t2[e3] = function() {
  12618. return n3.apply(t2, Array.from(arguments));
  12619. }, t2[e3] = function(e4, t3) {
  12620. return function(n4) {
  12621. let s2 = false;
  12622. if ("callFunction" === t3) {
  12623. const e5 = n4 && n4.type || u;
  12624. s2 = e5 !== u;
  12625. }
  12626. const r2 = "callFunction" === t3 && !s2, i2 = this._initPromiseHub.exec();
  12627. n4 = n4 || {};
  12628. const { success: o2, fail: a2, complete: c2 } = te(n4), h2 = i2.then(() => s2 ? Promise.resolve() : M(q(t3, "invoke"), n4)).then(() => e4.call(this, n4)).then((e5) => s2 ? Promise.resolve(e5) : M(q(t3, "success"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (r2 && Q(B, { type: J, content: e5 }), Promise.resolve(e5))), (e5) => s2 ? Promise.reject(e5) : M(q(t3, "fail"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (Q(B, { type: J, content: e5 }), Promise.reject(e5))));
  12629. if (!(o2 || a2 || c2))
  12630. return h2;
  12631. h2.then((e5) => {
  12632. o2 && o2(e5), c2 && c2(e5), r2 && Q(B, { type: J, content: e5 });
  12633. }, (e5) => {
  12634. a2 && a2(e5), c2 && c2(e5), r2 && Q(B, { type: J, content: e5 });
  12635. });
  12636. };
  12637. }(t2[e3], e3).bind(t2);
  12638. }), t2.init = this.init, t2;
  12639. }
  12640. }();
  12641. (() => {
  12642. const e2 = E;
  12643. let t2 = {};
  12644. if (e2 && 1 === e2.length)
  12645. t2 = e2[0], Ns = Ns.init(t2), Ns._isDefault = true;
  12646. else {
  12647. const t3 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  12648. let n2;
  12649. n2 = e2 && e2.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : "应用未关联服务空间,请在uniCloud目录右键关联服务空间", t3.forEach((e3) => {
  12650. Ns[e3] = function() {
  12651. return console.error(n2), Promise.reject(new ne({ code: "SYS_ERR", message: n2 }));
  12652. };
  12653. });
  12654. }
  12655. Object.assign(Ns, { get mixinDatacom() {
  12656. return bs(Ns);
  12657. } }), gs(Ns), Ns.addInterceptor = D, Ns.removeInterceptor = F, Ns.interceptObject = K;
  12658. })();
  12659. var Ds = Ns;
  12660. const ERR_MSG_OK = "chooseAndUploadFile:ok";
  12661. const ERR_MSG_FAIL = "chooseAndUploadFile:fail";
  12662. function chooseImage(opts) {
  12663. const {
  12664. count,
  12665. sizeType = ["original", "compressed"],
  12666. sourceType,
  12667. extension
  12668. } = opts;
  12669. return new Promise((resolve, reject) => {
  12670. uni.chooseImage({
  12671. count,
  12672. sizeType,
  12673. sourceType,
  12674. extension,
  12675. success(res) {
  12676. resolve(normalizeChooseAndUploadFileRes(res, "image"));
  12677. },
  12678. fail(res) {
  12679. reject({
  12680. errMsg: res.errMsg.replace("chooseImage:fail", ERR_MSG_FAIL)
  12681. });
  12682. }
  12683. });
  12684. });
  12685. }
  12686. function chooseVideo(opts) {
  12687. const {
  12688. camera,
  12689. compressed,
  12690. maxDuration,
  12691. sourceType,
  12692. extension
  12693. } = opts;
  12694. return new Promise((resolve, reject) => {
  12695. uni.chooseVideo({
  12696. camera,
  12697. compressed,
  12698. maxDuration,
  12699. sourceType,
  12700. extension,
  12701. success(res) {
  12702. const {
  12703. tempFilePath,
  12704. duration,
  12705. size,
  12706. height,
  12707. width
  12708. } = res;
  12709. resolve(normalizeChooseAndUploadFileRes({
  12710. errMsg: "chooseVideo:ok",
  12711. tempFilePaths: [tempFilePath],
  12712. tempFiles: [
  12713. {
  12714. name: res.tempFile && res.tempFile.name || "",
  12715. path: tempFilePath,
  12716. size,
  12717. type: res.tempFile && res.tempFile.type || "",
  12718. width,
  12719. height,
  12720. duration,
  12721. fileType: "video",
  12722. cloudPath: ""
  12723. }
  12724. ]
  12725. }, "video"));
  12726. },
  12727. fail(res) {
  12728. reject({
  12729. errMsg: res.errMsg.replace("chooseVideo:fail", ERR_MSG_FAIL)
  12730. });
  12731. }
  12732. });
  12733. });
  12734. }
  12735. function chooseAll(opts) {
  12736. const {
  12737. count,
  12738. extension
  12739. } = opts;
  12740. return new Promise((resolve, reject) => {
  12741. let chooseFile = uni.chooseFile;
  12742. if (typeof wx !== "undefined" && typeof wx.chooseMessageFile === "function") {
  12743. chooseFile = wx.chooseMessageFile;
  12744. }
  12745. if (typeof chooseFile !== "function") {
  12746. return reject({
  12747. errMsg: ERR_MSG_FAIL + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  12748. });
  12749. }
  12750. chooseFile({
  12751. type: "all",
  12752. count,
  12753. extension,
  12754. success(res) {
  12755. resolve(normalizeChooseAndUploadFileRes(res));
  12756. },
  12757. fail(res) {
  12758. reject({
  12759. errMsg: res.errMsg.replace("chooseFile:fail", ERR_MSG_FAIL)
  12760. });
  12761. }
  12762. });
  12763. });
  12764. }
  12765. function normalizeChooseAndUploadFileRes(res, fileType) {
  12766. res.tempFiles.forEach((item, index) => {
  12767. if (!item.name) {
  12768. item.name = item.path.substring(item.path.lastIndexOf("/") + 1);
  12769. }
  12770. if (fileType) {
  12771. item.fileType = fileType;
  12772. }
  12773. item.cloudPath = Date.now() + "_" + index + item.name.substring(item.name.lastIndexOf("."));
  12774. });
  12775. if (!res.tempFilePaths) {
  12776. res.tempFilePaths = res.tempFiles.map((file) => file.path);
  12777. }
  12778. return res;
  12779. }
  12780. function uploadCloudFiles(files, max = 5, onUploadProgress) {
  12781. files = JSON.parse(JSON.stringify(files));
  12782. const len2 = files.length;
  12783. let count = 0;
  12784. let self = this;
  12785. return new Promise((resolve) => {
  12786. while (count < max) {
  12787. next();
  12788. }
  12789. function next() {
  12790. let cur = count++;
  12791. if (cur >= len2) {
  12792. !files.find((item) => !item.url && !item.errMsg) && resolve(files);
  12793. return;
  12794. }
  12795. const fileItem = files[cur];
  12796. const index = self.files.findIndex((v2) => v2.uuid === fileItem.uuid);
  12797. fileItem.url = "";
  12798. delete fileItem.errMsg;
  12799. Ds.uploadFile({
  12800. filePath: fileItem.path,
  12801. cloudPath: fileItem.cloudPath,
  12802. fileType: fileItem.fileType,
  12803. onUploadProgress: (res) => {
  12804. res.index = index;
  12805. onUploadProgress && onUploadProgress(res);
  12806. }
  12807. }).then((res) => {
  12808. fileItem.url = res.fileID;
  12809. fileItem.index = index;
  12810. if (cur < len2) {
  12811. next();
  12812. }
  12813. }).catch((res) => {
  12814. fileItem.errMsg = res.errMsg || res.message;
  12815. fileItem.index = index;
  12816. if (cur < len2) {
  12817. next();
  12818. }
  12819. });
  12820. }
  12821. });
  12822. }
  12823. function uploadFiles(choosePromise, {
  12824. onChooseFile,
  12825. onUploadProgress
  12826. }) {
  12827. return choosePromise.then((res) => {
  12828. if (onChooseFile) {
  12829. const customChooseRes = onChooseFile(res);
  12830. if (typeof customChooseRes !== "undefined") {
  12831. return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === "undefined" ? res : chooseRes);
  12832. }
  12833. }
  12834. return res;
  12835. }).then((res) => {
  12836. if (res === false) {
  12837. return {
  12838. errMsg: ERR_MSG_OK,
  12839. tempFilePaths: [],
  12840. tempFiles: []
  12841. };
  12842. }
  12843. return res;
  12844. });
  12845. }
  12846. function chooseAndUploadFile(opts = {
  12847. type: "all"
  12848. }) {
  12849. if (opts.type === "image") {
  12850. return uploadFiles(chooseImage(opts), opts);
  12851. } else if (opts.type === "video") {
  12852. return uploadFiles(chooseVideo(opts), opts);
  12853. }
  12854. return uploadFiles(chooseAll(opts), opts);
  12855. }
  12856. const get_file_ext = (name) => {
  12857. const last_len = name.lastIndexOf(".");
  12858. const len2 = name.length;
  12859. return {
  12860. name: name.substring(0, last_len),
  12861. ext: name.substring(last_len + 1, len2)
  12862. };
  12863. };
  12864. const get_extname = (fileExtname) => {
  12865. if (!Array.isArray(fileExtname)) {
  12866. let extname = fileExtname.replace(/(\[|\])/g, "");
  12867. return extname.split(",");
  12868. } else {
  12869. return fileExtname;
  12870. }
  12871. };
  12872. const get_files_and_is_max = (res, _extname) => {
  12873. let filePaths = [];
  12874. let files = [];
  12875. if (!_extname || _extname.length === 0) {
  12876. return {
  12877. filePaths,
  12878. files
  12879. };
  12880. }
  12881. res.tempFiles.forEach((v2) => {
  12882. let fileFullName = get_file_ext(v2.name);
  12883. const extname = fileFullName.ext.toLowerCase();
  12884. if (_extname.indexOf(extname) !== -1) {
  12885. files.push(v2);
  12886. filePaths.push(v2.path);
  12887. }
  12888. });
  12889. if (files.length !== res.tempFiles.length) {
  12890. uni.showToast({
  12891. title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files.length} 个文件格式不正确`,
  12892. icon: "none",
  12893. duration: 5e3
  12894. });
  12895. }
  12896. return {
  12897. filePaths,
  12898. files
  12899. };
  12900. };
  12901. const get_file_info = (filepath) => {
  12902. return new Promise((resolve, reject) => {
  12903. uni.getImageInfo({
  12904. src: filepath,
  12905. success(res) {
  12906. resolve(res);
  12907. },
  12908. fail(err) {
  12909. reject(err);
  12910. }
  12911. });
  12912. });
  12913. };
  12914. const get_file_data = async (files, type = "image") => {
  12915. let fileFullName = get_file_ext(files.name);
  12916. const extname = fileFullName.ext.toLowerCase();
  12917. let filedata = {
  12918. name: files.name,
  12919. uuid: files.uuid,
  12920. extname: extname || "",
  12921. cloudPath: files.cloudPath,
  12922. fileType: files.fileType,
  12923. url: files.path || files.path,
  12924. size: files.size,
  12925. //单位是字节
  12926. image: {},
  12927. path: files.path,
  12928. video: {}
  12929. };
  12930. if (type === "image") {
  12931. const imageinfo = await get_file_info(files.path);
  12932. delete filedata.video;
  12933. filedata.image.width = imageinfo.width;
  12934. filedata.image.height = imageinfo.height;
  12935. filedata.image.location = imageinfo.path;
  12936. } else {
  12937. delete filedata.image;
  12938. }
  12939. return filedata;
  12940. };
  12941. const _sfc_main$5 = {
  12942. name: "uploadImage",
  12943. emits: ["uploadFiles", "choose", "delFile"],
  12944. props: {
  12945. filesList: {
  12946. type: Array,
  12947. default() {
  12948. return [];
  12949. }
  12950. },
  12951. disabled: {
  12952. type: Boolean,
  12953. default: false
  12954. },
  12955. disablePreview: {
  12956. type: Boolean,
  12957. default: false
  12958. },
  12959. limit: {
  12960. type: [Number, String],
  12961. default: 9
  12962. },
  12963. imageStyles: {
  12964. type: Object,
  12965. default() {
  12966. return {
  12967. width: "auto",
  12968. height: "auto",
  12969. border: {}
  12970. };
  12971. }
  12972. },
  12973. delIcon: {
  12974. type: Boolean,
  12975. default: true
  12976. },
  12977. readonly: {
  12978. type: Boolean,
  12979. default: false
  12980. }
  12981. },
  12982. computed: {
  12983. styles() {
  12984. let styles = {
  12985. width: "auto",
  12986. height: "auto",
  12987. border: {}
  12988. };
  12989. return Object.assign(styles, this.imageStyles);
  12990. },
  12991. boxStyle() {
  12992. const {
  12993. width = "auto",
  12994. height = "auto"
  12995. } = this.styles;
  12996. let obj = {};
  12997. if (height === "auto") {
  12998. if (width !== "auto") {
  12999. obj.height = this.value2px(width);
  13000. obj["padding-top"] = 0;
  13001. } else {
  13002. obj.height = 0;
  13003. }
  13004. } else {
  13005. obj.height = this.value2px(height);
  13006. obj["padding-top"] = 0;
  13007. }
  13008. if (width === "auto") {
  13009. if (height !== "auto") {
  13010. obj.width = this.value2px(height);
  13011. } else {
  13012. obj.width = "33.3%";
  13013. }
  13014. } else {
  13015. obj.width = this.value2px(width);
  13016. }
  13017. let classles = "";
  13018. for (let i2 in obj) {
  13019. classles += `${i2}:${obj[i2]};`;
  13020. }
  13021. return classles;
  13022. },
  13023. borderStyle() {
  13024. let {
  13025. border
  13026. } = this.styles;
  13027. let obj = {};
  13028. const widthDefaultValue = 1;
  13029. const radiusDefaultValue = 3;
  13030. if (typeof border === "boolean") {
  13031. obj.border = border ? "1px #eee solid" : "none";
  13032. } else {
  13033. let width = border && border.width || widthDefaultValue;
  13034. width = this.value2px(width);
  13035. let radius = border && border.radius || radiusDefaultValue;
  13036. radius = this.value2px(radius);
  13037. obj = {
  13038. "border-width": width,
  13039. "border-style": border && border.style || "solid",
  13040. "border-color": border && border.color || "#eee",
  13041. "border-radius": radius
  13042. };
  13043. }
  13044. let classles = "";
  13045. for (let i2 in obj) {
  13046. classles += `${i2}:${obj[i2]};`;
  13047. }
  13048. return classles;
  13049. }
  13050. },
  13051. methods: {
  13052. uploadFiles(item, index) {
  13053. this.$emit("uploadFiles", item);
  13054. },
  13055. choose() {
  13056. this.$emit("choose");
  13057. },
  13058. delFile(index) {
  13059. this.$emit("delFile", index);
  13060. },
  13061. prviewImage(img, index) {
  13062. let urls = [];
  13063. if (Number(this.limit) === 1 && this.disablePreview && !this.disabled) {
  13064. this.$emit("choose");
  13065. }
  13066. if (this.disablePreview)
  13067. return;
  13068. this.filesList.forEach((i2) => {
  13069. urls.push(i2.url);
  13070. });
  13071. uni.previewImage({
  13072. urls,
  13073. current: index
  13074. });
  13075. },
  13076. value2px(value) {
  13077. if (typeof value === "number") {
  13078. value += "px";
  13079. } else {
  13080. if (value.indexOf("%") === -1) {
  13081. value = value.indexOf("px") !== -1 ? value : value + "px";
  13082. }
  13083. }
  13084. return value;
  13085. }
  13086. }
  13087. };
  13088. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  13089. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-file-picker__container" }, [
  13090. (vue.openBlock(true), vue.createElementBlock(
  13091. vue.Fragment,
  13092. null,
  13093. vue.renderList($props.filesList, (item, index) => {
  13094. return vue.openBlock(), vue.createElementBlock(
  13095. "view",
  13096. {
  13097. class: "file-picker__box",
  13098. key: index,
  13099. style: vue.normalizeStyle($options.boxStyle)
  13100. },
  13101. [
  13102. vue.createElementVNode(
  13103. "view",
  13104. {
  13105. class: "file-picker__box-content",
  13106. style: vue.normalizeStyle($options.borderStyle)
  13107. },
  13108. [
  13109. vue.createElementVNode("image", {
  13110. class: "file-image",
  13111. src: item.url,
  13112. mode: "aspectFill",
  13113. onClick: vue.withModifiers(($event) => $options.prviewImage(item, index), ["stop"])
  13114. }, null, 8, ["src", "onClick"]),
  13115. $props.delIcon && !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
  13116. key: 0,
  13117. class: "icon-del-box",
  13118. onClick: vue.withModifiers(($event) => $options.delFile(index), ["stop"])
  13119. }, [
  13120. vue.createElementVNode("view", { class: "icon-del" }),
  13121. vue.createElementVNode("view", { class: "icon-del rotate" })
  13122. ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
  13123. item.progress && item.progress !== 100 || item.progress === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  13124. key: 1,
  13125. class: "file-picker__progress"
  13126. }, [
  13127. vue.createElementVNode("progress", {
  13128. class: "file-picker__progress-item",
  13129. percent: item.progress === -1 ? 0 : item.progress,
  13130. "stroke-width": "4",
  13131. backgroundColor: item.errMsg ? "#ff5a5f" : "#EBEBEB"
  13132. }, null, 8, ["percent", "backgroundColor"])
  13133. ])) : vue.createCommentVNode("v-if", true),
  13134. item.errMsg ? (vue.openBlock(), vue.createElementBlock("view", {
  13135. key: 2,
  13136. class: "file-picker__mask",
  13137. onClick: vue.withModifiers(($event) => $options.uploadFiles(item, index), ["stop"])
  13138. }, " 点击重试 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
  13139. ],
  13140. 4
  13141. /* STYLE */
  13142. )
  13143. ],
  13144. 4
  13145. /* STYLE */
  13146. );
  13147. }),
  13148. 128
  13149. /* KEYED_FRAGMENT */
  13150. )),
  13151. $props.filesList.length < $props.limit && !$props.readonly ? (vue.openBlock(), vue.createElementBlock(
  13152. "view",
  13153. {
  13154. key: 0,
  13155. class: "file-picker__box",
  13156. style: vue.normalizeStyle($options.boxStyle)
  13157. },
  13158. [
  13159. vue.createElementVNode(
  13160. "view",
  13161. {
  13162. class: "file-picker__box-content is-add",
  13163. style: vue.normalizeStyle($options.borderStyle),
  13164. onClick: _cache[0] || (_cache[0] = (...args) => $options.choose && $options.choose(...args))
  13165. },
  13166. [
  13167. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  13168. vue.createElementVNode("view", { class: "icon-add" }),
  13169. vue.createElementVNode("view", { class: "icon-add rotate" })
  13170. ], true)
  13171. ],
  13172. 4
  13173. /* STYLE */
  13174. )
  13175. ],
  13176. 4
  13177. /* STYLE */
  13178. )) : vue.createCommentVNode("v-if", true)
  13179. ]);
  13180. }
  13181. const uploadImage = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$2], ["__scopeId", "data-v-bdfc07e0"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue"]]);
  13182. const _sfc_main$4 = {
  13183. name: "uploadFile",
  13184. emits: ["uploadFiles", "choose", "delFile"],
  13185. props: {
  13186. filesList: {
  13187. type: Array,
  13188. default() {
  13189. return [];
  13190. }
  13191. },
  13192. delIcon: {
  13193. type: Boolean,
  13194. default: true
  13195. },
  13196. limit: {
  13197. type: [Number, String],
  13198. default: 9
  13199. },
  13200. showType: {
  13201. type: String,
  13202. default: ""
  13203. },
  13204. listStyles: {
  13205. type: Object,
  13206. default() {
  13207. return {
  13208. // 是否显示边框
  13209. border: true,
  13210. // 是否显示分隔线
  13211. dividline: true,
  13212. // 线条样式
  13213. borderStyle: {}
  13214. };
  13215. }
  13216. },
  13217. readonly: {
  13218. type: Boolean,
  13219. default: false
  13220. }
  13221. },
  13222. computed: {
  13223. list() {
  13224. let files = [];
  13225. this.filesList.forEach((v2) => {
  13226. files.push(v2);
  13227. });
  13228. return files;
  13229. },
  13230. styles() {
  13231. let styles = {
  13232. border: true,
  13233. dividline: true,
  13234. "border-style": {}
  13235. };
  13236. return Object.assign(styles, this.listStyles);
  13237. },
  13238. borderStyle() {
  13239. let {
  13240. borderStyle,
  13241. border
  13242. } = this.styles;
  13243. let obj = {};
  13244. if (!border) {
  13245. obj.border = "none";
  13246. } else {
  13247. let width = borderStyle && borderStyle.width || 1;
  13248. width = this.value2px(width);
  13249. let radius = borderStyle && borderStyle.radius || 5;
  13250. radius = this.value2px(radius);
  13251. obj = {
  13252. "border-width": width,
  13253. "border-style": borderStyle && borderStyle.style || "solid",
  13254. "border-color": borderStyle && borderStyle.color || "#eee",
  13255. "border-radius": radius
  13256. };
  13257. }
  13258. let classles = "";
  13259. for (let i2 in obj) {
  13260. classles += `${i2}:${obj[i2]};`;
  13261. }
  13262. return classles;
  13263. },
  13264. borderLineStyle() {
  13265. let obj = {};
  13266. let {
  13267. borderStyle
  13268. } = this.styles;
  13269. if (borderStyle && borderStyle.color) {
  13270. obj["border-color"] = borderStyle.color;
  13271. }
  13272. if (borderStyle && borderStyle.width) {
  13273. let width = borderStyle && borderStyle.width || 1;
  13274. let style = borderStyle && borderStyle.style || 0;
  13275. if (typeof width === "number") {
  13276. width += "px";
  13277. } else {
  13278. width = width.indexOf("px") ? width : width + "px";
  13279. }
  13280. obj["border-width"] = width;
  13281. if (typeof style === "number") {
  13282. style += "px";
  13283. } else {
  13284. style = style.indexOf("px") ? style : style + "px";
  13285. }
  13286. obj["border-top-style"] = style;
  13287. }
  13288. let classles = "";
  13289. for (let i2 in obj) {
  13290. classles += `${i2}:${obj[i2]};`;
  13291. }
  13292. return classles;
  13293. }
  13294. },
  13295. methods: {
  13296. uploadFiles(item, index) {
  13297. this.$emit("uploadFiles", {
  13298. item,
  13299. index
  13300. });
  13301. },
  13302. choose() {
  13303. this.$emit("choose");
  13304. },
  13305. delFile(index) {
  13306. this.$emit("delFile", index);
  13307. },
  13308. value2px(value) {
  13309. if (typeof value === "number") {
  13310. value += "px";
  13311. } else {
  13312. value = value.indexOf("px") !== -1 ? value : value + "px";
  13313. }
  13314. return value;
  13315. }
  13316. }
  13317. };
  13318. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  13319. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-file-picker__files" }, [
  13320. !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
  13321. key: 0,
  13322. class: "files-button",
  13323. onClick: _cache[0] || (_cache[0] = (...args) => $options.choose && $options.choose(...args))
  13324. }, [
  13325. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  13326. ])) : vue.createCommentVNode("v-if", true),
  13327. vue.createCommentVNode(` :class="{'is-text-box':showType === 'list'}" `),
  13328. $options.list.length > 0 ? (vue.openBlock(), vue.createElementBlock(
  13329. "view",
  13330. {
  13331. key: 1,
  13332. class: "uni-file-picker__lists is-text-box",
  13333. style: vue.normalizeStyle($options.borderStyle)
  13334. },
  13335. [
  13336. vue.createCommentVNode(" ,'is-list-card':showType === 'list-card' "),
  13337. (vue.openBlock(true), vue.createElementBlock(
  13338. vue.Fragment,
  13339. null,
  13340. vue.renderList($options.list, (item, index) => {
  13341. return vue.openBlock(), vue.createElementBlock(
  13342. "view",
  13343. {
  13344. class: vue.normalizeClass(["uni-file-picker__lists-box", {
  13345. "files-border": index !== 0 && $options.styles.dividline
  13346. }]),
  13347. key: index,
  13348. style: vue.normalizeStyle(index !== 0 && $options.styles.dividline && $options.borderLineStyle)
  13349. },
  13350. [
  13351. vue.createElementVNode("view", { class: "uni-file-picker__item" }, [
  13352. vue.createCommentVNode(` :class="{'is-text-image':showType === 'list'}" `),
  13353. vue.createCommentVNode(' <view class="files__image is-text-image">\n <image class="header-image" :src="item.logo" mode="aspectFit"></image>\n </view> '),
  13354. vue.createElementVNode(
  13355. "view",
  13356. { class: "files__name" },
  13357. vue.toDisplayString(item.name),
  13358. 1
  13359. /* TEXT */
  13360. ),
  13361. $props.delIcon && !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
  13362. key: 0,
  13363. class: "icon-del-box icon-files",
  13364. onClick: ($event) => $options.delFile(index)
  13365. }, [
  13366. vue.createElementVNode("view", { class: "icon-del icon-files" }),
  13367. vue.createElementVNode("view", { class: "icon-del rotate" })
  13368. ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
  13369. ]),
  13370. item.progress && item.progress !== 100 || item.progress === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  13371. key: 0,
  13372. class: "file-picker__progress"
  13373. }, [
  13374. vue.createElementVNode("progress", {
  13375. class: "file-picker__progress-item",
  13376. percent: item.progress === -1 ? 0 : item.progress,
  13377. "stroke-width": "4",
  13378. backgroundColor: item.errMsg ? "#ff5a5f" : "#EBEBEB"
  13379. }, null, 8, ["percent", "backgroundColor"])
  13380. ])) : vue.createCommentVNode("v-if", true),
  13381. item.status === "error" ? (vue.openBlock(), vue.createElementBlock("view", {
  13382. key: 1,
  13383. class: "file-picker__mask",
  13384. onClick: vue.withModifiers(($event) => $options.uploadFiles(item, index), ["stop"])
  13385. }, " 点击重试 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
  13386. ],
  13387. 6
  13388. /* CLASS, STYLE */
  13389. );
  13390. }),
  13391. 128
  13392. /* KEYED_FRAGMENT */
  13393. ))
  13394. ],
  13395. 4
  13396. /* STYLE */
  13397. )) : vue.createCommentVNode("v-if", true)
  13398. ]);
  13399. }
  13400. const uploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1], ["__scopeId", "data-v-a54939c6"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue"]]);
  13401. const _sfc_main$3 = {
  13402. name: "uniFilePicker",
  13403. components: {
  13404. uploadImage,
  13405. uploadFile
  13406. },
  13407. options: {
  13408. virtualHost: true
  13409. },
  13410. emits: ["select", "success", "fail", "progress", "delete", "update:modelValue", "input"],
  13411. props: {
  13412. modelValue: {
  13413. type: [Array, Object],
  13414. default() {
  13415. return [];
  13416. }
  13417. },
  13418. disabled: {
  13419. type: Boolean,
  13420. default: false
  13421. },
  13422. disablePreview: {
  13423. type: Boolean,
  13424. default: false
  13425. },
  13426. delIcon: {
  13427. type: Boolean,
  13428. default: true
  13429. },
  13430. // 自动上传
  13431. autoUpload: {
  13432. type: Boolean,
  13433. default: true
  13434. },
  13435. // 最大选择个数 ,h5只能限制单选或是多选
  13436. limit: {
  13437. type: [Number, String],
  13438. default: 9
  13439. },
  13440. // 列表样式 grid | list | list-card
  13441. mode: {
  13442. type: String,
  13443. default: "grid"
  13444. },
  13445. // 选择文件类型 image/video/all
  13446. fileMediatype: {
  13447. type: String,
  13448. default: "image"
  13449. },
  13450. // 文件类型筛选
  13451. fileExtname: {
  13452. type: [Array, String],
  13453. default() {
  13454. return [];
  13455. }
  13456. },
  13457. title: {
  13458. type: String,
  13459. default: ""
  13460. },
  13461. listStyles: {
  13462. type: Object,
  13463. default() {
  13464. return {
  13465. // 是否显示边框
  13466. border: true,
  13467. // 是否显示分隔线
  13468. dividline: true,
  13469. // 线条样式
  13470. borderStyle: {}
  13471. };
  13472. }
  13473. },
  13474. imageStyles: {
  13475. type: Object,
  13476. default() {
  13477. return {
  13478. width: "auto",
  13479. height: "auto"
  13480. };
  13481. }
  13482. },
  13483. readonly: {
  13484. type: Boolean,
  13485. default: false
  13486. },
  13487. returnType: {
  13488. type: String,
  13489. default: "array"
  13490. },
  13491. sizeType: {
  13492. type: Array,
  13493. default() {
  13494. return ["original", "compressed"];
  13495. }
  13496. },
  13497. sourceType: {
  13498. type: Array,
  13499. default() {
  13500. return ["album", "camera"];
  13501. }
  13502. }
  13503. },
  13504. data() {
  13505. return {
  13506. files: [],
  13507. localValue: []
  13508. };
  13509. },
  13510. watch: {
  13511. modelValue: {
  13512. handler(newVal, oldVal) {
  13513. this.setValue(newVal, oldVal);
  13514. },
  13515. immediate: true
  13516. }
  13517. },
  13518. computed: {
  13519. filesList() {
  13520. let files = [];
  13521. this.files.forEach((v2) => {
  13522. files.push(v2);
  13523. });
  13524. return files;
  13525. },
  13526. showType() {
  13527. if (this.fileMediatype === "image") {
  13528. return this.mode;
  13529. }
  13530. return "list";
  13531. },
  13532. limitLength() {
  13533. if (this.returnType === "object") {
  13534. return 1;
  13535. }
  13536. if (!this.limit) {
  13537. return 1;
  13538. }
  13539. if (this.limit >= 9) {
  13540. return 9;
  13541. }
  13542. return this.limit;
  13543. }
  13544. },
  13545. created() {
  13546. if (!(Ds.config && Ds.config.provider)) {
  13547. this.noSpace = true;
  13548. Ds.chooseAndUploadFile = chooseAndUploadFile;
  13549. }
  13550. this.form = this.getForm("uniForms");
  13551. this.formItem = this.getForm("uniFormsItem");
  13552. if (this.form && this.formItem) {
  13553. if (this.formItem.name) {
  13554. this.rename = this.formItem.name;
  13555. this.form.inputChildrens.push(this);
  13556. }
  13557. }
  13558. },
  13559. methods: {
  13560. /**
  13561. * 公开用户使用,清空文件
  13562. * @param {Object} index
  13563. */
  13564. clearFiles(index) {
  13565. if (index !== 0 && !index) {
  13566. this.files = [];
  13567. this.$nextTick(() => {
  13568. this.setEmit();
  13569. });
  13570. } else {
  13571. this.files.splice(index, 1);
  13572. }
  13573. this.$nextTick(() => {
  13574. this.setEmit();
  13575. });
  13576. },
  13577. /**
  13578. * 公开用户使用,继续上传
  13579. */
  13580. upload() {
  13581. let files = [];
  13582. this.files.forEach((v2, index) => {
  13583. if (v2.status === "ready" || v2.status === "error") {
  13584. files.push(Object.assign({}, v2));
  13585. }
  13586. });
  13587. return this.uploadFiles(files);
  13588. },
  13589. async setValue(newVal, oldVal) {
  13590. const newData = async (v2) => {
  13591. const reg = /cloud:\/\/([\w.]+\/?)\S*/;
  13592. let url = "";
  13593. if (v2.fileID) {
  13594. url = v2.fileID;
  13595. } else {
  13596. url = v2.url;
  13597. }
  13598. if (reg.test(url)) {
  13599. v2.fileID = url;
  13600. v2.url = await this.getTempFileURL(url);
  13601. }
  13602. if (v2.url)
  13603. v2.path = v2.url;
  13604. return v2;
  13605. };
  13606. if (this.returnType === "object") {
  13607. if (newVal) {
  13608. await newData(newVal);
  13609. } else {
  13610. newVal = {};
  13611. }
  13612. } else {
  13613. if (!newVal)
  13614. newVal = [];
  13615. for (let i2 = 0; i2 < newVal.length; i2++) {
  13616. let v2 = newVal[i2];
  13617. await newData(v2);
  13618. }
  13619. }
  13620. this.localValue = newVal;
  13621. if (this.form && this.formItem && !this.is_reset) {
  13622. this.is_reset = false;
  13623. this.formItem.setValue(this.localValue);
  13624. }
  13625. let filesData = Object.keys(newVal).length > 0 ? newVal : [];
  13626. this.files = [].concat(filesData);
  13627. },
  13628. /**
  13629. * 选择文件
  13630. */
  13631. choose() {
  13632. if (this.disabled)
  13633. return;
  13634. if (this.files.length >= Number(this.limitLength) && this.showType !== "grid" && this.returnType === "array") {
  13635. uni.showToast({
  13636. title: `您最多选择 ${this.limitLength} 个文件`,
  13637. icon: "none"
  13638. });
  13639. return;
  13640. }
  13641. this.chooseFiles();
  13642. },
  13643. /**
  13644. * 选择文件并上传
  13645. */
  13646. chooseFiles() {
  13647. const _extname = get_extname(this.fileExtname);
  13648. Ds.chooseAndUploadFile({
  13649. type: this.fileMediatype,
  13650. compressed: false,
  13651. sizeType: this.sizeType,
  13652. sourceType: this.sourceType,
  13653. // TODO 如果为空,video 有问题
  13654. extension: _extname.length > 0 ? _extname : void 0,
  13655. count: this.limitLength - this.files.length,
  13656. //默认9
  13657. onChooseFile: this.chooseFileCallback,
  13658. onUploadProgress: (progressEvent) => {
  13659. this.setProgress(progressEvent, progressEvent.index);
  13660. }
  13661. }).then((result) => {
  13662. this.setSuccessAndError(result.tempFiles);
  13663. }).catch((err) => {
  13664. formatAppLog("log", "at uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue:371", "选择失败", err);
  13665. });
  13666. },
  13667. /**
  13668. * 选择文件回调
  13669. * @param {Object} res
  13670. */
  13671. async chooseFileCallback(res) {
  13672. const _extname = get_extname(this.fileExtname);
  13673. const is_one = Number(this.limitLength) === 1 && this.disablePreview && !this.disabled || this.returnType === "object";
  13674. if (is_one) {
  13675. this.files = [];
  13676. }
  13677. let {
  13678. filePaths,
  13679. files
  13680. } = get_files_and_is_max(res, _extname);
  13681. if (!(_extname && _extname.length > 0)) {
  13682. filePaths = res.tempFilePaths;
  13683. files = res.tempFiles;
  13684. }
  13685. let currentData = [];
  13686. for (let i2 = 0; i2 < files.length; i2++) {
  13687. if (this.limitLength - this.files.length <= 0)
  13688. break;
  13689. files[i2].uuid = Date.now();
  13690. let filedata = await get_file_data(files[i2], this.fileMediatype);
  13691. filedata.progress = 0;
  13692. filedata.status = "ready";
  13693. this.files.push(filedata);
  13694. currentData.push({
  13695. ...filedata,
  13696. file: files[i2]
  13697. });
  13698. }
  13699. this.$emit("select", {
  13700. tempFiles: currentData,
  13701. tempFilePaths: filePaths
  13702. });
  13703. res.tempFiles = files;
  13704. if (!this.autoUpload || this.noSpace) {
  13705. res.tempFiles = [];
  13706. }
  13707. },
  13708. /**
  13709. * 批传
  13710. * @param {Object} e
  13711. */
  13712. uploadFiles(files) {
  13713. files = [].concat(files);
  13714. return uploadCloudFiles.call(this, files, 5, (res) => {
  13715. this.setProgress(res, res.index, true);
  13716. }).then((result) => {
  13717. this.setSuccessAndError(result);
  13718. return result;
  13719. }).catch((err) => {
  13720. formatAppLog("log", "at uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue:437", err);
  13721. });
  13722. },
  13723. /**
  13724. * 成功或失败
  13725. */
  13726. async setSuccessAndError(res, fn) {
  13727. let successData = [];
  13728. let errorData = [];
  13729. let tempFilePath = [];
  13730. let errorTempFilePath = [];
  13731. for (let i2 = 0; i2 < res.length; i2++) {
  13732. const item = res[i2];
  13733. const index = item.uuid ? this.files.findIndex((p2) => p2.uuid === item.uuid) : item.index;
  13734. if (index === -1 || !this.files)
  13735. break;
  13736. if (item.errMsg === "request:fail") {
  13737. this.files[index].url = item.path;
  13738. this.files[index].status = "error";
  13739. this.files[index].errMsg = item.errMsg;
  13740. errorData.push(this.files[index]);
  13741. errorTempFilePath.push(this.files[index].url);
  13742. } else {
  13743. this.files[index].errMsg = "";
  13744. this.files[index].fileID = item.url;
  13745. const reg = /cloud:\/\/([\w.]+\/?)\S*/;
  13746. if (reg.test(item.url)) {
  13747. this.files[index].url = await this.getTempFileURL(item.url);
  13748. } else {
  13749. this.files[index].url = item.url;
  13750. }
  13751. this.files[index].status = "success";
  13752. this.files[index].progress += 1;
  13753. successData.push(this.files[index]);
  13754. tempFilePath.push(this.files[index].fileID);
  13755. }
  13756. }
  13757. if (successData.length > 0) {
  13758. this.setEmit();
  13759. this.$emit("success", {
  13760. tempFiles: this.backObject(successData),
  13761. tempFilePaths: tempFilePath
  13762. });
  13763. }
  13764. if (errorData.length > 0) {
  13765. this.$emit("fail", {
  13766. tempFiles: this.backObject(errorData),
  13767. tempFilePaths: errorTempFilePath
  13768. });
  13769. }
  13770. },
  13771. /**
  13772. * 获取进度
  13773. * @param {Object} progressEvent
  13774. * @param {Object} index
  13775. * @param {Object} type
  13776. */
  13777. setProgress(progressEvent, index, type) {
  13778. this.files.length;
  13779. const percentCompleted = Math.round(progressEvent.loaded * 100 / progressEvent.total);
  13780. let idx = index;
  13781. if (!type) {
  13782. idx = this.files.findIndex((p2) => p2.uuid === progressEvent.tempFile.uuid);
  13783. }
  13784. if (idx === -1 || !this.files[idx])
  13785. return;
  13786. this.files[idx].progress = percentCompleted - 1;
  13787. this.$emit("progress", {
  13788. index: idx,
  13789. progress: parseInt(percentCompleted),
  13790. tempFile: this.files[idx]
  13791. });
  13792. },
  13793. /**
  13794. * 删除文件
  13795. * @param {Object} index
  13796. */
  13797. delFile(index) {
  13798. this.$emit("delete", {
  13799. tempFile: this.files[index],
  13800. tempFilePath: this.files[index].url
  13801. });
  13802. this.files.splice(index, 1);
  13803. this.$nextTick(() => {
  13804. this.setEmit();
  13805. });
  13806. },
  13807. /**
  13808. * 获取文件名和后缀
  13809. * @param {Object} name
  13810. */
  13811. getFileExt(name) {
  13812. const last_len = name.lastIndexOf(".");
  13813. const len2 = name.length;
  13814. return {
  13815. name: name.substring(0, last_len),
  13816. ext: name.substring(last_len + 1, len2)
  13817. };
  13818. },
  13819. /**
  13820. * 处理返回事件
  13821. */
  13822. setEmit() {
  13823. let data = [];
  13824. if (this.returnType === "object") {
  13825. data = this.backObject(this.files)[0];
  13826. this.localValue = data ? data : null;
  13827. } else {
  13828. data = this.backObject(this.files);
  13829. if (!this.localValue) {
  13830. this.localValue = [];
  13831. }
  13832. this.localValue = [...data];
  13833. }
  13834. this.$emit("update:modelValue", this.localValue);
  13835. },
  13836. /**
  13837. * 处理返回参数
  13838. * @param {Object} files
  13839. */
  13840. backObject(files) {
  13841. let newFilesData = [];
  13842. files.forEach((v2) => {
  13843. newFilesData.push({
  13844. extname: v2.extname,
  13845. fileType: v2.fileType,
  13846. image: v2.image,
  13847. name: v2.name,
  13848. path: v2.path,
  13849. size: v2.size,
  13850. fileID: v2.fileID,
  13851. url: v2.url,
  13852. // 修改删除一个文件后不能再上传的bug, #694
  13853. uuid: v2.uuid,
  13854. status: v2.status,
  13855. cloudPath: v2.cloudPath
  13856. });
  13857. });
  13858. return newFilesData;
  13859. },
  13860. async getTempFileURL(fileList) {
  13861. fileList = {
  13862. fileList: [].concat(fileList)
  13863. };
  13864. const urls = await Ds.getTempFileURL(fileList);
  13865. return urls.fileList[0].tempFileURL || "";
  13866. },
  13867. /**
  13868. * 获取父元素实例
  13869. */
  13870. getForm(name = "uniForms") {
  13871. let parent = this.$parent;
  13872. let parentName = parent.$options.name;
  13873. while (parentName !== name) {
  13874. parent = parent.$parent;
  13875. if (!parent)
  13876. return false;
  13877. parentName = parent.$options.name;
  13878. }
  13879. return parent;
  13880. }
  13881. }
  13882. };
  13883. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  13884. const _component_upload_image = vue.resolveComponent("upload-image");
  13885. const _component_upload_file = vue.resolveComponent("upload-file");
  13886. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-file-picker" }, [
  13887. $props.title ? (vue.openBlock(), vue.createElementBlock("view", {
  13888. key: 0,
  13889. class: "uni-file-picker__header"
  13890. }, [
  13891. vue.createElementVNode(
  13892. "text",
  13893. { class: "file-title" },
  13894. vue.toDisplayString($props.title),
  13895. 1
  13896. /* TEXT */
  13897. ),
  13898. vue.createElementVNode(
  13899. "text",
  13900. { class: "file-count" },
  13901. vue.toDisplayString($options.filesList.length) + "/" + vue.toDisplayString($options.limitLength),
  13902. 1
  13903. /* TEXT */
  13904. )
  13905. ])) : vue.createCommentVNode("v-if", true),
  13906. $props.fileMediatype === "image" && $options.showType === "grid" ? (vue.openBlock(), vue.createBlock(_component_upload_image, {
  13907. key: 1,
  13908. readonly: $props.readonly,
  13909. "image-styles": $props.imageStyles,
  13910. "files-list": $options.filesList,
  13911. limit: $options.limitLength,
  13912. disablePreview: $props.disablePreview,
  13913. delIcon: $props.delIcon,
  13914. onUploadFiles: $options.uploadFiles,
  13915. onChoose: $options.choose,
  13916. onDelFile: $options.delFile
  13917. }, {
  13918. default: vue.withCtx(() => [
  13919. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  13920. vue.createElementVNode("view", { class: "is-add" }, [
  13921. vue.createElementVNode("view", { class: "icon-add" }),
  13922. vue.createElementVNode("view", { class: "icon-add rotate" })
  13923. ])
  13924. ], true)
  13925. ]),
  13926. _: 3
  13927. /* FORWARDED */
  13928. }, 8, ["readonly", "image-styles", "files-list", "limit", "disablePreview", "delIcon", "onUploadFiles", "onChoose", "onDelFile"])) : vue.createCommentVNode("v-if", true),
  13929. $props.fileMediatype !== "image" || $options.showType !== "grid" ? (vue.openBlock(), vue.createBlock(_component_upload_file, {
  13930. key: 2,
  13931. readonly: $props.readonly,
  13932. "list-styles": $props.listStyles,
  13933. "files-list": $options.filesList,
  13934. showType: $options.showType,
  13935. delIcon: $props.delIcon,
  13936. onUploadFiles: $options.uploadFiles,
  13937. onChoose: $options.choose,
  13938. onDelFile: $options.delFile
  13939. }, {
  13940. default: vue.withCtx(() => [
  13941. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  13942. vue.createElementVNode("button", {
  13943. type: "primary",
  13944. size: "mini"
  13945. }, "选择文件")
  13946. ], true)
  13947. ]),
  13948. _: 3
  13949. /* FORWARDED */
  13950. }, 8, ["readonly", "list-styles", "files-list", "showType", "delIcon", "onUploadFiles", "onChoose", "onDelFile"])) : vue.createCommentVNode("v-if", true)
  13951. ]);
  13952. }
  13953. const __easycom_3 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render], ["__scopeId", "data-v-6223573f"], ["__file", "/Users/sunwubin/source/pharmacy/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue"]]);
  13954. const __default__$1 = {
  13955. name: ""
  13956. };
  13957. const _sfc_main$2 = /* @__PURE__ */ Object.assign(__default__$1, {
  13958. setup(__props) {
  13959. const urlConfig = vue.ref("http://zhongyao.fscuc.cn");
  13960. const preseObj = vue.ref({
  13961. code: "",
  13962. color: ["#000"],
  13963. // 条形码的颜色
  13964. bgColor: "#FFFFFF",
  13965. // 背景色
  13966. width: 200,
  13967. // 宽度
  13968. height: 50
  13969. // 高度
  13970. });
  13971. vue.ref([
  13972. { name: "配药", id: "1" },
  13973. { name: "煎药", id: "2" },
  13974. { name: "发药", id: "3" },
  13975. { name: "配送", id: "4" }
  13976. ]);
  13977. vue.ref([
  13978. { name: "中药处方", id: "1" },
  13979. { name: "中药制剂", id: "2" }
  13980. ]);
  13981. const { proxy } = vue.getCurrentInstance();
  13982. const imageStyles = vue.ref({
  13983. width: 112.5,
  13984. height: 112.5,
  13985. border: {
  13986. color: "#DDDDDD",
  13987. width: 1,
  13988. style: "solid",
  13989. radius: "4px"
  13990. }
  13991. });
  13992. vue.ref([]);
  13993. vue.ref({
  13994. height: 80,
  13995. displayValue: false
  13996. });
  13997. const selectRps = vue.ref([]);
  13998. const isPrint = vue.ref(true);
  13999. vue.ref([]);
  14000. const v2 = vue.ref({
  14001. preNo: "11220822134401",
  14002. presType: "普通处方",
  14003. name: "李某",
  14004. sex: "男",
  14005. age: 35,
  14006. contactNumber: "13888888888",
  14007. status: "发药",
  14008. department: "中医内科",
  14009. disName: "胃脘痛病",
  14010. symName: "脾胃虚寒证",
  14011. prescriptionTime: "2023-06-01 15:58",
  14012. address: "浙江省某某事某某去某某事中医院门诊楼三楼302是",
  14013. rp: [
  14014. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14015. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14016. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14017. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14018. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14019. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14020. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14021. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14022. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14023. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" },
  14024. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14025. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14026. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14027. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14028. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14029. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14030. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14031. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14032. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14033. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" },
  14034. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14035. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14036. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14037. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14038. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14039. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14040. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14041. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14042. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14043. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" },
  14044. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14045. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14046. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14047. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14048. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14049. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14050. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14051. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14052. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14053. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" }
  14054. ],
  14055. number: 3,
  14056. pies_tips: "待见",
  14057. dosageForm: "汤剂",
  14058. prescriptionUsage: "煎服",
  14059. concentration: "200ml",
  14060. frequency: "一日三次",
  14061. medicationTime: "饭后服",
  14062. entrust: "注意多休息,饮食清单。",
  14063. prescriptionSum: "187.00",
  14064. daijianCost: "30.00",
  14065. distributionCost: "10.00",
  14066. prescriptionTotleSum: "227.00",
  14067. yljgName: "杭州某某高级中医院",
  14068. operateList: [
  14069. { py: "kf", title: "开方", operater: "" },
  14070. { py: "sh", title: "审核", operater: "" },
  14071. { py: "tp", title: "调配", operater: "" },
  14072. { py: "fh", title: "复核", operater: "" },
  14073. { py: "jp", title: "浸泡", operater: "" },
  14074. { py: "jz", title: "煎煮", operater: "" },
  14075. { py: "db", title: "打包", operater: "" },
  14076. { py: "fy", title: "发药", operater: "" }
  14077. ],
  14078. // extra_doc:'A医生',
  14079. // check_doc:'B医生',
  14080. // depoly:'调陪人',
  14081. // review:'复核人',
  14082. // steep:'浸泡',
  14083. // cook:'煎煮人',
  14084. // pack:'大宝人',
  14085. // dispen:'发药人',
  14086. // },
  14087. entrust1111: "1、本处方当日有效\n 2、取药时请您当面核对。。。。 \n 3、延长处方用量时间原油:慢性病 其他老年病 外地 其他"
  14088. });
  14089. const editForm = vue.ref({
  14090. urls: [],
  14091. userId: uni.getStorageSync("userId"),
  14092. comments: "",
  14093. weight: v2.value.weight,
  14094. coreId: v2.value.preNo
  14095. });
  14096. vue.onMounted(() => {
  14097. });
  14098. const bindTextInput = (e2) => {
  14099. formatAppLog("log", "at pages/edit/edit.vue:322", e2.detail.value);
  14100. };
  14101. onLoad(async (options) => {
  14102. formatAppLog("log", "at pages/edit/edit.vue:326", "options", options);
  14103. uni.getStorageSync("userId");
  14104. const params2 = {
  14105. token: uni.getStorageSync("token"),
  14106. data: {
  14107. id: options.id || "",
  14108. preNo: options.preId || "",
  14109. depolyStatus: options.depolyStatus || ""
  14110. }
  14111. };
  14112. formatAppLog("log", "at pages/edit/edit.vue:337", "params", params2);
  14113. const { data: res } = await selectOrderDetail(params2);
  14114. if (res.code === 200) {
  14115. v2.prescriptionTime = res.data.prescriptionTime, v2.value.name = res.data.name, v2.value.sex = res.data.sex, v2.value.age = res.data.age, v2.value.contactNumber = res.data.contactNumber;
  14116. v2.value.address = res.data.address;
  14117. v2.value.concentration = res.data.concentration;
  14118. v2.value.frequency = res.data.frequency;
  14119. v2.value.medicationTime = res.data.medicationTime;
  14120. v2.value.disName = res.data.disName, v2.value.symName = res.data.symName, v2.value.preNo = res.data.preNo, formatAppLog("log", "at pages/edit/edit.vue:354", "onLoad v.value.preNo", v2.value.preNo);
  14121. preseObj.value.code = v2.value.preNo;
  14122. v2.value.department = res.data.department, v2.value.dosageForm = res.data.dosageForm, v2.value.prescriptionUsage = res.data.prescriptionUsage, v2.value.number = res.data.number, v2.value.prescriptionSum = res.data.prescriptionSum, v2.value.prescriptionTotalSum = res.data.prescriptionTotalSum, v2.value.daijianCost = res.data.daijianCost, v2.value.distributionCost = res.data.distributionCost, v2.value.prescriptionTotleSum = res.data.prescriptionTotleSum, v2.value.entrust = res.data.entrust, v2.value.rp = res.data.detailList;
  14123. v2.value.yljgName = res.data.yljgName || "";
  14124. v2.value.status = res.data.status, formatAppLog("log", "at pages/edit/edit.vue:372", "res.data.status", res.data.status);
  14125. switch (res.data.status) {
  14126. case "1":
  14127. v2.value.status = "配药";
  14128. break;
  14129. case "2":
  14130. v2.value.status = "煎药";
  14131. break;
  14132. case "3":
  14133. v2.value.status = "发药";
  14134. break;
  14135. case "4":
  14136. v2.value.status = "配送";
  14137. break;
  14138. case "5":
  14139. v2.value.status = "已分配";
  14140. break;
  14141. case "6":
  14142. v2.value.status = "已传送";
  14143. break;
  14144. default:
  14145. v2.value.status = "配药";
  14146. }
  14147. v2.value.operateList[0].operater = res.data.doctor || "";
  14148. v2.value.operateList[1].operater = res.data.checkBy || "";
  14149. v2.value.operateList[2].operater = res.data.tiaopeiName || "";
  14150. const length = res.data.operateList;
  14151. if (length > 0) {
  14152. res.data.operateList.forEach((item) => {
  14153. switch (item.type) {
  14154. case "2":
  14155. v2.value.operateList[3].operater = item.createBy;
  14156. break;
  14157. case "3":
  14158. v2.value.operateList[4].operater = item.createBy;
  14159. break;
  14160. case "4":
  14161. v2.value.operateList[5].operater = item.createBy;
  14162. break;
  14163. case "5":
  14164. v2.value.operateList[6].operater = item.createBy;
  14165. break;
  14166. case "6":
  14167. v2.value.operateList[7].operater = item.createBy;
  14168. break;
  14169. }
  14170. });
  14171. }
  14172. }
  14173. });
  14174. const handleGetRps = (v3) => {
  14175. formatAppLog("log", "at pages/edit/edit.vue:427", "handleGetRps", v3);
  14176. if (!selectRps.value.includes(v3)) {
  14177. selectRps.value.push(v3);
  14178. } else {
  14179. selectRps.value.splice(selectRps.value.indexOf(v3), 1);
  14180. }
  14181. };
  14182. const handleChange = () => {
  14183. isPrint.value = !isPrint.value;
  14184. formatAppLog("log", "at pages/edit/edit.vue:437", "handleChange", isPrint.value);
  14185. };
  14186. const handleBack = () => {
  14187. uni.navigateBack({
  14188. delta: 1
  14189. });
  14190. };
  14191. const handleSubmit = async () => {
  14192. formatAppLog("log", "at pages/edit/edit.vue:447", "handleSubmit>>>", editForm.value);
  14193. formatAppLog("log", "at pages/edit/edit.vue:448", "直接调用接口,然后打印");
  14194. const { data: res } = await saveDepoly({
  14195. token: uni.getStorageSync("token"),
  14196. data: JSON.stringify(editForm.value)
  14197. });
  14198. if (res.code === 200) {
  14199. formatAppLog("log", "at pages/edit/edit.vue:454", "depoly success>>>");
  14200. }
  14201. if (isPrint.value) {
  14202. print("#printMe");
  14203. await sendToUser({
  14204. token: uni.getStorageSync("token"),
  14205. data: JSON.stringify({ id: uni.getStorageSync("userId") })
  14206. });
  14207. uni.redirectTo({
  14208. url: "/pages/index/index"
  14209. });
  14210. } else {
  14211. proxy.$refs.alertDialog.open("center");
  14212. }
  14213. };
  14214. const dialogConfirm = async () => {
  14215. formatAppLog("log", "at pages/edit/edit.vue:479", "dialogConfirm直接调用接口,然后打印");
  14216. print("#printMe");
  14217. await sendToUser({
  14218. token: uni.getStorageSync("token"),
  14219. data: JSON.stringify({ id: uni.getStorageSync("userId") })
  14220. });
  14221. uni.redirectTo({
  14222. url: "/pages/index/index"
  14223. });
  14224. };
  14225. const dialogClose = () => {
  14226. formatAppLog("log", "at pages/edit/edit.vue:491", "dialogClose直接调用接口,不打印");
  14227. uni.redirectTo({
  14228. url: "/pages/index/index"
  14229. });
  14230. };
  14231. const selectUpload = (e2) => {
  14232. uni.showLoading({
  14233. title: "上传中"
  14234. });
  14235. const tempFilePaths = e2.tempFilePaths;
  14236. for (var i2 = 0; i2 < tempFilePaths.length; i2++) {
  14237. e2.tempFiles[i2];
  14238. uni.uploadFile({
  14239. url: urlConfig.value + "/common/upload",
  14240. header: {
  14241. "Authorization": "Bearer " + uni.getStorageSync("token")
  14242. },
  14243. formData: {
  14244. secretFlag: "N",
  14245. fileLocation: 5
  14246. },
  14247. filePath: tempFilePaths[i2],
  14248. name: "file",
  14249. success: (uploadFileRes) => {
  14250. uni.hideLoading();
  14251. formatAppLog("log", "at pages/edit/edit.vue:517", "upload success>>", uploadFileRes);
  14252. const back = JSON.parse(uploadFileRes.data);
  14253. formatAppLog("log", "at pages/edit/edit.vue:519", "upload success back >>", back);
  14254. if (back.code == 200) {
  14255. editForm.value.urls.push(back.url);
  14256. }
  14257. },
  14258. fail: () => {
  14259. uni.hideLoading();
  14260. uni.showToast("上传失败,请联系开发!");
  14261. },
  14262. complete: function() {
  14263. uni.hideLoading();
  14264. }
  14265. });
  14266. }
  14267. };
  14268. return (_ctx, _cache) => {
  14269. const _component_uni_nav_bar = resolveEasycom(vue.resolveDynamicComponent("uni-nav-bar"), __easycom_0);
  14270. const _component_w_barcode = resolveEasycom(vue.resolveDynamicComponent("w-barcode"), __easycom_1);
  14271. const _component_uni_tag = resolveEasycom(vue.resolveDynamicComponent("uni-tag"), __easycom_2);
  14272. const _component_uni_file_picker = resolveEasycom(vue.resolveDynamicComponent("uni-file-picker"), __easycom_3);
  14273. const _component_uni_popup_dialog = resolveEasycom(vue.resolveDynamicComponent("uni-popup-dialog"), __easycom_4);
  14274. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_5);
  14275. return vue.openBlock(), vue.createElementBlock("view", { class: "main" }, [
  14276. vue.createVNode(_component_uni_nav_bar, {
  14277. dark: "",
  14278. fixed: true,
  14279. "background-color": "#18C7B0",
  14280. "status-bar": "",
  14281. "left-icon": "left",
  14282. height: "62.5rpx",
  14283. width: "750rpx",
  14284. title: "调配详情",
  14285. onClickLeft: handleBack
  14286. }),
  14287. vue.createElementVNode("view", { class: "content" }, [
  14288. vue.createElementVNode("view", { class: "header" }, [
  14289. vue.createElementVNode("view", { class: "ti" }, [
  14290. vue.createElementVNode("view", { class: "left" }, [
  14291. vue.createElementVNode("view", { class: "baracode" }, [
  14292. vue.createVNode(_component_w_barcode, { options: preseObj.value }, null, 8, ["options"]),
  14293. vue.createElementVNode(
  14294. "view",
  14295. { class: "barnum" },
  14296. vue.toDisplayString(v2.value.preNo),
  14297. 1
  14298. /* TEXT */
  14299. )
  14300. ])
  14301. ]),
  14302. vue.createElementVNode("view", { class: "mid" }, [
  14303. vue.createElementVNode("text", { class: "title" }, "中药处方笺")
  14304. ]),
  14305. vue.createElementVNode("view", { class: "rig" }, [
  14306. vue.createElementVNode(
  14307. "text",
  14308. { class: "title" },
  14309. vue.toDisplayString(v2.value.type == "1" ? "中药处方" : v2.value.type == "1" ? "中药制剂" : ""),
  14310. 1
  14311. /* TEXT */
  14312. )
  14313. ])
  14314. ]),
  14315. vue.createElementVNode("view", { class: "patiinfo" }, [
  14316. vue.createElementVNode("view", { class: "r1" }, [
  14317. vue.createElementVNode("view", { class: "row" }, [
  14318. vue.createElementVNode("span", { class: "we" }, "姓名:"),
  14319. vue.createTextVNode(
  14320. vue.toDisplayString(v2.value.name),
  14321. 1
  14322. /* TEXT */
  14323. )
  14324. ]),
  14325. vue.createElementVNode("view", { class: "row" }, [
  14326. vue.createElementVNode("span", { class: "we" }, "性别:"),
  14327. vue.createTextVNode(
  14328. vue.toDisplayString(v2.value.sex),
  14329. 1
  14330. /* TEXT */
  14331. )
  14332. ]),
  14333. vue.createElementVNode("view", { class: "row" }, [
  14334. vue.createElementVNode("span", { class: "we" }, "年龄:"),
  14335. vue.createTextVNode(
  14336. vue.toDisplayString(v2.value.age) + "岁",
  14337. 1
  14338. /* TEXT */
  14339. )
  14340. ]),
  14341. vue.createElementVNode("view", { class: "row" }, [
  14342. vue.createElementVNode("span", { class: "we" }, "电话:"),
  14343. vue.createTextVNode(
  14344. vue.toDisplayString(v2.value.contactNumber),
  14345. 1
  14346. /* TEXT */
  14347. )
  14348. ]),
  14349. vue.createElementVNode("view", { class: "row" }, [
  14350. vue.createElementVNode("span", { class: "we" }, "当前处方状态:"),
  14351. vue.createTextVNode(
  14352. vue.toDisplayString(v2.value.state == "1" ? "配药" : v2.value.state == "2" ? "煎药" : v2.value.state == "3" ? "发药" : v2.value.state == "4" ? "配送" : ""),
  14353. 1
  14354. /* TEXT */
  14355. )
  14356. ])
  14357. ]),
  14358. vue.createElementVNode("view", { class: "r2" }, [
  14359. vue.createElementVNode("view", { class: "row" }, [
  14360. vue.createElementVNode("span", { class: "we" }, "就诊科室:"),
  14361. vue.createTextVNode(
  14362. vue.toDisplayString(v2.value.department),
  14363. 1
  14364. /* TEXT */
  14365. )
  14366. ]),
  14367. vue.createElementVNode("view", { class: "row" }, [
  14368. vue.createElementVNode("span", { class: "we" }, "临床诊断:"),
  14369. vue.createTextVNode(
  14370. vue.toDisplayString(v2.value.disName) + "—" + vue.toDisplayString(v2.value.symName),
  14371. 1
  14372. /* TEXT */
  14373. )
  14374. ]),
  14375. vue.createElementVNode("view", { class: "row" }, [
  14376. vue.createElementVNode("span", { class: "we" }, "开方时间:"),
  14377. vue.createTextVNode(
  14378. vue.toDisplayString(v2.value.prescriptionTime),
  14379. 1
  14380. /* TEXT */
  14381. )
  14382. ])
  14383. ]),
  14384. vue.createElementVNode("view", { class: "r3" }, [
  14385. vue.createElementVNode("span", { class: "we" }, "联系地址:"),
  14386. vue.createTextVNode(
  14387. vue.toDisplayString(v2.value.address),
  14388. 1
  14389. /* TEXT */
  14390. )
  14391. ])
  14392. ])
  14393. ]),
  14394. vue.createElementVNode("view", { class: "rp" }, [
  14395. vue.createElementVNode("view", { class: "title" }, [
  14396. vue.createElementVNode("text", { class: "text" }, "Rp:")
  14397. ]),
  14398. vue.createElementVNode("view", { class: "lists" }, [
  14399. (vue.openBlock(true), vue.createElementBlock(
  14400. vue.Fragment,
  14401. null,
  14402. vue.renderList(v2.value.rp, (x2, i2) => {
  14403. return vue.openBlock(), vue.createElementBlock("view", {
  14404. class: "item",
  14405. key: i2
  14406. }, [
  14407. vue.createElementVNode("view", { class: "le tag-view" }, [
  14408. vue.createVNode(_component_uni_tag, {
  14409. inverted: !selectRps.value.includes(x2),
  14410. text: x2.matName + x2.matDose + x2.matUnitName,
  14411. onClick: ($event) => handleGetRps(x2)
  14412. }, null, 8, ["inverted", "text", "onClick"])
  14413. ]),
  14414. vue.createElementVNode("view", { class: "rig" }, [
  14415. vue.createElementVNode(
  14416. "view",
  14417. { class: "up" },
  14418. vue.toDisplayString(x2.matUsageName),
  14419. 1
  14420. /* TEXT */
  14421. ),
  14422. vue.createElementVNode(
  14423. "view",
  14424. { class: "do" },
  14425. vue.toDisplayString(x2.sign),
  14426. 1
  14427. /* TEXT */
  14428. )
  14429. ])
  14430. ]);
  14431. }),
  14432. 128
  14433. /* KEYED_FRAGMENT */
  14434. ))
  14435. ]),
  14436. vue.createElementVNode("view", { class: "footer" }, [
  14437. vue.createElementVNode("view", { class: "js" }, [
  14438. vue.createTextVNode(
  14439. " 剂数:" + vue.toDisplayString(v2.value.number) + " ",
  14440. 1
  14441. /* TEXT */
  14442. ),
  14443. v2.value.daijianCost !== "" ? (vue.openBlock(), vue.createElementBlock("view", {
  14444. key: 0,
  14445. class: "pies_tips"
  14446. }, " (代煎) ")) : vue.createCommentVNode("v-if", true)
  14447. ]),
  14448. vue.createElementVNode(
  14449. "view",
  14450. { class: "js" },
  14451. vue.toDisplayString(v2.value.dosageForm),
  14452. 1
  14453. /* TEXT */
  14454. ),
  14455. vue.createElementVNode(
  14456. "view",
  14457. { class: "js" },
  14458. vue.toDisplayString(v2.value.prescriptionUsage),
  14459. 1
  14460. /* TEXT */
  14461. ),
  14462. vue.createElementVNode(
  14463. "view",
  14464. { class: "js" },
  14465. "每次" + vue.toDisplayString(v2.value.concentration),
  14466. 1
  14467. /* TEXT */
  14468. ),
  14469. vue.createElementVNode(
  14470. "view",
  14471. { class: "js" },
  14472. vue.toDisplayString(v2.value.frequency),
  14473. 1
  14474. /* TEXT */
  14475. ),
  14476. vue.createElementVNode(
  14477. "view",
  14478. { class: "freque" },
  14479. vue.toDisplayString(v2.value.medicationTime),
  14480. 1
  14481. /* TEXT */
  14482. )
  14483. ]),
  14484. vue.createElementVNode(
  14485. "view",
  14486. { class: "rp-tips" },
  14487. vue.toDisplayString(v2.value.entrust),
  14488. 1
  14489. /* TEXT */
  14490. )
  14491. ]),
  14492. vue.createElementVNode("view", { class: "amountarea" }, [
  14493. vue.createElementVNode("view", { class: "amount" }, [
  14494. vue.createElementVNode("view", { class: "r1" }, [
  14495. vue.createElementVNode(
  14496. "view",
  14497. { class: "pijw" },
  14498. "药品金额:" + vue.toDisplayString(v2.value.prescriptionSum),
  14499. 1
  14500. /* TEXT */
  14501. )
  14502. ]),
  14503. vue.createElementVNode("view", { class: "r2" }, [
  14504. vue.createElementVNode(
  14505. "view",
  14506. { class: "jyf" },
  14507. "煎药费:" + vue.toDisplayString(v2.value.daijianCost),
  14508. 1
  14509. /* TEXT */
  14510. ),
  14511. vue.createElementVNode(
  14512. "view",
  14513. { class: "psf" },
  14514. "配送费:" + vue.toDisplayString(v2.value.distributionCost),
  14515. 1
  14516. /* TEXT */
  14517. )
  14518. ]),
  14519. vue.createElementVNode("view", { class: "r3" }, [
  14520. vue.createTextVNode(
  14521. " 总金额:" + vue.toDisplayString(v2.value.prescriptionTotalSum) + " ",
  14522. 1
  14523. /* TEXT */
  14524. ),
  14525. vue.createCommentVNode(' <view class="zjw"></view> ')
  14526. ])
  14527. ]),
  14528. vue.createElementVNode("view", { class: "service" }, [
  14529. vue.createElementVNode("view", { class: "kf" }, [
  14530. vue.createElementVNode("span", { class: "we" }, "开方:"),
  14531. vue.createTextVNode(
  14532. vue.toDisplayString(v2.value.operateList[0].operater || ""),
  14533. 1
  14534. /* TEXT */
  14535. )
  14536. ]),
  14537. vue.createElementVNode("view", { class: "kf" }, [
  14538. vue.createElementVNode("span", { class: "we" }, "审核:"),
  14539. vue.createTextVNode(
  14540. vue.toDisplayString(v2.value.operateList[1].operater || ""),
  14541. 1
  14542. /* TEXT */
  14543. )
  14544. ]),
  14545. vue.createElementVNode("view", { class: "kf" }, [
  14546. vue.createElementVNode("span", { class: "we" }, "调配:"),
  14547. vue.createTextVNode(
  14548. vue.toDisplayString(v2.value.operateList[2].operater || ""),
  14549. 1
  14550. /* TEXT */
  14551. )
  14552. ]),
  14553. vue.createElementVNode("view", { class: "kf" }, [
  14554. vue.createElementVNode("span", { class: "we" }, "复核:"),
  14555. vue.createTextVNode(
  14556. vue.toDisplayString(v2.value.operateList[3].operater || ""),
  14557. 1
  14558. /* TEXT */
  14559. )
  14560. ]),
  14561. vue.createElementVNode("view", { class: "kf" }, [
  14562. vue.createElementVNode("span", { class: "we" }, "浸泡:"),
  14563. vue.createTextVNode(
  14564. vue.toDisplayString(v2.value.operateList[4].operater || ""),
  14565. 1
  14566. /* TEXT */
  14567. )
  14568. ]),
  14569. vue.createElementVNode("view", { class: "kf" }, [
  14570. vue.createElementVNode("span", { class: "we" }, "煎煮:"),
  14571. vue.createTextVNode(
  14572. vue.toDisplayString(v2.value.operateList[5].operater || ""),
  14573. 1
  14574. /* TEXT */
  14575. )
  14576. ]),
  14577. vue.createElementVNode("view", { class: "kf" }, [
  14578. vue.createElementVNode("span", { class: "we" }, "打包:"),
  14579. vue.createTextVNode(
  14580. vue.toDisplayString(v2.value.operateList[6].operater || ""),
  14581. 1
  14582. /* TEXT */
  14583. )
  14584. ]),
  14585. vue.createElementVNode("view", { class: "kf" }, [
  14586. vue.createElementVNode("span", { class: "we" }, "发药:"),
  14587. vue.createTextVNode(
  14588. vue.toDisplayString(v2.value.operateList[7].operater || ""),
  14589. 1
  14590. /* TEXT */
  14591. )
  14592. ])
  14593. ])
  14594. ]),
  14595. vue.createElementVNode("view", { class: "comment" }, [
  14596. vue.createElementVNode("view", { class: "z" }, "注:"),
  14597. vue.createElementVNode(
  14598. "text",
  14599. null,
  14600. vue.toDisplayString(v2.value.entrust1111),
  14601. 1
  14602. /* TEXT */
  14603. )
  14604. ])
  14605. ]),
  14606. vue.createElementVNode("view", { class: "upload" }, [
  14607. vue.createElementVNode("view", { class: "title" }, "上传照片"),
  14608. vue.createVNode(_component_uni_file_picker, {
  14609. "image-styles": imageStyles.value,
  14610. fileMediatype: "image",
  14611. mode: "grid",
  14612. limit: 3,
  14613. "del-icon": false,
  14614. "auto-upload": false,
  14615. onSelect: selectUpload
  14616. }, null, 8, ["image-styles"])
  14617. ]),
  14618. vue.createElementVNode("view", { class: "cooment" }, [
  14619. vue.createElementVNode("view", { class: "title" }, "备注内容"),
  14620. vue.createElementVNode("view", { class: "tex" }, [
  14621. vue.withDirectives(vue.createElementVNode(
  14622. "textarea",
  14623. {
  14624. placeholder: "请输入备注内容",
  14625. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => editForm.value.comments = $event),
  14626. "placeholder-style": "font-size: 15rpx;",
  14627. height: "60rpx",
  14628. onInput: bindTextInput,
  14629. class: "input"
  14630. },
  14631. null,
  14632. 544
  14633. /* HYDRATE_EVENTS, NEED_PATCH */
  14634. ), [
  14635. [vue.vModelText, editForm.value.comments]
  14636. ])
  14637. ])
  14638. ]),
  14639. vue.createElementVNode("view", { class: "radio" }, [
  14640. vue.createElementVNode("label", { for: "" }, [
  14641. vue.createElementVNode("switch", {
  14642. checked: isPrint.value,
  14643. style: { "transform": "scale(0.7)" },
  14644. onChange: handleChange
  14645. }, null, 40, ["checked"]),
  14646. vue.createTextVNode(" 上传时直接打印标签 ")
  14647. ])
  14648. ]),
  14649. vue.createElementVNode("view", { class: "submit" }, [
  14650. vue.createElementVNode("button", {
  14651. type: "primary",
  14652. class: "bu",
  14653. onClick: handleSubmit
  14654. }, "上传")
  14655. ]),
  14656. vue.createElementVNode("view", { class: "popup" }, [
  14657. vue.createVNode(
  14658. _component_uni_popup,
  14659. {
  14660. ref: "alertDialog",
  14661. type: "dialog"
  14662. },
  14663. {
  14664. default: vue.withCtx(() => [
  14665. vue.createVNode(_component_uni_popup_dialog, {
  14666. type: "center",
  14667. cancelText: "不打印",
  14668. confirmText: "打印",
  14669. title: "打印标签",
  14670. onConfirm: dialogConfirm,
  14671. onClose: dialogClose
  14672. }, {
  14673. default: vue.withCtx(() => [
  14674. vue.createElementVNode("view", {
  14675. class: "cotent",
  14676. id: "printMe"
  14677. }, [
  14678. vue.createElementVNode(
  14679. "view",
  14680. { class: "title" },
  14681. vue.toDisplayString(v2.value.yljgName || "默默事中医院取药标签打印(门诊)"),
  14682. 1
  14683. /* TEXT */
  14684. ),
  14685. vue.createElementVNode("view", { class: "body" }, [
  14686. vue.createElementVNode("view", { class: "lef" }, [
  14687. vue.createElementVNode("view", { class: "baracode" }, [
  14688. vue.createVNode(_component_w_barcode, {
  14689. class: "cav",
  14690. options: preseObj.value
  14691. }, null, 8, ["options"]),
  14692. vue.createElementVNode(
  14693. "view",
  14694. { class: "barnum" },
  14695. vue.toDisplayString(v2.value.preNo),
  14696. 1
  14697. /* TEXT */
  14698. )
  14699. ])
  14700. ]),
  14701. vue.createElementVNode("view", { class: "rig" }, [
  14702. vue.createElementVNode("view", { class: "hz" }, [
  14703. vue.createTextVNode("患者:"),
  14704. vue.createElementVNode(
  14705. "view",
  14706. { class: "bold" },
  14707. vue.toDisplayString(v2.value.name) + "," + vue.toDisplayString(v2.value.sex) + "," + vue.toDisplayString(v2.value.age) + "岁",
  14708. 1
  14709. /* TEXT */
  14710. )
  14711. ]),
  14712. vue.createElementVNode("view", { class: "hz" }, [
  14713. vue.createTextVNode("出生日期:"),
  14714. vue.createElementVNode(
  14715. "view",
  14716. { class: "bold" },
  14717. vue.toDisplayString(v2.value.birth),
  14718. 1
  14719. /* TEXT */
  14720. )
  14721. ])
  14722. ])
  14723. ])
  14724. ])
  14725. ]),
  14726. _: 1
  14727. /* STABLE */
  14728. })
  14729. ]),
  14730. _: 1
  14731. /* STABLE */
  14732. },
  14733. 512
  14734. /* NEED_PATCH */
  14735. )
  14736. ])
  14737. ]);
  14738. };
  14739. }
  14740. });
  14741. const PagesEditEdit = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/Users/sunwubin/source/pharmacy/pages/edit/edit.vue"]]);
  14742. const __default__ = {
  14743. name: ""
  14744. };
  14745. const _sfc_main$1 = /* @__PURE__ */ Object.assign(__default__, {
  14746. setup(__props) {
  14747. const urlConfig = vue.ref("http://zhongyao.fscuc.cn");
  14748. const preseObj = vue.ref({
  14749. code: "",
  14750. color: ["#000"],
  14751. // 条形码的颜色
  14752. bgColor: "#FFFFFF",
  14753. // 背景色
  14754. width: 200,
  14755. // 宽度
  14756. height: 50
  14757. // 高度
  14758. });
  14759. vue.getCurrentInstance();
  14760. const imageStyles = vue.ref({
  14761. width: 112.5,
  14762. height: 112.5,
  14763. border: {
  14764. color: "#DDDDDD",
  14765. width: 1,
  14766. style: "solid",
  14767. radius: "4px"
  14768. }
  14769. });
  14770. vue.ref([]);
  14771. vue.ref({
  14772. height: 80,
  14773. displayValue: false
  14774. });
  14775. const selectRps = vue.ref([]);
  14776. vue.ref(true);
  14777. vue.ref([]);
  14778. const v2 = vue.ref({
  14779. preNo: "11220822134401",
  14780. presType: "普通处方",
  14781. name: "李某",
  14782. sex: "男",
  14783. age: 35,
  14784. contactNumber: "13888888888",
  14785. status: "发药",
  14786. department: "中医内科",
  14787. disName: "胃脘痛病",
  14788. symName: "脾胃虚寒证",
  14789. prescriptionTime: "2023-06-01 15:58",
  14790. address: "浙江省某某事某某去某某事中医院门诊楼三楼302是",
  14791. rp: [
  14792. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14793. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14794. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14795. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14796. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14797. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14798. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14799. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14800. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14801. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" },
  14802. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14803. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14804. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14805. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14806. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14807. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14808. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14809. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14810. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14811. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" },
  14812. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14813. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14814. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14815. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14816. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14817. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14818. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14819. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14820. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14821. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" },
  14822. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14823. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14824. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14825. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14826. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "医生签名" },
  14827. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "包煎", sign: "医生签名" },
  14828. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14829. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14830. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "", sign: "" },
  14831. { matName: "车前子", matDose: "6", matUnitName: "g", tips: "先煎", sign: "" }
  14832. ],
  14833. number: 3,
  14834. weight: "0",
  14835. pies_tips: "待见",
  14836. dosageForm: "汤剂",
  14837. prescriptionUsage: "煎服",
  14838. concentration: "200ml",
  14839. frequency: "一日三次",
  14840. medicationTime: "饭后服",
  14841. entrust: "注意多休息,饮食清单。",
  14842. prescriptionSum: "187.00",
  14843. daijianCost: "30.00",
  14844. distributionCost: "10.00",
  14845. prescriptionTotleSum: "227.00",
  14846. yljgName: "杭州某某高级中医院",
  14847. operateList: [
  14848. { py: "kf", title: "开方", operater: "" },
  14849. { py: "sh", title: "审核", operater: "" },
  14850. { py: "tp", title: "调配", operater: "" },
  14851. { py: "fh", title: "复核", operater: "" },
  14852. { py: "jp", title: "浸泡", operater: "" },
  14853. { py: "jz", title: "煎煮", operater: "" },
  14854. { py: "db", title: "打包", operater: "" },
  14855. { py: "fy", title: "发药", operater: "" }
  14856. ],
  14857. entrust1111: "1、本处方当日有效\n 2、取药时请您当面核对。。。。 \n 3、延长处方用量时间原油:慢性病 其他老年病 外地 其他"
  14858. });
  14859. const editForm = vue.ref({
  14860. urls: [],
  14861. userId: uni.getStorageSync("userId"),
  14862. comments: "",
  14863. weight: v2.value.weight,
  14864. coreId: v2.value.preNo
  14865. });
  14866. vue.onMounted(() => {
  14867. });
  14868. const bindTextInput = (e2) => {
  14869. formatAppLog("log", "at pages/review/review.vue:284", e2.detail.value);
  14870. };
  14871. onLoad(async (options) => {
  14872. formatAppLog("log", "at pages/review/review.vue:288", "options", options);
  14873. uni.getStorageSync("userId");
  14874. const params2 = {
  14875. token: uni.getStorageSync("token"),
  14876. data: {
  14877. id: options.id || "",
  14878. preNo: options.preNo || "",
  14879. depolyStatus: options.deployState || ""
  14880. }
  14881. };
  14882. formatAppLog("log", "at pages/review/review.vue:299", "params", params2);
  14883. const { data: res } = await selectOrderDetail(params2);
  14884. if (res.code === 200) {
  14885. v2.prescriptionTime = res.data.prescriptionTime, v2.value.name = res.data.name, v2.value.sex = res.data.sex, v2.value.age = res.data.age, v2.value.contactNumber = res.data.contactNumber;
  14886. v2.value.address = res.data.address;
  14887. v2.value.concentration = res.data.concentration;
  14888. v2.value.frequency = res.data.frequency;
  14889. v2.value.medicationTime = res.data.medicationTime;
  14890. v2.value.disName = res.data.disName, v2.value.symName = res.data.symName, v2.value.preNo = res.data.preNo, formatAppLog("log", "at pages/review/review.vue:316", "onLoad v.value.preNo", v2.value.preNo);
  14891. preseObj.value.code = v2.value.preNo;
  14892. v2.value.department = res.data.department, v2.value.dosageForm = res.data.dosageForm, v2.value.prescriptionUsage = res.data.prescriptionUsage, v2.value.number = res.data.number, v2.value.prescriptionSum = res.data.prescriptionSum, v2.value.prescriptionTotalSum = res.data.prescriptionTotalSum, v2.value.daijianCost = res.data.daijianCost, v2.value.distributionCost = res.data.distributionCost, v2.value.prescriptionTotleSum = res.data.prescriptionTotleSum, v2.value.entrust = res.data.entrust, v2.value.rp = res.data.detailList;
  14893. v2.value.yljgName = res.data.yljgName || "";
  14894. v2.value.status = res.data.status, formatAppLog("log", "at pages/review/review.vue:334", "res.data.status", res.data.status);
  14895. switch (res.data.status) {
  14896. case "1":
  14897. v2.value.status = "配药";
  14898. break;
  14899. case "2":
  14900. v2.value.status = "煎药";
  14901. break;
  14902. case "3":
  14903. v2.value.status = "发药";
  14904. break;
  14905. case "4":
  14906. v2.value.status = "配送";
  14907. break;
  14908. case "5":
  14909. v2.value.status = "已分配";
  14910. break;
  14911. case "6":
  14912. v2.value.status = "已传送";
  14913. break;
  14914. default:
  14915. v2.value.status = "配药";
  14916. }
  14917. v2.value.operateList[0].operater = res.data.doctor || "";
  14918. v2.value.operateList[1].operater = res.data.checkBy || "";
  14919. v2.value.operateList[2].operater = res.data.tiaopeiName || "";
  14920. const length = res.data.operateList;
  14921. if (length > 0) {
  14922. res.data.operateList.forEach((item) => {
  14923. switch (item.type) {
  14924. case "2":
  14925. v2.value.operateList[3].operater = item.createBy;
  14926. break;
  14927. case "3":
  14928. v2.value.operateList[4].operater = item.createBy;
  14929. break;
  14930. case "4":
  14931. v2.value.operateList[5].operater = item.createBy;
  14932. break;
  14933. case "5":
  14934. v2.value.operateList[6].operater = item.createBy;
  14935. break;
  14936. case "6":
  14937. v2.value.operateList[7].operater = item.createBy;
  14938. break;
  14939. }
  14940. });
  14941. }
  14942. const leng = v2.rp.length;
  14943. formatAppLog("log", "at pages/review/review.vue:386", "rprprpprprpr", leng);
  14944. let weight = 0;
  14945. if (leng > 0) {
  14946. for (let i2 = 0; i2 < len; i2++) {
  14947. weight = weight + parseInt(v2.rp[i2].matDose);
  14948. }
  14949. }
  14950. v2.value.weight = weight + "";
  14951. formatAppLog("log", "at pages/review/review.vue:394", "weigiht>>>", v2.value.weight);
  14952. }
  14953. });
  14954. const handleGetRps = (v3) => {
  14955. formatAppLog("log", "at pages/review/review.vue:399", "handleGetRps", v3);
  14956. if (!selectRps.value.includes(v3)) {
  14957. selectRps.value.push(v3);
  14958. } else {
  14959. selectRps.value.splice(selectRps.value.indexOf(v3), 1);
  14960. }
  14961. };
  14962. const handleBack = () => {
  14963. uni.navigateBack({
  14964. delta: 1
  14965. });
  14966. };
  14967. const handleSubmit = async () => {
  14968. formatAppLog("log", "at pages/review/review.vue:419", "handleSubmit>>>", editForm.value);
  14969. const { data: res } = await saveReview({
  14970. token: uni.getStorageSync("token"),
  14971. data: JSON.stringify(editForm.value)
  14972. });
  14973. if (res.code === 200) {
  14974. formatAppLog("log", "at pages/review/review.vue:426", "depoly success>>>");
  14975. uni.redirectTo({
  14976. url: "/pages/index/index"
  14977. });
  14978. }
  14979. };
  14980. const selectUpload = (e2) => {
  14981. uni.showLoading({
  14982. title: "上传中"
  14983. });
  14984. const tempFilePaths = e2.tempFilePaths;
  14985. for (var i2 = 0; i2 < tempFilePaths.length; i2++) {
  14986. e2.tempFiles[i2];
  14987. uni.uploadFile({
  14988. url: urlConfig.value + "/common/upload",
  14989. header: {
  14990. "Authorization": "Bearer " + uni.getStorageSync("token")
  14991. },
  14992. formData: {
  14993. secretFlag: "N",
  14994. fileLocation: 5
  14995. },
  14996. filePath: tempFilePaths[i2],
  14997. name: "file",
  14998. success: (uploadFileRes) => {
  14999. uni.hideLoading();
  15000. formatAppLog("log", "at pages/review/review.vue:454", "upload success>>", uploadFileRes);
  15001. const back = JSON.parse(uploadFileRes.data);
  15002. formatAppLog("log", "at pages/review/review.vue:456", "upload success back >>", back);
  15003. if (back.code == 200) {
  15004. editForm.value.urls.push(back.url);
  15005. }
  15006. },
  15007. fail: () => {
  15008. uni.hideLoading();
  15009. uni.showToast("上传失败,请联系开发!");
  15010. },
  15011. complete: function() {
  15012. uni.hideLoading();
  15013. }
  15014. });
  15015. }
  15016. };
  15017. const handleOnblur = (e2) => {
  15018. formatAppLog("log", "at pages/review/review.vue:474", "eeeeee", e2.detail.value);
  15019. editForm.value.weight = e2.detail.value;
  15020. formatAppLog("log", "at pages/review/review.vue:476", "eeeeee editForm.value.weight", editForm.value.weight);
  15021. };
  15022. return (_ctx, _cache) => {
  15023. const _component_uni_nav_bar = resolveEasycom(vue.resolveDynamicComponent("uni-nav-bar"), __easycom_0);
  15024. const _component_w_barcode = resolveEasycom(vue.resolveDynamicComponent("w-barcode"), __easycom_1);
  15025. const _component_uni_tag = resolveEasycom(vue.resolveDynamicComponent("uni-tag"), __easycom_2);
  15026. const _component_uni_file_picker = resolveEasycom(vue.resolveDynamicComponent("uni-file-picker"), __easycom_3);
  15027. return vue.openBlock(), vue.createElementBlock("view", { class: "main" }, [
  15028. vue.createVNode(_component_uni_nav_bar, {
  15029. dark: "",
  15030. fixed: true,
  15031. "background-color": "#18C7B0",
  15032. "status-bar": "",
  15033. "left-icon": "left",
  15034. height: "62.5rpx",
  15035. width: "750rpx",
  15036. title: "复核详情",
  15037. onClickLeft: handleBack
  15038. }),
  15039. vue.createElementVNode("view", { class: "content" }, [
  15040. vue.createElementVNode("view", { class: "header" }, [
  15041. vue.createElementVNode("view", { class: "ti" }, [
  15042. vue.createElementVNode("view", { class: "left" }, [
  15043. vue.createElementVNode("view", { class: "baracode" }, [
  15044. vue.createVNode(_component_w_barcode, { options: preseObj.value }, null, 8, ["options"]),
  15045. vue.createElementVNode(
  15046. "view",
  15047. { class: "barnum" },
  15048. vue.toDisplayString(v2.value.preNo),
  15049. 1
  15050. /* TEXT */
  15051. )
  15052. ])
  15053. ]),
  15054. vue.createElementVNode("view", { class: "mid" }, [
  15055. vue.createElementVNode("text", { class: "title" }, "中药处方笺")
  15056. ]),
  15057. vue.createElementVNode("view", { class: "rig" }, [
  15058. vue.createElementVNode(
  15059. "text",
  15060. { class: "title" },
  15061. vue.toDisplayString(v2.value.type == "1" ? "中药处方" : v2.value.type == "1" ? "中药制剂" : ""),
  15062. 1
  15063. /* TEXT */
  15064. )
  15065. ])
  15066. ]),
  15067. vue.createElementVNode("view", { class: "patiinfo" }, [
  15068. vue.createElementVNode("view", { class: "r1" }, [
  15069. vue.createElementVNode("view", { class: "row" }, [
  15070. vue.createElementVNode("span", { class: "we" }, "姓名:"),
  15071. vue.createTextVNode(
  15072. vue.toDisplayString(v2.value.name),
  15073. 1
  15074. /* TEXT */
  15075. )
  15076. ]),
  15077. vue.createElementVNode("view", { class: "row" }, [
  15078. vue.createElementVNode("span", { class: "we" }, "性别:"),
  15079. vue.createTextVNode(
  15080. vue.toDisplayString(v2.value.sex),
  15081. 1
  15082. /* TEXT */
  15083. )
  15084. ]),
  15085. vue.createElementVNode("view", { class: "row" }, [
  15086. vue.createElementVNode("span", { class: "we" }, "年龄:"),
  15087. vue.createTextVNode(
  15088. vue.toDisplayString(v2.value.age) + "岁",
  15089. 1
  15090. /* TEXT */
  15091. )
  15092. ]),
  15093. vue.createElementVNode("view", { class: "row" }, [
  15094. vue.createElementVNode("span", { class: "we" }, "电话:"),
  15095. vue.createTextVNode(
  15096. vue.toDisplayString(v2.value.contactNumber),
  15097. 1
  15098. /* TEXT */
  15099. )
  15100. ]),
  15101. vue.createElementVNode("view", { class: "row" }, [
  15102. vue.createElementVNode("span", { class: "we" }, "当前处方状态:"),
  15103. vue.createTextVNode(
  15104. vue.toDisplayString(v2.value.state == "1" ? "配药" : v2.value.state == "2" ? "煎药" : v2.value.state == "3" ? "发药" : v2.value.state == "4" ? "配送" : ""),
  15105. 1
  15106. /* TEXT */
  15107. )
  15108. ])
  15109. ]),
  15110. vue.createElementVNode("view", { class: "r2" }, [
  15111. vue.createElementVNode("view", { class: "row" }, [
  15112. vue.createElementVNode("span", { class: "we" }, "就诊科室:"),
  15113. vue.createTextVNode(
  15114. vue.toDisplayString(v2.value.department),
  15115. 1
  15116. /* TEXT */
  15117. )
  15118. ]),
  15119. vue.createElementVNode("view", { class: "row" }, [
  15120. vue.createElementVNode("span", { class: "we" }, "临床诊断:"),
  15121. vue.createTextVNode(
  15122. vue.toDisplayString(v2.value.disName) + "—" + vue.toDisplayString(v2.value.symName),
  15123. 1
  15124. /* TEXT */
  15125. )
  15126. ]),
  15127. vue.createElementVNode("view", { class: "row" }, [
  15128. vue.createElementVNode("span", { class: "we" }, "开方时间:"),
  15129. vue.createTextVNode(
  15130. vue.toDisplayString(v2.value.prescriptionTime),
  15131. 1
  15132. /* TEXT */
  15133. )
  15134. ])
  15135. ]),
  15136. vue.createElementVNode("view", { class: "r3" }, [
  15137. vue.createElementVNode("span", { class: "we" }, "联系地址:"),
  15138. vue.createTextVNode(
  15139. vue.toDisplayString(v2.value.address),
  15140. 1
  15141. /* TEXT */
  15142. )
  15143. ])
  15144. ])
  15145. ]),
  15146. vue.createElementVNode("view", { class: "rp" }, [
  15147. vue.createElementVNode("view", { class: "title" }, [
  15148. vue.createElementVNode("text", { class: "text" }, "Rp:")
  15149. ]),
  15150. vue.createElementVNode("view", { class: "lists" }, [
  15151. (vue.openBlock(true), vue.createElementBlock(
  15152. vue.Fragment,
  15153. null,
  15154. vue.renderList(v2.value.rp, (x2, i2) => {
  15155. return vue.openBlock(), vue.createElementBlock("view", {
  15156. class: "item",
  15157. key: i2
  15158. }, [
  15159. vue.createElementVNode("view", { class: "le tag-view" }, [
  15160. vue.createVNode(_component_uni_tag, {
  15161. inverted: !selectRps.value.includes(x2),
  15162. text: x2.matName + x2.matDose + x2.matUnitName,
  15163. onClick: ($event) => handleGetRps(x2)
  15164. }, null, 8, ["inverted", "text", "onClick"])
  15165. ]),
  15166. vue.createElementVNode("view", { class: "rig" }, [
  15167. vue.createElementVNode(
  15168. "view",
  15169. { class: "up" },
  15170. vue.toDisplayString(x2.matUsageName),
  15171. 1
  15172. /* TEXT */
  15173. ),
  15174. vue.createElementVNode(
  15175. "view",
  15176. { class: "do" },
  15177. vue.toDisplayString(x2.sign),
  15178. 1
  15179. /* TEXT */
  15180. )
  15181. ])
  15182. ]);
  15183. }),
  15184. 128
  15185. /* KEYED_FRAGMENT */
  15186. ))
  15187. ]),
  15188. vue.createElementVNode("view", { class: "footer" }, [
  15189. vue.createElementVNode("view", { class: "js" }, [
  15190. vue.createTextVNode(
  15191. " 剂数:" + vue.toDisplayString(v2.value.number) + " ",
  15192. 1
  15193. /* TEXT */
  15194. ),
  15195. v2.value.daijianCost !== "" ? (vue.openBlock(), vue.createElementBlock("view", {
  15196. key: 0,
  15197. class: "pies_tips"
  15198. }, " (代煎) ")) : vue.createCommentVNode("v-if", true)
  15199. ]),
  15200. vue.createElementVNode(
  15201. "view",
  15202. { class: "js" },
  15203. vue.toDisplayString(v2.value.dosageForm),
  15204. 1
  15205. /* TEXT */
  15206. ),
  15207. vue.createElementVNode(
  15208. "view",
  15209. { class: "js" },
  15210. vue.toDisplayString(v2.value.prescriptionUsage),
  15211. 1
  15212. /* TEXT */
  15213. ),
  15214. vue.createElementVNode(
  15215. "view",
  15216. { class: "js" },
  15217. "每次" + vue.toDisplayString(v2.value.concentration),
  15218. 1
  15219. /* TEXT */
  15220. ),
  15221. vue.createElementVNode(
  15222. "view",
  15223. { class: "js" },
  15224. vue.toDisplayString(v2.value.frequency),
  15225. 1
  15226. /* TEXT */
  15227. ),
  15228. vue.createElementVNode(
  15229. "view",
  15230. { class: "freque" },
  15231. vue.toDisplayString(v2.value.medicationTime),
  15232. 1
  15233. /* TEXT */
  15234. )
  15235. ]),
  15236. vue.createElementVNode(
  15237. "view",
  15238. { class: "rp-tips" },
  15239. vue.toDisplayString(v2.value.entrust),
  15240. 1
  15241. /* TEXT */
  15242. )
  15243. ]),
  15244. vue.createElementVNode("view", { class: "amountarea" }, [
  15245. vue.createElementVNode("view", { class: "amount" }, [
  15246. vue.createElementVNode("view", { class: "r1" }, [
  15247. vue.createElementVNode(
  15248. "view",
  15249. { class: "pijw" },
  15250. "药品金额:" + vue.toDisplayString(v2.value.prescriptionSum),
  15251. 1
  15252. /* TEXT */
  15253. )
  15254. ]),
  15255. vue.createElementVNode("view", { class: "r2" }, [
  15256. vue.createElementVNode(
  15257. "view",
  15258. { class: "jyf" },
  15259. "煎药费:" + vue.toDisplayString(v2.value.daijianCost),
  15260. 1
  15261. /* TEXT */
  15262. ),
  15263. vue.createElementVNode(
  15264. "view",
  15265. { class: "psf" },
  15266. "配送费:" + vue.toDisplayString(v2.value.distributionCost),
  15267. 1
  15268. /* TEXT */
  15269. )
  15270. ]),
  15271. vue.createElementVNode("view", { class: "r3" }, [
  15272. vue.createTextVNode(
  15273. " 总金额:" + vue.toDisplayString(v2.value.prescriptionTotalSum) + " ",
  15274. 1
  15275. /* TEXT */
  15276. ),
  15277. vue.createCommentVNode(' <view class="zjw"></view> ')
  15278. ])
  15279. ]),
  15280. vue.createElementVNode("view", { class: "service" }, [
  15281. vue.createElementVNode("view", { class: "kf" }, [
  15282. vue.createElementVNode("span", { class: "we" }, "开方:"),
  15283. vue.createTextVNode(
  15284. vue.toDisplayString(v2.value.operateList[0].operater || ""),
  15285. 1
  15286. /* TEXT */
  15287. )
  15288. ]),
  15289. vue.createElementVNode("view", { class: "kf" }, [
  15290. vue.createElementVNode("span", { class: "we" }, "审核:"),
  15291. vue.createTextVNode(
  15292. vue.toDisplayString(v2.value.operateList[1].operater || ""),
  15293. 1
  15294. /* TEXT */
  15295. )
  15296. ]),
  15297. vue.createElementVNode("view", { class: "kf" }, [
  15298. vue.createElementVNode("span", { class: "we" }, "调配:"),
  15299. vue.createTextVNode(
  15300. vue.toDisplayString(v2.value.operateList[2].operater || ""),
  15301. 1
  15302. /* TEXT */
  15303. )
  15304. ]),
  15305. vue.createElementVNode("view", { class: "kf" }, [
  15306. vue.createElementVNode("span", { class: "we" }, "复核:"),
  15307. vue.createTextVNode(
  15308. vue.toDisplayString(v2.value.operateList[3].operater || ""),
  15309. 1
  15310. /* TEXT */
  15311. )
  15312. ]),
  15313. vue.createElementVNode("view", { class: "kf" }, [
  15314. vue.createElementVNode("span", { class: "we" }, "浸泡:"),
  15315. vue.createTextVNode(
  15316. vue.toDisplayString(v2.value.operateList[4].operater || ""),
  15317. 1
  15318. /* TEXT */
  15319. )
  15320. ]),
  15321. vue.createElementVNode("view", { class: "kf" }, [
  15322. vue.createElementVNode("span", { class: "we" }, "煎煮:"),
  15323. vue.createTextVNode(
  15324. vue.toDisplayString(v2.value.operateList[5].operater || ""),
  15325. 1
  15326. /* TEXT */
  15327. )
  15328. ]),
  15329. vue.createElementVNode("view", { class: "kf" }, [
  15330. vue.createElementVNode("span", { class: "we" }, "打包:"),
  15331. vue.createTextVNode(
  15332. vue.toDisplayString(v2.value.operateList[6].operater || ""),
  15333. 1
  15334. /* TEXT */
  15335. )
  15336. ]),
  15337. vue.createElementVNode("view", { class: "kf" }, [
  15338. vue.createElementVNode("span", { class: "we" }, "发药:"),
  15339. vue.createTextVNode(
  15340. vue.toDisplayString(v2.value.operateList[7].operater || ""),
  15341. 1
  15342. /* TEXT */
  15343. )
  15344. ])
  15345. ])
  15346. ]),
  15347. vue.createElementVNode("view", { class: "comment" }, [
  15348. vue.createElementVNode("view", { class: "z" }, "注:"),
  15349. vue.createElementVNode(
  15350. "text",
  15351. null,
  15352. vue.toDisplayString(v2.value.entrust1111),
  15353. 1
  15354. /* TEXT */
  15355. )
  15356. ])
  15357. ]),
  15358. vue.createElementVNode("view", { class: "upload" }, [
  15359. vue.createElementVNode("view", { class: "title" }, "上传照片"),
  15360. vue.createVNode(_component_uni_file_picker, {
  15361. "image-styles": imageStyles.value,
  15362. fileMediatype: "image",
  15363. mode: "grid",
  15364. limit: 3,
  15365. "del-icon": false,
  15366. "auto-upload": false,
  15367. onSelect: selectUpload
  15368. }, null, 8, ["image-styles"])
  15369. ]),
  15370. vue.createElementVNode("view", { class: "weight" }, [
  15371. vue.createElementVNode("view", { class: "title" }, "复核重量"),
  15372. vue.createElementVNode("view", { class: "tex" }, [
  15373. vue.createElementVNode("input", {
  15374. class: "uni-input",
  15375. type: "number",
  15376. value: v2.value.weight,
  15377. placeholder: "请输入",
  15378. onInput: handleOnblur,
  15379. "auto-blur": "/"
  15380. }, null, 40, ["value"]),
  15381. vue.createTextVNode(" g ")
  15382. ])
  15383. ]),
  15384. vue.createElementVNode("view", { class: "cooment" }, [
  15385. vue.createElementVNode("view", { class: "title" }, "备注内容"),
  15386. vue.createElementVNode("view", { class: "tex" }, [
  15387. vue.withDirectives(vue.createElementVNode(
  15388. "textarea",
  15389. {
  15390. placeholder: "请输入备注内容",
  15391. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => editForm.value.comments = $event),
  15392. "placeholder-style": "font-size: 15rpx;",
  15393. height: "60rpx",
  15394. onInput: bindTextInput,
  15395. class: "input"
  15396. },
  15397. null,
  15398. 544
  15399. /* HYDRATE_EVENTS, NEED_PATCH */
  15400. ), [
  15401. [vue.vModelText, editForm.value.comments]
  15402. ])
  15403. ])
  15404. ]),
  15405. vue.createElementVNode("view", { class: "submit" }, [
  15406. vue.createElementVNode("button", {
  15407. type: "primary",
  15408. class: "bu",
  15409. onClick: handleSubmit
  15410. }, "上传")
  15411. ])
  15412. ]);
  15413. };
  15414. }
  15415. });
  15416. const PagesReviewReview = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/Users/sunwubin/source/pharmacy/pages/review/review.vue"]]);
  15417. __definePage("pages/login/login", PagesLoginLogin);
  15418. __definePage("pages/index/index", PagesIndexIndex);
  15419. __definePage("pages/detail/detail", PagesDetailDetail);
  15420. __definePage("pages/edit/edit", PagesEditEdit);
  15421. __definePage("pages/review/review", PagesReviewReview);
  15422. const _WEBSOCKET = {
  15423. //是否打开连接
  15424. isOpen: false,
  15425. //连接socket
  15426. connectSocket(url, successFunc = null, errorFunc = null) {
  15427. try {
  15428. uni.connectSocket({
  15429. url,
  15430. success() {
  15431. formatAppLog("log", "at static/js/websocket.js:11", "websocket连接成功!");
  15432. }
  15433. });
  15434. uni.onSocketOpen((res) => {
  15435. this.isOpen = true;
  15436. formatAppLog("log", "at static/js/websocket.js:17", "WebSocket连接已打开!");
  15437. if (successFunc) {
  15438. successFunc(res);
  15439. }
  15440. });
  15441. uni.onSocketError((res) => {
  15442. this.isOpen = false;
  15443. formatAppLog("log", "at static/js/websocket.js:25", "WebSocket连接打开失败,请检查!");
  15444. if (errorFunc) {
  15445. errorFunc(res);
  15446. }
  15447. });
  15448. uni.onSocketMessage((res) => {
  15449. formatAppLog("log", "at static/js/websocket.js:32", "收到服务器内容:" + res.data);
  15450. params = {
  15451. inApp: true,
  15452. // app内横幅提醒
  15453. voice: true,
  15454. // 声音提醒
  15455. vibration: true,
  15456. // 振动提醒
  15457. messageType: "",
  15458. //消息分类
  15459. messageTitle: "",
  15460. //通知标题
  15461. messageContent: "中药煎配溯源管理来新处方啦!",
  15462. messageImage: ""
  15463. };
  15464. uni.$appPush(params);
  15465. uni.redirectTo({
  15466. url: "/pages/index/index"
  15467. });
  15468. });
  15469. uni.onSocketClose((res) => {
  15470. formatAppLog("log", "at static/js/websocket.js:49", "WebSocket 已关闭!");
  15471. this.isOpen = false;
  15472. });
  15473. } catch (error) {
  15474. formatAppLog("log", "at static/js/websocket.js:53", "err:" + error);
  15475. }
  15476. },
  15477. //发送消息
  15478. sendMessage(msg = "", successFunc = null, errorFunc = null) {
  15479. if (!this.isOpen || !msg) {
  15480. if (errorFunc) {
  15481. errorFunc("未传消息内容或连接未打开!");
  15482. }
  15483. return;
  15484. }
  15485. uni.sendSocketMessage({
  15486. data: msg,
  15487. success(res) {
  15488. formatAppLog("log", "at static/js/websocket.js:67", "消息发送成功!");
  15489. if (successFunc) {
  15490. successFunc(res);
  15491. }
  15492. },
  15493. fail(err) {
  15494. formatAppLog("log", "at static/js/websocket.js:73", "消息发送失败!");
  15495. if (errorFunc) {
  15496. errorFunc(err);
  15497. }
  15498. }
  15499. });
  15500. },
  15501. //关闭连接
  15502. closeSocket() {
  15503. if (!this.isOpen) {
  15504. return;
  15505. }
  15506. uni.closeSocket();
  15507. }
  15508. };
  15509. const _sfc_main = {
  15510. __name: "App",
  15511. setup(__props) {
  15512. let globalTimer = null;
  15513. onLaunch(async () => {
  15514. formatAppLog("log", "at App.vue:14", "App onLaunch");
  15515. });
  15516. onShow(() => {
  15517. formatAppLog("log", "at App.vue:32", "App Show");
  15518. uni.$on("login", (data) => {
  15519. try {
  15520. _WEBSOCKET.connectSocket(`wss://zhongyao.fscuc.cn/webSocket/sentMessage/${data.userId}`, () => {
  15521. heartBeatTest();
  15522. });
  15523. } catch (error) {
  15524. formatAppLog("log", "at App.vue:42", "App err:" + error);
  15525. }
  15526. });
  15527. });
  15528. onHide(() => {
  15529. formatAppLog("log", "at App.vue:48", "App Hide");
  15530. uni.$off("login", (data) => {
  15531. _WEBSOCKET.closeSocket();
  15532. });
  15533. });
  15534. const heartBeatTest = () => {
  15535. clearInterval(globalTimer);
  15536. globalTimer = setInterval(() => {
  15537. _WEBSOCKET.sendMessage(
  15538. JSON.stringify({ action: "ping" }),
  15539. //与服务端约定好消息格式
  15540. null,
  15541. () => {
  15542. clearInterval(globalTimer);
  15543. }
  15544. );
  15545. }, 1e4);
  15546. };
  15547. return () => {
  15548. };
  15549. }
  15550. };
  15551. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/sunwubin/source/pharmacy/App.vue"]]);
  15552. let appPush$1 = class appPush {
  15553. constructor(option = {}) {
  15554. formatAppLog("log", "at js_sdk/levine-APPPush/levine-APPPush/plugins/APPPush/app_push.js:3", option);
  15555. this.inApp = option.inApp;
  15556. this.voice = option.voice;
  15557. this.vibration = option.vibration;
  15558. this.messageType = option.messageType || "";
  15559. this.messageTitle = option.messageTitle || "";
  15560. this.messageTime = option.messageTime || "现在";
  15561. this.messageContent = option.messageContent || "";
  15562. this.messageImage = option.messageImage || "";
  15563. this.screenWidth = plus.screen.resolutionWidth;
  15564. this.screenHeight = plus.screen.resolutionHeight;
  15565. this.propotation = this.screenWidth / 750;
  15566. this.popupViewWidth = this.propotation * 710;
  15567. this.popupViewHeight = this.propotation * 192;
  15568. this.viewContentPadding = this.propotation * 30;
  15569. this.viewContentWidth = parseInt(this.popupViewWidth - this.viewContentPadding * 2);
  15570. this.system = uni.getSystemInfoSync();
  15571. this.duration = 200;
  15572. this.closeTime = 3e3;
  15573. formatAppLog("log", "at js_sdk/levine-APPPush/levine-APPPush/plugins/APPPush/app_push.js:41", this.inApp, this.voice, this.vibration);
  15574. this.top = this.propotation * 20 + this.system.statusBarHeight;
  15575. this.initTop = -this.system.statusBarHeight;
  15576. this.body = null;
  15577. this.bodyBg = null;
  15578. this.timer = null;
  15579. this.flag = false;
  15580. this.cur = {
  15581. x: 0,
  15582. y: 0,
  15583. pageX: 0,
  15584. pageY: 0
  15585. };
  15586. }
  15587. // 生成弹框主体
  15588. createView() {
  15589. let view = new plus.nativeObj.View("popupView", {
  15590. // tag: 'rect',
  15591. top: this.propotation * 20 + this.system.statusBarHeight,
  15592. left: this.propotation * 20,
  15593. height: this.popupViewHeight,
  15594. width: this.popupViewWidth
  15595. });
  15596. view.drawRect({
  15597. color: "#fff",
  15598. radius: "10px"
  15599. });
  15600. let viewContentList = [
  15601. {
  15602. src: "/static/push/message-icon.png",
  15603. id: "icon",
  15604. tag: "img",
  15605. position: {
  15606. top: this.viewContentPadding + "px",
  15607. left: this.viewContentPadding + "px",
  15608. width: this.propotation * 24 + "px",
  15609. height: this.propotation * 24 + "px"
  15610. }
  15611. },
  15612. {
  15613. tag: "font",
  15614. id: "pop-title",
  15615. text: this.messageType,
  15616. textStyles: {
  15617. size: this.propotation * 24 + "px",
  15618. align: "left",
  15619. color: "#4F555B"
  15620. },
  15621. position: {
  15622. top: this.viewContentPadding + "px",
  15623. left: this.propotation * 64 + "px",
  15624. height: this.propotation * 24 + "px",
  15625. width: this.viewContentWidth + "px"
  15626. }
  15627. },
  15628. {
  15629. tag: "font",
  15630. id: "time",
  15631. text: this.messageTime,
  15632. textStyles: {
  15633. size: this.propotation * 24 + "px",
  15634. align: "right",
  15635. color: "#4F555B"
  15636. },
  15637. position: {
  15638. top: this.viewContentPadding + "px",
  15639. left: this.viewContentPadding + "px",
  15640. height: this.propotation * 24 + "px",
  15641. width: this.viewContentWidth + "px"
  15642. }
  15643. },
  15644. {
  15645. tag: "font",
  15646. id: "push-title",
  15647. text: this.messageTitle,
  15648. textStyles: {
  15649. size: this.propotation * 30 + "px",
  15650. align: "left",
  15651. color: "#202123",
  15652. overflow: "ellipsis"
  15653. },
  15654. position: {
  15655. top: this.propotation * 82 + "px",
  15656. left: this.propotation * 30 + "px",
  15657. height: this.propotation * 30 + "px",
  15658. width: this.propotation * 505 + "px"
  15659. }
  15660. },
  15661. {
  15662. tag: "font",
  15663. id: "push-content",
  15664. text: this.messageContent,
  15665. textStyles: {
  15666. size: this.propotation * 24 + "px",
  15667. align: "left",
  15668. color: "#4F555B",
  15669. overflow: "ellipsis"
  15670. },
  15671. position: {
  15672. top: this.propotation * 130 + "px",
  15673. left: this.propotation * 30 + "px",
  15674. height: this.propotation * 24 + "px",
  15675. width: this.propotation * 505 + "px"
  15676. }
  15677. },
  15678. {
  15679. src: this.messageImage,
  15680. id: "image",
  15681. tag: "img",
  15682. position: {
  15683. top: this.propotation * 68 + "px",
  15684. // right: "0px",
  15685. left: this.propotation * 586 + "px",
  15686. width: this.propotation * 100 + "px",
  15687. height: this.propotation * 100 + "px"
  15688. }
  15689. },
  15690. {
  15691. src: "/static/push/img-bg.png",
  15692. id: "img-bg",
  15693. tag: "img",
  15694. position: {
  15695. top: this.propotation * 68 + "px",
  15696. // right: "0px",
  15697. left: this.propotation * 586 + "px",
  15698. width: this.propotation * 100 + "px",
  15699. height: this.propotation * 100 + "px"
  15700. }
  15701. }
  15702. ];
  15703. view.draw(viewContentList);
  15704. view.addEventListener("touchstart", (event) => {
  15705. this.flag = true;
  15706. var touch;
  15707. if (event.touches) {
  15708. touch = event.touches[0];
  15709. } else {
  15710. touch = event;
  15711. }
  15712. this.cur.x = touch.clientX;
  15713. this.cur.y = touch.clientY;
  15714. this.cur.pageX = touch.pageX;
  15715. this.cur.pageY = touch.pageY;
  15716. });
  15717. view.addEventListener("touchmove", (event) => {
  15718. var touch;
  15719. if (event.touches) {
  15720. touch = event.touches[0];
  15721. } else {
  15722. touch = event;
  15723. }
  15724. let moveX = touch.pageX - this.cur.x;
  15725. let moveY = touch.pageY - this.cur.y;
  15726. let x2 = moveX;
  15727. let y2 = moveY;
  15728. if (x2 < 0)
  15729. ;
  15730. else if (x2 > this.popupViewWidth - this.popupViewWidth)
  15731. ;
  15732. if (y2 < 0)
  15733. ;
  15734. else if (y2 >= this.propotation * 20 + this.system.statusBarHeight) {
  15735. y2 = this.propotation * 20 + this.system.statusBarHeight;
  15736. }
  15737. this.body.setStyle({
  15738. top: y2 + "px",
  15739. left: x2 + "px"
  15740. });
  15741. });
  15742. view.addEventListener("touchend", (event) => {
  15743. var touch;
  15744. if (event.touches) {
  15745. touch = event.touches[0];
  15746. } else {
  15747. touch = event;
  15748. }
  15749. let differX = Math.abs(this.cur.pageX) - Math.abs(touch.pageX);
  15750. let differY = Math.abs(this.cur.pageY) - Math.abs(touch.pageY);
  15751. this.flag = false;
  15752. if (Math.abs(differX) > 5 || Math.abs(differY) > 5) {
  15753. this.hide();
  15754. } else {
  15755. formatAppLog("log", "at js_sdk/levine-APPPush/levine-APPPush/plugins/APPPush/app_push.js:243", "-------------------");
  15756. this.hide();
  15757. }
  15758. });
  15759. this.body = view;
  15760. }
  15761. // 显示/关闭弹框动画
  15762. modelAnimationOpenOrClose(type) {
  15763. var options = { type, duration: this.duration };
  15764. plus.nativeObj.View.startAnimation(options, this.body, () => {
  15765. plus.nativeObj.View.clearAnimation();
  15766. });
  15767. }
  15768. bgAnimationOpenOrClose(type) {
  15769. var options = { type, duration: this.duration };
  15770. plus.nativeObj.View.startAnimation(options, this.bodyBg, () => {
  15771. plus.nativeObj.View.clearAnimation();
  15772. });
  15773. }
  15774. // closeAnimation() {
  15775. // // push弹框距离最顶部的距离
  15776. // let top = (this.propotation * 20) + this.system.statusBarHeight
  15777. // // 完全隐藏时的顶部距离
  15778. // let hideTop = -this.system.statusBarHeight
  15779. // this.timer = setInterval(() => {
  15780. // this.top = this.top - 2
  15781. // if(this.top < hideTop * 2) {
  15782. // clearInterval(this.timer)
  15783. // this.timer = null
  15784. // }
  15785. // this.body.setStyle({
  15786. // top:this.top
  15787. // })
  15788. // }, 1)
  15789. // }
  15790. // 显示弹框
  15791. show() {
  15792. this.tips();
  15793. if (this.inApp) {
  15794. this.createView();
  15795. this.body.show();
  15796. setTimeout(() => {
  15797. if (this.body) {
  15798. this.hide();
  15799. }
  15800. }, this.closeTime);
  15801. }
  15802. }
  15803. // 关闭弹框
  15804. hide() {
  15805. this.modelAnimationOpenOrClose("slide-out-right");
  15806. this.body.hide();
  15807. setTimeout(() => {
  15808. plus.nativeObj.View.clearAnimation();
  15809. this.body = null;
  15810. }, this.duration);
  15811. }
  15812. // 调用系统提示音和振动
  15813. tips() {
  15814. if (this.voice) {
  15815. let system = uni.getSystemInfoSync().platform;
  15816. if (system == "ios") {
  15817. let player = plus.audio.createPlayer("/static/audio/ios.mp3");
  15818. player.play();
  15819. } else {
  15820. let main = plus.android.runtimeMainActivity();
  15821. let RingtoneManager = plus.android.importClass("android.media.RingtoneManager");
  15822. let uri = RingtoneManager.getActualDefaultRingtoneUri(main, RingtoneManager.TYPE_NOTIFICATION);
  15823. formatAppLog("log", "at js_sdk/levine-APPPush/levine-APPPush/plugins/APPPush/app_push.js:333", uri);
  15824. let MediaPlayer = plus.android.importClass("android.media.MediaPlayer");
  15825. let player = MediaPlayer.create(main, uri);
  15826. player.setLooping(false);
  15827. player.prepare();
  15828. player.start();
  15829. }
  15830. }
  15831. if (this.vibration) {
  15832. plus.device.vibrate();
  15833. }
  15834. }
  15835. };
  15836. const appPush = {
  15837. install: function(Vue2) {
  15838. Vue2.prototype.$appPush = function(op = {}) {
  15839. new appPush$1({
  15840. ...op
  15841. }).show();
  15842. };
  15843. }
  15844. };
  15845. class e {
  15846. constructor(e2) {
  15847. this.standards = { strict: "strict", loose: "loose", html5: "html5" }, this.previewBody = null, this.close = null, this.previewBodyUtilPrintBtn = null, this.selectArray = [], this.counter = 0, this.settings = { standard: this.standards.html5 }, Object.assign(this.settings, e2), this.init();
  15848. }
  15849. init() {
  15850. this.counter++, this.settings.id = `printArea_${this.counter}`;
  15851. let e2 = "";
  15852. this.settings.url && !this.settings.asyncUrl && (e2 = this.settings.url);
  15853. let t2 = this;
  15854. if (this.settings.asyncUrl)
  15855. return void t2.settings.asyncUrl(function(e3) {
  15856. let i3 = t2.getPrintWindow(e3);
  15857. t2.settings.preview ? t2.previewIfrmaeLoad() : t2.print(i3);
  15858. }, t2.settings.vue);
  15859. let i2 = this.getPrintWindow(e2);
  15860. this.settings.url || this.write(i2.doc), this.settings.preview ? this.previewIfrmaeLoad() : this.print(i2);
  15861. }
  15862. addEvent(e2, t2, i2) {
  15863. e2.addEventListener ? e2.addEventListener(t2, i2, false) : e2.attachEvent ? e2.attachEvent("on" + t2, i2) : e2["on" + t2] = i2;
  15864. }
  15865. previewIfrmaeLoad() {
  15866. let e2 = document.getElementById("vue-pirnt-nb-previewBox");
  15867. if (e2) {
  15868. let t2 = this, i2 = e2.querySelector("iframe");
  15869. this.settings.previewBeforeOpenCallback(), this.addEvent(i2, "load", function() {
  15870. t2.previewBoxShow(), t2.removeCanvasImg(), t2.settings.previewOpenCallback();
  15871. }), this.addEvent(e2.querySelector(".previewBodyUtilPrintBtn"), "click", function() {
  15872. t2.settings.beforeOpenCallback(), t2.settings.openCallback(), i2.contentWindow.print(), t2.settings.closeCallback();
  15873. });
  15874. }
  15875. }
  15876. removeCanvasImg() {
  15877. let e2 = this;
  15878. try {
  15879. if (e2.elsdom) {
  15880. let t2 = e2.elsdom.querySelectorAll(".canvasImg");
  15881. for (let e3 = 0; e3 < t2.length; e3++)
  15882. t2[e3].remove();
  15883. }
  15884. } catch (t2) {
  15885. formatAppLog("log", "at node_modules/vue3-print-nb/dist/vue3-print-nb.es.js:1", t2);
  15886. }
  15887. }
  15888. print(e2) {
  15889. var t2 = this;
  15890. let i2 = document.getElementById(this.settings.id) || e2.f, l2 = document.getElementById(this.settings.id).contentWindow || e2.f.contentWindow;
  15891. t2.settings.beforeOpenCallback(), t2.addEvent(i2, "load", function() {
  15892. l2.focus(), t2.settings.openCallback(), l2.print(), i2.remove(), t2.settings.closeCallback(), t2.removeCanvasImg();
  15893. });
  15894. }
  15895. write(e2) {
  15896. e2.open(), e2.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`), e2.close();
  15897. }
  15898. docType() {
  15899. return this.settings.standard === this.standards.html5 ? "<!DOCTYPE html>" : `<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01${this.settings.standard === this.standards.loose ? " Transitional" : ""}//EN" "http://www.w3.org/TR/html4/${this.settings.standard === this.standards.loose ? "loose" : "strict"}.dtd">`;
  15900. }
  15901. getHead() {
  15902. let e2 = "", t2 = "", i2 = "";
  15903. this.settings.extraHead && this.settings.extraHead.replace(/([^,]+)/g, (t3) => {
  15904. e2 += t3;
  15905. }), [].forEach.call(document.querySelectorAll("link"), function(e3) {
  15906. e3.href.indexOf(".css") >= 0 && (t2 += `<link type="text/css" rel="stylesheet" href="${e3.href}" >`);
  15907. });
  15908. let l2 = document.styleSheets;
  15909. if (l2 && l2.length > 0)
  15910. for (let r2 = 0; r2 < l2.length; r2++)
  15911. try {
  15912. if (l2[r2].cssRules || l2[r2].rules) {
  15913. let e3 = l2[r2].cssRules || l2[r2].rules;
  15914. for (let t3 = 0; t3 < e3.length; t3++)
  15915. i2 += e3[t3].cssText;
  15916. }
  15917. } catch (s2) {
  15918. formatAppLog("log", "at node_modules/vue3-print-nb/dist/vue3-print-nb.es.js:1", l2[r2].href + s2);
  15919. }
  15920. return this.settings.extraCss && this.settings.extraCss.replace(/([^,\s]+)/g, (e3) => {
  15921. t2 += `<link type="text/css" rel="stylesheet" href="${e3}">`;
  15922. }), `<head><title>${this.settings.popTitle}</title>${e2}${t2}<style type="text/css">${i2}</style></head>`;
  15923. }
  15924. getBody() {
  15925. let e2 = this.settings.ids;
  15926. return e2 = e2.replace(new RegExp("#", "g"), ""), this.elsdom = this.beforeHanler(document.getElementById(e2)), "<body>" + this.getFormData(this.elsdom).outerHTML + "</body>";
  15927. }
  15928. beforeHanler(e2) {
  15929. let t2 = e2.querySelectorAll("canvas");
  15930. for (let i2 = 0; i2 < t2.length; i2++)
  15931. if (!t2[i2].style.display) {
  15932. let e3 = t2[i2].parentNode, l2 = t2[i2].toDataURL("image/png"), s2 = new Image();
  15933. s2.className = "canvasImg", s2.style.display = "none", s2.src = l2, e3.appendChild(s2);
  15934. }
  15935. return e2;
  15936. }
  15937. getFormData(e2) {
  15938. let t2 = e2.cloneNode(true), i2 = t2.querySelectorAll("input,select,textarea"), l2 = t2.querySelectorAll(".canvasImg,canvas"), s2 = -1;
  15939. for (let r2 = 0; r2 < l2.length; r2++) {
  15940. let e3 = l2[r2].parentNode, t3 = l2[r2];
  15941. "canvas" === t3.tagName.toLowerCase() ? e3.removeChild(t3) : t3.style.display = "block";
  15942. }
  15943. for (let r2 = 0; r2 < i2.length; r2++) {
  15944. let t3 = i2[r2], l3 = t3.getAttribute("type"), n2 = i2[r2];
  15945. if (l3 || (l3 = "SELECT" === t3.tagName ? "select" : "TEXTAREA" === t3.tagName ? "textarea" : ""), "INPUT" === t3.tagName)
  15946. "radio" === l3 || "checkbox" === l3 ? t3.checked && n2.setAttribute("checked", t3.checked) : (n2.value = t3.value, n2.setAttribute("value", t3.value));
  15947. else if ("select" === l3) {
  15948. s2++;
  15949. for (let i3 = 0; i3 < e2.querySelectorAll("select").length; i3++) {
  15950. let l4 = e2.querySelectorAll("select")[i3];
  15951. if (!l4.getAttribute("newbs") && l4.setAttribute("newbs", i3), l4.getAttribute("newbs") == s2) {
  15952. let i4 = e2.querySelectorAll("select")[s2].selectedIndex;
  15953. t3.options[i4].setAttribute("selected", true);
  15954. }
  15955. }
  15956. } else
  15957. n2.innerHTML = t3.value, n2.setAttribute("html", t3.value);
  15958. }
  15959. return t2;
  15960. }
  15961. getPrintWindow(e2) {
  15962. var t2 = this.Iframe(e2);
  15963. return { f: t2, win: t2.contentWindow || t2, doc: t2.doc };
  15964. }
  15965. previewBoxShow() {
  15966. let e2 = document.getElementById("vue-pirnt-nb-previewBox");
  15967. e2 && (document.querySelector("html").setAttribute("style", "overflow: hidden"), e2.style.display = "block");
  15968. }
  15969. previewBoxHide() {
  15970. let e2 = document.getElementById("vue-pirnt-nb-previewBox");
  15971. e2 && (document.querySelector("html").setAttribute("style", "overflow: visible;"), e2.querySelector("iframe") && e2.querySelector("iframe").remove(), e2.style.display = "none");
  15972. }
  15973. previewBox() {
  15974. let e2 = document.getElementById("vue-pirnt-nb-previewBox"), t2 = "previewBody";
  15975. if (e2)
  15976. return e2.querySelector("iframe") && e2.querySelector("iframe").remove(), { close: e2.querySelector(".previewClose"), previewBody: e2.querySelector(".previewBody") };
  15977. let i2 = document.createElement("div");
  15978. i2.setAttribute("id", "vue-pirnt-nb-previewBox"), i2.setAttribute("style", "position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"), i2.style.zIndex = this.settings.zIndex;
  15979. let l2 = document.createElement("div");
  15980. l2.setAttribute("class", "previewHeader"), l2.setAttribute("style", "padding: 5px 20px;"), l2.innerHTML = this.settings.previewTitle, i2.appendChild(l2), this.close = document.createElement("div");
  15981. let s2 = this.close;
  15982. s2.setAttribute("class", "previewClose"), s2.setAttribute("style", "position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");
  15983. let r2 = document.createElement("div"), n2 = document.createElement("div");
  15984. r2.setAttribute("class", "closeBefore"), r2.setAttribute("style", "position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"), n2.setAttribute("class", "closeAfter"), n2.setAttribute("style", "position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"), s2.appendChild(r2), s2.appendChild(n2), l2.appendChild(s2), this.previewBody = document.createElement("div");
  15985. let o2 = this.previewBody;
  15986. o2.setAttribute("class", t2), o2.setAttribute("style", "display: flex;flex-direction: column; height: 100%;"), i2.appendChild(o2);
  15987. let a2 = document.createElement("div");
  15988. a2.setAttribute("class", "previewBodyUtil"), a2.setAttribute("style", "height: 32px;background: #474747;position: relative;"), o2.appendChild(a2), this.previewBodyUtilPrintBtn = document.createElement("div");
  15989. let d2 = this.previewBodyUtilPrintBtn;
  15990. return d2.setAttribute("class", "previewBodyUtilPrintBtn"), d2.innerHTML = this.settings.previewPrintBtnLabel, d2.setAttribute("style", "position: absolute;padding: 2px 10px;margin-top: 3px;left: 24px;font-size: 14px;color: white;cursor: pointer;background-color: rgba(0,0,0,.12);background-image: linear-gradient(hsla(0,0%,100%,.05),hsla(0,0%,100%,0));background-clip: padding-box;border: 1px solid rgba(0,0,0,.35);border-color: rgba(0,0,0,.32) rgba(0,0,0,.38) rgba(0,0,0,.42);box-shadow: inset 0 1px 0 hsla(0,0%,100%,.05), inset 0 0 1px hsla(0,0%,100%,.15), 0 1px 0 hsla(0,0%,100%,.05);"), a2.appendChild(d2), document.body.appendChild(i2), { close: this.close, previewBody: this.previewBody };
  15991. }
  15992. iframeBox(e2, t2) {
  15993. let i2 = document.createElement("iframe");
  15994. return i2.style.border = "0px", i2.style.position = "absolute", i2.style.width = "0px", i2.style.height = "0px", i2.style.right = "0px", i2.style.top = "0px", i2.setAttribute("id", e2), i2.setAttribute("src", t2), i2;
  15995. }
  15996. Iframe(e2) {
  15997. let t2 = this.settings.id;
  15998. e2 = e2 || (/* @__PURE__ */ new Date()).getTime();
  15999. let i2 = this, l2 = this.iframeBox(t2, e2);
  16000. try {
  16001. if (this.settings.preview) {
  16002. l2.setAttribute("style", "border: 0px;flex: 1;");
  16003. let e3 = this.previewBox(), t3 = e3.previewBody, s2 = e3.close;
  16004. t3.appendChild(l2), this.addEvent(s2, "click", function() {
  16005. i2.previewBoxHide();
  16006. });
  16007. } else
  16008. document.body.appendChild(l2);
  16009. l2.doc = null, l2.doc = l2.contentDocument ? l2.contentDocument : l2.contentWindow ? l2.contentWindow.document : l2.document;
  16010. } catch (s2) {
  16011. throw new Error(s2 + ". iframes may not be supported in this browser.");
  16012. }
  16013. if (null == l2.doc)
  16014. throw new Error("Cannot find document.");
  16015. return l2;
  16016. }
  16017. }
  16018. var t = { directiveName: "print", mounted(t2, i2, l2) {
  16019. let s2 = i2.instance, r2 = "";
  16020. var n2, o2, a2;
  16021. o2 = "click", a2 = () => {
  16022. if ("string" == typeof i2.value)
  16023. r2 = i2.value;
  16024. else {
  16025. if ("object" != typeof i2.value || !i2.value.id)
  16026. return void window.print();
  16027. {
  16028. r2 = i2.value.id;
  16029. let e2 = r2.replace(new RegExp("#", "g"), "");
  16030. document.getElementById(e2) || (formatAppLog("log", "at node_modules/vue3-print-nb/dist/vue3-print-nb.es.js:1", "id in Error"), r2 = "");
  16031. }
  16032. }
  16033. d2();
  16034. }, (n2 = t2).addEventListener ? n2.addEventListener(o2, a2, false) : n2.attachEvent ? n2.attachEvent("on" + o2, a2) : n2["on" + o2] = a2;
  16035. const d2 = () => {
  16036. new e({ ids: r2, vue: s2, url: i2.value.url, standard: "", extraHead: i2.value.extraHead, extraCss: i2.value.extraCss, zIndex: i2.value.zIndex || 20002, previewTitle: i2.value.previewTitle || "打印预览", previewPrintBtnLabel: i2.value.previewPrintBtnLabel || "打印", popTitle: i2.value.popTitle, preview: i2.value.preview || false, asyncUrl: i2.value.asyncUrl, previewBeforeOpenCallback() {
  16037. i2.value.previewBeforeOpenCallback && i2.value.previewBeforeOpenCallback(s2);
  16038. }, previewOpenCallback() {
  16039. i2.value.previewOpenCallback && i2.value.previewOpenCallback(s2);
  16040. }, openCallback() {
  16041. i2.value.openCallback && i2.value.openCallback(s2);
  16042. }, closeCallback() {
  16043. i2.value.closeCallback && i2.value.closeCallback(s2);
  16044. }, beforeOpenCallback() {
  16045. i2.value.beforeOpenCallback && i2.value.beforeOpenCallback(s2);
  16046. } });
  16047. };
  16048. }, install: function(e2) {
  16049. e2.directive("print", t);
  16050. } };
  16051. uni.$showMsg = (title = "数据请求失败!", duration = 1500) => {
  16052. uni.showToast({
  16053. title,
  16054. duration,
  16055. icon: "none"
  16056. });
  16057. };
  16058. uni.$appPush = appPush;
  16059. function createApp() {
  16060. const app = vue.createVueApp(App);
  16061. app.use(t);
  16062. return {
  16063. app
  16064. };
  16065. }
  16066. const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
  16067. uni.Vuex = __Vuex__;
  16068. uni.Pinia = __Pinia__;
  16069. __app__.provide("__globalStyles", __uniConfig.styles);
  16070. __app__._component.mpType = "app";
  16071. __app__._component.render = () => {
  16072. };
  16073. __app__.mount("#app");
  16074. })(Vue, uni.VueShared);