app-service.js 609 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173
  1. if (typeof Promise !== "undefined" && !Promise.prototype.finally) {
  2. Promise.prototype.finally = function(callback) {
  3. const promise = this.constructor;
  4. return this.then(
  5. (value) => promise.resolve(callback()).then(() => value),
  6. (reason) => promise.resolve(callback()).then(() => {
  7. throw reason;
  8. })
  9. );
  10. };
  11. }
  12. ;
  13. if (typeof uni !== "undefined" && uni && uni.requireGlobal) {
  14. const global2 = uni.requireGlobal();
  15. ArrayBuffer = global2.ArrayBuffer;
  16. Int8Array = global2.Int8Array;
  17. Uint8Array = global2.Uint8Array;
  18. Uint8ClampedArray = global2.Uint8ClampedArray;
  19. Int16Array = global2.Int16Array;
  20. Uint16Array = global2.Uint16Array;
  21. Int32Array = global2.Int32Array;
  22. Uint32Array = global2.Uint32Array;
  23. Float32Array = global2.Float32Array;
  24. Float64Array = global2.Float64Array;
  25. BigInt64Array = global2.BigInt64Array;
  26. BigUint64Array = global2.BigUint64Array;
  27. }
  28. ;
  29. if (uni.restoreGlobal) {
  30. uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval);
  31. }
  32. (function(vue) {
  33. "use strict";
  34. const _export_sfc = (sfc, props) => {
  35. const target = sfc.__vccOpts || sfc;
  36. for (const [key, val] of props) {
  37. target[key] = val;
  38. }
  39. return target;
  40. };
  41. const _sfc_main$F = {
  42. name: "UniGridItem",
  43. inject: ["grid"],
  44. props: {
  45. index: {
  46. type: Number,
  47. default: 0
  48. }
  49. },
  50. data() {
  51. return {
  52. column: 0,
  53. showBorder: true,
  54. square: true,
  55. highlight: true,
  56. left: 0,
  57. top: 0,
  58. openNum: 2,
  59. width: 0,
  60. borderColor: "#e5e5e5"
  61. };
  62. },
  63. created() {
  64. this.column = this.grid.column;
  65. this.showBorder = this.grid.showBorder;
  66. this.square = this.grid.square;
  67. this.highlight = this.grid.highlight;
  68. this.top = this.hor === 0 ? this.grid.hor : this.hor;
  69. this.left = this.ver === 0 ? this.grid.ver : this.ver;
  70. this.borderColor = this.grid.borderColor;
  71. this.grid.children.push(this);
  72. this.width = this.grid.width;
  73. },
  74. beforeDestroy() {
  75. this.grid.children.forEach((item, index) => {
  76. if (item === this) {
  77. this.grid.children.splice(index, 1);
  78. }
  79. });
  80. },
  81. methods: {
  82. _onClick() {
  83. this.grid.change({
  84. detail: {
  85. index: this.index
  86. }
  87. });
  88. }
  89. }
  90. };
  91. function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
  92. return $data.width ? (vue.openBlock(), vue.createElementBlock(
  93. "view",
  94. {
  95. key: 0,
  96. style: vue.normalizeStyle("width:" + $data.width + ";" + ($data.square ? "height:" + $data.width : "")),
  97. class: "uni-grid-item"
  98. },
  99. [
  100. vue.createElementVNode(
  101. "view",
  102. {
  103. class: vue.normalizeClass([{ "uni-grid-item--border": $data.showBorder, "uni-grid-item--border-top": $data.showBorder && $props.index < $data.column, "uni-highlight": $data.highlight }, "uni-grid-item__box"]),
  104. style: vue.normalizeStyle({ "border-right-color": $data.borderColor, "border-bottom-color": $data.borderColor, "border-top-color": $data.borderColor }),
  105. onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
  106. },
  107. [
  108. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  109. ],
  110. 6
  111. /* CLASS, STYLE */
  112. )
  113. ],
  114. 4
  115. /* STYLE */
  116. )) : vue.createCommentVNode("v-if", true);
  117. }
  118. const __easycom_0$7 = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$E], ["__scopeId", "data-v-7a807eb7"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue"]]);
  119. const ON_SHOW = "onShow";
  120. const ON_HIDE = "onHide";
  121. const ON_LOAD = "onLoad";
  122. const ON_UNLOAD = "onUnload";
  123. const ON_BACK_PRESS = "onBackPress";
  124. const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  125. function requireNativePlugin(name) {
  126. return weex.requireModule(name);
  127. }
  128. function formatAppLog(type, filename, ...args) {
  129. if (uni.__log__) {
  130. uni.__log__(type, filename, ...args);
  131. } else {
  132. console[type].apply(console, [...args, filename]);
  133. }
  134. }
  135. function resolveEasycom(component, easycom) {
  136. return typeof component === "string" ? easycom : component;
  137. }
  138. const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) => {
  139. !vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
  140. };
  141. const onShow = /* @__PURE__ */ createHook(ON_SHOW);
  142. const onHide = /* @__PURE__ */ createHook(ON_HIDE);
  143. const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
  144. const onUnload = /* @__PURE__ */ createHook(ON_UNLOAD);
  145. const onBackPress = /* @__PURE__ */ createHook(ON_BACK_PRESS);
  146. const onNavigationBarButtonTap = /* @__PURE__ */ createHook(ON_NAVIGATION_BAR_BUTTON_TAP);
  147. const _sfc_main$E = {
  148. name: "UniGrid",
  149. emits: ["change"],
  150. props: {
  151. // 每列显示个数
  152. column: {
  153. type: Number,
  154. default: 3
  155. },
  156. // 是否显示边框
  157. showBorder: {
  158. type: Boolean,
  159. default: true
  160. },
  161. // 边框颜色
  162. borderColor: {
  163. type: String,
  164. default: "#D2D2D2"
  165. },
  166. // 是否正方形显示,默认为 true
  167. square: {
  168. type: Boolean,
  169. default: true
  170. },
  171. highlight: {
  172. type: Boolean,
  173. default: true
  174. }
  175. },
  176. provide() {
  177. return {
  178. grid: this
  179. };
  180. },
  181. data() {
  182. const elId = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
  183. return {
  184. elId,
  185. width: 0
  186. };
  187. },
  188. created() {
  189. this.children = [];
  190. },
  191. mounted() {
  192. this.$nextTick(() => {
  193. this.init();
  194. });
  195. },
  196. methods: {
  197. init() {
  198. setTimeout(() => {
  199. this._getSize((width) => {
  200. this.children.forEach((item, index) => {
  201. item.width = width;
  202. });
  203. });
  204. }, 50);
  205. },
  206. change(e2) {
  207. this.$emit("change", e2);
  208. },
  209. _getSize(fn) {
  210. uni.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((ret) => {
  211. this.width = parseInt((ret[0].width - 1) / this.column) + "px";
  212. fn(this.width);
  213. });
  214. }
  215. }
  216. };
  217. function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
  218. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-grid-wrap" }, [
  219. vue.createElementVNode("view", {
  220. id: $data.elId,
  221. ref: "uni-grid",
  222. class: vue.normalizeClass(["uni-grid", { "uni-grid--border": $props.showBorder }]),
  223. style: vue.normalizeStyle({ "border-left-color": $props.borderColor })
  224. }, [
  225. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  226. ], 14, ["id"])
  227. ]);
  228. }
  229. const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$D], ["__scopeId", "data-v-07acefee"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-grid/components/uni-grid/uni-grid.vue"]]);
  230. const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
  231. __name: "index",
  232. setup(__props, { expose: __expose }) {
  233. __expose();
  234. const token = vue.ref(null);
  235. const user = vue.ref(null);
  236. const list = vue.ref([
  237. // {
  238. // url: '/pages/scan/index',
  239. // src: '/static/scan_fill.png',
  240. // text: '扫描入库'
  241. // },
  242. {
  243. url: "/pages/inbound/index",
  244. src: "/static/inbound.png",
  245. text: "入库"
  246. },
  247. {
  248. url: "/pages/weigh/index",
  249. src: "/static/weigh.png",
  250. text: "称重"
  251. },
  252. {
  253. url: "/pages/outbound/index",
  254. src: "/static/outbound.png",
  255. text: "出库"
  256. },
  257. {
  258. url: "/pages/warehouseScan/index",
  259. src: "/static/houscan.png",
  260. text: "仓库扫描"
  261. },
  262. {
  263. url: "/pages/printer/index",
  264. src: "/static/print.png",
  265. text: "打印"
  266. },
  267. {
  268. url: "/pages/scanLotno/index",
  269. src: "/static/link.png",
  270. text: "托盘/批次"
  271. },
  272. {
  273. url: "/pages/waybillNo/index",
  274. src: "/static/link.png",
  275. text: "库位绑定"
  276. }
  277. ]);
  278. onShow(() => {
  279. token.value = uni.getStorageSync("token");
  280. user.value = uni.getStorageSync("user");
  281. formatAppLog("log", "at pages/home/index.vue:72", "show---", { token: token.value, user: user.value });
  282. });
  283. const itemClick = (url) => {
  284. formatAppLog("log", "at pages/home/index.vue:75", url);
  285. if (token.value) {
  286. uni.navigateTo({
  287. url
  288. });
  289. } else {
  290. uni.navigateTo({
  291. url: "/pages/login/index"
  292. });
  293. }
  294. };
  295. const change = () => {
  296. };
  297. const logout = () => {
  298. uni.removeStorageSync("token");
  299. uni.removeStorageSync("user");
  300. token.value = uni.getStorageSync("token");
  301. user.value = uni.getStorageSync("user");
  302. };
  303. const __returned__ = { token, user, list, itemClick, change, logout };
  304. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  305. return __returned__;
  306. }
  307. });
  308. function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
  309. const _component_uni_grid_item = resolveEasycom(vue.resolveDynamicComponent("uni-grid-item"), __easycom_0$7);
  310. const _component_uni_grid = resolveEasycom(vue.resolveDynamicComponent("uni-grid"), __easycom_1$2);
  311. return vue.openBlock(), vue.createElementBlock("view", { class: "warp" }, [
  312. vue.createVNode(_component_uni_grid, {
  313. class: "grid",
  314. column: 3,
  315. "show-border": false,
  316. square: false,
  317. onChange: $setup.change
  318. }, {
  319. default: vue.withCtx(() => [
  320. (vue.openBlock(true), vue.createElementBlock(
  321. vue.Fragment,
  322. null,
  323. vue.renderList($setup.list, (item, index) => {
  324. return vue.openBlock(), vue.createBlock(_component_uni_grid_item, {
  325. index,
  326. key: index
  327. }, {
  328. default: vue.withCtx(() => [
  329. vue.createElementVNode("view", {
  330. class: "grid-item-box",
  331. onClick: ($event) => $setup.itemClick(item.url)
  332. }, [
  333. vue.createElementVNode("image", {
  334. class: "image",
  335. src: item.src,
  336. mode: "aspectFill"
  337. }, null, 8, ["src"]),
  338. vue.createElementVNode(
  339. "text",
  340. { class: "text" },
  341. vue.toDisplayString(item.text),
  342. 1
  343. /* TEXT */
  344. )
  345. ], 8, ["onClick"])
  346. ]),
  347. _: 2
  348. /* DYNAMIC */
  349. }, 1032, ["index"]);
  350. }),
  351. 128
  352. /* KEYED_FRAGMENT */
  353. ))
  354. ]),
  355. _: 1
  356. /* STABLE */
  357. })
  358. ]);
  359. }
  360. const PagesHomeIndex = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$C], ["__file", "E:/HBuilderProjects/yta/pages/home/index.vue"]]);
  361. const fontData = [
  362. {
  363. "font_class": "arrow-down",
  364. "unicode": ""
  365. },
  366. {
  367. "font_class": "arrow-left",
  368. "unicode": ""
  369. },
  370. {
  371. "font_class": "arrow-right",
  372. "unicode": ""
  373. },
  374. {
  375. "font_class": "arrow-up",
  376. "unicode": ""
  377. },
  378. {
  379. "font_class": "auth",
  380. "unicode": ""
  381. },
  382. {
  383. "font_class": "auth-filled",
  384. "unicode": ""
  385. },
  386. {
  387. "font_class": "back",
  388. "unicode": ""
  389. },
  390. {
  391. "font_class": "bars",
  392. "unicode": ""
  393. },
  394. {
  395. "font_class": "calendar",
  396. "unicode": ""
  397. },
  398. {
  399. "font_class": "calendar-filled",
  400. "unicode": ""
  401. },
  402. {
  403. "font_class": "camera",
  404. "unicode": ""
  405. },
  406. {
  407. "font_class": "camera-filled",
  408. "unicode": ""
  409. },
  410. {
  411. "font_class": "cart",
  412. "unicode": ""
  413. },
  414. {
  415. "font_class": "cart-filled",
  416. "unicode": ""
  417. },
  418. {
  419. "font_class": "chat",
  420. "unicode": ""
  421. },
  422. {
  423. "font_class": "chat-filled",
  424. "unicode": ""
  425. },
  426. {
  427. "font_class": "chatboxes",
  428. "unicode": ""
  429. },
  430. {
  431. "font_class": "chatboxes-filled",
  432. "unicode": ""
  433. },
  434. {
  435. "font_class": "chatbubble",
  436. "unicode": ""
  437. },
  438. {
  439. "font_class": "chatbubble-filled",
  440. "unicode": ""
  441. },
  442. {
  443. "font_class": "checkbox",
  444. "unicode": ""
  445. },
  446. {
  447. "font_class": "checkbox-filled",
  448. "unicode": ""
  449. },
  450. {
  451. "font_class": "checkmarkempty",
  452. "unicode": ""
  453. },
  454. {
  455. "font_class": "circle",
  456. "unicode": ""
  457. },
  458. {
  459. "font_class": "circle-filled",
  460. "unicode": ""
  461. },
  462. {
  463. "font_class": "clear",
  464. "unicode": ""
  465. },
  466. {
  467. "font_class": "close",
  468. "unicode": ""
  469. },
  470. {
  471. "font_class": "closeempty",
  472. "unicode": ""
  473. },
  474. {
  475. "font_class": "cloud-download",
  476. "unicode": ""
  477. },
  478. {
  479. "font_class": "cloud-download-filled",
  480. "unicode": ""
  481. },
  482. {
  483. "font_class": "cloud-upload",
  484. "unicode": ""
  485. },
  486. {
  487. "font_class": "cloud-upload-filled",
  488. "unicode": ""
  489. },
  490. {
  491. "font_class": "color",
  492. "unicode": ""
  493. },
  494. {
  495. "font_class": "color-filled",
  496. "unicode": ""
  497. },
  498. {
  499. "font_class": "compose",
  500. "unicode": ""
  501. },
  502. {
  503. "font_class": "contact",
  504. "unicode": ""
  505. },
  506. {
  507. "font_class": "contact-filled",
  508. "unicode": ""
  509. },
  510. {
  511. "font_class": "down",
  512. "unicode": ""
  513. },
  514. {
  515. "font_class": "bottom",
  516. "unicode": ""
  517. },
  518. {
  519. "font_class": "download",
  520. "unicode": ""
  521. },
  522. {
  523. "font_class": "download-filled",
  524. "unicode": ""
  525. },
  526. {
  527. "font_class": "email",
  528. "unicode": ""
  529. },
  530. {
  531. "font_class": "email-filled",
  532. "unicode": ""
  533. },
  534. {
  535. "font_class": "eye",
  536. "unicode": ""
  537. },
  538. {
  539. "font_class": "eye-filled",
  540. "unicode": ""
  541. },
  542. {
  543. "font_class": "eye-slash",
  544. "unicode": ""
  545. },
  546. {
  547. "font_class": "eye-slash-filled",
  548. "unicode": ""
  549. },
  550. {
  551. "font_class": "fire",
  552. "unicode": ""
  553. },
  554. {
  555. "font_class": "fire-filled",
  556. "unicode": ""
  557. },
  558. {
  559. "font_class": "flag",
  560. "unicode": ""
  561. },
  562. {
  563. "font_class": "flag-filled",
  564. "unicode": ""
  565. },
  566. {
  567. "font_class": "folder-add",
  568. "unicode": ""
  569. },
  570. {
  571. "font_class": "folder-add-filled",
  572. "unicode": ""
  573. },
  574. {
  575. "font_class": "font",
  576. "unicode": ""
  577. },
  578. {
  579. "font_class": "forward",
  580. "unicode": ""
  581. },
  582. {
  583. "font_class": "gear",
  584. "unicode": ""
  585. },
  586. {
  587. "font_class": "gear-filled",
  588. "unicode": ""
  589. },
  590. {
  591. "font_class": "gift",
  592. "unicode": ""
  593. },
  594. {
  595. "font_class": "gift-filled",
  596. "unicode": ""
  597. },
  598. {
  599. "font_class": "hand-down",
  600. "unicode": ""
  601. },
  602. {
  603. "font_class": "hand-down-filled",
  604. "unicode": ""
  605. },
  606. {
  607. "font_class": "hand-up",
  608. "unicode": ""
  609. },
  610. {
  611. "font_class": "hand-up-filled",
  612. "unicode": ""
  613. },
  614. {
  615. "font_class": "headphones",
  616. "unicode": ""
  617. },
  618. {
  619. "font_class": "heart",
  620. "unicode": ""
  621. },
  622. {
  623. "font_class": "heart-filled",
  624. "unicode": ""
  625. },
  626. {
  627. "font_class": "help",
  628. "unicode": ""
  629. },
  630. {
  631. "font_class": "help-filled",
  632. "unicode": ""
  633. },
  634. {
  635. "font_class": "home",
  636. "unicode": ""
  637. },
  638. {
  639. "font_class": "home-filled",
  640. "unicode": ""
  641. },
  642. {
  643. "font_class": "image",
  644. "unicode": ""
  645. },
  646. {
  647. "font_class": "image-filled",
  648. "unicode": ""
  649. },
  650. {
  651. "font_class": "images",
  652. "unicode": ""
  653. },
  654. {
  655. "font_class": "images-filled",
  656. "unicode": ""
  657. },
  658. {
  659. "font_class": "info",
  660. "unicode": ""
  661. },
  662. {
  663. "font_class": "info-filled",
  664. "unicode": ""
  665. },
  666. {
  667. "font_class": "left",
  668. "unicode": ""
  669. },
  670. {
  671. "font_class": "link",
  672. "unicode": ""
  673. },
  674. {
  675. "font_class": "list",
  676. "unicode": ""
  677. },
  678. {
  679. "font_class": "location",
  680. "unicode": ""
  681. },
  682. {
  683. "font_class": "location-filled",
  684. "unicode": ""
  685. },
  686. {
  687. "font_class": "locked",
  688. "unicode": ""
  689. },
  690. {
  691. "font_class": "locked-filled",
  692. "unicode": ""
  693. },
  694. {
  695. "font_class": "loop",
  696. "unicode": ""
  697. },
  698. {
  699. "font_class": "mail-open",
  700. "unicode": ""
  701. },
  702. {
  703. "font_class": "mail-open-filled",
  704. "unicode": ""
  705. },
  706. {
  707. "font_class": "map",
  708. "unicode": ""
  709. },
  710. {
  711. "font_class": "map-filled",
  712. "unicode": ""
  713. },
  714. {
  715. "font_class": "map-pin",
  716. "unicode": ""
  717. },
  718. {
  719. "font_class": "map-pin-ellipse",
  720. "unicode": ""
  721. },
  722. {
  723. "font_class": "medal",
  724. "unicode": ""
  725. },
  726. {
  727. "font_class": "medal-filled",
  728. "unicode": ""
  729. },
  730. {
  731. "font_class": "mic",
  732. "unicode": ""
  733. },
  734. {
  735. "font_class": "mic-filled",
  736. "unicode": ""
  737. },
  738. {
  739. "font_class": "micoff",
  740. "unicode": ""
  741. },
  742. {
  743. "font_class": "micoff-filled",
  744. "unicode": ""
  745. },
  746. {
  747. "font_class": "minus",
  748. "unicode": ""
  749. },
  750. {
  751. "font_class": "minus-filled",
  752. "unicode": ""
  753. },
  754. {
  755. "font_class": "more",
  756. "unicode": ""
  757. },
  758. {
  759. "font_class": "more-filled",
  760. "unicode": ""
  761. },
  762. {
  763. "font_class": "navigate",
  764. "unicode": ""
  765. },
  766. {
  767. "font_class": "navigate-filled",
  768. "unicode": ""
  769. },
  770. {
  771. "font_class": "notification",
  772. "unicode": ""
  773. },
  774. {
  775. "font_class": "notification-filled",
  776. "unicode": ""
  777. },
  778. {
  779. "font_class": "paperclip",
  780. "unicode": ""
  781. },
  782. {
  783. "font_class": "paperplane",
  784. "unicode": ""
  785. },
  786. {
  787. "font_class": "paperplane-filled",
  788. "unicode": ""
  789. },
  790. {
  791. "font_class": "person",
  792. "unicode": ""
  793. },
  794. {
  795. "font_class": "person-filled",
  796. "unicode": ""
  797. },
  798. {
  799. "font_class": "personadd",
  800. "unicode": ""
  801. },
  802. {
  803. "font_class": "personadd-filled",
  804. "unicode": ""
  805. },
  806. {
  807. "font_class": "personadd-filled-copy",
  808. "unicode": ""
  809. },
  810. {
  811. "font_class": "phone",
  812. "unicode": ""
  813. },
  814. {
  815. "font_class": "phone-filled",
  816. "unicode": ""
  817. },
  818. {
  819. "font_class": "plus",
  820. "unicode": ""
  821. },
  822. {
  823. "font_class": "plus-filled",
  824. "unicode": ""
  825. },
  826. {
  827. "font_class": "plusempty",
  828. "unicode": ""
  829. },
  830. {
  831. "font_class": "pulldown",
  832. "unicode": ""
  833. },
  834. {
  835. "font_class": "pyq",
  836. "unicode": ""
  837. },
  838. {
  839. "font_class": "qq",
  840. "unicode": ""
  841. },
  842. {
  843. "font_class": "redo",
  844. "unicode": ""
  845. },
  846. {
  847. "font_class": "redo-filled",
  848. "unicode": ""
  849. },
  850. {
  851. "font_class": "refresh",
  852. "unicode": ""
  853. },
  854. {
  855. "font_class": "refresh-filled",
  856. "unicode": ""
  857. },
  858. {
  859. "font_class": "refreshempty",
  860. "unicode": ""
  861. },
  862. {
  863. "font_class": "reload",
  864. "unicode": ""
  865. },
  866. {
  867. "font_class": "right",
  868. "unicode": ""
  869. },
  870. {
  871. "font_class": "scan",
  872. "unicode": ""
  873. },
  874. {
  875. "font_class": "search",
  876. "unicode": ""
  877. },
  878. {
  879. "font_class": "settings",
  880. "unicode": ""
  881. },
  882. {
  883. "font_class": "settings-filled",
  884. "unicode": ""
  885. },
  886. {
  887. "font_class": "shop",
  888. "unicode": ""
  889. },
  890. {
  891. "font_class": "shop-filled",
  892. "unicode": ""
  893. },
  894. {
  895. "font_class": "smallcircle",
  896. "unicode": ""
  897. },
  898. {
  899. "font_class": "smallcircle-filled",
  900. "unicode": ""
  901. },
  902. {
  903. "font_class": "sound",
  904. "unicode": ""
  905. },
  906. {
  907. "font_class": "sound-filled",
  908. "unicode": ""
  909. },
  910. {
  911. "font_class": "spinner-cycle",
  912. "unicode": ""
  913. },
  914. {
  915. "font_class": "staff",
  916. "unicode": ""
  917. },
  918. {
  919. "font_class": "staff-filled",
  920. "unicode": ""
  921. },
  922. {
  923. "font_class": "star",
  924. "unicode": ""
  925. },
  926. {
  927. "font_class": "star-filled",
  928. "unicode": ""
  929. },
  930. {
  931. "font_class": "starhalf",
  932. "unicode": ""
  933. },
  934. {
  935. "font_class": "trash",
  936. "unicode": ""
  937. },
  938. {
  939. "font_class": "trash-filled",
  940. "unicode": ""
  941. },
  942. {
  943. "font_class": "tune",
  944. "unicode": ""
  945. },
  946. {
  947. "font_class": "tune-filled",
  948. "unicode": ""
  949. },
  950. {
  951. "font_class": "undo",
  952. "unicode": ""
  953. },
  954. {
  955. "font_class": "undo-filled",
  956. "unicode": ""
  957. },
  958. {
  959. "font_class": "up",
  960. "unicode": ""
  961. },
  962. {
  963. "font_class": "top",
  964. "unicode": ""
  965. },
  966. {
  967. "font_class": "upload",
  968. "unicode": ""
  969. },
  970. {
  971. "font_class": "upload-filled",
  972. "unicode": ""
  973. },
  974. {
  975. "font_class": "videocam",
  976. "unicode": ""
  977. },
  978. {
  979. "font_class": "videocam-filled",
  980. "unicode": ""
  981. },
  982. {
  983. "font_class": "vip",
  984. "unicode": ""
  985. },
  986. {
  987. "font_class": "vip-filled",
  988. "unicode": ""
  989. },
  990. {
  991. "font_class": "wallet",
  992. "unicode": ""
  993. },
  994. {
  995. "font_class": "wallet-filled",
  996. "unicode": ""
  997. },
  998. {
  999. "font_class": "weibo",
  1000. "unicode": ""
  1001. },
  1002. {
  1003. "font_class": "weixin",
  1004. "unicode": ""
  1005. }
  1006. ];
  1007. const getVal = (val) => {
  1008. const reg = /^[0-9]*$/g;
  1009. return typeof val === "number" || reg.test(val) ? val + "px" : val;
  1010. };
  1011. const _sfc_main$C = {
  1012. name: "UniIcons",
  1013. emits: ["click"],
  1014. props: {
  1015. type: {
  1016. type: String,
  1017. default: ""
  1018. },
  1019. color: {
  1020. type: String,
  1021. default: "#333333"
  1022. },
  1023. size: {
  1024. type: [Number, String],
  1025. default: 16
  1026. },
  1027. customPrefix: {
  1028. type: String,
  1029. default: ""
  1030. },
  1031. fontFamily: {
  1032. type: String,
  1033. default: ""
  1034. }
  1035. },
  1036. data() {
  1037. return {
  1038. icons: fontData
  1039. };
  1040. },
  1041. computed: {
  1042. unicode() {
  1043. let code = this.icons.find((v2) => v2.font_class === this.type);
  1044. if (code) {
  1045. return code.unicode;
  1046. }
  1047. return "";
  1048. },
  1049. iconSize() {
  1050. return getVal(this.size);
  1051. },
  1052. styleObj() {
  1053. if (this.fontFamily !== "") {
  1054. return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`;
  1055. }
  1056. return `color: ${this.color}; font-size: ${this.iconSize};`;
  1057. }
  1058. },
  1059. methods: {
  1060. _onClick() {
  1061. this.$emit("click");
  1062. }
  1063. }
  1064. };
  1065. function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
  1066. return vue.openBlock(), vue.createElementBlock(
  1067. "text",
  1068. {
  1069. style: vue.normalizeStyle($options.styleObj),
  1070. class: vue.normalizeClass(["uni-icons", ["uniui-" + $props.type, $props.customPrefix, $props.customPrefix ? $props.type : ""]]),
  1071. onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
  1072. },
  1073. [
  1074. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  1075. ],
  1076. 6
  1077. /* CLASS, STYLE */
  1078. );
  1079. }
  1080. const __easycom_4 = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$B], ["__scopeId", "data-v-d31e1c47"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-icons/components/uni-icons/uni-icons.vue"]]);
  1081. function obj2strClass(obj) {
  1082. let classess = "";
  1083. for (let key in obj) {
  1084. const val = obj[key];
  1085. if (val) {
  1086. classess += `${key} `;
  1087. }
  1088. }
  1089. return classess;
  1090. }
  1091. function obj2strStyle(obj) {
  1092. let style = "";
  1093. for (let key in obj) {
  1094. const val = obj[key];
  1095. style += `${key}:${val};`;
  1096. }
  1097. return style;
  1098. }
  1099. const _sfc_main$B = {
  1100. name: "uni-easyinput",
  1101. emits: ["click", "iconClick", "update:modelValue", "input", "focus", "blur", "confirm", "clear", "eyes", "change", "keyboardheightchange"],
  1102. model: {
  1103. prop: "modelValue",
  1104. event: "update:modelValue"
  1105. },
  1106. options: {
  1107. virtualHost: true
  1108. },
  1109. inject: {
  1110. form: {
  1111. from: "uniForm",
  1112. default: null
  1113. },
  1114. formItem: {
  1115. from: "uniFormItem",
  1116. default: null
  1117. }
  1118. },
  1119. props: {
  1120. name: String,
  1121. value: [Number, String],
  1122. modelValue: [Number, String],
  1123. type: {
  1124. type: String,
  1125. default: "text"
  1126. },
  1127. clearable: {
  1128. type: Boolean,
  1129. default: true
  1130. },
  1131. autoHeight: {
  1132. type: Boolean,
  1133. default: false
  1134. },
  1135. placeholder: {
  1136. type: String,
  1137. default: " "
  1138. },
  1139. placeholderStyle: String,
  1140. focus: {
  1141. type: Boolean,
  1142. default: false
  1143. },
  1144. disabled: {
  1145. type: Boolean,
  1146. default: false
  1147. },
  1148. maxlength: {
  1149. type: [Number, String],
  1150. default: 140
  1151. },
  1152. confirmType: {
  1153. type: String,
  1154. default: "done"
  1155. },
  1156. clearSize: {
  1157. type: [Number, String],
  1158. default: 24
  1159. },
  1160. inputBorder: {
  1161. type: Boolean,
  1162. default: true
  1163. },
  1164. prefixIcon: {
  1165. type: String,
  1166. default: ""
  1167. },
  1168. suffixIcon: {
  1169. type: String,
  1170. default: ""
  1171. },
  1172. trim: {
  1173. type: [Boolean, String],
  1174. default: false
  1175. },
  1176. cursorSpacing: {
  1177. type: Number,
  1178. default: 0
  1179. },
  1180. passwordIcon: {
  1181. type: Boolean,
  1182. default: true
  1183. },
  1184. primaryColor: {
  1185. type: String,
  1186. default: "#2979ff"
  1187. },
  1188. styles: {
  1189. type: Object,
  1190. default() {
  1191. return {
  1192. color: "#333",
  1193. backgroundColor: "#fff",
  1194. disableColor: "#F7F6F6",
  1195. borderColor: "#e5e5e5"
  1196. };
  1197. }
  1198. },
  1199. errorMessage: {
  1200. type: [String, Boolean],
  1201. default: ""
  1202. }
  1203. },
  1204. data() {
  1205. return {
  1206. focused: false,
  1207. val: "",
  1208. showMsg: "",
  1209. border: false,
  1210. isFirstBorder: false,
  1211. showClearIcon: false,
  1212. showPassword: false,
  1213. focusShow: false,
  1214. localMsg: "",
  1215. isEnter: false
  1216. // 用于判断当前是否是使用回车操作
  1217. };
  1218. },
  1219. computed: {
  1220. // 输入框内是否有值
  1221. isVal() {
  1222. const val = this.val;
  1223. if (val || val === 0) {
  1224. return true;
  1225. }
  1226. return false;
  1227. },
  1228. msg() {
  1229. return this.localMsg || this.errorMessage;
  1230. },
  1231. // 因为uniapp的input组件的maxlength组件必须要数值,这里转为数值,用户可以传入字符串数值
  1232. inputMaxlength() {
  1233. return Number(this.maxlength);
  1234. },
  1235. // 处理外层样式的style
  1236. boxStyle() {
  1237. return `color:${this.inputBorder && this.msg ? "#e43d33" : this.styles.color};`;
  1238. },
  1239. // input 内容的类和样式处理
  1240. inputContentClass() {
  1241. return obj2strClass({
  1242. "is-input-border": this.inputBorder,
  1243. "is-input-error-border": this.inputBorder && this.msg,
  1244. "is-textarea": this.type === "textarea",
  1245. "is-disabled": this.disabled,
  1246. "is-focused": this.focusShow
  1247. });
  1248. },
  1249. inputContentStyle() {
  1250. const focusColor = this.focusShow ? this.primaryColor : this.styles.borderColor;
  1251. const borderColor = this.inputBorder && this.msg ? "#dd524d" : focusColor;
  1252. return obj2strStyle({
  1253. "border-color": borderColor || "#e5e5e5",
  1254. "background-color": this.disabled ? this.styles.disableColor : this.styles.backgroundColor
  1255. });
  1256. },
  1257. // input右侧样式
  1258. inputStyle() {
  1259. const paddingRight = this.type === "password" || this.clearable || this.prefixIcon ? "" : "10px";
  1260. return obj2strStyle({
  1261. "padding-right": paddingRight,
  1262. "padding-left": this.prefixIcon ? "" : "10px"
  1263. });
  1264. }
  1265. },
  1266. watch: {
  1267. value(newVal) {
  1268. this.val = newVal;
  1269. },
  1270. modelValue(newVal) {
  1271. this.val = newVal;
  1272. },
  1273. focus(newVal) {
  1274. this.$nextTick(() => {
  1275. this.focused = this.focus;
  1276. this.focusShow = this.focus;
  1277. });
  1278. }
  1279. },
  1280. created() {
  1281. this.init();
  1282. if (this.form && this.formItem) {
  1283. this.$watch("formItem.errMsg", (newVal) => {
  1284. this.localMsg = newVal;
  1285. });
  1286. }
  1287. },
  1288. mounted() {
  1289. this.$nextTick(() => {
  1290. this.focused = this.focus;
  1291. this.focusShow = this.focus;
  1292. });
  1293. },
  1294. methods: {
  1295. /**
  1296. * 初始化变量值
  1297. */
  1298. init() {
  1299. if (this.value || this.value === 0) {
  1300. this.val = this.value;
  1301. } else if (this.modelValue || this.modelValue === 0 || this.modelValue === "") {
  1302. this.val = this.modelValue;
  1303. } else {
  1304. this.val = null;
  1305. }
  1306. },
  1307. /**
  1308. * 点击图标时触发
  1309. * @param {Object} type
  1310. */
  1311. onClickIcon(type) {
  1312. this.$emit("iconClick", type);
  1313. },
  1314. /**
  1315. * 显示隐藏内容,密码框时生效
  1316. */
  1317. onEyes() {
  1318. this.showPassword = !this.showPassword;
  1319. this.$emit("eyes", this.showPassword);
  1320. },
  1321. /**
  1322. * 输入时触发
  1323. * @param {Object} event
  1324. */
  1325. onInput(event) {
  1326. let value = event.detail.value;
  1327. if (this.trim) {
  1328. if (typeof this.trim === "boolean" && this.trim) {
  1329. value = this.trimStr(value);
  1330. }
  1331. if (typeof this.trim === "string") {
  1332. value = this.trimStr(value, this.trim);
  1333. }
  1334. }
  1335. if (this.errMsg)
  1336. this.errMsg = "";
  1337. this.val = value;
  1338. this.$emit("input", value);
  1339. this.$emit("update:modelValue", value);
  1340. },
  1341. /**
  1342. * 外部调用方法
  1343. * 获取焦点时触发
  1344. * @param {Object} event
  1345. */
  1346. onFocus() {
  1347. this.$nextTick(() => {
  1348. this.focused = true;
  1349. });
  1350. this.$emit("focus", null);
  1351. },
  1352. _Focus(event) {
  1353. this.focusShow = true;
  1354. this.$emit("focus", event);
  1355. },
  1356. /**
  1357. * 外部调用方法
  1358. * 失去焦点时触发
  1359. * @param {Object} event
  1360. */
  1361. onBlur() {
  1362. this.focused = false;
  1363. this.$emit("focus", null);
  1364. },
  1365. _Blur(event) {
  1366. event.detail.value;
  1367. this.focusShow = false;
  1368. this.$emit("blur", event);
  1369. if (this.isEnter === false) {
  1370. this.$emit("change", this.val);
  1371. }
  1372. if (this.form && this.formItem) {
  1373. const { validateTrigger } = this.form;
  1374. if (validateTrigger === "blur") {
  1375. this.formItem.onFieldChange();
  1376. }
  1377. }
  1378. },
  1379. /**
  1380. * 按下键盘的发送键
  1381. * @param {Object} e
  1382. */
  1383. onConfirm(e2) {
  1384. this.$emit("confirm", this.val);
  1385. this.isEnter = true;
  1386. this.$emit("change", this.val);
  1387. this.$nextTick(() => {
  1388. this.isEnter = false;
  1389. });
  1390. },
  1391. /**
  1392. * 清理内容
  1393. * @param {Object} event
  1394. */
  1395. onClear(event) {
  1396. this.val = "";
  1397. this.$emit("input", "");
  1398. this.$emit("update:modelValue", "");
  1399. this.$emit("clear");
  1400. },
  1401. /**
  1402. * 键盘高度发生变化的时候触发此事件
  1403. * 兼容性:微信小程序2.7.0+、App 3.1.0+
  1404. * @param {Object} event
  1405. */
  1406. onkeyboardheightchange(event) {
  1407. this.$emit("keyboardheightchange", event);
  1408. },
  1409. /**
  1410. * 去除空格
  1411. */
  1412. trimStr(str, pos = "both") {
  1413. if (pos === "both") {
  1414. return str.trim();
  1415. } else if (pos === "left") {
  1416. return str.trimLeft();
  1417. } else if (pos === "right") {
  1418. return str.trimRight();
  1419. } else if (pos === "start") {
  1420. return str.trimStart();
  1421. } else if (pos === "end") {
  1422. return str.trimEnd();
  1423. } else if (pos === "all") {
  1424. return str.replace(/\s+/g, "");
  1425. } else if (pos === "none") {
  1426. return str;
  1427. }
  1428. return str;
  1429. }
  1430. }
  1431. };
  1432. function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
  1433. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  1434. return vue.openBlock(), vue.createElementBlock(
  1435. "view",
  1436. {
  1437. class: vue.normalizeClass(["uni-easyinput", { "uni-easyinput-error": $options.msg }]),
  1438. style: vue.normalizeStyle($options.boxStyle)
  1439. },
  1440. [
  1441. vue.createElementVNode(
  1442. "view",
  1443. {
  1444. class: vue.normalizeClass(["uni-easyinput__content", $options.inputContentClass]),
  1445. style: vue.normalizeStyle($options.inputContentStyle)
  1446. },
  1447. [
  1448. $props.prefixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  1449. key: 0,
  1450. class: "content-clear-icon",
  1451. type: $props.prefixIcon,
  1452. color: "#c0c4cc",
  1453. onClick: _cache[0] || (_cache[0] = ($event) => $options.onClickIcon("prefix")),
  1454. size: "22"
  1455. }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true),
  1456. $props.type === "textarea" ? (vue.openBlock(), vue.createElementBlock("textarea", {
  1457. key: 1,
  1458. class: vue.normalizeClass(["uni-easyinput__content-textarea", { "input-padding": $props.inputBorder }]),
  1459. name: $props.name,
  1460. value: $data.val,
  1461. placeholder: $props.placeholder,
  1462. placeholderStyle: $props.placeholderStyle,
  1463. disabled: $props.disabled,
  1464. "placeholder-class": "uni-easyinput__placeholder-class",
  1465. maxlength: $options.inputMaxlength,
  1466. focus: $data.focused,
  1467. autoHeight: $props.autoHeight,
  1468. "cursor-spacing": $props.cursorSpacing,
  1469. onInput: _cache[1] || (_cache[1] = (...args) => $options.onInput && $options.onInput(...args)),
  1470. onBlur: _cache[2] || (_cache[2] = (...args) => $options._Blur && $options._Blur(...args)),
  1471. onFocus: _cache[3] || (_cache[3] = (...args) => $options._Focus && $options._Focus(...args)),
  1472. onConfirm: _cache[4] || (_cache[4] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
  1473. onKeyboardheightchange: _cache[5] || (_cache[5] = (...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
  1474. }, null, 42, ["name", "value", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "autoHeight", "cursor-spacing"])) : (vue.openBlock(), vue.createElementBlock("input", {
  1475. key: 2,
  1476. type: $props.type === "password" ? "text" : $props.type,
  1477. class: "uni-easyinput__content-input",
  1478. style: vue.normalizeStyle($options.inputStyle),
  1479. name: $props.name,
  1480. value: $data.val,
  1481. password: !$data.showPassword && $props.type === "password",
  1482. placeholder: $props.placeholder,
  1483. placeholderStyle: $props.placeholderStyle,
  1484. "placeholder-class": "uni-easyinput__placeholder-class",
  1485. disabled: $props.disabled,
  1486. maxlength: $options.inputMaxlength,
  1487. focus: $data.focused,
  1488. confirmType: $props.confirmType,
  1489. "cursor-spacing": $props.cursorSpacing,
  1490. onFocus: _cache[6] || (_cache[6] = (...args) => $options._Focus && $options._Focus(...args)),
  1491. onBlur: _cache[7] || (_cache[7] = (...args) => $options._Blur && $options._Blur(...args)),
  1492. onInput: _cache[8] || (_cache[8] = (...args) => $options.onInput && $options.onInput(...args)),
  1493. onConfirm: _cache[9] || (_cache[9] = (...args) => $options.onConfirm && $options.onConfirm(...args)),
  1494. onKeyboardheightchange: _cache[10] || (_cache[10] = (...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
  1495. }, null, 44, ["type", "name", "value", "password", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "confirmType", "cursor-spacing"])),
  1496. $props.type === "password" && $props.passwordIcon ? (vue.openBlock(), vue.createElementBlock(
  1497. vue.Fragment,
  1498. { key: 3 },
  1499. [
  1500. vue.createCommentVNode(" 开启密码时显示小眼睛 "),
  1501. $options.isVal ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  1502. key: 0,
  1503. class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
  1504. type: $data.showPassword ? "eye-slash-filled" : "eye-filled",
  1505. size: 22,
  1506. color: $data.focusShow ? $props.primaryColor : "#c0c4cc",
  1507. onClick: $options.onEyes
  1508. }, null, 8, ["class", "type", "color", "onClick"])) : vue.createCommentVNode("v-if", true)
  1509. ],
  1510. 64
  1511. /* STABLE_FRAGMENT */
  1512. )) : $props.suffixIcon ? (vue.openBlock(), vue.createElementBlock(
  1513. vue.Fragment,
  1514. { key: 4 },
  1515. [
  1516. $props.suffixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  1517. key: 0,
  1518. class: "content-clear-icon",
  1519. type: $props.suffixIcon,
  1520. color: "#c0c4cc",
  1521. onClick: _cache[11] || (_cache[11] = ($event) => $options.onClickIcon("suffix")),
  1522. size: "22"
  1523. }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true)
  1524. ],
  1525. 64
  1526. /* STABLE_FRAGMENT */
  1527. )) : (vue.openBlock(), vue.createElementBlock(
  1528. vue.Fragment,
  1529. { key: 5 },
  1530. [
  1531. $props.clearable && $options.isVal && !$props.disabled && $props.type !== "textarea" ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  1532. key: 0,
  1533. class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
  1534. type: "clear",
  1535. size: $props.clearSize,
  1536. color: $options.msg ? "#dd524d" : $data.focusShow ? $props.primaryColor : "#c0c4cc",
  1537. onClick: $options.onClear
  1538. }, null, 8, ["class", "size", "color", "onClick"])) : vue.createCommentVNode("v-if", true)
  1539. ],
  1540. 64
  1541. /* STABLE_FRAGMENT */
  1542. )),
  1543. vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
  1544. ],
  1545. 6
  1546. /* CLASS, STYLE */
  1547. )
  1548. ],
  1549. 6
  1550. /* CLASS, STYLE */
  1551. );
  1552. }
  1553. const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$A], ["__scopeId", "data-v-09fd5285"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue"]]);
  1554. const _sfc_main$A = {
  1555. name: "uniFormsItem",
  1556. options: {
  1557. virtualHost: true
  1558. },
  1559. provide() {
  1560. return {
  1561. uniFormItem: this
  1562. };
  1563. },
  1564. inject: {
  1565. form: {
  1566. from: "uniForm",
  1567. default: null
  1568. }
  1569. },
  1570. props: {
  1571. // 表单校验规则
  1572. rules: {
  1573. type: Array,
  1574. default() {
  1575. return null;
  1576. }
  1577. },
  1578. // 表单域的属性名,在使用校验规则时必填
  1579. name: {
  1580. type: [String, Array],
  1581. default: ""
  1582. },
  1583. required: {
  1584. type: Boolean,
  1585. default: false
  1586. },
  1587. label: {
  1588. type: String,
  1589. default: ""
  1590. },
  1591. // label的宽度
  1592. labelWidth: {
  1593. type: [String, Number],
  1594. default: ""
  1595. },
  1596. // label 居中方式,默认 left 取值 left/center/right
  1597. labelAlign: {
  1598. type: String,
  1599. default: ""
  1600. },
  1601. // 强制显示错误信息
  1602. errorMessage: {
  1603. type: [String, Boolean],
  1604. default: ""
  1605. },
  1606. // 1.4.0 弃用,统一使用 form 的校验时机
  1607. // validateTrigger: {
  1608. // type: String,
  1609. // default: ''
  1610. // },
  1611. // 1.4.0 弃用,统一使用 form 的label 位置
  1612. // labelPosition: {
  1613. // type: String,
  1614. // default: ''
  1615. // },
  1616. // 1.4.0 以下属性已经废弃,请使用 #label 插槽代替
  1617. leftIcon: String,
  1618. iconColor: {
  1619. type: String,
  1620. default: "#606266"
  1621. }
  1622. },
  1623. data() {
  1624. return {
  1625. errMsg: "",
  1626. userRules: null,
  1627. localLabelAlign: "left",
  1628. localLabelWidth: "70px",
  1629. localLabelPos: "left",
  1630. border: false,
  1631. isFirstBorder: false
  1632. };
  1633. },
  1634. computed: {
  1635. // 处理错误信息
  1636. msg() {
  1637. return this.errorMessage || this.errMsg;
  1638. }
  1639. },
  1640. watch: {
  1641. // 规则发生变化通知子组件更新
  1642. "form.formRules"(val) {
  1643. this.init();
  1644. },
  1645. "form.labelWidth"(val) {
  1646. this.localLabelWidth = this._labelWidthUnit(val);
  1647. },
  1648. "form.labelPosition"(val) {
  1649. this.localLabelPos = this._labelPosition();
  1650. },
  1651. "form.labelAlign"(val) {
  1652. }
  1653. },
  1654. created() {
  1655. this.init(true);
  1656. if (this.name && this.form) {
  1657. this.$watch(
  1658. () => {
  1659. const val = this.form._getDataValue(this.name, this.form.localData);
  1660. return val;
  1661. },
  1662. (value, oldVal) => {
  1663. const isEqual2 = this.form._isEqual(value, oldVal);
  1664. if (!isEqual2) {
  1665. const val = this.itemSetValue(value);
  1666. this.onFieldChange(val, false);
  1667. }
  1668. },
  1669. {
  1670. immediate: false
  1671. }
  1672. );
  1673. }
  1674. },
  1675. unmounted() {
  1676. this.__isUnmounted = true;
  1677. this.unInit();
  1678. },
  1679. methods: {
  1680. /**
  1681. * 外部调用方法
  1682. * 设置规则 ,主要用于小程序自定义检验规则
  1683. * @param {Array} rules 规则源数据
  1684. */
  1685. setRules(rules = null) {
  1686. this.userRules = rules;
  1687. this.init(false);
  1688. },
  1689. // 兼容老版本表单组件
  1690. setValue() {
  1691. },
  1692. /**
  1693. * 外部调用方法
  1694. * 校验数据
  1695. * @param {any} value 需要校验的数据
  1696. * @param {boolean} 是否立即校验
  1697. * @return {Array|null} 校验内容
  1698. */
  1699. async onFieldChange(value, formtrigger = true) {
  1700. const {
  1701. formData,
  1702. localData,
  1703. errShowType,
  1704. validateCheck,
  1705. validateTrigger,
  1706. _isRequiredField,
  1707. _realName
  1708. } = this.form;
  1709. const name = _realName(this.name);
  1710. if (!value) {
  1711. value = this.form.formData[name];
  1712. }
  1713. const ruleLen = this.itemRules.rules && this.itemRules.rules.length;
  1714. if (!this.validator || !ruleLen || ruleLen === 0)
  1715. return;
  1716. const isRequiredField2 = _isRequiredField(this.itemRules.rules || []);
  1717. let result = null;
  1718. if (validateTrigger === "bind" || formtrigger) {
  1719. result = await this.validator.validateUpdate(
  1720. {
  1721. [name]: value
  1722. },
  1723. formData
  1724. );
  1725. if (!isRequiredField2 && (value === void 0 || value === "")) {
  1726. result = null;
  1727. }
  1728. if (result && result.errorMessage) {
  1729. if (errShowType === "undertext") {
  1730. this.errMsg = !result ? "" : result.errorMessage;
  1731. }
  1732. if (errShowType === "toast") {
  1733. uni.showToast({
  1734. title: result.errorMessage || "校验错误",
  1735. icon: "none"
  1736. });
  1737. }
  1738. if (errShowType === "modal") {
  1739. uni.showModal({
  1740. title: "提示",
  1741. content: result.errorMessage || "校验错误"
  1742. });
  1743. }
  1744. } else {
  1745. this.errMsg = "";
  1746. }
  1747. validateCheck(result ? result : null);
  1748. } else {
  1749. this.errMsg = "";
  1750. }
  1751. return result ? result : null;
  1752. },
  1753. /**
  1754. * 初始组件数据
  1755. */
  1756. init(type = false) {
  1757. const {
  1758. validator,
  1759. formRules,
  1760. childrens,
  1761. formData,
  1762. localData,
  1763. _realName,
  1764. labelWidth,
  1765. _getDataValue,
  1766. _setDataValue
  1767. } = this.form || {};
  1768. this.localLabelAlign = this._justifyContent();
  1769. this.localLabelWidth = this._labelWidthUnit(labelWidth);
  1770. this.localLabelPos = this._labelPosition();
  1771. this.form && type && childrens.push(this);
  1772. if (!validator || !formRules)
  1773. return;
  1774. if (!this.form.isFirstBorder) {
  1775. this.form.isFirstBorder = true;
  1776. this.isFirstBorder = true;
  1777. }
  1778. if (this.group) {
  1779. if (!this.group.isFirstBorder) {
  1780. this.group.isFirstBorder = true;
  1781. this.isFirstBorder = true;
  1782. }
  1783. }
  1784. this.border = this.form.border;
  1785. const name = _realName(this.name);
  1786. const itemRule = this.userRules || this.rules;
  1787. if (typeof formRules === "object" && itemRule) {
  1788. formRules[name] = {
  1789. rules: itemRule
  1790. };
  1791. validator.updateSchema(formRules);
  1792. }
  1793. const itemRules = formRules[name] || {};
  1794. this.itemRules = itemRules;
  1795. this.validator = validator;
  1796. this.itemSetValue(_getDataValue(this.name, localData));
  1797. },
  1798. unInit() {
  1799. if (this.form) {
  1800. const {
  1801. childrens,
  1802. formData,
  1803. _realName
  1804. } = this.form;
  1805. childrens.forEach((item, index) => {
  1806. if (item === this) {
  1807. this.form.childrens.splice(index, 1);
  1808. delete formData[_realName(item.name)];
  1809. }
  1810. });
  1811. }
  1812. },
  1813. // 设置item 的值
  1814. itemSetValue(value) {
  1815. const name = this.form._realName(this.name);
  1816. const rules = this.itemRules.rules || [];
  1817. const val = this.form._getValue(name, value, rules);
  1818. this.form._setDataValue(name, this.form.formData, val);
  1819. return val;
  1820. },
  1821. /**
  1822. * 移除该表单项的校验结果
  1823. */
  1824. clearValidate() {
  1825. this.errMsg = "";
  1826. },
  1827. // 是否显示星号
  1828. _isRequired() {
  1829. return this.required;
  1830. },
  1831. // 处理对齐方式
  1832. _justifyContent() {
  1833. if (this.form) {
  1834. const {
  1835. labelAlign
  1836. } = this.form;
  1837. let labelAli = this.labelAlign ? this.labelAlign : labelAlign;
  1838. if (labelAli === "left")
  1839. return "flex-start";
  1840. if (labelAli === "center")
  1841. return "center";
  1842. if (labelAli === "right")
  1843. return "flex-end";
  1844. }
  1845. return "flex-start";
  1846. },
  1847. // 处理 label宽度单位 ,继承父元素的值
  1848. _labelWidthUnit(labelWidth) {
  1849. return this.num2px(this.labelWidth ? this.labelWidth : labelWidth || (this.label ? 70 : "auto"));
  1850. },
  1851. // 处理 label 位置
  1852. _labelPosition() {
  1853. if (this.form)
  1854. return this.form.labelPosition || "left";
  1855. return "left";
  1856. },
  1857. /**
  1858. * 触发时机
  1859. * @param {Object} rule 当前规则内时机
  1860. * @param {Object} itemRlue 当前组件时机
  1861. * @param {Object} parentRule 父组件时机
  1862. */
  1863. isTrigger(rule, itemRlue, parentRule) {
  1864. if (rule === "submit" || !rule) {
  1865. if (rule === void 0) {
  1866. if (itemRlue !== "bind") {
  1867. if (!itemRlue) {
  1868. return parentRule === "" ? "bind" : "submit";
  1869. }
  1870. return "submit";
  1871. }
  1872. return "bind";
  1873. }
  1874. return "submit";
  1875. }
  1876. return "bind";
  1877. },
  1878. num2px(num) {
  1879. if (typeof num === "number") {
  1880. return `${num}px`;
  1881. }
  1882. return num;
  1883. }
  1884. }
  1885. };
  1886. function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
  1887. return vue.openBlock(), vue.createElementBlock(
  1888. "view",
  1889. {
  1890. class: vue.normalizeClass(["uni-forms-item", ["is-direction-" + $data.localLabelPos, $data.border ? "uni-forms-item--border" : "", $data.border && $data.isFirstBorder ? "is-first-border" : ""]])
  1891. },
  1892. [
  1893. vue.renderSlot(_ctx.$slots, "label", {}, () => [
  1894. vue.createElementVNode(
  1895. "view",
  1896. {
  1897. class: vue.normalizeClass(["uni-forms-item__label", { "no-label": !$props.label && !$props.required }]),
  1898. style: vue.normalizeStyle({ width: $data.localLabelWidth, justifyContent: $data.localLabelAlign })
  1899. },
  1900. [
  1901. $props.required ? (vue.openBlock(), vue.createElementBlock("text", {
  1902. key: 0,
  1903. class: "is-required"
  1904. }, "*")) : vue.createCommentVNode("v-if", true),
  1905. vue.createElementVNode(
  1906. "text",
  1907. null,
  1908. vue.toDisplayString($props.label),
  1909. 1
  1910. /* TEXT */
  1911. )
  1912. ],
  1913. 6
  1914. /* CLASS, STYLE */
  1915. )
  1916. ], true),
  1917. vue.createElementVNode("view", { class: "uni-forms-item__content" }, [
  1918. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
  1919. vue.createElementVNode(
  1920. "view",
  1921. {
  1922. class: vue.normalizeClass(["uni-forms-item__error", { "msg--active": $options.msg }])
  1923. },
  1924. [
  1925. vue.createElementVNode(
  1926. "text",
  1927. null,
  1928. vue.toDisplayString($options.msg),
  1929. 1
  1930. /* TEXT */
  1931. )
  1932. ],
  1933. 2
  1934. /* CLASS */
  1935. )
  1936. ])
  1937. ],
  1938. 2
  1939. /* CLASS */
  1940. );
  1941. }
  1942. const __easycom_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$z], ["__scopeId", "data-v-462874dd"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue"]]);
  1943. var pattern = {
  1944. email: /^\S+?@\S+?\.\S+?$/,
  1945. 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]$/,
  1946. url: new RegExp(
  1947. "^(?!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]*)?$",
  1948. "i"
  1949. )
  1950. };
  1951. const FORMAT_MAPPING = {
  1952. "int": "integer",
  1953. "bool": "boolean",
  1954. "double": "number",
  1955. "long": "number",
  1956. "password": "string"
  1957. // "fileurls": 'array'
  1958. };
  1959. function formatMessage(args, resources = "") {
  1960. var defaultMessage = ["label"];
  1961. defaultMessage.forEach((item) => {
  1962. if (args[item] === void 0) {
  1963. args[item] = "";
  1964. }
  1965. });
  1966. let str = resources;
  1967. for (let key in args) {
  1968. let reg = new RegExp("{" + key + "}");
  1969. str = str.replace(reg, args[key]);
  1970. }
  1971. return str;
  1972. }
  1973. function isEmptyValue(value, type) {
  1974. if (value === void 0 || value === null) {
  1975. return true;
  1976. }
  1977. if (typeof value === "string" && !value) {
  1978. return true;
  1979. }
  1980. if (Array.isArray(value) && !value.length) {
  1981. return true;
  1982. }
  1983. if (type === "object" && !Object.keys(value).length) {
  1984. return true;
  1985. }
  1986. return false;
  1987. }
  1988. const types = {
  1989. integer(value) {
  1990. return types.number(value) && parseInt(value, 10) === value;
  1991. },
  1992. string(value) {
  1993. return typeof value === "string";
  1994. },
  1995. number(value) {
  1996. if (isNaN(value)) {
  1997. return false;
  1998. }
  1999. return typeof value === "number";
  2000. },
  2001. "boolean": function(value) {
  2002. return typeof value === "boolean";
  2003. },
  2004. "float": function(value) {
  2005. return types.number(value) && !types.integer(value);
  2006. },
  2007. array(value) {
  2008. return Array.isArray(value);
  2009. },
  2010. object(value) {
  2011. return typeof value === "object" && !types.array(value);
  2012. },
  2013. date(value) {
  2014. return value instanceof Date;
  2015. },
  2016. timestamp(value) {
  2017. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  2018. return false;
  2019. }
  2020. return true;
  2021. },
  2022. file(value) {
  2023. return typeof value.url === "string";
  2024. },
  2025. email(value) {
  2026. return typeof value === "string" && !!value.match(pattern.email) && value.length < 255;
  2027. },
  2028. url(value) {
  2029. return typeof value === "string" && !!value.match(pattern.url);
  2030. },
  2031. pattern(reg, value) {
  2032. try {
  2033. return new RegExp(reg).test(value);
  2034. } catch (e2) {
  2035. return false;
  2036. }
  2037. },
  2038. method(value) {
  2039. return typeof value === "function";
  2040. },
  2041. idcard(value) {
  2042. return typeof value === "string" && !!value.match(pattern.idcard);
  2043. },
  2044. "url-https"(value) {
  2045. return this.url(value) && value.startsWith("https://");
  2046. },
  2047. "url-scheme"(value) {
  2048. return value.startsWith("://");
  2049. },
  2050. "url-web"(value) {
  2051. return false;
  2052. }
  2053. };
  2054. class RuleValidator {
  2055. constructor(message) {
  2056. this._message = message;
  2057. }
  2058. async validateRule(fieldKey, fieldValue, value, data, allData) {
  2059. var result = null;
  2060. let rules = fieldValue.rules;
  2061. let hasRequired = rules.findIndex((item) => {
  2062. return item.required;
  2063. });
  2064. if (hasRequired < 0) {
  2065. if (value === null || value === void 0) {
  2066. return result;
  2067. }
  2068. if (typeof value === "string" && !value.length) {
  2069. return result;
  2070. }
  2071. }
  2072. var message = this._message;
  2073. if (rules === void 0) {
  2074. return message["default"];
  2075. }
  2076. for (var i2 = 0; i2 < rules.length; i2++) {
  2077. let rule = rules[i2];
  2078. let vt2 = this._getValidateType(rule);
  2079. Object.assign(rule, {
  2080. label: fieldValue.label || `["${fieldKey}"]`
  2081. });
  2082. if (RuleValidatorHelper[vt2]) {
  2083. result = RuleValidatorHelper[vt2](rule, value, message);
  2084. if (result != null) {
  2085. break;
  2086. }
  2087. }
  2088. if (rule.validateExpr) {
  2089. let now = Date.now();
  2090. let resultExpr = rule.validateExpr(value, allData, now);
  2091. if (resultExpr === false) {
  2092. result = this._getMessage(rule, rule.errorMessage || this._message["default"]);
  2093. break;
  2094. }
  2095. }
  2096. if (rule.validateFunction) {
  2097. result = await this.validateFunction(rule, value, data, allData, vt2);
  2098. if (result !== null) {
  2099. break;
  2100. }
  2101. }
  2102. }
  2103. if (result !== null) {
  2104. result = message.TAG + result;
  2105. }
  2106. return result;
  2107. }
  2108. async validateFunction(rule, value, data, allData, vt2) {
  2109. let result = null;
  2110. try {
  2111. let callbackMessage = null;
  2112. const res = await rule.validateFunction(rule, value, allData || data, (message) => {
  2113. callbackMessage = message;
  2114. });
  2115. if (callbackMessage || typeof res === "string" && res || res === false) {
  2116. result = this._getMessage(rule, callbackMessage || res, vt2);
  2117. }
  2118. } catch (e2) {
  2119. result = this._getMessage(rule, e2.message, vt2);
  2120. }
  2121. return result;
  2122. }
  2123. _getMessage(rule, message, vt2) {
  2124. return formatMessage(rule, message || rule.errorMessage || this._message[vt2] || message["default"]);
  2125. }
  2126. _getValidateType(rule) {
  2127. var result = "";
  2128. if (rule.required) {
  2129. result = "required";
  2130. } else if (rule.format) {
  2131. result = "format";
  2132. } else if (rule.arrayType) {
  2133. result = "arrayTypeFormat";
  2134. } else if (rule.range) {
  2135. result = "range";
  2136. } else if (rule.maximum !== void 0 || rule.minimum !== void 0) {
  2137. result = "rangeNumber";
  2138. } else if (rule.maxLength !== void 0 || rule.minLength !== void 0) {
  2139. result = "rangeLength";
  2140. } else if (rule.pattern) {
  2141. result = "pattern";
  2142. } else if (rule.validateFunction) {
  2143. result = "validateFunction";
  2144. }
  2145. return result;
  2146. }
  2147. }
  2148. const RuleValidatorHelper = {
  2149. required(rule, value, message) {
  2150. if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
  2151. return formatMessage(rule, rule.errorMessage || message.required);
  2152. }
  2153. return null;
  2154. },
  2155. range(rule, value, message) {
  2156. const {
  2157. range,
  2158. errorMessage
  2159. } = rule;
  2160. let list = new Array(range.length);
  2161. for (let i2 = 0; i2 < range.length; i2++) {
  2162. const item = range[i2];
  2163. if (types.object(item) && item.value !== void 0) {
  2164. list[i2] = item.value;
  2165. } else {
  2166. list[i2] = item;
  2167. }
  2168. }
  2169. let result = false;
  2170. if (Array.isArray(value)) {
  2171. result = new Set(value.concat(list)).size === list.length;
  2172. } else {
  2173. if (list.indexOf(value) > -1) {
  2174. result = true;
  2175. }
  2176. }
  2177. if (!result) {
  2178. return formatMessage(rule, errorMessage || message["enum"]);
  2179. }
  2180. return null;
  2181. },
  2182. rangeNumber(rule, value, message) {
  2183. if (!types.number(value)) {
  2184. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  2185. }
  2186. let {
  2187. minimum,
  2188. maximum,
  2189. exclusiveMinimum,
  2190. exclusiveMaximum
  2191. } = rule;
  2192. let min = exclusiveMinimum ? value <= minimum : value < minimum;
  2193. let max = exclusiveMaximum ? value >= maximum : value > maximum;
  2194. if (minimum !== void 0 && min) {
  2195. return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMinimum ? "exclusiveMinimum" : "minimum"]);
  2196. } else if (maximum !== void 0 && max) {
  2197. return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMaximum ? "exclusiveMaximum" : "maximum"]);
  2198. } else if (minimum !== void 0 && maximum !== void 0 && (min || max)) {
  2199. return formatMessage(rule, rule.errorMessage || message["number"].range);
  2200. }
  2201. return null;
  2202. },
  2203. rangeLength(rule, value, message) {
  2204. if (!types.string(value) && !types.array(value)) {
  2205. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  2206. }
  2207. let min = rule.minLength;
  2208. let max = rule.maxLength;
  2209. let val = value.length;
  2210. if (min !== void 0 && val < min) {
  2211. return formatMessage(rule, rule.errorMessage || message["length"].minLength);
  2212. } else if (max !== void 0 && val > max) {
  2213. return formatMessage(rule, rule.errorMessage || message["length"].maxLength);
  2214. } else if (min !== void 0 && max !== void 0 && (val < min || val > max)) {
  2215. return formatMessage(rule, rule.errorMessage || message["length"].range);
  2216. }
  2217. return null;
  2218. },
  2219. pattern(rule, value, message) {
  2220. if (!types["pattern"](rule.pattern, value)) {
  2221. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  2222. }
  2223. return null;
  2224. },
  2225. format(rule, value, message) {
  2226. var customTypes = Object.keys(types);
  2227. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  2228. if (customTypes.indexOf(format) > -1) {
  2229. if (!types[format](value)) {
  2230. return formatMessage(rule, rule.errorMessage || message.typeError);
  2231. }
  2232. }
  2233. return null;
  2234. },
  2235. arrayTypeFormat(rule, value, message) {
  2236. if (!Array.isArray(value)) {
  2237. return formatMessage(rule, rule.errorMessage || message.typeError);
  2238. }
  2239. for (let i2 = 0; i2 < value.length; i2++) {
  2240. const element = value[i2];
  2241. let formatResult = this.format(rule, element, message);
  2242. if (formatResult !== null) {
  2243. return formatResult;
  2244. }
  2245. }
  2246. return null;
  2247. }
  2248. };
  2249. class SchemaValidator extends RuleValidator {
  2250. constructor(schema, options) {
  2251. super(SchemaValidator.message);
  2252. this._schema = schema;
  2253. this._options = options || null;
  2254. }
  2255. updateSchema(schema) {
  2256. this._schema = schema;
  2257. }
  2258. async validate(data, allData) {
  2259. let result = this._checkFieldInSchema(data);
  2260. if (!result) {
  2261. result = await this.invokeValidate(data, false, allData);
  2262. }
  2263. return result.length ? result[0] : null;
  2264. }
  2265. async validateAll(data, allData) {
  2266. let result = this._checkFieldInSchema(data);
  2267. if (!result) {
  2268. result = await this.invokeValidate(data, true, allData);
  2269. }
  2270. return result;
  2271. }
  2272. async validateUpdate(data, allData) {
  2273. let result = this._checkFieldInSchema(data);
  2274. if (!result) {
  2275. result = await this.invokeValidateUpdate(data, false, allData);
  2276. }
  2277. return result.length ? result[0] : null;
  2278. }
  2279. async invokeValidate(data, all, allData) {
  2280. let result = [];
  2281. let schema = this._schema;
  2282. for (let key in schema) {
  2283. let value = schema[key];
  2284. let errorMessage = await this.validateRule(key, value, data[key], data, allData);
  2285. if (errorMessage != null) {
  2286. result.push({
  2287. key,
  2288. errorMessage
  2289. });
  2290. if (!all)
  2291. break;
  2292. }
  2293. }
  2294. return result;
  2295. }
  2296. async invokeValidateUpdate(data, all, allData) {
  2297. let result = [];
  2298. for (let key in data) {
  2299. let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData);
  2300. if (errorMessage != null) {
  2301. result.push({
  2302. key,
  2303. errorMessage
  2304. });
  2305. if (!all)
  2306. break;
  2307. }
  2308. }
  2309. return result;
  2310. }
  2311. _checkFieldInSchema(data) {
  2312. var keys = Object.keys(data);
  2313. var keys2 = Object.keys(this._schema);
  2314. if (new Set(keys.concat(keys2)).size === keys2.length) {
  2315. return "";
  2316. }
  2317. var noExistFields = keys.filter((key) => {
  2318. return keys2.indexOf(key) < 0;
  2319. });
  2320. var errorMessage = formatMessage({
  2321. field: JSON.stringify(noExistFields)
  2322. }, SchemaValidator.message.TAG + SchemaValidator.message["defaultInvalid"]);
  2323. return [{
  2324. key: "invalid",
  2325. errorMessage
  2326. }];
  2327. }
  2328. }
  2329. function Message() {
  2330. return {
  2331. TAG: "",
  2332. default: "验证错误",
  2333. defaultInvalid: "提交的字段{field}在数据库中并不存在",
  2334. validateFunction: "验证无效",
  2335. required: "{label}必填",
  2336. "enum": "{label}超出范围",
  2337. timestamp: "{label}格式无效",
  2338. whitespace: "{label}不能为空",
  2339. typeError: "{label}类型无效",
  2340. date: {
  2341. format: "{label}日期{value}格式无效",
  2342. parse: "{label}日期无法解析,{value}无效",
  2343. invalid: "{label}日期{value}无效"
  2344. },
  2345. length: {
  2346. minLength: "{label}长度不能少于{minLength}",
  2347. maxLength: "{label}长度不能超过{maxLength}",
  2348. range: "{label}必须介于{minLength}和{maxLength}之间"
  2349. },
  2350. number: {
  2351. minimum: "{label}不能小于{minimum}",
  2352. maximum: "{label}不能大于{maximum}",
  2353. exclusiveMinimum: "{label}不能小于等于{minimum}",
  2354. exclusiveMaximum: "{label}不能大于等于{maximum}",
  2355. range: "{label}必须介于{minimum}and{maximum}之间"
  2356. },
  2357. pattern: {
  2358. mismatch: "{label}格式不匹配"
  2359. }
  2360. };
  2361. }
  2362. SchemaValidator.message = new Message();
  2363. const deepCopy = (val) => {
  2364. return JSON.parse(JSON.stringify(val));
  2365. };
  2366. const typeFilter = (format) => {
  2367. return format === "int" || format === "double" || format === "number" || format === "timestamp";
  2368. };
  2369. const getValue = (key, value, rules) => {
  2370. const isRuleNumType = rules.find((val) => val.format && typeFilter(val.format));
  2371. const isRuleBoolType = rules.find((val) => val.format && val.format === "boolean" || val.format === "bool");
  2372. if (!!isRuleNumType) {
  2373. if (!value && value !== 0) {
  2374. value = null;
  2375. } else {
  2376. value = isNumber(Number(value)) ? Number(value) : value;
  2377. }
  2378. }
  2379. if (!!isRuleBoolType) {
  2380. value = isBoolean(value) ? value : false;
  2381. }
  2382. return value;
  2383. };
  2384. const setDataValue = (field, formdata, value) => {
  2385. formdata[field] = value;
  2386. return value || "";
  2387. };
  2388. const getDataValue = (field, data) => {
  2389. return objGet(data, field);
  2390. };
  2391. const realName = (name, data = {}) => {
  2392. const base_name = _basePath(name);
  2393. if (typeof base_name === "object" && Array.isArray(base_name) && base_name.length > 1) {
  2394. const realname = base_name.reduce((a2, b2) => a2 += `#${b2}`, "_formdata_");
  2395. return realname;
  2396. }
  2397. return base_name[0] || name;
  2398. };
  2399. const isRealName = (name) => {
  2400. const reg = /^_formdata_#*/;
  2401. return reg.test(name);
  2402. };
  2403. const rawData = (object = {}, name) => {
  2404. let newData = JSON.parse(JSON.stringify(object));
  2405. let formData = {};
  2406. for (let i2 in newData) {
  2407. let path = name2arr(i2);
  2408. objSet(formData, path, newData[i2]);
  2409. }
  2410. return formData;
  2411. };
  2412. const name2arr = (name) => {
  2413. let field = name.replace("_formdata_#", "");
  2414. field = field.split("#").map((v2) => isNumber(v2) ? Number(v2) : v2);
  2415. return field;
  2416. };
  2417. const objSet = (object, path, value) => {
  2418. if (typeof object !== "object")
  2419. return object;
  2420. _basePath(path).reduce((o2, k, i2, _2) => {
  2421. if (i2 === _2.length - 1) {
  2422. o2[k] = value;
  2423. return null;
  2424. } else if (k in o2) {
  2425. return o2[k];
  2426. } else {
  2427. o2[k] = /^[0-9]{1,}$/.test(_2[i2 + 1]) ? [] : {};
  2428. return o2[k];
  2429. }
  2430. }, object);
  2431. return object;
  2432. };
  2433. function _basePath(path) {
  2434. if (Array.isArray(path))
  2435. return path;
  2436. return path.replace(/\[/g, ".").replace(/\]/g, "").split(".");
  2437. }
  2438. const objGet = (object, path, defaultVal = "undefined") => {
  2439. let newPath = _basePath(path);
  2440. let val = newPath.reduce((o2, k) => {
  2441. return (o2 || {})[k];
  2442. }, object);
  2443. return !val || val !== void 0 ? val : defaultVal;
  2444. };
  2445. const isNumber = (num) => {
  2446. return !isNaN(Number(num));
  2447. };
  2448. const isBoolean = (bool) => {
  2449. return typeof bool === "boolean";
  2450. };
  2451. const isRequiredField = (rules) => {
  2452. let isNoField = false;
  2453. for (let i2 = 0; i2 < rules.length; i2++) {
  2454. const ruleData = rules[i2];
  2455. if (ruleData.required) {
  2456. isNoField = true;
  2457. break;
  2458. }
  2459. }
  2460. return isNoField;
  2461. };
  2462. const isEqual = (a2, b2) => {
  2463. if (a2 === b2) {
  2464. return a2 !== 0 || 1 / a2 === 1 / b2;
  2465. }
  2466. if (a2 == null || b2 == null) {
  2467. return a2 === b2;
  2468. }
  2469. var classNameA = toString.call(a2), classNameB = toString.call(b2);
  2470. if (classNameA !== classNameB) {
  2471. return false;
  2472. }
  2473. switch (classNameA) {
  2474. case "[object RegExp]":
  2475. case "[object String]":
  2476. return "" + a2 === "" + b2;
  2477. case "[object Number]":
  2478. if (+a2 !== +a2) {
  2479. return +b2 !== +b2;
  2480. }
  2481. return +a2 === 0 ? 1 / +a2 === 1 / b2 : +a2 === +b2;
  2482. case "[object Date]":
  2483. case "[object Boolean]":
  2484. return +a2 === +b2;
  2485. }
  2486. if (classNameA == "[object Object]") {
  2487. var propsA = Object.getOwnPropertyNames(a2), propsB = Object.getOwnPropertyNames(b2);
  2488. if (propsA.length != propsB.length) {
  2489. return false;
  2490. }
  2491. for (var i2 = 0; i2 < propsA.length; i2++) {
  2492. var propName = propsA[i2];
  2493. if (a2[propName] !== b2[propName]) {
  2494. return false;
  2495. }
  2496. }
  2497. return true;
  2498. }
  2499. if (classNameA == "[object Array]") {
  2500. if (a2.toString() == b2.toString()) {
  2501. return true;
  2502. }
  2503. return false;
  2504. }
  2505. };
  2506. const _sfc_main$z = {
  2507. name: "uniForms",
  2508. emits: ["validate", "submit"],
  2509. options: {
  2510. virtualHost: true
  2511. },
  2512. props: {
  2513. // 即将弃用
  2514. value: {
  2515. type: Object,
  2516. default() {
  2517. return null;
  2518. }
  2519. },
  2520. // vue3 替换 value 属性
  2521. modelValue: {
  2522. type: Object,
  2523. default() {
  2524. return null;
  2525. }
  2526. },
  2527. // 1.4.0 开始将不支持 v-model ,且废弃 value 和 modelValue
  2528. model: {
  2529. type: Object,
  2530. default() {
  2531. return null;
  2532. }
  2533. },
  2534. // 表单校验规则
  2535. rules: {
  2536. type: Object,
  2537. default() {
  2538. return {};
  2539. }
  2540. },
  2541. //校验错误信息提示方式 默认 undertext 取值 [undertext|toast|modal]
  2542. errShowType: {
  2543. type: String,
  2544. default: "undertext"
  2545. },
  2546. // 校验触发器方式 默认 bind 取值 [bind|submit]
  2547. validateTrigger: {
  2548. type: String,
  2549. default: "submit"
  2550. },
  2551. // label 位置,默认 left 取值 top/left
  2552. labelPosition: {
  2553. type: String,
  2554. default: "left"
  2555. },
  2556. // label 宽度
  2557. labelWidth: {
  2558. type: [String, Number],
  2559. default: ""
  2560. },
  2561. // label 居中方式,默认 left 取值 left/center/right
  2562. labelAlign: {
  2563. type: String,
  2564. default: "left"
  2565. },
  2566. border: {
  2567. type: Boolean,
  2568. default: false
  2569. }
  2570. },
  2571. provide() {
  2572. return {
  2573. uniForm: this
  2574. };
  2575. },
  2576. data() {
  2577. return {
  2578. // 表单本地值的记录,不应该与传如的值进行关联
  2579. formData: {},
  2580. formRules: {}
  2581. };
  2582. },
  2583. computed: {
  2584. // 计算数据源变化的
  2585. localData() {
  2586. const localVal = this.model || this.modelValue || this.value;
  2587. if (localVal) {
  2588. return deepCopy(localVal);
  2589. }
  2590. return {};
  2591. }
  2592. },
  2593. watch: {
  2594. // 监听数据变化 ,暂时不使用,需要单独赋值
  2595. // localData: {},
  2596. // 监听规则变化
  2597. rules: {
  2598. handler: function(val, oldVal) {
  2599. this.setRules(val);
  2600. },
  2601. deep: true,
  2602. immediate: true
  2603. }
  2604. },
  2605. created() {
  2606. let getbinddata = getApp().$vm.$.appContext.config.globalProperties.binddata;
  2607. if (!getbinddata) {
  2608. getApp().$vm.$.appContext.config.globalProperties.binddata = function(name, value, formName) {
  2609. if (formName) {
  2610. this.$refs[formName].setValue(name, value);
  2611. } else {
  2612. let formVm;
  2613. for (let i2 in this.$refs) {
  2614. const vm = this.$refs[i2];
  2615. if (vm && vm.$options && vm.$options.name === "uniForms") {
  2616. formVm = vm;
  2617. break;
  2618. }
  2619. }
  2620. if (!formVm)
  2621. return formatAppLog("error", "at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:182", "当前 uni-froms 组件缺少 ref 属性");
  2622. formVm.setValue(name, value);
  2623. }
  2624. };
  2625. }
  2626. this.childrens = [];
  2627. this.inputChildrens = [];
  2628. this.setRules(this.rules);
  2629. },
  2630. methods: {
  2631. /**
  2632. * 外部调用方法
  2633. * 设置规则 ,主要用于小程序自定义检验规则
  2634. * @param {Array} rules 规则源数据
  2635. */
  2636. setRules(rules) {
  2637. this.formRules = Object.assign({}, this.formRules, rules);
  2638. this.validator = new SchemaValidator(rules);
  2639. },
  2640. /**
  2641. * 外部调用方法
  2642. * 设置数据,用于设置表单数据,公开给用户使用 , 不支持在动态表单中使用
  2643. * @param {Object} key
  2644. * @param {Object} value
  2645. */
  2646. setValue(key, value) {
  2647. let example = this.childrens.find((child) => child.name === key);
  2648. if (!example)
  2649. return null;
  2650. this.formData[key] = getValue(key, value, this.formRules[key] && this.formRules[key].rules || []);
  2651. return example.onFieldChange(this.formData[key]);
  2652. },
  2653. /**
  2654. * 外部调用方法
  2655. * 手动提交校验表单
  2656. * 对整个表单进行校验的方法,参数为一个回调函数。
  2657. * @param {Array} keepitem 保留不参与校验的字段
  2658. * @param {type} callback 方法回调
  2659. */
  2660. validate(keepitem, callback) {
  2661. return this.checkAll(this.formData, keepitem, callback);
  2662. },
  2663. /**
  2664. * 外部调用方法
  2665. * 部分表单校验
  2666. * @param {Array|String} props 需要校验的字段
  2667. * @param {Function} 回调函数
  2668. */
  2669. validateField(props = [], callback) {
  2670. props = [].concat(props);
  2671. let invalidFields = {};
  2672. this.childrens.forEach((item) => {
  2673. const name = realName(item.name);
  2674. if (props.indexOf(name) !== -1) {
  2675. invalidFields = Object.assign({}, invalidFields, {
  2676. [name]: this.formData[name]
  2677. });
  2678. }
  2679. });
  2680. return this.checkAll(invalidFields, [], callback);
  2681. },
  2682. /**
  2683. * 外部调用方法
  2684. * 移除表单项的校验结果。传入待移除的表单项的 prop 属性或者 prop 组成的数组,如不传则移除整个表单的校验结果
  2685. * @param {Array|String} props 需要移除校验的字段 ,不填为所有
  2686. */
  2687. clearValidate(props = []) {
  2688. props = [].concat(props);
  2689. this.childrens.forEach((item) => {
  2690. if (props.length === 0) {
  2691. item.errMsg = "";
  2692. } else {
  2693. const name = realName(item.name);
  2694. if (props.indexOf(name) !== -1) {
  2695. item.errMsg = "";
  2696. }
  2697. }
  2698. });
  2699. },
  2700. /**
  2701. * 外部调用方法 ,即将废弃
  2702. * 手动提交校验表单
  2703. * 对整个表单进行校验的方法,参数为一个回调函数。
  2704. * @param {Array} keepitem 保留不参与校验的字段
  2705. * @param {type} callback 方法回调
  2706. */
  2707. submit(keepitem, callback, type) {
  2708. for (let i2 in this.dataValue) {
  2709. const itemData = this.childrens.find((v2) => v2.name === i2);
  2710. if (itemData) {
  2711. if (this.formData[i2] === void 0) {
  2712. this.formData[i2] = this._getValue(i2, this.dataValue[i2]);
  2713. }
  2714. }
  2715. }
  2716. if (!type) {
  2717. formatAppLog("warn", "at uni_modules/uni-forms/components/uni-forms/uni-forms.vue:289", "submit 方法即将废弃,请使用validate方法代替!");
  2718. }
  2719. return this.checkAll(this.formData, keepitem, callback, "submit");
  2720. },
  2721. // 校验所有
  2722. async checkAll(invalidFields, keepitem, callback, type) {
  2723. if (!this.validator)
  2724. return;
  2725. let childrens = [];
  2726. for (let i2 in invalidFields) {
  2727. const item = this.childrens.find((v2) => realName(v2.name) === i2);
  2728. if (item) {
  2729. childrens.push(item);
  2730. }
  2731. }
  2732. if (!callback && typeof keepitem === "function") {
  2733. callback = keepitem;
  2734. }
  2735. let promise;
  2736. if (!callback && typeof callback !== "function" && Promise) {
  2737. promise = new Promise((resolve, reject) => {
  2738. callback = function(valid, invalidFields2) {
  2739. !valid ? resolve(invalidFields2) : reject(valid);
  2740. };
  2741. });
  2742. }
  2743. let results = [];
  2744. let tempFormData = JSON.parse(JSON.stringify(invalidFields));
  2745. for (let i2 in childrens) {
  2746. const child = childrens[i2];
  2747. let name = realName(child.name);
  2748. const result = await child.onFieldChange(tempFormData[name]);
  2749. if (result) {
  2750. results.push(result);
  2751. if (this.errShowType === "toast" || this.errShowType === "modal")
  2752. break;
  2753. }
  2754. }
  2755. if (Array.isArray(results)) {
  2756. if (results.length === 0)
  2757. results = null;
  2758. }
  2759. if (Array.isArray(keepitem)) {
  2760. keepitem.forEach((v2) => {
  2761. let vName = realName(v2);
  2762. let value = getDataValue(v2, this.localData);
  2763. if (value !== void 0) {
  2764. tempFormData[vName] = value;
  2765. }
  2766. });
  2767. }
  2768. if (type === "submit") {
  2769. this.$emit("submit", {
  2770. detail: {
  2771. value: tempFormData,
  2772. errors: results
  2773. }
  2774. });
  2775. } else {
  2776. this.$emit("validate", results);
  2777. }
  2778. let resetFormData = {};
  2779. resetFormData = rawData(tempFormData, this.name);
  2780. callback && typeof callback === "function" && callback(results, resetFormData);
  2781. if (promise && callback) {
  2782. return promise;
  2783. } else {
  2784. return null;
  2785. }
  2786. },
  2787. /**
  2788. * 返回validate事件
  2789. * @param {Object} result
  2790. */
  2791. validateCheck(result) {
  2792. this.$emit("validate", result);
  2793. },
  2794. _getValue: getValue,
  2795. _isRequiredField: isRequiredField,
  2796. _setDataValue: setDataValue,
  2797. _getDataValue: getDataValue,
  2798. _realName: realName,
  2799. _isRealName: isRealName,
  2800. _isEqual: isEqual
  2801. }
  2802. };
  2803. function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
  2804. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-forms" }, [
  2805. vue.createElementVNode("form", null, [
  2806. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  2807. ])
  2808. ]);
  2809. }
  2810. const __easycom_3$2 = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$y], ["__scopeId", "data-v-9a1e3c32"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-forms/components/uni-forms/uni-forms.vue"]]);
  2811. const popup = {
  2812. data() {
  2813. return {};
  2814. },
  2815. created() {
  2816. this.popup = this.getParent();
  2817. },
  2818. methods: {
  2819. /**
  2820. * 获取父元素实例
  2821. */
  2822. getParent(name = "uniPopup") {
  2823. let parent = this.$parent;
  2824. let parentName = parent.$options.name;
  2825. while (parentName !== name) {
  2826. parent = parent.$parent;
  2827. if (!parent)
  2828. return false;
  2829. parentName = parent.$options.name;
  2830. }
  2831. return parent;
  2832. }
  2833. }
  2834. };
  2835. const _sfc_main$y = {
  2836. name: "uniPopupMessage",
  2837. mixins: [popup],
  2838. props: {
  2839. /**
  2840. * 主题 success/warning/info/error 默认 success
  2841. */
  2842. type: {
  2843. type: String,
  2844. default: "success"
  2845. },
  2846. /**
  2847. * 消息文字
  2848. */
  2849. message: {
  2850. type: String,
  2851. default: ""
  2852. },
  2853. /**
  2854. * 显示时间,设置为 0 则不会自动关闭
  2855. */
  2856. duration: {
  2857. type: Number,
  2858. default: 3e3
  2859. },
  2860. maskShow: {
  2861. type: Boolean,
  2862. default: false
  2863. }
  2864. },
  2865. data() {
  2866. return {};
  2867. },
  2868. created() {
  2869. this.popup.maskShow = this.maskShow;
  2870. this.popup.messageChild = this;
  2871. },
  2872. methods: {
  2873. timerClose() {
  2874. if (this.duration === 0)
  2875. return;
  2876. clearTimeout(this.timer);
  2877. this.timer = setTimeout(() => {
  2878. this.popup.close();
  2879. }, this.duration);
  2880. }
  2881. }
  2882. };
  2883. function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
  2884. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-popup-message" }, [
  2885. vue.createElementVNode(
  2886. "view",
  2887. {
  2888. class: vue.normalizeClass(["uni-popup-message__box fixforpc-width", "uni-popup__" + $props.type])
  2889. },
  2890. [
  2891. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  2892. vue.createElementVNode(
  2893. "text",
  2894. {
  2895. class: vue.normalizeClass(["uni-popup-message-text", "uni-popup__" + $props.type + "-text"])
  2896. },
  2897. vue.toDisplayString($props.message),
  2898. 3
  2899. /* TEXT, CLASS */
  2900. )
  2901. ], true)
  2902. ],
  2903. 2
  2904. /* CLASS */
  2905. )
  2906. ]);
  2907. }
  2908. const __easycom_5 = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$x], ["__scopeId", "data-v-a4566996"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue"]]);
  2909. class MPAnimation {
  2910. constructor(options, _this) {
  2911. this.options = options;
  2912. this.animation = uni.createAnimation({
  2913. ...options
  2914. });
  2915. this.currentStepAnimates = {};
  2916. this.next = 0;
  2917. this.$ = _this;
  2918. }
  2919. _nvuePushAnimates(type, args) {
  2920. let aniObj = this.currentStepAnimates[this.next];
  2921. let styles = {};
  2922. if (!aniObj) {
  2923. styles = {
  2924. styles: {},
  2925. config: {}
  2926. };
  2927. } else {
  2928. styles = aniObj;
  2929. }
  2930. if (animateTypes1.includes(type)) {
  2931. if (!styles.styles.transform) {
  2932. styles.styles.transform = "";
  2933. }
  2934. let unit = "";
  2935. if (type === "rotate") {
  2936. unit = "deg";
  2937. }
  2938. styles.styles.transform += `${type}(${args + unit}) `;
  2939. } else {
  2940. styles.styles[type] = `${args}`;
  2941. }
  2942. this.currentStepAnimates[this.next] = styles;
  2943. }
  2944. _animateRun(styles = {}, config = {}) {
  2945. let ref = this.$.$refs["ani"].ref;
  2946. if (!ref)
  2947. return;
  2948. return new Promise((resolve, reject) => {
  2949. nvueAnimation.transition(ref, {
  2950. styles,
  2951. ...config
  2952. }, (res) => {
  2953. resolve();
  2954. });
  2955. });
  2956. }
  2957. _nvueNextAnimate(animates, step = 0, fn) {
  2958. let obj = animates[step];
  2959. if (obj) {
  2960. let {
  2961. styles,
  2962. config
  2963. } = obj;
  2964. this._animateRun(styles, config).then(() => {
  2965. step += 1;
  2966. this._nvueNextAnimate(animates, step, fn);
  2967. });
  2968. } else {
  2969. this.currentStepAnimates = {};
  2970. typeof fn === "function" && fn();
  2971. this.isEnd = true;
  2972. }
  2973. }
  2974. step(config = {}) {
  2975. this.animation.step(config);
  2976. return this;
  2977. }
  2978. run(fn) {
  2979. this.$.animationData = this.animation.export();
  2980. this.$.timer = setTimeout(() => {
  2981. typeof fn === "function" && fn();
  2982. }, this.$.durationTime);
  2983. }
  2984. }
  2985. const animateTypes1 = [
  2986. "matrix",
  2987. "matrix3d",
  2988. "rotate",
  2989. "rotate3d",
  2990. "rotateX",
  2991. "rotateY",
  2992. "rotateZ",
  2993. "scale",
  2994. "scale3d",
  2995. "scaleX",
  2996. "scaleY",
  2997. "scaleZ",
  2998. "skew",
  2999. "skewX",
  3000. "skewY",
  3001. "translate",
  3002. "translate3d",
  3003. "translateX",
  3004. "translateY",
  3005. "translateZ"
  3006. ];
  3007. const animateTypes2 = ["opacity", "backgroundColor"];
  3008. const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
  3009. animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
  3010. MPAnimation.prototype[type] = function(...args) {
  3011. this.animation[type](...args);
  3012. return this;
  3013. };
  3014. });
  3015. function createAnimation(option, _this) {
  3016. if (!_this)
  3017. return;
  3018. clearTimeout(_this.timer);
  3019. return new MPAnimation(option, _this);
  3020. }
  3021. const _sfc_main$x = {
  3022. name: "uniTransition",
  3023. emits: ["click", "change"],
  3024. props: {
  3025. show: {
  3026. type: Boolean,
  3027. default: false
  3028. },
  3029. modeClass: {
  3030. type: [Array, String],
  3031. default() {
  3032. return "fade";
  3033. }
  3034. },
  3035. duration: {
  3036. type: Number,
  3037. default: 300
  3038. },
  3039. styles: {
  3040. type: Object,
  3041. default() {
  3042. return {};
  3043. }
  3044. },
  3045. customClass: {
  3046. type: String,
  3047. default: ""
  3048. },
  3049. onceRender: {
  3050. type: Boolean,
  3051. default: false
  3052. }
  3053. },
  3054. data() {
  3055. return {
  3056. isShow: false,
  3057. transform: "",
  3058. opacity: 1,
  3059. animationData: {},
  3060. durationTime: 300,
  3061. config: {}
  3062. };
  3063. },
  3064. watch: {
  3065. show: {
  3066. handler(newVal) {
  3067. if (newVal) {
  3068. this.open();
  3069. } else {
  3070. if (this.isShow) {
  3071. this.close();
  3072. }
  3073. }
  3074. },
  3075. immediate: true
  3076. }
  3077. },
  3078. computed: {
  3079. // 生成样式数据
  3080. stylesObject() {
  3081. let styles = {
  3082. ...this.styles,
  3083. "transition-duration": this.duration / 1e3 + "s"
  3084. };
  3085. let transform = "";
  3086. for (let i2 in styles) {
  3087. let line = this.toLine(i2);
  3088. transform += line + ":" + styles[i2] + ";";
  3089. }
  3090. return transform;
  3091. },
  3092. // 初始化动画条件
  3093. transformStyles() {
  3094. return "transform:" + this.transform + ";opacity:" + this.opacity + ";" + this.stylesObject;
  3095. }
  3096. },
  3097. created() {
  3098. this.config = {
  3099. duration: this.duration,
  3100. timingFunction: "ease",
  3101. transformOrigin: "50% 50%",
  3102. delay: 0
  3103. };
  3104. this.durationTime = this.duration;
  3105. },
  3106. methods: {
  3107. /**
  3108. * ref 触发 初始化动画
  3109. */
  3110. init(obj = {}) {
  3111. if (obj.duration) {
  3112. this.durationTime = obj.duration;
  3113. }
  3114. this.animation = createAnimation(Object.assign(this.config, obj), this);
  3115. },
  3116. /**
  3117. * 点击组件触发回调
  3118. */
  3119. onClick() {
  3120. this.$emit("click", {
  3121. detail: this.isShow
  3122. });
  3123. },
  3124. /**
  3125. * ref 触发 动画分组
  3126. * @param {Object} obj
  3127. */
  3128. step(obj, config = {}) {
  3129. if (!this.animation)
  3130. return;
  3131. for (let i2 in obj) {
  3132. try {
  3133. if (typeof obj[i2] === "object") {
  3134. this.animation[i2](...obj[i2]);
  3135. } else {
  3136. this.animation[i2](obj[i2]);
  3137. }
  3138. } catch (e2) {
  3139. formatAppLog("error", "at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:148", `方法 ${i2} 不存在`);
  3140. }
  3141. }
  3142. this.animation.step(config);
  3143. return this;
  3144. },
  3145. /**
  3146. * ref 触发 执行动画
  3147. */
  3148. run(fn) {
  3149. if (!this.animation)
  3150. return;
  3151. this.animation.run(fn);
  3152. },
  3153. // 开始过度动画
  3154. open() {
  3155. clearTimeout(this.timer);
  3156. this.transform = "";
  3157. this.isShow = true;
  3158. let { opacity, transform } = this.styleInit(false);
  3159. if (typeof opacity !== "undefined") {
  3160. this.opacity = opacity;
  3161. }
  3162. this.transform = transform;
  3163. this.$nextTick(() => {
  3164. this.timer = setTimeout(() => {
  3165. this.animation = createAnimation(this.config, this);
  3166. this.tranfromInit(false).step();
  3167. this.animation.run();
  3168. this.$emit("change", {
  3169. detail: this.isShow
  3170. });
  3171. }, 20);
  3172. });
  3173. },
  3174. // 关闭过度动画
  3175. close(type) {
  3176. if (!this.animation)
  3177. return;
  3178. this.tranfromInit(true).step().run(() => {
  3179. this.isShow = false;
  3180. this.animationData = null;
  3181. this.animation = null;
  3182. let { opacity, transform } = this.styleInit(false);
  3183. this.opacity = opacity || 1;
  3184. this.transform = transform;
  3185. this.$emit("change", {
  3186. detail: this.isShow
  3187. });
  3188. });
  3189. },
  3190. // 处理动画开始前的默认样式
  3191. styleInit(type) {
  3192. let styles = {
  3193. transform: ""
  3194. };
  3195. let buildStyle = (type2, mode) => {
  3196. if (mode === "fade") {
  3197. styles.opacity = this.animationType(type2)[mode];
  3198. } else {
  3199. styles.transform += this.animationType(type2)[mode] + " ";
  3200. }
  3201. };
  3202. if (typeof this.modeClass === "string") {
  3203. buildStyle(type, this.modeClass);
  3204. } else {
  3205. this.modeClass.forEach((mode) => {
  3206. buildStyle(type, mode);
  3207. });
  3208. }
  3209. return styles;
  3210. },
  3211. // 处理内置组合动画
  3212. tranfromInit(type) {
  3213. let buildTranfrom = (type2, mode) => {
  3214. let aniNum = null;
  3215. if (mode === "fade") {
  3216. aniNum = type2 ? 0 : 1;
  3217. } else {
  3218. aniNum = type2 ? "-100%" : "0";
  3219. if (mode === "zoom-in") {
  3220. aniNum = type2 ? 0.8 : 1;
  3221. }
  3222. if (mode === "zoom-out") {
  3223. aniNum = type2 ? 1.2 : 1;
  3224. }
  3225. if (mode === "slide-right") {
  3226. aniNum = type2 ? "100%" : "0";
  3227. }
  3228. if (mode === "slide-bottom") {
  3229. aniNum = type2 ? "100%" : "0";
  3230. }
  3231. }
  3232. this.animation[this.animationMode()[mode]](aniNum);
  3233. };
  3234. if (typeof this.modeClass === "string") {
  3235. buildTranfrom(type, this.modeClass);
  3236. } else {
  3237. this.modeClass.forEach((mode) => {
  3238. buildTranfrom(type, mode);
  3239. });
  3240. }
  3241. return this.animation;
  3242. },
  3243. animationType(type) {
  3244. return {
  3245. fade: type ? 1 : 0,
  3246. "slide-top": `translateY(${type ? "0" : "-100%"})`,
  3247. "slide-right": `translateX(${type ? "0" : "100%"})`,
  3248. "slide-bottom": `translateY(${type ? "0" : "100%"})`,
  3249. "slide-left": `translateX(${type ? "0" : "-100%"})`,
  3250. "zoom-in": `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
  3251. "zoom-out": `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
  3252. };
  3253. },
  3254. // 内置动画类型与实际动画对应字典
  3255. animationMode() {
  3256. return {
  3257. fade: "opacity",
  3258. "slide-top": "translateY",
  3259. "slide-right": "translateX",
  3260. "slide-bottom": "translateY",
  3261. "slide-left": "translateX",
  3262. "zoom-in": "scale",
  3263. "zoom-out": "scale"
  3264. };
  3265. },
  3266. // 驼峰转中横线
  3267. toLine(name) {
  3268. return name.replace(/([A-Z])/g, "-$1").toLowerCase();
  3269. }
  3270. }
  3271. };
  3272. function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
  3273. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("view", {
  3274. ref: "ani",
  3275. animation: $data.animationData,
  3276. class: vue.normalizeClass($props.customClass),
  3277. style: vue.normalizeStyle($options.transformStyles),
  3278. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  3279. }, [
  3280. vue.renderSlot(_ctx.$slots, "default")
  3281. ], 14, ["animation"])), [
  3282. [vue.vShow, $data.isShow]
  3283. ]);
  3284. }
  3285. const __easycom_0$6 = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$w], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-transition/components/uni-transition/uni-transition.vue"]]);
  3286. const _sfc_main$w = {
  3287. name: "uniPopup",
  3288. components: {},
  3289. emits: ["change", "maskClick"],
  3290. props: {
  3291. // 开启动画
  3292. animation: {
  3293. type: Boolean,
  3294. default: true
  3295. },
  3296. // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
  3297. // message: 消息提示 ; dialog : 对话框
  3298. type: {
  3299. type: String,
  3300. default: "center"
  3301. },
  3302. // maskClick
  3303. isMaskClick: {
  3304. type: Boolean,
  3305. default: null
  3306. },
  3307. // TODO 2 个版本后废弃属性 ,使用 isMaskClick
  3308. maskClick: {
  3309. type: Boolean,
  3310. default: null
  3311. },
  3312. backgroundColor: {
  3313. type: String,
  3314. default: "none"
  3315. },
  3316. safeArea: {
  3317. type: Boolean,
  3318. default: true
  3319. },
  3320. maskBackgroundColor: {
  3321. type: String,
  3322. default: "rgba(0, 0, 0, 0.4)"
  3323. }
  3324. },
  3325. watch: {
  3326. /**
  3327. * 监听type类型
  3328. */
  3329. type: {
  3330. handler: function(type) {
  3331. if (!this.config[type])
  3332. return;
  3333. this[this.config[type]](true);
  3334. },
  3335. immediate: true
  3336. },
  3337. isDesktop: {
  3338. handler: function(newVal) {
  3339. if (!this.config[newVal])
  3340. return;
  3341. this[this.config[this.type]](true);
  3342. },
  3343. immediate: true
  3344. },
  3345. /**
  3346. * 监听遮罩是否可点击
  3347. * @param {Object} val
  3348. */
  3349. maskClick: {
  3350. handler: function(val) {
  3351. this.mkclick = val;
  3352. },
  3353. immediate: true
  3354. },
  3355. isMaskClick: {
  3356. handler: function(val) {
  3357. this.mkclick = val;
  3358. },
  3359. immediate: true
  3360. },
  3361. // H5 下禁止底部滚动
  3362. showPopup(show) {
  3363. }
  3364. },
  3365. data() {
  3366. return {
  3367. duration: 300,
  3368. ani: [],
  3369. showPopup: false,
  3370. showTrans: false,
  3371. popupWidth: 0,
  3372. popupHeight: 0,
  3373. config: {
  3374. top: "top",
  3375. bottom: "bottom",
  3376. center: "center",
  3377. left: "left",
  3378. right: "right",
  3379. message: "top",
  3380. dialog: "center",
  3381. share: "bottom"
  3382. },
  3383. maskClass: {
  3384. position: "fixed",
  3385. bottom: 0,
  3386. top: 0,
  3387. left: 0,
  3388. right: 0,
  3389. backgroundColor: "rgba(0, 0, 0, 0.4)"
  3390. },
  3391. transClass: {
  3392. position: "fixed",
  3393. left: 0,
  3394. right: 0
  3395. },
  3396. maskShow: true,
  3397. mkclick: true,
  3398. popupstyle: "top"
  3399. };
  3400. },
  3401. computed: {
  3402. isDesktop() {
  3403. return this.popupWidth >= 500 && this.popupHeight >= 500;
  3404. },
  3405. bg() {
  3406. if (this.backgroundColor === "" || this.backgroundColor === "none") {
  3407. return "transparent";
  3408. }
  3409. return this.backgroundColor;
  3410. }
  3411. },
  3412. mounted() {
  3413. const fixSize = () => {
  3414. const {
  3415. windowWidth,
  3416. windowHeight,
  3417. windowTop,
  3418. safeArea,
  3419. screenHeight,
  3420. safeAreaInsets
  3421. } = uni.getSystemInfoSync();
  3422. this.popupWidth = windowWidth;
  3423. this.popupHeight = windowHeight + (windowTop || 0);
  3424. if (safeArea && this.safeArea) {
  3425. this.safeAreaInsets = safeAreaInsets.bottom;
  3426. } else {
  3427. this.safeAreaInsets = 0;
  3428. }
  3429. };
  3430. fixSize();
  3431. },
  3432. // TODO vue3
  3433. unmounted() {
  3434. this.setH5Visible();
  3435. },
  3436. created() {
  3437. if (this.isMaskClick === null && this.maskClick === null) {
  3438. this.mkclick = true;
  3439. } else {
  3440. this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
  3441. }
  3442. if (this.animation) {
  3443. this.duration = 300;
  3444. } else {
  3445. this.duration = 0;
  3446. }
  3447. this.messageChild = null;
  3448. this.clearPropagation = false;
  3449. this.maskClass.backgroundColor = this.maskBackgroundColor;
  3450. },
  3451. methods: {
  3452. setH5Visible() {
  3453. },
  3454. /**
  3455. * 公用方法,不显示遮罩层
  3456. */
  3457. closeMask() {
  3458. this.maskShow = false;
  3459. },
  3460. /**
  3461. * 公用方法,遮罩层禁止点击
  3462. */
  3463. disableMask() {
  3464. this.mkclick = false;
  3465. },
  3466. // TODO nvue 取消冒泡
  3467. clear(e2) {
  3468. e2.stopPropagation();
  3469. this.clearPropagation = true;
  3470. },
  3471. open(direction) {
  3472. if (this.showPopup) {
  3473. return;
  3474. }
  3475. let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
  3476. if (!(direction && innerType.indexOf(direction) !== -1)) {
  3477. direction = this.type;
  3478. }
  3479. if (!this.config[direction]) {
  3480. formatAppLog("error", "at uni_modules/uni-popup/components/uni-popup/uni-popup.vue:279", "缺少类型:", direction);
  3481. return;
  3482. }
  3483. this[this.config[direction]]();
  3484. this.$emit("change", {
  3485. show: true,
  3486. type: direction
  3487. });
  3488. },
  3489. close(type) {
  3490. this.showTrans = false;
  3491. this.$emit("change", {
  3492. show: false,
  3493. type: this.type
  3494. });
  3495. clearTimeout(this.timer);
  3496. this.timer = setTimeout(() => {
  3497. this.showPopup = false;
  3498. }, 300);
  3499. },
  3500. // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
  3501. touchstart() {
  3502. this.clearPropagation = false;
  3503. },
  3504. onTap() {
  3505. if (this.clearPropagation) {
  3506. this.clearPropagation = false;
  3507. return;
  3508. }
  3509. this.$emit("maskClick");
  3510. if (!this.mkclick)
  3511. return;
  3512. this.close();
  3513. },
  3514. /**
  3515. * 顶部弹出样式处理
  3516. */
  3517. top(type) {
  3518. this.popupstyle = this.isDesktop ? "fixforpc-top" : "top";
  3519. this.ani = ["slide-top"];
  3520. this.transClass = {
  3521. position: "fixed",
  3522. left: 0,
  3523. right: 0,
  3524. backgroundColor: this.bg
  3525. };
  3526. if (type)
  3527. return;
  3528. this.showPopup = true;
  3529. this.showTrans = true;
  3530. this.$nextTick(() => {
  3531. if (this.messageChild && this.type === "message") {
  3532. this.messageChild.timerClose();
  3533. }
  3534. });
  3535. },
  3536. /**
  3537. * 底部弹出样式处理
  3538. */
  3539. bottom(type) {
  3540. this.popupstyle = "bottom";
  3541. this.ani = ["slide-bottom"];
  3542. this.transClass = {
  3543. position: "fixed",
  3544. left: 0,
  3545. right: 0,
  3546. bottom: 0,
  3547. paddingBottom: this.safeAreaInsets + "px",
  3548. backgroundColor: this.bg
  3549. };
  3550. if (type)
  3551. return;
  3552. this.showPopup = true;
  3553. this.showTrans = true;
  3554. },
  3555. /**
  3556. * 中间弹出样式处理
  3557. */
  3558. center(type) {
  3559. this.popupstyle = "center";
  3560. this.ani = ["zoom-out", "fade"];
  3561. this.transClass = {
  3562. position: "fixed",
  3563. display: "flex",
  3564. flexDirection: "column",
  3565. bottom: 0,
  3566. left: 0,
  3567. right: 0,
  3568. top: 0,
  3569. justifyContent: "center",
  3570. alignItems: "center"
  3571. };
  3572. if (type)
  3573. return;
  3574. this.showPopup = true;
  3575. this.showTrans = true;
  3576. },
  3577. left(type) {
  3578. this.popupstyle = "left";
  3579. this.ani = ["slide-left"];
  3580. this.transClass = {
  3581. position: "fixed",
  3582. left: 0,
  3583. bottom: 0,
  3584. top: 0,
  3585. backgroundColor: this.bg,
  3586. display: "flex",
  3587. flexDirection: "column"
  3588. };
  3589. if (type)
  3590. return;
  3591. this.showPopup = true;
  3592. this.showTrans = true;
  3593. },
  3594. right(type) {
  3595. this.popupstyle = "right";
  3596. this.ani = ["slide-right"];
  3597. this.transClass = {
  3598. position: "fixed",
  3599. bottom: 0,
  3600. right: 0,
  3601. top: 0,
  3602. backgroundColor: this.bg,
  3603. display: "flex",
  3604. flexDirection: "column"
  3605. };
  3606. if (type)
  3607. return;
  3608. this.showPopup = true;
  3609. this.showTrans = true;
  3610. }
  3611. }
  3612. };
  3613. function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
  3614. const _component_uni_transition = resolveEasycom(vue.resolveDynamicComponent("uni-transition"), __easycom_0$6);
  3615. return $data.showPopup ? (vue.openBlock(), vue.createElementBlock(
  3616. "view",
  3617. {
  3618. key: 0,
  3619. class: vue.normalizeClass(["uni-popup", [$data.popupstyle, $options.isDesktop ? "fixforpc-z-index" : ""]])
  3620. },
  3621. [
  3622. vue.createElementVNode(
  3623. "view",
  3624. {
  3625. onTouchstart: _cache[1] || (_cache[1] = (...args) => $options.touchstart && $options.touchstart(...args))
  3626. },
  3627. [
  3628. $data.maskShow ? (vue.openBlock(), vue.createBlock(_component_uni_transition, {
  3629. key: "1",
  3630. name: "mask",
  3631. "mode-class": "fade",
  3632. styles: $data.maskClass,
  3633. duration: $data.duration,
  3634. show: $data.showTrans,
  3635. onClick: $options.onTap
  3636. }, null, 8, ["styles", "duration", "show", "onClick"])) : vue.createCommentVNode("v-if", true),
  3637. vue.createVNode(_component_uni_transition, {
  3638. key: "2",
  3639. "mode-class": $data.ani,
  3640. name: "content",
  3641. styles: $data.transClass,
  3642. duration: $data.duration,
  3643. show: $data.showTrans,
  3644. onClick: $options.onTap
  3645. }, {
  3646. default: vue.withCtx(() => [
  3647. vue.createElementVNode(
  3648. "view",
  3649. {
  3650. class: vue.normalizeClass(["uni-popup__wrapper", [$data.popupstyle]]),
  3651. style: vue.normalizeStyle({ backgroundColor: $options.bg }),
  3652. onClick: _cache[0] || (_cache[0] = (...args) => $options.clear && $options.clear(...args))
  3653. },
  3654. [
  3655. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  3656. ],
  3657. 6
  3658. /* CLASS, STYLE */
  3659. )
  3660. ]),
  3661. _: 3
  3662. /* FORWARDED */
  3663. }, 8, ["mode-class", "styles", "duration", "show", "onClick"])
  3664. ],
  3665. 32
  3666. /* NEED_HYDRATION */
  3667. )
  3668. ],
  3669. 2
  3670. /* CLASS */
  3671. )) : vue.createCommentVNode("v-if", true);
  3672. }
  3673. const __easycom_6 = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$v], ["__scopeId", "data-v-4dd3c44b"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-popup/components/uni-popup/uni-popup.vue"]]);
  3674. const isObject = (val) => val !== null && typeof val === "object";
  3675. const defaultDelimiters = ["{", "}"];
  3676. class BaseFormatter {
  3677. constructor() {
  3678. this._caches = /* @__PURE__ */ Object.create(null);
  3679. }
  3680. interpolate(message, values, delimiters = defaultDelimiters) {
  3681. if (!values) {
  3682. return [message];
  3683. }
  3684. let tokens = this._caches[message];
  3685. if (!tokens) {
  3686. tokens = parse(message, delimiters);
  3687. this._caches[message] = tokens;
  3688. }
  3689. return compile(tokens, values);
  3690. }
  3691. }
  3692. const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3693. const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3694. function parse(format, [startDelimiter, endDelimiter]) {
  3695. const tokens = [];
  3696. let position = 0;
  3697. let text = "";
  3698. while (position < format.length) {
  3699. let char = format[position++];
  3700. if (char === startDelimiter) {
  3701. if (text) {
  3702. tokens.push({ type: "text", value: text });
  3703. }
  3704. text = "";
  3705. let sub = "";
  3706. char = format[position++];
  3707. while (char !== void 0 && char !== endDelimiter) {
  3708. sub += char;
  3709. char = format[position++];
  3710. }
  3711. const isClosed = char === endDelimiter;
  3712. const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
  3713. tokens.push({ value: sub, type });
  3714. } else {
  3715. text += char;
  3716. }
  3717. }
  3718. text && tokens.push({ type: "text", value: text });
  3719. return tokens;
  3720. }
  3721. function compile(tokens, values) {
  3722. const compiled = [];
  3723. let index = 0;
  3724. const mode = Array.isArray(values) ? "list" : isObject(values) ? "named" : "unknown";
  3725. if (mode === "unknown") {
  3726. return compiled;
  3727. }
  3728. while (index < tokens.length) {
  3729. const token = tokens[index];
  3730. switch (token.type) {
  3731. case "text":
  3732. compiled.push(token.value);
  3733. break;
  3734. case "list":
  3735. compiled.push(values[parseInt(token.value, 10)]);
  3736. break;
  3737. case "named":
  3738. if (mode === "named") {
  3739. compiled.push(values[token.value]);
  3740. } else {
  3741. {
  3742. console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);
  3743. }
  3744. }
  3745. break;
  3746. case "unknown":
  3747. {
  3748. console.warn(`Detect 'unknown' type of token!`);
  3749. }
  3750. break;
  3751. }
  3752. index++;
  3753. }
  3754. return compiled;
  3755. }
  3756. const LOCALE_ZH_HANS = "zh-Hans";
  3757. const LOCALE_ZH_HANT = "zh-Hant";
  3758. const LOCALE_EN = "en";
  3759. const LOCALE_FR = "fr";
  3760. const LOCALE_ES = "es";
  3761. const hasOwnProperty = Object.prototype.hasOwnProperty;
  3762. const hasOwn = (val, key) => hasOwnProperty.call(val, key);
  3763. const defaultFormatter = new BaseFormatter();
  3764. function include(str, parts) {
  3765. return !!parts.find((part) => str.indexOf(part) !== -1);
  3766. }
  3767. function startsWith(str, parts) {
  3768. return parts.find((part) => str.indexOf(part) === 0);
  3769. }
  3770. function normalizeLocale(locale, messages2) {
  3771. if (!locale) {
  3772. return;
  3773. }
  3774. locale = locale.trim().replace(/_/g, "-");
  3775. if (messages2 && messages2[locale]) {
  3776. return locale;
  3777. }
  3778. locale = locale.toLowerCase();
  3779. if (locale === "chinese") {
  3780. return LOCALE_ZH_HANS;
  3781. }
  3782. if (locale.indexOf("zh") === 0) {
  3783. if (locale.indexOf("-hans") > -1) {
  3784. return LOCALE_ZH_HANS;
  3785. }
  3786. if (locale.indexOf("-hant") > -1) {
  3787. return LOCALE_ZH_HANT;
  3788. }
  3789. if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
  3790. return LOCALE_ZH_HANT;
  3791. }
  3792. return LOCALE_ZH_HANS;
  3793. }
  3794. let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  3795. if (messages2 && Object.keys(messages2).length > 0) {
  3796. locales = Object.keys(messages2);
  3797. }
  3798. const lang = startsWith(locale, locales);
  3799. if (lang) {
  3800. return lang;
  3801. }
  3802. }
  3803. class I18n {
  3804. constructor({ locale, fallbackLocale, messages: messages2, watcher, formater: formater2 }) {
  3805. this.locale = LOCALE_EN;
  3806. this.fallbackLocale = LOCALE_EN;
  3807. this.message = {};
  3808. this.messages = {};
  3809. this.watchers = [];
  3810. if (fallbackLocale) {
  3811. this.fallbackLocale = fallbackLocale;
  3812. }
  3813. this.formater = formater2 || defaultFormatter;
  3814. this.messages = messages2 || {};
  3815. this.setLocale(locale || LOCALE_EN);
  3816. if (watcher) {
  3817. this.watchLocale(watcher);
  3818. }
  3819. }
  3820. setLocale(locale) {
  3821. const oldLocale = this.locale;
  3822. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3823. if (!this.messages[this.locale]) {
  3824. this.messages[this.locale] = {};
  3825. }
  3826. this.message = this.messages[this.locale];
  3827. if (oldLocale !== this.locale) {
  3828. this.watchers.forEach((watcher) => {
  3829. watcher(this.locale, oldLocale);
  3830. });
  3831. }
  3832. }
  3833. getLocale() {
  3834. return this.locale;
  3835. }
  3836. watchLocale(fn) {
  3837. const index = this.watchers.push(fn) - 1;
  3838. return () => {
  3839. this.watchers.splice(index, 1);
  3840. };
  3841. }
  3842. add(locale, message, override = true) {
  3843. const curMessages = this.messages[locale];
  3844. if (curMessages) {
  3845. if (override) {
  3846. Object.assign(curMessages, message);
  3847. } else {
  3848. Object.keys(message).forEach((key) => {
  3849. if (!hasOwn(curMessages, key)) {
  3850. curMessages[key] = message[key];
  3851. }
  3852. });
  3853. }
  3854. } else {
  3855. this.messages[locale] = message;
  3856. }
  3857. }
  3858. f(message, values, delimiters) {
  3859. return this.formater.interpolate(message, values, delimiters).join("");
  3860. }
  3861. t(key, locale, values) {
  3862. let message = this.message;
  3863. if (typeof locale === "string") {
  3864. locale = normalizeLocale(locale, this.messages);
  3865. locale && (message = this.messages[locale]);
  3866. } else {
  3867. values = locale;
  3868. }
  3869. if (!hasOwn(message, key)) {
  3870. console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
  3871. return key;
  3872. }
  3873. return this.formater.interpolate(message[key], values).join("");
  3874. }
  3875. }
  3876. function watchAppLocale(appVm, i18n) {
  3877. if (appVm.$watchLocale) {
  3878. appVm.$watchLocale((newLocale) => {
  3879. i18n.setLocale(newLocale);
  3880. });
  3881. } else {
  3882. appVm.$watch(() => appVm.$locale, (newLocale) => {
  3883. i18n.setLocale(newLocale);
  3884. });
  3885. }
  3886. }
  3887. function getDefaultLocale() {
  3888. if (typeof uni !== "undefined" && uni.getLocale) {
  3889. return uni.getLocale();
  3890. }
  3891. if (typeof global !== "undefined" && global.getLocale) {
  3892. return global.getLocale();
  3893. }
  3894. return LOCALE_EN;
  3895. }
  3896. function initVueI18n(locale, messages2 = {}, fallbackLocale, watcher) {
  3897. if (typeof locale !== "string") {
  3898. const options = [
  3899. messages2,
  3900. locale
  3901. ];
  3902. locale = options[0];
  3903. messages2 = options[1];
  3904. }
  3905. if (typeof locale !== "string") {
  3906. locale = getDefaultLocale();
  3907. }
  3908. if (typeof fallbackLocale !== "string") {
  3909. fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
  3910. }
  3911. const i18n = new I18n({
  3912. locale,
  3913. fallbackLocale,
  3914. messages: messages2,
  3915. watcher
  3916. });
  3917. let t2 = (key, values) => {
  3918. if (typeof getApp !== "function") {
  3919. t2 = function(key2, values2) {
  3920. return i18n.t(key2, values2);
  3921. };
  3922. } else {
  3923. let isWatchedAppLocale = false;
  3924. t2 = function(key2, values2) {
  3925. const appVm = getApp().$vm;
  3926. if (appVm) {
  3927. appVm.$locale;
  3928. if (!isWatchedAppLocale) {
  3929. isWatchedAppLocale = true;
  3930. watchAppLocale(appVm, i18n);
  3931. }
  3932. }
  3933. return i18n.t(key2, values2);
  3934. };
  3935. }
  3936. return t2(key, values);
  3937. };
  3938. return {
  3939. i18n,
  3940. f(message, values, delimiters) {
  3941. return i18n.f(message, values, delimiters);
  3942. },
  3943. t(key, values) {
  3944. return t2(key, values);
  3945. },
  3946. add(locale2, message, override = true) {
  3947. return i18n.add(locale2, message, override);
  3948. },
  3949. watch(fn) {
  3950. return i18n.watchLocale(fn);
  3951. },
  3952. getLocale() {
  3953. return i18n.getLocale();
  3954. },
  3955. setLocale(newLocale) {
  3956. return i18n.setLocale(newLocale);
  3957. }
  3958. };
  3959. }
  3960. const en$1 = {
  3961. "uni-popup.cancel": "cancel",
  3962. "uni-popup.ok": "ok",
  3963. "uni-popup.placeholder": "pleace enter",
  3964. "uni-popup.title": "Hint",
  3965. "uni-popup.shareTitle": "Share to"
  3966. };
  3967. const zhHans$1 = {
  3968. "uni-popup.cancel": "取消",
  3969. "uni-popup.ok": "确定",
  3970. "uni-popup.placeholder": "请输入",
  3971. "uni-popup.title": "提示",
  3972. "uni-popup.shareTitle": "分享到"
  3973. };
  3974. const zhHant$1 = {
  3975. "uni-popup.cancel": "取消",
  3976. "uni-popup.ok": "確定",
  3977. "uni-popup.placeholder": "請輸入",
  3978. "uni-popup.title": "提示",
  3979. "uni-popup.shareTitle": "分享到"
  3980. };
  3981. const messages$1 = {
  3982. en: en$1,
  3983. "zh-Hans": zhHans$1,
  3984. "zh-Hant": zhHant$1
  3985. };
  3986. const { t: t$2 } = initVueI18n(messages$1);
  3987. const _sfc_main$v = {
  3988. name: "uniPopupDialog",
  3989. mixins: [popup],
  3990. emits: ["confirm", "close"],
  3991. props: {
  3992. inputType: {
  3993. type: String,
  3994. default: "text"
  3995. },
  3996. value: {
  3997. type: [String, Number],
  3998. default: ""
  3999. },
  4000. placeholder: {
  4001. type: [String, Number],
  4002. default: ""
  4003. },
  4004. type: {
  4005. type: String,
  4006. default: "error"
  4007. },
  4008. mode: {
  4009. type: String,
  4010. default: "base"
  4011. },
  4012. title: {
  4013. type: String,
  4014. default: ""
  4015. },
  4016. content: {
  4017. type: String,
  4018. default: ""
  4019. },
  4020. beforeClose: {
  4021. type: Boolean,
  4022. default: false
  4023. },
  4024. cancelText: {
  4025. type: String,
  4026. default: ""
  4027. },
  4028. confirmText: {
  4029. type: String,
  4030. default: ""
  4031. }
  4032. },
  4033. data() {
  4034. return {
  4035. dialogType: "error",
  4036. focus: false,
  4037. val: ""
  4038. };
  4039. },
  4040. computed: {
  4041. okText() {
  4042. return this.confirmText || t$2("uni-popup.ok");
  4043. },
  4044. closeText() {
  4045. return this.cancelText || t$2("uni-popup.cancel");
  4046. },
  4047. placeholderText() {
  4048. return this.placeholder || t$2("uni-popup.placeholder");
  4049. },
  4050. titleText() {
  4051. return this.title || t$2("uni-popup.title");
  4052. }
  4053. },
  4054. watch: {
  4055. type(val) {
  4056. this.dialogType = val;
  4057. },
  4058. mode(val) {
  4059. if (val === "input") {
  4060. this.dialogType = "info";
  4061. }
  4062. },
  4063. value(val) {
  4064. this.val = val;
  4065. }
  4066. },
  4067. created() {
  4068. this.popup.disableMask();
  4069. if (this.mode === "input") {
  4070. this.dialogType = "info";
  4071. this.val = this.value;
  4072. } else {
  4073. this.dialogType = this.type;
  4074. }
  4075. },
  4076. mounted() {
  4077. this.focus = true;
  4078. },
  4079. methods: {
  4080. /**
  4081. * 点击确认按钮
  4082. */
  4083. onOk() {
  4084. if (this.mode === "input") {
  4085. this.$emit("confirm", this.val);
  4086. } else {
  4087. this.$emit("confirm");
  4088. }
  4089. if (this.beforeClose)
  4090. return;
  4091. this.popup.close();
  4092. },
  4093. /**
  4094. * 点击取消按钮
  4095. */
  4096. closeDialog() {
  4097. this.$emit("close");
  4098. if (this.beforeClose)
  4099. return;
  4100. this.popup.close();
  4101. },
  4102. close() {
  4103. this.popup.close();
  4104. }
  4105. }
  4106. };
  4107. function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
  4108. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-popup-dialog" }, [
  4109. vue.createElementVNode("view", { class: "uni-dialog-title" }, [
  4110. vue.createElementVNode(
  4111. "text",
  4112. {
  4113. class: vue.normalizeClass(["uni-dialog-title-text", ["uni-popup__" + $data.dialogType]])
  4114. },
  4115. vue.toDisplayString($options.titleText),
  4116. 3
  4117. /* TEXT, CLASS */
  4118. )
  4119. ]),
  4120. $props.mode === "base" ? (vue.openBlock(), vue.createElementBlock("view", {
  4121. key: 0,
  4122. class: "uni-dialog-content"
  4123. }, [
  4124. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  4125. vue.createElementVNode(
  4126. "text",
  4127. { class: "uni-dialog-content-text" },
  4128. vue.toDisplayString($props.content),
  4129. 1
  4130. /* TEXT */
  4131. )
  4132. ], true)
  4133. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  4134. key: 1,
  4135. class: "uni-dialog-content"
  4136. }, [
  4137. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  4138. vue.withDirectives(vue.createElementVNode("input", {
  4139. class: "uni-dialog-input",
  4140. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.val = $event),
  4141. type: $props.inputType,
  4142. placeholder: $options.placeholderText,
  4143. focus: $data.focus
  4144. }, null, 8, ["type", "placeholder", "focus"]), [
  4145. [vue.vModelDynamic, $data.val]
  4146. ])
  4147. ], true)
  4148. ])),
  4149. vue.createElementVNode("view", { class: "uni-dialog-button-group" }, [
  4150. vue.createElementVNode("view", {
  4151. class: "uni-dialog-button",
  4152. onClick: _cache[1] || (_cache[1] = (...args) => $options.closeDialog && $options.closeDialog(...args))
  4153. }, [
  4154. vue.createElementVNode(
  4155. "text",
  4156. { class: "uni-dialog-button-text" },
  4157. vue.toDisplayString($options.closeText),
  4158. 1
  4159. /* TEXT */
  4160. )
  4161. ]),
  4162. vue.createElementVNode("view", {
  4163. class: "uni-dialog-button uni-border-left",
  4164. onClick: _cache[2] || (_cache[2] = (...args) => $options.onOk && $options.onOk(...args))
  4165. }, [
  4166. vue.createElementVNode(
  4167. "text",
  4168. { class: "uni-dialog-button-text uni-button-color" },
  4169. vue.toDisplayString($options.okText),
  4170. 1
  4171. /* TEXT */
  4172. )
  4173. ])
  4174. ])
  4175. ]);
  4176. }
  4177. const __easycom_0$5 = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$u], ["__scopeId", "data-v-d78c88b7"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue"]]);
  4178. const pages = [
  4179. {
  4180. path: "pages/home/index",
  4181. style: {
  4182. navigationBarTitleText: "英途仓库"
  4183. }
  4184. },
  4185. {
  4186. path: "pages/weigh/index",
  4187. style: {
  4188. navigationBarTitleText: "称重",
  4189. "app-plus": {
  4190. bounce: "none",
  4191. titleNView: {
  4192. buttons: [
  4193. {
  4194. fontSize: "16px",
  4195. text: "历史"
  4196. }
  4197. ],
  4198. backButton: {
  4199. background: "#00FF00"
  4200. }
  4201. }
  4202. }
  4203. }
  4204. },
  4205. {
  4206. path: "pages/weigh/instockLog",
  4207. style: {
  4208. navigationBarTitleText: "录入历史"
  4209. }
  4210. },
  4211. {
  4212. path: "pages/inbound/index",
  4213. style: {
  4214. navigationBarTitleText: "入库",
  4215. "app-plus": {
  4216. bounce: "none",
  4217. titleNView: {
  4218. buttons: [
  4219. {
  4220. fontSize: "16px",
  4221. text: "历史"
  4222. }
  4223. ],
  4224. backButton: {
  4225. background: "#00FF00"
  4226. }
  4227. }
  4228. }
  4229. }
  4230. },
  4231. {
  4232. path: "pages/inbound/instockLog",
  4233. style: {
  4234. navigationBarTitleText: "录入历史"
  4235. }
  4236. },
  4237. {
  4238. path: "pages/outbound/index",
  4239. style: {
  4240. navigationBarTitleText: "出库",
  4241. "app-plus": {
  4242. bounce: "none",
  4243. titleNView: {
  4244. buttons: [
  4245. {
  4246. fontSize: "16px",
  4247. text: "历史"
  4248. }
  4249. ],
  4250. backButton: {
  4251. background: "#00FF00"
  4252. }
  4253. }
  4254. }
  4255. }
  4256. },
  4257. {
  4258. path: "pages/outbound/instockLog",
  4259. style: {
  4260. navigationBarTitleText: "录入历史"
  4261. }
  4262. },
  4263. {
  4264. path: "pages/profile/index",
  4265. style: {
  4266. navigationBarTitleText: "我的"
  4267. }
  4268. },
  4269. {
  4270. path: "pages/login/index",
  4271. style: {
  4272. navigationBarTitleText: "登录"
  4273. }
  4274. },
  4275. {
  4276. path: "pages/order/index",
  4277. style: {
  4278. navigationBarTitleText: "ORDER"
  4279. }
  4280. },
  4281. {
  4282. path: "pages/scanLotno/index",
  4283. style: {
  4284. navigationBarTitleText: "托盘/批次",
  4285. "app-plus": {
  4286. bounce: "none",
  4287. titleNView: {
  4288. buttons: [
  4289. {
  4290. fontSize: "16px",
  4291. text: "历史"
  4292. }
  4293. ],
  4294. backButton: {
  4295. background: "#00FF00"
  4296. }
  4297. }
  4298. }
  4299. }
  4300. },
  4301. {
  4302. path: "pages/scanLotno/lotnoLog",
  4303. style: {
  4304. navigationBarTitleText: "录入历史"
  4305. }
  4306. },
  4307. {
  4308. path: "pages/scanLotno/waybillsList",
  4309. style: {
  4310. navigationBarTitleText: "运单列表"
  4311. }
  4312. },
  4313. {
  4314. path: "pages/warehouseScan/index",
  4315. style: {
  4316. navigationBarTitleText: "仓库扫描",
  4317. "app-plus": {
  4318. bounce: "none",
  4319. titleNView: {
  4320. buttons: [
  4321. {
  4322. fontSize: "16px",
  4323. text: "历史"
  4324. }
  4325. ],
  4326. backButton: {
  4327. background: "#00FF00"
  4328. }
  4329. }
  4330. }
  4331. }
  4332. },
  4333. {
  4334. path: "pages/warehouseScan/warehouseLog",
  4335. style: {
  4336. navigationBarTitleText: "录入历史"
  4337. }
  4338. },
  4339. {
  4340. path: "pages/waybillNo/index",
  4341. style: {
  4342. navigationBarTitleText: "库位绑定",
  4343. "app-plus": {
  4344. bounce: "none",
  4345. titleNView: {
  4346. buttons: [
  4347. {
  4348. fontSize: "16px",
  4349. text: "历史"
  4350. }
  4351. ],
  4352. backButton: {
  4353. background: "#00FF00"
  4354. }
  4355. }
  4356. }
  4357. }
  4358. },
  4359. {
  4360. path: "pages/waybillNo/waybillNoLog",
  4361. style: {
  4362. navigationBarTitleText: "录入历史"
  4363. }
  4364. },
  4365. {
  4366. path: "pages/waybillDeliveryOrder/index",
  4367. style: {
  4368. navigationBarTitleText: "派送单",
  4369. "app-plus": {
  4370. bounce: "none",
  4371. titleNView: {
  4372. buttons: [
  4373. {
  4374. fontSize: "16px",
  4375. text: "筛选"
  4376. }
  4377. ],
  4378. backButton: {
  4379. background: "#00FF00"
  4380. }
  4381. }
  4382. }
  4383. }
  4384. },
  4385. {
  4386. path: "pages/waybillDeliveryOrder/orderInfo",
  4387. style: {
  4388. navigationBarTitleText: "派送详情"
  4389. }
  4390. },
  4391. {
  4392. path: "pages/printer/index",
  4393. style: {
  4394. navigationBarTitleText: "打印"
  4395. }
  4396. },
  4397. {
  4398. path: "pages/printer/label",
  4399. style: {
  4400. navigationBarTitleText: "打印Label"
  4401. }
  4402. }
  4403. ];
  4404. const globalStyle = {
  4405. navigationBarTextStyle: "black",
  4406. navigationBarTitleText: "uni-app",
  4407. navigationBarBackgroundColor: "#F8F8F8",
  4408. backgroundColor: "#F8F8F8"
  4409. };
  4410. const tabBar = {
  4411. color: "#7A7E83",
  4412. selectedColor: "#007AFF",
  4413. borderStyle: "black",
  4414. backgroundColor: "#F8F8F8",
  4415. list: [
  4416. {
  4417. pagePath: "pages/home/index",
  4418. iconPath: "static/home.png",
  4419. selectedIconPath: "static/home_fill.png",
  4420. text: "首页"
  4421. },
  4422. {
  4423. pagePath: "pages/profile/index",
  4424. iconPath: "static/people.png",
  4425. selectedIconPath: "static/people_fill.png",
  4426. text: "我的"
  4427. }
  4428. ]
  4429. };
  4430. const uniIdRouter = {};
  4431. const e = {
  4432. pages,
  4433. globalStyle,
  4434. tabBar,
  4435. uniIdRouter
  4436. };
  4437. var define_process_env_UNI_SECURE_NETWORK_CONFIG_default = [];
  4438. function t$1(e2) {
  4439. return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
  4440. }
  4441. function n(e2, t2, n2) {
  4442. return e2(n2 = { path: t2, exports: {}, require: function(e3, t3) {
  4443. return function() {
  4444. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  4445. }(null == t3 && n2.path);
  4446. } }, n2.exports), n2.exports;
  4447. }
  4448. var s = n(function(e2, t2) {
  4449. var n2;
  4450. e2.exports = (n2 = n2 || function(e3, t3) {
  4451. var n3 = Object.create || /* @__PURE__ */ function() {
  4452. function e4() {
  4453. }
  4454. return function(t4) {
  4455. var n4;
  4456. return e4.prototype = t4, n4 = new e4(), e4.prototype = null, n4;
  4457. };
  4458. }(), s2 = {}, r2 = s2.lib = {}, i2 = r2.Base = { extend: function(e4) {
  4459. var t4 = n3(this);
  4460. return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") && this.init !== t4.init || (t4.init = function() {
  4461. t4.$super.init.apply(this, arguments);
  4462. }), t4.init.prototype = t4, t4.$super = this, t4;
  4463. }, create: function() {
  4464. var e4 = this.extend();
  4465. return e4.init.apply(e4, arguments), e4;
  4466. }, init: function() {
  4467. }, mixIn: function(e4) {
  4468. for (var t4 in e4)
  4469. e4.hasOwnProperty(t4) && (this[t4] = e4[t4]);
  4470. e4.hasOwnProperty("toString") && (this.toString = e4.toString);
  4471. }, clone: function() {
  4472. return this.init.prototype.extend(this);
  4473. } }, o2 = r2.WordArray = i2.extend({ init: function(e4, n4) {
  4474. e4 = this.words = e4 || [], this.sigBytes = n4 != t3 ? n4 : 4 * e4.length;
  4475. }, toString: function(e4) {
  4476. return (e4 || c2).stringify(this);
  4477. }, concat: function(e4) {
  4478. var t4 = this.words, n4 = e4.words, s3 = this.sigBytes, r3 = e4.sigBytes;
  4479. if (this.clamp(), s3 % 4)
  4480. for (var i3 = 0; i3 < r3; i3++) {
  4481. var o3 = n4[i3 >>> 2] >>> 24 - i3 % 4 * 8 & 255;
  4482. t4[s3 + i3 >>> 2] |= o3 << 24 - (s3 + i3) % 4 * 8;
  4483. }
  4484. else
  4485. for (i3 = 0; i3 < r3; i3 += 4)
  4486. t4[s3 + i3 >>> 2] = n4[i3 >>> 2];
  4487. return this.sigBytes += r3, this;
  4488. }, clamp: function() {
  4489. var t4 = this.words, n4 = this.sigBytes;
  4490. t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4);
  4491. }, clone: function() {
  4492. var e4 = i2.clone.call(this);
  4493. return e4.words = this.words.slice(0), e4;
  4494. }, random: function(t4) {
  4495. for (var n4, s3 = [], r3 = function(t5) {
  4496. var n5 = 987654321, s4 = 4294967295;
  4497. return function() {
  4498. var r4 = ((n5 = 36969 * (65535 & n5) + (n5 >> 16) & s4) << 16) + (t5 = 18e3 * (65535 & t5) + (t5 >> 16) & s4) & s4;
  4499. return r4 /= 4294967296, (r4 += 0.5) * (e3.random() > 0.5 ? 1 : -1);
  4500. };
  4501. }, i3 = 0; i3 < t4; i3 += 4) {
  4502. var a3 = r3(4294967296 * (n4 || e3.random()));
  4503. n4 = 987654071 * a3(), s3.push(4294967296 * a3() | 0);
  4504. }
  4505. return new o2.init(s3, t4);
  4506. } }), a2 = s2.enc = {}, c2 = a2.Hex = { stringify: function(e4) {
  4507. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  4508. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  4509. s3.push((i3 >>> 4).toString(16)), s3.push((15 & i3).toString(16));
  4510. }
  4511. return s3.join("");
  4512. }, parse: function(e4) {
  4513. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3 += 2)
  4514. n4[s3 >>> 3] |= parseInt(e4.substr(s3, 2), 16) << 24 - s3 % 8 * 4;
  4515. return new o2.init(n4, t4 / 2);
  4516. } }, u2 = a2.Latin1 = { stringify: function(e4) {
  4517. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  4518. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  4519. s3.push(String.fromCharCode(i3));
  4520. }
  4521. return s3.join("");
  4522. }, parse: function(e4) {
  4523. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3++)
  4524. n4[s3 >>> 2] |= (255 & e4.charCodeAt(s3)) << 24 - s3 % 4 * 8;
  4525. return new o2.init(n4, t4);
  4526. } }, h2 = a2.Utf8 = { stringify: function(e4) {
  4527. try {
  4528. return decodeURIComponent(escape(u2.stringify(e4)));
  4529. } catch (e5) {
  4530. throw new Error("Malformed UTF-8 data");
  4531. }
  4532. }, parse: function(e4) {
  4533. return u2.parse(unescape(encodeURIComponent(e4)));
  4534. } }, l2 = r2.BufferedBlockAlgorithm = i2.extend({ reset: function() {
  4535. this._data = new o2.init(), this._nDataBytes = 0;
  4536. }, _append: function(e4) {
  4537. "string" == typeof e4 && (e4 = h2.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes;
  4538. }, _process: function(t4) {
  4539. 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);
  4540. if (c3) {
  4541. for (var h3 = 0; h3 < c3; h3 += i3)
  4542. this._doProcessBlock(s3, h3);
  4543. var l3 = s3.splice(0, c3);
  4544. n4.sigBytes -= u3;
  4545. }
  4546. return new o2.init(l3, u3);
  4547. }, clone: function() {
  4548. var e4 = i2.clone.call(this);
  4549. return e4._data = this._data.clone(), e4;
  4550. }, _minBufferSize: 0 });
  4551. r2.Hasher = l2.extend({ cfg: i2.extend(), init: function(e4) {
  4552. this.cfg = this.cfg.extend(e4), this.reset();
  4553. }, reset: function() {
  4554. l2.reset.call(this), this._doReset();
  4555. }, update: function(e4) {
  4556. return this._append(e4), this._process(), this;
  4557. }, finalize: function(e4) {
  4558. return e4 && this._append(e4), this._doFinalize();
  4559. }, blockSize: 16, _createHelper: function(e4) {
  4560. return function(t4, n4) {
  4561. return new e4.init(n4).finalize(t4);
  4562. };
  4563. }, _createHmacHelper: function(e4) {
  4564. return function(t4, n4) {
  4565. return new d2.HMAC.init(e4, n4).finalize(t4);
  4566. };
  4567. } });
  4568. var d2 = s2.algo = {};
  4569. return s2;
  4570. }(Math), n2);
  4571. }), r = s, i = (n(function(e2, t2) {
  4572. var n2;
  4573. e2.exports = (n2 = r, function(e3) {
  4574. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [];
  4575. !function() {
  4576. for (var t4 = 0; t4 < 64; t4++)
  4577. a2[t4] = 4294967296 * e3.abs(e3.sin(t4 + 1)) | 0;
  4578. }();
  4579. var c2 = o2.MD5 = i2.extend({ _doReset: function() {
  4580. this._hash = new r2.init([1732584193, 4023233417, 2562383102, 271733878]);
  4581. }, _doProcessBlock: function(e4, t4) {
  4582. for (var n3 = 0; n3 < 16; n3++) {
  4583. var s3 = t4 + n3, r3 = e4[s3];
  4584. e4[s3] = 16711935 & (r3 << 8 | r3 >>> 24) | 4278255360 & (r3 << 24 | r3 >>> 8);
  4585. }
  4586. 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], T2 = e4[t4 + 12], b2 = e4[t4 + 13], E2 = e4[t4 + 14], k2 = e4[t4 + 15], P2 = i3[0], C2 = i3[1], A2 = i3[2], O2 = i3[3];
  4587. P2 = u2(P2, C2, A2, O2, o3, 7, a2[0]), O2 = u2(O2, P2, C2, A2, c3, 12, a2[1]), A2 = u2(A2, O2, P2, C2, p2, 17, a2[2]), C2 = u2(C2, A2, O2, P2, f2, 22, a2[3]), P2 = u2(P2, C2, A2, O2, g2, 7, a2[4]), O2 = u2(O2, P2, C2, A2, m2, 12, a2[5]), A2 = u2(A2, O2, P2, C2, y2, 17, a2[6]), C2 = u2(C2, A2, O2, P2, _2, 22, a2[7]), P2 = u2(P2, C2, A2, O2, w2, 7, a2[8]), O2 = u2(O2, P2, C2, A2, v2, 12, a2[9]), A2 = u2(A2, O2, P2, C2, I2, 17, a2[10]), C2 = u2(C2, A2, O2, P2, S2, 22, a2[11]), P2 = u2(P2, C2, A2, O2, T2, 7, a2[12]), O2 = u2(O2, P2, C2, A2, b2, 12, a2[13]), A2 = u2(A2, O2, P2, C2, E2, 17, a2[14]), P2 = h2(P2, C2 = u2(C2, A2, O2, P2, k2, 22, a2[15]), A2, O2, c3, 5, a2[16]), O2 = h2(O2, P2, C2, A2, y2, 9, a2[17]), A2 = h2(A2, O2, P2, C2, S2, 14, a2[18]), C2 = h2(C2, A2, O2, P2, o3, 20, a2[19]), P2 = h2(P2, C2, A2, O2, m2, 5, a2[20]), O2 = h2(O2, P2, C2, A2, I2, 9, a2[21]), A2 = h2(A2, O2, P2, C2, k2, 14, a2[22]), C2 = h2(C2, A2, O2, P2, g2, 20, a2[23]), P2 = h2(P2, C2, A2, O2, v2, 5, a2[24]), O2 = h2(O2, P2, C2, A2, E2, 9, a2[25]), A2 = h2(A2, O2, P2, C2, f2, 14, a2[26]), C2 = h2(C2, A2, O2, P2, w2, 20, a2[27]), P2 = h2(P2, C2, A2, O2, b2, 5, a2[28]), O2 = h2(O2, P2, C2, A2, p2, 9, a2[29]), A2 = h2(A2, O2, P2, C2, _2, 14, a2[30]), P2 = l2(P2, C2 = h2(C2, A2, O2, P2, T2, 20, a2[31]), A2, O2, m2, 4, a2[32]), O2 = l2(O2, P2, C2, A2, w2, 11, a2[33]), A2 = l2(A2, O2, P2, C2, S2, 16, a2[34]), C2 = l2(C2, A2, O2, P2, E2, 23, a2[35]), P2 = l2(P2, C2, A2, O2, c3, 4, a2[36]), O2 = l2(O2, P2, C2, A2, g2, 11, a2[37]), A2 = l2(A2, O2, P2, C2, _2, 16, a2[38]), C2 = l2(C2, A2, O2, P2, I2, 23, a2[39]), P2 = l2(P2, C2, A2, O2, b2, 4, a2[40]), O2 = l2(O2, P2, C2, A2, o3, 11, a2[41]), A2 = l2(A2, O2, P2, C2, f2, 16, a2[42]), C2 = l2(C2, A2, O2, P2, y2, 23, a2[43]), P2 = l2(P2, C2, A2, O2, v2, 4, a2[44]), O2 = l2(O2, P2, C2, A2, T2, 11, a2[45]), A2 = l2(A2, O2, P2, C2, k2, 16, a2[46]), P2 = d2(P2, C2 = l2(C2, A2, O2, P2, p2, 23, a2[47]), A2, O2, o3, 6, a2[48]), O2 = d2(O2, P2, C2, A2, _2, 10, a2[49]), A2 = d2(A2, O2, P2, C2, E2, 15, a2[50]), C2 = d2(C2, A2, O2, P2, m2, 21, a2[51]), P2 = d2(P2, C2, A2, O2, T2, 6, a2[52]), O2 = d2(O2, P2, C2, A2, f2, 10, a2[53]), A2 = d2(A2, O2, P2, C2, I2, 15, a2[54]), C2 = d2(C2, A2, O2, P2, c3, 21, a2[55]), P2 = d2(P2, C2, A2, O2, w2, 6, a2[56]), O2 = d2(O2, P2, C2, A2, k2, 10, a2[57]), A2 = d2(A2, O2, P2, C2, y2, 15, a2[58]), C2 = d2(C2, A2, O2, P2, b2, 21, a2[59]), P2 = d2(P2, C2, A2, O2, g2, 6, a2[60]), O2 = d2(O2, P2, C2, A2, S2, 10, a2[61]), A2 = d2(A2, O2, P2, C2, p2, 15, a2[62]), C2 = d2(C2, A2, O2, P2, v2, 21, a2[63]), i3[0] = i3[0] + P2 | 0, i3[1] = i3[1] + C2 | 0, i3[2] = i3[2] + A2 | 0, i3[3] = i3[3] + O2 | 0;
  4588. }, _doFinalize: function() {
  4589. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  4590. n3[r3 >>> 5] |= 128 << 24 - r3 % 32;
  4591. var i3 = e3.floor(s3 / 4294967296), o3 = s3;
  4592. 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();
  4593. for (var a3 = this._hash, c3 = a3.words, u3 = 0; u3 < 4; u3++) {
  4594. var h3 = c3[u3];
  4595. c3[u3] = 16711935 & (h3 << 8 | h3 >>> 24) | 4278255360 & (h3 << 24 | h3 >>> 8);
  4596. }
  4597. return a3;
  4598. }, clone: function() {
  4599. var e4 = i2.clone.call(this);
  4600. return e4._hash = this._hash.clone(), e4;
  4601. } });
  4602. function u2(e4, t4, n3, s3, r3, i3, o3) {
  4603. var a3 = e4 + (t4 & n3 | ~t4 & s3) + r3 + o3;
  4604. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  4605. }
  4606. function h2(e4, t4, n3, s3, r3, i3, o3) {
  4607. var a3 = e4 + (t4 & s3 | n3 & ~s3) + r3 + o3;
  4608. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  4609. }
  4610. function l2(e4, t4, n3, s3, r3, i3, o3) {
  4611. var a3 = e4 + (t4 ^ n3 ^ s3) + r3 + o3;
  4612. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  4613. }
  4614. function d2(e4, t4, n3, s3, r3, i3, o3) {
  4615. var a3 = e4 + (n3 ^ (t4 | ~s3)) + r3 + o3;
  4616. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  4617. }
  4618. t3.MD5 = i2._createHelper(c2), t3.HmacMD5 = i2._createHmacHelper(c2);
  4619. }(Math), n2.MD5);
  4620. }), n(function(e2, t2) {
  4621. var n2;
  4622. e2.exports = (n2 = r, void function() {
  4623. var e3 = n2, t3 = e3.lib.Base, s2 = e3.enc.Utf8;
  4624. e3.algo.HMAC = t3.extend({ init: function(e4, t4) {
  4625. e4 = this._hasher = new e4.init(), "string" == typeof t4 && (t4 = s2.parse(t4));
  4626. var n3 = e4.blockSize, r2 = 4 * n3;
  4627. t4.sigBytes > r2 && (t4 = e4.finalize(t4)), t4.clamp();
  4628. for (var i2 = this._oKey = t4.clone(), o2 = this._iKey = t4.clone(), a2 = i2.words, c2 = o2.words, u2 = 0; u2 < n3; u2++)
  4629. a2[u2] ^= 1549556828, c2[u2] ^= 909522486;
  4630. i2.sigBytes = o2.sigBytes = r2, this.reset();
  4631. }, reset: function() {
  4632. var e4 = this._hasher;
  4633. e4.reset(), e4.update(this._iKey);
  4634. }, update: function(e4) {
  4635. return this._hasher.update(e4), this;
  4636. }, finalize: function(e4) {
  4637. var t4 = this._hasher, n3 = t4.finalize(e4);
  4638. return t4.reset(), t4.finalize(this._oKey.clone().concat(n3));
  4639. } });
  4640. }());
  4641. }), n(function(e2, t2) {
  4642. e2.exports = r.HmacMD5;
  4643. })), o = n(function(e2, t2) {
  4644. e2.exports = r.enc.Utf8;
  4645. }), a = n(function(e2, t2) {
  4646. var n2;
  4647. e2.exports = (n2 = r, function() {
  4648. var e3 = n2, t3 = e3.lib.WordArray;
  4649. function s2(e4, n3, s3) {
  4650. for (var r2 = [], i2 = 0, o2 = 0; o2 < n3; o2++)
  4651. if (o2 % 4) {
  4652. var a2 = s3[e4.charCodeAt(o2 - 1)] << o2 % 4 * 2, c2 = s3[e4.charCodeAt(o2)] >>> 6 - o2 % 4 * 2;
  4653. r2[i2 >>> 2] |= (a2 | c2) << 24 - i2 % 4 * 8, i2++;
  4654. }
  4655. return t3.create(r2, i2);
  4656. }
  4657. e3.enc.Base64 = { stringify: function(e4) {
  4658. var t4 = e4.words, n3 = e4.sigBytes, s3 = this._map;
  4659. e4.clamp();
  4660. for (var r2 = [], i2 = 0; i2 < n3; i2 += 3)
  4661. 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++)
  4662. r2.push(s3.charAt(o2 >>> 6 * (3 - a2) & 63));
  4663. var c2 = s3.charAt(64);
  4664. if (c2)
  4665. for (; r2.length % 4; )
  4666. r2.push(c2);
  4667. return r2.join("");
  4668. }, parse: function(e4) {
  4669. var t4 = e4.length, n3 = this._map, r2 = this._reverseMap;
  4670. if (!r2) {
  4671. r2 = this._reverseMap = [];
  4672. for (var i2 = 0; i2 < n3.length; i2++)
  4673. r2[n3.charCodeAt(i2)] = i2;
  4674. }
  4675. var o2 = n3.charAt(64);
  4676. if (o2) {
  4677. var a2 = e4.indexOf(o2);
  4678. -1 !== a2 && (t4 = a2);
  4679. }
  4680. return s2(e4, t4, r2);
  4681. }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
  4682. }(), n2.enc.Base64);
  4683. });
  4684. const c = "uni_id_token", u = "uni_id_token_expired", h = "uniIdToken", l = { DEFAULT: "FUNCTION", FUNCTION: "FUNCTION", OBJECT: "OBJECT", CLIENT_DB: "CLIENT_DB" }, d = "pending", p = "fulfilled", f = "rejected";
  4685. function g(e2) {
  4686. return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase();
  4687. }
  4688. function m(e2) {
  4689. return "object" === g(e2);
  4690. }
  4691. function y(e2) {
  4692. return "function" == typeof e2;
  4693. }
  4694. function _(e2) {
  4695. return function() {
  4696. try {
  4697. return e2.apply(e2, arguments);
  4698. } catch (e3) {
  4699. console.error(e3);
  4700. }
  4701. };
  4702. }
  4703. const w = "REJECTED", v = "NOT_PENDING";
  4704. class I {
  4705. constructor({ createPromise: e2, retryRule: t2 = w } = {}) {
  4706. this.createPromise = e2, this.status = null, this.promise = null, this.retryRule = t2;
  4707. }
  4708. get needRetry() {
  4709. if (!this.status)
  4710. return true;
  4711. switch (this.retryRule) {
  4712. case w:
  4713. return this.status === f;
  4714. case v:
  4715. return this.status !== d;
  4716. }
  4717. }
  4718. exec() {
  4719. 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;
  4720. }
  4721. }
  4722. class S {
  4723. constructor() {
  4724. this._callback = {};
  4725. }
  4726. addListener(e2, t2) {
  4727. this._callback[e2] || (this._callback[e2] = []), this._callback[e2].push(t2);
  4728. }
  4729. on(e2, t2) {
  4730. return this.addListener(e2, t2);
  4731. }
  4732. removeListener(e2, t2) {
  4733. if (!t2)
  4734. throw new Error('The "listener" argument must be of type function. Received undefined');
  4735. const n2 = this._callback[e2];
  4736. if (!n2)
  4737. return;
  4738. const s2 = function(e3, t3) {
  4739. for (let n3 = e3.length - 1; n3 >= 0; n3--)
  4740. if (e3[n3] === t3)
  4741. return n3;
  4742. return -1;
  4743. }(n2, t2);
  4744. n2.splice(s2, 1);
  4745. }
  4746. off(e2, t2) {
  4747. return this.removeListener(e2, t2);
  4748. }
  4749. removeAllListener(e2) {
  4750. delete this._callback[e2];
  4751. }
  4752. emit(e2, ...t2) {
  4753. const n2 = this._callback[e2];
  4754. if (n2)
  4755. for (let e3 = 0; e3 < n2.length; e3++)
  4756. n2[e3](...t2);
  4757. }
  4758. }
  4759. function T(e2) {
  4760. return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
  4761. }
  4762. const b = true, E = "app", P = T(define_process_env_UNI_SECURE_NETWORK_CONFIG_default), C = E, A = T(""), O = T("[]") || [];
  4763. let N = "";
  4764. try {
  4765. N = "__UNI__EE98A34";
  4766. } catch (e2) {
  4767. }
  4768. let R, L = {};
  4769. function U(e2, t2 = {}) {
  4770. var n2, s2;
  4771. return n2 = L, s2 = e2, Object.prototype.hasOwnProperty.call(n2, s2) || (L[e2] = t2), L[e2];
  4772. }
  4773. function D() {
  4774. return R || (R = function() {
  4775. if ("undefined" != typeof globalThis)
  4776. return globalThis;
  4777. if ("undefined" != typeof self)
  4778. return self;
  4779. if ("undefined" != typeof window)
  4780. return window;
  4781. function e2() {
  4782. return this;
  4783. }
  4784. return void 0 !== e2() ? e2() : new Function("return this")();
  4785. }(), R);
  4786. }
  4787. L = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {};
  4788. const M = ["invoke", "success", "fail", "complete"], q = U("_globalUniCloudInterceptor");
  4789. function F(e2, t2) {
  4790. q[e2] || (q[e2] = {}), m(t2) && Object.keys(t2).forEach((n2) => {
  4791. M.indexOf(n2) > -1 && function(e3, t3, n3) {
  4792. let s2 = q[e3][t3];
  4793. s2 || (s2 = q[e3][t3] = []), -1 === s2.indexOf(n3) && y(n3) && s2.push(n3);
  4794. }(e2, n2, t2[n2]);
  4795. });
  4796. }
  4797. function K(e2, t2) {
  4798. q[e2] || (q[e2] = {}), m(t2) ? Object.keys(t2).forEach((n2) => {
  4799. M.indexOf(n2) > -1 && function(e3, t3, n3) {
  4800. const s2 = q[e3][t3];
  4801. if (!s2)
  4802. return;
  4803. const r2 = s2.indexOf(n3);
  4804. r2 > -1 && s2.splice(r2, 1);
  4805. }(e2, n2, t2[n2]);
  4806. }) : delete q[e2];
  4807. }
  4808. function j(e2, t2) {
  4809. return e2 && 0 !== e2.length ? e2.reduce((e3, n2) => e3.then(() => n2(t2)), Promise.resolve()) : Promise.resolve();
  4810. }
  4811. function $(e2, t2) {
  4812. return q[e2] && q[e2][t2] || [];
  4813. }
  4814. function B(e2) {
  4815. F("callObject", e2);
  4816. }
  4817. const W = U("_globalUniCloudListener"), H = { RESPONSE: "response", NEED_LOGIN: "needLogin", REFRESH_TOKEN: "refreshToken" }, J = { CLIENT_DB: "clientdb", CLOUD_FUNCTION: "cloudfunction", CLOUD_OBJECT: "cloudobject" };
  4818. function z(e2) {
  4819. return W[e2] || (W[e2] = []), W[e2];
  4820. }
  4821. function V(e2, t2) {
  4822. const n2 = z(e2);
  4823. n2.includes(t2) || n2.push(t2);
  4824. }
  4825. function G(e2, t2) {
  4826. const n2 = z(e2), s2 = n2.indexOf(t2);
  4827. -1 !== s2 && n2.splice(s2, 1);
  4828. }
  4829. function Y(e2, t2) {
  4830. const n2 = z(e2);
  4831. for (let e3 = 0; e3 < n2.length; e3++) {
  4832. (0, n2[e3])(t2);
  4833. }
  4834. }
  4835. let Q, X = false;
  4836. function Z() {
  4837. return Q || (Q = new Promise((e2) => {
  4838. X && e2(), function t2() {
  4839. if ("function" == typeof getCurrentPages) {
  4840. const t3 = getCurrentPages();
  4841. t3 && t3[0] && (X = true, e2());
  4842. }
  4843. X || setTimeout(() => {
  4844. t2();
  4845. }, 30);
  4846. }();
  4847. }), Q);
  4848. }
  4849. function ee(e2) {
  4850. const t2 = {};
  4851. for (const n2 in e2) {
  4852. const s2 = e2[n2];
  4853. y(s2) && (t2[n2] = _(s2));
  4854. }
  4855. return t2;
  4856. }
  4857. class te extends Error {
  4858. constructor(e2) {
  4859. 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;
  4860. }
  4861. toJson(e2 = 0) {
  4862. if (!(e2 >= 10))
  4863. return e2++, { errCode: this.errCode, errMsg: this.errMsg, errSubject: this.errSubject, cause: this.cause && this.cause.toJson ? this.cause.toJson(e2) : this.cause };
  4864. }
  4865. }
  4866. var ne = { request: (e2) => uni.request(e2), uploadFile: (e2) => uni.uploadFile(e2), setStorageSync: (e2, t2) => uni.setStorageSync(e2, t2), getStorageSync: (e2) => uni.getStorageSync(e2), removeStorageSync: (e2) => uni.removeStorageSync(e2), clearStorageSync: () => uni.clearStorageSync(), connectSocket: (e2) => uni.connectSocket(e2) };
  4867. function se(e2) {
  4868. return e2 && se(e2.__v_raw) || e2;
  4869. }
  4870. function re() {
  4871. return { token: ne.getStorageSync(c) || ne.getStorageSync(h), tokenExpired: ne.getStorageSync(u) };
  4872. }
  4873. function ie({ token: e2, tokenExpired: t2 } = {}) {
  4874. e2 && ne.setStorageSync(c, e2), t2 && ne.setStorageSync(u, t2);
  4875. }
  4876. let oe, ae;
  4877. function ce() {
  4878. return oe || (oe = uni.getSystemInfoSync()), oe;
  4879. }
  4880. function ue() {
  4881. let e2, t2;
  4882. try {
  4883. if (uni.getLaunchOptionsSync) {
  4884. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1)
  4885. return;
  4886. const { scene: n2, channel: s2 } = uni.getLaunchOptionsSync();
  4887. e2 = s2, t2 = n2;
  4888. }
  4889. } catch (e3) {
  4890. }
  4891. return { channel: e2, scene: t2 };
  4892. }
  4893. let he = {};
  4894. function le() {
  4895. const e2 = uni.getLocale && uni.getLocale() || "en";
  4896. if (ae)
  4897. return { ...he, ...ae, locale: e2, LOCALE: e2 };
  4898. const t2 = ce(), { deviceId: n2, osName: s2, uniPlatform: r2, appId: i2 } = t2, o2 = ["appId", "appLanguage", "appName", "appVersion", "appVersionCode", "appWgtVersion", "browserName", "browserVersion", "deviceBrand", "deviceId", "deviceModel", "deviceType", "osName", "osVersion", "romName", "romVersion", "ua", "hostName", "hostVersion", "uniPlatform", "uniRuntimeVersion", "uniRuntimeVersionCode", "uniCompilerVersion", "uniCompilerVersionCode"];
  4899. for (const e3 in t2)
  4900. Object.hasOwnProperty.call(t2, e3) && -1 === o2.indexOf(e3) && delete t2[e3];
  4901. return ae = { PLATFORM: r2, OS: s2, APPID: i2, DEVICEID: n2, ...ue(), ...t2 }, { ...he, ...ae, locale: e2, LOCALE: e2 };
  4902. }
  4903. var de = { sign: function(e2, t2) {
  4904. let n2 = "";
  4905. return Object.keys(e2).sort().forEach(function(t3) {
  4906. e2[t3] && (n2 = n2 + "&" + t3 + "=" + e2[t3]);
  4907. }), n2 = n2.slice(1), i(n2, t2).toString();
  4908. }, wrappedRequest: function(e2, t2) {
  4909. return new Promise((n2, s2) => {
  4910. t2(Object.assign(e2, { complete(e3) {
  4911. e3 || (e3 = {});
  4912. const t3 = e3.data && e3.data.header && e3.data.header["x-serverless-request-id"] || e3.header && e3.header["request-id"];
  4913. if (!e3.statusCode || e3.statusCode >= 400) {
  4914. const n3 = e3.data && e3.data.error && e3.data.error.code || "SYS_ERR", r3 = e3.data && e3.data.error && e3.data.error.message || e3.errMsg || "request:fail";
  4915. return s2(new te({ code: n3, message: r3, requestId: t3 }));
  4916. }
  4917. const r2 = e3.data;
  4918. if (r2.error)
  4919. return s2(new te({ code: r2.error.code, message: r2.error.message, requestId: t3 }));
  4920. r2.result = r2.data, r2.requestId = t3, delete r2.data, n2(r2);
  4921. } }));
  4922. });
  4923. }, toBase64: function(e2) {
  4924. return a.stringify(o.parse(e2));
  4925. } };
  4926. var pe = class {
  4927. constructor(e2) {
  4928. ["spaceId", "clientSecret"].forEach((t2) => {
  4929. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  4930. throw new Error(`${t2} required`);
  4931. }), this.config = Object.assign({}, { endpoint: 0 === e2.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com" }, e2), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = ne, this._getAccessTokenPromiseHub = new I({ createPromise: () => this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then((e3) => {
  4932. if (!e3.result || !e3.result.accessToken)
  4933. throw new te({ code: "AUTH_FAILED", message: "获取accessToken失败" });
  4934. this.setAccessToken(e3.result.accessToken);
  4935. }), retryRule: v });
  4936. }
  4937. get hasAccessToken() {
  4938. return !!this.accessToken;
  4939. }
  4940. setAccessToken(e2) {
  4941. this.accessToken = e2;
  4942. }
  4943. requestWrapped(e2) {
  4944. return de.wrappedRequest(e2, this.adapter.request);
  4945. }
  4946. requestAuth(e2) {
  4947. return this.requestWrapped(e2);
  4948. }
  4949. request(e2, t2) {
  4950. return Promise.resolve().then(() => this.hasAccessToken ? t2 ? this.requestWrapped(e2) : this.requestWrapped(e2).catch((t3) => new Promise((e3, n2) => {
  4951. !t3 || "GATEWAY_INVALID_TOKEN" !== t3.code && "InvalidParameter.InvalidToken" !== t3.code ? n2(t3) : e3();
  4952. }).then(() => this.getAccessToken()).then(() => {
  4953. const t4 = this.rebuildRequest(e2);
  4954. return this.request(t4, true);
  4955. })) : this.getAccessToken().then(() => {
  4956. const t3 = this.rebuildRequest(e2);
  4957. return this.request(t3, true);
  4958. }));
  4959. }
  4960. rebuildRequest(e2) {
  4961. const t2 = Object.assign({}, e2);
  4962. 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;
  4963. }
  4964. setupRequest(e2, t2) {
  4965. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  4966. 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 };
  4967. }
  4968. getAccessToken() {
  4969. return this._getAccessTokenPromiseHub.exec();
  4970. }
  4971. async authorize() {
  4972. await this.getAccessToken();
  4973. }
  4974. callFunction(e2) {
  4975. const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
  4976. return this.request({ ...this.setupRequest(t2), timeout: e2.timeout });
  4977. }
  4978. getOSSUploadOptionsFromPath(e2) {
  4979. const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
  4980. return this.request(this.setupRequest(t2));
  4981. }
  4982. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  4983. return new Promise((o2, a2) => {
  4984. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, header: { "X-OSS-server-side-encrpytion": "AES256" }, success(e3) {
  4985. e3 && e3.statusCode < 400 ? o2(e3) : a2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  4986. }, fail(e3) {
  4987. a2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  4988. } });
  4989. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  4990. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  4991. });
  4992. });
  4993. }
  4994. reportOSSUpload(e2) {
  4995. const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
  4996. return this.request(this.setupRequest(t2));
  4997. }
  4998. async uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", cloudPathAsRealPath: s2 = false, onUploadProgress: r2, config: i2 }) {
  4999. if ("string" !== g(t2))
  5000. throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  5001. if (!(t2 = t2.trim()))
  5002. throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  5003. if (/:\/\//.test(t2))
  5004. throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  5005. const o2 = i2 && i2.envType || this.config.envType;
  5006. if (s2 && ("/" !== t2[0] && (t2 = "/" + t2), t2.indexOf("\\") > -1))
  5007. throw new te({ code: "INVALID_PARAM", message: "使用cloudPath作为路径时,cloudPath不可包含“\\”" });
  5008. 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 };
  5009. if (u2 && (_2["x-oss-security-token"] = u2), y2) {
  5010. const e3 = JSON.stringify({ callbackUrl: y2, callbackBody: JSON.stringify({ fileId: f2, spaceId: this.config.spaceId }), callbackBodyType: "application/json" });
  5011. _2.callback = de.toBase64(e3);
  5012. }
  5013. const w2 = { url: "https://" + a2.host, formData: _2, fileName: "file", name: "file", filePath: e2, fileType: n2 };
  5014. if (await this.uploadFileToOSS(Object.assign({}, w2, { onUploadProgress: r2 })), y2)
  5015. return { success: true, filePath: e2, fileID: c2 };
  5016. if ((await this.reportOSSUpload({ id: f2 })).success)
  5017. return { success: true, filePath: e2, fileID: c2 };
  5018. throw new te({ code: "UPLOAD_FAILED", message: "文件上传失败" });
  5019. }
  5020. getTempFileURL({ fileList: e2 } = {}) {
  5021. return new Promise((t2, n2) => {
  5022. Array.isArray(e2) && 0 !== e2.length || n2(new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t2({ fileList: e2.map((e3) => ({ fileID: e3, tempFileURL: e3 })) });
  5023. });
  5024. }
  5025. async getFileInfo({ fileList: e2 } = {}) {
  5026. if (!Array.isArray(e2) || 0 === e2.length)
  5027. throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  5028. const t2 = { method: "serverless.file.resource.info", params: JSON.stringify({ id: e2.map((e3) => e3.split("?")[0]).join(",") }) };
  5029. return { fileList: (await this.request(this.setupRequest(t2))).result };
  5030. }
  5031. };
  5032. var fe = { init(e2) {
  5033. const t2 = new pe(e2), n2 = { signInAnonymously: function() {
  5034. return t2.authorize();
  5035. }, getLoginState: function() {
  5036. return Promise.resolve(false);
  5037. } };
  5038. return t2.auth = function() {
  5039. return n2;
  5040. }, t2.customAuth = t2.auth, t2;
  5041. } };
  5042. const ge = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  5043. var me;
  5044. !function(e2) {
  5045. e2.local = "local", e2.none = "none", e2.session = "session";
  5046. }(me || (me = {}));
  5047. var ye = function() {
  5048. }, _e = n(function(e2, t2) {
  5049. var n2;
  5050. e2.exports = (n2 = r, function(e3) {
  5051. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [], c2 = [];
  5052. !function() {
  5053. function t4(t5) {
  5054. for (var n4 = e3.sqrt(t5), s4 = 2; s4 <= n4; s4++)
  5055. if (!(t5 % s4))
  5056. return false;
  5057. return true;
  5058. }
  5059. function n3(e4) {
  5060. return 4294967296 * (e4 - (0 | e4)) | 0;
  5061. }
  5062. for (var s3 = 2, r3 = 0; r3 < 64; )
  5063. t4(s3) && (r3 < 8 && (a2[r3] = n3(e3.pow(s3, 0.5))), c2[r3] = n3(e3.pow(s3, 1 / 3)), r3++), s3++;
  5064. }();
  5065. var u2 = [], h2 = o2.SHA256 = i2.extend({ _doReset: function() {
  5066. this._hash = new r2.init(a2.slice(0));
  5067. }, _doProcessBlock: function(e4, t4) {
  5068. for (var n3 = this._hash.words, s3 = n3[0], r3 = n3[1], i3 = n3[2], o3 = n3[3], a3 = n3[4], h3 = n3[5], l2 = n3[6], d2 = n3[7], p2 = 0; p2 < 64; p2++) {
  5069. if (p2 < 16)
  5070. u2[p2] = 0 | e4[t4 + p2];
  5071. else {
  5072. var f2 = u2[p2 - 15], g2 = (f2 << 25 | f2 >>> 7) ^ (f2 << 14 | f2 >>> 18) ^ f2 >>> 3, m2 = u2[p2 - 2], y2 = (m2 << 15 | m2 >>> 17) ^ (m2 << 13 | m2 >>> 19) ^ m2 >>> 10;
  5073. u2[p2] = g2 + u2[p2 - 7] + y2 + u2[p2 - 16];
  5074. }
  5075. var _2 = s3 & r3 ^ s3 & i3 ^ r3 & i3, w2 = (s3 << 30 | s3 >>> 2) ^ (s3 << 19 | s3 >>> 13) ^ (s3 << 10 | s3 >>> 22), v2 = d2 + ((a3 << 26 | a3 >>> 6) ^ (a3 << 21 | a3 >>> 11) ^ (a3 << 7 | a3 >>> 25)) + (a3 & h3 ^ ~a3 & l2) + c2[p2] + u2[p2];
  5076. d2 = l2, l2 = h3, h3 = a3, a3 = o3 + v2 | 0, o3 = i3, i3 = r3, r3 = s3, s3 = v2 + (w2 + _2) | 0;
  5077. }
  5078. n3[0] = n3[0] + s3 | 0, n3[1] = n3[1] + r3 | 0, n3[2] = n3[2] + i3 | 0, n3[3] = n3[3] + o3 | 0, n3[4] = n3[4] + a3 | 0, n3[5] = n3[5] + h3 | 0, n3[6] = n3[6] + l2 | 0, n3[7] = n3[7] + d2 | 0;
  5079. }, _doFinalize: function() {
  5080. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  5081. return n3[r3 >>> 5] |= 128 << 24 - r3 % 32, n3[14 + (r3 + 64 >>> 9 << 4)] = e3.floor(s3 / 4294967296), n3[15 + (r3 + 64 >>> 9 << 4)] = s3, t4.sigBytes = 4 * n3.length, this._process(), this._hash;
  5082. }, clone: function() {
  5083. var e4 = i2.clone.call(this);
  5084. return e4._hash = this._hash.clone(), e4;
  5085. } });
  5086. t3.SHA256 = i2._createHelper(h2), t3.HmacSHA256 = i2._createHmacHelper(h2);
  5087. }(Math), n2.SHA256);
  5088. }), we = _e, ve = n(function(e2, t2) {
  5089. e2.exports = r.HmacSHA256;
  5090. });
  5091. const Ie = () => {
  5092. let e2;
  5093. if (!Promise) {
  5094. e2 = () => {
  5095. }, e2.promise = {};
  5096. const t3 = () => {
  5097. throw new te({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });
  5098. };
  5099. return Object.defineProperty(e2.promise, "then", { get: t3 }), Object.defineProperty(e2.promise, "catch", { get: t3 }), e2;
  5100. }
  5101. const t2 = new Promise((t3, n2) => {
  5102. e2 = (e3, s2) => e3 ? n2(e3) : t3(s2);
  5103. });
  5104. return e2.promise = t2, e2;
  5105. };
  5106. function Se(e2) {
  5107. return void 0 === e2;
  5108. }
  5109. function Te(e2) {
  5110. return "[object Null]" === Object.prototype.toString.call(e2);
  5111. }
  5112. function be(e2 = "") {
  5113. return e2.replace(/([\s\S]+)\s+(请前往云开发AI小助手查看问题:.*)/, "$1");
  5114. }
  5115. function Ee(e2 = 32) {
  5116. const t2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  5117. let n2 = "";
  5118. for (let s2 = 0; s2 < e2; s2++)
  5119. n2 += t2.charAt(Math.floor(62 * Math.random()));
  5120. return n2;
  5121. }
  5122. var ke;
  5123. function Pe(e2) {
  5124. const t2 = (n2 = e2, "[object Array]" === Object.prototype.toString.call(n2) ? e2 : [e2]);
  5125. var n2;
  5126. for (const e3 of t2) {
  5127. const { isMatch: t3, genAdapter: n3, runtime: s2 } = e3;
  5128. if (t3())
  5129. return { adapter: n3(), runtime: s2 };
  5130. }
  5131. }
  5132. !function(e2) {
  5133. e2.WEB = "web", e2.WX_MP = "wx_mp";
  5134. }(ke || (ke = {}));
  5135. const Ce = { adapter: null, runtime: void 0 }, Ae = ["anonymousUuidKey"];
  5136. class Oe extends ye {
  5137. constructor() {
  5138. super(), Ce.adapter.root.tcbObject || (Ce.adapter.root.tcbObject = {});
  5139. }
  5140. setItem(e2, t2) {
  5141. Ce.adapter.root.tcbObject[e2] = t2;
  5142. }
  5143. getItem(e2) {
  5144. return Ce.adapter.root.tcbObject[e2];
  5145. }
  5146. removeItem(e2) {
  5147. delete Ce.adapter.root.tcbObject[e2];
  5148. }
  5149. clear() {
  5150. delete Ce.adapter.root.tcbObject;
  5151. }
  5152. }
  5153. function xe(e2, t2) {
  5154. switch (e2) {
  5155. case "local":
  5156. return t2.localStorage || new Oe();
  5157. case "none":
  5158. return new Oe();
  5159. default:
  5160. return t2.sessionStorage || new Oe();
  5161. }
  5162. }
  5163. class Ne {
  5164. constructor(e2) {
  5165. if (!this._storage) {
  5166. this._persistence = Ce.adapter.primaryStorage || e2.persistence, this._storage = xe(this._persistence, Ce.adapter);
  5167. 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 = "device_id", a2 = `token_type_${e2.env}`, c2 = `user_info_${e2.env}`;
  5168. this.keys = { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2, anonymousUuidKey: r2, loginTypeKey: i2, userInfoKey: c2, deviceIdKey: o2, tokenTypeKey: a2 };
  5169. }
  5170. }
  5171. updatePersistence(e2) {
  5172. if (e2 === this._persistence)
  5173. return;
  5174. const t2 = "local" === this._persistence;
  5175. this._persistence = e2;
  5176. const n2 = xe(e2, Ce.adapter);
  5177. for (const e3 in this.keys) {
  5178. const s2 = this.keys[e3];
  5179. if (t2 && Ae.includes(e3))
  5180. continue;
  5181. const r2 = this._storage.getItem(s2);
  5182. Se(r2) || Te(r2) || (n2.setItem(s2, r2), this._storage.removeItem(s2));
  5183. }
  5184. this._storage = n2;
  5185. }
  5186. setStore(e2, t2, n2) {
  5187. if (!this._storage)
  5188. return;
  5189. const s2 = { version: n2 || "localCachev1", content: t2 }, r2 = JSON.stringify(s2);
  5190. try {
  5191. this._storage.setItem(e2, r2);
  5192. } catch (e3) {
  5193. throw e3;
  5194. }
  5195. }
  5196. getStore(e2, t2) {
  5197. try {
  5198. if (!this._storage)
  5199. return;
  5200. } catch (e3) {
  5201. return "";
  5202. }
  5203. t2 = t2 || "localCachev1";
  5204. const n2 = this._storage.getItem(e2);
  5205. if (!n2)
  5206. return "";
  5207. if (n2.indexOf(t2) >= 0) {
  5208. return JSON.parse(n2).content;
  5209. }
  5210. return "";
  5211. }
  5212. removeStore(e2) {
  5213. this._storage.removeItem(e2);
  5214. }
  5215. }
  5216. const Re = {}, Le = {};
  5217. function Ue(e2) {
  5218. return Re[e2];
  5219. }
  5220. class De {
  5221. constructor(e2, t2) {
  5222. this.data = t2 || null, this.name = e2;
  5223. }
  5224. }
  5225. class Me extends De {
  5226. constructor(e2, t2) {
  5227. super("error", { error: e2, data: t2 }), this.error = e2;
  5228. }
  5229. }
  5230. const qe = new class {
  5231. constructor() {
  5232. this._listeners = {};
  5233. }
  5234. on(e2, t2) {
  5235. return function(e3, t3, n2) {
  5236. n2[e3] = n2[e3] || [], n2[e3].push(t3);
  5237. }(e2, t2, this._listeners), this;
  5238. }
  5239. off(e2, t2) {
  5240. return function(e3, t3, n2) {
  5241. if (n2 && n2[e3]) {
  5242. const s2 = n2[e3].indexOf(t3);
  5243. -1 !== s2 && n2[e3].splice(s2, 1);
  5244. }
  5245. }(e2, t2, this._listeners), this;
  5246. }
  5247. fire(e2, t2) {
  5248. if (e2 instanceof Me)
  5249. return console.error(e2.error), this;
  5250. const n2 = "string" == typeof e2 ? new De(e2, t2 || {}) : e2;
  5251. const s2 = n2.name;
  5252. if (this._listens(s2)) {
  5253. n2.target = this;
  5254. const e3 = this._listeners[s2] ? [...this._listeners[s2]] : [];
  5255. for (const t3 of e3)
  5256. t3.call(this, n2);
  5257. }
  5258. return this;
  5259. }
  5260. _listens(e2) {
  5261. return this._listeners[e2] && this._listeners[e2].length > 0;
  5262. }
  5263. }();
  5264. function Fe(e2, t2) {
  5265. qe.on(e2, t2);
  5266. }
  5267. function Ke(e2, t2 = {}) {
  5268. qe.fire(e2, t2);
  5269. }
  5270. function je(e2, t2) {
  5271. qe.off(e2, t2);
  5272. }
  5273. const $e = "loginStateChanged", Be = "loginStateExpire", We = "loginTypeChanged", He = "anonymousConverted", Je = "refreshAccessToken";
  5274. var ze;
  5275. !function(e2) {
  5276. 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";
  5277. }(ze || (ze = {}));
  5278. class Ve {
  5279. constructor() {
  5280. this._fnPromiseMap = /* @__PURE__ */ new Map();
  5281. }
  5282. async run(e2, t2) {
  5283. let n2 = this._fnPromiseMap.get(e2);
  5284. return n2 || (n2 = new Promise(async (n3, s2) => {
  5285. try {
  5286. await this._runIdlePromise();
  5287. const e3 = t2();
  5288. n3(await e3);
  5289. } catch (e3) {
  5290. s2(e3);
  5291. } finally {
  5292. this._fnPromiseMap.delete(e2);
  5293. }
  5294. }), this._fnPromiseMap.set(e2, n2)), n2;
  5295. }
  5296. _runIdlePromise() {
  5297. return Promise.resolve();
  5298. }
  5299. }
  5300. class Ge {
  5301. constructor(e2) {
  5302. this._singlePromise = new Ve(), this._cache = Ue(e2.env), this._baseURL = `https://${e2.env}.ap-shanghai.tcb-api.tencentcloudapi.com`, this._reqClass = new Ce.adapter.reqClass({ timeout: e2.timeout, timeoutMsg: `请求在${e2.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] });
  5303. }
  5304. _getDeviceId() {
  5305. if (this._deviceID)
  5306. return this._deviceID;
  5307. const { deviceIdKey: e2 } = this._cache.keys;
  5308. let t2 = this._cache.getStore(e2);
  5309. return "string" == typeof t2 && t2.length >= 16 && t2.length <= 48 || (t2 = Ee(), this._cache.setStore(e2, t2)), this._deviceID = t2, t2;
  5310. }
  5311. async _request(e2, t2, n2 = {}) {
  5312. const s2 = { "x-request-id": Ee(), "x-device-id": this._getDeviceId() };
  5313. if (n2.withAccessToken) {
  5314. const { tokenTypeKey: e3 } = this._cache.keys, t3 = await this.getAccessToken(), n3 = this._cache.getStore(e3);
  5315. s2.authorization = `${n3} ${t3}`;
  5316. }
  5317. return this._reqClass["get" === n2.method ? "get" : "post"]({ url: `${this._baseURL}${e2}`, data: t2, headers: s2 });
  5318. }
  5319. async _fetchAccessToken() {
  5320. const { loginTypeKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2, tokenTypeKey: s2 } = this._cache.keys, r2 = this._cache.getStore(e2);
  5321. if (r2 && r2 !== ze.ANONYMOUS)
  5322. throw new te({ code: "INVALID_OPERATION", message: "非匿名登录不支持刷新 access token" });
  5323. const i2 = await this._singlePromise.run("fetchAccessToken", async () => (await this._request("/auth/v1/signin/anonymously", {}, { method: "post" })).data), { access_token: o2, expires_in: a2, token_type: c2 } = i2;
  5324. return this._cache.setStore(s2, c2), this._cache.setStore(t2, o2), this._cache.setStore(n2, Date.now() + 1e3 * a2), o2;
  5325. }
  5326. isAccessTokenExpired(e2, t2) {
  5327. let n2 = true;
  5328. return e2 && t2 && (n2 = t2 < Date.now()), n2;
  5329. }
  5330. async getAccessToken() {
  5331. const { accessTokenKey: e2, accessTokenExpireKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2), s2 = this._cache.getStore(t2);
  5332. return this.isAccessTokenExpired(n2, s2) ? this._fetchAccessToken() : n2;
  5333. }
  5334. async refreshAccessToken() {
  5335. const { accessTokenKey: e2, accessTokenExpireKey: t2, loginTypeKey: n2 } = this._cache.keys;
  5336. return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.setStore(n2, ze.ANONYMOUS), this.getAccessToken();
  5337. }
  5338. async getUserInfo() {
  5339. return this._singlePromise.run("getUserInfo", async () => (await this._request("/auth/v1/user/me", {}, { withAccessToken: true, method: "get" })).data);
  5340. }
  5341. }
  5342. const Ye = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"], Qe = { "X-SDK-Version": "1.3.5" };
  5343. function Xe(e2, t2, n2) {
  5344. const s2 = e2[t2];
  5345. e2[t2] = function(t3) {
  5346. const r2 = {}, i2 = {};
  5347. n2.forEach((n3) => {
  5348. const { data: s3, headers: o3 } = n3.call(e2, t3);
  5349. Object.assign(r2, s3), Object.assign(i2, o3);
  5350. });
  5351. const o2 = t3.data;
  5352. return o2 && (() => {
  5353. var e3;
  5354. if (e3 = o2, "[object FormData]" !== Object.prototype.toString.call(e3))
  5355. t3.data = { ...o2, ...r2 };
  5356. else
  5357. for (const e4 in r2)
  5358. o2.append(e4, r2[e4]);
  5359. })(), t3.headers = { ...t3.headers || {}, ...i2 }, s2.call(e2, t3);
  5360. };
  5361. }
  5362. function Ze() {
  5363. const e2 = Math.random().toString(16).slice(2);
  5364. return { data: { seqId: e2 }, headers: { ...Qe, "x-seqid": e2 } };
  5365. }
  5366. class et {
  5367. constructor(e2 = {}) {
  5368. var t2;
  5369. this.config = e2, this._reqClass = new Ce.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: `请求在${this.config.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] }), this._cache = Ue(this.config.env), this._localCache = (t2 = this.config.env, Le[t2]), this.oauth = new Ge(this.config), Xe(this._reqClass, "post", [Ze]), Xe(this._reqClass, "upload", [Ze]), Xe(this._reqClass, "download", [Ze]);
  5370. }
  5371. async post(e2) {
  5372. return await this._reqClass.post(e2);
  5373. }
  5374. async upload(e2) {
  5375. return await this._reqClass.upload(e2);
  5376. }
  5377. async download(e2) {
  5378. return await this._reqClass.download(e2);
  5379. }
  5380. async refreshAccessToken() {
  5381. let e2, t2;
  5382. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  5383. try {
  5384. e2 = await this._refreshAccessTokenPromise;
  5385. } catch (e3) {
  5386. t2 = e3;
  5387. }
  5388. if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t2)
  5389. throw t2;
  5390. return e2;
  5391. }
  5392. async _refreshAccessToken() {
  5393. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2, loginTypeKey: s2, anonymousUuidKey: r2 } = this._cache.keys;
  5394. this._cache.removeStore(e2), this._cache.removeStore(t2);
  5395. let i2 = this._cache.getStore(n2);
  5396. if (!i2)
  5397. throw new te({ message: "未登录CloudBase" });
  5398. const o2 = { refresh_token: i2 }, a2 = await this.request("auth.fetchAccessTokenWithRefreshToken", o2);
  5399. if (a2.data.code) {
  5400. const { code: e3 } = a2.data;
  5401. if ("SIGN_PARAM_INVALID" === e3 || "REFRESH_TOKEN_EXPIRED" === e3 || "INVALID_REFRESH_TOKEN" === e3) {
  5402. if (this._cache.getStore(s2) === ze.ANONYMOUS && "INVALID_REFRESH_TOKEN" === e3) {
  5403. const e4 = this._cache.getStore(r2), t3 = this._cache.getStore(n2), s3 = await this.send("auth.signInAnonymously", { anonymous_uuid: e4, refresh_token: t3 });
  5404. return this.setRefreshToken(s3.refresh_token), this._refreshAccessToken();
  5405. }
  5406. Ke(Be), this._cache.removeStore(n2);
  5407. }
  5408. throw new te({ code: a2.data.code, message: `刷新access token失败:${a2.data.code}` });
  5409. }
  5410. if (a2.data.access_token)
  5411. return Ke(Je), 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 };
  5412. a2.data.refresh_token && (this._cache.removeStore(n2), this._cache.setStore(n2, a2.data.refresh_token), this._refreshAccessToken());
  5413. }
  5414. async getAccessToken() {
  5415. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2 } = this._cache.keys;
  5416. if (!this._cache.getStore(n2))
  5417. throw new te({ message: "refresh token不存在,登录状态异常" });
  5418. let s2 = this._cache.getStore(e2), r2 = this._cache.getStore(t2), i2 = true;
  5419. return this._shouldRefreshAccessTokenHook && !await this._shouldRefreshAccessTokenHook(s2, r2) && (i2 = false), (!s2 || !r2 || r2 < Date.now()) && i2 ? this.refreshAccessToken() : { accessToken: s2, accessTokenExpire: r2 };
  5420. }
  5421. async request(e2, t2, n2) {
  5422. const s2 = `x-tcb-trace_${this.config.env}`;
  5423. let r2 = "application/x-www-form-urlencoded";
  5424. const i2 = { action: e2, env: this.config.env, dataVersion: "2019-08-16", ...t2 };
  5425. let o2;
  5426. if (-1 === Ye.indexOf(e2) && (this._cache.keys, i2.access_token = await this.oauth.getAccessToken()), "storage.uploadFile" === e2) {
  5427. o2 = new FormData();
  5428. for (let e3 in o2)
  5429. o2.hasOwnProperty(e3) && void 0 !== o2[e3] && o2.append(e3, i2[e3]);
  5430. r2 = "multipart/form-data";
  5431. } else {
  5432. r2 = "application/json", o2 = {};
  5433. for (let e3 in i2)
  5434. void 0 !== i2[e3] && (o2[e3] = i2[e3]);
  5435. }
  5436. let a2 = { headers: { "content-type": r2 } };
  5437. n2 && n2.timeout && (a2.timeout = n2.timeout), n2 && n2.onUploadProgress && (a2.onUploadProgress = n2.onUploadProgress);
  5438. const c2 = this._localCache.getStore(s2);
  5439. c2 && (a2.headers["X-TCB-Trace"] = c2);
  5440. const { parse: u2, inQuery: h2, search: l2 } = t2;
  5441. let d2 = { env: this.config.env };
  5442. u2 && (d2.parse = true), h2 && (d2 = { ...h2, ...d2 });
  5443. let p2 = function(e3, t3, n3 = {}) {
  5444. const s3 = /\?/.test(t3);
  5445. let r3 = "";
  5446. for (let e4 in n3)
  5447. "" === r3 ? !s3 && (t3 += "?") : r3 += "&", r3 += `${e4}=${encodeURIComponent(n3[e4])}`;
  5448. return /^http(s)?\:\/\//.test(t3 += r3) ? t3 : `${e3}${t3}`;
  5449. }(ge, "//tcb-api.tencentcloudapi.com/web", d2);
  5450. l2 && (p2 += l2);
  5451. const f2 = await this.post({ url: p2, data: o2, ...a2 }), g2 = f2.header && f2.header["x-tcb-trace"];
  5452. if (g2 && this._localCache.setStore(s2, g2), 200 !== Number(f2.status) && 200 !== Number(f2.statusCode) || !f2.data)
  5453. throw new te({ code: "NETWORK_ERROR", message: "network request error" });
  5454. return f2;
  5455. }
  5456. async send(e2, t2 = {}, n2 = {}) {
  5457. const s2 = await this.request(e2, t2, { ...n2, onUploadProgress: t2.onUploadProgress });
  5458. if (("ACCESS_TOKEN_DISABLED" === s2.data.code || "ACCESS_TOKEN_EXPIRED" === s2.data.code) && -1 === Ye.indexOf(e2)) {
  5459. await this.oauth.refreshAccessToken();
  5460. const s3 = await this.request(e2, t2, { ...n2, onUploadProgress: t2.onUploadProgress });
  5461. if (s3.data.code)
  5462. throw new te({ code: s3.data.code, message: be(s3.data.message) });
  5463. return s3.data;
  5464. }
  5465. if (s2.data.code)
  5466. throw new te({ code: s2.data.code, message: be(s2.data.message) });
  5467. return s2.data;
  5468. }
  5469. setRefreshToken(e2) {
  5470. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  5471. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  5472. }
  5473. }
  5474. const tt = {};
  5475. function nt(e2) {
  5476. return tt[e2];
  5477. }
  5478. class st {
  5479. constructor(e2) {
  5480. this.config = e2, this._cache = Ue(e2.env), this._request = nt(e2.env);
  5481. }
  5482. setRefreshToken(e2) {
  5483. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  5484. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  5485. }
  5486. setAccessToken(e2, t2) {
  5487. const { accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys;
  5488. this._cache.setStore(n2, e2), this._cache.setStore(s2, t2);
  5489. }
  5490. async refreshUserInfo() {
  5491. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  5492. return this.setLocalUserInfo(e2), e2;
  5493. }
  5494. setLocalUserInfo(e2) {
  5495. const { userInfoKey: t2 } = this._cache.keys;
  5496. this._cache.setStore(t2, e2);
  5497. }
  5498. }
  5499. class rt {
  5500. constructor(e2) {
  5501. if (!e2)
  5502. throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
  5503. this._envId = e2, this._cache = Ue(this._envId), this._request = nt(this._envId), this.setUserInfo();
  5504. }
  5505. linkWithTicket(e2) {
  5506. if ("string" != typeof e2)
  5507. throw new te({ code: "PARAM_ERROR", message: "ticket must be string" });
  5508. return this._request.send("auth.linkWithTicket", { ticket: e2 });
  5509. }
  5510. linkWithRedirect(e2) {
  5511. e2.signInWithRedirect();
  5512. }
  5513. updatePassword(e2, t2) {
  5514. return this._request.send("auth.updatePassword", { oldPassword: t2, newPassword: e2 });
  5515. }
  5516. updateEmail(e2) {
  5517. return this._request.send("auth.updateEmail", { newEmail: e2 });
  5518. }
  5519. updateUsername(e2) {
  5520. if ("string" != typeof e2)
  5521. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  5522. return this._request.send("auth.updateUsername", { username: e2 });
  5523. }
  5524. async getLinkedUidList() {
  5525. const { data: e2 } = await this._request.send("auth.getLinkedUidList", {});
  5526. let t2 = false;
  5527. const { users: n2 } = e2;
  5528. return n2.forEach((e3) => {
  5529. e3.wxOpenId && e3.wxPublicId && (t2 = true);
  5530. }), { users: n2, hasPrimaryUid: t2 };
  5531. }
  5532. setPrimaryUid(e2) {
  5533. return this._request.send("auth.setPrimaryUid", { uid: e2 });
  5534. }
  5535. unlink(e2) {
  5536. return this._request.send("auth.unlink", { platform: e2 });
  5537. }
  5538. async update(e2) {
  5539. 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 });
  5540. this.setLocalUserInfo(a2);
  5541. }
  5542. async refresh() {
  5543. const e2 = await this._request.oauth.getUserInfo();
  5544. return this.setLocalUserInfo(e2), e2;
  5545. }
  5546. setUserInfo() {
  5547. const { userInfoKey: e2 } = this._cache.keys, t2 = this._cache.getStore(e2);
  5548. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach((e3) => {
  5549. this[e3] = t2[e3];
  5550. }), this.location = { country: t2.country, province: t2.province, city: t2.city };
  5551. }
  5552. setLocalUserInfo(e2) {
  5553. const { userInfoKey: t2 } = this._cache.keys;
  5554. this._cache.setStore(t2, e2), this.setUserInfo();
  5555. }
  5556. }
  5557. class it {
  5558. constructor(e2) {
  5559. if (!e2)
  5560. throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
  5561. this._cache = Ue(e2);
  5562. 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);
  5563. this.credential = { refreshToken: r2, accessToken: i2, accessTokenExpire: o2 }, this.user = new rt(e2);
  5564. }
  5565. get isAnonymousAuth() {
  5566. return this.loginType === ze.ANONYMOUS;
  5567. }
  5568. get isCustomAuth() {
  5569. return this.loginType === ze.CUSTOM;
  5570. }
  5571. get isWeixinAuth() {
  5572. return this.loginType === ze.WECHAT || this.loginType === ze.WECHAT_OPEN || this.loginType === ze.WECHAT_PUBLIC;
  5573. }
  5574. get loginType() {
  5575. return this._cache.getStore(this._cache.keys.loginTypeKey);
  5576. }
  5577. }
  5578. class ot extends st {
  5579. async signIn() {
  5580. this._cache.updatePersistence("local"), await this._request.oauth.getAccessToken(), Ke($e), Ke(We, { env: this.config.env, loginType: ze.ANONYMOUS, persistence: "local" });
  5581. const e2 = new it(this.config.env);
  5582. return await e2.user.refresh(), e2;
  5583. }
  5584. async linkAndRetrieveDataWithTicket(e2) {
  5585. 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 });
  5586. if (i2.refresh_token)
  5587. return this._clearAnonymousUUID(), this.setRefreshToken(i2.refresh_token), await this._request.refreshAccessToken(), Ke(He, { env: this.config.env }), Ke(We, { loginType: ze.CUSTOM, persistence: "local" }), { credential: { refreshToken: i2.refresh_token } };
  5588. throw new te({ message: "匿名转化失败" });
  5589. }
  5590. _setAnonymousUUID(e2) {
  5591. const { anonymousUuidKey: t2, loginTypeKey: n2 } = this._cache.keys;
  5592. this._cache.removeStore(t2), this._cache.setStore(t2, e2), this._cache.setStore(n2, ze.ANONYMOUS);
  5593. }
  5594. _clearAnonymousUUID() {
  5595. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  5596. }
  5597. }
  5598. class at extends st {
  5599. async signIn(e2) {
  5600. if ("string" != typeof e2)
  5601. throw new te({ code: "PARAM_ERROR", message: "ticket must be a string" });
  5602. const { refreshTokenKey: t2 } = this._cache.keys, n2 = await this._request.send("auth.signInWithTicket", { ticket: e2, refresh_token: this._cache.getStore(t2) || "" });
  5603. if (n2.refresh_token)
  5604. return this.setRefreshToken(n2.refresh_token), await this._request.refreshAccessToken(), Ke($e), Ke(We, { env: this.config.env, loginType: ze.CUSTOM, persistence: this.config.persistence }), await this.refreshUserInfo(), new it(this.config.env);
  5605. throw new te({ message: "自定义登录失败" });
  5606. }
  5607. }
  5608. class ct extends st {
  5609. async signIn(e2, t2) {
  5610. if ("string" != typeof e2)
  5611. throw new te({ code: "PARAM_ERROR", message: "email must be a string" });
  5612. 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;
  5613. if (r2)
  5614. return this.setRefreshToken(r2), i2 && o2 ? this.setAccessToken(i2, o2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Ke($e), Ke(We, { env: this.config.env, loginType: ze.EMAIL, persistence: this.config.persistence }), new it(this.config.env);
  5615. throw s2.code ? new te({ code: s2.code, message: `邮箱登录失败: ${s2.message}` }) : new te({ message: "邮箱登录失败" });
  5616. }
  5617. async activate(e2) {
  5618. return this._request.send("auth.activateEndUserMail", { token: e2 });
  5619. }
  5620. async resetPasswordWithToken(e2, t2) {
  5621. return this._request.send("auth.resetPasswordWithToken", { token: e2, newPassword: t2 });
  5622. }
  5623. }
  5624. class ut extends st {
  5625. async signIn(e2, t2) {
  5626. if ("string" != typeof e2)
  5627. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  5628. "string" != typeof t2 && (t2 = "", console.warn("password is empty"));
  5629. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: ze.USERNAME, username: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token_expire: i2, access_token: o2 } = s2;
  5630. if (r2)
  5631. return this.setRefreshToken(r2), o2 && i2 ? this.setAccessToken(o2, i2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Ke($e), Ke(We, { env: this.config.env, loginType: ze.USERNAME, persistence: this.config.persistence }), new it(this.config.env);
  5632. throw s2.code ? new te({ code: s2.code, message: `用户名密码登录失败: ${s2.message}` }) : new te({ message: "用户名密码登录失败" });
  5633. }
  5634. }
  5635. class ht {
  5636. constructor(e2) {
  5637. this.config = e2, this._cache = Ue(e2.env), this._request = nt(e2.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Fe(We, this._onLoginTypeChanged);
  5638. }
  5639. get currentUser() {
  5640. const e2 = this.hasLoginState();
  5641. return e2 && e2.user || null;
  5642. }
  5643. get loginType() {
  5644. return this._cache.getStore(this._cache.keys.loginTypeKey);
  5645. }
  5646. anonymousAuthProvider() {
  5647. return new ot(this.config);
  5648. }
  5649. customAuthProvider() {
  5650. return new at(this.config);
  5651. }
  5652. emailAuthProvider() {
  5653. return new ct(this.config);
  5654. }
  5655. usernameAuthProvider() {
  5656. return new ut(this.config);
  5657. }
  5658. async signInAnonymously() {
  5659. return new ot(this.config).signIn();
  5660. }
  5661. async signInWithEmailAndPassword(e2, t2) {
  5662. return new ct(this.config).signIn(e2, t2);
  5663. }
  5664. signInWithUsernameAndPassword(e2, t2) {
  5665. return new ut(this.config).signIn(e2, t2);
  5666. }
  5667. async linkAndRetrieveDataWithTicket(e2) {
  5668. this._anonymousAuthProvider || (this._anonymousAuthProvider = new ot(this.config)), Fe(He, this._onAnonymousConverted);
  5669. return await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e2);
  5670. }
  5671. async signOut() {
  5672. if (this.loginType === ze.ANONYMOUS)
  5673. throw new te({ message: "匿名用户不支持登出操作" });
  5674. const { refreshTokenKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2 } = this._cache.keys, s2 = this._cache.getStore(e2);
  5675. if (!s2)
  5676. return;
  5677. const r2 = await this._request.send("auth.logout", { refresh_token: s2 });
  5678. return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.removeStore(n2), Ke($e), Ke(We, { env: this.config.env, loginType: ze.NULL, persistence: this.config.persistence }), r2;
  5679. }
  5680. async signUpWithEmailAndPassword(e2, t2) {
  5681. return this._request.send("auth.signUpWithEmailAndPassword", { email: e2, password: t2 });
  5682. }
  5683. async sendPasswordResetEmail(e2) {
  5684. return this._request.send("auth.sendPasswordResetEmail", { email: e2 });
  5685. }
  5686. onLoginStateChanged(e2) {
  5687. Fe($e, () => {
  5688. const t3 = this.hasLoginState();
  5689. e2.call(this, t3);
  5690. });
  5691. const t2 = this.hasLoginState();
  5692. e2.call(this, t2);
  5693. }
  5694. onLoginStateExpired(e2) {
  5695. Fe(Be, e2.bind(this));
  5696. }
  5697. onAccessTokenRefreshed(e2) {
  5698. Fe(Je, e2.bind(this));
  5699. }
  5700. onAnonymousConverted(e2) {
  5701. Fe(He, e2.bind(this));
  5702. }
  5703. onLoginTypeChanged(e2) {
  5704. Fe(We, () => {
  5705. const t2 = this.hasLoginState();
  5706. e2.call(this, t2);
  5707. });
  5708. }
  5709. async getAccessToken() {
  5710. return { accessToken: (await this._request.getAccessToken()).accessToken, env: this.config.env };
  5711. }
  5712. hasLoginState() {
  5713. const { accessTokenKey: e2, accessTokenExpireKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2), s2 = this._cache.getStore(t2);
  5714. return this._request.oauth.isAccessTokenExpired(n2, s2) ? null : new it(this.config.env);
  5715. }
  5716. async isUsernameRegistered(e2) {
  5717. if ("string" != typeof e2)
  5718. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  5719. const { data: t2 } = await this._request.send("auth.isUsernameRegistered", { username: e2 });
  5720. return t2 && t2.isRegistered;
  5721. }
  5722. getLoginState() {
  5723. return Promise.resolve(this.hasLoginState());
  5724. }
  5725. async signInWithTicket(e2) {
  5726. return new at(this.config).signIn(e2);
  5727. }
  5728. shouldRefreshAccessToken(e2) {
  5729. this._request._shouldRefreshAccessTokenHook = e2.bind(this);
  5730. }
  5731. getUserInfo() {
  5732. return this._request.send("auth.getUserInfo", {}).then((e2) => e2.code ? e2 : { ...e2.data, requestId: e2.seqId });
  5733. }
  5734. getAuthHeader() {
  5735. const { refreshTokenKey: e2, accessTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2);
  5736. return { "x-cloudbase-credentials": this._cache.getStore(t2) + "/@@/" + n2 };
  5737. }
  5738. _onAnonymousConverted(e2) {
  5739. const { env: t2 } = e2.data;
  5740. t2 === this.config.env && this._cache.updatePersistence(this.config.persistence);
  5741. }
  5742. _onLoginTypeChanged(e2) {
  5743. const { loginType: t2, persistence: n2, env: s2 } = e2.data;
  5744. s2 === this.config.env && (this._cache.updatePersistence(n2), this._cache.setStore(this._cache.keys.loginTypeKey, t2));
  5745. }
  5746. }
  5747. const lt = function(e2, t2) {
  5748. t2 = t2 || Ie();
  5749. const n2 = nt(this.config.env), { cloudPath: s2, filePath: r2, onUploadProgress: i2, fileType: o2 = "image" } = e2;
  5750. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  5751. 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 };
  5752. n2.upload({ url: a2, data: p2, file: r2, name: s2, fileType: o2, onUploadProgress: i2 }).then((e4) => {
  5753. 201 === e4.statusCode ? t2(null, { fileID: h2, requestId: d2 }) : t2(new te({ code: "STORAGE_REQUEST_FAIL", message: `STORAGE_REQUEST_FAIL: ${e4.data}` }));
  5754. }).catch((e4) => {
  5755. t2(e4);
  5756. });
  5757. }).catch((e3) => {
  5758. t2(e3);
  5759. }), t2.promise;
  5760. }, dt = function(e2, t2) {
  5761. t2 = t2 || Ie();
  5762. const n2 = nt(this.config.env), { cloudPath: s2 } = e2;
  5763. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  5764. t2(null, e3);
  5765. }).catch((e3) => {
  5766. t2(e3);
  5767. }), t2.promise;
  5768. }, pt = function({ fileList: e2 }, t2) {
  5769. if (t2 = t2 || Ie(), !e2 || !Array.isArray(e2))
  5770. return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };
  5771. for (let t3 of e2)
  5772. if (!t3 || "string" != typeof t3)
  5773. return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };
  5774. const n2 = { fileid_list: e2 };
  5775. return nt(this.config.env).send("storage.batchDeleteFile", n2).then((e3) => {
  5776. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.delete_list, requestId: e3.requestId });
  5777. }).catch((e3) => {
  5778. t2(e3);
  5779. }), t2.promise;
  5780. }, ft = function({ fileList: e2 }, t2) {
  5781. t2 = t2 || Ie(), e2 && Array.isArray(e2) || t2(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });
  5782. let n2 = [];
  5783. for (let s3 of e2)
  5784. "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的元素必须是字符串" });
  5785. const s2 = { file_list: n2 };
  5786. return nt(this.config.env).send("storage.batchGetDownloadUrl", s2).then((e3) => {
  5787. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.download_list, requestId: e3.requestId });
  5788. }).catch((e3) => {
  5789. t2(e3);
  5790. }), t2.promise;
  5791. }, gt = async function({ fileID: e2 }, t2) {
  5792. const n2 = (await ft.call(this, { fileList: [{ fileID: e2, maxAge: 600 }] })).fileList[0];
  5793. if ("SUCCESS" !== n2.code)
  5794. return t2 ? t2(n2) : new Promise((e3) => {
  5795. e3(n2);
  5796. });
  5797. const s2 = nt(this.config.env);
  5798. let r2 = n2.download_url;
  5799. if (r2 = encodeURI(r2), !t2)
  5800. return s2.download({ url: r2 });
  5801. t2(await s2.download({ url: r2 }));
  5802. }, mt = function({ name: e2, data: t2, query: n2, parse: s2, search: r2, timeout: i2 }, o2) {
  5803. const a2 = o2 || Ie();
  5804. let c2;
  5805. try {
  5806. c2 = t2 ? JSON.stringify(t2) : "";
  5807. } catch (e3) {
  5808. return Promise.reject(e3);
  5809. }
  5810. if (!e2)
  5811. return Promise.reject(new te({ code: "PARAM_ERROR", message: "函数名不能为空" }));
  5812. const u2 = { inQuery: n2, parse: s2, search: r2, function_name: e2, request_data: c2 };
  5813. return nt(this.config.env).send("functions.invokeFunction", u2, { timeout: i2 }).then((e3) => {
  5814. if (e3.code)
  5815. a2(null, e3);
  5816. else {
  5817. let t3 = e3.data.response_data;
  5818. if (s2)
  5819. a2(null, { result: t3, requestId: e3.requestId });
  5820. else
  5821. try {
  5822. t3 = JSON.parse(e3.data.response_data), a2(null, { result: t3, requestId: e3.requestId });
  5823. } catch (e4) {
  5824. a2(new te({ message: "response data must be json" }));
  5825. }
  5826. }
  5827. return a2.promise;
  5828. }).catch((e3) => {
  5829. a2(e3);
  5830. }), a2.promise;
  5831. }, yt = { timeout: 15e3, persistence: "session" }, _t = 6e5, wt = {};
  5832. class vt {
  5833. constructor(e2) {
  5834. this.config = e2 || this.config, this.authObj = void 0;
  5835. }
  5836. init(e2) {
  5837. switch (Ce.adapter || (this.requestClient = new Ce.adapter.reqClass({ timeout: e2.timeout || 5e3, timeoutMsg: `请求在${(e2.timeout || 5e3) / 1e3}s内未完成,已中断` })), this.config = { ...yt, ...e2 }, true) {
  5838. case this.config.timeout > _t:
  5839. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = _t;
  5840. break;
  5841. case this.config.timeout < 100:
  5842. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  5843. }
  5844. return new vt(this.config);
  5845. }
  5846. auth({ persistence: e2 } = {}) {
  5847. if (this.authObj)
  5848. return this.authObj;
  5849. const t2 = e2 || Ce.adapter.primaryStorage || yt.persistence;
  5850. var n2;
  5851. return t2 !== this.config.persistence && (this.config.persistence = t2), function(e3) {
  5852. const { env: t3 } = e3;
  5853. Re[t3] = new Ne(e3), Le[t3] = new Ne({ ...e3, persistence: "local" });
  5854. }(this.config), n2 = this.config, tt[n2.env] = new et(n2), this.authObj = new ht(this.config), this.authObj;
  5855. }
  5856. on(e2, t2) {
  5857. return Fe.apply(this, [e2, t2]);
  5858. }
  5859. off(e2, t2) {
  5860. return je.apply(this, [e2, t2]);
  5861. }
  5862. callFunction(e2, t2) {
  5863. return mt.apply(this, [e2, t2]);
  5864. }
  5865. deleteFile(e2, t2) {
  5866. return pt.apply(this, [e2, t2]);
  5867. }
  5868. getTempFileURL(e2, t2) {
  5869. return ft.apply(this, [e2, t2]);
  5870. }
  5871. downloadFile(e2, t2) {
  5872. return gt.apply(this, [e2, t2]);
  5873. }
  5874. uploadFile(e2, t2) {
  5875. return lt.apply(this, [e2, t2]);
  5876. }
  5877. getUploadMetadata(e2, t2) {
  5878. return dt.apply(this, [e2, t2]);
  5879. }
  5880. registerExtension(e2) {
  5881. wt[e2.name] = e2;
  5882. }
  5883. async invokeExtension(e2, t2) {
  5884. const n2 = wt[e2];
  5885. if (!n2)
  5886. throw new te({ message: `扩展${e2} 必须先注册` });
  5887. return await n2.invoke(t2, this);
  5888. }
  5889. useAdapters(e2) {
  5890. const { adapter: t2, runtime: n2 } = Pe(e2) || {};
  5891. t2 && (Ce.adapter = t2), n2 && (Ce.runtime = n2);
  5892. }
  5893. }
  5894. var It = new vt();
  5895. function St(e2, t2, n2) {
  5896. void 0 === n2 && (n2 = {});
  5897. var s2 = /\?/.test(t2), r2 = "";
  5898. for (var i2 in n2)
  5899. "" === r2 ? !s2 && (t2 += "?") : r2 += "&", r2 += i2 + "=" + encodeURIComponent(n2[i2]);
  5900. return /^http(s)?:\/\//.test(t2 += r2) ? t2 : "" + e2 + t2;
  5901. }
  5902. class Tt {
  5903. get(e2) {
  5904. const { url: t2, data: n2, headers: s2, timeout: r2 } = e2;
  5905. return new Promise((e3, i2) => {
  5906. ne.request({ url: St("https:", t2), data: n2, method: "GET", header: s2, timeout: r2, success(t3) {
  5907. e3(t3);
  5908. }, fail(e4) {
  5909. i2(e4);
  5910. } });
  5911. });
  5912. }
  5913. post(e2) {
  5914. const { url: t2, data: n2, headers: s2, timeout: r2 } = e2;
  5915. return new Promise((e3, i2) => {
  5916. ne.request({ url: St("https:", t2), data: n2, method: "POST", header: s2, timeout: r2, success(t3) {
  5917. e3(t3);
  5918. }, fail(e4) {
  5919. i2(e4);
  5920. } });
  5921. });
  5922. }
  5923. upload(e2) {
  5924. return new Promise((t2, n2) => {
  5925. const { url: s2, file: r2, data: i2, headers: o2, fileType: a2 } = e2, c2 = ne.uploadFile({ url: St("https:", s2), name: "file", formData: Object.assign({}, i2), filePath: r2, fileType: a2, header: o2, success(e3) {
  5926. const n3 = { statusCode: e3.statusCode, data: e3.data || {} };
  5927. 200 === e3.statusCode && i2.success_action_status && (n3.statusCode = parseInt(i2.success_action_status, 10)), t2(n3);
  5928. }, fail(e3) {
  5929. n2(new Error(e3.errMsg || "uploadFile:fail"));
  5930. } });
  5931. "function" == typeof e2.onUploadProgress && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((t3) => {
  5932. e2.onUploadProgress({ loaded: t3.totalBytesSent, total: t3.totalBytesExpectedToSend });
  5933. });
  5934. });
  5935. }
  5936. }
  5937. const bt = { setItem(e2, t2) {
  5938. ne.setStorageSync(e2, t2);
  5939. }, getItem: (e2) => ne.getStorageSync(e2), removeItem(e2) {
  5940. ne.removeStorageSync(e2);
  5941. }, clear() {
  5942. ne.clearStorageSync();
  5943. } };
  5944. var Et = { genAdapter: function() {
  5945. return { root: {}, reqClass: Tt, localStorage: bt, primaryStorage: "local" };
  5946. }, isMatch: function() {
  5947. return true;
  5948. }, runtime: "uni_app" };
  5949. It.useAdapters(Et);
  5950. const kt = It, Pt = kt.init;
  5951. kt.init = function(e2) {
  5952. e2.env = e2.spaceId;
  5953. const t2 = Pt.call(this, e2);
  5954. t2.config.provider = "tencent", t2.config.spaceId = e2.spaceId;
  5955. const n2 = t2.auth;
  5956. return t2.auth = function(e3) {
  5957. const t3 = n2.call(this, e3);
  5958. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach((e4) => {
  5959. var n3;
  5960. t3[e4] = (n3 = t3[e4], function(e5) {
  5961. e5 = e5 || {};
  5962. const { success: t4, fail: s2, complete: r2 } = ee(e5);
  5963. if (!(t4 || s2 || r2))
  5964. return n3.call(this, e5);
  5965. n3.call(this, e5).then((e6) => {
  5966. t4 && t4(e6), r2 && r2(e6);
  5967. }, (e6) => {
  5968. s2 && s2(e6), r2 && r2(e6);
  5969. });
  5970. }).bind(t3);
  5971. }), t3;
  5972. }, t2.customAuth = t2.auth, t2;
  5973. };
  5974. var Ct = kt;
  5975. async function At(e2, t2) {
  5976. const n2 = `http://${e2}:${t2}/system/ping`;
  5977. try {
  5978. const e3 = await (s2 = { url: n2, timeout: 500 }, new Promise((e4, t3) => {
  5979. ne.request({ ...s2, success(t4) {
  5980. e4(t4);
  5981. }, fail(e5) {
  5982. t3(e5);
  5983. } });
  5984. }));
  5985. return !(!e3.data || 0 !== e3.data.code);
  5986. } catch (e3) {
  5987. return false;
  5988. }
  5989. var s2;
  5990. }
  5991. async function Ot(e2, t2) {
  5992. let n2;
  5993. for (let s2 = 0; s2 < e2.length; s2++) {
  5994. const r2 = e2[s2];
  5995. if (await At(r2, t2)) {
  5996. n2 = r2;
  5997. break;
  5998. }
  5999. }
  6000. return { address: n2, port: t2 };
  6001. }
  6002. const xt = { "serverless.file.resource.generateProximalSign": "storage/generate-proximal-sign", "serverless.file.resource.report": "storage/report", "serverless.file.resource.delete": "storage/delete", "serverless.file.resource.getTempFileURL": "storage/get-temp-file-url" };
  6003. var Nt = class {
  6004. constructor(e2) {
  6005. if (["spaceId", "clientSecret"].forEach((t2) => {
  6006. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  6007. throw new Error(`${t2} required`);
  6008. }), !e2.endpoint)
  6009. throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");
  6010. this.config = Object.assign({}, e2), this.config.provider = "dcloud", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.adapter = ne;
  6011. }
  6012. async request(e2, t2 = true) {
  6013. const n2 = t2;
  6014. return e2 = n2 ? await this.setupLocalRequest(e2) : this.setupRequest(e2), Promise.resolve().then(() => n2 ? this.requestLocal(e2) : de.wrappedRequest(e2, this.adapter.request));
  6015. }
  6016. requestLocal(e2) {
  6017. return new Promise((t2, n2) => {
  6018. this.adapter.request(Object.assign(e2, { complete(e3) {
  6019. if (e3 || (e3 = {}), !e3.statusCode || e3.statusCode >= 400) {
  6020. const t3 = e3.data && e3.data.code || "SYS_ERR", s2 = e3.data && e3.data.message || "request:fail";
  6021. return n2(new te({ code: t3, message: s2 }));
  6022. }
  6023. t2({ success: true, result: e3.data });
  6024. } }));
  6025. });
  6026. }
  6027. setupRequest(e2) {
  6028. const t2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), n2 = { "Content-Type": "application/json" };
  6029. n2["x-serverless-sign"] = de.sign(t2, this.config.clientSecret);
  6030. const s2 = le();
  6031. n2["x-client-info"] = encodeURIComponent(JSON.stringify(s2));
  6032. const { token: r2 } = re();
  6033. return n2["x-client-token"] = r2, { url: this.config.requestUrl, method: "POST", data: t2, dataType: "json", header: JSON.parse(JSON.stringify(n2)) };
  6034. }
  6035. async setupLocalRequest(e2) {
  6036. const t2 = le(), { token: n2 } = re(), s2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now(), clientInfo: t2, token: n2 }), { address: r2, servePort: i2 } = this.__dev__ && this.__dev__.debugInfo || {}, { address: o2 } = await Ot(r2, i2);
  6037. return { url: `http://${o2}:${i2}/${xt[e2.method]}`, method: "POST", data: s2, dataType: "json", header: JSON.parse(JSON.stringify({ "Content-Type": "application/json" })) };
  6038. }
  6039. callFunction(e2) {
  6040. const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
  6041. return this.request(t2, false);
  6042. }
  6043. getUploadFileOptions(e2) {
  6044. const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
  6045. return this.request(t2);
  6046. }
  6047. reportUploadFile(e2) {
  6048. const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
  6049. return this.request(t2);
  6050. }
  6051. uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", onUploadProgress: s2 }) {
  6052. if (!t2)
  6053. throw new te({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });
  6054. let r2;
  6055. return this.getUploadFileOptions({ cloudPath: t2 }).then((t3) => {
  6056. const { url: i2, formData: o2, name: a2 } = t3.result;
  6057. return r2 = t3.result.fileUrl, new Promise((t4, r3) => {
  6058. const c2 = this.adapter.uploadFile({ url: i2, formData: o2, name: a2, filePath: e2, fileType: n2, success(e3) {
  6059. e3 && e3.statusCode < 400 ? t4(e3) : r3(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  6060. }, fail(e3) {
  6061. r3(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  6062. } });
  6063. "function" == typeof s2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  6064. s2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  6065. });
  6066. });
  6067. }).then(() => this.reportUploadFile({ cloudPath: t2 })).then((t3) => new Promise((n3, s3) => {
  6068. t3.success ? n3({ success: true, filePath: e2, fileID: r2 }) : s3(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  6069. }));
  6070. }
  6071. deleteFile({ fileList: e2 }) {
  6072. const t2 = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e2 }) };
  6073. return this.request(t2).then((e3) => {
  6074. if (e3.success)
  6075. return e3.result;
  6076. throw new te({ code: "DELETE_FILE_FAILED", message: "删除文件失败" });
  6077. });
  6078. }
  6079. getTempFileURL({ fileList: e2, maxAge: t2 } = {}) {
  6080. if (!Array.isArray(e2) || 0 === e2.length)
  6081. throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  6082. const n2 = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e2, maxAge: t2 }) };
  6083. return this.request(n2).then((e3) => {
  6084. if (e3.success)
  6085. return { fileList: e3.result.fileList.map((e4) => ({ fileID: e4.fileID, tempFileURL: e4.tempFileURL })) };
  6086. throw new te({ code: "GET_TEMP_FILE_URL_FAILED", message: "获取临时文件链接失败" });
  6087. });
  6088. }
  6089. };
  6090. var Rt = { init(e2) {
  6091. const t2 = new Nt(e2), n2 = { signInAnonymously: function() {
  6092. return Promise.resolve();
  6093. }, getLoginState: function() {
  6094. return Promise.resolve(false);
  6095. } };
  6096. return t2.auth = function() {
  6097. return n2;
  6098. }, t2.customAuth = t2.auth, t2;
  6099. } }, Lt = n(function(e2, t2) {
  6100. e2.exports = r.enc.Hex;
  6101. });
  6102. function Ut() {
  6103. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e2) {
  6104. var t2 = 16 * Math.random() | 0;
  6105. return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
  6106. });
  6107. }
  6108. function Dt(e2 = "", t2 = {}) {
  6109. const { data: n2, functionName: s2, method: r2, headers: i2, signHeaderKeys: o2 = [], config: a2 } = t2, c2 = String(Date.now()), u2 = Ut(), h2 = Object.assign({}, i2, { "x-from-app-id": a2.spaceAppId, "x-from-env-id": a2.spaceId, "x-to-env-id": a2.spaceId, "x-from-instance-id": c2, "x-from-function-name": s2, "x-client-timestamp": c2, "x-alipay-source": "client", "x-request-id": u2, "x-alipay-callid": u2, "x-trace-id": u2 }), l2 = ["x-from-app-id", "x-from-env-id", "x-to-env-id", "x-from-instance-id", "x-from-function-name", "x-client-timestamp"].concat(o2), [d2 = "", p2 = ""] = e2.split("?") || [], f2 = function(e3) {
  6110. const t3 = "HMAC-SHA256", n3 = e3.signedHeaders.join(";"), s3 = e3.signedHeaders.map((t4) => `${t4.toLowerCase()}:${e3.headers[t4]}
  6111. `).join(""), r3 = we(e3.body).toString(Lt), i3 = `${e3.method.toUpperCase()}
  6112. ${e3.path}
  6113. ${e3.query}
  6114. ${s3}
  6115. ${n3}
  6116. ${r3}
  6117. `, o3 = we(i3).toString(Lt), a3 = `${t3}
  6118. ${e3.timestamp}
  6119. ${o3}
  6120. `, c3 = ve(a3, e3.secretKey).toString(Lt);
  6121. return `${t3} Credential=${e3.secretId}, SignedHeaders=${n3}, Signature=${c3}`;
  6122. }({ path: d2, query: p2, method: r2, headers: h2, timestamp: c2, body: JSON.stringify(n2), secretId: a2.accessKey, secretKey: a2.secretKey, signedHeaders: l2.sort() });
  6123. return { url: `${a2.endpoint}${e2}`, headers: Object.assign({}, h2, { Authorization: f2 }) };
  6124. }
  6125. function Mt({ url: e2, data: t2, method: n2 = "POST", headers: s2 = {}, timeout: r2 }) {
  6126. return new Promise((i2, o2) => {
  6127. ne.request({ url: e2, method: n2, data: "object" == typeof t2 ? JSON.stringify(t2) : t2, header: s2, dataType: "json", timeout: r2, complete: (e3 = {}) => {
  6128. const t3 = s2["x-trace-id"] || "";
  6129. if (!e3.statusCode || e3.statusCode >= 400) {
  6130. const { message: n3, errMsg: s3, trace_id: r3 } = e3.data || {};
  6131. return o2(new te({ code: "SYS_ERR", message: n3 || s3 || "request:fail", requestId: r3 || t3 }));
  6132. }
  6133. i2({ status: e3.statusCode, data: e3.data, headers: e3.header, requestId: t3 });
  6134. } });
  6135. });
  6136. }
  6137. function qt(e2, t2) {
  6138. const { path: n2, data: s2, method: r2 = "GET" } = e2, { url: i2, headers: o2 } = Dt(n2, { functionName: "", data: s2, method: r2, headers: { "x-alipay-cloud-mode": "oss", "x-data-api-type": "oss", "x-expire-timestamp": Date.now() + 6e4 }, signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"], config: t2 });
  6139. return Mt({ url: i2, data: s2, method: r2, headers: o2 }).then((e3) => {
  6140. const t3 = e3.data || {};
  6141. if (!t3.success)
  6142. throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
  6143. return t3.data || {};
  6144. }).catch((e3) => {
  6145. throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
  6146. });
  6147. }
  6148. function Ft(e2 = "") {
  6149. const t2 = e2.trim().replace(/^cloud:\/\//, ""), n2 = t2.indexOf("/");
  6150. if (n2 <= 0)
  6151. throw new te({ code: "INVALID_PARAM", message: "fileID不合法" });
  6152. const s2 = t2.substring(0, n2), r2 = t2.substring(n2 + 1);
  6153. return s2 !== this.config.spaceId && console.warn("file ".concat(e2, " does not belong to env ").concat(this.config.spaceId)), r2;
  6154. }
  6155. function Kt(e2 = "") {
  6156. return "cloud://".concat(this.config.spaceId, "/").concat(e2.replace(/^\/+/, ""));
  6157. }
  6158. class jt {
  6159. constructor(e2) {
  6160. this.config = e2;
  6161. }
  6162. signedURL(e2, t2 = {}) {
  6163. const n2 = `/ws/function/${e2}`, s2 = this.config.wsEndpoint.replace(/^ws(s)?:\/\//, ""), r2 = Object.assign({}, t2, { accessKeyId: this.config.accessKey, signatureNonce: Ut(), timestamp: "" + Date.now() }), i2 = [n2, ["accessKeyId", "authorization", "signatureNonce", "timestamp"].sort().map(function(e3) {
  6164. return r2[e3] ? "".concat(e3, "=").concat(r2[e3]) : null;
  6165. }).filter(Boolean).join("&"), `host:${s2}`].join("\n"), o2 = ["HMAC-SHA256", we(i2).toString(Lt)].join("\n"), a2 = ve(o2, this.config.secretKey).toString(Lt), c2 = Object.keys(r2).map((e3) => `${e3}=${encodeURIComponent(r2[e3])}`).join("&");
  6166. return `${this.config.wsEndpoint}${n2}?${c2}&signature=${a2}`;
  6167. }
  6168. }
  6169. var $t = class {
  6170. constructor(e2) {
  6171. if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach((t2) => {
  6172. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  6173. throw new Error(`${t2} required`);
  6174. }), e2.endpoint) {
  6175. if ("string" != typeof e2.endpoint)
  6176. throw new Error("endpoint must be string");
  6177. if (!/^https:\/\//.test(e2.endpoint))
  6178. throw new Error("endpoint must start with https://");
  6179. e2.endpoint = e2.endpoint.replace(/\/$/, "");
  6180. }
  6181. this.config = Object.assign({}, e2, { endpoint: e2.endpoint || `https://${e2.spaceId}.api-hz.cloudbasefunction.cn`, wsEndpoint: e2.wsEndpoint || `wss://${e2.spaceId}.api-hz.cloudbasefunction.cn` }), this._websocket = new jt(this.config);
  6182. }
  6183. callFunction(e2) {
  6184. return function(e3, t2) {
  6185. const { name: n2, data: s2, async: r2 = false, timeout: i2 } = e3, o2 = "POST", a2 = { "x-to-function-name": n2 };
  6186. r2 && (a2["x-function-invoke-type"] = "async");
  6187. const { url: c2, headers: u2 } = Dt("/functions/invokeFunction", { functionName: n2, data: s2, method: o2, headers: a2, signHeaderKeys: ["x-to-function-name"], config: t2 });
  6188. return Mt({ url: c2, data: s2, method: o2, headers: u2, timeout: i2 }).then((e4) => {
  6189. let t3 = 0;
  6190. if (r2) {
  6191. const n3 = e4.data || {};
  6192. t3 = "200" === n3.errCode ? 0 : n3.errCode, e4.data = n3.data || {}, e4.errMsg = n3.errMsg;
  6193. }
  6194. if (0 !== t3)
  6195. throw new te({ code: t3, message: e4.errMsg, requestId: e4.requestId });
  6196. return { errCode: t3, success: 0 === t3, requestId: e4.requestId, result: e4.data };
  6197. }).catch((e4) => {
  6198. throw new te({ code: e4.errCode, message: e4.errMsg, requestId: e4.requestId });
  6199. });
  6200. }(e2, this.config);
  6201. }
  6202. uploadFileToOSS({ url: e2, filePath: t2, fileType: n2, formData: s2, onUploadProgress: r2 }) {
  6203. return new Promise((i2, o2) => {
  6204. const a2 = ne.uploadFile({ url: e2, filePath: t2, fileType: n2, formData: s2, name: "file", success(e3) {
  6205. e3 && e3.statusCode < 400 ? i2(e3) : o2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  6206. }, fail(e3) {
  6207. o2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  6208. } });
  6209. "function" == typeof r2 && a2 && "function" == typeof a2.onProgressUpdate && a2.onProgressUpdate((e3) => {
  6210. r2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  6211. });
  6212. });
  6213. }
  6214. async uploadFile({ filePath: e2, cloudPath: t2 = "", fileType: n2 = "image", onUploadProgress: s2 }) {
  6215. if ("string" !== g(t2))
  6216. throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  6217. if (!(t2 = t2.trim()))
  6218. throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  6219. if (/:\/\//.test(t2))
  6220. throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  6221. const r2 = await qt({ path: "/".concat(t2.replace(/^\//, ""), "?post_url") }, this.config), { file_id: i2, upload_url: o2, form_data: a2 } = r2, c2 = a2 && a2.reduce((e3, t3) => (e3[t3.key] = t3.value, e3), {});
  6222. return this.uploadFileToOSS({ url: o2, filePath: e2, fileType: n2, formData: c2, onUploadProgress: s2 }).then(() => ({ fileID: i2 }));
  6223. }
  6224. async getTempFileURL({ fileList: e2 }) {
  6225. return new Promise((t2, n2) => {
  6226. (!e2 || e2.length < 0) && t2({ code: "INVALID_PARAM", message: "fileList不能为空数组" }), e2.length > 50 && t2({ code: "INVALID_PARAM", message: "fileList数组长度不能超过50" });
  6227. const s2 = [];
  6228. for (const n3 of e2) {
  6229. let e3;
  6230. "string" !== g(n3) && t2({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  6231. try {
  6232. e3 = Ft.call(this, n3);
  6233. } catch (t3) {
  6234. console.warn(t3.errCode, t3.errMsg), e3 = n3;
  6235. }
  6236. s2.push({ file_id: e3, expire: 600 });
  6237. }
  6238. qt({ path: "/?download_url", data: { file_list: s2 }, method: "POST" }, this.config).then((e3) => {
  6239. const { file_list: n3 = [] } = e3;
  6240. t2({ fileList: n3.map((e4) => ({ fileID: Kt.call(this, e4.file_id), tempFileURL: e4.download_url })) });
  6241. }).catch((e3) => n2(e3));
  6242. });
  6243. }
  6244. async connectWebSocket(e2) {
  6245. const { name: t2, query: n2 } = e2;
  6246. return ne.connectSocket({ url: this._websocket.signedURL(t2, n2), complete: () => {
  6247. } });
  6248. }
  6249. };
  6250. var Bt = { init: (e2) => {
  6251. e2.provider = "alipay";
  6252. const t2 = new $t(e2);
  6253. return t2.auth = function() {
  6254. return { signInAnonymously: function() {
  6255. return Promise.resolve();
  6256. }, getLoginState: function() {
  6257. return Promise.resolve(true);
  6258. } };
  6259. }, t2;
  6260. } };
  6261. function Wt({ data: e2 }) {
  6262. let t2;
  6263. t2 = le();
  6264. const n2 = JSON.parse(JSON.stringify(e2 || {}));
  6265. if (Object.assign(n2, { clientInfo: t2 }), !n2.uniIdToken) {
  6266. const { token: e3 } = re();
  6267. e3 && (n2.uniIdToken = e3);
  6268. }
  6269. return n2;
  6270. }
  6271. async function Ht(e2 = {}) {
  6272. await this.__dev__.initLocalNetwork();
  6273. const { localAddress: t2, localPort: n2 } = this.__dev__, s2 = { aliyun: "aliyun", tencent: "tcb", alipay: "alipay", dcloud: "dcloud" }[this.config.provider], r2 = this.config.spaceId, i2 = `http://${t2}:${n2}/system/check-function`, o2 = `http://${t2}:${n2}/cloudfunctions/${e2.name}`;
  6274. return new Promise((t3, n3) => {
  6275. ne.request({ method: "POST", url: i2, data: { name: e2.name, platform: C, provider: s2, spaceId: r2 }, timeout: 3e3, success(e3) {
  6276. t3(e3);
  6277. }, fail() {
  6278. t3({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });
  6279. } });
  6280. }).then(({ data: e3 } = {}) => {
  6281. const { code: t3, message: n3 } = e3 || {};
  6282. return { code: 0 === t3 ? 0 : t3 || "SYS_ERR", message: n3 || "SYS_ERR" };
  6283. }).then(({ code: t3, message: n3 }) => {
  6284. if (0 !== t3) {
  6285. switch (t3) {
  6286. case "MODULE_ENCRYPTED":
  6287. console.error(`此云函数(${e2.name})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);
  6288. break;
  6289. case "FUNCTION_ENCRYPTED":
  6290. console.error(`此云函数(${e2.name})已加密不可本地调试,自动切换为云端已部署的云函数`);
  6291. break;
  6292. case "ACTION_ENCRYPTED":
  6293. console.error(n3 || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  6294. break;
  6295. case "NETWORK_ERROR":
  6296. console.error(n3 || "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下");
  6297. break;
  6298. case "SWITCH_TO_CLOUD":
  6299. break;
  6300. default: {
  6301. const e3 = `检测本地调试服务出现错误:${n3},请检查网络环境或重启客户端再试`;
  6302. throw console.error(e3), new Error(e3);
  6303. }
  6304. }
  6305. return this._callCloudFunction(e2);
  6306. }
  6307. return new Promise((t4, n4) => {
  6308. const r3 = Wt.call(this, { data: e2.data });
  6309. ne.request({ method: "POST", url: o2, data: { provider: s2, platform: C, param: r3 }, timeout: e2.timeout, success: ({ statusCode: e3, data: s3 } = {}) => !e3 || e3 >= 400 ? n4(new te({ code: s3.code || "SYS_ERR", message: s3.message || "request:fail" })) : t4({ result: s3 }), fail(e3) {
  6310. n4(new te({ code: e3.code || e3.errCode || "SYS_ERR", message: e3.message || e3.errMsg || "request:fail" }));
  6311. } });
  6312. });
  6313. });
  6314. }
  6315. const Jt = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];
  6316. var zt = /[\\^$.*+?()[\]{}|]/g, Vt = RegExp(zt.source);
  6317. function Gt(e2, t2, n2) {
  6318. return e2.replace(new RegExp((s2 = t2) && Vt.test(s2) ? s2.replace(zt, "\\$&") : s2, "g"), n2);
  6319. var s2;
  6320. }
  6321. const Yt = { NONE: "none", REQUEST: "request", RESPONSE: "response", BOTH: "both" }, Qt = "_globalUniCloudStatus", Xt = "_globalUniCloudSecureNetworkCache__{spaceId}";
  6322. const Un = "uni-secure-network", Dn = { SYSTEM_ERROR: { code: 2e4, message: "System error" }, APP_INFO_INVALID: { code: 20101, message: "Invalid client" }, GET_ENCRYPT_KEY_FAILED: { code: 20102, message: "Get encrypt key failed" } };
  6323. function qn(e2) {
  6324. const { errSubject: t2, subject: n2, errCode: s2, errMsg: r2, code: i2, message: o2, cause: a2 } = e2 || {};
  6325. return new te({ subject: t2 || n2 || Un, code: s2 || i2 || Dn.SYSTEM_ERROR.code, message: r2 || o2, cause: a2 });
  6326. }
  6327. let Kn;
  6328. function Hn({ secretType: e2 } = {}) {
  6329. return e2 === Yt.REQUEST || e2 === Yt.RESPONSE || e2 === Yt.BOTH;
  6330. }
  6331. function Jn({ name: e2, data: t2 = {} } = {}) {
  6332. return "DCloud-clientDB" === e2 && "encryption" === t2.redirectTo && "getAppClientKey" === t2.action;
  6333. }
  6334. function zn({ provider: e2, spaceId: t2, functionName: n2 } = {}) {
  6335. const { appId: s2, uniPlatform: r2, osName: i2 } = ce();
  6336. let o2 = r2;
  6337. "app" === r2 && (o2 = i2);
  6338. const a2 = function({ provider: e3, spaceId: t3 } = {}) {
  6339. const n3 = P;
  6340. if (!n3)
  6341. return {};
  6342. e3 = /* @__PURE__ */ function(e4) {
  6343. return "tencent" === e4 ? "tcb" : e4;
  6344. }(e3);
  6345. const s3 = n3.find((n4) => n4.provider === e3 && n4.spaceId === t3);
  6346. return s3 && s3.config;
  6347. }({ provider: e2, spaceId: t2 });
  6348. if (!a2 || !a2.accessControl || !a2.accessControl.enable)
  6349. return false;
  6350. const c2 = a2.accessControl.function || {}, u2 = Object.keys(c2);
  6351. if (0 === u2.length)
  6352. return true;
  6353. const h2 = function(e3, t3) {
  6354. let n3, s3, r3;
  6355. for (let i3 = 0; i3 < e3.length; i3++) {
  6356. const o3 = e3[i3];
  6357. o3 !== t3 ? "*" !== o3 ? o3.split(",").map((e4) => e4.trim()).indexOf(t3) > -1 && (s3 = o3) : r3 = o3 : n3 = o3;
  6358. }
  6359. return n3 || s3 || r3;
  6360. }(u2, n2);
  6361. if (!h2)
  6362. return false;
  6363. if ((c2[h2] || []).find((e3 = {}) => e3.appId === s2 && (e3.platform || "").toLowerCase() === o2.toLowerCase()))
  6364. return true;
  6365. throw console.error(`此应用[appId: ${s2}, platform: ${o2}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`), qn(Dn.APP_INFO_INVALID);
  6366. }
  6367. function Vn({ functionName: e2, result: t2, logPvd: n2 }) {
  6368. if (this.__dev__.debugLog && t2 && t2.requestId) {
  6369. const s2 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e2, requestId: t2.requestId });
  6370. console.log(`[${n2}-request]${s2}[/${n2}-request]`);
  6371. }
  6372. }
  6373. function Gn(e2) {
  6374. const t2 = e2.callFunction, n2 = function(n3) {
  6375. const s2 = n3.name;
  6376. n3.data = Wt.call(e2, { data: n3.data });
  6377. const r2 = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb", alipay: "alipay", dcloud: "dcloud" }[this.config.provider], i2 = Hn(n3), o2 = Jn(n3), a2 = i2 || o2;
  6378. return t2.call(this, n3).then((e3) => (e3.errCode = 0, !a2 && Vn.call(this, { functionName: s2, result: e3, logPvd: r2 }), Promise.resolve(e3)), (e3) => (!a2 && Vn.call(this, { functionName: s2, result: e3, logPvd: r2 }), e3 && e3.message && (e3.message = function({ message: e4 = "", extraInfo: t3 = {}, formatter: n4 = [] } = {}) {
  6379. for (let s3 = 0; s3 < n4.length; s3++) {
  6380. const { rule: r3, content: i3, mode: o3 } = n4[s3], a3 = e4.match(r3);
  6381. if (!a3)
  6382. continue;
  6383. let c2 = i3;
  6384. for (let e5 = 1; e5 < a3.length; e5++)
  6385. c2 = Gt(c2, `{$${e5}}`, a3[e5]);
  6386. for (const e5 in t3)
  6387. c2 = Gt(c2, `{${e5}}`, t3[e5]);
  6388. return "replace" === o3 ? c2 : e4 + c2;
  6389. }
  6390. return e4;
  6391. }({ message: `[${n3.name}]: ${e3.message}`, formatter: Jt, extraInfo: { functionName: s2 } })), Promise.reject(e3)));
  6392. };
  6393. e2.callFunction = function(t3) {
  6394. const { provider: s2, spaceId: r2 } = e2.config, i2 = t3.name;
  6395. let o2, a2;
  6396. if (t3.data = t3.data || {}, e2.__dev__.debugInfo && !e2.__dev__.debugInfo.forceRemote && O ? (e2._callCloudFunction || (e2._callCloudFunction = n2, e2._callLocalFunction = Ht), o2 = Ht) : o2 = n2, o2 = o2.bind(e2), Jn(t3))
  6397. a2 = n2.call(e2, t3);
  6398. else if (Hn(t3)) {
  6399. a2 = new Kn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapEncryptDataCallFunction(n2.bind(e2))(t3);
  6400. } else if (zn({ provider: s2, spaceId: r2, functionName: i2 })) {
  6401. a2 = new Kn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapVerifyClientCallFunction(n2.bind(e2))(t3);
  6402. } else
  6403. a2 = o2(t3);
  6404. return Object.defineProperty(a2, "result", { get: () => (console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {}) }), a2.then((e3) => ("undefined" != typeof UTSJSONObject && (e3.result = new UTSJSONObject(e3.result)), e3));
  6405. };
  6406. }
  6407. Kn = class {
  6408. constructor() {
  6409. throw qn({ message: `Platform ${C} is not enabled, please check whether secure network module is enabled in your manifest.json` });
  6410. }
  6411. };
  6412. const Yn = Symbol("CLIENT_DB_INTERNAL");
  6413. function Qn(e2, t2) {
  6414. return e2.then = "DoNotReturnProxyWithAFunctionNamedThen", e2._internalType = Yn, e2.inspect = null, e2.__v_raw = void 0, new Proxy(e2, { get(e3, n2, s2) {
  6415. if ("_uniClient" === n2)
  6416. return null;
  6417. if ("symbol" == typeof n2)
  6418. return e3[n2];
  6419. if (n2 in e3 || "string" != typeof n2) {
  6420. const t3 = e3[n2];
  6421. return "function" == typeof t3 ? t3.bind(e3) : t3;
  6422. }
  6423. return t2.get(e3, n2, s2);
  6424. } });
  6425. }
  6426. function Xn(e2) {
  6427. return { on: (t2, n2) => {
  6428. e2[t2] = e2[t2] || [], e2[t2].indexOf(n2) > -1 || e2[t2].push(n2);
  6429. }, off: (t2, n2) => {
  6430. e2[t2] = e2[t2] || [];
  6431. const s2 = e2[t2].indexOf(n2);
  6432. -1 !== s2 && e2[t2].splice(s2, 1);
  6433. } };
  6434. }
  6435. const Zn = ["db.Geo", "db.command", "command.aggregate"];
  6436. function es(e2, t2) {
  6437. return Zn.indexOf(`${e2}.${t2}`) > -1;
  6438. }
  6439. function ts(e2) {
  6440. switch (g(e2 = se(e2))) {
  6441. case "array":
  6442. return e2.map((e3) => ts(e3));
  6443. case "object":
  6444. return e2._internalType === Yn || Object.keys(e2).forEach((t2) => {
  6445. e2[t2] = ts(e2[t2]);
  6446. }), e2;
  6447. case "regexp":
  6448. return { $regexp: { source: e2.source, flags: e2.flags } };
  6449. case "date":
  6450. return { $date: e2.toISOString() };
  6451. default:
  6452. return e2;
  6453. }
  6454. }
  6455. function ns(e2) {
  6456. return e2 && e2.content && e2.content.$method;
  6457. }
  6458. class ss {
  6459. constructor(e2, t2, n2) {
  6460. this.content = e2, this.prevStage = t2 || null, this.udb = null, this._database = n2;
  6461. }
  6462. toJSON() {
  6463. let e2 = this;
  6464. const t2 = [e2.content];
  6465. for (; e2.prevStage; )
  6466. e2 = e2.prevStage, t2.push(e2.content);
  6467. return { $db: t2.reverse().map((e3) => ({ $method: e3.$method, $param: ts(e3.$param) })) };
  6468. }
  6469. toString() {
  6470. return JSON.stringify(this.toJSON());
  6471. }
  6472. getAction() {
  6473. const e2 = this.toJSON().$db.find((e3) => "action" === e3.$method);
  6474. return e2 && e2.$param && e2.$param[0];
  6475. }
  6476. getCommand() {
  6477. return { $db: this.toJSON().$db.filter((e2) => "action" !== e2.$method) };
  6478. }
  6479. get isAggregate() {
  6480. let e2 = this;
  6481. for (; e2; ) {
  6482. const t2 = ns(e2), n2 = ns(e2.prevStage);
  6483. if ("aggregate" === t2 && "collection" === n2 || "pipeline" === t2)
  6484. return true;
  6485. e2 = e2.prevStage;
  6486. }
  6487. return false;
  6488. }
  6489. get isCommand() {
  6490. let e2 = this;
  6491. for (; e2; ) {
  6492. if ("command" === ns(e2))
  6493. return true;
  6494. e2 = e2.prevStage;
  6495. }
  6496. return false;
  6497. }
  6498. get isAggregateCommand() {
  6499. let e2 = this;
  6500. for (; e2; ) {
  6501. const t2 = ns(e2), n2 = ns(e2.prevStage);
  6502. if ("aggregate" === t2 && "command" === n2)
  6503. return true;
  6504. e2 = e2.prevStage;
  6505. }
  6506. return false;
  6507. }
  6508. getNextStageFn(e2) {
  6509. const t2 = this;
  6510. return function() {
  6511. return rs({ $method: e2, $param: ts(Array.from(arguments)) }, t2, t2._database);
  6512. };
  6513. }
  6514. get count() {
  6515. return this.isAggregate ? this.getNextStageFn("count") : function() {
  6516. return this._send("count", Array.from(arguments));
  6517. };
  6518. }
  6519. get remove() {
  6520. return this.isCommand ? this.getNextStageFn("remove") : function() {
  6521. return this._send("remove", Array.from(arguments));
  6522. };
  6523. }
  6524. get() {
  6525. return this._send("get", Array.from(arguments));
  6526. }
  6527. get add() {
  6528. return this.isCommand ? this.getNextStageFn("add") : function() {
  6529. return this._send("add", Array.from(arguments));
  6530. };
  6531. }
  6532. update() {
  6533. return this._send("update", Array.from(arguments));
  6534. }
  6535. end() {
  6536. return this._send("end", Array.from(arguments));
  6537. }
  6538. get set() {
  6539. return this.isCommand ? this.getNextStageFn("set") : function() {
  6540. throw new Error("JQL禁止使用set方法");
  6541. };
  6542. }
  6543. _send(e2, t2) {
  6544. const n2 = this.getAction(), s2 = this.getCommand();
  6545. if (s2.$db.push({ $method: e2, $param: ts(t2) }), b) {
  6546. const e3 = s2.$db.find((e4) => "collection" === e4.$method), t3 = e3 && e3.$param;
  6547. 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- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  6548. }
  6549. return this._database._callCloudFunction({ action: n2, command: s2 });
  6550. }
  6551. }
  6552. function rs(e2, t2, n2) {
  6553. return Qn(new ss(e2, t2, n2), { get(e3, t3) {
  6554. let s2 = "db";
  6555. return e3 && e3.content && (s2 = e3.content.$method), es(s2, t3) ? rs({ $method: t3 }, e3, n2) : function() {
  6556. return rs({ $method: t3, $param: ts(Array.from(arguments)) }, e3, n2);
  6557. };
  6558. } });
  6559. }
  6560. function is({ path: e2, method: t2 }) {
  6561. return class {
  6562. constructor() {
  6563. this.param = Array.from(arguments);
  6564. }
  6565. toJSON() {
  6566. return { $newDb: [...e2.map((e3) => ({ $method: e3 })), { $method: t2, $param: this.param }] };
  6567. }
  6568. toString() {
  6569. return JSON.stringify(this.toJSON());
  6570. }
  6571. };
  6572. }
  6573. class os {
  6574. constructor({ uniClient: e2 = {}, isJQL: t2 = false } = {}) {
  6575. this._uniClient = e2, this._authCallBacks = {}, this._dbCallBacks = {}, e2._isDefault && (this._dbCallBacks = U("_globalUniCloudDatabaseCallback")), t2 || (this.auth = Xn(this._authCallBacks)), this._isJQL = t2, Object.assign(this, Xn(this._dbCallBacks)), this.env = Qn({}, { get: (e3, t3) => ({ $env: t3 }) }), this.Geo = Qn({}, { get: (e3, t3) => is({ path: ["Geo"], method: t3 }) }), this.serverDate = is({ path: [], method: "serverDate" }), this.RegExp = is({ path: [], method: "RegExp" });
  6576. }
  6577. getCloudEnv(e2) {
  6578. if ("string" != typeof e2 || !e2.trim())
  6579. throw new Error("getCloudEnv参数错误");
  6580. return { $env: e2.replace("$cloudEnv_", "") };
  6581. }
  6582. _callback(e2, t2) {
  6583. const n2 = this._dbCallBacks;
  6584. n2[e2] && n2[e2].forEach((e3) => {
  6585. e3(...t2);
  6586. });
  6587. }
  6588. _callbackAuth(e2, t2) {
  6589. const n2 = this._authCallBacks;
  6590. n2[e2] && n2[e2].forEach((e3) => {
  6591. e3(...t2);
  6592. });
  6593. }
  6594. multiSend() {
  6595. const e2 = Array.from(arguments), t2 = e2.map((e3) => {
  6596. const t3 = e3.getAction(), n2 = e3.getCommand();
  6597. if ("getTemp" !== n2.$db[n2.$db.length - 1].$method)
  6598. throw new Error("multiSend只支持子命令内使用getTemp");
  6599. return { action: t3, command: n2 };
  6600. });
  6601. return this._callCloudFunction({ multiCommand: t2, queryList: e2 });
  6602. }
  6603. }
  6604. function as(e2, t2 = {}) {
  6605. return Qn(new e2(t2), { get: (e3, t3) => es("db", t3) ? rs({ $method: t3 }, null, e3) : function() {
  6606. return rs({ $method: t3, $param: ts(Array.from(arguments)) }, null, e3);
  6607. } });
  6608. }
  6609. class cs extends os {
  6610. _parseResult(e2) {
  6611. return this._isJQL ? e2.result : e2;
  6612. }
  6613. _callCloudFunction({ action: e2, command: t2, multiCommand: n2, queryList: s2 }) {
  6614. function r2(e3, t3) {
  6615. if (n2 && s2)
  6616. for (let n3 = 0; n3 < s2.length; n3++) {
  6617. const r3 = s2[n3];
  6618. r3.udb && "function" == typeof r3.udb.setResult && (t3 ? r3.udb.setResult(t3) : r3.udb.setResult(e3.result.dataList[n3]));
  6619. }
  6620. }
  6621. const i2 = this, o2 = this._isJQL ? "databaseForJQL" : "database";
  6622. function a2(e3) {
  6623. return i2._callback("error", [e3]), j($(o2, "fail"), e3).then(() => j($(o2, "complete"), e3)).then(() => (r2(null, e3), Y(H.RESPONSE, { type: J.CLIENT_DB, content: e3 }), Promise.reject(e3)));
  6624. }
  6625. const c2 = j($(o2, "invoke")), u2 = this._uniClient;
  6626. return c2.then(() => u2.callFunction({ name: "DCloud-clientDB", type: l.CLIENT_DB, data: { action: e2, command: t2, multiCommand: n2 } })).then((e3) => {
  6627. const { code: t3, message: n3, token: s3, tokenExpired: c3, systemInfo: u3 = [] } = e3.result;
  6628. if (u3)
  6629. for (let e4 = 0; e4 < u3.length; e4++) {
  6630. const { level: t4, message: n4, detail: s4 } = u3[e4];
  6631. let r3 = "[System Info]" + n4;
  6632. s4 && (r3 = `${r3}
  6633. 详细信息:${s4}`), (console["warn" === t4 ? "error" : t4] || console.log)(r3);
  6634. }
  6635. if (t3) {
  6636. return a2(new te({ code: t3, message: n3, requestId: e3.requestId }));
  6637. }
  6638. e3.result.errCode = e3.result.errCode || e3.result.code, e3.result.errMsg = e3.result.errMsg || e3.result.message, s3 && c3 && (ie({ token: s3, tokenExpired: c3 }), this._callbackAuth("refreshToken", [{ token: s3, tokenExpired: c3 }]), this._callback("refreshToken", [{ token: s3, tokenExpired: c3 }]), Y(H.REFRESH_TOKEN, { token: s3, tokenExpired: c3 }));
  6639. const h2 = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];
  6640. for (let t4 = 0; t4 < h2.length; t4++) {
  6641. const { prop: n4, tips: s4 } = h2[t4];
  6642. if (n4 in e3.result) {
  6643. const t5 = e3.result[n4];
  6644. Object.defineProperty(e3.result, n4, { get: () => (console.warn(s4), t5) });
  6645. }
  6646. }
  6647. return function(e4) {
  6648. return j($(o2, "success"), e4).then(() => j($(o2, "complete"), e4)).then(() => {
  6649. r2(e4, null);
  6650. const t4 = i2._parseResult(e4);
  6651. return Y(H.RESPONSE, { type: J.CLIENT_DB, content: t4 }), Promise.resolve(t4);
  6652. });
  6653. }(e3);
  6654. }, (e3) => {
  6655. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e3.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  6656. return a2(new te({ code: e3.code || "SYSTEM_ERROR", message: e3.message, requestId: e3.requestId }));
  6657. });
  6658. }
  6659. }
  6660. const us = "token无效,跳转登录页面", hs = "token过期,跳转登录页面", ls = { TOKEN_INVALID_TOKEN_EXPIRED: hs, TOKEN_INVALID_INVALID_CLIENTID: us, TOKEN_INVALID: us, TOKEN_INVALID_WRONG_TOKEN: us, TOKEN_INVALID_ANONYMOUS_USER: us }, ds = { "uni-id-token-expired": hs, "uni-id-check-token-failed": us, "uni-id-token-not-exist": us, "uni-id-check-device-feature-failed": us };
  6661. function ps(e2, t2) {
  6662. let n2 = "";
  6663. return n2 = e2 ? `${e2}/${t2}` : t2, n2.replace(/^\//, "");
  6664. }
  6665. function fs(e2 = [], t2 = "") {
  6666. const n2 = [], s2 = [];
  6667. return e2.forEach((e3) => {
  6668. true === e3.needLogin ? n2.push(ps(t2, e3.path)) : false === e3.needLogin && s2.push(ps(t2, e3.path));
  6669. }), { needLoginPage: n2, notNeedLoginPage: s2 };
  6670. }
  6671. function gs(e2) {
  6672. return e2.split("?")[0].replace(/^\//, "");
  6673. }
  6674. function ms() {
  6675. return function(e2) {
  6676. let t2 = e2 && e2.$page && e2.$page.fullPath || "";
  6677. return t2 ? ("/" !== t2.charAt(0) && (t2 = "/" + t2), t2) : t2;
  6678. }(function() {
  6679. const e2 = getCurrentPages();
  6680. return e2[e2.length - 1];
  6681. }());
  6682. }
  6683. function ys() {
  6684. return gs(ms());
  6685. }
  6686. function _s(e2 = "", t2 = {}) {
  6687. if (!e2)
  6688. return false;
  6689. if (!(t2 && t2.list && t2.list.length))
  6690. return false;
  6691. const n2 = t2.list, s2 = gs(e2);
  6692. return n2.some((e3) => e3.pagePath === s2);
  6693. }
  6694. const ws = !!e.uniIdRouter;
  6695. const { loginPage: vs, routerNeedLogin: Is, resToLogin: Ss, needLoginPage: Ts, notNeedLoginPage: bs, loginPageInTabBar: Es } = function({ pages: t2 = [], subPackages: n2 = [], uniIdRouter: s2 = {}, tabBar: r2 = {} } = e) {
  6696. const { loginPage: i2, needLogin: o2 = [], resToLogin: a2 = true } = s2, { needLoginPage: c2, notNeedLoginPage: u2 } = fs(t2), { needLoginPage: h2, notNeedLoginPage: l2 } = function(e2 = []) {
  6697. const t3 = [], n3 = [];
  6698. return e2.forEach((e3) => {
  6699. const { root: s3, pages: r3 = [] } = e3, { needLoginPage: i3, notNeedLoginPage: o3 } = fs(r3, s3);
  6700. t3.push(...i3), n3.push(...o3);
  6701. }), { needLoginPage: t3, notNeedLoginPage: n3 };
  6702. }(n2);
  6703. return { loginPage: i2, routerNeedLogin: o2, resToLogin: a2, needLoginPage: [...c2, ...h2], notNeedLoginPage: [...u2, ...l2], loginPageInTabBar: _s(i2, r2) };
  6704. }();
  6705. if (Ts.indexOf(vs) > -1)
  6706. throw new Error(`Login page [${vs}] should not be "needLogin", please check your pages.json`);
  6707. function ks(e2) {
  6708. const t2 = ys();
  6709. if ("/" === e2.charAt(0))
  6710. return e2;
  6711. const [n2, s2] = e2.split("?"), r2 = n2.replace(/^\//, "").split("/"), i2 = t2.split("/");
  6712. i2.pop();
  6713. for (let e3 = 0; e3 < r2.length; e3++) {
  6714. const t3 = r2[e3];
  6715. ".." === t3 ? i2.pop() : "." !== t3 && i2.push(t3);
  6716. }
  6717. return "" === i2[0] && i2.shift(), "/" + i2.join("/") + (s2 ? "?" + s2 : "");
  6718. }
  6719. function Ps(e2) {
  6720. const t2 = gs(ks(e2));
  6721. return !(bs.indexOf(t2) > -1) && (Ts.indexOf(t2) > -1 || Is.some((t3) => function(e3, t4) {
  6722. return new RegExp(t4).test(e3);
  6723. }(e2, t3)));
  6724. }
  6725. function Cs({ redirect: e2 }) {
  6726. const t2 = gs(e2), n2 = gs(vs);
  6727. return ys() !== n2 && t2 !== n2;
  6728. }
  6729. function As({ api: e2, redirect: t2 } = {}) {
  6730. if (!t2 || !Cs({ redirect: t2 }))
  6731. return;
  6732. const n2 = function(e3, t3) {
  6733. return "/" !== e3.charAt(0) && (e3 = "/" + e3), t3 ? e3.indexOf("?") > -1 ? e3 + `&uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3 + `?uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3;
  6734. }(vs, t2);
  6735. Es ? "navigateTo" !== e2 && "redirectTo" !== e2 || (e2 = "switchTab") : "switchTab" === e2 && (e2 = "navigateTo");
  6736. const s2 = { navigateTo: uni.navigateTo, redirectTo: uni.redirectTo, switchTab: uni.switchTab, reLaunch: uni.reLaunch };
  6737. setTimeout(() => {
  6738. s2[e2]({ url: n2 });
  6739. }, 0);
  6740. }
  6741. function Os({ url: e2 } = {}) {
  6742. const t2 = { abortLoginPageJump: false, autoToLoginPage: false }, n2 = function() {
  6743. const { token: e3, tokenExpired: t3 } = re();
  6744. let n3;
  6745. if (e3) {
  6746. if (t3 < Date.now()) {
  6747. const e4 = "uni-id-token-expired";
  6748. n3 = { errCode: e4, errMsg: ds[e4] };
  6749. }
  6750. } else {
  6751. const e4 = "uni-id-check-token-failed";
  6752. n3 = { errCode: e4, errMsg: ds[e4] };
  6753. }
  6754. return n3;
  6755. }();
  6756. if (Ps(e2) && n2) {
  6757. n2.uniIdRedirectUrl = e2;
  6758. if (z(H.NEED_LOGIN).length > 0)
  6759. return setTimeout(() => {
  6760. Y(H.NEED_LOGIN, n2);
  6761. }, 0), t2.abortLoginPageJump = true, t2;
  6762. t2.autoToLoginPage = true;
  6763. }
  6764. return t2;
  6765. }
  6766. function xs() {
  6767. !function() {
  6768. const e3 = ms(), { abortLoginPageJump: t2, autoToLoginPage: n2 } = Os({ url: e3 });
  6769. t2 || n2 && As({ api: "redirectTo", redirect: e3 });
  6770. }();
  6771. const e2 = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  6772. for (let t2 = 0; t2 < e2.length; t2++) {
  6773. const n2 = e2[t2];
  6774. uni.addInterceptor(n2, { invoke(e3) {
  6775. const { abortLoginPageJump: t3, autoToLoginPage: s2 } = Os({ url: e3.url });
  6776. return t3 ? e3 : s2 ? (As({ api: n2, redirect: ks(e3.url) }), false) : e3;
  6777. } });
  6778. }
  6779. }
  6780. function Ns() {
  6781. this.onResponse((e2) => {
  6782. const { type: t2, content: n2 } = e2;
  6783. let s2 = false;
  6784. switch (t2) {
  6785. case "cloudobject":
  6786. s2 = function(e3) {
  6787. if ("object" != typeof e3)
  6788. return false;
  6789. const { errCode: t3 } = e3 || {};
  6790. return t3 in ds;
  6791. }(n2);
  6792. break;
  6793. case "clientdb":
  6794. s2 = function(e3) {
  6795. if ("object" != typeof e3)
  6796. return false;
  6797. const { errCode: t3 } = e3 || {};
  6798. return t3 in ls;
  6799. }(n2);
  6800. }
  6801. s2 && function(e3 = {}) {
  6802. const t3 = z(H.NEED_LOGIN);
  6803. Z().then(() => {
  6804. const n3 = ms();
  6805. if (n3 && Cs({ redirect: n3 }))
  6806. return t3.length > 0 ? Y(H.NEED_LOGIN, Object.assign({ uniIdRedirectUrl: n3 }, e3)) : void (vs && As({ api: "navigateTo", redirect: n3 }));
  6807. });
  6808. }(n2);
  6809. });
  6810. }
  6811. function Rs(e2) {
  6812. !function(e3) {
  6813. e3.onResponse = function(e4) {
  6814. V(H.RESPONSE, e4);
  6815. }, e3.offResponse = function(e4) {
  6816. G(H.RESPONSE, e4);
  6817. };
  6818. }(e2), function(e3) {
  6819. e3.onNeedLogin = function(e4) {
  6820. V(H.NEED_LOGIN, e4);
  6821. }, e3.offNeedLogin = function(e4) {
  6822. G(H.NEED_LOGIN, e4);
  6823. }, ws && (U(Qt).needLoginInit || (U(Qt).needLoginInit = true, Z().then(() => {
  6824. xs.call(e3);
  6825. }), Ss && Ns.call(e3)));
  6826. }(e2), function(e3) {
  6827. e3.onRefreshToken = function(e4) {
  6828. V(H.REFRESH_TOKEN, e4);
  6829. }, e3.offRefreshToken = function(e4) {
  6830. G(H.REFRESH_TOKEN, e4);
  6831. };
  6832. }(e2);
  6833. }
  6834. let Ls;
  6835. const Us = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", Ds = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  6836. function Ms() {
  6837. const e2 = re().token || "", t2 = e2.split(".");
  6838. if (!e2 || 3 !== t2.length)
  6839. return { uid: null, role: [], permission: [], tokenExpired: 0 };
  6840. let n2;
  6841. try {
  6842. n2 = JSON.parse((s2 = t2[1], decodeURIComponent(Ls(s2).split("").map(function(e3) {
  6843. return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
  6844. }).join(""))));
  6845. } catch (e3) {
  6846. throw new Error("获取当前用户信息出错,详细错误信息为:" + e3.message);
  6847. }
  6848. var s2;
  6849. return n2.tokenExpired = 1e3 * n2.exp, delete n2.exp, delete n2.iat, n2;
  6850. }
  6851. Ls = "function" != typeof atob ? function(e2) {
  6852. if (e2 = String(e2).replace(/[\t\n\f\r ]+/g, ""), !Ds.test(e2))
  6853. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  6854. var t2;
  6855. e2 += "==".slice(2 - (3 & e2.length));
  6856. for (var n2, s2, r2 = "", i2 = 0; i2 < e2.length; )
  6857. t2 = Us.indexOf(e2.charAt(i2++)) << 18 | Us.indexOf(e2.charAt(i2++)) << 12 | (n2 = Us.indexOf(e2.charAt(i2++))) << 6 | (s2 = Us.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);
  6858. return r2;
  6859. } : atob;
  6860. var qs = n(function(e2, t2) {
  6861. Object.defineProperty(t2, "__esModule", { value: true });
  6862. const n2 = "chooseAndUploadFile:ok", s2 = "chooseAndUploadFile:fail";
  6863. function r2(e3, t3) {
  6864. return e3.tempFiles.forEach((e4, n3) => {
  6865. 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("."));
  6866. }), e3.tempFilePaths || (e3.tempFilePaths = e3.tempFiles.map((e4) => e4.path)), e3;
  6867. }
  6868. function i2(e3, t3, { onChooseFile: s3, onUploadProgress: r3 }) {
  6869. return t3.then((e4) => {
  6870. if (s3) {
  6871. const t4 = s3(e4);
  6872. if (void 0 !== t4)
  6873. return Promise.resolve(t4).then((t5) => void 0 === t5 ? e4 : t5);
  6874. }
  6875. return e4;
  6876. }).then((t4) => false === t4 ? { errMsg: n2, tempFilePaths: [], tempFiles: [] } : function(e4, t5, s4 = 5, r4) {
  6877. (t5 = Object.assign({}, t5)).errMsg = n2;
  6878. const i3 = t5.tempFiles, o2 = i3.length;
  6879. let a2 = 0;
  6880. return new Promise((n3) => {
  6881. for (; a2 < s4; )
  6882. c2();
  6883. function c2() {
  6884. const s5 = a2++;
  6885. if (s5 >= o2)
  6886. return void (!i3.find((e5) => !e5.url && !e5.errMsg) && n3(t5));
  6887. const u2 = i3[s5];
  6888. e4.uploadFile({ provider: u2.provider, filePath: u2.path, cloudPath: u2.cloudPath, fileType: u2.fileType, cloudPathAsRealPath: u2.cloudPathAsRealPath, onUploadProgress(e5) {
  6889. e5.index = s5, e5.tempFile = u2, e5.tempFilePath = u2.path, r4 && r4(e5);
  6890. } }).then((e5) => {
  6891. u2.url = e5.fileID, s5 < o2 && c2();
  6892. }).catch((e5) => {
  6893. u2.errMsg = e5.errMsg || e5.message, s5 < o2 && c2();
  6894. });
  6895. }
  6896. });
  6897. }(e3, t4, 5, r3));
  6898. }
  6899. t2.initChooseAndUploadFile = function(e3) {
  6900. return function(t3 = { type: "all" }) {
  6901. return "image" === t3.type ? i2(e3, function(e4) {
  6902. const { count: t4, sizeType: n3, sourceType: i3 = ["album", "camera"], extension: o2 } = e4;
  6903. return new Promise((e5, a2) => {
  6904. uni.chooseImage({ count: t4, sizeType: n3, sourceType: i3, extension: o2, success(t5) {
  6905. e5(r2(t5, "image"));
  6906. }, fail(e6) {
  6907. a2({ errMsg: e6.errMsg.replace("chooseImage:fail", s2) });
  6908. } });
  6909. });
  6910. }(t3), t3) : "video" === t3.type ? i2(e3, function(e4) {
  6911. const { camera: t4, compressed: n3, maxDuration: i3, sourceType: o2 = ["album", "camera"], extension: a2 } = e4;
  6912. return new Promise((e5, c2) => {
  6913. uni.chooseVideo({ camera: t4, compressed: n3, maxDuration: i3, sourceType: o2, extension: a2, success(t5) {
  6914. const { tempFilePath: n4, duration: s3, size: i4, height: o3, width: a3 } = t5;
  6915. 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"));
  6916. }, fail(e6) {
  6917. c2({ errMsg: e6.errMsg.replace("chooseVideo:fail", s2) });
  6918. } });
  6919. });
  6920. }(t3), t3) : i2(e3, function(e4) {
  6921. const { count: t4, extension: n3 } = e4;
  6922. return new Promise((e5, i3) => {
  6923. let o2 = uni.chooseFile;
  6924. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o2 = wx.chooseMessageFile), "function" != typeof o2)
  6925. return i3({ errMsg: s2 + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });
  6926. o2({ type: "all", count: t4, extension: n3, success(t5) {
  6927. e5(r2(t5));
  6928. }, fail(e6) {
  6929. i3({ errMsg: e6.errMsg.replace("chooseFile:fail", s2) });
  6930. } });
  6931. });
  6932. }(t3), t3);
  6933. };
  6934. };
  6935. }), Fs = t$1(qs);
  6936. const Ks = { auto: "auto", onready: "onready", manual: "manual" };
  6937. function js(e2) {
  6938. return { props: { localdata: { type: Array, default: () => [] }, options: { type: [Object, Array], default: () => ({}) }, spaceInfo: { type: Object, default: () => ({}) }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: false }, gettree: { type: [Boolean, String], default: false }, gettreepath: { type: [Boolean, String], default: false }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: false }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: false } }, data: () => ({ mixinDatacomLoading: false, mixinDatacomHasMore: false, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {}, mixinDatacomError: null }), created() {
  6939. this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(() => {
  6940. var e3 = [];
  6941. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach((t2) => {
  6942. e3.push(this[t2]);
  6943. }), e3;
  6944. }, (e3, t2) => {
  6945. if (this.loadtime === Ks.manual)
  6946. return;
  6947. let n2 = false;
  6948. const s2 = [];
  6949. for (let r2 = 2; r2 < e3.length; r2++)
  6950. e3[r2] !== t2[r2] && (s2.push(e3[r2]), n2 = true);
  6951. e3[0] !== t2[0] && (this.mixinDatacomPage.current = this.pageCurrent), this.mixinDatacomPage.size = this.pageSize, this.onMixinDatacomPropsChange(n2, s2);
  6952. });
  6953. }, methods: { onMixinDatacomPropsChange(e3, t2) {
  6954. }, mixinDatacomEasyGet({ getone: e3 = false, success: t2, fail: n2 } = {}) {
  6955. this.mixinDatacomLoading || (this.mixinDatacomLoading = true, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then((n3) => {
  6956. this.mixinDatacomLoading = false;
  6957. const { data: s2, count: r2 } = n3.result;
  6958. this.getcount && (this.mixinDatacomPage.count = r2), this.mixinDatacomHasMore = s2.length < this.pageSize;
  6959. const i2 = e3 ? s2.length ? s2[0] : void 0 : s2;
  6960. this.mixinDatacomResData = i2, t2 && t2(i2);
  6961. }).catch((e4) => {
  6962. this.mixinDatacomLoading = false, this.mixinDatacomErrorMessage = e4, this.mixinDatacomError = e4, n2 && n2(e4);
  6963. }));
  6964. }, mixinDatacomGet(t2 = {}) {
  6965. let n2;
  6966. t2 = t2 || {}, n2 = "undefined" != typeof __uniX && __uniX ? e2.databaseForJQL(this.spaceInfo) : e2.database(this.spaceInfo);
  6967. const s2 = t2.action || this.action;
  6968. s2 && (n2 = n2.action(s2));
  6969. const r2 = t2.collection || this.collection;
  6970. n2 = Array.isArray(r2) ? n2.collection(...r2) : n2.collection(r2);
  6971. const i2 = t2.where || this.where;
  6972. i2 && Object.keys(i2).length && (n2 = n2.where(i2));
  6973. const o2 = t2.field || this.field;
  6974. o2 && (n2 = n2.field(o2));
  6975. const a2 = t2.foreignKey || this.foreignKey;
  6976. a2 && (n2 = n2.foreignKey(a2));
  6977. const c2 = t2.groupby || this.groupby;
  6978. c2 && (n2 = n2.groupBy(c2));
  6979. const u2 = t2.groupField || this.groupField;
  6980. u2 && (n2 = n2.groupField(u2));
  6981. true === (void 0 !== t2.distinct ? t2.distinct : this.distinct) && (n2 = n2.distinct());
  6982. const h2 = t2.orderby || this.orderby;
  6983. h2 && (n2 = n2.orderBy(h2));
  6984. 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 };
  6985. return f2 && (m2.getTree = y2), g2 && (m2.getTreePath = y2), n2 = n2.skip(d2 * (l2 - 1)).limit(d2).get(m2), n2;
  6986. } } };
  6987. }
  6988. function $s(e2) {
  6989. return function(t2, n2 = {}) {
  6990. n2 = function(e3, t3 = {}) {
  6991. 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;
  6992. }({ customUI: false, loadingOptions: { title: "加载中...", mask: true }, errorOptions: { type: "modal", retry: false } }, n2);
  6993. const { customUI: s2, loadingOptions: r2, errorOptions: i2, parseSystemError: o2 } = n2, a2 = !s2;
  6994. return new Proxy({}, { get(s3, c2) {
  6995. switch (c2) {
  6996. case "toString":
  6997. return "[object UniCloudObject]";
  6998. case "toJSON":
  6999. return {};
  7000. }
  7001. return function({ fn: e3, interceptorName: t3, getCallbackArgs: n3 } = {}) {
  7002. return async function(...s4) {
  7003. const r3 = n3 ? n3({ params: s4 }) : {};
  7004. let i3, o3;
  7005. try {
  7006. return await j($(t3, "invoke"), { ...r3 }), i3 = await e3(...s4), await j($(t3, "success"), { ...r3, result: i3 }), i3;
  7007. } catch (e4) {
  7008. throw o3 = e4, await j($(t3, "fail"), { ...r3, error: o3 }), o3;
  7009. } finally {
  7010. await j($(t3, "complete"), o3 ? { ...r3, error: o3 } : { ...r3, result: i3 });
  7011. }
  7012. };
  7013. }({ fn: async function s4(...u2) {
  7014. let h2;
  7015. a2 && uni.showLoading({ title: r2.title, mask: r2.mask });
  7016. const d2 = { name: t2, type: l.OBJECT, data: { method: c2, params: u2 } };
  7017. "object" == typeof n2.secretMethods && function(e3, t3) {
  7018. const n3 = t3.data.method, s5 = e3.secretMethods || {}, r3 = s5[n3] || s5["*"];
  7019. r3 && (t3.secretType = r3);
  7020. }(n2, d2);
  7021. let p2 = false;
  7022. try {
  7023. h2 = await e2.callFunction(d2);
  7024. } catch (e3) {
  7025. p2 = true, h2 = { result: new te(e3) };
  7026. }
  7027. const { errSubject: f2, errCode: g2, errMsg: m2, newToken: y2 } = h2.result || {};
  7028. if (a2 && uni.hideLoading(), y2 && y2.token && y2.tokenExpired && (ie(y2), Y(H.REFRESH_TOKEN, { ...y2 })), g2) {
  7029. let e3 = m2;
  7030. if (p2 && o2) {
  7031. e3 = (await o2({ objectName: t2, methodName: c2, params: u2, errSubject: f2, errCode: g2, errMsg: m2 })).errMsg || m2;
  7032. }
  7033. if (a2)
  7034. if ("toast" === i2.type)
  7035. uni.showToast({ title: e3, icon: "none" });
  7036. else {
  7037. if ("modal" !== i2.type)
  7038. throw new Error(`Invalid errorOptions.type: ${i2.type}`);
  7039. {
  7040. const { confirm: t3 } = await async function({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3 } = {}) {
  7041. return new Promise((i3, o3) => {
  7042. uni.showModal({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3, success(e5) {
  7043. i3(e5);
  7044. }, fail() {
  7045. i3({ confirm: false, cancel: true });
  7046. } });
  7047. });
  7048. }({ title: "提示", content: e3, showCancel: i2.retry, cancelText: "取消", confirmText: i2.retry ? "重试" : "确定" });
  7049. if (i2.retry && t3)
  7050. return s4(...u2);
  7051. }
  7052. }
  7053. const n3 = new te({ subject: f2, code: g2, message: m2, requestId: h2.requestId });
  7054. throw n3.detail = h2.result, Y(H.RESPONSE, { type: J.CLOUD_OBJECT, content: n3 }), n3;
  7055. }
  7056. return Y(H.RESPONSE, { type: J.CLOUD_OBJECT, content: h2.result }), h2.result;
  7057. }, interceptorName: "callObject", getCallbackArgs: function({ params: e3 } = {}) {
  7058. return { objectName: t2, methodName: c2, params: e3 };
  7059. } });
  7060. } });
  7061. };
  7062. }
  7063. function Bs(e2) {
  7064. return U(Xt.replace("{spaceId}", e2.config.spaceId));
  7065. }
  7066. async function Ws({ openid: e2, callLoginByWeixin: t2 = false } = {}) {
  7067. Bs(this);
  7068. throw new Error(`[SecureNetwork] API \`initSecureNetworkByWeixin\` is not supported on platform \`${C}\``);
  7069. }
  7070. async function Hs(e2) {
  7071. const t2 = Bs(this);
  7072. return t2.initPromise || (t2.initPromise = Ws.call(this, e2).then((e3) => e3).catch((e3) => {
  7073. throw delete t2.initPromise, e3;
  7074. })), t2.initPromise;
  7075. }
  7076. function Js(e2) {
  7077. return function({ openid: t2, callLoginByWeixin: n2 = false } = {}) {
  7078. return Hs.call(e2, { openid: t2, callLoginByWeixin: n2 });
  7079. };
  7080. }
  7081. function zs(e2) {
  7082. !function(e3) {
  7083. he = e3;
  7084. }(e2);
  7085. }
  7086. function Vs(e2) {
  7087. const t2 = { getSystemInfo: uni.getSystemInfo, getPushClientId: uni.getPushClientId };
  7088. return function(n2) {
  7089. return new Promise((s2, r2) => {
  7090. t2[e2]({ ...n2, success(e3) {
  7091. s2(e3);
  7092. }, fail(e3) {
  7093. r2(e3);
  7094. } });
  7095. });
  7096. };
  7097. }
  7098. class Gs extends S {
  7099. constructor() {
  7100. super(), this._uniPushMessageCallback = this._receivePushMessage.bind(this), this._currentMessageId = -1, this._payloadQueue = [];
  7101. }
  7102. init() {
  7103. return Promise.all([Vs("getSystemInfo")(), Vs("getPushClientId")()]).then(([{ appId: e2 } = {}, { cid: t2 } = {}] = []) => {
  7104. if (!e2)
  7105. throw new Error("Invalid appId, please check the manifest.json file");
  7106. if (!t2)
  7107. throw new Error("Invalid push client id");
  7108. this._appId = e2, this._pushClientId = t2, this._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), this.emit("open"), this._initMessageListener();
  7109. }, (e2) => {
  7110. throw this.emit("error", e2), this.close(), e2;
  7111. });
  7112. }
  7113. async open() {
  7114. return this.init();
  7115. }
  7116. _isUniCloudSSE(e2) {
  7117. if ("receive" !== e2.type)
  7118. return false;
  7119. const t2 = e2 && e2.data && e2.data.payload;
  7120. return !(!t2 || "UNI_CLOUD_SSE" !== t2.channel || t2.seqId !== this._seqId);
  7121. }
  7122. _receivePushMessage(e2) {
  7123. if (!this._isUniCloudSSE(e2))
  7124. return;
  7125. const t2 = e2 && e2.data && e2.data.payload, { action: n2, messageId: s2, message: r2 } = t2;
  7126. this._payloadQueue.push({ action: n2, messageId: s2, message: r2 }), this._consumMessage();
  7127. }
  7128. _consumMessage() {
  7129. for (; ; ) {
  7130. const e2 = this._payloadQueue.find((e3) => e3.messageId === this._currentMessageId + 1);
  7131. if (!e2)
  7132. break;
  7133. this._currentMessageId++, this._parseMessagePayload(e2);
  7134. }
  7135. }
  7136. _parseMessagePayload(e2) {
  7137. const { action: t2, messageId: n2, message: s2 } = e2;
  7138. "end" === t2 ? this._end({ messageId: n2, message: s2 }) : "message" === t2 && this._appendMessage({ messageId: n2, message: s2 });
  7139. }
  7140. _appendMessage({ messageId: e2, message: t2 } = {}) {
  7141. this.emit("message", t2);
  7142. }
  7143. _end({ messageId: e2, message: t2 } = {}) {
  7144. this.emit("end", t2), this.close();
  7145. }
  7146. _initMessageListener() {
  7147. uni.onPushMessage(this._uniPushMessageCallback);
  7148. }
  7149. _destroy() {
  7150. uni.offPushMessage(this._uniPushMessageCallback);
  7151. }
  7152. toJSON() {
  7153. return { appId: this._appId, pushClientId: this._pushClientId, seqId: this._seqId };
  7154. }
  7155. close() {
  7156. this._destroy(), this.emit("close");
  7157. }
  7158. }
  7159. async function Ys(e2) {
  7160. {
  7161. const { osName: e3, osVersion: t3 } = ce();
  7162. "ios" === e3 && function(e4) {
  7163. if (!e4 || "string" != typeof e4)
  7164. return 0;
  7165. const t4 = e4.match(/^(\d+)./);
  7166. return t4 && t4[1] ? parseInt(t4[1]) : 0;
  7167. }(t3) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发期间需要,发行后不需要)");
  7168. }
  7169. const t2 = e2.__dev__;
  7170. if (!t2.debugInfo)
  7171. return;
  7172. const { address: n2, servePort: s2 } = t2.debugInfo, { address: r2 } = await Ot(n2, s2);
  7173. if (r2)
  7174. return t2.localAddress = r2, void (t2.localPort = s2);
  7175. const i2 = console["error"];
  7176. let o2 = "";
  7177. if ("remote" === t2.debugInfo.initialLaunchType ? (t2.debugInfo.forceRemote = true, o2 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o2 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o2 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", 0 === C.indexOf("mp-") && (o2 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t2.debugInfo.forceRemote)
  7178. throw new Error(o2);
  7179. i2(o2);
  7180. }
  7181. function Qs(e2) {
  7182. e2._initPromiseHub || (e2._initPromiseHub = new I({ createPromise: function() {
  7183. let t2 = Promise.resolve();
  7184. var n2;
  7185. n2 = 1, t2 = new Promise((e3) => {
  7186. setTimeout(() => {
  7187. e3();
  7188. }, n2);
  7189. });
  7190. const s2 = e2.auth();
  7191. return t2.then(() => s2.getLoginState()).then((e3) => e3 ? Promise.resolve() : s2.signInAnonymously());
  7192. } }));
  7193. }
  7194. const Xs = { tcb: Ct, tencent: Ct, aliyun: fe, private: Rt, dcloud: Rt, alipay: Bt };
  7195. let Zs = new class {
  7196. init(e2) {
  7197. let t2 = {};
  7198. const n2 = Xs[e2.provider];
  7199. if (!n2)
  7200. throw new Error("未提供正确的provider参数");
  7201. t2 = n2.init(e2), function(e3) {
  7202. const t3 = {};
  7203. e3.__dev__ = t3, t3.debugLog = "app" === C;
  7204. const n3 = A;
  7205. n3 && !n3.code && (t3.debugInfo = n3);
  7206. const s2 = new I({ createPromise: function() {
  7207. return Ys(e3);
  7208. } });
  7209. t3.initLocalNetwork = function() {
  7210. return s2.exec();
  7211. };
  7212. }(t2), Qs(t2), Gn(t2), function(e3) {
  7213. const t3 = e3.uploadFile;
  7214. e3.uploadFile = function(e4) {
  7215. return t3.call(this, e4);
  7216. };
  7217. }(t2), function(e3) {
  7218. e3.database = function(t3) {
  7219. if (t3 && Object.keys(t3).length > 0)
  7220. return e3.init(t3).database();
  7221. if (this._database)
  7222. return this._database;
  7223. const n3 = as(cs, { uniClient: e3 });
  7224. return this._database = n3, n3;
  7225. }, e3.databaseForJQL = function(t3) {
  7226. if (t3 && Object.keys(t3).length > 0)
  7227. return e3.init(t3).databaseForJQL();
  7228. if (this._databaseForJQL)
  7229. return this._databaseForJQL;
  7230. const n3 = as(cs, { uniClient: e3, isJQL: true });
  7231. return this._databaseForJQL = n3, n3;
  7232. };
  7233. }(t2), function(e3) {
  7234. e3.getCurrentUserInfo = Ms, e3.chooseAndUploadFile = Fs.initChooseAndUploadFile(e3), Object.assign(e3, { get mixinDatacom() {
  7235. return js(e3);
  7236. } }), e3.SSEChannel = Gs, e3.initSecureNetworkByWeixin = Js(e3), e3.setCustomClientInfo = zs, e3.importObject = $s(e3);
  7237. }(t2);
  7238. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach((e3) => {
  7239. if (!t2[e3])
  7240. return;
  7241. const n3 = t2[e3];
  7242. t2[e3] = function() {
  7243. return n3.apply(t2, Array.from(arguments));
  7244. }, t2[e3] = (/* @__PURE__ */ function(e4, t3) {
  7245. return function(n4) {
  7246. let s2 = false;
  7247. if ("callFunction" === t3) {
  7248. const e5 = n4 && n4.type || l.DEFAULT;
  7249. s2 = e5 !== l.DEFAULT;
  7250. }
  7251. const r2 = "callFunction" === t3 && !s2, i2 = this._initPromiseHub.exec();
  7252. n4 = n4 || {};
  7253. const { success: o2, fail: a2, complete: c2 } = ee(n4), u2 = i2.then(() => s2 ? Promise.resolve() : j($(t3, "invoke"), n4)).then(() => e4.call(this, n4)).then((e5) => s2 ? Promise.resolve(e5) : j($(t3, "success"), e5).then(() => j($(t3, "complete"), e5)).then(() => (r2 && Y(H.RESPONSE, { type: J.CLOUD_FUNCTION, content: e5 }), Promise.resolve(e5))), (e5) => s2 ? Promise.reject(e5) : j($(t3, "fail"), e5).then(() => j($(t3, "complete"), e5)).then(() => (Y(H.RESPONSE, { type: J.CLOUD_FUNCTION, content: e5 }), Promise.reject(e5))));
  7254. if (!(o2 || a2 || c2))
  7255. return u2;
  7256. u2.then((e5) => {
  7257. o2 && o2(e5), c2 && c2(e5), r2 && Y(H.RESPONSE, { type: J.CLOUD_FUNCTION, content: e5 });
  7258. }, (e5) => {
  7259. a2 && a2(e5), c2 && c2(e5), r2 && Y(H.RESPONSE, { type: J.CLOUD_FUNCTION, content: e5 });
  7260. });
  7261. };
  7262. }(t2[e3], e3)).bind(t2);
  7263. }), t2.init = this.init, t2;
  7264. }
  7265. }();
  7266. (() => {
  7267. const e2 = O;
  7268. let t2 = {};
  7269. if (e2 && 1 === e2.length)
  7270. t2 = e2[0], Zs = Zs.init(t2), Zs._isDefault = true;
  7271. else {
  7272. const t3 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  7273. let n2;
  7274. n2 = e2 && e2.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : "应用未关联服务空间,请在uniCloud目录右键关联服务空间", t3.forEach((e3) => {
  7275. Zs[e3] = function() {
  7276. return console.error(n2), Promise.reject(new te({ code: "SYS_ERR", message: n2 }));
  7277. };
  7278. });
  7279. }
  7280. if (Object.assign(Zs, { get mixinDatacom() {
  7281. return js(Zs);
  7282. } }), Rs(Zs), Zs.addInterceptor = F, Zs.removeInterceptor = K, Zs.interceptObject = B, uni.__uniCloud = Zs, "app" === C) {
  7283. const e3 = D();
  7284. e3.uniCloud = Zs, e3.UniCloudError = te;
  7285. }
  7286. })();
  7287. var er = Zs;
  7288. const en = {
  7289. "uni-load-more.contentdown": "Pull up to show more",
  7290. "uni-load-more.contentrefresh": "loading...",
  7291. "uni-load-more.contentnomore": "No more data"
  7292. };
  7293. const zhHans = {
  7294. "uni-load-more.contentdown": "上拉显示更多",
  7295. "uni-load-more.contentrefresh": "正在加载...",
  7296. "uni-load-more.contentnomore": "没有更多数据了"
  7297. };
  7298. const zhHant = {
  7299. "uni-load-more.contentdown": "上拉顯示更多",
  7300. "uni-load-more.contentrefresh": "正在加載...",
  7301. "uni-load-more.contentnomore": "沒有更多數據了"
  7302. };
  7303. const messages = {
  7304. en,
  7305. "zh-Hans": zhHans,
  7306. "zh-Hant": zhHant
  7307. };
  7308. let platform;
  7309. setTimeout(() => {
  7310. platform = uni.getSystemInfoSync().platform;
  7311. }, 16);
  7312. const {
  7313. t
  7314. } = initVueI18n(messages);
  7315. const _sfc_main$u = {
  7316. name: "UniLoadMore",
  7317. emits: ["clickLoadMore"],
  7318. props: {
  7319. status: {
  7320. // 上拉的状态:more-loading前;loading-loading中;noMore-没有更多了
  7321. type: String,
  7322. default: "more"
  7323. },
  7324. showIcon: {
  7325. type: Boolean,
  7326. default: true
  7327. },
  7328. iconType: {
  7329. type: String,
  7330. default: "auto"
  7331. },
  7332. iconSize: {
  7333. type: Number,
  7334. default: 24
  7335. },
  7336. color: {
  7337. type: String,
  7338. default: "#777777"
  7339. },
  7340. contentText: {
  7341. type: Object,
  7342. default() {
  7343. return {
  7344. contentdown: "",
  7345. contentrefresh: "",
  7346. contentnomore: ""
  7347. };
  7348. }
  7349. },
  7350. showText: {
  7351. type: Boolean,
  7352. default: true
  7353. }
  7354. },
  7355. data() {
  7356. return {
  7357. webviewHide: false,
  7358. platform,
  7359. imgBase64: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QzlBMzU3OTlEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QzlBMzU3OUFEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDOUEzNTc5N0Q5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDOUEzNTc5OEQ5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pt+ALSwAAA6CSURBVHja1FsLkFZVHb98LM+F5bHL8khA1iSeiyQBCRM+YGqKUnnJTDLGI0BGZlKDIU2MMglUiDApEZvSsZnQtBRJtKwQNKQMFYeRDR10WOLd8ljYXdh+v8v5fR3Od+797t1dnOnO/Ofce77z+J//+b/P+ZqtXbs2sJ9MJhNUV1cHJ06cCJo3bx7EPc2aNcvpy7pWrVoF+/fvDyoqKoI2bdoE9fX1F7TjN8a+EXBn/fkfvw942Tf+wYMHg9mzZwfjxo0LDhw4EPa1x2MbFw/fOGfPng1qa2tzcCkILsLDydq2bRsunpOTMM7TD/W/tZDZhPdeKD+yGxHhdu3aBV27dg3OnDlzMVANMheLAO3btw8KCwuDmpoaX5OxbgUIMEq7K8IcPnw4KCsrC/r37x8cP378/4cAXAB3vqSkJMuiDhTkw+XcuXNhOWbMmKBly5YhUT8xArhyFvP0BfwRsAuwxJZJsm/nzp2DTp06he/OU+cZ64K6o0ePBkOHDg2GDx8e6gEbJ5Q/NHNuAJQ1hgBeHUDlR7nVTkY8rQAvAi4z34vR/mPs1FoRsaCgIJThI0eOBC1atEiFGGV+5MiRoS45efJkqFjJFXV1dQuA012m2WcwTw98fy6CqBdsaiIO4CScrGPHjvk4odhavPquRtFWXEC25VgkREKOCh/qDSq+vn37htzD/mZTOmOc5U7zKzBPEedygWshcDyWvs30igAbU+6oyMgJBCFhwQE0fccxN60Ay9iebbjoDh06hMowjQxT4fXq1SskArmHZpkArvixp/kWzHdMeArExSJEaiXIjjRjRJ4DaAGWpibLzXN3Fm1vA5teBgh3j1Rv3bp1YgKwPdmf2p9zcyNYYgPKMfY0T5f5nNYdw158nJ8QawW4CLKwiOBSEgO/hok2eBydR+3dYH+PLxA5J8Vv0KBBwenTp0P2JWAx6+yFEBfs8lMY+y0SWMBNI9E4ThKi58VKTg3FQZS1RQF1cz27eC0QHMu+3E0SkUowjhVt5VdaWhp07949ZHv2Qd1EjDXM2cla1M0nl3GxAs3J9yREzyTdFVKVFOaE9qRA8GM0WebRuo9JGZKA7Mv2SeS/Z8+eoQ9BArMfFrLGo6jvxbhHbJZnKX2Rzz1O7QhJJ9Cs2ZMaWIyq/zhdeqPNfIoHd58clIQD+JSXl4dKlyIAuBdVXZwFVWKspSSoxE++h8x4k3uCnEhE4I5KwRiFWGOU0QWKiCYLbdoRMRKAu2kQ9vkfLU6dOhX06NEjlH+yMRZSinnuyWnYosVcji8CEA/6Cg2JF+IIUBqnGKUTCNwtwBN4f89RiK1R96DEgO2o0NDmtEdvVFdVVYV+P3UAPUEs6GFwV3PHmXkD4vh74iDFJysVI/MlaQhwKeBNTLYX5VuA8T4/gZxA4MRGFxDB6R7OmYPfyykGRJbyie+XnGYnQIC/coH9+vULiYrxrkL9ZA9+0ykaHIfEpM7ge8TiJ2CsHYwyMfafAF1yCGBHYIbCVDjDjKt7BeB51D+LgQa6OkG7IDYEEtvQ7lnXLKLtLdLuJBpE4gPUXcW2+PkZwOex+4cGDhwYDBkyRL7/HFcEwUGPo/8uWRUpYnfxGHco8HkewLHLyYmAawAPuIFZxhOpDfJQ8gbUv41yORAptMWBNr6oqMhWird5+u+iHmBb2nhjDV7HWBNQTgK8y11l5NetWzc5ULscAtSj7nbNI0skhWeUZCc0W4nyH/jO4Vz0u1IeYhbk4AiwM6tjxIWByHsoZ9qcIBPJd/y+DwPfBESOmCa/QF3WiZHucLlEDpNxcNhmheEOPgdQNx6/VZFQzFZ5TN08AHXQt2Ii3EdyFuUsPtTcGPhW5iMiCNELvz+Gdn9huG4HUJaW/w3g0wxV0XaG7arG2WeKiUWYM4Y7GO5ezshTARbbWGw/DvXkpp/ivVvE0JVoMxN4rpGzJMhE5Pl+xlATsDIqikP9F9D2z3h9nOksEUFhK+qO4rcPkoalMQ/HqJLIyb3F3JdjrCcw1yZ8joyJLR5gCo54etlag7qIoeNh1N1BRYj3DTFJ0elotxPlVzkGuYAmL0VSJVGAJA41c4Z6A3BzTLfn0HYwYKEI6CUAMzZEWvLsIcQOo1AmmyyM72nHJCfYsogflGV6jEk9vyQZXSuq6w4c16NsGcGZbwOPr+H1RkOk2LEzjNepxQkihHSCQ4ynAYNRx2zMKV92CQMWqj8J0BRE8EShxRFN6YrfCRhC0x3r/Zm4IbQCcmJoV0kMamllccR6FjHqUC5F2R/wS2dcymOlfAKOS4KmzQb5cpNC2MC7JhVn5wjXoJ44rYhLh8n0eXOCorJxa7POjbSlCGVczr34/RsAmrcvo9s+wGp3tzVhntxiXiJ4nvEYb4FJkf0O8HocAePmLvCxnL0AORraVekJk6TYjDabRVXfRE2lCN1h6ZQRN1+InUbsCpKwoBZHh0dODN9JBCUffItXxEavTQkUtnfTVAplCWL3JISz29h4NjotnuSsQKJCk8dF+kJR6RARjrqFVmfPnj3ZbK8cIJ0msd6jgHPGtfVTQ8VLmlvh4mct9sobRmPic0DyDQQnx/NlfYUgyz59+oScsH379pAwXABD32nTpoUHIToESeI5mnbE/UqDdyLcafEBf2MCqgC7NwxIbMREJQ0g4D4sfJwnD+AmRrII05cfMWJE+L1169bQr+fip06dGp4oJ83lmYd5wj/EmMa4TaHivo4EeCguYZBnkB5g2aWA69OIEnUHOaGysjIYMGBAMGnSpODYsWPZwCpFmm4lNq+4gSLQA7jcX8DwtjEyRC8wjabnXEx9kfWnTJkSJkAo90xpJVV+FmcVNeYAF5zWngS4C4O91MBxmAv8blLEpbjI5sz9MTdAhcgkCT1RO8mZkAjfiYpTEvStAS53Uw1vAiUGgZ3GpuQEYvoiBqlIan7kSDHnTwJQFNiPu0+5VxCVYhcZIjNrdXUDdp+Eq5AZ3Gkg8QAyVZRZIk4Tl4QAbF9cXJxNYZMAtAokgs4BrNxEpCtteXg7DDTMDKYNSuQdKsnJBek7HxewvxaosWxLYXtw+cJp18217wql4aKCfBNoEu0O5VU+PhctJ0YeXD4C6JQpyrlpSLTojpGGGN5YwNziChdIZLk4lvLcFJ9jMX3QdiImY9bmGQU+TRUL5CHITTRlgF8D9ouD1MfmLoEPl5xokIumZ2cfgMpHt47IW9N64Hsh7wQYYjyIugWuF5fCqYncXRd5vPMWyizzvhi/32+nvG0dZc9vR6fZOu0md5e+uC408FvKSIOZwXlGvxPv95izA2Vtvg1xKFWARI+vMX66HUhpQQb643uW1bSjuTWyw2SBvDrBvjFic1eGGlz5esq3ko9uSIlBRqPuFcCv8F4WIcN12nVaBd0SaYwI6PDDImR11JkqgHcPmQssjxIn6bUshygDFJUTxPMpHk+jfjPgupgdnYV2R/g7xSjtpah8RJBewhwf0gGK6XI92u4wXFEU40afJ4DN4h5LcAd+40HI3JgJecuT0c062W0i2hQJUTcxan3/CMW1PF2K6bbA+Daz4xRs1D3Br1Cm0OihKCqizW78/nXAF/G5TXrEcVzaNMH6CyMswqsAHqDyDLEyou8lwOXnKF8DjI6KjV3KzMBiXkDH8ij/H214J5A596ekrZ3F0zXlWeL7+P5eUrNo3/QwC15uxthuzidy7DzKRwEDaAViiDgKbTbz7CJnzo0bN7pIfIiid8SuPwn25o3QCmpnyjlZkyxPP8EomCJzrGb7GJMx7tNsq4MT2xMUYaiErZOluTzKsnz3gwCeCZyVRZJfYplNEokEjwrPtxlxjeYAk+F1F74VAzPxQRNYYdtpOUvWs8J1sGhBJMNsb7igN8plJs1eSmLIhLKE4rvaCX27gOhLpLOsIzJ7qn/i+wZzcvSOZ23/du8TZjwV8zHIXoP4R3ifBxiFz1dcVpa3aPntPE+c6TmIWE9EtcMmAcPdWAhYhAXxcLOQi9L1WhD1Sc8p1d2oL7XGiRKp8F4A2i8K/nfI+y/gsTDJ/YC/8+AD5Uh04KHiGl+cIFPnBDDrPMjwRGkLXyxO4VGbfQWnDH2v0bVWE3C9QOXlepbgjEfIJQI6XDG3z5ahD9cw2pS78ipB85wyScNTvsVzlzzhL8/jRrnmVjfFJK/m3m4nj9vbgQTguT8XZTjsm672R5uJKEaQmBI/c58gyus8ZDagLpEVSJBIyHp4jn++xqPV71OgQgJYEWOtZ/haxRtKmWOBu8xdBLftWltsY84zE6WIEy/eIOWL+BaayMx+KHtL7EAkqdNDLiEXmEMUHniedtJqg9HmZtfvt26vNi0BdG3Ft3g8ZOf7PAu59TxtzivLNIekyi+wD1i8CuUiD9FXAa8C+/xS3JPmZnomyc7H+fb4/Se0bk41Fel621r4cgVxbq91V4jVqwB7HTe2M7jgB+QWHavZkDRPmZcASoZEmBx6i75bGjPcMdL4/VKGFAGWZkGzPG0XAbdL9A81G5LOmUnC9hHKJeO7dcUMjblSl12867ElFTtaGl20xvvLGPdVz/8TVuU7y0x1PG7vtNg24oz9Uo/Z412++VFWI7Fcog9tu9Lm6gvRmIPv9x1xmQAu6RDkXtbOtlGEmpgD5Nvnyc0dcv0EE6cfdi1HmhMf9wDF3k3gtRvEedhxjpgfqPb9PU9iEJHnyOUA7bQUXh6kq/D7l2iTjWv7XOD530BDr8jIrus+srXjt4MzumJMHuTsBa63YKE1+RR5lBjEikCCnWKWiHdzOgKO+nRIBAF88za/IFmJ3eMZov4CYxGBabcpGL8EYx+SeMXJeRwHNsV/h+vdxeuhEpN3ZyNY78Gm2fknJxVGhyjixPiQvVkNzT1elD9Py/aTAL64Hb9vcYmC9zfdXdT/C1LeGbg4rnBaAihDFJH12W5ulfNCNe/xTsP3bp8ikzJs5BF+5PNfAQYAPaseTdsEcaYAAAAASUVORK5CYII="
  7360. };
  7361. },
  7362. computed: {
  7363. iconSnowWidth() {
  7364. return (Math.floor(this.iconSize / 24) || 1) * 2;
  7365. },
  7366. contentdownText() {
  7367. return this.contentText.contentdown || t("uni-load-more.contentdown");
  7368. },
  7369. contentrefreshText() {
  7370. return this.contentText.contentrefresh || t("uni-load-more.contentrefresh");
  7371. },
  7372. contentnomoreText() {
  7373. return this.contentText.contentnomore || t("uni-load-more.contentnomore");
  7374. }
  7375. },
  7376. mounted() {
  7377. var pages2 = getCurrentPages();
  7378. var page = pages2[pages2.length - 1];
  7379. var currentWebview = page.$getAppWebview();
  7380. currentWebview.addEventListener("hide", () => {
  7381. this.webviewHide = true;
  7382. });
  7383. currentWebview.addEventListener("show", () => {
  7384. this.webviewHide = false;
  7385. });
  7386. },
  7387. methods: {
  7388. onClick() {
  7389. this.$emit("clickLoadMore", {
  7390. detail: {
  7391. status: this.status
  7392. }
  7393. });
  7394. }
  7395. }
  7396. };
  7397. function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
  7398. return vue.openBlock(), vue.createElementBlock("view", {
  7399. class: "uni-load-more",
  7400. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  7401. }, [
  7402. !$data.webviewHide && ($props.iconType === "circle" || $props.iconType === "auto" && $data.platform === "android") && $props.status === "loading" && $props.showIcon ? (vue.openBlock(), vue.createElementBlock(
  7403. "view",
  7404. {
  7405. key: 0,
  7406. style: vue.normalizeStyle({ width: $props.iconSize + "px", height: $props.iconSize + "px" }),
  7407. class: "uni-load-more__img uni-load-more__img--android-MP"
  7408. },
  7409. [
  7410. vue.createElementVNode(
  7411. "view",
  7412. {
  7413. class: "uni-load-more__img-icon",
  7414. style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
  7415. },
  7416. null,
  7417. 4
  7418. /* STYLE */
  7419. ),
  7420. vue.createElementVNode(
  7421. "view",
  7422. {
  7423. class: "uni-load-more__img-icon",
  7424. style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
  7425. },
  7426. null,
  7427. 4
  7428. /* STYLE */
  7429. ),
  7430. vue.createElementVNode(
  7431. "view",
  7432. {
  7433. class: "uni-load-more__img-icon",
  7434. style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
  7435. },
  7436. null,
  7437. 4
  7438. /* STYLE */
  7439. )
  7440. ],
  7441. 4
  7442. /* STYLE */
  7443. )) : !$data.webviewHide && $props.status === "loading" && $props.showIcon ? (vue.openBlock(), vue.createElementBlock(
  7444. "view",
  7445. {
  7446. key: 1,
  7447. style: vue.normalizeStyle({ width: $props.iconSize + "px", height: $props.iconSize + "px" }),
  7448. class: "uni-load-more__img uni-load-more__img--ios-H5"
  7449. },
  7450. [
  7451. vue.createElementVNode("image", {
  7452. src: $data.imgBase64,
  7453. mode: "widthFix"
  7454. }, null, 8, ["src"])
  7455. ],
  7456. 4
  7457. /* STYLE */
  7458. )) : vue.createCommentVNode("v-if", true),
  7459. $props.showText ? (vue.openBlock(), vue.createElementBlock(
  7460. "text",
  7461. {
  7462. key: 2,
  7463. class: "uni-load-more__text",
  7464. style: vue.normalizeStyle({ color: $props.color })
  7465. },
  7466. vue.toDisplayString($props.status === "more" ? $options.contentdownText : $props.status === "loading" ? $options.contentrefreshText : $options.contentnomoreText),
  7467. 5
  7468. /* TEXT, STYLE */
  7469. )) : vue.createCommentVNode("v-if", true)
  7470. ]);
  7471. }
  7472. const __easycom_0$4 = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t], ["__scopeId", "data-v-9245e42c"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue"]]);
  7473. const _sfc_main$t = {
  7474. name: "uniDataChecklist",
  7475. mixins: [er.mixinDatacom || {}],
  7476. emits: ["input", "update:modelValue", "change"],
  7477. props: {
  7478. mode: {
  7479. type: String,
  7480. default: "default"
  7481. },
  7482. multiple: {
  7483. type: Boolean,
  7484. default: false
  7485. },
  7486. value: {
  7487. type: [Array, String, Number],
  7488. default() {
  7489. return "";
  7490. }
  7491. },
  7492. // TODO vue3
  7493. modelValue: {
  7494. type: [Array, String, Number],
  7495. default() {
  7496. return "";
  7497. }
  7498. },
  7499. localdata: {
  7500. type: Array,
  7501. default() {
  7502. return [];
  7503. }
  7504. },
  7505. min: {
  7506. type: [Number, String],
  7507. default: ""
  7508. },
  7509. max: {
  7510. type: [Number, String],
  7511. default: ""
  7512. },
  7513. wrap: {
  7514. type: Boolean,
  7515. default: false
  7516. },
  7517. icon: {
  7518. type: String,
  7519. default: "left"
  7520. },
  7521. selectedColor: {
  7522. type: String,
  7523. default: ""
  7524. },
  7525. selectedTextColor: {
  7526. type: String,
  7527. default: ""
  7528. },
  7529. emptyText: {
  7530. type: String,
  7531. default: "暂无数据"
  7532. },
  7533. disabled: {
  7534. type: Boolean,
  7535. default: false
  7536. },
  7537. map: {
  7538. type: Object,
  7539. default() {
  7540. return {
  7541. text: "text",
  7542. value: "value"
  7543. };
  7544. }
  7545. }
  7546. },
  7547. watch: {
  7548. localdata: {
  7549. handler(newVal) {
  7550. this.range = newVal;
  7551. this.dataList = this.getDataList(this.getSelectedValue(newVal));
  7552. },
  7553. deep: true
  7554. },
  7555. mixinDatacomResData(newVal) {
  7556. this.range = newVal;
  7557. this.dataList = this.getDataList(this.getSelectedValue(newVal));
  7558. },
  7559. value(newVal) {
  7560. this.dataList = this.getDataList(newVal);
  7561. },
  7562. modelValue(newVal) {
  7563. this.dataList = this.getDataList(newVal);
  7564. }
  7565. },
  7566. data() {
  7567. return {
  7568. dataList: [],
  7569. range: [],
  7570. contentText: {
  7571. contentdown: "查看更多",
  7572. contentrefresh: "加载中",
  7573. contentnomore: "没有更多"
  7574. },
  7575. isLocal: true,
  7576. styles: {
  7577. selectedColor: "#2979ff",
  7578. selectedTextColor: "#666"
  7579. },
  7580. isTop: 0
  7581. };
  7582. },
  7583. computed: {
  7584. dataValue() {
  7585. if (this.value === "")
  7586. return this.modelValue;
  7587. if (this.modelValue === "")
  7588. return this.value;
  7589. return this.value;
  7590. }
  7591. },
  7592. created() {
  7593. if (this.localdata && this.localdata.length !== 0) {
  7594. this.isLocal = true;
  7595. this.range = this.localdata;
  7596. this.dataList = this.getDataList(this.getSelectedValue(this.range));
  7597. } else {
  7598. if (this.collection) {
  7599. this.isLocal = false;
  7600. this.loadData();
  7601. }
  7602. }
  7603. },
  7604. methods: {
  7605. loadData() {
  7606. this.mixinDatacomGet().then((res) => {
  7607. this.mixinDatacomResData = res.result.data;
  7608. if (this.mixinDatacomResData.length === 0) {
  7609. this.isLocal = false;
  7610. this.mixinDatacomErrorMessage = this.emptyText;
  7611. } else {
  7612. this.isLocal = true;
  7613. }
  7614. }).catch((err) => {
  7615. this.mixinDatacomErrorMessage = err.message;
  7616. });
  7617. },
  7618. /**
  7619. * 获取父元素实例
  7620. */
  7621. getForm(name = "uniForms") {
  7622. let parent = this.$parent;
  7623. let parentName = parent.$options.name;
  7624. while (parentName !== name) {
  7625. parent = parent.$parent;
  7626. if (!parent)
  7627. return false;
  7628. parentName = parent.$options.name;
  7629. }
  7630. return parent;
  7631. },
  7632. change(e2) {
  7633. const values = e2.detail.value;
  7634. let detail = {
  7635. value: [],
  7636. data: []
  7637. };
  7638. if (this.multiple) {
  7639. this.range.forEach((item) => {
  7640. if (values.includes(item[this.map.value] + "")) {
  7641. detail.value.push(item[this.map.value]);
  7642. detail.data.push(item);
  7643. }
  7644. });
  7645. } else {
  7646. const range = this.range.find((item) => item[this.map.value] + "" === values);
  7647. if (range) {
  7648. detail = {
  7649. value: range[this.map.value],
  7650. data: range
  7651. };
  7652. }
  7653. }
  7654. this.$emit("input", detail.value);
  7655. this.$emit("update:modelValue", detail.value);
  7656. this.$emit("change", {
  7657. detail
  7658. });
  7659. if (this.multiple) {
  7660. this.dataList = this.getDataList(detail.value, true);
  7661. } else {
  7662. this.dataList = this.getDataList(detail.value);
  7663. }
  7664. },
  7665. /**
  7666. * 获取渲染的新数组
  7667. * @param {Object} value 选中内容
  7668. */
  7669. getDataList(value) {
  7670. let dataList = JSON.parse(JSON.stringify(this.range));
  7671. let list = [];
  7672. if (this.multiple) {
  7673. if (!Array.isArray(value)) {
  7674. value = [];
  7675. }
  7676. }
  7677. dataList.forEach((item, index) => {
  7678. item.disabled = item.disable || item.disabled || false;
  7679. if (this.multiple) {
  7680. if (value.length > 0) {
  7681. let have = value.find((val) => val === item[this.map.value]);
  7682. item.selected = have !== void 0;
  7683. } else {
  7684. item.selected = false;
  7685. }
  7686. } else {
  7687. item.selected = value === item[this.map.value];
  7688. }
  7689. list.push(item);
  7690. });
  7691. return this.setRange(list);
  7692. },
  7693. /**
  7694. * 处理最大最小值
  7695. * @param {Object} list
  7696. */
  7697. setRange(list) {
  7698. let selectList = list.filter((item) => item.selected);
  7699. let min = Number(this.min) || 0;
  7700. let max = Number(this.max) || "";
  7701. list.forEach((item, index) => {
  7702. if (this.multiple) {
  7703. if (selectList.length <= min) {
  7704. let have = selectList.find((val) => val[this.map.value] === item[this.map.value]);
  7705. if (have !== void 0) {
  7706. item.disabled = true;
  7707. }
  7708. }
  7709. if (selectList.length >= max && max !== "") {
  7710. let have = selectList.find((val) => val[this.map.value] === item[this.map.value]);
  7711. if (have === void 0) {
  7712. item.disabled = true;
  7713. }
  7714. }
  7715. }
  7716. this.setStyles(item, index);
  7717. list[index] = item;
  7718. });
  7719. return list;
  7720. },
  7721. /**
  7722. * 设置 class
  7723. * @param {Object} item
  7724. * @param {Object} index
  7725. */
  7726. setStyles(item, index) {
  7727. item.styleBackgroud = this.setStyleBackgroud(item);
  7728. item.styleIcon = this.setStyleIcon(item);
  7729. item.styleIconText = this.setStyleIconText(item);
  7730. item.styleRightIcon = this.setStyleRightIcon(item);
  7731. },
  7732. /**
  7733. * 获取选中值
  7734. * @param {Object} range
  7735. */
  7736. getSelectedValue(range) {
  7737. if (!this.multiple)
  7738. return this.dataValue;
  7739. let selectedArr = [];
  7740. range.forEach((item) => {
  7741. if (item.selected) {
  7742. selectedArr.push(item[this.map.value]);
  7743. }
  7744. });
  7745. return this.dataValue.length > 0 ? this.dataValue : selectedArr;
  7746. },
  7747. /**
  7748. * 设置背景样式
  7749. */
  7750. setStyleBackgroud(item) {
  7751. let styles = {};
  7752. let selectedColor = this.selectedColor ? this.selectedColor : "#2979ff";
  7753. if (this.selectedColor) {
  7754. if (this.mode !== "list") {
  7755. styles["border-color"] = item.selected ? selectedColor : "#DCDFE6";
  7756. }
  7757. if (this.mode === "tag") {
  7758. styles["background-color"] = item.selected ? selectedColor : "#f5f5f5";
  7759. }
  7760. }
  7761. let classles = "";
  7762. for (let i2 in styles) {
  7763. classles += `${i2}:${styles[i2]};`;
  7764. }
  7765. return classles;
  7766. },
  7767. setStyleIcon(item) {
  7768. let styles = {};
  7769. let classles = "";
  7770. if (this.selectedColor) {
  7771. let selectedColor = this.selectedColor ? this.selectedColor : "#2979ff";
  7772. styles["background-color"] = item.selected ? selectedColor : "#fff";
  7773. styles["border-color"] = item.selected ? selectedColor : "#DCDFE6";
  7774. if (!item.selected && item.disabled) {
  7775. styles["background-color"] = "#F2F6FC";
  7776. styles["border-color"] = item.selected ? selectedColor : "#DCDFE6";
  7777. }
  7778. }
  7779. for (let i2 in styles) {
  7780. classles += `${i2}:${styles[i2]};`;
  7781. }
  7782. return classles;
  7783. },
  7784. setStyleIconText(item) {
  7785. let styles = {};
  7786. let classles = "";
  7787. if (this.selectedColor) {
  7788. let selectedColor = this.selectedColor ? this.selectedColor : "#2979ff";
  7789. if (this.mode === "tag") {
  7790. styles.color = item.selected ? this.selectedTextColor ? this.selectedTextColor : "#fff" : "#666";
  7791. } else {
  7792. styles.color = item.selected ? this.selectedTextColor ? this.selectedTextColor : selectedColor : "#666";
  7793. }
  7794. if (!item.selected && item.disabled) {
  7795. styles.color = "#999";
  7796. }
  7797. }
  7798. for (let i2 in styles) {
  7799. classles += `${i2}:${styles[i2]};`;
  7800. }
  7801. return classles;
  7802. },
  7803. setStyleRightIcon(item) {
  7804. let styles = {};
  7805. let classles = "";
  7806. if (this.mode === "list") {
  7807. styles["border-color"] = item.selected ? this.styles.selectedColor : "#DCDFE6";
  7808. }
  7809. for (let i2 in styles) {
  7810. classles += `${i2}:${styles[i2]};`;
  7811. }
  7812. return classles;
  7813. }
  7814. }
  7815. };
  7816. function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
  7817. const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_0$4);
  7818. return vue.openBlock(), vue.createElementBlock(
  7819. "view",
  7820. {
  7821. class: "uni-data-checklist",
  7822. style: vue.normalizeStyle({ "margin-top": $data.isTop + "px" })
  7823. },
  7824. [
  7825. !$data.isLocal ? (vue.openBlock(), vue.createElementBlock("view", {
  7826. key: 0,
  7827. class: "uni-data-loading"
  7828. }, [
  7829. !_ctx.mixinDatacomErrorMessage ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
  7830. key: 0,
  7831. status: "loading",
  7832. iconType: "snow",
  7833. iconSize: 18,
  7834. "content-text": $data.contentText
  7835. }, null, 8, ["content-text"])) : (vue.openBlock(), vue.createElementBlock(
  7836. "text",
  7837. { key: 1 },
  7838. vue.toDisplayString(_ctx.mixinDatacomErrorMessage),
  7839. 1
  7840. /* TEXT */
  7841. ))
  7842. ])) : (vue.openBlock(), vue.createElementBlock(
  7843. vue.Fragment,
  7844. { key: 1 },
  7845. [
  7846. $props.multiple ? (vue.openBlock(), vue.createElementBlock(
  7847. "checkbox-group",
  7848. {
  7849. key: 0,
  7850. class: vue.normalizeClass(["checklist-group", { "is-list": $props.mode === "list" || $props.wrap }]),
  7851. onChange: _cache[0] || (_cache[0] = (...args) => $options.change && $options.change(...args))
  7852. },
  7853. [
  7854. (vue.openBlock(true), vue.createElementBlock(
  7855. vue.Fragment,
  7856. null,
  7857. vue.renderList($data.dataList, (item, index) => {
  7858. return vue.openBlock(), vue.createElementBlock(
  7859. "label",
  7860. {
  7861. class: vue.normalizeClass(["checklist-box", ["is--" + $props.mode, item.selected ? "is-checked" : "", $props.disabled || !!item.disabled ? "is-disable" : "", index !== 0 && $props.mode === "list" ? "is-list-border" : ""]]),
  7862. style: vue.normalizeStyle(item.styleBackgroud),
  7863. key: index
  7864. },
  7865. [
  7866. vue.createElementVNode("checkbox", {
  7867. class: "hidden",
  7868. hidden: "",
  7869. disabled: $props.disabled || !!item.disabled,
  7870. value: item[$props.map.value] + "",
  7871. checked: item.selected
  7872. }, null, 8, ["disabled", "value", "checked"]),
  7873. $props.mode !== "tag" && $props.mode !== "list" || $props.mode === "list" && $props.icon === "left" ? (vue.openBlock(), vue.createElementBlock(
  7874. "view",
  7875. {
  7876. key: 0,
  7877. class: "checkbox__inner",
  7878. style: vue.normalizeStyle(item.styleIcon)
  7879. },
  7880. [
  7881. vue.createElementVNode("view", { class: "checkbox__inner-icon" })
  7882. ],
  7883. 4
  7884. /* STYLE */
  7885. )) : vue.createCommentVNode("v-if", true),
  7886. vue.createElementVNode(
  7887. "view",
  7888. {
  7889. class: vue.normalizeClass(["checklist-content", { "list-content": $props.mode === "list" && $props.icon === "left" }])
  7890. },
  7891. [
  7892. vue.createElementVNode(
  7893. "text",
  7894. {
  7895. class: "checklist-text",
  7896. style: vue.normalizeStyle(item.styleIconText)
  7897. },
  7898. vue.toDisplayString(item[$props.map.text]),
  7899. 5
  7900. /* TEXT, STYLE */
  7901. ),
  7902. $props.mode === "list" && $props.icon === "right" ? (vue.openBlock(), vue.createElementBlock(
  7903. "view",
  7904. {
  7905. key: 0,
  7906. class: "checkobx__list",
  7907. style: vue.normalizeStyle(item.styleBackgroud)
  7908. },
  7909. null,
  7910. 4
  7911. /* STYLE */
  7912. )) : vue.createCommentVNode("v-if", true)
  7913. ],
  7914. 2
  7915. /* CLASS */
  7916. )
  7917. ],
  7918. 6
  7919. /* CLASS, STYLE */
  7920. );
  7921. }),
  7922. 128
  7923. /* KEYED_FRAGMENT */
  7924. ))
  7925. ],
  7926. 34
  7927. /* CLASS, NEED_HYDRATION */
  7928. )) : (vue.openBlock(), vue.createElementBlock(
  7929. "radio-group",
  7930. {
  7931. key: 1,
  7932. class: vue.normalizeClass(["checklist-group", { "is-list": $props.mode === "list", "is-wrap": $props.wrap }]),
  7933. onChange: _cache[1] || (_cache[1] = (...args) => $options.change && $options.change(...args))
  7934. },
  7935. [
  7936. (vue.openBlock(true), vue.createElementBlock(
  7937. vue.Fragment,
  7938. null,
  7939. vue.renderList($data.dataList, (item, index) => {
  7940. return vue.openBlock(), vue.createElementBlock(
  7941. "label",
  7942. {
  7943. class: vue.normalizeClass(["checklist-box", ["is--" + $props.mode, item.selected ? "is-checked" : "", $props.disabled || !!item.disabled ? "is-disable" : "", index !== 0 && $props.mode === "list" ? "is-list-border" : ""]]),
  7944. style: vue.normalizeStyle(item.styleBackgroud),
  7945. key: index
  7946. },
  7947. [
  7948. vue.createElementVNode("radio", {
  7949. class: "hidden",
  7950. hidden: "",
  7951. disabled: $props.disabled || item.disabled,
  7952. value: item[$props.map.value] + "",
  7953. checked: item.selected
  7954. }, null, 8, ["disabled", "value", "checked"]),
  7955. $props.mode !== "tag" && $props.mode !== "list" || $props.mode === "list" && $props.icon === "left" ? (vue.openBlock(), vue.createElementBlock(
  7956. "view",
  7957. {
  7958. key: 0,
  7959. class: "radio__inner",
  7960. style: vue.normalizeStyle(item.styleBackgroud)
  7961. },
  7962. [
  7963. vue.createElementVNode(
  7964. "view",
  7965. {
  7966. class: "radio__inner-icon",
  7967. style: vue.normalizeStyle(item.styleIcon)
  7968. },
  7969. null,
  7970. 4
  7971. /* STYLE */
  7972. )
  7973. ],
  7974. 4
  7975. /* STYLE */
  7976. )) : vue.createCommentVNode("v-if", true),
  7977. vue.createElementVNode(
  7978. "view",
  7979. {
  7980. class: vue.normalizeClass(["checklist-content", { "list-content": $props.mode === "list" && $props.icon === "left" }])
  7981. },
  7982. [
  7983. vue.createElementVNode(
  7984. "text",
  7985. {
  7986. class: "checklist-text",
  7987. style: vue.normalizeStyle(item.styleIconText)
  7988. },
  7989. vue.toDisplayString(item[$props.map.text]),
  7990. 5
  7991. /* TEXT, STYLE */
  7992. ),
  7993. $props.mode === "list" && $props.icon === "right" ? (vue.openBlock(), vue.createElementBlock(
  7994. "view",
  7995. {
  7996. key: 0,
  7997. style: vue.normalizeStyle(item.styleRightIcon),
  7998. class: "checkobx__list"
  7999. },
  8000. null,
  8001. 4
  8002. /* STYLE */
  8003. )) : vue.createCommentVNode("v-if", true)
  8004. ],
  8005. 2
  8006. /* CLASS */
  8007. )
  8008. ],
  8009. 6
  8010. /* CLASS, STYLE */
  8011. );
  8012. }),
  8013. 128
  8014. /* KEYED_FRAGMENT */
  8015. ))
  8016. ],
  8017. 34
  8018. /* CLASS, NEED_HYDRATION */
  8019. ))
  8020. ],
  8021. 64
  8022. /* STABLE_FRAGMENT */
  8023. ))
  8024. ],
  8025. 4
  8026. /* STYLE */
  8027. );
  8028. }
  8029. const __easycom_0$3 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s], ["__scopeId", "data-v-2f788efd"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue"]]);
  8030. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  8031. function getDefaultExportFromCjs(x) {
  8032. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  8033. }
  8034. var dayjs_min = { exports: {} };
  8035. (function(module, exports) {
  8036. !function(t2, e2) {
  8037. module.exports = e2();
  8038. }(commonjsGlobal, function() {
  8039. var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) {
  8040. var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
  8041. return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
  8042. } }, m2 = function(t3, e3, n3) {
  8043. var r3 = String(t3);
  8044. return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3;
  8045. }, v2 = { s: m2, z: function(t3) {
  8046. var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
  8047. return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0");
  8048. }, m: function t3(e3, n3) {
  8049. if (e3.date() < n3.date())
  8050. return -t3(n3, e3);
  8051. var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i3 = e3.clone().add(r3, c2), s3 = n3 - i3 < 0, u3 = e3.clone().add(r3 + (s3 ? -1 : 1), c2);
  8052. return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
  8053. }, a: function(t3) {
  8054. return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
  8055. }, p: function(t3) {
  8056. return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
  8057. }, u: function(t3) {
  8058. return void 0 === t3;
  8059. } }, g2 = "en", D2 = {};
  8060. D2[g2] = M2;
  8061. var p2 = "$isDayjsObject", S2 = function(t3) {
  8062. return t3 instanceof _2 || !(!t3 || !t3[p2]);
  8063. }, w2 = function t3(e3, n3, r3) {
  8064. var i3;
  8065. if (!e3)
  8066. return g2;
  8067. if ("string" == typeof e3) {
  8068. var s3 = e3.toLowerCase();
  8069. D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
  8070. var u3 = e3.split("-");
  8071. if (!i3 && u3.length > 1)
  8072. return t3(u3[0]);
  8073. } else {
  8074. var a3 = e3.name;
  8075. D2[a3] = e3, i3 = a3;
  8076. }
  8077. return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
  8078. }, O2 = function(t3, e3) {
  8079. if (S2(t3))
  8080. return t3.clone();
  8081. var n3 = "object" == typeof e3 ? e3 : {};
  8082. return n3.date = t3, n3.args = arguments, new _2(n3);
  8083. }, b2 = v2;
  8084. b2.l = w2, b2.i = S2, b2.w = function(t3, e3) {
  8085. return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
  8086. };
  8087. var _2 = function() {
  8088. function M3(t3) {
  8089. this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
  8090. }
  8091. var m3 = M3.prototype;
  8092. return m3.parse = function(t3) {
  8093. this.$d = function(t4) {
  8094. var e3 = t4.date, n3 = t4.utc;
  8095. if (null === e3)
  8096. return /* @__PURE__ */ new Date(NaN);
  8097. if (b2.u(e3))
  8098. return /* @__PURE__ */ new Date();
  8099. if (e3 instanceof Date)
  8100. return new Date(e3);
  8101. if ("string" == typeof e3 && !/Z$/i.test(e3)) {
  8102. var r3 = e3.match($2);
  8103. if (r3) {
  8104. var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
  8105. return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
  8106. }
  8107. }
  8108. return new Date(e3);
  8109. }(t3), this.init();
  8110. }, m3.init = function() {
  8111. var t3 = this.$d;
  8112. this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
  8113. }, m3.$utils = function() {
  8114. return b2;
  8115. }, m3.isValid = function() {
  8116. return !(this.$d.toString() === l2);
  8117. }, m3.isSame = function(t3, e3) {
  8118. var n3 = O2(t3);
  8119. return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
  8120. }, m3.isAfter = function(t3, e3) {
  8121. return O2(t3) < this.startOf(e3);
  8122. }, m3.isBefore = function(t3, e3) {
  8123. return this.endOf(e3) < O2(t3);
  8124. }, m3.$g = function(t3, e3, n3) {
  8125. return b2.u(t3) ? this[e3] : this.set(n3, t3);
  8126. }, m3.unix = function() {
  8127. return Math.floor(this.valueOf() / 1e3);
  8128. }, m3.valueOf = function() {
  8129. return this.$d.getTime();
  8130. }, m3.startOf = function(t3, e3) {
  8131. var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) {
  8132. var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
  8133. return r3 ? i3 : i3.endOf(a2);
  8134. }, $3 = function(t4, e4) {
  8135. return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3);
  8136. }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
  8137. switch (f3) {
  8138. case h2:
  8139. return r3 ? l3(1, 0) : l3(31, 11);
  8140. case c2:
  8141. return r3 ? l3(1, M4) : l3(0, M4 + 1);
  8142. case o2:
  8143. var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
  8144. return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
  8145. case a2:
  8146. case d2:
  8147. return $3(v3 + "Hours", 0);
  8148. case u2:
  8149. return $3(v3 + "Minutes", 1);
  8150. case s2:
  8151. return $3(v3 + "Seconds", 2);
  8152. case i2:
  8153. return $3(v3 + "Milliseconds", 3);
  8154. default:
  8155. return this.clone();
  8156. }
  8157. }, m3.endOf = function(t3) {
  8158. return this.startOf(t3, false);
  8159. }, m3.$set = function(t3, e3) {
  8160. var n3, o3 = b2.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $3 = o3 === a2 ? this.$D + (e3 - this.$W) : e3;
  8161. if (o3 === c2 || o3 === h2) {
  8162. var y3 = this.clone().set(d2, 1);
  8163. y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
  8164. } else
  8165. l3 && this.$d[l3]($3);
  8166. return this.init(), this;
  8167. }, m3.set = function(t3, e3) {
  8168. return this.clone().$set(t3, e3);
  8169. }, m3.get = function(t3) {
  8170. return this[b2.p(t3)]();
  8171. }, m3.add = function(r3, f3) {
  8172. var d3, l3 = this;
  8173. r3 = Number(r3);
  8174. var $3 = b2.p(f3), y3 = function(t3) {
  8175. var e3 = O2(l3);
  8176. return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
  8177. };
  8178. if ($3 === c2)
  8179. return this.set(c2, this.$M + r3);
  8180. if ($3 === h2)
  8181. return this.set(h2, this.$y + r3);
  8182. if ($3 === a2)
  8183. return y3(1);
  8184. if ($3 === o2)
  8185. return y3(7);
  8186. var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n2, d3[i2] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M4;
  8187. return b2.w(m4, this);
  8188. }, m3.subtract = function(t3, e3) {
  8189. return this.add(-1 * t3, e3);
  8190. }, m3.format = function(t3) {
  8191. var e3 = this, n3 = this.$locale();
  8192. if (!this.isValid())
  8193. return n3.invalidDate || l2;
  8194. var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, i4, s4) {
  8195. return t4 && (t4[n4] || t4(e3, r3)) || i4[n4].slice(0, s4);
  8196. }, d3 = function(t4) {
  8197. return b2.s(s3 % 12 || 12, t4, "0");
  8198. }, $3 = f3 || function(t4, e4, n4) {
  8199. var r4 = t4 < 12 ? "AM" : "PM";
  8200. return n4 ? r4.toLowerCase() : r4;
  8201. };
  8202. return r3.replace(y2, function(t4, r4) {
  8203. return r4 || function(t5) {
  8204. switch (t5) {
  8205. case "YY":
  8206. return String(e3.$y).slice(-2);
  8207. case "YYYY":
  8208. return b2.s(e3.$y, 4, "0");
  8209. case "M":
  8210. return a3 + 1;
  8211. case "MM":
  8212. return b2.s(a3 + 1, 2, "0");
  8213. case "MMM":
  8214. return h3(n3.monthsShort, a3, c3, 3);
  8215. case "MMMM":
  8216. return h3(c3, a3);
  8217. case "D":
  8218. return e3.$D;
  8219. case "DD":
  8220. return b2.s(e3.$D, 2, "0");
  8221. case "d":
  8222. return String(e3.$W);
  8223. case "dd":
  8224. return h3(n3.weekdaysMin, e3.$W, o3, 2);
  8225. case "ddd":
  8226. return h3(n3.weekdaysShort, e3.$W, o3, 3);
  8227. case "dddd":
  8228. return o3[e3.$W];
  8229. case "H":
  8230. return String(s3);
  8231. case "HH":
  8232. return b2.s(s3, 2, "0");
  8233. case "h":
  8234. return d3(1);
  8235. case "hh":
  8236. return d3(2);
  8237. case "a":
  8238. return $3(s3, u3, true);
  8239. case "A":
  8240. return $3(s3, u3, false);
  8241. case "m":
  8242. return String(u3);
  8243. case "mm":
  8244. return b2.s(u3, 2, "0");
  8245. case "s":
  8246. return String(e3.$s);
  8247. case "ss":
  8248. return b2.s(e3.$s, 2, "0");
  8249. case "SSS":
  8250. return b2.s(e3.$ms, 3, "0");
  8251. case "Z":
  8252. return i3;
  8253. }
  8254. return null;
  8255. }(t4) || i3.replace(":", "");
  8256. });
  8257. }, m3.utcOffset = function() {
  8258. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  8259. }, m3.diff = function(r3, d3, l3) {
  8260. var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() {
  8261. return b2.m(y3, m4);
  8262. };
  8263. switch (M4) {
  8264. case h2:
  8265. $3 = D3() / 12;
  8266. break;
  8267. case c2:
  8268. $3 = D3();
  8269. break;
  8270. case f2:
  8271. $3 = D3() / 3;
  8272. break;
  8273. case o2:
  8274. $3 = (g3 - v3) / 6048e5;
  8275. break;
  8276. case a2:
  8277. $3 = (g3 - v3) / 864e5;
  8278. break;
  8279. case u2:
  8280. $3 = g3 / n2;
  8281. break;
  8282. case s2:
  8283. $3 = g3 / e2;
  8284. break;
  8285. case i2:
  8286. $3 = g3 / t2;
  8287. break;
  8288. default:
  8289. $3 = g3;
  8290. }
  8291. return l3 ? $3 : b2.a($3);
  8292. }, m3.daysInMonth = function() {
  8293. return this.endOf(c2).$D;
  8294. }, m3.$locale = function() {
  8295. return D2[this.$L];
  8296. }, m3.locale = function(t3, e3) {
  8297. if (!t3)
  8298. return this.$L;
  8299. var n3 = this.clone(), r3 = w2(t3, e3, true);
  8300. return r3 && (n3.$L = r3), n3;
  8301. }, m3.clone = function() {
  8302. return b2.w(this.$d, this);
  8303. }, m3.toDate = function() {
  8304. return new Date(this.valueOf());
  8305. }, m3.toJSON = function() {
  8306. return this.isValid() ? this.toISOString() : null;
  8307. }, m3.toISOString = function() {
  8308. return this.$d.toISOString();
  8309. }, m3.toString = function() {
  8310. return this.$d.toUTCString();
  8311. }, M3;
  8312. }(), k = _2.prototype;
  8313. return O2.prototype = k, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
  8314. k[t3[1]] = function(e3) {
  8315. return this.$g(e3, t3[0], t3[1]);
  8316. };
  8317. }), O2.extend = function(t3, e3) {
  8318. return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2;
  8319. }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
  8320. return O2(1e3 * t3);
  8321. }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
  8322. });
  8323. })(dayjs_min);
  8324. var dayjs_minExports = dayjs_min.exports;
  8325. const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
  8326. var isIOS;
  8327. function album() {
  8328. var result = 0;
  8329. var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
  8330. var authStatus = PHPhotoLibrary.authorizationStatus();
  8331. if (authStatus === 0) {
  8332. result = null;
  8333. } else if (authStatus == 3) {
  8334. result = 1;
  8335. } else {
  8336. result = 0;
  8337. }
  8338. plus.ios.deleteObject(PHPhotoLibrary);
  8339. return result;
  8340. }
  8341. function camera() {
  8342. var result = 0;
  8343. var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
  8344. var authStatus = AVCaptureDevice.authorizationStatusForMediaType("vide");
  8345. if (authStatus === 0) {
  8346. result = null;
  8347. } else if (authStatus == 3) {
  8348. result = 1;
  8349. } else {
  8350. result = 0;
  8351. }
  8352. plus.ios.deleteObject(AVCaptureDevice);
  8353. return result;
  8354. }
  8355. function location$1() {
  8356. var result = 0;
  8357. var cllocationManger = plus.ios.import("CLLocationManager");
  8358. var enable = cllocationManger.locationServicesEnabled();
  8359. var status = cllocationManger.authorizationStatus();
  8360. if (!enable) {
  8361. result = 2;
  8362. } else if (status === 0) {
  8363. result = null;
  8364. } else if (status === 3 || status === 4) {
  8365. result = 1;
  8366. } else {
  8367. result = 0;
  8368. }
  8369. plus.ios.deleteObject(cllocationManger);
  8370. return result;
  8371. }
  8372. function push() {
  8373. var result = 0;
  8374. var UIApplication = plus.ios.import("UIApplication");
  8375. var app = UIApplication.sharedApplication();
  8376. var enabledTypes = 0;
  8377. if (app.currentUserNotificationSettings) {
  8378. var settings = app.currentUserNotificationSettings();
  8379. enabledTypes = settings.plusGetAttribute("types");
  8380. if (enabledTypes == 0) {
  8381. result = 0;
  8382. formatAppLog("log", "at common/permission.js:63", "推送权限没有开启");
  8383. } else {
  8384. result = 1;
  8385. formatAppLog("log", "at common/permission.js:66", "已经开启推送功能!");
  8386. }
  8387. plus.ios.deleteObject(settings);
  8388. } else {
  8389. enabledTypes = app.enabledRemoteNotificationTypes();
  8390. if (enabledTypes == 0) {
  8391. result = 3;
  8392. formatAppLog("log", "at common/permission.js:73", "推送权限没有开启!");
  8393. } else {
  8394. result = 4;
  8395. formatAppLog("log", "at common/permission.js:76", "已经开启推送功能!");
  8396. }
  8397. }
  8398. plus.ios.deleteObject(app);
  8399. plus.ios.deleteObject(UIApplication);
  8400. return result;
  8401. }
  8402. function contact() {
  8403. var result = 0;
  8404. var CNContactStore = plus.ios.import("CNContactStore");
  8405. var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
  8406. if (cnAuthStatus === 0) {
  8407. result = null;
  8408. } else if (cnAuthStatus == 3) {
  8409. result = 1;
  8410. } else {
  8411. result = 0;
  8412. }
  8413. plus.ios.deleteObject(CNContactStore);
  8414. return result;
  8415. }
  8416. function record() {
  8417. var result = null;
  8418. var avaudiosession = plus.ios.import("AVAudioSession");
  8419. var avaudio = avaudiosession.sharedInstance();
  8420. var status = avaudio.recordPermission();
  8421. formatAppLog("log", "at common/permission.js:104", "permissionStatus:" + status);
  8422. if (status === 1970168948) {
  8423. result = null;
  8424. } else if (status === 1735552628) {
  8425. result = 1;
  8426. } else {
  8427. result = 0;
  8428. }
  8429. plus.ios.deleteObject(avaudiosession);
  8430. return result;
  8431. }
  8432. function calendar() {
  8433. var result = null;
  8434. var EKEventStore = plus.ios.import("EKEventStore");
  8435. var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
  8436. if (ekAuthStatus == 3) {
  8437. result = 1;
  8438. formatAppLog("log", "at common/permission.js:122", "日历权限已经开启");
  8439. } else {
  8440. formatAppLog("log", "at common/permission.js:124", "日历权限没有开启");
  8441. }
  8442. plus.ios.deleteObject(EKEventStore);
  8443. return result;
  8444. }
  8445. function memo() {
  8446. var result = null;
  8447. var EKEventStore = plus.ios.import("EKEventStore");
  8448. var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
  8449. if (ekAuthStatus == 3) {
  8450. result = 1;
  8451. formatAppLog("log", "at common/permission.js:136", "备忘录权限已经开启");
  8452. } else {
  8453. formatAppLog("log", "at common/permission.js:138", "备忘录权限没有开启");
  8454. }
  8455. plus.ios.deleteObject(EKEventStore);
  8456. return result;
  8457. }
  8458. function requestIOS(permissionID) {
  8459. return new Promise((resolve, reject) => {
  8460. switch (permissionID) {
  8461. case "push":
  8462. resolve(push());
  8463. break;
  8464. case "location":
  8465. resolve(location$1());
  8466. break;
  8467. case "record":
  8468. resolve(record());
  8469. break;
  8470. case "camera":
  8471. resolve(camera());
  8472. break;
  8473. case "album":
  8474. resolve(album());
  8475. break;
  8476. case "contact":
  8477. resolve(contact());
  8478. break;
  8479. case "calendar":
  8480. resolve(calendar());
  8481. break;
  8482. case "memo":
  8483. resolve(memo());
  8484. break;
  8485. default:
  8486. resolve(0);
  8487. break;
  8488. }
  8489. });
  8490. }
  8491. function requestAndroid(permissionID) {
  8492. return new Promise((resolve, reject) => {
  8493. plus.android.requestPermissions(
  8494. [permissionID],
  8495. function(resultObj) {
  8496. var result = 0;
  8497. for (var i2 = 0; i2 < resultObj.granted.length; i2++) {
  8498. var grantedPermission = resultObj.granted[i2];
  8499. formatAppLog("log", "at common/permission.js:187", "已获取的权限:" + grantedPermission);
  8500. result = 1;
  8501. }
  8502. for (var i2 = 0; i2 < resultObj.deniedPresent.length; i2++) {
  8503. var deniedPresentPermission = resultObj.deniedPresent[i2];
  8504. formatAppLog("log", "at common/permission.js:192", "拒绝本次申请的权限:" + deniedPresentPermission);
  8505. result = 0;
  8506. }
  8507. for (var i2 = 0; i2 < resultObj.deniedAlways.length; i2++) {
  8508. var deniedAlwaysPermission = resultObj.deniedAlways[i2];
  8509. formatAppLog("log", "at common/permission.js:197", "永久拒绝申请的权限:" + deniedAlwaysPermission);
  8510. result = -1;
  8511. }
  8512. resolve(result);
  8513. },
  8514. function(error) {
  8515. formatAppLog("log", "at common/permission.js:203", "result error: " + error.message);
  8516. resolve({
  8517. code: error.code,
  8518. message: error.message
  8519. });
  8520. }
  8521. );
  8522. });
  8523. }
  8524. function gotoAppPermissionSetting() {
  8525. if (permission.isIOS) {
  8526. var UIApplication = plus.ios.import("UIApplication");
  8527. var application2 = UIApplication.sharedApplication();
  8528. var NSURL2 = plus.ios.import("NSURL");
  8529. var setting2 = NSURL2.URLWithString("app-settings:");
  8530. application2.openURL(setting2);
  8531. plus.ios.deleteObject(setting2);
  8532. plus.ios.deleteObject(NSURL2);
  8533. plus.ios.deleteObject(application2);
  8534. } else {
  8535. var Intent = plus.android.importClass("android.content.Intent");
  8536. var Settings = plus.android.importClass("android.provider.Settings");
  8537. var Uri = plus.android.importClass("android.net.Uri");
  8538. var mainActivity = plus.android.runtimeMainActivity();
  8539. var intent = new Intent();
  8540. intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
  8541. var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
  8542. intent.setData(uri);
  8543. mainActivity.startActivity(intent);
  8544. }
  8545. }
  8546. const permission = {
  8547. get isIOS() {
  8548. return typeof isIOS === "boolean" ? isIOS : isIOS = uni.getSystemInfoSync().platform === "ios";
  8549. },
  8550. requestIOS,
  8551. requestAndroid,
  8552. gotoAppSetting: gotoAppPermissionSetting
  8553. };
  8554. const baseURL = "http://dsg.tms.api.aibasil.cn";
  8555. const warehouseScanURL = baseURL + "/admin/order.sheetOrder/warehouseScan";
  8556. const instockScanURL = baseURL + "/admin/order.ScanOrder/instock";
  8557. const outStockScanURL = baseURL + "/admin/order.scanOrder/outStock";
  8558. const orderInfoURL = baseURL + "/admin/order.scanOrder/getOrderInfo";
  8559. const companyListURL = baseURL + "/admin/expressCompany/index";
  8560. const checkWaybillGoodsURL = baseURL + "/admin/order.scanOrder/checkWaybillGoods";
  8561. const getWarehouseSpaceURL = baseURL + "/admin/order.ScanOrder/getWarehouseSpace";
  8562. const weighScanURL = baseURL + "/admin/order.ScanOrder/weigh";
  8563. const getBindParamsURL = baseURL + "/admin/order.scanOrder/getBindParams";
  8564. const getPrinterListURL = baseURL + "/admin/printer//getPrinterList";
  8565. const bindShippingURL = baseURL + "/admin/order.scanOrder/bindShipping";
  8566. const getWaybillsURL = baseURL + "/admin/order.scanOrder/getWaybills";
  8567. const printWaybillLabelURL = baseURL + "/admin/order.ScanOrder/printWaybillLabel";
  8568. const printCustomerLabelURL = baseURL + "/admin/order.ScanOrder/printCustomerLabel";
  8569. const loginURL = baseURL + "/admin/index/login";
  8570. const getcaptchaURL = baseURL + "/api/common/captcha";
  8571. const pickupWaybillDeliveryOrderURL = baseURL + "/admin/pickup.waybillDeliveryOrder";
  8572. const addWaybillNoURL = baseURL + "/admin/warehouse.waybillNo/add";
  8573. const waybillNoOptions = baseURL + "/admin/warehouse.waybillNo/getOptions";
  8574. const sendOutURL = baseURL + "/admin/pickup.waybillDeliveryOrder/sendOut";
  8575. const deliveredURL = baseURL + "/admin/pickup.waybillDeliveryOrder/delivered";
  8576. const refuseURL = baseURL + "/admin/pickup.waybillDeliveryOrder/refuse";
  8577. const createTrackPodURL = baseURL + "/admin/pickup.waybillDeliveryOrder/createTrackPod";
  8578. const cancelFedExPickUpURL = baseURL + "/admin/pickup.waybillDeliveryOrder/cancelFedExPickUp";
  8579. const getAliyunOssSignatureUrl = baseURL + "/admin/Config/getAliyunOssSignature";
  8580. const hexList = [];
  8581. for (let i2 = 0; i2 <= 15; i2++) {
  8582. hexList[i2] = i2.toString(16);
  8583. }
  8584. function uuid() {
  8585. let uuid2 = "";
  8586. for (let i2 = 1; i2 <= 36; i2++) {
  8587. if (i2 === 9 || i2 === 14 || i2 === 19 || i2 === 24) {
  8588. uuid2 += "-";
  8589. } else if (i2 === 15) {
  8590. uuid2 += 4;
  8591. } else if (i2 === 20) {
  8592. uuid2 += hexList[Math.random() * 4 | 8];
  8593. } else {
  8594. uuid2 += hexList[Math.random() * 16 | 0];
  8595. }
  8596. }
  8597. return uuid2;
  8598. }
  8599. const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
  8600. __name: "index",
  8601. setup(__props, { expose: __expose }) {
  8602. __expose();
  8603. const alertDialog = vue.ref();
  8604. const message = vue.ref();
  8605. const valiForm = vue.ref();
  8606. const printerDialog = vue.ref();
  8607. const token = vue.ref(null);
  8608. const user = vue.ref(null);
  8609. const loading = vue.ref(false);
  8610. const images = vue.ref([]);
  8611. const messageType = vue.ref("");
  8612. const messageText = vue.ref("");
  8613. const batchOptions = vue.ref([]);
  8614. const spaces = vue.ref([]);
  8615. const previewImage = vue.ref(null);
  8616. const maxImages = vue.ref(6);
  8617. const printerList = vue.ref({});
  8618. const historyList = vue.ref([]);
  8619. const printers = vue.ref([]);
  8620. const sendToPeinter = vue.ref([1]);
  8621. const selectPrinter = vue.ref(0);
  8622. const subLoading = vue.ref(false);
  8623. const focusType = vue.ref(true);
  8624. const result = vue.ref();
  8625. const valiFormData = vue.reactive({
  8626. images: [],
  8627. orderNum: "",
  8628. batch_number: "",
  8629. space_code: "",
  8630. weight: "",
  8631. typing: true
  8632. });
  8633. const rules = vue.computed(() => {
  8634. return {
  8635. orderNum: {
  8636. rules: [
  8637. {
  8638. required: true,
  8639. errorMessage: "单号不能为空"
  8640. }
  8641. ]
  8642. },
  8643. weight: {
  8644. rules: [
  8645. {
  8646. required: true,
  8647. errorMessage: "重量不能为空"
  8648. },
  8649. {
  8650. format: "number",
  8651. errorMessage: "重量只能输入数字"
  8652. }
  8653. ]
  8654. }
  8655. };
  8656. });
  8657. const spaceRes = vue.computed(() => {
  8658. try {
  8659. const res = spaces.value.find((item) => item.value === valiFormData.space_code);
  8660. return res == null ? void 0 : res.text;
  8661. } catch (e2) {
  8662. formatAppLog("log", "at pages/weigh/index.vue:201", e2);
  8663. return "";
  8664. }
  8665. });
  8666. onShow(() => {
  8667. focusType.value = true;
  8668. loading.value = false;
  8669. token.value = uni.getStorageSync("token");
  8670. user.value = uni.getStorageSync("user");
  8671. getWarehouseSpace();
  8672. getBindParams();
  8673. getPrinterList();
  8674. });
  8675. onHide(() => {
  8676. focusType.value = false;
  8677. loading.value = false;
  8678. });
  8679. onNavigationBarButtonTap((event) => {
  8680. if (event.index === 0) {
  8681. uni.navigateTo({
  8682. url: "/pages/weigh/instockLog"
  8683. });
  8684. }
  8685. });
  8686. const getWarehouseSpace = () => {
  8687. uni.request({
  8688. url: getWarehouseSpaceURL,
  8689. method: "POST",
  8690. header: {
  8691. batoken: token.value
  8692. },
  8693. data: {
  8694. code: ""
  8695. },
  8696. success: (res) => {
  8697. if (res.data.code === 1) {
  8698. spaces.value = res.data.data.spaces.map((item) => {
  8699. return {
  8700. text: item.name,
  8701. value: item.code
  8702. };
  8703. });
  8704. }
  8705. }
  8706. });
  8707. };
  8708. const getBindParams = () => {
  8709. uni.request({
  8710. url: getBindParamsURL,
  8711. method: "GET",
  8712. header: {
  8713. batoken: token.value
  8714. },
  8715. success: (res) => {
  8716. if (res.data.code === 1) {
  8717. batchOptions.value = res.data.data.batch_number.map((item) => {
  8718. return {
  8719. text: item.name,
  8720. value: item.id
  8721. };
  8722. });
  8723. }
  8724. },
  8725. fail(e2) {
  8726. formatAppLog("log", "at pages/weigh/index.vue:267", "fail--", e2);
  8727. }
  8728. });
  8729. };
  8730. const getPrinterList = () => {
  8731. uni.request({
  8732. url: getPrinterListURL,
  8733. method: "GET",
  8734. header: {
  8735. batoken: token.value
  8736. },
  8737. success: (res) => {
  8738. if (res.data.code === 1) {
  8739. printerList.value = res.data.data.printers;
  8740. printers.value = Object.values(printerList.value).map((item) => {
  8741. return {
  8742. text: item.name,
  8743. value: item.value
  8744. };
  8745. });
  8746. }
  8747. },
  8748. fail(e2) {
  8749. formatAppLog("log", "at pages/weigh/index.vue:291", "fail--", e2);
  8750. }
  8751. });
  8752. };
  8753. const reset = () => {
  8754. loading.value = false;
  8755. focusType.value = false;
  8756. images.value = [];
  8757. valiFormData.orderNum = "";
  8758. valiFormData.batch_number = "";
  8759. valiFormData.weight = "";
  8760. valiFormData.typing = true;
  8761. vue.nextTick(() => {
  8762. focusType.value = true;
  8763. });
  8764. };
  8765. const scan = async () => {
  8766. let status = await checkPermission();
  8767. if (status !== 1) {
  8768. return;
  8769. }
  8770. uni.scanCode({
  8771. success: (res) => {
  8772. result.value = res.result;
  8773. valiFormData.orderNum = res.result;
  8774. },
  8775. fail: (err) => {
  8776. }
  8777. });
  8778. };
  8779. const checkPermission = async () => {
  8780. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  8781. if (status === null || status === 1) {
  8782. status = 1;
  8783. } else {
  8784. uni.showModal({
  8785. content: "Camera permission required",
  8786. confirmText: "Setting",
  8787. success: function(res) {
  8788. if (res.confirm) {
  8789. permission.gotoAppSetting();
  8790. }
  8791. }
  8792. });
  8793. }
  8794. return status;
  8795. };
  8796. let st2;
  8797. const warehouseScan = async () => {
  8798. st2 && clearTimeout(st2);
  8799. await checkWaybillGoods();
  8800. };
  8801. const checkWaybillGoods = async () => {
  8802. loading.value = true;
  8803. uni.request({
  8804. url: checkWaybillGoodsURL,
  8805. method: "POST",
  8806. header: {
  8807. batoken: token.value
  8808. },
  8809. data: {
  8810. order_no: valiFormData.orderNum
  8811. },
  8812. success: (res) => {
  8813. if (res.data.code === 1 && res.data.data.is_goods_empty) {
  8814. alertDialog.value.open();
  8815. } else {
  8816. weighScan(0);
  8817. }
  8818. }
  8819. });
  8820. };
  8821. const weighScan = (is_save_goods) => {
  8822. const images2 = getImages();
  8823. formatAppLog("log", "at pages/weigh/index.vue:376", "images--", images2);
  8824. let allImgVerify = true;
  8825. for (var i2 = 0; i2 < images2.length; i2++) {
  8826. if (!images2[i2].savePath) {
  8827. allImgVerify = false;
  8828. }
  8829. }
  8830. if (!allImgVerify) {
  8831. messageType.value = "error";
  8832. messageText.value = "图片还没上传完毕,请稍后...";
  8833. message.value.open();
  8834. loading.value = false;
  8835. return;
  8836. }
  8837. uni.request({
  8838. url: weighScanURL,
  8839. method: "POST",
  8840. header: {
  8841. batoken: token.value
  8842. },
  8843. data: {
  8844. order_no: valiFormData.orderNum,
  8845. weight: valiFormData.weight,
  8846. is_save_goods,
  8847. images: images2
  8848. },
  8849. success: (res) => {
  8850. loading.value = false;
  8851. if (res.data.code == 1) {
  8852. messageType.value = "success";
  8853. messageText.value = res.data.msg;
  8854. message.value.open();
  8855. formatAppLog("log", "at pages/weigh/index.vue:408", "res.data.data---", res.data.data);
  8856. const historyItem = {
  8857. orderNum: valiFormData.orderNum,
  8858. createTime: /* @__PURE__ */ new Date(),
  8859. space: spaceRes.value,
  8860. type: "称重",
  8861. status: true
  8862. };
  8863. historyList.value.unshift(historyItem);
  8864. uni.setStorageSync("weighHistory", historyList.value);
  8865. getHistory();
  8866. if (res.data.data.express_label) {
  8867. formatAppLog("log", "at pages/weigh/index.vue:422", "有打印面单");
  8868. } else {
  8869. st2 = setTimeout(() => {
  8870. reset();
  8871. st2 && clearTimeout(st2);
  8872. }, 1e3);
  8873. }
  8874. } else {
  8875. messageType.value = "error";
  8876. messageText.value = res.data.msg;
  8877. message.value.open();
  8878. const historyItem = {
  8879. orderNum: valiFormData.orderNum,
  8880. createTime: /* @__PURE__ */ new Date(),
  8881. space: spaceRes.value,
  8882. type: "称重",
  8883. status: false
  8884. };
  8885. historyList.value.unshift(historyItem);
  8886. uni.setStorageSync("weighHistory", historyList.value);
  8887. getHistory();
  8888. st2 = setTimeout(() => {
  8889. reset();
  8890. st2 && clearTimeout(st2);
  8891. }, 1e3);
  8892. }
  8893. }
  8894. });
  8895. };
  8896. const close = () => {
  8897. printerDialog.value.close();
  8898. st2 = setTimeout(() => {
  8899. reset();
  8900. st2 && clearTimeout(st2);
  8901. }, 700);
  8902. };
  8903. const dialogConfirm = () => {
  8904. weighScan(1);
  8905. };
  8906. const dialogClose = () => {
  8907. weighScan(0);
  8908. };
  8909. const sendToPeinterFun = (res) => {
  8910. if (!res.detail.value.length > 0) {
  8911. selectPrinter.value = 0;
  8912. } else {
  8913. selectPrinter.value = printers.value[0].value;
  8914. }
  8915. };
  8916. const printConfirm = () => {
  8917. subLoading.value = true;
  8918. uni.request({
  8919. url: printWaybillLabelURL,
  8920. method: "POST",
  8921. header: {
  8922. batoken: token.value
  8923. },
  8924. data: {
  8925. order_no: valiFormData.orderNum,
  8926. printer_code: selectPrinter
  8927. },
  8928. success: (res) => {
  8929. close();
  8930. subLoading.value = false;
  8931. formatAppLog("log", "at pages/weigh/index.vue:490", "打印成功", res);
  8932. messageType.value = "success";
  8933. messageText.value = "打印成功";
  8934. message.value.open();
  8935. }
  8936. });
  8937. };
  8938. const onsubmit = () => {
  8939. valiForm.value.validate().then((res) => {
  8940. warehouseScan();
  8941. }).catch((err) => {
  8942. formatAppLog("log", "at pages/weigh/index.vue:504", "err", err);
  8943. });
  8944. };
  8945. const getHistory = () => {
  8946. historyList.value = uni.getStorageSync("weighHistory");
  8947. };
  8948. const getImages = () => {
  8949. const res = images.value.map((item) => {
  8950. return {
  8951. name: item.name,
  8952. savePath: item.serverUrl,
  8953. fileSize: item.size,
  8954. mimeType: item.type
  8955. };
  8956. });
  8957. formatAppLog("log", "at pages/weigh/index.vue:519", "res22 ", res);
  8958. return res;
  8959. };
  8960. const getAliyunOssSignature = (rawFiles) => {
  8961. uni.request({
  8962. url: getAliyunOssSignatureUrl,
  8963. method: "GET",
  8964. header: {
  8965. batoken: token.value
  8966. },
  8967. success: ({ data }) => {
  8968. const signature = data.data.signature;
  8969. const uploadPromises = rawFiles.map((image) => {
  8970. return upLoadFile(signature, image);
  8971. });
  8972. Promise.all(uploadPromises).then((results) => {
  8973. formatAppLog("log", "at pages/weigh/index.vue:540", "所有图片加载成功:", results);
  8974. uni.showToast({
  8975. title: "加载成功",
  8976. icon: "success"
  8977. });
  8978. }).catch((error) => {
  8979. formatAppLog("error", "at pages/weigh/index.vue:547", "加载失败:", error);
  8980. uni.showToast({
  8981. title: "加载失败",
  8982. icon: "none"
  8983. });
  8984. });
  8985. },
  8986. fail: (err) => {
  8987. formatAppLog("log", "at pages/weigh/index.vue:555", err);
  8988. }
  8989. });
  8990. };
  8991. const upLoadFile = (signature, image) => {
  8992. const fileData = {
  8993. policy: signature.policy,
  8994. signature: signature.signature,
  8995. ossaccessKeyId: signature.ossAccessKeyId,
  8996. key: signature.dir + dayjs().format("YYYYMMDD") + "/" + uuid() + "_" + image.name,
  8997. dir: signature.dir,
  8998. host: signature.host,
  8999. file: image.file
  9000. };
  9001. return new Promise((resolve, reject) => {
  9002. let name = image.name;
  9003. name = "file";
  9004. const uploadTask = uni.uploadFile({
  9005. url: signature.host,
  9006. // 你的上传接口地址
  9007. filePath: image.path,
  9008. name,
  9009. // 这里根据后端需要的字段来定义
  9010. formData: fileData,
  9011. success: (uploadFileRes) => {
  9012. if (uploadFileRes.statusCode === 204 || uploadFileRes.statusCode === 200) {
  9013. image.serverUrl = fileData.key;
  9014. resolve(uploadFileRes);
  9015. } else {
  9016. reject(uploadFileRes);
  9017. }
  9018. },
  9019. fail: (error) => {
  9020. formatAppLog("log", "at pages/weigh/index.vue:588", "error++", error);
  9021. reject(error);
  9022. },
  9023. // 更新上传进度
  9024. complete: () => {
  9025. formatAppLog("log", "at pages/weigh/index.vue:593", "complete---");
  9026. image.progress = 100;
  9027. }
  9028. });
  9029. uploadTask.onProgressUpdate((progressEvent) => {
  9030. image.progress = progressEvent.progress;
  9031. });
  9032. });
  9033. };
  9034. const chooseImage = () => {
  9035. uni.chooseImage({
  9036. count: maxImages.value - images.value.length,
  9037. success: (res) => {
  9038. images.value = images.value.concat(
  9039. res.tempFiles.map((item) => {
  9040. const res2 = {
  9041. size: item.size,
  9042. path: item.path,
  9043. name: item.name,
  9044. type: item.type,
  9045. progress: 0,
  9046. file: item
  9047. };
  9048. const suffix = item.path.substring(item.path.lastIndexOf(".") + 1);
  9049. const fileName = item.path.substring(item.path.lastIndexOf("/") + 1);
  9050. res2.name = fileName;
  9051. res2.type = suffix;
  9052. return res2;
  9053. })
  9054. );
  9055. const paddingImages = images.value.filter((image) => image.progress === 0);
  9056. vue.nextTick(() => {
  9057. getAliyunOssSignature(paddingImages);
  9058. });
  9059. },
  9060. fail: (err) => {
  9061. formatAppLog("error", "at pages/weigh/index.vue:638", err);
  9062. }
  9063. });
  9064. };
  9065. const deleteImage = (index) => {
  9066. images.value.splice(index, 1);
  9067. };
  9068. const openPreview = (image) => {
  9069. previewImage.value = image;
  9070. };
  9071. const closePreview = () => {
  9072. previewImage.value = null;
  9073. };
  9074. const __returned__ = { alertDialog, message, valiForm, printerDialog, token, user, loading, images, messageType, messageText, batchOptions, spaces, previewImage, maxImages, printerList, historyList, printers, sendToPeinter, selectPrinter, subLoading, focusType, result, valiFormData, rules, spaceRes, getWarehouseSpace, getBindParams, getPrinterList, reset, scan, checkPermission, get st() {
  9075. return st2;
  9076. }, set st(v2) {
  9077. st2 = v2;
  9078. }, warehouseScan, checkWaybillGoods, weighScan, close, dialogConfirm, dialogClose, sendToPeinterFun, printConfirm, onsubmit, getHistory, getImages, getAliyunOssSignature, upLoadFile, chooseImage, deleteImage, openPreview, closePreview };
  9079. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  9080. return __returned__;
  9081. }
  9082. });
  9083. function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
  9084. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  9085. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  9086. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  9087. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  9088. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  9089. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  9090. const _component_uni_popup_dialog = resolveEasycom(vue.resolveDynamicComponent("uni-popup-dialog"), __easycom_0$5);
  9091. const _component_uni_data_checkbox = resolveEasycom(vue.resolveDynamicComponent("uni-data-checkbox"), __easycom_0$3);
  9092. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  9093. vue.createElementVNode("view", { class: "example" }, [
  9094. vue.createCommentVNode(" 基础表单校验 "),
  9095. vue.createVNode(_component_uni_forms, {
  9096. ref: "valiForm",
  9097. "label-align": "right",
  9098. rules: $setup.rules,
  9099. modelValue: $setup.valiFormData
  9100. }, {
  9101. default: vue.withCtx(() => [
  9102. vue.createVNode(_component_uni_forms_item, {
  9103. label: "单号",
  9104. required: true,
  9105. name: "orderNum"
  9106. }, {
  9107. default: vue.withCtx(() => [
  9108. vue.createVNode(_component_uni_easyinput, {
  9109. modelValue: $setup.valiFormData.orderNum,
  9110. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  9111. placeholder: "请输入单号",
  9112. suffixIcon: "scan",
  9113. focus: $setup.focusType,
  9114. onIconClick: $setup.scan
  9115. }, null, 8, ["modelValue", "focus"])
  9116. ]),
  9117. _: 1
  9118. /* STABLE */
  9119. }),
  9120. vue.createVNode(_component_uni_forms_item, {
  9121. label: "重量",
  9122. required: "",
  9123. name: "weight"
  9124. }, {
  9125. default: vue.withCtx(() => [
  9126. vue.createVNode(_component_uni_easyinput, {
  9127. modelValue: $setup.valiFormData.weight,
  9128. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.weight = $event),
  9129. placeholder: "请输入重量",
  9130. oninput: "value=value.replace(/[^\\d.]/g,'').replace(/^\\./g, '').replace(/\\.{2,}/g, '').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').match(/^\\d*(\\.?\\d{0,2})/g)[0] || null"
  9131. }, {
  9132. right: vue.withCtx(() => [
  9133. vue.createElementVNode("view", { class: "weight-right" }, "KG")
  9134. ]),
  9135. _: 1
  9136. /* STABLE */
  9137. }, 8, ["modelValue"])
  9138. ]),
  9139. _: 1
  9140. /* STABLE */
  9141. }),
  9142. vue.createVNode(_component_uni_forms_item, {
  9143. label: "图片",
  9144. name: "images"
  9145. }, {
  9146. default: vue.withCtx(() => [
  9147. vue.createElementVNode("view", { class: "upload-container" }, [
  9148. vue.createElementVNode("view", { class: "preview" }, [
  9149. (vue.openBlock(true), vue.createElementBlock(
  9150. vue.Fragment,
  9151. null,
  9152. vue.renderList($setup.images, (img, index) => {
  9153. return vue.openBlock(), vue.createElementBlock("view", {
  9154. key: index,
  9155. class: "image-container"
  9156. }, [
  9157. vue.createElementVNode("image", {
  9158. src: img.path,
  9159. class: "preview-image",
  9160. mode: "aspectFill",
  9161. onClick: ($event) => $setup.openPreview(img.path)
  9162. }, null, 8, ["src", "onClick"]),
  9163. vue.createElementVNode("progress", {
  9164. percent: img.progress || 0,
  9165. activeColor: Number(img.progress || 0) === 100 ? "#00ff00" : "#10AEFF",
  9166. "stroke-width": "3"
  9167. }, null, 8, ["percent", "activeColor"]),
  9168. img.status === "success" ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, "1")) : vue.createCommentVNode("v-if", true),
  9169. vue.createVNode(_component_uni_icons, {
  9170. class: "delete-icon",
  9171. onClick: ($event) => $setup.deleteImage(index),
  9172. type: "clear",
  9173. size: "20",
  9174. color: "red"
  9175. }, null, 8, ["onClick"])
  9176. ]);
  9177. }),
  9178. 128
  9179. /* KEYED_FRAGMENT */
  9180. )),
  9181. $setup.images.length < $setup.maxImages ? (vue.openBlock(), vue.createElementBlock("view", {
  9182. key: 0,
  9183. class: "choose-image-container",
  9184. onClick: $setup.chooseImage
  9185. }, [
  9186. vue.createVNode(_component_uni_icons, {
  9187. type: "plusempty",
  9188. size: "40",
  9189. color: "#ccc"
  9190. })
  9191. ])) : vue.createCommentVNode("v-if", true)
  9192. ]),
  9193. vue.createElementVNode("text", { style: { "padding-top": "8px" } }, "最多选择6张图片"),
  9194. vue.createCommentVNode(" 放大预览 "),
  9195. $setup.previewImage ? (vue.openBlock(), vue.createElementBlock("view", {
  9196. key: 0,
  9197. class: "preview-modal",
  9198. onClick: $setup.closePreview
  9199. }, [
  9200. vue.createElementVNode("image", {
  9201. src: $setup.previewImage,
  9202. class: "preview-large",
  9203. mode: "aspectFit",
  9204. onClick: vue.withModifiers($setup.closePreview, ["stop"])
  9205. }, null, 8, ["src"])
  9206. ])) : vue.createCommentVNode("v-if", true)
  9207. ])
  9208. ]),
  9209. _: 1
  9210. /* STABLE */
  9211. })
  9212. ]),
  9213. _: 1
  9214. /* STABLE */
  9215. }, 8, ["rules", "modelValue"]),
  9216. vue.createElementVNode("view", { class: "button-group" }, [
  9217. vue.createElementVNode("button", {
  9218. type: "info",
  9219. onClick: $setup.reset
  9220. }, "重置"),
  9221. vue.createElementVNode("button", {
  9222. type: "primary",
  9223. onClick: $setup.onsubmit,
  9224. loading: $setup.loading
  9225. }, [
  9226. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  9227. key: 0,
  9228. type: "checkmarkempty",
  9229. size: "18",
  9230. color: "white"
  9231. })) : vue.createCommentVNode("v-if", true),
  9232. vue.createTextVNode(" 提交 ")
  9233. ], 8, ["loading"])
  9234. ])
  9235. ]),
  9236. vue.createElementVNode("view", { class: "history" }, [
  9237. (vue.openBlock(true), vue.createElementBlock(
  9238. vue.Fragment,
  9239. null,
  9240. vue.renderList($setup.historyList.slice(0, 5), (item, i2) => {
  9241. return vue.openBlock(), vue.createElementBlock("view", {
  9242. class: "item",
  9243. key: i2
  9244. }, [
  9245. vue.createElementVNode(
  9246. "text",
  9247. {
  9248. class: "code",
  9249. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  9250. },
  9251. [
  9252. vue.createTextVNode(
  9253. vue.toDisplayString(item.orderNum) + " ",
  9254. 1
  9255. /* TEXT */
  9256. ),
  9257. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  9258. "text",
  9259. { key: 0 },
  9260. "批次号: " + vue.toDisplayString(item.batch_text),
  9261. 1
  9262. /* TEXT */
  9263. )) : vue.createCommentVNode("v-if", true),
  9264. item.space ? (vue.openBlock(), vue.createElementBlock(
  9265. "text",
  9266. { key: 1 },
  9267. "仓位编码: " + vue.toDisplayString(item.space),
  9268. 1
  9269. /* TEXT */
  9270. )) : vue.createCommentVNode("v-if", true),
  9271. vue.createTextVNode(
  9272. " " + vue.toDisplayString(item.type),
  9273. 1
  9274. /* TEXT */
  9275. )
  9276. ],
  9277. 4
  9278. /* STYLE */
  9279. ),
  9280. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  9281. key: 0,
  9282. type: "checkmarkempty",
  9283. class: "status",
  9284. size: "16",
  9285. color: "green"
  9286. })) : (vue.openBlock(), vue.createElementBlock("text", {
  9287. key: 1,
  9288. class: "status fail"
  9289. }, "F")),
  9290. vue.createElementVNode(
  9291. "text",
  9292. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  9293. vue.toDisplayString("\r\n" + item.createTime),
  9294. 1
  9295. /* TEXT */
  9296. )
  9297. ]);
  9298. }),
  9299. 128
  9300. /* KEYED_FRAGMENT */
  9301. ))
  9302. ]),
  9303. vue.createVNode(
  9304. _component_uni_popup,
  9305. {
  9306. ref: "message",
  9307. type: "message"
  9308. },
  9309. {
  9310. default: vue.withCtx(() => [
  9311. vue.createVNode(_component_uni_popup_message, {
  9312. type: $setup.messageType,
  9313. message: $setup.messageText,
  9314. duration: 2e3
  9315. }, null, 8, ["type", "message"])
  9316. ]),
  9317. _: 1
  9318. /* STABLE */
  9319. },
  9320. 512
  9321. /* NEED_PATCH */
  9322. ),
  9323. vue.createVNode(
  9324. _component_uni_popup,
  9325. {
  9326. ref: "alertDialog",
  9327. type: "dialog"
  9328. },
  9329. {
  9330. default: vue.withCtx(() => [
  9331. vue.createVNode(_component_uni_popup_dialog, {
  9332. type: "info",
  9333. cancelText: "否",
  9334. confirmText: "是",
  9335. title: "提示",
  9336. content: "是否按默认申报(默认申报为:衣服,10件,单价1)",
  9337. onConfirm: $setup.dialogConfirm,
  9338. onClose: $setup.dialogClose
  9339. })
  9340. ]),
  9341. _: 1
  9342. /* STABLE */
  9343. },
  9344. 512
  9345. /* NEED_PATCH */
  9346. ),
  9347. vue.createVNode(
  9348. _component_uni_popup,
  9349. {
  9350. ref: "printerDialog",
  9351. type: "dialog",
  9352. "is-mask-click": false
  9353. },
  9354. {
  9355. default: vue.withCtx(() => [
  9356. vue.createElementVNode("view", { style: { "width": "90%", "margin": "0 auto", "min-height": "250px", "background-color": "#fff", "border-radius": "5px" } }, [
  9357. vue.createElementVNode("view", {
  9358. class: "",
  9359. style: { "font-size": "20px", "border-bottom": "1px solid #e1e1e1", "padding": "15px 10px" }
  9360. }, [
  9361. vue.createElementVNode("view", null, [
  9362. vue.createElementVNode("view", { style: { "margin-bottom": "20px" } }, [
  9363. vue.createElementVNode("text", null, "打印尾程面单")
  9364. ]),
  9365. vue.createElementVNode("view", null, [
  9366. $setup.printerList ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  9367. vue.createElementVNode("view", null, [
  9368. vue.createVNode(_component_uni_data_checkbox, {
  9369. multiple: "",
  9370. modelValue: $setup.sendToPeinter,
  9371. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.sendToPeinter = $event),
  9372. localdata: [
  9373. {
  9374. text: "发送到标签打印机打印",
  9375. value: 1
  9376. }
  9377. ],
  9378. onChange: $setup.sendToPeinterFun
  9379. }, {
  9380. default: vue.withCtx(() => [
  9381. vue.createTextVNode(" > ")
  9382. ]),
  9383. _: 1
  9384. /* STABLE */
  9385. }, 8, ["modelValue"]),
  9386. vue.createVNode(_component_uni_data_checkbox, {
  9387. disabled: $setup.sendToPeinter.length === 0,
  9388. modelValue: $setup.selectPrinter,
  9389. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.selectPrinter = $event),
  9390. localdata: $setup.printers
  9391. }, null, 8, ["disabled", "modelValue", "localdata"])
  9392. ])
  9393. ])) : vue.createCommentVNode("v-if", true)
  9394. ])
  9395. ]),
  9396. vue.createElementVNode("view", { style: { "text-align": "center", "position": "absolute", "bottom": "10px", "width": "90%", "display": "flex", "margin": "0 auto", "left": "0", "right": "0" } }, [
  9397. vue.createElementVNode("button", {
  9398. onClick: $setup.close,
  9399. style: { "width": "35%" }
  9400. }, "关闭"),
  9401. vue.createElementVNode("button", {
  9402. onClick: $setup.printConfirm,
  9403. "hover-stay-time": 500,
  9404. loading: $setup.subLoading,
  9405. disabled: $setup.sendToPeinter.length === 0 || $setup.subLoading,
  9406. class: "my-bt-bg",
  9407. style: { "width": "35%" }
  9408. }, " 打印 ", 8, ["loading", "disabled"])
  9409. ])
  9410. ])
  9411. ])
  9412. ]),
  9413. _: 1
  9414. /* STABLE */
  9415. },
  9416. 512
  9417. /* NEED_PATCH */
  9418. )
  9419. ]);
  9420. }
  9421. const PagesWeighIndex = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r], ["__scopeId", "data-v-14676f1a"], ["__file", "E:/HBuilderProjects/yta/pages/weigh/index.vue"]]);
  9422. const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
  9423. __name: "instockLog",
  9424. setup(__props, { expose: __expose }) {
  9425. __expose();
  9426. const historyList = vue.ref([]);
  9427. const getHistory = () => {
  9428. historyList.value = uni.getStorageSync("weighHistory");
  9429. };
  9430. onLoad(() => {
  9431. getHistory();
  9432. });
  9433. const __returned__ = { historyList, getHistory };
  9434. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  9435. return __returned__;
  9436. }
  9437. });
  9438. function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
  9439. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  9440. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  9441. (vue.openBlock(true), vue.createElementBlock(
  9442. vue.Fragment,
  9443. null,
  9444. vue.renderList($setup.historyList, (item, i2) => {
  9445. return vue.openBlock(), vue.createElementBlock("view", { class: "item" }, [
  9446. vue.createElementVNode(
  9447. "text",
  9448. {
  9449. class: "code",
  9450. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  9451. },
  9452. [
  9453. vue.createTextVNode(
  9454. vue.toDisplayString(item.orderNum) + " ",
  9455. 1
  9456. /* TEXT */
  9457. ),
  9458. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  9459. "text",
  9460. { key: 0 },
  9461. "批次号: " + vue.toDisplayString(item.batch_text),
  9462. 1
  9463. /* TEXT */
  9464. )) : vue.createCommentVNode("v-if", true),
  9465. item.space ? (vue.openBlock(), vue.createElementBlock(
  9466. "text",
  9467. { key: 1 },
  9468. "仓位编码: " + vue.toDisplayString(item.space),
  9469. 1
  9470. /* TEXT */
  9471. )) : vue.createCommentVNode("v-if", true),
  9472. vue.createTextVNode(
  9473. " " + vue.toDisplayString(item.type),
  9474. 1
  9475. /* TEXT */
  9476. )
  9477. ],
  9478. 4
  9479. /* STYLE */
  9480. ),
  9481. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  9482. key: 0,
  9483. type: "checkmarkempty",
  9484. class: "status",
  9485. size: "16",
  9486. color: "green"
  9487. })) : (vue.openBlock(), vue.createElementBlock("text", {
  9488. key: 1,
  9489. class: "status fail"
  9490. }, "F")),
  9491. vue.createElementVNode(
  9492. "text",
  9493. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  9494. vue.toDisplayString("\r\n" + item.createTime),
  9495. 1
  9496. /* TEXT */
  9497. )
  9498. ]);
  9499. }),
  9500. 256
  9501. /* UNKEYED_FRAGMENT */
  9502. )),
  9503. $setup.historyList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  9504. key: 0,
  9505. class: "is-empty"
  9506. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  9507. ]);
  9508. }
  9509. const PagesWeighInstockLog = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q], ["__scopeId", "data-v-f9ce4ab0"], ["__file", "E:/HBuilderProjects/yta/pages/weigh/instockLog.vue"]]);
  9510. const _sfc_main$q = {
  9511. name: "uni-data-select",
  9512. mixins: [er.mixinDatacom || {}],
  9513. props: {
  9514. localdata: {
  9515. type: Array,
  9516. default() {
  9517. return [];
  9518. }
  9519. },
  9520. value: {
  9521. type: [String, Number],
  9522. default: ""
  9523. },
  9524. modelValue: {
  9525. type: [String, Number],
  9526. default: ""
  9527. },
  9528. label: {
  9529. type: String,
  9530. default: ""
  9531. },
  9532. placeholder: {
  9533. type: String,
  9534. default: "请选择"
  9535. },
  9536. emptyTips: {
  9537. type: String,
  9538. default: "无选项"
  9539. },
  9540. clear: {
  9541. type: Boolean,
  9542. default: true
  9543. },
  9544. defItem: {
  9545. type: Number,
  9546. default: 0
  9547. },
  9548. disabled: {
  9549. type: Boolean,
  9550. default: false
  9551. },
  9552. // 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
  9553. format: {
  9554. type: String,
  9555. default: ""
  9556. },
  9557. placement: {
  9558. type: String,
  9559. default: "bottom"
  9560. }
  9561. },
  9562. data() {
  9563. return {
  9564. showSelector: false,
  9565. current: "",
  9566. mixinDatacomResData: [],
  9567. apps: [],
  9568. channels: [],
  9569. cacheKey: "uni-data-select-lastSelectedValue"
  9570. };
  9571. },
  9572. created() {
  9573. this.debounceGet = this.debounce(() => {
  9574. this.query();
  9575. }, 300);
  9576. if (this.collection && !this.localdata.length) {
  9577. this.debounceGet();
  9578. }
  9579. },
  9580. computed: {
  9581. typePlaceholder() {
  9582. const text = {
  9583. "opendb-stat-app-versions": "版本",
  9584. "opendb-app-channels": "渠道",
  9585. "opendb-app-list": "应用"
  9586. };
  9587. const common = this.placeholder;
  9588. const placeholder = text[this.collection];
  9589. return placeholder ? common + placeholder : common;
  9590. },
  9591. valueCom() {
  9592. return this.modelValue;
  9593. },
  9594. textShow() {
  9595. let text = this.current;
  9596. if (text.length > 10) {
  9597. return text.slice(0, 25) + "...";
  9598. }
  9599. return text;
  9600. },
  9601. getOffsetByPlacement() {
  9602. switch (this.placement) {
  9603. case "top":
  9604. return "bottom:calc(100% + 12px);";
  9605. case "bottom":
  9606. return "top:calc(100% + 12px);";
  9607. }
  9608. }
  9609. },
  9610. watch: {
  9611. localdata: {
  9612. immediate: true,
  9613. handler(val, old) {
  9614. if (Array.isArray(val) && old !== val) {
  9615. this.mixinDatacomResData = val;
  9616. }
  9617. }
  9618. },
  9619. valueCom(val, old) {
  9620. this.initDefVal();
  9621. },
  9622. mixinDatacomResData: {
  9623. immediate: true,
  9624. handler(val) {
  9625. if (val.length) {
  9626. this.initDefVal();
  9627. }
  9628. }
  9629. }
  9630. },
  9631. methods: {
  9632. debounce(fn, time = 100) {
  9633. let timer = null;
  9634. return function(...args) {
  9635. if (timer)
  9636. clearTimeout(timer);
  9637. timer = setTimeout(() => {
  9638. fn.apply(this, args);
  9639. }, time);
  9640. };
  9641. },
  9642. // 执行数据库查询
  9643. query() {
  9644. this.mixinDatacomEasyGet();
  9645. },
  9646. // 监听查询条件变更事件
  9647. onMixinDatacomPropsChange() {
  9648. if (this.collection) {
  9649. this.debounceGet();
  9650. }
  9651. },
  9652. initDefVal() {
  9653. let defValue = "";
  9654. if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
  9655. defValue = this.valueCom;
  9656. } else {
  9657. let strogeValue;
  9658. if (this.collection) {
  9659. strogeValue = this.getCache();
  9660. }
  9661. if (strogeValue || strogeValue === 0) {
  9662. defValue = strogeValue;
  9663. } else {
  9664. let defItem = "";
  9665. if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
  9666. defItem = this.mixinDatacomResData[this.defItem - 1].value;
  9667. }
  9668. defValue = defItem;
  9669. }
  9670. if (defValue || defValue === 0) {
  9671. this.emit(defValue);
  9672. }
  9673. }
  9674. const def = this.mixinDatacomResData.find((item) => item.value === defValue);
  9675. this.current = def ? this.formatItemName(def) : "";
  9676. },
  9677. /**
  9678. * @param {[String, Number]} value
  9679. * 判断用户给的 value 是否同时为禁用状态
  9680. */
  9681. isDisabled(value) {
  9682. let isDisabled = false;
  9683. this.mixinDatacomResData.forEach((item) => {
  9684. if (item.value === value) {
  9685. isDisabled = item.disable;
  9686. }
  9687. });
  9688. return isDisabled;
  9689. },
  9690. clearVal() {
  9691. this.emit("");
  9692. if (this.collection) {
  9693. this.removeCache();
  9694. }
  9695. },
  9696. change(item) {
  9697. if (!item.disable) {
  9698. this.showSelector = false;
  9699. this.current = this.formatItemName(item);
  9700. this.emit(item.value);
  9701. }
  9702. },
  9703. emit(val) {
  9704. this.$emit("input", val);
  9705. this.$emit("update:modelValue", val);
  9706. this.$emit("change", val);
  9707. if (this.collection) {
  9708. this.setCache(val);
  9709. }
  9710. },
  9711. toggleSelector() {
  9712. if (this.disabled) {
  9713. return;
  9714. }
  9715. this.showSelector = !this.showSelector;
  9716. },
  9717. formatItemName(item) {
  9718. let {
  9719. text,
  9720. value,
  9721. channel_code
  9722. } = item;
  9723. channel_code = channel_code ? `(${channel_code})` : "";
  9724. if (this.format) {
  9725. let str = "";
  9726. str = this.format;
  9727. for (let key in item) {
  9728. str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
  9729. }
  9730. return str;
  9731. } else {
  9732. return this.collection.indexOf("app-list") > 0 ? `${text}(${value})` : text ? text : `未命名${channel_code}`;
  9733. }
  9734. },
  9735. // 获取当前加载的数据
  9736. getLoadData() {
  9737. return this.mixinDatacomResData;
  9738. },
  9739. // 获取当前缓存key
  9740. getCurrentCacheKey() {
  9741. return this.collection;
  9742. },
  9743. // 获取缓存
  9744. getCache(name = this.getCurrentCacheKey()) {
  9745. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  9746. return cacheData[name];
  9747. },
  9748. // 设置缓存
  9749. setCache(value, name = this.getCurrentCacheKey()) {
  9750. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  9751. cacheData[name] = value;
  9752. uni.setStorageSync(this.cacheKey, cacheData);
  9753. },
  9754. // 删除缓存
  9755. removeCache(name = this.getCurrentCacheKey()) {
  9756. let cacheData = uni.getStorageSync(this.cacheKey) || {};
  9757. delete cacheData[name];
  9758. uni.setStorageSync(this.cacheKey, cacheData);
  9759. }
  9760. }
  9761. };
  9762. function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
  9763. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  9764. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-stat__select" }, [
  9765. $props.label ? (vue.openBlock(), vue.createElementBlock(
  9766. "span",
  9767. {
  9768. key: 0,
  9769. class: "uni-label-text hide-on-phone"
  9770. },
  9771. vue.toDisplayString($props.label + ":"),
  9772. 1
  9773. /* TEXT */
  9774. )) : vue.createCommentVNode("v-if", true),
  9775. vue.createElementVNode(
  9776. "view",
  9777. {
  9778. class: vue.normalizeClass(["uni-stat-box", { "uni-stat__actived": $data.current }])
  9779. },
  9780. [
  9781. vue.createElementVNode(
  9782. "view",
  9783. {
  9784. class: vue.normalizeClass(["uni-select", { "uni-select--disabled": $props.disabled }])
  9785. },
  9786. [
  9787. vue.createElementVNode("view", {
  9788. class: "uni-select__input-box",
  9789. onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleSelector && $options.toggleSelector(...args))
  9790. }, [
  9791. $data.current ? (vue.openBlock(), vue.createElementBlock(
  9792. "view",
  9793. {
  9794. key: 0,
  9795. class: "uni-select__input-text"
  9796. },
  9797. vue.toDisplayString($options.textShow),
  9798. 1
  9799. /* TEXT */
  9800. )) : (vue.openBlock(), vue.createElementBlock(
  9801. "view",
  9802. {
  9803. key: 1,
  9804. class: "uni-select__input-text uni-select__input-placeholder"
  9805. },
  9806. vue.toDisplayString($options.typePlaceholder),
  9807. 1
  9808. /* TEXT */
  9809. )),
  9810. $data.current && $props.clear && !$props.disabled ? (vue.openBlock(), vue.createElementBlock("view", {
  9811. key: 2,
  9812. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.clearVal && $options.clearVal(...args), ["stop"]))
  9813. }, [
  9814. vue.createVNode(_component_uni_icons, {
  9815. type: "clear",
  9816. color: "#c0c4cc",
  9817. size: "24"
  9818. })
  9819. ])) : (vue.openBlock(), vue.createElementBlock("view", { key: 3 }, [
  9820. vue.createVNode(_component_uni_icons, {
  9821. type: $data.showSelector ? "top" : "bottom",
  9822. size: "14",
  9823. color: "#999"
  9824. }, null, 8, ["type"])
  9825. ]))
  9826. ]),
  9827. $data.showSelector ? (vue.openBlock(), vue.createElementBlock("view", {
  9828. key: 0,
  9829. class: "uni-select--mask",
  9830. onClick: _cache[2] || (_cache[2] = (...args) => $options.toggleSelector && $options.toggleSelector(...args))
  9831. })) : vue.createCommentVNode("v-if", true),
  9832. $data.showSelector ? (vue.openBlock(), vue.createElementBlock(
  9833. "view",
  9834. {
  9835. key: 1,
  9836. class: "uni-select__selector",
  9837. style: vue.normalizeStyle($options.getOffsetByPlacement)
  9838. },
  9839. [
  9840. vue.createElementVNode(
  9841. "view",
  9842. {
  9843. class: vue.normalizeClass($props.placement == "bottom" ? "uni-popper__arrow_bottom" : "uni-popper__arrow_top")
  9844. },
  9845. null,
  9846. 2
  9847. /* CLASS */
  9848. ),
  9849. vue.createElementVNode("scroll-view", {
  9850. "scroll-y": "true",
  9851. class: "uni-select__selector-scroll"
  9852. }, [
  9853. $data.mixinDatacomResData.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  9854. key: 0,
  9855. class: "uni-select__selector-empty"
  9856. }, [
  9857. vue.createElementVNode(
  9858. "text",
  9859. null,
  9860. vue.toDisplayString($props.emptyTips),
  9861. 1
  9862. /* TEXT */
  9863. )
  9864. ])) : (vue.openBlock(true), vue.createElementBlock(
  9865. vue.Fragment,
  9866. { key: 1 },
  9867. vue.renderList($data.mixinDatacomResData, (item, index) => {
  9868. return vue.openBlock(), vue.createElementBlock("view", {
  9869. class: "uni-select__selector-item",
  9870. key: index,
  9871. onClick: ($event) => $options.change(item)
  9872. }, [
  9873. vue.createElementVNode(
  9874. "text",
  9875. {
  9876. class: vue.normalizeClass({ "uni-select__selector__disabled": item.disable })
  9877. },
  9878. vue.toDisplayString($options.formatItemName(item)),
  9879. 3
  9880. /* TEXT, CLASS */
  9881. )
  9882. ], 8, ["onClick"]);
  9883. }),
  9884. 128
  9885. /* KEYED_FRAGMENT */
  9886. ))
  9887. ])
  9888. ],
  9889. 4
  9890. /* STYLE */
  9891. )) : vue.createCommentVNode("v-if", true)
  9892. ],
  9893. 2
  9894. /* CLASS */
  9895. )
  9896. ],
  9897. 2
  9898. /* CLASS */
  9899. )
  9900. ]);
  9901. }
  9902. const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p], ["__scopeId", "data-v-ddf9e0a2"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue"]]);
  9903. const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
  9904. __name: "index",
  9905. setup(__props, { expose: __expose }) {
  9906. __expose();
  9907. const message = vue.ref();
  9908. const valiForm = vue.ref();
  9909. const printerDialog = vue.ref();
  9910. const token = vue.ref(null);
  9911. const user = vue.ref(null);
  9912. const loading = vue.ref(false);
  9913. const images = vue.ref([]);
  9914. const messageType = vue.ref("");
  9915. const messageText = vue.ref("");
  9916. const batchOptions = vue.ref([]);
  9917. const spaces = vue.ref([]);
  9918. const previewImage = vue.ref(null);
  9919. const maxImages = vue.ref(6);
  9920. const printerList = vue.ref({});
  9921. const historyList = vue.ref([]);
  9922. const printers = vue.ref([]);
  9923. const sendToPeinter = vue.ref([1]);
  9924. const selectPrinter = vue.ref(0);
  9925. const subLoading = vue.ref(false);
  9926. const focusType = vue.ref(true);
  9927. const result = vue.ref();
  9928. const valiFormData = vue.reactive({
  9929. images: [],
  9930. orderNum: "",
  9931. batch_number: "",
  9932. space_code: "",
  9933. weight: "",
  9934. search_pkg: true,
  9935. typing: true,
  9936. search_order: true,
  9937. search_order_choice: 1
  9938. });
  9939. const rules = vue.computed(() => {
  9940. return {
  9941. orderNum: {
  9942. rules: [
  9943. {
  9944. required: true,
  9945. errorMessage: "单号不能为空"
  9946. }
  9947. ]
  9948. },
  9949. weight: {
  9950. rules: [
  9951. {
  9952. required: true,
  9953. errorMessage: "重量不能为空"
  9954. },
  9955. {
  9956. format: "number",
  9957. errorMessage: "重量只能输入数字"
  9958. }
  9959. ]
  9960. }
  9961. };
  9962. });
  9963. const spaceRes = vue.computed(() => {
  9964. try {
  9965. const res = spaces.value.find((item) => item.value === valiFormData.space_code);
  9966. return res == null ? void 0 : res.text;
  9967. } catch (e2) {
  9968. formatAppLog("log", "at pages/inbound/index.vue:182", e2);
  9969. return "";
  9970. }
  9971. });
  9972. onShow(() => {
  9973. focusType.value = true;
  9974. loading.value = false;
  9975. token.value = uni.getStorageSync("token");
  9976. user.value = uni.getStorageSync("user");
  9977. getWarehouseSpace();
  9978. getBindParams();
  9979. getPrinterList();
  9980. });
  9981. onHide(() => {
  9982. focusType.value = false;
  9983. loading.value = false;
  9984. });
  9985. onNavigationBarButtonTap((event) => {
  9986. if (event.index === 0) {
  9987. uni.navigateTo({
  9988. url: "/pages/inbound/instockLog"
  9989. });
  9990. }
  9991. });
  9992. const getWarehouseSpace = () => {
  9993. uni.request({
  9994. url: getWarehouseSpaceURL,
  9995. method: "POST",
  9996. header: {
  9997. batoken: token.value
  9998. },
  9999. data: {
  10000. code: ""
  10001. },
  10002. success: (res) => {
  10003. if (res.data.code === 1) {
  10004. spaces.value = res.data.data.spaces.map((item) => {
  10005. return {
  10006. text: item.name,
  10007. value: item.code
  10008. };
  10009. });
  10010. }
  10011. }
  10012. });
  10013. };
  10014. const getBindParams = () => {
  10015. uni.request({
  10016. url: getBindParamsURL,
  10017. method: "GET",
  10018. header: {
  10019. batoken: token.value
  10020. },
  10021. success: (res) => {
  10022. if (res.data.code === 1) {
  10023. batchOptions.value = res.data.data.batch_number.map((item) => {
  10024. return {
  10025. text: item.name,
  10026. value: item.id
  10027. };
  10028. });
  10029. }
  10030. },
  10031. fail(e2) {
  10032. formatAppLog("log", "at pages/inbound/index.vue:248", "fail--", e2);
  10033. }
  10034. });
  10035. };
  10036. const getPrinterList = () => {
  10037. uni.request({
  10038. url: getPrinterListURL,
  10039. method: "GET",
  10040. header: {
  10041. batoken: token.value
  10042. },
  10043. success: (res) => {
  10044. if (res.data.code === 1) {
  10045. printerList.value = res.data.data.printers;
  10046. printers.value = Object.values(printerList.value).map((item) => {
  10047. return {
  10048. text: item.name,
  10049. value: item.value
  10050. };
  10051. });
  10052. }
  10053. },
  10054. fail(e2) {
  10055. formatAppLog("log", "at pages/inbound/index.vue:272", "fail--", e2);
  10056. }
  10057. });
  10058. };
  10059. const reset = () => {
  10060. loading.value = false;
  10061. focusType.value = false;
  10062. images.value = [];
  10063. valiFormData.orderNum = "";
  10064. valiFormData.batch_number = "";
  10065. valiFormData.weight = "";
  10066. valiFormData.search_pkg = true;
  10067. valiFormData.typing = true;
  10068. valiFormData.search_order = true;
  10069. vue.nextTick(() => {
  10070. focusType.value = true;
  10071. });
  10072. };
  10073. const scan = async () => {
  10074. let status = await checkPermission();
  10075. if (status !== 1) {
  10076. return;
  10077. }
  10078. uni.scanCode({
  10079. success: (res) => {
  10080. result.value = res.result;
  10081. valiFormData.orderNum = res.result;
  10082. },
  10083. fail: (err) => {
  10084. }
  10085. });
  10086. };
  10087. const checkPermission = async () => {
  10088. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  10089. if (status === null || status === 1) {
  10090. status = 1;
  10091. } else {
  10092. uni.showModal({
  10093. content: "Camera permission required",
  10094. confirmText: "Setting",
  10095. success: function(res) {
  10096. if (res.confirm) {
  10097. permission.gotoAppSetting();
  10098. }
  10099. }
  10100. });
  10101. }
  10102. return status;
  10103. };
  10104. let st2;
  10105. const warehouseScan = async () => {
  10106. st2 && clearTimeout(st2);
  10107. instockScan();
  10108. };
  10109. const instockScan = () => {
  10110. const images2 = getImages();
  10111. formatAppLog("log", "at pages/inbound/index.vue:339", "images--", images2);
  10112. let allImgVerify = true;
  10113. for (var i2 = 0; i2 < images2.length; i2++) {
  10114. if (!images2[i2].savePath) {
  10115. allImgVerify = false;
  10116. }
  10117. }
  10118. if (!allImgVerify) {
  10119. messageType.value = "error";
  10120. messageText.value = "图片还没上传完毕,请稍后...";
  10121. message.value.open();
  10122. loading.value = false;
  10123. return;
  10124. }
  10125. uni.request({
  10126. url: instockScanURL,
  10127. method: "POST",
  10128. header: {
  10129. batoken: token.value
  10130. },
  10131. data: {
  10132. order_no: valiFormData.orderNum,
  10133. space_code: valiFormData.space_code,
  10134. images: images2
  10135. },
  10136. success: (res) => {
  10137. loading.value = false;
  10138. if (res.data.code == 1) {
  10139. messageType.value = "success";
  10140. messageText.value = res.data.msg;
  10141. message.value.open();
  10142. formatAppLog("log", "at pages/inbound/index.vue:370", "res.data.data---", res.data.data);
  10143. const historyItem = {
  10144. orderNum: valiFormData.orderNum,
  10145. createTime: /* @__PURE__ */ new Date(),
  10146. space: spaceRes.value,
  10147. type: "入库",
  10148. status: true
  10149. };
  10150. historyList.value.unshift(historyItem);
  10151. uni.setStorageSync("inboundHistory", historyList.value);
  10152. getHistory();
  10153. if (res.data.data.express_label) {
  10154. formatAppLog("log", "at pages/inbound/index.vue:384", "有打印面单");
  10155. } else {
  10156. st2 = setTimeout(() => {
  10157. reset();
  10158. st2 && clearTimeout(st2);
  10159. }, 1e3);
  10160. }
  10161. } else {
  10162. messageType.value = "error";
  10163. messageText.value = res.data.msg;
  10164. message.value.open();
  10165. const historyItem = {
  10166. orderNum: valiFormData.orderNum,
  10167. createTime: /* @__PURE__ */ new Date(),
  10168. space: spaceRes.value,
  10169. type: "入库",
  10170. status: false
  10171. };
  10172. historyList.value.unshift(historyItem);
  10173. uni.setStorageSync("inboundHistory", historyList.value);
  10174. getHistory();
  10175. st2 = setTimeout(() => {
  10176. reset();
  10177. st2 && clearTimeout(st2);
  10178. }, 1e3);
  10179. }
  10180. }
  10181. });
  10182. };
  10183. const close = () => {
  10184. printerDialog.value.close();
  10185. st2 = setTimeout(() => {
  10186. reset();
  10187. st2 && clearTimeout(st2);
  10188. }, 700);
  10189. };
  10190. const sendToPeinterFun = (res) => {
  10191. if (!res.detail.value.length > 0) {
  10192. selectPrinter.value = 0;
  10193. } else {
  10194. selectPrinter.value = printers.value[0].value;
  10195. }
  10196. };
  10197. const printConfirm = () => {
  10198. subLoading.value = true;
  10199. uni.request({
  10200. url: printWaybillLabelURL,
  10201. method: "POST",
  10202. header: {
  10203. batoken: token.value
  10204. },
  10205. data: {
  10206. order_no: valiFormData.orderNum,
  10207. printer_code: selectPrinter
  10208. },
  10209. success: (res) => {
  10210. close();
  10211. subLoading.value = false;
  10212. formatAppLog("log", "at pages/inbound/index.vue:446", "打印成功", res);
  10213. messageType.value = "success";
  10214. messageText.value = "打印成功";
  10215. message.value.open();
  10216. }
  10217. });
  10218. };
  10219. const onsubmit = () => {
  10220. valiForm.value.validate().then((res) => {
  10221. warehouseScan();
  10222. }).catch((err) => {
  10223. formatAppLog("log", "at pages/inbound/index.vue:460", "err", err);
  10224. });
  10225. };
  10226. const getHistory = () => {
  10227. historyList.value = uni.getStorageSync("inboundHistory");
  10228. };
  10229. const getImages = () => {
  10230. const res = images.value.map((item) => {
  10231. return {
  10232. name: item.name,
  10233. savePath: item.serverUrl,
  10234. fileSize: item.size,
  10235. mimeType: item.type
  10236. };
  10237. });
  10238. formatAppLog("log", "at pages/inbound/index.vue:475", "res22 ", res);
  10239. return res;
  10240. };
  10241. const getAliyunOssSignature = (rawFiles) => {
  10242. uni.request({
  10243. url: getAliyunOssSignatureUrl,
  10244. method: "GET",
  10245. header: {
  10246. batoken: token.value
  10247. },
  10248. success: ({ data }) => {
  10249. const signature = data.data.signature;
  10250. const uploadPromises = rawFiles.map((image) => {
  10251. return upLoadFile(signature, image);
  10252. });
  10253. Promise.all(uploadPromises).then((results) => {
  10254. formatAppLog("log", "at pages/inbound/index.vue:496", "所有图片加载成功:", results);
  10255. uni.showToast({
  10256. title: "加载成功",
  10257. icon: "success"
  10258. });
  10259. }).catch((error) => {
  10260. formatAppLog("error", "at pages/inbound/index.vue:503", "加载失败:", error);
  10261. uni.showToast({
  10262. title: "加载失败",
  10263. icon: "none"
  10264. });
  10265. });
  10266. },
  10267. fail: (err) => {
  10268. formatAppLog("log", "at pages/inbound/index.vue:511", err);
  10269. }
  10270. });
  10271. };
  10272. const upLoadFile = (signature, image) => {
  10273. const fileData = {
  10274. policy: signature.policy,
  10275. signature: signature.signature,
  10276. ossaccessKeyId: signature.ossAccessKeyId,
  10277. key: signature.dir + dayjs().format("YYYYMMDD") + "/" + uuid() + "_" + image.name,
  10278. dir: signature.dir,
  10279. host: signature.host,
  10280. file: image.file
  10281. };
  10282. return new Promise((resolve, reject) => {
  10283. let name = image.name;
  10284. name = "file";
  10285. const uploadTask = uni.uploadFile({
  10286. url: signature.host,
  10287. // 你的上传接口地址
  10288. filePath: image.path,
  10289. name,
  10290. // 这里根据后端需要的字段来定义
  10291. formData: fileData,
  10292. success: (uploadFileRes) => {
  10293. if (uploadFileRes.statusCode === 204 || uploadFileRes.statusCode === 200) {
  10294. image.serverUrl = fileData.key;
  10295. resolve(uploadFileRes);
  10296. } else {
  10297. reject(uploadFileRes);
  10298. }
  10299. },
  10300. fail: (error) => {
  10301. formatAppLog("log", "at pages/inbound/index.vue:544", "error++", error);
  10302. reject(error);
  10303. },
  10304. // 更新上传进度
  10305. complete: () => {
  10306. formatAppLog("log", "at pages/inbound/index.vue:549", "complete---");
  10307. image.progress = 100;
  10308. }
  10309. });
  10310. uploadTask.onProgressUpdate((progressEvent) => {
  10311. image.progress = progressEvent.progress;
  10312. });
  10313. });
  10314. };
  10315. const chooseImage = () => {
  10316. uni.chooseImage({
  10317. count: maxImages.value - images.value.length,
  10318. success: (res) => {
  10319. images.value = images.value.concat(
  10320. res.tempFiles.map((item) => {
  10321. const res2 = {
  10322. size: item.size,
  10323. path: item.path,
  10324. name: item.name,
  10325. type: item.type,
  10326. progress: 0,
  10327. file: item
  10328. };
  10329. const suffix = item.path.substring(item.path.lastIndexOf(".") + 1);
  10330. const fileName = item.path.substring(item.path.lastIndexOf("/") + 1);
  10331. res2.name = fileName;
  10332. res2.type = suffix;
  10333. return res2;
  10334. })
  10335. );
  10336. const paddingImages = images.value.filter((image) => image.progress === 0);
  10337. vue.nextTick(() => {
  10338. getAliyunOssSignature(paddingImages);
  10339. });
  10340. },
  10341. fail: (err) => {
  10342. formatAppLog("error", "at pages/inbound/index.vue:594", err);
  10343. }
  10344. });
  10345. };
  10346. const deleteImage = (index) => {
  10347. images.value.splice(index, 1);
  10348. };
  10349. const openPreview = (image) => {
  10350. previewImage.value = image;
  10351. };
  10352. const closePreview = () => {
  10353. previewImage.value = null;
  10354. };
  10355. const __returned__ = { message, valiForm, printerDialog, token, user, loading, images, messageType, messageText, batchOptions, spaces, previewImage, maxImages, printerList, historyList, printers, sendToPeinter, selectPrinter, subLoading, focusType, result, valiFormData, rules, spaceRes, getWarehouseSpace, getBindParams, getPrinterList, reset, scan, checkPermission, get st() {
  10356. return st2;
  10357. }, set st(v2) {
  10358. st2 = v2;
  10359. }, warehouseScan, instockScan, close, sendToPeinterFun, printConfirm, onsubmit, getHistory, getImages, getAliyunOssSignature, upLoadFile, chooseImage, deleteImage, openPreview, closePreview };
  10360. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  10361. return __returned__;
  10362. }
  10363. });
  10364. function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
  10365. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  10366. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  10367. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$2);
  10368. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  10369. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  10370. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  10371. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  10372. const _component_uni_data_checkbox = resolveEasycom(vue.resolveDynamicComponent("uni-data-checkbox"), __easycom_0$3);
  10373. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  10374. vue.createElementVNode("view", { class: "example" }, [
  10375. vue.createCommentVNode(" 基础表单校验 "),
  10376. vue.createVNode(_component_uni_forms, {
  10377. ref: "valiForm",
  10378. "label-align": "right",
  10379. rules: $setup.rules,
  10380. modelValue: $setup.valiFormData
  10381. }, {
  10382. default: vue.withCtx(() => [
  10383. vue.createVNode(_component_uni_forms_item, {
  10384. label: "单号",
  10385. required: true,
  10386. name: "orderNum"
  10387. }, {
  10388. default: vue.withCtx(() => [
  10389. vue.createVNode(_component_uni_easyinput, {
  10390. modelValue: $setup.valiFormData.orderNum,
  10391. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  10392. placeholder: "请输入单号",
  10393. suffixIcon: "scan",
  10394. focus: $setup.focusType,
  10395. onIconClick: $setup.scan
  10396. }, null, 8, ["modelValue", "focus"])
  10397. ]),
  10398. _: 1
  10399. /* STABLE */
  10400. }),
  10401. vue.createVNode(_component_uni_forms_item, {
  10402. label: "仓位编码",
  10403. name: "space_code"
  10404. }, {
  10405. default: vue.withCtx(() => [
  10406. vue.createVNode(_component_uni_data_select, {
  10407. modelValue: $setup.valiFormData.space_code,
  10408. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.space_code = $event),
  10409. localdata: $setup.spaces,
  10410. placeholder: "请选择仓位编码"
  10411. }, null, 8, ["modelValue", "localdata"])
  10412. ]),
  10413. _: 1
  10414. /* STABLE */
  10415. }),
  10416. vue.createVNode(_component_uni_forms_item, {
  10417. label: "图片",
  10418. name: "images"
  10419. }, {
  10420. default: vue.withCtx(() => [
  10421. vue.createElementVNode("view", { class: "upload-container" }, [
  10422. vue.createElementVNode("view", { class: "preview" }, [
  10423. (vue.openBlock(true), vue.createElementBlock(
  10424. vue.Fragment,
  10425. null,
  10426. vue.renderList($setup.images, (img, index) => {
  10427. return vue.openBlock(), vue.createElementBlock("view", {
  10428. key: index,
  10429. class: "image-container"
  10430. }, [
  10431. vue.createElementVNode("image", {
  10432. src: img.path,
  10433. class: "preview-image",
  10434. mode: "aspectFill",
  10435. onClick: ($event) => $setup.openPreview(img.path)
  10436. }, null, 8, ["src", "onClick"]),
  10437. vue.createElementVNode("progress", {
  10438. percent: img.progress || 0,
  10439. activeColor: Number(img.progress || 0) === 100 ? "#00ff00" : "#10AEFF",
  10440. "stroke-width": "3"
  10441. }, null, 8, ["percent", "activeColor"]),
  10442. img.status === "success" ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, "1")) : vue.createCommentVNode("v-if", true),
  10443. vue.createVNode(_component_uni_icons, {
  10444. class: "delete-icon",
  10445. onClick: ($event) => $setup.deleteImage(index),
  10446. type: "clear",
  10447. size: "20",
  10448. color: "red"
  10449. }, null, 8, ["onClick"])
  10450. ]);
  10451. }),
  10452. 128
  10453. /* KEYED_FRAGMENT */
  10454. )),
  10455. $setup.images.length < $setup.maxImages ? (vue.openBlock(), vue.createElementBlock("view", {
  10456. key: 0,
  10457. class: "choose-image-container",
  10458. onClick: $setup.chooseImage
  10459. }, [
  10460. vue.createVNode(_component_uni_icons, {
  10461. type: "plusempty",
  10462. size: "40",
  10463. color: "#ccc"
  10464. })
  10465. ])) : vue.createCommentVNode("v-if", true)
  10466. ]),
  10467. vue.createElementVNode("text", { style: { "padding-top": "8px" } }, "最多选择6张图片"),
  10468. vue.createCommentVNode(" 放大预览 "),
  10469. $setup.previewImage ? (vue.openBlock(), vue.createElementBlock("view", {
  10470. key: 0,
  10471. class: "preview-modal",
  10472. onClick: $setup.closePreview
  10473. }, [
  10474. vue.createElementVNode("image", {
  10475. src: $setup.previewImage,
  10476. class: "preview-large",
  10477. mode: "aspectFit",
  10478. onClick: vue.withModifiers($setup.closePreview, ["stop"])
  10479. }, null, 8, ["src"])
  10480. ])) : vue.createCommentVNode("v-if", true)
  10481. ])
  10482. ]),
  10483. _: 1
  10484. /* STABLE */
  10485. })
  10486. ]),
  10487. _: 1
  10488. /* STABLE */
  10489. }, 8, ["rules", "modelValue"]),
  10490. vue.createElementVNode("view", { class: "button-group" }, [
  10491. vue.createElementVNode("button", {
  10492. type: "info",
  10493. onClick: $setup.reset
  10494. }, "重置"),
  10495. vue.createElementVNode("button", {
  10496. type: "primary",
  10497. onClick: $setup.onsubmit,
  10498. loading: $setup.loading
  10499. }, [
  10500. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  10501. key: 0,
  10502. type: "checkmarkempty",
  10503. size: "18",
  10504. color: "white"
  10505. })) : vue.createCommentVNode("v-if", true),
  10506. vue.createTextVNode(" 提交 ")
  10507. ], 8, ["loading"])
  10508. ])
  10509. ]),
  10510. vue.createElementVNode("view", { class: "history" }, [
  10511. (vue.openBlock(true), vue.createElementBlock(
  10512. vue.Fragment,
  10513. null,
  10514. vue.renderList($setup.historyList.slice(0, 5), (item, i2) => {
  10515. return vue.openBlock(), vue.createElementBlock("view", {
  10516. class: "item",
  10517. key: i2
  10518. }, [
  10519. vue.createElementVNode(
  10520. "text",
  10521. {
  10522. class: "code",
  10523. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  10524. },
  10525. [
  10526. vue.createTextVNode(
  10527. vue.toDisplayString(item.orderNum) + " ",
  10528. 1
  10529. /* TEXT */
  10530. ),
  10531. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  10532. "text",
  10533. { key: 0 },
  10534. "批次号: " + vue.toDisplayString(item.batch_text),
  10535. 1
  10536. /* TEXT */
  10537. )) : vue.createCommentVNode("v-if", true),
  10538. item.space ? (vue.openBlock(), vue.createElementBlock(
  10539. "text",
  10540. { key: 1 },
  10541. "仓位编码: " + vue.toDisplayString(item.space),
  10542. 1
  10543. /* TEXT */
  10544. )) : vue.createCommentVNode("v-if", true),
  10545. vue.createTextVNode(
  10546. " " + vue.toDisplayString(item.type),
  10547. 1
  10548. /* TEXT */
  10549. )
  10550. ],
  10551. 4
  10552. /* STYLE */
  10553. ),
  10554. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  10555. key: 0,
  10556. type: "checkmarkempty",
  10557. class: "status",
  10558. size: "16",
  10559. color: "green"
  10560. })) : (vue.openBlock(), vue.createElementBlock("text", {
  10561. key: 1,
  10562. class: "status fail"
  10563. }, "F")),
  10564. vue.createElementVNode(
  10565. "text",
  10566. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  10567. vue.toDisplayString("\r\n" + item.createTime),
  10568. 1
  10569. /* TEXT */
  10570. )
  10571. ]);
  10572. }),
  10573. 128
  10574. /* KEYED_FRAGMENT */
  10575. ))
  10576. ]),
  10577. vue.createVNode(
  10578. _component_uni_popup,
  10579. {
  10580. ref: "message",
  10581. type: "message"
  10582. },
  10583. {
  10584. default: vue.withCtx(() => [
  10585. vue.createVNode(_component_uni_popup_message, {
  10586. type: $setup.messageType,
  10587. message: $setup.messageText,
  10588. duration: 2e3
  10589. }, null, 8, ["type", "message"])
  10590. ]),
  10591. _: 1
  10592. /* STABLE */
  10593. },
  10594. 512
  10595. /* NEED_PATCH */
  10596. ),
  10597. vue.createVNode(
  10598. _component_uni_popup,
  10599. {
  10600. ref: "printerDialog",
  10601. type: "dialog",
  10602. "is-mask-click": false
  10603. },
  10604. {
  10605. default: vue.withCtx(() => [
  10606. vue.createElementVNode("view", { style: { "width": "90%", "margin": "0 auto", "min-height": "250px", "background-color": "#fff", "border-radius": "5px" } }, [
  10607. vue.createElementVNode("view", {
  10608. class: "",
  10609. style: { "font-size": "20px", "border-bottom": "1px solid #e1e1e1", "padding": "15px 10px" }
  10610. }, [
  10611. vue.createElementVNode("view", null, [
  10612. vue.createElementVNode("view", { style: { "margin-bottom": "20px" } }, [
  10613. vue.createElementVNode("text", null, "打印尾程面单")
  10614. ]),
  10615. vue.createElementVNode("view", null, [
  10616. $setup.printerList ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  10617. vue.createElementVNode("view", null, [
  10618. vue.createVNode(_component_uni_data_checkbox, {
  10619. multiple: "",
  10620. modelValue: $setup.sendToPeinter,
  10621. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.sendToPeinter = $event),
  10622. localdata: [
  10623. {
  10624. text: "发送到标签打印机打印",
  10625. value: 1
  10626. }
  10627. ],
  10628. onChange: $setup.sendToPeinterFun
  10629. }, {
  10630. default: vue.withCtx(() => [
  10631. vue.createTextVNode(" > ")
  10632. ]),
  10633. _: 1
  10634. /* STABLE */
  10635. }, 8, ["modelValue"]),
  10636. vue.createVNode(_component_uni_data_checkbox, {
  10637. disabled: $setup.sendToPeinter.length === 0,
  10638. modelValue: $setup.selectPrinter,
  10639. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.selectPrinter = $event),
  10640. localdata: $setup.printers
  10641. }, null, 8, ["disabled", "modelValue", "localdata"])
  10642. ])
  10643. ])) : vue.createCommentVNode("v-if", true)
  10644. ])
  10645. ]),
  10646. vue.createElementVNode("view", { style: { "text-align": "center", "position": "absolute", "bottom": "10px", "width": "90%", "display": "flex", "margin": "0 auto", "left": "0", "right": "0" } }, [
  10647. vue.createElementVNode("button", {
  10648. onClick: $setup.close,
  10649. style: { "width": "35%" }
  10650. }, "关闭"),
  10651. vue.createElementVNode("button", {
  10652. onClick: $setup.printConfirm,
  10653. "hover-stay-time": 500,
  10654. loading: $setup.subLoading,
  10655. disabled: $setup.sendToPeinter.length === 0 || $setup.subLoading,
  10656. class: "my-bt-bg",
  10657. style: { "width": "35%" }
  10658. }, " 打印 ", 8, ["loading", "disabled"])
  10659. ])
  10660. ])
  10661. ])
  10662. ]),
  10663. _: 1
  10664. /* STABLE */
  10665. },
  10666. 512
  10667. /* NEED_PATCH */
  10668. )
  10669. ]);
  10670. }
  10671. const PagesInboundIndex = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__scopeId", "data-v-d5a684ce"], ["__file", "E:/HBuilderProjects/yta/pages/inbound/index.vue"]]);
  10672. const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
  10673. __name: "instockLog",
  10674. setup(__props, { expose: __expose }) {
  10675. __expose();
  10676. const historyList = vue.ref([]);
  10677. const getHistory = () => {
  10678. historyList.value = uni.getStorageSync("inboundHistory");
  10679. };
  10680. onLoad(() => {
  10681. getHistory();
  10682. });
  10683. const __returned__ = { historyList, getHistory };
  10684. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  10685. return __returned__;
  10686. }
  10687. });
  10688. function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
  10689. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  10690. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  10691. (vue.openBlock(true), vue.createElementBlock(
  10692. vue.Fragment,
  10693. null,
  10694. vue.renderList($setup.historyList, (item, i2) => {
  10695. return vue.openBlock(), vue.createElementBlock("view", { class: "item" }, [
  10696. vue.createElementVNode(
  10697. "text",
  10698. {
  10699. class: "code",
  10700. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  10701. },
  10702. [
  10703. vue.createTextVNode(
  10704. vue.toDisplayString(item.orderNum) + " ",
  10705. 1
  10706. /* TEXT */
  10707. ),
  10708. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  10709. "text",
  10710. { key: 0 },
  10711. "批次号: " + vue.toDisplayString(item.batch_text),
  10712. 1
  10713. /* TEXT */
  10714. )) : vue.createCommentVNode("v-if", true),
  10715. item.space ? (vue.openBlock(), vue.createElementBlock(
  10716. "text",
  10717. { key: 1 },
  10718. "仓位编码: " + vue.toDisplayString(item.space),
  10719. 1
  10720. /* TEXT */
  10721. )) : vue.createCommentVNode("v-if", true),
  10722. vue.createTextVNode(
  10723. " " + vue.toDisplayString(item.type),
  10724. 1
  10725. /* TEXT */
  10726. )
  10727. ],
  10728. 4
  10729. /* STYLE */
  10730. ),
  10731. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  10732. key: 0,
  10733. type: "checkmarkempty",
  10734. class: "status",
  10735. size: "16",
  10736. color: "green"
  10737. })) : (vue.openBlock(), vue.createElementBlock("text", {
  10738. key: 1,
  10739. class: "status fail"
  10740. }, "F")),
  10741. vue.createElementVNode(
  10742. "text",
  10743. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  10744. vue.toDisplayString("\r\n" + item.createTime),
  10745. 1
  10746. /* TEXT */
  10747. )
  10748. ]);
  10749. }),
  10750. 256
  10751. /* UNKEYED_FRAGMENT */
  10752. )),
  10753. $setup.historyList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  10754. key: 0,
  10755. class: "is-empty"
  10756. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  10757. ]);
  10758. }
  10759. const PagesInboundInstockLog = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__scopeId", "data-v-9c131049"], ["__file", "E:/HBuilderProjects/yta/pages/inbound/instockLog.vue"]]);
  10760. const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
  10761. __name: "index",
  10762. setup(__props, { expose: __expose }) {
  10763. __expose();
  10764. const message = vue.ref();
  10765. const valiForm = vue.ref();
  10766. const printerDialog = vue.ref();
  10767. const token = vue.ref(null);
  10768. const user = vue.ref(null);
  10769. const loading = vue.ref(false);
  10770. const messageType = vue.ref("");
  10771. const messageText = vue.ref("");
  10772. const batchOptions = vue.ref([]);
  10773. const companyOptions = vue.ref([]);
  10774. const orderInfo = vue.ref({});
  10775. const printerList = vue.ref({});
  10776. const historyList = vue.ref([]);
  10777. const printers = vue.ref([]);
  10778. const sendToPeinter = vue.ref([1]);
  10779. const selectPrinter = vue.ref(0);
  10780. const subLoading = vue.ref(false);
  10781. const focusType = vue.ref(true);
  10782. const result = vue.ref();
  10783. const valiFormData = vue.reactive({
  10784. orderNum: "",
  10785. batch_number: "",
  10786. typing: true,
  10787. express_company_id: "",
  10788. express_no: "",
  10789. express_tracking_number: ""
  10790. });
  10791. const rules = vue.computed(() => {
  10792. return {
  10793. orderNum: {
  10794. rules: [
  10795. {
  10796. required: false,
  10797. errorMessage: "单号不能为空"
  10798. }
  10799. ]
  10800. }
  10801. };
  10802. });
  10803. onShow(() => {
  10804. focusType.value = true;
  10805. loading.value = false;
  10806. token.value = uni.getStorageSync("token");
  10807. user.value = uni.getStorageSync("user");
  10808. getBindParams();
  10809. getCompanyList();
  10810. getPrinterList();
  10811. });
  10812. onHide(() => {
  10813. focusType.value = false;
  10814. loading.value = false;
  10815. });
  10816. onNavigationBarButtonTap((event) => {
  10817. if (event.index === 0) {
  10818. uni.navigateTo({
  10819. url: "/pages/outbound/instockLog"
  10820. });
  10821. }
  10822. });
  10823. const getBindParams = () => {
  10824. uni.request({
  10825. url: getBindParamsURL,
  10826. method: "GET",
  10827. header: {
  10828. batoken: token.value
  10829. },
  10830. success: (res) => {
  10831. if (res.data.code === 1) {
  10832. batchOptions.value = res.data.data.batch_number.map((item) => {
  10833. return {
  10834. text: item.name,
  10835. value: item.id
  10836. };
  10837. });
  10838. }
  10839. },
  10840. fail(e2) {
  10841. formatAppLog("log", "at pages/outbound/index.vue:204", "fail--", e2);
  10842. }
  10843. });
  10844. };
  10845. const getCompanyList = () => {
  10846. uni.request({
  10847. url: companyListURL,
  10848. method: "GET",
  10849. header: {
  10850. batoken: token.value
  10851. },
  10852. data: {
  10853. limit: 100,
  10854. order: "id,desc"
  10855. },
  10856. success: (res) => {
  10857. if (res.data.code === 1) {
  10858. companyOptions.value = res.data.data.list.map((item) => {
  10859. return {
  10860. text: item.name,
  10861. value: item.id
  10862. };
  10863. });
  10864. }
  10865. },
  10866. fail(e2) {
  10867. formatAppLog("log", "at pages/outbound/index.vue:231", "fail--", e2);
  10868. }
  10869. });
  10870. };
  10871. const getPrinterList = () => {
  10872. uni.request({
  10873. url: getPrinterListURL,
  10874. method: "GET",
  10875. header: {
  10876. batoken: token.value
  10877. },
  10878. success: (res) => {
  10879. if (res.data.code === 1) {
  10880. printerList.value = res.data.data.printers;
  10881. printers.value = Object.values(printerList.value).map((item) => {
  10882. return {
  10883. text: item.name,
  10884. value: item.value
  10885. };
  10886. });
  10887. }
  10888. },
  10889. fail(e2) {
  10890. formatAppLog("log", "at pages/outbound/index.vue:255", "fail--", e2);
  10891. }
  10892. });
  10893. };
  10894. let st2;
  10895. const orderChange = (res) => {
  10896. valiFormData.orderNum = res;
  10897. st2 && clearTimeout(st2);
  10898. st2 = setTimeout(() => {
  10899. getOrderInfoURL();
  10900. clearTimeout(st2);
  10901. }, 800);
  10902. };
  10903. const getOrderInfoURL = () => {
  10904. if (valiFormData.orderNum.length === 0) {
  10905. return;
  10906. }
  10907. uni.request({
  10908. url: orderInfoURL,
  10909. method: "GET",
  10910. header: {
  10911. batoken: token.value
  10912. },
  10913. data: {
  10914. order_no: valiFormData.orderNum
  10915. },
  10916. success: (res) => {
  10917. if (res.data.code === 1) {
  10918. orderInfo.value = res.data.data;
  10919. } else {
  10920. orderInfo.value = {};
  10921. messageType.value = "error";
  10922. messageText.value = res.data.msg;
  10923. message.value.open();
  10924. }
  10925. },
  10926. fail(e2) {
  10927. formatAppLog("log", "at pages/outbound/index.vue:301", "fail--", e2);
  10928. }
  10929. });
  10930. };
  10931. const batchText = (batch_number) => {
  10932. var _a;
  10933. return (_a = batchOptions.value.find((item) => item.value === batch_number)) == null ? void 0 : _a.text;
  10934. };
  10935. const reset = () => {
  10936. loading.value = false;
  10937. focusType.value = false;
  10938. valiFormData.orderNum = "";
  10939. valiFormData.batch_number = "";
  10940. valiFormData.typing = true;
  10941. vue.nextTick(() => {
  10942. focusType.value = true;
  10943. });
  10944. };
  10945. const scan = async (key) => {
  10946. let status = await checkPermission();
  10947. if (status !== 1) {
  10948. return;
  10949. }
  10950. uni.scanCode({
  10951. success: (res) => {
  10952. result.value = res.result;
  10953. valiFormData[key] = res.result;
  10954. orderChange(res.result);
  10955. },
  10956. fail: (err) => {
  10957. }
  10958. });
  10959. };
  10960. const checkPermission = async () => {
  10961. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  10962. if (status === null || status === 1) {
  10963. status = 1;
  10964. } else {
  10965. uni.showModal({
  10966. content: "Camera permission required",
  10967. confirmText: "Setting",
  10968. success: function(res) {
  10969. if (res.confirm) {
  10970. permission.gotoAppSetting();
  10971. }
  10972. }
  10973. });
  10974. }
  10975. return status;
  10976. };
  10977. let st3;
  10978. const warehouseScan = async () => {
  10979. st3 && clearTimeout(st3);
  10980. scanOutstock();
  10981. };
  10982. const scanOutstock = () => {
  10983. formatAppLog("log", "at pages/outbound/index.vue:367", valiFormData.orderNum, valiFormData.batch_number);
  10984. if (valiFormData.orderNum.length === 0 && valiFormData.batch_number.length === 0) {
  10985. messageType.value = "error";
  10986. messageText.value = "单号或批次号至少填一个";
  10987. message.value.open();
  10988. return;
  10989. }
  10990. loading.value = true;
  10991. uni.request({
  10992. url: outStockScanURL,
  10993. method: "POST",
  10994. header: {
  10995. batoken: token.value
  10996. },
  10997. data: {
  10998. order_no: valiFormData.orderNum,
  10999. batch_number: valiFormData.batch_number,
  11000. express_company_id: valiFormData.express_company_id,
  11001. express_no: valiFormData.express_no,
  11002. express_tracking_number: valiFormData.express_tracking_number
  11003. },
  11004. success: (res) => {
  11005. loading.value = false;
  11006. if (res.data.code == 1) {
  11007. messageType.value = "success";
  11008. messageText.value = res.data.msg;
  11009. message.value.open();
  11010. const historyItem = {
  11011. orderNum: valiFormData.orderNum,
  11012. batch_text: batchText(valiFormData.batch_number),
  11013. createTime: /* @__PURE__ */ new Date(),
  11014. type: "出库",
  11015. status: true
  11016. };
  11017. historyList.value.unshift(historyItem);
  11018. historyList.value.length > 10 && (historyList.value.length = 10);
  11019. uni.setStorageSync("outboundHistory", historyList.value);
  11020. getHistory();
  11021. if (res.data.data.labels && res.data.data.labels.length > 0) {
  11022. formatAppLog("log", "at pages/outbound/index.vue:407", "有打印面单");
  11023. } else {
  11024. st3 = setTimeout(() => {
  11025. reset();
  11026. st3 && clearTimeout(st3);
  11027. }, 700);
  11028. }
  11029. } else {
  11030. messageType.value = "error";
  11031. messageText.value = res.data.msg;
  11032. message.value.open();
  11033. const historyItem = {
  11034. orderNum: valiFormData.orderNum,
  11035. batch_text: batchText(valiFormData.batch_number),
  11036. createTime: /* @__PURE__ */ new Date(),
  11037. type: "出库",
  11038. status: false
  11039. };
  11040. historyList.value.unshift(historyItem);
  11041. historyList.value.length > 10 && (historyList.value.length = 10);
  11042. uni.setStorageSync("outboundHistory", historyList.value);
  11043. getHistory();
  11044. st3 = setTimeout(() => {
  11045. reset();
  11046. st3 && clearTimeout(st3);
  11047. }, 700);
  11048. }
  11049. }
  11050. });
  11051. };
  11052. const close = () => {
  11053. printerDialog.value.close();
  11054. st3 = setTimeout(() => {
  11055. reset();
  11056. st3 && clearTimeout(st3);
  11057. }, 700);
  11058. };
  11059. const sendToPeinterFun = (res) => {
  11060. if (!res.detail.value.length > 0) {
  11061. selectPrinter.value = 0;
  11062. } else {
  11063. selectPrinter.value = printers.value[0].value;
  11064. }
  11065. };
  11066. const printConfirm = () => {
  11067. subLoading.value = true;
  11068. uni.request({
  11069. url: printWaybillLabelURL,
  11070. method: "POST",
  11071. header: {
  11072. batoken: token.value
  11073. },
  11074. data: {
  11075. order_no: valiFormData.orderNum,
  11076. printer_code: selectPrinter
  11077. },
  11078. success: (res) => {
  11079. close();
  11080. subLoading.value = false;
  11081. formatAppLog("log", "at pages/outbound/index.vue:470", "打印成功", res);
  11082. messageType.value = "success";
  11083. messageText.value = "打印成功";
  11084. message.value.open();
  11085. }
  11086. });
  11087. };
  11088. const onsubmit = () => {
  11089. valiForm.value.validate().then((res) => {
  11090. warehouseScan();
  11091. }).catch((err) => {
  11092. formatAppLog("log", "at pages/outbound/index.vue:484", "err", err);
  11093. });
  11094. };
  11095. const getHistory = () => {
  11096. historyList.value = uni.getStorageSync("outboundHistory");
  11097. };
  11098. const __returned__ = { message, valiForm, printerDialog, token, user, loading, messageType, messageText, batchOptions, companyOptions, orderInfo, printerList, historyList, printers, sendToPeinter, selectPrinter, subLoading, focusType, result, valiFormData, rules, getBindParams, getCompanyList, getPrinterList, get st2() {
  11099. return st2;
  11100. }, set st2(v2) {
  11101. st2 = v2;
  11102. }, orderChange, getOrderInfoURL, batchText, reset, scan, checkPermission, get st() {
  11103. return st3;
  11104. }, set st(v2) {
  11105. st3 = v2;
  11106. }, warehouseScan, scanOutstock, close, sendToPeinterFun, printConfirm, onsubmit, getHistory };
  11107. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  11108. return __returned__;
  11109. }
  11110. });
  11111. function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
  11112. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  11113. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  11114. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$2);
  11115. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  11116. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  11117. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  11118. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  11119. const _component_uni_data_checkbox = resolveEasycom(vue.resolveDynamicComponent("uni-data-checkbox"), __easycom_0$3);
  11120. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  11121. vue.createElementVNode("view", { class: "example" }, [
  11122. vue.createCommentVNode(" 基础表单校验 "),
  11123. vue.createVNode(_component_uni_forms, {
  11124. ref: "valiForm",
  11125. "label-align": "right",
  11126. rules: $setup.rules,
  11127. modelValue: $setup.valiFormData
  11128. }, {
  11129. default: vue.withCtx(() => [
  11130. vue.createVNode(_component_uni_forms_item, {
  11131. label: "单号",
  11132. required: true,
  11133. name: "orderNum"
  11134. }, {
  11135. default: vue.withCtx(() => [
  11136. vue.createVNode(_component_uni_easyinput, {
  11137. modelValue: $setup.valiFormData.orderNum,
  11138. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  11139. placeholder: "请输入单号",
  11140. suffixIcon: "scan",
  11141. focus: $setup.focusType,
  11142. onIconClick: _cache[1] || (_cache[1] = ($event) => $setup.scan("orderNum")),
  11143. onInput: $setup.orderChange
  11144. }, null, 8, ["modelValue", "focus"])
  11145. ]),
  11146. _: 1
  11147. /* STABLE */
  11148. }),
  11149. vue.createVNode(_component_uni_forms_item, {
  11150. label: "批次号",
  11151. name: "batch_number"
  11152. }, {
  11153. default: vue.withCtx(() => [
  11154. vue.createVNode(_component_uni_data_select, {
  11155. modelValue: $setup.valiFormData.batch_number,
  11156. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.valiFormData.batch_number = $event),
  11157. localdata: $setup.batchOptions,
  11158. placeholder: "请选择批次号"
  11159. }, null, 8, ["modelValue", "localdata"])
  11160. ]),
  11161. _: 1
  11162. /* STABLE */
  11163. }),
  11164. $setup.orderInfo.order_id ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  11165. !$setup.orderInfo.express_sn ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  11166. vue.createVNode(_component_uni_forms_item, {
  11167. label: "物流公司",
  11168. name: "express_company_id"
  11169. }, {
  11170. default: vue.withCtx(() => [
  11171. vue.createVNode(_component_uni_data_select, {
  11172. modelValue: $setup.valiFormData.express_company_id,
  11173. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.valiFormData.express_company_id = $event),
  11174. localdata: $setup.companyOptions,
  11175. placeholder: "请选择物流公司"
  11176. }, null, 8, ["modelValue", "localdata"])
  11177. ]),
  11178. _: 1
  11179. /* STABLE */
  11180. }),
  11181. vue.createVNode(_component_uni_forms_item, {
  11182. label: "物流单号",
  11183. name: "express_no"
  11184. }, {
  11185. default: vue.withCtx(() => [
  11186. vue.createVNode(_component_uni_easyinput, {
  11187. modelValue: $setup.valiFormData.express_no,
  11188. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.valiFormData.express_no = $event),
  11189. placeholder: "请输入物流单号",
  11190. suffixIcon: "scan",
  11191. onIconClick: _cache[5] || (_cache[5] = ($event) => $setup.scan("express_no"))
  11192. }, null, 8, ["modelValue"])
  11193. ]),
  11194. _: 1
  11195. /* STABLE */
  11196. }),
  11197. vue.createVNode(_component_uni_forms_item, {
  11198. label: "追踪单号",
  11199. name: "express_tracking_number"
  11200. }, {
  11201. default: vue.withCtx(() => [
  11202. vue.createVNode(_component_uni_easyinput, {
  11203. modelValue: $setup.valiFormData.express_tracking_number,
  11204. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.valiFormData.express_tracking_number = $event),
  11205. placeholder: "请输入追踪单号",
  11206. suffixIcon: "scan",
  11207. onIconClick: _cache[7] || (_cache[7] = ($event) => $setup.scan("express_tracking_number"))
  11208. }, null, 8, ["modelValue"])
  11209. ]),
  11210. _: 1
  11211. /* STABLE */
  11212. })
  11213. ])) : vue.createCommentVNode("v-if", true)
  11214. ])) : vue.createCommentVNode("v-if", true)
  11215. ]),
  11216. _: 1
  11217. /* STABLE */
  11218. }, 8, ["rules", "modelValue"]),
  11219. vue.createElementVNode("view", { class: "button-group" }, [
  11220. vue.createElementVNode("button", {
  11221. type: "info",
  11222. onClick: $setup.reset
  11223. }, "重置"),
  11224. vue.createElementVNode("button", {
  11225. type: "primary",
  11226. onClick: $setup.onsubmit,
  11227. loading: $setup.loading
  11228. }, [
  11229. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  11230. key: 0,
  11231. type: "checkmarkempty",
  11232. size: "18",
  11233. color: "white"
  11234. })) : vue.createCommentVNode("v-if", true),
  11235. vue.createTextVNode(" 提交 ")
  11236. ], 8, ["loading"])
  11237. ])
  11238. ]),
  11239. vue.createElementVNode("view", { class: "history" }, [
  11240. (vue.openBlock(true), vue.createElementBlock(
  11241. vue.Fragment,
  11242. null,
  11243. vue.renderList($setup.historyList.slice(0, 5), (item, i2) => {
  11244. return vue.openBlock(), vue.createElementBlock("view", {
  11245. class: "item",
  11246. key: i2
  11247. }, [
  11248. vue.createElementVNode(
  11249. "text",
  11250. {
  11251. class: "code",
  11252. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  11253. },
  11254. [
  11255. vue.createTextVNode(
  11256. vue.toDisplayString(item.orderNum) + " ",
  11257. 1
  11258. /* TEXT */
  11259. ),
  11260. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  11261. "text",
  11262. { key: 0 },
  11263. "批次号: " + vue.toDisplayString(item.batch_text),
  11264. 1
  11265. /* TEXT */
  11266. )) : vue.createCommentVNode("v-if", true),
  11267. item.space ? (vue.openBlock(), vue.createElementBlock(
  11268. "text",
  11269. { key: 1 },
  11270. "仓位编码: " + vue.toDisplayString(item.space),
  11271. 1
  11272. /* TEXT */
  11273. )) : vue.createCommentVNode("v-if", true),
  11274. vue.createTextVNode(
  11275. " " + vue.toDisplayString(item.type),
  11276. 1
  11277. /* TEXT */
  11278. )
  11279. ],
  11280. 4
  11281. /* STYLE */
  11282. ),
  11283. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  11284. key: 0,
  11285. type: "checkmarkempty",
  11286. class: "status",
  11287. size: "16",
  11288. color: "green"
  11289. })) : (vue.openBlock(), vue.createElementBlock("text", {
  11290. key: 1,
  11291. class: "status fail"
  11292. }, "F")),
  11293. vue.createElementVNode(
  11294. "text",
  11295. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  11296. vue.toDisplayString("\r\n" + item.createTime),
  11297. 1
  11298. /* TEXT */
  11299. )
  11300. ]);
  11301. }),
  11302. 128
  11303. /* KEYED_FRAGMENT */
  11304. ))
  11305. ]),
  11306. vue.createVNode(
  11307. _component_uni_popup,
  11308. {
  11309. ref: "message",
  11310. type: "message"
  11311. },
  11312. {
  11313. default: vue.withCtx(() => [
  11314. vue.createVNode(_component_uni_popup_message, {
  11315. type: $setup.messageType,
  11316. message: $setup.messageText,
  11317. duration: 2e3
  11318. }, null, 8, ["type", "message"])
  11319. ]),
  11320. _: 1
  11321. /* STABLE */
  11322. },
  11323. 512
  11324. /* NEED_PATCH */
  11325. ),
  11326. vue.createVNode(
  11327. _component_uni_popup,
  11328. {
  11329. ref: "printerDialog",
  11330. type: "dialog",
  11331. "is-mask-click": false
  11332. },
  11333. {
  11334. default: vue.withCtx(() => [
  11335. vue.createElementVNode("view", { style: { "width": "90%", "margin": "0 auto", "min-height": "250px", "background-color": "#fff", "border-radius": "5px" } }, [
  11336. vue.createElementVNode("view", {
  11337. class: "",
  11338. style: { "font-size": "20px", "border-bottom": "1px solid #e1e1e1", "padding": "15px 10px" }
  11339. }, [
  11340. vue.createElementVNode("view", null, [
  11341. vue.createElementVNode("view", { style: { "margin-bottom": "20px" } }, [
  11342. vue.createElementVNode("text", null, "打印尾程面单")
  11343. ]),
  11344. vue.createElementVNode("view", null, [
  11345. $setup.printerList ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  11346. vue.createElementVNode("view", null, [
  11347. vue.createVNode(_component_uni_data_checkbox, {
  11348. multiple: "",
  11349. modelValue: $setup.sendToPeinter,
  11350. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $setup.sendToPeinter = $event),
  11351. localdata: [
  11352. {
  11353. text: "发送到标签打印机打印",
  11354. value: 1
  11355. }
  11356. ],
  11357. onChange: $setup.sendToPeinterFun
  11358. }, {
  11359. default: vue.withCtx(() => [
  11360. vue.createTextVNode(" > ")
  11361. ]),
  11362. _: 1
  11363. /* STABLE */
  11364. }, 8, ["modelValue"]),
  11365. vue.createVNode(_component_uni_data_checkbox, {
  11366. disabled: $setup.sendToPeinter.length === 0,
  11367. modelValue: $setup.selectPrinter,
  11368. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $setup.selectPrinter = $event),
  11369. localdata: $setup.printers
  11370. }, null, 8, ["disabled", "modelValue", "localdata"])
  11371. ])
  11372. ])) : vue.createCommentVNode("v-if", true)
  11373. ])
  11374. ]),
  11375. vue.createElementVNode("view", { style: { "text-align": "center", "position": "absolute", "bottom": "10px", "width": "90%", "display": "flex", "margin": "0 auto", "left": "0", "right": "0" } }, [
  11376. vue.createElementVNode("button", {
  11377. onClick: $setup.close,
  11378. style: { "width": "35%" }
  11379. }, "关闭"),
  11380. vue.createElementVNode("button", {
  11381. onClick: $setup.printConfirm,
  11382. "hover-stay-time": 500,
  11383. loading: $setup.subLoading,
  11384. disabled: $setup.sendToPeinter.length === 0 || $setup.subLoading,
  11385. class: "my-bt-bg",
  11386. style: { "width": "35%" }
  11387. }, " 打印 ", 8, ["loading", "disabled"])
  11388. ])
  11389. ])
  11390. ])
  11391. ]),
  11392. _: 1
  11393. /* STABLE */
  11394. },
  11395. 512
  11396. /* NEED_PATCH */
  11397. )
  11398. ]);
  11399. }
  11400. const PagesOutboundIndex = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m], ["__scopeId", "data-v-e24b5023"], ["__file", "E:/HBuilderProjects/yta/pages/outbound/index.vue"]]);
  11401. const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
  11402. __name: "instockLog",
  11403. setup(__props, { expose: __expose }) {
  11404. __expose();
  11405. const historyList = vue.ref([]);
  11406. const getHistory = () => {
  11407. historyList.value = uni.getStorageSync("outboundHistory");
  11408. };
  11409. onLoad(() => {
  11410. getHistory();
  11411. });
  11412. const __returned__ = { historyList, getHistory };
  11413. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  11414. return __returned__;
  11415. }
  11416. });
  11417. function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
  11418. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  11419. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  11420. (vue.openBlock(true), vue.createElementBlock(
  11421. vue.Fragment,
  11422. null,
  11423. vue.renderList($setup.historyList, (item, i2) => {
  11424. return vue.openBlock(), vue.createElementBlock("view", { class: "item" }, [
  11425. vue.createElementVNode(
  11426. "text",
  11427. {
  11428. class: "code",
  11429. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  11430. },
  11431. [
  11432. vue.createTextVNode(
  11433. vue.toDisplayString(item.orderNum) + " ",
  11434. 1
  11435. /* TEXT */
  11436. ),
  11437. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  11438. "text",
  11439. { key: 0 },
  11440. "批次号: " + vue.toDisplayString(item.batch_text),
  11441. 1
  11442. /* TEXT */
  11443. )) : vue.createCommentVNode("v-if", true),
  11444. item.space ? (vue.openBlock(), vue.createElementBlock(
  11445. "text",
  11446. { key: 1 },
  11447. "仓位编码: " + vue.toDisplayString(item.space),
  11448. 1
  11449. /* TEXT */
  11450. )) : vue.createCommentVNode("v-if", true),
  11451. vue.createTextVNode(
  11452. " " + vue.toDisplayString(item.type),
  11453. 1
  11454. /* TEXT */
  11455. )
  11456. ],
  11457. 4
  11458. /* STYLE */
  11459. ),
  11460. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  11461. key: 0,
  11462. type: "checkmarkempty",
  11463. class: "status",
  11464. size: "16",
  11465. color: "green"
  11466. })) : (vue.openBlock(), vue.createElementBlock("text", {
  11467. key: 1,
  11468. class: "status fail"
  11469. }, "F")),
  11470. vue.createElementVNode(
  11471. "text",
  11472. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  11473. vue.toDisplayString("\r\n" + item.createTime),
  11474. 1
  11475. /* TEXT */
  11476. )
  11477. ]);
  11478. }),
  11479. 256
  11480. /* UNKEYED_FRAGMENT */
  11481. )),
  11482. $setup.historyList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  11483. key: 0,
  11484. class: "is-empty"
  11485. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  11486. ]);
  11487. }
  11488. const PagesOutboundInstockLog = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__scopeId", "data-v-059bddb5"], ["__file", "E:/HBuilderProjects/yta/pages/outbound/instockLog.vue"]]);
  11489. const _imports_0$2 = "/static/user.png";
  11490. const _sfc_main$l = {
  11491. data() {
  11492. const token = vue.ref(null);
  11493. const user = vue.ref(null);
  11494. return {
  11495. token,
  11496. user
  11497. };
  11498. },
  11499. onLoad() {
  11500. },
  11501. onShow() {
  11502. this.token = uni.getStorageSync("token");
  11503. this.user = uni.getStorageSync("user");
  11504. },
  11505. methods: {
  11506. avatarClick() {
  11507. if (this.token)
  11508. ;
  11509. else {
  11510. uni.navigateTo({
  11511. url: "/pages/login/index"
  11512. });
  11513. }
  11514. },
  11515. logout() {
  11516. uni.removeStorageSync("token");
  11517. uni.removeStorageSync("user");
  11518. this.token = uni.getStorageSync("token");
  11519. this.user = uni.getStorageSync("user");
  11520. },
  11521. dialogToggle() {
  11522. this.$refs.alertDialog.open();
  11523. }
  11524. }
  11525. };
  11526. function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
  11527. const _component_uni_popup_dialog = resolveEasycom(vue.resolveDynamicComponent("uni-popup-dialog"), __easycom_0$5);
  11528. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  11529. return vue.openBlock(), vue.createElementBlock("view", { class: "content" }, [
  11530. vue.createElementVNode("view", {
  11531. class: "user-v",
  11532. onClick: _cache[0] || (_cache[0] = (...args) => $options.avatarClick && $options.avatarClick(...args))
  11533. }, [
  11534. !$data.user.avatar ? (vue.openBlock(), vue.createElementBlock("image", {
  11535. key: 0,
  11536. class: "user-icon",
  11537. src: _imports_0$2
  11538. })) : (vue.openBlock(), vue.createElementBlock("image", {
  11539. key: 1,
  11540. class: "user-icon",
  11541. src: $data.user.avatar
  11542. }, null, 8, ["src"]))
  11543. ]),
  11544. vue.createElementVNode("view", { class: "text-area" }, [
  11545. vue.createElementVNode(
  11546. "text",
  11547. { class: "title" },
  11548. vue.toDisplayString($data.user.username),
  11549. 1
  11550. /* TEXT */
  11551. )
  11552. ]),
  11553. vue.createElementVNode("view", { class: "login-btn" }, [
  11554. !$data.token ? (vue.openBlock(), vue.createElementBlock("button", {
  11555. key: 0,
  11556. type: "primary",
  11557. plain: "true",
  11558. size: "mini",
  11559. onClick: _cache[1] || (_cache[1] = (...args) => $options.avatarClick && $options.avatarClick(...args))
  11560. }, "登录")) : (vue.openBlock(), vue.createElementBlock("button", {
  11561. key: 1,
  11562. type: "default",
  11563. plain: "true",
  11564. size: "mini",
  11565. onClick: _cache[2] || (_cache[2] = (...args) => $options.dialogToggle && $options.dialogToggle(...args))
  11566. }, "注销"))
  11567. ]),
  11568. vue.createVNode(
  11569. _component_uni_popup,
  11570. {
  11571. ref: "alertDialog",
  11572. type: "dialog"
  11573. },
  11574. {
  11575. default: vue.withCtx(() => [
  11576. vue.createVNode(_component_uni_popup_dialog, {
  11577. type: "info",
  11578. cancelText: "取消",
  11579. confirmText: "注销",
  11580. title: "注销",
  11581. content: "确定是要注销吗?",
  11582. onConfirm: $options.logout
  11583. }, null, 8, ["onConfirm"])
  11584. ]),
  11585. _: 1
  11586. /* STABLE */
  11587. },
  11588. 512
  11589. /* NEED_PATCH */
  11590. )
  11591. ]);
  11592. }
  11593. const PagesProfileIndex = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$k], ["__file", "E:/HBuilderProjects/yta/pages/profile/index.vue"]]);
  11594. const _imports_0$1 = "/static/logo.png";
  11595. const _sfc_main$k = {
  11596. data() {
  11597. return {
  11598. messageText: "",
  11599. captcha_id: "f2dd39ce-0d3e-4c1e-916c-b50090a7590s",
  11600. verifyCodeImg: "",
  11601. //验证码图片
  11602. verifyCodeToken: "",
  11603. //图形验证码的验证token
  11604. isVerifyCodeTure: false,
  11605. //验证码输入是否正确
  11606. valiFormData: {
  11607. account: "",
  11608. password: "",
  11609. captcha: ""
  11610. },
  11611. rules: {
  11612. name: {
  11613. rules: [{
  11614. required: true,
  11615. errorMessage: "姓名不能为空"
  11616. }]
  11617. }
  11618. }
  11619. };
  11620. },
  11621. onLoad() {
  11622. this.getVerifyCodeImg();
  11623. },
  11624. methods: {
  11625. getVerifyCodeImg() {
  11626. uni.request({
  11627. url: `${getcaptchaURL}?server=1&id=${this.captcha_id}&m=` + Math.random(),
  11628. method: "GET",
  11629. responseType: "arraybuffer",
  11630. //设置响应类型
  11631. success: (res) => {
  11632. const arrayBuffer = new Uint8Array(res.data);
  11633. const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(
  11634. arrayBuffer
  11635. );
  11636. this.verifyCodeImg = base64;
  11637. this.verifyCodeToken = res.header["Set-Cookie"];
  11638. }
  11639. });
  11640. },
  11641. formSubmit() {
  11642. uni.request({
  11643. //api地址
  11644. url: loginURL,
  11645. data: {
  11646. "username": this.valiFormData.account,
  11647. "password": this.valiFormData.password,
  11648. "captcha": this.valiFormData.captcha,
  11649. "keep": false,
  11650. "loading": true,
  11651. "captcha_id": this.captcha_id
  11652. },
  11653. //请求类型
  11654. method: "POST",
  11655. success: (res) => {
  11656. formatAppLog("log", "at pages/login/index.vue:100", res);
  11657. if (res.data.code == 1) {
  11658. const userInfo = res.data.data.userInfo;
  11659. uni.setStorage({
  11660. key: "token",
  11661. data: userInfo.token,
  11662. success() {
  11663. uni.setStorage({
  11664. key: "user",
  11665. data: userInfo,
  11666. success() {
  11667. uni.navigateBack();
  11668. }
  11669. });
  11670. }
  11671. });
  11672. } else {
  11673. formatAppLog("log", "at pages/login/index.vue:120", res);
  11674. this.messageText = res.data.msg;
  11675. this.$refs.message.open();
  11676. }
  11677. }
  11678. });
  11679. }
  11680. }
  11681. };
  11682. function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
  11683. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  11684. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  11685. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  11686. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  11687. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  11688. return vue.openBlock(), vue.createElementBlock("view", { class: "contaier" }, [
  11689. vue.createElementVNode("view", { class: "top-bg" }, [
  11690. vue.createElementVNode("image", {
  11691. class: "logo-icon",
  11692. src: _imports_0$1
  11693. })
  11694. ]),
  11695. vue.createElementVNode("view", { class: "input-box padding-lr" }, [
  11696. vue.createVNode(_component_uni_forms, {
  11697. ref: "valiForm",
  11698. rules: $data.rules,
  11699. modelValue: $data.valiFormData
  11700. }, {
  11701. default: vue.withCtx(() => [
  11702. vue.createElementVNode("view", { class: "cu-form-group margin-top" }, [
  11703. vue.createVNode(_component_uni_icons, {
  11704. class: "uni-icon",
  11705. type: "person",
  11706. size: "30",
  11707. color: "#999"
  11708. }),
  11709. vue.createVNode(_component_uni_easyinput, {
  11710. placeholder: "账号",
  11711. modelValue: $data.valiFormData.account,
  11712. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.valiFormData.account = $event)
  11713. }, null, 8, ["modelValue"])
  11714. ]),
  11715. vue.createElementVNode("view", { class: "cu-form-group" }, [
  11716. vue.createVNode(_component_uni_icons, {
  11717. class: "uni-icon",
  11718. type: "locked",
  11719. size: "30",
  11720. color: "#999"
  11721. }),
  11722. vue.createVNode(_component_uni_easyinput, {
  11723. placeholder: "密码",
  11724. type: "password",
  11725. modelValue: $data.valiFormData.password,
  11726. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.valiFormData.password = $event)
  11727. }, null, 8, ["modelValue"])
  11728. ]),
  11729. vue.createElementVNode("view", { class: "cu-form-group solid-bottom" }, [
  11730. vue.createVNode(_component_uni_icons, {
  11731. class: "uni-icon",
  11732. type: "more-filled",
  11733. size: "30",
  11734. color: "#999"
  11735. }),
  11736. vue.createVNode(_component_uni_easyinput, {
  11737. placeholder: "验证码",
  11738. modelValue: $data.valiFormData.captcha,
  11739. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.valiFormData.captcha = $event)
  11740. }, null, 8, ["modelValue"]),
  11741. vue.createCommentVNode(" <button class='cu-btn bg-login-zl shadow'>验证码</button> "),
  11742. vue.createElementVNode("image", {
  11743. class: "cu-btn captchaImg",
  11744. src: $data.verifyCodeImg,
  11745. onClick: _cache[3] || (_cache[3] = (...args) => $options.getVerifyCodeImg && $options.getVerifyCodeImg(...args))
  11746. }, null, 8, ["src"])
  11747. ])
  11748. ]),
  11749. _: 1
  11750. /* STABLE */
  11751. }, 8, ["rules", "modelValue"])
  11752. ]),
  11753. vue.createElementVNode("view", { class: "padding-lr margin-top-xs" }, [
  11754. vue.createElementVNode("button", {
  11755. class: "cu-btn block round bg-login-zl margin-tb-sm lg",
  11756. onClick: _cache[4] || (_cache[4] = ($event) => $options.formSubmit("valiForm"))
  11757. }, "立即登录")
  11758. ]),
  11759. vue.createVNode(
  11760. _component_uni_popup,
  11761. {
  11762. ref: "message",
  11763. type: "message"
  11764. },
  11765. {
  11766. default: vue.withCtx(() => [
  11767. vue.createVNode(_component_uni_popup_message, {
  11768. type: "error",
  11769. message: $data.messageText,
  11770. duration: 2e3
  11771. }, null, 8, ["message"])
  11772. ]),
  11773. _: 1
  11774. /* STABLE */
  11775. },
  11776. 512
  11777. /* NEED_PATCH */
  11778. )
  11779. ]);
  11780. }
  11781. const PagesLoginIndex = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$j], ["__scopeId", "data-v-d08ef7d4"], ["__file", "E:/HBuilderProjects/yta/pages/login/index.vue"]]);
  11782. const _sfc_main$j = {
  11783. data() {
  11784. const token = vue.ref(null);
  11785. const user = vue.ref(null);
  11786. return {
  11787. token,
  11788. user
  11789. };
  11790. },
  11791. onLoad() {
  11792. },
  11793. onShow() {
  11794. this.token = uni.getStorageSync("token");
  11795. this.user = uni.getStorageSync("user");
  11796. },
  11797. methods: {
  11798. avatarClick() {
  11799. if (this.token)
  11800. ;
  11801. else {
  11802. uni.navigateTo({
  11803. url: "/pages/login/index"
  11804. });
  11805. }
  11806. },
  11807. logout() {
  11808. uni.removeStorageSync("token");
  11809. uni.removeStorageSync("user");
  11810. this.token = uni.getStorageSync("token");
  11811. this.user = uni.getStorageSync("user");
  11812. },
  11813. dialogToggle() {
  11814. this.$refs.alertDialog.open();
  11815. }
  11816. }
  11817. };
  11818. function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
  11819. return vue.openBlock(), vue.createElementBlock("view", { class: "content" });
  11820. }
  11821. const PagesOrderIndex = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i], ["__file", "E:/HBuilderProjects/yta/pages/order/index.vue"]]);
  11822. const dataPicker = {
  11823. props: {
  11824. localdata: {
  11825. type: [Array, Object],
  11826. default() {
  11827. return [];
  11828. }
  11829. },
  11830. spaceInfo: {
  11831. type: Object,
  11832. default() {
  11833. return {};
  11834. }
  11835. },
  11836. collection: {
  11837. type: String,
  11838. default: ""
  11839. },
  11840. action: {
  11841. type: String,
  11842. default: ""
  11843. },
  11844. field: {
  11845. type: String,
  11846. default: ""
  11847. },
  11848. orderby: {
  11849. type: String,
  11850. default: ""
  11851. },
  11852. where: {
  11853. type: [String, Object],
  11854. default: ""
  11855. },
  11856. pageData: {
  11857. type: String,
  11858. default: "add"
  11859. },
  11860. pageCurrent: {
  11861. type: Number,
  11862. default: 1
  11863. },
  11864. pageSize: {
  11865. type: Number,
  11866. default: 500
  11867. },
  11868. getcount: {
  11869. type: [Boolean, String],
  11870. default: false
  11871. },
  11872. getone: {
  11873. type: [Boolean, String],
  11874. default: false
  11875. },
  11876. gettree: {
  11877. type: [Boolean, String],
  11878. default: false
  11879. },
  11880. manual: {
  11881. type: Boolean,
  11882. default: false
  11883. },
  11884. value: {
  11885. type: [Array, String, Number],
  11886. default() {
  11887. return [];
  11888. }
  11889. },
  11890. modelValue: {
  11891. type: [Array, String, Number],
  11892. default() {
  11893. return [];
  11894. }
  11895. },
  11896. preload: {
  11897. type: Boolean,
  11898. default: false
  11899. },
  11900. stepSearh: {
  11901. type: Boolean,
  11902. default: true
  11903. },
  11904. selfField: {
  11905. type: String,
  11906. default: ""
  11907. },
  11908. parentField: {
  11909. type: String,
  11910. default: ""
  11911. },
  11912. multiple: {
  11913. type: Boolean,
  11914. default: false
  11915. },
  11916. map: {
  11917. type: Object,
  11918. default() {
  11919. return {
  11920. text: "text",
  11921. value: "value"
  11922. };
  11923. }
  11924. }
  11925. },
  11926. data() {
  11927. return {
  11928. loading: false,
  11929. errorMessage: "",
  11930. loadMore: {
  11931. contentdown: "",
  11932. contentrefresh: "",
  11933. contentnomore: ""
  11934. },
  11935. dataList: [],
  11936. selected: [],
  11937. selectedIndex: 0,
  11938. page: {
  11939. current: this.pageCurrent,
  11940. size: this.pageSize,
  11941. count: 0
  11942. }
  11943. };
  11944. },
  11945. computed: {
  11946. isLocalData() {
  11947. return !this.collection.length;
  11948. },
  11949. isCloudData() {
  11950. return this.collection.length > 0;
  11951. },
  11952. isCloudDataList() {
  11953. return this.isCloudData && (!this.parentField && !this.selfField);
  11954. },
  11955. isCloudDataTree() {
  11956. return this.isCloudData && this.parentField && this.selfField;
  11957. },
  11958. dataValue() {
  11959. let isModelValue = Array.isArray(this.modelValue) ? this.modelValue.length > 0 : this.modelValue !== null || this.modelValue !== void 0;
  11960. return isModelValue ? this.modelValue : this.value;
  11961. },
  11962. hasValue() {
  11963. if (typeof this.dataValue === "number") {
  11964. return true;
  11965. }
  11966. return this.dataValue != null && this.dataValue.length > 0;
  11967. }
  11968. },
  11969. created() {
  11970. this.$watch(() => {
  11971. var al = [];
  11972. [
  11973. "pageCurrent",
  11974. "pageSize",
  11975. "spaceInfo",
  11976. "value",
  11977. "modelValue",
  11978. "localdata",
  11979. "collection",
  11980. "action",
  11981. "field",
  11982. "orderby",
  11983. "where",
  11984. "getont",
  11985. "getcount",
  11986. "gettree"
  11987. ].forEach((key) => {
  11988. al.push(this[key]);
  11989. });
  11990. return al;
  11991. }, (newValue, oldValue) => {
  11992. for (let i2 = 2; i2 < newValue.length; i2++) {
  11993. if (newValue[i2] != oldValue[i2]) {
  11994. break;
  11995. }
  11996. }
  11997. if (newValue[0] != oldValue[0]) {
  11998. this.page.current = this.pageCurrent;
  11999. }
  12000. this.page.size = this.pageSize;
  12001. this.onPropsChange();
  12002. });
  12003. this._treeData = [];
  12004. },
  12005. methods: {
  12006. onPropsChange() {
  12007. this._treeData = [];
  12008. },
  12009. // 填充 pickview 数据
  12010. async loadData() {
  12011. if (this.isLocalData) {
  12012. this.loadLocalData();
  12013. } else if (this.isCloudDataList) {
  12014. this.loadCloudDataList();
  12015. } else if (this.isCloudDataTree) {
  12016. this.loadCloudDataTree();
  12017. }
  12018. },
  12019. // 加载本地数据
  12020. async loadLocalData() {
  12021. this._treeData = [];
  12022. this._extractTree(this.localdata, this._treeData);
  12023. let inputValue = this.dataValue;
  12024. if (inputValue === void 0) {
  12025. return;
  12026. }
  12027. if (Array.isArray(inputValue)) {
  12028. inputValue = inputValue[inputValue.length - 1];
  12029. if (typeof inputValue === "object" && inputValue[this.map.value]) {
  12030. inputValue = inputValue[this.map.value];
  12031. }
  12032. }
  12033. this.selected = this._findNodePath(inputValue, this.localdata);
  12034. },
  12035. // 加载 Cloud 数据 (单列)
  12036. async loadCloudDataList() {
  12037. if (this.loading) {
  12038. return;
  12039. }
  12040. this.loading = true;
  12041. try {
  12042. let response = await this.getCommand();
  12043. let responseData = response.result.data;
  12044. this._treeData = responseData;
  12045. this._updateBindData();
  12046. this._updateSelected();
  12047. this.onDataChange();
  12048. } catch (e2) {
  12049. this.errorMessage = e2;
  12050. } finally {
  12051. this.loading = false;
  12052. }
  12053. },
  12054. // 加载 Cloud 数据 (树形)
  12055. async loadCloudDataTree() {
  12056. if (this.loading) {
  12057. return;
  12058. }
  12059. this.loading = true;
  12060. try {
  12061. let commandOptions = {
  12062. field: this._cloudDataPostField(),
  12063. where: this._cloudDataTreeWhere()
  12064. };
  12065. if (this.gettree) {
  12066. commandOptions.startwith = `${this.selfField}=='${this.dataValue}'`;
  12067. }
  12068. let response = await this.getCommand(commandOptions);
  12069. let responseData = response.result.data;
  12070. this._treeData = responseData;
  12071. this._updateBindData();
  12072. this._updateSelected();
  12073. this.onDataChange();
  12074. } catch (e2) {
  12075. this.errorMessage = e2;
  12076. } finally {
  12077. this.loading = false;
  12078. }
  12079. },
  12080. // 加载 Cloud 数据 (节点)
  12081. async loadCloudDataNode(callback) {
  12082. if (this.loading) {
  12083. return;
  12084. }
  12085. this.loading = true;
  12086. try {
  12087. let commandOptions = {
  12088. field: this._cloudDataPostField(),
  12089. where: this._cloudDataNodeWhere()
  12090. };
  12091. let response = await this.getCommand(commandOptions);
  12092. let responseData = response.result.data;
  12093. callback(responseData);
  12094. } catch (e2) {
  12095. this.errorMessage = e2;
  12096. } finally {
  12097. this.loading = false;
  12098. }
  12099. },
  12100. // 回显 Cloud 数据
  12101. getCloudDataValue() {
  12102. if (this.isCloudDataList) {
  12103. return this.getCloudDataListValue();
  12104. }
  12105. if (this.isCloudDataTree) {
  12106. return this.getCloudDataTreeValue();
  12107. }
  12108. },
  12109. // 回显 Cloud 数据 (单列)
  12110. getCloudDataListValue() {
  12111. let where = [];
  12112. let whereField = this._getForeignKeyByField();
  12113. if (whereField) {
  12114. where.push(`${whereField} == '${this.dataValue}'`);
  12115. }
  12116. where = where.join(" || ");
  12117. if (this.where) {
  12118. where = `(${this.where}) && (${where})`;
  12119. }
  12120. return this.getCommand({
  12121. field: this._cloudDataPostField(),
  12122. where
  12123. }).then((res) => {
  12124. this.selected = res.result.data;
  12125. return res.result.data;
  12126. });
  12127. },
  12128. // 回显 Cloud 数据 (树形)
  12129. getCloudDataTreeValue() {
  12130. return this.getCommand({
  12131. field: this._cloudDataPostField(),
  12132. getTreePath: {
  12133. startWith: `${this.selfField}=='${this.dataValue}'`
  12134. }
  12135. }).then((res) => {
  12136. let treePath = [];
  12137. this._extractTreePath(res.result.data, treePath);
  12138. this.selected = treePath;
  12139. return treePath;
  12140. });
  12141. },
  12142. getCommand(options = {}) {
  12143. let db = er.database(this.spaceInfo);
  12144. const action = options.action || this.action;
  12145. if (action) {
  12146. db = db.action(action);
  12147. }
  12148. const collection = options.collection || this.collection;
  12149. db = db.collection(collection);
  12150. const where = options.where || this.where;
  12151. if (!(!where || !Object.keys(where).length)) {
  12152. db = db.where(where);
  12153. }
  12154. const field = options.field || this.field;
  12155. if (field) {
  12156. db = db.field(field);
  12157. }
  12158. const orderby = options.orderby || this.orderby;
  12159. if (orderby) {
  12160. db = db.orderBy(orderby);
  12161. }
  12162. const current = options.pageCurrent !== void 0 ? options.pageCurrent : this.page.current;
  12163. const size = options.pageSize !== void 0 ? options.pageSize : this.page.size;
  12164. const getCount = options.getcount !== void 0 ? options.getcount : this.getcount;
  12165. const getTree = options.gettree !== void 0 ? options.gettree : this.gettree;
  12166. const getOptions = {
  12167. getCount,
  12168. getTree
  12169. };
  12170. if (options.getTreePath) {
  12171. getOptions.getTreePath = options.getTreePath;
  12172. }
  12173. db = db.skip(size * (current - 1)).limit(size).get(getOptions);
  12174. return db;
  12175. },
  12176. _cloudDataPostField() {
  12177. let fields = [this.field];
  12178. if (this.parentField) {
  12179. fields.push(`${this.parentField} as parent_value`);
  12180. }
  12181. return fields.join(",");
  12182. },
  12183. _cloudDataTreeWhere() {
  12184. let result = [];
  12185. let selected = this.selected;
  12186. let parentField = this.parentField;
  12187. if (parentField) {
  12188. result.push(`${parentField} == null || ${parentField} == ""`);
  12189. }
  12190. if (selected.length) {
  12191. for (var i2 = 0; i2 < selected.length - 1; i2++) {
  12192. result.push(`${parentField} == '${selected[i2].value}'`);
  12193. }
  12194. }
  12195. let where = [];
  12196. if (this.where) {
  12197. where.push(`(${this.where})`);
  12198. }
  12199. if (result.length) {
  12200. where.push(`(${result.join(" || ")})`);
  12201. }
  12202. return where.join(" && ");
  12203. },
  12204. _cloudDataNodeWhere() {
  12205. let where = [];
  12206. let selected = this.selected;
  12207. if (selected.length) {
  12208. where.push(`${this.parentField} == '${selected[selected.length - 1].value}'`);
  12209. }
  12210. where = where.join(" || ");
  12211. if (this.where) {
  12212. return `(${this.where}) && (${where})`;
  12213. }
  12214. return where;
  12215. },
  12216. _getWhereByForeignKey() {
  12217. let result = [];
  12218. let whereField = this._getForeignKeyByField();
  12219. if (whereField) {
  12220. result.push(`${whereField} == '${this.dataValue}'`);
  12221. }
  12222. if (this.where) {
  12223. return `(${this.where}) && (${result.join(" || ")})`;
  12224. }
  12225. return result.join(" || ");
  12226. },
  12227. _getForeignKeyByField() {
  12228. let fields = this.field.split(",");
  12229. let whereField = null;
  12230. for (let i2 = 0; i2 < fields.length; i2++) {
  12231. const items = fields[i2].split("as");
  12232. if (items.length < 2) {
  12233. continue;
  12234. }
  12235. if (items[1].trim() === "value") {
  12236. whereField = items[0].trim();
  12237. break;
  12238. }
  12239. }
  12240. return whereField;
  12241. },
  12242. _updateBindData(node) {
  12243. const {
  12244. dataList,
  12245. hasNodes
  12246. } = this._filterData(this._treeData, this.selected);
  12247. let isleaf = this._stepSearh === false && !hasNodes;
  12248. if (node) {
  12249. node.isleaf = isleaf;
  12250. }
  12251. this.dataList = dataList;
  12252. this.selectedIndex = dataList.length - 1;
  12253. if (!isleaf && this.selected.length < dataList.length) {
  12254. this.selected.push({
  12255. value: null,
  12256. text: "请选择"
  12257. });
  12258. }
  12259. return {
  12260. isleaf,
  12261. hasNodes
  12262. };
  12263. },
  12264. _updateSelected() {
  12265. let dl = this.dataList;
  12266. let sl = this.selected;
  12267. let textField = this.map.text;
  12268. let valueField = this.map.value;
  12269. for (let i2 = 0; i2 < sl.length; i2++) {
  12270. let value = sl[i2].value;
  12271. let dl2 = dl[i2];
  12272. for (let j2 = 0; j2 < dl2.length; j2++) {
  12273. let item2 = dl2[j2];
  12274. if (item2[valueField] === value) {
  12275. sl[i2].text = item2[textField];
  12276. break;
  12277. }
  12278. }
  12279. }
  12280. },
  12281. _filterData(data, paths) {
  12282. let dataList = [];
  12283. let hasNodes = true;
  12284. dataList.push(data.filter((item) => {
  12285. return item.parent_value === null || item.parent_value === void 0 || item.parent_value === "";
  12286. }));
  12287. for (let i2 = 0; i2 < paths.length; i2++) {
  12288. let value = paths[i2].value;
  12289. let nodes = data.filter((item) => {
  12290. return item.parent_value === value;
  12291. });
  12292. if (nodes.length) {
  12293. dataList.push(nodes);
  12294. } else {
  12295. hasNodes = false;
  12296. }
  12297. }
  12298. return {
  12299. dataList,
  12300. hasNodes
  12301. };
  12302. },
  12303. _extractTree(nodes, result, parent_value) {
  12304. let valueField = this.map.value;
  12305. for (let i2 = 0; i2 < nodes.length; i2++) {
  12306. let node = nodes[i2];
  12307. let child = {};
  12308. for (let key in node) {
  12309. if (key !== "children") {
  12310. child[key] = node[key];
  12311. }
  12312. }
  12313. if (parent_value !== null && parent_value !== void 0 && parent_value !== "") {
  12314. child.parent_value = parent_value;
  12315. }
  12316. result.push(child);
  12317. let children = node.children;
  12318. if (children) {
  12319. this._extractTree(children, result, node[valueField]);
  12320. }
  12321. }
  12322. },
  12323. _extractTreePath(nodes, result) {
  12324. for (let i2 = 0; i2 < nodes.length; i2++) {
  12325. let node = nodes[i2];
  12326. let child = {};
  12327. for (let key in node) {
  12328. if (key !== "children") {
  12329. child[key] = node[key];
  12330. }
  12331. }
  12332. result.push(child);
  12333. let children = node.children;
  12334. if (children) {
  12335. this._extractTreePath(children, result);
  12336. }
  12337. }
  12338. },
  12339. _findNodePath(key, nodes, path = []) {
  12340. let textField = this.map.text;
  12341. let valueField = this.map.value;
  12342. for (let i2 = 0; i2 < nodes.length; i2++) {
  12343. let node = nodes[i2];
  12344. let children = node.children;
  12345. let text = node[textField];
  12346. let value = node[valueField];
  12347. path.push({
  12348. value,
  12349. text
  12350. });
  12351. if (value === key) {
  12352. return path;
  12353. }
  12354. if (children) {
  12355. const p2 = this._findNodePath(key, children, path);
  12356. if (p2.length) {
  12357. return p2;
  12358. }
  12359. }
  12360. path.pop();
  12361. }
  12362. return [];
  12363. }
  12364. }
  12365. };
  12366. const _sfc_main$i = {
  12367. name: "UniDataPickerView",
  12368. emits: ["nodeclick", "change", "datachange", "update:modelValue"],
  12369. mixins: [dataPicker],
  12370. props: {
  12371. managedMode: {
  12372. type: Boolean,
  12373. default: false
  12374. },
  12375. ellipsis: {
  12376. type: Boolean,
  12377. default: true
  12378. }
  12379. },
  12380. created() {
  12381. if (!this.managedMode) {
  12382. this.$nextTick(() => {
  12383. this.loadData();
  12384. });
  12385. }
  12386. },
  12387. methods: {
  12388. onPropsChange() {
  12389. this._treeData = [];
  12390. this.selectedIndex = 0;
  12391. this.$nextTick(() => {
  12392. this.loadData();
  12393. });
  12394. },
  12395. handleSelect(index) {
  12396. this.selectedIndex = index;
  12397. },
  12398. handleNodeClick(item, i2, j2) {
  12399. if (item.disable) {
  12400. return;
  12401. }
  12402. const node = this.dataList[i2][j2];
  12403. const text = node[this.map.text];
  12404. const value = node[this.map.value];
  12405. if (i2 < this.selected.length - 1) {
  12406. this.selected.splice(i2, this.selected.length - i2);
  12407. this.selected.push({
  12408. text,
  12409. value
  12410. });
  12411. } else if (i2 === this.selected.length - 1) {
  12412. this.selected.splice(i2, 1, {
  12413. text,
  12414. value
  12415. });
  12416. }
  12417. if (node.isleaf) {
  12418. this.onSelectedChange(node, node.isleaf);
  12419. return;
  12420. }
  12421. const {
  12422. isleaf,
  12423. hasNodes
  12424. } = this._updateBindData();
  12425. if (this.isLocalData) {
  12426. this.onSelectedChange(node, !hasNodes || isleaf);
  12427. } else if (this.isCloudDataList) {
  12428. this.onSelectedChange(node, true);
  12429. } else if (this.isCloudDataTree) {
  12430. if (isleaf) {
  12431. this.onSelectedChange(node, node.isleaf);
  12432. } else if (!hasNodes) {
  12433. this.loadCloudDataNode((data) => {
  12434. if (!data.length) {
  12435. node.isleaf = true;
  12436. } else {
  12437. this._treeData.push(...data);
  12438. this._updateBindData(node);
  12439. }
  12440. this.onSelectedChange(node, node.isleaf);
  12441. });
  12442. }
  12443. }
  12444. },
  12445. updateData(data) {
  12446. this._treeData = data.treeData;
  12447. this.selected = data.selected;
  12448. if (!this._treeData.length) {
  12449. this.loadData();
  12450. } else {
  12451. this._updateBindData();
  12452. }
  12453. },
  12454. onDataChange() {
  12455. this.$emit("datachange");
  12456. },
  12457. onSelectedChange(node, isleaf) {
  12458. if (isleaf) {
  12459. this._dispatchEvent();
  12460. }
  12461. if (node) {
  12462. this.$emit("nodeclick", node);
  12463. }
  12464. },
  12465. _dispatchEvent() {
  12466. this.$emit("change", this.selected.slice(0));
  12467. }
  12468. }
  12469. };
  12470. function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
  12471. const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_0$4);
  12472. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-data-pickerview" }, [
  12473. !_ctx.isCloudDataList ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
  12474. key: 0,
  12475. class: "selected-area",
  12476. "scroll-x": "true"
  12477. }, [
  12478. vue.createElementVNode("view", { class: "selected-list" }, [
  12479. (vue.openBlock(true), vue.createElementBlock(
  12480. vue.Fragment,
  12481. null,
  12482. vue.renderList(_ctx.selected, (item, index) => {
  12483. return vue.openBlock(), vue.createElementBlock("view", {
  12484. class: vue.normalizeClass(["selected-item", {
  12485. "selected-item-active": index == _ctx.selectedIndex
  12486. }]),
  12487. key: index,
  12488. onClick: ($event) => $options.handleSelect(index)
  12489. }, [
  12490. vue.createElementVNode(
  12491. "text",
  12492. null,
  12493. vue.toDisplayString(item.text || ""),
  12494. 1
  12495. /* TEXT */
  12496. )
  12497. ], 10, ["onClick"]);
  12498. }),
  12499. 128
  12500. /* KEYED_FRAGMENT */
  12501. ))
  12502. ])
  12503. ])) : vue.createCommentVNode("v-if", true),
  12504. vue.createElementVNode("view", { class: "tab-c" }, [
  12505. vue.createElementVNode("scroll-view", {
  12506. class: "list",
  12507. "scroll-y": true
  12508. }, [
  12509. (vue.openBlock(true), vue.createElementBlock(
  12510. vue.Fragment,
  12511. null,
  12512. vue.renderList(_ctx.dataList[_ctx.selectedIndex], (item, j2) => {
  12513. return vue.openBlock(), vue.createElementBlock("view", {
  12514. class: vue.normalizeClass(["item", { "is-disabled": !!item.disable }]),
  12515. key: j2,
  12516. onClick: ($event) => $options.handleNodeClick(item, _ctx.selectedIndex, j2)
  12517. }, [
  12518. vue.createElementVNode(
  12519. "text",
  12520. { class: "item-text" },
  12521. vue.toDisplayString(item[_ctx.map.text]),
  12522. 1
  12523. /* TEXT */
  12524. ),
  12525. _ctx.selected.length > _ctx.selectedIndex && item[_ctx.map.value] == _ctx.selected[_ctx.selectedIndex].value ? (vue.openBlock(), vue.createElementBlock("view", {
  12526. key: 0,
  12527. class: "check"
  12528. })) : vue.createCommentVNode("v-if", true)
  12529. ], 10, ["onClick"]);
  12530. }),
  12531. 128
  12532. /* KEYED_FRAGMENT */
  12533. ))
  12534. ]),
  12535. _ctx.loading ? (vue.openBlock(), vue.createElementBlock("view", {
  12536. key: 0,
  12537. class: "loading-cover"
  12538. }, [
  12539. vue.createVNode(_component_uni_load_more, {
  12540. class: "load-more",
  12541. contentText: _ctx.loadMore,
  12542. status: "loading"
  12543. }, null, 8, ["contentText"])
  12544. ])) : vue.createCommentVNode("v-if", true),
  12545. _ctx.errorMessage ? (vue.openBlock(), vue.createElementBlock("view", {
  12546. key: 1,
  12547. class: "error-message"
  12548. }, [
  12549. vue.createElementVNode(
  12550. "text",
  12551. { class: "error-text" },
  12552. vue.toDisplayString(_ctx.errorMessage),
  12553. 1
  12554. /* TEXT */
  12555. )
  12556. ])) : vue.createCommentVNode("v-if", true)
  12557. ])
  12558. ]);
  12559. }
  12560. const DataPickerView = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__scopeId", "data-v-91ec6a82"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue"]]);
  12561. const _sfc_main$h = {
  12562. name: "UniDataPicker",
  12563. emits: ["popupopened", "popupclosed", "nodeclick", "input", "change", "update:modelValue", "inputclick"],
  12564. mixins: [dataPicker],
  12565. components: {
  12566. DataPickerView
  12567. },
  12568. props: {
  12569. options: {
  12570. type: [Object, Array],
  12571. default() {
  12572. return {};
  12573. }
  12574. },
  12575. popupTitle: {
  12576. type: String,
  12577. default: "请选择"
  12578. },
  12579. placeholder: {
  12580. type: String,
  12581. default: "请选择"
  12582. },
  12583. heightMobile: {
  12584. type: String,
  12585. default: ""
  12586. },
  12587. readonly: {
  12588. type: Boolean,
  12589. default: false
  12590. },
  12591. clearIcon: {
  12592. type: Boolean,
  12593. default: true
  12594. },
  12595. border: {
  12596. type: Boolean,
  12597. default: true
  12598. },
  12599. split: {
  12600. type: String,
  12601. default: "/"
  12602. },
  12603. ellipsis: {
  12604. type: Boolean,
  12605. default: true
  12606. }
  12607. },
  12608. data() {
  12609. return {
  12610. isOpened: false,
  12611. inputSelected: []
  12612. };
  12613. },
  12614. created() {
  12615. this.$nextTick(() => {
  12616. this.load();
  12617. });
  12618. },
  12619. watch: {
  12620. localdata: {
  12621. handler() {
  12622. this.load();
  12623. },
  12624. deep: true
  12625. }
  12626. },
  12627. methods: {
  12628. clear() {
  12629. this._dispatchEvent([]);
  12630. },
  12631. onPropsChange() {
  12632. this._treeData = [];
  12633. this.selectedIndex = 0;
  12634. this.load();
  12635. },
  12636. load() {
  12637. if (this.readonly) {
  12638. this._processReadonly(this.localdata, this.dataValue);
  12639. return;
  12640. }
  12641. if (this.isLocalData) {
  12642. this.loadData();
  12643. this.inputSelected = this.selected.slice(0);
  12644. } else if (this.isCloudDataList || this.isCloudDataTree) {
  12645. this.loading = true;
  12646. this.getCloudDataValue().then((res) => {
  12647. this.loading = false;
  12648. this.inputSelected = res;
  12649. }).catch((err) => {
  12650. this.loading = false;
  12651. this.errorMessage = err;
  12652. });
  12653. }
  12654. },
  12655. show() {
  12656. this.isOpened = true;
  12657. setTimeout(() => {
  12658. this.$refs.pickerView.updateData({
  12659. treeData: this._treeData,
  12660. selected: this.selected,
  12661. selectedIndex: this.selectedIndex
  12662. });
  12663. }, 200);
  12664. this.$emit("popupopened");
  12665. },
  12666. hide() {
  12667. this.isOpened = false;
  12668. this.$emit("popupclosed");
  12669. },
  12670. handleInput() {
  12671. if (this.readonly) {
  12672. this.$emit("inputclick");
  12673. return;
  12674. }
  12675. this.show();
  12676. },
  12677. handleClose(e2) {
  12678. this.hide();
  12679. },
  12680. onnodeclick(e2) {
  12681. this.$emit("nodeclick", e2);
  12682. },
  12683. ondatachange(e2) {
  12684. this._treeData = this.$refs.pickerView._treeData;
  12685. },
  12686. onchange(e2) {
  12687. this.hide();
  12688. this.$nextTick(() => {
  12689. this.inputSelected = e2;
  12690. });
  12691. this._dispatchEvent(e2);
  12692. },
  12693. _processReadonly(dataList, value) {
  12694. var isTree = dataList.findIndex((item2) => {
  12695. return item2.children;
  12696. });
  12697. if (isTree > -1) {
  12698. let inputValue;
  12699. if (Array.isArray(value)) {
  12700. inputValue = value[value.length - 1];
  12701. if (typeof inputValue === "object" && inputValue.value) {
  12702. inputValue = inputValue.value;
  12703. }
  12704. } else {
  12705. inputValue = value;
  12706. }
  12707. this.inputSelected = this._findNodePath(inputValue, this.localdata);
  12708. return;
  12709. }
  12710. if (!this.hasValue) {
  12711. this.inputSelected = [];
  12712. return;
  12713. }
  12714. let result = [];
  12715. for (let i2 = 0; i2 < value.length; i2++) {
  12716. var val = value[i2];
  12717. var item = dataList.find((v2) => {
  12718. return v2.value == val;
  12719. });
  12720. if (item) {
  12721. result.push(item);
  12722. }
  12723. }
  12724. if (result.length) {
  12725. this.inputSelected = result;
  12726. }
  12727. },
  12728. _filterForArray(data, valueArray) {
  12729. var result = [];
  12730. for (let i2 = 0; i2 < valueArray.length; i2++) {
  12731. var value = valueArray[i2];
  12732. var found = data.find((item) => {
  12733. return item.value == value;
  12734. });
  12735. if (found) {
  12736. result.push(found);
  12737. }
  12738. }
  12739. return result;
  12740. },
  12741. _dispatchEvent(selected) {
  12742. let item = {};
  12743. if (selected.length) {
  12744. var value = new Array(selected.length);
  12745. for (var i2 = 0; i2 < selected.length; i2++) {
  12746. value[i2] = selected[i2].value;
  12747. }
  12748. item = selected[selected.length - 1];
  12749. } else {
  12750. item.value = "";
  12751. }
  12752. if (this.formItem) {
  12753. this.formItem.setValue(item.value);
  12754. }
  12755. this.$emit("input", item.value);
  12756. this.$emit("update:modelValue", item.value);
  12757. this.$emit("change", {
  12758. detail: {
  12759. value: selected
  12760. }
  12761. });
  12762. }
  12763. }
  12764. };
  12765. function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
  12766. const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_0$4);
  12767. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  12768. const _component_data_picker_view = vue.resolveComponent("data-picker-view");
  12769. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-data-tree" }, [
  12770. vue.createElementVNode("view", {
  12771. class: "uni-data-tree-input",
  12772. onClick: _cache[1] || (_cache[1] = (...args) => $options.handleInput && $options.handleInput(...args))
  12773. }, [
  12774. vue.renderSlot(_ctx.$slots, "default", {
  12775. options: $props.options,
  12776. data: $data.inputSelected,
  12777. error: _ctx.errorMessage
  12778. }, () => [
  12779. vue.createElementVNode(
  12780. "view",
  12781. {
  12782. class: vue.normalizeClass(["input-value", { "input-value-border": $props.border }])
  12783. },
  12784. [
  12785. _ctx.errorMessage ? (vue.openBlock(), vue.createElementBlock(
  12786. "text",
  12787. {
  12788. key: 0,
  12789. class: "selected-area error-text"
  12790. },
  12791. vue.toDisplayString(_ctx.errorMessage),
  12792. 1
  12793. /* TEXT */
  12794. )) : _ctx.loading && !$data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
  12795. key: 1,
  12796. class: "selected-area"
  12797. }, [
  12798. vue.createVNode(_component_uni_load_more, {
  12799. class: "load-more",
  12800. contentText: _ctx.loadMore,
  12801. status: "loading"
  12802. }, null, 8, ["contentText"])
  12803. ])) : $data.inputSelected.length ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
  12804. key: 2,
  12805. class: "selected-area",
  12806. "scroll-x": "true"
  12807. }, [
  12808. vue.createElementVNode("view", { class: "selected-list" }, [
  12809. (vue.openBlock(true), vue.createElementBlock(
  12810. vue.Fragment,
  12811. null,
  12812. vue.renderList($data.inputSelected, (item, index) => {
  12813. return vue.openBlock(), vue.createElementBlock("view", {
  12814. class: "selected-item",
  12815. key: index
  12816. }, [
  12817. vue.createElementVNode(
  12818. "text",
  12819. { class: "text-color" },
  12820. vue.toDisplayString(item.text),
  12821. 1
  12822. /* TEXT */
  12823. ),
  12824. index < $data.inputSelected.length - 1 ? (vue.openBlock(), vue.createElementBlock(
  12825. "text",
  12826. {
  12827. key: 0,
  12828. class: "input-split-line"
  12829. },
  12830. vue.toDisplayString($props.split),
  12831. 1
  12832. /* TEXT */
  12833. )) : vue.createCommentVNode("v-if", true)
  12834. ]);
  12835. }),
  12836. 128
  12837. /* KEYED_FRAGMENT */
  12838. ))
  12839. ])
  12840. ])) : (vue.openBlock(), vue.createElementBlock(
  12841. "text",
  12842. {
  12843. key: 3,
  12844. class: "selected-area placeholder"
  12845. },
  12846. vue.toDisplayString($props.placeholder),
  12847. 1
  12848. /* TEXT */
  12849. )),
  12850. $props.clearIcon && !$props.readonly && $data.inputSelected.length ? (vue.openBlock(), vue.createElementBlock("view", {
  12851. key: 4,
  12852. class: "icon-clear",
  12853. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop"]))
  12854. }, [
  12855. vue.createVNode(_component_uni_icons, {
  12856. type: "clear",
  12857. color: "#c0c4cc",
  12858. size: "24"
  12859. })
  12860. ])) : vue.createCommentVNode("v-if", true),
  12861. (!$props.clearIcon || !$data.inputSelected.length) && !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
  12862. key: 5,
  12863. class: "arrow-area"
  12864. }, [
  12865. vue.createElementVNode("view", { class: "input-arrow" })
  12866. ])) : vue.createCommentVNode("v-if", true)
  12867. ],
  12868. 2
  12869. /* CLASS */
  12870. )
  12871. ], true)
  12872. ]),
  12873. $data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
  12874. key: 0,
  12875. class: "uni-data-tree-cover",
  12876. onClick: _cache[2] || (_cache[2] = (...args) => $options.handleClose && $options.handleClose(...args))
  12877. })) : vue.createCommentVNode("v-if", true),
  12878. $data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
  12879. key: 1,
  12880. class: "uni-data-tree-dialog"
  12881. }, [
  12882. vue.createElementVNode("view", { class: "uni-popper__arrow" }),
  12883. vue.createElementVNode("view", { class: "dialog-caption" }, [
  12884. vue.createElementVNode("view", { class: "title-area" }, [
  12885. vue.createElementVNode(
  12886. "text",
  12887. { class: "dialog-title" },
  12888. vue.toDisplayString($props.popupTitle),
  12889. 1
  12890. /* TEXT */
  12891. )
  12892. ]),
  12893. vue.createElementVNode("view", {
  12894. class: "dialog-close",
  12895. onClick: _cache[3] || (_cache[3] = (...args) => $options.handleClose && $options.handleClose(...args))
  12896. }, [
  12897. vue.createElementVNode("view", {
  12898. class: "dialog-close-plus",
  12899. "data-id": "close"
  12900. }),
  12901. vue.createElementVNode("view", {
  12902. class: "dialog-close-plus dialog-close-rotate",
  12903. "data-id": "close"
  12904. })
  12905. ])
  12906. ]),
  12907. vue.createVNode(_component_data_picker_view, {
  12908. class: "picker-view",
  12909. ref: "pickerView",
  12910. modelValue: _ctx.dataValue,
  12911. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.dataValue = $event),
  12912. localdata: _ctx.localdata,
  12913. preload: _ctx.preload,
  12914. collection: _ctx.collection,
  12915. field: _ctx.field,
  12916. orderby: _ctx.orderby,
  12917. where: _ctx.where,
  12918. "step-searh": _ctx.stepSearh,
  12919. "self-field": _ctx.selfField,
  12920. "parent-field": _ctx.parentField,
  12921. "managed-mode": true,
  12922. map: _ctx.map,
  12923. ellipsis: $props.ellipsis,
  12924. onChange: $options.onchange,
  12925. onDatachange: $options.ondatachange,
  12926. onNodeclick: $options.onnodeclick
  12927. }, null, 8, ["modelValue", "localdata", "preload", "collection", "field", "orderby", "where", "step-searh", "self-field", "parent-field", "map", "ellipsis", "onChange", "onDatachange", "onNodeclick"])
  12928. ])) : vue.createCommentVNode("v-if", true)
  12929. ]);
  12930. }
  12931. const __easycom_3$1 = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g], ["__scopeId", "data-v-2653531e"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue"]]);
  12932. const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
  12933. __name: "index",
  12934. setup(__props, { expose: __expose }) {
  12935. __expose();
  12936. const token = vue.ref();
  12937. const loading = vue.ref(false);
  12938. const hidePage = vue.ref(false);
  12939. const focusType = vue.ref(true);
  12940. const editBatchNum = vue.ref(false);
  12941. const editPalletNum = vue.ref(false);
  12942. const lotnoLogHistory = vue.ref([]);
  12943. const messageRef = vue.ref();
  12944. const messageType = vue.ref();
  12945. const messageText = vue.ref();
  12946. let st2;
  12947. const valiFormData = vue.ref({
  12948. orderNum: "",
  12949. weight: "",
  12950. batchNum: "",
  12951. palletNum: ""
  12952. });
  12953. const rules = vue.reactive({
  12954. orderNum: {
  12955. rules: [
  12956. {
  12957. required: true,
  12958. errorMessage: "单号不能为空"
  12959. }
  12960. ]
  12961. }
  12962. });
  12963. const options = vue.reactive({
  12964. batch: [],
  12965. pallet: []
  12966. });
  12967. const onnodeclick = () => {
  12968. };
  12969. const onpopupopened = () => {
  12970. };
  12971. const onpopupclosed = () => {
  12972. };
  12973. const onchange = () => {
  12974. };
  12975. const checkPermission = async () => {
  12976. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  12977. if (status === null || status === 1) {
  12978. status = 1;
  12979. } else {
  12980. uni.showModal({
  12981. content: "Camera permission required",
  12982. confirmText: "Setting",
  12983. success: function(res) {
  12984. if (res.confirm) {
  12985. permission.gotoAppSetting();
  12986. }
  12987. }
  12988. });
  12989. }
  12990. return status;
  12991. };
  12992. const scanInput = async () => {
  12993. let status = await checkPermission();
  12994. if (status !== 1) {
  12995. return;
  12996. }
  12997. uni.scanCode({
  12998. success: (res) => {
  12999. valiFormData.value.orderNum = res.result;
  13000. },
  13001. fail: (err) => {
  13002. }
  13003. });
  13004. };
  13005. const reset = () => {
  13006. loading.value = false;
  13007. valiFormData.value.orderNum = "";
  13008. valiFormData.value.weight = "";
  13009. };
  13010. const submitBatchNum = () => {
  13011. if (valiFormData.value.batchNum) {
  13012. editBatchNum.value = true;
  13013. } else {
  13014. messageType.value = "error";
  13015. messageText.value = "请选择批次号";
  13016. messageRef.value.open();
  13017. }
  13018. };
  13019. const batchNum = vue.computed(() => {
  13020. const res = options.batch.find((item) => item.value === valiFormData.value.batchNum);
  13021. return res == null ? void 0 : res.text;
  13022. });
  13023. const submitPalletNum = () => {
  13024. if (valiFormData.value.palletNum) {
  13025. editPalletNum.value = true;
  13026. } else {
  13027. messageType.value = "error";
  13028. messageText.value = "请选择托盘号";
  13029. messageRef.value.open();
  13030. }
  13031. };
  13032. const palletNum = vue.computed(() => {
  13033. function findTextByValue(arr, targetValue) {
  13034. for (let item of arr) {
  13035. if (item.value === targetValue) {
  13036. return item.text;
  13037. }
  13038. if (item.children && item.children.length > 0) {
  13039. const result = findTextByValue(item.children, targetValue);
  13040. if (result) {
  13041. return `${item.text}/${result}`;
  13042. }
  13043. }
  13044. }
  13045. return null;
  13046. }
  13047. const textPath = findTextByValue(options.pallet, valiFormData.value.palletNum);
  13048. return textPath;
  13049. });
  13050. const checkOrder = () => {
  13051. loading.value = true;
  13052. uni.setStorageSync("waybills", []);
  13053. uni.request({
  13054. url: getWaybillsURL,
  13055. method: "POST",
  13056. header: {
  13057. batoken: token.value
  13058. },
  13059. data: {
  13060. order_no: valiFormData.value.orderNum,
  13061. batch_number: valiFormData.value.batchNum,
  13062. pallet_number: valiFormData.value.palletNum ? findPalletNumIdByValue(options.pallet, valiFormData.value.palletNum) : ""
  13063. },
  13064. success: (res) => {
  13065. loading.value = false;
  13066. if (res.data.code == 1) {
  13067. messageType.value = "success";
  13068. messageText.value = res.data.msg;
  13069. messageRef.value.open();
  13070. uni.setStorageSync("waybills", res.data.data.waybills);
  13071. uni.navigateTo({
  13072. url: "/pages/scanLotno/waybillsList"
  13073. });
  13074. } else {
  13075. messageType.value = "error";
  13076. messageText.value = res.data.msg;
  13077. messageRef.value.open();
  13078. }
  13079. }
  13080. });
  13081. };
  13082. const findPalletNumIdByValue = (data, targetValue) => {
  13083. for (let i2 = 0; i2 < data.length; i2++) {
  13084. const item = data[i2];
  13085. if (item.id === targetValue || item.value === targetValue) {
  13086. return [item.id];
  13087. } else if (item.children && item.children.length > 0) {
  13088. const childId = findPalletNumIdByValue(item.children, targetValue);
  13089. if (childId !== null) {
  13090. return childId;
  13091. }
  13092. }
  13093. }
  13094. return null;
  13095. };
  13096. const onsubmit = () => {
  13097. st2 && clearTimeout(st2);
  13098. loading.value = true;
  13099. uni.request({
  13100. url: bindShippingURL,
  13101. method: "POST",
  13102. header: {
  13103. batoken: token.value
  13104. },
  13105. data: {
  13106. order_no: valiFormData.value.orderNum,
  13107. reweighting: valiFormData.value.weight,
  13108. batch_number: valiFormData.value.batchNum,
  13109. pallet_number: valiFormData.value.palletNum ? findPalletNumIdByValue(options.pallet, valiFormData.value.palletNum) : ""
  13110. },
  13111. success: (res) => {
  13112. loading.value = false;
  13113. if (res.data.code == 1) {
  13114. messageType.value = "success";
  13115. messageText.value = res.data.msg;
  13116. messageRef.value.open();
  13117. if (res.data.data.labels && res.data.data.labels.length > 0) {
  13118. formatAppLog("log", "at pages/scanLotno/index.vue:278", "有打印面单");
  13119. }
  13120. const historyItem = {
  13121. orderNum: valiFormData.value.orderNum,
  13122. createTime: /* @__PURE__ */ new Date(),
  13123. type: valiFormData.value.batchNum ? "绑定批次" : "绑定托盘",
  13124. status: true
  13125. };
  13126. formatAppLog("log", "at pages/scanLotno/index.vue:290", "lotnoLogHistory--", lotnoLogHistory);
  13127. lotnoLogHistory.value.unshift(historyItem);
  13128. uni.setStorageSync("lotnoLogHistory", lotnoLogHistory.value);
  13129. getHistory();
  13130. } else {
  13131. messageType.value = "error";
  13132. messageText.value = res.data.msg;
  13133. messageRef.value.open();
  13134. const historyItem = {
  13135. orderNum: valiFormData.value.orderNum,
  13136. createTime: /* @__PURE__ */ new Date(),
  13137. type: valiFormData.value.batchNum ? "绑定批次" : "绑定托盘",
  13138. status: false
  13139. };
  13140. lotnoLogHistory.value.unshift(historyItem);
  13141. uni.setStorageSync("lotnoLogHistory", lotnoLogHistory.value);
  13142. getHistory();
  13143. }
  13144. st2 = setTimeout(() => {
  13145. reset();
  13146. setFocus();
  13147. st2 && clearTimeout(st2);
  13148. }, 1e3);
  13149. }
  13150. });
  13151. };
  13152. const getHistory = () => {
  13153. lotnoLogHistory.value = uni.getStorageSync("lotnoLogHistory") || [];
  13154. };
  13155. const keypress = (e2) => {
  13156. formatAppLog("log", "at pages/scanLotno/index.vue:321", e2, "按键码");
  13157. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  13158. ;
  13159. if (e2.keyCode == 66) {
  13160. onsubmit();
  13161. }
  13162. };
  13163. onLoad(() => {
  13164. plus.key.addEventListener("keyup", keypress);
  13165. });
  13166. onUnload(() => {
  13167. plus.key.removeEventListener("keyup", keypress);
  13168. });
  13169. onHide(() => {
  13170. hidePage.value = true;
  13171. plus.key.removeEventListener("keyup", keypress);
  13172. });
  13173. onBackPress(() => {
  13174. plus.key.removeEventListener("keyup", keypress);
  13175. });
  13176. onShow(() => {
  13177. hidePage.value = false;
  13178. token.value = uni.getStorageSync("token");
  13179. getBindParams();
  13180. getHistory();
  13181. });
  13182. const setFocus = () => {
  13183. if (hidePage.value) {
  13184. return;
  13185. }
  13186. focusType.value = false;
  13187. vue.nextTick(() => {
  13188. focusType.value = true;
  13189. });
  13190. };
  13191. const getBindParams = () => {
  13192. uni.request({
  13193. url: getBindParamsURL,
  13194. method: "GET",
  13195. header: {
  13196. batoken: token.value
  13197. },
  13198. success: (res) => {
  13199. if (res.data.code === 1) {
  13200. let transformData = function(data) {
  13201. return data.map((item) => {
  13202. const { id, value, label, ...rest } = item;
  13203. return {
  13204. id: id || value,
  13205. value,
  13206. text: label,
  13207. ...rest,
  13208. children: item.children ? transformData(item.children) : []
  13209. };
  13210. });
  13211. };
  13212. options.batch = res.data.data.batch_number.map((item) => {
  13213. return { text: item.name, value: item.id };
  13214. });
  13215. const shipping = transformData(res.data.data.shipping);
  13216. options.pallet = shipping;
  13217. }
  13218. },
  13219. fail(e2) {
  13220. formatAppLog("log", "at pages/scanLotno/index.vue:411", "fail--", e2);
  13221. }
  13222. });
  13223. };
  13224. onNavigationBarButtonTap((event) => {
  13225. if (event.index === 0) {
  13226. uni.navigateTo({
  13227. url: "/pages/scanLotno/lotnoLog"
  13228. });
  13229. }
  13230. });
  13231. const __returned__ = { token, loading, hidePage, focusType, editBatchNum, editPalletNum, lotnoLogHistory, messageRef, messageType, messageText, get st() {
  13232. return st2;
  13233. }, set st(v2) {
  13234. st2 = v2;
  13235. }, valiFormData, rules, options, onnodeclick, onpopupopened, onpopupclosed, onchange, checkPermission, scanInput, reset, submitBatchNum, batchNum, submitPalletNum, palletNum, checkOrder, findPalletNumIdByValue, onsubmit, getHistory, keypress, setFocus, getBindParams };
  13236. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  13237. return __returned__;
  13238. }
  13239. });
  13240. function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
  13241. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  13242. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  13243. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$2);
  13244. const _component_uni_data_picker = resolveEasycom(vue.resolveDynamicComponent("uni-data-picker"), __easycom_3$1);
  13245. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  13246. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  13247. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  13248. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  13249. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  13250. vue.createVNode(_component_uni_forms, {
  13251. ref: "valiForm",
  13252. "label-align": "right",
  13253. "label-width": 80,
  13254. rules: $setup.rules,
  13255. modelValue: $setup.valiFormData
  13256. }, {
  13257. default: vue.withCtx(() => [
  13258. vue.createVNode(_component_uni_forms_item, {
  13259. label: "运单号码",
  13260. required: "",
  13261. name: "orderNum"
  13262. }, {
  13263. default: vue.withCtx(() => [
  13264. vue.createVNode(_component_uni_easyinput, {
  13265. modelValue: $setup.valiFormData.orderNum,
  13266. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  13267. placeholder: "请输入单号",
  13268. suffixIcon: "scan",
  13269. focus: $setup.focusType,
  13270. onIconClick: $setup.scanInput
  13271. }, null, 8, ["modelValue", "focus"])
  13272. ]),
  13273. _: 1
  13274. /* STABLE */
  13275. }),
  13276. vue.createVNode(_component_uni_forms_item, {
  13277. label: "复称重量",
  13278. name: "weight"
  13279. }, {
  13280. default: vue.withCtx(() => [
  13281. vue.createVNode(_component_uni_easyinput, {
  13282. modelValue: $setup.valiFormData.weight,
  13283. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.weight = $event),
  13284. placeholder: "请输入复称重量",
  13285. oninput: "value=value.replace(/[^\\d.]/g,'').replace(/^\\./g, '').replace(/\\.{2,}/g, '').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').match(/^\\d*(\\.?\\d{0,2})/g)[0] || null"
  13286. }, {
  13287. right: vue.withCtx(() => [
  13288. vue.createElementVNode("view", { class: "weight-right" }, "KG")
  13289. ]),
  13290. _: 1
  13291. /* STABLE */
  13292. }, 8, ["modelValue"])
  13293. ]),
  13294. _: 1
  13295. /* STABLE */
  13296. }),
  13297. vue.createCommentVNode(" <text class='weight-tip'>复称重量作用是确保句惠完整,防止工作人员计费称車后进行的其他操作引起的物品丢失问题</text> "),
  13298. vue.createCommentVNode(' <uni-section title="绑定批托盘号" type="line" padding style="height: calc(100vh - 100px)"> '),
  13299. vue.createVNode(_component_uni_forms_item, {
  13300. label: "绑定批次号",
  13301. name: "batchNum",
  13302. class: "select-item"
  13303. }, {
  13304. default: vue.withCtx(() => [
  13305. !$setup.editBatchNum ? (vue.openBlock(), vue.createBlock(_component_uni_data_select, {
  13306. key: 0,
  13307. modelValue: $setup.valiFormData.batchNum,
  13308. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.valiFormData.batchNum = $event),
  13309. placeholder: "请选择批次号",
  13310. localdata: $setup.options.batch,
  13311. clear: false
  13312. }, null, 8, ["modelValue", "localdata"])) : vue.createCommentVNode("v-if", true),
  13313. $setup.editBatchNum ? (vue.openBlock(), vue.createBlock(_component_uni_easyinput, {
  13314. key: 1,
  13315. value: $setup.batchNum,
  13316. disabled: $setup.editBatchNum
  13317. }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
  13318. !$setup.editBatchNum ? (vue.openBlock(), vue.createElementBlock("button", {
  13319. key: 2,
  13320. type: "primary",
  13321. onClick: $setup.submitBatchNum
  13322. }, "确认")) : vue.createCommentVNode("v-if", true),
  13323. $setup.editBatchNum ? (vue.openBlock(), vue.createElementBlock("button", {
  13324. key: 3,
  13325. type: "primary",
  13326. onClick: _cache[3] || (_cache[3] = ($event) => $setup.editBatchNum = false)
  13327. }, "修改")) : vue.createCommentVNode("v-if", true)
  13328. ]),
  13329. _: 1
  13330. /* STABLE */
  13331. }),
  13332. vue.createVNode(_component_uni_forms_item, {
  13333. label: "绑定托盘号",
  13334. name: "palletNum",
  13335. class: "select-item"
  13336. }, {
  13337. default: vue.withCtx(() => [
  13338. !$setup.editPalletNum ? (vue.openBlock(), vue.createBlock(_component_uni_data_picker, {
  13339. key: 0,
  13340. placeholder: "请选择托盘号",
  13341. "popup-title": "绑定托盘号",
  13342. localdata: $setup.options.pallet,
  13343. modelValue: $setup.valiFormData.palletNum,
  13344. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.valiFormData.palletNum = $event),
  13345. onChange: $setup.onchange,
  13346. onNodeclick: $setup.onnodeclick,
  13347. onPopupopened: $setup.onpopupopened,
  13348. onPopupclosed: $setup.onpopupclosed
  13349. }, null, 8, ["localdata", "modelValue"])) : vue.createCommentVNode("v-if", true),
  13350. $setup.editPalletNum ? (vue.openBlock(), vue.createBlock(_component_uni_easyinput, {
  13351. key: 1,
  13352. value: $setup.palletNum,
  13353. disabled: $setup.editPalletNum
  13354. }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
  13355. !$setup.editPalletNum ? (vue.openBlock(), vue.createElementBlock("button", {
  13356. key: 2,
  13357. type: "primary",
  13358. onClick: $setup.submitPalletNum
  13359. }, "确认")) : vue.createCommentVNode("v-if", true),
  13360. $setup.editPalletNum ? (vue.openBlock(), vue.createElementBlock("button", {
  13361. key: 3,
  13362. type: "primary",
  13363. onClick: _cache[5] || (_cache[5] = ($event) => $setup.editPalletNum = false)
  13364. }, "修改")) : vue.createCommentVNode("v-if", true)
  13365. ]),
  13366. _: 1
  13367. /* STABLE */
  13368. }),
  13369. vue.createCommentVNode(" </uni-section> ")
  13370. ]),
  13371. _: 1
  13372. /* STABLE */
  13373. }, 8, ["rules", "modelValue"]),
  13374. vue.createElementVNode("view", { class: "button-group" }, [
  13375. vue.createElementVNode("button", {
  13376. type: "info",
  13377. onClick: $setup.reset
  13378. }, "重置"),
  13379. vue.createElementVNode("button", {
  13380. type: "default",
  13381. onClick: $setup.checkOrder,
  13382. loading: $setup.loading
  13383. }, [
  13384. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  13385. key: 0,
  13386. type: "search",
  13387. size: "18"
  13388. })) : vue.createCommentVNode("v-if", true),
  13389. vue.createTextVNode(" 查看运单 ")
  13390. ], 8, ["loading"]),
  13391. vue.createElementVNode("button", {
  13392. type: "primary",
  13393. onClick: $setup.onsubmit,
  13394. loading: $setup.loading
  13395. }, [
  13396. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  13397. key: 0,
  13398. type: "checkmarkempty",
  13399. size: "18",
  13400. color: "white"
  13401. })) : vue.createCommentVNode("v-if", true),
  13402. vue.createTextVNode(" 提交 ")
  13403. ], 8, ["loading"])
  13404. ]),
  13405. $setup.lotnoLogHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  13406. key: 0,
  13407. class: "history"
  13408. }, [
  13409. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  13410. ])) : vue.createCommentVNode("v-if", true),
  13411. vue.createElementVNode("view", { class: "history" }, [
  13412. (vue.openBlock(true), vue.createElementBlock(
  13413. vue.Fragment,
  13414. null,
  13415. vue.renderList($setup.lotnoLogHistory.slice(0, 5), (item, i2) => {
  13416. return vue.openBlock(), vue.createElementBlock("view", {
  13417. class: "item",
  13418. key: i2
  13419. }, [
  13420. vue.createElementVNode(
  13421. "text",
  13422. { class: "type" },
  13423. vue.toDisplayString(item.type),
  13424. 1
  13425. /* TEXT */
  13426. ),
  13427. vue.createElementVNode(
  13428. "text",
  13429. {
  13430. class: "code",
  13431. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  13432. },
  13433. vue.toDisplayString(item.orderNum),
  13434. 5
  13435. /* TEXT, STYLE */
  13436. ),
  13437. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  13438. key: 0,
  13439. type: "checkmarkempty",
  13440. class: "status",
  13441. size: "16",
  13442. color: "green"
  13443. })) : (vue.openBlock(), vue.createElementBlock("text", {
  13444. key: 1,
  13445. class: "status fail"
  13446. }, "F")),
  13447. vue.createElementVNode(
  13448. "text",
  13449. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  13450. vue.toDisplayString("\r\n" + item.createTime),
  13451. 1
  13452. /* TEXT */
  13453. )
  13454. ]);
  13455. }),
  13456. 128
  13457. /* KEYED_FRAGMENT */
  13458. ))
  13459. ]),
  13460. vue.createVNode(
  13461. _component_uni_popup,
  13462. {
  13463. ref: "messageRef",
  13464. type: "message"
  13465. },
  13466. {
  13467. default: vue.withCtx(() => [
  13468. vue.createVNode(_component_uni_popup_message, {
  13469. type: $setup.messageType,
  13470. message: $setup.messageText,
  13471. duration: 2e3
  13472. }, null, 8, ["type", "message"])
  13473. ]),
  13474. _: 1
  13475. /* STABLE */
  13476. },
  13477. 512
  13478. /* NEED_PATCH */
  13479. )
  13480. ]);
  13481. }
  13482. const PagesScanLotnoIndex = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f], ["__file", "E:/HBuilderProjects/yta/pages/scanLotno/index.vue"]]);
  13483. const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
  13484. __name: "lotnoLog",
  13485. setup(__props, { expose: __expose }) {
  13486. __expose();
  13487. const lotnoLogHistory = vue.ref([]);
  13488. const getHistory = () => {
  13489. lotnoLogHistory.value = uni.getStorageSync("lotnoLogHistory");
  13490. };
  13491. onLoad(() => {
  13492. getHistory();
  13493. });
  13494. const __returned__ = { lotnoLogHistory, getHistory };
  13495. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  13496. return __returned__;
  13497. }
  13498. });
  13499. function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
  13500. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  13501. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  13502. (vue.openBlock(true), vue.createElementBlock(
  13503. vue.Fragment,
  13504. null,
  13505. vue.renderList($setup.lotnoLogHistory, (item, i2) => {
  13506. return vue.openBlock(), vue.createElementBlock("view", {
  13507. class: "item",
  13508. key: i2
  13509. }, [
  13510. vue.createElementVNode(
  13511. "text",
  13512. { class: "type" },
  13513. vue.toDisplayString(item.type),
  13514. 1
  13515. /* TEXT */
  13516. ),
  13517. vue.createElementVNode(
  13518. "text",
  13519. {
  13520. class: "code",
  13521. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  13522. },
  13523. vue.toDisplayString(item.orderNum),
  13524. 5
  13525. /* TEXT, STYLE */
  13526. ),
  13527. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  13528. key: 0,
  13529. type: "checkmarkempty",
  13530. class: "status",
  13531. size: "16",
  13532. color: "green"
  13533. })) : (vue.openBlock(), vue.createElementBlock("text", {
  13534. key: 1,
  13535. class: "status fail"
  13536. }, "F")),
  13537. vue.createElementVNode(
  13538. "text",
  13539. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  13540. vue.toDisplayString("\r\n" + item.createTime),
  13541. 1
  13542. /* TEXT */
  13543. )
  13544. ]);
  13545. }),
  13546. 128
  13547. /* KEYED_FRAGMENT */
  13548. )),
  13549. $setup.lotnoLogHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  13550. key: 0,
  13551. class: "is-empty"
  13552. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  13553. ]);
  13554. }
  13555. const PagesScanLotnoLotnoLog = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e], ["__scopeId", "data-v-d86d23fe"], ["__file", "E:/HBuilderProjects/yta/pages/scanLotno/lotnoLog.vue"]]);
  13556. const _sfc_main$e = {
  13557. name: "UniSection",
  13558. emits: ["click"],
  13559. props: {
  13560. type: {
  13561. type: String,
  13562. default: ""
  13563. },
  13564. title: {
  13565. type: String,
  13566. required: true,
  13567. default: ""
  13568. },
  13569. titleFontSize: {
  13570. type: String,
  13571. default: "14px"
  13572. },
  13573. titleColor: {
  13574. type: String,
  13575. default: "#333"
  13576. },
  13577. subTitle: {
  13578. type: String,
  13579. default: ""
  13580. },
  13581. subTitleFontSize: {
  13582. type: String,
  13583. default: "12px"
  13584. },
  13585. subTitleColor: {
  13586. type: String,
  13587. default: "#999"
  13588. },
  13589. padding: {
  13590. type: [Boolean, String],
  13591. default: false
  13592. }
  13593. },
  13594. computed: {
  13595. _padding() {
  13596. if (typeof this.padding === "string") {
  13597. return this.padding;
  13598. }
  13599. return this.padding ? "10px" : "";
  13600. }
  13601. },
  13602. watch: {
  13603. title(newVal) {
  13604. if (uni.report && newVal !== "") {
  13605. uni.report("title", newVal);
  13606. }
  13607. }
  13608. },
  13609. methods: {
  13610. onClick() {
  13611. this.$emit("click");
  13612. }
  13613. }
  13614. };
  13615. function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
  13616. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-section" }, [
  13617. vue.createElementVNode("view", {
  13618. class: "uni-section-header",
  13619. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  13620. }, [
  13621. $props.type ? (vue.openBlock(), vue.createElementBlock(
  13622. "view",
  13623. {
  13624. key: 0,
  13625. class: vue.normalizeClass(["uni-section-header__decoration", $props.type])
  13626. },
  13627. null,
  13628. 2
  13629. /* CLASS */
  13630. )) : vue.renderSlot(_ctx.$slots, "decoration", { key: 1 }, void 0, true),
  13631. vue.createElementVNode("view", { class: "uni-section-header__content" }, [
  13632. vue.createElementVNode(
  13633. "text",
  13634. {
  13635. style: vue.normalizeStyle({ "font-size": $props.titleFontSize, "color": $props.titleColor }),
  13636. class: vue.normalizeClass(["uni-section__content-title", { "distraction": !$props.subTitle }])
  13637. },
  13638. vue.toDisplayString($props.title),
  13639. 7
  13640. /* TEXT, CLASS, STYLE */
  13641. ),
  13642. $props.subTitle ? (vue.openBlock(), vue.createElementBlock(
  13643. "text",
  13644. {
  13645. key: 0,
  13646. style: vue.normalizeStyle({ "font-size": $props.subTitleFontSize, "color": $props.subTitleColor }),
  13647. class: "uni-section-header__content-sub"
  13648. },
  13649. vue.toDisplayString($props.subTitle),
  13650. 5
  13651. /* TEXT, STYLE */
  13652. )) : vue.createCommentVNode("v-if", true)
  13653. ]),
  13654. vue.createElementVNode("view", { class: "uni-section-header__slot-right" }, [
  13655. vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
  13656. ])
  13657. ]),
  13658. vue.createElementVNode(
  13659. "view",
  13660. {
  13661. class: "uni-section-content",
  13662. style: vue.normalizeStyle({ padding: $options._padding })
  13663. },
  13664. [
  13665. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  13666. ],
  13667. 4
  13668. /* STYLE */
  13669. )
  13670. ]);
  13671. }
  13672. const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d], ["__scopeId", "data-v-637fd36b"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-section/components/uni-section/uni-section.vue"]]);
  13673. const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
  13674. __name: "waybillsList",
  13675. setup(__props, { expose: __expose }) {
  13676. __expose();
  13677. const waybills = vue.ref([]);
  13678. const getHistory = () => {
  13679. waybills.value = uni.getStorageSync("waybills");
  13680. };
  13681. onLoad(() => {
  13682. getHistory();
  13683. });
  13684. const __returned__ = { waybills, getHistory };
  13685. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  13686. return __returned__;
  13687. }
  13688. });
  13689. function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
  13690. const _component_uni_section = resolveEasycom(vue.resolveDynamicComponent("uni-section"), __easycom_0$1);
  13691. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  13692. vue.createVNode(_component_uni_section, {
  13693. title: "数量: " + $setup.waybills.length
  13694. }, null, 8, ["title"]),
  13695. (vue.openBlock(true), vue.createElementBlock(
  13696. vue.Fragment,
  13697. null,
  13698. vue.renderList($setup.waybills, (item, i2) => {
  13699. return vue.openBlock(), vue.createElementBlock("view", {
  13700. class: "item",
  13701. key: i2
  13702. }, [
  13703. vue.createElementVNode(
  13704. "text",
  13705. {
  13706. class: "code",
  13707. style: { color: "#666" }
  13708. },
  13709. vue.toDisplayString(item.order_box_no),
  13710. 1
  13711. /* TEXT */
  13712. ),
  13713. vue.createElementVNode(
  13714. "text",
  13715. { class: "type" },
  13716. "重量: " + vue.toDisplayString(item.weight) + "KG",
  13717. 1
  13718. /* TEXT */
  13719. ),
  13720. vue.createElementVNode("view", { class: "sub-items" }, [
  13721. vue.createElementVNode("view", { class: "sub-item" }, [
  13722. vue.createElementVNode("text", { class: "type" }, "批次/船航/托盘"),
  13723. vue.createElementVNode(
  13724. "text",
  13725. { class: "type" },
  13726. vue.toDisplayString(item.batch_shipping_pallet),
  13727. 1
  13728. /* TEXT */
  13729. )
  13730. ]),
  13731. vue.createElementVNode("view", { class: "sub-item" }, [
  13732. vue.createElementVNode("text", { class: "type" }, "末公里运单号"),
  13733. vue.createElementVNode(
  13734. "text",
  13735. { class: "type" },
  13736. vue.toDisplayString(item.tracking_number || "无"),
  13737. 1
  13738. /* TEXT */
  13739. )
  13740. ])
  13741. ])
  13742. ]);
  13743. }),
  13744. 128
  13745. /* KEYED_FRAGMENT */
  13746. )),
  13747. $setup.waybills.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  13748. key: 0,
  13749. class: "is-empty"
  13750. }, "暂无运单")) : vue.createCommentVNode("v-if", true)
  13751. ]);
  13752. }
  13753. const PagesScanLotnoWaybillsList = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c], ["__scopeId", "data-v-ef3fda20"], ["__file", "E:/HBuilderProjects/yta/pages/scanLotno/waybillsList.vue"]]);
  13754. const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
  13755. __name: "index",
  13756. setup(__props, { expose: __expose }) {
  13757. __expose();
  13758. const token = vue.ref();
  13759. const loading = vue.ref(false);
  13760. const hidePage = vue.ref(false);
  13761. const focusType = vue.ref(true);
  13762. const warehouseLogHistory = vue.ref([]);
  13763. const messageRef = vue.ref();
  13764. const messageType = vue.ref();
  13765. const messageText = vue.ref();
  13766. let st2;
  13767. const valiFormData = vue.ref({
  13768. order_code: ""
  13769. });
  13770. const rules = vue.reactive({
  13771. order_code: {
  13772. rules: [
  13773. {
  13774. required: true,
  13775. errorMessage: "单据编号不能为空"
  13776. }
  13777. ]
  13778. }
  13779. });
  13780. const checkPermission = async () => {
  13781. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  13782. if (status === null || status === 1) {
  13783. status = 1;
  13784. } else {
  13785. uni.showModal({
  13786. content: "Camera permission required",
  13787. confirmText: "Setting",
  13788. success: function(res) {
  13789. if (res.confirm) {
  13790. permission.gotoAppSetting();
  13791. }
  13792. }
  13793. });
  13794. }
  13795. return status;
  13796. };
  13797. const scanInput = async () => {
  13798. let status = await checkPermission();
  13799. if (status !== 1) {
  13800. return;
  13801. }
  13802. uni.scanCode({
  13803. success: (res) => {
  13804. valiFormData.value.order_code = res.result;
  13805. onsubmit();
  13806. },
  13807. fail: (err) => {
  13808. }
  13809. });
  13810. };
  13811. const reset = () => {
  13812. loading.value = false;
  13813. valiFormData.value.order_code = "";
  13814. };
  13815. const setfocus = () => {
  13816. if (hidePage.value) {
  13817. return;
  13818. }
  13819. focusType.value = false;
  13820. vue.nextTick(() => {
  13821. focusType.value = true;
  13822. });
  13823. };
  13824. const onsubmit = () => {
  13825. st2 && clearTimeout(st2);
  13826. loading.value = true;
  13827. uni.request({
  13828. url: warehouseScanURL,
  13829. method: "POST",
  13830. header: {
  13831. batoken: token.value
  13832. },
  13833. data: {
  13834. order_code: valiFormData.value.order_code
  13835. },
  13836. success: (res) => {
  13837. loading.value = false;
  13838. if (res.data.code == 1) {
  13839. messageType.value = "success";
  13840. messageText.value = res.data.msg;
  13841. messageRef.value.open();
  13842. const historyItem = {
  13843. order_code: valiFormData.value.order_code,
  13844. createTime: /* @__PURE__ */ new Date(),
  13845. type: "单据扫描",
  13846. status: true
  13847. };
  13848. warehouseLogHistory.value.unshift(historyItem);
  13849. uni.setStorageSync("warehouseLogHistory", warehouseLogHistory.value);
  13850. getHistory();
  13851. } else {
  13852. messageType.value = "error";
  13853. messageText.value = res.data.msg;
  13854. messageRef.value.open();
  13855. const historyItem = {
  13856. order_code: valiFormData.value.order_code,
  13857. createTime: /* @__PURE__ */ new Date(),
  13858. type: "单据扫描",
  13859. status: false
  13860. };
  13861. warehouseLogHistory.value.unshift(historyItem);
  13862. uni.setStorageSync("warehouseLogHistory", warehouseLogHistory.value);
  13863. getHistory();
  13864. }
  13865. st2 = setTimeout(() => {
  13866. reset();
  13867. st2 && clearTimeout(st2);
  13868. }, 1e3);
  13869. }
  13870. });
  13871. };
  13872. const getHistory = () => {
  13873. warehouseLogHistory.value = uni.getStorageSync("warehouseLogHistory") || [];
  13874. };
  13875. const keypress = (e2) => {
  13876. formatAppLog("log", "at pages/warehouseScan/index.vue:179", e2, "按键码");
  13877. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  13878. ;
  13879. if (e2.keyCode == 66) {
  13880. onsubmit();
  13881. }
  13882. };
  13883. onLoad(() => {
  13884. plus.key.addEventListener("keyup", keypress);
  13885. });
  13886. onUnload(() => {
  13887. plus.key.removeEventListener("keyup", keypress);
  13888. });
  13889. onHide(() => {
  13890. hidePage.value = true;
  13891. plus.key.removeEventListener("keyup", keypress);
  13892. });
  13893. onBackPress(() => {
  13894. plus.key.removeEventListener("keyup", keypress);
  13895. });
  13896. onShow(() => {
  13897. token.value = uni.getStorageSync("token");
  13898. hidePage.value = false;
  13899. getHistory();
  13900. });
  13901. onNavigationBarButtonTap((event) => {
  13902. if (event.index === 0) {
  13903. uni.navigateTo({
  13904. url: "/pages/warehouseScan/warehouseLog"
  13905. });
  13906. }
  13907. });
  13908. const __returned__ = { token, loading, hidePage, focusType, warehouseLogHistory, messageRef, messageType, messageText, get st() {
  13909. return st2;
  13910. }, set st(v2) {
  13911. st2 = v2;
  13912. }, valiFormData, rules, checkPermission, scanInput, reset, setfocus, onsubmit, getHistory, keypress };
  13913. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  13914. return __returned__;
  13915. }
  13916. });
  13917. function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
  13918. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  13919. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  13920. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  13921. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  13922. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  13923. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  13924. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  13925. vue.createVNode(_component_uni_forms, {
  13926. ref: "valiForm",
  13927. "label-align": "right",
  13928. "label-width": 80,
  13929. rules: $setup.rules,
  13930. modelValue: $setup.valiFormData
  13931. }, {
  13932. default: vue.withCtx(() => [
  13933. vue.createVNode(_component_uni_forms_item, {
  13934. label: "单据编号",
  13935. required: "",
  13936. name: "order_code"
  13937. }, {
  13938. default: vue.withCtx(() => [
  13939. vue.createVNode(_component_uni_easyinput, {
  13940. modelValue: $setup.valiFormData.order_code,
  13941. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.order_code = $event),
  13942. placeholder: "请输入单据编号",
  13943. suffixIcon: "scan",
  13944. focus: $setup.focusType,
  13945. onIconClick: $setup.scanInput,
  13946. onBlur: $setup.setfocus,
  13947. onConfirm: $setup.onsubmit
  13948. }, null, 8, ["modelValue", "focus"])
  13949. ]),
  13950. _: 1
  13951. /* STABLE */
  13952. })
  13953. ]),
  13954. _: 1
  13955. /* STABLE */
  13956. }, 8, ["rules", "modelValue"]),
  13957. vue.createElementVNode("view", { class: "button-group" }, [
  13958. vue.createElementVNode("button", {
  13959. type: "info",
  13960. onClick: $setup.reset
  13961. }, "重置"),
  13962. vue.createElementVNode("button", {
  13963. type: "primary",
  13964. onClick: $setup.onsubmit,
  13965. loading: $setup.loading
  13966. }, [
  13967. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  13968. key: 0,
  13969. type: "checkmarkempty",
  13970. size: "18",
  13971. color: "white"
  13972. })) : vue.createCommentVNode("v-if", true),
  13973. vue.createTextVNode(" 提交 ")
  13974. ], 8, ["loading"])
  13975. ]),
  13976. $setup.warehouseLogHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  13977. key: 0,
  13978. class: "history"
  13979. }, [
  13980. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  13981. ])) : vue.createCommentVNode("v-if", true),
  13982. vue.createElementVNode("view", { class: "history" }, [
  13983. (vue.openBlock(true), vue.createElementBlock(
  13984. vue.Fragment,
  13985. null,
  13986. vue.renderList($setup.warehouseLogHistory.slice(0, 5), (item, i2) => {
  13987. return vue.openBlock(), vue.createElementBlock("view", {
  13988. class: "item",
  13989. key: i2
  13990. }, [
  13991. vue.createElementVNode(
  13992. "text",
  13993. {
  13994. class: "code",
  13995. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  13996. },
  13997. vue.toDisplayString(item.order_code),
  13998. 5
  13999. /* TEXT, STYLE */
  14000. ),
  14001. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  14002. key: 0,
  14003. type: "checkmarkempty",
  14004. class: "status",
  14005. size: "16",
  14006. color: "green"
  14007. })) : (vue.openBlock(), vue.createElementBlock("text", {
  14008. key: 1,
  14009. class: "status fail"
  14010. }, "F")),
  14011. vue.createElementVNode(
  14012. "text",
  14013. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  14014. vue.toDisplayString("\r\n" + item.createTime),
  14015. 1
  14016. /* TEXT */
  14017. )
  14018. ]);
  14019. }),
  14020. 128
  14021. /* KEYED_FRAGMENT */
  14022. ))
  14023. ]),
  14024. vue.createVNode(
  14025. _component_uni_popup,
  14026. {
  14027. ref: "messageRef",
  14028. type: "message"
  14029. },
  14030. {
  14031. default: vue.withCtx(() => [
  14032. vue.createVNode(_component_uni_popup_message, {
  14033. type: $setup.messageType,
  14034. message: $setup.messageText,
  14035. duration: 2e3
  14036. }, null, 8, ["type", "message"])
  14037. ]),
  14038. _: 1
  14039. /* STABLE */
  14040. },
  14041. 512
  14042. /* NEED_PATCH */
  14043. )
  14044. ]);
  14045. }
  14046. const PagesWarehouseScanIndex = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b], ["__scopeId", "data-v-c64ca80c"], ["__file", "E:/HBuilderProjects/yta/pages/warehouseScan/index.vue"]]);
  14047. const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
  14048. __name: "warehouseLog",
  14049. setup(__props, { expose: __expose }) {
  14050. __expose();
  14051. const warehouseLogHistory = vue.ref([]);
  14052. const getHistory = () => {
  14053. warehouseLogHistory.value = uni.getStorageSync("warehouseLogHistory");
  14054. };
  14055. onLoad(() => {
  14056. getHistory();
  14057. });
  14058. const __returned__ = { warehouseLogHistory, getHistory };
  14059. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  14060. return __returned__;
  14061. }
  14062. });
  14063. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  14064. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  14065. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  14066. (vue.openBlock(true), vue.createElementBlock(
  14067. vue.Fragment,
  14068. null,
  14069. vue.renderList($setup.warehouseLogHistory, (item, i2) => {
  14070. return vue.openBlock(), vue.createElementBlock("view", {
  14071. class: "item",
  14072. key: i2
  14073. }, [
  14074. vue.createElementVNode(
  14075. "text",
  14076. { class: "type" },
  14077. vue.toDisplayString(item.type),
  14078. 1
  14079. /* TEXT */
  14080. ),
  14081. vue.createElementVNode(
  14082. "text",
  14083. {
  14084. class: "code",
  14085. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  14086. },
  14087. vue.toDisplayString(item.order_code),
  14088. 5
  14089. /* TEXT, STYLE */
  14090. ),
  14091. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  14092. key: 0,
  14093. type: "checkmarkempty",
  14094. class: "status",
  14095. size: "16",
  14096. color: "green"
  14097. })) : (vue.openBlock(), vue.createElementBlock("text", {
  14098. key: 1,
  14099. class: "status fail"
  14100. }, "F")),
  14101. vue.createElementVNode(
  14102. "text",
  14103. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  14104. vue.toDisplayString("\r\n" + item.createTime),
  14105. 1
  14106. /* TEXT */
  14107. )
  14108. ]);
  14109. }),
  14110. 128
  14111. /* KEYED_FRAGMENT */
  14112. )),
  14113. $setup.warehouseLogHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  14114. key: 0,
  14115. class: "is-empty"
  14116. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  14117. ]);
  14118. }
  14119. const PagesWarehouseScanWarehouseLog = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a], ["__scopeId", "data-v-dadaa086"], ["__file", "E:/HBuilderProjects/yta/pages/warehouseScan/warehouseLog.vue"]]);
  14120. const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
  14121. __name: "index",
  14122. setup(__props, { expose: __expose }) {
  14123. __expose();
  14124. const token = vue.ref();
  14125. const editSpaceNo = vue.ref(false);
  14126. const loading = vue.ref(false);
  14127. const hidePage = vue.ref(false);
  14128. const focusType = vue.ref(true);
  14129. const waybillNoHistory = vue.ref([]);
  14130. const messageRef = vue.ref();
  14131. const messageType = vue.ref();
  14132. const messageText = vue.ref();
  14133. let st2;
  14134. const valiFormData = vue.ref({
  14135. code: "",
  14136. space_id: ""
  14137. });
  14138. const rules = vue.reactive({
  14139. code: {
  14140. rules: [
  14141. {
  14142. required: true,
  14143. errorMessage: "单号不能为空"
  14144. }
  14145. ]
  14146. }
  14147. });
  14148. const options = vue.reactive({
  14149. space: []
  14150. });
  14151. const checkPermission = async () => {
  14152. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  14153. if (status === null || status === 1) {
  14154. status = 1;
  14155. } else {
  14156. uni.showModal({
  14157. content: "Camera permission required",
  14158. confirmText: "Setting",
  14159. success: function(res) {
  14160. if (res.confirm) {
  14161. permission.gotoAppSetting();
  14162. }
  14163. }
  14164. });
  14165. }
  14166. return status;
  14167. };
  14168. const scanInput = async () => {
  14169. let status = await checkPermission();
  14170. if (status !== 1) {
  14171. return;
  14172. }
  14173. uni.scanCode({
  14174. success: (res) => {
  14175. valiFormData.value.code = res.result;
  14176. },
  14177. fail: (err) => {
  14178. }
  14179. });
  14180. };
  14181. const reset = () => {
  14182. loading.value = false;
  14183. valiFormData.value.code = "";
  14184. };
  14185. const submitSpace = () => {
  14186. if (valiFormData.value.space_id) {
  14187. editSpaceNo.value = true;
  14188. setFocus();
  14189. } else {
  14190. messageType.value = "error";
  14191. messageText.value = "请选择库位";
  14192. messageRef.value.open();
  14193. }
  14194. };
  14195. const space = vue.computed(() => {
  14196. const res = options.space.find((item) => item.value === valiFormData.value.space_id);
  14197. return res == null ? void 0 : res.text;
  14198. });
  14199. const findPalletNumIdByValue = (data, targetValue) => {
  14200. for (let i2 = 0; i2 < data.length; i2++) {
  14201. const item = data[i2];
  14202. if (item.id === targetValue || item.value === targetValue) {
  14203. return [item.id];
  14204. } else if (item.children && item.children.length > 0) {
  14205. const childId = findPalletNumIdByValue(item.children, targetValue);
  14206. if (childId !== null) {
  14207. return childId;
  14208. }
  14209. }
  14210. }
  14211. return null;
  14212. };
  14213. const onsubmit = () => {
  14214. if (valiFormData.value.space_id && valiFormData.value.code) {
  14215. st2 && clearTimeout(st2);
  14216. loading.value = true;
  14217. uni.request({
  14218. url: addWaybillNoURL,
  14219. method: "POST",
  14220. header: {
  14221. batoken: token.value
  14222. },
  14223. data: {
  14224. code: valiFormData.value.code,
  14225. space_id: valiFormData.value.space_id
  14226. },
  14227. success: (res) => {
  14228. loading.value = false;
  14229. const space2 = options.space.find((item) => item.value === valiFormData.value.space_id);
  14230. if (res.data.code == 1) {
  14231. messageType.value = "success";
  14232. messageText.value = res.data.msg;
  14233. messageRef.value.open();
  14234. const historyItem = {
  14235. code: valiFormData.value.code,
  14236. createTime: /* @__PURE__ */ new Date(),
  14237. type: "运单号",
  14238. space: space2.text,
  14239. status: true
  14240. };
  14241. waybillNoHistory.value.unshift(historyItem);
  14242. uni.setStorageSync("waybillNoHistory", waybillNoHistory.value);
  14243. getHistory();
  14244. } else {
  14245. messageType.value = "error";
  14246. messageText.value = res.data.msg;
  14247. messageRef.value.open();
  14248. const historyItem = {
  14249. code: valiFormData.value.code,
  14250. createTime: /* @__PURE__ */ new Date(),
  14251. type: "运单号",
  14252. space: space2.text,
  14253. status: false
  14254. };
  14255. waybillNoHistory.value.unshift(historyItem);
  14256. uni.setStorageSync("waybillNoHistory", waybillNoHistory.value);
  14257. getHistory();
  14258. }
  14259. st2 = setTimeout(() => {
  14260. reset();
  14261. setFocus();
  14262. st2 && clearTimeout(st2);
  14263. }, 1e3);
  14264. }
  14265. });
  14266. } else {
  14267. if (!valiFormData.value.space_id) {
  14268. messageType.value = "error";
  14269. messageText.value = "请选择库位";
  14270. messageRef.value.open();
  14271. }
  14272. if (!valiFormData.value.code) {
  14273. messageType.value = "error";
  14274. messageText.value = "请填写运单号";
  14275. messageRef.value.open();
  14276. }
  14277. }
  14278. };
  14279. const getHistory = () => {
  14280. waybillNoHistory.value = uni.getStorageSync("waybillNoHistory") || [];
  14281. };
  14282. const keypress = (e2) => {
  14283. formatAppLog("log", "at pages/waybillNo/index.vue:240", e2, "按键码");
  14284. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  14285. ;
  14286. if (e2.keyCode == 66) {
  14287. onsubmit();
  14288. }
  14289. };
  14290. onLoad(() => {
  14291. plus.key.addEventListener("keyup", keypress);
  14292. });
  14293. onUnload(() => {
  14294. plus.key.removeEventListener("keyup", keypress);
  14295. });
  14296. onHide(() => {
  14297. hidePage.value = true;
  14298. plus.key.removeEventListener("keyup", keypress);
  14299. });
  14300. onBackPress(() => {
  14301. plus.key.removeEventListener("keyup", keypress);
  14302. });
  14303. onShow(() => {
  14304. hidePage.value = false;
  14305. token.value = uni.getStorageSync("token");
  14306. getOptions();
  14307. getHistory();
  14308. });
  14309. const getOptions = () => {
  14310. uni.request({
  14311. url: waybillNoOptions,
  14312. method: "GET",
  14313. header: {
  14314. batoken: token.value
  14315. },
  14316. success: (res) => {
  14317. formatAppLog("log", "at pages/waybillNo/index.vue:300", res);
  14318. if (res.data.code === 1) {
  14319. for (let key in res.data.data.space_id) {
  14320. if (res.data.data.space_id.hasOwnProperty(key)) {
  14321. options.space.push({ text: res.data.data.space_id[key], value: key });
  14322. }
  14323. }
  14324. }
  14325. },
  14326. fail(e2) {
  14327. formatAppLog("log", "at pages/waybillNo/index.vue:310", "fail--", e2);
  14328. }
  14329. });
  14330. };
  14331. const setFocus = () => {
  14332. if (hidePage.value) {
  14333. return;
  14334. }
  14335. focusType.value = false;
  14336. vue.nextTick(() => {
  14337. focusType.value = true;
  14338. });
  14339. };
  14340. onNavigationBarButtonTap((event) => {
  14341. if (event.index === 0) {
  14342. uni.navigateTo({
  14343. url: "/pages/waybillNo/waybillNoLog"
  14344. });
  14345. }
  14346. });
  14347. const __returned__ = { token, editSpaceNo, loading, hidePage, focusType, waybillNoHistory, messageRef, messageType, messageText, get st() {
  14348. return st2;
  14349. }, set st(v2) {
  14350. st2 = v2;
  14351. }, valiFormData, rules, options, checkPermission, scanInput, reset, submitSpace, space, findPalletNumIdByValue, onsubmit, getHistory, keypress, getOptions, setFocus };
  14352. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  14353. return __returned__;
  14354. }
  14355. });
  14356. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  14357. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$2);
  14358. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  14359. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  14360. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  14361. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  14362. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  14363. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  14364. vue.createVNode(_component_uni_forms, {
  14365. ref: "valiForm",
  14366. "label-align": "right",
  14367. "label-width": 80,
  14368. rules: $setup.rules,
  14369. modelValue: $setup.valiFormData
  14370. }, {
  14371. default: vue.withCtx(() => [
  14372. vue.createElementVNode("view", { class: "space-select" }, [
  14373. !$setup.editSpaceNo ? (vue.openBlock(), vue.createBlock(_component_uni_data_select, {
  14374. key: 0,
  14375. modelValue: $setup.valiFormData.space_id,
  14376. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.space_id = $event),
  14377. placeholder: "请选择库位",
  14378. localdata: $setup.options.space,
  14379. clear: false
  14380. }, null, 8, ["modelValue", "localdata"])) : vue.createCommentVNode("v-if", true),
  14381. $setup.editSpaceNo ? (vue.openBlock(), vue.createBlock(_component_uni_easyinput, {
  14382. key: 1,
  14383. value: $setup.space,
  14384. disabled: $setup.editSpaceNo
  14385. }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
  14386. !$setup.editSpaceNo ? (vue.openBlock(), vue.createElementBlock("button", {
  14387. key: 2,
  14388. type: "primary",
  14389. onClick: $setup.submitSpace
  14390. }, "确认")) : vue.createCommentVNode("v-if", true),
  14391. $setup.editSpaceNo ? (vue.openBlock(), vue.createElementBlock("button", {
  14392. key: 3,
  14393. type: "primary",
  14394. onClick: _cache[1] || (_cache[1] = ($event) => $setup.editSpaceNo = false)
  14395. }, "修改")) : vue.createCommentVNode("v-if", true)
  14396. ]),
  14397. vue.createElementVNode("view", null, [
  14398. vue.createVNode(_component_uni_easyinput, {
  14399. modelValue: $setup.valiFormData.code,
  14400. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.valiFormData.code = $event),
  14401. placeholder: "请输入运单号",
  14402. suffixIcon: "scan",
  14403. focus: $setup.focusType,
  14404. onIconClick: $setup.scanInput
  14405. }, null, 8, ["modelValue", "focus"])
  14406. ])
  14407. ]),
  14408. _: 1
  14409. /* STABLE */
  14410. }, 8, ["rules", "modelValue"]),
  14411. vue.createElementVNode("view", { class: "button-group" }, [
  14412. vue.createElementVNode("button", {
  14413. type: "info",
  14414. onClick: $setup.reset
  14415. }, "重置"),
  14416. vue.createElementVNode("button", {
  14417. type: "primary",
  14418. onClick: $setup.onsubmit,
  14419. loading: $setup.loading
  14420. }, [
  14421. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  14422. key: 0,
  14423. type: "checkmarkempty",
  14424. size: "18",
  14425. color: "white"
  14426. })) : vue.createCommentVNode("v-if", true),
  14427. vue.createTextVNode(" 提交 ")
  14428. ], 8, ["loading"])
  14429. ]),
  14430. $setup.waybillNoHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  14431. key: 0,
  14432. class: "history"
  14433. }, [
  14434. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  14435. ])) : vue.createCommentVNode("v-if", true),
  14436. vue.createElementVNode("view", { class: "history" }, [
  14437. (vue.openBlock(true), vue.createElementBlock(
  14438. vue.Fragment,
  14439. null,
  14440. vue.renderList($setup.waybillNoHistory.slice(0, 5), (item, i2) => {
  14441. return vue.openBlock(), vue.createElementBlock("view", {
  14442. class: "item",
  14443. key: i2
  14444. }, [
  14445. vue.createElementVNode("view", null, [
  14446. vue.createElementVNode("view", null, [
  14447. vue.createElementVNode("text", { class: "type" }, "库位"),
  14448. vue.createElementVNode(
  14449. "text",
  14450. {
  14451. class: "code",
  14452. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  14453. },
  14454. vue.toDisplayString(item.space),
  14455. 5
  14456. /* TEXT, STYLE */
  14457. )
  14458. ]),
  14459. vue.createElementVNode("view", null, [
  14460. vue.createElementVNode("text", { class: "type" }, "单号"),
  14461. vue.createElementVNode(
  14462. "text",
  14463. {
  14464. class: "code",
  14465. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  14466. },
  14467. vue.toDisplayString(item.code),
  14468. 5
  14469. /* TEXT, STYLE */
  14470. )
  14471. ]),
  14472. vue.createElementVNode("view", { class: "space-time" }, [
  14473. vue.createElementVNode(
  14474. "text",
  14475. null,
  14476. vue.toDisplayString(item.createTime),
  14477. 1
  14478. /* TEXT */
  14479. )
  14480. ])
  14481. ]),
  14482. vue.createElementVNode("view", null, [
  14483. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  14484. key: 0,
  14485. type: "checkmarkempty",
  14486. class: "status",
  14487. size: "16",
  14488. color: "green"
  14489. })) : (vue.openBlock(), vue.createElementBlock("text", {
  14490. key: 1,
  14491. class: "status fail"
  14492. }, "F"))
  14493. ])
  14494. ]);
  14495. }),
  14496. 128
  14497. /* KEYED_FRAGMENT */
  14498. ))
  14499. ]),
  14500. vue.createVNode(
  14501. _component_uni_popup,
  14502. {
  14503. ref: "messageRef",
  14504. type: "message"
  14505. },
  14506. {
  14507. default: vue.withCtx(() => [
  14508. vue.createVNode(_component_uni_popup_message, {
  14509. type: $setup.messageType,
  14510. message: $setup.messageText,
  14511. duration: 2e3
  14512. }, null, 8, ["type", "message"])
  14513. ]),
  14514. _: 1
  14515. /* STABLE */
  14516. },
  14517. 512
  14518. /* NEED_PATCH */
  14519. )
  14520. ]);
  14521. }
  14522. const PagesWaybillNoIndex = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__file", "E:/HBuilderProjects/yta/pages/waybillNo/index.vue"]]);
  14523. const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
  14524. __name: "waybillNoLog",
  14525. setup(__props, { expose: __expose }) {
  14526. __expose();
  14527. const waybillNoHistory = vue.ref([]);
  14528. const getHistory = async () => {
  14529. waybillNoHistory.value = await uni.getStorageSync("waybillNoHistory");
  14530. };
  14531. onLoad(async () => {
  14532. await getHistory();
  14533. });
  14534. const __returned__ = { waybillNoHistory, getHistory };
  14535. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  14536. return __returned__;
  14537. }
  14538. });
  14539. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  14540. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  14541. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  14542. (vue.openBlock(true), vue.createElementBlock(
  14543. vue.Fragment,
  14544. null,
  14545. vue.renderList($setup.waybillNoHistory, (item, i2) => {
  14546. return vue.openBlock(), vue.createElementBlock("view", {
  14547. class: "item",
  14548. key: i2
  14549. }, [
  14550. vue.createElementVNode("view", null, [
  14551. vue.createElementVNode("view", null, [
  14552. vue.createElementVNode("text", { class: "type" }, "库位"),
  14553. vue.createElementVNode(
  14554. "text",
  14555. {
  14556. class: "code",
  14557. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  14558. },
  14559. vue.toDisplayString(item.space),
  14560. 5
  14561. /* TEXT, STYLE */
  14562. )
  14563. ]),
  14564. vue.createElementVNode("view", null, [
  14565. vue.createElementVNode("text", { class: "type" }, "单号"),
  14566. vue.createElementVNode(
  14567. "text",
  14568. {
  14569. class: "code",
  14570. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  14571. },
  14572. vue.toDisplayString(item.code),
  14573. 5
  14574. /* TEXT, STYLE */
  14575. )
  14576. ]),
  14577. vue.createElementVNode("view", { class: "space-time" }, [
  14578. vue.createElementVNode(
  14579. "text",
  14580. null,
  14581. vue.toDisplayString(item.createTime),
  14582. 1
  14583. /* TEXT */
  14584. )
  14585. ])
  14586. ]),
  14587. vue.createElementVNode("view", null, [
  14588. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  14589. key: 0,
  14590. type: "checkmarkempty",
  14591. class: "status",
  14592. size: "16",
  14593. color: "green"
  14594. })) : (vue.openBlock(), vue.createElementBlock("text", {
  14595. key: 1,
  14596. class: "status fail"
  14597. }, "F"))
  14598. ])
  14599. ]);
  14600. }),
  14601. 128
  14602. /* KEYED_FRAGMENT */
  14603. )),
  14604. $setup.waybillNoHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  14605. key: 0,
  14606. class: "is-empty"
  14607. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  14608. ]);
  14609. }
  14610. const PagesWaybillNoWaybillNoLog = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__scopeId", "data-v-2f55e896"], ["__file", "E:/HBuilderProjects/yta/pages/waybillNo/waybillNoLog.vue"]]);
  14611. const _sfc_main$8 = {
  14612. name: "UniDrawer",
  14613. components: {},
  14614. emits: ["change"],
  14615. props: {
  14616. /**
  14617. * 显示模式(左、右),只在初始化生效
  14618. */
  14619. mode: {
  14620. type: String,
  14621. default: ""
  14622. },
  14623. /**
  14624. * 蒙层显示状态
  14625. */
  14626. mask: {
  14627. type: Boolean,
  14628. default: true
  14629. },
  14630. /**
  14631. * 遮罩是否可点击关闭
  14632. */
  14633. maskClick: {
  14634. type: Boolean,
  14635. default: true
  14636. },
  14637. /**
  14638. * 抽屉宽度
  14639. */
  14640. width: {
  14641. type: Number,
  14642. default: 220
  14643. }
  14644. },
  14645. data() {
  14646. return {
  14647. visibleSync: false,
  14648. showDrawer: false,
  14649. rightMode: false,
  14650. watchTimer: null,
  14651. drawerWidth: 220
  14652. };
  14653. },
  14654. created() {
  14655. this.drawerWidth = this.width;
  14656. this.rightMode = this.mode === "right";
  14657. },
  14658. methods: {
  14659. clear() {
  14660. },
  14661. close(type) {
  14662. if (type === "mask" && !this.maskClick || !this.visibleSync)
  14663. return;
  14664. this._change("showDrawer", "visibleSync", false);
  14665. },
  14666. open() {
  14667. if (this.visibleSync)
  14668. return;
  14669. this._change("visibleSync", "showDrawer", true);
  14670. },
  14671. _change(param1, param2, status) {
  14672. this[param1] = status;
  14673. if (this.watchTimer) {
  14674. clearTimeout(this.watchTimer);
  14675. }
  14676. this.watchTimer = setTimeout(() => {
  14677. this[param2] = status;
  14678. this.$emit("change", status);
  14679. }, status ? 50 : 300);
  14680. }
  14681. }
  14682. };
  14683. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  14684. return $data.visibleSync ? (vue.openBlock(), vue.createElementBlock(
  14685. "view",
  14686. {
  14687. key: 0,
  14688. class: vue.normalizeClass([{ "uni-drawer--visible": $data.showDrawer }, "uni-drawer"]),
  14689. onTouchmove: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop", "prevent"]))
  14690. },
  14691. [
  14692. vue.createElementVNode(
  14693. "view",
  14694. {
  14695. class: vue.normalizeClass(["uni-drawer__mask", { "uni-drawer__mask--visible": $data.showDrawer && $props.mask }]),
  14696. onClick: _cache[0] || (_cache[0] = ($event) => $options.close("mask"))
  14697. },
  14698. null,
  14699. 2
  14700. /* CLASS */
  14701. ),
  14702. vue.createElementVNode(
  14703. "view",
  14704. {
  14705. class: vue.normalizeClass(["uni-drawer__content", { "uni-drawer--right": $data.rightMode, "uni-drawer--left": !$data.rightMode, "uni-drawer__content--visible": $data.showDrawer }]),
  14706. style: vue.normalizeStyle({ width: $data.drawerWidth + "px" })
  14707. },
  14708. [
  14709. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  14710. ],
  14711. 6
  14712. /* CLASS, STYLE */
  14713. )
  14714. ],
  14715. 34
  14716. /* CLASS, NEED_HYDRATION */
  14717. )) : vue.createCommentVNode("v-if", true);
  14718. }
  14719. const __easycom_3 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__scopeId", "data-v-f7c32d22"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue"]]);
  14720. const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
  14721. __name: "index",
  14722. setup(__props, { expose: __expose }) {
  14723. __expose();
  14724. const loading = vue.ref(false);
  14725. const loadingBtn = vue.ref(false);
  14726. const token = vue.ref();
  14727. const searchValue = vue.ref();
  14728. const waybillDelivery = vue.ref([]);
  14729. const messageType = vue.ref();
  14730. const messageText = vue.ref();
  14731. const messageRef = vue.ref();
  14732. const showRightRef = vue.ref();
  14733. const resetForm = () => {
  14734. };
  14735. const confirmForm = () => {
  14736. showRightRef.value.close();
  14737. };
  14738. const copyOrderNo = (order_no) => {
  14739. uni.setClipboardData({
  14740. data: order_no,
  14741. success: function() {
  14742. uni.showToast({
  14743. title: "复制成功",
  14744. icon: "success",
  14745. duration: 2e3
  14746. });
  14747. },
  14748. fail: function() {
  14749. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:85", "复制失败");
  14750. }
  14751. });
  14752. };
  14753. const callPhone = (phoneNumber) => {
  14754. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:91", phoneNumber);
  14755. uni.makePhoneCall({
  14756. phoneNumber,
  14757. success: function() {
  14758. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:96", "拨打电话成功!");
  14759. },
  14760. fail: function() {
  14761. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:99", "拨打电话失败!");
  14762. }
  14763. });
  14764. };
  14765. const checkPermission = async () => {
  14766. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  14767. if (status === null || status === 1) {
  14768. status = 1;
  14769. } else {
  14770. uni.showModal({
  14771. content: "Camera permission required",
  14772. confirmText: "Setting",
  14773. success: function(res) {
  14774. if (res.confirm) {
  14775. permission.gotoAppSetting();
  14776. }
  14777. }
  14778. });
  14779. }
  14780. return status;
  14781. };
  14782. const scanInput = async () => {
  14783. let status = await checkPermission();
  14784. if (status !== 1) {
  14785. return;
  14786. }
  14787. uni.scanCode({
  14788. success: (res) => {
  14789. },
  14790. fail: (err) => {
  14791. }
  14792. });
  14793. };
  14794. const itemClick = (item) => {
  14795. uni.setStorageSync("selectItem", item);
  14796. uni.navigateTo({
  14797. url: "/pages/waybillDeliveryOrder/orderInfo?id=" + item.id
  14798. });
  14799. };
  14800. const onButtonClick = async (row, value) => {
  14801. if (value === "send_out") {
  14802. sendOut({ id: row.id });
  14803. } else if (value === "delivered") {
  14804. updateDelivered({ id: row.id });
  14805. } else if (value === "refuse") {
  14806. updateRefuse({ id: row.id });
  14807. } else if (value === "create_track_pod") {
  14808. createTrackPod({ id: row.id });
  14809. } else if (value === "edit")
  14810. ;
  14811. else if (value === "generate_label")
  14812. ;
  14813. else if (value === "fedex_appointment_pick_up")
  14814. ;
  14815. else if (value === "print_get_back_label")
  14816. ;
  14817. else if (value === "fedex_cancel_pick_up") {
  14818. cancelFedExPickUp({ id: row.id });
  14819. }
  14820. };
  14821. const sendOut = (data) => {
  14822. loadingBtn.value = true;
  14823. uni.request({
  14824. url: sendOutURL,
  14825. method: "POST",
  14826. header: {
  14827. batoken: token.value
  14828. },
  14829. data,
  14830. success: ({ data: data2 }) => {
  14831. loadingBtn.value = false;
  14832. messageType.value = "success";
  14833. messageText.value = "发出成功";
  14834. messageRef.value.open();
  14835. },
  14836. fail: (err) => {
  14837. loadingBtn.value = false;
  14838. messageType.value = "error";
  14839. messageText.value = "发出失败,请稍后重试";
  14840. messageRef.value.open();
  14841. }
  14842. });
  14843. };
  14844. const updateDelivered = (data) => {
  14845. loadingBtn.value = true;
  14846. uni.request({
  14847. url: deliveredURL,
  14848. method: "POST",
  14849. header: {
  14850. batoken: token.value
  14851. },
  14852. data,
  14853. success: ({ data: data2 }) => {
  14854. loadingBtn.value = false;
  14855. messageType.value = "success";
  14856. messageText.value = "确认送达成功";
  14857. messageRef.value.open();
  14858. },
  14859. fail: (err) => {
  14860. loadingBtn.value = false;
  14861. messageType.value = "error";
  14862. messageText.value = "确认送达失败,请稍后重试";
  14863. messageRef.value.open();
  14864. }
  14865. });
  14866. };
  14867. const updateRefuse = (data) => {
  14868. loadingBtn.value = true;
  14869. uni.request({
  14870. url: refuseURL,
  14871. method: "POST",
  14872. header: {
  14873. batoken: token.value
  14874. },
  14875. data,
  14876. success: ({ data: data2 }) => {
  14877. loadingBtn.value = false;
  14878. messageType.value = "success";
  14879. messageText.value = "已拒绝签收";
  14880. messageRef.value.open();
  14881. },
  14882. fail: (err) => {
  14883. loadingBtn.value = false;
  14884. messageType.value = "error";
  14885. messageText.value = "修改失败,请稍后重试";
  14886. messageRef.value.open();
  14887. }
  14888. });
  14889. };
  14890. const createTrackPod = (data) => {
  14891. loadingBtn.value = true;
  14892. uni.request({
  14893. url: createTrackPodURL,
  14894. method: "POST",
  14895. header: {
  14896. batoken: token.value
  14897. },
  14898. data,
  14899. success: ({ data: data2 }) => {
  14900. loadingBtn.value = false;
  14901. messageType.value = "success";
  14902. messageText.value = "同步成功";
  14903. messageRef.value.open();
  14904. },
  14905. fail: (err) => {
  14906. loadingBtn.value = false;
  14907. messageType.value = "error";
  14908. messageText.value = "同步失败,请稍后重试";
  14909. messageRef.value.open();
  14910. }
  14911. });
  14912. };
  14913. const cancelFedExPickUp = (data) => {
  14914. loadingBtn.value = true;
  14915. uni.request({
  14916. url: cancelFedExPickUpURL,
  14917. method: "POST",
  14918. header: {
  14919. batoken: token.value
  14920. },
  14921. data,
  14922. success: ({ data: data2 }) => {
  14923. loadingBtn.value = false;
  14924. messageType.value = "success";
  14925. messageText.value = "操作成功";
  14926. messageRef.value.open();
  14927. },
  14928. fail: (err) => {
  14929. loadingBtn.value = false;
  14930. messageType.value = "error";
  14931. messageText.value = "操作失败,请稍后重试";
  14932. messageRef.value.open();
  14933. }
  14934. });
  14935. };
  14936. const getList = () => {
  14937. loading.value = true;
  14938. uni.request({
  14939. url: pickupWaybillDeliveryOrderURL + "/index",
  14940. method: "GET",
  14941. header: {
  14942. batoken: token.value
  14943. },
  14944. success: ({ data }) => {
  14945. loading.value = false;
  14946. formatAppLog("log", "at pages/waybillDeliveryOrder/index.vue:319", data);
  14947. if (data.code == 1) {
  14948. waybillDelivery.value = data.data.list;
  14949. } else {
  14950. messageType.value = "error";
  14951. messageText.value = data.msg;
  14952. messageRef.value.open();
  14953. }
  14954. },
  14955. fail: (err) => {
  14956. loading.value = false;
  14957. }
  14958. });
  14959. };
  14960. onLoad(() => {
  14961. token.value = uni.getStorageSync("token");
  14962. getList();
  14963. });
  14964. onNavigationBarButtonTap((event) => {
  14965. if (event.index === 0) {
  14966. showRightRef.value.open();
  14967. }
  14968. });
  14969. const __returned__ = { loading, loadingBtn, token, searchValue, waybillDelivery, messageType, messageText, messageRef, showRightRef, resetForm, confirmForm, copyOrderNo, callPhone, checkPermission, scanInput, itemClick, onButtonClick, sendOut, updateDelivered, updateRefuse, createTrackPod, cancelFedExPickUp, getList };
  14970. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  14971. return __returned__;
  14972. }
  14973. });
  14974. const _imports_0 = "/static/copy.png";
  14975. const _imports_1 = "/static/call.png";
  14976. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  14977. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  14978. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  14979. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  14980. const _component_uni_drawer = resolveEasycom(vue.resolveDynamicComponent("uni-drawer"), __easycom_3);
  14981. return vue.openBlock(), vue.createElementBlock("view", { class: "list" }, [
  14982. vue.createCommentVNode(' <uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="blur" @focus="focus" @input="input" @cancel="cancel" @clear="clear"></uni-search-bar> '),
  14983. vue.createVNode(_component_uni_easyinput, {
  14984. modelValue: $setup.searchValue,
  14985. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.searchValue = $event),
  14986. placeholder: "请输入单号",
  14987. suffixIcon: "scan",
  14988. onIconClick: $setup.scanInput
  14989. }, null, 8, ["modelValue"]),
  14990. (vue.openBlock(true), vue.createElementBlock(
  14991. vue.Fragment,
  14992. null,
  14993. vue.renderList($setup.waybillDelivery, (item, i2) => {
  14994. return vue.openBlock(), vue.createElementBlock("view", {
  14995. class: "item",
  14996. key: i2,
  14997. onClick: ($event) => $setup.itemClick(item)
  14998. }, [
  14999. vue.createElementVNode("view", { class: "order-no" }, [
  15000. vue.createElementVNode(
  15001. "text",
  15002. null,
  15003. " 派送单号: " + vue.toDisplayString(item.order_no),
  15004. 1
  15005. /* TEXT */
  15006. ),
  15007. vue.createElementVNode("image", {
  15008. onClick: ($event) => $setup.copyOrderNo(item.order_no),
  15009. class: "icon",
  15010. src: _imports_0,
  15011. mode: "aspectFill"
  15012. }, null, 8, ["onClick"])
  15013. ]),
  15014. vue.createElementVNode("view", { class: "address-info" }, [
  15015. vue.createElementVNode("view", { class: "info" }, [
  15016. vue.createElementVNode("view", { class: "user" }, [
  15017. vue.createElementVNode(
  15018. "text",
  15019. null,
  15020. vue.toDisplayString(item.address.first_name + " " + item.address.last_name) + " " + vue.toDisplayString("+" + item.address.mobile_code + " " + item.address.mobile),
  15021. 1
  15022. /* TEXT */
  15023. ),
  15024. vue.createElementVNode("image", {
  15025. onClick: ($event) => $setup.callPhone(item.address.mobile_code + " " + item.address.mobile),
  15026. class: "icon",
  15027. src: _imports_1,
  15028. mode: "aspectFill"
  15029. }, null, 8, ["onClick"])
  15030. ]),
  15031. vue.createElementVNode("view", null, [
  15032. vue.createElementVNode("text", { class: "address" }, [
  15033. vue.createElementVNode(
  15034. "text",
  15035. { class: "city" },
  15036. vue.toDisplayString(item.address.city),
  15037. 1
  15038. /* TEXT */
  15039. ),
  15040. vue.createTextVNode(
  15041. " " + vue.toDisplayString(item.address.zip_code),
  15042. 1
  15043. /* TEXT */
  15044. )
  15045. ]),
  15046. vue.createElementVNode("image", {
  15047. onClick: ($event) => $setup.copyOrderNo(item.address.zip_code),
  15048. class: "icon",
  15049. src: _imports_0,
  15050. mode: "aspectFill"
  15051. }, null, 8, ["onClick"])
  15052. ])
  15053. ]),
  15054. vue.createElementVNode("view", { class: "info" })
  15055. ]),
  15056. vue.createElementVNode("view"),
  15057. vue.createElementVNode("view", { class: "operations" }, [
  15058. (vue.openBlock(true), vue.createElementBlock(
  15059. vue.Fragment,
  15060. null,
  15061. vue.renderList(item.operations, (operation, i22) => {
  15062. return vue.openBlock(), vue.createElementBlock("button", {
  15063. key: i22,
  15064. onClick: ($event) => $setup.onButtonClick(item, operation.value),
  15065. type: "info",
  15066. size: "mini"
  15067. }, vue.toDisplayString(operation.text), 9, ["onClick"]);
  15068. }),
  15069. 128
  15070. /* KEYED_FRAGMENT */
  15071. ))
  15072. ])
  15073. ], 8, ["onClick"]);
  15074. }),
  15075. 128
  15076. /* KEYED_FRAGMENT */
  15077. )),
  15078. $setup.waybillDelivery.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  15079. key: 0,
  15080. class: "is-empty"
  15081. }, "暂无派送单")) : vue.createCommentVNode("v-if", true),
  15082. vue.createVNode(
  15083. _component_uni_popup,
  15084. {
  15085. ref: "messageRef",
  15086. type: "message"
  15087. },
  15088. {
  15089. default: vue.withCtx(() => [
  15090. vue.createVNode(_component_uni_popup_message, {
  15091. type: $setup.messageType,
  15092. message: $setup.messageText,
  15093. duration: 2e3
  15094. }, null, 8, ["type", "message"])
  15095. ]),
  15096. _: 1
  15097. /* STABLE */
  15098. },
  15099. 512
  15100. /* NEED_PATCH */
  15101. ),
  15102. vue.createVNode(
  15103. _component_uni_drawer,
  15104. {
  15105. ref: "showRightRef",
  15106. mode: "right",
  15107. "mask-click": true
  15108. },
  15109. {
  15110. default: vue.withCtx(() => [
  15111. vue.createElementVNode("scroll-view", {
  15112. style: { "height": "100%" },
  15113. "scroll-y": "true"
  15114. }, [
  15115. vue.createElementVNode("view", { class: "button-group" }, [
  15116. vue.createElementVNode("button", {
  15117. onClick: $setup.resetForm,
  15118. type: "info"
  15119. }, "重置"),
  15120. vue.createElementVNode("button", {
  15121. onClick: $setup.confirmForm,
  15122. type: "primary"
  15123. }, "确认")
  15124. ])
  15125. ])
  15126. ]),
  15127. _: 1
  15128. /* STABLE */
  15129. },
  15130. 512
  15131. /* NEED_PATCH */
  15132. )
  15133. ]);
  15134. }
  15135. const PagesWaybillDeliveryOrderIndex = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__scopeId", "data-v-e43ee4da"], ["__file", "E:/HBuilderProjects/yta/pages/waybillDeliveryOrder/index.vue"]]);
  15136. const _sfc_main$6 = {
  15137. name: "UniSegmentedControl",
  15138. emits: ["clickItem"],
  15139. props: {
  15140. current: {
  15141. type: Number,
  15142. default: 0
  15143. },
  15144. values: {
  15145. type: Array,
  15146. default() {
  15147. return [];
  15148. }
  15149. },
  15150. activeColor: {
  15151. type: String,
  15152. default: "#2979FF"
  15153. },
  15154. inActiveColor: {
  15155. type: String,
  15156. default: "transparent"
  15157. },
  15158. styleType: {
  15159. type: String,
  15160. default: "button"
  15161. }
  15162. },
  15163. data() {
  15164. return {
  15165. currentIndex: 0
  15166. };
  15167. },
  15168. watch: {
  15169. current(val) {
  15170. if (val !== this.currentIndex) {
  15171. this.currentIndex = val;
  15172. }
  15173. }
  15174. },
  15175. computed: {},
  15176. created() {
  15177. this.currentIndex = this.current;
  15178. },
  15179. methods: {
  15180. _onClick(index) {
  15181. if (this.currentIndex !== index) {
  15182. this.currentIndex = index;
  15183. this.$emit("clickItem", {
  15184. currentIndex: index
  15185. });
  15186. }
  15187. }
  15188. }
  15189. };
  15190. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  15191. return vue.openBlock(), vue.createElementBlock(
  15192. "view",
  15193. {
  15194. class: vue.normalizeClass([[$props.styleType === "text" ? "segmented-control--text" : "segmented-control--button"], "segmented-control"]),
  15195. style: vue.normalizeStyle({ borderColor: $props.styleType === "text" ? "" : $props.activeColor })
  15196. },
  15197. [
  15198. (vue.openBlock(true), vue.createElementBlock(
  15199. vue.Fragment,
  15200. null,
  15201. vue.renderList($props.values, (item, index) => {
  15202. return vue.openBlock(), vue.createElementBlock("view", {
  15203. class: vue.normalizeClass([[
  15204. $props.styleType === "text" ? "" : "segmented-control__item--button",
  15205. index === 0 && $props.styleType === "button" ? "segmented-control__item--button--first" : "",
  15206. index === $props.values.length - 1 && $props.styleType === "button" ? "segmented-control__item--button--last" : ""
  15207. ], "segmented-control__item"]),
  15208. key: index,
  15209. style: vue.normalizeStyle({ backgroundColor: index === $data.currentIndex && $props.styleType === "button" ? $props.activeColor : $props.styleType === "button" ? $props.inActiveColor : "transparent", borderColor: index === $data.currentIndex && $props.styleType === "text" || $props.styleType === "button" ? $props.activeColor : $props.inActiveColor }),
  15210. onClick: ($event) => $options._onClick(index)
  15211. }, [
  15212. vue.createElementVNode("view", null, [
  15213. vue.createElementVNode(
  15214. "text",
  15215. {
  15216. style: vue.normalizeStyle({ color: index === $data.currentIndex ? $props.styleType === "text" ? $props.activeColor : "#fff" : $props.styleType === "text" ? "#000" : $props.activeColor }),
  15217. class: vue.normalizeClass(["segmented-control__text", $props.styleType === "text" && index === $data.currentIndex ? "segmented-control__item--text" : ""])
  15218. },
  15219. vue.toDisplayString(item),
  15220. 7
  15221. /* TEXT, CLASS, STYLE */
  15222. )
  15223. ])
  15224. ], 14, ["onClick"]);
  15225. }),
  15226. 128
  15227. /* KEYED_FRAGMENT */
  15228. ))
  15229. ],
  15230. 6
  15231. /* CLASS, STYLE */
  15232. );
  15233. }
  15234. const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__scopeId", "data-v-86aa1171"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue"]]);
  15235. const _sfc_main$5 = {
  15236. name: "UniTag",
  15237. emits: ["click"],
  15238. props: {
  15239. type: {
  15240. // 标签类型default、primary、success、warning、error、royal
  15241. type: String,
  15242. default: "default"
  15243. },
  15244. size: {
  15245. // 标签大小 normal, small
  15246. type: String,
  15247. default: "normal"
  15248. },
  15249. // 标签内容
  15250. text: {
  15251. type: String,
  15252. default: ""
  15253. },
  15254. disabled: {
  15255. // 是否为禁用状态
  15256. type: [Boolean, String],
  15257. default: false
  15258. },
  15259. inverted: {
  15260. // 是否为空心
  15261. type: [Boolean, String],
  15262. default: false
  15263. },
  15264. circle: {
  15265. // 是否为圆角样式
  15266. type: [Boolean, String],
  15267. default: false
  15268. },
  15269. mark: {
  15270. // 是否为标记样式
  15271. type: [Boolean, String],
  15272. default: false
  15273. },
  15274. customStyle: {
  15275. type: String,
  15276. default: ""
  15277. }
  15278. },
  15279. computed: {
  15280. classes() {
  15281. const {
  15282. type,
  15283. disabled,
  15284. inverted,
  15285. circle,
  15286. mark,
  15287. size,
  15288. isTrue
  15289. } = this;
  15290. const classArr = [
  15291. "uni-tag--" + type,
  15292. "uni-tag--" + size,
  15293. isTrue(disabled) ? "uni-tag--disabled" : "",
  15294. isTrue(inverted) ? "uni-tag--" + type + "--inverted" : "",
  15295. isTrue(circle) ? "uni-tag--circle" : "",
  15296. isTrue(mark) ? "uni-tag--mark" : "",
  15297. // type === 'default' ? 'uni-tag--default' : 'uni-tag-text',
  15298. isTrue(inverted) ? "uni-tag--inverted uni-tag-text--" + type : "",
  15299. size === "small" ? "uni-tag-text--small" : ""
  15300. ];
  15301. return classArr.join(" ");
  15302. }
  15303. },
  15304. methods: {
  15305. isTrue(value) {
  15306. return value === true || value === "true";
  15307. },
  15308. onClick() {
  15309. if (this.isTrue(this.disabled))
  15310. return;
  15311. this.$emit("click");
  15312. }
  15313. }
  15314. };
  15315. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  15316. return $props.text ? (vue.openBlock(), vue.createElementBlock(
  15317. "text",
  15318. {
  15319. key: 0,
  15320. class: vue.normalizeClass(["uni-tag", $options.classes]),
  15321. style: vue.normalizeStyle($props.customStyle),
  15322. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  15323. },
  15324. vue.toDisplayString($props.text),
  15325. 7
  15326. /* TEXT, CLASS, STYLE */
  15327. )) : vue.createCommentVNode("v-if", true);
  15328. }
  15329. const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-1f94d070"], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-tag/components/uni-tag/uni-tag.vue"]]);
  15330. function pad(str, length = 2) {
  15331. str += "";
  15332. while (str.length < length) {
  15333. str = "0" + str;
  15334. }
  15335. return str.slice(-length);
  15336. }
  15337. const parser = {
  15338. yyyy: (dateObj) => {
  15339. return pad(dateObj.year, 4);
  15340. },
  15341. yy: (dateObj) => {
  15342. return pad(dateObj.year);
  15343. },
  15344. MM: (dateObj) => {
  15345. return pad(dateObj.month);
  15346. },
  15347. M: (dateObj) => {
  15348. return dateObj.month;
  15349. },
  15350. dd: (dateObj) => {
  15351. return pad(dateObj.day);
  15352. },
  15353. d: (dateObj) => {
  15354. return dateObj.day;
  15355. },
  15356. hh: (dateObj) => {
  15357. return pad(dateObj.hour);
  15358. },
  15359. h: (dateObj) => {
  15360. return dateObj.hour;
  15361. },
  15362. mm: (dateObj) => {
  15363. return pad(dateObj.minute);
  15364. },
  15365. m: (dateObj) => {
  15366. return dateObj.minute;
  15367. },
  15368. ss: (dateObj) => {
  15369. return pad(dateObj.second);
  15370. },
  15371. s: (dateObj) => {
  15372. return dateObj.second;
  15373. },
  15374. SSS: (dateObj) => {
  15375. return pad(dateObj.millisecond, 3);
  15376. },
  15377. S: (dateObj) => {
  15378. return dateObj.millisecond;
  15379. }
  15380. };
  15381. function getDate(time) {
  15382. if (time instanceof Date) {
  15383. return time;
  15384. }
  15385. switch (typeof time) {
  15386. case "string": {
  15387. if (time.indexOf("T") > -1) {
  15388. return new Date(time);
  15389. }
  15390. return new Date(time.replace(/-/g, "/"));
  15391. }
  15392. default:
  15393. return new Date(time);
  15394. }
  15395. }
  15396. function formatDate(date, format = "yyyy/MM/dd hh:mm:ss") {
  15397. if (!date && date !== 0) {
  15398. return "";
  15399. }
  15400. date = getDate(date);
  15401. const dateObj = {
  15402. year: date.getFullYear(),
  15403. month: date.getMonth() + 1,
  15404. day: date.getDate(),
  15405. hour: date.getHours(),
  15406. minute: date.getMinutes(),
  15407. second: date.getSeconds(),
  15408. millisecond: date.getMilliseconds()
  15409. };
  15410. const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/;
  15411. let flag = true;
  15412. let result = format;
  15413. while (flag) {
  15414. flag = false;
  15415. result = result.replace(tokenRegExp, function(matched) {
  15416. flag = true;
  15417. return parser[matched](dateObj);
  15418. });
  15419. }
  15420. return result;
  15421. }
  15422. function friendlyDate(time, {
  15423. locale = "zh",
  15424. threshold = [6e4, 36e5],
  15425. format = "yyyy/MM/dd hh:mm:ss"
  15426. }) {
  15427. if (time === "-") {
  15428. return time;
  15429. }
  15430. if (!time && time !== 0) {
  15431. return "";
  15432. }
  15433. const localeText = {
  15434. zh: {
  15435. year: "年",
  15436. month: "月",
  15437. day: "天",
  15438. hour: "小时",
  15439. minute: "分钟",
  15440. second: "秒",
  15441. ago: "前",
  15442. later: "后",
  15443. justNow: "刚刚",
  15444. soon: "马上",
  15445. template: "{num}{unit}{suffix}"
  15446. },
  15447. en: {
  15448. year: "year",
  15449. month: "month",
  15450. day: "day",
  15451. hour: "hour",
  15452. minute: "minute",
  15453. second: "second",
  15454. ago: "ago",
  15455. later: "later",
  15456. justNow: "just now",
  15457. soon: "soon",
  15458. template: "{num} {unit} {suffix}"
  15459. }
  15460. };
  15461. const text = localeText[locale] || localeText.zh;
  15462. let date = getDate(time);
  15463. let ms2 = date.getTime() - Date.now();
  15464. let absMs = Math.abs(ms2);
  15465. if (absMs < threshold[0]) {
  15466. return ms2 < 0 ? text.justNow : text.soon;
  15467. }
  15468. if (absMs >= threshold[1]) {
  15469. return formatDate(date, format);
  15470. }
  15471. let num;
  15472. let unit;
  15473. let suffix = text.later;
  15474. if (ms2 < 0) {
  15475. suffix = text.ago;
  15476. ms2 = -ms2;
  15477. }
  15478. const seconds = Math.floor(ms2 / 1e3);
  15479. const minutes = Math.floor(seconds / 60);
  15480. const hours = Math.floor(minutes / 60);
  15481. const days = Math.floor(hours / 24);
  15482. const months = Math.floor(days / 30);
  15483. const years = Math.floor(months / 12);
  15484. switch (true) {
  15485. case years > 0:
  15486. num = years;
  15487. unit = text.year;
  15488. break;
  15489. case months > 0:
  15490. num = months;
  15491. unit = text.month;
  15492. break;
  15493. case days > 0:
  15494. num = days;
  15495. unit = text.day;
  15496. break;
  15497. case hours > 0:
  15498. num = hours;
  15499. unit = text.hour;
  15500. break;
  15501. case minutes > 0:
  15502. num = minutes;
  15503. unit = text.minute;
  15504. break;
  15505. default:
  15506. num = seconds;
  15507. unit = text.second;
  15508. break;
  15509. }
  15510. if (locale === "en") {
  15511. if (num === 1) {
  15512. num = "a";
  15513. } else {
  15514. unit += "s";
  15515. }
  15516. }
  15517. return text.template.replace(/{\s*num\s*}/g, num + "").replace(/{\s*unit\s*}/g, unit).replace(
  15518. /{\s*suffix\s*}/g,
  15519. suffix
  15520. );
  15521. }
  15522. const _sfc_main$4 = {
  15523. name: "uniDateformat",
  15524. props: {
  15525. date: {
  15526. type: [Object, String, Number],
  15527. default() {
  15528. return "-";
  15529. }
  15530. },
  15531. locale: {
  15532. type: String,
  15533. default: "zh"
  15534. },
  15535. threshold: {
  15536. type: Array,
  15537. default() {
  15538. return [0, 0];
  15539. }
  15540. },
  15541. format: {
  15542. type: String,
  15543. default: "yyyy/MM/dd hh:mm:ss"
  15544. },
  15545. // refreshRate使用不当可能导致性能问题,谨慎使用
  15546. refreshRate: {
  15547. type: [Number, String],
  15548. default: 0
  15549. }
  15550. },
  15551. data() {
  15552. return {
  15553. refreshMark: 0
  15554. };
  15555. },
  15556. computed: {
  15557. dateShow() {
  15558. this.refreshMark;
  15559. return friendlyDate(this.date, {
  15560. locale: this.locale,
  15561. threshold: this.threshold,
  15562. format: this.format
  15563. });
  15564. }
  15565. },
  15566. watch: {
  15567. refreshRate: {
  15568. handler() {
  15569. this.setAutoRefresh();
  15570. },
  15571. immediate: true
  15572. }
  15573. },
  15574. methods: {
  15575. refresh() {
  15576. this.refreshMark++;
  15577. },
  15578. setAutoRefresh() {
  15579. clearInterval(this.refreshInterval);
  15580. if (this.refreshRate) {
  15581. this.refreshInterval = setInterval(() => {
  15582. this.refresh();
  15583. }, parseInt(this.refreshRate));
  15584. }
  15585. }
  15586. }
  15587. };
  15588. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  15589. return vue.openBlock(), vue.createElementBlock(
  15590. "text",
  15591. null,
  15592. vue.toDisplayString($options.dateShow),
  15593. 1
  15594. /* TEXT */
  15595. );
  15596. }
  15597. const __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__file", "E:/HBuilderProjects/yta/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue"]]);
  15598. const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
  15599. __name: "orderInfo",
  15600. setup(__props, { expose: __expose }) {
  15601. __expose();
  15602. const current = vue.ref(0);
  15603. const items = vue.ref(["基本信息", "运单详情"]);
  15604. const loading = vue.ref(false);
  15605. const token = vue.ref();
  15606. const waybillDelivery = vue.ref([]);
  15607. const messageType = vue.ref();
  15608. const messageText = vue.ref();
  15609. const messageRef = vue.ref();
  15610. const item = vue.ref();
  15611. const deliveryOrderOptions = vue.ref({});
  15612. const delivery_type = vue.ref({
  15613. "1": "英途派送",
  15614. "2": "第三方物流"
  15615. });
  15616. onLoad((query) => {
  15617. token.value = uni.getStorageSync("token");
  15618. item.value = uni.getStorageSync("selectItem");
  15619. deliveryOrderOptions.value = uni.getStorageSync("deliveryOrderOptions");
  15620. formatAppLog("log", "at pages/waybillDeliveryOrder/orderInfo.vue:128", item.value);
  15621. });
  15622. const onClickItem = (e2) => {
  15623. if (current.value != e2.currentIndex) {
  15624. current.value = e2.currentIndex;
  15625. }
  15626. };
  15627. const copyString = (str) => {
  15628. uni.setClipboardData({
  15629. data: str,
  15630. success: function() {
  15631. uni.showToast({
  15632. title: "复制成功",
  15633. icon: "success",
  15634. duration: 2e3
  15635. });
  15636. },
  15637. fail: function() {
  15638. formatAppLog("log", "at pages/waybillDeliveryOrder/orderInfo.vue:149", "复制失败");
  15639. }
  15640. });
  15641. };
  15642. const __returned__ = { current, items, loading, token, waybillDelivery, messageType, messageText, messageRef, item, deliveryOrderOptions, delivery_type, onClickItem, copyString };
  15643. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  15644. return __returned__;
  15645. }
  15646. });
  15647. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  15648. const _component_uni_segmented_control = resolveEasycom(vue.resolveDynamicComponent("uni-segmented-control"), __easycom_0);
  15649. const _component_uni_tag = resolveEasycom(vue.resolveDynamicComponent("uni-tag"), __easycom_1);
  15650. const _component_uni_dateformat = resolveEasycom(vue.resolveDynamicComponent("uni-dateformat"), __easycom_2);
  15651. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  15652. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  15653. return vue.openBlock(), vue.createElementBlock("view", { class: "info" }, [
  15654. vue.createVNode(_component_uni_segmented_control, {
  15655. current: $setup.current,
  15656. values: $setup.items,
  15657. onClickItem: $setup.onClickItem,
  15658. styleType: "text",
  15659. activeColor: "#007aff"
  15660. }, null, 8, ["current", "values"]),
  15661. vue.createElementVNode("view", { class: "content" }, [
  15662. vue.withDirectives(vue.createElementVNode(
  15663. "view",
  15664. null,
  15665. [
  15666. vue.createElementVNode("view", { class: "order-no" }, [
  15667. vue.createElementVNode("view", null, [
  15668. vue.createElementVNode(
  15669. "text",
  15670. null,
  15671. "派送单号: " + vue.toDisplayString($setup.item.order_no),
  15672. 1
  15673. /* TEXT */
  15674. ),
  15675. vue.createElementVNode("image", {
  15676. onClick: _cache[0] || (_cache[0] = ($event) => $setup.copyString($setup.item.order_no)),
  15677. class: "icon",
  15678. src: _imports_0,
  15679. mode: "aspectFill"
  15680. })
  15681. ]),
  15682. vue.createVNode(_component_uni_tag, {
  15683. text: $setup.item.status_text,
  15684. type: "primary",
  15685. circle: ""
  15686. }, null, 8, ["text"])
  15687. ]),
  15688. vue.createElementVNode("view", { class: "box-card" }, [
  15689. vue.createElementVNode("view", { class: "label-icon" }, [
  15690. vue.createElementVNode("text", { class: "label-title" }, "地址信息")
  15691. ]),
  15692. vue.createElementVNode("view", { class: "label-content" }, [
  15693. vue.createElementVNode(
  15694. "text",
  15695. null,
  15696. vue.toDisplayString($setup.item.address.first_name + " " + $setup.item.address.last_name),
  15697. 1
  15698. /* TEXT */
  15699. ),
  15700. $setup.item.address.mobile ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, [
  15701. vue.createTextVNode(
  15702. " +" + vue.toDisplayString($setup.item.address.mobile_code + " " + $setup.item.address.mobile) + " ",
  15703. 1
  15704. /* TEXT */
  15705. ),
  15706. vue.createElementVNode("br")
  15707. ])) : vue.createCommentVNode("v-if", true),
  15708. $setup.item.address.email ? (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, [
  15709. vue.createTextVNode(
  15710. vue.toDisplayString($setup.item.address.email) + " ",
  15711. 1
  15712. /* TEXT */
  15713. ),
  15714. vue.createElementVNode("br")
  15715. ])) : vue.createCommentVNode("v-if", true),
  15716. vue.createElementVNode("text", null, [
  15717. vue.createTextVNode(
  15718. vue.toDisplayString($setup.item.address.address_line_1) + " ",
  15719. 1
  15720. /* TEXT */
  15721. ),
  15722. vue.createElementVNode("br")
  15723. ]),
  15724. $setup.item.address.address_line_2 ? (vue.openBlock(), vue.createElementBlock("text", { key: 2 }, [
  15725. vue.createTextVNode(
  15726. vue.toDisplayString($setup.item.address.address_line_2) + " ",
  15727. 1
  15728. /* TEXT */
  15729. ),
  15730. vue.createElementVNode("br")
  15731. ])) : vue.createCommentVNode("v-if", true),
  15732. $setup.item.address.address_line_3 ? (vue.openBlock(), vue.createElementBlock("text", { key: 3 }, [
  15733. vue.createTextVNode(
  15734. vue.toDisplayString($setup.item.address.address_line_3) + " ",
  15735. 1
  15736. /* TEXT */
  15737. ),
  15738. vue.createElementVNode("br")
  15739. ])) : vue.createCommentVNode("v-if", true),
  15740. vue.createElementVNode("text", null, [
  15741. vue.createTextVNode(
  15742. vue.toDisplayString($setup.item.address.city + " " + $setup.item.address.district) + " ",
  15743. 1
  15744. /* TEXT */
  15745. ),
  15746. vue.createElementVNode("br")
  15747. ]),
  15748. vue.createElementVNode("text", null, [
  15749. vue.createTextVNode(
  15750. vue.toDisplayString($setup.item.address.province) + " ",
  15751. 1
  15752. /* TEXT */
  15753. ),
  15754. vue.createElementVNode("br")
  15755. ]),
  15756. vue.createElementVNode("text", null, [
  15757. vue.createTextVNode(
  15758. vue.toDisplayString($setup.item.address.zip_code) + " ",
  15759. 1
  15760. /* TEXT */
  15761. ),
  15762. vue.createElementVNode("br")
  15763. ])
  15764. ])
  15765. ]),
  15766. vue.createElementVNode("view", { class: "box-card" }, [
  15767. vue.createElementVNode("text", null, [
  15768. vue.createTextVNode("客户派送日期: "),
  15769. $setup.item.delivery_date ? (vue.openBlock(), vue.createBlock(_component_uni_dateformat, {
  15770. key: 0,
  15771. date: $setup.item.delivery_date,
  15772. format: "yyyy-MM-dd"
  15773. }, null, 8, ["date"])) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, "无")),
  15774. vue.createElementVNode("br")
  15775. ]),
  15776. vue.createElementVNode(
  15777. "text",
  15778. null,
  15779. "备注: " + vue.toDisplayString($setup.item.remark || "无"),
  15780. 1
  15781. /* TEXT */
  15782. )
  15783. ]),
  15784. vue.createElementVNode("view", { class: "box-card" }, [
  15785. vue.createElementVNode("view", { class: "label-icon" }, [
  15786. vue.createElementVNode("text", { class: "label-title" }, "物流信息")
  15787. ]),
  15788. vue.createElementVNode("view", { class: "label-content" }, [
  15789. vue.createElementVNode("text", null, [
  15790. vue.createTextVNode("派送渠道类型: "),
  15791. vue.createVNode(_component_uni_tag, {
  15792. text: $setup.delivery_type[$setup.item.delivery_type],
  15793. type: "primary"
  15794. }, null, 8, ["text"]),
  15795. vue.createElementVNode("br")
  15796. ]),
  15797. Number($setup.item.delivery_type) === 1 ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, [
  15798. vue.createTextVNode(
  15799. "司机: " + vue.toDisplayString($setup.deliveryOrderOptions["driver_id"][$setup.item.driver_id] || "无") + " ",
  15800. 1
  15801. /* TEXT */
  15802. ),
  15803. vue.createElementVNode("br")
  15804. ])) : vue.createCommentVNode("v-if", true),
  15805. Number($setup.item.delivery_type) === 2 ? (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, [
  15806. vue.createTextVNode("快递公司: "),
  15807. vue.createVNode(_component_uni_tag, {
  15808. text: $setup.item.express.name || "无",
  15809. type: "success",
  15810. size: "small",
  15811. circle: ""
  15812. }, null, 8, ["text"]),
  15813. vue.createElementVNode("br")
  15814. ])) : vue.createCommentVNode("v-if", true),
  15815. vue.createElementVNode("text", null, [
  15816. vue.createTextVNode(
  15817. "物流单号: " + vue.toDisplayString($setup.item.express_no || "无") + " ",
  15818. 1
  15819. /* TEXT */
  15820. ),
  15821. vue.createElementVNode("br")
  15822. ]),
  15823. vue.createElementVNode(
  15824. "text",
  15825. null,
  15826. "追踪单号: " + vue.toDisplayString($setup.item.express_tracking_number || "无"),
  15827. 1
  15828. /* TEXT */
  15829. )
  15830. ])
  15831. ])
  15832. ],
  15833. 512
  15834. /* NEED_PATCH */
  15835. ), [
  15836. [vue.vShow, $setup.current === 0]
  15837. ]),
  15838. vue.withDirectives(vue.createElementVNode(
  15839. "view",
  15840. null,
  15841. " 选项卡2的内容 ",
  15842. 512
  15843. /* NEED_PATCH */
  15844. ), [
  15845. [vue.vShow, $setup.current === 1]
  15846. ])
  15847. ]),
  15848. vue.createVNode(
  15849. _component_uni_popup,
  15850. {
  15851. ref: "messageRef",
  15852. type: "message"
  15853. },
  15854. {
  15855. default: vue.withCtx(() => [
  15856. vue.createVNode(_component_uni_popup_message, {
  15857. type: $setup.messageType,
  15858. message: $setup.messageText,
  15859. duration: 2e3
  15860. }, null, 8, ["type", "message"])
  15861. ]),
  15862. _: 1
  15863. /* STABLE */
  15864. },
  15865. 512
  15866. /* NEED_PATCH */
  15867. )
  15868. ]);
  15869. }
  15870. const PagesWaybillDeliveryOrderOrderInfo = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-a28459fe"], ["__file", "E:/HBuilderProjects/yta/pages/waybillDeliveryOrder/orderInfo.vue"]]);
  15871. const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
  15872. __name: "index",
  15873. setup(__props, { expose: __expose }) {
  15874. __expose();
  15875. const token = vue.ref();
  15876. const loading = vue.ref(false);
  15877. const hidePage = vue.ref(false);
  15878. const focusType = vue.ref(true);
  15879. const selectType = vue.ref(1);
  15880. const printType = vue.ref([
  15881. {
  15882. text: "打印尾程面单",
  15883. value: 1
  15884. },
  15885. {
  15886. text: "打印客户联(详细)",
  15887. value: 2
  15888. },
  15889. {
  15890. text: "打印客户联(简单)",
  15891. value: 3
  15892. }
  15893. ]);
  15894. const printerDialog = vue.ref();
  15895. const subLoading = vue.ref(false);
  15896. const printerList = vue.ref([]);
  15897. const printers = vue.ref([]);
  15898. const downloadFile = vue.ref([]);
  15899. const sendToPeinter = vue.ref([1]);
  15900. const selectPrinter = vue.ref(0);
  15901. const printLogHistory = vue.ref([]);
  15902. const messageRef = vue.ref();
  15903. const messageType = vue.ref();
  15904. const messageText = vue.ref();
  15905. let st2;
  15906. const valiFormData = vue.ref({
  15907. order_code: ""
  15908. });
  15909. const rules = vue.reactive({
  15910. order_code: {
  15911. rules: [
  15912. {
  15913. required: true,
  15914. errorMessage: "单据编号不能为空"
  15915. }
  15916. ]
  15917. }
  15918. });
  15919. const checkPermission = async () => {
  15920. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  15921. if (status === null || status === 1) {
  15922. status = 1;
  15923. } else {
  15924. uni.showModal({
  15925. content: "Camera permission required",
  15926. confirmText: "Setting",
  15927. success: function(res) {
  15928. if (res.confirm) {
  15929. permission.gotoAppSetting();
  15930. }
  15931. }
  15932. });
  15933. }
  15934. return status;
  15935. };
  15936. const scanInput = async () => {
  15937. let status = await checkPermission();
  15938. if (status !== 1) {
  15939. return;
  15940. }
  15941. uni.scanCode({
  15942. success: (res) => {
  15943. valiFormData.value.order_code = res.result;
  15944. onsubmit();
  15945. },
  15946. fail: (err) => {
  15947. }
  15948. });
  15949. };
  15950. const reset = () => {
  15951. loading.value = false;
  15952. valiFormData.value.order_code = "";
  15953. };
  15954. const setfocus = () => {
  15955. if (hidePage.value) {
  15956. return;
  15957. }
  15958. focusType.value = false;
  15959. vue.nextTick(() => {
  15960. focusType.value = true;
  15961. });
  15962. };
  15963. const close = () => {
  15964. printerDialog.value.close();
  15965. st2 = setTimeout(() => {
  15966. reset();
  15967. st2 && clearTimeout(st2);
  15968. }, 700);
  15969. };
  15970. const sendToPeinterFun = (res) => {
  15971. if (res.detail.value.length === 0) {
  15972. selectPrinter.value = 0;
  15973. } else {
  15974. selectPrinter.value = printers.value[0].value;
  15975. }
  15976. };
  15977. const printConfirm = () => {
  15978. subLoading.value = true;
  15979. const url = selectType.value === 1 ? printWaybillLabelURL : printCustomerLabelURL;
  15980. let data = {
  15981. order_no: valiFormData.value.order_code,
  15982. printer_code: selectPrinter.value
  15983. };
  15984. let type = "尾程面单打印";
  15985. if (selectType.value === 2) {
  15986. data.style = "detail";
  15987. type = "打印客户联(详细)";
  15988. }
  15989. if (selectType.value === 3) {
  15990. data.style = "simple";
  15991. type = "打印客户联(简单)";
  15992. }
  15993. uni.request({
  15994. url,
  15995. method: "POST",
  15996. header: {
  15997. batoken: token.value
  15998. },
  15999. data,
  16000. success: (res) => {
  16001. subLoading.value = false;
  16002. formatAppLog("log", "at pages/printer/index.vue:233", "打印成功", res);
  16003. messageType.value = res.data.code ? "success" : "error";
  16004. messageText.value = res.data.msg;
  16005. messageRef.value.open();
  16006. const historyItem = {
  16007. order_code: valiFormData.value.order_code,
  16008. createTime: /* @__PURE__ */ new Date(),
  16009. type,
  16010. status: res.data.code
  16011. };
  16012. printLogHistory.value.unshift(historyItem);
  16013. uni.setStorageSync("printLogHistory", printLogHistory.value);
  16014. getHistory();
  16015. close();
  16016. },
  16017. fail: (err) => {
  16018. subLoading.value = false;
  16019. formatAppLog("log", "at pages/printer/index.vue:251", "打印失败", err);
  16020. messageType.value = "error";
  16021. messageText.value = "打印失败";
  16022. messageRef.value.open();
  16023. const historyItem = {
  16024. order_code: valiFormData.value.order_code,
  16025. createTime: /* @__PURE__ */ new Date(),
  16026. type,
  16027. status: false
  16028. };
  16029. printLogHistory.value.unshift(historyItem);
  16030. uni.setStorageSync("printLogHistory", printLogHistory.value);
  16031. getHistory();
  16032. close();
  16033. }
  16034. });
  16035. };
  16036. const getPrinterList = () => {
  16037. uni.request({
  16038. url: getPrinterListURL,
  16039. method: "GET",
  16040. header: {
  16041. batoken: token.value
  16042. },
  16043. success: (res) => {
  16044. if (res.data.code === 1) {
  16045. printerList.value = res.data.data.printers;
  16046. printers.value = Object.values(printerList.value).map((item) => {
  16047. return {
  16048. text: item.name,
  16049. value: item.value
  16050. };
  16051. });
  16052. }
  16053. },
  16054. fail(e2) {
  16055. formatAppLog("log", "at pages/printer/index.vue:288", "fail--", e2);
  16056. }
  16057. });
  16058. };
  16059. const onsubmit = () => {
  16060. if (valiFormData.value.order_code) {
  16061. loading.value = true;
  16062. st2 && clearTimeout(st2);
  16063. selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0;
  16064. printerDialog.value.open();
  16065. loading.value = false;
  16066. } else {
  16067. messageType.value = "error";
  16068. messageText.value = "请填写运单号";
  16069. messageRef.value.open();
  16070. }
  16071. };
  16072. const getHistory = () => {
  16073. printLogHistory.value = uni.getStorageSync("printLogHistory") || [];
  16074. };
  16075. const keypress = (e2) => {
  16076. formatAppLog("log", "at pages/printer/index.vue:311", e2, "按键码");
  16077. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  16078. ;
  16079. if (e2.keyCode == 66) {
  16080. onsubmit();
  16081. }
  16082. };
  16083. onLoad(() => {
  16084. plus.key.addEventListener("keyup", keypress);
  16085. });
  16086. onUnload(() => {
  16087. plus.key.removeEventListener("keyup", keypress);
  16088. });
  16089. onHide(() => {
  16090. hidePage.value = true;
  16091. plus.key.removeEventListener("keyup", keypress);
  16092. });
  16093. onBackPress(() => {
  16094. plus.key.removeEventListener("keyup", keypress);
  16095. });
  16096. onShow(() => {
  16097. token.value = uni.getStorageSync("token");
  16098. hidePage.value = false;
  16099. getHistory();
  16100. getPrinterList();
  16101. });
  16102. onNavigationBarButtonTap((event) => {
  16103. if (event.index === 0) {
  16104. uni.navigateTo({
  16105. url: "/pages/warehouseScan/warehouseLog"
  16106. });
  16107. }
  16108. });
  16109. const __returned__ = { token, loading, hidePage, focusType, selectType, printType, printerDialog, subLoading, printerList, printers, downloadFile, sendToPeinter, selectPrinter, printLogHistory, messageRef, messageType, messageText, get st() {
  16110. return st2;
  16111. }, set st(v2) {
  16112. st2 = v2;
  16113. }, valiFormData, rules, checkPermission, scanInput, reset, setfocus, close, sendToPeinterFun, printConfirm, getPrinterList, onsubmit, getHistory, keypress };
  16114. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  16115. return __returned__;
  16116. }
  16117. });
  16118. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  16119. const _component_uni_data_checkbox = resolveEasycom(vue.resolveDynamicComponent("uni-data-checkbox"), __easycom_0$3);
  16120. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_1$1);
  16121. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_2$1);
  16122. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_3$2);
  16123. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_4);
  16124. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_5);
  16125. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_6);
  16126. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  16127. vue.createElementVNode("view", { class: "checkbox" }, [
  16128. vue.createVNode(_component_uni_data_checkbox, {
  16129. modelValue: $setup.selectType,
  16130. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.selectType = $event),
  16131. localdata: $setup.printType
  16132. }, null, 8, ["modelValue", "localdata"])
  16133. ]),
  16134. vue.createVNode(_component_uni_forms, {
  16135. ref: "valiForm",
  16136. "label-align": "right",
  16137. "label-width": 80,
  16138. rules: $setup.rules,
  16139. modelValue: $setup.valiFormData
  16140. }, {
  16141. default: vue.withCtx(() => [
  16142. vue.createVNode(_component_uni_forms_item, {
  16143. label: "单据编号",
  16144. required: "",
  16145. name: "order_code"
  16146. }, {
  16147. default: vue.withCtx(() => [
  16148. vue.createVNode(_component_uni_easyinput, {
  16149. modelValue: $setup.valiFormData.order_code,
  16150. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.order_code = $event),
  16151. placeholder: "请输入单据编号",
  16152. suffixIcon: "scan",
  16153. focus: $setup.focusType,
  16154. onIconClick: $setup.scanInput,
  16155. onBlur: $setup.setfocus,
  16156. onConfirm: $setup.onsubmit
  16157. }, null, 8, ["modelValue", "focus"])
  16158. ]),
  16159. _: 1
  16160. /* STABLE */
  16161. })
  16162. ]),
  16163. _: 1
  16164. /* STABLE */
  16165. }, 8, ["rules", "modelValue"]),
  16166. vue.createElementVNode("view", { class: "button-group" }, [
  16167. vue.createElementVNode("button", {
  16168. type: "info",
  16169. onClick: $setup.reset
  16170. }, "重置"),
  16171. vue.createElementVNode("button", {
  16172. type: "primary",
  16173. onClick: $setup.onsubmit,
  16174. loading: $setup.loading
  16175. }, [
  16176. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  16177. key: 0,
  16178. type: "checkmarkempty",
  16179. size: "18",
  16180. color: "white"
  16181. })) : vue.createCommentVNode("v-if", true),
  16182. vue.createTextVNode(" 打印 ")
  16183. ], 8, ["loading"])
  16184. ]),
  16185. $setup.printLogHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  16186. key: 0,
  16187. class: "history"
  16188. }, [
  16189. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  16190. ])) : vue.createCommentVNode("v-if", true),
  16191. vue.createElementVNode("view", { class: "history" }, [
  16192. (vue.openBlock(true), vue.createElementBlock(
  16193. vue.Fragment,
  16194. null,
  16195. vue.renderList($setup.printLogHistory.slice(0, 5), (item, i2) => {
  16196. return vue.openBlock(), vue.createElementBlock("view", {
  16197. class: "item",
  16198. key: i2
  16199. }, [
  16200. vue.createElementVNode(
  16201. "text",
  16202. {
  16203. class: "code",
  16204. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  16205. },
  16206. vue.toDisplayString(item.type) + " " + vue.toDisplayString(item.order_code),
  16207. 5
  16208. /* TEXT, STYLE */
  16209. ),
  16210. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  16211. key: 0,
  16212. type: "checkmarkempty",
  16213. class: "status",
  16214. size: "16",
  16215. color: "green"
  16216. })) : (vue.openBlock(), vue.createElementBlock("text", {
  16217. key: 1,
  16218. class: "status fail"
  16219. }, "F")),
  16220. vue.createElementVNode(
  16221. "text",
  16222. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  16223. vue.toDisplayString("\r\n" + item.createTime),
  16224. 1
  16225. /* TEXT */
  16226. )
  16227. ]);
  16228. }),
  16229. 128
  16230. /* KEYED_FRAGMENT */
  16231. ))
  16232. ]),
  16233. vue.createVNode(
  16234. _component_uni_popup,
  16235. {
  16236. ref: "messageRef",
  16237. type: "message"
  16238. },
  16239. {
  16240. default: vue.withCtx(() => [
  16241. vue.createVNode(_component_uni_popup_message, {
  16242. type: $setup.messageType,
  16243. message: $setup.messageText,
  16244. duration: 2e3
  16245. }, null, 8, ["type", "message"])
  16246. ]),
  16247. _: 1
  16248. /* STABLE */
  16249. },
  16250. 512
  16251. /* NEED_PATCH */
  16252. ),
  16253. vue.createVNode(
  16254. _component_uni_popup,
  16255. {
  16256. ref: "printerDialog",
  16257. type: "dialog",
  16258. "is-mask-click": false
  16259. },
  16260. {
  16261. default: vue.withCtx(() => [
  16262. vue.createElementVNode("view", { style: { "width": "90%", "margin": "0 auto", "min-height": "250px", "background-color": "#fff", "border-radius": "5px" } }, [
  16263. vue.createElementVNode("view", {
  16264. class: "",
  16265. style: { "font-size": "20px", "border-bottom": "1px solid #e1e1e1", "padding": "15px 10px" }
  16266. }, [
  16267. vue.createElementVNode("view", null, [
  16268. vue.createElementVNode("view", { style: { "margin-bottom": "20px" } }, [
  16269. vue.createElementVNode("text", null, "打印尾程面单")
  16270. ]),
  16271. vue.createElementVNode("view", null, [
  16272. $setup.printerList ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  16273. vue.createElementVNode("view", null, [
  16274. vue.createVNode(_component_uni_data_checkbox, {
  16275. multiple: "",
  16276. modelValue: $setup.sendToPeinter,
  16277. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.sendToPeinter = $event),
  16278. localdata: [
  16279. {
  16280. text: "发送到标签打印机打印",
  16281. value: 1
  16282. }
  16283. ],
  16284. onChange: $setup.sendToPeinterFun
  16285. }, {
  16286. default: vue.withCtx(() => [
  16287. vue.createTextVNode(" > ")
  16288. ]),
  16289. _: 1
  16290. /* STABLE */
  16291. }, 8, ["modelValue"]),
  16292. vue.createVNode(_component_uni_data_checkbox, {
  16293. disabled: $setup.sendToPeinter.length === 0,
  16294. modelValue: $setup.selectPrinter,
  16295. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.selectPrinter = $event),
  16296. localdata: $setup.printers
  16297. }, null, 8, ["disabled", "modelValue", "localdata"])
  16298. ])
  16299. ])) : vue.createCommentVNode("v-if", true)
  16300. ])
  16301. ]),
  16302. vue.createElementVNode("view", { style: { "text-align": "center", "position": "absolute", "bottom": "10px", "width": "90%", "display": "flex", "margin": "0 auto", "left": "0", "right": "0" } }, [
  16303. vue.createElementVNode("button", {
  16304. onClick: $setup.close,
  16305. style: { "width": "35%" }
  16306. }, "关闭"),
  16307. vue.createElementVNode("button", {
  16308. onClick: $setup.printConfirm,
  16309. "hover-stay-time": 500,
  16310. loading: $setup.subLoading,
  16311. disabled: $setup.sendToPeinter.length === 0 || $setup.subLoading,
  16312. class: "my-bt-bg",
  16313. style: { "width": "35%" }
  16314. }, " 打印 ", 8, ["loading", "disabled"])
  16315. ])
  16316. ])
  16317. ])
  16318. ]),
  16319. _: 1
  16320. /* STABLE */
  16321. },
  16322. 512
  16323. /* NEED_PATCH */
  16324. )
  16325. ]);
  16326. }
  16327. const PagesPrinterIndex = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-b2c0c306"], ["__file", "E:/HBuilderProjects/yta/pages/printer/index.vue"]]);
  16328. const modal = requireNativePlugin("modal");
  16329. var AutoReplyPrintUniModule = requireNativePlugin("AutoReplyPrintUniModule");
  16330. var hPrinter = 0;
  16331. var isEnumeratingBT2 = false;
  16332. var isEnumeratingNET = false;
  16333. var selectedPortType = "rbBT2";
  16334. const _sfc_main$1 = {
  16335. data() {
  16336. return {
  16337. udsBT2Value: 0,
  16338. udsBT2Range: [],
  16339. udsNETValue: 0,
  16340. udsNETRange: [],
  16341. udsUSBValue: 0,
  16342. udsUSBRange: [],
  16343. udsCOMValue: 0,
  16344. udsCOMRange: [],
  16345. udsCOMBaudrateValue: 9600,
  16346. udsCOMBaudrateRange: [
  16347. {
  16348. text: "9600",
  16349. value: 9600
  16350. },
  16351. {
  16352. text: "19200",
  16353. value: 19200
  16354. },
  16355. {
  16356. text: "38400",
  16357. value: 38400
  16358. },
  16359. {
  16360. text: "57600",
  16361. value: 57600
  16362. },
  16363. {
  16364. text: "115200",
  16365. value: 115200
  16366. },
  16367. {
  16368. text: "230400",
  16369. value: 230400
  16370. },
  16371. {
  16372. text: "256000",
  16373. value: 256e3
  16374. },
  16375. {
  16376. text: "500000",
  16377. value: 5e5
  16378. }
  16379. ],
  16380. udsCOMFlowControlValue: 0,
  16381. udsCOMFlowControlRange: [
  16382. {
  16383. text: "NoFlowControl",
  16384. value: 0
  16385. },
  16386. {
  16387. text: "Hardware",
  16388. value: 2
  16389. }
  16390. ],
  16391. btnOpenPortDisabled: false,
  16392. btnClosePortDisabled: true
  16393. };
  16394. },
  16395. onLoad() {
  16396. uni.setNavigationBarTitle({
  16397. title: "SampleLabel " + AutoReplyPrintUniModule.CP_Library_Version()
  16398. });
  16399. },
  16400. onReady() {
  16401. },
  16402. methods: {
  16403. radioChange: function(evt) {
  16404. selectedPortType = evt.detail.value;
  16405. },
  16406. enumPort() {
  16407. var newComRange = new Array();
  16408. var comNameList = AutoReplyPrintUniModule.CP_Port_EnumCom();
  16409. if (comNameList != null) {
  16410. for (var i2 = 0; i2 < comNameList.length; i2++) {
  16411. var tmp = {
  16412. text: comNameList[i2],
  16413. value: i2
  16414. };
  16415. formatAppLog("log", "at pages/printer/label.vue:173", tmp);
  16416. newComRange.push(tmp);
  16417. }
  16418. }
  16419. this.udsCOMRange = newComRange;
  16420. var newUsbRange = new Array();
  16421. var usbNameList = AutoReplyPrintUniModule.CP_Port_EnumUsb();
  16422. if (usbNameList != null) {
  16423. for (var i2 = 0; i2 < usbNameList.length; i2++) {
  16424. var tmp = {
  16425. text: usbNameList[i2],
  16426. value: i2
  16427. };
  16428. formatAppLog("log", "at pages/printer/label.vue:187", tmp);
  16429. newUsbRange.push(tmp);
  16430. }
  16431. }
  16432. this.udsUSBRange = newUsbRange;
  16433. if (!isEnumeratingBT2) {
  16434. isEnumeratingBT2 = true;
  16435. formatAppLog("log", "at pages/printer/label.vue:195", "isEnumeratingBT2");
  16436. AutoReplyPrintUniModule.CP_Port_EnumBtDevice(
  16437. 12e3,
  16438. (ret) => {
  16439. var text = ret.device_address + "(" + ret.device_name + ")";
  16440. for (var i3 = 0; i3 < this.udsBT2Range.length; i3++) {
  16441. if (this.udsBT2Range[i3].text == text) {
  16442. return;
  16443. }
  16444. }
  16445. var tmp2 = {
  16446. text,
  16447. value: this.udsBT2Range.length
  16448. };
  16449. formatAppLog("log", "at pages/printer/label.vue:210", tmp2);
  16450. this.udsBT2Range.push(tmp2);
  16451. },
  16452. (ret) => {
  16453. isEnumeratingBT2 = false;
  16454. formatAppLog("log", "at pages/printer/label.vue:215", "finishedEnumeratingBT2");
  16455. }
  16456. );
  16457. }
  16458. if (!isEnumeratingNET) {
  16459. isEnumeratingNET = true;
  16460. formatAppLog("log", "at pages/printer/label.vue:222", "isEnumeratingNET");
  16461. AutoReplyPrintUniModule.CP_Port_EnumNetPrinter(
  16462. 12e3,
  16463. (ret) => {
  16464. var text = ret.discovered_ip + "(" + ret.discovered_name + ")";
  16465. for (var i3 = 0; i3 < this.udsNETRange.length; i3++) {
  16466. if (this.udsNETRange[i3].text == text) {
  16467. return;
  16468. }
  16469. }
  16470. var tmp2 = {
  16471. text,
  16472. value: this.udsNETRange.length
  16473. };
  16474. formatAppLog("log", "at pages/printer/label.vue:237", tmp2);
  16475. this.udsNETRange.push(tmp2);
  16476. },
  16477. (ret) => {
  16478. isEnumeratingNET = false;
  16479. formatAppLog("log", "at pages/printer/label.vue:242", "finishedEnumeratingNET");
  16480. }
  16481. );
  16482. }
  16483. },
  16484. openPort() {
  16485. if (hPrinter == 0) {
  16486. if (selectedPortType == "rbBT2") {
  16487. var text = this.udsBT2Range[this.udsBT2Value].text;
  16488. var btAddress = text.substring(0, text.indexOf("("));
  16489. modal.toast({
  16490. message: "Connecting: " + btAddress + " ......",
  16491. duration: 1.5
  16492. });
  16493. formatAppLog("log", "at pages/printer/label.vue:257", "Connecting: " + btAddress + " ......");
  16494. hPrinter = AutoReplyPrintUniModule.CP_Port_OpenBtSpp(btAddress, 1);
  16495. formatAppLog("log", "at pages/printer/label.vue:259", "hPrinter: " + hPrinter);
  16496. } else if (selectedPortType == "rbNET") {
  16497. var text = this.udsNETRange[this.udsNETValue].text;
  16498. var ipAddress = text.substring(0, text.indexOf("("));
  16499. modal.toast({
  16500. message: "Connecting: " + ipAddress + " ......",
  16501. duration: 1.5
  16502. });
  16503. formatAppLog("log", "at pages/printer/label.vue:267", "Connecting: " + ipAddress + " ......");
  16504. hPrinter = AutoReplyPrintUniModule.CP_Port_OpenTcp(null, ipAddress, 9100, 5e3, 1);
  16505. formatAppLog("log", "at pages/printer/label.vue:269", "hPrinter: " + hPrinter);
  16506. } else if (selectedPortType == "rbUSB") {
  16507. var usbName = this.udsUSBRange[this.udsUSBValue].text;
  16508. modal.toast({
  16509. message: "Connecting: " + usbName + " ......",
  16510. duration: 1.5
  16511. });
  16512. formatAppLog("log", "at pages/printer/label.vue:276", "Connecting: " + usbName + " ......");
  16513. hPrinter = AutoReplyPrintUniModule.CP_Port_OpenUsb(usbName, 1);
  16514. formatAppLog("log", "at pages/printer/label.vue:278", "hPrinter: " + hPrinter);
  16515. } else if (selectedPortType == "rbCOM") {
  16516. var comName = this.udsCOMRange[this.udsCOMValue].text;
  16517. var comBaudrate = this.udsCOMBaudrateValue;
  16518. var comFlowControl = this.udsCOMFlowControlValue;
  16519. modal.toast({
  16520. message: "Connecting: " + comName + "," + comBaudrate + "," + comFlowControl + " ......",
  16521. duration: 1.5
  16522. });
  16523. formatAppLog("log", "at pages/printer/label.vue:288", "Connecting: " + comName + "," + comBaudrate + "," + comFlowControl + "......");
  16524. hPrinter = AutoReplyPrintUniModule.CP_Port_OpenCom(
  16525. comName,
  16526. comBaudrate,
  16527. 8,
  16528. 0,
  16529. 0,
  16530. comFlowControl,
  16531. 1
  16532. );
  16533. formatAppLog("log", "at pages/printer/label.vue:291", "hPrinter: " + hPrinter);
  16534. }
  16535. modal.toast({
  16536. message: hPrinter != 0 ? "Connected" : "Failed",
  16537. duration: 1.5
  16538. });
  16539. }
  16540. this.btnOpenPortDisabled = hPrinter != 0;
  16541. this.btnClosePortDisabled = hPrinter == 0;
  16542. },
  16543. closePort() {
  16544. if (hPrinter != 0) {
  16545. AutoReplyPrintUniModule.CP_Port_Close(hPrinter);
  16546. hPrinter = 0;
  16547. }
  16548. this.btnOpenPortDisabled = hPrinter != 0;
  16549. this.btnClosePortDisabled = hPrinter == 0;
  16550. },
  16551. Test_Label_SampleTicket_58MM_1() {
  16552. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  16553. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 1);
  16554. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 240, 0);
  16555. AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 10, 24, 0, "型号:P58A+");
  16556. AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 40, 24, 0, "MFG :00");
  16557. AutoReplyPrintUniModule.CP_Label_DrawBarcode(hPrinter, 10, 70, 8, 2, 60, 2, 0, "No.123456");
  16558. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16559. var printResult = AutoReplyPrintUniModule.CP_Pos_QueryPrintResult(hPrinter, 1e4);
  16560. modal.toast({
  16561. message: printResult ? "Print Success" : "Print Failed",
  16562. duration: 1.5
  16563. });
  16564. },
  16565. Test_Label_SampleTicket_80MM_1() {
  16566. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  16567. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 1);
  16568. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 576, 240, 0);
  16569. AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 10, 24, 0, "型号:P80A+");
  16570. AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 40, 24, 0, "MFG :00");
  16571. AutoReplyPrintUniModule.CP_Label_DrawBarcode(hPrinter, 10, 70, 8, 2, 60, 4, 0, "No.123456");
  16572. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16573. var printResult = AutoReplyPrintUniModule.CP_Pos_QueryPrintResult(hPrinter, 1e4);
  16574. modal.toast({
  16575. message: printResult ? "Print Success" : "Print Failed",
  16576. duration: 1.5
  16577. });
  16578. },
  16579. GetPrinterResolutionInfo() {
  16580. var ret = AutoReplyPrintUniModule.CP_Printer_GetPrinterResolutionInfo(hPrinter);
  16581. modal.toast({
  16582. message: ret,
  16583. duration: 1.5
  16584. });
  16585. },
  16586. GetPrinterFirmwareVersion() {
  16587. var ret = AutoReplyPrintUniModule.CP_Printer_GetPrinterFirmwareVersion(hPrinter);
  16588. modal.toast({
  16589. message: ret,
  16590. duration: 1.5
  16591. });
  16592. },
  16593. GetPrinterStatusInfo() {
  16594. var ret = AutoReplyPrintUniModule.CP_Printer_GetPrinterStatusInfo(hPrinter);
  16595. var status_time = new Date(ret.timestamp_ms);
  16596. var printer_error_status = ret.printer_error_status;
  16597. var status_str = "";
  16598. if (printer_error_status != 0) {
  16599. status_str += "ERROR_OCCURED\n";
  16600. if ((printer_error_status & 1) != 0) {
  16601. status_str += "ERROR_CUTTER\n";
  16602. }
  16603. if ((printer_error_status & 2) != 0) {
  16604. status_str += "ERROR_FLASH\n";
  16605. }
  16606. if ((printer_error_status & 4) != 0) {
  16607. status_str += "ERROR_NOPAPER\n";
  16608. }
  16609. if ((printer_error_status & 8) != 0) {
  16610. status_str += "ERROR_VOLTAGE\n";
  16611. }
  16612. if ((printer_error_status & 16) != 0) {
  16613. status_str += "ERROR_MARKER\n";
  16614. }
  16615. if ((printer_error_status & 32) != 0) {
  16616. status_str += "ERROR_ENGINE\n";
  16617. }
  16618. if ((printer_error_status & 64) != 0) {
  16619. status_str += "ERROR_OVERHEAT\n";
  16620. }
  16621. if ((printer_error_status & 128) != 0) {
  16622. status_str += "ERROR_COVERUP\n";
  16623. }
  16624. if ((printer_error_status & 256) != 0) {
  16625. status_str += "ERROR_MOTOR\n";
  16626. }
  16627. } else {
  16628. status_str += "Status OK\n";
  16629. }
  16630. modal.toast({
  16631. message: "" + status_time + "\n" + status_str,
  16632. duration: 1.5
  16633. });
  16634. },
  16635. CP_Pos_KickOutDrawer() {
  16636. var ret = AutoReplyPrintUniModule.CP_Pos_KickOutDrawer(hPrinter, 0, 100, 100);
  16637. modal.toast({
  16638. message: ret,
  16639. duration: 1.5
  16640. });
  16641. },
  16642. CP_Pos_Beep() {
  16643. var ret = AutoReplyPrintUniModule.CP_Pos_Beep(hPrinter, 3, 500);
  16644. modal.toast({
  16645. message: ret,
  16646. duration: 1.5
  16647. });
  16648. },
  16649. CP_Pos_PrintSelfTestPage() {
  16650. var ret = AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  16651. modal.toast({
  16652. message: ret,
  16653. duration: 1.5
  16654. });
  16655. },
  16656. CP_Pos_ResetPrinter() {
  16657. var ret = AutoReplyPrintUniModule.CP_Pos_ResetPrinter(hPrinter);
  16658. modal.toast({
  16659. message: ret,
  16660. duration: 1.5
  16661. });
  16662. },
  16663. CP_Pos_SetPrintSpeed_100() {
  16664. var ret = AutoReplyPrintUniModule.CP_Pos_SetPrintSpeed(hPrinter, 100);
  16665. AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  16666. modal.toast({
  16667. message: ret,
  16668. duration: 1.5
  16669. });
  16670. },
  16671. CP_Pos_SetPrintSpeed_150() {
  16672. var ret = AutoReplyPrintUniModule.CP_Pos_SetPrintSpeed(hPrinter, 150);
  16673. AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  16674. modal.toast({
  16675. message: ret,
  16676. duration: 1.5
  16677. });
  16678. },
  16679. CP_Pos_SetPrintDensity_7() {
  16680. var ret = AutoReplyPrintUniModule.CP_Pos_SetPrintDensity(hPrinter, 7);
  16681. AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  16682. modal.toast({
  16683. message: ret,
  16684. duration: 1.5
  16685. });
  16686. },
  16687. CP_Pos_SetPrintDensity_15() {
  16688. var ret = AutoReplyPrintUniModule.CP_Pos_SetPrintDensity(hPrinter, 15);
  16689. AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  16690. modal.toast({
  16691. message: ret,
  16692. duration: 1.5
  16693. });
  16694. },
  16695. CP_Label_EnableLabelMode() {
  16696. var ret = AutoReplyPrintUniModule.CP_Label_EnableLabelMode(hPrinter);
  16697. modal.toast({
  16698. message: ret,
  16699. duration: 1.5
  16700. });
  16701. },
  16702. CP_Label_DisableLabelMode() {
  16703. var ret = AutoReplyPrintUniModule.CP_Label_DisableLabelMode(hPrinter);
  16704. modal.toast({
  16705. message: ret,
  16706. duration: 1.5
  16707. });
  16708. },
  16709. CP_Label_CalibrateLabel() {
  16710. var ret = AutoReplyPrintUniModule.CP_Label_CalibrateLabel(hPrinter);
  16711. modal.toast({
  16712. message: ret,
  16713. duration: 1.5
  16714. });
  16715. },
  16716. CP_Label_FeedLabel() {
  16717. var ret = AutoReplyPrintUniModule.CP_Label_FeedLabel(hPrinter);
  16718. modal.toast({
  16719. message: ret,
  16720. duration: 1.5
  16721. });
  16722. },
  16723. CP_Label_PageBegin() {
  16724. var ret = AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16725. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16726. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16727. modal.toast({
  16728. message: ret,
  16729. duration: 1.5
  16730. });
  16731. },
  16732. CP_Label_PagePrint() {
  16733. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16734. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16735. var ret = AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16736. modal.toast({
  16737. message: ret,
  16738. duration: 1.5
  16739. });
  16740. },
  16741. CP_Label_DrawText() {
  16742. var str = "$$$123哈哈哈";
  16743. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  16744. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 1);
  16745. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16746. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16747. var ret = AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 10, 24, 0, str);
  16748. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16749. modal.toast({
  16750. message: ret,
  16751. duration: 1.5
  16752. });
  16753. },
  16754. CP_Label_DrawTextInUTF8() {
  16755. var str = "$$$123哈哈哈";
  16756. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  16757. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 1);
  16758. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16759. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16760. var ret = AutoReplyPrintUniModule.CP_Label_DrawTextInUTF8(hPrinter, 10, 10, 24, 0, str);
  16761. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16762. modal.toast({
  16763. message: ret,
  16764. duration: 1.5
  16765. });
  16766. },
  16767. CP_Label_DrawTextInGBK() {
  16768. var str = "$$$123哈哈哈";
  16769. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  16770. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 0);
  16771. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16772. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16773. var ret = AutoReplyPrintUniModule.CP_Label_DrawTextInGBK(hPrinter, 10, 10, 24, 0, str);
  16774. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16775. modal.toast({
  16776. message: ret,
  16777. duration: 1.5
  16778. });
  16779. },
  16780. CP_Label_DrawBarcode() {
  16781. var str = "01234567890";
  16782. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16783. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16784. var ret = AutoReplyPrintUniModule.CP_Label_DrawBarcode(hPrinter, 10, 10, 0, 2, 60, 2, 0, str);
  16785. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16786. modal.toast({
  16787. message: ret,
  16788. duration: 1.5
  16789. });
  16790. },
  16791. CP_Label_DrawQRCode() {
  16792. var str = "Hello 你好";
  16793. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16794. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16795. var ret = AutoReplyPrintUniModule.CP_Label_DrawQRCode(hPrinter, 10, 10, 0, 1, 8, 0, str);
  16796. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16797. modal.toast({
  16798. message: ret,
  16799. duration: 1.5
  16800. });
  16801. },
  16802. CP_Label_DrawPDF417Code() {
  16803. var str = "Hello 你好";
  16804. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16805. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16806. var ret = AutoReplyPrintUniModule.CP_Label_DrawPDF417Code(hPrinter, 10, 10, 3, 3, 0, 3, 0, str);
  16807. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16808. modal.toast({
  16809. message: ret,
  16810. duration: 1.5
  16811. });
  16812. },
  16813. CP_Label_DrawImageFromFile() {
  16814. uni.chooseImage({
  16815. count: 1,
  16816. //默认9
  16817. sizeType: ["original", "compressed"],
  16818. //可以指定是原图还是压缩图,默认二者都有
  16819. sourceType: ["album"],
  16820. //从相册选择
  16821. success: function(res) {
  16822. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16823. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16824. var ret = AutoReplyPrintUniModule.CP_Label_DrawImageFromFile(
  16825. hPrinter,
  16826. 0,
  16827. 0,
  16828. 384,
  16829. 0,
  16830. res.tempFilePaths[0],
  16831. 2,
  16832. 0
  16833. );
  16834. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16835. modal.toast({
  16836. message: ret,
  16837. duration: 1.5
  16838. });
  16839. }
  16840. });
  16841. },
  16842. CP_Label_DrawImageFromPixels() {
  16843. var image_width = 100;
  16844. var image_height = 100;
  16845. var image_pixels_array = new Uint8Array(image_width * image_height * 4);
  16846. for (let y2 = 0; y2 < image_height; ++y2) {
  16847. for (let x = 0; x < image_width; ++x) {
  16848. var offset = y2 * image_width * 4 + x * 4;
  16849. if (x == y2) {
  16850. image_pixels_array[offset] = 0;
  16851. image_pixels_array[offset + 1] = 0;
  16852. image_pixels_array[offset + 2] = 0;
  16853. image_pixels_array[offset + 3] = 255;
  16854. } else {
  16855. image_pixels_array[offset] = 255;
  16856. image_pixels_array[offset + 1] = 255;
  16857. image_pixels_array[offset + 2] = 255;
  16858. image_pixels_array[offset + 3] = 255;
  16859. }
  16860. }
  16861. }
  16862. var image_pixels_base64 = uni.arrayBufferToBase64(image_pixels_array);
  16863. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16864. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16865. var ret = AutoReplyPrintUniModule.CP_Label_DrawImageFromPixels(
  16866. hPrinter,
  16867. 0,
  16868. 0,
  16869. image_pixels_base64,
  16870. image_width,
  16871. image_height,
  16872. image_width * 4,
  16873. 7,
  16874. 2,
  16875. 0
  16876. );
  16877. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16878. modal.toast({
  16879. message: ret,
  16880. duration: 1.5
  16881. });
  16882. },
  16883. CP_Label_DrawLine() {
  16884. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16885. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16886. var ret = AutoReplyPrintUniModule.CP_Label_DrawLine(hPrinter, 20, 20, 100, 300, 1, 1);
  16887. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16888. modal.toast({
  16889. message: ret,
  16890. duration: 1.5
  16891. });
  16892. },
  16893. CP_Label_DrawRect() {
  16894. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16895. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16896. var ret = AutoReplyPrintUniModule.CP_Label_DrawRect(hPrinter, 20, 20, 200, 10, 1);
  16897. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16898. modal.toast({
  16899. message: ret,
  16900. duration: 1.5
  16901. });
  16902. },
  16903. CP_Label_DrawBox() {
  16904. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  16905. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  16906. var ret = AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 30, 30, 300, 200, 1, 1);
  16907. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  16908. modal.toast({
  16909. message: ret,
  16910. duration: 1.5
  16911. });
  16912. }
  16913. }
  16914. };
  16915. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  16916. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$2);
  16917. return vue.openBlock(), vue.createElementBlock("view", null, [
  16918. vue.createElementVNode(
  16919. "radio-group",
  16920. {
  16921. onChange: _cache[6] || (_cache[6] = (...args) => $options.radioChange && $options.radioChange(...args))
  16922. },
  16923. [
  16924. vue.createElementVNode("label", { class: "uni-list-cell uni-list-cell-pd" }, [
  16925. vue.createElementVNode("label", { class: "radio" }, [
  16926. vue.createElementVNode("radio", {
  16927. value: "rbBT2",
  16928. checked: "true"
  16929. }),
  16930. vue.createTextVNode("BT2.0 ")
  16931. ]),
  16932. vue.createVNode(_component_uni_data_select, {
  16933. modelValue: $data.udsBT2Value,
  16934. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.udsBT2Value = $event),
  16935. localdata: $data.udsBT2Range
  16936. }, null, 8, ["modelValue", "localdata"])
  16937. ]),
  16938. vue.createElementVNode("label", { class: "uni-list-cell uni-list-cell-pd" }, [
  16939. vue.createElementVNode("label", { class: "radio" }, [
  16940. vue.createElementVNode("radio", { value: "rbNET" }),
  16941. vue.createTextVNode("NET ")
  16942. ]),
  16943. vue.createVNode(_component_uni_data_select, {
  16944. modelValue: $data.udsNETValue,
  16945. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.udsNETValue = $event),
  16946. localdata: $data.udsNETRange
  16947. }, null, 8, ["modelValue", "localdata"])
  16948. ]),
  16949. vue.createElementVNode("label", { class: "uni-list-cell uni-list-cell-pd" }, [
  16950. vue.createElementVNode("label", { class: "radio" }, [
  16951. vue.createElementVNode("radio", { value: "rbUSB" }),
  16952. vue.createTextVNode("USB ")
  16953. ]),
  16954. vue.createVNode(_component_uni_data_select, {
  16955. modelValue: $data.udsUSBValue,
  16956. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.udsUSBValue = $event),
  16957. localdata: $data.udsUSBRange
  16958. }, null, 8, ["modelValue", "localdata"])
  16959. ]),
  16960. vue.createElementVNode("label", { class: "uni-list-cell uni-list-cell-pd" }, [
  16961. vue.createElementVNode("label", { class: "radio" }, [
  16962. vue.createElementVNode("radio", { value: "rbCOM" }),
  16963. vue.createTextVNode("COM ")
  16964. ]),
  16965. vue.createVNode(_component_uni_data_select, {
  16966. modelValue: $data.udsCOMValue,
  16967. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.udsCOMValue = $event),
  16968. localdata: $data.udsCOMRange
  16969. }, null, 8, ["modelValue", "localdata"]),
  16970. vue.createVNode(_component_uni_data_select, {
  16971. modelValue: $data.udsCOMBaudrateValue,
  16972. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.udsCOMBaudrateValue = $event),
  16973. localdata: $data.udsCOMBaudrateRange
  16974. }, null, 8, ["modelValue", "localdata"]),
  16975. vue.createVNode(_component_uni_data_select, {
  16976. modelValue: $data.udsCOMFlowControlValue,
  16977. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.udsCOMFlowControlValue = $event),
  16978. localdata: $data.udsCOMFlowControlRange
  16979. }, null, 8, ["modelValue", "localdata"])
  16980. ])
  16981. ],
  16982. 32
  16983. /* NEED_HYDRATION */
  16984. ),
  16985. vue.createElementVNode("view", { class: "uni-flex uni-row" }, [
  16986. vue.createElementVNode("button", {
  16987. type: "default",
  16988. onClick: _cache[7] || (_cache[7] = (...args) => $options.enumPort && $options.enumPort(...args))
  16989. }, "Enum Port"),
  16990. vue.createElementVNode("button", {
  16991. type: "default",
  16992. onClick: _cache[8] || (_cache[8] = (...args) => $options.openPort && $options.openPort(...args)),
  16993. disabled: $data.btnOpenPortDisabled
  16994. }, "Open Port", 8, ["disabled"]),
  16995. vue.createElementVNode("button", {
  16996. type: "default",
  16997. onClick: _cache[9] || (_cache[9] = (...args) => $options.closePort && $options.closePort(...args)),
  16998. disabled: $data.btnClosePortDisabled
  16999. }, "Close Port", 8, ["disabled"])
  17000. ]),
  17001. vue.createElementVNode("view", null, [
  17002. vue.createElementVNode("button", {
  17003. type: "primary",
  17004. onClick: _cache[10] || (_cache[10] = (...args) => $options.Test_Label_SampleTicket_58MM_1 && $options.Test_Label_SampleTicket_58MM_1(...args))
  17005. }, "Test_Label_SampleTicket_58MM_1"),
  17006. vue.createElementVNode("button", {
  17007. type: "primary",
  17008. onClick: _cache[11] || (_cache[11] = (...args) => $options.Test_Label_SampleTicket_80MM_1 && $options.Test_Label_SampleTicket_80MM_1(...args))
  17009. }, "Test_Label_SampleTicket_80MM_1"),
  17010. vue.createElementVNode("button", {
  17011. type: "primary",
  17012. onClick: _cache[12] || (_cache[12] = (...args) => $options.GetPrinterResolutionInfo && $options.GetPrinterResolutionInfo(...args))
  17013. }, "GetPrinterResolutionInfo"),
  17014. vue.createElementVNode("button", {
  17015. type: "primary",
  17016. onClick: _cache[13] || (_cache[13] = (...args) => $options.GetPrinterFirmwareVersion && $options.GetPrinterFirmwareVersion(...args))
  17017. }, "GetPrinterFirmwareVersion"),
  17018. vue.createElementVNode("button", {
  17019. type: "primary",
  17020. onClick: _cache[14] || (_cache[14] = (...args) => $options.GetPrinterStatusInfo && $options.GetPrinterStatusInfo(...args))
  17021. }, "GetPrinterStatusInfo"),
  17022. vue.createElementVNode("button", {
  17023. type: "primary",
  17024. onClick: _cache[15] || (_cache[15] = (...args) => $options.CP_Pos_KickOutDrawer && $options.CP_Pos_KickOutDrawer(...args))
  17025. }, "CP_Pos_KickOutDrawer"),
  17026. vue.createElementVNode("button", {
  17027. type: "primary",
  17028. onClick: _cache[16] || (_cache[16] = (...args) => $options.CP_Pos_Beep && $options.CP_Pos_Beep(...args))
  17029. }, "CP_Pos_Beep"),
  17030. vue.createElementVNode("button", {
  17031. type: "primary",
  17032. onClick: _cache[17] || (_cache[17] = (...args) => $options.CP_Pos_PrintSelfTestPage && $options.CP_Pos_PrintSelfTestPage(...args))
  17033. }, "CP_Pos_PrintSelfTestPage"),
  17034. vue.createElementVNode("button", {
  17035. type: "primary",
  17036. onClick: _cache[18] || (_cache[18] = (...args) => $options.CP_Pos_ResetPrinter && $options.CP_Pos_ResetPrinter(...args))
  17037. }, "CP_Pos_ResetPrinter"),
  17038. vue.createElementVNode("button", {
  17039. type: "primary",
  17040. onClick: _cache[19] || (_cache[19] = (...args) => $options.CP_Pos_SetPrintSpeed_100 && $options.CP_Pos_SetPrintSpeed_100(...args))
  17041. }, "CP_Pos_SetPrintSpeed_100"),
  17042. vue.createElementVNode("button", {
  17043. type: "primary",
  17044. onClick: _cache[20] || (_cache[20] = (...args) => $options.CP_Pos_SetPrintSpeed_150 && $options.CP_Pos_SetPrintSpeed_150(...args))
  17045. }, "CP_Pos_SetPrintSpeed_150"),
  17046. vue.createElementVNode("button", {
  17047. type: "primary",
  17048. onClick: _cache[21] || (_cache[21] = (...args) => $options.CP_Pos_SetPrintDensity_7 && $options.CP_Pos_SetPrintDensity_7(...args))
  17049. }, "CP_Pos_SetPrintDensity_7"),
  17050. vue.createElementVNode("button", {
  17051. type: "primary",
  17052. onClick: _cache[22] || (_cache[22] = (...args) => $options.CP_Pos_SetPrintDensity_15 && $options.CP_Pos_SetPrintDensity_15(...args))
  17053. }, "CP_Pos_SetPrintDensity_15"),
  17054. vue.createElementVNode("button", {
  17055. type: "primary",
  17056. onClick: _cache[23] || (_cache[23] = (...args) => $options.CP_Label_EnableLabelMode && $options.CP_Label_EnableLabelMode(...args))
  17057. }, "CP_Label_EnableLabelMode"),
  17058. vue.createElementVNode("button", {
  17059. type: "primary",
  17060. onClick: _cache[24] || (_cache[24] = (...args) => $options.CP_Label_DisableLabelMode && $options.CP_Label_DisableLabelMode(...args))
  17061. }, "CP_Label_DisableLabelMode"),
  17062. vue.createElementVNode("button", {
  17063. type: "primary",
  17064. onClick: _cache[25] || (_cache[25] = (...args) => $options.CP_Label_CalibrateLabel && $options.CP_Label_CalibrateLabel(...args))
  17065. }, "CP_Label_CalibrateLabel"),
  17066. vue.createElementVNode("button", {
  17067. type: "primary",
  17068. onClick: _cache[26] || (_cache[26] = (...args) => $options.CP_Label_FeedLabel && $options.CP_Label_FeedLabel(...args))
  17069. }, "CP_Label_FeedLabel"),
  17070. vue.createElementVNode("button", {
  17071. type: "primary",
  17072. onClick: _cache[27] || (_cache[27] = (...args) => $options.CP_Label_PageBegin && $options.CP_Label_PageBegin(...args))
  17073. }, "CP_Label_PageBegin"),
  17074. vue.createElementVNode("button", {
  17075. type: "primary",
  17076. onClick: _cache[28] || (_cache[28] = (...args) => $options.CP_Label_PagePrint && $options.CP_Label_PagePrint(...args))
  17077. }, "CP_Label_PagePrint"),
  17078. vue.createElementVNode("button", {
  17079. type: "primary",
  17080. onClick: _cache[29] || (_cache[29] = (...args) => $options.CP_Label_DrawText && $options.CP_Label_DrawText(...args))
  17081. }, "CP_Label_DrawText"),
  17082. vue.createElementVNode("button", {
  17083. type: "primary",
  17084. onClick: _cache[30] || (_cache[30] = (...args) => $options.CP_Label_DrawTextInUTF8 && $options.CP_Label_DrawTextInUTF8(...args))
  17085. }, "CP_Label_DrawTextInUTF8"),
  17086. vue.createElementVNode("button", {
  17087. type: "primary",
  17088. onClick: _cache[31] || (_cache[31] = (...args) => $options.CP_Label_DrawTextInGBK && $options.CP_Label_DrawTextInGBK(...args))
  17089. }, "CP_Label_DrawTextInGBK"),
  17090. vue.createElementVNode("button", {
  17091. type: "primary",
  17092. onClick: _cache[32] || (_cache[32] = (...args) => $options.CP_Label_DrawBarcode && $options.CP_Label_DrawBarcode(...args))
  17093. }, "CP_Label_DrawBarcode"),
  17094. vue.createElementVNode("button", {
  17095. type: "primary",
  17096. onClick: _cache[33] || (_cache[33] = (...args) => $options.CP_Label_DrawQRCode && $options.CP_Label_DrawQRCode(...args))
  17097. }, "CP_Label_DrawQRCode"),
  17098. vue.createElementVNode("button", {
  17099. type: "primary",
  17100. onClick: _cache[34] || (_cache[34] = (...args) => $options.CP_Label_DrawPDF417Code && $options.CP_Label_DrawPDF417Code(...args))
  17101. }, "CP_Label_DrawPDF417Code"),
  17102. vue.createElementVNode("button", {
  17103. type: "primary",
  17104. onClick: _cache[35] || (_cache[35] = (...args) => $options.CP_Label_DrawImageFromFile && $options.CP_Label_DrawImageFromFile(...args))
  17105. }, "CP_Label_DrawImageFromFile"),
  17106. vue.createElementVNode("button", {
  17107. type: "primary",
  17108. onClick: _cache[36] || (_cache[36] = (...args) => $options.CP_Label_DrawImageFromPixels && $options.CP_Label_DrawImageFromPixels(...args))
  17109. }, "CP_Label_DrawImageFromPixels"),
  17110. vue.createElementVNode("button", {
  17111. type: "primary",
  17112. onClick: _cache[37] || (_cache[37] = (...args) => $options.CP_Label_DrawLine && $options.CP_Label_DrawLine(...args))
  17113. }, "CP_Label_DrawLine"),
  17114. vue.createElementVNode("button", {
  17115. type: "primary",
  17116. onClick: _cache[38] || (_cache[38] = (...args) => $options.CP_Label_DrawRect && $options.CP_Label_DrawRect(...args))
  17117. }, "CP_Label_DrawRect"),
  17118. vue.createElementVNode("button", {
  17119. type: "primary",
  17120. onClick: _cache[39] || (_cache[39] = (...args) => $options.CP_Label_DrawBox && $options.CP_Label_DrawBox(...args))
  17121. }, "CP_Label_DrawBox")
  17122. ])
  17123. ]);
  17124. }
  17125. const PagesPrinterLabel = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "E:/HBuilderProjects/yta/pages/printer/label.vue"]]);
  17126. __definePage("pages/home/index", PagesHomeIndex);
  17127. __definePage("pages/weigh/index", PagesWeighIndex);
  17128. __definePage("pages/weigh/instockLog", PagesWeighInstockLog);
  17129. __definePage("pages/inbound/index", PagesInboundIndex);
  17130. __definePage("pages/inbound/instockLog", PagesInboundInstockLog);
  17131. __definePage("pages/outbound/index", PagesOutboundIndex);
  17132. __definePage("pages/outbound/instockLog", PagesOutboundInstockLog);
  17133. __definePage("pages/profile/index", PagesProfileIndex);
  17134. __definePage("pages/login/index", PagesLoginIndex);
  17135. __definePage("pages/order/index", PagesOrderIndex);
  17136. __definePage("pages/scanLotno/index", PagesScanLotnoIndex);
  17137. __definePage("pages/scanLotno/lotnoLog", PagesScanLotnoLotnoLog);
  17138. __definePage("pages/scanLotno/waybillsList", PagesScanLotnoWaybillsList);
  17139. __definePage("pages/warehouseScan/index", PagesWarehouseScanIndex);
  17140. __definePage("pages/warehouseScan/warehouseLog", PagesWarehouseScanWarehouseLog);
  17141. __definePage("pages/waybillNo/index", PagesWaybillNoIndex);
  17142. __definePage("pages/waybillNo/waybillNoLog", PagesWaybillNoWaybillNoLog);
  17143. __definePage("pages/waybillDeliveryOrder/index", PagesWaybillDeliveryOrderIndex);
  17144. __definePage("pages/waybillDeliveryOrder/orderInfo", PagesWaybillDeliveryOrderOrderInfo);
  17145. __definePage("pages/printer/index", PagesPrinterIndex);
  17146. __definePage("pages/printer/label", PagesPrinterLabel);
  17147. const _sfc_main = {
  17148. onLaunch: function() {
  17149. formatAppLog("log", "at App.vue:4", "App Launch");
  17150. },
  17151. onShow: function() {
  17152. formatAppLog("log", "at App.vue:7", "App Show");
  17153. },
  17154. onHide: function() {
  17155. formatAppLog("log", "at App.vue:10", "App Hide");
  17156. }
  17157. };
  17158. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "E:/HBuilderProjects/yta/App.vue"]]);
  17159. function createApp() {
  17160. const app = vue.createVueApp(App);
  17161. return {
  17162. app
  17163. };
  17164. }
  17165. const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
  17166. uni.Vuex = __Vuex__;
  17167. uni.Pinia = __Pinia__;
  17168. __app__.provide("__globalStyles", __uniConfig.styles);
  17169. __app__._component.mpType = "app";
  17170. __app__._component.render = () => {
  17171. };
  17172. __app__.mount("#app");
  17173. })(Vue);