app-service.js 877 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415
  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 _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
  35. __name: "CustomNavbar",
  36. setup(__props, { expose: __expose }) {
  37. __expose();
  38. const { safeAreaInsets } = uni.getSystemInfoSync();
  39. const __returned__ = { safeAreaInsets };
  40. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  41. return __returned__;
  42. }
  43. });
  44. const _imports_0$2 = "/static/images/logo.png";
  45. const _export_sfc = (sfc, props) => {
  46. const target = sfc.__vccOpts || sfc;
  47. for (const [key, val] of props) {
  48. target[key] = val;
  49. }
  50. return target;
  51. };
  52. function _sfc_render$10(_ctx, _cache, $props, $setup, $data, $options) {
  53. return vue.openBlock(), vue.createElementBlock(
  54. "view",
  55. {
  56. class: "navbar",
  57. style: vue.normalizeStyle({ paddingTop: $setup.safeAreaInsets.top + 10 + "px" })
  58. },
  59. [
  60. vue.createCommentVNode(" logo文字 "),
  61. vue.createElementVNode("view", { class: "logo" }, [
  62. vue.createElementVNode("image", {
  63. class: "logo-image",
  64. src: _imports_0$2
  65. })
  66. ])
  67. ],
  68. 4
  69. /* STYLE */
  70. );
  71. }
  72. const CustomNavbar = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$10], ["__scopeId", "data-v-ff0d84a2"], ["__file", "E:/demo/hmrabbit/src/pages/index/components/CustomNavbar.vue"]]);
  73. const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
  74. __name: "CategoryPanel",
  75. props: {
  76. list: { type: Array, required: true }
  77. },
  78. setup(__props, { expose: __expose }) {
  79. __expose();
  80. const __returned__ = {};
  81. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  82. return __returned__;
  83. }
  84. });
  85. function _sfc_render$$(_ctx, _cache, $props, $setup, $data, $options) {
  86. return vue.openBlock(), vue.createElementBlock("view", { class: "category" }, [
  87. (vue.openBlock(true), vue.createElementBlock(
  88. vue.Fragment,
  89. null,
  90. vue.renderList($props.list, (item) => {
  91. return vue.openBlock(), vue.createElementBlock("navigator", {
  92. class: "category-item",
  93. "hover-class": "none",
  94. url: item.target,
  95. key: item.id
  96. }, [
  97. vue.createElementVNode(
  98. "view",
  99. {
  100. class: "icon",
  101. style: vue.normalizeStyle({
  102. "background-image": `linear-gradient(45deg, ${item.colors[0]} 0%, ${item.colors[1]} 99%, ${item.colors[0]} 100%)`
  103. })
  104. },
  105. [
  106. vue.createElementVNode("image", {
  107. class: "",
  108. src: item.icon
  109. }, null, 8, ["src"])
  110. ],
  111. 4
  112. /* STYLE */
  113. ),
  114. vue.createElementVNode(
  115. "text",
  116. { class: "text" },
  117. vue.toDisplayString(item.name),
  118. 1
  119. /* TEXT */
  120. )
  121. ], 8, ["url"]);
  122. }),
  123. 128
  124. /* KEYED_FRAGMENT */
  125. ))
  126. ]);
  127. }
  128. const CategoryPanel = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$$], ["__scopeId", "data-v-44ae5a81"], ["__file", "E:/demo/hmrabbit/src/pages/index/components/CategoryPanel.vue"]]);
  129. const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
  130. __name: "index",
  131. setup(__props, { expose: __expose }) {
  132. __expose();
  133. const categoryList = vue.ref([
  134. {
  135. colors: ["#4facfe", "#00f2fe"],
  136. target: "/pages/inbound/inbound",
  137. icon: "/static/home/inbound.png",
  138. name: "入库"
  139. },
  140. {
  141. colors: ["#6991c7", "#a3bded"],
  142. target: "/pages/weigh/weigh",
  143. icon: "/static/home/weigh.png",
  144. name: "称重"
  145. },
  146. {
  147. colors: ["#005bea", "#00c6fb"],
  148. target: "/pages/outbound/outbound",
  149. icon: "/static/home/outbound.png",
  150. name: "出库"
  151. },
  152. {
  153. colors: ["#667eea", "#764ba2"],
  154. target: "/pages/warehouseScan/warehouseScan",
  155. icon: "/static/home/houscan.png",
  156. name: "仓库扫描"
  157. },
  158. {
  159. colors: ["#f83600", "#f9d423"],
  160. target: "/pages/printer/printer",
  161. icon: "/static/home/houscan.png",
  162. name: "打印"
  163. },
  164. {
  165. colors: ["#ff0844", "#ffb199"],
  166. target: "/pages/scanLotno/scanLotno",
  167. icon: "/static/home/link.png",
  168. name: "托盘/批次"
  169. },
  170. {
  171. colors: ["#29323c", "#485563"],
  172. target: "/pages/waybillNo/waybillNo",
  173. icon: "/static/home/link.png",
  174. name: "库位绑定"
  175. },
  176. {
  177. colors: ["#2af598", "#009efd"],
  178. target: "/pages/pickup/waybillPickUpOrder",
  179. icon: "/static/home/pickup.png",
  180. name: "取件单"
  181. },
  182. {
  183. colors: ["#4facfe", "#00f2fe"],
  184. target: "/pages/waybillDeliveryOrder/waybillDeliveryOrder",
  185. icon: "/static/home/dispatch.png",
  186. name: "派送单"
  187. }
  188. ]);
  189. const __returned__ = { categoryList, CustomNavbar, CategoryPanel };
  190. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  191. return __returned__;
  192. }
  193. });
  194. function _sfc_render$_(_ctx, _cache, $props, $setup, $data, $options) {
  195. return vue.openBlock(), vue.createElementBlock("view", { class: "viewport" }, [
  196. vue.createCommentVNode(" 自定义导航栏 "),
  197. vue.createVNode($setup["CustomNavbar"]),
  198. vue.createCommentVNode(" 滚动容器 "),
  199. vue.createElementVNode("scroll-view", {
  200. "enable-back-to-top": "",
  201. "refresher-enabled": false,
  202. class: "scroll-view",
  203. "scroll-y": ""
  204. }, [
  205. vue.createCommentVNode(" 分类面板 "),
  206. vue.createVNode($setup["CategoryPanel"], { list: $setup.categoryList }, null, 8, ["list"])
  207. ])
  208. ]);
  209. }
  210. const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["render", _sfc_render$_], ["__file", "E:/demo/hmrabbit/src/pages/index/index.vue"]]);
  211. const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
  212. __name: "XtxSwiper",
  213. props: {
  214. list: { type: Array, required: true }
  215. },
  216. setup(__props, { expose: __expose }) {
  217. __expose();
  218. const activeIndex = vue.ref(0);
  219. const onChange = (ev) => {
  220. activeIndex.value = ev.detail.current;
  221. };
  222. const __returned__ = { activeIndex, onChange };
  223. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  224. return __returned__;
  225. }
  226. });
  227. function _sfc_render$Z(_ctx, _cache, $props, $setup, $data, $options) {
  228. return vue.openBlock(), vue.createElementBlock("view", { class: "carousel" }, [
  229. vue.createElementVNode(
  230. "swiper",
  231. {
  232. circular: true,
  233. autoplay: false,
  234. interval: 3e3,
  235. onChange: $setup.onChange
  236. },
  237. [
  238. (vue.openBlock(true), vue.createElementBlock(
  239. vue.Fragment,
  240. null,
  241. vue.renderList($props.list, (item) => {
  242. return vue.openBlock(), vue.createElementBlock("swiper-item", {
  243. key: item.id
  244. }, [
  245. vue.createElementVNode("navigator", {
  246. url: "/pages/index/index",
  247. "hover-class": "none",
  248. class: "navigator"
  249. }, [
  250. vue.createElementVNode("image", {
  251. mode: "aspectFill",
  252. class: "image",
  253. src: item.imgUrl
  254. }, null, 8, ["src"])
  255. ])
  256. ]);
  257. }),
  258. 128
  259. /* KEYED_FRAGMENT */
  260. ))
  261. ],
  262. 32
  263. /* NEED_HYDRATION */
  264. ),
  265. vue.createCommentVNode(" 指示点 "),
  266. vue.createElementVNode("view", { class: "indicator" }, [
  267. (vue.openBlock(true), vue.createElementBlock(
  268. vue.Fragment,
  269. null,
  270. vue.renderList($props.list, (item, index) => {
  271. return vue.openBlock(), vue.createElementBlock(
  272. "text",
  273. {
  274. key: item.id,
  275. class: vue.normalizeClass(["dot", { active: index === $setup.activeIndex }])
  276. },
  277. null,
  278. 2
  279. /* CLASS */
  280. );
  281. }),
  282. 128
  283. /* KEYED_FRAGMENT */
  284. ))
  285. ])
  286. ]);
  287. }
  288. const __easycom_0$c = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$Z], ["__scopeId", "data-v-17cc3903"], ["__file", "E:/demo/hmrabbit/src/components/XtxSwiper.vue"]]);
  289. const ON_SHOW = "onShow";
  290. const ON_HIDE = "onHide";
  291. const ON_LAUNCH = "onLaunch";
  292. const ON_LOAD = "onLoad";
  293. const ON_UNLOAD = "onUnload";
  294. const ON_BACK_PRESS = "onBackPress";
  295. const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  296. function requireNativePlugin(name) {
  297. return weex.requireModule(name);
  298. }
  299. function formatAppLog(type, filename, ...args) {
  300. if (uni.__log__) {
  301. uni.__log__(type, filename, ...args);
  302. } else {
  303. console[type].apply(console, [...args, filename]);
  304. }
  305. }
  306. function resolveEasycom(component, easycom2) {
  307. return typeof component === "string" ? easycom2 : component;
  308. }
  309. const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) => {
  310. !vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
  311. };
  312. const onShow = /* @__PURE__ */ createHook(ON_SHOW);
  313. const onHide = /* @__PURE__ */ createHook(ON_HIDE);
  314. const onLaunch = /* @__PURE__ */ createHook(ON_LAUNCH);
  315. const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
  316. const onUnload = /* @__PURE__ */ createHook(ON_UNLOAD);
  317. const onBackPress = /* @__PURE__ */ createHook(ON_BACK_PRESS);
  318. const onNavigationBarButtonTap = /* @__PURE__ */ createHook(ON_NAVIGATION_BAR_BUTTON_TAP);
  319. var isVue2 = false;
  320. function set$1(target, key, val) {
  321. if (Array.isArray(target)) {
  322. target.length = Math.max(target.length, key);
  323. target.splice(key, 1, val);
  324. return val;
  325. }
  326. target[key] = val;
  327. return val;
  328. }
  329. function del(target, key) {
  330. if (Array.isArray(target)) {
  331. target.splice(key, 1);
  332. return;
  333. }
  334. delete target[key];
  335. }
  336. function getDevtoolsGlobalHook() {
  337. return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
  338. }
  339. function getTarget() {
  340. return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
  341. }
  342. const isProxyAvailable = typeof Proxy === "function";
  343. const HOOK_SETUP = "devtools-plugin:setup";
  344. const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
  345. let supported;
  346. let perf;
  347. function isPerformanceSupported() {
  348. var _a;
  349. if (supported !== void 0) {
  350. return supported;
  351. }
  352. if (typeof window !== "undefined" && window.performance) {
  353. supported = true;
  354. perf = window.performance;
  355. } else if (typeof global !== "undefined" && ((_a = global.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
  356. supported = true;
  357. perf = global.perf_hooks.performance;
  358. } else {
  359. supported = false;
  360. }
  361. return supported;
  362. }
  363. function now() {
  364. return isPerformanceSupported() ? perf.now() : Date.now();
  365. }
  366. class ApiProxy {
  367. constructor(plugin, hook) {
  368. this.target = null;
  369. this.targetQueue = [];
  370. this.onQueue = [];
  371. this.plugin = plugin;
  372. this.hook = hook;
  373. const defaultSettings = {};
  374. if (plugin.settings) {
  375. for (const id in plugin.settings) {
  376. const item = plugin.settings[id];
  377. defaultSettings[id] = item.defaultValue;
  378. }
  379. }
  380. const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
  381. let currentSettings = Object.assign({}, defaultSettings);
  382. try {
  383. const raw = localStorage.getItem(localSettingsSaveId);
  384. const data = JSON.parse(raw);
  385. Object.assign(currentSettings, data);
  386. } catch (e2) {
  387. }
  388. this.fallbacks = {
  389. getSettings() {
  390. return currentSettings;
  391. },
  392. setSettings(value) {
  393. try {
  394. localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
  395. } catch (e2) {
  396. }
  397. currentSettings = value;
  398. },
  399. now() {
  400. return now();
  401. }
  402. };
  403. if (hook) {
  404. hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
  405. if (pluginId === this.plugin.id) {
  406. this.fallbacks.setSettings(value);
  407. }
  408. });
  409. }
  410. this.proxiedOn = new Proxy({}, {
  411. get: (_target, prop) => {
  412. if (this.target) {
  413. return this.target.on[prop];
  414. } else {
  415. return (...args) => {
  416. this.onQueue.push({
  417. method: prop,
  418. args
  419. });
  420. };
  421. }
  422. }
  423. });
  424. this.proxiedTarget = new Proxy({}, {
  425. get: (_target, prop) => {
  426. if (this.target) {
  427. return this.target[prop];
  428. } else if (prop === "on") {
  429. return this.proxiedOn;
  430. } else if (Object.keys(this.fallbacks).includes(prop)) {
  431. return (...args) => {
  432. this.targetQueue.push({
  433. method: prop,
  434. args,
  435. resolve: () => {
  436. }
  437. });
  438. return this.fallbacks[prop](...args);
  439. };
  440. } else {
  441. return (...args) => {
  442. return new Promise((resolve) => {
  443. this.targetQueue.push({
  444. method: prop,
  445. args,
  446. resolve
  447. });
  448. });
  449. };
  450. }
  451. }
  452. });
  453. }
  454. async setRealTarget(target) {
  455. this.target = target;
  456. for (const item of this.onQueue) {
  457. this.target.on[item.method](...item.args);
  458. }
  459. for (const item of this.targetQueue) {
  460. item.resolve(await this.target[item.method](...item.args));
  461. }
  462. }
  463. }
  464. function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
  465. const descriptor = pluginDescriptor;
  466. const target = getTarget();
  467. const hook = getDevtoolsGlobalHook();
  468. const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;
  469. if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
  470. hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
  471. } else {
  472. const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;
  473. const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
  474. list.push({
  475. pluginDescriptor: descriptor,
  476. setupFn,
  477. proxy
  478. });
  479. if (proxy)
  480. setupFn(proxy.proxiedTarget);
  481. }
  482. }
  483. /*!
  484. * pinia v2.0.27
  485. * (c) 2022 Eduardo San Martin Morote
  486. * @license MIT
  487. */
  488. let activePinia;
  489. const setActivePinia = (pinia2) => activePinia = pinia2;
  490. const piniaSymbol = Symbol("pinia");
  491. function isPlainObject(o2) {
  492. return o2 && typeof o2 === "object" && Object.prototype.toString.call(o2) === "[object Object]" && typeof o2.toJSON !== "function";
  493. }
  494. var MutationType;
  495. (function(MutationType2) {
  496. MutationType2["direct"] = "direct";
  497. MutationType2["patchObject"] = "patch object";
  498. MutationType2["patchFunction"] = "patch function";
  499. })(MutationType || (MutationType = {}));
  500. const IS_CLIENT = typeof window !== "undefined";
  501. const USE_DEVTOOLS = IS_CLIENT;
  502. const _global = /* @__PURE__ */ (() => typeof window === "object" && window.window === window ? window : typeof self === "object" && self.self === self ? self : typeof global === "object" && global.global === global ? global : typeof globalThis === "object" ? globalThis : { HTMLElement: null })();
  503. function bom(blob, { autoBom = false } = {}) {
  504. if (autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
  505. return new Blob([String.fromCharCode(65279), blob], { type: blob.type });
  506. }
  507. return blob;
  508. }
  509. function download(url, name, opts) {
  510. const xhr = new XMLHttpRequest();
  511. xhr.open("GET", url);
  512. xhr.responseType = "blob";
  513. xhr.onload = function() {
  514. saveAs(xhr.response, name, opts);
  515. };
  516. xhr.onerror = function() {
  517. console.error("could not download file");
  518. };
  519. xhr.send();
  520. }
  521. function corsEnabled(url) {
  522. const xhr = new XMLHttpRequest();
  523. xhr.open("HEAD", url, false);
  524. try {
  525. xhr.send();
  526. } catch (e2) {
  527. }
  528. return xhr.status >= 200 && xhr.status <= 299;
  529. }
  530. function click(node) {
  531. try {
  532. node.dispatchEvent(new MouseEvent("click"));
  533. } catch (e2) {
  534. const evt = document.createEvent("MouseEvents");
  535. evt.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
  536. node.dispatchEvent(evt);
  537. }
  538. }
  539. const _navigator = typeof navigator === "object" ? navigator : { userAgent: "" };
  540. const isMacOSWebView = /* @__PURE__ */ (() => /Macintosh/.test(_navigator.userAgent) && /AppleWebKit/.test(_navigator.userAgent) && !/Safari/.test(_navigator.userAgent))();
  541. const saveAs = !IS_CLIENT ? () => {
  542. } : (
  543. // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
  544. typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype && !isMacOSWebView ? downloadSaveAs : (
  545. // Use msSaveOrOpenBlob as a second approach
  546. "msSaveOrOpenBlob" in _navigator ? msSaveAs : (
  547. // Fallback to using FileReader and a popup
  548. fileSaverSaveAs
  549. )
  550. )
  551. );
  552. function downloadSaveAs(blob, name = "download", opts) {
  553. const a2 = document.createElement("a");
  554. a2.download = name;
  555. a2.rel = "noopener";
  556. if (typeof blob === "string") {
  557. a2.href = blob;
  558. if (a2.origin !== location.origin) {
  559. if (corsEnabled(a2.href)) {
  560. download(blob, name, opts);
  561. } else {
  562. a2.target = "_blank";
  563. click(a2);
  564. }
  565. } else {
  566. click(a2);
  567. }
  568. } else {
  569. a2.href = URL.createObjectURL(blob);
  570. setTimeout(function() {
  571. URL.revokeObjectURL(a2.href);
  572. }, 4e4);
  573. setTimeout(function() {
  574. click(a2);
  575. }, 0);
  576. }
  577. }
  578. function msSaveAs(blob, name = "download", opts) {
  579. if (typeof blob === "string") {
  580. if (corsEnabled(blob)) {
  581. download(blob, name, opts);
  582. } else {
  583. const a2 = document.createElement("a");
  584. a2.href = blob;
  585. a2.target = "_blank";
  586. setTimeout(function() {
  587. click(a2);
  588. });
  589. }
  590. } else {
  591. navigator.msSaveOrOpenBlob(bom(blob, opts), name);
  592. }
  593. }
  594. function fileSaverSaveAs(blob, name, opts, popup2) {
  595. popup2 = popup2 || open("", "_blank");
  596. if (popup2) {
  597. popup2.document.title = popup2.document.body.innerText = "downloading...";
  598. }
  599. if (typeof blob === "string")
  600. return download(blob, name, opts);
  601. const force = blob.type === "application/octet-stream";
  602. const isSafari = /constructor/i.test(String(_global.HTMLElement)) || "safari" in _global;
  603. const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
  604. if ((isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== "undefined") {
  605. const reader = new FileReader();
  606. reader.onloadend = function() {
  607. let url = reader.result;
  608. if (typeof url !== "string") {
  609. popup2 = null;
  610. throw new Error("Wrong reader.result type");
  611. }
  612. url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, "data:attachment/file;");
  613. if (popup2) {
  614. popup2.location.href = url;
  615. } else {
  616. location.assign(url);
  617. }
  618. popup2 = null;
  619. };
  620. reader.readAsDataURL(blob);
  621. } else {
  622. const url = URL.createObjectURL(blob);
  623. if (popup2)
  624. popup2.location.assign(url);
  625. else
  626. location.href = url;
  627. popup2 = null;
  628. setTimeout(function() {
  629. URL.revokeObjectURL(url);
  630. }, 4e4);
  631. }
  632. }
  633. function toastMessage(message, type) {
  634. const piniaMessage = "🍍 " + message;
  635. if (typeof __VUE_DEVTOOLS_TOAST__ === "function") {
  636. __VUE_DEVTOOLS_TOAST__(piniaMessage, type);
  637. } else if (type === "error") {
  638. console.error(piniaMessage);
  639. } else if (type === "warn") {
  640. console.warn(piniaMessage);
  641. } else {
  642. console.log(piniaMessage);
  643. }
  644. }
  645. function isPinia(o2) {
  646. return "_a" in o2 && "install" in o2;
  647. }
  648. function checkClipboardAccess() {
  649. if (!("clipboard" in navigator)) {
  650. toastMessage(`Your browser doesn't support the Clipboard API`, "error");
  651. return true;
  652. }
  653. }
  654. function checkNotFocusedError(error) {
  655. if (error instanceof Error && error.message.toLowerCase().includes("document is not focused")) {
  656. toastMessage('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn");
  657. return true;
  658. }
  659. return false;
  660. }
  661. async function actionGlobalCopyState(pinia2) {
  662. if (checkClipboardAccess())
  663. return;
  664. try {
  665. await navigator.clipboard.writeText(JSON.stringify(pinia2.state.value));
  666. toastMessage("Global state copied to clipboard.");
  667. } catch (error) {
  668. if (checkNotFocusedError(error))
  669. return;
  670. toastMessage(`Failed to serialize the state. Check the console for more details.`, "error");
  671. console.error(error);
  672. }
  673. }
  674. async function actionGlobalPasteState(pinia2) {
  675. if (checkClipboardAccess())
  676. return;
  677. try {
  678. pinia2.state.value = JSON.parse(await navigator.clipboard.readText());
  679. toastMessage("Global state pasted from clipboard.");
  680. } catch (error) {
  681. if (checkNotFocusedError(error))
  682. return;
  683. toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, "error");
  684. console.error(error);
  685. }
  686. }
  687. async function actionGlobalSaveState(pinia2) {
  688. try {
  689. saveAs(new Blob([JSON.stringify(pinia2.state.value)], {
  690. type: "text/plain;charset=utf-8"
  691. }), "pinia-state.json");
  692. } catch (error) {
  693. toastMessage(`Failed to export the state as JSON. Check the console for more details.`, "error");
  694. console.error(error);
  695. }
  696. }
  697. let fileInput;
  698. function getFileOpener() {
  699. if (!fileInput) {
  700. fileInput = document.createElement("input");
  701. fileInput.type = "file";
  702. fileInput.accept = ".json";
  703. }
  704. function openFile() {
  705. return new Promise((resolve, reject) => {
  706. fileInput.onchange = async () => {
  707. const files = fileInput.files;
  708. if (!files)
  709. return resolve(null);
  710. const file = files.item(0);
  711. if (!file)
  712. return resolve(null);
  713. return resolve({ text: await file.text(), file });
  714. };
  715. fileInput.oncancel = () => resolve(null);
  716. fileInput.onerror = reject;
  717. fileInput.click();
  718. });
  719. }
  720. return openFile;
  721. }
  722. async function actionGlobalOpenStateFile(pinia2) {
  723. try {
  724. const open2 = await getFileOpener();
  725. const result = await open2();
  726. if (!result)
  727. return;
  728. const { text, file } = result;
  729. pinia2.state.value = JSON.parse(text);
  730. toastMessage(`Global state imported from "${file.name}".`);
  731. } catch (error) {
  732. toastMessage(`Failed to export the state as JSON. Check the console for more details.`, "error");
  733. console.error(error);
  734. }
  735. }
  736. function formatDisplay(display) {
  737. return {
  738. _custom: {
  739. display
  740. }
  741. };
  742. }
  743. const PINIA_ROOT_LABEL = "🍍 Pinia (root)";
  744. const PINIA_ROOT_ID = "_root";
  745. function formatStoreForInspectorTree(store) {
  746. return isPinia(store) ? {
  747. id: PINIA_ROOT_ID,
  748. label: PINIA_ROOT_LABEL
  749. } : {
  750. id: store.$id,
  751. label: store.$id
  752. };
  753. }
  754. function formatStoreForInspectorState(store) {
  755. if (isPinia(store)) {
  756. const storeNames = Array.from(store._s.keys());
  757. const storeMap = store._s;
  758. const state2 = {
  759. state: storeNames.map((storeId) => ({
  760. editable: true,
  761. key: storeId,
  762. value: store.state.value[storeId]
  763. })),
  764. getters: storeNames.filter((id) => storeMap.get(id)._getters).map((id) => {
  765. const store2 = storeMap.get(id);
  766. return {
  767. editable: false,
  768. key: id,
  769. value: store2._getters.reduce((getters, key) => {
  770. getters[key] = store2[key];
  771. return getters;
  772. }, {})
  773. };
  774. })
  775. };
  776. return state2;
  777. }
  778. const state = {
  779. state: Object.keys(store.$state).map((key) => ({
  780. editable: true,
  781. key,
  782. value: store.$state[key]
  783. }))
  784. };
  785. if (store._getters && store._getters.length) {
  786. state.getters = store._getters.map((getterName) => ({
  787. editable: false,
  788. key: getterName,
  789. value: store[getterName]
  790. }));
  791. }
  792. if (store._customProperties.size) {
  793. state.customProperties = Array.from(store._customProperties).map((key) => ({
  794. editable: true,
  795. key,
  796. value: store[key]
  797. }));
  798. }
  799. return state;
  800. }
  801. function formatEventData(events) {
  802. if (!events)
  803. return {};
  804. if (Array.isArray(events)) {
  805. return events.reduce((data, event) => {
  806. data.keys.push(event.key);
  807. data.operations.push(event.type);
  808. data.oldValue[event.key] = event.oldValue;
  809. data.newValue[event.key] = event.newValue;
  810. return data;
  811. }, {
  812. oldValue: {},
  813. keys: [],
  814. operations: [],
  815. newValue: {}
  816. });
  817. } else {
  818. return {
  819. operation: formatDisplay(events.type),
  820. key: formatDisplay(events.key),
  821. oldValue: events.oldValue,
  822. newValue: events.newValue
  823. };
  824. }
  825. }
  826. function formatMutationType(type) {
  827. switch (type) {
  828. case MutationType.direct:
  829. return "mutation";
  830. case MutationType.patchFunction:
  831. return "$patch";
  832. case MutationType.patchObject:
  833. return "$patch";
  834. default:
  835. return "unknown";
  836. }
  837. }
  838. let isTimelineActive = true;
  839. const componentStateTypes = [];
  840. const MUTATIONS_LAYER_ID = "pinia:mutations";
  841. const INSPECTOR_ID = "pinia";
  842. const getStoreType = (id) => "🍍 " + id;
  843. function registerPiniaDevtools(app, pinia2) {
  844. setupDevtoolsPlugin({
  845. id: "dev.esm.pinia",
  846. label: "Pinia 🍍",
  847. logo: "https://pinia.vuejs.org/logo.svg",
  848. packageName: "pinia",
  849. homepage: "https://pinia.vuejs.org",
  850. componentStateTypes,
  851. app
  852. }, (api) => {
  853. if (typeof api.now !== "function") {
  854. toastMessage("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.");
  855. }
  856. api.addTimelineLayer({
  857. id: MUTATIONS_LAYER_ID,
  858. label: `Pinia 🍍`,
  859. color: 15064968
  860. });
  861. api.addInspector({
  862. id: INSPECTOR_ID,
  863. label: "Pinia 🍍",
  864. icon: "storage",
  865. treeFilterPlaceholder: "Search stores",
  866. actions: [
  867. {
  868. icon: "content_copy",
  869. action: () => {
  870. actionGlobalCopyState(pinia2);
  871. },
  872. tooltip: "Serialize and copy the state"
  873. },
  874. {
  875. icon: "content_paste",
  876. action: async () => {
  877. await actionGlobalPasteState(pinia2);
  878. api.sendInspectorTree(INSPECTOR_ID);
  879. api.sendInspectorState(INSPECTOR_ID);
  880. },
  881. tooltip: "Replace the state with the content of your clipboard"
  882. },
  883. {
  884. icon: "save",
  885. action: () => {
  886. actionGlobalSaveState(pinia2);
  887. },
  888. tooltip: "Save the state as a JSON file"
  889. },
  890. {
  891. icon: "folder_open",
  892. action: async () => {
  893. await actionGlobalOpenStateFile(pinia2);
  894. api.sendInspectorTree(INSPECTOR_ID);
  895. api.sendInspectorState(INSPECTOR_ID);
  896. },
  897. tooltip: "Import the state from a JSON file"
  898. }
  899. ],
  900. nodeActions: [
  901. {
  902. icon: "restore",
  903. tooltip: "Reset the state (option store only)",
  904. action: (nodeId) => {
  905. const store = pinia2._s.get(nodeId);
  906. if (!store) {
  907. toastMessage(`Cannot reset "${nodeId}" store because it wasn't found.`, "warn");
  908. } else if (!store._isOptionsAPI) {
  909. toastMessage(`Cannot reset "${nodeId}" store because it's a setup store.`, "warn");
  910. } else {
  911. store.$reset();
  912. toastMessage(`Store "${nodeId}" reset.`);
  913. }
  914. }
  915. }
  916. ]
  917. });
  918. api.on.inspectComponent((payload, ctx) => {
  919. const proxy = payload.componentInstance && payload.componentInstance.proxy;
  920. if (proxy && proxy._pStores) {
  921. const piniaStores = payload.componentInstance.proxy._pStores;
  922. Object.values(piniaStores).forEach((store) => {
  923. payload.instanceData.state.push({
  924. type: getStoreType(store.$id),
  925. key: "state",
  926. editable: true,
  927. value: store._isOptionsAPI ? {
  928. _custom: {
  929. value: vue.toRaw(store.$state),
  930. actions: [
  931. {
  932. icon: "restore",
  933. tooltip: "Reset the state of this store",
  934. action: () => store.$reset()
  935. }
  936. ]
  937. }
  938. } : (
  939. // NOTE: workaround to unwrap transferred refs
  940. Object.keys(store.$state).reduce((state, key) => {
  941. state[key] = store.$state[key];
  942. return state;
  943. }, {})
  944. )
  945. });
  946. if (store._getters && store._getters.length) {
  947. payload.instanceData.state.push({
  948. type: getStoreType(store.$id),
  949. key: "getters",
  950. editable: false,
  951. value: store._getters.reduce((getters, key) => {
  952. try {
  953. getters[key] = store[key];
  954. } catch (error) {
  955. getters[key] = error;
  956. }
  957. return getters;
  958. }, {})
  959. });
  960. }
  961. });
  962. }
  963. });
  964. api.on.getInspectorTree((payload) => {
  965. if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
  966. let stores = [pinia2];
  967. stores = stores.concat(Array.from(pinia2._s.values()));
  968. payload.rootNodes = (payload.filter ? stores.filter((store) => "$id" in store ? store.$id.toLowerCase().includes(payload.filter.toLowerCase()) : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase())) : stores).map(formatStoreForInspectorTree);
  969. }
  970. });
  971. api.on.getInspectorState((payload) => {
  972. if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
  973. const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia2 : pinia2._s.get(payload.nodeId);
  974. if (!inspectedStore) {
  975. return;
  976. }
  977. if (inspectedStore) {
  978. payload.state = formatStoreForInspectorState(inspectedStore);
  979. }
  980. }
  981. });
  982. api.on.editInspectorState((payload, ctx) => {
  983. if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
  984. const inspectedStore = payload.nodeId === PINIA_ROOT_ID ? pinia2 : pinia2._s.get(payload.nodeId);
  985. if (!inspectedStore) {
  986. return toastMessage(`store "${payload.nodeId}" not found`, "error");
  987. }
  988. const { path } = payload;
  989. if (!isPinia(inspectedStore)) {
  990. if (path.length !== 1 || !inspectedStore._customProperties.has(path[0]) || path[0] in inspectedStore.$state) {
  991. path.unshift("$state");
  992. }
  993. } else {
  994. path.unshift("state");
  995. }
  996. isTimelineActive = false;
  997. payload.set(inspectedStore, path, payload.state.value);
  998. isTimelineActive = true;
  999. }
  1000. });
  1001. api.on.editComponentState((payload) => {
  1002. if (payload.type.startsWith("🍍")) {
  1003. const storeId = payload.type.replace(/^🍍\s*/, "");
  1004. const store = pinia2._s.get(storeId);
  1005. if (!store) {
  1006. return toastMessage(`store "${storeId}" not found`, "error");
  1007. }
  1008. const { path } = payload;
  1009. if (path[0] !== "state") {
  1010. return toastMessage(`Invalid path for store "${storeId}":
  1011. ${path}
  1012. Only state can be modified.`);
  1013. }
  1014. path[0] = "$state";
  1015. isTimelineActive = false;
  1016. payload.set(store, path, payload.state.value);
  1017. isTimelineActive = true;
  1018. }
  1019. });
  1020. });
  1021. }
  1022. function addStoreToDevtools(app, store) {
  1023. if (!componentStateTypes.includes(getStoreType(store.$id))) {
  1024. componentStateTypes.push(getStoreType(store.$id));
  1025. }
  1026. setupDevtoolsPlugin({
  1027. id: "dev.esm.pinia",
  1028. label: "Pinia 🍍",
  1029. logo: "https://pinia.vuejs.org/logo.svg",
  1030. packageName: "pinia",
  1031. homepage: "https://pinia.vuejs.org",
  1032. componentStateTypes,
  1033. app,
  1034. settings: {
  1035. logStoreChanges: {
  1036. label: "Notify about new/deleted stores",
  1037. type: "boolean",
  1038. defaultValue: true
  1039. }
  1040. // useEmojis: {
  1041. // label: 'Use emojis in messages ⚡️',
  1042. // type: 'boolean',
  1043. // defaultValue: true,
  1044. // },
  1045. }
  1046. }, (api) => {
  1047. const now2 = typeof api.now === "function" ? api.now.bind(api) : Date.now;
  1048. store.$onAction(({ after, onError, name, args }) => {
  1049. const groupId = runningActionId++;
  1050. api.addTimelineEvent({
  1051. layerId: MUTATIONS_LAYER_ID,
  1052. event: {
  1053. time: now2(),
  1054. title: "🛫 " + name,
  1055. subtitle: "start",
  1056. data: {
  1057. store: formatDisplay(store.$id),
  1058. action: formatDisplay(name),
  1059. args
  1060. },
  1061. groupId
  1062. }
  1063. });
  1064. after((result) => {
  1065. activeAction = void 0;
  1066. api.addTimelineEvent({
  1067. layerId: MUTATIONS_LAYER_ID,
  1068. event: {
  1069. time: now2(),
  1070. title: "🛬 " + name,
  1071. subtitle: "end",
  1072. data: {
  1073. store: formatDisplay(store.$id),
  1074. action: formatDisplay(name),
  1075. args,
  1076. result
  1077. },
  1078. groupId
  1079. }
  1080. });
  1081. });
  1082. onError((error) => {
  1083. activeAction = void 0;
  1084. api.addTimelineEvent({
  1085. layerId: MUTATIONS_LAYER_ID,
  1086. event: {
  1087. time: now2(),
  1088. logType: "error",
  1089. title: "💥 " + name,
  1090. subtitle: "end",
  1091. data: {
  1092. store: formatDisplay(store.$id),
  1093. action: formatDisplay(name),
  1094. args,
  1095. error
  1096. },
  1097. groupId
  1098. }
  1099. });
  1100. });
  1101. }, true);
  1102. store._customProperties.forEach((name) => {
  1103. vue.watch(() => vue.unref(store[name]), (newValue, oldValue) => {
  1104. api.notifyComponentUpdate();
  1105. api.sendInspectorState(INSPECTOR_ID);
  1106. if (isTimelineActive) {
  1107. api.addTimelineEvent({
  1108. layerId: MUTATIONS_LAYER_ID,
  1109. event: {
  1110. time: now2(),
  1111. title: "Change",
  1112. subtitle: name,
  1113. data: {
  1114. newValue,
  1115. oldValue
  1116. },
  1117. groupId: activeAction
  1118. }
  1119. });
  1120. }
  1121. }, { deep: true });
  1122. });
  1123. store.$subscribe(({ events, type }, state) => {
  1124. api.notifyComponentUpdate();
  1125. api.sendInspectorState(INSPECTOR_ID);
  1126. if (!isTimelineActive)
  1127. return;
  1128. const eventData = {
  1129. time: now2(),
  1130. title: formatMutationType(type),
  1131. data: {
  1132. store: formatDisplay(store.$id),
  1133. ...formatEventData(events)
  1134. },
  1135. groupId: activeAction
  1136. };
  1137. activeAction = void 0;
  1138. if (type === MutationType.patchFunction) {
  1139. eventData.subtitle = "⤵️";
  1140. } else if (type === MutationType.patchObject) {
  1141. eventData.subtitle = "🧩";
  1142. } else if (events && !Array.isArray(events)) {
  1143. eventData.subtitle = events.type;
  1144. }
  1145. if (events) {
  1146. eventData.data["rawEvent(s)"] = {
  1147. _custom: {
  1148. display: "DebuggerEvent",
  1149. type: "object",
  1150. tooltip: "raw DebuggerEvent[]",
  1151. value: events
  1152. }
  1153. };
  1154. }
  1155. api.addTimelineEvent({
  1156. layerId: MUTATIONS_LAYER_ID,
  1157. event: eventData
  1158. });
  1159. }, { detached: true, flush: "sync" });
  1160. const hotUpdate = store._hotUpdate;
  1161. store._hotUpdate = vue.markRaw((newStore) => {
  1162. hotUpdate(newStore);
  1163. api.addTimelineEvent({
  1164. layerId: MUTATIONS_LAYER_ID,
  1165. event: {
  1166. time: now2(),
  1167. title: "🔥 " + store.$id,
  1168. subtitle: "HMR update",
  1169. data: {
  1170. store: formatDisplay(store.$id),
  1171. info: formatDisplay(`HMR update`)
  1172. }
  1173. }
  1174. });
  1175. api.notifyComponentUpdate();
  1176. api.sendInspectorTree(INSPECTOR_ID);
  1177. api.sendInspectorState(INSPECTOR_ID);
  1178. });
  1179. const { $dispose } = store;
  1180. store.$dispose = () => {
  1181. $dispose();
  1182. api.notifyComponentUpdate();
  1183. api.sendInspectorTree(INSPECTOR_ID);
  1184. api.sendInspectorState(INSPECTOR_ID);
  1185. api.getSettings().logStoreChanges && toastMessage(`Disposed "${store.$id}" store 🗑`);
  1186. };
  1187. api.notifyComponentUpdate();
  1188. api.sendInspectorTree(INSPECTOR_ID);
  1189. api.sendInspectorState(INSPECTOR_ID);
  1190. api.getSettings().logStoreChanges && toastMessage(`"${store.$id}" store installed 🆕`);
  1191. });
  1192. }
  1193. let runningActionId = 0;
  1194. let activeAction;
  1195. function patchActionForGrouping(store, actionNames) {
  1196. const actions = actionNames.reduce((storeActions, actionName) => {
  1197. storeActions[actionName] = vue.toRaw(store)[actionName];
  1198. return storeActions;
  1199. }, {});
  1200. for (const actionName in actions) {
  1201. store[actionName] = function() {
  1202. const _actionId = runningActionId;
  1203. const trackedStore = new Proxy(store, {
  1204. get(...args) {
  1205. activeAction = _actionId;
  1206. return Reflect.get(...args);
  1207. },
  1208. set(...args) {
  1209. activeAction = _actionId;
  1210. return Reflect.set(...args);
  1211. }
  1212. });
  1213. return actions[actionName].apply(trackedStore, arguments);
  1214. };
  1215. }
  1216. }
  1217. function devtoolsPlugin({ app, store, options }) {
  1218. if (store.$id.startsWith("__hot:")) {
  1219. return;
  1220. }
  1221. if (options.state) {
  1222. store._isOptionsAPI = true;
  1223. }
  1224. if (typeof options.state === "function") {
  1225. patchActionForGrouping(
  1226. // @ts-expect-error: can cast the store...
  1227. store,
  1228. Object.keys(options.actions)
  1229. );
  1230. const originalHotUpdate = store._hotUpdate;
  1231. vue.toRaw(store)._hotUpdate = function(newStore) {
  1232. originalHotUpdate.apply(this, arguments);
  1233. patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions));
  1234. };
  1235. }
  1236. addStoreToDevtools(
  1237. app,
  1238. // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
  1239. store
  1240. );
  1241. }
  1242. function createPinia() {
  1243. const scope = vue.effectScope(true);
  1244. const state = scope.run(() => vue.ref({}));
  1245. let _p = [];
  1246. let toBeInstalled = [];
  1247. const pinia2 = vue.markRaw({
  1248. install(app) {
  1249. setActivePinia(pinia2);
  1250. {
  1251. pinia2._a = app;
  1252. app.provide(piniaSymbol, pinia2);
  1253. app.config.globalProperties.$pinia = pinia2;
  1254. if (USE_DEVTOOLS) {
  1255. registerPiniaDevtools(app, pinia2);
  1256. }
  1257. toBeInstalled.forEach((plugin) => _p.push(plugin));
  1258. toBeInstalled = [];
  1259. }
  1260. },
  1261. use(plugin) {
  1262. if (!this._a && !isVue2) {
  1263. toBeInstalled.push(plugin);
  1264. } else {
  1265. _p.push(plugin);
  1266. }
  1267. return this;
  1268. },
  1269. _p,
  1270. // it's actually undefined here
  1271. // @ts-expect-error
  1272. _a: null,
  1273. _e: scope,
  1274. _s: /* @__PURE__ */ new Map(),
  1275. state
  1276. });
  1277. if (USE_DEVTOOLS && typeof Proxy !== "undefined") {
  1278. pinia2.use(devtoolsPlugin);
  1279. }
  1280. return pinia2;
  1281. }
  1282. function patchObject(newState, oldState) {
  1283. for (const key in oldState) {
  1284. const subPatch = oldState[key];
  1285. if (!(key in newState)) {
  1286. continue;
  1287. }
  1288. const targetValue = newState[key];
  1289. if (isPlainObject(targetValue) && isPlainObject(subPatch) && !vue.isRef(subPatch) && !vue.isReactive(subPatch)) {
  1290. newState[key] = patchObject(targetValue, subPatch);
  1291. } else {
  1292. {
  1293. newState[key] = subPatch;
  1294. }
  1295. }
  1296. }
  1297. return newState;
  1298. }
  1299. const noop = () => {
  1300. };
  1301. function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
  1302. subscriptions.push(callback);
  1303. const removeSubscription = () => {
  1304. const idx = subscriptions.indexOf(callback);
  1305. if (idx > -1) {
  1306. subscriptions.splice(idx, 1);
  1307. onCleanup();
  1308. }
  1309. };
  1310. if (!detached && vue.getCurrentScope()) {
  1311. vue.onScopeDispose(removeSubscription);
  1312. }
  1313. return removeSubscription;
  1314. }
  1315. function triggerSubscriptions(subscriptions, ...args) {
  1316. subscriptions.slice().forEach((callback) => {
  1317. callback(...args);
  1318. });
  1319. }
  1320. function mergeReactiveObjects(target, patchToApply) {
  1321. if (target instanceof Map && patchToApply instanceof Map) {
  1322. patchToApply.forEach((value, key) => target.set(key, value));
  1323. }
  1324. if (target instanceof Set && patchToApply instanceof Set) {
  1325. patchToApply.forEach(target.add, target);
  1326. }
  1327. for (const key in patchToApply) {
  1328. if (!patchToApply.hasOwnProperty(key))
  1329. continue;
  1330. const subPatch = patchToApply[key];
  1331. const targetValue = target[key];
  1332. if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !vue.isRef(subPatch) && !vue.isReactive(subPatch)) {
  1333. target[key] = mergeReactiveObjects(targetValue, subPatch);
  1334. } else {
  1335. target[key] = subPatch;
  1336. }
  1337. }
  1338. return target;
  1339. }
  1340. const skipHydrateSymbol = Symbol("pinia:skipHydration");
  1341. function shouldHydrate(obj) {
  1342. return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
  1343. }
  1344. const { assign } = Object;
  1345. function isComputed(o2) {
  1346. return !!(vue.isRef(o2) && o2.effect);
  1347. }
  1348. function createOptionsStore(id, options, pinia2, hot) {
  1349. const { state, actions, getters } = options;
  1350. const initialState = pinia2.state.value[id];
  1351. let store;
  1352. function setup() {
  1353. if (!initialState && !hot) {
  1354. {
  1355. pinia2.state.value[id] = state ? state() : {};
  1356. }
  1357. }
  1358. const localState = hot ? (
  1359. // use ref() to unwrap refs inside state TODO: check if this is still necessary
  1360. vue.toRefs(vue.ref(state ? state() : {}).value)
  1361. ) : vue.toRefs(pinia2.state.value[id]);
  1362. return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
  1363. if (name in localState) {
  1364. console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`);
  1365. }
  1366. computedGetters[name] = vue.markRaw(vue.computed(() => {
  1367. setActivePinia(pinia2);
  1368. const store2 = pinia2._s.get(id);
  1369. return getters[name].call(store2, store2);
  1370. }));
  1371. return computedGetters;
  1372. }, {}));
  1373. }
  1374. store = createSetupStore(id, setup, options, pinia2, hot, true);
  1375. store.$reset = function $reset() {
  1376. const newState = state ? state() : {};
  1377. this.$patch(($state) => {
  1378. assign($state, newState);
  1379. });
  1380. };
  1381. return store;
  1382. }
  1383. function createSetupStore($id, setup, options = {}, pinia2, hot, isOptionsStore) {
  1384. let scope;
  1385. const optionsForPlugin = assign({ actions: {} }, options);
  1386. if (!pinia2._e.active) {
  1387. throw new Error("Pinia destroyed");
  1388. }
  1389. const $subscribeOptions = {
  1390. deep: true
  1391. // flush: 'post',
  1392. };
  1393. {
  1394. $subscribeOptions.onTrigger = (event) => {
  1395. if (isListening) {
  1396. debuggerEvents = event;
  1397. } else if (isListening == false && !store._hotUpdating) {
  1398. if (Array.isArray(debuggerEvents)) {
  1399. debuggerEvents.push(event);
  1400. } else {
  1401. console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.");
  1402. }
  1403. }
  1404. };
  1405. }
  1406. let isListening;
  1407. let isSyncListening;
  1408. let subscriptions = vue.markRaw([]);
  1409. let actionSubscriptions = vue.markRaw([]);
  1410. let debuggerEvents;
  1411. const initialState = pinia2.state.value[$id];
  1412. if (!isOptionsStore && !initialState && !hot) {
  1413. {
  1414. pinia2.state.value[$id] = {};
  1415. }
  1416. }
  1417. const hotState = vue.ref({});
  1418. let activeListener;
  1419. function $patch(partialStateOrMutator) {
  1420. let subscriptionMutation;
  1421. isListening = isSyncListening = false;
  1422. {
  1423. debuggerEvents = [];
  1424. }
  1425. if (typeof partialStateOrMutator === "function") {
  1426. partialStateOrMutator(pinia2.state.value[$id]);
  1427. subscriptionMutation = {
  1428. type: MutationType.patchFunction,
  1429. storeId: $id,
  1430. events: debuggerEvents
  1431. };
  1432. } else {
  1433. mergeReactiveObjects(pinia2.state.value[$id], partialStateOrMutator);
  1434. subscriptionMutation = {
  1435. type: MutationType.patchObject,
  1436. payload: partialStateOrMutator,
  1437. storeId: $id,
  1438. events: debuggerEvents
  1439. };
  1440. }
  1441. const myListenerId = activeListener = Symbol();
  1442. vue.nextTick().then(() => {
  1443. if (activeListener === myListenerId) {
  1444. isListening = true;
  1445. }
  1446. });
  1447. isSyncListening = true;
  1448. triggerSubscriptions(subscriptions, subscriptionMutation, pinia2.state.value[$id]);
  1449. }
  1450. const $reset = () => {
  1451. throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
  1452. };
  1453. function $dispose() {
  1454. scope.stop();
  1455. subscriptions = [];
  1456. actionSubscriptions = [];
  1457. pinia2._s.delete($id);
  1458. }
  1459. function wrapAction(name, action) {
  1460. return function() {
  1461. setActivePinia(pinia2);
  1462. const args = Array.from(arguments);
  1463. const afterCallbackList = [];
  1464. const onErrorCallbackList = [];
  1465. function after(callback) {
  1466. afterCallbackList.push(callback);
  1467. }
  1468. function onError(callback) {
  1469. onErrorCallbackList.push(callback);
  1470. }
  1471. triggerSubscriptions(actionSubscriptions, {
  1472. args,
  1473. name,
  1474. store,
  1475. after,
  1476. onError
  1477. });
  1478. let ret;
  1479. try {
  1480. ret = action.apply(this && this.$id === $id ? this : store, args);
  1481. } catch (error) {
  1482. triggerSubscriptions(onErrorCallbackList, error);
  1483. throw error;
  1484. }
  1485. if (ret instanceof Promise) {
  1486. return ret.then((value) => {
  1487. triggerSubscriptions(afterCallbackList, value);
  1488. return value;
  1489. }).catch((error) => {
  1490. triggerSubscriptions(onErrorCallbackList, error);
  1491. return Promise.reject(error);
  1492. });
  1493. }
  1494. triggerSubscriptions(afterCallbackList, ret);
  1495. return ret;
  1496. };
  1497. }
  1498. const _hmrPayload = /* @__PURE__ */ vue.markRaw({
  1499. actions: {},
  1500. getters: {},
  1501. state: [],
  1502. hotState
  1503. });
  1504. const partialStore = {
  1505. _p: pinia2,
  1506. // _s: scope,
  1507. $id,
  1508. $onAction: addSubscription.bind(null, actionSubscriptions),
  1509. $patch,
  1510. $reset,
  1511. $subscribe(callback, options2 = {}) {
  1512. const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
  1513. const stopWatcher = scope.run(() => vue.watch(() => pinia2.state.value[$id], (state) => {
  1514. if (options2.flush === "sync" ? isSyncListening : isListening) {
  1515. callback({
  1516. storeId: $id,
  1517. type: MutationType.direct,
  1518. events: debuggerEvents
  1519. }, state);
  1520. }
  1521. }, assign({}, $subscribeOptions, options2)));
  1522. return removeSubscription;
  1523. },
  1524. $dispose
  1525. };
  1526. const store = vue.reactive(assign(
  1527. {
  1528. _hmrPayload,
  1529. _customProperties: vue.markRaw(/* @__PURE__ */ new Set())
  1530. // devtools custom properties
  1531. },
  1532. partialStore
  1533. // must be added later
  1534. // setupStore
  1535. ));
  1536. pinia2._s.set($id, store);
  1537. const setupStore = pinia2._e.run(() => {
  1538. scope = vue.effectScope();
  1539. return scope.run(() => setup());
  1540. });
  1541. for (const key in setupStore) {
  1542. const prop = setupStore[key];
  1543. if (vue.isRef(prop) && !isComputed(prop) || vue.isReactive(prop)) {
  1544. if (hot) {
  1545. set$1(hotState.value, key, vue.toRef(setupStore, key));
  1546. } else if (!isOptionsStore) {
  1547. if (initialState && shouldHydrate(prop)) {
  1548. if (vue.isRef(prop)) {
  1549. prop.value = initialState[key];
  1550. } else {
  1551. mergeReactiveObjects(prop, initialState[key]);
  1552. }
  1553. }
  1554. {
  1555. pinia2.state.value[$id][key] = prop;
  1556. }
  1557. }
  1558. {
  1559. _hmrPayload.state.push(key);
  1560. }
  1561. } else if (typeof prop === "function") {
  1562. const actionValue = hot ? prop : wrapAction(key, prop);
  1563. {
  1564. setupStore[key] = actionValue;
  1565. }
  1566. {
  1567. _hmrPayload.actions[key] = prop;
  1568. }
  1569. optionsForPlugin.actions[key] = prop;
  1570. } else {
  1571. if (isComputed(prop)) {
  1572. _hmrPayload.getters[key] = isOptionsStore ? (
  1573. // @ts-expect-error
  1574. options.getters[key]
  1575. ) : prop;
  1576. if (IS_CLIENT) {
  1577. const getters = setupStore._getters || // @ts-expect-error: same
  1578. (setupStore._getters = vue.markRaw([]));
  1579. getters.push(key);
  1580. }
  1581. }
  1582. }
  1583. }
  1584. {
  1585. assign(store, setupStore);
  1586. assign(vue.toRaw(store), setupStore);
  1587. }
  1588. Object.defineProperty(store, "$state", {
  1589. get: () => hot ? hotState.value : pinia2.state.value[$id],
  1590. set: (state) => {
  1591. if (hot) {
  1592. throw new Error("cannot set hotState");
  1593. }
  1594. $patch(($state) => {
  1595. assign($state, state);
  1596. });
  1597. }
  1598. });
  1599. {
  1600. store._hotUpdate = vue.markRaw((newStore) => {
  1601. store._hotUpdating = true;
  1602. newStore._hmrPayload.state.forEach((stateKey) => {
  1603. if (stateKey in store.$state) {
  1604. const newStateTarget = newStore.$state[stateKey];
  1605. const oldStateSource = store.$state[stateKey];
  1606. if (typeof newStateTarget === "object" && isPlainObject(newStateTarget) && isPlainObject(oldStateSource)) {
  1607. patchObject(newStateTarget, oldStateSource);
  1608. } else {
  1609. newStore.$state[stateKey] = oldStateSource;
  1610. }
  1611. }
  1612. set$1(store, stateKey, vue.toRef(newStore.$state, stateKey));
  1613. });
  1614. Object.keys(store.$state).forEach((stateKey) => {
  1615. if (!(stateKey in newStore.$state)) {
  1616. del(store, stateKey);
  1617. }
  1618. });
  1619. isListening = false;
  1620. isSyncListening = false;
  1621. pinia2.state.value[$id] = vue.toRef(newStore._hmrPayload, "hotState");
  1622. isSyncListening = true;
  1623. vue.nextTick().then(() => {
  1624. isListening = true;
  1625. });
  1626. for (const actionName in newStore._hmrPayload.actions) {
  1627. const action = newStore[actionName];
  1628. set$1(store, actionName, wrapAction(actionName, action));
  1629. }
  1630. for (const getterName in newStore._hmrPayload.getters) {
  1631. const getter = newStore._hmrPayload.getters[getterName];
  1632. const getterValue = isOptionsStore ? (
  1633. // special handling of options api
  1634. vue.computed(() => {
  1635. setActivePinia(pinia2);
  1636. return getter.call(store, store);
  1637. })
  1638. ) : getter;
  1639. set$1(store, getterName, getterValue);
  1640. }
  1641. Object.keys(store._hmrPayload.getters).forEach((key) => {
  1642. if (!(key in newStore._hmrPayload.getters)) {
  1643. del(store, key);
  1644. }
  1645. });
  1646. Object.keys(store._hmrPayload.actions).forEach((key) => {
  1647. if (!(key in newStore._hmrPayload.actions)) {
  1648. del(store, key);
  1649. }
  1650. });
  1651. store._hmrPayload = newStore._hmrPayload;
  1652. store._getters = newStore._getters;
  1653. store._hotUpdating = false;
  1654. });
  1655. }
  1656. if (USE_DEVTOOLS) {
  1657. const nonEnumerable = {
  1658. writable: true,
  1659. configurable: true,
  1660. // avoid warning on devtools trying to display this property
  1661. enumerable: false
  1662. };
  1663. ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p2) => {
  1664. Object.defineProperty(store, p2, {
  1665. value: store[p2],
  1666. ...nonEnumerable
  1667. });
  1668. });
  1669. }
  1670. pinia2._p.forEach((extender) => {
  1671. if (USE_DEVTOOLS) {
  1672. const extensions = scope.run(() => extender({
  1673. store,
  1674. app: pinia2._a,
  1675. pinia: pinia2,
  1676. options: optionsForPlugin
  1677. }));
  1678. Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));
  1679. assign(store, extensions);
  1680. } else {
  1681. assign(store, scope.run(() => extender({
  1682. store,
  1683. app: pinia2._a,
  1684. pinia: pinia2,
  1685. options: optionsForPlugin
  1686. })));
  1687. }
  1688. });
  1689. if (store.$state && typeof store.$state === "object" && typeof store.$state.constructor === "function" && !store.$state.constructor.toString().includes("[native code]")) {
  1690. console.warn(`[🍍]: The "state" must be a plain object. It cannot be
  1691. state: () => new MyClass()
  1692. Found in store "${store.$id}".`);
  1693. }
  1694. if (initialState && isOptionsStore && options.hydrate) {
  1695. options.hydrate(store.$state, initialState);
  1696. }
  1697. isListening = true;
  1698. isSyncListening = true;
  1699. return store;
  1700. }
  1701. function defineStore(idOrOptions, setup, setupOptions) {
  1702. let id;
  1703. let options;
  1704. const isSetupStore = typeof setup === "function";
  1705. if (typeof idOrOptions === "string") {
  1706. id = idOrOptions;
  1707. options = isSetupStore ? setupOptions : setup;
  1708. } else {
  1709. options = idOrOptions;
  1710. id = idOrOptions.id;
  1711. }
  1712. function useStore(pinia2, hot) {
  1713. const currentInstance = vue.getCurrentInstance();
  1714. pinia2 = // in test mode, ignore the argument provided as we can always retrieve a
  1715. // pinia instance with getActivePinia()
  1716. pinia2 || currentInstance && vue.inject(piniaSymbol);
  1717. if (pinia2)
  1718. setActivePinia(pinia2);
  1719. if (!activePinia) {
  1720. throw new Error(`[🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
  1721. const pinia = createPinia()
  1722. app.use(pinia)
  1723. This will fail in production.`);
  1724. }
  1725. pinia2 = activePinia;
  1726. if (!pinia2._s.has(id)) {
  1727. if (isSetupStore) {
  1728. createSetupStore(id, setup, options, pinia2);
  1729. } else {
  1730. createOptionsStore(id, options, pinia2);
  1731. }
  1732. {
  1733. useStore._pinia = pinia2;
  1734. }
  1735. }
  1736. const store = pinia2._s.get(id);
  1737. if (hot) {
  1738. const hotId = "__hot:" + id;
  1739. const newStore = isSetupStore ? createSetupStore(hotId, setup, options, pinia2, true) : createOptionsStore(hotId, assign({}, options), pinia2, true);
  1740. hot._hotUpdate(newStore);
  1741. delete pinia2.state.value[hotId];
  1742. pinia2._s.delete(hotId);
  1743. }
  1744. if (IS_CLIENT && currentInstance && currentInstance.proxy && // avoid adding stores that are just built for hot module replacement
  1745. !hot) {
  1746. const vm = currentInstance.proxy;
  1747. const cache = "_pStores" in vm ? vm._pStores : vm._pStores = {};
  1748. cache[id] = store;
  1749. }
  1750. return store;
  1751. }
  1752. useStore.$id = id;
  1753. return useStore;
  1754. }
  1755. function isObject$1(v2) {
  1756. return typeof v2 === "object" && v2 !== null;
  1757. }
  1758. function normalizeOptions(options, factoryOptions) {
  1759. options = isObject$1(options) ? options : /* @__PURE__ */ Object.create(null);
  1760. return new Proxy(options, {
  1761. get(target, key, receiver) {
  1762. if (key === "key")
  1763. return Reflect.get(target, key, receiver);
  1764. return Reflect.get(target, key, receiver) || Reflect.get(factoryOptions, key, receiver);
  1765. }
  1766. });
  1767. }
  1768. function get(state, path) {
  1769. return path.reduce((obj, p2) => {
  1770. return obj == null ? void 0 : obj[p2];
  1771. }, state);
  1772. }
  1773. function set(state, path, val) {
  1774. return path.slice(0, -1).reduce((obj, p2) => {
  1775. if (/^(__proto__)$/.test(p2))
  1776. return {};
  1777. else
  1778. return obj[p2] = obj[p2] || {};
  1779. }, state)[path[path.length - 1]] = val, state;
  1780. }
  1781. function pick(baseState, paths) {
  1782. return paths.reduce((substate, path) => {
  1783. const pathArray = path.split(".");
  1784. return set(substate, pathArray, get(baseState, pathArray));
  1785. }, {});
  1786. }
  1787. function hydrateStore(store, { storage, serializer, key, debug }) {
  1788. try {
  1789. const fromStorage = storage == null ? void 0 : storage.getItem(key);
  1790. if (fromStorage)
  1791. store.$patch(serializer == null ? void 0 : serializer.deserialize(fromStorage));
  1792. } catch (error) {
  1793. if (debug)
  1794. console.error(error);
  1795. }
  1796. }
  1797. function persistState(state, { storage, serializer, key, paths, debug }) {
  1798. try {
  1799. const toStore = Array.isArray(paths) ? pick(state, paths) : state;
  1800. storage.setItem(key, serializer.serialize(toStore));
  1801. } catch (error) {
  1802. if (debug)
  1803. console.error(error);
  1804. }
  1805. }
  1806. function createPersistedState(factoryOptions = {}) {
  1807. return (context) => {
  1808. const { auto = false } = factoryOptions;
  1809. const {
  1810. options: { persist = auto },
  1811. store,
  1812. pinia: pinia2
  1813. } = context;
  1814. if (!persist)
  1815. return;
  1816. if (!(store.$id in pinia2.state.value)) {
  1817. const original_store = pinia2._s.get(store.$id.replace("__hot:", ""));
  1818. if (original_store)
  1819. Promise.resolve().then(() => original_store.$persist());
  1820. return;
  1821. }
  1822. const persistences = (Array.isArray(persist) ? persist.map((p2) => normalizeOptions(p2, factoryOptions)) : [normalizeOptions(persist, factoryOptions)]).map(
  1823. ({
  1824. storage = localStorage,
  1825. beforeRestore = null,
  1826. afterRestore = null,
  1827. serializer = {
  1828. serialize: JSON.stringify,
  1829. deserialize: JSON.parse
  1830. },
  1831. key = store.$id,
  1832. paths = null,
  1833. debug = false
  1834. }) => {
  1835. var _a;
  1836. return {
  1837. storage,
  1838. beforeRestore,
  1839. afterRestore,
  1840. serializer,
  1841. key: ((_a = factoryOptions.key) != null ? _a : (k) => k)(typeof key == "string" ? key : key(store.$id)),
  1842. paths,
  1843. debug
  1844. };
  1845. }
  1846. );
  1847. store.$persist = () => {
  1848. persistences.forEach((persistence) => {
  1849. persistState(store.$state, persistence);
  1850. });
  1851. };
  1852. store.$hydrate = ({ runHooks = true } = {}) => {
  1853. persistences.forEach((persistence) => {
  1854. const { beforeRestore, afterRestore } = persistence;
  1855. if (runHooks)
  1856. beforeRestore == null ? void 0 : beforeRestore(context);
  1857. hydrateStore(store, persistence);
  1858. if (runHooks)
  1859. afterRestore == null ? void 0 : afterRestore(context);
  1860. });
  1861. };
  1862. persistences.forEach((persistence) => {
  1863. const { beforeRestore, afterRestore } = persistence;
  1864. beforeRestore == null ? void 0 : beforeRestore(context);
  1865. hydrateStore(store, persistence);
  1866. afterRestore == null ? void 0 : afterRestore(context);
  1867. store.$subscribe(
  1868. (_mutation, state) => {
  1869. persistState(state, persistence);
  1870. },
  1871. {
  1872. detached: true
  1873. }
  1874. );
  1875. });
  1876. };
  1877. }
  1878. var src_default = createPersistedState();
  1879. const useMemberStore = defineStore(
  1880. "member",
  1881. () => {
  1882. const profile = vue.ref();
  1883. const setProfile = (val) => {
  1884. profile.value = val;
  1885. };
  1886. const clearProfile = () => {
  1887. profile.value = void 0;
  1888. };
  1889. return {
  1890. profile,
  1891. setProfile,
  1892. clearProfile
  1893. };
  1894. },
  1895. {
  1896. // 网页端配置
  1897. // persist: true,
  1898. // 小程序端配置
  1899. persist: {
  1900. storage: {
  1901. getItem(key) {
  1902. return uni.getStorageSync(key);
  1903. },
  1904. setItem(key, value) {
  1905. uni.setStorageSync(key, value);
  1906. }
  1907. }
  1908. }
  1909. }
  1910. );
  1911. const pinia = createPinia();
  1912. pinia.use(src_default);
  1913. var define_import_meta_env_default = { VITE_AXIOS_BASE_URL: "http://dsg.tms.api.aibasil.cn", VITE_CJS_IGNORE_WARNING: "true", VITE_ROOT_DIR: "E:\\demo\\hmrabbit", VITE_USER_NODE_ENV: "development", BASE_URL: "/", MODE: "test", DEV: true, PROD: false, SSR: false };
  1914. const baseURL = "http://dsg.tms.api.aibasil.cn";
  1915. formatAppLog("log", "at utils/http.ts:17", "***", define_import_meta_env_default);
  1916. formatAppLog("log", "at utils/http.ts:18", "**2*", baseURL);
  1917. const httpInterceptor = {
  1918. // 拦截前触发
  1919. invoke(options) {
  1920. var _a;
  1921. if (!options.url.startsWith("http")) {
  1922. options.url = baseURL + options.url;
  1923. }
  1924. options.timeout = 1e4;
  1925. options.header = {
  1926. ...options.header,
  1927. "source-client": "miniapp"
  1928. };
  1929. const memberStore = useMemberStore();
  1930. const token = (_a = memberStore.profile) == null ? void 0 : _a.token;
  1931. if (token) {
  1932. options.header.batoken = token;
  1933. }
  1934. }
  1935. };
  1936. uni.addInterceptor("request", httpInterceptor);
  1937. uni.addInterceptor("uploadFile", httpInterceptor);
  1938. const http = (options) => {
  1939. return new Promise((resolve, reject) => {
  1940. uni.request({
  1941. ...options,
  1942. // 响应成功
  1943. success(res) {
  1944. if (res.statusCode >= 200 && res.statusCode < 300) {
  1945. const data = res.data;
  1946. if (data.code === 302) {
  1947. formatAppLog("log", "at utils/http.ts:77", "未登录 -> 清理用户信息,跳转到登录页---");
  1948. const memberStore = useMemberStore();
  1949. memberStore.clearProfile();
  1950. uni.navigateTo({ url: "/pages/login/login" });
  1951. reject(res);
  1952. } else if (data.code === 409) {
  1953. formatAppLog("log", "at utils/http.ts:84", "登录态过期,请重新登录!---");
  1954. const memberStore = useMemberStore();
  1955. memberStore.clearProfile();
  1956. uni.navigateTo({ url: "/pages/login/login" });
  1957. reject(res);
  1958. } else {
  1959. resolve(res.data);
  1960. }
  1961. } else if (res.statusCode === 401) {
  1962. const memberStore = useMemberStore();
  1963. memberStore.clearProfile();
  1964. uni.navigateTo({ url: "/pages/login/login" });
  1965. reject(res);
  1966. } else {
  1967. uni.showToast({
  1968. icon: "none",
  1969. title: res.data.msg || "请求错误"
  1970. });
  1971. reject(res);
  1972. }
  1973. },
  1974. // 响应失败
  1975. fail(err) {
  1976. uni.showToast({
  1977. icon: "none",
  1978. title: "网络错误,换个网络试试"
  1979. });
  1980. reject(err);
  1981. }
  1982. });
  1983. });
  1984. };
  1985. const getCategoryTopAPI = () => {
  1986. return http({
  1987. method: "GET",
  1988. url: "/category/top"
  1989. });
  1990. };
  1991. const getHomeBannerAPI = (distributionSite = 1) => {
  1992. return http({
  1993. method: "GET",
  1994. url: "/home/banner",
  1995. data: {
  1996. distributionSite
  1997. }
  1998. });
  1999. };
  2000. const getHomeGoodsGuessLikeAPI = (data) => {
  2001. return http({
  2002. method: "GET",
  2003. url: "/home/goods/guessLike",
  2004. data
  2005. });
  2006. };
  2007. const _sfc_main$Z = {};
  2008. function _sfc_render$Y(_ctx, _cache) {
  2009. return vue.openBlock(), vue.createElementBlock("view", { class: "sk-container" }, [
  2010. vue.createElementVNode("view", { class: "viewport" }, [
  2011. vue.createElementVNode("view", { class: "search" }, [
  2012. vue.createElementVNode("view", { class: "input" }, [
  2013. vue.createElementVNode("text", { class: "icon-search sk-transparent sk-text-14-2857-225 sk-text sk-pseudo sk-pseudo-circle" }, "女靴")
  2014. ])
  2015. ]),
  2016. vue.createElementVNode("view", { class: "categories" }, [
  2017. vue.createElementVNode("scroll-view", {
  2018. "scroll-y": true,
  2019. class: "primary"
  2020. }, [
  2021. vue.createElementVNode("view", { class: "item active sk-pseudo sk-pseudo-circle" }, [
  2022. vue.createElementVNode("text", { class: "name sk-transparent sk-text-14-2857-218 sk-text" }, "居家")
  2023. ]),
  2024. vue.createElementVNode("view", { class: "item sk-pseudo sk-pseudo-circle" }, [
  2025. vue.createElementVNode("text", { class: "name sk-transparent sk-text-14-2857-495 sk-text" }, "美食")
  2026. ]),
  2027. vue.createElementVNode("view", { class: "item sk-pseudo sk-pseudo-circle" }, [
  2028. vue.createElementVNode("text", { class: "name sk-transparent sk-text-14-2857-628 sk-text" }, "服饰")
  2029. ]),
  2030. vue.createElementVNode("view", { class: "item sk-pseudo sk-pseudo-circle" }, [
  2031. vue.createElementVNode("text", { class: "name sk-transparent sk-text-14-2857-163 sk-text" }, "母婴")
  2032. ]),
  2033. vue.createElementVNode("view", { class: "item sk-pseudo sk-pseudo-circle" }, [
  2034. vue.createElementVNode("text", { class: "name sk-transparent sk-text-14-2857-690 sk-text" }, "个护")
  2035. ]),
  2036. vue.createElementVNode("view", { class: "item sk-pseudo sk-pseudo-circle" }, [
  2037. vue.createElementVNode("text", { class: "name sk-transparent sk-text-14-2857-302 sk-text" }, "严选")
  2038. ]),
  2039. vue.createElementVNode("view", { class: "item sk-pseudo sk-pseudo-circle" }, [
  2040. vue.createElementVNode("text", { class: "name sk-transparent sk-text-14-2857-730 sk-text" }, "数码")
  2041. ]),
  2042. vue.createElementVNode("view", { class: "item sk-pseudo sk-pseudo-circle" }, [
  2043. vue.createElementVNode("text", { class: "name sk-transparent sk-text-14-2857-584 sk-text" }, "运动")
  2044. ]),
  2045. vue.createElementVNode("view", { class: "item sk-pseudo sk-pseudo-circle" }, [
  2046. vue.createElementVNode("text", { class: "name sk-transparent sk-text-14-2857-895 sk-text" }, "杂项")
  2047. ])
  2048. ]),
  2049. vue.createElementVNode("scroll-view", {
  2050. "scroll-y": true,
  2051. class: "secondary"
  2052. }, [
  2053. vue.createElementVNode("view", {
  2054. is: "components/XtxSwiper",
  2055. class: "banner"
  2056. }, [
  2057. vue.createElementVNode("view", { class: "carousel XtxSwiper--carousel" }, [
  2058. vue.createElementVNode("view", { class: "indicator XtxSwiper--indicator" }, [
  2059. vue.createElementVNode("text", { class: "dot XtxSwiper--dot active XtxSwiper--active" }),
  2060. vue.createElementVNode("text", { class: "dot XtxSwiper--dot" }),
  2061. vue.createElementVNode("text", { class: "dot XtxSwiper--dot" }),
  2062. vue.createElementVNode("text", { class: "dot XtxSwiper--dot" }),
  2063. vue.createElementVNode("text", { class: "dot XtxSwiper--dot" })
  2064. ])
  2065. ])
  2066. ]),
  2067. vue.createElementVNode("view", { class: "panel" }, [
  2068. vue.createElementVNode("view", { class: "title" }, [
  2069. vue.createElementVNode("text", { class: "name sk-transparent sk-text-26-6667-885 sk-text" }, "居家生活用品"),
  2070. vue.createElementVNode("navigator", {
  2071. class: "more sk-transparent sk-text-30-0000-892 sk-text sk-pseudo sk-pseudo-circle",
  2072. "hover-class": "none"
  2073. }, "全部")
  2074. ]),
  2075. vue.createElementVNode("view", { class: "section" }, [
  2076. vue.createElementVNode("navigator", {
  2077. class: "goods",
  2078. "hover-class": "none"
  2079. }, [
  2080. vue.createElementVNode("image", { class: "image sk-image" }),
  2081. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-648 sk-text" }, "极光限定 珠光蓝珐琅锅"),
  2082. vue.createElementVNode("view", { class: "price" }, [
  2083. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  2084. vue.createElementVNode("text", { class: "number sk-transparent sk-text-14-2857-708 sk-text" }, "199.00")
  2085. ])
  2086. ]),
  2087. vue.createElementVNode("navigator", {
  2088. class: "goods",
  2089. "hover-class": "none"
  2090. }, [
  2091. vue.createElementVNode("image", { class: "image sk-image" }),
  2092. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-832 sk-text" }, "钻石陶瓷涂层多用锅18cm 小奶锅"),
  2093. vue.createElementVNode("view", { class: "price" }, [
  2094. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  2095. vue.createElementVNode("text", { class: "number sk-transparent sk-text-14-2857-349 sk-text" }, "149.00")
  2096. ])
  2097. ])
  2098. ])
  2099. ]),
  2100. vue.createElementVNode("view", { class: "panel" }, [
  2101. vue.createElementVNode("view", { class: "title" }, [
  2102. vue.createElementVNode("text", { class: "name sk-transparent sk-text-26-6667-486 sk-text" }, "收纳"),
  2103. vue.createElementVNode("navigator", {
  2104. class: "more sk-transparent sk-text-30-0000-520 sk-text sk-pseudo sk-pseudo-circle",
  2105. "hover-class": "none"
  2106. }, "全部")
  2107. ]),
  2108. vue.createElementVNode("view", { class: "section" }, [
  2109. vue.createElementVNode("navigator", {
  2110. class: "goods",
  2111. "hover-class": "none"
  2112. }, [
  2113. vue.createElementVNode("image", { class: "image sk-image" }),
  2114. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-582 sk-text" }, "开发员自留款,带滚轮双层脏衣篓"),
  2115. vue.createElementVNode("view", { class: "price" }, [
  2116. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  2117. vue.createElementVNode("text", { class: "number sk-transparent sk-text-14-2857-938 sk-text" }, "125.00")
  2118. ])
  2119. ]),
  2120. vue.createElementVNode("navigator", {
  2121. class: "goods",
  2122. "hover-class": "none"
  2123. }, [
  2124. vue.createElementVNode("image", { class: "image sk-image" }),
  2125. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-108 sk-text" }, "换季好帮手,大容量防尘衣物收纳袋"),
  2126. vue.createElementVNode("view", { class: "price" }, [
  2127. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  2128. vue.createElementVNode("text", { class: "number sk-transparent sk-text-14-2857-564 sk-text" }, "69.00")
  2129. ])
  2130. ]),
  2131. vue.createElementVNode("navigator", {
  2132. class: "goods",
  2133. "hover-class": "none"
  2134. }, [
  2135. vue.createElementVNode("image", { class: "image sk-image" }),
  2136. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-507 sk-text" }, "可水洗的布艺收纳盒"),
  2137. vue.createElementVNode("view", { class: "price" }, [
  2138. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  2139. vue.createElementVNode("text", { class: "number sk-transparent sk-text-14-2857-503 sk-text" }, "29.90")
  2140. ])
  2141. ]),
  2142. vue.createElementVNode("navigator", {
  2143. class: "goods",
  2144. "hover-class": "none"
  2145. }, [
  2146. vue.createElementVNode("image", { class: "image sk-image" }),
  2147. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-75 sk-text" }, "爆款明星好物,抽屉式透明储物柜"),
  2148. vue.createElementVNode("view", { class: "price" }, [
  2149. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  2150. vue.createElementVNode("text", { class: "number sk-transparent sk-text-14-2857-965 sk-text" }, "129.00")
  2151. ])
  2152. ]),
  2153. vue.createElementVNode("navigator", {
  2154. class: "goods",
  2155. "hover-class": "none"
  2156. }, [
  2157. vue.createElementVNode("image", { class: "image sk-image" }),
  2158. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-71 sk-text" }, "给衣柜减减肥,真空防潮压缩袋"),
  2159. vue.createElementVNode("view", { class: "price" }, [
  2160. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  2161. vue.createElementVNode("text", { class: "number sk-transparent sk-text-14-2857-530 sk-text" }, "79.00")
  2162. ])
  2163. ]),
  2164. vue.createElementVNode("navigator", {
  2165. class: "goods",
  2166. "hover-class": "none"
  2167. }, [
  2168. vue.createElementVNode("image", { class: "image sk-image" }),
  2169. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-151 sk-text" }, "拉开抽屉不凌乱,磨砂抽屉整理盒套装"),
  2170. vue.createElementVNode("view", { class: "price" }, [
  2171. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  2172. vue.createElementVNode("text", { class: "number sk-transparent sk-text-14-2857-641 sk-text" }, "49.00")
  2173. ])
  2174. ])
  2175. ])
  2176. ])
  2177. ])
  2178. ])
  2179. ])
  2180. ]);
  2181. }
  2182. const PageSkeleton$1 = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$Y], ["__scopeId", "data-v-177b00bb"], ["__file", "E:/demo/hmrabbit/src/pages/category/components/PageSkeleton.vue"]]);
  2183. const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
  2184. __name: "category",
  2185. setup(__props, { expose: __expose }) {
  2186. __expose();
  2187. const bannerList = vue.ref([]);
  2188. const getBannerData = async () => {
  2189. const res = await getHomeBannerAPI(2);
  2190. bannerList.value = res.result;
  2191. };
  2192. const categoryList = vue.ref([]);
  2193. const activeIndex = vue.ref(0);
  2194. const getCategoryTopData = async () => {
  2195. const res = await getCategoryTopAPI();
  2196. categoryList.value = res.result;
  2197. };
  2198. const isFinish = vue.ref(false);
  2199. onLoad(async () => {
  2200. await Promise.all([getBannerData(), getCategoryTopData()]);
  2201. isFinish.value = true;
  2202. });
  2203. const subCategoryList = vue.computed(() => {
  2204. var _a;
  2205. return ((_a = categoryList.value[activeIndex.value]) == null ? void 0 : _a.children) || [];
  2206. });
  2207. const __returned__ = { bannerList, getBannerData, categoryList, activeIndex, getCategoryTopData, isFinish, subCategoryList, PageSkeleton: PageSkeleton$1 };
  2208. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  2209. return __returned__;
  2210. }
  2211. });
  2212. function _sfc_render$X(_ctx, _cache, $props, $setup, $data, $options) {
  2213. const _component_XtxSwiper = resolveEasycom(vue.resolveDynamicComponent("XtxSwiper"), __easycom_0$c);
  2214. return $setup.isFinish ? (vue.openBlock(), vue.createElementBlock("view", {
  2215. key: 0,
  2216. class: "viewport"
  2217. }, [
  2218. vue.createCommentVNode(" 搜索框 "),
  2219. vue.createElementVNode("view", { class: "search" }, [
  2220. vue.createElementVNode("view", { class: "input" }, [
  2221. vue.createElementVNode("text", { class: "icon-search" }, "女靴")
  2222. ])
  2223. ]),
  2224. vue.createCommentVNode(" 分类 "),
  2225. vue.createElementVNode("view", { class: "categories" }, [
  2226. vue.createCommentVNode(" 左侧:一级分类 "),
  2227. vue.createElementVNode("scroll-view", {
  2228. class: "primary",
  2229. "scroll-y": ""
  2230. }, [
  2231. (vue.openBlock(true), vue.createElementBlock(
  2232. vue.Fragment,
  2233. null,
  2234. vue.renderList($setup.categoryList, (item, index) => {
  2235. return vue.openBlock(), vue.createElementBlock("view", {
  2236. key: item.id,
  2237. class: vue.normalizeClass(["item", { active: index === $setup.activeIndex }]),
  2238. onClick: ($event) => $setup.activeIndex = index
  2239. }, [
  2240. vue.createElementVNode(
  2241. "text",
  2242. { class: "name" },
  2243. vue.toDisplayString(item.name),
  2244. 1
  2245. /* TEXT */
  2246. )
  2247. ], 10, ["onClick"]);
  2248. }),
  2249. 128
  2250. /* KEYED_FRAGMENT */
  2251. ))
  2252. ]),
  2253. vue.createCommentVNode(" 右侧:二级分类 "),
  2254. vue.createElementVNode("scroll-view", {
  2255. "enable-back-to-top": "",
  2256. class: "secondary",
  2257. "scroll-y": ""
  2258. }, [
  2259. vue.createCommentVNode(" 焦点图 "),
  2260. vue.createVNode(_component_XtxSwiper, {
  2261. class: "banner",
  2262. list: $setup.bannerList
  2263. }, null, 8, ["list"]),
  2264. vue.createCommentVNode(" 内容区域 "),
  2265. (vue.openBlock(true), vue.createElementBlock(
  2266. vue.Fragment,
  2267. null,
  2268. vue.renderList($setup.subCategoryList, (item) => {
  2269. return vue.openBlock(), vue.createElementBlock("view", {
  2270. class: "panel",
  2271. key: item.id
  2272. }, [
  2273. vue.createElementVNode("view", { class: "title" }, [
  2274. vue.createElementVNode(
  2275. "text",
  2276. { class: "name" },
  2277. vue.toDisplayString(item.name),
  2278. 1
  2279. /* TEXT */
  2280. ),
  2281. vue.createElementVNode("navigator", {
  2282. class: "more",
  2283. "hover-class": "none"
  2284. }, "全部")
  2285. ]),
  2286. vue.createElementVNode("view", { class: "section" }, [
  2287. (vue.openBlock(true), vue.createElementBlock(
  2288. vue.Fragment,
  2289. null,
  2290. vue.renderList(item.goods, (goods2) => {
  2291. return vue.openBlock(), vue.createElementBlock("navigator", {
  2292. key: goods2.id,
  2293. class: "goods",
  2294. "hover-class": "none",
  2295. url: `/pages/goods/goods?id=${goods2.id}`
  2296. }, [
  2297. vue.createElementVNode("image", {
  2298. class: "image",
  2299. src: goods2.picture
  2300. }, null, 8, ["src"]),
  2301. vue.createElementVNode(
  2302. "view",
  2303. { class: "name ellipsis" },
  2304. vue.toDisplayString(goods2.name),
  2305. 1
  2306. /* TEXT */
  2307. ),
  2308. vue.createElementVNode("view", { class: "price" }, [
  2309. vue.createElementVNode("text", { class: "symbol" }, "¥"),
  2310. vue.createElementVNode(
  2311. "text",
  2312. { class: "number" },
  2313. vue.toDisplayString(goods2.price),
  2314. 1
  2315. /* TEXT */
  2316. )
  2317. ])
  2318. ], 8, ["url"]);
  2319. }),
  2320. 128
  2321. /* KEYED_FRAGMENT */
  2322. ))
  2323. ])
  2324. ]);
  2325. }),
  2326. 128
  2327. /* KEYED_FRAGMENT */
  2328. ))
  2329. ])
  2330. ])
  2331. ])) : (vue.openBlock(), vue.createBlock($setup["PageSkeleton"], { key: 1 }));
  2332. }
  2333. const PagesCategoryCategory = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$X], ["__file", "E:/demo/hmrabbit/src/pages/category/category.vue"]]);
  2334. const _sfc_main$X = {
  2335. name: "vk-data-input-number-box",
  2336. emits: ["update:modelValue", "input", "change", "blur", "plus", "minus"],
  2337. props: {
  2338. // 预显示的数字
  2339. value: {
  2340. type: Number,
  2341. default: 1
  2342. },
  2343. modelValue: {
  2344. type: Number,
  2345. default: 1
  2346. },
  2347. // 背景颜色
  2348. bgColor: {
  2349. type: String,
  2350. default: "#F2F3F5"
  2351. },
  2352. // 最小值
  2353. min: {
  2354. type: Number,
  2355. default: 0
  2356. },
  2357. // 最大值
  2358. max: {
  2359. type: Number,
  2360. default: 99999
  2361. },
  2362. // 步进值,每次加或减的值
  2363. step: {
  2364. type: Number,
  2365. default: 1
  2366. },
  2367. // 步进值,首次增加或最后减的值
  2368. stepFirst: {
  2369. type: Number,
  2370. default: 0
  2371. },
  2372. // 是否只能输入 step 的倍数
  2373. stepStrictly: {
  2374. type: Boolean,
  2375. default: false
  2376. },
  2377. // 是否禁用加减操作
  2378. disabled: {
  2379. type: Boolean,
  2380. default: false
  2381. },
  2382. // input的字体大小,单位rpx
  2383. size: {
  2384. type: [Number, String],
  2385. default: 26
  2386. },
  2387. // 加减图标的颜色
  2388. color: {
  2389. type: String,
  2390. default: "#323233"
  2391. },
  2392. // input宽度,单位rpx
  2393. inputWidth: {
  2394. type: [Number, String],
  2395. default: 80
  2396. },
  2397. // input高度,单位rpx
  2398. inputHeight: {
  2399. type: [Number, String],
  2400. default: 50
  2401. },
  2402. // index索引,用于列表中使用,让用户知道是哪个numberbox发生了变化,一般使用for循环出来的index值即可
  2403. index: {
  2404. type: [Number, String],
  2405. default: ""
  2406. },
  2407. // 是否禁用输入框,与disabled作用于输入框时,为OR的关系,即想要禁用输入框,又可以加减的话
  2408. // 设置disabled为false,disabledInput为true即可
  2409. disabledInput: {
  2410. type: Boolean,
  2411. default: false
  2412. },
  2413. // 输入框于键盘之间的距离
  2414. cursorSpacing: {
  2415. type: [Number, String],
  2416. default: 100
  2417. },
  2418. // 是否开启长按连续递增或递减
  2419. longPress: {
  2420. type: Boolean,
  2421. default: true
  2422. },
  2423. // 开启长按触发后,每触发一次需要多久
  2424. pressTime: {
  2425. type: [Number, String],
  2426. default: 250
  2427. },
  2428. // 是否只能输入大于或等于0的整数(正整数)
  2429. positiveInteger: {
  2430. type: Boolean,
  2431. default: true
  2432. }
  2433. },
  2434. watch: {
  2435. valueCom(v1, v2) {
  2436. if (!this.changeFromInner) {
  2437. this.inputVal = v1;
  2438. this.$nextTick(function() {
  2439. this.changeFromInner = false;
  2440. });
  2441. }
  2442. },
  2443. inputVal(v1, v2) {
  2444. if (v1 == "")
  2445. return;
  2446. let value = 0;
  2447. let tmp = this.isNumber(v1);
  2448. if (tmp && v1 >= this.min && v1 <= this.max)
  2449. value = v1;
  2450. else
  2451. value = v2;
  2452. if (this.positiveInteger) {
  2453. if (v1 < 0 || String(v1).indexOf(".") !== -1) {
  2454. value = v2;
  2455. this.$nextTick(() => {
  2456. this.inputVal = v2;
  2457. });
  2458. }
  2459. }
  2460. this.handleChange(value, "change");
  2461. },
  2462. min(v1) {
  2463. if (v1 !== void 0 && v1 != "" && this.valueCom < v1) {
  2464. this.$emit("input", v1);
  2465. this.$emit("update:modelValue", v1);
  2466. }
  2467. },
  2468. max(v1) {
  2469. if (v1 !== void 0 && v1 != "" && this.valueCom > v1) {
  2470. this.$emit("input", v1);
  2471. this.$emit("update:modelValue", v1);
  2472. }
  2473. }
  2474. },
  2475. data() {
  2476. return {
  2477. inputVal: 1,
  2478. // 输入框中的值,不能直接使用props中的value,因为应该改变props的状态
  2479. timer: null,
  2480. // 用作长按的定时器
  2481. changeFromInner: false,
  2482. // 值发生变化,是来自内部还是外部
  2483. innerChangeTimer: null
  2484. // 内部定时器
  2485. };
  2486. },
  2487. created() {
  2488. this.inputVal = Number(this.valueCom);
  2489. },
  2490. computed: {
  2491. valueCom() {
  2492. return this.modelValue;
  2493. },
  2494. getCursorSpacing() {
  2495. return Number(uni.upx2px(this.cursorSpacing));
  2496. }
  2497. },
  2498. methods: {
  2499. // 点击退格键
  2500. btnTouchStart(callback) {
  2501. this[callback]();
  2502. if (!this.longPress)
  2503. return;
  2504. clearInterval(this.timer);
  2505. this.timer = null;
  2506. this.timer = setInterval(() => {
  2507. this[callback]();
  2508. }, this.pressTime);
  2509. },
  2510. clearTimer() {
  2511. this.$nextTick(() => {
  2512. clearInterval(this.timer);
  2513. this.timer = null;
  2514. });
  2515. },
  2516. minus() {
  2517. this.computeVal("minus");
  2518. },
  2519. plus() {
  2520. this.computeVal("plus");
  2521. },
  2522. // 为了保证小数相加减出现精度溢出的问题
  2523. calcPlus(num1, num2) {
  2524. let baseNum, baseNum1, baseNum2;
  2525. try {
  2526. baseNum1 = num1.toString().split(".")[1].length;
  2527. } catch (e2) {
  2528. baseNum1 = 0;
  2529. }
  2530. try {
  2531. baseNum2 = num2.toString().split(".")[1].length;
  2532. } catch (e2) {
  2533. baseNum2 = 0;
  2534. }
  2535. baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
  2536. let precision = baseNum1 >= baseNum2 ? baseNum1 : baseNum2;
  2537. return ((num1 * baseNum + num2 * baseNum) / baseNum).toFixed(precision);
  2538. },
  2539. // 为了保证小数相加减出现精度溢出的问题
  2540. calcMinus(num1, num2) {
  2541. let baseNum, baseNum1, baseNum2;
  2542. try {
  2543. baseNum1 = num1.toString().split(".")[1].length;
  2544. } catch (e2) {
  2545. baseNum1 = 0;
  2546. }
  2547. try {
  2548. baseNum2 = num2.toString().split(".")[1].length;
  2549. } catch (e2) {
  2550. baseNum2 = 0;
  2551. }
  2552. baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
  2553. let precision = baseNum1 >= baseNum2 ? baseNum1 : baseNum2;
  2554. return ((num1 * baseNum - num2 * baseNum) / baseNum).toFixed(precision);
  2555. },
  2556. computeVal(type) {
  2557. uni.hideKeyboard();
  2558. if (this.disabled)
  2559. return;
  2560. let value = 0;
  2561. if (type === "minus") {
  2562. if (this.stepFirst > 0 && this.inputVal == this.stepFirst) {
  2563. value = this.min;
  2564. } else {
  2565. value = this.calcMinus(this.inputVal, this.step);
  2566. }
  2567. } else if (type === "plus") {
  2568. if (this.stepFirst > 0 && this.inputVal < this.stepFirst) {
  2569. value = this.stepFirst;
  2570. } else {
  2571. value = this.calcPlus(this.inputVal, this.step);
  2572. }
  2573. }
  2574. if (this.stepStrictly) {
  2575. let strictly = value % this.step;
  2576. if (strictly > 0) {
  2577. value -= strictly;
  2578. }
  2579. }
  2580. if (value > this.max) {
  2581. value = this.max;
  2582. } else if (value < this.min) {
  2583. value = this.min;
  2584. }
  2585. this.inputVal = value;
  2586. this.handleChange(value, type);
  2587. },
  2588. // 处理用户手动输入的情况
  2589. onBlur(event) {
  2590. let val = 0;
  2591. let value = event.detail.value;
  2592. if (!/(^\d+$)/.test(value) || value[0] == 0)
  2593. val = this.min;
  2594. val = +value;
  2595. if (this.stepFirst > 0 && this.inputVal < this.stepFirst && this.inputVal > 0) {
  2596. val = this.stepFirst;
  2597. }
  2598. if (this.stepStrictly) {
  2599. let strictly = val % this.step;
  2600. if (strictly > 0) {
  2601. val -= strictly;
  2602. }
  2603. }
  2604. if (val > this.max) {
  2605. val = this.max;
  2606. } else if (val < this.min) {
  2607. val = this.min;
  2608. }
  2609. this.$nextTick(() => {
  2610. this.inputVal = val;
  2611. });
  2612. this.handleChange(val, "blur");
  2613. },
  2614. handleChange(value, type) {
  2615. if (this.disabled)
  2616. return;
  2617. if (this.innerChangeTimer) {
  2618. clearTimeout(this.innerChangeTimer);
  2619. this.innerChangeTimer = null;
  2620. }
  2621. this.changeFromInner = true;
  2622. this.innerChangeTimer = setTimeout(() => {
  2623. this.changeFromInner = false;
  2624. }, 150);
  2625. this.$emit("input", Number(value));
  2626. this.$emit("update:modelValue", Number(value));
  2627. this.$emit(type, {
  2628. // 转为Number类型
  2629. value: Number(value),
  2630. index: this.index
  2631. });
  2632. },
  2633. /**
  2634. * 验证十进制数字
  2635. */
  2636. isNumber(value) {
  2637. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  2638. }
  2639. }
  2640. };
  2641. function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) {
  2642. return vue.openBlock(), vue.createElementBlock("view", { class: "vk-data-input-number-box" }, [
  2643. vue.createElementVNode(
  2644. "view",
  2645. {
  2646. class: vue.normalizeClass(["u-icon-minus", { "u-icon-disabled": $props.disabled || $data.inputVal <= $props.min }]),
  2647. style: vue.normalizeStyle({
  2648. background: $props.bgColor,
  2649. height: $props.inputHeight + "rpx",
  2650. color: $props.color,
  2651. fontSize: $props.size + "rpx",
  2652. minHeight: "1.4em"
  2653. }),
  2654. onTouchstart: _cache[0] || (_cache[0] = vue.withModifiers(($event) => $options.btnTouchStart("minus"), ["prevent"])),
  2655. onTouchend: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.clearTimer && $options.clearTimer(...args), ["stop", "prevent"]))
  2656. },
  2657. [
  2658. vue.createElementVNode(
  2659. "view",
  2660. {
  2661. style: vue.normalizeStyle("font-size:" + (Number($props.size) + 10) + "rpx"),
  2662. class: "num-btn"
  2663. },
  2664. "-",
  2665. 4
  2666. /* STYLE */
  2667. )
  2668. ],
  2669. 38
  2670. /* CLASS, STYLE, NEED_HYDRATION */
  2671. ),
  2672. vue.withDirectives(vue.createElementVNode("input", {
  2673. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.inputVal = $event),
  2674. disabled: $props.disabledInput || $props.disabled,
  2675. "cursor-spacing": $options.getCursorSpacing,
  2676. class: vue.normalizeClass([{ "u-input-disabled": $props.disabled }, "u-number-input"]),
  2677. type: "number",
  2678. style: vue.normalizeStyle({
  2679. color: $props.color,
  2680. fontSize: $props.size + "rpx",
  2681. background: $props.bgColor,
  2682. height: $props.inputHeight + "rpx",
  2683. width: $props.inputWidth + "rpx"
  2684. }),
  2685. onBlur: _cache[3] || (_cache[3] = (...args) => $options.onBlur && $options.onBlur(...args))
  2686. }, null, 46, ["disabled", "cursor-spacing"]), [
  2687. [vue.vModelText, $data.inputVal]
  2688. ]),
  2689. vue.createElementVNode(
  2690. "view",
  2691. {
  2692. class: vue.normalizeClass(["u-icon-plus", { "u-icon-disabled": $props.disabled || $data.inputVal >= $props.max }]),
  2693. style: vue.normalizeStyle({
  2694. background: $props.bgColor,
  2695. height: $props.inputHeight + "rpx",
  2696. color: $props.color,
  2697. fontSize: $props.size + "rpx",
  2698. minHeight: "1.4em"
  2699. }),
  2700. onTouchstart: _cache[4] || (_cache[4] = vue.withModifiers(($event) => $options.btnTouchStart("plus"), ["prevent"])),
  2701. onTouchend: _cache[5] || (_cache[5] = vue.withModifiers((...args) => $options.clearTimer && $options.clearTimer(...args), ["stop", "prevent"]))
  2702. },
  2703. [
  2704. vue.createElementVNode(
  2705. "view",
  2706. {
  2707. style: vue.normalizeStyle("font-size:" + (Number($props.size) + 10) + "rpx"),
  2708. class: "num-btn"
  2709. },
  2710. "+",
  2711. 4
  2712. /* STYLE */
  2713. )
  2714. ],
  2715. 38
  2716. /* CLASS, STYLE, NEED_HYDRATION */
  2717. )
  2718. ]);
  2719. }
  2720. const __easycom_0$b = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["render", _sfc_render$W], ["__scopeId", "data-v-3517706a"], ["__file", "E:/demo/hmrabbit/src/components/vk-data-input-number-box/vk-data-input-number-box.vue"]]);
  2721. let mpMixins = {};
  2722. mpMixins = {
  2723. data() {
  2724. return {
  2725. is_show: "none"
  2726. };
  2727. },
  2728. watch: {
  2729. show(newVal) {
  2730. this.is_show = this.show;
  2731. }
  2732. },
  2733. created() {
  2734. this.swipeaction = this.getSwipeAction();
  2735. if (this.swipeaction.children !== void 0) {
  2736. this.swipeaction.children.push(this);
  2737. }
  2738. },
  2739. mounted() {
  2740. this.is_show = this.show;
  2741. },
  2742. methods: {
  2743. // wxs 中调用
  2744. closeSwipe(e2) {
  2745. if (!this.autoClose)
  2746. return;
  2747. this.swipeaction.closeOther(this);
  2748. },
  2749. change(e2) {
  2750. this.$emit("change", e2.open);
  2751. if (this.is_show !== e2.open) {
  2752. this.is_show = e2.open;
  2753. }
  2754. },
  2755. appTouchStart(e2) {
  2756. const {
  2757. clientX
  2758. } = e2.changedTouches[0];
  2759. this.clientX = clientX;
  2760. this.timestamp = (/* @__PURE__ */ new Date()).getTime();
  2761. },
  2762. appTouchEnd(e2, index, item, position) {
  2763. const {
  2764. clientX
  2765. } = e2.changedTouches[0];
  2766. let diff = Math.abs(this.clientX - clientX);
  2767. let time = (/* @__PURE__ */ new Date()).getTime() - this.timestamp;
  2768. if (diff < 40 && time < 300) {
  2769. this.$emit("click", {
  2770. content: item,
  2771. index,
  2772. position
  2773. });
  2774. }
  2775. },
  2776. onClickForPC(index, item, position) {
  2777. return;
  2778. }
  2779. }
  2780. };
  2781. const mpwxs = mpMixins;
  2782. let bindIngXMixins = {};
  2783. let otherMixins = {};
  2784. const block0 = (Comp) => {
  2785. (Comp.$wxs || (Comp.$wxs = [])).push("wxsswipe");
  2786. (Comp.$wxsModules || (Comp.$wxsModules = {}))["wxsswipe"] = "105aa6f4";
  2787. };
  2788. const block1 = (Comp) => {
  2789. (Comp.$renderjs || (Comp.$renderjs = [])).push("renderswipe");
  2790. (Comp.$renderjsModules || (Comp.$renderjsModules = {}))["renderswipe"] = "0db65775";
  2791. };
  2792. const _sfc_main$W = {
  2793. mixins: [mpwxs, bindIngXMixins, otherMixins],
  2794. emits: ["click", "change"],
  2795. props: {
  2796. // 控制开关
  2797. show: {
  2798. type: String,
  2799. default: "none"
  2800. },
  2801. // 禁用
  2802. disabled: {
  2803. type: Boolean,
  2804. default: false
  2805. },
  2806. // 是否自动关闭
  2807. autoClose: {
  2808. type: Boolean,
  2809. default: true
  2810. },
  2811. // 滑动缺省距离
  2812. threshold: {
  2813. type: Number,
  2814. default: 20
  2815. },
  2816. // 左侧按钮内容
  2817. leftOptions: {
  2818. type: Array,
  2819. default() {
  2820. return [];
  2821. }
  2822. },
  2823. // 右侧按钮内容
  2824. rightOptions: {
  2825. type: Array,
  2826. default() {
  2827. return [];
  2828. }
  2829. }
  2830. },
  2831. // TODO vue3
  2832. unmounted() {
  2833. this.__isUnmounted = true;
  2834. this.uninstall();
  2835. },
  2836. methods: {
  2837. uninstall() {
  2838. if (this.swipeaction) {
  2839. this.swipeaction.children.forEach((item, index) => {
  2840. if (item === this) {
  2841. this.swipeaction.children.splice(index, 1);
  2842. }
  2843. });
  2844. }
  2845. },
  2846. /**
  2847. * 获取父元素实例
  2848. */
  2849. getSwipeAction(name = "uniSwipeAction") {
  2850. let parent = this.$parent;
  2851. let parentName = parent.$options.name;
  2852. while (parentName !== name) {
  2853. parent = parent.$parent;
  2854. if (!parent)
  2855. return false;
  2856. parentName = parent.$options.name;
  2857. }
  2858. return parent;
  2859. }
  2860. }
  2861. };
  2862. function _sfc_render$V(_ctx, _cache, $props, $setup, $data, $options) {
  2863. return vue.openBlock(), vue.createElementBlock(
  2864. vue.Fragment,
  2865. null,
  2866. [
  2867. vue.createCommentVNode(" 在微信小程序 app vue端 h5 使用wxs 实现"),
  2868. vue.createElementVNode("view", { class: "uni-swipe" }, [
  2869. vue.createElementVNode("view", {
  2870. class: "uni-swipe_box",
  2871. "change:prop": _ctx.wxsswipe.showWatch,
  2872. prop: vue.wp(_ctx.is_show),
  2873. "data-threshold": $props.threshold,
  2874. "data-disabled": $props.disabled,
  2875. onTouchstart: _cache[2] || (_cache[2] = (...args) => _ctx.wxsswipe.touchstart && _ctx.wxsswipe.touchstart(...args)),
  2876. onTouchmove: _cache[3] || (_cache[3] = (...args) => _ctx.wxsswipe.touchmove && _ctx.wxsswipe.touchmove(...args)),
  2877. onTouchend: _cache[4] || (_cache[4] = (...args) => _ctx.wxsswipe.touchend && _ctx.wxsswipe.touchend(...args))
  2878. }, [
  2879. vue.createCommentVNode(" 在微信小程序 app vue端 h5 使用wxs 实现"),
  2880. vue.createElementVNode("view", { class: "uni-swipe_button-group button-group--left" }, [
  2881. vue.renderSlot(_ctx.$slots, "left", {}, () => [
  2882. (vue.openBlock(true), vue.createElementBlock(
  2883. vue.Fragment,
  2884. null,
  2885. vue.renderList($props.leftOptions, (item, index) => {
  2886. return vue.openBlock(), vue.createElementBlock("view", {
  2887. key: index,
  2888. style: vue.normalizeStyle({
  2889. backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : "#C7C6CD"
  2890. }),
  2891. class: "uni-swipe_button button-hock",
  2892. onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.appTouchStart && _ctx.appTouchStart(...args)),
  2893. onTouchend: ($event) => _ctx.appTouchEnd($event, index, item, "left"),
  2894. onClick: vue.withModifiers(($event) => _ctx.onClickForPC(index, item, "left"), ["stop"])
  2895. }, [
  2896. vue.createElementVNode(
  2897. "text",
  2898. {
  2899. class: "uni-swipe_button-text",
  2900. style: vue.normalizeStyle({ color: item.style && item.style.color ? item.style.color : "#FFFFFF", fontSize: item.style && item.style.fontSize ? item.style.fontSize : "16px" })
  2901. },
  2902. vue.toDisplayString(item.text),
  2903. 5
  2904. /* TEXT, STYLE */
  2905. )
  2906. ], 44, ["onTouchend", "onClick"]);
  2907. }),
  2908. 128
  2909. /* KEYED_FRAGMENT */
  2910. ))
  2911. ], true)
  2912. ]),
  2913. vue.createElementVNode("view", { class: "uni-swipe_text--center" }, [
  2914. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  2915. ]),
  2916. vue.createElementVNode("view", { class: "uni-swipe_button-group button-group--right" }, [
  2917. vue.renderSlot(_ctx.$slots, "right", {}, () => [
  2918. (vue.openBlock(true), vue.createElementBlock(
  2919. vue.Fragment,
  2920. null,
  2921. vue.renderList($props.rightOptions, (item, index) => {
  2922. return vue.openBlock(), vue.createElementBlock("view", {
  2923. key: index,
  2924. style: vue.normalizeStyle({
  2925. backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : "#C7C6CD"
  2926. }),
  2927. class: "uni-swipe_button button-hock",
  2928. onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.appTouchStart && _ctx.appTouchStart(...args)),
  2929. onTouchend: ($event) => _ctx.appTouchEnd($event, index, item, "right"),
  2930. onClick: vue.withModifiers(($event) => _ctx.onClickForPC(index, item, "right"), ["stop"])
  2931. }, [
  2932. vue.createElementVNode(
  2933. "text",
  2934. {
  2935. class: "uni-swipe_button-text",
  2936. style: vue.normalizeStyle({ color: item.style && item.style.color ? item.style.color : "#FFFFFF", fontSize: item.style && item.style.fontSize ? item.style.fontSize : "16px" })
  2937. },
  2938. vue.toDisplayString(item.text),
  2939. 5
  2940. /* TEXT, STYLE */
  2941. )
  2942. ], 44, ["onTouchend", "onClick"]);
  2943. }),
  2944. 128
  2945. /* KEYED_FRAGMENT */
  2946. ))
  2947. ], true)
  2948. ])
  2949. ], 40, ["change:prop", "prop", "data-threshold", "data-disabled"])
  2950. ]),
  2951. vue.createCommentVNode(" app nvue端 使用 bindingx "),
  2952. vue.createCommentVNode(" 其他平台使用 js ,长列表性能可能会有影响")
  2953. ],
  2954. 2112
  2955. /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
  2956. );
  2957. }
  2958. if (typeof block0 === "function")
  2959. block0(_sfc_main$W);
  2960. if (typeof block1 === "function")
  2961. block1(_sfc_main$W);
  2962. const __easycom_0$a = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$V], ["__scopeId", "data-v-82a5303b"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue"]]);
  2963. const _sfc_main$V = {
  2964. name: "uniSwipeAction",
  2965. data() {
  2966. return {};
  2967. },
  2968. created() {
  2969. this.children = [];
  2970. },
  2971. methods: {
  2972. // 公开给用户使用,重制组件样式
  2973. resize() {
  2974. },
  2975. // 公开给用户使用,关闭全部 已经打开的组件
  2976. closeAll() {
  2977. this.children.forEach((vm) => {
  2978. vm.is_show = "none";
  2979. });
  2980. },
  2981. closeOther(vm) {
  2982. if (this.openItem && this.openItem !== vm) {
  2983. this.openItem.is_show = "none";
  2984. }
  2985. this.openItem = vm;
  2986. }
  2987. }
  2988. };
  2989. function _sfc_render$U(_ctx, _cache, $props, $setup, $data, $options) {
  2990. return vue.openBlock(), vue.createElementBlock("view", null, [
  2991. vue.renderSlot(_ctx.$slots, "default")
  2992. ]);
  2993. }
  2994. const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$U], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-swipe-action/uni-swipe-action.vue"]]);
  2995. const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
  2996. __name: "XtxGuess",
  2997. setup(__props, { expose: __expose }) {
  2998. const pageParams = {
  2999. page: 1,
  3000. pageSize: 10
  3001. };
  3002. const guessList = vue.ref([]);
  3003. const finish = vue.ref(false);
  3004. const getHomeGoodsGuessLikeData = async () => {
  3005. if (finish.value === true) {
  3006. return uni.showToast({ icon: "none", title: "没有更多数据~" });
  3007. }
  3008. const res = await getHomeGoodsGuessLikeAPI(pageParams);
  3009. guessList.value.push(...res.result.items);
  3010. if (pageParams.page < res.result.pages) {
  3011. pageParams.page++;
  3012. } else {
  3013. finish.value = true;
  3014. }
  3015. };
  3016. const resetData = () => {
  3017. pageParams.page = 1;
  3018. guessList.value = [];
  3019. finish.value = false;
  3020. };
  3021. vue.onMounted(() => {
  3022. getHomeGoodsGuessLikeData();
  3023. });
  3024. __expose({
  3025. resetData,
  3026. getMore: getHomeGoodsGuessLikeData
  3027. });
  3028. const __returned__ = { pageParams, guessList, finish, getHomeGoodsGuessLikeData, resetData };
  3029. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  3030. return __returned__;
  3031. }
  3032. });
  3033. function _sfc_render$T(_ctx, _cache, $props, $setup, $data, $options) {
  3034. return vue.openBlock(), vue.createElementBlock(
  3035. vue.Fragment,
  3036. null,
  3037. [
  3038. vue.createCommentVNode(" 猜你喜欢 "),
  3039. vue.createElementVNode("view", { class: "caption" }, [
  3040. vue.createElementVNode("text", { class: "text" }, "猜你喜欢")
  3041. ]),
  3042. vue.createElementVNode("view", { class: "guess" }, [
  3043. (vue.openBlock(true), vue.createElementBlock(
  3044. vue.Fragment,
  3045. null,
  3046. vue.renderList($setup.guessList, (item) => {
  3047. return vue.openBlock(), vue.createElementBlock("navigator", {
  3048. class: "guess-item",
  3049. key: item.id,
  3050. url: `/pages/goods/goods?id=${item.id}`
  3051. }, [
  3052. vue.createElementVNode("image", {
  3053. class: "image",
  3054. mode: "aspectFill",
  3055. src: item.picture
  3056. }, null, 8, ["src"]),
  3057. vue.createElementVNode(
  3058. "view",
  3059. { class: "name" },
  3060. vue.toDisplayString(item.name),
  3061. 1
  3062. /* TEXT */
  3063. ),
  3064. vue.createElementVNode("view", { class: "price" }, [
  3065. vue.createElementVNode("text", { class: "small" }, "¥"),
  3066. vue.createElementVNode(
  3067. "text",
  3068. null,
  3069. vue.toDisplayString(item.price),
  3070. 1
  3071. /* TEXT */
  3072. )
  3073. ])
  3074. ], 8, ["url"]);
  3075. }),
  3076. 128
  3077. /* KEYED_FRAGMENT */
  3078. ))
  3079. ]),
  3080. vue.createElementVNode(
  3081. "view",
  3082. { class: "loading-text" },
  3083. vue.toDisplayString($setup.finish ? "没有更多数据~" : "正在加载..."),
  3084. 1
  3085. /* TEXT */
  3086. )
  3087. ],
  3088. 64
  3089. /* STABLE_FRAGMENT */
  3090. );
  3091. }
  3092. const __easycom_0$9 = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["render", _sfc_render$T], ["__scopeId", "data-v-e94a02da"], ["__file", "E:/demo/hmrabbit/src/components/XtxGuess.vue"]]);
  3093. const useGuessList = () => {
  3094. const guessRef = vue.ref();
  3095. const onScrolltolower = () => {
  3096. var _a;
  3097. (_a = guessRef.value) == null ? void 0 : _a.getMore();
  3098. };
  3099. return {
  3100. guessRef,
  3101. onScrolltolower
  3102. };
  3103. };
  3104. const postMemberCartAPI = (data) => {
  3105. return http({
  3106. method: "POST",
  3107. url: "/member/cart",
  3108. data
  3109. });
  3110. };
  3111. const getMemberCartAPI = () => {
  3112. return http({
  3113. method: "GET",
  3114. url: "/member/cart"
  3115. });
  3116. };
  3117. const deleteMemberCartAPI = (data) => {
  3118. return http({
  3119. method: "DELETE",
  3120. url: "/member/cart",
  3121. data
  3122. });
  3123. };
  3124. const putMemberCartBySkuIdAPI = (skuId, data) => {
  3125. return http({
  3126. method: "PUT",
  3127. url: `/member/cart/${skuId}`,
  3128. data
  3129. });
  3130. };
  3131. const putMemberCartSelectedAPI = (data) => {
  3132. return http({
  3133. method: "PUT",
  3134. url: "/member/cart/selected",
  3135. data
  3136. });
  3137. };
  3138. const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
  3139. __name: "CartMain",
  3140. props: {
  3141. safeAreaInsetBottom: { type: Boolean, required: false }
  3142. },
  3143. setup(__props, { expose: __expose }) {
  3144. __expose();
  3145. const { safeAreaInsets } = uni.getSystemInfoSync();
  3146. const memberStore = useMemberStore();
  3147. const cartList = vue.ref([]);
  3148. const showCartList = vue.ref(true);
  3149. const getMemberCartData = async () => {
  3150. const res = await getMemberCartAPI();
  3151. cartList.value = res.result;
  3152. showCartList.value = res.result.length > 0;
  3153. };
  3154. onShow(() => {
  3155. if (memberStore.profile) {
  3156. getMemberCartData();
  3157. }
  3158. });
  3159. const onDeleteCart = (skuId) => {
  3160. uni.showModal({
  3161. content: "是否删除",
  3162. confirmColor: "#27BA9B",
  3163. success: async (res) => {
  3164. if (res.confirm) {
  3165. await deleteMemberCartAPI({ ids: [skuId] });
  3166. getMemberCartData();
  3167. }
  3168. }
  3169. });
  3170. };
  3171. const onChangeCount = (ev) => {
  3172. putMemberCartBySkuIdAPI(ev.index, { count: ev.value });
  3173. };
  3174. const onChangeSelected = (item) => {
  3175. item.selected = !item.selected;
  3176. putMemberCartBySkuIdAPI(item.skuId, { selected: item.selected });
  3177. };
  3178. const isSelectedAll = vue.computed(() => {
  3179. return cartList.value.length && cartList.value.every((v2) => v2.selected);
  3180. });
  3181. const onChangeSelectedAll = () => {
  3182. const _isSelectedAll = !isSelectedAll.value;
  3183. cartList.value.forEach((item) => {
  3184. item.selected = _isSelectedAll;
  3185. });
  3186. putMemberCartSelectedAPI({ selected: _isSelectedAll });
  3187. };
  3188. const selectedCartList = vue.computed(() => {
  3189. return cartList.value.filter((v2) => v2.selected);
  3190. });
  3191. const selectedCartListCount = vue.computed(() => {
  3192. return selectedCartList.value.reduce((sum, item) => sum + item.count, 0);
  3193. });
  3194. const selectedCartListMoney = vue.computed(() => {
  3195. return selectedCartList.value.reduce((sum, item) => sum + item.count * item.nowPrice, 0).toFixed(2);
  3196. });
  3197. const gotoPayment = () => {
  3198. if (selectedCartListCount.value === 0) {
  3199. return uni.showToast({
  3200. icon: "none",
  3201. title: "请选择商品"
  3202. });
  3203. }
  3204. uni.navigateTo({ url: "/pagesOrder/create/create" });
  3205. };
  3206. const { guessRef, onScrolltolower } = useGuessList();
  3207. const __returned__ = { safeAreaInsets, memberStore, cartList, showCartList, getMemberCartData, onDeleteCart, onChangeCount, onChangeSelected, isSelectedAll, onChangeSelectedAll, selectedCartList, selectedCartListCount, selectedCartListMoney, gotoPayment, guessRef, onScrolltolower };
  3208. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  3209. return __returned__;
  3210. }
  3211. });
  3212. const _imports_0$1 = "/static/images/blank_cart.png";
  3213. function _sfc_render$S(_ctx, _cache, $props, $setup, $data, $options) {
  3214. var _a;
  3215. const _component_vk_data_input_number_box = resolveEasycom(vue.resolveDynamicComponent("vk-data-input-number-box"), __easycom_0$b);
  3216. const _component_uni_swipe_action_item = resolveEasycom(vue.resolveDynamicComponent("uni-swipe-action-item"), __easycom_0$a);
  3217. const _component_uni_swipe_action = resolveEasycom(vue.resolveDynamicComponent("uni-swipe-action"), __easycom_1$2);
  3218. const _component_XtxGuess = resolveEasycom(vue.resolveDynamicComponent("XtxGuess"), __easycom_0$9);
  3219. return vue.openBlock(), vue.createElementBlock(
  3220. "scroll-view",
  3221. {
  3222. "enable-back-to-top": "",
  3223. "scroll-y": "",
  3224. class: "scroll-view",
  3225. onScrolltolower: _cache[0] || (_cache[0] = (...args) => $setup.onScrolltolower && $setup.onScrolltolower(...args))
  3226. },
  3227. [
  3228. vue.createCommentVNode(" 已登录: 显示购物车 "),
  3229. $setup.memberStore.profile ? (vue.openBlock(), vue.createElementBlock(
  3230. vue.Fragment,
  3231. { key: 0 },
  3232. [
  3233. vue.createCommentVNode(" 购物车列表 "),
  3234. $setup.showCartList ? (vue.openBlock(), vue.createElementBlock("view", {
  3235. key: 0,
  3236. class: "cart-list"
  3237. }, [
  3238. vue.createCommentVNode(" 优惠提示 "),
  3239. vue.createElementVNode("view", { class: "tips" }, [
  3240. vue.createElementVNode("text", { class: "label" }, "满减"),
  3241. vue.createElementVNode("text", { class: "desc" }, "满1件, 即可享受9折优惠")
  3242. ]),
  3243. vue.createCommentVNode(" 滑动操作分区 "),
  3244. vue.createVNode(_component_uni_swipe_action, null, {
  3245. default: vue.withCtx(() => [
  3246. vue.createCommentVNode(" 滑动操作项 "),
  3247. (vue.openBlock(true), vue.createElementBlock(
  3248. vue.Fragment,
  3249. null,
  3250. vue.renderList($setup.cartList, (item) => {
  3251. return vue.openBlock(), vue.createBlock(
  3252. _component_uni_swipe_action_item,
  3253. {
  3254. key: item.skuId,
  3255. class: "cart-swipe"
  3256. },
  3257. {
  3258. right: vue.withCtx(() => [
  3259. vue.createElementVNode("view", { class: "cart-swipe-right" }, [
  3260. vue.createElementVNode("button", {
  3261. onClick: ($event) => $setup.onDeleteCart(item.skuId),
  3262. class: "button delete-button"
  3263. }, "删除", 8, ["onClick"])
  3264. ])
  3265. ]),
  3266. default: vue.withCtx(() => [
  3267. vue.createElementVNode("view", { class: "goods" }, [
  3268. vue.createCommentVNode(" 选中状态 "),
  3269. vue.createElementVNode("text", {
  3270. onClick: ($event) => $setup.onChangeSelected(item),
  3271. class: vue.normalizeClass(["checkbox", { checked: item.selected }])
  3272. }, null, 10, ["onClick"]),
  3273. vue.createElementVNode("navigator", {
  3274. url: `/pages/goods/goods?id=${item.id}`,
  3275. "hover-class": "none",
  3276. class: "navigator"
  3277. }, [
  3278. vue.createElementVNode("image", {
  3279. mode: "aspectFill",
  3280. class: "picture",
  3281. src: item.picture
  3282. }, null, 8, ["src"]),
  3283. vue.createElementVNode("view", { class: "meta" }, [
  3284. vue.createElementVNode(
  3285. "view",
  3286. { class: "name ellipsis" },
  3287. vue.toDisplayString(item.name),
  3288. 1
  3289. /* TEXT */
  3290. ),
  3291. vue.createElementVNode(
  3292. "view",
  3293. { class: "attrsText ellipsis" },
  3294. vue.toDisplayString(item.attrsText),
  3295. 1
  3296. /* TEXT */
  3297. ),
  3298. vue.createElementVNode(
  3299. "view",
  3300. { class: "price" },
  3301. vue.toDisplayString(item.nowPrice),
  3302. 1
  3303. /* TEXT */
  3304. )
  3305. ])
  3306. ], 8, ["url"]),
  3307. vue.createCommentVNode(" 商品数量 "),
  3308. vue.createElementVNode("view", { class: "count" }, [
  3309. vue.createVNode(_component_vk_data_input_number_box, {
  3310. modelValue: item.count,
  3311. "onUpdate:modelValue": ($event) => item.count = $event,
  3312. min: 1,
  3313. max: item.stock,
  3314. index: item.skuId,
  3315. onChange: $setup.onChangeCount
  3316. }, null, 8, ["modelValue", "onUpdate:modelValue", "max", "index"])
  3317. ])
  3318. ])
  3319. ]),
  3320. _: 2
  3321. /* DYNAMIC */
  3322. },
  3323. 1024
  3324. /* DYNAMIC_SLOTS */
  3325. );
  3326. }),
  3327. 128
  3328. /* KEYED_FRAGMENT */
  3329. ))
  3330. ]),
  3331. _: 1
  3332. /* STABLE */
  3333. })
  3334. ])) : (vue.openBlock(), vue.createElementBlock(
  3335. vue.Fragment,
  3336. { key: 1 },
  3337. [
  3338. vue.createCommentVNode(" 购物车空状态 "),
  3339. vue.createElementVNode("view", { class: "cart-blank" }, [
  3340. vue.createElementVNode("image", {
  3341. src: _imports_0$1,
  3342. class: "image"
  3343. }),
  3344. vue.createElementVNode("text", { class: "text" }, "购物车还是空的,快来挑选好货吧"),
  3345. vue.createElementVNode("navigator", {
  3346. url: "/pages/index/index",
  3347. "hover-class": "none"
  3348. }, [
  3349. vue.createElementVNode("button", { class: "button" }, "去首页看看")
  3350. ])
  3351. ])
  3352. ],
  3353. 2112
  3354. /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
  3355. )),
  3356. vue.createCommentVNode(" 吸底工具栏 "),
  3357. $setup.showCartList ? (vue.openBlock(), vue.createElementBlock(
  3358. "view",
  3359. {
  3360. key: 2,
  3361. class: "toolbar",
  3362. style: vue.normalizeStyle({ paddingBottom: $props.safeAreaInsetBottom ? ((_a = $setup.safeAreaInsets) == null ? void 0 : _a.bottom) + "px" : 0 })
  3363. },
  3364. [
  3365. vue.createElementVNode(
  3366. "text",
  3367. {
  3368. onClick: $setup.onChangeSelectedAll,
  3369. class: vue.normalizeClass(["all", { checked: $setup.isSelectedAll }])
  3370. },
  3371. "全选",
  3372. 2
  3373. /* CLASS */
  3374. ),
  3375. vue.createElementVNode("text", { class: "text" }, "合计:"),
  3376. vue.createElementVNode(
  3377. "text",
  3378. { class: "amount" },
  3379. vue.toDisplayString($setup.selectedCartListMoney),
  3380. 1
  3381. /* TEXT */
  3382. ),
  3383. vue.createElementVNode("view", { class: "button-grounp" }, [
  3384. vue.createElementVNode(
  3385. "view",
  3386. {
  3387. onClick: $setup.gotoPayment,
  3388. class: vue.normalizeClass(["button payment-button", { disabled: $setup.selectedCartListCount === 0 }])
  3389. },
  3390. " 去结算(" + vue.toDisplayString($setup.selectedCartListCount) + ") ",
  3391. 3
  3392. /* TEXT, CLASS */
  3393. )
  3394. ])
  3395. ],
  3396. 4
  3397. /* STYLE */
  3398. )) : vue.createCommentVNode("v-if", true)
  3399. ],
  3400. 64
  3401. /* STABLE_FRAGMENT */
  3402. )) : (vue.openBlock(), vue.createElementBlock(
  3403. vue.Fragment,
  3404. { key: 1 },
  3405. [
  3406. vue.createCommentVNode(" 未登录: 提示登录 "),
  3407. vue.createElementVNode("view", { class: "login-blank" }, [
  3408. vue.createElementVNode("text", { class: "text" }, "登录后可查看购物车中的商品"),
  3409. vue.createElementVNode("navigator", {
  3410. url: "/pages/login/login",
  3411. "hover-class": "none"
  3412. }, [
  3413. vue.createElementVNode("button", { class: "button" }, "去登录")
  3414. ])
  3415. ])
  3416. ],
  3417. 2112
  3418. /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
  3419. )),
  3420. vue.createCommentVNode(" 猜你喜欢 "),
  3421. vue.createVNode(
  3422. _component_XtxGuess,
  3423. { ref: "guessRef" },
  3424. null,
  3425. 512
  3426. /* NEED_PATCH */
  3427. ),
  3428. vue.createCommentVNode(" 底部占位空盒子 "),
  3429. vue.createElementVNode("view", { class: "toolbar-height" })
  3430. ],
  3431. 32
  3432. /* NEED_HYDRATION */
  3433. );
  3434. }
  3435. const CartMain = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$S], ["__scopeId", "data-v-1830a74b"], ["__file", "E:/demo/hmrabbit/src/pages/cart/components/CartMain.vue"]]);
  3436. const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
  3437. __name: "cart",
  3438. setup(__props, { expose: __expose }) {
  3439. __expose();
  3440. const __returned__ = { CartMain };
  3441. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  3442. return __returned__;
  3443. }
  3444. });
  3445. function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) {
  3446. return vue.openBlock(), vue.createBlock($setup["CartMain"]);
  3447. }
  3448. const PagesCartCart = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$R], ["__file", "E:/demo/hmrabbit/src/pages/cart/cart.vue"]]);
  3449. const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
  3450. __name: "cart2",
  3451. setup(__props, { expose: __expose }) {
  3452. __expose();
  3453. const __returned__ = { CartMain };
  3454. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  3455. return __returned__;
  3456. }
  3457. });
  3458. function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) {
  3459. return vue.openBlock(), vue.createElementBlock(
  3460. vue.Fragment,
  3461. null,
  3462. [
  3463. vue.createCommentVNode(" 适配底部安全区 "),
  3464. vue.createVNode($setup["CartMain"], { "safe-area-inset-bottom": "" })
  3465. ],
  3466. 2112
  3467. /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
  3468. );
  3469. }
  3470. const PagesCartCart2 = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$Q], ["__file", "E:/demo/hmrabbit/src/pages/cart/cart2.vue"]]);
  3471. const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
  3472. __name: "my",
  3473. setup(__props, { expose: __expose }) {
  3474. __expose();
  3475. const { safeAreaInsets } = uni.getSystemInfoSync();
  3476. const orderTypes = [
  3477. { type: "1", text: "待付款", icon: "icon-currency" },
  3478. { type: "2", text: "待发货", icon: "icon-gift" },
  3479. { type: "3", text: "待收货", icon: "icon-check" },
  3480. { type: "4", text: "待评价", icon: "icon-comment" }
  3481. ];
  3482. const memberStore = useMemberStore();
  3483. const { guessRef, onScrolltolower } = useGuessList();
  3484. const __returned__ = { safeAreaInsets, orderTypes, memberStore, guessRef, onScrolltolower };
  3485. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  3486. return __returned__;
  3487. }
  3488. });
  3489. function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
  3490. return vue.openBlock(), vue.createElementBlock(
  3491. "scroll-view",
  3492. {
  3493. "enable-back-to-top": "",
  3494. onScrolltolower: _cache[0] || (_cache[0] = (...args) => $setup.onScrolltolower && $setup.onScrolltolower(...args)),
  3495. class: "viewport",
  3496. "scroll-y": ""
  3497. },
  3498. [
  3499. vue.createCommentVNode(" 个人资料 "),
  3500. vue.createElementVNode(
  3501. "view",
  3502. {
  3503. class: "profile",
  3504. style: vue.normalizeStyle({ paddingTop: $setup.safeAreaInsets.top + "px" })
  3505. },
  3506. [
  3507. vue.createCommentVNode(" 情况1:已登录 "),
  3508. $setup.memberStore.profile ? (vue.openBlock(), vue.createElementBlock("view", {
  3509. key: 0,
  3510. class: "overview"
  3511. }, [
  3512. vue.createElementVNode("navigator", {
  3513. url: "/pagesMember/profile/profile",
  3514. "hover-class": "none"
  3515. }, [
  3516. vue.createElementVNode("image", {
  3517. class: "avatar",
  3518. src: $setup.memberStore.profile.avatar,
  3519. mode: "aspectFill"
  3520. }, null, 8, ["src"])
  3521. ]),
  3522. vue.createElementVNode("view", { class: "meta" }, [
  3523. vue.createElementVNode(
  3524. "view",
  3525. { class: "nickname" },
  3526. vue.toDisplayString($setup.memberStore.profile.nickname || $setup.memberStore.profile.username),
  3527. 1
  3528. /* TEXT */
  3529. ),
  3530. vue.createElementVNode("navigator", {
  3531. class: "extra",
  3532. url: "/pagesMember/profile/profile",
  3533. "hover-class": "none"
  3534. }, [
  3535. vue.createElementVNode("text", { class: "update" }, "更新头像昵称")
  3536. ])
  3537. ])
  3538. ])) : (vue.openBlock(), vue.createElementBlock(
  3539. vue.Fragment,
  3540. { key: 1 },
  3541. [
  3542. vue.createCommentVNode(" 情况2:未登录 "),
  3543. vue.createElementVNode("view", { class: "overview" }, [
  3544. vue.createElementVNode("navigator", {
  3545. url: "/pages/login/login",
  3546. "hover-class": "none"
  3547. }, [
  3548. vue.createElementVNode("image", {
  3549. class: "avatar gray",
  3550. mode: "aspectFill",
  3551. src: "https://yjy-xiaotuxian-dev.oss-cn-beijing.aliyuncs.com/picture/2021-04-06/db628d42-88a7-46e7-abb8-659448c33081.png"
  3552. })
  3553. ]),
  3554. vue.createElementVNode("view", { class: "meta" }, [
  3555. vue.createElementVNode("navigator", {
  3556. url: "/pages/login/login",
  3557. "hover-class": "none",
  3558. class: "nickname"
  3559. }, " 未登录 "),
  3560. vue.createElementVNode("view", { class: "extra" }, [
  3561. vue.createElementVNode("text", { class: "tips" }, "点击登录账号")
  3562. ])
  3563. ])
  3564. ])
  3565. ],
  3566. 2112
  3567. /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
  3568. )),
  3569. vue.createElementVNode("navigator", {
  3570. class: "settings",
  3571. url: "/pagesMember/settings/settings",
  3572. "hover-class": "none"
  3573. }, " 设置 ")
  3574. ],
  3575. 4
  3576. /* STYLE */
  3577. ),
  3578. vue.createCommentVNode(" 我的订单 "),
  3579. vue.createElementVNode("view", { class: "orders" }, [
  3580. vue.createElementVNode("view", { class: "title" }, [
  3581. vue.createTextVNode(" 我的订单 "),
  3582. vue.createElementVNode("navigator", {
  3583. class: "navigator",
  3584. url: "/pagesOrder/list/list?type=0",
  3585. "hover-class": "none"
  3586. }, [
  3587. vue.createTextVNode(" 查看全部订单"),
  3588. vue.createElementVNode("text", { class: "icon-right" })
  3589. ])
  3590. ]),
  3591. vue.createElementVNode("view", { class: "section" }, [
  3592. vue.createCommentVNode(" 订单 "),
  3593. (vue.openBlock(), vue.createElementBlock(
  3594. vue.Fragment,
  3595. null,
  3596. vue.renderList($setup.orderTypes, (item) => {
  3597. return vue.createElementVNode("navigator", {
  3598. key: item.type,
  3599. class: vue.normalizeClass([item.icon, "navigator"]),
  3600. url: `/pagesOrder/list/list?type=${item.type}`,
  3601. "hover-class": "none"
  3602. }, vue.toDisplayString(item.text), 11, ["url"]);
  3603. }),
  3604. 64
  3605. /* STABLE_FRAGMENT */
  3606. )),
  3607. vue.createCommentVNode(" 客服 ")
  3608. ])
  3609. ])
  3610. ],
  3611. 32
  3612. /* NEED_HYDRATION */
  3613. );
  3614. }
  3615. const PagesMyMy = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["render", _sfc_render$P], ["__file", "E:/demo/hmrabbit/src/pages/my/my.vue"]]);
  3616. const icons = {
  3617. "id": "2852637",
  3618. "name": "uniui图标库",
  3619. "font_family": "uniicons",
  3620. "css_prefix_text": "uniui-",
  3621. "description": "",
  3622. "glyphs": [
  3623. {
  3624. "icon_id": "25027049",
  3625. "name": "yanse",
  3626. "font_class": "color",
  3627. "unicode": "e6cf",
  3628. "unicode_decimal": 59087
  3629. },
  3630. {
  3631. "icon_id": "25027048",
  3632. "name": "wallet",
  3633. "font_class": "wallet",
  3634. "unicode": "e6b1",
  3635. "unicode_decimal": 59057
  3636. },
  3637. {
  3638. "icon_id": "25015720",
  3639. "name": "settings-filled",
  3640. "font_class": "settings-filled",
  3641. "unicode": "e6ce",
  3642. "unicode_decimal": 59086
  3643. },
  3644. {
  3645. "icon_id": "25015434",
  3646. "name": "shimingrenzheng-filled",
  3647. "font_class": "auth-filled",
  3648. "unicode": "e6cc",
  3649. "unicode_decimal": 59084
  3650. },
  3651. {
  3652. "icon_id": "24934246",
  3653. "name": "shop-filled",
  3654. "font_class": "shop-filled",
  3655. "unicode": "e6cd",
  3656. "unicode_decimal": 59085
  3657. },
  3658. {
  3659. "icon_id": "24934159",
  3660. "name": "staff-filled-01",
  3661. "font_class": "staff-filled",
  3662. "unicode": "e6cb",
  3663. "unicode_decimal": 59083
  3664. },
  3665. {
  3666. "icon_id": "24932461",
  3667. "name": "VIP-filled",
  3668. "font_class": "vip-filled",
  3669. "unicode": "e6c6",
  3670. "unicode_decimal": 59078
  3671. },
  3672. {
  3673. "icon_id": "24932462",
  3674. "name": "plus_circle_fill",
  3675. "font_class": "plus-filled",
  3676. "unicode": "e6c7",
  3677. "unicode_decimal": 59079
  3678. },
  3679. {
  3680. "icon_id": "24932463",
  3681. "name": "folder_add-filled",
  3682. "font_class": "folder-add-filled",
  3683. "unicode": "e6c8",
  3684. "unicode_decimal": 59080
  3685. },
  3686. {
  3687. "icon_id": "24932464",
  3688. "name": "yanse-filled",
  3689. "font_class": "color-filled",
  3690. "unicode": "e6c9",
  3691. "unicode_decimal": 59081
  3692. },
  3693. {
  3694. "icon_id": "24932465",
  3695. "name": "tune-filled",
  3696. "font_class": "tune-filled",
  3697. "unicode": "e6ca",
  3698. "unicode_decimal": 59082
  3699. },
  3700. {
  3701. "icon_id": "24932455",
  3702. "name": "a-rilidaka-filled",
  3703. "font_class": "calendar-filled",
  3704. "unicode": "e6c0",
  3705. "unicode_decimal": 59072
  3706. },
  3707. {
  3708. "icon_id": "24932456",
  3709. "name": "notification-filled",
  3710. "font_class": "notification-filled",
  3711. "unicode": "e6c1",
  3712. "unicode_decimal": 59073
  3713. },
  3714. {
  3715. "icon_id": "24932457",
  3716. "name": "wallet-filled",
  3717. "font_class": "wallet-filled",
  3718. "unicode": "e6c2",
  3719. "unicode_decimal": 59074
  3720. },
  3721. {
  3722. "icon_id": "24932458",
  3723. "name": "paihangbang-filled",
  3724. "font_class": "medal-filled",
  3725. "unicode": "e6c3",
  3726. "unicode_decimal": 59075
  3727. },
  3728. {
  3729. "icon_id": "24932459",
  3730. "name": "gift-filled",
  3731. "font_class": "gift-filled",
  3732. "unicode": "e6c4",
  3733. "unicode_decimal": 59076
  3734. },
  3735. {
  3736. "icon_id": "24932460",
  3737. "name": "fire-filled",
  3738. "font_class": "fire-filled",
  3739. "unicode": "e6c5",
  3740. "unicode_decimal": 59077
  3741. },
  3742. {
  3743. "icon_id": "24928001",
  3744. "name": "refreshempty",
  3745. "font_class": "refreshempty",
  3746. "unicode": "e6bf",
  3747. "unicode_decimal": 59071
  3748. },
  3749. {
  3750. "icon_id": "24926853",
  3751. "name": "location-ellipse",
  3752. "font_class": "location-filled",
  3753. "unicode": "e6af",
  3754. "unicode_decimal": 59055
  3755. },
  3756. {
  3757. "icon_id": "24926735",
  3758. "name": "person-filled",
  3759. "font_class": "person-filled",
  3760. "unicode": "e69d",
  3761. "unicode_decimal": 59037
  3762. },
  3763. {
  3764. "icon_id": "24926703",
  3765. "name": "personadd-filled",
  3766. "font_class": "personadd-filled",
  3767. "unicode": "e698",
  3768. "unicode_decimal": 59032
  3769. },
  3770. {
  3771. "icon_id": "24923351",
  3772. "name": "back",
  3773. "font_class": "back",
  3774. "unicode": "e6b9",
  3775. "unicode_decimal": 59065
  3776. },
  3777. {
  3778. "icon_id": "24923352",
  3779. "name": "forward",
  3780. "font_class": "forward",
  3781. "unicode": "e6ba",
  3782. "unicode_decimal": 59066
  3783. },
  3784. {
  3785. "icon_id": "24923353",
  3786. "name": "arrowthinright",
  3787. "font_class": "arrow-right",
  3788. "unicode": "e6bb",
  3789. "unicode_decimal": 59067
  3790. },
  3791. {
  3792. "icon_id": "24923353",
  3793. "name": "arrowthinright",
  3794. "font_class": "arrowthinright",
  3795. "unicode": "e6bb",
  3796. "unicode_decimal": 59067
  3797. },
  3798. {
  3799. "icon_id": "24923354",
  3800. "name": "arrowthinleft",
  3801. "font_class": "arrow-left",
  3802. "unicode": "e6bc",
  3803. "unicode_decimal": 59068
  3804. },
  3805. {
  3806. "icon_id": "24923354",
  3807. "name": "arrowthinleft",
  3808. "font_class": "arrowthinleft",
  3809. "unicode": "e6bc",
  3810. "unicode_decimal": 59068
  3811. },
  3812. {
  3813. "icon_id": "24923355",
  3814. "name": "arrowthinup",
  3815. "font_class": "arrow-up",
  3816. "unicode": "e6bd",
  3817. "unicode_decimal": 59069
  3818. },
  3819. {
  3820. "icon_id": "24923355",
  3821. "name": "arrowthinup",
  3822. "font_class": "arrowthinup",
  3823. "unicode": "e6bd",
  3824. "unicode_decimal": 59069
  3825. },
  3826. {
  3827. "icon_id": "24923356",
  3828. "name": "arrowthindown",
  3829. "font_class": "arrow-down",
  3830. "unicode": "e6be",
  3831. "unicode_decimal": 59070
  3832. },
  3833. {
  3834. "icon_id": "24923356",
  3835. "name": "arrowthindown",
  3836. "font_class": "arrowthindown",
  3837. "unicode": "e6be",
  3838. "unicode_decimal": 59070
  3839. },
  3840. {
  3841. "icon_id": "24923349",
  3842. "name": "arrowdown",
  3843. "font_class": "bottom",
  3844. "unicode": "e6b8",
  3845. "unicode_decimal": 59064
  3846. },
  3847. {
  3848. "icon_id": "24923349",
  3849. "name": "arrowdown",
  3850. "font_class": "arrowdown",
  3851. "unicode": "e6b8",
  3852. "unicode_decimal": 59064
  3853. },
  3854. {
  3855. "icon_id": "24923346",
  3856. "name": "arrowright",
  3857. "font_class": "right",
  3858. "unicode": "e6b5",
  3859. "unicode_decimal": 59061
  3860. },
  3861. {
  3862. "icon_id": "24923346",
  3863. "name": "arrowright",
  3864. "font_class": "arrowright",
  3865. "unicode": "e6b5",
  3866. "unicode_decimal": 59061
  3867. },
  3868. {
  3869. "icon_id": "24923347",
  3870. "name": "arrowup",
  3871. "font_class": "top",
  3872. "unicode": "e6b6",
  3873. "unicode_decimal": 59062
  3874. },
  3875. {
  3876. "icon_id": "24923347",
  3877. "name": "arrowup",
  3878. "font_class": "arrowup",
  3879. "unicode": "e6b6",
  3880. "unicode_decimal": 59062
  3881. },
  3882. {
  3883. "icon_id": "24923348",
  3884. "name": "arrowleft",
  3885. "font_class": "left",
  3886. "unicode": "e6b7",
  3887. "unicode_decimal": 59063
  3888. },
  3889. {
  3890. "icon_id": "24923348",
  3891. "name": "arrowleft",
  3892. "font_class": "arrowleft",
  3893. "unicode": "e6b7",
  3894. "unicode_decimal": 59063
  3895. },
  3896. {
  3897. "icon_id": "24923334",
  3898. "name": "eye",
  3899. "font_class": "eye",
  3900. "unicode": "e651",
  3901. "unicode_decimal": 58961
  3902. },
  3903. {
  3904. "icon_id": "24923335",
  3905. "name": "eye-filled",
  3906. "font_class": "eye-filled",
  3907. "unicode": "e66a",
  3908. "unicode_decimal": 58986
  3909. },
  3910. {
  3911. "icon_id": "24923336",
  3912. "name": "eye-slash",
  3913. "font_class": "eye-slash",
  3914. "unicode": "e6b3",
  3915. "unicode_decimal": 59059
  3916. },
  3917. {
  3918. "icon_id": "24923337",
  3919. "name": "eye-slash-filled",
  3920. "font_class": "eye-slash-filled",
  3921. "unicode": "e6b4",
  3922. "unicode_decimal": 59060
  3923. },
  3924. {
  3925. "icon_id": "24923305",
  3926. "name": "info-filled",
  3927. "font_class": "info-filled",
  3928. "unicode": "e649",
  3929. "unicode_decimal": 58953
  3930. },
  3931. {
  3932. "icon_id": "24923299",
  3933. "name": "reload-01",
  3934. "font_class": "reload",
  3935. "unicode": "e6b2",
  3936. "unicode_decimal": 59058
  3937. },
  3938. {
  3939. "icon_id": "24923195",
  3940. "name": "mic_slash_fill",
  3941. "font_class": "micoff-filled",
  3942. "unicode": "e6b0",
  3943. "unicode_decimal": 59056
  3944. },
  3945. {
  3946. "icon_id": "24923165",
  3947. "name": "map-pin-ellipse",
  3948. "font_class": "map-pin-ellipse",
  3949. "unicode": "e6ac",
  3950. "unicode_decimal": 59052
  3951. },
  3952. {
  3953. "icon_id": "24923166",
  3954. "name": "map-pin",
  3955. "font_class": "map-pin",
  3956. "unicode": "e6ad",
  3957. "unicode_decimal": 59053
  3958. },
  3959. {
  3960. "icon_id": "24923167",
  3961. "name": "location",
  3962. "font_class": "location",
  3963. "unicode": "e6ae",
  3964. "unicode_decimal": 59054
  3965. },
  3966. {
  3967. "icon_id": "24923064",
  3968. "name": "starhalf",
  3969. "font_class": "starhalf",
  3970. "unicode": "e683",
  3971. "unicode_decimal": 59011
  3972. },
  3973. {
  3974. "icon_id": "24923065",
  3975. "name": "star",
  3976. "font_class": "star",
  3977. "unicode": "e688",
  3978. "unicode_decimal": 59016
  3979. },
  3980. {
  3981. "icon_id": "24923066",
  3982. "name": "star-filled",
  3983. "font_class": "star-filled",
  3984. "unicode": "e68f",
  3985. "unicode_decimal": 59023
  3986. },
  3987. {
  3988. "icon_id": "24899646",
  3989. "name": "a-rilidaka",
  3990. "font_class": "calendar",
  3991. "unicode": "e6a0",
  3992. "unicode_decimal": 59040
  3993. },
  3994. {
  3995. "icon_id": "24899647",
  3996. "name": "fire",
  3997. "font_class": "fire",
  3998. "unicode": "e6a1",
  3999. "unicode_decimal": 59041
  4000. },
  4001. {
  4002. "icon_id": "24899648",
  4003. "name": "paihangbang",
  4004. "font_class": "medal",
  4005. "unicode": "e6a2",
  4006. "unicode_decimal": 59042
  4007. },
  4008. {
  4009. "icon_id": "24899649",
  4010. "name": "font",
  4011. "font_class": "font",
  4012. "unicode": "e6a3",
  4013. "unicode_decimal": 59043
  4014. },
  4015. {
  4016. "icon_id": "24899650",
  4017. "name": "gift",
  4018. "font_class": "gift",
  4019. "unicode": "e6a4",
  4020. "unicode_decimal": 59044
  4021. },
  4022. {
  4023. "icon_id": "24899651",
  4024. "name": "link",
  4025. "font_class": "link",
  4026. "unicode": "e6a5",
  4027. "unicode_decimal": 59045
  4028. },
  4029. {
  4030. "icon_id": "24899652",
  4031. "name": "notification",
  4032. "font_class": "notification",
  4033. "unicode": "e6a6",
  4034. "unicode_decimal": 59046
  4035. },
  4036. {
  4037. "icon_id": "24899653",
  4038. "name": "staff",
  4039. "font_class": "staff",
  4040. "unicode": "e6a7",
  4041. "unicode_decimal": 59047
  4042. },
  4043. {
  4044. "icon_id": "24899654",
  4045. "name": "VIP",
  4046. "font_class": "vip",
  4047. "unicode": "e6a8",
  4048. "unicode_decimal": 59048
  4049. },
  4050. {
  4051. "icon_id": "24899655",
  4052. "name": "folder_add",
  4053. "font_class": "folder-add",
  4054. "unicode": "e6a9",
  4055. "unicode_decimal": 59049
  4056. },
  4057. {
  4058. "icon_id": "24899656",
  4059. "name": "tune",
  4060. "font_class": "tune",
  4061. "unicode": "e6aa",
  4062. "unicode_decimal": 59050
  4063. },
  4064. {
  4065. "icon_id": "24899657",
  4066. "name": "shimingrenzheng",
  4067. "font_class": "auth",
  4068. "unicode": "e6ab",
  4069. "unicode_decimal": 59051
  4070. },
  4071. {
  4072. "icon_id": "24899565",
  4073. "name": "person",
  4074. "font_class": "person",
  4075. "unicode": "e699",
  4076. "unicode_decimal": 59033
  4077. },
  4078. {
  4079. "icon_id": "24899566",
  4080. "name": "email-filled",
  4081. "font_class": "email-filled",
  4082. "unicode": "e69a",
  4083. "unicode_decimal": 59034
  4084. },
  4085. {
  4086. "icon_id": "24899567",
  4087. "name": "phone-filled",
  4088. "font_class": "phone-filled",
  4089. "unicode": "e69b",
  4090. "unicode_decimal": 59035
  4091. },
  4092. {
  4093. "icon_id": "24899568",
  4094. "name": "phone",
  4095. "font_class": "phone",
  4096. "unicode": "e69c",
  4097. "unicode_decimal": 59036
  4098. },
  4099. {
  4100. "icon_id": "24899570",
  4101. "name": "email",
  4102. "font_class": "email",
  4103. "unicode": "e69e",
  4104. "unicode_decimal": 59038
  4105. },
  4106. {
  4107. "icon_id": "24899571",
  4108. "name": "personadd",
  4109. "font_class": "personadd",
  4110. "unicode": "e69f",
  4111. "unicode_decimal": 59039
  4112. },
  4113. {
  4114. "icon_id": "24899558",
  4115. "name": "chatboxes-filled",
  4116. "font_class": "chatboxes-filled",
  4117. "unicode": "e692",
  4118. "unicode_decimal": 59026
  4119. },
  4120. {
  4121. "icon_id": "24899559",
  4122. "name": "contact",
  4123. "font_class": "contact",
  4124. "unicode": "e693",
  4125. "unicode_decimal": 59027
  4126. },
  4127. {
  4128. "icon_id": "24899560",
  4129. "name": "chatbubble-filled",
  4130. "font_class": "chatbubble-filled",
  4131. "unicode": "e694",
  4132. "unicode_decimal": 59028
  4133. },
  4134. {
  4135. "icon_id": "24899561",
  4136. "name": "contact-filled",
  4137. "font_class": "contact-filled",
  4138. "unicode": "e695",
  4139. "unicode_decimal": 59029
  4140. },
  4141. {
  4142. "icon_id": "24899562",
  4143. "name": "chatboxes",
  4144. "font_class": "chatboxes",
  4145. "unicode": "e696",
  4146. "unicode_decimal": 59030
  4147. },
  4148. {
  4149. "icon_id": "24899563",
  4150. "name": "chatbubble",
  4151. "font_class": "chatbubble",
  4152. "unicode": "e697",
  4153. "unicode_decimal": 59031
  4154. },
  4155. {
  4156. "icon_id": "24881290",
  4157. "name": "upload-filled",
  4158. "font_class": "upload-filled",
  4159. "unicode": "e68e",
  4160. "unicode_decimal": 59022
  4161. },
  4162. {
  4163. "icon_id": "24881292",
  4164. "name": "upload",
  4165. "font_class": "upload",
  4166. "unicode": "e690",
  4167. "unicode_decimal": 59024
  4168. },
  4169. {
  4170. "icon_id": "24881293",
  4171. "name": "weixin",
  4172. "font_class": "weixin",
  4173. "unicode": "e691",
  4174. "unicode_decimal": 59025
  4175. },
  4176. {
  4177. "icon_id": "24881274",
  4178. "name": "compose",
  4179. "font_class": "compose",
  4180. "unicode": "e67f",
  4181. "unicode_decimal": 59007
  4182. },
  4183. {
  4184. "icon_id": "24881275",
  4185. "name": "qq",
  4186. "font_class": "qq",
  4187. "unicode": "e680",
  4188. "unicode_decimal": 59008
  4189. },
  4190. {
  4191. "icon_id": "24881276",
  4192. "name": "download-filled",
  4193. "font_class": "download-filled",
  4194. "unicode": "e681",
  4195. "unicode_decimal": 59009
  4196. },
  4197. {
  4198. "icon_id": "24881277",
  4199. "name": "pengyouquan",
  4200. "font_class": "pyq",
  4201. "unicode": "e682",
  4202. "unicode_decimal": 59010
  4203. },
  4204. {
  4205. "icon_id": "24881279",
  4206. "name": "sound",
  4207. "font_class": "sound",
  4208. "unicode": "e684",
  4209. "unicode_decimal": 59012
  4210. },
  4211. {
  4212. "icon_id": "24881280",
  4213. "name": "trash-filled",
  4214. "font_class": "trash-filled",
  4215. "unicode": "e685",
  4216. "unicode_decimal": 59013
  4217. },
  4218. {
  4219. "icon_id": "24881281",
  4220. "name": "sound-filled",
  4221. "font_class": "sound-filled",
  4222. "unicode": "e686",
  4223. "unicode_decimal": 59014
  4224. },
  4225. {
  4226. "icon_id": "24881282",
  4227. "name": "trash",
  4228. "font_class": "trash",
  4229. "unicode": "e687",
  4230. "unicode_decimal": 59015
  4231. },
  4232. {
  4233. "icon_id": "24881284",
  4234. "name": "videocam-filled",
  4235. "font_class": "videocam-filled",
  4236. "unicode": "e689",
  4237. "unicode_decimal": 59017
  4238. },
  4239. {
  4240. "icon_id": "24881285",
  4241. "name": "spinner-cycle",
  4242. "font_class": "spinner-cycle",
  4243. "unicode": "e68a",
  4244. "unicode_decimal": 59018
  4245. },
  4246. {
  4247. "icon_id": "24881286",
  4248. "name": "weibo",
  4249. "font_class": "weibo",
  4250. "unicode": "e68b",
  4251. "unicode_decimal": 59019
  4252. },
  4253. {
  4254. "icon_id": "24881288",
  4255. "name": "videocam",
  4256. "font_class": "videocam",
  4257. "unicode": "e68c",
  4258. "unicode_decimal": 59020
  4259. },
  4260. {
  4261. "icon_id": "24881289",
  4262. "name": "download",
  4263. "font_class": "download",
  4264. "unicode": "e68d",
  4265. "unicode_decimal": 59021
  4266. },
  4267. {
  4268. "icon_id": "24879601",
  4269. "name": "help",
  4270. "font_class": "help",
  4271. "unicode": "e679",
  4272. "unicode_decimal": 59001
  4273. },
  4274. {
  4275. "icon_id": "24879602",
  4276. "name": "navigate-filled",
  4277. "font_class": "navigate-filled",
  4278. "unicode": "e67a",
  4279. "unicode_decimal": 59002
  4280. },
  4281. {
  4282. "icon_id": "24879603",
  4283. "name": "plusempty",
  4284. "font_class": "plusempty",
  4285. "unicode": "e67b",
  4286. "unicode_decimal": 59003
  4287. },
  4288. {
  4289. "icon_id": "24879604",
  4290. "name": "smallcircle",
  4291. "font_class": "smallcircle",
  4292. "unicode": "e67c",
  4293. "unicode_decimal": 59004
  4294. },
  4295. {
  4296. "icon_id": "24879605",
  4297. "name": "minus-filled",
  4298. "font_class": "minus-filled",
  4299. "unicode": "e67d",
  4300. "unicode_decimal": 59005
  4301. },
  4302. {
  4303. "icon_id": "24879606",
  4304. "name": "micoff",
  4305. "font_class": "micoff",
  4306. "unicode": "e67e",
  4307. "unicode_decimal": 59006
  4308. },
  4309. {
  4310. "icon_id": "24879588",
  4311. "name": "closeempty",
  4312. "font_class": "closeempty",
  4313. "unicode": "e66c",
  4314. "unicode_decimal": 58988
  4315. },
  4316. {
  4317. "icon_id": "24879589",
  4318. "name": "clear",
  4319. "font_class": "clear",
  4320. "unicode": "e66d",
  4321. "unicode_decimal": 58989
  4322. },
  4323. {
  4324. "icon_id": "24879590",
  4325. "name": "navigate",
  4326. "font_class": "navigate",
  4327. "unicode": "e66e",
  4328. "unicode_decimal": 58990
  4329. },
  4330. {
  4331. "icon_id": "24879591",
  4332. "name": "minus",
  4333. "font_class": "minus",
  4334. "unicode": "e66f",
  4335. "unicode_decimal": 58991
  4336. },
  4337. {
  4338. "icon_id": "24879592",
  4339. "name": "image",
  4340. "font_class": "image",
  4341. "unicode": "e670",
  4342. "unicode_decimal": 58992
  4343. },
  4344. {
  4345. "icon_id": "24879593",
  4346. "name": "mic",
  4347. "font_class": "mic",
  4348. "unicode": "e671",
  4349. "unicode_decimal": 58993
  4350. },
  4351. {
  4352. "icon_id": "24879594",
  4353. "name": "paperplane",
  4354. "font_class": "paperplane",
  4355. "unicode": "e672",
  4356. "unicode_decimal": 58994
  4357. },
  4358. {
  4359. "icon_id": "24879595",
  4360. "name": "close",
  4361. "font_class": "close",
  4362. "unicode": "e673",
  4363. "unicode_decimal": 58995
  4364. },
  4365. {
  4366. "icon_id": "24879596",
  4367. "name": "help-filled",
  4368. "font_class": "help-filled",
  4369. "unicode": "e674",
  4370. "unicode_decimal": 58996
  4371. },
  4372. {
  4373. "icon_id": "24879597",
  4374. "name": "plus-filled",
  4375. "font_class": "paperplane-filled",
  4376. "unicode": "e675",
  4377. "unicode_decimal": 58997
  4378. },
  4379. {
  4380. "icon_id": "24879598",
  4381. "name": "plus",
  4382. "font_class": "plus",
  4383. "unicode": "e676",
  4384. "unicode_decimal": 58998
  4385. },
  4386. {
  4387. "icon_id": "24879599",
  4388. "name": "mic-filled",
  4389. "font_class": "mic-filled",
  4390. "unicode": "e677",
  4391. "unicode_decimal": 58999
  4392. },
  4393. {
  4394. "icon_id": "24879600",
  4395. "name": "image-filled",
  4396. "font_class": "image-filled",
  4397. "unicode": "e678",
  4398. "unicode_decimal": 59e3
  4399. },
  4400. {
  4401. "icon_id": "24855900",
  4402. "name": "locked-filled",
  4403. "font_class": "locked-filled",
  4404. "unicode": "e668",
  4405. "unicode_decimal": 58984
  4406. },
  4407. {
  4408. "icon_id": "24855901",
  4409. "name": "info",
  4410. "font_class": "info",
  4411. "unicode": "e669",
  4412. "unicode_decimal": 58985
  4413. },
  4414. {
  4415. "icon_id": "24855903",
  4416. "name": "locked",
  4417. "font_class": "locked",
  4418. "unicode": "e66b",
  4419. "unicode_decimal": 58987
  4420. },
  4421. {
  4422. "icon_id": "24855884",
  4423. "name": "camera-filled",
  4424. "font_class": "camera-filled",
  4425. "unicode": "e658",
  4426. "unicode_decimal": 58968
  4427. },
  4428. {
  4429. "icon_id": "24855885",
  4430. "name": "chat-filled",
  4431. "font_class": "chat-filled",
  4432. "unicode": "e659",
  4433. "unicode_decimal": 58969
  4434. },
  4435. {
  4436. "icon_id": "24855886",
  4437. "name": "camera",
  4438. "font_class": "camera",
  4439. "unicode": "e65a",
  4440. "unicode_decimal": 58970
  4441. },
  4442. {
  4443. "icon_id": "24855887",
  4444. "name": "circle",
  4445. "font_class": "circle",
  4446. "unicode": "e65b",
  4447. "unicode_decimal": 58971
  4448. },
  4449. {
  4450. "icon_id": "24855888",
  4451. "name": "checkmarkempty",
  4452. "font_class": "checkmarkempty",
  4453. "unicode": "e65c",
  4454. "unicode_decimal": 58972
  4455. },
  4456. {
  4457. "icon_id": "24855889",
  4458. "name": "chat",
  4459. "font_class": "chat",
  4460. "unicode": "e65d",
  4461. "unicode_decimal": 58973
  4462. },
  4463. {
  4464. "icon_id": "24855890",
  4465. "name": "circle-filled",
  4466. "font_class": "circle-filled",
  4467. "unicode": "e65e",
  4468. "unicode_decimal": 58974
  4469. },
  4470. {
  4471. "icon_id": "24855891",
  4472. "name": "flag",
  4473. "font_class": "flag",
  4474. "unicode": "e65f",
  4475. "unicode_decimal": 58975
  4476. },
  4477. {
  4478. "icon_id": "24855892",
  4479. "name": "flag-filled",
  4480. "font_class": "flag-filled",
  4481. "unicode": "e660",
  4482. "unicode_decimal": 58976
  4483. },
  4484. {
  4485. "icon_id": "24855893",
  4486. "name": "gear-filled",
  4487. "font_class": "gear-filled",
  4488. "unicode": "e661",
  4489. "unicode_decimal": 58977
  4490. },
  4491. {
  4492. "icon_id": "24855894",
  4493. "name": "home",
  4494. "font_class": "home",
  4495. "unicode": "e662",
  4496. "unicode_decimal": 58978
  4497. },
  4498. {
  4499. "icon_id": "24855895",
  4500. "name": "home-filled",
  4501. "font_class": "home-filled",
  4502. "unicode": "e663",
  4503. "unicode_decimal": 58979
  4504. },
  4505. {
  4506. "icon_id": "24855896",
  4507. "name": "gear",
  4508. "font_class": "gear",
  4509. "unicode": "e664",
  4510. "unicode_decimal": 58980
  4511. },
  4512. {
  4513. "icon_id": "24855897",
  4514. "name": "smallcircle-filled",
  4515. "font_class": "smallcircle-filled",
  4516. "unicode": "e665",
  4517. "unicode_decimal": 58981
  4518. },
  4519. {
  4520. "icon_id": "24855898",
  4521. "name": "map-filled",
  4522. "font_class": "map-filled",
  4523. "unicode": "e666",
  4524. "unicode_decimal": 58982
  4525. },
  4526. {
  4527. "icon_id": "24855899",
  4528. "name": "map",
  4529. "font_class": "map",
  4530. "unicode": "e667",
  4531. "unicode_decimal": 58983
  4532. },
  4533. {
  4534. "icon_id": "24855825",
  4535. "name": "refresh-filled",
  4536. "font_class": "refresh-filled",
  4537. "unicode": "e656",
  4538. "unicode_decimal": 58966
  4539. },
  4540. {
  4541. "icon_id": "24855826",
  4542. "name": "refresh",
  4543. "font_class": "refresh",
  4544. "unicode": "e657",
  4545. "unicode_decimal": 58967
  4546. },
  4547. {
  4548. "icon_id": "24855808",
  4549. "name": "cloud-upload",
  4550. "font_class": "cloud-upload",
  4551. "unicode": "e645",
  4552. "unicode_decimal": 58949
  4553. },
  4554. {
  4555. "icon_id": "24855809",
  4556. "name": "cloud-download-filled",
  4557. "font_class": "cloud-download-filled",
  4558. "unicode": "e646",
  4559. "unicode_decimal": 58950
  4560. },
  4561. {
  4562. "icon_id": "24855810",
  4563. "name": "cloud-download",
  4564. "font_class": "cloud-download",
  4565. "unicode": "e647",
  4566. "unicode_decimal": 58951
  4567. },
  4568. {
  4569. "icon_id": "24855811",
  4570. "name": "cloud-upload-filled",
  4571. "font_class": "cloud-upload-filled",
  4572. "unicode": "e648",
  4573. "unicode_decimal": 58952
  4574. },
  4575. {
  4576. "icon_id": "24855813",
  4577. "name": "redo",
  4578. "font_class": "redo",
  4579. "unicode": "e64a",
  4580. "unicode_decimal": 58954
  4581. },
  4582. {
  4583. "icon_id": "24855814",
  4584. "name": "images-filled",
  4585. "font_class": "images-filled",
  4586. "unicode": "e64b",
  4587. "unicode_decimal": 58955
  4588. },
  4589. {
  4590. "icon_id": "24855815",
  4591. "name": "undo-filled",
  4592. "font_class": "undo-filled",
  4593. "unicode": "e64c",
  4594. "unicode_decimal": 58956
  4595. },
  4596. {
  4597. "icon_id": "24855816",
  4598. "name": "more",
  4599. "font_class": "more",
  4600. "unicode": "e64d",
  4601. "unicode_decimal": 58957
  4602. },
  4603. {
  4604. "icon_id": "24855817",
  4605. "name": "more-filled",
  4606. "font_class": "more-filled",
  4607. "unicode": "e64e",
  4608. "unicode_decimal": 58958
  4609. },
  4610. {
  4611. "icon_id": "24855818",
  4612. "name": "undo",
  4613. "font_class": "undo",
  4614. "unicode": "e64f",
  4615. "unicode_decimal": 58959
  4616. },
  4617. {
  4618. "icon_id": "24855819",
  4619. "name": "images",
  4620. "font_class": "images",
  4621. "unicode": "e650",
  4622. "unicode_decimal": 58960
  4623. },
  4624. {
  4625. "icon_id": "24855821",
  4626. "name": "paperclip",
  4627. "font_class": "paperclip",
  4628. "unicode": "e652",
  4629. "unicode_decimal": 58962
  4630. },
  4631. {
  4632. "icon_id": "24855822",
  4633. "name": "settings",
  4634. "font_class": "settings",
  4635. "unicode": "e653",
  4636. "unicode_decimal": 58963
  4637. },
  4638. {
  4639. "icon_id": "24855823",
  4640. "name": "search",
  4641. "font_class": "search",
  4642. "unicode": "e654",
  4643. "unicode_decimal": 58964
  4644. },
  4645. {
  4646. "icon_id": "24855824",
  4647. "name": "redo-filled",
  4648. "font_class": "redo-filled",
  4649. "unicode": "e655",
  4650. "unicode_decimal": 58965
  4651. },
  4652. {
  4653. "icon_id": "24841702",
  4654. "name": "list",
  4655. "font_class": "list",
  4656. "unicode": "e644",
  4657. "unicode_decimal": 58948
  4658. },
  4659. {
  4660. "icon_id": "24841489",
  4661. "name": "mail-open-filled",
  4662. "font_class": "mail-open-filled",
  4663. "unicode": "e63a",
  4664. "unicode_decimal": 58938
  4665. },
  4666. {
  4667. "icon_id": "24841491",
  4668. "name": "hand-thumbsdown-filled",
  4669. "font_class": "hand-down-filled",
  4670. "unicode": "e63c",
  4671. "unicode_decimal": 58940
  4672. },
  4673. {
  4674. "icon_id": "24841492",
  4675. "name": "hand-thumbsdown",
  4676. "font_class": "hand-down",
  4677. "unicode": "e63d",
  4678. "unicode_decimal": 58941
  4679. },
  4680. {
  4681. "icon_id": "24841493",
  4682. "name": "hand-thumbsup-filled",
  4683. "font_class": "hand-up-filled",
  4684. "unicode": "e63e",
  4685. "unicode_decimal": 58942
  4686. },
  4687. {
  4688. "icon_id": "24841494",
  4689. "name": "hand-thumbsup",
  4690. "font_class": "hand-up",
  4691. "unicode": "e63f",
  4692. "unicode_decimal": 58943
  4693. },
  4694. {
  4695. "icon_id": "24841496",
  4696. "name": "heart-filled",
  4697. "font_class": "heart-filled",
  4698. "unicode": "e641",
  4699. "unicode_decimal": 58945
  4700. },
  4701. {
  4702. "icon_id": "24841498",
  4703. "name": "mail-open",
  4704. "font_class": "mail-open",
  4705. "unicode": "e643",
  4706. "unicode_decimal": 58947
  4707. },
  4708. {
  4709. "icon_id": "24841488",
  4710. "name": "heart",
  4711. "font_class": "heart",
  4712. "unicode": "e639",
  4713. "unicode_decimal": 58937
  4714. },
  4715. {
  4716. "icon_id": "24839963",
  4717. "name": "loop",
  4718. "font_class": "loop",
  4719. "unicode": "e633",
  4720. "unicode_decimal": 58931
  4721. },
  4722. {
  4723. "icon_id": "24839866",
  4724. "name": "pulldown",
  4725. "font_class": "pulldown",
  4726. "unicode": "e632",
  4727. "unicode_decimal": 58930
  4728. },
  4729. {
  4730. "icon_id": "24813798",
  4731. "name": "scan",
  4732. "font_class": "scan",
  4733. "unicode": "e62a",
  4734. "unicode_decimal": 58922
  4735. },
  4736. {
  4737. "icon_id": "24813786",
  4738. "name": "bars",
  4739. "font_class": "bars",
  4740. "unicode": "e627",
  4741. "unicode_decimal": 58919
  4742. },
  4743. {
  4744. "icon_id": "24813788",
  4745. "name": "cart-filled",
  4746. "font_class": "cart-filled",
  4747. "unicode": "e629",
  4748. "unicode_decimal": 58921
  4749. },
  4750. {
  4751. "icon_id": "24813790",
  4752. "name": "checkbox",
  4753. "font_class": "checkbox",
  4754. "unicode": "e62b",
  4755. "unicode_decimal": 58923
  4756. },
  4757. {
  4758. "icon_id": "24813791",
  4759. "name": "checkbox-filled",
  4760. "font_class": "checkbox-filled",
  4761. "unicode": "e62c",
  4762. "unicode_decimal": 58924
  4763. },
  4764. {
  4765. "icon_id": "24813794",
  4766. "name": "shop",
  4767. "font_class": "shop",
  4768. "unicode": "e62f",
  4769. "unicode_decimal": 58927
  4770. },
  4771. {
  4772. "icon_id": "24813795",
  4773. "name": "headphones",
  4774. "font_class": "headphones",
  4775. "unicode": "e630",
  4776. "unicode_decimal": 58928
  4777. },
  4778. {
  4779. "icon_id": "24813796",
  4780. "name": "cart",
  4781. "font_class": "cart",
  4782. "unicode": "e631",
  4783. "unicode_decimal": 58929
  4784. }
  4785. ]
  4786. };
  4787. const getVal = (val) => {
  4788. const reg = /^[0-9]*$/g;
  4789. return typeof val === "number" || reg.test(val) ? val + "px" : val;
  4790. };
  4791. const _sfc_main$P = {
  4792. name: "UniIcons",
  4793. emits: ["click"],
  4794. props: {
  4795. type: {
  4796. type: String,
  4797. default: ""
  4798. },
  4799. color: {
  4800. type: String,
  4801. default: "#333333"
  4802. },
  4803. size: {
  4804. type: [Number, String],
  4805. default: 16
  4806. },
  4807. customPrefix: {
  4808. type: String,
  4809. default: ""
  4810. }
  4811. },
  4812. data() {
  4813. return {
  4814. icons: icons.glyphs
  4815. };
  4816. },
  4817. computed: {
  4818. unicode() {
  4819. let code = this.icons.find((v2) => v2.font_class === this.type);
  4820. if (code) {
  4821. return unescape(`%u${code.unicode}`);
  4822. }
  4823. return "";
  4824. },
  4825. iconSize() {
  4826. return getVal(this.size);
  4827. }
  4828. },
  4829. methods: {
  4830. _onClick() {
  4831. this.$emit("click");
  4832. }
  4833. }
  4834. };
  4835. function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) {
  4836. return vue.openBlock(), vue.createElementBlock(
  4837. "text",
  4838. {
  4839. style: vue.normalizeStyle({ color: $props.color, "font-size": $options.iconSize }),
  4840. class: vue.normalizeClass(["uni-icons", ["uniui-" + $props.type, $props.customPrefix, $props.customPrefix ? $props.type : ""]]),
  4841. onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
  4842. },
  4843. null,
  4844. 6
  4845. /* CLASS, STYLE */
  4846. );
  4847. }
  4848. const __easycom_0$8 = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$O], ["__scopeId", "data-v-946bce22"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue"]]);
  4849. function obj2strClass(obj) {
  4850. let classess = "";
  4851. for (let key in obj) {
  4852. const val = obj[key];
  4853. if (val) {
  4854. classess += `${key} `;
  4855. }
  4856. }
  4857. return classess;
  4858. }
  4859. function obj2strStyle(obj) {
  4860. let style = "";
  4861. for (let key in obj) {
  4862. const val = obj[key];
  4863. style += `${key}:${val};`;
  4864. }
  4865. return style;
  4866. }
  4867. const _sfc_main$O = {
  4868. name: "uni-easyinput",
  4869. emits: [
  4870. "click",
  4871. "iconClick",
  4872. "update:modelValue",
  4873. "input",
  4874. "focus",
  4875. "blur",
  4876. "confirm",
  4877. "clear",
  4878. "eyes",
  4879. "change"
  4880. ],
  4881. model: {
  4882. prop: "modelValue",
  4883. event: "update:modelValue"
  4884. },
  4885. options: {
  4886. virtualHost: true
  4887. },
  4888. inject: {
  4889. form: {
  4890. from: "uniForm",
  4891. default: null
  4892. },
  4893. formItem: {
  4894. from: "uniFormItem",
  4895. default: null
  4896. }
  4897. },
  4898. props: {
  4899. name: String,
  4900. value: [Number, String],
  4901. modelValue: [Number, String],
  4902. type: {
  4903. type: String,
  4904. default: "text"
  4905. },
  4906. clearable: {
  4907. type: Boolean,
  4908. default: true
  4909. },
  4910. autoHeight: {
  4911. type: Boolean,
  4912. default: false
  4913. },
  4914. placeholder: {
  4915. type: String,
  4916. default: " "
  4917. },
  4918. placeholderStyle: String,
  4919. focus: {
  4920. type: Boolean,
  4921. default: false
  4922. },
  4923. disabled: {
  4924. type: Boolean,
  4925. default: false
  4926. },
  4927. maxlength: {
  4928. type: [Number, String],
  4929. default: 140
  4930. },
  4931. confirmType: {
  4932. type: String,
  4933. default: "done"
  4934. },
  4935. clearSize: {
  4936. type: [Number, String],
  4937. default: 24
  4938. },
  4939. inputBorder: {
  4940. type: Boolean,
  4941. default: true
  4942. },
  4943. prefixIcon: {
  4944. type: String,
  4945. default: ""
  4946. },
  4947. suffixIcon: {
  4948. type: String,
  4949. default: ""
  4950. },
  4951. trim: {
  4952. type: [Boolean, String],
  4953. default: true
  4954. },
  4955. passwordIcon: {
  4956. type: Boolean,
  4957. default: true
  4958. },
  4959. primaryColor: {
  4960. type: String,
  4961. default: "#2979ff"
  4962. },
  4963. styles: {
  4964. type: Object,
  4965. default() {
  4966. return {
  4967. color: "#333",
  4968. disableColor: "#F7F6F6",
  4969. borderColor: "#e5e5e5"
  4970. };
  4971. }
  4972. },
  4973. errorMessage: {
  4974. type: [String, Boolean],
  4975. default: ""
  4976. }
  4977. },
  4978. data() {
  4979. return {
  4980. focused: false,
  4981. val: "",
  4982. showMsg: "",
  4983. border: false,
  4984. isFirstBorder: false,
  4985. showClearIcon: false,
  4986. showPassword: false,
  4987. focusShow: false,
  4988. localMsg: ""
  4989. };
  4990. },
  4991. computed: {
  4992. // 输入框内是否有值
  4993. isVal() {
  4994. const val = this.val;
  4995. if (val || val === 0) {
  4996. return true;
  4997. }
  4998. return false;
  4999. },
  5000. msg() {
  5001. return this.localMsg || this.errorMessage;
  5002. },
  5003. // 因为uniapp的input组件的maxlength组件必须要数值,这里转为数值,用户可以传入字符串数值
  5004. inputMaxlength() {
  5005. return Number(this.maxlength);
  5006. },
  5007. // 处理外层样式的style
  5008. boxStyle() {
  5009. return `color:${this.inputBorder && this.msg ? "#e43d33" : this.styles.color};`;
  5010. },
  5011. // input 内容的类和样式处理
  5012. inputContentClass() {
  5013. return obj2strClass({
  5014. "is-input-border": this.inputBorder,
  5015. "is-input-error-border": this.inputBorder && this.msg,
  5016. "is-textarea": this.type === "textarea",
  5017. "is-disabled": this.disabled
  5018. });
  5019. },
  5020. inputContentStyle() {
  5021. const focusColor = this.focusShow ? this.primaryColor : this.styles.borderColor;
  5022. const borderColor = this.inputBorder && this.msg ? "#dd524d" : focusColor;
  5023. return obj2strStyle({
  5024. "border-color": borderColor || "#e5e5e5",
  5025. "background-color": this.disabled ? this.styles.disableColor : this.styles.backgroundColor
  5026. });
  5027. },
  5028. // input右侧样式
  5029. inputStyle() {
  5030. const paddingRight = this.type === "password" || this.clearable || this.prefixIcon ? "" : "10px";
  5031. return obj2strStyle({
  5032. "padding-right": paddingRight,
  5033. "padding-left": this.prefixIcon ? "" : "10px"
  5034. });
  5035. }
  5036. },
  5037. watch: {
  5038. value(newVal) {
  5039. this.val = newVal;
  5040. },
  5041. modelValue(newVal) {
  5042. this.val = newVal;
  5043. },
  5044. focus(newVal) {
  5045. this.$nextTick(() => {
  5046. this.focused = this.focus;
  5047. this.focusShow = this.focus;
  5048. });
  5049. }
  5050. },
  5051. created() {
  5052. this.init();
  5053. if (this.form && this.formItem) {
  5054. this.$watch("formItem.errMsg", (newVal) => {
  5055. this.localMsg = newVal;
  5056. });
  5057. }
  5058. },
  5059. mounted() {
  5060. this.$nextTick(() => {
  5061. this.focused = this.focus;
  5062. this.focusShow = this.focus;
  5063. });
  5064. },
  5065. methods: {
  5066. /**
  5067. * 初始化变量值
  5068. */
  5069. init() {
  5070. if (this.value || this.value === 0) {
  5071. this.val = this.value;
  5072. } else if (this.modelValue || this.modelValue === 0) {
  5073. this.val = this.modelValue;
  5074. } else {
  5075. this.val = null;
  5076. }
  5077. },
  5078. /**
  5079. * 点击图标时触发
  5080. * @param {Object} type
  5081. */
  5082. onClickIcon(type) {
  5083. this.$emit("iconClick", type);
  5084. },
  5085. /**
  5086. * 显示隐藏内容,密码框时生效
  5087. */
  5088. onEyes() {
  5089. this.showPassword = !this.showPassword;
  5090. this.$emit("eyes", this.showPassword);
  5091. },
  5092. /**
  5093. * 输入时触发
  5094. * @param {Object} event
  5095. */
  5096. onInput(event) {
  5097. let value = event.detail.value;
  5098. if (this.trim) {
  5099. if (typeof this.trim === "boolean" && this.trim) {
  5100. value = this.trimStr(value);
  5101. }
  5102. if (typeof this.trim === "string") {
  5103. value = this.trimStr(value, this.trim);
  5104. }
  5105. }
  5106. if (this.errMsg)
  5107. this.errMsg = "";
  5108. this.val = value;
  5109. this.$emit("input", value);
  5110. this.$emit("update:modelValue", value);
  5111. },
  5112. /**
  5113. * 外部调用方法
  5114. * 获取焦点时触发
  5115. * @param {Object} event
  5116. */
  5117. onFocus() {
  5118. this.$nextTick(() => {
  5119. this.focused = true;
  5120. });
  5121. this.$emit("focus", null);
  5122. },
  5123. _Focus(event) {
  5124. this.focusShow = true;
  5125. this.$emit("focus", event);
  5126. },
  5127. /**
  5128. * 外部调用方法
  5129. * 失去焦点时触发
  5130. * @param {Object} event
  5131. */
  5132. onBlur() {
  5133. this.focused = false;
  5134. this.$emit("focus", null);
  5135. },
  5136. _Blur(event) {
  5137. event.detail.value;
  5138. this.focusShow = false;
  5139. this.$emit("blur", event);
  5140. this.$emit("change", this.val);
  5141. if (this.form && this.formItem) {
  5142. const { validateTrigger } = this.form;
  5143. if (validateTrigger === "blur") {
  5144. this.formItem.onFieldChange();
  5145. }
  5146. }
  5147. },
  5148. /**
  5149. * 按下键盘的发送键
  5150. * @param {Object} e
  5151. */
  5152. onConfirm(e2) {
  5153. this.$emit("confirm", this.val);
  5154. this.$emit("change", this.val);
  5155. },
  5156. /**
  5157. * 清理内容
  5158. * @param {Object} event
  5159. */
  5160. onClear(event) {
  5161. this.val = "";
  5162. this.$emit("input", "");
  5163. this.$emit("update:modelValue", "");
  5164. this.$emit("clear");
  5165. },
  5166. /**
  5167. * 去除空格
  5168. */
  5169. trimStr(str, pos = "both") {
  5170. if (pos === "both") {
  5171. return str.trim();
  5172. } else if (pos === "left") {
  5173. return str.trimLeft();
  5174. } else if (pos === "right") {
  5175. return str.trimRight();
  5176. } else if (pos === "start") {
  5177. return str.trimStart();
  5178. } else if (pos === "end") {
  5179. return str.trimEnd();
  5180. } else if (pos === "all") {
  5181. return str.replace(/\s+/g, "");
  5182. } else if (pos === "none") {
  5183. return str;
  5184. }
  5185. return str;
  5186. }
  5187. }
  5188. };
  5189. function _sfc_render$N(_ctx, _cache, $props, $setup, $data, $options) {
  5190. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  5191. return vue.openBlock(), vue.createElementBlock(
  5192. "view",
  5193. {
  5194. class: vue.normalizeClass(["uni-easyinput", { "uni-easyinput-error": $options.msg }]),
  5195. style: vue.normalizeStyle($options.boxStyle)
  5196. },
  5197. [
  5198. vue.createElementVNode(
  5199. "view",
  5200. {
  5201. class: vue.normalizeClass(["uni-easyinput__content", $options.inputContentClass]),
  5202. style: vue.normalizeStyle($options.inputContentStyle)
  5203. },
  5204. [
  5205. vue.renderSlot(_ctx.$slots, "prefixIcon", {}, () => [
  5206. $props.prefixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  5207. key: 0,
  5208. class: "content-clear-icon",
  5209. type: $props.prefixIcon,
  5210. color: "#c0c4cc",
  5211. onClick: _cache[0] || (_cache[0] = ($event) => $options.onClickIcon("prefix")),
  5212. size: "22"
  5213. }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true)
  5214. ], true),
  5215. $props.type === "textarea" ? (vue.openBlock(), vue.createElementBlock("textarea", {
  5216. key: 0,
  5217. class: vue.normalizeClass(["uni-easyinput__content-textarea", { "input-padding": $props.inputBorder }]),
  5218. name: $props.name,
  5219. value: $data.val,
  5220. placeholder: $props.placeholder,
  5221. placeholderStyle: $props.placeholderStyle,
  5222. disabled: $props.disabled,
  5223. "placeholder-class": "uni-easyinput__placeholder-class",
  5224. maxlength: $options.inputMaxlength,
  5225. focus: $data.focused,
  5226. autoHeight: $props.autoHeight,
  5227. onInput: _cache[1] || (_cache[1] = (...args) => $options.onInput && $options.onInput(...args)),
  5228. onBlur: _cache[2] || (_cache[2] = (...args) => $options._Blur && $options._Blur(...args)),
  5229. onFocus: _cache[3] || (_cache[3] = (...args) => $options._Focus && $options._Focus(...args)),
  5230. onConfirm: _cache[4] || (_cache[4] = (...args) => $options.onConfirm && $options.onConfirm(...args))
  5231. }, null, 42, ["name", "value", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "autoHeight"])) : (vue.openBlock(), vue.createElementBlock("input", {
  5232. key: 1,
  5233. type: $props.type === "password" ? "text" : $props.type,
  5234. class: "uni-easyinput__content-input",
  5235. style: vue.normalizeStyle($options.inputStyle),
  5236. name: $props.name,
  5237. value: $data.val,
  5238. password: !$data.showPassword && $props.type === "password",
  5239. placeholder: $props.placeholder,
  5240. placeholderStyle: $props.placeholderStyle,
  5241. "placeholder-class": "uni-easyinput__placeholder-class",
  5242. disabled: $props.disabled,
  5243. maxlength: $options.inputMaxlength,
  5244. focus: $data.focused,
  5245. confirmType: $props.confirmType,
  5246. onFocus: _cache[5] || (_cache[5] = (...args) => $options._Focus && $options._Focus(...args)),
  5247. onBlur: _cache[6] || (_cache[6] = (...args) => $options._Blur && $options._Blur(...args)),
  5248. onInput: _cache[7] || (_cache[7] = (...args) => $options.onInput && $options.onInput(...args)),
  5249. onConfirm: _cache[8] || (_cache[8] = (...args) => $options.onConfirm && $options.onConfirm(...args))
  5250. }, null, 44, ["type", "name", "value", "password", "placeholder", "placeholderStyle", "disabled", "maxlength", "focus", "confirmType"])),
  5251. $props.type === "password" && $props.passwordIcon ? (vue.openBlock(), vue.createElementBlock(
  5252. vue.Fragment,
  5253. { key: 2 },
  5254. [
  5255. vue.createCommentVNode(" 开启密码时显示小眼睛 "),
  5256. $options.isVal ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  5257. key: 0,
  5258. class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
  5259. type: $data.showPassword ? "eye-slash-filled" : "eye-filled",
  5260. size: 22,
  5261. color: $data.focusShow ? $props.primaryColor : "#c0c4cc",
  5262. onClick: $options.onEyes
  5263. }, null, 8, ["class", "type", "color", "onClick"])) : vue.createCommentVNode("v-if", true)
  5264. ],
  5265. 64
  5266. /* STABLE_FRAGMENT */
  5267. )) : $props.suffixIcon || _ctx.$slots.suffixIcon ? vue.renderSlot(_ctx.$slots, "suffixIcon", { key: 3 }, () => [
  5268. $props.suffixIcon ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  5269. key: 0,
  5270. class: "content-clear-icon",
  5271. type: $props.suffixIcon,
  5272. color: "#c0c4cc",
  5273. onClick: _cache[9] || (_cache[9] = ($event) => $options.onClickIcon("suffix")),
  5274. size: "22"
  5275. }, null, 8, ["type"])) : vue.createCommentVNode("v-if", true)
  5276. ], true) : (vue.openBlock(), vue.createElementBlock(
  5277. vue.Fragment,
  5278. { key: 4 },
  5279. [
  5280. $props.clearable && $options.isVal && !$props.disabled && $props.type !== "textarea" ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  5281. key: 0,
  5282. class: vue.normalizeClass(["content-clear-icon", { "is-textarea-icon": $props.type === "textarea" }]),
  5283. type: "clear",
  5284. size: $props.clearSize,
  5285. color: $options.msg ? "#dd524d" : $data.focusShow ? $props.primaryColor : "#c0c4cc",
  5286. onClick: $options.onClear
  5287. }, null, 8, ["class", "size", "color", "onClick"])) : vue.createCommentVNode("v-if", true)
  5288. ],
  5289. 64
  5290. /* STABLE_FRAGMENT */
  5291. )),
  5292. vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
  5293. ],
  5294. 6
  5295. /* CLASS, STYLE */
  5296. )
  5297. ],
  5298. 6
  5299. /* CLASS, STYLE */
  5300. );
  5301. }
  5302. const __easycom_0$7 = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$N], ["__scopeId", "data-v-f7a14e66"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.vue"]]);
  5303. var pattern = {
  5304. email: /^\S+?@\S+?\.\S+?$/,
  5305. 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]$/,
  5306. url: new RegExp(
  5307. "^(?!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]*)?$",
  5308. "i"
  5309. )
  5310. };
  5311. const FORMAT_MAPPING = {
  5312. "int": "integer",
  5313. "bool": "boolean",
  5314. "double": "number",
  5315. "long": "number",
  5316. "password": "string"
  5317. // "fileurls": 'array'
  5318. };
  5319. function formatMessage(args, resources = "") {
  5320. var defaultMessage = ["label"];
  5321. defaultMessage.forEach((item) => {
  5322. if (args[item] === void 0) {
  5323. args[item] = "";
  5324. }
  5325. });
  5326. let str = resources;
  5327. for (let key in args) {
  5328. let reg = new RegExp("{" + key + "}");
  5329. str = str.replace(reg, args[key]);
  5330. }
  5331. return str;
  5332. }
  5333. function isEmptyValue(value, type) {
  5334. if (value === void 0 || value === null) {
  5335. return true;
  5336. }
  5337. if (typeof value === "string" && !value) {
  5338. return true;
  5339. }
  5340. if (Array.isArray(value) && !value.length) {
  5341. return true;
  5342. }
  5343. if (type === "object" && !Object.keys(value).length) {
  5344. return true;
  5345. }
  5346. return false;
  5347. }
  5348. const types = {
  5349. integer(value) {
  5350. return types.number(value) && parseInt(value, 10) === value;
  5351. },
  5352. string(value) {
  5353. return typeof value === "string";
  5354. },
  5355. number(value) {
  5356. if (isNaN(value)) {
  5357. return false;
  5358. }
  5359. return typeof value === "number";
  5360. },
  5361. "boolean": function(value) {
  5362. return typeof value === "boolean";
  5363. },
  5364. "float": function(value) {
  5365. return types.number(value) && !types.integer(value);
  5366. },
  5367. array(value) {
  5368. return Array.isArray(value);
  5369. },
  5370. object(value) {
  5371. return typeof value === "object" && !types.array(value);
  5372. },
  5373. date(value) {
  5374. return value instanceof Date;
  5375. },
  5376. timestamp(value) {
  5377. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  5378. return false;
  5379. }
  5380. return true;
  5381. },
  5382. file(value) {
  5383. return typeof value.url === "string";
  5384. },
  5385. email(value) {
  5386. return typeof value === "string" && !!value.match(pattern.email) && value.length < 255;
  5387. },
  5388. url(value) {
  5389. return typeof value === "string" && !!value.match(pattern.url);
  5390. },
  5391. pattern(reg, value) {
  5392. try {
  5393. return new RegExp(reg).test(value);
  5394. } catch (e2) {
  5395. return false;
  5396. }
  5397. },
  5398. method(value) {
  5399. return typeof value === "function";
  5400. },
  5401. idcard(value) {
  5402. return typeof value === "string" && !!value.match(pattern.idcard);
  5403. },
  5404. "url-https"(value) {
  5405. return this.url(value) && value.startsWith("https://");
  5406. },
  5407. "url-scheme"(value) {
  5408. return value.startsWith("://");
  5409. },
  5410. "url-web"(value) {
  5411. return false;
  5412. }
  5413. };
  5414. class RuleValidator {
  5415. constructor(message) {
  5416. this._message = message;
  5417. }
  5418. async validateRule(fieldKey, fieldValue, value, data, allData) {
  5419. var result = null;
  5420. let rules = fieldValue.rules;
  5421. let hasRequired = rules.findIndex((item) => {
  5422. return item.required;
  5423. });
  5424. if (hasRequired < 0) {
  5425. if (value === null || value === void 0) {
  5426. return result;
  5427. }
  5428. if (typeof value === "string" && !value.length) {
  5429. return result;
  5430. }
  5431. }
  5432. var message = this._message;
  5433. if (rules === void 0) {
  5434. return message["default"];
  5435. }
  5436. for (var i2 = 0; i2 < rules.length; i2++) {
  5437. let rule = rules[i2];
  5438. let vt2 = this._getValidateType(rule);
  5439. Object.assign(rule, {
  5440. label: fieldValue.label || `["${fieldKey}"]`
  5441. });
  5442. if (RuleValidatorHelper[vt2]) {
  5443. result = RuleValidatorHelper[vt2](rule, value, message);
  5444. if (result != null) {
  5445. break;
  5446. }
  5447. }
  5448. if (rule.validateExpr) {
  5449. let now2 = Date.now();
  5450. let resultExpr = rule.validateExpr(value, allData, now2);
  5451. if (resultExpr === false) {
  5452. result = this._getMessage(rule, rule.errorMessage || this._message["default"]);
  5453. break;
  5454. }
  5455. }
  5456. if (rule.validateFunction) {
  5457. result = await this.validateFunction(rule, value, data, allData, vt2);
  5458. if (result !== null) {
  5459. break;
  5460. }
  5461. }
  5462. }
  5463. if (result !== null) {
  5464. result = message.TAG + result;
  5465. }
  5466. return result;
  5467. }
  5468. async validateFunction(rule, value, data, allData, vt2) {
  5469. let result = null;
  5470. try {
  5471. let callbackMessage = null;
  5472. const res = await rule.validateFunction(rule, value, allData || data, (message) => {
  5473. callbackMessage = message;
  5474. });
  5475. if (callbackMessage || typeof res === "string" && res || res === false) {
  5476. result = this._getMessage(rule, callbackMessage || res, vt2);
  5477. }
  5478. } catch (e2) {
  5479. result = this._getMessage(rule, e2.message, vt2);
  5480. }
  5481. return result;
  5482. }
  5483. _getMessage(rule, message, vt2) {
  5484. return formatMessage(rule, message || rule.errorMessage || this._message[vt2] || message["default"]);
  5485. }
  5486. _getValidateType(rule) {
  5487. var result = "";
  5488. if (rule.required) {
  5489. result = "required";
  5490. } else if (rule.format) {
  5491. result = "format";
  5492. } else if (rule.arrayType) {
  5493. result = "arrayTypeFormat";
  5494. } else if (rule.range) {
  5495. result = "range";
  5496. } else if (rule.maximum !== void 0 || rule.minimum !== void 0) {
  5497. result = "rangeNumber";
  5498. } else if (rule.maxLength !== void 0 || rule.minLength !== void 0) {
  5499. result = "rangeLength";
  5500. } else if (rule.pattern) {
  5501. result = "pattern";
  5502. } else if (rule.validateFunction) {
  5503. result = "validateFunction";
  5504. }
  5505. return result;
  5506. }
  5507. }
  5508. const RuleValidatorHelper = {
  5509. required(rule, value, message) {
  5510. if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
  5511. return formatMessage(rule, rule.errorMessage || message.required);
  5512. }
  5513. return null;
  5514. },
  5515. range(rule, value, message) {
  5516. const {
  5517. range,
  5518. errorMessage
  5519. } = rule;
  5520. let list = new Array(range.length);
  5521. for (let i2 = 0; i2 < range.length; i2++) {
  5522. const item = range[i2];
  5523. if (types.object(item) && item.value !== void 0) {
  5524. list[i2] = item.value;
  5525. } else {
  5526. list[i2] = item;
  5527. }
  5528. }
  5529. let result = false;
  5530. if (Array.isArray(value)) {
  5531. result = new Set(value.concat(list)).size === list.length;
  5532. } else {
  5533. if (list.indexOf(value) > -1) {
  5534. result = true;
  5535. }
  5536. }
  5537. if (!result) {
  5538. return formatMessage(rule, errorMessage || message["enum"]);
  5539. }
  5540. return null;
  5541. },
  5542. rangeNumber(rule, value, message) {
  5543. if (!types.number(value)) {
  5544. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  5545. }
  5546. let {
  5547. minimum,
  5548. maximum,
  5549. exclusiveMinimum,
  5550. exclusiveMaximum
  5551. } = rule;
  5552. let min = exclusiveMinimum ? value <= minimum : value < minimum;
  5553. let max = exclusiveMaximum ? value >= maximum : value > maximum;
  5554. if (minimum !== void 0 && min) {
  5555. return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMinimum ? "exclusiveMinimum" : "minimum"]);
  5556. } else if (maximum !== void 0 && max) {
  5557. return formatMessage(rule, rule.errorMessage || message["number"][exclusiveMaximum ? "exclusiveMaximum" : "maximum"]);
  5558. } else if (minimum !== void 0 && maximum !== void 0 && (min || max)) {
  5559. return formatMessage(rule, rule.errorMessage || message["number"].range);
  5560. }
  5561. return null;
  5562. },
  5563. rangeLength(rule, value, message) {
  5564. if (!types.string(value) && !types.array(value)) {
  5565. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  5566. }
  5567. let min = rule.minLength;
  5568. let max = rule.maxLength;
  5569. let val = value.length;
  5570. if (min !== void 0 && val < min) {
  5571. return formatMessage(rule, rule.errorMessage || message["length"].minLength);
  5572. } else if (max !== void 0 && val > max) {
  5573. return formatMessage(rule, rule.errorMessage || message["length"].maxLength);
  5574. } else if (min !== void 0 && max !== void 0 && (val < min || val > max)) {
  5575. return formatMessage(rule, rule.errorMessage || message["length"].range);
  5576. }
  5577. return null;
  5578. },
  5579. pattern(rule, value, message) {
  5580. if (!types["pattern"](rule.pattern, value)) {
  5581. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  5582. }
  5583. return null;
  5584. },
  5585. format(rule, value, message) {
  5586. var customTypes = Object.keys(types);
  5587. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  5588. if (customTypes.indexOf(format) > -1) {
  5589. if (!types[format](value)) {
  5590. return formatMessage(rule, rule.errorMessage || message.typeError);
  5591. }
  5592. }
  5593. return null;
  5594. },
  5595. arrayTypeFormat(rule, value, message) {
  5596. if (!Array.isArray(value)) {
  5597. return formatMessage(rule, rule.errorMessage || message.typeError);
  5598. }
  5599. for (let i2 = 0; i2 < value.length; i2++) {
  5600. const element = value[i2];
  5601. let formatResult = this.format(rule, element, message);
  5602. if (formatResult !== null) {
  5603. return formatResult;
  5604. }
  5605. }
  5606. return null;
  5607. }
  5608. };
  5609. class SchemaValidator extends RuleValidator {
  5610. constructor(schema, options) {
  5611. super(SchemaValidator.message);
  5612. this._schema = schema;
  5613. this._options = options || null;
  5614. }
  5615. updateSchema(schema) {
  5616. this._schema = schema;
  5617. }
  5618. async validate(data, allData) {
  5619. let result = this._checkFieldInSchema(data);
  5620. if (!result) {
  5621. result = await this.invokeValidate(data, false, allData);
  5622. }
  5623. return result.length ? result[0] : null;
  5624. }
  5625. async validateAll(data, allData) {
  5626. let result = this._checkFieldInSchema(data);
  5627. if (!result) {
  5628. result = await this.invokeValidate(data, true, allData);
  5629. }
  5630. return result;
  5631. }
  5632. async validateUpdate(data, allData) {
  5633. let result = this._checkFieldInSchema(data);
  5634. if (!result) {
  5635. result = await this.invokeValidateUpdate(data, false, allData);
  5636. }
  5637. return result.length ? result[0] : null;
  5638. }
  5639. async invokeValidate(data, all, allData) {
  5640. let result = [];
  5641. let schema = this._schema;
  5642. for (let key in schema) {
  5643. let value = schema[key];
  5644. let errorMessage = await this.validateRule(key, value, data[key], data, allData);
  5645. if (errorMessage != null) {
  5646. result.push({
  5647. key,
  5648. errorMessage
  5649. });
  5650. if (!all)
  5651. break;
  5652. }
  5653. }
  5654. return result;
  5655. }
  5656. async invokeValidateUpdate(data, all, allData) {
  5657. let result = [];
  5658. for (let key in data) {
  5659. let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData);
  5660. if (errorMessage != null) {
  5661. result.push({
  5662. key,
  5663. errorMessage
  5664. });
  5665. if (!all)
  5666. break;
  5667. }
  5668. }
  5669. return result;
  5670. }
  5671. _checkFieldInSchema(data) {
  5672. var keys = Object.keys(data);
  5673. var keys2 = Object.keys(this._schema);
  5674. if (new Set(keys.concat(keys2)).size === keys2.length) {
  5675. return "";
  5676. }
  5677. var noExistFields = keys.filter((key) => {
  5678. return keys2.indexOf(key) < 0;
  5679. });
  5680. var errorMessage = formatMessage({
  5681. field: JSON.stringify(noExistFields)
  5682. }, SchemaValidator.message.TAG + SchemaValidator.message["defaultInvalid"]);
  5683. return [{
  5684. key: "invalid",
  5685. errorMessage
  5686. }];
  5687. }
  5688. }
  5689. function Message() {
  5690. return {
  5691. TAG: "",
  5692. default: "验证错误",
  5693. defaultInvalid: "提交的字段{field}在数据库中并不存在",
  5694. validateFunction: "验证无效",
  5695. required: "{label}必填",
  5696. "enum": "{label}超出范围",
  5697. timestamp: "{label}格式无效",
  5698. whitespace: "{label}不能为空",
  5699. typeError: "{label}类型无效",
  5700. date: {
  5701. format: "{label}日期{value}格式无效",
  5702. parse: "{label}日期无法解析,{value}无效",
  5703. invalid: "{label}日期{value}无效"
  5704. },
  5705. length: {
  5706. minLength: "{label}长度不能少于{minLength}",
  5707. maxLength: "{label}长度不能超过{maxLength}",
  5708. range: "{label}必须介于{minLength}和{maxLength}之间"
  5709. },
  5710. number: {
  5711. minimum: "{label}不能小于{minimum}",
  5712. maximum: "{label}不能大于{maximum}",
  5713. exclusiveMinimum: "{label}不能小于等于{minimum}",
  5714. exclusiveMaximum: "{label}不能大于等于{maximum}",
  5715. range: "{label}必须介于{minimum}and{maximum}之间"
  5716. },
  5717. pattern: {
  5718. mismatch: "{label}格式不匹配"
  5719. }
  5720. };
  5721. }
  5722. SchemaValidator.message = new Message();
  5723. const deepCopy = (val) => {
  5724. return JSON.parse(JSON.stringify(val));
  5725. };
  5726. const typeFilter = (format) => {
  5727. return format === "int" || format === "double" || format === "number" || format === "timestamp";
  5728. };
  5729. const getValue = (key, value, rules) => {
  5730. const isRuleNumType = rules.find((val) => val.format && typeFilter(val.format));
  5731. const isRuleBoolType = rules.find((val) => val.format && val.format === "boolean" || val.format === "bool");
  5732. if (!!isRuleNumType) {
  5733. if (!value && value !== 0) {
  5734. value = null;
  5735. } else {
  5736. value = isNumber(Number(value)) ? Number(value) : value;
  5737. }
  5738. }
  5739. if (!!isRuleBoolType) {
  5740. value = isBoolean(value) ? value : false;
  5741. }
  5742. return value;
  5743. };
  5744. const setDataValue = (field, formdata, value) => {
  5745. formdata[field] = value;
  5746. return value || "";
  5747. };
  5748. const getDataValue = (field, data) => {
  5749. return objGet(data, field);
  5750. };
  5751. const realName = (name, data = {}) => {
  5752. const base_name = _basePath(name);
  5753. if (typeof base_name === "object" && Array.isArray(base_name) && base_name.length > 1) {
  5754. const realname = base_name.reduce((a2, b2) => a2 += `#${b2}`, "_formdata_");
  5755. return realname;
  5756. }
  5757. return base_name[0] || name;
  5758. };
  5759. const isRealName = (name) => {
  5760. const reg = /^_formdata_#*/;
  5761. return reg.test(name);
  5762. };
  5763. const rawData = (object = {}, name) => {
  5764. let newData = JSON.parse(JSON.stringify(object));
  5765. let formData = {};
  5766. for (let i2 in newData) {
  5767. let path = name2arr(i2);
  5768. objSet(formData, path, newData[i2]);
  5769. }
  5770. return formData;
  5771. };
  5772. const name2arr = (name) => {
  5773. let field = name.replace("_formdata_#", "");
  5774. field = field.split("#").map((v2) => isNumber(v2) ? Number(v2) : v2);
  5775. return field;
  5776. };
  5777. const objSet = (object, path, value) => {
  5778. if (typeof object !== "object")
  5779. return object;
  5780. _basePath(path).reduce((o2, k, i2, _2) => {
  5781. if (i2 === _2.length - 1) {
  5782. o2[k] = value;
  5783. return null;
  5784. } else if (k in o2) {
  5785. return o2[k];
  5786. } else {
  5787. o2[k] = /^[0-9]{1,}$/.test(_2[i2 + 1]) ? [] : {};
  5788. return o2[k];
  5789. }
  5790. }, object);
  5791. return object;
  5792. };
  5793. function _basePath(path) {
  5794. if (Array.isArray(path))
  5795. return path;
  5796. return path.replace(/\[/g, ".").replace(/\]/g, "").split(".");
  5797. }
  5798. const objGet = (object, path, defaultVal = "undefined") => {
  5799. let newPath = _basePath(path);
  5800. let val = newPath.reduce((o2, k) => {
  5801. return (o2 || {})[k];
  5802. }, object);
  5803. return !val || val !== void 0 ? val : defaultVal;
  5804. };
  5805. const isNumber = (num) => {
  5806. return !isNaN(Number(num));
  5807. };
  5808. const isBoolean = (bool) => {
  5809. return typeof bool === "boolean";
  5810. };
  5811. const isRequiredField = (rules) => {
  5812. let isNoField = false;
  5813. for (let i2 = 0; i2 < rules.length; i2++) {
  5814. const ruleData = rules[i2];
  5815. if (ruleData.required) {
  5816. isNoField = true;
  5817. break;
  5818. }
  5819. }
  5820. return isNoField;
  5821. };
  5822. const isEqual = (a2, b2) => {
  5823. if (a2 === b2) {
  5824. return a2 !== 0 || 1 / a2 === 1 / b2;
  5825. }
  5826. if (a2 == null || b2 == null) {
  5827. return a2 === b2;
  5828. }
  5829. var classNameA = toString.call(a2), classNameB = toString.call(b2);
  5830. if (classNameA !== classNameB) {
  5831. return false;
  5832. }
  5833. switch (classNameA) {
  5834. case "[object RegExp]":
  5835. case "[object String]":
  5836. return "" + a2 === "" + b2;
  5837. case "[object Number]":
  5838. if (+a2 !== +a2) {
  5839. return +b2 !== +b2;
  5840. }
  5841. return +a2 === 0 ? 1 / +a2 === 1 / b2 : +a2 === +b2;
  5842. case "[object Date]":
  5843. case "[object Boolean]":
  5844. return +a2 === +b2;
  5845. }
  5846. if (classNameA == "[object Object]") {
  5847. var propsA = Object.getOwnPropertyNames(a2), propsB = Object.getOwnPropertyNames(b2);
  5848. if (propsA.length != propsB.length) {
  5849. return false;
  5850. }
  5851. for (var i2 = 0; i2 < propsA.length; i2++) {
  5852. var propName = propsA[i2];
  5853. if (a2[propName] !== b2[propName]) {
  5854. return false;
  5855. }
  5856. }
  5857. return true;
  5858. }
  5859. if (classNameA == "[object Array]") {
  5860. if (a2.toString() == b2.toString()) {
  5861. return true;
  5862. }
  5863. return false;
  5864. }
  5865. };
  5866. const _sfc_main$N = {
  5867. name: "uniForms",
  5868. emits: ["validate", "submit"],
  5869. options: {
  5870. virtualHost: true
  5871. },
  5872. props: {
  5873. // 即将弃用
  5874. value: {
  5875. type: Object,
  5876. default() {
  5877. return null;
  5878. }
  5879. },
  5880. // vue3 替换 value 属性
  5881. modelValue: {
  5882. type: Object,
  5883. default() {
  5884. return null;
  5885. }
  5886. },
  5887. // 1.4.0 开始将不支持 v-model ,且废弃 value 和 modelValue
  5888. model: {
  5889. type: Object,
  5890. default() {
  5891. return null;
  5892. }
  5893. },
  5894. // 表单校验规则
  5895. rules: {
  5896. type: Object,
  5897. default() {
  5898. return {};
  5899. }
  5900. },
  5901. //校验错误信息提示方式 默认 undertext 取值 [undertext|toast|modal]
  5902. errShowType: {
  5903. type: String,
  5904. default: "undertext"
  5905. },
  5906. // 校验触发器方式 默认 bind 取值 [bind|submit]
  5907. validateTrigger: {
  5908. type: String,
  5909. default: "submit"
  5910. },
  5911. // label 位置,默认 left 取值 top/left
  5912. labelPosition: {
  5913. type: String,
  5914. default: "left"
  5915. },
  5916. // label 宽度
  5917. labelWidth: {
  5918. type: [String, Number],
  5919. default: ""
  5920. },
  5921. // label 居中方式,默认 left 取值 left/center/right
  5922. labelAlign: {
  5923. type: String,
  5924. default: "left"
  5925. },
  5926. border: {
  5927. type: Boolean,
  5928. default: false
  5929. }
  5930. },
  5931. provide() {
  5932. return {
  5933. uniForm: this
  5934. };
  5935. },
  5936. data() {
  5937. return {
  5938. // 表单本地值的记录,不应该与传如的值进行关联
  5939. formData: {},
  5940. formRules: {}
  5941. };
  5942. },
  5943. computed: {
  5944. // 计算数据源变化的
  5945. localData() {
  5946. const localVal = this.model || this.modelValue || this.value;
  5947. if (localVal) {
  5948. return deepCopy(localVal);
  5949. }
  5950. return {};
  5951. }
  5952. },
  5953. watch: {
  5954. // 监听数据变化 ,暂时不使用,需要单独赋值
  5955. // localData: {},
  5956. // 监听规则变化
  5957. rules: {
  5958. handler: function(val, oldVal) {
  5959. this.setRules(val);
  5960. },
  5961. deep: true,
  5962. immediate: true
  5963. }
  5964. },
  5965. created() {
  5966. let getbinddata = getApp().$vm.$.appContext.config.globalProperties.binddata;
  5967. if (!getbinddata) {
  5968. getApp().$vm.$.appContext.config.globalProperties.binddata = function(name, value, formName) {
  5969. if (formName) {
  5970. this.$refs[formName].setValue(name, value);
  5971. } else {
  5972. let formVm;
  5973. for (let i2 in this.$refs) {
  5974. const vm = this.$refs[i2];
  5975. if (vm && vm.$options && vm.$options.name === "uniForms") {
  5976. formVm = vm;
  5977. break;
  5978. }
  5979. }
  5980. if (!formVm)
  5981. return console.error("当前 uni-froms 组件缺少 ref 属性");
  5982. formVm.setValue(name, value);
  5983. }
  5984. };
  5985. }
  5986. this.childrens = [];
  5987. this.inputChildrens = [];
  5988. this.setRules(this.rules);
  5989. },
  5990. methods: {
  5991. /**
  5992. * 外部调用方法
  5993. * 设置规则 ,主要用于小程序自定义检验规则
  5994. * @param {Array} rules 规则源数据
  5995. */
  5996. setRules(rules) {
  5997. this.formRules = Object.assign({}, this.formRules, rules);
  5998. this.validator = new SchemaValidator(rules);
  5999. },
  6000. /**
  6001. * 外部调用方法
  6002. * 设置数据,用于设置表单数据,公开给用户使用 , 不支持在动态表单中使用
  6003. * @param {Object} key
  6004. * @param {Object} value
  6005. */
  6006. setValue(key, value) {
  6007. let example = this.childrens.find((child) => child.name === key);
  6008. if (!example)
  6009. return null;
  6010. this.formData[key] = getValue(key, value, this.formRules[key] && this.formRules[key].rules || []);
  6011. return example.onFieldChange(this.formData[key]);
  6012. },
  6013. /**
  6014. * 外部调用方法
  6015. * 手动提交校验表单
  6016. * 对整个表单进行校验的方法,参数为一个回调函数。
  6017. * @param {Array} keepitem 保留不参与校验的字段
  6018. * @param {type} callback 方法回调
  6019. */
  6020. validate(keepitem, callback) {
  6021. return this.checkAll(this.formData, keepitem, callback);
  6022. },
  6023. /**
  6024. * 外部调用方法
  6025. * 部分表单校验
  6026. * @param {Array|String} props 需要校验的字段
  6027. * @param {Function} 回调函数
  6028. */
  6029. validateField(props = [], callback) {
  6030. props = [].concat(props);
  6031. let invalidFields = {};
  6032. this.childrens.forEach((item) => {
  6033. const name = realName(item.name);
  6034. if (props.indexOf(name) !== -1) {
  6035. invalidFields = Object.assign({}, invalidFields, {
  6036. [name]: this.formData[name]
  6037. });
  6038. }
  6039. });
  6040. return this.checkAll(invalidFields, [], callback);
  6041. },
  6042. /**
  6043. * 外部调用方法
  6044. * 移除表单项的校验结果。传入待移除的表单项的 prop 属性或者 prop 组成的数组,如不传则移除整个表单的校验结果
  6045. * @param {Array|String} props 需要移除校验的字段 ,不填为所有
  6046. */
  6047. clearValidate(props = []) {
  6048. props = [].concat(props);
  6049. this.childrens.forEach((item) => {
  6050. if (props.length === 0) {
  6051. item.errMsg = "";
  6052. } else {
  6053. const name = realName(item.name);
  6054. if (props.indexOf(name) !== -1) {
  6055. item.errMsg = "";
  6056. }
  6057. }
  6058. });
  6059. },
  6060. /**
  6061. * 外部调用方法 ,即将废弃
  6062. * 手动提交校验表单
  6063. * 对整个表单进行校验的方法,参数为一个回调函数。
  6064. * @param {Array} keepitem 保留不参与校验的字段
  6065. * @param {type} callback 方法回调
  6066. */
  6067. submit(keepitem, callback, type) {
  6068. for (let i2 in this.dataValue) {
  6069. const itemData = this.childrens.find((v2) => v2.name === i2);
  6070. if (itemData) {
  6071. if (this.formData[i2] === void 0) {
  6072. this.formData[i2] = this._getValue(i2, this.dataValue[i2]);
  6073. }
  6074. }
  6075. }
  6076. if (!type) {
  6077. console.warn("submit 方法即将废弃,请使用validate方法代替!");
  6078. }
  6079. return this.checkAll(this.formData, keepitem, callback, "submit");
  6080. },
  6081. // 校验所有
  6082. async checkAll(invalidFields, keepitem, callback, type) {
  6083. if (!this.validator)
  6084. return;
  6085. let childrens = [];
  6086. for (let i2 in invalidFields) {
  6087. const item = this.childrens.find((v2) => realName(v2.name) === i2);
  6088. if (item) {
  6089. childrens.push(item);
  6090. }
  6091. }
  6092. if (!callback && typeof keepitem === "function") {
  6093. callback = keepitem;
  6094. }
  6095. let promise;
  6096. if (!callback && typeof callback !== "function" && Promise) {
  6097. promise = new Promise((resolve, reject) => {
  6098. callback = function(valid, invalidFields2) {
  6099. !valid ? resolve(invalidFields2) : reject(valid);
  6100. };
  6101. });
  6102. }
  6103. let results = [];
  6104. let tempFormData = JSON.parse(JSON.stringify(invalidFields));
  6105. for (let i2 in childrens) {
  6106. const child = childrens[i2];
  6107. let name = realName(child.name);
  6108. const result = await child.onFieldChange(tempFormData[name]);
  6109. if (result) {
  6110. results.push(result);
  6111. if (this.errShowType === "toast" || this.errShowType === "modal")
  6112. break;
  6113. }
  6114. }
  6115. if (Array.isArray(results)) {
  6116. if (results.length === 0)
  6117. results = null;
  6118. }
  6119. if (Array.isArray(keepitem)) {
  6120. keepitem.forEach((v2) => {
  6121. let vName = realName(v2);
  6122. let value = getDataValue(v2, this.localData);
  6123. if (value !== void 0) {
  6124. tempFormData[vName] = value;
  6125. }
  6126. });
  6127. }
  6128. if (type === "submit") {
  6129. this.$emit("submit", {
  6130. detail: {
  6131. value: tempFormData,
  6132. errors: results
  6133. }
  6134. });
  6135. } else {
  6136. this.$emit("validate", results);
  6137. }
  6138. let resetFormData = {};
  6139. resetFormData = rawData(tempFormData, this.name);
  6140. callback && typeof callback === "function" && callback(results, resetFormData);
  6141. if (promise && callback) {
  6142. return promise;
  6143. } else {
  6144. return null;
  6145. }
  6146. },
  6147. /**
  6148. * 返回validate事件
  6149. * @param {Object} result
  6150. */
  6151. validateCheck(result) {
  6152. this.$emit("validate", result);
  6153. },
  6154. _getValue: getValue,
  6155. _isRequiredField: isRequiredField,
  6156. _setDataValue: setDataValue,
  6157. _getDataValue: getDataValue,
  6158. _realName: realName,
  6159. _isRealName: isRealName,
  6160. _isEqual: isEqual
  6161. }
  6162. };
  6163. function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) {
  6164. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-forms" }, [
  6165. vue.createElementVNode("form", null, [
  6166. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  6167. ])
  6168. ]);
  6169. }
  6170. const __easycom_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$M], ["__scopeId", "data-v-13523fe0"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue"]]);
  6171. const postLoginAPI = (data) => {
  6172. return http({
  6173. method: "POST",
  6174. url: "/admin/index/login",
  6175. data
  6176. });
  6177. };
  6178. const getVerifyCodeImg = (captcha_id) => {
  6179. return http({
  6180. method: "GET",
  6181. url: `/api/common/captcha?server=1&id=${captcha_id}&m=` + Math.random(),
  6182. responseType: "arraybuffer"
  6183. //设置响应类型
  6184. });
  6185. };
  6186. const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
  6187. __name: "login",
  6188. setup(__props, { expose: __expose }) {
  6189. __expose();
  6190. const loading = vue.ref(false);
  6191. const verifyCodeImg = vue.ref("");
  6192. const data = vue.reactive({ captcha_id: "f2dd39ce-0d3e-4c1e-916c-b50090a7590s" });
  6193. onLoad(() => {
  6194. _getVerifyCodeImg();
  6195. });
  6196. const _getVerifyCodeImg = async () => {
  6197. const res = await getVerifyCodeImg(data.captcha_id);
  6198. const arrayBuffer = new Uint8Array(res);
  6199. const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(arrayBuffer);
  6200. verifyCodeImg.value = base64;
  6201. };
  6202. const loginSuccess = (profile) => {
  6203. const memberStore = useMemberStore();
  6204. memberStore.setProfile(profile);
  6205. uni.showToast({ icon: "success", title: "登录成功" });
  6206. formatAppLog("log", "at pages/login/login.vue:28", "登录成功", profile);
  6207. setTimeout(() => {
  6208. uni.navigateBack();
  6209. }, 500);
  6210. };
  6211. const form = vue.ref({
  6212. account: "admin",
  6213. password: "",
  6214. captcha: ""
  6215. });
  6216. const onSubmit = async () => {
  6217. if (loading.value) {
  6218. return false;
  6219. }
  6220. if (form.value.account == "") {
  6221. uni.showToast({
  6222. icon: "none",
  6223. position: "bottom",
  6224. title: "用户名不能为空"
  6225. });
  6226. return;
  6227. }
  6228. if (form.value.password == "") {
  6229. uni.showToast({
  6230. icon: "none",
  6231. position: "bottom",
  6232. title: "密码不能为空"
  6233. });
  6234. return;
  6235. }
  6236. if (form.value.password.length < 6) {
  6237. uni.showToast({
  6238. icon: "none",
  6239. position: "bottom",
  6240. title: "密码长度不能小于6位"
  6241. });
  6242. return;
  6243. }
  6244. loading.value = true;
  6245. const param = {
  6246. username: form.value.account,
  6247. password: form.value.password,
  6248. captcha: form.value.captcha,
  6249. keep: true,
  6250. loading: true,
  6251. captcha_id: data.captcha_id
  6252. };
  6253. const res = await postLoginAPI(param);
  6254. loading.value = false;
  6255. if (res.code === 1) {
  6256. loginSuccess(res.data.userInfo);
  6257. } else {
  6258. uni.showToast({
  6259. title: res.msg,
  6260. icon: "none"
  6261. });
  6262. _getVerifyCodeImg();
  6263. }
  6264. };
  6265. const __returned__ = { loading, verifyCodeImg, data, _getVerifyCodeImg, loginSuccess, form, onSubmit };
  6266. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  6267. return __returned__;
  6268. }
  6269. });
  6270. function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
  6271. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  6272. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$7);
  6273. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$1);
  6274. return vue.openBlock(), vue.createElementBlock("view", { class: "viewport" }, [
  6275. vue.createElementVNode("view", { class: "logo" }, [
  6276. vue.createElementVNode("image", { src: _imports_0$2 })
  6277. ]),
  6278. vue.createElementVNode("view", { class: "login" }, [
  6279. vue.createCommentVNode(" 网页端表单登录 "),
  6280. vue.createElementVNode("view", { class: "input-box padding-lr" }, [
  6281. vue.createVNode(_component_uni_forms, { modelValue: $setup.form }, {
  6282. default: vue.withCtx(() => [
  6283. vue.createElementVNode("view", { class: "cu-form-group margin-top" }, [
  6284. vue.createVNode(_component_uni_icons, {
  6285. class: "uni-icon",
  6286. type: "person",
  6287. size: "30",
  6288. color: "#999"
  6289. }),
  6290. vue.createVNode(_component_uni_easyinput, {
  6291. placeholder: "账号",
  6292. modelValue: $setup.form.account,
  6293. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.form.account = $event)
  6294. }, null, 8, ["modelValue"])
  6295. ]),
  6296. vue.createElementVNode("view", { class: "cu-form-group" }, [
  6297. vue.createVNode(_component_uni_icons, {
  6298. class: "uni-icon",
  6299. type: "locked",
  6300. size: "30",
  6301. color: "#999"
  6302. }),
  6303. vue.createVNode(_component_uni_easyinput, {
  6304. placeholder: "密码",
  6305. type: "password",
  6306. modelValue: $setup.form.password,
  6307. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.form.password = $event)
  6308. }, null, 8, ["modelValue"])
  6309. ]),
  6310. vue.createElementVNode("view", { class: "cu-form-group solid-bottom" }, [
  6311. vue.createVNode(_component_uni_icons, {
  6312. class: "uni-icon",
  6313. type: "more-filled",
  6314. size: "30",
  6315. color: "#999"
  6316. }),
  6317. vue.createVNode(_component_uni_easyinput, {
  6318. placeholder: "验证码",
  6319. modelValue: $setup.form.captcha,
  6320. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.form.captcha = $event)
  6321. }, null, 8, ["modelValue"]),
  6322. vue.createCommentVNode(" <button class='cu-btn bg-login-zl shadow'>验证码</button> "),
  6323. vue.createElementVNode("image", {
  6324. class: "cu-btn captchaImg",
  6325. src: $setup.verifyCodeImg,
  6326. onClick: $setup._getVerifyCodeImg
  6327. }, null, 8, ["src"])
  6328. ])
  6329. ]),
  6330. _: 1
  6331. /* STABLE */
  6332. }, 8, ["modelValue"])
  6333. ]),
  6334. vue.createCommentVNode(' <input v-model="form.account" class="input" type="text" placeholder="请输入用户名/手机号码" /> '),
  6335. vue.createCommentVNode(' <input v-model="form.password" class="input" type="text" password placeholder="请输入密码" /> '),
  6336. vue.createElementVNode("button", {
  6337. onClick: $setup.onSubmit,
  6338. class: "button phone",
  6339. loading: $setup.loading
  6340. }, "登录", 8, ["loading"]),
  6341. vue.createElementVNode("view", { class: "tips" }, "登录/注册即视为你同意《服务条款》和《英途仓库隐私协议》")
  6342. ])
  6343. ]);
  6344. }
  6345. const PagesLoginLogin = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$L], ["__file", "E:/demo/hmrabbit/src/pages/login/login.vue"]]);
  6346. const getHotRecommendAPI = (url, data) => {
  6347. return http({
  6348. method: "GET",
  6349. url,
  6350. data
  6351. });
  6352. };
  6353. const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
  6354. __name: "hot",
  6355. props: {
  6356. type: { type: String, required: true }
  6357. },
  6358. setup(__props, { expose: __expose }) {
  6359. __expose();
  6360. const urlMap = [
  6361. { type: "1", title: "特惠推荐", url: "/hot/preference" },
  6362. { type: "2", title: "爆款推荐", url: "/hot/inVogue" },
  6363. { type: "3", title: "一站买全", url: "/hot/oneStop" },
  6364. { type: "4", title: "新鲜好物", url: "/hot/new" }
  6365. ];
  6366. const query = __props;
  6367. const currUrlMap = urlMap.find((v2) => v2.type === query.type);
  6368. uni.setNavigationBarTitle({ title: currUrlMap.title });
  6369. const bannerPicture = vue.ref("");
  6370. const subTypes = vue.ref([]);
  6371. const activeIndex = vue.ref(0);
  6372. const getHotRecommendData = async () => {
  6373. const res = await getHotRecommendAPI(currUrlMap.url, {
  6374. // 技巧:环境变量,开发环境,修改初始页面方便测试分页结束
  6375. page: 30,
  6376. pageSize: 10
  6377. });
  6378. bannerPicture.value = res.result.bannerPicture;
  6379. subTypes.value = res.result.subTypes;
  6380. };
  6381. onLoad(() => {
  6382. getHotRecommendData();
  6383. });
  6384. const onScrolltolower = async () => {
  6385. const currsubTypes = subTypes.value[activeIndex.value];
  6386. if (currsubTypes.goodsItems.page < currsubTypes.goodsItems.pages) {
  6387. currsubTypes.goodsItems.page++;
  6388. } else {
  6389. currsubTypes.finish = true;
  6390. return uni.showToast({ icon: "none", title: "没有更多数据了~" });
  6391. }
  6392. const res = await getHotRecommendAPI(currUrlMap.url, {
  6393. subType: currsubTypes.id,
  6394. page: currsubTypes.goodsItems.page,
  6395. pageSize: currsubTypes.goodsItems.pageSize
  6396. });
  6397. const newsubTypes = res.result.subTypes[activeIndex.value];
  6398. currsubTypes.goodsItems.items.push(...newsubTypes.goodsItems.items);
  6399. };
  6400. const __returned__ = { urlMap, query, currUrlMap, bannerPicture, subTypes, activeIndex, getHotRecommendData, onScrolltolower };
  6401. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  6402. return __returned__;
  6403. }
  6404. });
  6405. function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
  6406. return vue.openBlock(), vue.createElementBlock("view", { class: "viewport" }, [
  6407. vue.createCommentVNode(" 推荐封面图 "),
  6408. vue.createElementVNode("view", { class: "cover" }, [
  6409. vue.createElementVNode("image", {
  6410. class: "image",
  6411. mode: "widthFix",
  6412. src: $setup.bannerPicture
  6413. }, null, 8, ["src"])
  6414. ]),
  6415. vue.createCommentVNode(" 推荐选项 "),
  6416. vue.createElementVNode("view", { class: "tabs" }, [
  6417. (vue.openBlock(true), vue.createElementBlock(
  6418. vue.Fragment,
  6419. null,
  6420. vue.renderList($setup.subTypes, (item, index) => {
  6421. return vue.openBlock(), vue.createElementBlock("text", {
  6422. key: item.id,
  6423. class: vue.normalizeClass(["text", { active: index === $setup.activeIndex }]),
  6424. onClick: ($event) => $setup.activeIndex = index
  6425. }, vue.toDisplayString(item.title), 11, ["onClick"]);
  6426. }),
  6427. 128
  6428. /* KEYED_FRAGMENT */
  6429. ))
  6430. ]),
  6431. vue.createCommentVNode(" 推荐列表 "),
  6432. (vue.openBlock(true), vue.createElementBlock(
  6433. vue.Fragment,
  6434. null,
  6435. vue.renderList($setup.subTypes, (item, index) => {
  6436. return vue.withDirectives((vue.openBlock(), vue.createElementBlock(
  6437. "scroll-view",
  6438. {
  6439. "enable-back-to-top": "",
  6440. key: item.id,
  6441. "scroll-y": "",
  6442. class: "scroll-view",
  6443. onScrolltolower: $setup.onScrolltolower
  6444. },
  6445. [
  6446. vue.createElementVNode("view", { class: "goods" }, [
  6447. (vue.openBlock(true), vue.createElementBlock(
  6448. vue.Fragment,
  6449. null,
  6450. vue.renderList(item.goodsItems.items, (goods2) => {
  6451. return vue.openBlock(), vue.createElementBlock("navigator", {
  6452. "hover-class": "none",
  6453. class: "navigator",
  6454. key: goods2.id,
  6455. url: `/pages/goods/goods?id=${goods2.id}`
  6456. }, [
  6457. vue.createElementVNode("image", {
  6458. class: "thumb",
  6459. src: goods2.picture
  6460. }, null, 8, ["src"]),
  6461. vue.createElementVNode(
  6462. "view",
  6463. { class: "name ellipsis" },
  6464. vue.toDisplayString(goods2.name),
  6465. 1
  6466. /* TEXT */
  6467. ),
  6468. vue.createElementVNode("view", { class: "price" }, [
  6469. vue.createElementVNode("text", { class: "symbol" }, "¥"),
  6470. vue.createElementVNode(
  6471. "text",
  6472. { class: "number" },
  6473. vue.toDisplayString(goods2.price),
  6474. 1
  6475. /* TEXT */
  6476. )
  6477. ])
  6478. ], 8, ["url"]);
  6479. }),
  6480. 128
  6481. /* KEYED_FRAGMENT */
  6482. ))
  6483. ]),
  6484. vue.createElementVNode(
  6485. "view",
  6486. { class: "loading-text" },
  6487. vue.toDisplayString(item.finish ? "没有更多数据了~" : "正在加载..."),
  6488. 1
  6489. /* TEXT */
  6490. )
  6491. ],
  6492. 32
  6493. /* NEED_HYDRATION */
  6494. )), [
  6495. [vue.vShow, $setup.activeIndex === index]
  6496. ]);
  6497. }),
  6498. 128
  6499. /* KEYED_FRAGMENT */
  6500. ))
  6501. ]);
  6502. }
  6503. const PagesHotHot = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$K], ["__file", "E:/demo/hmrabbit/src/pages/hot/hot.vue"]]);
  6504. var vk;
  6505. var goodsCache = {};
  6506. const _sfc_main$K = {
  6507. name: "vk-data-goods-sku-popup",
  6508. emits: [
  6509. "update:modelValue",
  6510. "input",
  6511. "update-goods",
  6512. "open",
  6513. "close",
  6514. "add-cart",
  6515. "buy-now",
  6516. "cart",
  6517. "buy",
  6518. "num-change"
  6519. ],
  6520. props: {
  6521. // true 组件显示 false 组件隐藏
  6522. value: {
  6523. Type: Boolean,
  6524. default: false
  6525. },
  6526. modelValue: {
  6527. Type: Boolean,
  6528. default: false
  6529. },
  6530. // vk云函数路由模式参数开始-----------------------------------------------------------
  6531. // 商品id
  6532. goodsId: {
  6533. Type: String,
  6534. default: ""
  6535. },
  6536. // vk路由模式框架下的云函数地址
  6537. action: {
  6538. Type: String,
  6539. default: ""
  6540. },
  6541. // vk云函数路由模式参数结束-----------------------------------------------------------
  6542. // 该商品已抢完时的按钮文字
  6543. noStockText: {
  6544. Type: String,
  6545. default: "该商品已抢完"
  6546. },
  6547. // 库存文字
  6548. stockText: {
  6549. Type: String,
  6550. default: "库存"
  6551. },
  6552. // 商品表id的字段名
  6553. goodsIdName: {
  6554. Type: String,
  6555. default: "_id"
  6556. },
  6557. // sku表id的字段名
  6558. skuIdName: {
  6559. Type: String,
  6560. default: "_id"
  6561. },
  6562. // sku_list的字段名
  6563. skuListName: {
  6564. Type: String,
  6565. default: "sku_list"
  6566. },
  6567. // spec_list的字段名
  6568. specListName: {
  6569. Type: String,
  6570. default: "spec_list"
  6571. },
  6572. // 库存的字段名 默认 stock
  6573. stockName: {
  6574. Type: String,
  6575. default: "stock"
  6576. },
  6577. // sku组合路径的字段名
  6578. skuArrName: {
  6579. Type: String,
  6580. default: "sku_name_arr"
  6581. },
  6582. // 默认单规格时的规格组名称
  6583. defaultSingleSkuName: {
  6584. Type: String,
  6585. default: "默认"
  6586. },
  6587. // 模式 1:都显示 2:只显示购物车 3:只显示立即购买 4:显示缺货按钮 默认 1
  6588. mode: {
  6589. Type: Number,
  6590. default: 1
  6591. },
  6592. // 点击遮罩是否关闭组件 true 关闭 false 不关闭 默认true
  6593. maskCloseAble: {
  6594. Type: Boolean,
  6595. default: true
  6596. },
  6597. // 顶部圆角值
  6598. borderRadius: {
  6599. Type: [String, Number],
  6600. default: 0
  6601. },
  6602. // 商品缩略图字段名(未选择sku时)
  6603. goodsThumbName: {
  6604. Type: [String],
  6605. default: "goods_thumb"
  6606. },
  6607. // 商品缩略图背景颜色,如#999999
  6608. goodsThumbBackgroundColor: {
  6609. Type: String,
  6610. default: "transparent"
  6611. },
  6612. // 最小购买数量 默认 1
  6613. minBuyNum: {
  6614. Type: [Number, String],
  6615. default: 1
  6616. },
  6617. // 最大购买数量 默认 100000
  6618. maxBuyNum: {
  6619. Type: [Number, String],
  6620. default: 1e5
  6621. },
  6622. // 步进器步长 默认 1
  6623. stepBuyNum: {
  6624. Type: [Number, String],
  6625. default: 1
  6626. },
  6627. // 是否只能输入 step 的倍数
  6628. stepStrictly: {
  6629. Type: Boolean,
  6630. default: false
  6631. },
  6632. // 自定义获取商品信息的函数,支付宝小程序不支持该属性,请使用localdata属性
  6633. customAction: {
  6634. Type: [Function],
  6635. default: null
  6636. },
  6637. // 本地数据源
  6638. localdata: {
  6639. type: Object
  6640. },
  6641. // 价格的字体颜色
  6642. priceColor: {
  6643. Type: String
  6644. },
  6645. // 立即购买按钮的文字
  6646. buyNowText: {
  6647. Type: String,
  6648. default: "立即购买"
  6649. },
  6650. // 立即购买按钮的字体颜色
  6651. buyNowColor: {
  6652. Type: String
  6653. },
  6654. // 立即购买按钮的背景颜色
  6655. buyNowBackgroundColor: {
  6656. Type: String
  6657. },
  6658. // 加入购物车按钮的文字
  6659. addCartText: {
  6660. Type: String,
  6661. default: "加入购物车"
  6662. },
  6663. // 加入购物车按钮的字体颜色
  6664. addCartColor: {
  6665. Type: String
  6666. },
  6667. // 加入购物车按钮的背景颜色
  6668. addCartBackgroundColor: {
  6669. Type: String
  6670. },
  6671. // 不可点击时,按钮的样式
  6672. disableStyle: {
  6673. Type: Object,
  6674. default: null
  6675. },
  6676. // 按钮点击时的样式
  6677. activedStyle: {
  6678. Type: Object,
  6679. default: null
  6680. },
  6681. // 按钮常态的样式
  6682. btnStyle: {
  6683. Type: Object,
  6684. default: null
  6685. },
  6686. // 是否显示右上角关闭按钮
  6687. showClose: {
  6688. Type: Boolean,
  6689. default: true
  6690. },
  6691. // 关闭按钮的图片地址 https://img.alicdn.com/imgextra/i1/121022687/O1CN01ImN0O11VigqwzpLiK_!!121022687.png
  6692. closeImage: {
  6693. Type: String,
  6694. default: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAEyUlEQVR42sSZeWwNURTGp4OqtBo7sSXELragdkpQsRRJ1Zr4hyJiJ9YgxNIg1qANiT+E1i5IY0kVVWtQEbuEKLFGUSH27/ANN5PXmTvzupzkl/tm8t6b7517lnvvC0lKSjJ8WmnQAUSDFqABqALKgl8gD7wE90E2SAeXwFf1SxISErQeVtKHwCgwFsSDSIf3hYFKoCkYDBaDdyAViHdueHmoF6FtwDLQ23b/E7gM7oIcejIERIDaoBFoC8qA8mA8SQNz6W1XC9GY+nCQCCYAk/c+gF0gBZwH312+IxR0BCPBUIaH2A+wHsxHCHxx+gLT5QGN6a2JfG8uvVCDws9oiDQYlxkMGfHyQvARlADTwcXk5OT6foV2kS8ATXidymlcyen1a/Jjl9IJh3hPkjELYqO8Cu0KjjNZvtETw5jFBWXPmGSTGQKSeOn5iQ0kVLL0CINfPNcPbDMKyRCbGzEMBJ+ZD8cChYFdqGTqfsWT8otPGoVsEHsMwxDFs3shNsxJ6BrQ0Po8OGUUkVHsNCVml+cntB1jUWwn2GEUsTEMrASbDK+2CCQ0kYX6nfLLisMmKqUr0S60M+jG10vAm+JSCa8+x7CKlzHwaktV6DiObzUzPJIxFO1BQ12wGtTReO9GetVgY/kjNJzZbcWmTjHfxw51AsRqvL8eOAtmsJuFu3g1l+1ZLB5eDTVZ3K0P7tL0TkWOpSg61kVkBtuuNRthGs+wtJST5aQI7cEbkkRXNYVKgX6kIdYuUhYzMQwxN8tiExCLFqHNeSF9/aem0BzGp5PYQCJ7c/Gsk1RfuSD6U1dNpcDf9ZigTmKbMRZ9iVTsHscGJluW2FMf1SSQWGnBmaB6kCJVTVVNJZE++Cx9drEllS1KMCINpURFmEbBWA63Fz9s95cGIdJgp/zXmT4pZcOvSUzuZttTbblmnc3PIjjmidDXvKgdhMh0JdbzuCjWrbNOVovjS5P7bkPJ/mBESkz2BO0166ybNeJ431S2q+01NntuIq3E0amzjiZtk9tssWyTDzO4525bACK9NAUn68TtkNhpEXpOSagRml+S6iLSSeweHv242Qhl13rRyvoDvDlKyTQny/ZQJ+1iH7vVbEx7OR5UiKVIO7VicgvHCtwrudloMIV7/0uadVYW57O4Wvvi8v4pymlKkrpwvsDeLLZAY2pkwbAB3PSQfC+4cH7l4k1ZH8zkZRq8ecO+Z5rN40JJqnXFuGfaxPCTLjcn0OZOpnArXw8HY4paIbw5CcMgXq6HN2/mt6+XGLrN15tBryIUGavMpCTrfKcDCKkAceA9S8nhAOehhSUyhXpkBxxnP4YM1InugP7cBkjBPcqVUWFYCEROxXiQz5JlXV+IfKh7mpfJac+lZ6V87QXVClBkTc7YWsWTPSDyitfzUTlJlj8TbvE6jluDOdwZ+jX57GLO3ADeuyZrDYi86vV81FD2UVGsmT+5Zl0BnkhoseOEaogL46pqO4v/IqUEyalIR4h85BgjHv6+aUWRMbb7EstX6O0cpT1Gco0ry8fWygLDMjmDnQeBt3Qe7uVfkeugDwVLcsVzGsuwLXbV+I63XNAkG5r/hvgRqgqWs6pJPKrsbvz/Q6yyun0w/h6lP+BnzrCpfPMT2L8FGAA7k1GZ/vnaqAAAAABJRU5ErkJggg=="
  6695. },
  6696. // 是否隐藏库存显示
  6697. hideStock: {
  6698. Type: Boolean,
  6699. default: false
  6700. },
  6701. // 颜色主题
  6702. theme: {
  6703. Type: String,
  6704. default: "default"
  6705. },
  6706. // 请求中的提示
  6707. actionTips: {
  6708. Type: String,
  6709. default: "请求中..."
  6710. },
  6711. // 默认选中的SKU
  6712. defaultSelect: {
  6713. Type: Object
  6714. },
  6715. // 是否使用缓存
  6716. useCache: {
  6717. Type: Boolean,
  6718. default: true
  6719. },
  6720. /**
  6721. * 默认商品,设置该值可快速展示商品
  6722. * 逻辑: 先展示 defaultGoods 信息,再取数据库,再更新页面(通常为更新库存)
  6723. */
  6724. defaultGoods: {
  6725. Type: Object
  6726. },
  6727. /**
  6728. * 金额是否需要除以100
  6729. * 1:金额会除以100
  6730. * 0:金额不会除以100
  6731. */
  6732. amountType: {
  6733. Type: Number,
  6734. default: 1
  6735. },
  6736. // 每次选择完SKU后,购买数量归1,如果有最小购买数量,则设置为最小购买数量
  6737. selectedInit: {
  6738. Type: Boolean,
  6739. default: false
  6740. },
  6741. // 是否开启底部安全区适配,默认true
  6742. safeAreaInsetBottom: {
  6743. Type: Boolean,
  6744. default: true
  6745. }
  6746. },
  6747. data() {
  6748. return {
  6749. safeBottom: 0,
  6750. // 留出底部安全距离
  6751. complete: false,
  6752. // 组件是否加载完成
  6753. goodsInfo: {},
  6754. // 商品信息
  6755. isShow: false,
  6756. // true 显示 false 隐藏
  6757. initKey: true,
  6758. // 是否需要初始化 true 是 false 否
  6759. shopItemInfo: {},
  6760. // 存放要和选中的值进行匹配的数据(因百度小程序setData不支持中文字段,故不编译shopItemInfo变量)
  6761. selectArr: [],
  6762. // 存放被选中的值
  6763. subIndex: [],
  6764. // 是否选中 因为不确定是多规格还是单规格,所以这里定义数组来判断
  6765. selectShop: {},
  6766. // 存放最后选中的商品
  6767. selectNum: this.minBuyNum || 1,
  6768. // 选中数量
  6769. outFoStock: false,
  6770. // 是否全部sku都缺货
  6771. openTime: 0,
  6772. themeColor: {
  6773. // 默认主题
  6774. default: {
  6775. priceColor: "rgb(254, 86, 10)",
  6776. buyNowColor: "#ffffff",
  6777. buyNowBackgroundColor: "rgb(254, 86, 10)",
  6778. addCartColor: "#ffffff",
  6779. addCartBackgroundColor: "rgb(255, 148, 2)",
  6780. btnStyle: {
  6781. color: "#333333",
  6782. borderColor: "#f4f4f4",
  6783. backgroundColor: "#ffffff"
  6784. },
  6785. activedStyle: {
  6786. color: "rgb(254, 86, 10)",
  6787. borderColor: "rgb(254, 86, 10)",
  6788. backgroundColor: "rgba(254,86,10,0.1)"
  6789. },
  6790. disableStyle: {
  6791. color: "#c3c3c3",
  6792. borderColor: "#f6f6f6",
  6793. backgroundColor: "#f6f6f6"
  6794. }
  6795. },
  6796. // 红黑主题
  6797. "red-black": {
  6798. priceColor: "rgb(255, 68, 68)",
  6799. buyNowColor: "#ffffff",
  6800. buyNowBackgroundColor: "rgb(255, 68, 68)",
  6801. addCartColor: "#ffffff",
  6802. addCartBackgroundColor: "rgb(85, 85, 85)",
  6803. activedStyle: {
  6804. color: "rgb(255, 68, 68)",
  6805. borderColor: "rgb(255, 68, 68)",
  6806. backgroundColor: "rgba(255,68,68,0.1)"
  6807. }
  6808. },
  6809. // 黑白主题
  6810. "black-white": {
  6811. priceColor: "rgb(47, 47, 52)",
  6812. buyNowColor: "#ffffff",
  6813. buyNowBackgroundColor: "rgb(47, 47, 52)",
  6814. addCartColor: "rgb(47, 47, 52)",
  6815. addCartBackgroundColor: "rgb(235, 236, 242)",
  6816. // btnStyle:{
  6817. // color:"rgb(47, 47, 52)",
  6818. // borderColor:"rgba(235,236,242,0.5)",
  6819. // backgroundColor:"rgba(235,236,242,0.5)",
  6820. // },
  6821. activedStyle: {
  6822. color: "rgb(47, 47, 52)",
  6823. borderColor: "rgba(47,47,52,0.12)",
  6824. backgroundColor: "rgba(47,47,52,0.12)"
  6825. }
  6826. },
  6827. // 咖啡色主题
  6828. coffee: {
  6829. priceColor: "rgb(195, 167, 105)",
  6830. buyNowColor: "#ffffff",
  6831. buyNowBackgroundColor: "rgb(195, 167, 105)",
  6832. addCartColor: "rgb(195, 167, 105)",
  6833. addCartBackgroundColor: "rgb(243, 238, 225)",
  6834. activedStyle: {
  6835. color: "rgb(195, 167, 105)",
  6836. borderColor: "rgb(195, 167, 105)",
  6837. backgroundColor: "rgba(195, 167, 105,0.1)"
  6838. }
  6839. },
  6840. // 浅绿色主题
  6841. green: {
  6842. priceColor: "rgb(99, 190, 114)",
  6843. buyNowColor: "#ffffff",
  6844. buyNowBackgroundColor: "rgb(99, 190, 114)",
  6845. addCartColor: "rgb(99, 190, 114)",
  6846. addCartBackgroundColor: "rgb(225, 244, 227)",
  6847. activedStyle: {
  6848. color: "rgb(99, 190, 114)",
  6849. borderColor: "rgb(99, 190, 114)",
  6850. backgroundColor: "rgba(99, 190, 114,0.1)"
  6851. }
  6852. }
  6853. }
  6854. };
  6855. },
  6856. created() {
  6857. let that = this;
  6858. vk = that.vk;
  6859. if (that.valueCom) {
  6860. that.open();
  6861. }
  6862. const { safeAreaInsets } = uni.getSystemInfoSync();
  6863. that.safeBottom = safeAreaInsets.bottom;
  6864. },
  6865. mounted() {
  6866. },
  6867. methods: {
  6868. // 初始化
  6869. init(notAutoClick) {
  6870. let that = this;
  6871. that.selectArr = [];
  6872. that.subIndex = [];
  6873. that.selectShop = {};
  6874. that.selectNum = that.minBuyNum || 1;
  6875. that.outFoStock = false;
  6876. that.shopItemInfo = {};
  6877. let specListName = that.specListName;
  6878. that.goodsInfo[specListName].map((item) => {
  6879. that.selectArr.push("");
  6880. that.subIndex.push(-1);
  6881. });
  6882. that.checkItem();
  6883. that.checkInpath(-1);
  6884. if (!notAutoClick)
  6885. that.autoClickSku();
  6886. },
  6887. // 使用vk路由模式框架获取商品信息
  6888. findGoodsInfo(obj = {}) {
  6889. let that = this;
  6890. let { useCache } = obj;
  6891. if (typeof vk == "undefined") {
  6892. that.toast("custom-action必须是function", "none");
  6893. return false;
  6894. }
  6895. let { actionTips } = that;
  6896. let actionTitle = "";
  6897. let actionAoading = false;
  6898. if (actionTips !== "custom") {
  6899. actionTitle = useCache ? "" : "请求中...";
  6900. } else {
  6901. actionAoading = useCache ? false : true;
  6902. }
  6903. vk.callFunction({
  6904. url: that.action,
  6905. title: actionTitle,
  6906. loading: actionAoading,
  6907. data: {
  6908. goods_id: that.goodsId
  6909. },
  6910. success(data) {
  6911. that.updateGoodsInfo(data.goodsInfo);
  6912. goodsCache[that.goodsId] = data.goodsInfo;
  6913. that.$emit("update-goods", data.goodsInfo);
  6914. },
  6915. fail() {
  6916. that.updateValue(false);
  6917. }
  6918. });
  6919. },
  6920. updateValue(value) {
  6921. let that = this;
  6922. if (value) {
  6923. that.$emit("open", true);
  6924. that.$emit("input", true);
  6925. that.$emit("update:modelValue", true);
  6926. } else {
  6927. that.$emit("input", false);
  6928. that.$emit("close", "close");
  6929. that.$emit("update:modelValue", false);
  6930. }
  6931. },
  6932. // 更新商品信息(库存、名称、图片)
  6933. updateGoodsInfo(goodsInfo) {
  6934. let that = this;
  6935. let { skuListName } = that;
  6936. if (JSON.stringify(that.goodsInfo) === "{}" || that.goodsInfo[that.goodsIdName] !== goodsInfo[that.goodsIdName]) {
  6937. that.goodsInfo = goodsInfo;
  6938. that.initKey = true;
  6939. } else {
  6940. that.goodsInfo[skuListName] = goodsInfo[skuListName];
  6941. }
  6942. if (that.initKey) {
  6943. that.initKey = false;
  6944. that.init();
  6945. }
  6946. let select_sku_info = that.getListItem(
  6947. that.goodsInfo[skuListName],
  6948. that.skuIdName,
  6949. that.selectShop[that.skuIdName]
  6950. );
  6951. Object.assign(that.selectShop, select_sku_info);
  6952. that.defaultSelectSku();
  6953. that.complete = true;
  6954. },
  6955. async open() {
  6956. let that = this;
  6957. that.openTime = (/* @__PURE__ */ new Date()).getTime();
  6958. let findGoodsInfoRun = true;
  6959. that.skuListName;
  6960. let useCache = false;
  6961. let goodsInfo = goodsCache[that.goodsId];
  6962. if (goodsInfo && that.useCache) {
  6963. useCache = true;
  6964. that.updateGoodsInfo(goodsInfo);
  6965. } else {
  6966. that.complete = false;
  6967. }
  6968. if (that.customAction && typeof that.customAction === "function") {
  6969. try {
  6970. goodsInfo = await that.customAction({
  6971. useCache,
  6972. goodsId: that.goodsId,
  6973. goodsInfo,
  6974. close: function() {
  6975. setTimeout(function() {
  6976. that.close();
  6977. }, 500);
  6978. }
  6979. }).catch((err) => {
  6980. setTimeout(function() {
  6981. that.close();
  6982. }, 500);
  6983. });
  6984. } catch (err) {
  6985. let { message = "" } = err;
  6986. if (message.indexOf(".catch is not a function") > -1) {
  6987. that.toast("custom-action必须返回一个Promise", "none");
  6988. setTimeout(function() {
  6989. that.close();
  6990. }, 500);
  6991. return false;
  6992. }
  6993. }
  6994. goodsCache[that.goodsId] = goodsInfo;
  6995. if (goodsInfo && typeof goodsInfo == "object" && JSON.stringify(goodsInfo) != "{}") {
  6996. findGoodsInfoRun = false;
  6997. that.updateGoodsInfo(goodsInfo);
  6998. that.updateValue(true);
  6999. } else {
  7000. that.toast("未获取到商品信息", "none");
  7001. that.$emit("input", false);
  7002. return false;
  7003. }
  7004. } else if (typeof that.localdata !== "undefined" && that.localdata !== null) {
  7005. goodsInfo = that.localdata;
  7006. if (goodsInfo && typeof goodsInfo == "object" && JSON.stringify(goodsInfo) != "{}") {
  7007. findGoodsInfoRun = false;
  7008. that.updateGoodsInfo(goodsInfo);
  7009. that.updateValue(true);
  7010. } else {
  7011. that.toast("未获取到商品信息", "none");
  7012. that.$emit("input", false);
  7013. return false;
  7014. }
  7015. } else {
  7016. if (findGoodsInfoRun)
  7017. that.findGoodsInfo({ useCache });
  7018. }
  7019. },
  7020. // 监听 - 弹出层收起
  7021. close(s2) {
  7022. let that = this;
  7023. if ((/* @__PURE__ */ new Date()).getTime() - that.openTime < 400) {
  7024. return false;
  7025. }
  7026. if (s2 == "mask") {
  7027. if (that.maskCloseAble !== false) {
  7028. that.$emit("input", false);
  7029. that.$emit("close", "mask");
  7030. that.$emit("update:modelValue", false);
  7031. }
  7032. } else {
  7033. that.$emit("input", false);
  7034. that.$emit("close", "close");
  7035. that.$emit("update:modelValue", false);
  7036. }
  7037. },
  7038. moveHandle() {
  7039. },
  7040. // sku按钮的点击事件
  7041. skuClick(value, index1, index2) {
  7042. let that = this;
  7043. if (value.ishow) {
  7044. if (that.selectArr[index1] != value.name) {
  7045. that.$set(that.selectArr, index1, value.name);
  7046. that.$set(that.subIndex, index1, index2);
  7047. } else {
  7048. that.$set(that.selectArr, index1, "");
  7049. that.$set(that.subIndex, index1, -1);
  7050. }
  7051. that.checkInpath(index1);
  7052. that.checkSelectShop();
  7053. }
  7054. },
  7055. // 检测是否已经选完sku
  7056. checkSelectShop() {
  7057. let that = this;
  7058. if (that.selectArr.every((item) => item != "")) {
  7059. that.selectShop = that.shopItemInfo[that.getArrayToSting(that.selectArr)];
  7060. let stock = that.selectShop[that.stockName];
  7061. if (typeof stock !== "undefined" && that.selectNum > stock) {
  7062. that.selectNum = stock;
  7063. }
  7064. if (that.selectNum > that.maxBuyNum) {
  7065. that.selectNum = that.maxBuyNum;
  7066. }
  7067. if (that.selectNum < that.minBuyNum) {
  7068. that.selectNum = that.minBuyNum;
  7069. }
  7070. if (that.selectedInit) {
  7071. that.selectNum = that.minBuyNum || 1;
  7072. }
  7073. } else {
  7074. that.selectShop = {};
  7075. }
  7076. },
  7077. // 检查路径
  7078. checkInpath(clickIndex) {
  7079. let that = this;
  7080. let specListName = that.specListName;
  7081. let specList = that.goodsInfo[specListName];
  7082. for (let i2 = 0, len = specList.length; i2 < len; i2++) {
  7083. if (i2 == clickIndex) {
  7084. continue;
  7085. }
  7086. let len2 = specList[i2].list.length;
  7087. for (let j2 = 0; j2 < len2; j2++) {
  7088. if (that.subIndex[i2] != -1 && j2 == that.subIndex[i2]) {
  7089. continue;
  7090. }
  7091. let choosed_copy = [...that.selectArr];
  7092. that.$set(choosed_copy, i2, specList[i2].list[j2].name);
  7093. let choosed_copy2 = choosed_copy.filter(
  7094. (item) => item !== "" && typeof item !== "undefined"
  7095. );
  7096. if (that.shopItemInfo.hasOwnProperty(that.getArrayToSting(choosed_copy2))) {
  7097. specList[i2].list[j2].ishow = true;
  7098. } else {
  7099. specList[i2].list[j2].ishow = false;
  7100. }
  7101. }
  7102. }
  7103. that.$set(that.goodsInfo, specListName, specList);
  7104. },
  7105. // 计算sku里面规格形成路径
  7106. checkItem() {
  7107. let that = this;
  7108. let { stockName } = that;
  7109. let skuListName = that.skuListName;
  7110. let originalSkuList = that.goodsInfo[skuListName];
  7111. let skuList = [];
  7112. let stockNum = 0;
  7113. originalSkuList.map((skuItem, index) => {
  7114. if (skuItem[stockName] > 0) {
  7115. skuList.push(skuItem);
  7116. stockNum += skuItem[stockName];
  7117. }
  7118. });
  7119. if (stockNum <= 0) {
  7120. that.outFoStock = true;
  7121. }
  7122. skuList.reduce(
  7123. (arrs, items) => {
  7124. return arrs.concat(
  7125. items[that.skuArrName].reduce(
  7126. (arr, item) => {
  7127. return arr.concat(
  7128. arr.map((item2) => {
  7129. if (!that.shopItemInfo.hasOwnProperty(that.getArrayToSting([...item2, item]))) {
  7130. that.shopItemInfo[that.getArrayToSting([...item2, item])] = items;
  7131. }
  7132. return [...item2, item];
  7133. })
  7134. );
  7135. },
  7136. [[]]
  7137. )
  7138. );
  7139. },
  7140. [[]]
  7141. );
  7142. },
  7143. getArrayToSting(arr) {
  7144. let str = "";
  7145. arr.map((item, index) => {
  7146. item = item.replace(/\./g, "。");
  7147. if (index == 0) {
  7148. str += item;
  7149. } else {
  7150. str += "," + item;
  7151. }
  7152. });
  7153. return str;
  7154. },
  7155. // 检测sku选项是否已全部选完,且有库存
  7156. checkSelectComplete(obj = {}) {
  7157. let that = this;
  7158. let clickTime = (/* @__PURE__ */ new Date()).getTime();
  7159. if (that.clickTime && clickTime - that.clickTime < 400) {
  7160. return false;
  7161. }
  7162. that.clickTime = clickTime;
  7163. let { selectShop, selectNum, stockText, stockName } = that;
  7164. if (!selectShop || !selectShop[that.skuIdName]) {
  7165. that.toast("请先选择对应规格", "none");
  7166. return false;
  7167. }
  7168. if (selectNum <= 0) {
  7169. that.toast("购买数量必须>0", "none");
  7170. return false;
  7171. }
  7172. if (selectNum > selectShop[stockName]) {
  7173. that.toast(stockText + "不足", "none");
  7174. return false;
  7175. }
  7176. if (typeof obj.success == "function")
  7177. obj.success(selectShop);
  7178. },
  7179. // 加入购物车
  7180. addCart() {
  7181. let that = this;
  7182. that.checkSelectComplete({
  7183. success: function(selectShop) {
  7184. selectShop.buy_num = that.selectNum;
  7185. that.$emit("add-cart", selectShop);
  7186. that.$emit("cart", selectShop);
  7187. }
  7188. });
  7189. },
  7190. // 立即购买
  7191. buyNow() {
  7192. let that = this;
  7193. that.checkSelectComplete({
  7194. success: function(selectShop) {
  7195. selectShop.buy_num = that.selectNum;
  7196. that.$emit("buy-now", selectShop);
  7197. that.$emit("buy", selectShop);
  7198. }
  7199. });
  7200. },
  7201. // 弹窗
  7202. toast(title, icon) {
  7203. uni.showToast({
  7204. title,
  7205. icon
  7206. });
  7207. },
  7208. // 获取对象数组中的某一个item,根据指定的键值
  7209. getListItem(list, key, value) {
  7210. let item;
  7211. for (let i2 in list) {
  7212. if (typeof value == "object") {
  7213. if (JSON.stringify(list[i2][key]) === JSON.stringify(value)) {
  7214. item = list[i2];
  7215. break;
  7216. }
  7217. } else {
  7218. if (list[i2][key] === value) {
  7219. item = list[i2];
  7220. break;
  7221. }
  7222. }
  7223. }
  7224. return item;
  7225. },
  7226. getListIndex(list, key, value) {
  7227. let index = -1;
  7228. for (let i2 = 0; i2 < list.length; i2++) {
  7229. if (list[i2][key] === value) {
  7230. index = i2;
  7231. break;
  7232. }
  7233. }
  7234. return index;
  7235. },
  7236. // 自动选择sku前提是只有一组sku,默认自动选择最前面的有库存的sku
  7237. autoClickSku() {
  7238. let that = this;
  7239. let { stockName } = that;
  7240. let skuList = that.goodsInfo[that.skuListName];
  7241. let specListArr = that.goodsInfo[that.specListName];
  7242. if (specListArr.length == 1) {
  7243. let specList = specListArr[0].list;
  7244. for (let i2 = 0; i2 < specList.length; i2++) {
  7245. let sku = that.getListItem(skuList, that.skuArrName, [specList[i2].name]);
  7246. if (sku && sku[stockName] > 0) {
  7247. that.skuClick(specList[i2], 0, i2);
  7248. break;
  7249. }
  7250. }
  7251. }
  7252. },
  7253. // 主题颜色
  7254. themeColorFn(name) {
  7255. let that = this;
  7256. let { theme, themeColor } = that;
  7257. let color = that[name] ? that[name] : themeColor[theme][name];
  7258. return color;
  7259. },
  7260. defaultSelectSku() {
  7261. let that = this;
  7262. let { defaultSelect } = that;
  7263. if (defaultSelect && defaultSelect.sku && defaultSelect.sku.length > 0) {
  7264. that.selectSku(defaultSelect);
  7265. }
  7266. },
  7267. /**
  7268. * 主动方法 - 设置sku
  7269. that.$refs.skuPopup.selectSku({
  7270. sku:["红色","256G","公开版"],
  7271. num:5
  7272. });
  7273. */
  7274. selectSku(obj = {}) {
  7275. let that = this;
  7276. let { sku: skuArr, num: selectNum } = obj;
  7277. let specListArr = that.goodsInfo[that.specListName];
  7278. if (skuArr && specListArr.length === skuArr.length) {
  7279. let skuClickArr = [];
  7280. let clickKey = true;
  7281. for (let index = 0; index < skuArr.length; index++) {
  7282. let skuName = skuArr[index];
  7283. let specList = specListArr[index].list;
  7284. let index1 = index;
  7285. let index2 = that.getListIndex(specList, "name", skuName);
  7286. if (index2 == -1) {
  7287. clickKey = false;
  7288. break;
  7289. }
  7290. skuClickArr.push({
  7291. spec: specList[index2],
  7292. index1,
  7293. index2
  7294. });
  7295. }
  7296. if (clickKey) {
  7297. that.init(true);
  7298. skuClickArr.map((item) => {
  7299. that.skuClick(item.spec, item.index1, item.index2);
  7300. });
  7301. }
  7302. }
  7303. if (selectNum > 0)
  7304. that.selectNum = selectNum;
  7305. },
  7306. priceFilter(n2 = 0) {
  7307. let that = this;
  7308. if (typeof n2 == "string") {
  7309. n2 = parseFloat(n2);
  7310. }
  7311. if (that.amountType === 0) {
  7312. return n2.toFixed(2);
  7313. } else {
  7314. return (n2 / 100).toFixed(2);
  7315. }
  7316. },
  7317. pushGoodsCache(goodsInfo) {
  7318. let that = this;
  7319. let { goodsIdName } = that;
  7320. goodsCache[goodsInfo[goodsIdName]] = goodsInfo;
  7321. },
  7322. // 用于阻止冒泡
  7323. stop() {
  7324. },
  7325. // 图片预览
  7326. previewImage() {
  7327. let that = this;
  7328. let { selectShop, goodsInfo, goodsThumbName } = that;
  7329. let src = selectShop.image ? selectShop.image : goodsInfo[goodsThumbName];
  7330. if (src) {
  7331. uni.previewImage({
  7332. urls: [src]
  7333. });
  7334. }
  7335. },
  7336. getMaxStock() {
  7337. let maxStock = 0;
  7338. let that = this;
  7339. let { selectShop = {}, goodsInfo = {}, skuListName, stockName } = that;
  7340. if (selectShop[stockName]) {
  7341. maxStock = selectShop[stockName];
  7342. } else {
  7343. let skuList = goodsInfo[skuListName];
  7344. if (skuList && skuList.length > 0) {
  7345. let valueArr = [];
  7346. skuList.map((skuItem, index) => {
  7347. valueArr.push(skuItem[stockName]);
  7348. });
  7349. let max = Math.max(...valueArr);
  7350. maxStock = max;
  7351. }
  7352. }
  7353. return maxStock;
  7354. },
  7355. numChange(e2) {
  7356. this.$emit("num-change", e2.value);
  7357. }
  7358. },
  7359. // 计算属性
  7360. computed: {
  7361. valueCom() {
  7362. return this.modelValue;
  7363. },
  7364. // 最大购买数量
  7365. maxBuyNumCom() {
  7366. let that = this;
  7367. let maxStock = that.getMaxStock();
  7368. let max = that.maxBuyNum || 1e5;
  7369. if (max > maxStock) {
  7370. max = maxStock;
  7371. }
  7372. return max;
  7373. },
  7374. // 是否是多规格
  7375. isManyCom() {
  7376. let that = this;
  7377. let { goodsInfo, defaultSingleSkuName, specListName } = that;
  7378. let isMany = true;
  7379. if (goodsInfo[specListName] && goodsInfo[specListName].length === 1 && goodsInfo[specListName][0].list.length === 1 && goodsInfo[specListName][0].name === defaultSingleSkuName) {
  7380. isMany = false;
  7381. }
  7382. return isMany;
  7383. },
  7384. // 默认价格区间计算
  7385. priceCom() {
  7386. let str = "";
  7387. let that = this;
  7388. let { selectShop = {}, goodsInfo = {}, skuListName, skuIdName } = that;
  7389. if (selectShop[skuIdName]) {
  7390. str = that.priceFilter(selectShop.price);
  7391. } else {
  7392. let skuList = goodsInfo[skuListName];
  7393. if (skuList && skuList.length > 0) {
  7394. let valueArr = [];
  7395. skuList.map((skuItem, index) => {
  7396. valueArr.push(skuItem.price);
  7397. });
  7398. let min = that.priceFilter(Math.min(...valueArr));
  7399. let max = that.priceFilter(Math.max(...valueArr));
  7400. if (min === max) {
  7401. str = min + "";
  7402. } else {
  7403. str = `${min} - ${max}`;
  7404. }
  7405. }
  7406. }
  7407. return str;
  7408. },
  7409. // 库存显示
  7410. stockCom() {
  7411. let str = "";
  7412. let that = this;
  7413. let { selectShop = {}, goodsInfo = {}, skuListName, stockName } = that;
  7414. if (selectShop[stockName]) {
  7415. str = selectShop[stockName];
  7416. } else {
  7417. let skuList = goodsInfo[skuListName];
  7418. if (skuList && skuList.length > 0) {
  7419. let valueArr = [];
  7420. skuList.map((skuItem, index) => {
  7421. valueArr.push(skuItem[stockName]);
  7422. });
  7423. let min = Math.min(...valueArr);
  7424. let max = Math.max(...valueArr);
  7425. if (min === max) {
  7426. str = min;
  7427. } else {
  7428. str = `${min} - ${max}`;
  7429. }
  7430. }
  7431. }
  7432. return str;
  7433. }
  7434. },
  7435. watch: {
  7436. valueCom(newVal, oldValue) {
  7437. let that = this;
  7438. if (newVal) {
  7439. that.open();
  7440. }
  7441. },
  7442. defaultGoods: {
  7443. immediate: true,
  7444. handler: function(newVal, oldValue) {
  7445. let that = this;
  7446. let { goodsIdName } = that;
  7447. if (typeof newVal === "object" && newVal && newVal[goodsIdName] && !goodsCache[newVal[goodsIdName]]) {
  7448. that.pushGoodsCache(newVal);
  7449. }
  7450. }
  7451. }
  7452. }
  7453. };
  7454. function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
  7455. const _component_vk_data_input_number_box = resolveEasycom(vue.resolveDynamicComponent("vk-data-input-number-box"), __easycom_0$b);
  7456. return vue.openBlock(), vue.createElementBlock(
  7457. "view",
  7458. {
  7459. class: vue.normalizeClass(["vk-data-goods-sku-popup", $options.valueCom && $data.complete ? "show" : "none"]),
  7460. catchtouchmove: "true",
  7461. onTouchmove: _cache[8] || (_cache[8] = vue.withModifiers((...args) => $options.moveHandle && $options.moveHandle(...args), ["stop", "prevent"])),
  7462. onClick: _cache[9] || (_cache[9] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  7463. },
  7464. [
  7465. vue.createCommentVNode(" 页面内容开始 "),
  7466. vue.createElementVNode("view", {
  7467. class: "mask",
  7468. onClick: _cache[0] || (_cache[0] = ($event) => $options.close("mask"))
  7469. }),
  7470. vue.createElementVNode(
  7471. "view",
  7472. {
  7473. class: vue.normalizeClass(["layer attr-content", { "safe-area-inset-bottom": $props.safeAreaInsetBottom }]),
  7474. style: vue.normalizeStyle({
  7475. borderRadius: $props.borderRadius + "rpx " + $props.borderRadius + "rpx 0 0",
  7476. paddingBottom: $data.safeBottom + "px"
  7477. })
  7478. },
  7479. [
  7480. vue.createElementVNode("view", { class: "specification-wrapper" }, [
  7481. vue.createElementVNode("scroll-view", {
  7482. class: "specification-wrapper-content",
  7483. "scroll-y": "true"
  7484. }, [
  7485. vue.createElementVNode("view", { class: "specification-header" }, [
  7486. vue.createElementVNode("view", { class: "specification-left" }, [
  7487. vue.createElementVNode("image", {
  7488. class: "product-img",
  7489. src: $data.selectShop.image ? $data.selectShop.image : $data.goodsInfo[$props.goodsThumbName],
  7490. style: vue.normalizeStyle({ backgroundColor: $props.goodsThumbBackgroundColor }),
  7491. mode: "aspectFill",
  7492. onClick: _cache[1] || (_cache[1] = (...args) => $options.previewImage && $options.previewImage(...args))
  7493. }, null, 12, ["src"])
  7494. ]),
  7495. vue.createElementVNode("view", { class: "specification-right" }, [
  7496. vue.createElementVNode(
  7497. "view",
  7498. {
  7499. class: "price-content",
  7500. style: vue.normalizeStyle({ color: $options.themeColorFn("priceColor") })
  7501. },
  7502. [
  7503. vue.createElementVNode("text", { class: "sign" }, "¥"),
  7504. vue.createElementVNode(
  7505. "text",
  7506. {
  7507. class: vue.normalizeClass(["price", $options.priceCom.length > 16 ? "price2" : ""])
  7508. },
  7509. vue.toDisplayString($options.priceCom),
  7510. 3
  7511. /* TEXT, CLASS */
  7512. )
  7513. ],
  7514. 4
  7515. /* STYLE */
  7516. ),
  7517. !$props.hideStock ? (vue.openBlock(), vue.createElementBlock(
  7518. "view",
  7519. {
  7520. key: 0,
  7521. class: "inventory"
  7522. },
  7523. vue.toDisplayString($props.stockText) + ":" + vue.toDisplayString($options.stockCom),
  7524. 1
  7525. /* TEXT */
  7526. )) : (vue.openBlock(), vue.createElementBlock("view", {
  7527. key: 1,
  7528. class: "inventory"
  7529. })),
  7530. vue.withDirectives(vue.createElementVNode(
  7531. "view",
  7532. { class: "choose" },
  7533. "已选:" + vue.toDisplayString($data.selectArr.join(" ")),
  7534. 513
  7535. /* TEXT, NEED_PATCH */
  7536. ), [
  7537. [vue.vShow, $options.isManyCom]
  7538. ])
  7539. ])
  7540. ]),
  7541. vue.createElementVNode("view", { class: "specification-content" }, [
  7542. (vue.openBlock(true), vue.createElementBlock(
  7543. vue.Fragment,
  7544. null,
  7545. vue.renderList($data.goodsInfo[$props.specListName], (item, index1) => {
  7546. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("view", {
  7547. class: "specification-item",
  7548. key: index1
  7549. }, [
  7550. vue.createElementVNode(
  7551. "view",
  7552. { class: "item-title" },
  7553. vue.toDisplayString(item.name),
  7554. 1
  7555. /* TEXT */
  7556. ),
  7557. vue.createElementVNode("view", { class: "item-wrapper" }, [
  7558. (vue.openBlock(true), vue.createElementBlock(
  7559. vue.Fragment,
  7560. null,
  7561. vue.renderList(item.list, (item_value, index2) => {
  7562. return vue.openBlock(), vue.createElementBlock("view", {
  7563. class: vue.normalizeClass(["item-content", [
  7564. item_value.ishow ? "" : "noactived",
  7565. $data.subIndex[index1] == index2 ? "actived" : ""
  7566. ]]),
  7567. key: index2,
  7568. style: vue.normalizeStyle([
  7569. item_value.ishow ? "" : $options.themeColorFn("disableStyle"),
  7570. item_value.ishow ? $options.themeColorFn("btnStyle") : "",
  7571. $data.subIndex[index1] == index2 ? $options.themeColorFn("activedStyle") : ""
  7572. ]),
  7573. onClick: ($event) => $options.skuClick(item_value, index1, index2)
  7574. }, vue.toDisplayString(item_value.name), 15, ["onClick"]);
  7575. }),
  7576. 128
  7577. /* KEYED_FRAGMENT */
  7578. ))
  7579. ])
  7580. ])), [
  7581. [vue.vShow, $options.isManyCom]
  7582. ]);
  7583. }),
  7584. 128
  7585. /* KEYED_FRAGMENT */
  7586. )),
  7587. vue.createElementVNode("view", { class: "number-box-view" }, [
  7588. vue.createElementVNode("view", { style: { "flex": "1" } }, "数量"),
  7589. vue.createElementVNode("view", { style: { "flex": "4", "text-align": "right" } }, [
  7590. vue.createVNode(_component_vk_data_input_number_box, {
  7591. modelValue: $data.selectNum,
  7592. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.selectNum = $event),
  7593. min: $props.minBuyNum || 1,
  7594. max: $options.maxBuyNumCom,
  7595. step: $props.stepBuyNum || 1,
  7596. "step-strictly": $props.stepStrictly,
  7597. "positive-integer": true,
  7598. onChange: $options.numChange
  7599. }, null, 8, ["modelValue", "min", "max", "step", "step-strictly", "onChange"])
  7600. ])
  7601. ])
  7602. ])
  7603. ]),
  7604. $props.showClose != false ? (vue.openBlock(), vue.createElementBlock("view", {
  7605. key: 0,
  7606. class: "close",
  7607. onClick: _cache[3] || (_cache[3] = ($event) => $options.close("close"))
  7608. }, [
  7609. vue.createElementVNode("image", {
  7610. class: "close-item",
  7611. src: $props.closeImage
  7612. }, null, 8, ["src"])
  7613. ])) : vue.createCommentVNode("v-if", true)
  7614. ]),
  7615. $data.outFoStock || $props.mode == 4 ? (vue.openBlock(), vue.createElementBlock("view", {
  7616. key: 0,
  7617. class: "btn-wrapper"
  7618. }, [
  7619. vue.createElementVNode(
  7620. "view",
  7621. {
  7622. class: "sure",
  7623. style: { "color": "#ffffff", "background-color": "#cccccc" }
  7624. },
  7625. vue.toDisplayString($props.noStockText),
  7626. 1
  7627. /* TEXT */
  7628. )
  7629. ])) : $props.mode == 1 ? (vue.openBlock(), vue.createElementBlock("view", {
  7630. key: 1,
  7631. class: "btn-wrapper"
  7632. }, [
  7633. vue.createElementVNode(
  7634. "view",
  7635. {
  7636. class: "sure add-cart",
  7637. style: vue.normalizeStyle([{ "border-radius": "38rpx 0rpx 0rpx 38rpx" }, {
  7638. color: $options.themeColorFn("addCartColor"),
  7639. backgroundColor: $options.themeColorFn("addCartBackgroundColor")
  7640. }]),
  7641. onClick: _cache[4] || (_cache[4] = (...args) => $options.addCart && $options.addCart(...args))
  7642. },
  7643. vue.toDisplayString($props.addCartText),
  7644. 5
  7645. /* TEXT, STYLE */
  7646. ),
  7647. vue.createElementVNode(
  7648. "view",
  7649. {
  7650. class: "sure",
  7651. style: vue.normalizeStyle([{ "border-radius": "0rpx 38rpx 38rpx 0rpx" }, {
  7652. color: $options.themeColorFn("buyNowColor"),
  7653. backgroundColor: $options.themeColorFn("buyNowBackgroundColor")
  7654. }]),
  7655. onClick: _cache[5] || (_cache[5] = (...args) => $options.buyNow && $options.buyNow(...args))
  7656. },
  7657. vue.toDisplayString($props.buyNowText),
  7658. 5
  7659. /* TEXT, STYLE */
  7660. )
  7661. ])) : $props.mode == 2 ? (vue.openBlock(), vue.createElementBlock("view", {
  7662. key: 2,
  7663. class: "btn-wrapper"
  7664. }, [
  7665. vue.createElementVNode(
  7666. "view",
  7667. {
  7668. class: "sure add-cart",
  7669. style: vue.normalizeStyle({
  7670. color: $options.themeColorFn("addCartColor"),
  7671. backgroundColor: $options.themeColorFn("addCartBackgroundColor")
  7672. }),
  7673. onClick: _cache[6] || (_cache[6] = (...args) => $options.addCart && $options.addCart(...args))
  7674. },
  7675. vue.toDisplayString($props.addCartText),
  7676. 5
  7677. /* TEXT, STYLE */
  7678. )
  7679. ])) : $props.mode == 3 ? (vue.openBlock(), vue.createElementBlock("view", {
  7680. key: 3,
  7681. class: "btn-wrapper"
  7682. }, [
  7683. vue.createElementVNode(
  7684. "view",
  7685. {
  7686. class: "sure",
  7687. style: vue.normalizeStyle({
  7688. color: $options.themeColorFn("buyNowColor"),
  7689. backgroundColor: $options.themeColorFn("buyNowBackgroundColor")
  7690. }),
  7691. onClick: _cache[7] || (_cache[7] = (...args) => $options.buyNow && $options.buyNow(...args))
  7692. },
  7693. vue.toDisplayString($props.buyNowText),
  7694. 5
  7695. /* TEXT, STYLE */
  7696. )
  7697. ])) : vue.createCommentVNode("v-if", true)
  7698. ],
  7699. 6
  7700. /* CLASS, STYLE */
  7701. ),
  7702. vue.createCommentVNode(" 页面内容结束 ")
  7703. ],
  7704. 34
  7705. /* CLASS, NEED_HYDRATION */
  7706. );
  7707. }
  7708. const __easycom_0$6 = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$J], ["__scopeId", "data-v-d1e15e37"], ["__file", "E:/demo/hmrabbit/src/components/vk-data-goods-sku-popup/vk-data-goods-sku-popup.vue"]]);
  7709. class MPAnimation {
  7710. constructor(options, _this) {
  7711. this.options = options;
  7712. this.animation = uni.createAnimation(options);
  7713. this.currentStepAnimates = {};
  7714. this.next = 0;
  7715. this.$ = _this;
  7716. }
  7717. _nvuePushAnimates(type, args) {
  7718. let aniObj = this.currentStepAnimates[this.next];
  7719. let styles = {};
  7720. if (!aniObj) {
  7721. styles = {
  7722. styles: {},
  7723. config: {}
  7724. };
  7725. } else {
  7726. styles = aniObj;
  7727. }
  7728. if (animateTypes1.includes(type)) {
  7729. if (!styles.styles.transform) {
  7730. styles.styles.transform = "";
  7731. }
  7732. let unit = "";
  7733. if (type === "rotate") {
  7734. unit = "deg";
  7735. }
  7736. styles.styles.transform += `${type}(${args + unit}) `;
  7737. } else {
  7738. styles.styles[type] = `${args}`;
  7739. }
  7740. this.currentStepAnimates[this.next] = styles;
  7741. }
  7742. _animateRun(styles = {}, config = {}) {
  7743. let ref = this.$.$refs["ani"].ref;
  7744. if (!ref)
  7745. return;
  7746. return new Promise((resolve, reject) => {
  7747. nvueAnimation.transition(ref, {
  7748. styles,
  7749. ...config
  7750. }, (res) => {
  7751. resolve();
  7752. });
  7753. });
  7754. }
  7755. _nvueNextAnimate(animates, step = 0, fn) {
  7756. let obj = animates[step];
  7757. if (obj) {
  7758. let {
  7759. styles,
  7760. config
  7761. } = obj;
  7762. this._animateRun(styles, config).then(() => {
  7763. step += 1;
  7764. this._nvueNextAnimate(animates, step, fn);
  7765. });
  7766. } else {
  7767. this.currentStepAnimates = {};
  7768. typeof fn === "function" && fn();
  7769. this.isEnd = true;
  7770. }
  7771. }
  7772. step(config = {}) {
  7773. this.animation.step(config);
  7774. return this;
  7775. }
  7776. run(fn) {
  7777. this.$.animationData = this.animation.export();
  7778. this.$.timer = setTimeout(() => {
  7779. typeof fn === "function" && fn();
  7780. }, this.$.durationTime);
  7781. }
  7782. }
  7783. const animateTypes1 = [
  7784. "matrix",
  7785. "matrix3d",
  7786. "rotate",
  7787. "rotate3d",
  7788. "rotateX",
  7789. "rotateY",
  7790. "rotateZ",
  7791. "scale",
  7792. "scale3d",
  7793. "scaleX",
  7794. "scaleY",
  7795. "scaleZ",
  7796. "skew",
  7797. "skewX",
  7798. "skewY",
  7799. "translate",
  7800. "translate3d",
  7801. "translateX",
  7802. "translateY",
  7803. "translateZ"
  7804. ];
  7805. const animateTypes2 = ["opacity", "backgroundColor"];
  7806. const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
  7807. animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
  7808. MPAnimation.prototype[type] = function(...args) {
  7809. this.animation[type](...args);
  7810. return this;
  7811. };
  7812. });
  7813. function createAnimation(option, _this) {
  7814. if (!_this)
  7815. return;
  7816. clearTimeout(_this.timer);
  7817. return new MPAnimation(option, _this);
  7818. }
  7819. const _sfc_main$J = {
  7820. name: "uniTransition",
  7821. emits: ["click", "change"],
  7822. props: {
  7823. show: {
  7824. type: Boolean,
  7825. default: false
  7826. },
  7827. modeClass: {
  7828. type: [Array, String],
  7829. default() {
  7830. return "fade";
  7831. }
  7832. },
  7833. duration: {
  7834. type: Number,
  7835. default: 300
  7836. },
  7837. styles: {
  7838. type: Object,
  7839. default() {
  7840. return {};
  7841. }
  7842. },
  7843. customClass: {
  7844. type: String,
  7845. default: ""
  7846. },
  7847. onceRender: {
  7848. type: Boolean,
  7849. default: false
  7850. }
  7851. },
  7852. data() {
  7853. return {
  7854. isShow: false,
  7855. transform: "",
  7856. opacity: 1,
  7857. animationData: {},
  7858. durationTime: 300,
  7859. config: {}
  7860. };
  7861. },
  7862. watch: {
  7863. show: {
  7864. handler(newVal) {
  7865. if (newVal) {
  7866. this.open();
  7867. } else {
  7868. if (this.isShow) {
  7869. this.close();
  7870. }
  7871. }
  7872. },
  7873. immediate: true
  7874. }
  7875. },
  7876. computed: {
  7877. // 生成样式数据
  7878. stylesObject() {
  7879. let styles = {
  7880. ...this.styles,
  7881. "transition-duration": this.duration / 1e3 + "s"
  7882. };
  7883. let transform = "";
  7884. for (let i2 in styles) {
  7885. let line = this.toLine(i2);
  7886. transform += line + ":" + styles[i2] + ";";
  7887. }
  7888. return transform;
  7889. },
  7890. // 初始化动画条件
  7891. transformStyles() {
  7892. return "transform:" + this.transform + ";opacity:" + this.opacity + ";" + this.stylesObject;
  7893. }
  7894. },
  7895. created() {
  7896. this.config = {
  7897. duration: this.duration,
  7898. timingFunction: "ease",
  7899. transformOrigin: "50% 50%",
  7900. delay: 0
  7901. };
  7902. this.durationTime = this.duration;
  7903. },
  7904. methods: {
  7905. /**
  7906. * ref 触发 初始化动画
  7907. */
  7908. init(obj = {}) {
  7909. if (obj.duration) {
  7910. this.durationTime = obj.duration;
  7911. }
  7912. this.animation = createAnimation(Object.assign(this.config, obj), this);
  7913. },
  7914. /**
  7915. * 点击组件触发回调
  7916. */
  7917. onClick() {
  7918. this.$emit("click", {
  7919. detail: this.isShow
  7920. });
  7921. },
  7922. /**
  7923. * ref 触发 动画分组
  7924. * @param {Object} obj
  7925. */
  7926. step(obj, config = {}) {
  7927. if (!this.animation)
  7928. return;
  7929. for (let i2 in obj) {
  7930. try {
  7931. if (typeof obj[i2] === "object") {
  7932. this.animation[i2](...obj[i2]);
  7933. } else {
  7934. this.animation[i2](obj[i2]);
  7935. }
  7936. } catch (e2) {
  7937. console.error(`方法 ${i2} 不存在`);
  7938. }
  7939. }
  7940. this.animation.step(config);
  7941. return this;
  7942. },
  7943. /**
  7944. * ref 触发 执行动画
  7945. */
  7946. run(fn) {
  7947. if (!this.animation)
  7948. return;
  7949. this.animation.run(fn);
  7950. },
  7951. // 开始过度动画
  7952. open() {
  7953. clearTimeout(this.timer);
  7954. this.transform = "";
  7955. this.isShow = true;
  7956. let { opacity, transform } = this.styleInit(false);
  7957. if (typeof opacity !== "undefined") {
  7958. this.opacity = opacity;
  7959. }
  7960. this.transform = transform;
  7961. this.$nextTick(() => {
  7962. this.timer = setTimeout(() => {
  7963. this.animation = createAnimation(this.config, this);
  7964. this.tranfromInit(false).step();
  7965. this.animation.run();
  7966. this.$emit("change", {
  7967. detail: this.isShow
  7968. });
  7969. }, 20);
  7970. });
  7971. },
  7972. // 关闭过度动画
  7973. close(type) {
  7974. if (!this.animation)
  7975. return;
  7976. this.tranfromInit(true).step().run(() => {
  7977. this.isShow = false;
  7978. this.animationData = null;
  7979. this.animation = null;
  7980. let { opacity, transform } = this.styleInit(false);
  7981. this.opacity = opacity || 1;
  7982. this.transform = transform;
  7983. this.$emit("change", {
  7984. detail: this.isShow
  7985. });
  7986. });
  7987. },
  7988. // 处理动画开始前的默认样式
  7989. styleInit(type) {
  7990. let styles = {
  7991. transform: ""
  7992. };
  7993. let buildStyle = (type2, mode) => {
  7994. if (mode === "fade") {
  7995. styles.opacity = this.animationType(type2)[mode];
  7996. } else {
  7997. styles.transform += this.animationType(type2)[mode] + " ";
  7998. }
  7999. };
  8000. if (typeof this.modeClass === "string") {
  8001. buildStyle(type, this.modeClass);
  8002. } else {
  8003. this.modeClass.forEach((mode) => {
  8004. buildStyle(type, mode);
  8005. });
  8006. }
  8007. return styles;
  8008. },
  8009. // 处理内置组合动画
  8010. tranfromInit(type) {
  8011. let buildTranfrom = (type2, mode) => {
  8012. let aniNum = null;
  8013. if (mode === "fade") {
  8014. aniNum = type2 ? 0 : 1;
  8015. } else {
  8016. aniNum = type2 ? "-100%" : "0";
  8017. if (mode === "zoom-in") {
  8018. aniNum = type2 ? 0.8 : 1;
  8019. }
  8020. if (mode === "zoom-out") {
  8021. aniNum = type2 ? 1.2 : 1;
  8022. }
  8023. if (mode === "slide-right") {
  8024. aniNum = type2 ? "100%" : "0";
  8025. }
  8026. if (mode === "slide-bottom") {
  8027. aniNum = type2 ? "100%" : "0";
  8028. }
  8029. }
  8030. this.animation[this.animationMode()[mode]](aniNum);
  8031. };
  8032. if (typeof this.modeClass === "string") {
  8033. buildTranfrom(type, this.modeClass);
  8034. } else {
  8035. this.modeClass.forEach((mode) => {
  8036. buildTranfrom(type, mode);
  8037. });
  8038. }
  8039. return this.animation;
  8040. },
  8041. animationType(type) {
  8042. return {
  8043. fade: type ? 1 : 0,
  8044. "slide-top": `translateY(${type ? "0" : "-100%"})`,
  8045. "slide-right": `translateX(${type ? "0" : "100%"})`,
  8046. "slide-bottom": `translateY(${type ? "0" : "100%"})`,
  8047. "slide-left": `translateX(${type ? "0" : "-100%"})`,
  8048. "zoom-in": `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
  8049. "zoom-out": `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
  8050. };
  8051. },
  8052. // 内置动画类型与实际动画对应字典
  8053. animationMode() {
  8054. return {
  8055. fade: "opacity",
  8056. "slide-top": "translateY",
  8057. "slide-right": "translateX",
  8058. "slide-bottom": "translateY",
  8059. "slide-left": "translateX",
  8060. "zoom-in": "scale",
  8061. "zoom-out": "scale"
  8062. };
  8063. },
  8064. // 驼峰转中横线
  8065. toLine(name) {
  8066. return name.replace(/([A-Z])/g, "-$1").toLowerCase();
  8067. }
  8068. }
  8069. };
  8070. function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
  8071. return $data.isShow || $props.onceRender ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("view", {
  8072. key: 0,
  8073. ref: "ani",
  8074. animation: $data.animationData,
  8075. class: vue.normalizeClass($props.customClass),
  8076. style: vue.normalizeStyle($options.transformStyles),
  8077. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  8078. }, [
  8079. vue.renderSlot(_ctx.$slots, "default")
  8080. ], 14, ["animation"])), [
  8081. [vue.vShow, $data.isShow]
  8082. ]) : vue.createCommentVNode("v-if", true);
  8083. }
  8084. const __easycom_0$5 = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$I], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-transition/uni-transition.vue"]]);
  8085. const _sfc_main$I = {
  8086. name: "uniPopup",
  8087. components: {},
  8088. emits: ["change", "maskClick"],
  8089. props: {
  8090. // 开启动画
  8091. animation: {
  8092. type: Boolean,
  8093. default: true
  8094. },
  8095. // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
  8096. // message: 消息提示 ; dialog : 对话框
  8097. type: {
  8098. type: String,
  8099. default: "center"
  8100. },
  8101. // maskClick
  8102. isMaskClick: {
  8103. type: Boolean,
  8104. default: null
  8105. },
  8106. // TODO 2 个版本后废弃属性 ,使用 isMaskClick
  8107. maskClick: {
  8108. type: Boolean,
  8109. default: null
  8110. },
  8111. backgroundColor: {
  8112. type: String,
  8113. default: "none"
  8114. },
  8115. safeArea: {
  8116. type: Boolean,
  8117. default: true
  8118. },
  8119. maskBackgroundColor: {
  8120. type: String,
  8121. default: "rgba(0, 0, 0, 0.4)"
  8122. },
  8123. // 指定使用v-show指令,不重新渲染Pop组件
  8124. onceRender: {
  8125. type: Boolean,
  8126. default: false
  8127. }
  8128. },
  8129. watch: {
  8130. /**
  8131. * 监听type类型
  8132. */
  8133. type: {
  8134. handler: function(type) {
  8135. if (!this.config[type])
  8136. return;
  8137. this[this.config[type]](true);
  8138. },
  8139. immediate: true
  8140. },
  8141. isDesktop: {
  8142. handler: function(newVal) {
  8143. if (!this.config[newVal])
  8144. return;
  8145. this[this.config[this.type]](true);
  8146. },
  8147. immediate: true
  8148. },
  8149. /**
  8150. * 监听遮罩是否可点击
  8151. * @param {Object} val
  8152. */
  8153. maskClick: {
  8154. handler: function(val) {
  8155. this.mkclick = val;
  8156. },
  8157. immediate: true
  8158. },
  8159. isMaskClick: {
  8160. handler: function(val) {
  8161. this.mkclick = val;
  8162. },
  8163. immediate: true
  8164. },
  8165. // H5 下禁止底部滚动
  8166. showPopup(show) {
  8167. }
  8168. },
  8169. data() {
  8170. return {
  8171. duration: 300,
  8172. ani: [],
  8173. showPopup: false,
  8174. showTrans: false,
  8175. popupWidth: 0,
  8176. popupHeight: 0,
  8177. config: {
  8178. top: "top",
  8179. bottom: "bottom",
  8180. center: "center",
  8181. left: "left",
  8182. right: "right",
  8183. message: "top",
  8184. dialog: "center",
  8185. share: "bottom"
  8186. },
  8187. maskClass: {
  8188. position: "fixed",
  8189. bottom: 0,
  8190. top: 0,
  8191. left: 0,
  8192. right: 0,
  8193. backgroundColor: "rgba(0, 0, 0, 0.4)"
  8194. },
  8195. transClass: {
  8196. position: "fixed",
  8197. left: 0,
  8198. right: 0
  8199. },
  8200. maskShow: true,
  8201. mkclick: true,
  8202. popupstyle: this.isDesktop ? "fixforpc-top" : "top"
  8203. };
  8204. },
  8205. computed: {
  8206. isDesktop() {
  8207. return this.popupWidth >= 500 && this.popupHeight >= 500;
  8208. },
  8209. bg() {
  8210. if (this.backgroundColor === "" || this.backgroundColor === "none") {
  8211. return "transparent";
  8212. }
  8213. return this.backgroundColor;
  8214. }
  8215. },
  8216. mounted() {
  8217. const fixSize = () => {
  8218. const {
  8219. windowWidth,
  8220. windowHeight,
  8221. windowTop,
  8222. safeArea,
  8223. screenHeight,
  8224. safeAreaInsets
  8225. } = uni.getSystemInfoSync();
  8226. this.popupWidth = windowWidth;
  8227. this.popupHeight = windowHeight + (windowTop || 0);
  8228. if (safeArea && this.safeArea) {
  8229. this.safeAreaInsets = safeAreaInsets.bottom;
  8230. } else {
  8231. this.safeAreaInsets = 0;
  8232. }
  8233. };
  8234. fixSize();
  8235. },
  8236. // TODO vue3
  8237. unmounted() {
  8238. this.setH5Visible();
  8239. },
  8240. created() {
  8241. if (this.isMaskClick === null && this.maskClick === null) {
  8242. this.mkclick = true;
  8243. } else {
  8244. this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
  8245. }
  8246. if (this.animation) {
  8247. this.duration = 300;
  8248. } else {
  8249. this.duration = 0;
  8250. }
  8251. this.messageChild = null;
  8252. this.clearPropagation = false;
  8253. this.maskClass.backgroundColor = this.maskBackgroundColor;
  8254. },
  8255. methods: {
  8256. setH5Visible() {
  8257. },
  8258. /**
  8259. * 公用方法,不显示遮罩层
  8260. */
  8261. closeMask() {
  8262. this.maskShow = false;
  8263. },
  8264. /**
  8265. * 公用方法,遮罩层禁止点击
  8266. */
  8267. disableMask() {
  8268. this.mkclick = false;
  8269. },
  8270. // TODO nvue 取消冒泡
  8271. clear(e2) {
  8272. e2.stopPropagation();
  8273. this.clearPropagation = true;
  8274. },
  8275. open(direction) {
  8276. if (this.showPopup) {
  8277. clearTimeout(this.timer);
  8278. this.showPopup = false;
  8279. }
  8280. let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
  8281. if (!(direction && innerType.indexOf(direction) !== -1)) {
  8282. direction = this.type;
  8283. }
  8284. if (!this.config[direction]) {
  8285. console.error("缺少类型:", direction);
  8286. return;
  8287. }
  8288. this[this.config[direction]]();
  8289. this.$emit("change", {
  8290. show: true,
  8291. type: direction
  8292. });
  8293. },
  8294. close(type) {
  8295. this.showTrans = false;
  8296. this.$emit("change", {
  8297. show: false,
  8298. type: this.type
  8299. });
  8300. clearTimeout(this.timer);
  8301. this.timer = setTimeout(() => {
  8302. this.showPopup = false;
  8303. }, 300);
  8304. },
  8305. // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
  8306. touchstart() {
  8307. this.clearPropagation = false;
  8308. },
  8309. onTap() {
  8310. if (this.clearPropagation) {
  8311. this.clearPropagation = false;
  8312. return;
  8313. }
  8314. this.$emit("maskClick");
  8315. if (!this.mkclick)
  8316. return;
  8317. this.close();
  8318. },
  8319. /**
  8320. * 顶部弹出样式处理
  8321. */
  8322. top(type) {
  8323. this.popupstyle = this.isDesktop ? "fixforpc-top" : "top";
  8324. this.ani = ["slide-top"];
  8325. this.transClass = {
  8326. position: "fixed",
  8327. left: 0,
  8328. right: 0,
  8329. backgroundColor: this.bg
  8330. };
  8331. if (type)
  8332. return;
  8333. this.showPopup = true;
  8334. this.showTrans = true;
  8335. this.$nextTick(() => {
  8336. if (this.messageChild && this.type === "message") {
  8337. this.messageChild.timerClose();
  8338. }
  8339. });
  8340. },
  8341. /**
  8342. * 底部弹出样式处理
  8343. */
  8344. bottom(type) {
  8345. this.popupstyle = "bottom";
  8346. this.ani = ["slide-bottom"];
  8347. this.transClass = {
  8348. position: "fixed",
  8349. left: 0,
  8350. right: 0,
  8351. bottom: 0,
  8352. paddingBottom: this.safeAreaInsets + "px",
  8353. backgroundColor: this.bg
  8354. };
  8355. if (type)
  8356. return;
  8357. this.showPopup = true;
  8358. this.showTrans = true;
  8359. },
  8360. /**
  8361. * 中间弹出样式处理
  8362. */
  8363. center(type) {
  8364. this.popupstyle = "center";
  8365. this.ani = ["zoom-out", "fade"];
  8366. this.transClass = {
  8367. position: "fixed",
  8368. display: "flex",
  8369. flexDirection: "column",
  8370. bottom: 0,
  8371. left: 0,
  8372. right: 0,
  8373. top: 0,
  8374. justifyContent: "center",
  8375. alignItems: "center"
  8376. };
  8377. if (type)
  8378. return;
  8379. this.showPopup = true;
  8380. this.showTrans = true;
  8381. },
  8382. left(type) {
  8383. this.popupstyle = "left";
  8384. this.ani = ["slide-left"];
  8385. this.transClass = {
  8386. position: "fixed",
  8387. left: 0,
  8388. bottom: 0,
  8389. top: 0,
  8390. backgroundColor: this.bg,
  8391. display: "flex",
  8392. flexDirection: "column"
  8393. };
  8394. if (type)
  8395. return;
  8396. this.showPopup = true;
  8397. this.showTrans = true;
  8398. },
  8399. right(type) {
  8400. this.popupstyle = "right";
  8401. this.ani = ["slide-right"];
  8402. this.transClass = {
  8403. position: "fixed",
  8404. bottom: 0,
  8405. right: 0,
  8406. top: 0,
  8407. backgroundColor: this.bg,
  8408. display: "flex",
  8409. flexDirection: "column"
  8410. };
  8411. if (type)
  8412. return;
  8413. this.showPopup = true;
  8414. this.showTrans = true;
  8415. }
  8416. }
  8417. };
  8418. function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
  8419. const _component_uni_transition = resolveEasycom(vue.resolveDynamicComponent("uni-transition"), __easycom_0$5);
  8420. return $data.showPopup || $props.onceRender ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
  8421. "view",
  8422. {
  8423. key: 0,
  8424. class: vue.normalizeClass(["uni-popup", [$data.popupstyle, $options.isDesktop ? "fixforpc-z-index" : ""]])
  8425. },
  8426. [
  8427. vue.createElementVNode(
  8428. "view",
  8429. {
  8430. onTouchstart: _cache[1] || (_cache[1] = (...args) => $options.touchstart && $options.touchstart(...args))
  8431. },
  8432. [
  8433. $data.maskShow ? (vue.openBlock(), vue.createBlock(_component_uni_transition, {
  8434. key: "1",
  8435. name: "mask",
  8436. "mode-class": "fade",
  8437. styles: $data.maskClass,
  8438. duration: $data.duration,
  8439. show: $data.showTrans,
  8440. onClick: $options.onTap
  8441. }, null, 8, ["styles", "duration", "show", "onClick"])) : vue.createCommentVNode("v-if", true),
  8442. vue.createVNode(_component_uni_transition, {
  8443. key: "2",
  8444. "mode-class": $data.ani,
  8445. name: "content",
  8446. styles: $data.transClass,
  8447. duration: $data.duration,
  8448. show: $data.showTrans,
  8449. onClick: $options.onTap,
  8450. "once-render": $props.onceRender
  8451. }, {
  8452. default: vue.withCtx(() => [
  8453. vue.createElementVNode(
  8454. "view",
  8455. {
  8456. class: vue.normalizeClass(["uni-popup__wrapper", [$data.popupstyle]]),
  8457. style: vue.normalizeStyle({ backgroundColor: $options.bg }),
  8458. onClick: _cache[0] || (_cache[0] = (...args) => $options.clear && $options.clear(...args))
  8459. },
  8460. [
  8461. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  8462. ],
  8463. 6
  8464. /* CLASS, STYLE */
  8465. )
  8466. ]),
  8467. _: 3
  8468. /* FORWARDED */
  8469. }, 8, ["mode-class", "styles", "duration", "show", "onClick", "once-render"])
  8470. ],
  8471. 32
  8472. /* NEED_HYDRATION */
  8473. )
  8474. ],
  8475. 2
  8476. /* CLASS */
  8477. )), [
  8478. [vue.vShow, $data.showPopup]
  8479. ]) : vue.createCommentVNode("v-if", true);
  8480. }
  8481. const __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$H], ["__scopeId", "data-v-7db519c7"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue"]]);
  8482. const getGoodsByIdAPI = (id) => {
  8483. return http({
  8484. method: "GET",
  8485. url: "/goods",
  8486. data: { id }
  8487. });
  8488. };
  8489. const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
  8490. __name: "AddressPanel",
  8491. setup(__props, { expose: __expose }) {
  8492. __expose();
  8493. const __returned__ = {};
  8494. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  8495. return __returned__;
  8496. }
  8497. });
  8498. function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
  8499. return vue.openBlock(), vue.createElementBlock("view", { class: "address-panel" }, [
  8500. vue.createCommentVNode(" 关闭按钮 "),
  8501. vue.createElementVNode("text", { class: "close icon-close" }),
  8502. vue.createCommentVNode(" 标题 "),
  8503. vue.createElementVNode("view", { class: "title" }, "配送至"),
  8504. vue.createCommentVNode(" 内容 "),
  8505. vue.createElementVNode("view", { class: "content" }, [
  8506. vue.createElementVNode("view", { class: "item" }, [
  8507. vue.createElementVNode("view", { class: "user" }, "李明 13824686868"),
  8508. vue.createElementVNode("view", { class: "address" }, "北京市顺义区后沙峪地区安平北街6号院"),
  8509. vue.createElementVNode("text", { class: "icon icon-checked" })
  8510. ]),
  8511. vue.createElementVNode("view", { class: "item" }, [
  8512. vue.createElementVNode("view", { class: "user" }, "王东 13824686868"),
  8513. vue.createElementVNode("view", { class: "address" }, "北京市顺义区后沙峪地区安平北街6号院"),
  8514. vue.createElementVNode("text", { class: "icon icon-ring" })
  8515. ]),
  8516. vue.createElementVNode("view", { class: "item" }, [
  8517. vue.createElementVNode("view", { class: "user" }, "张三 13824686868"),
  8518. vue.createElementVNode("view", { class: "address" }, "北京市朝阳区孙河安平北街6号院"),
  8519. vue.createElementVNode("text", { class: "icon icon-ring" })
  8520. ])
  8521. ]),
  8522. vue.createElementVNode("view", { class: "footer" }, [
  8523. vue.createElementVNode("view", { class: "button primary" }, " 新建地址 "),
  8524. vue.createCommentVNode("v-if", true)
  8525. ])
  8526. ]);
  8527. }
  8528. const AddressPanel = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$G], ["__scopeId", "data-v-4157c245"], ["__file", "E:/demo/hmrabbit/src/pages/goods/components/AddressPanel.vue"]]);
  8529. const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
  8530. __name: "ServicePanel",
  8531. emits: ["close"],
  8532. setup(__props, { expose: __expose, emit: __emit }) {
  8533. __expose();
  8534. const emit = __emit;
  8535. const __returned__ = { emit };
  8536. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  8537. return __returned__;
  8538. }
  8539. });
  8540. function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
  8541. return vue.openBlock(), vue.createElementBlock("view", { class: "service-panel" }, [
  8542. vue.createCommentVNode(" 关闭按钮 "),
  8543. vue.createElementVNode("text", {
  8544. class: "close icon-close",
  8545. onClick: _cache[0] || (_cache[0] = ($event) => $setup.emit("close"))
  8546. }),
  8547. vue.createCommentVNode(" 标题 "),
  8548. vue.createElementVNode("view", { class: "title" }, "服务说明"),
  8549. vue.createCommentVNode(" 内容 "),
  8550. vue.createElementVNode("view", { class: "content" }, [
  8551. vue.createElementVNode("view", { class: "item" }, [
  8552. vue.createElementVNode("view", { class: "dt" }, "无忧退货"),
  8553. vue.createElementVNode("view", { class: "dd" }, " 自收到商品之日起30天内,可在线申请无忧退货服务(食品等特殊商品除外) ")
  8554. ]),
  8555. vue.createElementVNode("view", { class: "item" }, [
  8556. vue.createElementVNode("view", { class: "dt" }, "快速退款"),
  8557. vue.createElementVNode("view", { class: "dd" }, " 收到退货包裹并确认无误后,将在48小时内办理退款, 退款将原路返回,不同银行处理时间不同,预计1-5个工作日到账 ")
  8558. ]),
  8559. vue.createElementVNode("view", { class: "item" }, [
  8560. vue.createElementVNode("view", { class: "dt" }, "满88元免邮费"),
  8561. vue.createElementVNode("view", { class: "dd" }, " 单笔订单金额(不含运费)满88元可免邮费,不满88元, 单笔订单收取10元邮费 ")
  8562. ])
  8563. ])
  8564. ]);
  8565. }
  8566. const ServicePanel = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$F], ["__scopeId", "data-v-7a45ec41"], ["__file", "E:/demo/hmrabbit/src/pages/goods/components/ServicePanel.vue"]]);
  8567. var SkuMode = /* @__PURE__ */ ((SkuMode2) => {
  8568. SkuMode2[SkuMode2["Both"] = 1] = "Both";
  8569. SkuMode2[SkuMode2["Cart"] = 2] = "Cart";
  8570. SkuMode2[SkuMode2["Buy"] = 3] = "Buy";
  8571. return SkuMode2;
  8572. })(SkuMode || {});
  8573. const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
  8574. __name: "goods",
  8575. props: {
  8576. id: { type: String, required: true }
  8577. },
  8578. setup(__props, { expose: __expose }) {
  8579. __expose();
  8580. const { safeAreaInsets } = uni.getSystemInfoSync();
  8581. const query = __props;
  8582. const goods2 = vue.ref();
  8583. const getGoodsByIdData = async () => {
  8584. const res = await getGoodsByIdAPI(query.id);
  8585. goods2.value = res.result;
  8586. localdata.value = {
  8587. _id: res.result.id,
  8588. name: res.result.name,
  8589. goods_thumb: res.result.mainPictures[0],
  8590. spec_list: res.result.specs.map((v2) => {
  8591. return {
  8592. name: v2.name,
  8593. list: v2.values
  8594. };
  8595. }),
  8596. sku_list: res.result.skus.map((v2) => {
  8597. return {
  8598. _id: v2.id,
  8599. goods_id: res.result.id,
  8600. goods_name: res.result.name,
  8601. image: v2.picture,
  8602. price: v2.price * 100,
  8603. // 注意:需要乘以 100
  8604. stock: v2.inventory,
  8605. sku_name_arr: v2.specs.map((vv) => vv.valueName)
  8606. };
  8607. })
  8608. };
  8609. };
  8610. onLoad(() => {
  8611. getGoodsByIdData();
  8612. });
  8613. const currentIndex = vue.ref(0);
  8614. const onChange = (ev) => {
  8615. currentIndex.value = ev.detail.current;
  8616. };
  8617. const onTapImage = (url) => {
  8618. uni.previewImage({
  8619. current: url,
  8620. urls: goods2.value.mainPictures
  8621. });
  8622. };
  8623. const popup2 = vue.ref();
  8624. const popupName = vue.ref();
  8625. const openPopup = (name) => {
  8626. var _a;
  8627. popupName.value = name;
  8628. (_a = popup2.value) == null ? void 0 : _a.open();
  8629. };
  8630. const isShowSku = vue.ref(false);
  8631. const localdata = vue.ref({});
  8632. const mode = vue.ref(
  8633. 2
  8634. /* Cart */
  8635. );
  8636. const openSkuPopup = (val) => {
  8637. isShowSku.value = true;
  8638. mode.value = val;
  8639. };
  8640. const skuPopupRef = vue.ref();
  8641. const selectArrText = vue.computed(() => {
  8642. var _a, _b;
  8643. return ((_b = (_a = skuPopupRef.value) == null ? void 0 : _a.selectArr) == null ? void 0 : _b.join(" ").trim()) || "请选择商品规格";
  8644. });
  8645. const onAddCart = async (ev) => {
  8646. await postMemberCartAPI({ skuId: ev._id, count: ev.buy_num });
  8647. uni.showToast({ title: "添加成功" });
  8648. isShowSku.value = false;
  8649. };
  8650. const onBuyNow = (ev) => {
  8651. uni.navigateTo({ url: `/pagesOrder/create/create?skuId=${ev._id}&count=${ev.buy_num}` });
  8652. };
  8653. const __returned__ = { safeAreaInsets, query, goods: goods2, getGoodsByIdData, currentIndex, onChange, onTapImage, popup: popup2, popupName, openPopup, isShowSku, localdata, SkuMode, mode, openSkuPopup, skuPopupRef, selectArrText, onAddCart, onBuyNow, AddressPanel, ServicePanel };
  8654. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  8655. return __returned__;
  8656. }
  8657. });
  8658. function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
  8659. var _a, _b, _c, _d, _e2, _f, _g, _h, _i;
  8660. const _component_vk_data_goods_sku_popup = resolveEasycom(vue.resolveDynamicComponent("vk-data-goods-sku-popup"), __easycom_0$6);
  8661. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  8662. return vue.openBlock(), vue.createElementBlock(
  8663. vue.Fragment,
  8664. null,
  8665. [
  8666. vue.createCommentVNode(" SKU弹窗组件 "),
  8667. vue.createVNode(_component_vk_data_goods_sku_popup, {
  8668. modelValue: $setup.isShowSku,
  8669. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.isShowSku = $event),
  8670. localdata: $setup.localdata,
  8671. mode: $setup.mode,
  8672. "add-cart-background-color": "#FFA868",
  8673. "buy-now-background-color": "#27BA9B",
  8674. ref: "skuPopupRef",
  8675. "actived-style": {
  8676. color: "#27BA9B",
  8677. borderColor: "#27BA9B",
  8678. backgroundColor: "#E9F8F5"
  8679. },
  8680. onAddCart: $setup.onAddCart,
  8681. onBuyNow: $setup.onBuyNow
  8682. }, null, 8, ["modelValue", "localdata", "mode"]),
  8683. vue.createElementVNode("scroll-view", {
  8684. "enable-back-to-top": "",
  8685. "scroll-y": "",
  8686. class: "viewport"
  8687. }, [
  8688. vue.createCommentVNode(" 基本信息 "),
  8689. vue.createElementVNode("view", { class: "goods" }, [
  8690. vue.createCommentVNode(" 商品主图 "),
  8691. vue.createElementVNode("view", { class: "preview" }, [
  8692. vue.createElementVNode(
  8693. "swiper",
  8694. {
  8695. onChange: $setup.onChange,
  8696. circular: ""
  8697. },
  8698. [
  8699. (vue.openBlock(true), vue.createElementBlock(
  8700. vue.Fragment,
  8701. null,
  8702. vue.renderList((_a = $setup.goods) == null ? void 0 : _a.mainPictures, (item) => {
  8703. return vue.openBlock(), vue.createElementBlock("swiper-item", { key: item }, [
  8704. vue.createElementVNode("image", {
  8705. class: "image",
  8706. onClick: ($event) => $setup.onTapImage(item),
  8707. mode: "aspectFill",
  8708. src: item
  8709. }, null, 8, ["onClick", "src"])
  8710. ]);
  8711. }),
  8712. 128
  8713. /* KEYED_FRAGMENT */
  8714. ))
  8715. ],
  8716. 32
  8717. /* NEED_HYDRATION */
  8718. ),
  8719. vue.createElementVNode("view", { class: "indicator" }, [
  8720. vue.createElementVNode(
  8721. "text",
  8722. { class: "current" },
  8723. vue.toDisplayString($setup.currentIndex + 1),
  8724. 1
  8725. /* TEXT */
  8726. ),
  8727. vue.createElementVNode("text", { class: "split" }, "/"),
  8728. vue.createElementVNode(
  8729. "text",
  8730. { class: "total" },
  8731. vue.toDisplayString((_b = $setup.goods) == null ? void 0 : _b.mainPictures.length),
  8732. 1
  8733. /* TEXT */
  8734. )
  8735. ])
  8736. ]),
  8737. vue.createCommentVNode(" 商品简介 "),
  8738. vue.createElementVNode("view", { class: "meta" }, [
  8739. vue.createElementVNode("view", { class: "price" }, [
  8740. vue.createElementVNode("text", { class: "symbol" }, "¥"),
  8741. vue.createElementVNode(
  8742. "text",
  8743. { class: "number" },
  8744. vue.toDisplayString((_c = $setup.goods) == null ? void 0 : _c.price),
  8745. 1
  8746. /* TEXT */
  8747. )
  8748. ]),
  8749. vue.createElementVNode(
  8750. "view",
  8751. { class: "name ellipsis" },
  8752. vue.toDisplayString((_d = $setup.goods) == null ? void 0 : _d.name),
  8753. 1
  8754. /* TEXT */
  8755. ),
  8756. vue.createElementVNode(
  8757. "view",
  8758. { class: "desc" },
  8759. vue.toDisplayString((_e2 = $setup.goods) == null ? void 0 : _e2.desc),
  8760. 1
  8761. /* TEXT */
  8762. )
  8763. ]),
  8764. vue.createCommentVNode(" 操作面板 "),
  8765. vue.createElementVNode("view", { class: "action" }, [
  8766. vue.createElementVNode("view", {
  8767. onClick: _cache[1] || (_cache[1] = ($event) => $setup.openSkuPopup($setup.SkuMode.Both)),
  8768. class: "item arrow"
  8769. }, [
  8770. vue.createElementVNode("text", { class: "label" }, "选择"),
  8771. vue.createElementVNode(
  8772. "text",
  8773. { class: "text ellipsis" },
  8774. vue.toDisplayString($setup.selectArrText),
  8775. 1
  8776. /* TEXT */
  8777. )
  8778. ]),
  8779. vue.createElementVNode("view", {
  8780. onClick: _cache[2] || (_cache[2] = ($event) => $setup.openPopup("address")),
  8781. class: "item arrow"
  8782. }, [
  8783. vue.createElementVNode("text", { class: "label" }, "送至"),
  8784. vue.createElementVNode("text", { class: "text ellipsis" }, " 请选择收获地址 ")
  8785. ]),
  8786. vue.createElementVNode("view", {
  8787. onClick: _cache[3] || (_cache[3] = ($event) => $setup.openPopup("service")),
  8788. class: "item arrow"
  8789. }, [
  8790. vue.createElementVNode("text", { class: "label" }, "服务"),
  8791. vue.createElementVNode("text", { class: "text ellipsis" }, " 无忧退 快速退款 免费包邮 ")
  8792. ])
  8793. ])
  8794. ]),
  8795. vue.createCommentVNode(" 商品详情 "),
  8796. vue.createElementVNode("view", { class: "detail panel" }, [
  8797. vue.createElementVNode("view", { class: "title" }, [
  8798. vue.createElementVNode("text", null, "详情")
  8799. ]),
  8800. vue.createElementVNode("view", { class: "content" }, [
  8801. vue.createElementVNode("view", { class: "properties" }, [
  8802. vue.createCommentVNode(" 属性详情 "),
  8803. (vue.openBlock(true), vue.createElementBlock(
  8804. vue.Fragment,
  8805. null,
  8806. vue.renderList((_f = $setup.goods) == null ? void 0 : _f.details.properties, (item) => {
  8807. return vue.openBlock(), vue.createElementBlock("view", {
  8808. class: "item",
  8809. key: item.name
  8810. }, [
  8811. vue.createElementVNode(
  8812. "text",
  8813. { class: "label" },
  8814. vue.toDisplayString(item.name),
  8815. 1
  8816. /* TEXT */
  8817. ),
  8818. vue.createElementVNode(
  8819. "text",
  8820. { class: "value" },
  8821. vue.toDisplayString(item.value),
  8822. 1
  8823. /* TEXT */
  8824. )
  8825. ]);
  8826. }),
  8827. 128
  8828. /* KEYED_FRAGMENT */
  8829. ))
  8830. ]),
  8831. vue.createCommentVNode(" 图片详情 "),
  8832. (vue.openBlock(true), vue.createElementBlock(
  8833. vue.Fragment,
  8834. null,
  8835. vue.renderList((_g = $setup.goods) == null ? void 0 : _g.details.pictures, (item) => {
  8836. return vue.openBlock(), vue.createElementBlock("image", {
  8837. class: "image",
  8838. key: item,
  8839. mode: "widthFix",
  8840. src: item
  8841. }, null, 8, ["src"]);
  8842. }),
  8843. 128
  8844. /* KEYED_FRAGMENT */
  8845. ))
  8846. ])
  8847. ]),
  8848. vue.createCommentVNode(" 同类推荐 "),
  8849. vue.createElementVNode("view", { class: "similar panel" }, [
  8850. vue.createElementVNode("view", { class: "title" }, [
  8851. vue.createElementVNode("text", null, "同类推荐")
  8852. ]),
  8853. vue.createElementVNode("view", { class: "content" }, [
  8854. (vue.openBlock(true), vue.createElementBlock(
  8855. vue.Fragment,
  8856. null,
  8857. vue.renderList((_h = $setup.goods) == null ? void 0 : _h.similarProducts, (item) => {
  8858. return vue.openBlock(), vue.createElementBlock("navigator", {
  8859. key: item.id,
  8860. class: "goods",
  8861. "hover-class": "none",
  8862. url: `/pages/goods/goods?id=${item.id}`
  8863. }, [
  8864. vue.createElementVNode("image", {
  8865. class: "image",
  8866. mode: "aspectFill",
  8867. src: item.picture
  8868. }, null, 8, ["src"]),
  8869. vue.createElementVNode(
  8870. "view",
  8871. { class: "name ellipsis" },
  8872. vue.toDisplayString(item.name),
  8873. 1
  8874. /* TEXT */
  8875. ),
  8876. vue.createElementVNode("view", { class: "price" }, [
  8877. vue.createElementVNode("text", { class: "symbol" }, "¥"),
  8878. vue.createElementVNode(
  8879. "text",
  8880. { class: "number" },
  8881. vue.toDisplayString(item.price),
  8882. 1
  8883. /* TEXT */
  8884. )
  8885. ])
  8886. ], 8, ["url"]);
  8887. }),
  8888. 128
  8889. /* KEYED_FRAGMENT */
  8890. ))
  8891. ])
  8892. ])
  8893. ]),
  8894. vue.createCommentVNode(" 用户操作 "),
  8895. $setup.goods ? (vue.openBlock(), vue.createElementBlock(
  8896. "view",
  8897. {
  8898. key: 0,
  8899. class: "toolbar",
  8900. style: vue.normalizeStyle({ paddingBottom: ((_i = $setup.safeAreaInsets) == null ? void 0 : _i.bottom) + "px" })
  8901. },
  8902. [
  8903. vue.createElementVNode("view", { class: "icons" }, [
  8904. vue.createElementVNode("button", { class: "icons-button" }, [
  8905. vue.createElementVNode("text", { class: "icon-heart" }),
  8906. vue.createTextVNode("收藏")
  8907. ]),
  8908. vue.createElementVNode("navigator", {
  8909. class: "icons-button",
  8910. url: "/pages/cart/cart2",
  8911. "open-type": "navigate"
  8912. }, [
  8913. vue.createElementVNode("text", { class: "icon-cart" }),
  8914. vue.createTextVNode("购物车 ")
  8915. ])
  8916. ]),
  8917. vue.createElementVNode("view", { class: "buttons" }, [
  8918. vue.createElementVNode("view", {
  8919. onClick: _cache[4] || (_cache[4] = ($event) => $setup.openSkuPopup($setup.SkuMode.Cart)),
  8920. class: "addcart"
  8921. }, " 加入购物车 "),
  8922. vue.createElementVNode("view", {
  8923. onClick: _cache[5] || (_cache[5] = ($event) => $setup.openSkuPopup($setup.SkuMode.Buy)),
  8924. class: "payment"
  8925. }, " 立即购买 ")
  8926. ])
  8927. ],
  8928. 4
  8929. /* STYLE */
  8930. )) : vue.createCommentVNode("v-if", true),
  8931. vue.createCommentVNode(" uni-ui 弹出层 "),
  8932. vue.createVNode(
  8933. _component_uni_popup,
  8934. {
  8935. ref: "popup",
  8936. type: "bottom",
  8937. "background-color": "#fff"
  8938. },
  8939. {
  8940. default: vue.withCtx(() => [
  8941. $setup.popupName === "address" ? (vue.openBlock(), vue.createBlock($setup["AddressPanel"], {
  8942. key: 0,
  8943. onClose: _cache[6] || (_cache[6] = ($event) => {
  8944. var _a2;
  8945. return (_a2 = $setup.popup) == null ? void 0 : _a2.close();
  8946. })
  8947. })) : vue.createCommentVNode("v-if", true),
  8948. $setup.popupName === "service" ? (vue.openBlock(), vue.createBlock($setup["ServicePanel"], {
  8949. key: 1,
  8950. onClose: _cache[7] || (_cache[7] = ($event) => {
  8951. var _a2;
  8952. return (_a2 = $setup.popup) == null ? void 0 : _a2.close();
  8953. })
  8954. })) : vue.createCommentVNode("v-if", true)
  8955. ]),
  8956. _: 1
  8957. /* STABLE */
  8958. },
  8959. 512
  8960. /* NEED_PATCH */
  8961. )
  8962. ],
  8963. 64
  8964. /* STABLE_FRAGMENT */
  8965. );
  8966. }
  8967. const PagesGoodsGoods = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$E], ["__file", "E:/demo/hmrabbit/src/pages/goods/goods.vue"]]);
  8968. const _sfc_main$E = {
  8969. name: "uniFormsItem",
  8970. options: {
  8971. virtualHost: true
  8972. },
  8973. provide() {
  8974. return {
  8975. uniFormItem: this
  8976. };
  8977. },
  8978. inject: {
  8979. form: {
  8980. from: "uniForm",
  8981. default: null
  8982. }
  8983. },
  8984. props: {
  8985. // 表单校验规则
  8986. rules: {
  8987. type: Array,
  8988. default() {
  8989. return null;
  8990. }
  8991. },
  8992. // 表单域的属性名,在使用校验规则时必填
  8993. name: {
  8994. type: [String, Array],
  8995. default: ""
  8996. },
  8997. required: {
  8998. type: Boolean,
  8999. default: false
  9000. },
  9001. label: {
  9002. type: String,
  9003. default: ""
  9004. },
  9005. // label的宽度 ,默认 80
  9006. labelWidth: {
  9007. type: [String, Number],
  9008. default: ""
  9009. },
  9010. // label 居中方式,默认 left 取值 left/center/right
  9011. labelAlign: {
  9012. type: String,
  9013. default: ""
  9014. },
  9015. // 强制显示错误信息
  9016. errorMessage: {
  9017. type: [String, Boolean],
  9018. default: ""
  9019. },
  9020. // 1.4.0 弃用,统一使用 form 的校验时机
  9021. // validateTrigger: {
  9022. // type: String,
  9023. // default: ''
  9024. // },
  9025. // 1.4.0 弃用,统一使用 form 的label 位置
  9026. // labelPosition: {
  9027. // type: String,
  9028. // default: ''
  9029. // },
  9030. // 1.4.0 以下属性已经废弃,请使用 #label 插槽代替
  9031. leftIcon: String,
  9032. iconColor: {
  9033. type: String,
  9034. default: "#606266"
  9035. }
  9036. },
  9037. data() {
  9038. return {
  9039. errMsg: "",
  9040. isRequired: false,
  9041. userRules: null,
  9042. localLabelAlign: "left",
  9043. localLabelWidth: "65px",
  9044. localLabelPos: "left",
  9045. border: false,
  9046. isFirstBorder: false
  9047. };
  9048. },
  9049. computed: {
  9050. // 处理错误信息
  9051. msg() {
  9052. return this.errorMessage || this.errMsg;
  9053. }
  9054. },
  9055. watch: {
  9056. // 规则发生变化通知子组件更新
  9057. "form.formRules"(val) {
  9058. this.init();
  9059. },
  9060. "form.labelWidth"(val) {
  9061. this.localLabelWidth = this._labelWidthUnit(val);
  9062. },
  9063. "form.labelPosition"(val) {
  9064. this.localLabelPos = this._labelPosition();
  9065. },
  9066. "form.labelAlign"(val) {
  9067. }
  9068. },
  9069. created() {
  9070. this.init(true);
  9071. if (this.name && this.form) {
  9072. this.$watch(
  9073. () => {
  9074. const val = this.form._getDataValue(this.name, this.form.localData);
  9075. return val;
  9076. },
  9077. (value, oldVal) => {
  9078. const isEqual2 = this.form._isEqual(value, oldVal);
  9079. if (!isEqual2) {
  9080. const val = this.itemSetValue(value);
  9081. this.onFieldChange(val, false);
  9082. }
  9083. },
  9084. {
  9085. immediate: false
  9086. }
  9087. );
  9088. }
  9089. },
  9090. unmounted() {
  9091. this.__isUnmounted = true;
  9092. this.unInit();
  9093. },
  9094. methods: {
  9095. /**
  9096. * 外部调用方法
  9097. * 设置规则 ,主要用于小程序自定义检验规则
  9098. * @param {Array} rules 规则源数据
  9099. */
  9100. setRules(rules = null) {
  9101. this.userRules = rules;
  9102. this.init(false);
  9103. },
  9104. // 兼容老版本表单组件
  9105. setValue() {
  9106. },
  9107. /**
  9108. * 外部调用方法
  9109. * 校验数据
  9110. * @param {any} value 需要校验的数据
  9111. * @param {boolean} 是否立即校验
  9112. * @return {Array|null} 校验内容
  9113. */
  9114. async onFieldChange(value, formtrigger = true) {
  9115. const {
  9116. formData,
  9117. localData,
  9118. errShowType,
  9119. validateCheck,
  9120. validateTrigger,
  9121. _isRequiredField,
  9122. _realName
  9123. } = this.form;
  9124. const name = _realName(this.name);
  9125. if (!value) {
  9126. value = this.form.formData[name];
  9127. }
  9128. const ruleLen = this.itemRules.rules && this.itemRules.rules.length;
  9129. if (!this.validator || !ruleLen || ruleLen === 0)
  9130. return;
  9131. const isRequiredField2 = _isRequiredField(this.itemRules.rules || []);
  9132. let result = null;
  9133. if (validateTrigger === "bind" || formtrigger) {
  9134. result = await this.validator.validateUpdate(
  9135. {
  9136. [name]: value
  9137. },
  9138. formData
  9139. );
  9140. if (!isRequiredField2 && (value === void 0 || value === "")) {
  9141. result = null;
  9142. }
  9143. if (result && result.errorMessage) {
  9144. if (errShowType === "undertext") {
  9145. this.errMsg = !result ? "" : result.errorMessage;
  9146. }
  9147. if (errShowType === "toast") {
  9148. uni.showToast({
  9149. title: result.errorMessage || "校验错误",
  9150. icon: "none"
  9151. });
  9152. }
  9153. if (errShowType === "modal") {
  9154. uni.showModal({
  9155. title: "提示",
  9156. content: result.errorMessage || "校验错误"
  9157. });
  9158. }
  9159. } else {
  9160. this.errMsg = "";
  9161. }
  9162. validateCheck(result ? result : null);
  9163. } else {
  9164. this.errMsg = "";
  9165. }
  9166. return result ? result : null;
  9167. },
  9168. /**
  9169. * 初始组件数据
  9170. */
  9171. init(type = false) {
  9172. const {
  9173. validator,
  9174. formRules,
  9175. childrens,
  9176. formData,
  9177. localData,
  9178. _realName,
  9179. labelWidth,
  9180. _getDataValue,
  9181. _setDataValue
  9182. } = this.form || {};
  9183. this.localLabelAlign = this._justifyContent();
  9184. this.localLabelWidth = this._labelWidthUnit(labelWidth);
  9185. this.localLabelPos = this._labelPosition();
  9186. this.isRequired = this.required;
  9187. this.form && type && childrens.push(this);
  9188. if (!validator || !formRules)
  9189. return;
  9190. if (!this.form.isFirstBorder) {
  9191. this.form.isFirstBorder = true;
  9192. this.isFirstBorder = true;
  9193. }
  9194. if (this.group) {
  9195. if (!this.group.isFirstBorder) {
  9196. this.group.isFirstBorder = true;
  9197. this.isFirstBorder = true;
  9198. }
  9199. }
  9200. this.border = this.form.border;
  9201. const name = _realName(this.name);
  9202. const itemRule = this.userRules || this.rules;
  9203. if (typeof formRules === "object" && itemRule) {
  9204. formRules[name] = {
  9205. rules: itemRule
  9206. };
  9207. validator.updateSchema(formRules);
  9208. }
  9209. const itemRules = formRules[name] || {};
  9210. this.itemRules = itemRules;
  9211. this.validator = validator;
  9212. this.itemSetValue(_getDataValue(this.name, localData));
  9213. this.isRequired = this._isRequired();
  9214. },
  9215. unInit() {
  9216. if (this.form) {
  9217. const {
  9218. childrens,
  9219. formData,
  9220. _realName
  9221. } = this.form;
  9222. childrens.forEach((item, index) => {
  9223. if (item === this) {
  9224. this.form.childrens.splice(index, 1);
  9225. delete formData[_realName(item.name)];
  9226. }
  9227. });
  9228. }
  9229. },
  9230. // 设置item 的值
  9231. itemSetValue(value) {
  9232. const name = this.form._realName(this.name);
  9233. const rules = this.itemRules.rules || [];
  9234. const val = this.form._getValue(name, value, rules);
  9235. this.form._setDataValue(name, this.form.formData, val);
  9236. return val;
  9237. },
  9238. /**
  9239. * 移除该表单项的校验结果
  9240. */
  9241. clearValidate() {
  9242. this.errMsg = "";
  9243. },
  9244. // 是否显示星号
  9245. _isRequired() {
  9246. return this.required;
  9247. },
  9248. // 处理对齐方式
  9249. _justifyContent() {
  9250. if (this.form) {
  9251. const {
  9252. labelAlign
  9253. } = this.form;
  9254. let labelAli = this.labelAlign ? this.labelAlign : labelAlign;
  9255. if (labelAli === "left")
  9256. return "flex-start";
  9257. if (labelAli === "center")
  9258. return "center";
  9259. if (labelAli === "right")
  9260. return "flex-end";
  9261. }
  9262. return "flex-start";
  9263. },
  9264. // 处理 label宽度单位 ,继承父元素的值
  9265. _labelWidthUnit(labelWidth) {
  9266. return this.num2px(this.labelWidth ? this.labelWidth : labelWidth || (this.label ? 65 : "auto"));
  9267. },
  9268. // 处理 label 位置
  9269. _labelPosition() {
  9270. if (this.form)
  9271. return this.form.labelPosition || "left";
  9272. return "left";
  9273. },
  9274. /**
  9275. * 触发时机
  9276. * @param {Object} rule 当前规则内时机
  9277. * @param {Object} itemRlue 当前组件时机
  9278. * @param {Object} parentRule 父组件时机
  9279. */
  9280. isTrigger(rule, itemRlue, parentRule) {
  9281. if (rule === "submit" || !rule) {
  9282. if (rule === void 0) {
  9283. if (itemRlue !== "bind") {
  9284. if (!itemRlue) {
  9285. return parentRule === "" ? "bind" : "submit";
  9286. }
  9287. return "submit";
  9288. }
  9289. return "bind";
  9290. }
  9291. return "submit";
  9292. }
  9293. return "bind";
  9294. },
  9295. num2px(num) {
  9296. if (typeof num === "number") {
  9297. return `${num}px`;
  9298. }
  9299. return num;
  9300. }
  9301. }
  9302. };
  9303. function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
  9304. return vue.openBlock(), vue.createElementBlock(
  9305. "view",
  9306. {
  9307. class: vue.normalizeClass(["uni-forms-item", ["is-direction-" + $data.localLabelPos, $data.border ? "uni-forms-item--border" : "", $data.border && $data.isFirstBorder ? "is-first-border" : ""]])
  9308. },
  9309. [
  9310. vue.renderSlot(_ctx.$slots, "label", {}, () => [
  9311. vue.createElementVNode(
  9312. "view",
  9313. {
  9314. class: vue.normalizeClass(["uni-forms-item__label", { "no-label": !$props.label && !$data.isRequired }]),
  9315. style: vue.normalizeStyle({ width: $data.localLabelWidth, justifyContent: $data.localLabelAlign })
  9316. },
  9317. [
  9318. $data.isRequired ? (vue.openBlock(), vue.createElementBlock("text", {
  9319. key: 0,
  9320. class: "is-required"
  9321. }, "*")) : vue.createCommentVNode("v-if", true),
  9322. vue.createElementVNode(
  9323. "text",
  9324. null,
  9325. vue.toDisplayString($props.label),
  9326. 1
  9327. /* TEXT */
  9328. )
  9329. ],
  9330. 6
  9331. /* CLASS, STYLE */
  9332. )
  9333. ], true),
  9334. vue.createElementVNode("view", { class: "uni-forms-item__content" }, [
  9335. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
  9336. vue.createElementVNode(
  9337. "view",
  9338. {
  9339. class: vue.normalizeClass(["uni-forms-item__error", { "msg--active": $options.msg }])
  9340. },
  9341. [
  9342. vue.createElementVNode(
  9343. "text",
  9344. null,
  9345. vue.toDisplayString($options.msg),
  9346. 1
  9347. /* TEXT */
  9348. )
  9349. ],
  9350. 2
  9351. /* CLASS */
  9352. )
  9353. ])
  9354. ],
  9355. 2
  9356. /* CLASS */
  9357. );
  9358. }
  9359. const __easycom_0$4 = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$D], ["__scopeId", "data-v-3515f8e1"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.vue"]]);
  9360. const easycom = {
  9361. autoscan: true,
  9362. custom: {
  9363. "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue",
  9364. "^Xtx(.*)": "@/components/Xtx$1.vue"
  9365. }
  9366. };
  9367. const pages = [
  9368. {
  9369. path: "pages/index/index",
  9370. style: {
  9371. navigationStyle: "custom",
  9372. navigationBarTextStyle: "white",
  9373. navigationBarTitleText: "首页"
  9374. }
  9375. },
  9376. {
  9377. path: "pages/category/category",
  9378. style: {
  9379. navigationBarTitleText: "商品分类"
  9380. }
  9381. },
  9382. {
  9383. path: "pages/cart/cart",
  9384. style: {
  9385. navigationBarTitleText: "购物车"
  9386. }
  9387. },
  9388. {
  9389. path: "pages/cart/cart2",
  9390. style: {
  9391. navigationBarTitleText: "购物车"
  9392. }
  9393. },
  9394. {
  9395. path: "pages/my/my",
  9396. style: {
  9397. navigationStyle: "custom",
  9398. navigationBarTextStyle: "white",
  9399. navigationBarTitleText: "我的"
  9400. }
  9401. },
  9402. {
  9403. path: "pages/login/login",
  9404. style: {
  9405. navigationBarTitleText: "登录"
  9406. }
  9407. },
  9408. {
  9409. path: "pages/hot/hot",
  9410. style: {
  9411. navigationBarTitleText: "热门推荐"
  9412. }
  9413. },
  9414. {
  9415. path: "pages/goods/goods",
  9416. style: {
  9417. navigationBarTitleText: "商品详情"
  9418. }
  9419. },
  9420. {
  9421. path: "pages/inbound/inbound",
  9422. style: {
  9423. navigationBarTitleText: "入库",
  9424. "app-plus": {
  9425. bounce: "none",
  9426. titleNView: {
  9427. buttons: [
  9428. {
  9429. fontSize: "16px",
  9430. text: "历史"
  9431. }
  9432. ]
  9433. }
  9434. }
  9435. }
  9436. },
  9437. {
  9438. path: "pages/inbound/logList",
  9439. style: {
  9440. navigationBarTitleText: "录入历史"
  9441. }
  9442. },
  9443. {
  9444. path: "pages/weigh/weigh",
  9445. style: {
  9446. navigationBarTitleText: "称重",
  9447. "app-plus": {
  9448. bounce: "none",
  9449. titleNView: {
  9450. buttons: [
  9451. {
  9452. fontSize: "16px",
  9453. text: "历史"
  9454. }
  9455. ]
  9456. }
  9457. }
  9458. }
  9459. },
  9460. {
  9461. path: "pages/weigh/logList",
  9462. style: {
  9463. navigationBarTitleText: "录入历史"
  9464. }
  9465. },
  9466. {
  9467. path: "pages/outbound/outbound",
  9468. style: {
  9469. navigationBarTitleText: "出库",
  9470. "app-plus": {
  9471. bounce: "none",
  9472. titleNView: {
  9473. buttons: [
  9474. {
  9475. fontSize: "16px",
  9476. text: "历史"
  9477. }
  9478. ]
  9479. }
  9480. }
  9481. }
  9482. },
  9483. {
  9484. path: "pages/outbound/logList",
  9485. style: {
  9486. navigationBarTitleText: "录入历史"
  9487. }
  9488. },
  9489. {
  9490. path: "pages/warehouseScan/warehouseScan",
  9491. style: {
  9492. navigationBarTitleText: "仓库扫描",
  9493. "app-plus": {
  9494. bounce: "none",
  9495. titleNView: {
  9496. buttons: [
  9497. {
  9498. fontSize: "16px",
  9499. text: "历史"
  9500. }
  9501. ]
  9502. }
  9503. }
  9504. }
  9505. },
  9506. {
  9507. path: "pages/warehouseScan/logList",
  9508. style: {
  9509. navigationBarTitleText: "录入历史"
  9510. }
  9511. },
  9512. {
  9513. path: "pages/printer/printer",
  9514. style: {
  9515. navigationBarTitleText: "打印",
  9516. "app-plus": {
  9517. bounce: "none",
  9518. titleNView: {
  9519. buttons: [
  9520. {
  9521. fontSize: "16px",
  9522. text: "历史"
  9523. }
  9524. ]
  9525. }
  9526. }
  9527. }
  9528. },
  9529. {
  9530. path: "pages/printer/logList",
  9531. style: {
  9532. navigationBarTitleText: "录入历史"
  9533. }
  9534. },
  9535. {
  9536. path: "pages/scanLotno/scanLotno",
  9537. style: {
  9538. navigationBarTitleText: "托盘/批次",
  9539. "app-plus": {
  9540. bounce: "none",
  9541. titleNView: {
  9542. buttons: [
  9543. {
  9544. fontSize: "16px",
  9545. text: "历史"
  9546. }
  9547. ]
  9548. }
  9549. }
  9550. }
  9551. },
  9552. {
  9553. path: "pages/scanLotno/logList",
  9554. style: {
  9555. navigationBarTitleText: "录入历史"
  9556. }
  9557. },
  9558. {
  9559. path: "pages/scanLotno/waybillsList",
  9560. style: {
  9561. navigationBarTitleText: "运单列表"
  9562. }
  9563. },
  9564. {
  9565. path: "pages/waybillNo/waybillNo",
  9566. style: {
  9567. navigationBarTitleText: "库位绑定",
  9568. "app-plus": {
  9569. bounce: "none",
  9570. titleNView: {
  9571. buttons: [
  9572. {
  9573. fontSize: "16px",
  9574. text: "历史"
  9575. }
  9576. ]
  9577. }
  9578. }
  9579. }
  9580. },
  9581. {
  9582. path: "pages/waybillNo/logList",
  9583. style: {
  9584. navigationBarTitleText: "库位历史"
  9585. }
  9586. },
  9587. {
  9588. path: "pages/pickup/waybillPickUpOrder",
  9589. style: {
  9590. navigationBarTitleText: "取件单",
  9591. "app-plus": {
  9592. bounce: "none",
  9593. titleNView: {
  9594. buttons: [
  9595. {
  9596. color: "#007AFF",
  9597. fontSize: "22px",
  9598. text: "",
  9599. fontSrc: "/static/iconfont/iconfont.ttf",
  9600. float: "right"
  9601. }
  9602. ]
  9603. }
  9604. }
  9605. }
  9606. },
  9607. {
  9608. path: "pages/pickup/waybillPickUpDetails",
  9609. style: {
  9610. navigationBarTitleText: "取件详情"
  9611. }
  9612. },
  9613. {
  9614. path: "pages/pickup/waybillPickUpDetail",
  9615. style: {
  9616. navigationBarTitleText: "运单信息"
  9617. }
  9618. },
  9619. {
  9620. path: "pages/waybillDeliveryOrder/waybillDeliveryOrder",
  9621. style: {
  9622. navigationBarTitleText: "派送单"
  9623. }
  9624. }
  9625. ];
  9626. const globalStyle = {
  9627. navigationBarTextStyle: "black",
  9628. navigationBarTitleText: "",
  9629. navigationBarBackgroundColor: "#F8F8F8",
  9630. backgroundColor: "#F8F8F8"
  9631. };
  9632. const tabBar = {
  9633. color: "#333",
  9634. selectedColor: "#27ba9b",
  9635. backgroundColor: "#fff",
  9636. borderStyle: "white",
  9637. list: [
  9638. {
  9639. text: "首页",
  9640. pagePath: "pages/index/index",
  9641. iconPath: "static/tabs/home_default.png",
  9642. selectedIconPath: "static/tabs/home_selected.png"
  9643. },
  9644. {
  9645. text: "我的",
  9646. pagePath: "pages/my/my",
  9647. iconPath: "static/tabs/user_default.png",
  9648. selectedIconPath: "static/tabs/user_selected.png"
  9649. }
  9650. ]
  9651. };
  9652. const subPackages = [
  9653. {
  9654. root: "pagesMember",
  9655. pages: [
  9656. {
  9657. path: "settings/settings",
  9658. style: {
  9659. navigationBarTitleText: "设置"
  9660. }
  9661. },
  9662. {
  9663. path: "profile/profile",
  9664. style: {
  9665. navigationStyle: "custom",
  9666. navigationBarTextStyle: "white",
  9667. navigationBarTitleText: "个人信息"
  9668. }
  9669. },
  9670. {
  9671. path: "address/address",
  9672. style: {
  9673. navigationBarTitleText: "地址管理"
  9674. }
  9675. },
  9676. {
  9677. path: "address-form/address-form",
  9678. style: {
  9679. navigationBarTitleText: ""
  9680. }
  9681. }
  9682. ]
  9683. },
  9684. {
  9685. root: "pagesOrder",
  9686. pages: [
  9687. {
  9688. path: "create/create",
  9689. style: {
  9690. navigationBarTitleText: "填写订单"
  9691. }
  9692. },
  9693. {
  9694. path: "detail/detail",
  9695. style: {
  9696. navigationBarTitleText: "订单详情",
  9697. navigationStyle: "custom"
  9698. }
  9699. },
  9700. {
  9701. path: "payment/payment",
  9702. style: {
  9703. navigationBarTitleText: "支付结果"
  9704. }
  9705. },
  9706. {
  9707. path: "list/list",
  9708. style: {
  9709. navigationBarTitleText: "订单列表"
  9710. }
  9711. }
  9712. ]
  9713. }
  9714. ];
  9715. const preloadRule = {
  9716. "pages/my/my": {
  9717. network: "all",
  9718. packages: [
  9719. "pagesMember"
  9720. ]
  9721. }
  9722. };
  9723. const e = {
  9724. easycom,
  9725. pages,
  9726. globalStyle,
  9727. tabBar,
  9728. subPackages,
  9729. preloadRule
  9730. };
  9731. var define_process_env_UNI_SECURE_NETWORK_CONFIG_default = [];
  9732. function t$3(e2) {
  9733. return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
  9734. }
  9735. function n(e2, t2, n2) {
  9736. return e2(n2 = { path: t2, exports: {}, require: function(e3, t3) {
  9737. return function() {
  9738. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  9739. }(null == t3 && n2.path);
  9740. } }, n2.exports), n2.exports;
  9741. }
  9742. var s = n(function(e2, t2) {
  9743. var n2;
  9744. e2.exports = (n2 = n2 || function(e3, t3) {
  9745. var n3 = Object.create || /* @__PURE__ */ function() {
  9746. function e4() {
  9747. }
  9748. return function(t4) {
  9749. var n4;
  9750. return e4.prototype = t4, n4 = new e4(), e4.prototype = null, n4;
  9751. };
  9752. }(), s2 = {}, r2 = s2.lib = {}, i2 = r2.Base = { extend: function(e4) {
  9753. var t4 = n3(this);
  9754. return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") && this.init !== t4.init || (t4.init = function() {
  9755. t4.$super.init.apply(this, arguments);
  9756. }), t4.init.prototype = t4, t4.$super = this, t4;
  9757. }, create: function() {
  9758. var e4 = this.extend();
  9759. return e4.init.apply(e4, arguments), e4;
  9760. }, init: function() {
  9761. }, mixIn: function(e4) {
  9762. for (var t4 in e4)
  9763. e4.hasOwnProperty(t4) && (this[t4] = e4[t4]);
  9764. e4.hasOwnProperty("toString") && (this.toString = e4.toString);
  9765. }, clone: function() {
  9766. return this.init.prototype.extend(this);
  9767. } }, o2 = r2.WordArray = i2.extend({ init: function(e4, n4) {
  9768. e4 = this.words = e4 || [], this.sigBytes = n4 != t3 ? n4 : 4 * e4.length;
  9769. }, toString: function(e4) {
  9770. return (e4 || c2).stringify(this);
  9771. }, concat: function(e4) {
  9772. var t4 = this.words, n4 = e4.words, s3 = this.sigBytes, r3 = e4.sigBytes;
  9773. if (this.clamp(), s3 % 4)
  9774. for (var i3 = 0; i3 < r3; i3++) {
  9775. var o3 = n4[i3 >>> 2] >>> 24 - i3 % 4 * 8 & 255;
  9776. t4[s3 + i3 >>> 2] |= o3 << 24 - (s3 + i3) % 4 * 8;
  9777. }
  9778. else
  9779. for (i3 = 0; i3 < r3; i3 += 4)
  9780. t4[s3 + i3 >>> 2] = n4[i3 >>> 2];
  9781. return this.sigBytes += r3, this;
  9782. }, clamp: function() {
  9783. var t4 = this.words, n4 = this.sigBytes;
  9784. t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4);
  9785. }, clone: function() {
  9786. var e4 = i2.clone.call(this);
  9787. return e4.words = this.words.slice(0), e4;
  9788. }, random: function(t4) {
  9789. for (var n4, s3 = [], r3 = function(t5) {
  9790. t5 = t5;
  9791. var n5 = 987654321, s4 = 4294967295;
  9792. return function() {
  9793. var r4 = ((n5 = 36969 * (65535 & n5) + (n5 >> 16) & s4) << 16) + (t5 = 18e3 * (65535 & t5) + (t5 >> 16) & s4) & s4;
  9794. return r4 /= 4294967296, (r4 += 0.5) * (e3.random() > 0.5 ? 1 : -1);
  9795. };
  9796. }, i3 = 0; i3 < t4; i3 += 4) {
  9797. var a3 = r3(4294967296 * (n4 || e3.random()));
  9798. n4 = 987654071 * a3(), s3.push(4294967296 * a3() | 0);
  9799. }
  9800. return new o2.init(s3, t4);
  9801. } }), a2 = s2.enc = {}, c2 = a2.Hex = { stringify: function(e4) {
  9802. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  9803. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  9804. s3.push((i3 >>> 4).toString(16)), s3.push((15 & i3).toString(16));
  9805. }
  9806. return s3.join("");
  9807. }, parse: function(e4) {
  9808. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3 += 2)
  9809. n4[s3 >>> 3] |= parseInt(e4.substr(s3, 2), 16) << 24 - s3 % 8 * 4;
  9810. return new o2.init(n4, t4 / 2);
  9811. } }, u2 = a2.Latin1 = { stringify: function(e4) {
  9812. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  9813. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  9814. s3.push(String.fromCharCode(i3));
  9815. }
  9816. return s3.join("");
  9817. }, parse: function(e4) {
  9818. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3++)
  9819. n4[s3 >>> 2] |= (255 & e4.charCodeAt(s3)) << 24 - s3 % 4 * 8;
  9820. return new o2.init(n4, t4);
  9821. } }, h2 = a2.Utf8 = { stringify: function(e4) {
  9822. try {
  9823. return decodeURIComponent(escape(u2.stringify(e4)));
  9824. } catch (e5) {
  9825. throw new Error("Malformed UTF-8 data");
  9826. }
  9827. }, parse: function(e4) {
  9828. return u2.parse(unescape(encodeURIComponent(e4)));
  9829. } }, l2 = r2.BufferedBlockAlgorithm = i2.extend({ reset: function() {
  9830. this._data = new o2.init(), this._nDataBytes = 0;
  9831. }, _append: function(e4) {
  9832. "string" == typeof e4 && (e4 = h2.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes;
  9833. }, _process: function(t4) {
  9834. 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);
  9835. if (c3) {
  9836. for (var h3 = 0; h3 < c3; h3 += i3)
  9837. this._doProcessBlock(s3, h3);
  9838. var l3 = s3.splice(0, c3);
  9839. n4.sigBytes -= u3;
  9840. }
  9841. return new o2.init(l3, u3);
  9842. }, clone: function() {
  9843. var e4 = i2.clone.call(this);
  9844. return e4._data = this._data.clone(), e4;
  9845. }, _minBufferSize: 0 });
  9846. r2.Hasher = l2.extend({ cfg: i2.extend(), init: function(e4) {
  9847. this.cfg = this.cfg.extend(e4), this.reset();
  9848. }, reset: function() {
  9849. l2.reset.call(this), this._doReset();
  9850. }, update: function(e4) {
  9851. return this._append(e4), this._process(), this;
  9852. }, finalize: function(e4) {
  9853. return e4 && this._append(e4), this._doFinalize();
  9854. }, blockSize: 16, _createHelper: function(e4) {
  9855. return function(t4, n4) {
  9856. return new e4.init(n4).finalize(t4);
  9857. };
  9858. }, _createHmacHelper: function(e4) {
  9859. return function(t4, n4) {
  9860. return new d2.HMAC.init(e4, n4).finalize(t4);
  9861. };
  9862. } });
  9863. var d2 = s2.algo = {};
  9864. return s2;
  9865. }(Math), n2);
  9866. }), r = s, i = (n(function(e2, t2) {
  9867. var n2;
  9868. e2.exports = (n2 = r, function(e3) {
  9869. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [];
  9870. !function() {
  9871. for (var t4 = 0; t4 < 64; t4++)
  9872. a2[t4] = 4294967296 * e3.abs(e3.sin(t4 + 1)) | 0;
  9873. }();
  9874. var c2 = o2.MD5 = i2.extend({ _doReset: function() {
  9875. this._hash = new r2.init([1732584193, 4023233417, 2562383102, 271733878]);
  9876. }, _doProcessBlock: function(e4, t4) {
  9877. for (var n3 = 0; n3 < 16; n3++) {
  9878. var s3 = t4 + n3, r3 = e4[s3];
  9879. e4[s3] = 16711935 & (r3 << 8 | r3 >>> 24) | 4278255360 & (r3 << 24 | r3 >>> 8);
  9880. }
  9881. var i3 = this._hash.words, o3 = e4[t4 + 0], c3 = e4[t4 + 1], p2 = e4[t4 + 2], f2 = e4[t4 + 3], g2 = e4[t4 + 4], m2 = e4[t4 + 5], y2 = e4[t4 + 6], _2 = e4[t4 + 7], w2 = e4[t4 + 8], v2 = e4[t4 + 9], I2 = e4[t4 + 10], S2 = e4[t4 + 11], b2 = e4[t4 + 12], k2 = e4[t4 + 13], A2 = e4[t4 + 14], C2 = e4[t4 + 15], P2 = i3[0], T2 = i3[1], x2 = i3[2], O2 = i3[3];
  9882. P2 = u2(P2, T2, x2, O2, o3, 7, a2[0]), O2 = u2(O2, P2, T2, x2, c3, 12, a2[1]), x2 = u2(x2, O2, P2, T2, p2, 17, a2[2]), T2 = u2(T2, x2, O2, P2, f2, 22, a2[3]), P2 = u2(P2, T2, x2, O2, g2, 7, a2[4]), O2 = u2(O2, P2, T2, x2, m2, 12, a2[5]), x2 = u2(x2, O2, P2, T2, y2, 17, a2[6]), T2 = u2(T2, x2, O2, P2, _2, 22, a2[7]), P2 = u2(P2, T2, x2, O2, w2, 7, a2[8]), O2 = u2(O2, P2, T2, x2, v2, 12, a2[9]), x2 = u2(x2, O2, P2, T2, I2, 17, a2[10]), T2 = u2(T2, x2, O2, P2, S2, 22, a2[11]), P2 = u2(P2, T2, x2, O2, b2, 7, a2[12]), O2 = u2(O2, P2, T2, x2, k2, 12, a2[13]), x2 = u2(x2, O2, P2, T2, A2, 17, a2[14]), P2 = h2(P2, T2 = u2(T2, x2, O2, P2, C2, 22, a2[15]), x2, O2, c3, 5, a2[16]), O2 = h2(O2, P2, T2, x2, y2, 9, a2[17]), x2 = h2(x2, O2, P2, T2, S2, 14, a2[18]), T2 = h2(T2, x2, O2, P2, o3, 20, a2[19]), P2 = h2(P2, T2, x2, O2, m2, 5, a2[20]), O2 = h2(O2, P2, T2, x2, I2, 9, a2[21]), x2 = h2(x2, O2, P2, T2, C2, 14, a2[22]), T2 = h2(T2, x2, O2, P2, g2, 20, a2[23]), P2 = h2(P2, T2, x2, O2, v2, 5, a2[24]), O2 = h2(O2, P2, T2, x2, A2, 9, a2[25]), x2 = h2(x2, O2, P2, T2, f2, 14, a2[26]), T2 = h2(T2, x2, O2, P2, w2, 20, a2[27]), P2 = h2(P2, T2, x2, O2, k2, 5, a2[28]), O2 = h2(O2, P2, T2, x2, p2, 9, a2[29]), x2 = h2(x2, O2, P2, T2, _2, 14, a2[30]), P2 = l2(P2, T2 = h2(T2, x2, O2, P2, b2, 20, a2[31]), x2, O2, m2, 4, a2[32]), O2 = l2(O2, P2, T2, x2, w2, 11, a2[33]), x2 = l2(x2, O2, P2, T2, S2, 16, a2[34]), T2 = l2(T2, x2, O2, P2, A2, 23, a2[35]), P2 = l2(P2, T2, x2, O2, c3, 4, a2[36]), O2 = l2(O2, P2, T2, x2, g2, 11, a2[37]), x2 = l2(x2, O2, P2, T2, _2, 16, a2[38]), T2 = l2(T2, x2, O2, P2, I2, 23, a2[39]), P2 = l2(P2, T2, x2, O2, k2, 4, a2[40]), O2 = l2(O2, P2, T2, x2, o3, 11, a2[41]), x2 = l2(x2, O2, P2, T2, f2, 16, a2[42]), T2 = l2(T2, x2, O2, P2, y2, 23, a2[43]), P2 = l2(P2, T2, x2, O2, v2, 4, a2[44]), O2 = l2(O2, P2, T2, x2, b2, 11, a2[45]), x2 = l2(x2, O2, P2, T2, C2, 16, a2[46]), P2 = d2(P2, T2 = l2(T2, x2, O2, P2, p2, 23, a2[47]), x2, O2, o3, 6, a2[48]), O2 = d2(O2, P2, T2, x2, _2, 10, a2[49]), x2 = d2(x2, O2, P2, T2, A2, 15, a2[50]), T2 = d2(T2, x2, O2, P2, m2, 21, a2[51]), P2 = d2(P2, T2, x2, O2, b2, 6, a2[52]), O2 = d2(O2, P2, T2, x2, f2, 10, a2[53]), x2 = d2(x2, O2, P2, T2, I2, 15, a2[54]), T2 = d2(T2, x2, O2, P2, c3, 21, a2[55]), P2 = d2(P2, T2, x2, O2, w2, 6, a2[56]), O2 = d2(O2, P2, T2, x2, C2, 10, a2[57]), x2 = d2(x2, O2, P2, T2, y2, 15, a2[58]), T2 = d2(T2, x2, O2, P2, k2, 21, a2[59]), P2 = d2(P2, T2, x2, O2, g2, 6, a2[60]), O2 = d2(O2, P2, T2, x2, S2, 10, a2[61]), x2 = d2(x2, O2, P2, T2, p2, 15, a2[62]), T2 = d2(T2, x2, O2, P2, v2, 21, a2[63]), i3[0] = i3[0] + P2 | 0, i3[1] = i3[1] + T2 | 0, i3[2] = i3[2] + x2 | 0, i3[3] = i3[3] + O2 | 0;
  9883. }, _doFinalize: function() {
  9884. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  9885. n3[r3 >>> 5] |= 128 << 24 - r3 % 32;
  9886. var i3 = e3.floor(s3 / 4294967296), o3 = s3;
  9887. 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();
  9888. for (var a3 = this._hash, c3 = a3.words, u3 = 0; u3 < 4; u3++) {
  9889. var h3 = c3[u3];
  9890. c3[u3] = 16711935 & (h3 << 8 | h3 >>> 24) | 4278255360 & (h3 << 24 | h3 >>> 8);
  9891. }
  9892. return a3;
  9893. }, clone: function() {
  9894. var e4 = i2.clone.call(this);
  9895. return e4._hash = this._hash.clone(), e4;
  9896. } });
  9897. function u2(e4, t4, n3, s3, r3, i3, o3) {
  9898. var a3 = e4 + (t4 & n3 | ~t4 & s3) + r3 + o3;
  9899. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  9900. }
  9901. function h2(e4, t4, n3, s3, r3, i3, o3) {
  9902. var a3 = e4 + (t4 & s3 | n3 & ~s3) + r3 + o3;
  9903. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  9904. }
  9905. function l2(e4, t4, n3, s3, r3, i3, o3) {
  9906. var a3 = e4 + (t4 ^ n3 ^ s3) + r3 + o3;
  9907. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  9908. }
  9909. function d2(e4, t4, n3, s3, r3, i3, o3) {
  9910. var a3 = e4 + (n3 ^ (t4 | ~s3)) + r3 + o3;
  9911. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  9912. }
  9913. t3.MD5 = i2._createHelper(c2), t3.HmacMD5 = i2._createHmacHelper(c2);
  9914. }(Math), n2.MD5);
  9915. }), n(function(e2, t2) {
  9916. var n2;
  9917. e2.exports = (n2 = r, void function() {
  9918. var e3 = n2, t3 = e3.lib.Base, s2 = e3.enc.Utf8;
  9919. e3.algo.HMAC = t3.extend({ init: function(e4, t4) {
  9920. e4 = this._hasher = new e4.init(), "string" == typeof t4 && (t4 = s2.parse(t4));
  9921. var n3 = e4.blockSize, r2 = 4 * n3;
  9922. t4.sigBytes > r2 && (t4 = e4.finalize(t4)), t4.clamp();
  9923. for (var i2 = this._oKey = t4.clone(), o2 = this._iKey = t4.clone(), a2 = i2.words, c2 = o2.words, u2 = 0; u2 < n3; u2++)
  9924. a2[u2] ^= 1549556828, c2[u2] ^= 909522486;
  9925. i2.sigBytes = o2.sigBytes = r2, this.reset();
  9926. }, reset: function() {
  9927. var e4 = this._hasher;
  9928. e4.reset(), e4.update(this._iKey);
  9929. }, update: function(e4) {
  9930. return this._hasher.update(e4), this;
  9931. }, finalize: function(e4) {
  9932. var t4 = this._hasher, n3 = t4.finalize(e4);
  9933. return t4.reset(), t4.finalize(this._oKey.clone().concat(n3));
  9934. } });
  9935. }());
  9936. }), n(function(e2, t2) {
  9937. e2.exports = r.HmacMD5;
  9938. })), o = n(function(e2, t2) {
  9939. e2.exports = r.enc.Utf8;
  9940. }), a = n(function(e2, t2) {
  9941. var n2;
  9942. e2.exports = (n2 = r, function() {
  9943. var e3 = n2, t3 = e3.lib.WordArray;
  9944. function s2(e4, n3, s3) {
  9945. for (var r2 = [], i2 = 0, o2 = 0; o2 < n3; o2++)
  9946. if (o2 % 4) {
  9947. var a2 = s3[e4.charCodeAt(o2 - 1)] << o2 % 4 * 2, c2 = s3[e4.charCodeAt(o2)] >>> 6 - o2 % 4 * 2;
  9948. r2[i2 >>> 2] |= (a2 | c2) << 24 - i2 % 4 * 8, i2++;
  9949. }
  9950. return t3.create(r2, i2);
  9951. }
  9952. e3.enc.Base64 = { stringify: function(e4) {
  9953. var t4 = e4.words, n3 = e4.sigBytes, s3 = this._map;
  9954. e4.clamp();
  9955. for (var r2 = [], i2 = 0; i2 < n3; i2 += 3)
  9956. 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++)
  9957. r2.push(s3.charAt(o2 >>> 6 * (3 - a2) & 63));
  9958. var c2 = s3.charAt(64);
  9959. if (c2)
  9960. for (; r2.length % 4; )
  9961. r2.push(c2);
  9962. return r2.join("");
  9963. }, parse: function(e4) {
  9964. var t4 = e4.length, n3 = this._map, r2 = this._reverseMap;
  9965. if (!r2) {
  9966. r2 = this._reverseMap = [];
  9967. for (var i2 = 0; i2 < n3.length; i2++)
  9968. r2[n3.charCodeAt(i2)] = i2;
  9969. }
  9970. var o2 = n3.charAt(64);
  9971. if (o2) {
  9972. var a2 = e4.indexOf(o2);
  9973. -1 !== a2 && (t4 = a2);
  9974. }
  9975. return s2(e4, t4, r2);
  9976. }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
  9977. }(), n2.enc.Base64);
  9978. });
  9979. const c = "FUNCTION", u = "OBJECT", h = "CLIENT_DB", l = "pending", d = "fulfilled", p = "rejected";
  9980. function f(e2) {
  9981. return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase();
  9982. }
  9983. function g(e2) {
  9984. return "object" === f(e2);
  9985. }
  9986. function m(e2) {
  9987. return "function" == typeof e2;
  9988. }
  9989. function y(e2) {
  9990. return function() {
  9991. try {
  9992. return e2.apply(e2, arguments);
  9993. } catch (e3) {
  9994. console.error(e3);
  9995. }
  9996. };
  9997. }
  9998. const _ = "REJECTED", w = "NOT_PENDING";
  9999. class v {
  10000. constructor({ createPromise: e2, retryRule: t2 = _ } = {}) {
  10001. this.createPromise = e2, this.status = null, this.promise = null, this.retryRule = t2;
  10002. }
  10003. get needRetry() {
  10004. if (!this.status)
  10005. return true;
  10006. switch (this.retryRule) {
  10007. case _:
  10008. return this.status === p;
  10009. case w:
  10010. return this.status !== l;
  10011. }
  10012. }
  10013. exec() {
  10014. return this.needRetry ? (this.status = l, this.promise = this.createPromise().then((e2) => (this.status = d, Promise.resolve(e2)), (e2) => (this.status = p, Promise.reject(e2))), this.promise) : this.promise;
  10015. }
  10016. }
  10017. function I(e2) {
  10018. return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
  10019. }
  10020. const S = true, b = "app", A = I(define_process_env_UNI_SECURE_NETWORK_CONFIG_default), C = b, P = I(""), T = I("[]") || [];
  10021. let O = "";
  10022. try {
  10023. O = "__UNI__1619D0F";
  10024. } catch (e2) {
  10025. }
  10026. let E = {};
  10027. function L(e2, t2 = {}) {
  10028. var n2, s2;
  10029. return n2 = E, s2 = e2, Object.prototype.hasOwnProperty.call(n2, s2) || (E[e2] = t2), E[e2];
  10030. }
  10031. E = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {};
  10032. const R = ["invoke", "success", "fail", "complete"], U = L("_globalUniCloudInterceptor");
  10033. function N(e2, t2) {
  10034. U[e2] || (U[e2] = {}), g(t2) && Object.keys(t2).forEach((n2) => {
  10035. R.indexOf(n2) > -1 && function(e3, t3, n3) {
  10036. let s2 = U[e3][t3];
  10037. s2 || (s2 = U[e3][t3] = []), -1 === s2.indexOf(n3) && m(n3) && s2.push(n3);
  10038. }(e2, n2, t2[n2]);
  10039. });
  10040. }
  10041. function D(e2, t2) {
  10042. U[e2] || (U[e2] = {}), g(t2) ? Object.keys(t2).forEach((n2) => {
  10043. R.indexOf(n2) > -1 && function(e3, t3, n3) {
  10044. const s2 = U[e3][t3];
  10045. if (!s2)
  10046. return;
  10047. const r2 = s2.indexOf(n3);
  10048. r2 > -1 && s2.splice(r2, 1);
  10049. }(e2, n2, t2[n2]);
  10050. }) : delete U[e2];
  10051. }
  10052. function M(e2, t2) {
  10053. return e2 && 0 !== e2.length ? e2.reduce((e3, n2) => e3.then(() => n2(t2)), Promise.resolve()) : Promise.resolve();
  10054. }
  10055. function q(e2, t2) {
  10056. return U[e2] && U[e2][t2] || [];
  10057. }
  10058. function F(e2) {
  10059. N("callObject", e2);
  10060. }
  10061. const K = L("_globalUniCloudListener"), j = "response", $ = "needLogin", B = "refreshToken", W = "clientdb", H = "cloudfunction", z = "cloudobject";
  10062. function J(e2) {
  10063. return K[e2] || (K[e2] = []), K[e2];
  10064. }
  10065. function V(e2, t2) {
  10066. const n2 = J(e2);
  10067. n2.includes(t2) || n2.push(t2);
  10068. }
  10069. function G(e2, t2) {
  10070. const n2 = J(e2), s2 = n2.indexOf(t2);
  10071. -1 !== s2 && n2.splice(s2, 1);
  10072. }
  10073. function Y(e2, t2) {
  10074. const n2 = J(e2);
  10075. for (let e3 = 0; e3 < n2.length; e3++) {
  10076. (0, n2[e3])(t2);
  10077. }
  10078. }
  10079. let Q, X = false;
  10080. function Z() {
  10081. return Q || (Q = new Promise((e2) => {
  10082. X && e2(), function t2() {
  10083. if ("function" == typeof getCurrentPages) {
  10084. const t3 = getCurrentPages();
  10085. t3 && t3[0] && (X = true, e2());
  10086. }
  10087. X || setTimeout(() => {
  10088. t2();
  10089. }, 30);
  10090. }();
  10091. }), Q);
  10092. }
  10093. function ee(e2) {
  10094. const t2 = {};
  10095. for (const n2 in e2) {
  10096. const s2 = e2[n2];
  10097. m(s2) && (t2[n2] = y(s2));
  10098. }
  10099. return t2;
  10100. }
  10101. class te extends Error {
  10102. constructor(e2) {
  10103. 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;
  10104. }
  10105. toJson(e2 = 0) {
  10106. if (!(e2 >= 10))
  10107. return e2++, { errCode: this.errCode, errMsg: this.errMsg, errSubject: this.errSubject, cause: this.cause && this.cause.toJson ? this.cause.toJson(e2) : this.cause };
  10108. }
  10109. }
  10110. 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) };
  10111. function se(e2) {
  10112. return e2 && se(e2.__v_raw) || e2;
  10113. }
  10114. function re() {
  10115. return { token: ne.getStorageSync("uni_id_token") || ne.getStorageSync("uniIdToken"), tokenExpired: ne.getStorageSync("uni_id_token_expired") };
  10116. }
  10117. function ie({ token: e2, tokenExpired: t2 } = {}) {
  10118. e2 && ne.setStorageSync("uni_id_token", e2), t2 && ne.setStorageSync("uni_id_token_expired", t2);
  10119. }
  10120. let oe, ae;
  10121. function ce() {
  10122. return oe || (oe = uni.getSystemInfoSync()), oe;
  10123. }
  10124. function ue() {
  10125. let e2, t2;
  10126. try {
  10127. if (uni.getLaunchOptionsSync) {
  10128. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1)
  10129. return;
  10130. const { scene: n2, channel: s2 } = uni.getLaunchOptionsSync();
  10131. e2 = s2, t2 = n2;
  10132. }
  10133. } catch (e3) {
  10134. }
  10135. return { channel: e2, scene: t2 };
  10136. }
  10137. let he = {};
  10138. function le() {
  10139. const e2 = uni.getLocale && uni.getLocale() || "en";
  10140. if (ae)
  10141. return { ...he, ...ae, locale: e2, LOCALE: e2 };
  10142. 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"];
  10143. for (const e3 in t2)
  10144. Object.hasOwnProperty.call(t2, e3) && -1 === o2.indexOf(e3) && delete t2[e3];
  10145. return ae = { PLATFORM: r2, OS: s2, APPID: i2, DEVICEID: n2, ...ue(), ...t2 }, { ...he, ...ae, locale: e2, LOCALE: e2 };
  10146. }
  10147. var de = { sign: function(e2, t2) {
  10148. let n2 = "";
  10149. return Object.keys(e2).sort().forEach(function(t3) {
  10150. e2[t3] && (n2 = n2 + "&" + t3 + "=" + e2[t3]);
  10151. }), n2 = n2.slice(1), i(n2, t2).toString();
  10152. }, wrappedRequest: function(e2, t2) {
  10153. return new Promise((n2, s2) => {
  10154. t2(Object.assign(e2, { complete(e3) {
  10155. e3 || (e3 = {});
  10156. const t3 = e3.data && e3.data.header && e3.data.header["x-serverless-request-id"] || e3.header && e3.header["request-id"];
  10157. if (!e3.statusCode || e3.statusCode >= 400) {
  10158. 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";
  10159. return s2(new te({ code: n3, message: r3, requestId: t3 }));
  10160. }
  10161. const r2 = e3.data;
  10162. if (r2.error)
  10163. return s2(new te({ code: r2.error.code, message: r2.error.message, requestId: t3 }));
  10164. r2.result = r2.data, r2.requestId = t3, delete r2.data, n2(r2);
  10165. } }));
  10166. });
  10167. }, toBase64: function(e2) {
  10168. return a.stringify(o.parse(e2));
  10169. } };
  10170. var pe = class {
  10171. constructor(e2) {
  10172. ["spaceId", "clientSecret"].forEach((t2) => {
  10173. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  10174. throw new Error(`${t2} required`);
  10175. }), 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 v({ createPromise: () => this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then((e3) => {
  10176. if (!e3.result || !e3.result.accessToken)
  10177. throw new te({ code: "AUTH_FAILED", message: "获取accessToken失败" });
  10178. this.setAccessToken(e3.result.accessToken);
  10179. }), retryRule: w });
  10180. }
  10181. get hasAccessToken() {
  10182. return !!this.accessToken;
  10183. }
  10184. setAccessToken(e2) {
  10185. this.accessToken = e2;
  10186. }
  10187. requestWrapped(e2) {
  10188. return de.wrappedRequest(e2, this.adapter.request);
  10189. }
  10190. requestAuth(e2) {
  10191. return this.requestWrapped(e2);
  10192. }
  10193. request(e2, t2) {
  10194. return Promise.resolve().then(() => this.hasAccessToken ? t2 ? this.requestWrapped(e2) : this.requestWrapped(e2).catch((t3) => new Promise((e3, n2) => {
  10195. !t3 || "GATEWAY_INVALID_TOKEN" !== t3.code && "InvalidParameter.InvalidToken" !== t3.code ? n2(t3) : e3();
  10196. }).then(() => this.getAccessToken()).then(() => {
  10197. const t4 = this.rebuildRequest(e2);
  10198. return this.request(t4, true);
  10199. })) : this.getAccessToken().then(() => {
  10200. const t3 = this.rebuildRequest(e2);
  10201. return this.request(t3, true);
  10202. }));
  10203. }
  10204. rebuildRequest(e2) {
  10205. const t2 = Object.assign({}, e2);
  10206. 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;
  10207. }
  10208. setupRequest(e2, t2) {
  10209. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  10210. 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 };
  10211. }
  10212. getAccessToken() {
  10213. return this._getAccessTokenPromiseHub.exec();
  10214. }
  10215. async authorize() {
  10216. await this.getAccessToken();
  10217. }
  10218. callFunction(e2) {
  10219. const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
  10220. return this.request(this.setupRequest(t2));
  10221. }
  10222. getOSSUploadOptionsFromPath(e2) {
  10223. const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
  10224. return this.request(this.setupRequest(t2));
  10225. }
  10226. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  10227. return new Promise((o2, a2) => {
  10228. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, header: { "X-OSS-server-side-encrpytion": "AES256" }, success(e3) {
  10229. e3 && e3.statusCode < 400 ? o2(e3) : a2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  10230. }, fail(e3) {
  10231. a2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  10232. } });
  10233. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  10234. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  10235. });
  10236. });
  10237. }
  10238. reportOSSUpload(e2) {
  10239. const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
  10240. return this.request(this.setupRequest(t2));
  10241. }
  10242. async uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", cloudPathAsRealPath: s2 = false, onUploadProgress: r2, config: i2 }) {
  10243. if ("string" !== f(t2))
  10244. throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  10245. if (!(t2 = t2.trim()))
  10246. throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  10247. if (/:\/\//.test(t2))
  10248. throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  10249. const o2 = i2 && i2.envType || this.config.envType;
  10250. if (s2 && ("/" !== t2[0] && (t2 = "/" + t2), t2.indexOf("\\") > -1))
  10251. throw new te({ code: "INVALID_PARAM", message: "使用cloudPath作为路径时,cloudPath不可包含“\\”" });
  10252. 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: g2, policy: m2, ossCallbackUrl: y2 } = a2, _2 = { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: h2, Signature: l2, host: d2, id: g2, key: p2, policy: m2, success_action_status: 200 };
  10253. if (u2 && (_2["x-oss-security-token"] = u2), y2) {
  10254. const e3 = JSON.stringify({ callbackUrl: y2, callbackBody: JSON.stringify({ fileId: g2, spaceId: this.config.spaceId }), callbackBodyType: "application/json" });
  10255. _2.callback = de.toBase64(e3);
  10256. }
  10257. const w2 = { url: "https://" + a2.host, formData: _2, fileName: "file", name: "file", filePath: e2, fileType: n2 };
  10258. if (await this.uploadFileToOSS(Object.assign({}, w2, { onUploadProgress: r2 })), y2)
  10259. return { success: true, filePath: e2, fileID: c2 };
  10260. if ((await this.reportOSSUpload({ id: g2 })).success)
  10261. return { success: true, filePath: e2, fileID: c2 };
  10262. throw new te({ code: "UPLOAD_FAILED", message: "文件上传失败" });
  10263. }
  10264. getTempFileURL({ fileList: e2 } = {}) {
  10265. return new Promise((t2, n2) => {
  10266. Array.isArray(e2) && 0 !== e2.length || n2(new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t2({ fileList: e2.map((e3) => ({ fileID: e3, tempFileURL: e3 })) });
  10267. });
  10268. }
  10269. async getFileInfo({ fileList: e2 } = {}) {
  10270. if (!Array.isArray(e2) || 0 === e2.length)
  10271. throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  10272. const t2 = { method: "serverless.file.resource.info", params: JSON.stringify({ id: e2.map((e3) => e3.split("?")[0]).join(",") }) };
  10273. return { fileList: (await this.request(this.setupRequest(t2))).result };
  10274. }
  10275. };
  10276. var fe = { init(e2) {
  10277. const t2 = new pe(e2), n2 = { signInAnonymously: function() {
  10278. return t2.authorize();
  10279. }, getLoginState: function() {
  10280. return Promise.resolve(false);
  10281. } };
  10282. return t2.auth = function() {
  10283. return n2;
  10284. }, t2.customAuth = t2.auth, t2;
  10285. } };
  10286. const ge = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  10287. var me;
  10288. !function(e2) {
  10289. e2.local = "local", e2.none = "none", e2.session = "session";
  10290. }(me || (me = {}));
  10291. var ye = function() {
  10292. }, _e = n(function(e2, t2) {
  10293. var n2;
  10294. e2.exports = (n2 = r, function(e3) {
  10295. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [], c2 = [];
  10296. !function() {
  10297. function t4(t5) {
  10298. for (var n4 = e3.sqrt(t5), s4 = 2; s4 <= n4; s4++)
  10299. if (!(t5 % s4))
  10300. return false;
  10301. return true;
  10302. }
  10303. function n3(e4) {
  10304. return 4294967296 * (e4 - (0 | e4)) | 0;
  10305. }
  10306. for (var s3 = 2, r3 = 0; r3 < 64; )
  10307. t4(s3) && (r3 < 8 && (a2[r3] = n3(e3.pow(s3, 0.5))), c2[r3] = n3(e3.pow(s3, 1 / 3)), r3++), s3++;
  10308. }();
  10309. var u2 = [], h2 = o2.SHA256 = i2.extend({ _doReset: function() {
  10310. this._hash = new r2.init(a2.slice(0));
  10311. }, _doProcessBlock: function(e4, t4) {
  10312. 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++) {
  10313. if (p2 < 16)
  10314. u2[p2] = 0 | e4[t4 + p2];
  10315. else {
  10316. 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;
  10317. u2[p2] = g2 + u2[p2 - 7] + y2 + u2[p2 - 16];
  10318. }
  10319. 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];
  10320. d2 = l2, l2 = h3, h3 = a3, a3 = o3 + v2 | 0, o3 = i3, i3 = r3, r3 = s3, s3 = v2 + (w2 + _2) | 0;
  10321. }
  10322. 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;
  10323. }, _doFinalize: function() {
  10324. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  10325. 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;
  10326. }, clone: function() {
  10327. var e4 = i2.clone.call(this);
  10328. return e4._hash = this._hash.clone(), e4;
  10329. } });
  10330. t3.SHA256 = i2._createHelper(h2), t3.HmacSHA256 = i2._createHmacHelper(h2);
  10331. }(Math), n2.SHA256);
  10332. }), we = _e, ve = n(function(e2, t2) {
  10333. e2.exports = r.HmacSHA256;
  10334. });
  10335. const Ie = () => {
  10336. let e2;
  10337. if (!Promise) {
  10338. e2 = () => {
  10339. }, e2.promise = {};
  10340. const t3 = () => {
  10341. throw new te({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });
  10342. };
  10343. return Object.defineProperty(e2.promise, "then", { get: t3 }), Object.defineProperty(e2.promise, "catch", { get: t3 }), e2;
  10344. }
  10345. const t2 = new Promise((t3, n2) => {
  10346. e2 = (e3, s2) => e3 ? n2(e3) : t3(s2);
  10347. });
  10348. return e2.promise = t2, e2;
  10349. };
  10350. function Se(e2) {
  10351. return void 0 === e2;
  10352. }
  10353. function be(e2) {
  10354. return "[object Null]" === Object.prototype.toString.call(e2);
  10355. }
  10356. var ke;
  10357. function Ae(e2) {
  10358. const t2 = (n2 = e2, "[object Array]" === Object.prototype.toString.call(n2) ? e2 : [e2]);
  10359. var n2;
  10360. for (const e3 of t2) {
  10361. const { isMatch: t3, genAdapter: n3, runtime: s2 } = e3;
  10362. if (t3())
  10363. return { adapter: n3(), runtime: s2 };
  10364. }
  10365. }
  10366. !function(e2) {
  10367. e2.WEB = "web", e2.WX_MP = "wx_mp";
  10368. }(ke || (ke = {}));
  10369. const Ce = { adapter: null, runtime: void 0 }, Pe = ["anonymousUuidKey"];
  10370. class Te extends ye {
  10371. constructor() {
  10372. super(), Ce.adapter.root.tcbObject || (Ce.adapter.root.tcbObject = {});
  10373. }
  10374. setItem(e2, t2) {
  10375. Ce.adapter.root.tcbObject[e2] = t2;
  10376. }
  10377. getItem(e2) {
  10378. return Ce.adapter.root.tcbObject[e2];
  10379. }
  10380. removeItem(e2) {
  10381. delete Ce.adapter.root.tcbObject[e2];
  10382. }
  10383. clear() {
  10384. delete Ce.adapter.root.tcbObject;
  10385. }
  10386. }
  10387. function xe(e2, t2) {
  10388. switch (e2) {
  10389. case "local":
  10390. return t2.localStorage || new Te();
  10391. case "none":
  10392. return new Te();
  10393. default:
  10394. return t2.sessionStorage || new Te();
  10395. }
  10396. }
  10397. class Oe {
  10398. constructor(e2) {
  10399. if (!this._storage) {
  10400. this._persistence = Ce.adapter.primaryStorage || e2.persistence, this._storage = xe(this._persistence, Ce.adapter);
  10401. const t2 = `access_token_${e2.env}`, n2 = `access_token_expire_${e2.env}`, s2 = `refresh_token_${e2.env}`, r2 = `anonymous_uuid_${e2.env}`, i2 = `login_type_${e2.env}`, o2 = `user_info_${e2.env}`;
  10402. this.keys = { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2, anonymousUuidKey: r2, loginTypeKey: i2, userInfoKey: o2 };
  10403. }
  10404. }
  10405. updatePersistence(e2) {
  10406. if (e2 === this._persistence)
  10407. return;
  10408. const t2 = "local" === this._persistence;
  10409. this._persistence = e2;
  10410. const n2 = xe(e2, Ce.adapter);
  10411. for (const e3 in this.keys) {
  10412. const s2 = this.keys[e3];
  10413. if (t2 && Pe.includes(e3))
  10414. continue;
  10415. const r2 = this._storage.getItem(s2);
  10416. Se(r2) || be(r2) || (n2.setItem(s2, r2), this._storage.removeItem(s2));
  10417. }
  10418. this._storage = n2;
  10419. }
  10420. setStore(e2, t2, n2) {
  10421. if (!this._storage)
  10422. return;
  10423. const s2 = { version: n2 || "localCachev1", content: t2 }, r2 = JSON.stringify(s2);
  10424. try {
  10425. this._storage.setItem(e2, r2);
  10426. } catch (e3) {
  10427. throw e3;
  10428. }
  10429. }
  10430. getStore(e2, t2) {
  10431. try {
  10432. if (!this._storage)
  10433. return;
  10434. } catch (e3) {
  10435. return "";
  10436. }
  10437. t2 = t2 || "localCachev1";
  10438. const n2 = this._storage.getItem(e2);
  10439. if (!n2)
  10440. return "";
  10441. if (n2.indexOf(t2) >= 0) {
  10442. return JSON.parse(n2).content;
  10443. }
  10444. return "";
  10445. }
  10446. removeStore(e2) {
  10447. this._storage.removeItem(e2);
  10448. }
  10449. }
  10450. const Ee = {}, Le = {};
  10451. function Re(e2) {
  10452. return Ee[e2];
  10453. }
  10454. class Ue {
  10455. constructor(e2, t2) {
  10456. this.data = t2 || null, this.name = e2;
  10457. }
  10458. }
  10459. class Ne extends Ue {
  10460. constructor(e2, t2) {
  10461. super("error", { error: e2, data: t2 }), this.error = e2;
  10462. }
  10463. }
  10464. const De = new class {
  10465. constructor() {
  10466. this._listeners = {};
  10467. }
  10468. on(e2, t2) {
  10469. return function(e3, t3, n2) {
  10470. n2[e3] = n2[e3] || [], n2[e3].push(t3);
  10471. }(e2, t2, this._listeners), this;
  10472. }
  10473. off(e2, t2) {
  10474. return function(e3, t3, n2) {
  10475. if (n2 && n2[e3]) {
  10476. const s2 = n2[e3].indexOf(t3);
  10477. -1 !== s2 && n2[e3].splice(s2, 1);
  10478. }
  10479. }(e2, t2, this._listeners), this;
  10480. }
  10481. fire(e2, t2) {
  10482. if (e2 instanceof Ne)
  10483. return console.error(e2.error), this;
  10484. const n2 = "string" == typeof e2 ? new Ue(e2, t2 || {}) : e2;
  10485. const s2 = n2.name;
  10486. if (this._listens(s2)) {
  10487. n2.target = this;
  10488. const e3 = this._listeners[s2] ? [...this._listeners[s2]] : [];
  10489. for (const t3 of e3)
  10490. t3.call(this, n2);
  10491. }
  10492. return this;
  10493. }
  10494. _listens(e2) {
  10495. return this._listeners[e2] && this._listeners[e2].length > 0;
  10496. }
  10497. }();
  10498. function Me(e2, t2) {
  10499. De.on(e2, t2);
  10500. }
  10501. function qe(e2, t2 = {}) {
  10502. De.fire(e2, t2);
  10503. }
  10504. function Fe(e2, t2) {
  10505. De.off(e2, t2);
  10506. }
  10507. const Ke = "loginStateChanged", je = "loginStateExpire", $e = "loginTypeChanged", Be = "anonymousConverted", We = "refreshAccessToken";
  10508. var He;
  10509. !function(e2) {
  10510. 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";
  10511. }(He || (He = {}));
  10512. const ze = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"], Je = { "X-SDK-Version": "1.3.5" };
  10513. function Ve(e2, t2, n2) {
  10514. const s2 = e2[t2];
  10515. e2[t2] = function(t3) {
  10516. const r2 = {}, i2 = {};
  10517. n2.forEach((n3) => {
  10518. const { data: s3, headers: o3 } = n3.call(e2, t3);
  10519. Object.assign(r2, s3), Object.assign(i2, o3);
  10520. });
  10521. const o2 = t3.data;
  10522. return o2 && (() => {
  10523. var e3;
  10524. if (e3 = o2, "[object FormData]" !== Object.prototype.toString.call(e3))
  10525. t3.data = { ...o2, ...r2 };
  10526. else
  10527. for (const e4 in r2)
  10528. o2.append(e4, r2[e4]);
  10529. })(), t3.headers = { ...t3.headers || {}, ...i2 }, s2.call(e2, t3);
  10530. };
  10531. }
  10532. function Ge() {
  10533. const e2 = Math.random().toString(16).slice(2);
  10534. return { data: { seqId: e2 }, headers: { ...Je, "x-seqid": e2 } };
  10535. }
  10536. class Ye {
  10537. constructor(e2 = {}) {
  10538. var t2;
  10539. this.config = e2, this._reqClass = new Ce.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: `请求在${this.config.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] }), this._cache = Re(this.config.env), this._localCache = (t2 = this.config.env, Le[t2]), Ve(this._reqClass, "post", [Ge]), Ve(this._reqClass, "upload", [Ge]), Ve(this._reqClass, "download", [Ge]);
  10540. }
  10541. async post(e2) {
  10542. return await this._reqClass.post(e2);
  10543. }
  10544. async upload(e2) {
  10545. return await this._reqClass.upload(e2);
  10546. }
  10547. async download(e2) {
  10548. return await this._reqClass.download(e2);
  10549. }
  10550. async refreshAccessToken() {
  10551. let e2, t2;
  10552. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  10553. try {
  10554. e2 = await this._refreshAccessTokenPromise;
  10555. } catch (e3) {
  10556. t2 = e3;
  10557. }
  10558. if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t2)
  10559. throw t2;
  10560. return e2;
  10561. }
  10562. async _refreshAccessToken() {
  10563. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2, loginTypeKey: s2, anonymousUuidKey: r2 } = this._cache.keys;
  10564. this._cache.removeStore(e2), this._cache.removeStore(t2);
  10565. let i2 = this._cache.getStore(n2);
  10566. if (!i2)
  10567. throw new te({ message: "未登录CloudBase" });
  10568. const o2 = { refresh_token: i2 }, a2 = await this.request("auth.fetchAccessTokenWithRefreshToken", o2);
  10569. if (a2.data.code) {
  10570. const { code: e3 } = a2.data;
  10571. if ("SIGN_PARAM_INVALID" === e3 || "REFRESH_TOKEN_EXPIRED" === e3 || "INVALID_REFRESH_TOKEN" === e3) {
  10572. if (this._cache.getStore(s2) === He.ANONYMOUS && "INVALID_REFRESH_TOKEN" === e3) {
  10573. const e4 = this._cache.getStore(r2), t3 = this._cache.getStore(n2), s3 = await this.send("auth.signInAnonymously", { anonymous_uuid: e4, refresh_token: t3 });
  10574. return this.setRefreshToken(s3.refresh_token), this._refreshAccessToken();
  10575. }
  10576. qe(je), this._cache.removeStore(n2);
  10577. }
  10578. throw new te({ code: a2.data.code, message: `刷新access token失败:${a2.data.code}` });
  10579. }
  10580. if (a2.data.access_token)
  10581. return qe(We), 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 };
  10582. a2.data.refresh_token && (this._cache.removeStore(n2), this._cache.setStore(n2, a2.data.refresh_token), this._refreshAccessToken());
  10583. }
  10584. async getAccessToken() {
  10585. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2 } = this._cache.keys;
  10586. if (!this._cache.getStore(n2))
  10587. throw new te({ message: "refresh token不存在,登录状态异常" });
  10588. let s2 = this._cache.getStore(e2), r2 = this._cache.getStore(t2), i2 = true;
  10589. return this._shouldRefreshAccessTokenHook && !await this._shouldRefreshAccessTokenHook(s2, r2) && (i2 = false), (!s2 || !r2 || r2 < Date.now()) && i2 ? this.refreshAccessToken() : { accessToken: s2, accessTokenExpire: r2 };
  10590. }
  10591. async request(e2, t2, n2) {
  10592. const s2 = `x-tcb-trace_${this.config.env}`;
  10593. let r2 = "application/x-www-form-urlencoded";
  10594. const i2 = { action: e2, env: this.config.env, dataVersion: "2019-08-16", ...t2 };
  10595. if (-1 === ze.indexOf(e2)) {
  10596. const { refreshTokenKey: e3 } = this._cache.keys;
  10597. this._cache.getStore(e3) && (i2.access_token = (await this.getAccessToken()).accessToken);
  10598. }
  10599. let o2;
  10600. if ("storage.uploadFile" === e2) {
  10601. o2 = new FormData();
  10602. for (let e3 in o2)
  10603. o2.hasOwnProperty(e3) && void 0 !== o2[e3] && o2.append(e3, i2[e3]);
  10604. r2 = "multipart/form-data";
  10605. } else {
  10606. r2 = "application/json", o2 = {};
  10607. for (let e3 in i2)
  10608. void 0 !== i2[e3] && (o2[e3] = i2[e3]);
  10609. }
  10610. let a2 = { headers: { "content-type": r2 } };
  10611. n2 && n2.onUploadProgress && (a2.onUploadProgress = n2.onUploadProgress);
  10612. const c2 = this._localCache.getStore(s2);
  10613. c2 && (a2.headers["X-TCB-Trace"] = c2);
  10614. const { parse: u2, inQuery: h2, search: l2 } = t2;
  10615. let d2 = { env: this.config.env };
  10616. u2 && (d2.parse = true), h2 && (d2 = { ...h2, ...d2 });
  10617. let p2 = function(e3, t3, n3 = {}) {
  10618. const s3 = /\?/.test(t3);
  10619. let r3 = "";
  10620. for (let e4 in n3)
  10621. "" === r3 ? !s3 && (t3 += "?") : r3 += "&", r3 += `${e4}=${encodeURIComponent(n3[e4])}`;
  10622. return /^http(s)?\:\/\//.test(t3 += r3) ? t3 : `${e3}${t3}`;
  10623. }(ge, "//tcb-api.tencentcloudapi.com/web", d2);
  10624. l2 && (p2 += l2);
  10625. const f2 = await this.post({ url: p2, data: o2, ...a2 }), g2 = f2.header && f2.header["x-tcb-trace"];
  10626. if (g2 && this._localCache.setStore(s2, g2), 200 !== Number(f2.status) && 200 !== Number(f2.statusCode) || !f2.data)
  10627. throw new te({ code: "NETWORK_ERROR", message: "network request error" });
  10628. return f2;
  10629. }
  10630. async send(e2, t2 = {}) {
  10631. const n2 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
  10632. if ("ACCESS_TOKEN_EXPIRED" === n2.data.code && -1 === ze.indexOf(e2)) {
  10633. await this.refreshAccessToken();
  10634. const n3 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
  10635. if (n3.data.code)
  10636. throw new te({ code: n3.data.code, message: n3.data.message });
  10637. return n3.data;
  10638. }
  10639. if (n2.data.code)
  10640. throw new te({ code: n2.data.code, message: n2.data.message });
  10641. return n2.data;
  10642. }
  10643. setRefreshToken(e2) {
  10644. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  10645. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  10646. }
  10647. }
  10648. const Qe = {};
  10649. function Xe(e2) {
  10650. return Qe[e2];
  10651. }
  10652. class Ze {
  10653. constructor(e2) {
  10654. this.config = e2, this._cache = Re(e2.env), this._request = Xe(e2.env);
  10655. }
  10656. setRefreshToken(e2) {
  10657. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  10658. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  10659. }
  10660. setAccessToken(e2, t2) {
  10661. const { accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys;
  10662. this._cache.setStore(n2, e2), this._cache.setStore(s2, t2);
  10663. }
  10664. async refreshUserInfo() {
  10665. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  10666. return this.setLocalUserInfo(e2), e2;
  10667. }
  10668. setLocalUserInfo(e2) {
  10669. const { userInfoKey: t2 } = this._cache.keys;
  10670. this._cache.setStore(t2, e2);
  10671. }
  10672. }
  10673. class et {
  10674. constructor(e2) {
  10675. if (!e2)
  10676. throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
  10677. this._envId = e2, this._cache = Re(this._envId), this._request = Xe(this._envId), this.setUserInfo();
  10678. }
  10679. linkWithTicket(e2) {
  10680. if ("string" != typeof e2)
  10681. throw new te({ code: "PARAM_ERROR", message: "ticket must be string" });
  10682. return this._request.send("auth.linkWithTicket", { ticket: e2 });
  10683. }
  10684. linkWithRedirect(e2) {
  10685. e2.signInWithRedirect();
  10686. }
  10687. updatePassword(e2, t2) {
  10688. return this._request.send("auth.updatePassword", { oldPassword: t2, newPassword: e2 });
  10689. }
  10690. updateEmail(e2) {
  10691. return this._request.send("auth.updateEmail", { newEmail: e2 });
  10692. }
  10693. updateUsername(e2) {
  10694. if ("string" != typeof e2)
  10695. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  10696. return this._request.send("auth.updateUsername", { username: e2 });
  10697. }
  10698. async getLinkedUidList() {
  10699. const { data: e2 } = await this._request.send("auth.getLinkedUidList", {});
  10700. let t2 = false;
  10701. const { users: n2 } = e2;
  10702. return n2.forEach((e3) => {
  10703. e3.wxOpenId && e3.wxPublicId && (t2 = true);
  10704. }), { users: n2, hasPrimaryUid: t2 };
  10705. }
  10706. setPrimaryUid(e2) {
  10707. return this._request.send("auth.setPrimaryUid", { uid: e2 });
  10708. }
  10709. unlink(e2) {
  10710. return this._request.send("auth.unlink", { platform: e2 });
  10711. }
  10712. async update(e2) {
  10713. 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 });
  10714. this.setLocalUserInfo(a2);
  10715. }
  10716. async refresh() {
  10717. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  10718. return this.setLocalUserInfo(e2), e2;
  10719. }
  10720. setUserInfo() {
  10721. const { userInfoKey: e2 } = this._cache.keys, t2 = this._cache.getStore(e2);
  10722. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach((e3) => {
  10723. this[e3] = t2[e3];
  10724. }), this.location = { country: t2.country, province: t2.province, city: t2.city };
  10725. }
  10726. setLocalUserInfo(e2) {
  10727. const { userInfoKey: t2 } = this._cache.keys;
  10728. this._cache.setStore(t2, e2), this.setUserInfo();
  10729. }
  10730. }
  10731. class tt {
  10732. constructor(e2) {
  10733. if (!e2)
  10734. throw new te({ code: "PARAM_ERROR", message: "envId is not defined" });
  10735. this._cache = Re(e2);
  10736. 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);
  10737. this.credential = { refreshToken: r2, accessToken: i2, accessTokenExpire: o2 }, this.user = new et(e2);
  10738. }
  10739. get isAnonymousAuth() {
  10740. return this.loginType === He.ANONYMOUS;
  10741. }
  10742. get isCustomAuth() {
  10743. return this.loginType === He.CUSTOM;
  10744. }
  10745. get isWeixinAuth() {
  10746. return this.loginType === He.WECHAT || this.loginType === He.WECHAT_OPEN || this.loginType === He.WECHAT_PUBLIC;
  10747. }
  10748. get loginType() {
  10749. return this._cache.getStore(this._cache.keys.loginTypeKey);
  10750. }
  10751. }
  10752. class nt extends Ze {
  10753. async signIn() {
  10754. this._cache.updatePersistence("local");
  10755. const { anonymousUuidKey: e2, refreshTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2) || void 0, s2 = this._cache.getStore(t2) || void 0, r2 = await this._request.send("auth.signInAnonymously", { anonymous_uuid: n2, refresh_token: s2 });
  10756. if (r2.uuid && r2.refresh_token) {
  10757. this._setAnonymousUUID(r2.uuid), this.setRefreshToken(r2.refresh_token), await this._request.refreshAccessToken(), qe(Ke), qe($e, { env: this.config.env, loginType: He.ANONYMOUS, persistence: "local" });
  10758. const e3 = new tt(this.config.env);
  10759. return await e3.user.refresh(), e3;
  10760. }
  10761. throw new te({ message: "匿名登录失败" });
  10762. }
  10763. async linkAndRetrieveDataWithTicket(e2) {
  10764. 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 });
  10765. if (i2.refresh_token)
  10766. return this._clearAnonymousUUID(), this.setRefreshToken(i2.refresh_token), await this._request.refreshAccessToken(), qe(Be, { env: this.config.env }), qe($e, { loginType: He.CUSTOM, persistence: "local" }), { credential: { refreshToken: i2.refresh_token } };
  10767. throw new te({ message: "匿名转化失败" });
  10768. }
  10769. _setAnonymousUUID(e2) {
  10770. const { anonymousUuidKey: t2, loginTypeKey: n2 } = this._cache.keys;
  10771. this._cache.removeStore(t2), this._cache.setStore(t2, e2), this._cache.setStore(n2, He.ANONYMOUS);
  10772. }
  10773. _clearAnonymousUUID() {
  10774. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  10775. }
  10776. }
  10777. class st extends Ze {
  10778. async signIn(e2) {
  10779. if ("string" != typeof e2)
  10780. throw new te({ code: "PARAM_ERROR", message: "ticket must be a string" });
  10781. const { refreshTokenKey: t2 } = this._cache.keys, n2 = await this._request.send("auth.signInWithTicket", { ticket: e2, refresh_token: this._cache.getStore(t2) || "" });
  10782. if (n2.refresh_token)
  10783. return this.setRefreshToken(n2.refresh_token), await this._request.refreshAccessToken(), qe(Ke), qe($e, { env: this.config.env, loginType: He.CUSTOM, persistence: this.config.persistence }), await this.refreshUserInfo(), new tt(this.config.env);
  10784. throw new te({ message: "自定义登录失败" });
  10785. }
  10786. }
  10787. class rt extends Ze {
  10788. async signIn(e2, t2) {
  10789. if ("string" != typeof e2)
  10790. throw new te({ code: "PARAM_ERROR", message: "email must be a string" });
  10791. 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;
  10792. if (r2)
  10793. return this.setRefreshToken(r2), i2 && o2 ? this.setAccessToken(i2, o2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), qe(Ke), qe($e, { env: this.config.env, loginType: He.EMAIL, persistence: this.config.persistence }), new tt(this.config.env);
  10794. throw s2.code ? new te({ code: s2.code, message: `邮箱登录失败: ${s2.message}` }) : new te({ message: "邮箱登录失败" });
  10795. }
  10796. async activate(e2) {
  10797. return this._request.send("auth.activateEndUserMail", { token: e2 });
  10798. }
  10799. async resetPasswordWithToken(e2, t2) {
  10800. return this._request.send("auth.resetPasswordWithToken", { token: e2, newPassword: t2 });
  10801. }
  10802. }
  10803. class it extends Ze {
  10804. async signIn(e2, t2) {
  10805. if ("string" != typeof e2)
  10806. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  10807. "string" != typeof t2 && (t2 = "", console.warn("password is empty"));
  10808. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: He.USERNAME, username: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token_expire: i2, access_token: o2 } = s2;
  10809. if (r2)
  10810. return this.setRefreshToken(r2), o2 && i2 ? this.setAccessToken(o2, i2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), qe(Ke), qe($e, { env: this.config.env, loginType: He.USERNAME, persistence: this.config.persistence }), new tt(this.config.env);
  10811. throw s2.code ? new te({ code: s2.code, message: `用户名密码登录失败: ${s2.message}` }) : new te({ message: "用户名密码登录失败" });
  10812. }
  10813. }
  10814. class ot {
  10815. constructor(e2) {
  10816. this.config = e2, this._cache = Re(e2.env), this._request = Xe(e2.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Me($e, this._onLoginTypeChanged);
  10817. }
  10818. get currentUser() {
  10819. const e2 = this.hasLoginState();
  10820. return e2 && e2.user || null;
  10821. }
  10822. get loginType() {
  10823. return this._cache.getStore(this._cache.keys.loginTypeKey);
  10824. }
  10825. anonymousAuthProvider() {
  10826. return new nt(this.config);
  10827. }
  10828. customAuthProvider() {
  10829. return new st(this.config);
  10830. }
  10831. emailAuthProvider() {
  10832. return new rt(this.config);
  10833. }
  10834. usernameAuthProvider() {
  10835. return new it(this.config);
  10836. }
  10837. async signInAnonymously() {
  10838. return new nt(this.config).signIn();
  10839. }
  10840. async signInWithEmailAndPassword(e2, t2) {
  10841. return new rt(this.config).signIn(e2, t2);
  10842. }
  10843. signInWithUsernameAndPassword(e2, t2) {
  10844. return new it(this.config).signIn(e2, t2);
  10845. }
  10846. async linkAndRetrieveDataWithTicket(e2) {
  10847. this._anonymousAuthProvider || (this._anonymousAuthProvider = new nt(this.config)), Me(Be, this._onAnonymousConverted);
  10848. return await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e2);
  10849. }
  10850. async signOut() {
  10851. if (this.loginType === He.ANONYMOUS)
  10852. throw new te({ message: "匿名用户不支持登出操作" });
  10853. const { refreshTokenKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2 } = this._cache.keys, s2 = this._cache.getStore(e2);
  10854. if (!s2)
  10855. return;
  10856. const r2 = await this._request.send("auth.logout", { refresh_token: s2 });
  10857. return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.removeStore(n2), qe(Ke), qe($e, { env: this.config.env, loginType: He.NULL, persistence: this.config.persistence }), r2;
  10858. }
  10859. async signUpWithEmailAndPassword(e2, t2) {
  10860. return this._request.send("auth.signUpWithEmailAndPassword", { email: e2, password: t2 });
  10861. }
  10862. async sendPasswordResetEmail(e2) {
  10863. return this._request.send("auth.sendPasswordResetEmail", { email: e2 });
  10864. }
  10865. onLoginStateChanged(e2) {
  10866. Me(Ke, () => {
  10867. const t3 = this.hasLoginState();
  10868. e2.call(this, t3);
  10869. });
  10870. const t2 = this.hasLoginState();
  10871. e2.call(this, t2);
  10872. }
  10873. onLoginStateExpired(e2) {
  10874. Me(je, e2.bind(this));
  10875. }
  10876. onAccessTokenRefreshed(e2) {
  10877. Me(We, e2.bind(this));
  10878. }
  10879. onAnonymousConverted(e2) {
  10880. Me(Be, e2.bind(this));
  10881. }
  10882. onLoginTypeChanged(e2) {
  10883. Me($e, () => {
  10884. const t2 = this.hasLoginState();
  10885. e2.call(this, t2);
  10886. });
  10887. }
  10888. async getAccessToken() {
  10889. return { accessToken: (await this._request.getAccessToken()).accessToken, env: this.config.env };
  10890. }
  10891. hasLoginState() {
  10892. const { refreshTokenKey: e2 } = this._cache.keys;
  10893. return this._cache.getStore(e2) ? new tt(this.config.env) : null;
  10894. }
  10895. async isUsernameRegistered(e2) {
  10896. if ("string" != typeof e2)
  10897. throw new te({ code: "PARAM_ERROR", message: "username must be a string" });
  10898. const { data: t2 } = await this._request.send("auth.isUsernameRegistered", { username: e2 });
  10899. return t2 && t2.isRegistered;
  10900. }
  10901. getLoginState() {
  10902. return Promise.resolve(this.hasLoginState());
  10903. }
  10904. async signInWithTicket(e2) {
  10905. return new st(this.config).signIn(e2);
  10906. }
  10907. shouldRefreshAccessToken(e2) {
  10908. this._request._shouldRefreshAccessTokenHook = e2.bind(this);
  10909. }
  10910. getUserInfo() {
  10911. return this._request.send("auth.getUserInfo", {}).then((e2) => e2.code ? e2 : { ...e2.data, requestId: e2.seqId });
  10912. }
  10913. getAuthHeader() {
  10914. const { refreshTokenKey: e2, accessTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2);
  10915. return { "x-cloudbase-credentials": this._cache.getStore(t2) + "/@@/" + n2 };
  10916. }
  10917. _onAnonymousConverted(e2) {
  10918. const { env: t2 } = e2.data;
  10919. t2 === this.config.env && this._cache.updatePersistence(this.config.persistence);
  10920. }
  10921. _onLoginTypeChanged(e2) {
  10922. const { loginType: t2, persistence: n2, env: s2 } = e2.data;
  10923. s2 === this.config.env && (this._cache.updatePersistence(n2), this._cache.setStore(this._cache.keys.loginTypeKey, t2));
  10924. }
  10925. }
  10926. const at = function(e2, t2) {
  10927. t2 = t2 || Ie();
  10928. const n2 = Xe(this.config.env), { cloudPath: s2, filePath: r2, onUploadProgress: i2, fileType: o2 = "image" } = e2;
  10929. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  10930. 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 };
  10931. n2.upload({ url: a2, data: p2, file: r2, name: s2, fileType: o2, onUploadProgress: i2 }).then((e4) => {
  10932. 201 === e4.statusCode ? t2(null, { fileID: h2, requestId: d2 }) : t2(new te({ code: "STORAGE_REQUEST_FAIL", message: `STORAGE_REQUEST_FAIL: ${e4.data}` }));
  10933. }).catch((e4) => {
  10934. t2(e4);
  10935. });
  10936. }).catch((e3) => {
  10937. t2(e3);
  10938. }), t2.promise;
  10939. }, ct = function(e2, t2) {
  10940. t2 = t2 || Ie();
  10941. const n2 = Xe(this.config.env), { cloudPath: s2 } = e2;
  10942. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  10943. t2(null, e3);
  10944. }).catch((e3) => {
  10945. t2(e3);
  10946. }), t2.promise;
  10947. }, ut = function({ fileList: e2 }, t2) {
  10948. if (t2 = t2 || Ie(), !e2 || !Array.isArray(e2))
  10949. return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };
  10950. for (let t3 of e2)
  10951. if (!t3 || "string" != typeof t3)
  10952. return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };
  10953. const n2 = { fileid_list: e2 };
  10954. return Xe(this.config.env).send("storage.batchDeleteFile", n2).then((e3) => {
  10955. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.delete_list, requestId: e3.requestId });
  10956. }).catch((e3) => {
  10957. t2(e3);
  10958. }), t2.promise;
  10959. }, ht = function({ fileList: e2 }, t2) {
  10960. t2 = t2 || Ie(), e2 && Array.isArray(e2) || t2(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });
  10961. let n2 = [];
  10962. for (let s3 of e2)
  10963. "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的元素必须是字符串" });
  10964. const s2 = { file_list: n2 };
  10965. return Xe(this.config.env).send("storage.batchGetDownloadUrl", s2).then((e3) => {
  10966. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.download_list, requestId: e3.requestId });
  10967. }).catch((e3) => {
  10968. t2(e3);
  10969. }), t2.promise;
  10970. }, lt = async function({ fileID: e2 }, t2) {
  10971. const n2 = (await ht.call(this, { fileList: [{ fileID: e2, maxAge: 600 }] })).fileList[0];
  10972. if ("SUCCESS" !== n2.code)
  10973. return t2 ? t2(n2) : new Promise((e3) => {
  10974. e3(n2);
  10975. });
  10976. const s2 = Xe(this.config.env);
  10977. let r2 = n2.download_url;
  10978. if (r2 = encodeURI(r2), !t2)
  10979. return s2.download({ url: r2 });
  10980. t2(await s2.download({ url: r2 }));
  10981. }, dt = function({ name: e2, data: t2, query: n2, parse: s2, search: r2 }, i2) {
  10982. const o2 = i2 || Ie();
  10983. let a2;
  10984. try {
  10985. a2 = t2 ? JSON.stringify(t2) : "";
  10986. } catch (e3) {
  10987. return Promise.reject(e3);
  10988. }
  10989. if (!e2)
  10990. return Promise.reject(new te({ code: "PARAM_ERROR", message: "函数名不能为空" }));
  10991. const c2 = { inQuery: n2, parse: s2, search: r2, function_name: e2, request_data: a2 };
  10992. return Xe(this.config.env).send("functions.invokeFunction", c2).then((e3) => {
  10993. if (e3.code)
  10994. o2(null, e3);
  10995. else {
  10996. let t3 = e3.data.response_data;
  10997. if (s2)
  10998. o2(null, { result: t3, requestId: e3.requestId });
  10999. else
  11000. try {
  11001. t3 = JSON.parse(e3.data.response_data), o2(null, { result: t3, requestId: e3.requestId });
  11002. } catch (e4) {
  11003. o2(new te({ message: "response data must be json" }));
  11004. }
  11005. }
  11006. return o2.promise;
  11007. }).catch((e3) => {
  11008. o2(e3);
  11009. }), o2.promise;
  11010. }, pt = { timeout: 15e3, persistence: "session" }, ft = {};
  11011. class gt {
  11012. constructor(e2) {
  11013. this.config = e2 || this.config, this.authObj = void 0;
  11014. }
  11015. init(e2) {
  11016. switch (Ce.adapter || (this.requestClient = new Ce.adapter.reqClass({ timeout: e2.timeout || 5e3, timeoutMsg: `请求在${(e2.timeout || 5e3) / 1e3}s内未完成,已中断` })), this.config = { ...pt, ...e2 }, true) {
  11017. case this.config.timeout > 6e5:
  11018. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  11019. break;
  11020. case this.config.timeout < 100:
  11021. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  11022. }
  11023. return new gt(this.config);
  11024. }
  11025. auth({ persistence: e2 } = {}) {
  11026. if (this.authObj)
  11027. return this.authObj;
  11028. const t2 = e2 || Ce.adapter.primaryStorage || pt.persistence;
  11029. var n2;
  11030. return t2 !== this.config.persistence && (this.config.persistence = t2), function(e3) {
  11031. const { env: t3 } = e3;
  11032. Ee[t3] = new Oe(e3), Le[t3] = new Oe({ ...e3, persistence: "local" });
  11033. }(this.config), n2 = this.config, Qe[n2.env] = new Ye(n2), this.authObj = new ot(this.config), this.authObj;
  11034. }
  11035. on(e2, t2) {
  11036. return Me.apply(this, [e2, t2]);
  11037. }
  11038. off(e2, t2) {
  11039. return Fe.apply(this, [e2, t2]);
  11040. }
  11041. callFunction(e2, t2) {
  11042. return dt.apply(this, [e2, t2]);
  11043. }
  11044. deleteFile(e2, t2) {
  11045. return ut.apply(this, [e2, t2]);
  11046. }
  11047. getTempFileURL(e2, t2) {
  11048. return ht.apply(this, [e2, t2]);
  11049. }
  11050. downloadFile(e2, t2) {
  11051. return lt.apply(this, [e2, t2]);
  11052. }
  11053. uploadFile(e2, t2) {
  11054. return at.apply(this, [e2, t2]);
  11055. }
  11056. getUploadMetadata(e2, t2) {
  11057. return ct.apply(this, [e2, t2]);
  11058. }
  11059. registerExtension(e2) {
  11060. ft[e2.name] = e2;
  11061. }
  11062. async invokeExtension(e2, t2) {
  11063. const n2 = ft[e2];
  11064. if (!n2)
  11065. throw new te({ message: `扩展${e2} 必须先注册` });
  11066. return await n2.invoke(t2, this);
  11067. }
  11068. useAdapters(e2) {
  11069. const { adapter: t2, runtime: n2 } = Ae(e2) || {};
  11070. t2 && (Ce.adapter = t2), n2 && (Ce.runtime = n2);
  11071. }
  11072. }
  11073. var mt = new gt();
  11074. function yt(e2, t2, n2) {
  11075. void 0 === n2 && (n2 = {});
  11076. var s2 = /\?/.test(t2), r2 = "";
  11077. for (var i2 in n2)
  11078. "" === r2 ? !s2 && (t2 += "?") : r2 += "&", r2 += i2 + "=" + encodeURIComponent(n2[i2]);
  11079. return /^http(s)?:\/\//.test(t2 += r2) ? t2 : "" + e2 + t2;
  11080. }
  11081. class _t {
  11082. post(e2) {
  11083. const { url: t2, data: n2, headers: s2 } = e2;
  11084. return new Promise((e3, r2) => {
  11085. ne.request({ url: yt("https:", t2), data: n2, method: "POST", header: s2, success(t3) {
  11086. e3(t3);
  11087. }, fail(e4) {
  11088. r2(e4);
  11089. } });
  11090. });
  11091. }
  11092. upload(e2) {
  11093. return new Promise((t2, n2) => {
  11094. const { url: s2, file: r2, data: i2, headers: o2, fileType: a2 } = e2, c2 = ne.uploadFile({ url: yt("https:", s2), name: "file", formData: Object.assign({}, i2), filePath: r2, fileType: a2, header: o2, success(e3) {
  11095. const n3 = { statusCode: e3.statusCode, data: e3.data || {} };
  11096. 200 === e3.statusCode && i2.success_action_status && (n3.statusCode = parseInt(i2.success_action_status, 10)), t2(n3);
  11097. }, fail(e3) {
  11098. n2(new Error(e3.errMsg || "uploadFile:fail"));
  11099. } });
  11100. "function" == typeof e2.onUploadProgress && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((t3) => {
  11101. e2.onUploadProgress({ loaded: t3.totalBytesSent, total: t3.totalBytesExpectedToSend });
  11102. });
  11103. });
  11104. }
  11105. }
  11106. const wt = { setItem(e2, t2) {
  11107. ne.setStorageSync(e2, t2);
  11108. }, getItem: (e2) => ne.getStorageSync(e2), removeItem(e2) {
  11109. ne.removeStorageSync(e2);
  11110. }, clear() {
  11111. ne.clearStorageSync();
  11112. } };
  11113. var vt = { genAdapter: function() {
  11114. return { root: {}, reqClass: _t, localStorage: wt, primaryStorage: "local" };
  11115. }, isMatch: function() {
  11116. return true;
  11117. }, runtime: "uni_app" };
  11118. mt.useAdapters(vt);
  11119. const It = mt, St = It.init;
  11120. It.init = function(e2) {
  11121. e2.env = e2.spaceId;
  11122. const t2 = St.call(this, e2);
  11123. t2.config.provider = "tencent", t2.config.spaceId = e2.spaceId;
  11124. const n2 = t2.auth;
  11125. return t2.auth = function(e3) {
  11126. const t3 = n2.call(this, e3);
  11127. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach((e4) => {
  11128. var n3;
  11129. t3[e4] = (n3 = t3[e4], function(e5) {
  11130. e5 = e5 || {};
  11131. const { success: t4, fail: s2, complete: r2 } = ee(e5);
  11132. if (!(t4 || s2 || r2))
  11133. return n3.call(this, e5);
  11134. n3.call(this, e5).then((e6) => {
  11135. t4 && t4(e6), r2 && r2(e6);
  11136. }, (e6) => {
  11137. s2 && s2(e6), r2 && r2(e6);
  11138. });
  11139. }).bind(t3);
  11140. }), t3;
  11141. }, t2.customAuth = t2.auth, t2;
  11142. };
  11143. var bt = It;
  11144. var kt = class extends pe {
  11145. getAccessToken() {
  11146. return new Promise((e2, t2) => {
  11147. const n2 = "Anonymous_Access_token";
  11148. this.setAccessToken(n2), e2(n2);
  11149. });
  11150. }
  11151. setupRequest(e2, t2) {
  11152. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  11153. "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = de.sign(n2, this.config.clientSecret);
  11154. const r2 = le();
  11155. s2["x-client-info"] = encodeURIComponent(JSON.stringify(r2));
  11156. const { token: i2 } = re();
  11157. return s2["x-client-token"] = i2, { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: JSON.parse(JSON.stringify(s2)) };
  11158. }
  11159. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  11160. return new Promise((o2, a2) => {
  11161. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, success(e3) {
  11162. e3 && e3.statusCode < 400 ? o2(e3) : a2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  11163. }, fail(e3) {
  11164. a2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  11165. } });
  11166. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  11167. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  11168. });
  11169. });
  11170. }
  11171. uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", onUploadProgress: s2 }) {
  11172. if (!t2)
  11173. throw new te({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });
  11174. let r2;
  11175. return this.getOSSUploadOptionsFromPath({ cloudPath: t2 }).then((t3) => {
  11176. const { url: i2, formData: o2, name: a2 } = t3.result;
  11177. r2 = t3.result.fileUrl;
  11178. const c2 = { url: i2, formData: o2, name: a2, filePath: e2, fileType: n2 };
  11179. return this.uploadFileToOSS(Object.assign({}, c2, { onUploadProgress: s2 }));
  11180. }).then(() => this.reportOSSUpload({ cloudPath: t2 })).then((t3) => new Promise((n3, s3) => {
  11181. t3.success ? n3({ success: true, filePath: e2, fileID: r2 }) : s3(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  11182. }));
  11183. }
  11184. deleteFile({ fileList: e2 }) {
  11185. const t2 = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e2 }) };
  11186. return this.request(this.setupRequest(t2)).then((e3) => {
  11187. if (e3.success)
  11188. return e3.result;
  11189. throw new te({ code: "DELETE_FILE_FAILED", message: "删除文件失败" });
  11190. });
  11191. }
  11192. getTempFileURL({ fileList: e2, maxAge: t2 } = {}) {
  11193. if (!Array.isArray(e2) || 0 === e2.length)
  11194. throw new te({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  11195. const n2 = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e2, maxAge: t2 }) };
  11196. return this.request(this.setupRequest(n2)).then((e3) => {
  11197. if (e3.success)
  11198. return { fileList: e3.result.fileList.map((e4) => ({ fileID: e4.fileID, tempFileURL: e4.tempFileURL })) };
  11199. throw new te({ code: "GET_TEMP_FILE_URL_FAILED", message: "获取临时文件链接失败" });
  11200. });
  11201. }
  11202. };
  11203. var At = { init(e2) {
  11204. const t2 = new kt(e2), n2 = { signInAnonymously: function() {
  11205. return t2.authorize();
  11206. }, getLoginState: function() {
  11207. return Promise.resolve(false);
  11208. } };
  11209. return t2.auth = function() {
  11210. return n2;
  11211. }, t2.customAuth = t2.auth, t2;
  11212. } }, Ct = n(function(e2, t2) {
  11213. e2.exports = r.enc.Hex;
  11214. });
  11215. function Pt() {
  11216. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e2) {
  11217. var t2 = 16 * Math.random() | 0;
  11218. return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
  11219. });
  11220. }
  11221. function Tt(e2 = "", t2 = {}) {
  11222. const { data: n2, functionName: s2, method: r2, headers: i2, signHeaderKeys: o2 = [], config: a2 } = t2, c2 = Date.now(), u2 = Pt(), 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) {
  11223. const t3 = e3.signedHeaders.join(";"), n3 = e3.signedHeaders.map((t4) => `${t4.toLowerCase()}:${e3.headers[t4]}
  11224. `).join(""), s3 = we(e3.body).toString(Ct), r3 = `${e3.method.toUpperCase()}
  11225. ${e3.path}
  11226. ${e3.query}
  11227. ${n3}
  11228. ${t3}
  11229. ${s3}
  11230. `, i3 = we(r3).toString(Ct), o3 = `HMAC-SHA256
  11231. ${e3.timestamp}
  11232. ${i3}
  11233. `, a3 = ve(o3, e3.secretKey).toString(Ct);
  11234. return `HMAC-SHA256 Credential=${e3.secretId}, SignedHeaders=${t3}, Signature=${a3}`;
  11235. }({ path: d2, query: p2, method: r2, headers: h2, timestamp: c2, body: JSON.stringify(n2), secretId: a2.accessKey, secretKey: a2.secretKey, signedHeaders: l2.sort() });
  11236. return { url: `${a2.endpoint}${e2}`, headers: Object.assign({}, h2, { Authorization: f2 }) };
  11237. }
  11238. function xt({ url: e2, data: t2, method: n2 = "POST", headers: s2 = {} }) {
  11239. return new Promise((r2, i2) => {
  11240. ne.request({ url: e2, method: n2, data: "object" == typeof t2 ? JSON.stringify(t2) : t2, header: s2, dataType: "json", complete: (e3 = {}) => {
  11241. const t3 = s2["x-trace-id"] || "";
  11242. if (!e3.statusCode || e3.statusCode >= 400) {
  11243. const { message: n3, errMsg: s3, trace_id: r3 } = e3.data || {};
  11244. return i2(new te({ code: "SYS_ERR", message: n3 || s3 || "request:fail", requestId: r3 || t3 }));
  11245. }
  11246. r2({ status: e3.statusCode, data: e3.data, headers: e3.header, requestId: t3 });
  11247. } });
  11248. });
  11249. }
  11250. function Ot(e2, t2) {
  11251. const { path: n2, data: s2, method: r2 = "GET" } = e2, { url: i2, headers: o2 } = Tt(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 });
  11252. return xt({ url: i2, data: s2, method: r2, headers: o2 }).then((e3) => {
  11253. const t3 = e3.data || {};
  11254. if (!t3.success)
  11255. throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
  11256. return t3.data || {};
  11257. }).catch((e3) => {
  11258. throw new te({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId });
  11259. });
  11260. }
  11261. function Et(e2 = "") {
  11262. const t2 = e2.trim().replace(/^cloud:\/\//, ""), n2 = t2.indexOf("/");
  11263. if (n2 <= 0)
  11264. throw new te({ code: "INVALID_PARAM", message: "fileID不合法" });
  11265. const s2 = t2.substring(0, n2), r2 = t2.substring(n2 + 1);
  11266. return s2 !== this.config.spaceId && console.warn("file ".concat(e2, " does not belong to env ").concat(this.config.spaceId)), r2;
  11267. }
  11268. function Lt(e2 = "") {
  11269. return "cloud://".concat(this.config.spaceId, "/").concat(e2.replace(/^\/+/, ""));
  11270. }
  11271. class Rt {
  11272. constructor(e2) {
  11273. this.config = e2;
  11274. }
  11275. signedURL(e2, t2 = {}) {
  11276. const n2 = `/ws/function/${e2}`, s2 = this.config.wsEndpoint.replace(/^ws(s)?:\/\//, ""), r2 = Object.assign({}, t2, { accessKeyId: this.config.accessKey, signatureNonce: Pt(), timestamp: "" + Date.now() }), i2 = [n2, ["accessKeyId", "authorization", "signatureNonce", "timestamp"].sort().map(function(e3) {
  11277. return r2[e3] ? "".concat(e3, "=").concat(r2[e3]) : null;
  11278. }).filter(Boolean).join("&"), `host:${s2}`].join("\n"), o2 = ["HMAC-SHA256", we(i2).toString(Ct)].join("\n"), a2 = ve(o2, this.config.secretKey).toString(Ct), c2 = Object.keys(r2).map((e3) => `${e3}=${encodeURIComponent(r2[e3])}`).join("&");
  11279. return `${this.config.wsEndpoint}${n2}?${c2}&signature=${a2}`;
  11280. }
  11281. }
  11282. var Ut = class {
  11283. constructor(e2) {
  11284. if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach((t2) => {
  11285. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  11286. throw new Error(`${t2} required`);
  11287. }), e2.endpoint) {
  11288. if ("string" != typeof e2.endpoint)
  11289. throw new Error("endpoint must be string");
  11290. if (!/^https:\/\//.test(e2.endpoint))
  11291. throw new Error("endpoint must start with https://");
  11292. e2.endpoint = e2.endpoint.replace(/\/$/, "");
  11293. }
  11294. 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 Rt(this.config);
  11295. }
  11296. callFunction(e2) {
  11297. return function(e3, t2) {
  11298. const { name: n2, data: s2, async: r2 = false } = e3, i2 = "POST", o2 = { "x-to-function-name": n2 };
  11299. r2 && (o2["x-function-invoke-type"] = "async");
  11300. const { url: a2, headers: c2 } = Tt("/functions/invokeFunction", { functionName: n2, data: s2, method: i2, headers: o2, signHeaderKeys: ["x-to-function-name"], config: t2 });
  11301. return xt({ url: a2, data: s2, method: i2, headers: c2 }).then((e4) => {
  11302. let t3 = 0;
  11303. if (r2) {
  11304. const n3 = e4.data || {};
  11305. t3 = "200" === n3.errCode ? 0 : n3.errCode, e4.data = n3.data || {}, e4.errMsg = n3.errMsg;
  11306. }
  11307. if (0 !== t3)
  11308. throw new te({ code: t3, message: e4.errMsg, requestId: e4.requestId });
  11309. return { errCode: t3, success: 0 === t3, requestId: e4.requestId, result: e4.data };
  11310. }).catch((e4) => {
  11311. throw new te({ code: e4.errCode, message: e4.errMsg, requestId: e4.requestId });
  11312. });
  11313. }(e2, this.config);
  11314. }
  11315. uploadFileToOSS({ url: e2, filePath: t2, fileType: n2, formData: s2, onUploadProgress: r2 }) {
  11316. return new Promise((i2, o2) => {
  11317. const a2 = ne.uploadFile({ url: e2, filePath: t2, fileType: n2, formData: s2, name: "file", success(e3) {
  11318. e3 && e3.statusCode < 400 ? i2(e3) : o2(new te({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  11319. }, fail(e3) {
  11320. o2(new te({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  11321. } });
  11322. "function" == typeof r2 && a2 && "function" == typeof a2.onProgressUpdate && a2.onProgressUpdate((e3) => {
  11323. r2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  11324. });
  11325. });
  11326. }
  11327. async uploadFile({ filePath: e2, cloudPath: t2 = "", fileType: n2 = "image", onUploadProgress: s2 }) {
  11328. if ("string" !== f(t2))
  11329. throw new te({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  11330. if (!(t2 = t2.trim()))
  11331. throw new te({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  11332. if (/:\/\//.test(t2))
  11333. throw new te({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  11334. const r2 = await Ot({ 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), {});
  11335. return this.uploadFileToOSS({ url: o2, filePath: e2, fileType: n2, formData: c2, onUploadProgress: s2 }).then(() => ({ fileID: i2 }));
  11336. }
  11337. async getTempFileURL({ fileList: e2 }) {
  11338. return new Promise((t2, n2) => {
  11339. (!e2 || e2.length < 0) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList不能为空数组" })), e2.length > 50 && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList数组长度不能超过50" }));
  11340. const s2 = [];
  11341. for (const t3 of e2) {
  11342. "string" !== f(t3) && n2(new te({ errCode: "INVALID_PARAM", errMsg: "fileList的元素必须是非空的字符串" }));
  11343. const e3 = Et.call(this, t3);
  11344. s2.push({ file_id: e3, expire: 600 });
  11345. }
  11346. Ot({ path: "/?download_url", data: { file_list: s2 }, method: "POST" }, this.config).then((e3) => {
  11347. const { file_list: n3 = [] } = e3;
  11348. t2({ fileList: n3.map((e4) => ({ fileID: Lt.call(this, e4.file_id), tempFileURL: e4.download_url })) });
  11349. }).catch((e3) => n2(e3));
  11350. });
  11351. }
  11352. async connectWebSocket(e2) {
  11353. const { name: t2, query: n2 } = e2;
  11354. return ne.connectSocket({ url: this._websocket.signedURL(t2, n2), complete: () => {
  11355. } });
  11356. }
  11357. };
  11358. var Nt = { init: (e2) => {
  11359. e2.provider = "alipay";
  11360. const t2 = new Ut(e2);
  11361. return t2.auth = function() {
  11362. return { signInAnonymously: function() {
  11363. return Promise.resolve();
  11364. }, getLoginState: function() {
  11365. return Promise.resolve(true);
  11366. } };
  11367. }, t2;
  11368. } };
  11369. function Dt({ data: e2 }) {
  11370. let t2;
  11371. t2 = le();
  11372. const n2 = JSON.parse(JSON.stringify(e2 || {}));
  11373. if (Object.assign(n2, { clientInfo: t2 }), !n2.uniIdToken) {
  11374. const { token: e3 } = re();
  11375. e3 && (n2.uniIdToken = e3);
  11376. }
  11377. return n2;
  11378. }
  11379. async function Mt({ name: e2, data: t2 } = {}) {
  11380. await this.__dev__.initLocalNetwork();
  11381. const { localAddress: n2, localPort: s2 } = this.__dev__, r2 = { aliyun: "aliyun", tencent: "tcb", alipay: "alipay" }[this.config.provider], i2 = this.config.spaceId, o2 = `http://${n2}:${s2}/system/check-function`, a2 = `http://${n2}:${s2}/cloudfunctions/${e2}`;
  11382. return new Promise((t3, n3) => {
  11383. ne.request({ method: "POST", url: o2, data: { name: e2, platform: C, provider: r2, spaceId: i2 }, timeout: 3e3, success(e3) {
  11384. t3(e3);
  11385. }, fail() {
  11386. t3({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });
  11387. } });
  11388. }).then(({ data: e3 } = {}) => {
  11389. const { code: t3, message: n3 } = e3 || {};
  11390. return { code: 0 === t3 ? 0 : t3 || "SYS_ERR", message: n3 || "SYS_ERR" };
  11391. }).then(({ code: n3, message: s3 }) => {
  11392. if (0 !== n3) {
  11393. switch (n3) {
  11394. case "MODULE_ENCRYPTED":
  11395. console.error(`此云函数(${e2})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);
  11396. break;
  11397. case "FUNCTION_ENCRYPTED":
  11398. console.error(`此云函数(${e2})已加密不可本地调试,自动切换为云端已部署的云函数`);
  11399. break;
  11400. case "ACTION_ENCRYPTED":
  11401. console.error(s3 || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  11402. break;
  11403. case "NETWORK_ERROR":
  11404. console.error(s3 || "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下");
  11405. break;
  11406. case "SWITCH_TO_CLOUD":
  11407. break;
  11408. default: {
  11409. const e3 = `检测本地调试服务出现错误:${s3},请检查网络环境或重启客户端再试`;
  11410. throw console.error(e3), new Error(e3);
  11411. }
  11412. }
  11413. return this._callCloudFunction({ name: e2, data: t2 });
  11414. }
  11415. return new Promise((e3, n4) => {
  11416. const s4 = Dt.call(this, { data: t2 });
  11417. ne.request({ method: "POST", url: a2, data: { provider: r2, platform: C, param: s4 }, success: ({ statusCode: t3, data: s5 } = {}) => !t3 || t3 >= 400 ? n4(new te({ code: s5.code || "SYS_ERR", message: s5.message || "request:fail" })) : e3({ result: s5 }), fail(e4) {
  11418. n4(new te({ code: e4.code || e4.errCode || "SYS_ERR", message: e4.message || e4.errMsg || "request:fail" }));
  11419. } });
  11420. });
  11421. });
  11422. }
  11423. const qt = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];
  11424. var Ft = /[\\^$.*+?()[\]{}|]/g, Kt = RegExp(Ft.source);
  11425. function jt(e2, t2, n2) {
  11426. return e2.replace(new RegExp((s2 = t2) && Kt.test(s2) ? s2.replace(Ft, "\\$&") : s2, "g"), n2);
  11427. var s2;
  11428. }
  11429. const Bt = "request", Wt = "response", Ht = "both";
  11430. const Tn = { code: 2e4, message: "System error" }, xn = { code: 20101, message: "Invalid client" };
  11431. function Ln(e2) {
  11432. const { errSubject: t2, subject: n2, errCode: s2, errMsg: r2, code: i2, message: o2, cause: a2 } = e2 || {};
  11433. return new te({ subject: t2 || n2 || "uni-secure-network", code: s2 || i2 || Tn.code, message: r2 || o2, cause: a2 });
  11434. }
  11435. let Un;
  11436. function Fn({ secretType: e2 } = {}) {
  11437. return e2 === Bt || e2 === Wt || e2 === Ht;
  11438. }
  11439. function Kn({ name: e2, data: t2 = {} } = {}) {
  11440. return "DCloud-clientDB" === e2 && "encryption" === t2.redirectTo && "getAppClientKey" === t2.action;
  11441. }
  11442. function jn({ provider: e2, spaceId: t2, functionName: n2 } = {}) {
  11443. const { appId: s2, uniPlatform: r2, osName: i2 } = ce();
  11444. let o2 = r2;
  11445. "app" === r2 && (o2 = i2);
  11446. const a2 = function({ provider: e3, spaceId: t3 } = {}) {
  11447. const n3 = A;
  11448. if (!n3)
  11449. return {};
  11450. e3 = /* @__PURE__ */ function(e4) {
  11451. return "tencent" === e4 ? "tcb" : e4;
  11452. }(e3);
  11453. const s3 = n3.find((n4) => n4.provider === e3 && n4.spaceId === t3);
  11454. return s3 && s3.config;
  11455. }({ provider: e2, spaceId: t2 });
  11456. if (!a2 || !a2.accessControl || !a2.accessControl.enable)
  11457. return false;
  11458. const c2 = a2.accessControl.function || {}, u2 = Object.keys(c2);
  11459. if (0 === u2.length)
  11460. return true;
  11461. const h2 = function(e3, t3) {
  11462. let n3, s3, r3;
  11463. for (let i3 = 0; i3 < e3.length; i3++) {
  11464. const o3 = e3[i3];
  11465. o3 !== t3 ? "*" !== o3 ? o3.split(",").map((e4) => e4.trim()).indexOf(t3) > -1 && (s3 = o3) : r3 = o3 : n3 = o3;
  11466. }
  11467. return n3 || s3 || r3;
  11468. }(u2, n2);
  11469. if (!h2)
  11470. return false;
  11471. if ((c2[h2] || []).find((e3 = {}) => e3.appId === s2 && (e3.platform || "").toLowerCase() === o2.toLowerCase()))
  11472. return true;
  11473. throw console.error(`此应用[appId: ${s2}, platform: ${o2}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`), Ln(xn);
  11474. }
  11475. function $n({ functionName: e2, result: t2, logPvd: n2 }) {
  11476. if (this.__dev__.debugLog && t2 && t2.requestId) {
  11477. const s2 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e2, requestId: t2.requestId });
  11478. console.log(`[${n2}-request]${s2}[/${n2}-request]`);
  11479. }
  11480. }
  11481. function Bn(e2) {
  11482. const t2 = e2.callFunction, n2 = function(n3) {
  11483. const s2 = n3.name;
  11484. n3.data = Dt.call(e2, { data: n3.data });
  11485. const r2 = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb", alipay: "alipay" }[this.config.provider], i2 = Fn(n3), o2 = Kn(n3), a2 = i2 || o2;
  11486. return t2.call(this, n3).then((e3) => (e3.errCode = 0, !a2 && $n.call(this, { functionName: s2, result: e3, logPvd: r2 }), Promise.resolve(e3)), (e3) => (!a2 && $n.call(this, { functionName: s2, result: e3, logPvd: r2 }), e3 && e3.message && (e3.message = function({ message: e4 = "", extraInfo: t3 = {}, formatter: n4 = [] } = {}) {
  11487. for (let s3 = 0; s3 < n4.length; s3++) {
  11488. const { rule: r3, content: i3, mode: o3 } = n4[s3], a3 = e4.match(r3);
  11489. if (!a3)
  11490. continue;
  11491. let c2 = i3;
  11492. for (let e5 = 1; e5 < a3.length; e5++)
  11493. c2 = jt(c2, `{$${e5}}`, a3[e5]);
  11494. for (const e5 in t3)
  11495. c2 = jt(c2, `{${e5}}`, t3[e5]);
  11496. return "replace" === o3 ? c2 : e4 + c2;
  11497. }
  11498. return e4;
  11499. }({ message: `[${n3.name}]: ${e3.message}`, formatter: qt, extraInfo: { functionName: s2 } })), Promise.reject(e3)));
  11500. };
  11501. e2.callFunction = function(t3) {
  11502. const { provider: s2, spaceId: r2 } = e2.config, i2 = t3.name;
  11503. let o2, a2;
  11504. if (t3.data = t3.data || {}, e2.__dev__.debugInfo && !e2.__dev__.debugInfo.forceRemote && T ? (e2._callCloudFunction || (e2._callCloudFunction = n2, e2._callLocalFunction = Mt), o2 = Mt) : o2 = n2, o2 = o2.bind(e2), Kn(t3))
  11505. a2 = n2.call(e2, t3);
  11506. else if (Fn(t3)) {
  11507. a2 = new Un({ secretType: t3.secretType, uniCloudIns: e2 }).wrapEncryptDataCallFunction(n2.bind(e2))(t3);
  11508. } else if (jn({ provider: s2, spaceId: r2, functionName: i2 })) {
  11509. a2 = new Un({ secretType: t3.secretType, uniCloudIns: e2 }).wrapVerifyClientCallFunction(n2.bind(e2))(t3);
  11510. } else
  11511. a2 = o2(t3);
  11512. 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));
  11513. };
  11514. }
  11515. Un = class {
  11516. constructor() {
  11517. throw Ln({ message: `Platform ${C} is not enabled, please check whether secure network module is enabled in your manifest.json` });
  11518. }
  11519. };
  11520. const Wn = Symbol("CLIENT_DB_INTERNAL");
  11521. function Hn(e2, t2) {
  11522. return e2.then = "DoNotReturnProxyWithAFunctionNamedThen", e2._internalType = Wn, e2.inspect = null, e2.__v_raw = void 0, new Proxy(e2, { get(e3, n2, s2) {
  11523. if ("_uniClient" === n2)
  11524. return null;
  11525. if ("symbol" == typeof n2)
  11526. return e3[n2];
  11527. if (n2 in e3 || "string" != typeof n2) {
  11528. const t3 = e3[n2];
  11529. return "function" == typeof t3 ? t3.bind(e3) : t3;
  11530. }
  11531. return t2.get(e3, n2, s2);
  11532. } });
  11533. }
  11534. function zn(e2) {
  11535. return { on: (t2, n2) => {
  11536. e2[t2] = e2[t2] || [], e2[t2].indexOf(n2) > -1 || e2[t2].push(n2);
  11537. }, off: (t2, n2) => {
  11538. e2[t2] = e2[t2] || [];
  11539. const s2 = e2[t2].indexOf(n2);
  11540. -1 !== s2 && e2[t2].splice(s2, 1);
  11541. } };
  11542. }
  11543. const Jn = ["db.Geo", "db.command", "command.aggregate"];
  11544. function Vn(e2, t2) {
  11545. return Jn.indexOf(`${e2}.${t2}`) > -1;
  11546. }
  11547. function Gn(e2) {
  11548. switch (f(e2 = se(e2))) {
  11549. case "array":
  11550. return e2.map((e3) => Gn(e3));
  11551. case "object":
  11552. return e2._internalType === Wn || Object.keys(e2).forEach((t2) => {
  11553. e2[t2] = Gn(e2[t2]);
  11554. }), e2;
  11555. case "regexp":
  11556. return { $regexp: { source: e2.source, flags: e2.flags } };
  11557. case "date":
  11558. return { $date: e2.toISOString() };
  11559. default:
  11560. return e2;
  11561. }
  11562. }
  11563. function Yn(e2) {
  11564. return e2 && e2.content && e2.content.$method;
  11565. }
  11566. class Qn {
  11567. constructor(e2, t2, n2) {
  11568. this.content = e2, this.prevStage = t2 || null, this.udb = null, this._database = n2;
  11569. }
  11570. toJSON() {
  11571. let e2 = this;
  11572. const t2 = [e2.content];
  11573. for (; e2.prevStage; )
  11574. e2 = e2.prevStage, t2.push(e2.content);
  11575. return { $db: t2.reverse().map((e3) => ({ $method: e3.$method, $param: Gn(e3.$param) })) };
  11576. }
  11577. toString() {
  11578. return JSON.stringify(this.toJSON());
  11579. }
  11580. getAction() {
  11581. const e2 = this.toJSON().$db.find((e3) => "action" === e3.$method);
  11582. return e2 && e2.$param && e2.$param[0];
  11583. }
  11584. getCommand() {
  11585. return { $db: this.toJSON().$db.filter((e2) => "action" !== e2.$method) };
  11586. }
  11587. get isAggregate() {
  11588. let e2 = this;
  11589. for (; e2; ) {
  11590. const t2 = Yn(e2), n2 = Yn(e2.prevStage);
  11591. if ("aggregate" === t2 && "collection" === n2 || "pipeline" === t2)
  11592. return true;
  11593. e2 = e2.prevStage;
  11594. }
  11595. return false;
  11596. }
  11597. get isCommand() {
  11598. let e2 = this;
  11599. for (; e2; ) {
  11600. if ("command" === Yn(e2))
  11601. return true;
  11602. e2 = e2.prevStage;
  11603. }
  11604. return false;
  11605. }
  11606. get isAggregateCommand() {
  11607. let e2 = this;
  11608. for (; e2; ) {
  11609. const t2 = Yn(e2), n2 = Yn(e2.prevStage);
  11610. if ("aggregate" === t2 && "command" === n2)
  11611. return true;
  11612. e2 = e2.prevStage;
  11613. }
  11614. return false;
  11615. }
  11616. getNextStageFn(e2) {
  11617. const t2 = this;
  11618. return function() {
  11619. return Xn({ $method: e2, $param: Gn(Array.from(arguments)) }, t2, t2._database);
  11620. };
  11621. }
  11622. get count() {
  11623. return this.isAggregate ? this.getNextStageFn("count") : function() {
  11624. return this._send("count", Array.from(arguments));
  11625. };
  11626. }
  11627. get remove() {
  11628. return this.isCommand ? this.getNextStageFn("remove") : function() {
  11629. return this._send("remove", Array.from(arguments));
  11630. };
  11631. }
  11632. get() {
  11633. return this._send("get", Array.from(arguments));
  11634. }
  11635. get add() {
  11636. return this.isCommand ? this.getNextStageFn("add") : function() {
  11637. return this._send("add", Array.from(arguments));
  11638. };
  11639. }
  11640. update() {
  11641. return this._send("update", Array.from(arguments));
  11642. }
  11643. end() {
  11644. return this._send("end", Array.from(arguments));
  11645. }
  11646. get set() {
  11647. return this.isCommand ? this.getNextStageFn("set") : function() {
  11648. throw new Error("JQL禁止使用set方法");
  11649. };
  11650. }
  11651. _send(e2, t2) {
  11652. const n2 = this.getAction(), s2 = this.getCommand();
  11653. if (s2.$db.push({ $method: e2, $param: Gn(t2) }), S) {
  11654. const e3 = s2.$db.find((e4) => "collection" === e4.$method), t3 = e3 && e3.$param;
  11655. 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- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  11656. }
  11657. return this._database._callCloudFunction({ action: n2, command: s2 });
  11658. }
  11659. }
  11660. function Xn(e2, t2, n2) {
  11661. return Hn(new Qn(e2, t2, n2), { get(e3, t3) {
  11662. let s2 = "db";
  11663. return e3 && e3.content && (s2 = e3.content.$method), Vn(s2, t3) ? Xn({ $method: t3 }, e3, n2) : function() {
  11664. return Xn({ $method: t3, $param: Gn(Array.from(arguments)) }, e3, n2);
  11665. };
  11666. } });
  11667. }
  11668. function Zn({ path: e2, method: t2 }) {
  11669. return class {
  11670. constructor() {
  11671. this.param = Array.from(arguments);
  11672. }
  11673. toJSON() {
  11674. return { $newDb: [...e2.map((e3) => ({ $method: e3 })), { $method: t2, $param: this.param }] };
  11675. }
  11676. toString() {
  11677. return JSON.stringify(this.toJSON());
  11678. }
  11679. };
  11680. }
  11681. function es(e2, t2 = {}) {
  11682. return Hn(new e2(t2), { get: (e3, t3) => Vn("db", t3) ? Xn({ $method: t3 }, null, e3) : function() {
  11683. return Xn({ $method: t3, $param: Gn(Array.from(arguments)) }, null, e3);
  11684. } });
  11685. }
  11686. class ts extends class {
  11687. constructor({ uniClient: e2 = {}, isJQL: t2 = false } = {}) {
  11688. this._uniClient = e2, this._authCallBacks = {}, this._dbCallBacks = {}, e2._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t2 || (this.auth = zn(this._authCallBacks)), this._isJQL = t2, Object.assign(this, zn(this._dbCallBacks)), this.env = Hn({}, { get: (e3, t3) => ({ $env: t3 }) }), this.Geo = Hn({}, { get: (e3, t3) => Zn({ path: ["Geo"], method: t3 }) }), this.serverDate = Zn({ path: [], method: "serverDate" }), this.RegExp = Zn({ path: [], method: "RegExp" });
  11689. }
  11690. getCloudEnv(e2) {
  11691. if ("string" != typeof e2 || !e2.trim())
  11692. throw new Error("getCloudEnv参数错误");
  11693. return { $env: e2.replace("$cloudEnv_", "") };
  11694. }
  11695. _callback(e2, t2) {
  11696. const n2 = this._dbCallBacks;
  11697. n2[e2] && n2[e2].forEach((e3) => {
  11698. e3(...t2);
  11699. });
  11700. }
  11701. _callbackAuth(e2, t2) {
  11702. const n2 = this._authCallBacks;
  11703. n2[e2] && n2[e2].forEach((e3) => {
  11704. e3(...t2);
  11705. });
  11706. }
  11707. multiSend() {
  11708. const e2 = Array.from(arguments), t2 = e2.map((e3) => {
  11709. const t3 = e3.getAction(), n2 = e3.getCommand();
  11710. if ("getTemp" !== n2.$db[n2.$db.length - 1].$method)
  11711. throw new Error("multiSend只支持子命令内使用getTemp");
  11712. return { action: t3, command: n2 };
  11713. });
  11714. return this._callCloudFunction({ multiCommand: t2, queryList: e2 });
  11715. }
  11716. } {
  11717. _parseResult(e2) {
  11718. return this._isJQL ? e2.result : e2;
  11719. }
  11720. _callCloudFunction({ action: e2, command: t2, multiCommand: n2, queryList: s2 }) {
  11721. function r2(e3, t3) {
  11722. if (n2 && s2)
  11723. for (let n3 = 0; n3 < s2.length; n3++) {
  11724. const r3 = s2[n3];
  11725. r3.udb && "function" == typeof r3.udb.setResult && (t3 ? r3.udb.setResult(t3) : r3.udb.setResult(e3.result.dataList[n3]));
  11726. }
  11727. }
  11728. const i2 = this, o2 = this._isJQL ? "databaseForJQL" : "database";
  11729. function a2(e3) {
  11730. return i2._callback("error", [e3]), M(q(o2, "fail"), e3).then(() => M(q(o2, "complete"), e3)).then(() => (r2(null, e3), Y(j, { type: W, content: e3 }), Promise.reject(e3)));
  11731. }
  11732. const c2 = M(q(o2, "invoke")), u2 = this._uniClient;
  11733. return c2.then(() => u2.callFunction({ name: "DCloud-clientDB", type: h, data: { action: e2, command: t2, multiCommand: n2 } })).then((e3) => {
  11734. const { code: t3, message: n3, token: s3, tokenExpired: c3, systemInfo: u3 = [] } = e3.result;
  11735. if (u3)
  11736. for (let e4 = 0; e4 < u3.length; e4++) {
  11737. const { level: t4, message: n4, detail: s4 } = u3[e4], r3 = console["warn" === t4 ? "error" : t4] || console.log;
  11738. let i3 = "[System Info]" + n4;
  11739. s4 && (i3 = `${i3}
  11740. 详细信息:${s4}`), r3(i3);
  11741. }
  11742. if (t3) {
  11743. return a2(new te({ code: t3, message: n3, requestId: e3.requestId }));
  11744. }
  11745. 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(B, { token: s3, tokenExpired: c3 }));
  11746. const h2 = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];
  11747. for (let t4 = 0; t4 < h2.length; t4++) {
  11748. const { prop: n4, tips: s4 } = h2[t4];
  11749. if (n4 in e3.result) {
  11750. const t5 = e3.result[n4];
  11751. Object.defineProperty(e3.result, n4, { get: () => (console.warn(s4), t5) });
  11752. }
  11753. }
  11754. return function(e4) {
  11755. return M(q(o2, "success"), e4).then(() => M(q(o2, "complete"), e4)).then(() => {
  11756. r2(e4, null);
  11757. const t4 = i2._parseResult(e4);
  11758. return Y(j, { type: W, content: t4 }), Promise.resolve(t4);
  11759. });
  11760. }(e3);
  11761. }, (e3) => {
  11762. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e3.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  11763. return a2(new te({ code: e3.code || "SYSTEM_ERROR", message: e3.message, requestId: e3.requestId }));
  11764. });
  11765. }
  11766. }
  11767. const ns = "token无效,跳转登录页面", ss = "token过期,跳转登录页面", rs = { TOKEN_INVALID_TOKEN_EXPIRED: ss, TOKEN_INVALID_INVALID_CLIENTID: ns, TOKEN_INVALID: ns, TOKEN_INVALID_WRONG_TOKEN: ns, TOKEN_INVALID_ANONYMOUS_USER: ns }, is = { "uni-id-token-expired": ss, "uni-id-check-token-failed": ns, "uni-id-token-not-exist": ns, "uni-id-check-device-feature-failed": ns };
  11768. function os(e2, t2) {
  11769. let n2 = "";
  11770. return n2 = e2 ? `${e2}/${t2}` : t2, n2.replace(/^\//, "");
  11771. }
  11772. function as(e2 = [], t2 = "") {
  11773. const n2 = [], s2 = [];
  11774. return e2.forEach((e3) => {
  11775. true === e3.needLogin ? n2.push(os(t2, e3.path)) : false === e3.needLogin && s2.push(os(t2, e3.path));
  11776. }), { needLoginPage: n2, notNeedLoginPage: s2 };
  11777. }
  11778. function cs(e2) {
  11779. return e2.split("?")[0].replace(/^\//, "");
  11780. }
  11781. function us() {
  11782. return function(e2) {
  11783. let t2 = e2 && e2.$page && e2.$page.fullPath || "";
  11784. return t2 ? ("/" !== t2.charAt(0) && (t2 = "/" + t2), t2) : t2;
  11785. }(function() {
  11786. const e2 = getCurrentPages();
  11787. return e2[e2.length - 1];
  11788. }());
  11789. }
  11790. function hs() {
  11791. return cs(us());
  11792. }
  11793. function ls(e2 = "", t2 = {}) {
  11794. if (!e2)
  11795. return false;
  11796. if (!(t2 && t2.list && t2.list.length))
  11797. return false;
  11798. const n2 = t2.list, s2 = cs(e2);
  11799. return n2.some((e3) => e3.pagePath === s2);
  11800. }
  11801. const ds = !!e.uniIdRouter;
  11802. const { loginPage: ps, routerNeedLogin: fs, resToLogin: gs, needLoginPage: ms, notNeedLoginPage: ys, loginPageInTabBar: _s } = function({ pages: t2 = [], subPackages: n2 = [], uniIdRouter: s2 = {}, tabBar: r2 = {} } = e) {
  11803. const { loginPage: i2, needLogin: o2 = [], resToLogin: a2 = true } = s2, { needLoginPage: c2, notNeedLoginPage: u2 } = as(t2), { needLoginPage: h2, notNeedLoginPage: l2 } = function(e2 = []) {
  11804. const t3 = [], n3 = [];
  11805. return e2.forEach((e3) => {
  11806. const { root: s3, pages: r3 = [] } = e3, { needLoginPage: i3, notNeedLoginPage: o3 } = as(r3, s3);
  11807. t3.push(...i3), n3.push(...o3);
  11808. }), { needLoginPage: t3, notNeedLoginPage: n3 };
  11809. }(n2);
  11810. return { loginPage: i2, routerNeedLogin: o2, resToLogin: a2, needLoginPage: [...c2, ...h2], notNeedLoginPage: [...u2, ...l2], loginPageInTabBar: ls(i2, r2) };
  11811. }();
  11812. if (ms.indexOf(ps) > -1)
  11813. throw new Error(`Login page [${ps}] should not be "needLogin", please check your pages.json`);
  11814. function ws(e2) {
  11815. const t2 = hs();
  11816. if ("/" === e2.charAt(0))
  11817. return e2;
  11818. const [n2, s2] = e2.split("?"), r2 = n2.replace(/^\//, "").split("/"), i2 = t2.split("/");
  11819. i2.pop();
  11820. for (let e3 = 0; e3 < r2.length; e3++) {
  11821. const t3 = r2[e3];
  11822. ".." === t3 ? i2.pop() : "." !== t3 && i2.push(t3);
  11823. }
  11824. return "" === i2[0] && i2.shift(), "/" + i2.join("/") + (s2 ? "?" + s2 : "");
  11825. }
  11826. function vs(e2) {
  11827. const t2 = cs(ws(e2));
  11828. return !(ys.indexOf(t2) > -1) && (ms.indexOf(t2) > -1 || fs.some((t3) => function(e3, t4) {
  11829. return new RegExp(t4).test(e3);
  11830. }(e2, t3)));
  11831. }
  11832. function Is({ redirect: e2 }) {
  11833. const t2 = cs(e2), n2 = cs(ps);
  11834. return hs() !== n2 && t2 !== n2;
  11835. }
  11836. function Ss({ api: e2, redirect: t2 } = {}) {
  11837. if (!t2 || !Is({ redirect: t2 }))
  11838. return;
  11839. const n2 = function(e3, t3) {
  11840. return "/" !== e3.charAt(0) && (e3 = "/" + e3), t3 ? e3.indexOf("?") > -1 ? e3 + `&uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3 + `?uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3;
  11841. }(ps, t2);
  11842. _s ? "navigateTo" !== e2 && "redirectTo" !== e2 || (e2 = "switchTab") : "switchTab" === e2 && (e2 = "navigateTo");
  11843. const s2 = { navigateTo: uni.navigateTo, redirectTo: uni.redirectTo, switchTab: uni.switchTab, reLaunch: uni.reLaunch };
  11844. setTimeout(() => {
  11845. s2[e2]({ url: n2 });
  11846. }, 0);
  11847. }
  11848. function bs({ url: e2 } = {}) {
  11849. const t2 = { abortLoginPageJump: false, autoToLoginPage: false }, n2 = function() {
  11850. const { token: e3, tokenExpired: t3 } = re();
  11851. let n3;
  11852. if (e3) {
  11853. if (t3 < Date.now()) {
  11854. const e4 = "uni-id-token-expired";
  11855. n3 = { errCode: e4, errMsg: is[e4] };
  11856. }
  11857. } else {
  11858. const e4 = "uni-id-check-token-failed";
  11859. n3 = { errCode: e4, errMsg: is[e4] };
  11860. }
  11861. return n3;
  11862. }();
  11863. if (vs(e2) && n2) {
  11864. n2.uniIdRedirectUrl = e2;
  11865. if (J($).length > 0)
  11866. return setTimeout(() => {
  11867. Y($, n2);
  11868. }, 0), t2.abortLoginPageJump = true, t2;
  11869. t2.autoToLoginPage = true;
  11870. }
  11871. return t2;
  11872. }
  11873. function ks() {
  11874. !function() {
  11875. const e3 = us(), { abortLoginPageJump: t2, autoToLoginPage: n2 } = bs({ url: e3 });
  11876. t2 || n2 && Ss({ api: "redirectTo", redirect: e3 });
  11877. }();
  11878. const e2 = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  11879. for (let t2 = 0; t2 < e2.length; t2++) {
  11880. const n2 = e2[t2];
  11881. uni.addInterceptor(n2, { invoke(e3) {
  11882. const { abortLoginPageJump: t3, autoToLoginPage: s2 } = bs({ url: e3.url });
  11883. return t3 ? e3 : s2 ? (Ss({ api: n2, redirect: ws(e3.url) }), false) : e3;
  11884. } });
  11885. }
  11886. }
  11887. function As() {
  11888. this.onResponse((e2) => {
  11889. const { type: t2, content: n2 } = e2;
  11890. let s2 = false;
  11891. switch (t2) {
  11892. case "cloudobject":
  11893. s2 = function(e3) {
  11894. if ("object" != typeof e3)
  11895. return false;
  11896. const { errCode: t3 } = e3 || {};
  11897. return t3 in is;
  11898. }(n2);
  11899. break;
  11900. case "clientdb":
  11901. s2 = function(e3) {
  11902. if ("object" != typeof e3)
  11903. return false;
  11904. const { errCode: t3 } = e3 || {};
  11905. return t3 in rs;
  11906. }(n2);
  11907. }
  11908. s2 && function(e3 = {}) {
  11909. const t3 = J($);
  11910. Z().then(() => {
  11911. const n3 = us();
  11912. if (n3 && Is({ redirect: n3 }))
  11913. return t3.length > 0 ? Y($, Object.assign({ uniIdRedirectUrl: n3 }, e3)) : void (ps && Ss({ api: "navigateTo", redirect: n3 }));
  11914. });
  11915. }(n2);
  11916. });
  11917. }
  11918. function Cs(e2) {
  11919. !function(e3) {
  11920. e3.onResponse = function(e4) {
  11921. V(j, e4);
  11922. }, e3.offResponse = function(e4) {
  11923. G(j, e4);
  11924. };
  11925. }(e2), function(e3) {
  11926. e3.onNeedLogin = function(e4) {
  11927. V($, e4);
  11928. }, e3.offNeedLogin = function(e4) {
  11929. G($, e4);
  11930. }, ds && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = true, Z().then(() => {
  11931. ks.call(e3);
  11932. }), gs && As.call(e3)));
  11933. }(e2), function(e3) {
  11934. e3.onRefreshToken = function(e4) {
  11935. V(B, e4);
  11936. }, e3.offRefreshToken = function(e4) {
  11937. G(B, e4);
  11938. };
  11939. }(e2);
  11940. }
  11941. let Ps;
  11942. const Ts = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", xs = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  11943. function Os() {
  11944. const e2 = re().token || "", t2 = e2.split(".");
  11945. if (!e2 || 3 !== t2.length)
  11946. return { uid: null, role: [], permission: [], tokenExpired: 0 };
  11947. let n2;
  11948. try {
  11949. n2 = JSON.parse((s2 = t2[1], decodeURIComponent(Ps(s2).split("").map(function(e3) {
  11950. return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
  11951. }).join(""))));
  11952. } catch (e3) {
  11953. throw new Error("获取当前用户信息出错,详细错误信息为:" + e3.message);
  11954. }
  11955. var s2;
  11956. return n2.tokenExpired = 1e3 * n2.exp, delete n2.exp, delete n2.iat, n2;
  11957. }
  11958. Ps = "function" != typeof atob ? function(e2) {
  11959. if (e2 = String(e2).replace(/[\t\n\f\r ]+/g, ""), !xs.test(e2))
  11960. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  11961. var t2;
  11962. e2 += "==".slice(2 - (3 & e2.length));
  11963. for (var n2, s2, r2 = "", i2 = 0; i2 < e2.length; )
  11964. t2 = Ts.indexOf(e2.charAt(i2++)) << 18 | Ts.indexOf(e2.charAt(i2++)) << 12 | (n2 = Ts.indexOf(e2.charAt(i2++))) << 6 | (s2 = Ts.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);
  11965. return r2;
  11966. } : atob;
  11967. var Es = n(function(e2, t2) {
  11968. Object.defineProperty(t2, "__esModule", { value: true });
  11969. const n2 = "chooseAndUploadFile:ok", s2 = "chooseAndUploadFile:fail";
  11970. function r2(e3, t3) {
  11971. return e3.tempFiles.forEach((e4, n3) => {
  11972. 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("."));
  11973. }), e3.tempFilePaths || (e3.tempFilePaths = e3.tempFiles.map((e4) => e4.path)), e3;
  11974. }
  11975. function i2(e3, t3, { onChooseFile: s3, onUploadProgress: r3 }) {
  11976. return t3.then((e4) => {
  11977. if (s3) {
  11978. const t4 = s3(e4);
  11979. if (void 0 !== t4)
  11980. return Promise.resolve(t4).then((t5) => void 0 === t5 ? e4 : t5);
  11981. }
  11982. return e4;
  11983. }).then((t4) => false === t4 ? { errMsg: n2, tempFilePaths: [], tempFiles: [] } : function(e4, t5, s4 = 5, r4) {
  11984. (t5 = Object.assign({}, t5)).errMsg = n2;
  11985. const i3 = t5.tempFiles, o2 = i3.length;
  11986. let a2 = 0;
  11987. return new Promise((n3) => {
  11988. for (; a2 < s4; )
  11989. c2();
  11990. function c2() {
  11991. const s5 = a2++;
  11992. if (s5 >= o2)
  11993. return void (!i3.find((e5) => !e5.url && !e5.errMsg) && n3(t5));
  11994. const u2 = i3[s5];
  11995. e4.uploadFile({ provider: u2.provider, filePath: u2.path, cloudPath: u2.cloudPath, fileType: u2.fileType, cloudPathAsRealPath: u2.cloudPathAsRealPath, onUploadProgress(e5) {
  11996. e5.index = s5, e5.tempFile = u2, e5.tempFilePath = u2.path, r4 && r4(e5);
  11997. } }).then((e5) => {
  11998. u2.url = e5.fileID, s5 < o2 && c2();
  11999. }).catch((e5) => {
  12000. u2.errMsg = e5.errMsg || e5.message, s5 < o2 && c2();
  12001. });
  12002. }
  12003. });
  12004. }(e3, t4, 5, r3));
  12005. }
  12006. t2.initChooseAndUploadFile = function(e3) {
  12007. return function(t3 = { type: "all" }) {
  12008. return "image" === t3.type ? i2(e3, function(e4) {
  12009. const { count: t4, sizeType: n3, sourceType: i3 = ["album", "camera"], extension: o2 } = e4;
  12010. return new Promise((e5, a2) => {
  12011. uni.chooseImage({ count: t4, sizeType: n3, sourceType: i3, extension: o2, success(t5) {
  12012. e5(r2(t5, "image"));
  12013. }, fail(e6) {
  12014. a2({ errMsg: e6.errMsg.replace("chooseImage:fail", s2) });
  12015. } });
  12016. });
  12017. }(t3), t3) : "video" === t3.type ? i2(e3, function(e4) {
  12018. const { camera: t4, compressed: n3, maxDuration: i3, sourceType: o2 = ["album", "camera"], extension: a2 } = e4;
  12019. return new Promise((e5, c2) => {
  12020. uni.chooseVideo({ camera: t4, compressed: n3, maxDuration: i3, sourceType: o2, extension: a2, success(t5) {
  12021. const { tempFilePath: n4, duration: s3, size: i4, height: o3, width: a3 } = t5;
  12022. 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"));
  12023. }, fail(e6) {
  12024. c2({ errMsg: e6.errMsg.replace("chooseVideo:fail", s2) });
  12025. } });
  12026. });
  12027. }(t3), t3) : i2(e3, function(e4) {
  12028. const { count: t4, extension: n3 } = e4;
  12029. return new Promise((e5, i3) => {
  12030. let o2 = uni.chooseFile;
  12031. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o2 = wx.chooseMessageFile), "function" != typeof o2)
  12032. return i3({ errMsg: s2 + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });
  12033. o2({ type: "all", count: t4, extension: n3, success(t5) {
  12034. e5(r2(t5));
  12035. }, fail(e6) {
  12036. i3({ errMsg: e6.errMsg.replace("chooseFile:fail", s2) });
  12037. } });
  12038. });
  12039. }(t3), t3);
  12040. };
  12041. };
  12042. }), Ls = t$3(Es);
  12043. const Rs = "manual";
  12044. function Us(e2) {
  12045. 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() {
  12046. this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(() => {
  12047. var e3 = [];
  12048. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach((t2) => {
  12049. e3.push(this[t2]);
  12050. }), e3;
  12051. }, (e3, t2) => {
  12052. if (this.loadtime === Rs)
  12053. return;
  12054. let n2 = false;
  12055. const s2 = [];
  12056. for (let r2 = 2; r2 < e3.length; r2++)
  12057. e3[r2] !== t2[r2] && (s2.push(e3[r2]), n2 = true);
  12058. e3[0] !== t2[0] && (this.mixinDatacomPage.current = this.pageCurrent), this.mixinDatacomPage.size = this.pageSize, this.onMixinDatacomPropsChange(n2, s2);
  12059. });
  12060. }, methods: { onMixinDatacomPropsChange(e3, t2) {
  12061. }, mixinDatacomEasyGet({ getone: e3 = false, success: t2, fail: n2 } = {}) {
  12062. this.mixinDatacomLoading || (this.mixinDatacomLoading = true, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then((n3) => {
  12063. this.mixinDatacomLoading = false;
  12064. const { data: s2, count: r2 } = n3.result;
  12065. this.getcount && (this.mixinDatacomPage.count = r2), this.mixinDatacomHasMore = s2.length < this.pageSize;
  12066. const i2 = e3 ? s2.length ? s2[0] : void 0 : s2;
  12067. this.mixinDatacomResData = i2, t2 && t2(i2);
  12068. }).catch((e4) => {
  12069. this.mixinDatacomLoading = false, this.mixinDatacomErrorMessage = e4, this.mixinDatacomError = e4, n2 && n2(e4);
  12070. }));
  12071. }, mixinDatacomGet(t2 = {}) {
  12072. let n2;
  12073. t2 = t2 || {}, n2 = "undefined" != typeof __uniX && __uniX ? e2.databaseForJQL(this.spaceInfo) : e2.database(this.spaceInfo);
  12074. const s2 = t2.action || this.action;
  12075. s2 && (n2 = n2.action(s2));
  12076. const r2 = t2.collection || this.collection;
  12077. n2 = Array.isArray(r2) ? n2.collection(...r2) : n2.collection(r2);
  12078. const i2 = t2.where || this.where;
  12079. i2 && Object.keys(i2).length && (n2 = n2.where(i2));
  12080. const o2 = t2.field || this.field;
  12081. o2 && (n2 = n2.field(o2));
  12082. const a2 = t2.foreignKey || this.foreignKey;
  12083. a2 && (n2 = n2.foreignKey(a2));
  12084. const c2 = t2.groupby || this.groupby;
  12085. c2 && (n2 = n2.groupBy(c2));
  12086. const u2 = t2.groupField || this.groupField;
  12087. u2 && (n2 = n2.groupField(u2));
  12088. true === (void 0 !== t2.distinct ? t2.distinct : this.distinct) && (n2 = n2.distinct());
  12089. const h2 = t2.orderby || this.orderby;
  12090. h2 && (n2 = n2.orderBy(h2));
  12091. 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 };
  12092. return f2 && (m2.getTree = y2), g2 && (m2.getTreePath = y2), n2 = n2.skip(d2 * (l2 - 1)).limit(d2).get(m2), n2;
  12093. } } };
  12094. }
  12095. function Ns(e2) {
  12096. return function(t2, n2 = {}) {
  12097. n2 = function(e3, t3 = {}) {
  12098. 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;
  12099. }({ customUI: false, loadingOptions: { title: "加载中...", mask: true }, errorOptions: { type: "modal", retry: false } }, n2);
  12100. const { customUI: s2, loadingOptions: r2, errorOptions: i2, parseSystemError: o2 } = n2, a2 = !s2;
  12101. return new Proxy({}, { get(s3, c2) {
  12102. switch (c2) {
  12103. case "toString":
  12104. return "[object UniCloudObject]";
  12105. case "toJSON":
  12106. return {};
  12107. }
  12108. return function({ fn: e3, interceptorName: t3, getCallbackArgs: n3 } = {}) {
  12109. return async function(...s4) {
  12110. const r3 = n3 ? n3({ params: s4 }) : {};
  12111. let i3, o3;
  12112. try {
  12113. return await M(q(t3, "invoke"), { ...r3 }), i3 = await e3(...s4), await M(q(t3, "success"), { ...r3, result: i3 }), i3;
  12114. } catch (e4) {
  12115. throw o3 = e4, await M(q(t3, "fail"), { ...r3, error: o3 }), o3;
  12116. } finally {
  12117. await M(q(t3, "complete"), o3 ? { ...r3, error: o3 } : { ...r3, result: i3 });
  12118. }
  12119. };
  12120. }({ fn: async function s4(...h2) {
  12121. let l2;
  12122. a2 && uni.showLoading({ title: r2.title, mask: r2.mask });
  12123. const d2 = { name: t2, type: u, data: { method: c2, params: h2 } };
  12124. "object" == typeof n2.secretMethods && function(e3, t3) {
  12125. const n3 = t3.data.method, s5 = e3.secretMethods || {}, r3 = s5[n3] || s5["*"];
  12126. r3 && (t3.secretType = r3);
  12127. }(n2, d2);
  12128. let p2 = false;
  12129. try {
  12130. l2 = await e2.callFunction(d2);
  12131. } catch (e3) {
  12132. p2 = true, l2 = { result: new te(e3) };
  12133. }
  12134. const { errSubject: f2, errCode: g2, errMsg: m2, newToken: y2 } = l2.result || {};
  12135. if (a2 && uni.hideLoading(), y2 && y2.token && y2.tokenExpired && (ie(y2), Y(B, { ...y2 })), g2) {
  12136. let e3 = m2;
  12137. if (p2 && o2) {
  12138. e3 = (await o2({ objectName: t2, methodName: c2, params: h2, errSubject: f2, errCode: g2, errMsg: m2 })).errMsg || m2;
  12139. }
  12140. if (a2)
  12141. if ("toast" === i2.type)
  12142. uni.showToast({ title: e3, icon: "none" });
  12143. else {
  12144. if ("modal" !== i2.type)
  12145. throw new Error(`Invalid errorOptions.type: ${i2.type}`);
  12146. {
  12147. const { confirm: t3 } = await async function({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3 } = {}) {
  12148. return new Promise((i3, o3) => {
  12149. uni.showModal({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3, success(e5) {
  12150. i3(e5);
  12151. }, fail() {
  12152. i3({ confirm: false, cancel: true });
  12153. } });
  12154. });
  12155. }({ title: "提示", content: e3, showCancel: i2.retry, cancelText: "取消", confirmText: i2.retry ? "重试" : "确定" });
  12156. if (i2.retry && t3)
  12157. return s4(...h2);
  12158. }
  12159. }
  12160. const n3 = new te({ subject: f2, code: g2, message: m2, requestId: l2.requestId });
  12161. throw n3.detail = l2.result, Y(j, { type: z, content: n3 }), n3;
  12162. }
  12163. return Y(j, { type: z, content: l2.result }), l2.result;
  12164. }, interceptorName: "callObject", getCallbackArgs: function({ params: e3 } = {}) {
  12165. return { objectName: t2, methodName: c2, params: e3 };
  12166. } });
  12167. } });
  12168. };
  12169. }
  12170. function Ds(e2) {
  12171. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e2.config.spaceId));
  12172. }
  12173. async function Ms({ openid: e2, callLoginByWeixin: t2 = false } = {}) {
  12174. Ds(this);
  12175. throw new Error(`[SecureNetwork] API \`initSecureNetworkByWeixin\` is not supported on platform \`${C}\``);
  12176. }
  12177. async function qs(e2) {
  12178. const t2 = Ds(this);
  12179. return t2.initPromise || (t2.initPromise = Ms.call(this, e2).then((e3) => e3).catch((e3) => {
  12180. throw delete t2.initPromise, e3;
  12181. })), t2.initPromise;
  12182. }
  12183. function Fs(e2) {
  12184. return function({ openid: t2, callLoginByWeixin: n2 = false } = {}) {
  12185. return qs.call(e2, { openid: t2, callLoginByWeixin: n2 });
  12186. };
  12187. }
  12188. function Ks(e2) {
  12189. !function(e3) {
  12190. he = e3;
  12191. }(e2);
  12192. }
  12193. function js(e2) {
  12194. const t2 = { getSystemInfo: uni.getSystemInfo, getPushClientId: uni.getPushClientId };
  12195. return function(n2) {
  12196. return new Promise((s2, r2) => {
  12197. t2[e2]({ ...n2, success(e3) {
  12198. s2(e3);
  12199. }, fail(e3) {
  12200. r2(e3);
  12201. } });
  12202. });
  12203. };
  12204. }
  12205. class $s extends class {
  12206. constructor() {
  12207. this._callback = {};
  12208. }
  12209. addListener(e2, t2) {
  12210. this._callback[e2] || (this._callback[e2] = []), this._callback[e2].push(t2);
  12211. }
  12212. on(e2, t2) {
  12213. return this.addListener(e2, t2);
  12214. }
  12215. removeListener(e2, t2) {
  12216. if (!t2)
  12217. throw new Error('The "listener" argument must be of type function. Received undefined');
  12218. const n2 = this._callback[e2];
  12219. if (!n2)
  12220. return;
  12221. const s2 = function(e3, t3) {
  12222. for (let n3 = e3.length - 1; n3 >= 0; n3--)
  12223. if (e3[n3] === t3)
  12224. return n3;
  12225. return -1;
  12226. }(n2, t2);
  12227. n2.splice(s2, 1);
  12228. }
  12229. off(e2, t2) {
  12230. return this.removeListener(e2, t2);
  12231. }
  12232. removeAllListener(e2) {
  12233. delete this._callback[e2];
  12234. }
  12235. emit(e2, ...t2) {
  12236. const n2 = this._callback[e2];
  12237. if (n2)
  12238. for (let e3 = 0; e3 < n2.length; e3++)
  12239. n2[e3](...t2);
  12240. }
  12241. } {
  12242. constructor() {
  12243. super(), this._uniPushMessageCallback = this._receivePushMessage.bind(this), this._currentMessageId = -1, this._payloadQueue = [];
  12244. }
  12245. init() {
  12246. return Promise.all([js("getSystemInfo")(), js("getPushClientId")()]).then(([{ appId: e2 } = {}, { cid: t2 } = {}] = []) => {
  12247. if (!e2)
  12248. throw new Error("Invalid appId, please check the manifest.json file");
  12249. if (!t2)
  12250. throw new Error("Invalid push client id");
  12251. this._appId = e2, this._pushClientId = t2, this._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), this.emit("open"), this._initMessageListener();
  12252. }, (e2) => {
  12253. throw this.emit("error", e2), this.close(), e2;
  12254. });
  12255. }
  12256. async open() {
  12257. return this.init();
  12258. }
  12259. _isUniCloudSSE(e2) {
  12260. if ("receive" !== e2.type)
  12261. return false;
  12262. const t2 = e2 && e2.data && e2.data.payload;
  12263. return !(!t2 || "UNI_CLOUD_SSE" !== t2.channel || t2.seqId !== this._seqId);
  12264. }
  12265. _receivePushMessage(e2) {
  12266. if (!this._isUniCloudSSE(e2))
  12267. return;
  12268. const t2 = e2 && e2.data && e2.data.payload, { action: n2, messageId: s2, message: r2 } = t2;
  12269. this._payloadQueue.push({ action: n2, messageId: s2, message: r2 }), this._consumMessage();
  12270. }
  12271. _consumMessage() {
  12272. for (; ; ) {
  12273. const e2 = this._payloadQueue.find((e3) => e3.messageId === this._currentMessageId + 1);
  12274. if (!e2)
  12275. break;
  12276. this._currentMessageId++, this._parseMessagePayload(e2);
  12277. }
  12278. }
  12279. _parseMessagePayload(e2) {
  12280. const { action: t2, messageId: n2, message: s2 } = e2;
  12281. "end" === t2 ? this._end({ messageId: n2, message: s2 }) : "message" === t2 && this._appendMessage({ messageId: n2, message: s2 });
  12282. }
  12283. _appendMessage({ messageId: e2, message: t2 } = {}) {
  12284. this.emit("message", t2);
  12285. }
  12286. _end({ messageId: e2, message: t2 } = {}) {
  12287. this.emit("end", t2), this.close();
  12288. }
  12289. _initMessageListener() {
  12290. uni.onPushMessage(this._uniPushMessageCallback);
  12291. }
  12292. _destroy() {
  12293. uni.offPushMessage(this._uniPushMessageCallback);
  12294. }
  12295. toJSON() {
  12296. return { appId: this._appId, pushClientId: this._pushClientId, seqId: this._seqId };
  12297. }
  12298. close() {
  12299. this._destroy(), this.emit("close");
  12300. }
  12301. }
  12302. async function Bs(e2, t2) {
  12303. const n2 = `http://${e2}:${t2}/system/ping`;
  12304. try {
  12305. const e3 = await (s2 = { url: n2, timeout: 500 }, new Promise((e4, t3) => {
  12306. ne.request({ ...s2, success(t4) {
  12307. e4(t4);
  12308. }, fail(e5) {
  12309. t3(e5);
  12310. } });
  12311. }));
  12312. return !(!e3.data || 0 !== e3.data.code);
  12313. } catch (e3) {
  12314. return false;
  12315. }
  12316. var s2;
  12317. }
  12318. async function Ws(e2) {
  12319. {
  12320. const { osName: e3, osVersion: t3 } = ce();
  12321. "ios" === e3 && function(e4) {
  12322. if (!e4 || "string" != typeof e4)
  12323. return 0;
  12324. const t4 = e4.match(/^(\d+)./);
  12325. return t4 && t4[1] ? parseInt(t4[1]) : 0;
  12326. }(t3) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发期间需要,发行后不需要)");
  12327. }
  12328. const t2 = e2.__dev__;
  12329. if (!t2.debugInfo)
  12330. return;
  12331. const { address: n2, servePort: s2 } = t2.debugInfo, { address: r2 } = await async function(e3, t3) {
  12332. let n3;
  12333. for (let s3 = 0; s3 < e3.length; s3++) {
  12334. const r3 = e3[s3];
  12335. if (await Bs(r3, t3)) {
  12336. n3 = r3;
  12337. break;
  12338. }
  12339. }
  12340. return { address: n3, port: t3 };
  12341. }(n2, s2);
  12342. if (r2)
  12343. return t2.localAddress = r2, void (t2.localPort = s2);
  12344. const i2 = console["error"];
  12345. let o2 = "";
  12346. 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)
  12347. throw new Error(o2);
  12348. i2(o2);
  12349. }
  12350. function Hs(e2) {
  12351. e2._initPromiseHub || (e2._initPromiseHub = new v({ createPromise: function() {
  12352. let t2 = Promise.resolve();
  12353. var n2;
  12354. n2 = 1, t2 = new Promise((e3) => {
  12355. setTimeout(() => {
  12356. e3();
  12357. }, n2);
  12358. });
  12359. const s2 = e2.auth();
  12360. return t2.then(() => s2.getLoginState()).then((e3) => e3 ? Promise.resolve() : s2.signInAnonymously());
  12361. } }));
  12362. }
  12363. const zs = { tcb: bt, tencent: bt, aliyun: fe, private: At, alipay: Nt };
  12364. let Js = new class {
  12365. init(e2) {
  12366. let t2 = {};
  12367. const n2 = zs[e2.provider];
  12368. if (!n2)
  12369. throw new Error("未提供正确的provider参数");
  12370. t2 = n2.init(e2), function(e3) {
  12371. const t3 = {};
  12372. e3.__dev__ = t3, t3.debugLog = "app" === C;
  12373. const n3 = P;
  12374. n3 && !n3.code && (t3.debugInfo = n3);
  12375. const s2 = new v({ createPromise: function() {
  12376. return Ws(e3);
  12377. } });
  12378. t3.initLocalNetwork = function() {
  12379. return s2.exec();
  12380. };
  12381. }(t2), Hs(t2), Bn(t2), function(e3) {
  12382. const t3 = e3.uploadFile;
  12383. e3.uploadFile = function(e4) {
  12384. return t3.call(this, e4);
  12385. };
  12386. }(t2), function(e3) {
  12387. e3.database = function(t3) {
  12388. if (t3 && Object.keys(t3).length > 0)
  12389. return e3.init(t3).database();
  12390. if (this._database)
  12391. return this._database;
  12392. const n3 = es(ts, { uniClient: e3 });
  12393. return this._database = n3, n3;
  12394. }, e3.databaseForJQL = function(t3) {
  12395. if (t3 && Object.keys(t3).length > 0)
  12396. return e3.init(t3).databaseForJQL();
  12397. if (this._databaseForJQL)
  12398. return this._databaseForJQL;
  12399. const n3 = es(ts, { uniClient: e3, isJQL: true });
  12400. return this._databaseForJQL = n3, n3;
  12401. };
  12402. }(t2), function(e3) {
  12403. e3.getCurrentUserInfo = Os, e3.chooseAndUploadFile = Ls.initChooseAndUploadFile(e3), Object.assign(e3, { get mixinDatacom() {
  12404. return Us(e3);
  12405. } }), e3.SSEChannel = $s, e3.initSecureNetworkByWeixin = Fs(e3), e3.setCustomClientInfo = Ks, e3.importObject = Ns(e3);
  12406. }(t2);
  12407. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach((e3) => {
  12408. if (!t2[e3])
  12409. return;
  12410. const n3 = t2[e3];
  12411. t2[e3] = function() {
  12412. return n3.apply(t2, Array.from(arguments));
  12413. }, t2[e3] = (/* @__PURE__ */ function(e4, t3) {
  12414. return function(n4) {
  12415. let s2 = false;
  12416. if ("callFunction" === t3) {
  12417. const e5 = n4 && n4.type || c;
  12418. s2 = e5 !== c;
  12419. }
  12420. const r2 = "callFunction" === t3 && !s2, i2 = this._initPromiseHub.exec();
  12421. n4 = n4 || {};
  12422. const { success: o2, fail: a2, complete: u2 } = ee(n4), h2 = i2.then(() => s2 ? Promise.resolve() : M(q(t3, "invoke"), n4)).then(() => e4.call(this, n4)).then((e5) => s2 ? Promise.resolve(e5) : M(q(t3, "success"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (r2 && Y(j, { type: H, content: e5 }), Promise.resolve(e5))), (e5) => s2 ? Promise.reject(e5) : M(q(t3, "fail"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (Y(j, { type: H, content: e5 }), Promise.reject(e5))));
  12423. if (!(o2 || a2 || u2))
  12424. return h2;
  12425. h2.then((e5) => {
  12426. o2 && o2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
  12427. }, (e5) => {
  12428. a2 && a2(e5), u2 && u2(e5), r2 && Y(j, { type: H, content: e5 });
  12429. });
  12430. };
  12431. }(t2[e3], e3)).bind(t2);
  12432. }), t2.init = this.init, t2;
  12433. }
  12434. }();
  12435. (() => {
  12436. const e2 = T;
  12437. let t2 = {};
  12438. if (e2 && 1 === e2.length)
  12439. t2 = e2[0], Js = Js.init(t2), Js._isDefault = true;
  12440. else {
  12441. const t3 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  12442. let n2;
  12443. n2 = e2 && e2.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", t3.forEach((e3) => {
  12444. Js[e3] = function() {
  12445. return console.error(n2), Promise.reject(new te({ code: "SYS_ERR", message: n2 }));
  12446. };
  12447. });
  12448. }
  12449. Object.assign(Js, { get mixinDatacom() {
  12450. return Us(Js);
  12451. } }), Cs(Js), Js.addInterceptor = N, Js.removeInterceptor = D, Js.interceptObject = F;
  12452. })();
  12453. var Vs = Js;
  12454. const _sfc_main$D = {
  12455. name: "uni-stat-select",
  12456. mixins: [Vs.mixinDatacom || {}],
  12457. data() {
  12458. return {
  12459. showSelector: false,
  12460. current: "",
  12461. mixinDatacomResData: [],
  12462. apps: [],
  12463. channels: []
  12464. };
  12465. },
  12466. props: {
  12467. localdata: {
  12468. type: Array,
  12469. default() {
  12470. return [];
  12471. }
  12472. },
  12473. value: {
  12474. type: [String, Number],
  12475. default: ""
  12476. },
  12477. modelValue: {
  12478. type: [String, Number],
  12479. default: ""
  12480. },
  12481. label: {
  12482. type: String,
  12483. default: ""
  12484. },
  12485. placeholder: {
  12486. type: String,
  12487. default: "请选择"
  12488. },
  12489. emptyTips: {
  12490. type: String,
  12491. default: "无选项"
  12492. },
  12493. clear: {
  12494. type: Boolean,
  12495. default: true
  12496. },
  12497. defItem: {
  12498. type: Number,
  12499. default: 0
  12500. },
  12501. disabled: {
  12502. type: Boolean,
  12503. default: false
  12504. }
  12505. },
  12506. created() {
  12507. this.last = `${this.collection}_last_selected_option_value`;
  12508. if (this.collection && !this.localdata.length) {
  12509. this.mixinDatacomEasyGet();
  12510. }
  12511. },
  12512. computed: {
  12513. typePlaceholder() {
  12514. const text = {
  12515. "opendb-stat-app-versions": "版本",
  12516. "opendb-app-channels": "渠道",
  12517. "opendb-app-list": "应用"
  12518. };
  12519. const common = this.placeholder;
  12520. const placeholder = text[this.collection];
  12521. return placeholder ? common + placeholder : common;
  12522. }
  12523. },
  12524. watch: {
  12525. localdata: {
  12526. immediate: true,
  12527. handler(val, old) {
  12528. if (Array.isArray(val) && old !== val) {
  12529. this.mixinDatacomResData = val;
  12530. }
  12531. }
  12532. },
  12533. modelValue() {
  12534. this.initDefVal();
  12535. },
  12536. mixinDatacomResData: {
  12537. immediate: true,
  12538. handler(val) {
  12539. if (val.length) {
  12540. this.initDefVal();
  12541. }
  12542. }
  12543. }
  12544. },
  12545. methods: {
  12546. initDefVal() {
  12547. let defValue = "";
  12548. if ((this.value || this.value === 0) && !this.isDisabled(this.value)) {
  12549. defValue = this.value;
  12550. } else if ((this.modelValue || this.modelValue === 0) && !this.isDisabled(this.modelValue)) {
  12551. defValue = this.modelValue;
  12552. } else {
  12553. let strogeValue;
  12554. if (this.collection) {
  12555. strogeValue = uni.getStorageSync(this.last);
  12556. }
  12557. if (strogeValue || strogeValue === 0) {
  12558. defValue = strogeValue;
  12559. } else {
  12560. let defItem = "";
  12561. if (this.defItem > 0 && this.defItem < this.mixinDatacomResData.length) {
  12562. defItem = this.mixinDatacomResData[this.defItem - 1].value;
  12563. }
  12564. defValue = defItem;
  12565. }
  12566. this.emit(defValue);
  12567. }
  12568. const def = this.mixinDatacomResData.find((item) => item.value === defValue);
  12569. this.current = def ? this.formatItemName(def) : "";
  12570. },
  12571. /**
  12572. * @param {[String, Number]} value
  12573. * 判断用户给的 value 是否同时为禁用状态
  12574. */
  12575. isDisabled(value) {
  12576. let isDisabled = false;
  12577. this.mixinDatacomResData.forEach((item) => {
  12578. if (item.value === value) {
  12579. isDisabled = item.disable;
  12580. }
  12581. });
  12582. return isDisabled;
  12583. },
  12584. clearVal() {
  12585. this.emit("");
  12586. if (this.collection) {
  12587. uni.removeStorageSync(this.last);
  12588. }
  12589. },
  12590. change(item) {
  12591. if (!item.disable) {
  12592. this.showSelector = false;
  12593. this.current = this.formatItemName(item);
  12594. this.emit(item.value);
  12595. }
  12596. },
  12597. emit(val) {
  12598. this.$emit("change", val);
  12599. this.$emit("input", val);
  12600. this.$emit("update:modelValue", val);
  12601. if (this.collection) {
  12602. uni.setStorageSync(this.last, val);
  12603. }
  12604. },
  12605. toggleSelector() {
  12606. if (this.disabled) {
  12607. return;
  12608. }
  12609. this.showSelector = !this.showSelector;
  12610. },
  12611. formatItemName(item) {
  12612. let {
  12613. text,
  12614. value,
  12615. channel_code
  12616. } = item;
  12617. channel_code = channel_code ? `(${channel_code})` : "";
  12618. return this.collection.indexOf("app-list") > 0 ? `${text}(${value})` : text ? text : `未命名${channel_code}`;
  12619. }
  12620. }
  12621. };
  12622. function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
  12623. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  12624. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-stat__select" }, [
  12625. $props.label ? (vue.openBlock(), vue.createElementBlock(
  12626. "span",
  12627. {
  12628. key: 0,
  12629. class: "uni-label-text hide-on-phone"
  12630. },
  12631. vue.toDisplayString($props.label + ":"),
  12632. 1
  12633. /* TEXT */
  12634. )) : vue.createCommentVNode("v-if", true),
  12635. vue.createElementVNode(
  12636. "view",
  12637. {
  12638. class: vue.normalizeClass(["uni-stat-box", { "uni-stat__actived": $data.current }])
  12639. },
  12640. [
  12641. vue.createElementVNode(
  12642. "view",
  12643. {
  12644. class: vue.normalizeClass(["uni-select", { "uni-select--disabled": $props.disabled }])
  12645. },
  12646. [
  12647. vue.createElementVNode("view", {
  12648. class: "uni-select__input-box",
  12649. onClick: _cache[0] || (_cache[0] = (...args) => $options.toggleSelector && $options.toggleSelector(...args))
  12650. }, [
  12651. $data.current ? (vue.openBlock(), vue.createElementBlock(
  12652. "view",
  12653. {
  12654. key: 0,
  12655. class: "uni-select__input-text"
  12656. },
  12657. vue.toDisplayString($data.current),
  12658. 1
  12659. /* TEXT */
  12660. )) : (vue.openBlock(), vue.createElementBlock(
  12661. "view",
  12662. {
  12663. key: 1,
  12664. class: "uni-select__input-text uni-select__input-placeholder"
  12665. },
  12666. vue.toDisplayString($options.typePlaceholder),
  12667. 1
  12668. /* TEXT */
  12669. )),
  12670. $data.current && $props.clear ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  12671. key: 2,
  12672. type: "clear",
  12673. color: "#c0c4cc",
  12674. size: "24",
  12675. onClick: $options.clearVal
  12676. }, null, 8, ["onClick"])) : (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  12677. key: 3,
  12678. type: $data.showSelector ? "top" : "bottom",
  12679. size: "14",
  12680. color: "#999"
  12681. }, null, 8, ["type"]))
  12682. ]),
  12683. $data.showSelector ? (vue.openBlock(), vue.createElementBlock("view", {
  12684. key: 0,
  12685. class: "uni-select--mask",
  12686. onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleSelector && $options.toggleSelector(...args))
  12687. })) : vue.createCommentVNode("v-if", true),
  12688. $data.showSelector ? (vue.openBlock(), vue.createElementBlock("view", {
  12689. key: 1,
  12690. class: "uni-select__selector"
  12691. }, [
  12692. vue.createElementVNode("view", { class: "uni-popper__arrow" }),
  12693. vue.createElementVNode("scroll-view", {
  12694. "scroll-y": "true",
  12695. class: "uni-select__selector-scroll"
  12696. }, [
  12697. $data.mixinDatacomResData.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  12698. key: 0,
  12699. class: "uni-select__selector-empty"
  12700. }, [
  12701. vue.createElementVNode(
  12702. "text",
  12703. null,
  12704. vue.toDisplayString($props.emptyTips),
  12705. 1
  12706. /* TEXT */
  12707. )
  12708. ])) : (vue.openBlock(true), vue.createElementBlock(
  12709. vue.Fragment,
  12710. { key: 1 },
  12711. vue.renderList($data.mixinDatacomResData, (item, index) => {
  12712. return vue.openBlock(), vue.createElementBlock("view", {
  12713. class: "uni-select__selector-item",
  12714. key: index,
  12715. onClick: ($event) => $options.change(item)
  12716. }, [
  12717. vue.createElementVNode(
  12718. "text",
  12719. {
  12720. class: vue.normalizeClass({ "uni-select__selector__disabled": item.disable })
  12721. },
  12722. vue.toDisplayString($options.formatItemName(item)),
  12723. 3
  12724. /* TEXT, CLASS */
  12725. )
  12726. ], 8, ["onClick"]);
  12727. }),
  12728. 128
  12729. /* KEYED_FRAGMENT */
  12730. ))
  12731. ])
  12732. ])) : vue.createCommentVNode("v-if", true)
  12733. ],
  12734. 2
  12735. /* CLASS */
  12736. )
  12737. ],
  12738. 2
  12739. /* CLASS */
  12740. )
  12741. ]);
  12742. }
  12743. const __easycom_0$3 = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$C], ["__scopeId", "data-v-123e8af9"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-data-select/uni-data-select.vue"]]);
  12744. const popup = {
  12745. data() {
  12746. return {};
  12747. },
  12748. created() {
  12749. this.popup = this.getParent();
  12750. },
  12751. methods: {
  12752. /**
  12753. * 获取父元素实例
  12754. */
  12755. getParent(name = "uniPopup") {
  12756. let parent = this.$parent;
  12757. let parentName = parent.$options.name;
  12758. while (parentName !== name) {
  12759. parent = parent.$parent;
  12760. if (!parent)
  12761. return false;
  12762. parentName = parent.$options.name;
  12763. }
  12764. return parent;
  12765. }
  12766. }
  12767. };
  12768. const _sfc_main$C = {
  12769. name: "uniPopupMessage",
  12770. mixins: [popup],
  12771. props: {
  12772. /**
  12773. * 主题 success/warning/info/error 默认 success
  12774. */
  12775. type: {
  12776. type: String,
  12777. default: "success"
  12778. },
  12779. /**
  12780. * 消息文字
  12781. */
  12782. message: {
  12783. type: String,
  12784. default: ""
  12785. },
  12786. /**
  12787. * 显示时间,设置为 0 则不会自动关闭
  12788. */
  12789. duration: {
  12790. type: Number,
  12791. default: 3e3
  12792. },
  12793. maskShow: {
  12794. type: Boolean,
  12795. default: false
  12796. }
  12797. },
  12798. data() {
  12799. return {};
  12800. },
  12801. created() {
  12802. this.popup.maskShow = this.maskShow;
  12803. this.popup.messageChild = this;
  12804. },
  12805. methods: {
  12806. timerClose() {
  12807. if (this.duration === 0)
  12808. return;
  12809. clearTimeout(this.timer);
  12810. this.timer = setTimeout(() => {
  12811. this.popup.close();
  12812. }, this.duration);
  12813. }
  12814. }
  12815. };
  12816. function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
  12817. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-popup-message" }, [
  12818. vue.createElementVNode(
  12819. "view",
  12820. {
  12821. class: vue.normalizeClass(["uni-popup-message__box fixforpc-width", "uni-popup__" + $props.type])
  12822. },
  12823. [
  12824. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  12825. vue.createElementVNode(
  12826. "text",
  12827. {
  12828. class: vue.normalizeClass(["uni-popup-message-text", "uni-popup__" + $props.type + "-text"])
  12829. },
  12830. vue.toDisplayString($props.message),
  12831. 3
  12832. /* TEXT, CLASS */
  12833. )
  12834. ], true)
  12835. ],
  12836. 2
  12837. /* CLASS */
  12838. )
  12839. ]);
  12840. }
  12841. const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$B], ["__scopeId", "data-v-515d10d7"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-popup-message/uni-popup-message.vue"]]);
  12842. const isObject = (val) => val !== null && typeof val === "object";
  12843. const defaultDelimiters = ["{", "}"];
  12844. class BaseFormatter {
  12845. constructor() {
  12846. this._caches = /* @__PURE__ */ Object.create(null);
  12847. }
  12848. interpolate(message, values, delimiters = defaultDelimiters) {
  12849. if (!values) {
  12850. return [message];
  12851. }
  12852. let tokens = this._caches[message];
  12853. if (!tokens) {
  12854. tokens = parse(message, delimiters);
  12855. this._caches[message] = tokens;
  12856. }
  12857. return compile(tokens, values);
  12858. }
  12859. }
  12860. const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  12861. const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  12862. function parse(format, [startDelimiter, endDelimiter]) {
  12863. const tokens = [];
  12864. let position = 0;
  12865. let text = "";
  12866. while (position < format.length) {
  12867. let char = format[position++];
  12868. if (char === startDelimiter) {
  12869. if (text) {
  12870. tokens.push({ type: "text", value: text });
  12871. }
  12872. text = "";
  12873. let sub = "";
  12874. char = format[position++];
  12875. while (char !== void 0 && char !== endDelimiter) {
  12876. sub += char;
  12877. char = format[position++];
  12878. }
  12879. const isClosed = char === endDelimiter;
  12880. const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
  12881. tokens.push({ value: sub, type });
  12882. } else {
  12883. text += char;
  12884. }
  12885. }
  12886. text && tokens.push({ type: "text", value: text });
  12887. return tokens;
  12888. }
  12889. function compile(tokens, values) {
  12890. const compiled = [];
  12891. let index = 0;
  12892. const mode = Array.isArray(values) ? "list" : isObject(values) ? "named" : "unknown";
  12893. if (mode === "unknown") {
  12894. return compiled;
  12895. }
  12896. while (index < tokens.length) {
  12897. const token = tokens[index];
  12898. switch (token.type) {
  12899. case "text":
  12900. compiled.push(token.value);
  12901. break;
  12902. case "list":
  12903. compiled.push(values[parseInt(token.value, 10)]);
  12904. break;
  12905. case "named":
  12906. if (mode === "named") {
  12907. compiled.push(values[token.value]);
  12908. } else {
  12909. {
  12910. console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);
  12911. }
  12912. }
  12913. break;
  12914. case "unknown":
  12915. {
  12916. console.warn(`Detect 'unknown' type of token!`);
  12917. }
  12918. break;
  12919. }
  12920. index++;
  12921. }
  12922. return compiled;
  12923. }
  12924. const LOCALE_ZH_HANS = "zh-Hans";
  12925. const LOCALE_ZH_HANT = "zh-Hant";
  12926. const LOCALE_EN = "en";
  12927. const LOCALE_FR = "fr";
  12928. const LOCALE_ES = "es";
  12929. const hasOwnProperty = Object.prototype.hasOwnProperty;
  12930. const hasOwn = (val, key) => hasOwnProperty.call(val, key);
  12931. const defaultFormatter = new BaseFormatter();
  12932. function include(str, parts) {
  12933. return !!parts.find((part) => str.indexOf(part) !== -1);
  12934. }
  12935. function startsWith(str, parts) {
  12936. return parts.find((part) => str.indexOf(part) === 0);
  12937. }
  12938. function normalizeLocale(locale, messages2) {
  12939. if (!locale) {
  12940. return;
  12941. }
  12942. locale = locale.trim().replace(/_/g, "-");
  12943. if (messages2 && messages2[locale]) {
  12944. return locale;
  12945. }
  12946. locale = locale.toLowerCase();
  12947. if (locale === "chinese") {
  12948. return LOCALE_ZH_HANS;
  12949. }
  12950. if (locale.indexOf("zh") === 0) {
  12951. if (locale.indexOf("-hans") > -1) {
  12952. return LOCALE_ZH_HANS;
  12953. }
  12954. if (locale.indexOf("-hant") > -1) {
  12955. return LOCALE_ZH_HANT;
  12956. }
  12957. if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
  12958. return LOCALE_ZH_HANT;
  12959. }
  12960. return LOCALE_ZH_HANS;
  12961. }
  12962. let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  12963. if (messages2 && Object.keys(messages2).length > 0) {
  12964. locales = Object.keys(messages2);
  12965. }
  12966. const lang = startsWith(locale, locales);
  12967. if (lang) {
  12968. return lang;
  12969. }
  12970. }
  12971. class I18n {
  12972. constructor({ locale, fallbackLocale, messages: messages2, watcher, formater: formater2 }) {
  12973. this.locale = LOCALE_EN;
  12974. this.fallbackLocale = LOCALE_EN;
  12975. this.message = {};
  12976. this.messages = {};
  12977. this.watchers = [];
  12978. if (fallbackLocale) {
  12979. this.fallbackLocale = fallbackLocale;
  12980. }
  12981. this.formater = formater2 || defaultFormatter;
  12982. this.messages = messages2 || {};
  12983. this.setLocale(locale || LOCALE_EN);
  12984. if (watcher) {
  12985. this.watchLocale(watcher);
  12986. }
  12987. }
  12988. setLocale(locale) {
  12989. const oldLocale = this.locale;
  12990. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  12991. if (!this.messages[this.locale]) {
  12992. this.messages[this.locale] = {};
  12993. }
  12994. this.message = this.messages[this.locale];
  12995. if (oldLocale !== this.locale) {
  12996. this.watchers.forEach((watcher) => {
  12997. watcher(this.locale, oldLocale);
  12998. });
  12999. }
  13000. }
  13001. getLocale() {
  13002. return this.locale;
  13003. }
  13004. watchLocale(fn) {
  13005. const index = this.watchers.push(fn) - 1;
  13006. return () => {
  13007. this.watchers.splice(index, 1);
  13008. };
  13009. }
  13010. add(locale, message, override = true) {
  13011. const curMessages = this.messages[locale];
  13012. if (curMessages) {
  13013. if (override) {
  13014. Object.assign(curMessages, message);
  13015. } else {
  13016. Object.keys(message).forEach((key) => {
  13017. if (!hasOwn(curMessages, key)) {
  13018. curMessages[key] = message[key];
  13019. }
  13020. });
  13021. }
  13022. } else {
  13023. this.messages[locale] = message;
  13024. }
  13025. }
  13026. f(message, values, delimiters) {
  13027. return this.formater.interpolate(message, values, delimiters).join("");
  13028. }
  13029. t(key, locale, values) {
  13030. let message = this.message;
  13031. if (typeof locale === "string") {
  13032. locale = normalizeLocale(locale, this.messages);
  13033. locale && (message = this.messages[locale]);
  13034. } else {
  13035. values = locale;
  13036. }
  13037. if (!hasOwn(message, key)) {
  13038. console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
  13039. return key;
  13040. }
  13041. return this.formater.interpolate(message[key], values).join("");
  13042. }
  13043. }
  13044. function watchAppLocale(appVm, i18n) {
  13045. if (appVm.$watchLocale) {
  13046. appVm.$watchLocale((newLocale) => {
  13047. i18n.setLocale(newLocale);
  13048. });
  13049. } else {
  13050. appVm.$watch(() => appVm.$locale, (newLocale) => {
  13051. i18n.setLocale(newLocale);
  13052. });
  13053. }
  13054. }
  13055. function getDefaultLocale() {
  13056. if (typeof uni !== "undefined" && uni.getLocale) {
  13057. return uni.getLocale();
  13058. }
  13059. if (typeof global !== "undefined" && global.getLocale) {
  13060. return global.getLocale();
  13061. }
  13062. return LOCALE_EN;
  13063. }
  13064. function initVueI18n(locale, messages2 = {}, fallbackLocale, watcher) {
  13065. if (typeof locale !== "string") {
  13066. const options = [
  13067. messages2,
  13068. locale
  13069. ];
  13070. locale = options[0];
  13071. messages2 = options[1];
  13072. }
  13073. if (typeof locale !== "string") {
  13074. locale = getDefaultLocale();
  13075. }
  13076. if (typeof fallbackLocale !== "string") {
  13077. fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
  13078. }
  13079. const i18n = new I18n({
  13080. locale,
  13081. fallbackLocale,
  13082. messages: messages2,
  13083. watcher
  13084. });
  13085. let t2 = (key, values) => {
  13086. if (typeof getApp !== "function") {
  13087. t2 = function(key2, values2) {
  13088. return i18n.t(key2, values2);
  13089. };
  13090. } else {
  13091. let isWatchedAppLocale = false;
  13092. t2 = function(key2, values2) {
  13093. const appVm = getApp().$vm;
  13094. if (appVm) {
  13095. appVm.$locale;
  13096. if (!isWatchedAppLocale) {
  13097. isWatchedAppLocale = true;
  13098. watchAppLocale(appVm, i18n);
  13099. }
  13100. }
  13101. return i18n.t(key2, values2);
  13102. };
  13103. }
  13104. return t2(key, values);
  13105. };
  13106. return {
  13107. i18n,
  13108. f(message, values, delimiters) {
  13109. return i18n.f(message, values, delimiters);
  13110. },
  13111. t(key, values) {
  13112. return t2(key, values);
  13113. },
  13114. add(locale2, message, override = true) {
  13115. return i18n.add(locale2, message, override);
  13116. },
  13117. watch(fn) {
  13118. return i18n.watchLocale(fn);
  13119. },
  13120. getLocale() {
  13121. return i18n.getLocale();
  13122. },
  13123. setLocale(newLocale) {
  13124. return i18n.setLocale(newLocale);
  13125. }
  13126. };
  13127. }
  13128. const en$2 = {
  13129. "uni-load-more.contentdown": "Pull up to show more",
  13130. "uni-load-more.contentrefresh": "loading...",
  13131. "uni-load-more.contentnomore": "No more data"
  13132. };
  13133. const zhHans$2 = {
  13134. "uni-load-more.contentdown": "上拉显示更多",
  13135. "uni-load-more.contentrefresh": "正在加载...",
  13136. "uni-load-more.contentnomore": "没有更多数据了"
  13137. };
  13138. const zhHant$2 = {
  13139. "uni-load-more.contentdown": "上拉顯示更多",
  13140. "uni-load-more.contentrefresh": "正在加載...",
  13141. "uni-load-more.contentnomore": "沒有更多數據了"
  13142. };
  13143. const messages$2 = {
  13144. en: en$2,
  13145. "zh-Hans": zhHans$2,
  13146. "zh-Hant": zhHant$2
  13147. };
  13148. let platform;
  13149. setTimeout(() => {
  13150. platform = uni.getSystemInfoSync().platform;
  13151. }, 16);
  13152. const {
  13153. t: t$2
  13154. } = initVueI18n(messages$2);
  13155. const _sfc_main$B = {
  13156. name: "UniLoadMore",
  13157. emits: ["clickLoadMore"],
  13158. props: {
  13159. status: {
  13160. // 上拉的状态:more-loading前;loading-loading中;noMore-没有更多了
  13161. type: String,
  13162. default: "more"
  13163. },
  13164. showIcon: {
  13165. type: Boolean,
  13166. default: true
  13167. },
  13168. iconType: {
  13169. type: String,
  13170. default: "auto"
  13171. },
  13172. iconSize: {
  13173. type: Number,
  13174. default: 24
  13175. },
  13176. color: {
  13177. type: String,
  13178. default: "#777777"
  13179. },
  13180. contentText: {
  13181. type: Object,
  13182. default() {
  13183. return {
  13184. contentdown: "",
  13185. contentrefresh: "",
  13186. contentnomore: ""
  13187. };
  13188. }
  13189. },
  13190. showText: {
  13191. type: Boolean,
  13192. default: true
  13193. }
  13194. },
  13195. data() {
  13196. return {
  13197. webviewHide: false,
  13198. platform,
  13199. 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="
  13200. };
  13201. },
  13202. computed: {
  13203. iconSnowWidth() {
  13204. return (Math.floor(this.iconSize / 24) || 1) * 2;
  13205. },
  13206. contentdownText() {
  13207. return this.contentText.contentdown || t$2("uni-load-more.contentdown");
  13208. },
  13209. contentrefreshText() {
  13210. return this.contentText.contentrefresh || t$2("uni-load-more.contentrefresh");
  13211. },
  13212. contentnomoreText() {
  13213. return this.contentText.contentnomore || t$2("uni-load-more.contentnomore");
  13214. }
  13215. },
  13216. mounted() {
  13217. var pages2 = getCurrentPages();
  13218. var page = pages2[pages2.length - 1];
  13219. var currentWebview = page.$getAppWebview();
  13220. currentWebview.addEventListener("hide", () => {
  13221. this.webviewHide = true;
  13222. });
  13223. currentWebview.addEventListener("show", () => {
  13224. this.webviewHide = false;
  13225. });
  13226. },
  13227. methods: {
  13228. onClick() {
  13229. this.$emit("clickLoadMore", {
  13230. detail: {
  13231. status: this.status
  13232. }
  13233. });
  13234. }
  13235. }
  13236. };
  13237. function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
  13238. return vue.openBlock(), vue.createElementBlock("view", {
  13239. class: "uni-load-more",
  13240. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  13241. }, [
  13242. !$data.webviewHide && ($props.iconType === "circle" || $props.iconType === "auto" && $data.platform === "android") && $props.status === "loading" && $props.showIcon ? (vue.openBlock(), vue.createElementBlock(
  13243. "view",
  13244. {
  13245. key: 0,
  13246. style: vue.normalizeStyle({ width: $props.iconSize + "px", height: $props.iconSize + "px" }),
  13247. class: "uni-load-more__img uni-load-more__img--android-MP"
  13248. },
  13249. [
  13250. vue.createElementVNode(
  13251. "view",
  13252. {
  13253. class: "uni-load-more__img-icon",
  13254. style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
  13255. },
  13256. null,
  13257. 4
  13258. /* STYLE */
  13259. ),
  13260. vue.createElementVNode(
  13261. "view",
  13262. {
  13263. class: "uni-load-more__img-icon",
  13264. style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
  13265. },
  13266. null,
  13267. 4
  13268. /* STYLE */
  13269. ),
  13270. vue.createElementVNode(
  13271. "view",
  13272. {
  13273. class: "uni-load-more__img-icon",
  13274. style: vue.normalizeStyle({ borderTopColor: $props.color, borderTopWidth: $props.iconSize / 12 })
  13275. },
  13276. null,
  13277. 4
  13278. /* STYLE */
  13279. )
  13280. ],
  13281. 4
  13282. /* STYLE */
  13283. )) : !$data.webviewHide && $props.status === "loading" && $props.showIcon ? (vue.openBlock(), vue.createElementBlock(
  13284. "view",
  13285. {
  13286. key: 1,
  13287. style: vue.normalizeStyle({ width: $props.iconSize + "px", height: $props.iconSize + "px" }),
  13288. class: "uni-load-more__img uni-load-more__img--ios-H5"
  13289. },
  13290. [
  13291. vue.createElementVNode("image", {
  13292. src: $data.imgBase64,
  13293. mode: "widthFix"
  13294. }, null, 8, ["src"])
  13295. ],
  13296. 4
  13297. /* STYLE */
  13298. )) : vue.createCommentVNode("v-if", true),
  13299. $props.showText ? (vue.openBlock(), vue.createElementBlock(
  13300. "text",
  13301. {
  13302. key: 2,
  13303. class: "uni-load-more__text",
  13304. style: vue.normalizeStyle({ color: $props.color })
  13305. },
  13306. vue.toDisplayString($props.status === "more" ? $options.contentdownText : $props.status === "loading" ? $options.contentrefreshText : $options.contentnomoreText),
  13307. 5
  13308. /* TEXT, STYLE */
  13309. )) : vue.createCommentVNode("v-if", true)
  13310. ]);
  13311. }
  13312. const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$A], ["__scopeId", "data-v-2c1dd21f"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.vue"]]);
  13313. const _sfc_main$A = {
  13314. name: "uniDataChecklist",
  13315. mixins: [Vs.mixinDatacom || {}],
  13316. emits: ["input", "update:modelValue", "change"],
  13317. props: {
  13318. mode: {
  13319. type: String,
  13320. default: "default"
  13321. },
  13322. multiple: {
  13323. type: Boolean,
  13324. default: false
  13325. },
  13326. value: {
  13327. type: [Array, String, Number],
  13328. default() {
  13329. return "";
  13330. }
  13331. },
  13332. // TODO vue3
  13333. modelValue: {
  13334. type: [Array, String, Number],
  13335. default() {
  13336. return "";
  13337. }
  13338. },
  13339. localdata: {
  13340. type: Array,
  13341. default() {
  13342. return [];
  13343. }
  13344. },
  13345. min: {
  13346. type: [Number, String],
  13347. default: ""
  13348. },
  13349. max: {
  13350. type: [Number, String],
  13351. default: ""
  13352. },
  13353. wrap: {
  13354. type: Boolean,
  13355. default: false
  13356. },
  13357. icon: {
  13358. type: String,
  13359. default: "left"
  13360. },
  13361. selectedColor: {
  13362. type: String,
  13363. default: ""
  13364. },
  13365. selectedTextColor: {
  13366. type: String,
  13367. default: ""
  13368. },
  13369. emptyText: {
  13370. type: String,
  13371. default: "暂无数据"
  13372. },
  13373. disabled: {
  13374. type: Boolean,
  13375. default: false
  13376. },
  13377. map: {
  13378. type: Object,
  13379. default() {
  13380. return {
  13381. text: "text",
  13382. value: "value"
  13383. };
  13384. }
  13385. }
  13386. },
  13387. watch: {
  13388. localdata: {
  13389. handler(newVal) {
  13390. this.range = newVal;
  13391. this.dataList = this.getDataList(this.getSelectedValue(newVal));
  13392. },
  13393. deep: true
  13394. },
  13395. mixinDatacomResData(newVal) {
  13396. this.range = newVal;
  13397. this.dataList = this.getDataList(this.getSelectedValue(newVal));
  13398. },
  13399. value(newVal) {
  13400. this.dataList = this.getDataList(newVal);
  13401. },
  13402. modelValue(newVal) {
  13403. this.dataList = this.getDataList(newVal);
  13404. }
  13405. },
  13406. data() {
  13407. return {
  13408. dataList: [],
  13409. range: [],
  13410. contentText: {
  13411. contentdown: "查看更多",
  13412. contentrefresh: "加载中",
  13413. contentnomore: "没有更多"
  13414. },
  13415. isLocal: true,
  13416. styles: {
  13417. selectedColor: "#2979ff",
  13418. selectedTextColor: "#666"
  13419. },
  13420. isTop: 0
  13421. };
  13422. },
  13423. computed: {
  13424. dataValue() {
  13425. if (this.value === "")
  13426. return this.modelValue;
  13427. if (this.modelValue === "")
  13428. return this.value;
  13429. return this.value;
  13430. }
  13431. },
  13432. created() {
  13433. if (this.localdata && this.localdata.length !== 0) {
  13434. this.isLocal = true;
  13435. this.range = this.localdata;
  13436. this.dataList = this.getDataList(this.getSelectedValue(this.range));
  13437. } else {
  13438. if (this.collection) {
  13439. this.isLocal = false;
  13440. this.loadData();
  13441. }
  13442. }
  13443. },
  13444. methods: {
  13445. loadData() {
  13446. this.mixinDatacomGet().then((res) => {
  13447. this.mixinDatacomResData = res.result.data;
  13448. if (this.mixinDatacomResData.length === 0) {
  13449. this.isLocal = false;
  13450. this.mixinDatacomErrorMessage = this.emptyText;
  13451. } else {
  13452. this.isLocal = true;
  13453. }
  13454. }).catch((err) => {
  13455. this.mixinDatacomErrorMessage = err.message;
  13456. });
  13457. },
  13458. /**
  13459. * 获取父元素实例
  13460. */
  13461. getForm(name = "uniForms") {
  13462. let parent = this.$parent;
  13463. let parentName = parent.$options.name;
  13464. while (parentName !== name) {
  13465. parent = parent.$parent;
  13466. if (!parent)
  13467. return false;
  13468. parentName = parent.$options.name;
  13469. }
  13470. return parent;
  13471. },
  13472. chagne(e2) {
  13473. const values = e2.detail.value;
  13474. let detail = {
  13475. value: [],
  13476. data: []
  13477. };
  13478. if (this.multiple) {
  13479. this.range.forEach((item) => {
  13480. if (values.includes(item[this.map.value] + "")) {
  13481. detail.value.push(item[this.map.value]);
  13482. detail.data.push(item);
  13483. }
  13484. });
  13485. } else {
  13486. const range = this.range.find((item) => item[this.map.value] + "" === values);
  13487. if (range) {
  13488. detail = {
  13489. value: range[this.map.value],
  13490. data: range
  13491. };
  13492. }
  13493. }
  13494. this.$emit("input", detail.value);
  13495. this.$emit("update:modelValue", detail.value);
  13496. this.$emit("change", {
  13497. detail
  13498. });
  13499. if (this.multiple) {
  13500. this.dataList = this.getDataList(detail.value, true);
  13501. } else {
  13502. this.dataList = this.getDataList(detail.value);
  13503. }
  13504. },
  13505. /**
  13506. * 获取渲染的新数组
  13507. * @param {Object} value 选中内容
  13508. */
  13509. getDataList(value) {
  13510. let dataList = JSON.parse(JSON.stringify(this.range));
  13511. let list = [];
  13512. if (this.multiple) {
  13513. if (!Array.isArray(value)) {
  13514. value = [];
  13515. }
  13516. }
  13517. dataList.forEach((item, index) => {
  13518. item.disabled = item.disable || item.disabled || false;
  13519. if (this.multiple) {
  13520. if (value.length > 0) {
  13521. let have = value.find((val) => val === item[this.map.value]);
  13522. item.selected = have !== void 0;
  13523. } else {
  13524. item.selected = false;
  13525. }
  13526. } else {
  13527. item.selected = value === item[this.map.value];
  13528. }
  13529. list.push(item);
  13530. });
  13531. return this.setRange(list);
  13532. },
  13533. /**
  13534. * 处理最大最小值
  13535. * @param {Object} list
  13536. */
  13537. setRange(list) {
  13538. let selectList = list.filter((item) => item.selected);
  13539. let min = Number(this.min) || 0;
  13540. let max = Number(this.max) || "";
  13541. list.forEach((item, index) => {
  13542. if (this.multiple) {
  13543. if (selectList.length <= min) {
  13544. let have = selectList.find((val) => val[this.map.value] === item[this.map.value]);
  13545. if (have !== void 0) {
  13546. item.disabled = true;
  13547. }
  13548. }
  13549. if (selectList.length >= max && max !== "") {
  13550. let have = selectList.find((val) => val[this.map.value] === item[this.map.value]);
  13551. if (have === void 0) {
  13552. item.disabled = true;
  13553. }
  13554. }
  13555. }
  13556. this.setStyles(item, index);
  13557. list[index] = item;
  13558. });
  13559. return list;
  13560. },
  13561. /**
  13562. * 设置 class
  13563. * @param {Object} item
  13564. * @param {Object} index
  13565. */
  13566. setStyles(item, index) {
  13567. item.styleBackgroud = this.setStyleBackgroud(item);
  13568. item.styleIcon = this.setStyleIcon(item);
  13569. item.styleIconText = this.setStyleIconText(item);
  13570. item.styleRightIcon = this.setStyleRightIcon(item);
  13571. },
  13572. /**
  13573. * 获取选中值
  13574. * @param {Object} range
  13575. */
  13576. getSelectedValue(range) {
  13577. if (!this.multiple)
  13578. return this.dataValue;
  13579. let selectedArr = [];
  13580. range.forEach((item) => {
  13581. if (item.selected) {
  13582. selectedArr.push(item[this.map.value]);
  13583. }
  13584. });
  13585. return this.dataValue.length > 0 ? this.dataValue : selectedArr;
  13586. },
  13587. /**
  13588. * 设置背景样式
  13589. */
  13590. setStyleBackgroud(item) {
  13591. let styles = {};
  13592. let selectedColor = this.selectedColor ? this.selectedColor : "#2979ff";
  13593. if (this.selectedColor) {
  13594. if (this.mode !== "list") {
  13595. styles["border-color"] = item.selected ? selectedColor : "#DCDFE6";
  13596. }
  13597. if (this.mode === "tag") {
  13598. styles["background-color"] = item.selected ? selectedColor : "#f5f5f5";
  13599. }
  13600. }
  13601. let classles = "";
  13602. for (let i2 in styles) {
  13603. classles += `${i2}:${styles[i2]};`;
  13604. }
  13605. return classles;
  13606. },
  13607. setStyleIcon(item) {
  13608. let styles = {};
  13609. let classles = "";
  13610. if (this.selectedColor) {
  13611. let selectedColor = this.selectedColor ? this.selectedColor : "#2979ff";
  13612. styles["background-color"] = item.selected ? selectedColor : "#fff";
  13613. styles["border-color"] = item.selected ? selectedColor : "#DCDFE6";
  13614. if (!item.selected && item.disabled) {
  13615. styles["background-color"] = "#F2F6FC";
  13616. styles["border-color"] = item.selected ? selectedColor : "#DCDFE6";
  13617. }
  13618. }
  13619. for (let i2 in styles) {
  13620. classles += `${i2}:${styles[i2]};`;
  13621. }
  13622. return classles;
  13623. },
  13624. setStyleIconText(item) {
  13625. let styles = {};
  13626. let classles = "";
  13627. if (this.selectedColor) {
  13628. let selectedColor = this.selectedColor ? this.selectedColor : "#2979ff";
  13629. if (this.mode === "tag") {
  13630. styles.color = item.selected ? this.selectedTextColor ? this.selectedTextColor : "#fff" : "#666";
  13631. } else {
  13632. styles.color = item.selected ? this.selectedTextColor ? this.selectedTextColor : selectedColor : "#666";
  13633. }
  13634. if (!item.selected && item.disabled) {
  13635. styles.color = "#999";
  13636. }
  13637. }
  13638. for (let i2 in styles) {
  13639. classles += `${i2}:${styles[i2]};`;
  13640. }
  13641. return classles;
  13642. },
  13643. setStyleRightIcon(item) {
  13644. let styles = {};
  13645. let classles = "";
  13646. if (this.mode === "list") {
  13647. styles["border-color"] = item.selected ? this.styles.selectedColor : "#DCDFE6";
  13648. }
  13649. for (let i2 in styles) {
  13650. classles += `${i2}:${styles[i2]};`;
  13651. }
  13652. return classles;
  13653. }
  13654. }
  13655. };
  13656. function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
  13657. const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_0$2);
  13658. return vue.openBlock(), vue.createElementBlock(
  13659. "view",
  13660. {
  13661. class: "uni-data-checklist",
  13662. style: vue.normalizeStyle({ "margin-top": $data.isTop + "px" })
  13663. },
  13664. [
  13665. !$data.isLocal ? (vue.openBlock(), vue.createElementBlock("view", {
  13666. key: 0,
  13667. class: "uni-data-loading"
  13668. }, [
  13669. !_ctx.mixinDatacomErrorMessage ? (vue.openBlock(), vue.createBlock(_component_uni_load_more, {
  13670. key: 0,
  13671. status: "loading",
  13672. iconType: "snow",
  13673. iconSize: 18,
  13674. "content-text": $data.contentText
  13675. }, null, 8, ["content-text"])) : (vue.openBlock(), vue.createElementBlock(
  13676. "text",
  13677. { key: 1 },
  13678. vue.toDisplayString(_ctx.mixinDatacomErrorMessage),
  13679. 1
  13680. /* TEXT */
  13681. ))
  13682. ])) : (vue.openBlock(), vue.createElementBlock(
  13683. vue.Fragment,
  13684. { key: 1 },
  13685. [
  13686. $props.multiple ? (vue.openBlock(), vue.createElementBlock(
  13687. "checkbox-group",
  13688. {
  13689. key: 0,
  13690. class: vue.normalizeClass(["checklist-group", { "is-list": $props.mode === "list" || $props.wrap }]),
  13691. onChange: _cache[0] || (_cache[0] = (...args) => $options.chagne && $options.chagne(...args))
  13692. },
  13693. [
  13694. (vue.openBlock(true), vue.createElementBlock(
  13695. vue.Fragment,
  13696. null,
  13697. vue.renderList($data.dataList, (item, index) => {
  13698. return vue.openBlock(), vue.createElementBlock(
  13699. "label",
  13700. {
  13701. 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" : ""]]),
  13702. style: vue.normalizeStyle(item.styleBackgroud),
  13703. key: index
  13704. },
  13705. [
  13706. vue.createElementVNode("checkbox", {
  13707. class: "hidden",
  13708. hidden: "",
  13709. disabled: $props.disabled || !!item.disabled,
  13710. value: item[$props.map.value] + "",
  13711. checked: item.selected
  13712. }, null, 8, ["disabled", "value", "checked"]),
  13713. $props.mode !== "tag" && $props.mode !== "list" || $props.mode === "list" && $props.icon === "left" ? (vue.openBlock(), vue.createElementBlock(
  13714. "view",
  13715. {
  13716. key: 0,
  13717. class: "checkbox__inner",
  13718. style: vue.normalizeStyle(item.styleIcon)
  13719. },
  13720. [
  13721. vue.createElementVNode("view", { class: "checkbox__inner-icon" })
  13722. ],
  13723. 4
  13724. /* STYLE */
  13725. )) : vue.createCommentVNode("v-if", true),
  13726. vue.createElementVNode(
  13727. "view",
  13728. {
  13729. class: vue.normalizeClass(["checklist-content", { "list-content": $props.mode === "list" && $props.icon === "left" }])
  13730. },
  13731. [
  13732. vue.createElementVNode(
  13733. "text",
  13734. {
  13735. class: "checklist-text",
  13736. style: vue.normalizeStyle(item.styleIconText)
  13737. },
  13738. vue.toDisplayString(item[$props.map.text]),
  13739. 5
  13740. /* TEXT, STYLE */
  13741. ),
  13742. $props.mode === "list" && $props.icon === "right" ? (vue.openBlock(), vue.createElementBlock(
  13743. "view",
  13744. {
  13745. key: 0,
  13746. class: "checkobx__list",
  13747. style: vue.normalizeStyle(item.styleBackgroud)
  13748. },
  13749. null,
  13750. 4
  13751. /* STYLE */
  13752. )) : vue.createCommentVNode("v-if", true)
  13753. ],
  13754. 2
  13755. /* CLASS */
  13756. )
  13757. ],
  13758. 6
  13759. /* CLASS, STYLE */
  13760. );
  13761. }),
  13762. 128
  13763. /* KEYED_FRAGMENT */
  13764. ))
  13765. ],
  13766. 34
  13767. /* CLASS, NEED_HYDRATION */
  13768. )) : (vue.openBlock(), vue.createElementBlock(
  13769. "radio-group",
  13770. {
  13771. key: 1,
  13772. class: vue.normalizeClass(["checklist-group", { "is-list": $props.mode === "list", "is-wrap": $props.wrap }]),
  13773. onChange: _cache[1] || (_cache[1] = (...args) => $options.chagne && $options.chagne(...args))
  13774. },
  13775. [
  13776. vue.createCommentVNode(" "),
  13777. (vue.openBlock(true), vue.createElementBlock(
  13778. vue.Fragment,
  13779. null,
  13780. vue.renderList($data.dataList, (item, index) => {
  13781. return vue.openBlock(), vue.createElementBlock(
  13782. "label",
  13783. {
  13784. 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" : ""]]),
  13785. style: vue.normalizeStyle(item.styleBackgroud),
  13786. key: index
  13787. },
  13788. [
  13789. vue.createElementVNode("radio", {
  13790. class: "hidden",
  13791. hidden: "",
  13792. disabled: $props.disabled || item.disabled,
  13793. value: item[$props.map.value] + "",
  13794. checked: item.selected
  13795. }, null, 8, ["disabled", "value", "checked"]),
  13796. $props.mode !== "tag" && $props.mode !== "list" || $props.mode === "list" && $props.icon === "left" ? (vue.openBlock(), vue.createElementBlock(
  13797. "view",
  13798. {
  13799. key: 0,
  13800. class: "radio__inner",
  13801. style: vue.normalizeStyle(item.styleBackgroud)
  13802. },
  13803. [
  13804. vue.createElementVNode(
  13805. "view",
  13806. {
  13807. class: "radio__inner-icon",
  13808. style: vue.normalizeStyle(item.styleIcon)
  13809. },
  13810. null,
  13811. 4
  13812. /* STYLE */
  13813. )
  13814. ],
  13815. 4
  13816. /* STYLE */
  13817. )) : vue.createCommentVNode("v-if", true),
  13818. vue.createElementVNode(
  13819. "view",
  13820. {
  13821. class: vue.normalizeClass(["checklist-content", { "list-content": $props.mode === "list" && $props.icon === "left" }])
  13822. },
  13823. [
  13824. vue.createElementVNode(
  13825. "text",
  13826. {
  13827. class: "checklist-text",
  13828. style: vue.normalizeStyle(item.styleIconText)
  13829. },
  13830. vue.toDisplayString(item[$props.map.text]),
  13831. 5
  13832. /* TEXT, STYLE */
  13833. ),
  13834. $props.mode === "list" && $props.icon === "right" ? (vue.openBlock(), vue.createElementBlock(
  13835. "view",
  13836. {
  13837. key: 0,
  13838. style: vue.normalizeStyle(item.styleRightIcon),
  13839. class: "checkobx__list"
  13840. },
  13841. null,
  13842. 4
  13843. /* STYLE */
  13844. )) : vue.createCommentVNode("v-if", true)
  13845. ],
  13846. 2
  13847. /* CLASS */
  13848. )
  13849. ],
  13850. 6
  13851. /* CLASS, STYLE */
  13852. );
  13853. }),
  13854. 128
  13855. /* KEYED_FRAGMENT */
  13856. ))
  13857. ],
  13858. 34
  13859. /* CLASS, NEED_HYDRATION */
  13860. ))
  13861. ],
  13862. 64
  13863. /* STABLE_FRAGMENT */
  13864. ))
  13865. ],
  13866. 4
  13867. /* STYLE */
  13868. );
  13869. }
  13870. const __easycom_7 = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$z], ["__scopeId", "data-v-149d584b"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue"]]);
  13871. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  13872. function getDefaultExportFromCjs(x) {
  13873. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  13874. }
  13875. var dayjs_min = { exports: {} };
  13876. (function(module, exports) {
  13877. !function(t2, e2) {
  13878. module.exports = e2();
  13879. }(commonjsGlobal, function() {
  13880. 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) {
  13881. var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
  13882. return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
  13883. } }, m2 = function(t3, e3, n3) {
  13884. var r3 = String(t3);
  13885. return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3;
  13886. }, v2 = { s: m2, z: function(t3) {
  13887. var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
  13888. return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0");
  13889. }, m: function t3(e3, n3) {
  13890. if (e3.date() < n3.date())
  13891. return -t3(n3, e3);
  13892. 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);
  13893. return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
  13894. }, a: function(t3) {
  13895. return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
  13896. }, p: function(t3) {
  13897. 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$/, "");
  13898. }, u: function(t3) {
  13899. return void 0 === t3;
  13900. } }, g2 = "en", D2 = {};
  13901. D2[g2] = M2;
  13902. var p2 = "$isDayjsObject", S2 = function(t3) {
  13903. return t3 instanceof _2 || !(!t3 || !t3[p2]);
  13904. }, w2 = function t3(e3, n3, r3) {
  13905. var i3;
  13906. if (!e3)
  13907. return g2;
  13908. if ("string" == typeof e3) {
  13909. var s3 = e3.toLowerCase();
  13910. D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3);
  13911. var u3 = e3.split("-");
  13912. if (!i3 && u3.length > 1)
  13913. return t3(u3[0]);
  13914. } else {
  13915. var a3 = e3.name;
  13916. D2[a3] = e3, i3 = a3;
  13917. }
  13918. return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
  13919. }, O2 = function(t3, e3) {
  13920. if (S2(t3))
  13921. return t3.clone();
  13922. var n3 = "object" == typeof e3 ? e3 : {};
  13923. return n3.date = t3, n3.args = arguments, new _2(n3);
  13924. }, b2 = v2;
  13925. b2.l = w2, b2.i = S2, b2.w = function(t3, e3) {
  13926. return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
  13927. };
  13928. var _2 = function() {
  13929. function M3(t3) {
  13930. this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
  13931. }
  13932. var m3 = M3.prototype;
  13933. return m3.parse = function(t3) {
  13934. this.$d = function(t4) {
  13935. var e3 = t4.date, n3 = t4.utc;
  13936. if (null === e3)
  13937. return /* @__PURE__ */ new Date(NaN);
  13938. if (b2.u(e3))
  13939. return /* @__PURE__ */ new Date();
  13940. if (e3 instanceof Date)
  13941. return new Date(e3);
  13942. if ("string" == typeof e3 && !/Z$/i.test(e3)) {
  13943. var r3 = e3.match($2);
  13944. if (r3) {
  13945. var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
  13946. 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);
  13947. }
  13948. }
  13949. return new Date(e3);
  13950. }(t3), this.init();
  13951. }, m3.init = function() {
  13952. var t3 = this.$d;
  13953. 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();
  13954. }, m3.$utils = function() {
  13955. return b2;
  13956. }, m3.isValid = function() {
  13957. return !(this.$d.toString() === l2);
  13958. }, m3.isSame = function(t3, e3) {
  13959. var n3 = O2(t3);
  13960. return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
  13961. }, m3.isAfter = function(t3, e3) {
  13962. return O2(t3) < this.startOf(e3);
  13963. }, m3.isBefore = function(t3, e3) {
  13964. return this.endOf(e3) < O2(t3);
  13965. }, m3.$g = function(t3, e3, n3) {
  13966. return b2.u(t3) ? this[e3] : this.set(n3, t3);
  13967. }, m3.unix = function() {
  13968. return Math.floor(this.valueOf() / 1e3);
  13969. }, m3.valueOf = function() {
  13970. return this.$d.getTime();
  13971. }, m3.startOf = function(t3, e3) {
  13972. var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) {
  13973. var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
  13974. return r3 ? i3 : i3.endOf(a2);
  13975. }, $3 = function(t4, e4) {
  13976. return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3);
  13977. }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
  13978. switch (f3) {
  13979. case h2:
  13980. return r3 ? l3(1, 0) : l3(31, 11);
  13981. case c2:
  13982. return r3 ? l3(1, M4) : l3(0, M4 + 1);
  13983. case o2:
  13984. var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
  13985. return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4);
  13986. case a2:
  13987. case d2:
  13988. return $3(v3 + "Hours", 0);
  13989. case u2:
  13990. return $3(v3 + "Minutes", 1);
  13991. case s2:
  13992. return $3(v3 + "Seconds", 2);
  13993. case i2:
  13994. return $3(v3 + "Milliseconds", 3);
  13995. default:
  13996. return this.clone();
  13997. }
  13998. }, m3.endOf = function(t3) {
  13999. return this.startOf(t3, false);
  14000. }, m3.$set = function(t3, e3) {
  14001. 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;
  14002. if (o3 === c2 || o3 === h2) {
  14003. var y3 = this.clone().set(d2, 1);
  14004. y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
  14005. } else
  14006. l3 && this.$d[l3]($3);
  14007. return this.init(), this;
  14008. }, m3.set = function(t3, e3) {
  14009. return this.clone().$set(t3, e3);
  14010. }, m3.get = function(t3) {
  14011. return this[b2.p(t3)]();
  14012. }, m3.add = function(r3, f3) {
  14013. var d3, l3 = this;
  14014. r3 = Number(r3);
  14015. var $3 = b2.p(f3), y3 = function(t3) {
  14016. var e3 = O2(l3);
  14017. return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
  14018. };
  14019. if ($3 === c2)
  14020. return this.set(c2, this.$M + r3);
  14021. if ($3 === h2)
  14022. return this.set(h2, this.$y + r3);
  14023. if ($3 === a2)
  14024. return y3(1);
  14025. if ($3 === o2)
  14026. return y3(7);
  14027. var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n2, d3[i2] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M4;
  14028. return b2.w(m4, this);
  14029. }, m3.subtract = function(t3, e3) {
  14030. return this.add(-1 * t3, e3);
  14031. }, m3.format = function(t3) {
  14032. var e3 = this, n3 = this.$locale();
  14033. if (!this.isValid())
  14034. return n3.invalidDate || l2;
  14035. 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) {
  14036. return t4 && (t4[n4] || t4(e3, r3)) || i4[n4].slice(0, s4);
  14037. }, d3 = function(t4) {
  14038. return b2.s(s3 % 12 || 12, t4, "0");
  14039. }, $3 = f3 || function(t4, e4, n4) {
  14040. var r4 = t4 < 12 ? "AM" : "PM";
  14041. return n4 ? r4.toLowerCase() : r4;
  14042. };
  14043. return r3.replace(y2, function(t4, r4) {
  14044. return r4 || function(t5) {
  14045. switch (t5) {
  14046. case "YY":
  14047. return String(e3.$y).slice(-2);
  14048. case "YYYY":
  14049. return b2.s(e3.$y, 4, "0");
  14050. case "M":
  14051. return a3 + 1;
  14052. case "MM":
  14053. return b2.s(a3 + 1, 2, "0");
  14054. case "MMM":
  14055. return h3(n3.monthsShort, a3, c3, 3);
  14056. case "MMMM":
  14057. return h3(c3, a3);
  14058. case "D":
  14059. return e3.$D;
  14060. case "DD":
  14061. return b2.s(e3.$D, 2, "0");
  14062. case "d":
  14063. return String(e3.$W);
  14064. case "dd":
  14065. return h3(n3.weekdaysMin, e3.$W, o3, 2);
  14066. case "ddd":
  14067. return h3(n3.weekdaysShort, e3.$W, o3, 3);
  14068. case "dddd":
  14069. return o3[e3.$W];
  14070. case "H":
  14071. return String(s3);
  14072. case "HH":
  14073. return b2.s(s3, 2, "0");
  14074. case "h":
  14075. return d3(1);
  14076. case "hh":
  14077. return d3(2);
  14078. case "a":
  14079. return $3(s3, u3, true);
  14080. case "A":
  14081. return $3(s3, u3, false);
  14082. case "m":
  14083. return String(u3);
  14084. case "mm":
  14085. return b2.s(u3, 2, "0");
  14086. case "s":
  14087. return String(e3.$s);
  14088. case "ss":
  14089. return b2.s(e3.$s, 2, "0");
  14090. case "SSS":
  14091. return b2.s(e3.$ms, 3, "0");
  14092. case "Z":
  14093. return i3;
  14094. }
  14095. return null;
  14096. }(t4) || i3.replace(":", "");
  14097. });
  14098. }, m3.utcOffset = function() {
  14099. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  14100. }, m3.diff = function(r3, d3, l3) {
  14101. var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() {
  14102. return b2.m(y3, m4);
  14103. };
  14104. switch (M4) {
  14105. case h2:
  14106. $3 = D3() / 12;
  14107. break;
  14108. case c2:
  14109. $3 = D3();
  14110. break;
  14111. case f2:
  14112. $3 = D3() / 3;
  14113. break;
  14114. case o2:
  14115. $3 = (g3 - v3) / 6048e5;
  14116. break;
  14117. case a2:
  14118. $3 = (g3 - v3) / 864e5;
  14119. break;
  14120. case u2:
  14121. $3 = g3 / n2;
  14122. break;
  14123. case s2:
  14124. $3 = g3 / e2;
  14125. break;
  14126. case i2:
  14127. $3 = g3 / t2;
  14128. break;
  14129. default:
  14130. $3 = g3;
  14131. }
  14132. return l3 ? $3 : b2.a($3);
  14133. }, m3.daysInMonth = function() {
  14134. return this.endOf(c2).$D;
  14135. }, m3.$locale = function() {
  14136. return D2[this.$L];
  14137. }, m3.locale = function(t3, e3) {
  14138. if (!t3)
  14139. return this.$L;
  14140. var n3 = this.clone(), r3 = w2(t3, e3, true);
  14141. return r3 && (n3.$L = r3), n3;
  14142. }, m3.clone = function() {
  14143. return b2.w(this.$d, this);
  14144. }, m3.toDate = function() {
  14145. return new Date(this.valueOf());
  14146. }, m3.toJSON = function() {
  14147. return this.isValid() ? this.toISOString() : null;
  14148. }, m3.toISOString = function() {
  14149. return this.$d.toISOString();
  14150. }, m3.toString = function() {
  14151. return this.$d.toUTCString();
  14152. }, M3;
  14153. }(), k = _2.prototype;
  14154. return O2.prototype = k, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
  14155. k[t3[1]] = function(e3) {
  14156. return this.$g(e3, t3[0], t3[1]);
  14157. };
  14158. }), O2.extend = function(t3, e3) {
  14159. return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2;
  14160. }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) {
  14161. return O2(1e3 * t3);
  14162. }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
  14163. });
  14164. })(dayjs_min);
  14165. var dayjs_minExports = dayjs_min.exports;
  14166. const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
  14167. var isIOS;
  14168. function album() {
  14169. var result = 0;
  14170. var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
  14171. var authStatus = PHPhotoLibrary.authorizationStatus();
  14172. if (authStatus === 0) {
  14173. result = null;
  14174. } else if (authStatus == 3) {
  14175. result = 1;
  14176. } else {
  14177. result = 0;
  14178. }
  14179. plus.ios.deleteObject(PHPhotoLibrary);
  14180. return result;
  14181. }
  14182. function camera() {
  14183. var result = 0;
  14184. var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
  14185. var authStatus = AVCaptureDevice.authorizationStatusForMediaType("vide");
  14186. if (authStatus === 0) {
  14187. result = null;
  14188. } else if (authStatus == 3) {
  14189. result = 1;
  14190. } else {
  14191. result = 0;
  14192. }
  14193. plus.ios.deleteObject(AVCaptureDevice);
  14194. return result;
  14195. }
  14196. function location$1() {
  14197. var result = 0;
  14198. var cllocationManger = plus.ios.import("CLLocationManager");
  14199. var enable = cllocationManger.locationServicesEnabled();
  14200. var status = cllocationManger.authorizationStatus();
  14201. if (!enable) {
  14202. result = 2;
  14203. } else if (status === 0) {
  14204. result = null;
  14205. } else if (status === 3 || status === 4) {
  14206. result = 1;
  14207. } else {
  14208. result = 0;
  14209. }
  14210. plus.ios.deleteObject(cllocationManger);
  14211. return result;
  14212. }
  14213. function push() {
  14214. var result = 0;
  14215. var UIApplication = plus.ios.import("UIApplication");
  14216. var app = UIApplication.sharedApplication();
  14217. var enabledTypes = 0;
  14218. if (app.currentUserNotificationSettings) {
  14219. var settings = app.currentUserNotificationSettings();
  14220. enabledTypes = settings.plusGetAttribute("types");
  14221. if (enabledTypes == 0) {
  14222. result = 0;
  14223. formatAppLog("log", "at utils/permission.js:64", "推送权限没有开启");
  14224. } else {
  14225. result = 1;
  14226. formatAppLog("log", "at utils/permission.js:67", "已经开启推送功能!");
  14227. }
  14228. plus.ios.deleteObject(settings);
  14229. } else {
  14230. enabledTypes = app.enabledRemoteNotificationTypes();
  14231. if (enabledTypes == 0) {
  14232. result = 3;
  14233. formatAppLog("log", "at utils/permission.js:74", "推送权限没有开启!");
  14234. } else {
  14235. result = 4;
  14236. formatAppLog("log", "at utils/permission.js:77", "已经开启推送功能!");
  14237. }
  14238. }
  14239. plus.ios.deleteObject(app);
  14240. plus.ios.deleteObject(UIApplication);
  14241. return result;
  14242. }
  14243. function contact() {
  14244. var result = 0;
  14245. var CNContactStore = plus.ios.import("CNContactStore");
  14246. var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
  14247. if (cnAuthStatus === 0) {
  14248. result = null;
  14249. } else if (cnAuthStatus == 3) {
  14250. result = 1;
  14251. } else {
  14252. result = 0;
  14253. }
  14254. plus.ios.deleteObject(CNContactStore);
  14255. return result;
  14256. }
  14257. function record() {
  14258. var result = null;
  14259. var avaudiosession = plus.ios.import("AVAudioSession");
  14260. var avaudio = avaudiosession.sharedInstance();
  14261. var status = avaudio.recordPermission();
  14262. formatAppLog("log", "at utils/permission.js:105", "permissionStatus:" + status);
  14263. if (status === 1970168948) {
  14264. result = null;
  14265. } else if (status === 1735552628) {
  14266. result = 1;
  14267. } else {
  14268. result = 0;
  14269. }
  14270. plus.ios.deleteObject(avaudiosession);
  14271. return result;
  14272. }
  14273. function calendar() {
  14274. var result = null;
  14275. var EKEventStore = plus.ios.import("EKEventStore");
  14276. var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
  14277. if (ekAuthStatus == 3) {
  14278. result = 1;
  14279. formatAppLog("log", "at utils/permission.js:123", "日历权限已经开启");
  14280. } else {
  14281. formatAppLog("log", "at utils/permission.js:125", "日历权限没有开启");
  14282. }
  14283. plus.ios.deleteObject(EKEventStore);
  14284. return result;
  14285. }
  14286. function memo() {
  14287. var result = null;
  14288. var EKEventStore = plus.ios.import("EKEventStore");
  14289. var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
  14290. if (ekAuthStatus == 3) {
  14291. result = 1;
  14292. formatAppLog("log", "at utils/permission.js:137", "备忘录权限已经开启");
  14293. } else {
  14294. formatAppLog("log", "at utils/permission.js:139", "备忘录权限没有开启");
  14295. }
  14296. plus.ios.deleteObject(EKEventStore);
  14297. return result;
  14298. }
  14299. function requestIOS(permissionID) {
  14300. return new Promise((resolve) => {
  14301. switch (permissionID) {
  14302. case "push":
  14303. resolve(push());
  14304. break;
  14305. case "location":
  14306. resolve(location$1());
  14307. break;
  14308. case "record":
  14309. resolve(record());
  14310. break;
  14311. case "camera":
  14312. resolve(camera());
  14313. break;
  14314. case "album":
  14315. resolve(album());
  14316. break;
  14317. case "contact":
  14318. resolve(contact());
  14319. break;
  14320. case "calendar":
  14321. resolve(calendar());
  14322. break;
  14323. case "memo":
  14324. resolve(memo());
  14325. break;
  14326. default:
  14327. resolve(0);
  14328. break;
  14329. }
  14330. });
  14331. }
  14332. function requestAndroid(permissionID) {
  14333. return new Promise((resolve) => {
  14334. plus.android.requestPermissions(
  14335. [permissionID],
  14336. function(resultObj) {
  14337. var result = 0;
  14338. for (let i2 = 0; i2 < resultObj.granted.length; i2++) {
  14339. var grantedPermission = resultObj.granted[i2];
  14340. formatAppLog("log", "at utils/permission.js:187", "已获取的权限:" + grantedPermission);
  14341. result = 1;
  14342. }
  14343. for (let i2 = 0; i2 < resultObj.deniedPresent.length; i2++) {
  14344. var deniedPresentPermission = resultObj.deniedPresent[i2];
  14345. formatAppLog("log", "at utils/permission.js:192", "拒绝本次申请的权限:" + deniedPresentPermission);
  14346. result = 0;
  14347. }
  14348. for (let i2 = 0; i2 < resultObj.deniedAlways.length; i2++) {
  14349. var deniedAlwaysPermission = resultObj.deniedAlways[i2];
  14350. formatAppLog("log", "at utils/permission.js:197", "永久拒绝申请的权限:" + deniedAlwaysPermission);
  14351. result = -1;
  14352. }
  14353. resolve(result);
  14354. },
  14355. function(error) {
  14356. formatAppLog("log", "at utils/permission.js:203", "result error: " + error.message);
  14357. resolve({
  14358. code: error.code,
  14359. message: error.message
  14360. });
  14361. }
  14362. );
  14363. });
  14364. }
  14365. function gotoAppPermissionSetting() {
  14366. if (permission.isIOS) {
  14367. var UIApplication = plus.ios.import("UIApplication");
  14368. var application2 = UIApplication.sharedApplication();
  14369. var NSURL2 = plus.ios.import("NSURL");
  14370. var setting2 = NSURL2.URLWithString("app-settings:");
  14371. application2.openURL(setting2);
  14372. plus.ios.deleteObject(setting2);
  14373. plus.ios.deleteObject(NSURL2);
  14374. plus.ios.deleteObject(application2);
  14375. } else {
  14376. var Intent = plus.android.importClass("android.content.Intent");
  14377. var Settings = plus.android.importClass("android.provider.Settings");
  14378. var Uri = plus.android.importClass("android.net.Uri");
  14379. var mainActivity = plus.android.runtimeMainActivity();
  14380. var intent = new Intent();
  14381. intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
  14382. var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
  14383. intent.setData(uri);
  14384. mainActivity.startActivity(intent);
  14385. }
  14386. }
  14387. const permission = {
  14388. get isIOS() {
  14389. return typeof isIOS === "boolean" ? isIOS : isIOS = uni.getSystemInfoSync().platform === "ios";
  14390. },
  14391. requestIOS,
  14392. requestAndroid,
  14393. gotoAppSetting: gotoAppPermissionSetting
  14394. };
  14395. const formatDate = (date, format = "YYYY-MM-DD HH:mm:ss") => {
  14396. const year = String(date.getFullYear());
  14397. const month = String(date.getMonth() + 1).padStart(2, "0");
  14398. const day = String(date.getDate()).padStart(2, "0");
  14399. const hours = String(date.getHours()).padStart(2, "0");
  14400. const minutes = String(date.getMinutes()).padStart(2, "0");
  14401. const seconds = String(date.getSeconds()).padStart(2, "0");
  14402. return format.replace("YYYY", year).replace("MM", month).replace("DD", day).replace("HH", hours).replace("mm", minutes).replace("ss", seconds);
  14403. };
  14404. const checkPermission = async () => {
  14405. let status = permission.isIOS ? await permission.requestIOS("camera") : await permission.requestAndroid("android.permission.CAMERA");
  14406. if (status === null || status === 1) {
  14407. status = 1;
  14408. } else {
  14409. uni.showModal({
  14410. content: "Camera permission required",
  14411. confirmText: "Setting",
  14412. success: function(res) {
  14413. if (res.confirm) {
  14414. permission.gotoAppSetting();
  14415. }
  14416. }
  14417. });
  14418. }
  14419. return status;
  14420. };
  14421. const getAliyunOssSignature = () => {
  14422. return http({
  14423. method: "GET",
  14424. url: "/admin/Config/getAliyunOssSignature"
  14425. });
  14426. };
  14427. const printWaybillLabel = (data) => {
  14428. return http({
  14429. method: "POST",
  14430. url: "/admin/order.ScanOrder/printWaybillLabel",
  14431. data
  14432. });
  14433. };
  14434. const weigh = (data) => {
  14435. return http({
  14436. method: "POST",
  14437. url: "/admin/order.scanOrder/weigh",
  14438. data
  14439. });
  14440. };
  14441. const outStock = (data) => {
  14442. return http({
  14443. method: "POST",
  14444. url: "/admin/order.scanOrder/outStock",
  14445. data
  14446. });
  14447. };
  14448. const instock = (data) => {
  14449. return http({
  14450. method: "POST",
  14451. url: "/admin/order.scanOrder/instock",
  14452. data
  14453. });
  14454. };
  14455. const getBindParams$1 = () => {
  14456. return http({
  14457. method: "GET",
  14458. url: "/admin/order.scanOrder/getBindParams"
  14459. });
  14460. };
  14461. const checkWaybillGoods = (order_no) => {
  14462. return http({
  14463. method: "POST",
  14464. url: "/admin/order.scanOrder/checkWaybillGoods",
  14465. data: { order_no }
  14466. });
  14467. };
  14468. const getWarehouseSpace = (code = "") => {
  14469. return http({
  14470. method: "POST",
  14471. url: "/admin/order.ScanOrder/getWarehouseSpace",
  14472. data: { code }
  14473. });
  14474. };
  14475. const hexList = [];
  14476. for (let i2 = 0; i2 <= 15; i2++) {
  14477. hexList[i2] = i2.toString(16);
  14478. }
  14479. function uuid() {
  14480. let uuid2 = "";
  14481. for (let i2 = 1; i2 <= 36; i2++) {
  14482. if (i2 === 9 || i2 === 14 || i2 === 19 || i2 === 24) {
  14483. uuid2 += "-";
  14484. } else if (i2 === 15) {
  14485. uuid2 += 4;
  14486. } else if (i2 === 20) {
  14487. uuid2 += hexList[Math.random() * 4 | 8];
  14488. } else {
  14489. uuid2 += hexList[Math.random() * 16 | 0];
  14490. }
  14491. }
  14492. return uuid2;
  14493. }
  14494. const getPrinterList = () => {
  14495. return http({
  14496. method: "GET",
  14497. url: "/admin/printer/getPrinterList"
  14498. });
  14499. };
  14500. const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
  14501. __name: "inbound",
  14502. setup(__props, { expose: __expose }) {
  14503. __expose();
  14504. const message = vue.ref();
  14505. const valiForm = vue.ref();
  14506. const printerDialog = vue.ref();
  14507. const loading = vue.ref(false);
  14508. const images = vue.ref([]);
  14509. const messageType = vue.ref("");
  14510. const messageText = vue.ref("");
  14511. const spaces = vue.ref([]);
  14512. const previewImage = vue.ref(null);
  14513. const maxImages = vue.ref(6);
  14514. const printerList = vue.ref();
  14515. const historyList = vue.ref([]);
  14516. const printers = vue.ref([]);
  14517. const sendToPeinter = vue.ref([1]);
  14518. const selectPrinter = vue.ref(0);
  14519. const subLoading = vue.ref(false);
  14520. const focusType = vue.ref(true);
  14521. const result = vue.ref();
  14522. const valiFormData = vue.reactive({
  14523. images: [],
  14524. orderNum: "",
  14525. space_code: "",
  14526. weight: "",
  14527. typing: true
  14528. });
  14529. const rules = vue.computed(() => {
  14530. return {
  14531. orderNum: {
  14532. rules: [
  14533. {
  14534. required: true,
  14535. errorMessage: "单号不能为空"
  14536. }
  14537. ]
  14538. }
  14539. };
  14540. });
  14541. const spaceRes = vue.computed(() => {
  14542. try {
  14543. const res = spaces.value.find((item) => item.value === valiFormData.space_code);
  14544. return res == null ? void 0 : res.text;
  14545. } catch (e2) {
  14546. formatAppLog("log", "at pages/inbound/inbound.vue:247", e2);
  14547. return "";
  14548. }
  14549. });
  14550. onShow(async () => {
  14551. focusType.value = true;
  14552. loading.value = false;
  14553. await _getWarehouseSpace();
  14554. await Promise.all([_getPrinterList()]);
  14555. });
  14556. onHide(() => {
  14557. focusType.value = false;
  14558. loading.value = false;
  14559. });
  14560. onNavigationBarButtonTap((event) => {
  14561. if (event.index === 0) {
  14562. uni.navigateTo({
  14563. url: "/pages/inbound/logList"
  14564. });
  14565. }
  14566. });
  14567. const _getWarehouseSpace = async () => {
  14568. const res = await getWarehouseSpace();
  14569. if (res.code === 1) {
  14570. spaces.value = res.data.spaces.map((item) => {
  14571. return {
  14572. text: item.name,
  14573. value: item.code
  14574. };
  14575. });
  14576. }
  14577. };
  14578. const _getPrinterList = async () => {
  14579. const res = await getPrinterList();
  14580. if (res.code === 1) {
  14581. printerList.value = res.data.printers;
  14582. printers.value = Object.values(printerList.value).map((item) => {
  14583. return {
  14584. text: item.name,
  14585. value: item.value
  14586. };
  14587. });
  14588. }
  14589. };
  14590. const reset = () => {
  14591. loading.value = false;
  14592. focusType.value = false;
  14593. images.value = [];
  14594. valiFormData.orderNum = "";
  14595. valiFormData.weight = "";
  14596. valiFormData.typing = true;
  14597. vue.nextTick(() => {
  14598. focusType.value = true;
  14599. });
  14600. };
  14601. const scan = async () => {
  14602. let status = await checkPermission();
  14603. if (status !== 1) {
  14604. return;
  14605. }
  14606. uni.scanCode({
  14607. success: (res) => {
  14608. result.value = res.result;
  14609. valiFormData.orderNum = res.result;
  14610. },
  14611. fail: (err) => {
  14612. }
  14613. });
  14614. };
  14615. let st2;
  14616. const warehouseScan2 = async () => {
  14617. st2 && clearTimeout(st2);
  14618. instockScan();
  14619. };
  14620. const instockScan = async () => {
  14621. const images2 = getImages();
  14622. let allImgVerify = true;
  14623. for (var i2 = 0; i2 < images2.length; i2++) {
  14624. if (!images2[i2].savePath) {
  14625. allImgVerify = false;
  14626. }
  14627. }
  14628. if (!allImgVerify) {
  14629. messageType.value = "error";
  14630. messageText.value = "图片还没上传完毕,请稍后...";
  14631. message.value.open();
  14632. loading.value = false;
  14633. return;
  14634. }
  14635. const res = await instock({
  14636. order_no: valiFormData.orderNum,
  14637. space_code: valiFormData.space_code,
  14638. images: images2
  14639. });
  14640. loading.value = false;
  14641. if (res.code == 1) {
  14642. messageType.value = "success";
  14643. messageText.value = res.msg;
  14644. message.value.open();
  14645. const historyItem = {
  14646. orderNum: valiFormData.orderNum,
  14647. createTime: /* @__PURE__ */ new Date(),
  14648. space: spaceRes.value,
  14649. type: "入库",
  14650. status: true
  14651. };
  14652. historyList.value.unshift(historyItem);
  14653. uni.setStorageSync("inboundHistory", historyList.value);
  14654. getHistory();
  14655. if (res.data.express_label) {
  14656. selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0;
  14657. printerDialog.value.open();
  14658. } else {
  14659. st2 = setTimeout(() => {
  14660. reset();
  14661. st2 && clearTimeout(st2);
  14662. }, 1e3);
  14663. }
  14664. } else {
  14665. messageType.value = "error";
  14666. messageText.value = res.msg;
  14667. message.value.open();
  14668. const historyItem = {
  14669. orderNum: valiFormData.orderNum,
  14670. createTime: /* @__PURE__ */ new Date(),
  14671. space: spaceRes.value,
  14672. type: "入库",
  14673. status: false
  14674. };
  14675. historyList.value.unshift(historyItem);
  14676. uni.setStorageSync("inboundHistory", historyList.value);
  14677. getHistory();
  14678. st2 = setTimeout(() => {
  14679. reset();
  14680. st2 && clearTimeout(st2);
  14681. }, 1e3);
  14682. }
  14683. };
  14684. const close = () => {
  14685. printerDialog.value.close();
  14686. st2 = setTimeout(() => {
  14687. reset();
  14688. st2 && clearTimeout(st2);
  14689. }, 700);
  14690. };
  14691. const sendToPeinterFun = (res) => {
  14692. if (res.detail.value.length === 0) {
  14693. selectPrinter.value = 0;
  14694. } else {
  14695. selectPrinter.value = printers.value[0].value;
  14696. }
  14697. };
  14698. const printConfirm = async () => {
  14699. subLoading.value = true;
  14700. const res = await printWaybillLabel({
  14701. order_no: valiFormData.orderNum,
  14702. printer_code: selectPrinter
  14703. });
  14704. close();
  14705. subLoading.value = false;
  14706. formatAppLog("log", "at pages/inbound/inbound.vue:419", "打印成功", res);
  14707. messageType.value = "success";
  14708. messageText.value = "打印成功";
  14709. message.value.open();
  14710. };
  14711. const onsubmit = () => {
  14712. valiForm.value.validate().then((res) => {
  14713. warehouseScan2();
  14714. }).catch((err) => {
  14715. formatAppLog("log", "at pages/inbound/inbound.vue:431", "err", err);
  14716. });
  14717. };
  14718. const getHistory = () => {
  14719. historyList.value = uni.getStorageSync("inboundHistory");
  14720. };
  14721. const getImages = () => {
  14722. const res = images.value.map((item) => {
  14723. return {
  14724. name: item.name,
  14725. savePath: item.serverUrl,
  14726. fileSize: item.size,
  14727. mimeType: item.type
  14728. };
  14729. });
  14730. return res;
  14731. };
  14732. const _getAliyunOssSignature = async (rawFiles) => {
  14733. const res = await getAliyunOssSignature();
  14734. const signature = res.data.signature;
  14735. const uploadPromises = rawFiles.map((image) => {
  14736. return upLoadFile(signature, image);
  14737. });
  14738. Promise.all(uploadPromises).then((results) => {
  14739. formatAppLog("log", "at pages/inbound/inbound.vue:460", "所有图片加载成功:", results);
  14740. uni.showToast({
  14741. title: "加载成功",
  14742. icon: "success"
  14743. });
  14744. }).catch((error) => {
  14745. formatAppLog("error", "at pages/inbound/inbound.vue:467", "加载失败:", error);
  14746. uni.showToast({
  14747. title: "加载失败",
  14748. icon: "none"
  14749. });
  14750. });
  14751. };
  14752. const upLoadFile = (signature, image) => {
  14753. const fileData = {
  14754. policy: signature.policy,
  14755. signature: signature.signature,
  14756. ossaccessKeyId: signature.ossAccessKeyId,
  14757. key: signature.dir + dayjs().format("YYYYMMDD") + "/" + uuid() + "_" + image.name,
  14758. dir: signature.dir,
  14759. host: signature.host,
  14760. file: image.file
  14761. };
  14762. return new Promise((resolve, reject) => {
  14763. let name = image.name;
  14764. name = "file";
  14765. const uploadTask = uni.uploadFile({
  14766. url: signature.host,
  14767. // 你的上传接口地址
  14768. filePath: image.path,
  14769. name,
  14770. // 这里根据后端需要的字段来定义
  14771. formData: fileData,
  14772. success: (uploadFileRes) => {
  14773. if (uploadFileRes.statusCode === 204 || uploadFileRes.statusCode === 200) {
  14774. image.serverUrl = fileData.key;
  14775. resolve(uploadFileRes);
  14776. } else {
  14777. reject(uploadFileRes);
  14778. }
  14779. },
  14780. fail: (error) => {
  14781. formatAppLog("log", "at pages/inbound/inbound.vue:512", "error++", error);
  14782. reject(error);
  14783. },
  14784. // 更新上传进度
  14785. complete: () => {
  14786. formatAppLog("log", "at pages/inbound/inbound.vue:517", "complete---");
  14787. image.progress = 100;
  14788. }
  14789. });
  14790. uploadTask.onProgressUpdate((progressEvent) => {
  14791. image.progress = progressEvent.progress;
  14792. });
  14793. });
  14794. };
  14795. const chooseImage = () => {
  14796. uni.chooseImage({
  14797. count: maxImages.value - images.value.length,
  14798. success: (res) => {
  14799. images.value = images.value.concat(
  14800. res.tempFiles.map((item) => {
  14801. const res2 = {
  14802. size: item.size,
  14803. path: item.path,
  14804. name: item.name,
  14805. type: item.type,
  14806. progress: 0,
  14807. file: item
  14808. };
  14809. const suffix = item.path.substring(item.path.lastIndexOf(".") + 1);
  14810. const fileName = item.path.substring(item.path.lastIndexOf("/") + 1);
  14811. res2.name = fileName;
  14812. res2.type = suffix;
  14813. return res2;
  14814. })
  14815. );
  14816. const paddingImages = images.value.filter((image) => image.progress === 0);
  14817. vue.nextTick(() => {
  14818. _getAliyunOssSignature(paddingImages);
  14819. });
  14820. },
  14821. fail: (err) => {
  14822. formatAppLog("error", "at pages/inbound/inbound.vue:562", err);
  14823. }
  14824. });
  14825. };
  14826. const deleteImage = (index) => {
  14827. images.value.splice(index, 1);
  14828. };
  14829. const openPreview = (image) => {
  14830. previewImage.value = image;
  14831. };
  14832. const closePreview = () => {
  14833. previewImage.value = null;
  14834. };
  14835. const __returned__ = { message, valiForm, printerDialog, loading, images, messageType, messageText, spaces, previewImage, maxImages, printerList, historyList, printers, sendToPeinter, selectPrinter, subLoading, focusType, result, valiFormData, rules, spaceRes, _getWarehouseSpace, _getPrinterList, reset, scan, get st() {
  14836. return st2;
  14837. }, set st(v2) {
  14838. st2 = v2;
  14839. }, warehouseScan: warehouseScan2, instockScan, close, sendToPeinterFun, printConfirm, onsubmit, getHistory, getImages, _getAliyunOssSignature, upLoadFile, chooseImage, deleteImage, openPreview, closePreview };
  14840. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  14841. return __returned__;
  14842. }
  14843. });
  14844. function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
  14845. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$7);
  14846. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_0$4);
  14847. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$3);
  14848. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  14849. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$1);
  14850. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_1$1);
  14851. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  14852. const _component_uni_data_checkbox = resolveEasycom(vue.resolveDynamicComponent("uni-data-checkbox"), __easycom_7);
  14853. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  14854. vue.createElementVNode("view", { class: "example" }, [
  14855. vue.createCommentVNode(" 基础表单校验 "),
  14856. vue.createVNode(_component_uni_forms, {
  14857. ref: "valiForm",
  14858. "label-align": "right",
  14859. "label-width": "80px",
  14860. rules: $setup.rules,
  14861. modelValue: $setup.valiFormData
  14862. }, {
  14863. default: vue.withCtx(() => [
  14864. vue.createVNode(_component_uni_forms_item, {
  14865. label: "单号",
  14866. required: "",
  14867. name: "orderNum"
  14868. }, {
  14869. default: vue.withCtx(() => [
  14870. vue.createVNode(_component_uni_easyinput, {
  14871. modelValue: $setup.valiFormData.orderNum,
  14872. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  14873. placeholder: "请输入单号",
  14874. suffixIcon: "scan",
  14875. focus: $setup.focusType,
  14876. onIconClick: $setup.scan
  14877. }, null, 8, ["modelValue", "focus"])
  14878. ]),
  14879. _: 1
  14880. /* STABLE */
  14881. }),
  14882. vue.createVNode(_component_uni_forms_item, {
  14883. label: "仓位编码",
  14884. name: "space_code"
  14885. }, {
  14886. default: vue.withCtx(() => [
  14887. vue.createVNode(_component_uni_data_select, {
  14888. modelValue: $setup.valiFormData.space_code,
  14889. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.space_code = $event),
  14890. localdata: $setup.spaces,
  14891. placeholder: "请选择仓位编码"
  14892. }, null, 8, ["modelValue", "localdata"])
  14893. ]),
  14894. _: 1
  14895. /* STABLE */
  14896. }),
  14897. vue.createVNode(_component_uni_forms_item, {
  14898. label: "图片",
  14899. name: "images"
  14900. }, {
  14901. default: vue.withCtx(() => [
  14902. vue.createElementVNode("view", { class: "upload-container" }, [
  14903. vue.createElementVNode("view", { class: "preview" }, [
  14904. (vue.openBlock(true), vue.createElementBlock(
  14905. vue.Fragment,
  14906. null,
  14907. vue.renderList($setup.images, (img, index) => {
  14908. return vue.openBlock(), vue.createElementBlock("view", {
  14909. key: index,
  14910. class: "image-container"
  14911. }, [
  14912. vue.createElementVNode("image", {
  14913. src: img.path,
  14914. class: "preview-image",
  14915. mode: "aspectFill",
  14916. onClick: ($event) => $setup.openPreview(img.path)
  14917. }, null, 8, ["src", "onClick"]),
  14918. vue.createElementVNode("progress", {
  14919. percent: img.progress || 0,
  14920. activeColor: Number(img.progress || 0) === 100 ? "#00ff00" : "#10AEFF",
  14921. "stroke-width": "3"
  14922. }, null, 8, ["percent", "activeColor"]),
  14923. img.status === "success" ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, "1")) : vue.createCommentVNode("v-if", true),
  14924. vue.createVNode(_component_uni_icons, {
  14925. class: "delete-icon",
  14926. onClick: ($event) => $setup.deleteImage(index),
  14927. type: "clear",
  14928. size: "20",
  14929. color: "red"
  14930. }, null, 8, ["onClick"])
  14931. ]);
  14932. }),
  14933. 128
  14934. /* KEYED_FRAGMENT */
  14935. )),
  14936. $setup.images.length < $setup.maxImages ? (vue.openBlock(), vue.createElementBlock("view", {
  14937. key: 0,
  14938. class: "choose-image-container",
  14939. onClick: $setup.chooseImage
  14940. }, [
  14941. vue.createVNode(_component_uni_icons, {
  14942. type: "plusempty",
  14943. size: "40",
  14944. color: "#ccc"
  14945. })
  14946. ])) : vue.createCommentVNode("v-if", true)
  14947. ]),
  14948. vue.createElementVNode("text", { style: { "padding-top": "8px" } }, "最多选择6张图片"),
  14949. vue.createCommentVNode(" 放大预览 "),
  14950. $setup.previewImage ? (vue.openBlock(), vue.createElementBlock("view", {
  14951. key: 0,
  14952. class: "preview-modal",
  14953. onClick: $setup.closePreview
  14954. }, [
  14955. vue.createElementVNode("image", {
  14956. src: $setup.previewImage,
  14957. class: "preview-large",
  14958. mode: "aspectFit",
  14959. onClick: vue.withModifiers($setup.closePreview, ["stop"])
  14960. }, null, 8, ["src"])
  14961. ])) : vue.createCommentVNode("v-if", true)
  14962. ])
  14963. ]),
  14964. _: 1
  14965. /* STABLE */
  14966. })
  14967. ]),
  14968. _: 1
  14969. /* STABLE */
  14970. }, 8, ["rules", "modelValue"]),
  14971. vue.createElementVNode("view", { class: "button-group" }, [
  14972. vue.createElementVNode("button", {
  14973. type: "info",
  14974. onClick: $setup.reset
  14975. }, "重置"),
  14976. vue.createElementVNode("button", {
  14977. type: "primary",
  14978. onClick: $setup.onsubmit,
  14979. loading: $setup.loading
  14980. }, [
  14981. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  14982. key: 0,
  14983. type: "checkmarkempty",
  14984. size: "18",
  14985. color: "white"
  14986. })) : vue.createCommentVNode("v-if", true),
  14987. vue.createTextVNode(" 提交 ")
  14988. ], 8, ["loading"])
  14989. ])
  14990. ]),
  14991. vue.createElementVNode("view", { class: "history" }, [
  14992. (vue.openBlock(true), vue.createElementBlock(
  14993. vue.Fragment,
  14994. null,
  14995. vue.renderList($setup.historyList.slice(0, 5), (item, i2) => {
  14996. return vue.openBlock(), vue.createElementBlock("view", {
  14997. class: "item",
  14998. key: i2
  14999. }, [
  15000. vue.createElementVNode(
  15001. "text",
  15002. {
  15003. class: "code",
  15004. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  15005. },
  15006. [
  15007. vue.createTextVNode(
  15008. vue.toDisplayString(item.orderNum) + " ",
  15009. 1
  15010. /* TEXT */
  15011. ),
  15012. item.space ? (vue.openBlock(), vue.createElementBlock(
  15013. "text",
  15014. { key: 0 },
  15015. "仓位编码: " + vue.toDisplayString(item.space),
  15016. 1
  15017. /* TEXT */
  15018. )) : vue.createCommentVNode("v-if", true),
  15019. vue.createTextVNode(
  15020. " " + vue.toDisplayString(item.type),
  15021. 1
  15022. /* TEXT */
  15023. )
  15024. ],
  15025. 4
  15026. /* STYLE */
  15027. ),
  15028. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  15029. key: 0,
  15030. type: "checkmarkempty",
  15031. class: "status",
  15032. size: "16",
  15033. color: "green"
  15034. })) : (vue.openBlock(), vue.createElementBlock("text", {
  15035. key: 1,
  15036. class: "status fail"
  15037. }, "F")),
  15038. vue.createElementVNode(
  15039. "text",
  15040. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  15041. vue.toDisplayString("\r\n" + item.createTime),
  15042. 1
  15043. /* TEXT */
  15044. )
  15045. ]);
  15046. }),
  15047. 128
  15048. /* KEYED_FRAGMENT */
  15049. ))
  15050. ]),
  15051. vue.createVNode(
  15052. _component_uni_popup,
  15053. {
  15054. ref: "message",
  15055. type: "message"
  15056. },
  15057. {
  15058. default: vue.withCtx(() => [
  15059. vue.createVNode(_component_uni_popup_message, {
  15060. type: $setup.messageType,
  15061. message: $setup.messageText,
  15062. duration: 2e3
  15063. }, null, 8, ["type", "message"])
  15064. ]),
  15065. _: 1
  15066. /* STABLE */
  15067. },
  15068. 512
  15069. /* NEED_PATCH */
  15070. ),
  15071. vue.createVNode(
  15072. _component_uni_popup,
  15073. {
  15074. ref: "printerDialog",
  15075. type: "dialog",
  15076. "is-mask-click": false
  15077. },
  15078. {
  15079. default: vue.withCtx(() => [
  15080. vue.createElementVNode("view", { style: { "width": "90%", "margin": "0 auto", "min-height": "250px", "background-color": "#fff", "border-radius": "5px" } }, [
  15081. vue.createElementVNode("view", {
  15082. class: "",
  15083. style: { "font-size": "20px", "border-bottom": "1px solid #e1e1e1", "padding": "15px 10px" }
  15084. }, [
  15085. vue.createElementVNode("view", null, [
  15086. vue.createElementVNode("view", { style: { "margin-bottom": "20px" } }, [
  15087. vue.createElementVNode("text", null, "打印尾程面单")
  15088. ]),
  15089. vue.createElementVNode("view", null, [
  15090. $setup.printerList ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  15091. vue.createElementVNode("view", null, [
  15092. vue.createVNode(_component_uni_data_checkbox, {
  15093. multiple: "",
  15094. modelValue: $setup.sendToPeinter,
  15095. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.sendToPeinter = $event),
  15096. localdata: [
  15097. {
  15098. text: "发送到标签打印机打印",
  15099. value: 1
  15100. }
  15101. ],
  15102. onChange: $setup.sendToPeinterFun
  15103. }, {
  15104. default: vue.withCtx(() => [
  15105. vue.createTextVNode(" > ")
  15106. ]),
  15107. _: 1
  15108. /* STABLE */
  15109. }, 8, ["modelValue"]),
  15110. vue.createVNode(_component_uni_data_checkbox, {
  15111. disabled: $setup.sendToPeinter.length === 0,
  15112. modelValue: $setup.selectPrinter,
  15113. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.selectPrinter = $event),
  15114. localdata: $setup.printers
  15115. }, null, 8, ["disabled", "modelValue", "localdata"])
  15116. ])
  15117. ])) : vue.createCommentVNode("v-if", true)
  15118. ])
  15119. ]),
  15120. vue.createElementVNode("view", { style: { "text-align": "center", "position": "absolute", "bottom": "10px", "width": "90%", "display": "flex", "margin": "0 auto", "left": "0", "right": "0" } }, [
  15121. vue.createElementVNode("button", {
  15122. onClick: $setup.close,
  15123. style: { "width": "35%" }
  15124. }, "关闭"),
  15125. vue.createElementVNode("button", {
  15126. onClick: $setup.printConfirm,
  15127. "hover-stay-time": 500,
  15128. loading: $setup.subLoading,
  15129. disabled: $setup.sendToPeinter.length === 0 || $setup.subLoading,
  15130. class: "my-bt-bg",
  15131. style: { "width": "35%" }
  15132. }, " 打印 ", 8, ["loading", "disabled"])
  15133. ])
  15134. ])
  15135. ])
  15136. ]),
  15137. _: 1
  15138. /* STABLE */
  15139. },
  15140. 512
  15141. /* NEED_PATCH */
  15142. )
  15143. ]);
  15144. }
  15145. const PagesInboundInbound = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$y], ["__scopeId", "data-v-4cc835f2"], ["__file", "E:/demo/hmrabbit/src/pages/inbound/inbound.vue"]]);
  15146. const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
  15147. __name: "logList",
  15148. setup(__props, { expose: __expose }) {
  15149. __expose();
  15150. const historyList = vue.ref([]);
  15151. const getHistory = () => {
  15152. historyList.value = uni.getStorageSync("inboundHistory");
  15153. };
  15154. onLoad(() => {
  15155. getHistory();
  15156. });
  15157. const __returned__ = { historyList, getHistory };
  15158. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  15159. return __returned__;
  15160. }
  15161. });
  15162. function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
  15163. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  15164. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  15165. (vue.openBlock(true), vue.createElementBlock(
  15166. vue.Fragment,
  15167. null,
  15168. vue.renderList($setup.historyList, (item, i2) => {
  15169. return vue.openBlock(), vue.createElementBlock("view", {
  15170. class: "item",
  15171. key: i2
  15172. }, [
  15173. vue.createElementVNode(
  15174. "text",
  15175. {
  15176. class: "code",
  15177. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  15178. },
  15179. [
  15180. vue.createTextVNode(
  15181. vue.toDisplayString(item.orderNum) + " ",
  15182. 1
  15183. /* TEXT */
  15184. ),
  15185. item.space ? (vue.openBlock(), vue.createElementBlock(
  15186. "text",
  15187. { key: 0 },
  15188. "仓位编码: " + vue.toDisplayString(item.space),
  15189. 1
  15190. /* TEXT */
  15191. )) : vue.createCommentVNode("v-if", true),
  15192. vue.createTextVNode(
  15193. " " + vue.toDisplayString(item.type),
  15194. 1
  15195. /* TEXT */
  15196. )
  15197. ],
  15198. 4
  15199. /* STYLE */
  15200. ),
  15201. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  15202. key: 0,
  15203. type: "checkmarkempty",
  15204. class: "status",
  15205. size: "16",
  15206. color: "green"
  15207. })) : (vue.openBlock(), vue.createElementBlock("text", {
  15208. key: 1,
  15209. class: "status fail"
  15210. }, "F")),
  15211. vue.createElementVNode(
  15212. "text",
  15213. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  15214. vue.toDisplayString("\r\n" + item.createTime),
  15215. 1
  15216. /* TEXT */
  15217. )
  15218. ]);
  15219. }),
  15220. 128
  15221. /* KEYED_FRAGMENT */
  15222. )),
  15223. $setup.historyList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  15224. key: 0,
  15225. class: "is-empty"
  15226. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  15227. ]);
  15228. }
  15229. const PagesInboundLogList = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$x], ["__scopeId", "data-v-5286bcd7"], ["__file", "E:/demo/hmrabbit/src/pages/inbound/logList.vue"]]);
  15230. const en$1 = {
  15231. "uni-popup.cancel": "cancel",
  15232. "uni-popup.ok": "ok",
  15233. "uni-popup.placeholder": "pleace enter",
  15234. "uni-popup.title": "Hint",
  15235. "uni-popup.shareTitle": "Share to"
  15236. };
  15237. const zhHans$1 = {
  15238. "uni-popup.cancel": "取消",
  15239. "uni-popup.ok": "确定",
  15240. "uni-popup.placeholder": "请输入",
  15241. "uni-popup.title": "提示",
  15242. "uni-popup.shareTitle": "分享到"
  15243. };
  15244. const zhHant$1 = {
  15245. "uni-popup.cancel": "取消",
  15246. "uni-popup.ok": "確定",
  15247. "uni-popup.placeholder": "請輸入",
  15248. "uni-popup.title": "提示",
  15249. "uni-popup.shareTitle": "分享到"
  15250. };
  15251. const messages$1 = {
  15252. en: en$1,
  15253. "zh-Hans": zhHans$1,
  15254. "zh-Hant": zhHant$1
  15255. };
  15256. const { t: t$1 } = initVueI18n(messages$1);
  15257. const _sfc_main$x = {
  15258. name: "uniPopupDialog",
  15259. mixins: [popup],
  15260. emits: ["confirm", "close"],
  15261. props: {
  15262. value: {
  15263. type: [String, Number],
  15264. default: ""
  15265. },
  15266. placeholder: {
  15267. type: [String, Number],
  15268. default: ""
  15269. },
  15270. type: {
  15271. type: String,
  15272. default: "error"
  15273. },
  15274. mode: {
  15275. type: String,
  15276. default: "base"
  15277. },
  15278. title: {
  15279. type: String,
  15280. default: ""
  15281. },
  15282. content: {
  15283. type: String,
  15284. default: ""
  15285. },
  15286. beforeClose: {
  15287. type: Boolean,
  15288. default: false
  15289. },
  15290. cancelText: {
  15291. type: String,
  15292. default: ""
  15293. },
  15294. confirmText: {
  15295. type: String,
  15296. default: ""
  15297. }
  15298. },
  15299. data() {
  15300. return {
  15301. dialogType: "error",
  15302. focus: false,
  15303. val: ""
  15304. };
  15305. },
  15306. computed: {
  15307. okText() {
  15308. return this.confirmText || t$1("uni-popup.ok");
  15309. },
  15310. closeText() {
  15311. return this.cancelText || t$1("uni-popup.cancel");
  15312. },
  15313. placeholderText() {
  15314. return this.placeholder || t$1("uni-popup.placeholder");
  15315. },
  15316. titleText() {
  15317. return this.title || t$1("uni-popup.title");
  15318. }
  15319. },
  15320. watch: {
  15321. type(val) {
  15322. this.dialogType = val;
  15323. },
  15324. mode(val) {
  15325. if (val === "input") {
  15326. this.dialogType = "info";
  15327. }
  15328. },
  15329. value(val) {
  15330. this.val = val;
  15331. }
  15332. },
  15333. created() {
  15334. this.popup.disableMask();
  15335. if (this.mode === "input") {
  15336. this.dialogType = "info";
  15337. this.val = this.value;
  15338. } else {
  15339. this.dialogType = this.type;
  15340. }
  15341. },
  15342. mounted() {
  15343. this.focus = true;
  15344. },
  15345. methods: {
  15346. /**
  15347. * 点击确认按钮
  15348. */
  15349. onOk() {
  15350. if (this.mode === "input") {
  15351. this.$emit("confirm", this.val);
  15352. } else {
  15353. this.$emit("confirm");
  15354. }
  15355. if (this.beforeClose)
  15356. return;
  15357. this.popup.close();
  15358. },
  15359. /**
  15360. * 点击取消按钮
  15361. */
  15362. closeDialog() {
  15363. this.$emit("close");
  15364. if (this.beforeClose)
  15365. return;
  15366. this.popup.close();
  15367. },
  15368. close() {
  15369. this.popup.close();
  15370. }
  15371. }
  15372. };
  15373. function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
  15374. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-popup-dialog" }, [
  15375. vue.createElementVNode("view", { class: "uni-dialog-title" }, [
  15376. vue.createElementVNode(
  15377. "text",
  15378. {
  15379. class: vue.normalizeClass(["uni-dialog-title-text", ["uni-popup__" + $data.dialogType]])
  15380. },
  15381. vue.toDisplayString($options.titleText),
  15382. 3
  15383. /* TEXT, CLASS */
  15384. )
  15385. ]),
  15386. $props.mode === "base" ? (vue.openBlock(), vue.createElementBlock("view", {
  15387. key: 0,
  15388. class: "uni-dialog-content"
  15389. }, [
  15390. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  15391. vue.createElementVNode(
  15392. "text",
  15393. { class: "uni-dialog-content-text" },
  15394. vue.toDisplayString($props.content),
  15395. 1
  15396. /* TEXT */
  15397. )
  15398. ], true)
  15399. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  15400. key: 1,
  15401. class: "uni-dialog-content"
  15402. }, [
  15403. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  15404. vue.withDirectives(vue.createElementVNode("input", {
  15405. class: "uni-dialog-input",
  15406. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.val = $event),
  15407. type: "text",
  15408. placeholder: $options.placeholderText,
  15409. focus: $data.focus
  15410. }, null, 8, ["placeholder", "focus"]), [
  15411. [vue.vModelText, $data.val]
  15412. ])
  15413. ], true)
  15414. ])),
  15415. vue.createElementVNode("view", { class: "uni-dialog-button-group" }, [
  15416. vue.createElementVNode("view", {
  15417. class: "uni-dialog-button",
  15418. onClick: _cache[1] || (_cache[1] = (...args) => $options.closeDialog && $options.closeDialog(...args))
  15419. }, [
  15420. vue.createElementVNode(
  15421. "text",
  15422. { class: "uni-dialog-button-text" },
  15423. vue.toDisplayString($options.closeText),
  15424. 1
  15425. /* TEXT */
  15426. )
  15427. ]),
  15428. vue.createElementVNode("view", {
  15429. class: "uni-dialog-button uni-border-left",
  15430. onClick: _cache[2] || (_cache[2] = (...args) => $options.onOk && $options.onOk(...args))
  15431. }, [
  15432. vue.createElementVNode(
  15433. "text",
  15434. { class: "uni-dialog-button-text uni-button-color" },
  15435. vue.toDisplayString($options.okText),
  15436. 1
  15437. /* TEXT */
  15438. )
  15439. ])
  15440. ])
  15441. ]);
  15442. }
  15443. const __easycom_6 = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$w], ["__scopeId", "data-v-678a307f"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue"]]);
  15444. const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
  15445. __name: "weigh",
  15446. setup(__props, { expose: __expose }) {
  15447. __expose();
  15448. const alertDialog = vue.ref();
  15449. const message = vue.ref();
  15450. const valiForm = vue.ref();
  15451. const printerDialog = vue.ref();
  15452. const loading = vue.ref(false);
  15453. const images = vue.ref([]);
  15454. const messageType = vue.ref("");
  15455. const messageText = vue.ref("");
  15456. const previewImage = vue.ref(null);
  15457. const maxImages = vue.ref(6);
  15458. const printerList = vue.ref();
  15459. const historyList = vue.ref([]);
  15460. const printers = vue.ref([]);
  15461. const sendToPeinter = vue.ref([1]);
  15462. const selectPrinter = vue.ref(0);
  15463. const subLoading = vue.ref(false);
  15464. const focusType = vue.ref(true);
  15465. const result = vue.ref();
  15466. const valiFormData = vue.reactive({
  15467. images: [],
  15468. orderNum: "",
  15469. weight: "",
  15470. typing: true
  15471. });
  15472. const rules = vue.computed(() => {
  15473. return {
  15474. orderNum: {
  15475. rules: [
  15476. {
  15477. required: true,
  15478. errorMessage: "单号不能为空"
  15479. }
  15480. ]
  15481. },
  15482. weight: {
  15483. rules: [
  15484. {
  15485. required: true,
  15486. errorMessage: "重量不能为空"
  15487. },
  15488. {
  15489. format: "number",
  15490. errorMessage: "重量只能输入数字"
  15491. }
  15492. ]
  15493. }
  15494. };
  15495. });
  15496. onShow(async () => {
  15497. focusType.value = true;
  15498. loading.value = false;
  15499. await Promise.all([_getPrinterList()]);
  15500. });
  15501. onHide(() => {
  15502. focusType.value = false;
  15503. loading.value = false;
  15504. });
  15505. onNavigationBarButtonTap((event) => {
  15506. if (event.index === 0) {
  15507. uni.navigateTo({
  15508. url: "/pages/weigh/logList"
  15509. });
  15510. }
  15511. });
  15512. const _getPrinterList = async () => {
  15513. const res = await getPrinterList();
  15514. if (res.code === 1) {
  15515. printerList.value = res.data.printers;
  15516. printers.value = Object.values(printerList.value).map((item) => {
  15517. return {
  15518. text: item.name,
  15519. value: item.value
  15520. };
  15521. });
  15522. }
  15523. };
  15524. const reset = () => {
  15525. loading.value = false;
  15526. focusType.value = false;
  15527. images.value = [];
  15528. valiFormData.orderNum = "";
  15529. valiFormData.weight = "";
  15530. valiFormData.typing = true;
  15531. vue.nextTick(() => {
  15532. focusType.value = true;
  15533. });
  15534. };
  15535. const scan = async () => {
  15536. let status = await checkPermission();
  15537. if (status !== 1) {
  15538. return;
  15539. }
  15540. uni.scanCode({
  15541. success: (res) => {
  15542. result.value = res.result;
  15543. valiFormData.orderNum = res.result;
  15544. },
  15545. fail: (err) => {
  15546. }
  15547. });
  15548. };
  15549. let st2;
  15550. const warehouseScan2 = async () => {
  15551. st2 && clearTimeout(st2);
  15552. await _checkWaybillGoods();
  15553. };
  15554. const _checkWaybillGoods = async () => {
  15555. loading.value = true;
  15556. const res = await checkWaybillGoods(valiFormData.orderNum);
  15557. if (res.code === 1) {
  15558. if (res.data.is_goods_empty) {
  15559. alertDialog.value.open();
  15560. } else {
  15561. weighScan(0);
  15562. }
  15563. } else {
  15564. messageType.value = "error";
  15565. messageText.value = res.msg;
  15566. message.value.open();
  15567. loading.value = false;
  15568. }
  15569. };
  15570. const weighScan = async (is_save_goods) => {
  15571. const images2 = getImages();
  15572. let allImgVerify = true;
  15573. for (var i2 = 0; i2 < images2.length; i2++) {
  15574. if (!images2[i2].savePath) {
  15575. allImgVerify = false;
  15576. }
  15577. }
  15578. if (!allImgVerify) {
  15579. messageType.value = "error";
  15580. messageText.value = "图片还没上传完毕,请稍后...";
  15581. message.value.open();
  15582. loading.value = false;
  15583. return;
  15584. }
  15585. const res = await weigh({
  15586. order_no: valiFormData.orderNum,
  15587. weight: valiFormData.weight,
  15588. is_save_goods,
  15589. images: images2
  15590. });
  15591. loading.value = false;
  15592. if (res.code == 1) {
  15593. messageType.value = "success";
  15594. messageText.value = res.msg;
  15595. message.value.open();
  15596. const historyItem = {
  15597. orderNum: valiFormData.orderNum,
  15598. createTime: /* @__PURE__ */ new Date(),
  15599. type: "称重",
  15600. status: true
  15601. };
  15602. historyList.value.unshift(historyItem);
  15603. uni.setStorageSync("weighHistory", historyList.value);
  15604. getHistory();
  15605. if (res.data.express_label) {
  15606. selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0;
  15607. printerDialog.value.open();
  15608. } else {
  15609. st2 = setTimeout(() => {
  15610. reset();
  15611. st2 && clearTimeout(st2);
  15612. }, 1e3);
  15613. }
  15614. } else {
  15615. messageType.value = "error";
  15616. messageText.value = res.msg;
  15617. message.value.open();
  15618. const historyItem = {
  15619. orderNum: valiFormData.orderNum,
  15620. createTime: /* @__PURE__ */ new Date(),
  15621. type: "称重",
  15622. status: false
  15623. };
  15624. historyList.value.unshift(historyItem);
  15625. uni.setStorageSync("weighHistory", historyList.value);
  15626. getHistory();
  15627. st2 = setTimeout(() => {
  15628. reset();
  15629. st2 && clearTimeout(st2);
  15630. }, 1e3);
  15631. }
  15632. };
  15633. const close = () => {
  15634. printerDialog.value.close();
  15635. st2 = setTimeout(() => {
  15636. reset();
  15637. st2 && clearTimeout(st2);
  15638. }, 700);
  15639. };
  15640. const dialogConfirm = () => {
  15641. weighScan(1);
  15642. };
  15643. const dialogClose = () => {
  15644. weighScan(0);
  15645. };
  15646. const sendToPeinterFun = (res) => {
  15647. if (res.detail.value.length === 0) {
  15648. selectPrinter.value = 0;
  15649. } else {
  15650. selectPrinter.value = printers.value[0].value;
  15651. }
  15652. };
  15653. const printConfirm = async () => {
  15654. subLoading.value = true;
  15655. const res = await printWaybillLabel({
  15656. order_no: valiFormData.orderNum,
  15657. printer_code: selectPrinter
  15658. });
  15659. close();
  15660. subLoading.value = false;
  15661. formatAppLog("log", "at pages/weigh/weigh.vue:450", "打印成功", res);
  15662. messageType.value = "success";
  15663. messageText.value = "打印成功";
  15664. message.value.open();
  15665. };
  15666. const onsubmit = () => {
  15667. valiForm.value.validate().then((res) => {
  15668. warehouseScan2();
  15669. }).catch((err) => {
  15670. formatAppLog("log", "at pages/weigh/weigh.vue:462", "err", err);
  15671. });
  15672. };
  15673. const getHistory = () => {
  15674. historyList.value = uni.getStorageSync("weighHistory");
  15675. };
  15676. const getImages = () => {
  15677. const res = images.value.map((item) => {
  15678. return {
  15679. name: item.name,
  15680. savePath: item.serverUrl,
  15681. fileSize: item.size,
  15682. mimeType: item.type
  15683. };
  15684. });
  15685. return res;
  15686. };
  15687. const _getAliyunOssSignature = async (rawFiles) => {
  15688. const res = await getAliyunOssSignature();
  15689. const signature = res.data.signature;
  15690. const uploadPromises = rawFiles.map((image) => {
  15691. return upLoadFile(signature, image);
  15692. });
  15693. Promise.all(uploadPromises).then((results) => {
  15694. uni.showToast({
  15695. title: "加载成功",
  15696. icon: "success"
  15697. });
  15698. }).catch((error) => {
  15699. formatAppLog("error", "at pages/weigh/weigh.vue:497", "加载失败:", error);
  15700. uni.showToast({
  15701. title: "加载失败",
  15702. icon: "none"
  15703. });
  15704. });
  15705. };
  15706. const upLoadFile = (signature, image) => {
  15707. const fileData = {
  15708. policy: signature.policy,
  15709. signature: signature.signature,
  15710. ossaccessKeyId: signature.ossAccessKeyId,
  15711. key: signature.dir + dayjs().format("YYYYMMDD") + "/" + uuid() + "_" + image.name,
  15712. dir: signature.dir,
  15713. host: signature.host,
  15714. file: image.file
  15715. };
  15716. return new Promise((resolve, reject) => {
  15717. let name = image.name;
  15718. name = "file";
  15719. const uploadTask = uni.uploadFile({
  15720. url: signature.host,
  15721. // 你的上传接口地址
  15722. filePath: image.path,
  15723. name,
  15724. // 这里根据后端需要的字段来定义
  15725. formData: fileData,
  15726. success: (uploadFileRes) => {
  15727. if (uploadFileRes.statusCode === 204 || uploadFileRes.statusCode === 200) {
  15728. image.serverUrl = fileData.key;
  15729. resolve(uploadFileRes);
  15730. } else {
  15731. reject(uploadFileRes);
  15732. }
  15733. },
  15734. fail: (error) => {
  15735. formatAppLog("log", "at pages/weigh/weigh.vue:542", "error++", error);
  15736. reject(error);
  15737. },
  15738. // 更新上传进度
  15739. complete: () => {
  15740. formatAppLog("log", "at pages/weigh/weigh.vue:547", "complete---");
  15741. image.progress = 100;
  15742. }
  15743. });
  15744. uploadTask.onProgressUpdate((progressEvent) => {
  15745. image.progress = progressEvent.progress;
  15746. });
  15747. });
  15748. };
  15749. const chooseImage = () => {
  15750. uni.chooseImage({
  15751. count: maxImages.value - images.value.length,
  15752. success: (res) => {
  15753. images.value = images.value.concat(
  15754. res.tempFiles.map((item) => {
  15755. const res2 = {
  15756. size: item.size,
  15757. path: item.path,
  15758. name: item.name,
  15759. type: item.type,
  15760. progress: 0,
  15761. file: item
  15762. };
  15763. const suffix = item.path.substring(item.path.lastIndexOf(".") + 1);
  15764. const fileName = item.path.substring(item.path.lastIndexOf("/") + 1);
  15765. res2.name = fileName;
  15766. res2.type = suffix;
  15767. return res2;
  15768. })
  15769. );
  15770. const paddingImages = images.value.filter((image) => image.progress === 0);
  15771. vue.nextTick(() => {
  15772. _getAliyunOssSignature(paddingImages);
  15773. });
  15774. },
  15775. fail: (err) => {
  15776. formatAppLog("error", "at pages/weigh/weigh.vue:592", err);
  15777. }
  15778. });
  15779. };
  15780. const deleteImage = (index) => {
  15781. images.value.splice(index, 1);
  15782. };
  15783. const openPreview = (image) => {
  15784. previewImage.value = image;
  15785. };
  15786. const closePreview = () => {
  15787. previewImage.value = null;
  15788. };
  15789. const __returned__ = { alertDialog, message, valiForm, printerDialog, loading, images, messageType, messageText, previewImage, maxImages, printerList, historyList, printers, sendToPeinter, selectPrinter, subLoading, focusType, result, valiFormData, rules, _getPrinterList, reset, scan, get st() {
  15790. return st2;
  15791. }, set st(v2) {
  15792. st2 = v2;
  15793. }, warehouseScan: warehouseScan2, _checkWaybillGoods, weighScan, close, dialogConfirm, dialogClose, sendToPeinterFun, printConfirm, onsubmit, getHistory, getImages, _getAliyunOssSignature, upLoadFile, chooseImage, deleteImage, openPreview, closePreview };
  15794. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  15795. return __returned__;
  15796. }
  15797. });
  15798. function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
  15799. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$7);
  15800. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_0$4);
  15801. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  15802. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$1);
  15803. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_1$1);
  15804. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  15805. const _component_uni_popup_dialog = resolveEasycom(vue.resolveDynamicComponent("uni-popup-dialog"), __easycom_6);
  15806. const _component_uni_data_checkbox = resolveEasycom(vue.resolveDynamicComponent("uni-data-checkbox"), __easycom_7);
  15807. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  15808. vue.createElementVNode("view", { class: "example" }, [
  15809. vue.createCommentVNode(" 基础表单校验 "),
  15810. vue.createVNode(_component_uni_forms, {
  15811. ref: "valiForm",
  15812. "label-align": "right",
  15813. "label-width": "80px",
  15814. rules: $setup.rules,
  15815. modelValue: $setup.valiFormData
  15816. }, {
  15817. default: vue.withCtx(() => [
  15818. vue.createVNode(_component_uni_forms_item, {
  15819. label: "单号",
  15820. required: "",
  15821. name: "orderNum"
  15822. }, {
  15823. default: vue.withCtx(() => [
  15824. vue.createVNode(_component_uni_easyinput, {
  15825. modelValue: $setup.valiFormData.orderNum,
  15826. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  15827. placeholder: "请输入单号",
  15828. suffixIcon: "scan",
  15829. focus: $setup.focusType,
  15830. onIconClick: $setup.scan
  15831. }, null, 8, ["modelValue", "focus"])
  15832. ]),
  15833. _: 1
  15834. /* STABLE */
  15835. }),
  15836. vue.createVNode(_component_uni_forms_item, {
  15837. label: "重量",
  15838. required: "",
  15839. name: "weight"
  15840. }, {
  15841. default: vue.withCtx(() => [
  15842. vue.createVNode(_component_uni_easyinput, {
  15843. modelValue: $setup.valiFormData.weight,
  15844. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.weight = $event),
  15845. placeholder: "请输入重量",
  15846. oninput: "value=value.replace(/[^\\d.]/g,'').replace(/^\\./g, '').replace(/\\.{2,}/g, '').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').match(/^\\d*(\\.?\\d{0,2})/g)[0] || null"
  15847. }, {
  15848. right: vue.withCtx(() => [
  15849. vue.createElementVNode("view", { class: "weight-right" }, "KG")
  15850. ]),
  15851. _: 1
  15852. /* STABLE */
  15853. }, 8, ["modelValue"])
  15854. ]),
  15855. _: 1
  15856. /* STABLE */
  15857. }),
  15858. vue.createVNode(_component_uni_forms_item, {
  15859. label: "图片",
  15860. name: "images"
  15861. }, {
  15862. default: vue.withCtx(() => [
  15863. vue.createElementVNode("view", { class: "upload-container" }, [
  15864. vue.createElementVNode("view", { class: "preview" }, [
  15865. (vue.openBlock(true), vue.createElementBlock(
  15866. vue.Fragment,
  15867. null,
  15868. vue.renderList($setup.images, (img, index) => {
  15869. return vue.openBlock(), vue.createElementBlock("view", {
  15870. key: index,
  15871. class: "image-container"
  15872. }, [
  15873. vue.createElementVNode("image", {
  15874. src: img.path,
  15875. class: "preview-image",
  15876. mode: "aspectFill",
  15877. onClick: ($event) => $setup.openPreview(img.path)
  15878. }, null, 8, ["src", "onClick"]),
  15879. vue.createElementVNode("progress", {
  15880. percent: img.progress || 0,
  15881. activeColor: Number(img.progress || 0) === 100 ? "#00ff00" : "#10AEFF",
  15882. "stroke-width": "3"
  15883. }, null, 8, ["percent", "activeColor"]),
  15884. img.status === "success" ? (vue.openBlock(), vue.createElementBlock("text", { key: 0 }, "1")) : vue.createCommentVNode("v-if", true),
  15885. vue.createVNode(_component_uni_icons, {
  15886. class: "delete-icon",
  15887. onClick: ($event) => $setup.deleteImage(index),
  15888. type: "clear",
  15889. size: "20",
  15890. color: "red"
  15891. }, null, 8, ["onClick"])
  15892. ]);
  15893. }),
  15894. 128
  15895. /* KEYED_FRAGMENT */
  15896. )),
  15897. $setup.images.length < $setup.maxImages ? (vue.openBlock(), vue.createElementBlock("view", {
  15898. key: 0,
  15899. class: "choose-image-container",
  15900. onClick: $setup.chooseImage
  15901. }, [
  15902. vue.createVNode(_component_uni_icons, {
  15903. type: "plusempty",
  15904. size: "40",
  15905. color: "#ccc"
  15906. })
  15907. ])) : vue.createCommentVNode("v-if", true)
  15908. ]),
  15909. vue.createElementVNode("text", { style: { "padding-top": "8px" } }, "最多选择6张图片"),
  15910. vue.createCommentVNode(" 放大预览 "),
  15911. $setup.previewImage ? (vue.openBlock(), vue.createElementBlock("view", {
  15912. key: 0,
  15913. class: "preview-modal",
  15914. onClick: $setup.closePreview
  15915. }, [
  15916. vue.createElementVNode("image", {
  15917. src: $setup.previewImage,
  15918. class: "preview-large",
  15919. mode: "aspectFit",
  15920. onClick: vue.withModifiers($setup.closePreview, ["stop"])
  15921. }, null, 8, ["src"])
  15922. ])) : vue.createCommentVNode("v-if", true)
  15923. ])
  15924. ]),
  15925. _: 1
  15926. /* STABLE */
  15927. })
  15928. ]),
  15929. _: 1
  15930. /* STABLE */
  15931. }, 8, ["rules", "modelValue"]),
  15932. vue.createElementVNode("view", { class: "button-group" }, [
  15933. vue.createElementVNode("button", {
  15934. type: "info",
  15935. onClick: $setup.reset
  15936. }, "重置"),
  15937. vue.createElementVNode("button", {
  15938. type: "primary",
  15939. onClick: $setup.onsubmit,
  15940. loading: $setup.loading
  15941. }, [
  15942. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  15943. key: 0,
  15944. type: "checkmarkempty",
  15945. size: "18",
  15946. color: "white"
  15947. })) : vue.createCommentVNode("v-if", true),
  15948. vue.createTextVNode(" 提交 ")
  15949. ], 8, ["loading"])
  15950. ])
  15951. ]),
  15952. vue.createElementVNode("view", { class: "history" }, [
  15953. (vue.openBlock(true), vue.createElementBlock(
  15954. vue.Fragment,
  15955. null,
  15956. vue.renderList($setup.historyList.slice(0, 5), (item, i2) => {
  15957. return vue.openBlock(), vue.createElementBlock("view", {
  15958. class: "item",
  15959. key: i2
  15960. }, [
  15961. vue.createElementVNode(
  15962. "text",
  15963. {
  15964. class: "code",
  15965. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  15966. },
  15967. vue.toDisplayString(item.orderNum) + " " + vue.toDisplayString(item.type),
  15968. 5
  15969. /* TEXT, STYLE */
  15970. ),
  15971. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  15972. key: 0,
  15973. type: "checkmarkempty",
  15974. class: "status",
  15975. size: "16",
  15976. color: "green"
  15977. })) : (vue.openBlock(), vue.createElementBlock("text", {
  15978. key: 1,
  15979. class: "status fail"
  15980. }, "F")),
  15981. vue.createElementVNode(
  15982. "text",
  15983. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  15984. vue.toDisplayString("\r\n" + item.createTime),
  15985. 1
  15986. /* TEXT */
  15987. )
  15988. ]);
  15989. }),
  15990. 128
  15991. /* KEYED_FRAGMENT */
  15992. ))
  15993. ]),
  15994. vue.createVNode(
  15995. _component_uni_popup,
  15996. {
  15997. ref: "message",
  15998. type: "message"
  15999. },
  16000. {
  16001. default: vue.withCtx(() => [
  16002. vue.createVNode(_component_uni_popup_message, {
  16003. type: $setup.messageType,
  16004. message: $setup.messageText,
  16005. duration: 2e3
  16006. }, null, 8, ["type", "message"])
  16007. ]),
  16008. _: 1
  16009. /* STABLE */
  16010. },
  16011. 512
  16012. /* NEED_PATCH */
  16013. ),
  16014. vue.createVNode(
  16015. _component_uni_popup,
  16016. {
  16017. ref: "alertDialog",
  16018. type: "dialog"
  16019. },
  16020. {
  16021. default: vue.withCtx(() => [
  16022. vue.createVNode(_component_uni_popup_dialog, {
  16023. type: "info",
  16024. cancelText: "否",
  16025. confirmText: "是",
  16026. title: "提示",
  16027. content: "是否按默认申报(默认申报为:衣服,10件,单价1)",
  16028. onConfirm: $setup.dialogConfirm,
  16029. onClose: $setup.dialogClose
  16030. })
  16031. ]),
  16032. _: 1
  16033. /* STABLE */
  16034. },
  16035. 512
  16036. /* NEED_PATCH */
  16037. ),
  16038. vue.createVNode(
  16039. _component_uni_popup,
  16040. {
  16041. ref: "printerDialog",
  16042. type: "dialog",
  16043. "is-mask-click": false
  16044. },
  16045. {
  16046. default: vue.withCtx(() => [
  16047. vue.createElementVNode("view", { style: { "width": "90%", "margin": "0 auto", "min-height": "250px", "background-color": "#fff", "border-radius": "5px" } }, [
  16048. vue.createElementVNode("view", {
  16049. class: "",
  16050. style: { "font-size": "20px", "border-bottom": "1px solid #e1e1e1", "padding": "15px 10px" }
  16051. }, [
  16052. vue.createElementVNode("view", null, [
  16053. vue.createElementVNode("view", { style: { "margin-bottom": "20px" } }, [
  16054. vue.createElementVNode("text", null, "打印尾程面单")
  16055. ]),
  16056. vue.createElementVNode("view", null, [
  16057. $setup.printerList ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  16058. vue.createElementVNode("view", null, [
  16059. vue.createVNode(_component_uni_data_checkbox, {
  16060. multiple: "",
  16061. modelValue: $setup.sendToPeinter,
  16062. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.sendToPeinter = $event),
  16063. localdata: [
  16064. {
  16065. text: "发送到标签打印机打印",
  16066. value: 1
  16067. }
  16068. ],
  16069. onChange: $setup.sendToPeinterFun
  16070. }, {
  16071. default: vue.withCtx(() => [
  16072. vue.createTextVNode(" > ")
  16073. ]),
  16074. _: 1
  16075. /* STABLE */
  16076. }, 8, ["modelValue"]),
  16077. vue.createVNode(_component_uni_data_checkbox, {
  16078. disabled: $setup.sendToPeinter.length === 0,
  16079. modelValue: $setup.selectPrinter,
  16080. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.selectPrinter = $event),
  16081. localdata: $setup.printers
  16082. }, null, 8, ["disabled", "modelValue", "localdata"])
  16083. ])
  16084. ])) : vue.createCommentVNode("v-if", true)
  16085. ])
  16086. ]),
  16087. vue.createElementVNode("view", { style: { "text-align": "center", "position": "absolute", "bottom": "10px", "width": "90%", "display": "flex", "margin": "0 auto", "left": "0", "right": "0" } }, [
  16088. vue.createElementVNode("button", {
  16089. onClick: $setup.close,
  16090. style: { "width": "35%" }
  16091. }, "关闭"),
  16092. vue.createElementVNode("button", {
  16093. onClick: $setup.printConfirm,
  16094. "hover-stay-time": 500,
  16095. loading: $setup.subLoading,
  16096. disabled: $setup.sendToPeinter.length === 0 || $setup.subLoading,
  16097. class: "my-bt-bg",
  16098. style: { "width": "35%" }
  16099. }, " 打印 ", 8, ["loading", "disabled"])
  16100. ])
  16101. ])
  16102. ])
  16103. ]),
  16104. _: 1
  16105. /* STABLE */
  16106. },
  16107. 512
  16108. /* NEED_PATCH */
  16109. )
  16110. ]);
  16111. }
  16112. const PagesWeighWeigh = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$v], ["__scopeId", "data-v-6f825acf"], ["__file", "E:/demo/hmrabbit/src/pages/weigh/weigh.vue"]]);
  16113. const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
  16114. __name: "logList",
  16115. setup(__props, { expose: __expose }) {
  16116. __expose();
  16117. const historyList = vue.ref([]);
  16118. const getHistory = () => {
  16119. historyList.value = uni.getStorageSync("weighHistory");
  16120. };
  16121. onLoad(() => {
  16122. getHistory();
  16123. });
  16124. const __returned__ = { historyList, getHistory };
  16125. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  16126. return __returned__;
  16127. }
  16128. });
  16129. function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
  16130. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  16131. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  16132. (vue.openBlock(true), vue.createElementBlock(
  16133. vue.Fragment,
  16134. null,
  16135. vue.renderList($setup.historyList, (item, i2) => {
  16136. return vue.openBlock(), vue.createElementBlock("view", {
  16137. class: "item",
  16138. key: i2
  16139. }, [
  16140. vue.createElementVNode(
  16141. "text",
  16142. {
  16143. class: "code",
  16144. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  16145. },
  16146. vue.toDisplayString(item.orderNum) + " " + vue.toDisplayString(item.type),
  16147. 5
  16148. /* TEXT, STYLE */
  16149. ),
  16150. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  16151. key: 0,
  16152. type: "checkmarkempty",
  16153. class: "status",
  16154. size: "16",
  16155. color: "green"
  16156. })) : (vue.openBlock(), vue.createElementBlock("text", {
  16157. key: 1,
  16158. class: "status fail"
  16159. }, "F")),
  16160. vue.createElementVNode(
  16161. "text",
  16162. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  16163. vue.toDisplayString("\r\n" + item.createTime),
  16164. 1
  16165. /* TEXT */
  16166. )
  16167. ]);
  16168. }),
  16169. 128
  16170. /* KEYED_FRAGMENT */
  16171. )),
  16172. $setup.historyList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  16173. key: 0,
  16174. class: "is-empty"
  16175. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  16176. ]);
  16177. }
  16178. const PagesWeighLogList = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$u], ["__scopeId", "data-v-4fa869ac"], ["__file", "E:/demo/hmrabbit/src/pages/weigh/logList.vue"]]);
  16179. const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
  16180. __name: "outbound",
  16181. setup(__props, { expose: __expose }) {
  16182. __expose();
  16183. const message = vue.ref();
  16184. const valiForm = vue.ref();
  16185. const printerDialog = vue.ref();
  16186. const loading = vue.ref(false);
  16187. const messageType = vue.ref("");
  16188. const messageText = vue.ref("");
  16189. const batchOptions = vue.ref([]);
  16190. const printerList = vue.ref();
  16191. const historyList = vue.ref([]);
  16192. const printers = vue.ref([]);
  16193. const sendToPeinter = vue.ref([1]);
  16194. const selectPrinter = vue.ref(0);
  16195. const subLoading = vue.ref(false);
  16196. const focusType = vue.ref(true);
  16197. const result = vue.ref();
  16198. const valiFormData = vue.reactive({
  16199. orderNum: "",
  16200. batch_number: "",
  16201. weight: "",
  16202. typing: true
  16203. });
  16204. const rules = vue.computed(() => {
  16205. return {
  16206. orderNum: {
  16207. rules: [
  16208. {
  16209. required: false,
  16210. errorMessage: "单号不能为空"
  16211. }
  16212. ]
  16213. }
  16214. };
  16215. });
  16216. onShow(async () => {
  16217. focusType.value = true;
  16218. loading.value = false;
  16219. await Promise.all([_getBindParams(), _getPrinterList()]);
  16220. });
  16221. onHide(() => {
  16222. focusType.value = false;
  16223. loading.value = false;
  16224. });
  16225. onNavigationBarButtonTap((event) => {
  16226. if (event.index === 0) {
  16227. uni.navigateTo({
  16228. url: "/pages/outbound/logList"
  16229. });
  16230. }
  16231. });
  16232. const _getBindParams = async () => {
  16233. const res = await getBindParams$1();
  16234. if (res.code === 1) {
  16235. batchOptions.value = res.data.batch_number.map((item) => {
  16236. return {
  16237. text: item.name,
  16238. value: item.id
  16239. };
  16240. });
  16241. }
  16242. };
  16243. const _getPrinterList = async () => {
  16244. const res = await getPrinterList();
  16245. if (res.code === 1) {
  16246. printerList.value = res.data.printers;
  16247. printers.value = Object.values(printerList.value).map((item) => {
  16248. return {
  16249. text: item.name,
  16250. value: item.value
  16251. };
  16252. });
  16253. }
  16254. };
  16255. const batchText = (batch_number) => {
  16256. var _a;
  16257. return (_a = batchOptions.value.find((item) => item.value === batch_number)) == null ? void 0 : _a.text;
  16258. };
  16259. const reset = () => {
  16260. loading.value = false;
  16261. focusType.value = false;
  16262. valiFormData.orderNum = "";
  16263. valiFormData.batch_number = "";
  16264. valiFormData.weight = "";
  16265. valiFormData.typing = true;
  16266. vue.nextTick(() => {
  16267. focusType.value = true;
  16268. });
  16269. };
  16270. const scan = async () => {
  16271. let status = await checkPermission();
  16272. if (status !== 1) {
  16273. return;
  16274. }
  16275. uni.scanCode({
  16276. success: (res) => {
  16277. result.value = res.result;
  16278. valiFormData.orderNum = res.result;
  16279. },
  16280. fail: (err) => {
  16281. }
  16282. });
  16283. };
  16284. let st2;
  16285. const warehouseScan2 = async () => {
  16286. st2 && clearTimeout(st2);
  16287. await scanOutstock();
  16288. };
  16289. const scanOutstock = async () => {
  16290. formatAppLog("log", "at pages/outbound/outbound.vue:268", valiFormData.orderNum, valiFormData.batch_number);
  16291. if (valiFormData.orderNum.length === 0 && valiFormData.batch_number.length === 0) {
  16292. messageType.value = "error";
  16293. messageText.value = "单号或批次号至少填一个";
  16294. message.value.open();
  16295. return;
  16296. }
  16297. loading.value = true;
  16298. const res = await outStock({
  16299. order_no: valiFormData.orderNum,
  16300. batch_number: valiFormData.batch_number
  16301. });
  16302. loading.value = false;
  16303. if (res.code == 1) {
  16304. messageType.value = "success";
  16305. messageText.value = res.msg;
  16306. message.value.open();
  16307. const historyItem = {
  16308. orderNum: valiFormData.orderNum,
  16309. batch_text: batchText(valiFormData.batch_number),
  16310. createTime: /* @__PURE__ */ new Date(),
  16311. type: "出库",
  16312. status: true
  16313. };
  16314. historyList.value.unshift(historyItem);
  16315. historyList.value.length > 10 && (historyList.value.length = 10);
  16316. uni.setStorageSync("outboundHistory", historyList.value);
  16317. getHistory();
  16318. if (res.data.labels && res.data.labels.length > 0) {
  16319. selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0;
  16320. printerDialog.value.open();
  16321. loading.value = false;
  16322. } else {
  16323. st2 = setTimeout(() => {
  16324. reset();
  16325. st2 && clearTimeout(st2);
  16326. loading.value = false;
  16327. }, 700);
  16328. }
  16329. } else {
  16330. messageType.value = "error";
  16331. messageText.value = res.msg;
  16332. message.value.open();
  16333. const historyItem = {
  16334. orderNum: valiFormData.orderNum,
  16335. batch_text: batchText(valiFormData.batch_number),
  16336. createTime: /* @__PURE__ */ new Date(),
  16337. type: "出库",
  16338. status: false
  16339. };
  16340. historyList.value.unshift(historyItem);
  16341. historyList.value.length > 10 && (historyList.value.length = 10);
  16342. uni.setStorageSync("outboundHistory", historyList.value);
  16343. getHistory();
  16344. st2 = setTimeout(() => {
  16345. reset();
  16346. st2 && clearTimeout(st2);
  16347. loading.value = false;
  16348. }, 700);
  16349. }
  16350. };
  16351. const close = () => {
  16352. printerDialog.value.close();
  16353. st2 = setTimeout(() => {
  16354. reset();
  16355. st2 && clearTimeout(st2);
  16356. }, 700);
  16357. };
  16358. const sendToPeinterFun = (res) => {
  16359. if (res.detail.value.length === 0) {
  16360. selectPrinter.value = 0;
  16361. } else {
  16362. selectPrinter.value = printers.value[0].value;
  16363. }
  16364. };
  16365. const printConfirm = async () => {
  16366. subLoading.value = true;
  16367. const res = await printWaybillLabel({
  16368. order_no: valiFormData.orderNum,
  16369. printer_code: selectPrinter
  16370. });
  16371. close();
  16372. subLoading.value = false;
  16373. formatAppLog("log", "at pages/outbound/outbound.vue:357", "打印成功", res);
  16374. messageType.value = "success";
  16375. messageText.value = "打印成功";
  16376. message.value.open();
  16377. };
  16378. const onsubmit = () => {
  16379. valiForm.value.validate().then((res) => {
  16380. warehouseScan2();
  16381. }).catch((err) => {
  16382. formatAppLog("log", "at pages/outbound/outbound.vue:369", "err", err);
  16383. });
  16384. };
  16385. const getHistory = () => {
  16386. historyList.value = uni.getStorageSync("outboundHistory");
  16387. };
  16388. const __returned__ = { message, valiForm, printerDialog, loading, messageType, messageText, batchOptions, printerList, historyList, printers, sendToPeinter, selectPrinter, subLoading, focusType, result, valiFormData, rules, _getBindParams, _getPrinterList, batchText, reset, scan, get st() {
  16389. return st2;
  16390. }, set st(v2) {
  16391. st2 = v2;
  16392. }, warehouseScan: warehouseScan2, scanOutstock, close, sendToPeinterFun, printConfirm, onsubmit, getHistory };
  16393. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  16394. return __returned__;
  16395. }
  16396. });
  16397. function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
  16398. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$7);
  16399. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_0$4);
  16400. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$3);
  16401. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$1);
  16402. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  16403. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_1$1);
  16404. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  16405. const _component_uni_data_checkbox = resolveEasycom(vue.resolveDynamicComponent("uni-data-checkbox"), __easycom_7);
  16406. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  16407. vue.createElementVNode("view", { class: "example" }, [
  16408. vue.createCommentVNode(" 基础表单校验 "),
  16409. vue.createVNode(_component_uni_forms, {
  16410. ref: "valiForm",
  16411. "label-align": "right",
  16412. "label-width": "80px",
  16413. rules: $setup.rules,
  16414. modelValue: $setup.valiFormData
  16415. }, {
  16416. default: vue.withCtx(() => [
  16417. vue.createVNode(_component_uni_forms_item, {
  16418. label: "单号",
  16419. required: false,
  16420. name: "orderNum"
  16421. }, {
  16422. default: vue.withCtx(() => [
  16423. vue.createVNode(_component_uni_easyinput, {
  16424. modelValue: $setup.valiFormData.orderNum,
  16425. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  16426. placeholder: "请输入单号",
  16427. suffixIcon: "scan",
  16428. focus: $setup.focusType,
  16429. onIconClick: $setup.scan
  16430. }, null, 8, ["modelValue", "focus"])
  16431. ]),
  16432. _: 1
  16433. /* STABLE */
  16434. }),
  16435. vue.createVNode(_component_uni_forms_item, {
  16436. label: "批次号",
  16437. name: "batch_number"
  16438. }, {
  16439. default: vue.withCtx(() => [
  16440. vue.createVNode(_component_uni_data_select, {
  16441. modelValue: $setup.valiFormData.batch_number,
  16442. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.batch_number = $event),
  16443. localdata: $setup.batchOptions,
  16444. placeholder: "请选择批次号"
  16445. }, null, 8, ["modelValue", "localdata"])
  16446. ]),
  16447. _: 1
  16448. /* STABLE */
  16449. })
  16450. ]),
  16451. _: 1
  16452. /* STABLE */
  16453. }, 8, ["rules", "modelValue"]),
  16454. vue.createElementVNode("view", { class: "button-group" }, [
  16455. vue.createElementVNode("button", {
  16456. type: "info",
  16457. onClick: $setup.reset
  16458. }, "重置"),
  16459. vue.createElementVNode("button", {
  16460. type: "primary",
  16461. onClick: $setup.onsubmit,
  16462. loading: $setup.loading
  16463. }, [
  16464. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  16465. key: 0,
  16466. type: "checkmarkempty",
  16467. size: "18",
  16468. color: "white"
  16469. })) : vue.createCommentVNode("v-if", true),
  16470. vue.createTextVNode(" 提交 ")
  16471. ], 8, ["loading"])
  16472. ])
  16473. ]),
  16474. vue.createElementVNode("view", { class: "history" }, [
  16475. (vue.openBlock(true), vue.createElementBlock(
  16476. vue.Fragment,
  16477. null,
  16478. vue.renderList($setup.historyList.slice(0, 5), (item, i2) => {
  16479. return vue.openBlock(), vue.createElementBlock("view", {
  16480. class: "item",
  16481. key: i2
  16482. }, [
  16483. vue.createElementVNode(
  16484. "text",
  16485. {
  16486. class: "code",
  16487. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  16488. },
  16489. [
  16490. vue.createTextVNode(
  16491. vue.toDisplayString(item.orderNum) + " ",
  16492. 1
  16493. /* TEXT */
  16494. ),
  16495. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  16496. "text",
  16497. { key: 0 },
  16498. "批次号: " + vue.toDisplayString(item.batch_text),
  16499. 1
  16500. /* TEXT */
  16501. )) : vue.createCommentVNode("v-if", true),
  16502. vue.createTextVNode(
  16503. " " + vue.toDisplayString(item.type),
  16504. 1
  16505. /* TEXT */
  16506. )
  16507. ],
  16508. 4
  16509. /* STYLE */
  16510. ),
  16511. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  16512. key: 0,
  16513. type: "checkmarkempty",
  16514. class: "status",
  16515. size: "16",
  16516. color: "green"
  16517. })) : (vue.openBlock(), vue.createElementBlock("text", {
  16518. key: 1,
  16519. class: "status fail"
  16520. }, "F")),
  16521. vue.createElementVNode(
  16522. "text",
  16523. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  16524. vue.toDisplayString("\r\n" + item.createTime),
  16525. 1
  16526. /* TEXT */
  16527. )
  16528. ]);
  16529. }),
  16530. 128
  16531. /* KEYED_FRAGMENT */
  16532. ))
  16533. ]),
  16534. vue.createVNode(
  16535. _component_uni_popup,
  16536. {
  16537. ref: "message",
  16538. type: "message"
  16539. },
  16540. {
  16541. default: vue.withCtx(() => [
  16542. vue.createVNode(_component_uni_popup_message, {
  16543. type: $setup.messageType,
  16544. message: $setup.messageText,
  16545. duration: 2e3
  16546. }, null, 8, ["type", "message"])
  16547. ]),
  16548. _: 1
  16549. /* STABLE */
  16550. },
  16551. 512
  16552. /* NEED_PATCH */
  16553. ),
  16554. vue.createVNode(
  16555. _component_uni_popup,
  16556. {
  16557. ref: "printerDialog",
  16558. type: "dialog",
  16559. "is-mask-click": false
  16560. },
  16561. {
  16562. default: vue.withCtx(() => [
  16563. vue.createElementVNode("view", { style: { "width": "90%", "margin": "0 auto", "min-height": "250px", "background-color": "#fff", "border-radius": "5px" } }, [
  16564. vue.createElementVNode("view", {
  16565. class: "",
  16566. style: { "font-size": "20px", "border-bottom": "1px solid #e1e1e1", "padding": "15px 10px" }
  16567. }, [
  16568. vue.createElementVNode("view", null, [
  16569. vue.createElementVNode("view", { style: { "margin-bottom": "20px" } }, [
  16570. vue.createElementVNode("text", null, "打印尾程面单")
  16571. ]),
  16572. vue.createElementVNode("view", null, [
  16573. $setup.printerList ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
  16574. vue.createElementVNode("view", null, [
  16575. vue.createVNode(_component_uni_data_checkbox, {
  16576. multiple: "",
  16577. modelValue: $setup.sendToPeinter,
  16578. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.sendToPeinter = $event),
  16579. localdata: [
  16580. {
  16581. text: "发送到标签打印机打印",
  16582. value: 1
  16583. }
  16584. ],
  16585. onChange: $setup.sendToPeinterFun
  16586. }, {
  16587. default: vue.withCtx(() => [
  16588. vue.createTextVNode(" > ")
  16589. ]),
  16590. _: 1
  16591. /* STABLE */
  16592. }, 8, ["modelValue"]),
  16593. vue.createVNode(_component_uni_data_checkbox, {
  16594. disabled: $setup.sendToPeinter.length === 0,
  16595. modelValue: $setup.selectPrinter,
  16596. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.selectPrinter = $event),
  16597. localdata: $setup.printers
  16598. }, null, 8, ["disabled", "modelValue", "localdata"])
  16599. ])
  16600. ])) : vue.createCommentVNode("v-if", true)
  16601. ])
  16602. ]),
  16603. vue.createElementVNode("view", { style: { "text-align": "center", "position": "absolute", "bottom": "10px", "width": "90%", "display": "flex", "margin": "0 auto", "left": "0", "right": "0" } }, [
  16604. vue.createElementVNode("button", {
  16605. onClick: $setup.close,
  16606. style: { "width": "35%" }
  16607. }, "关闭"),
  16608. vue.createElementVNode("button", {
  16609. onClick: $setup.printConfirm,
  16610. "hover-stay-time": 500,
  16611. loading: $setup.subLoading,
  16612. disabled: $setup.sendToPeinter.length === 0 || $setup.subLoading,
  16613. class: "my-bt-bg",
  16614. style: { "width": "35%" }
  16615. }, " 打印 ", 8, ["loading", "disabled"])
  16616. ])
  16617. ])
  16618. ])
  16619. ]),
  16620. _: 1
  16621. /* STABLE */
  16622. },
  16623. 512
  16624. /* NEED_PATCH */
  16625. )
  16626. ]);
  16627. }
  16628. const PagesOutboundOutbound = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t], ["__scopeId", "data-v-b3062ebb"], ["__file", "E:/demo/hmrabbit/src/pages/outbound/outbound.vue"]]);
  16629. const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
  16630. __name: "logList",
  16631. setup(__props, { expose: __expose }) {
  16632. __expose();
  16633. const historyList = vue.ref([]);
  16634. const getHistory = () => {
  16635. historyList.value = uni.getStorageSync("outboundHistory");
  16636. };
  16637. onLoad(() => {
  16638. getHistory();
  16639. });
  16640. const __returned__ = { historyList, getHistory };
  16641. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  16642. return __returned__;
  16643. }
  16644. });
  16645. function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
  16646. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  16647. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  16648. (vue.openBlock(true), vue.createElementBlock(
  16649. vue.Fragment,
  16650. null,
  16651. vue.renderList($setup.historyList, (item, i2) => {
  16652. return vue.openBlock(), vue.createElementBlock("view", {
  16653. class: "item",
  16654. key: i2
  16655. }, [
  16656. vue.createElementVNode(
  16657. "text",
  16658. {
  16659. class: "code",
  16660. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  16661. },
  16662. [
  16663. vue.createTextVNode(
  16664. vue.toDisplayString(item.orderNum) + " ",
  16665. 1
  16666. /* TEXT */
  16667. ),
  16668. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  16669. "text",
  16670. { key: 0 },
  16671. "批次号: " + vue.toDisplayString(item.batch_text),
  16672. 1
  16673. /* TEXT */
  16674. )) : vue.createCommentVNode("v-if", true),
  16675. vue.createTextVNode(
  16676. " " + vue.toDisplayString(item.type),
  16677. 1
  16678. /* TEXT */
  16679. )
  16680. ],
  16681. 4
  16682. /* STYLE */
  16683. ),
  16684. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  16685. key: 0,
  16686. type: "checkmarkempty",
  16687. class: "status",
  16688. size: "16",
  16689. color: "green"
  16690. })) : (vue.openBlock(), vue.createElementBlock("text", {
  16691. key: 1,
  16692. class: "status fail"
  16693. }, "F")),
  16694. vue.createElementVNode(
  16695. "text",
  16696. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  16697. vue.toDisplayString("\r\n" + item.createTime),
  16698. 1
  16699. /* TEXT */
  16700. )
  16701. ]);
  16702. }),
  16703. 128
  16704. /* KEYED_FRAGMENT */
  16705. )),
  16706. $setup.historyList.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  16707. key: 0,
  16708. class: "is-empty"
  16709. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  16710. ]);
  16711. }
  16712. const PagesOutboundLogList = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s], ["__scopeId", "data-v-c14564f1"], ["__file", "E:/demo/hmrabbit/src/pages/outbound/logList.vue"]]);
  16713. const warehouseScan = (data) => {
  16714. return http({
  16715. method: "POST",
  16716. url: "/admin/order.sheetOrder/warehouseScan",
  16717. data
  16718. });
  16719. };
  16720. const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
  16721. __name: "warehouseScan",
  16722. setup(__props, { expose: __expose }) {
  16723. __expose();
  16724. const valiFormRef = vue.ref();
  16725. const loading = vue.ref(false);
  16726. const hidePage = vue.ref(false);
  16727. const focusType = vue.ref(true);
  16728. const warehouseLogHistory = vue.ref([]);
  16729. const messageRef = vue.ref();
  16730. const messageType = vue.ref();
  16731. const messageText = vue.ref();
  16732. let st2;
  16733. const valiFormData = vue.ref({
  16734. order_code: ""
  16735. });
  16736. const rules = vue.reactive({
  16737. order_code: {
  16738. rules: [
  16739. {
  16740. required: true,
  16741. errorMessage: "单据编号不能为空"
  16742. }
  16743. ]
  16744. }
  16745. });
  16746. const scanInput = async () => {
  16747. let status = await checkPermission();
  16748. if (status !== 1) {
  16749. return;
  16750. }
  16751. uni.scanCode({
  16752. success: (res) => {
  16753. valiFormData.value.order_code = res.result;
  16754. onsubmit();
  16755. },
  16756. fail: (err) => {
  16757. }
  16758. });
  16759. };
  16760. const reset = () => {
  16761. loading.value = false;
  16762. valiFormData.value.order_code = "";
  16763. };
  16764. const setfocus = () => {
  16765. if (hidePage.value) {
  16766. return;
  16767. }
  16768. focusType.value = false;
  16769. vue.nextTick(() => {
  16770. focusType.value = true;
  16771. });
  16772. };
  16773. const onsubmit = async () => {
  16774. st2 && clearTimeout(st2);
  16775. const valiRes = await valiFormRef.value.validate();
  16776. if (!valiRes) {
  16777. return;
  16778. }
  16779. loading.value = true;
  16780. const res = await warehouseScan({
  16781. order_code: valiFormData.value.order_code
  16782. });
  16783. formatAppLog("log", "at pages/warehouseScan/warehouseScan.vue:143", "res---", res);
  16784. loading.value = false;
  16785. if (res.code == 1) {
  16786. messageType.value = "success";
  16787. messageText.value = res.msg;
  16788. messageRef.value.open();
  16789. const historyItem = {
  16790. order_code: valiFormData.value.order_code,
  16791. createTime: /* @__PURE__ */ new Date(),
  16792. type: "单据扫描",
  16793. status: true
  16794. };
  16795. warehouseLogHistory.value.unshift(historyItem);
  16796. uni.setStorageSync("warehouseLogHistory", warehouseLogHistory.value);
  16797. getHistory();
  16798. } else {
  16799. messageType.value = "error";
  16800. messageText.value = res.msg;
  16801. messageRef.value.open();
  16802. const historyItem = {
  16803. order_code: valiFormData.value.order_code,
  16804. createTime: /* @__PURE__ */ new Date(),
  16805. type: "单据扫描",
  16806. status: false
  16807. };
  16808. warehouseLogHistory.value.unshift(historyItem);
  16809. uni.setStorageSync("warehouseLogHistory", warehouseLogHistory.value);
  16810. getHistory();
  16811. }
  16812. st2 = setTimeout(() => {
  16813. reset();
  16814. st2 && clearTimeout(st2);
  16815. }, 1e3);
  16816. };
  16817. const getHistory = () => {
  16818. warehouseLogHistory.value = uni.getStorageSync("warehouseLogHistory") || [];
  16819. };
  16820. const keypress = (e2) => {
  16821. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  16822. ;
  16823. if (e2.keyCode == 66) {
  16824. onsubmit();
  16825. }
  16826. };
  16827. onLoad(() => {
  16828. plus.key.addEventListener("keyup", keypress);
  16829. });
  16830. onUnload(() => {
  16831. plus.key.removeEventListener("keyup", keypress);
  16832. });
  16833. onHide(() => {
  16834. hidePage.value = true;
  16835. plus.key.removeEventListener("keyup", keypress);
  16836. });
  16837. onBackPress(() => {
  16838. plus.key.removeEventListener("keyup", keypress);
  16839. });
  16840. onShow(() => {
  16841. hidePage.value = false;
  16842. getHistory();
  16843. });
  16844. onNavigationBarButtonTap((event) => {
  16845. if (event.index === 0) {
  16846. uni.navigateTo({
  16847. url: "/pages/warehouseScan/logList"
  16848. });
  16849. }
  16850. });
  16851. const __returned__ = { valiFormRef, loading, hidePage, focusType, warehouseLogHistory, messageRef, messageType, messageText, get st() {
  16852. return st2;
  16853. }, set st(v2) {
  16854. st2 = v2;
  16855. }, valiFormData, rules, scanInput, reset, setfocus, onsubmit, getHistory, keypress };
  16856. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  16857. return __returned__;
  16858. }
  16859. });
  16860. function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
  16861. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$7);
  16862. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_0$4);
  16863. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$1);
  16864. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  16865. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_1$1);
  16866. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  16867. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  16868. vue.createVNode(_component_uni_forms, {
  16869. ref: "valiFormRef",
  16870. "label-align": "right",
  16871. "label-width": 80,
  16872. rules: $setup.rules,
  16873. modelValue: $setup.valiFormData
  16874. }, {
  16875. default: vue.withCtx(() => [
  16876. vue.createVNode(_component_uni_forms_item, {
  16877. label: "单据编号",
  16878. required: "",
  16879. name: "order_code"
  16880. }, {
  16881. default: vue.withCtx(() => [
  16882. vue.createVNode(_component_uni_easyinput, {
  16883. modelValue: $setup.valiFormData.order_code,
  16884. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.order_code = $event),
  16885. placeholder: "请输入单据编号",
  16886. suffixIcon: "scan",
  16887. focus: $setup.focusType,
  16888. onIconClick: $setup.scanInput,
  16889. onBlur: $setup.setfocus,
  16890. onConfirm: $setup.onsubmit
  16891. }, null, 8, ["modelValue", "focus"])
  16892. ]),
  16893. _: 1
  16894. /* STABLE */
  16895. })
  16896. ]),
  16897. _: 1
  16898. /* STABLE */
  16899. }, 8, ["rules", "modelValue"]),
  16900. vue.createElementVNode("view", { class: "button-group" }, [
  16901. vue.createElementVNode("button", {
  16902. type: "default",
  16903. onClick: $setup.reset
  16904. }, "重置"),
  16905. vue.createElementVNode("button", {
  16906. type: "primary",
  16907. onClick: $setup.onsubmit,
  16908. loading: $setup.loading
  16909. }, [
  16910. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  16911. key: 0,
  16912. type: "checkmarkempty",
  16913. size: "18",
  16914. color: "white"
  16915. })) : vue.createCommentVNode("v-if", true),
  16916. vue.createTextVNode(" 提交 ")
  16917. ], 8, ["loading"])
  16918. ]),
  16919. $setup.warehouseLogHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  16920. key: 0,
  16921. class: "history"
  16922. }, [
  16923. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  16924. ])) : vue.createCommentVNode("v-if", true),
  16925. vue.createElementVNode("view", { class: "history" }, [
  16926. (vue.openBlock(true), vue.createElementBlock(
  16927. vue.Fragment,
  16928. null,
  16929. vue.renderList($setup.warehouseLogHistory.slice(0, 5), (item, i2) => {
  16930. return vue.openBlock(), vue.createElementBlock("view", {
  16931. class: "item",
  16932. key: i2
  16933. }, [
  16934. vue.createElementVNode(
  16935. "text",
  16936. {
  16937. class: "code",
  16938. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  16939. },
  16940. vue.toDisplayString(item.order_code),
  16941. 5
  16942. /* TEXT, STYLE */
  16943. ),
  16944. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  16945. key: 0,
  16946. type: "checkmarkempty",
  16947. class: "status",
  16948. size: "16",
  16949. color: "green"
  16950. })) : (vue.openBlock(), vue.createElementBlock("text", {
  16951. key: 1,
  16952. class: "status fail"
  16953. }, "F")),
  16954. vue.createElementVNode(
  16955. "text",
  16956. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  16957. vue.toDisplayString("\r\n" + item.createTime),
  16958. 1
  16959. /* TEXT */
  16960. )
  16961. ]);
  16962. }),
  16963. 128
  16964. /* KEYED_FRAGMENT */
  16965. ))
  16966. ]),
  16967. vue.createVNode(
  16968. _component_uni_popup,
  16969. {
  16970. ref: "messageRef",
  16971. type: "message"
  16972. },
  16973. {
  16974. default: vue.withCtx(() => [
  16975. vue.createVNode(_component_uni_popup_message, {
  16976. type: $setup.messageType,
  16977. message: $setup.messageText,
  16978. duration: 2e3
  16979. }, null, 8, ["type", "message"])
  16980. ]),
  16981. _: 1
  16982. /* STABLE */
  16983. },
  16984. 512
  16985. /* NEED_PATCH */
  16986. )
  16987. ]);
  16988. }
  16989. const PagesWarehouseScanWarehouseScan = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r], ["__scopeId", "data-v-30c3024c"], ["__file", "E:/demo/hmrabbit/src/pages/warehouseScan/warehouseScan.vue"]]);
  16990. const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
  16991. __name: "logList",
  16992. setup(__props, { expose: __expose }) {
  16993. __expose();
  16994. const warehouseLogHistory = vue.ref([]);
  16995. const getHistory = () => {
  16996. warehouseLogHistory.value = uni.getStorageSync("warehouseLogHistory");
  16997. };
  16998. onLoad(() => {
  16999. getHistory();
  17000. });
  17001. const __returned__ = { warehouseLogHistory, getHistory };
  17002. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  17003. return __returned__;
  17004. }
  17005. });
  17006. function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
  17007. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  17008. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  17009. (vue.openBlock(true), vue.createElementBlock(
  17010. vue.Fragment,
  17011. null,
  17012. vue.renderList($setup.warehouseLogHistory, (item, i2) => {
  17013. return vue.openBlock(), vue.createElementBlock("view", {
  17014. class: "item",
  17015. key: i2
  17016. }, [
  17017. vue.createElementVNode(
  17018. "text",
  17019. { class: "type" },
  17020. vue.toDisplayString(item.type),
  17021. 1
  17022. /* TEXT */
  17023. ),
  17024. vue.createElementVNode(
  17025. "text",
  17026. {
  17027. class: "code",
  17028. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  17029. },
  17030. vue.toDisplayString(item.order_code),
  17031. 5
  17032. /* TEXT, STYLE */
  17033. ),
  17034. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  17035. key: 0,
  17036. type: "checkmarkempty",
  17037. class: "status",
  17038. size: "16",
  17039. color: "green"
  17040. })) : (vue.openBlock(), vue.createElementBlock("text", {
  17041. key: 1,
  17042. class: "status fail"
  17043. }, "F")),
  17044. vue.createElementVNode(
  17045. "text",
  17046. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  17047. vue.toDisplayString("\r\n" + item.createTime),
  17048. 1
  17049. /* TEXT */
  17050. )
  17051. ]);
  17052. }),
  17053. 128
  17054. /* KEYED_FRAGMENT */
  17055. )),
  17056. $setup.warehouseLogHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  17057. key: 0,
  17058. class: "is-empty"
  17059. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  17060. ]);
  17061. }
  17062. const PagesWarehouseScanLogList = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q], ["__scopeId", "data-v-4f138066"], ["__file", "E:/demo/hmrabbit/src/pages/warehouseScan/logList.vue"]]);
  17063. const modal = requireNativePlugin("modal");
  17064. var AutoReplyPrintUniModule = requireNativePlugin("AutoReplyPrintUniModule");
  17065. var hPrinter = 0;
  17066. var isEnumeratingBT2 = false;
  17067. var isEnumeratingNET = false;
  17068. var selectedPortType = "rbBT2";
  17069. const _sfc_main$q = {
  17070. data() {
  17071. return {
  17072. udsBT2Value: 0,
  17073. udsBT2Range: [],
  17074. udsNETValue: 0,
  17075. udsNETRange: [],
  17076. udsUSBValue: 0,
  17077. udsUSBRange: [],
  17078. udsCOMValue: 0,
  17079. udsCOMRange: [],
  17080. udsCOMBaudrateValue: 9600,
  17081. udsCOMBaudrateRange: [
  17082. {
  17083. text: "9600",
  17084. value: 9600
  17085. },
  17086. {
  17087. text: "19200",
  17088. value: 19200
  17089. },
  17090. {
  17091. text: "38400",
  17092. value: 38400
  17093. },
  17094. {
  17095. text: "57600",
  17096. value: 57600
  17097. },
  17098. {
  17099. text: "115200",
  17100. value: 115200
  17101. },
  17102. {
  17103. text: "230400",
  17104. value: 230400
  17105. },
  17106. {
  17107. text: "256000",
  17108. value: 256e3
  17109. },
  17110. {
  17111. text: "500000",
  17112. value: 5e5
  17113. }
  17114. ],
  17115. udsCOMFlowControlValue: 0,
  17116. udsCOMFlowControlRange: [
  17117. {
  17118. text: "NoFlowControl",
  17119. value: 0
  17120. },
  17121. {
  17122. text: "Hardware",
  17123. value: 2
  17124. }
  17125. ],
  17126. btnOpenPortDisabled: false,
  17127. btnClosePortDisabled: true
  17128. };
  17129. },
  17130. onLoad() {
  17131. uni.setNavigationBarTitle({
  17132. title: "SampleLabel " + AutoReplyPrintUniModule.CP_Library_Version()
  17133. });
  17134. },
  17135. onReady() {
  17136. },
  17137. methods: {
  17138. radioChange: function(evt) {
  17139. selectedPortType = evt.detail.value;
  17140. },
  17141. enumPort() {
  17142. var newComRange = new Array();
  17143. var comNameList = AutoReplyPrintUniModule.CP_Port_EnumCom();
  17144. if (comNameList != null) {
  17145. for (var i2 = 0; i2 < comNameList.length; i2++) {
  17146. var tmp = {
  17147. text: comNameList[i2],
  17148. value: i2
  17149. };
  17150. formatAppLog("log", "at pages/printer/printer.vue:176", tmp);
  17151. newComRange.push(tmp);
  17152. }
  17153. }
  17154. this.udsCOMRange = newComRange;
  17155. var newUsbRange = new Array();
  17156. var usbNameList = AutoReplyPrintUniModule.CP_Port_EnumUsb();
  17157. if (usbNameList != null) {
  17158. for (var i2 = 0; i2 < usbNameList.length; i2++) {
  17159. var tmp = {
  17160. text: usbNameList[i2],
  17161. value: i2
  17162. };
  17163. formatAppLog("log", "at pages/printer/printer.vue:190", tmp);
  17164. newUsbRange.push(tmp);
  17165. }
  17166. }
  17167. this.udsUSBRange = newUsbRange;
  17168. if (!isEnumeratingBT2) {
  17169. isEnumeratingBT2 = true;
  17170. formatAppLog("log", "at pages/printer/printer.vue:198", "isEnumeratingBT2");
  17171. AutoReplyPrintUniModule.CP_Port_EnumBtDevice(
  17172. 12e3,
  17173. (ret) => {
  17174. var text = ret.device_address + "(" + ret.device_name + ")";
  17175. for (var i3 = 0; i3 < this.udsBT2Range.length; i3++) {
  17176. if (this.udsBT2Range[i3].text == text) {
  17177. return;
  17178. }
  17179. }
  17180. var tmp2 = {
  17181. text,
  17182. value: this.udsBT2Range.length
  17183. };
  17184. formatAppLog("log", "at pages/printer/printer.vue:213", tmp2);
  17185. this.udsBT2Range.push(tmp2);
  17186. },
  17187. (ret) => {
  17188. isEnumeratingBT2 = false;
  17189. formatAppLog("log", "at pages/printer/printer.vue:218", "finishedEnumeratingBT2");
  17190. }
  17191. );
  17192. }
  17193. if (!isEnumeratingNET) {
  17194. isEnumeratingNET = true;
  17195. formatAppLog("log", "at pages/printer/printer.vue:225", "isEnumeratingNET");
  17196. AutoReplyPrintUniModule.CP_Port_EnumNetPrinter(
  17197. 12e3,
  17198. (ret) => {
  17199. var text = ret.discovered_ip + "(" + ret.discovered_name + ")";
  17200. for (var i3 = 0; i3 < this.udsNETRange.length; i3++) {
  17201. if (this.udsNETRange[i3].text == text) {
  17202. return;
  17203. }
  17204. }
  17205. var tmp2 = {
  17206. text,
  17207. value: this.udsNETRange.length
  17208. };
  17209. formatAppLog("log", "at pages/printer/printer.vue:240", tmp2);
  17210. this.udsNETRange.push(tmp2);
  17211. },
  17212. (ret) => {
  17213. isEnumeratingNET = false;
  17214. formatAppLog("log", "at pages/printer/printer.vue:245", "finishedEnumeratingNET");
  17215. }
  17216. );
  17217. }
  17218. },
  17219. openPort() {
  17220. if (hPrinter == 0) {
  17221. if (selectedPortType == "rbBT2") {
  17222. var text = this.udsBT2Range[this.udsBT2Value].text;
  17223. var btAddress = text.substring(0, text.indexOf("("));
  17224. modal.toast({
  17225. message: "Connecting: " + btAddress + " ......",
  17226. duration: 1.5
  17227. });
  17228. formatAppLog("log", "at pages/printer/printer.vue:259", "Connecting: " + btAddress + " ......");
  17229. hPrinter = AutoReplyPrintUniModule.CP_Port_OpenBtSpp(btAddress, 1);
  17230. formatAppLog("log", "at pages/printer/printer.vue:261", "hPrinter: " + hPrinter);
  17231. } else if (selectedPortType == "rbNET") {
  17232. var text = this.udsNETRange[this.udsNETValue].text;
  17233. var ipAddress = text.substring(0, text.indexOf("("));
  17234. modal.toast({
  17235. message: "Connecting: " + ipAddress + " ......",
  17236. duration: 1.5
  17237. });
  17238. formatAppLog("log", "at pages/printer/printer.vue:269", "Connecting: " + ipAddress + " ......");
  17239. hPrinter = AutoReplyPrintUniModule.CP_Port_OpenTcp(null, ipAddress, 9100, 5e3, 1);
  17240. formatAppLog("log", "at pages/printer/printer.vue:271", "hPrinter: " + hPrinter);
  17241. } else if (selectedPortType == "rbUSB") {
  17242. var usbName = this.udsUSBRange[this.udsUSBValue].text;
  17243. modal.toast({
  17244. message: "Connecting: " + usbName + " ......",
  17245. duration: 1.5
  17246. });
  17247. formatAppLog("log", "at pages/printer/printer.vue:278", "Connecting: " + usbName + " ......");
  17248. hPrinter = AutoReplyPrintUniModule.CP_Port_OpenUsb(usbName, 1);
  17249. formatAppLog("log", "at pages/printer/printer.vue:280", "hPrinter: " + hPrinter);
  17250. } else if (selectedPortType == "rbCOM") {
  17251. var comName = this.udsCOMRange[this.udsCOMValue].text;
  17252. var comBaudrate = this.udsCOMBaudrateValue;
  17253. var comFlowControl = this.udsCOMFlowControlValue;
  17254. modal.toast({
  17255. message: "Connecting: " + comName + "," + comBaudrate + "," + comFlowControl + " ......",
  17256. duration: 1.5
  17257. });
  17258. formatAppLog(
  17259. "log",
  17260. "at pages/printer/printer.vue:290",
  17261. "Connecting: " + comName + "," + comBaudrate + "," + comFlowControl + "......"
  17262. );
  17263. hPrinter = AutoReplyPrintUniModule.CP_Port_OpenCom(
  17264. comName,
  17265. comBaudrate,
  17266. 8,
  17267. 0,
  17268. 0,
  17269. comFlowControl,
  17270. 1
  17271. );
  17272. formatAppLog("log", "at pages/printer/printer.vue:302", "hPrinter: " + hPrinter);
  17273. }
  17274. modal.toast({
  17275. message: hPrinter != 0 ? "Connected" : "Failed",
  17276. duration: 1.5
  17277. });
  17278. }
  17279. this.btnOpenPortDisabled = hPrinter != 0;
  17280. this.btnClosePortDisabled = hPrinter == 0;
  17281. },
  17282. closePort() {
  17283. if (hPrinter != 0) {
  17284. AutoReplyPrintUniModule.CP_Port_Close(hPrinter);
  17285. hPrinter = 0;
  17286. }
  17287. this.btnOpenPortDisabled = hPrinter != 0;
  17288. this.btnClosePortDisabled = hPrinter == 0;
  17289. },
  17290. Test_Label_SampleTicket_58MM_1() {
  17291. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  17292. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 1);
  17293. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 240, 0);
  17294. AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 10, 24, 0, "型号:P58A+");
  17295. AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 40, 24, 0, "MFG :00");
  17296. AutoReplyPrintUniModule.CP_Label_DrawBarcode(hPrinter, 10, 70, 8, 2, 60, 2, 0, "No.123456");
  17297. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17298. var printResult = AutoReplyPrintUniModule.CP_Pos_QueryPrintResult(hPrinter, 1e4);
  17299. modal.toast({
  17300. message: printResult ? "Print Success" : "Print Failed",
  17301. duration: 1.5
  17302. });
  17303. },
  17304. Test_Label_SampleTicket_80MM_1() {
  17305. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  17306. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 1);
  17307. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 576, 240, 0);
  17308. AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 10, 24, 0, "型号:P80A+");
  17309. AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 40, 24, 0, "MFG :00");
  17310. AutoReplyPrintUniModule.CP_Label_DrawBarcode(hPrinter, 10, 70, 8, 2, 60, 4, 0, "No.123456");
  17311. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17312. var printResult = AutoReplyPrintUniModule.CP_Pos_QueryPrintResult(hPrinter, 1e4);
  17313. modal.toast({
  17314. message: printResult ? "Print Success" : "Print Failed",
  17315. duration: 1.5
  17316. });
  17317. },
  17318. GetPrinterResolutionInfo() {
  17319. var ret = AutoReplyPrintUniModule.CP_Printer_GetPrinterResolutionInfo(hPrinter);
  17320. modal.toast({
  17321. message: ret,
  17322. duration: 1.5
  17323. });
  17324. },
  17325. GetPrinterFirmwareVersion() {
  17326. var ret = AutoReplyPrintUniModule.CP_Printer_GetPrinterFirmwareVersion(hPrinter);
  17327. modal.toast({
  17328. message: ret,
  17329. duration: 1.5
  17330. });
  17331. },
  17332. GetPrinterStatusInfo() {
  17333. var ret = AutoReplyPrintUniModule.CP_Printer_GetPrinterStatusInfo(hPrinter);
  17334. var status_time = new Date(ret.timestamp_ms);
  17335. var printer_error_status = ret.printer_error_status;
  17336. var status_str = "";
  17337. if (printer_error_status != 0) {
  17338. status_str += "ERROR_OCCURED\n";
  17339. if ((printer_error_status & 1) != 0) {
  17340. status_str += "ERROR_CUTTER\n";
  17341. }
  17342. if ((printer_error_status & 2) != 0) {
  17343. status_str += "ERROR_FLASH\n";
  17344. }
  17345. if ((printer_error_status & 4) != 0) {
  17346. status_str += "ERROR_NOPAPER\n";
  17347. }
  17348. if ((printer_error_status & 8) != 0) {
  17349. status_str += "ERROR_VOLTAGE\n";
  17350. }
  17351. if ((printer_error_status & 16) != 0) {
  17352. status_str += "ERROR_MARKER\n";
  17353. }
  17354. if ((printer_error_status & 32) != 0) {
  17355. status_str += "ERROR_ENGINE\n";
  17356. }
  17357. if ((printer_error_status & 64) != 0) {
  17358. status_str += "ERROR_OVERHEAT\n";
  17359. }
  17360. if ((printer_error_status & 128) != 0) {
  17361. status_str += "ERROR_COVERUP\n";
  17362. }
  17363. if ((printer_error_status & 256) != 0) {
  17364. status_str += "ERROR_MOTOR\n";
  17365. }
  17366. } else {
  17367. status_str += "Status OK\n";
  17368. }
  17369. modal.toast({
  17370. message: "" + status_time + "\n" + status_str,
  17371. duration: 1.5
  17372. });
  17373. },
  17374. CP_Pos_KickOutDrawer() {
  17375. var ret = AutoReplyPrintUniModule.CP_Pos_KickOutDrawer(hPrinter, 0, 100, 100);
  17376. modal.toast({
  17377. message: ret,
  17378. duration: 1.5
  17379. });
  17380. },
  17381. CP_Pos_Beep() {
  17382. var ret = AutoReplyPrintUniModule.CP_Pos_Beep(hPrinter, 3, 500);
  17383. modal.toast({
  17384. message: ret,
  17385. duration: 1.5
  17386. });
  17387. },
  17388. CP_Pos_PrintSelfTestPage() {
  17389. var ret = AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  17390. modal.toast({
  17391. message: ret,
  17392. duration: 1.5
  17393. });
  17394. },
  17395. CP_Pos_ResetPrinter() {
  17396. var ret = AutoReplyPrintUniModule.CP_Pos_ResetPrinter(hPrinter);
  17397. modal.toast({
  17398. message: ret,
  17399. duration: 1.5
  17400. });
  17401. },
  17402. CP_Pos_SetPrintSpeed_100() {
  17403. var ret = AutoReplyPrintUniModule.CP_Pos_SetPrintSpeed(hPrinter, 100);
  17404. AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  17405. modal.toast({
  17406. message: ret,
  17407. duration: 1.5
  17408. });
  17409. },
  17410. CP_Pos_SetPrintSpeed_150() {
  17411. var ret = AutoReplyPrintUniModule.CP_Pos_SetPrintSpeed(hPrinter, 150);
  17412. AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  17413. modal.toast({
  17414. message: ret,
  17415. duration: 1.5
  17416. });
  17417. },
  17418. CP_Pos_SetPrintDensity_7() {
  17419. var ret = AutoReplyPrintUniModule.CP_Pos_SetPrintDensity(hPrinter, 7);
  17420. AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  17421. modal.toast({
  17422. message: ret,
  17423. duration: 1.5
  17424. });
  17425. },
  17426. CP_Pos_SetPrintDensity_15() {
  17427. var ret = AutoReplyPrintUniModule.CP_Pos_SetPrintDensity(hPrinter, 15);
  17428. AutoReplyPrintUniModule.CP_Pos_PrintSelfTestPage(hPrinter);
  17429. modal.toast({
  17430. message: ret,
  17431. duration: 1.5
  17432. });
  17433. },
  17434. CP_Label_EnableLabelMode() {
  17435. var ret = AutoReplyPrintUniModule.CP_Label_EnableLabelMode(hPrinter);
  17436. modal.toast({
  17437. message: ret,
  17438. duration: 1.5
  17439. });
  17440. },
  17441. CP_Label_DisableLabelMode() {
  17442. var ret = AutoReplyPrintUniModule.CP_Label_DisableLabelMode(hPrinter);
  17443. modal.toast({
  17444. message: ret,
  17445. duration: 1.5
  17446. });
  17447. },
  17448. CP_Label_CalibrateLabel() {
  17449. var ret = AutoReplyPrintUniModule.CP_Label_CalibrateLabel(hPrinter);
  17450. modal.toast({
  17451. message: ret,
  17452. duration: 1.5
  17453. });
  17454. },
  17455. CP_Label_FeedLabel() {
  17456. var ret = AutoReplyPrintUniModule.CP_Label_FeedLabel(hPrinter);
  17457. modal.toast({
  17458. message: ret,
  17459. duration: 1.5
  17460. });
  17461. },
  17462. CP_Label_PageBegin() {
  17463. var ret = AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17464. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17465. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17466. modal.toast({
  17467. message: ret,
  17468. duration: 1.5
  17469. });
  17470. },
  17471. CP_Label_PagePrint() {
  17472. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17473. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17474. var ret = AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17475. modal.toast({
  17476. message: ret,
  17477. duration: 1.5
  17478. });
  17479. },
  17480. CP_Label_DrawText() {
  17481. var str = "$$$123哈哈哈";
  17482. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  17483. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 1);
  17484. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17485. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17486. var ret = AutoReplyPrintUniModule.CP_Label_DrawText(hPrinter, 10, 10, 24, 0, str);
  17487. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17488. modal.toast({
  17489. message: ret,
  17490. duration: 1.5
  17491. });
  17492. },
  17493. CP_Label_DrawTextInUTF8() {
  17494. var str = "$$$123哈哈哈";
  17495. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  17496. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 1);
  17497. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17498. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17499. var ret = AutoReplyPrintUniModule.CP_Label_DrawTextInUTF8(hPrinter, 10, 10, 24, 0, str);
  17500. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17501. modal.toast({
  17502. message: ret,
  17503. duration: 1.5
  17504. });
  17505. },
  17506. CP_Label_DrawTextInGBK() {
  17507. var str = "$$$123哈哈哈";
  17508. AutoReplyPrintUniModule.CP_Pos_SetMultiByteMode(hPrinter);
  17509. AutoReplyPrintUniModule.CP_Pos_SetMultiByteEncoding(hPrinter, 0);
  17510. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17511. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17512. var ret = AutoReplyPrintUniModule.CP_Label_DrawTextInGBK(hPrinter, 10, 10, 24, 0, str);
  17513. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17514. modal.toast({
  17515. message: ret,
  17516. duration: 1.5
  17517. });
  17518. },
  17519. CP_Label_DrawBarcode() {
  17520. var str = "01234567890";
  17521. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17522. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17523. var ret = AutoReplyPrintUniModule.CP_Label_DrawBarcode(hPrinter, 10, 10, 0, 2, 60, 2, 0, str);
  17524. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17525. modal.toast({
  17526. message: ret,
  17527. duration: 1.5
  17528. });
  17529. },
  17530. CP_Label_DrawQRCode() {
  17531. var str = "Hello 你好";
  17532. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17533. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17534. var ret = AutoReplyPrintUniModule.CP_Label_DrawQRCode(hPrinter, 10, 10, 0, 1, 8, 0, str);
  17535. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17536. modal.toast({
  17537. message: ret,
  17538. duration: 1.5
  17539. });
  17540. },
  17541. CP_Label_DrawPDF417Code() {
  17542. var str = "Hello 你好";
  17543. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17544. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17545. var ret = AutoReplyPrintUniModule.CP_Label_DrawPDF417Code(
  17546. hPrinter,
  17547. 10,
  17548. 10,
  17549. 3,
  17550. 3,
  17551. 0,
  17552. 3,
  17553. 0,
  17554. str
  17555. );
  17556. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17557. modal.toast({
  17558. message: ret,
  17559. duration: 1.5
  17560. });
  17561. },
  17562. CP_Label_DrawImageFromFile() {
  17563. uni.chooseImage({
  17564. count: 1,
  17565. //默认9
  17566. sizeType: ["original", "compressed"],
  17567. //可以指定是原图还是压缩图,默认二者都有
  17568. sourceType: ["album"],
  17569. //从相册选择
  17570. success: function(res) {
  17571. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17572. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17573. var ret = AutoReplyPrintUniModule.CP_Label_DrawImageFromFile(
  17574. hPrinter,
  17575. 0,
  17576. 0,
  17577. 384,
  17578. 0,
  17579. res.tempFilePaths[0],
  17580. 2,
  17581. 0
  17582. );
  17583. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17584. modal.toast({
  17585. message: ret,
  17586. duration: 1.5
  17587. });
  17588. }
  17589. });
  17590. },
  17591. CP_Label_DrawImageFromPixels() {
  17592. var image_width = 100;
  17593. var image_height = 100;
  17594. var image_pixels_array = new Uint8Array(image_width * image_height * 4);
  17595. for (let y2 = 0; y2 < image_height; ++y2) {
  17596. for (let x = 0; x < image_width; ++x) {
  17597. var offset = y2 * image_width * 4 + x * 4;
  17598. if (x == y2) {
  17599. image_pixels_array[offset] = 0;
  17600. image_pixels_array[offset + 1] = 0;
  17601. image_pixels_array[offset + 2] = 0;
  17602. image_pixels_array[offset + 3] = 255;
  17603. } else {
  17604. image_pixels_array[offset] = 255;
  17605. image_pixels_array[offset + 1] = 255;
  17606. image_pixels_array[offset + 2] = 255;
  17607. image_pixels_array[offset + 3] = 255;
  17608. }
  17609. }
  17610. }
  17611. var image_pixels_base64 = uni.arrayBufferToBase64(image_pixels_array);
  17612. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17613. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17614. var ret = AutoReplyPrintUniModule.CP_Label_DrawImageFromPixels(
  17615. hPrinter,
  17616. 0,
  17617. 0,
  17618. image_pixels_base64,
  17619. image_width,
  17620. image_height,
  17621. image_width * 4,
  17622. 7,
  17623. 2,
  17624. 0
  17625. );
  17626. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17627. modal.toast({
  17628. message: ret,
  17629. duration: 1.5
  17630. });
  17631. },
  17632. CP_Label_DrawLine() {
  17633. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17634. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17635. var ret = AutoReplyPrintUniModule.CP_Label_DrawLine(hPrinter, 20, 20, 100, 300, 1, 1);
  17636. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17637. modal.toast({
  17638. message: ret,
  17639. duration: 1.5
  17640. });
  17641. },
  17642. CP_Label_DrawRect() {
  17643. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17644. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17645. var ret = AutoReplyPrintUniModule.CP_Label_DrawRect(hPrinter, 20, 20, 200, 10, 1);
  17646. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17647. modal.toast({
  17648. message: ret,
  17649. duration: 1.5
  17650. });
  17651. },
  17652. CP_Label_DrawBox() {
  17653. AutoReplyPrintUniModule.CP_Label_PageBegin(hPrinter, 0, 0, 384, 400, 0);
  17654. AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 0, 0, 383, 399, 1, 1);
  17655. var ret = AutoReplyPrintUniModule.CP_Label_DrawBox(hPrinter, 30, 30, 300, 200, 1, 1);
  17656. AutoReplyPrintUniModule.CP_Label_PagePrint(hPrinter, 1);
  17657. modal.toast({
  17658. message: ret,
  17659. duration: 1.5
  17660. });
  17661. }
  17662. }
  17663. };
  17664. function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
  17665. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$3);
  17666. return vue.openBlock(), vue.createElementBlock("view", null, [
  17667. vue.createElementVNode(
  17668. "radio-group",
  17669. {
  17670. onChange: _cache[6] || (_cache[6] = (...args) => $options.radioChange && $options.radioChange(...args))
  17671. },
  17672. [
  17673. vue.createElementVNode("label", { class: "uni-list-cell uni-list-cell-pd" }, [
  17674. vue.createElementVNode("label", { class: "radio" }, [
  17675. vue.createElementVNode("radio", {
  17676. value: "rbBT2",
  17677. checked: "true"
  17678. }),
  17679. vue.createTextVNode("BT2.0 ")
  17680. ]),
  17681. vue.createVNode(_component_uni_data_select, {
  17682. modelValue: $data.udsBT2Value,
  17683. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.udsBT2Value = $event),
  17684. localdata: $data.udsBT2Range
  17685. }, null, 8, ["modelValue", "localdata"])
  17686. ]),
  17687. vue.createElementVNode("label", { class: "uni-list-cell uni-list-cell-pd" }, [
  17688. vue.createElementVNode("label", { class: "radio" }, [
  17689. vue.createElementVNode("radio", { value: "rbNET" }),
  17690. vue.createTextVNode("NET ")
  17691. ]),
  17692. vue.createVNode(_component_uni_data_select, {
  17693. modelValue: $data.udsNETValue,
  17694. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.udsNETValue = $event),
  17695. localdata: $data.udsNETRange
  17696. }, null, 8, ["modelValue", "localdata"])
  17697. ]),
  17698. vue.createElementVNode("label", { class: "uni-list-cell uni-list-cell-pd" }, [
  17699. vue.createElementVNode("label", { class: "radio" }, [
  17700. vue.createElementVNode("radio", { value: "rbUSB" }),
  17701. vue.createTextVNode("USB ")
  17702. ]),
  17703. vue.createVNode(_component_uni_data_select, {
  17704. modelValue: $data.udsUSBValue,
  17705. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.udsUSBValue = $event),
  17706. localdata: $data.udsUSBRange
  17707. }, null, 8, ["modelValue", "localdata"])
  17708. ]),
  17709. vue.createElementVNode("label", { class: "uni-list-cell uni-list-cell-pd" }, [
  17710. vue.createElementVNode("label", { class: "radio" }, [
  17711. vue.createElementVNode("radio", { value: "rbCOM" }),
  17712. vue.createTextVNode("COM ")
  17713. ]),
  17714. vue.createVNode(_component_uni_data_select, {
  17715. modelValue: $data.udsCOMValue,
  17716. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.udsCOMValue = $event),
  17717. localdata: $data.udsCOMRange
  17718. }, null, 8, ["modelValue", "localdata"]),
  17719. vue.createVNode(_component_uni_data_select, {
  17720. modelValue: $data.udsCOMBaudrateValue,
  17721. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.udsCOMBaudrateValue = $event),
  17722. localdata: $data.udsCOMBaudrateRange
  17723. }, null, 8, ["modelValue", "localdata"]),
  17724. vue.createVNode(_component_uni_data_select, {
  17725. modelValue: $data.udsCOMFlowControlValue,
  17726. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.udsCOMFlowControlValue = $event),
  17727. localdata: $data.udsCOMFlowControlRange
  17728. }, null, 8, ["modelValue", "localdata"])
  17729. ])
  17730. ],
  17731. 32
  17732. /* NEED_HYDRATION */
  17733. ),
  17734. vue.createElementVNode("view", { class: "uni-flex uni-row" }, [
  17735. vue.createElementVNode("button", {
  17736. type: "default",
  17737. onClick: _cache[7] || (_cache[7] = (...args) => $options.enumPort && $options.enumPort(...args))
  17738. }, "Enum Port"),
  17739. vue.createElementVNode("button", {
  17740. type: "default",
  17741. onClick: _cache[8] || (_cache[8] = (...args) => $options.openPort && $options.openPort(...args)),
  17742. disabled: $data.btnOpenPortDisabled
  17743. }, "Open Port", 8, ["disabled"]),
  17744. vue.createElementVNode("button", {
  17745. type: "default",
  17746. onClick: _cache[9] || (_cache[9] = (...args) => $options.closePort && $options.closePort(...args)),
  17747. disabled: $data.btnClosePortDisabled
  17748. }, "Close Port", 8, ["disabled"])
  17749. ]),
  17750. vue.createElementVNode("view", null, [
  17751. vue.createElementVNode("button", {
  17752. type: "primary",
  17753. onClick: _cache[10] || (_cache[10] = (...args) => $options.Test_Label_SampleTicket_58MM_1 && $options.Test_Label_SampleTicket_58MM_1(...args))
  17754. }, " Test_Label_SampleTicket_58MM_1 "),
  17755. vue.createElementVNode("button", {
  17756. type: "primary",
  17757. onClick: _cache[11] || (_cache[11] = (...args) => $options.Test_Label_SampleTicket_80MM_1 && $options.Test_Label_SampleTicket_80MM_1(...args))
  17758. }, " Test_Label_SampleTicket_80MM_1 "),
  17759. vue.createElementVNode("button", {
  17760. type: "primary",
  17761. onClick: _cache[12] || (_cache[12] = (...args) => $options.GetPrinterResolutionInfo && $options.GetPrinterResolutionInfo(...args))
  17762. }, "GetPrinterResolutionInfo"),
  17763. vue.createElementVNode("button", {
  17764. type: "primary",
  17765. onClick: _cache[13] || (_cache[13] = (...args) => $options.GetPrinterFirmwareVersion && $options.GetPrinterFirmwareVersion(...args))
  17766. }, "GetPrinterFirmwareVersion"),
  17767. vue.createElementVNode("button", {
  17768. type: "primary",
  17769. onClick: _cache[14] || (_cache[14] = (...args) => $options.GetPrinterStatusInfo && $options.GetPrinterStatusInfo(...args))
  17770. }, "GetPrinterStatusInfo"),
  17771. vue.createElementVNode("button", {
  17772. type: "primary",
  17773. onClick: _cache[15] || (_cache[15] = (...args) => $options.CP_Pos_KickOutDrawer && $options.CP_Pos_KickOutDrawer(...args))
  17774. }, "CP_Pos_KickOutDrawer"),
  17775. vue.createElementVNode("button", {
  17776. type: "primary",
  17777. onClick: _cache[16] || (_cache[16] = (...args) => $options.CP_Pos_Beep && $options.CP_Pos_Beep(...args))
  17778. }, "CP_Pos_Beep"),
  17779. vue.createElementVNode("button", {
  17780. type: "primary",
  17781. onClick: _cache[17] || (_cache[17] = (...args) => $options.CP_Pos_PrintSelfTestPage && $options.CP_Pos_PrintSelfTestPage(...args))
  17782. }, "CP_Pos_PrintSelfTestPage"),
  17783. vue.createElementVNode("button", {
  17784. type: "primary",
  17785. onClick: _cache[18] || (_cache[18] = (...args) => $options.CP_Pos_ResetPrinter && $options.CP_Pos_ResetPrinter(...args))
  17786. }, "CP_Pos_ResetPrinter"),
  17787. vue.createElementVNode("button", {
  17788. type: "primary",
  17789. onClick: _cache[19] || (_cache[19] = (...args) => $options.CP_Pos_SetPrintSpeed_100 && $options.CP_Pos_SetPrintSpeed_100(...args))
  17790. }, "CP_Pos_SetPrintSpeed_100"),
  17791. vue.createElementVNode("button", {
  17792. type: "primary",
  17793. onClick: _cache[20] || (_cache[20] = (...args) => $options.CP_Pos_SetPrintSpeed_150 && $options.CP_Pos_SetPrintSpeed_150(...args))
  17794. }, "CP_Pos_SetPrintSpeed_150"),
  17795. vue.createElementVNode("button", {
  17796. type: "primary",
  17797. onClick: _cache[21] || (_cache[21] = (...args) => $options.CP_Pos_SetPrintDensity_7 && $options.CP_Pos_SetPrintDensity_7(...args))
  17798. }, "CP_Pos_SetPrintDensity_7"),
  17799. vue.createElementVNode("button", {
  17800. type: "primary",
  17801. onClick: _cache[22] || (_cache[22] = (...args) => $options.CP_Pos_SetPrintDensity_15 && $options.CP_Pos_SetPrintDensity_15(...args))
  17802. }, "CP_Pos_SetPrintDensity_15"),
  17803. vue.createElementVNode("button", {
  17804. type: "primary",
  17805. onClick: _cache[23] || (_cache[23] = (...args) => $options.CP_Label_EnableLabelMode && $options.CP_Label_EnableLabelMode(...args))
  17806. }, "CP_Label_EnableLabelMode"),
  17807. vue.createElementVNode("button", {
  17808. type: "primary",
  17809. onClick: _cache[24] || (_cache[24] = (...args) => $options.CP_Label_DisableLabelMode && $options.CP_Label_DisableLabelMode(...args))
  17810. }, "CP_Label_DisableLabelMode"),
  17811. vue.createElementVNode("button", {
  17812. type: "primary",
  17813. onClick: _cache[25] || (_cache[25] = (...args) => $options.CP_Label_CalibrateLabel && $options.CP_Label_CalibrateLabel(...args))
  17814. }, "CP_Label_CalibrateLabel"),
  17815. vue.createElementVNode("button", {
  17816. type: "primary",
  17817. onClick: _cache[26] || (_cache[26] = (...args) => $options.CP_Label_FeedLabel && $options.CP_Label_FeedLabel(...args))
  17818. }, "CP_Label_FeedLabel"),
  17819. vue.createElementVNode("button", {
  17820. type: "primary",
  17821. onClick: _cache[27] || (_cache[27] = (...args) => $options.CP_Label_PageBegin && $options.CP_Label_PageBegin(...args))
  17822. }, "CP_Label_PageBegin"),
  17823. vue.createElementVNode("button", {
  17824. type: "primary",
  17825. onClick: _cache[28] || (_cache[28] = (...args) => $options.CP_Label_PagePrint && $options.CP_Label_PagePrint(...args))
  17826. }, "CP_Label_PagePrint"),
  17827. vue.createElementVNode("button", {
  17828. type: "primary",
  17829. onClick: _cache[29] || (_cache[29] = (...args) => $options.CP_Label_DrawText && $options.CP_Label_DrawText(...args))
  17830. }, "CP_Label_DrawText"),
  17831. vue.createElementVNode("button", {
  17832. type: "primary",
  17833. onClick: _cache[30] || (_cache[30] = (...args) => $options.CP_Label_DrawTextInUTF8 && $options.CP_Label_DrawTextInUTF8(...args))
  17834. }, "CP_Label_DrawTextInUTF8"),
  17835. vue.createElementVNode("button", {
  17836. type: "primary",
  17837. onClick: _cache[31] || (_cache[31] = (...args) => $options.CP_Label_DrawTextInGBK && $options.CP_Label_DrawTextInGBK(...args))
  17838. }, "CP_Label_DrawTextInGBK"),
  17839. vue.createElementVNode("button", {
  17840. type: "primary",
  17841. onClick: _cache[32] || (_cache[32] = (...args) => $options.CP_Label_DrawBarcode && $options.CP_Label_DrawBarcode(...args))
  17842. }, "CP_Label_DrawBarcode"),
  17843. vue.createElementVNode("button", {
  17844. type: "primary",
  17845. onClick: _cache[33] || (_cache[33] = (...args) => $options.CP_Label_DrawQRCode && $options.CP_Label_DrawQRCode(...args))
  17846. }, "CP_Label_DrawQRCode"),
  17847. vue.createElementVNode("button", {
  17848. type: "primary",
  17849. onClick: _cache[34] || (_cache[34] = (...args) => $options.CP_Label_DrawPDF417Code && $options.CP_Label_DrawPDF417Code(...args))
  17850. }, "CP_Label_DrawPDF417Code"),
  17851. vue.createElementVNode("button", {
  17852. type: "primary",
  17853. onClick: _cache[35] || (_cache[35] = (...args) => $options.CP_Label_DrawImageFromFile && $options.CP_Label_DrawImageFromFile(...args))
  17854. }, "CP_Label_DrawImageFromFile"),
  17855. vue.createElementVNode("button", {
  17856. type: "primary",
  17857. onClick: _cache[36] || (_cache[36] = (...args) => $options.CP_Label_DrawImageFromPixels && $options.CP_Label_DrawImageFromPixels(...args))
  17858. }, " CP_Label_DrawImageFromPixels "),
  17859. vue.createElementVNode("button", {
  17860. type: "primary",
  17861. onClick: _cache[37] || (_cache[37] = (...args) => $options.CP_Label_DrawLine && $options.CP_Label_DrawLine(...args))
  17862. }, "CP_Label_DrawLine"),
  17863. vue.createElementVNode("button", {
  17864. type: "primary",
  17865. onClick: _cache[38] || (_cache[38] = (...args) => $options.CP_Label_DrawRect && $options.CP_Label_DrawRect(...args))
  17866. }, "CP_Label_DrawRect"),
  17867. vue.createElementVNode("button", {
  17868. type: "primary",
  17869. onClick: _cache[39] || (_cache[39] = (...args) => $options.CP_Label_DrawBox && $options.CP_Label_DrawBox(...args))
  17870. }, "CP_Label_DrawBox")
  17871. ])
  17872. ]);
  17873. }
  17874. const PagesPrinterPrinter = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p], ["__file", "E:/demo/hmrabbit/src/pages/printer/printer.vue"]]);
  17875. const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
  17876. __name: "logList",
  17877. setup(__props, { expose: __expose }) {
  17878. __expose();
  17879. const printLogHistory = vue.ref([]);
  17880. const getHistory = () => {
  17881. printLogHistory.value = uni.getStorageSync("printLogHistory");
  17882. };
  17883. onLoad(() => {
  17884. getHistory();
  17885. });
  17886. const __returned__ = { printLogHistory, getHistory };
  17887. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  17888. return __returned__;
  17889. }
  17890. });
  17891. function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
  17892. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  17893. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  17894. (vue.openBlock(true), vue.createElementBlock(
  17895. vue.Fragment,
  17896. null,
  17897. vue.renderList($setup.printLogHistory, (item, i2) => {
  17898. return vue.openBlock(), vue.createElementBlock("view", {
  17899. class: "item",
  17900. key: i2
  17901. }, [
  17902. vue.createElementVNode(
  17903. "text",
  17904. {
  17905. class: "code",
  17906. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  17907. },
  17908. vue.toDisplayString(item.type) + " " + vue.toDisplayString(item.order_code),
  17909. 5
  17910. /* TEXT, STYLE */
  17911. ),
  17912. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  17913. key: 0,
  17914. type: "checkmarkempty",
  17915. class: "status",
  17916. size: "16",
  17917. color: "green"
  17918. })) : (vue.openBlock(), vue.createElementBlock("text", {
  17919. key: 1,
  17920. class: "status fail"
  17921. }, "F")),
  17922. vue.createElementVNode(
  17923. "text",
  17924. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  17925. vue.toDisplayString("\r\n" + item.createTime),
  17926. 1
  17927. /* TEXT */
  17928. )
  17929. ]);
  17930. }),
  17931. 128
  17932. /* KEYED_FRAGMENT */
  17933. )),
  17934. $setup.printLogHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  17935. key: 0,
  17936. class: "is-empty"
  17937. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  17938. ]);
  17939. }
  17940. const PagesPrinterLogList = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__scopeId", "data-v-38a3815c"], ["__file", "E:/demo/hmrabbit/src/pages/printer/logList.vue"]]);
  17941. const dataPicker = {
  17942. props: {
  17943. localdata: {
  17944. type: [Array, Object],
  17945. default() {
  17946. return [];
  17947. }
  17948. },
  17949. spaceInfo: {
  17950. type: Object,
  17951. default() {
  17952. return {};
  17953. }
  17954. },
  17955. collection: {
  17956. type: String,
  17957. default: ""
  17958. },
  17959. action: {
  17960. type: String,
  17961. default: ""
  17962. },
  17963. field: {
  17964. type: String,
  17965. default: ""
  17966. },
  17967. orderby: {
  17968. type: String,
  17969. default: ""
  17970. },
  17971. where: {
  17972. type: [String, Object],
  17973. default: ""
  17974. },
  17975. pageData: {
  17976. type: String,
  17977. default: "add"
  17978. },
  17979. pageCurrent: {
  17980. type: Number,
  17981. default: 1
  17982. },
  17983. pageSize: {
  17984. type: Number,
  17985. default: 500
  17986. },
  17987. getcount: {
  17988. type: [Boolean, String],
  17989. default: false
  17990. },
  17991. getone: {
  17992. type: [Boolean, String],
  17993. default: false
  17994. },
  17995. gettree: {
  17996. type: [Boolean, String],
  17997. default: false
  17998. },
  17999. manual: {
  18000. type: Boolean,
  18001. default: false
  18002. },
  18003. value: {
  18004. type: [Array, String, Number],
  18005. default() {
  18006. return [];
  18007. }
  18008. },
  18009. modelValue: {
  18010. type: [Array, String, Number],
  18011. default() {
  18012. return [];
  18013. }
  18014. },
  18015. preload: {
  18016. type: Boolean,
  18017. default: false
  18018. },
  18019. stepSearh: {
  18020. type: Boolean,
  18021. default: true
  18022. },
  18023. selfField: {
  18024. type: String,
  18025. default: ""
  18026. },
  18027. parentField: {
  18028. type: String,
  18029. default: ""
  18030. },
  18031. multiple: {
  18032. type: Boolean,
  18033. default: false
  18034. },
  18035. map: {
  18036. type: Object,
  18037. default() {
  18038. return {
  18039. text: "text",
  18040. value: "value"
  18041. };
  18042. }
  18043. }
  18044. },
  18045. data() {
  18046. return {
  18047. loading: false,
  18048. errorMessage: "",
  18049. loadMore: {
  18050. contentdown: "",
  18051. contentrefresh: "",
  18052. contentnomore: ""
  18053. },
  18054. dataList: [],
  18055. selected: [],
  18056. selectedIndex: 0,
  18057. page: {
  18058. current: this.pageCurrent,
  18059. size: this.pageSize,
  18060. count: 0
  18061. }
  18062. };
  18063. },
  18064. computed: {
  18065. isLocalData() {
  18066. return !this.collection.length;
  18067. },
  18068. isCloudData() {
  18069. return this.collection.length > 0;
  18070. },
  18071. isCloudDataList() {
  18072. return this.isCloudData && (!this.parentField && !this.selfField);
  18073. },
  18074. isCloudDataTree() {
  18075. return this.isCloudData && this.parentField && this.selfField;
  18076. },
  18077. dataValue() {
  18078. let isModelValue = Array.isArray(this.modelValue) ? this.modelValue.length > 0 : this.modelValue !== null || this.modelValue !== void 0;
  18079. return isModelValue ? this.modelValue : this.value;
  18080. },
  18081. hasValue() {
  18082. if (typeof this.dataValue === "number") {
  18083. return true;
  18084. }
  18085. return this.dataValue != null && this.dataValue.length > 0;
  18086. }
  18087. },
  18088. created() {
  18089. this.$watch(() => {
  18090. var al = [];
  18091. [
  18092. "pageCurrent",
  18093. "pageSize",
  18094. "spaceInfo",
  18095. "value",
  18096. "modelValue",
  18097. "localdata",
  18098. "collection",
  18099. "action",
  18100. "field",
  18101. "orderby",
  18102. "where",
  18103. "getont",
  18104. "getcount",
  18105. "gettree"
  18106. ].forEach((key) => {
  18107. al.push(this[key]);
  18108. });
  18109. return al;
  18110. }, (newValue, oldValue) => {
  18111. for (let i2 = 2; i2 < newValue.length; i2++) {
  18112. if (newValue[i2] != oldValue[i2]) {
  18113. break;
  18114. }
  18115. }
  18116. if (newValue[0] != oldValue[0]) {
  18117. this.page.current = this.pageCurrent;
  18118. }
  18119. this.page.size = this.pageSize;
  18120. this.onPropsChange();
  18121. });
  18122. this._treeData = [];
  18123. },
  18124. methods: {
  18125. onPropsChange() {
  18126. this._treeData = [];
  18127. },
  18128. // 填充 pickview 数据
  18129. async loadData() {
  18130. if (this.isLocalData) {
  18131. this.loadLocalData();
  18132. } else if (this.isCloudDataList) {
  18133. this.loadCloudDataList();
  18134. } else if (this.isCloudDataTree) {
  18135. this.loadCloudDataTree();
  18136. }
  18137. },
  18138. // 加载本地数据
  18139. async loadLocalData() {
  18140. this._treeData = [];
  18141. this._extractTree(this.localdata, this._treeData);
  18142. let inputValue = this.dataValue;
  18143. if (inputValue === void 0) {
  18144. return;
  18145. }
  18146. if (Array.isArray(inputValue)) {
  18147. inputValue = inputValue[inputValue.length - 1];
  18148. if (typeof inputValue === "object" && inputValue[this.map.value]) {
  18149. inputValue = inputValue[this.map.value];
  18150. }
  18151. }
  18152. this.selected = this._findNodePath(inputValue, this.localdata);
  18153. },
  18154. // 加载 Cloud 数据 (单列)
  18155. async loadCloudDataList() {
  18156. if (this.loading) {
  18157. return;
  18158. }
  18159. this.loading = true;
  18160. try {
  18161. let response = await this.getCommand();
  18162. let responseData = response.result.data;
  18163. this._treeData = responseData;
  18164. this._updateBindData();
  18165. this._updateSelected();
  18166. this.onDataChange();
  18167. } catch (e2) {
  18168. this.errorMessage = e2;
  18169. } finally {
  18170. this.loading = false;
  18171. }
  18172. },
  18173. // 加载 Cloud 数据 (树形)
  18174. async loadCloudDataTree() {
  18175. if (this.loading) {
  18176. return;
  18177. }
  18178. this.loading = true;
  18179. try {
  18180. let commandOptions = {
  18181. field: this._cloudDataPostField(),
  18182. where: this._cloudDataTreeWhere()
  18183. };
  18184. if (this.gettree) {
  18185. commandOptions.startwith = `${this.selfField}=='${this.dataValue}'`;
  18186. }
  18187. let response = await this.getCommand(commandOptions);
  18188. let responseData = response.result.data;
  18189. this._treeData = responseData;
  18190. this._updateBindData();
  18191. this._updateSelected();
  18192. this.onDataChange();
  18193. } catch (e2) {
  18194. this.errorMessage = e2;
  18195. } finally {
  18196. this.loading = false;
  18197. }
  18198. },
  18199. // 加载 Cloud 数据 (节点)
  18200. async loadCloudDataNode(callback) {
  18201. if (this.loading) {
  18202. return;
  18203. }
  18204. this.loading = true;
  18205. try {
  18206. let commandOptions = {
  18207. field: this._cloudDataPostField(),
  18208. where: this._cloudDataNodeWhere()
  18209. };
  18210. let response = await this.getCommand(commandOptions);
  18211. let responseData = response.result.data;
  18212. callback(responseData);
  18213. } catch (e2) {
  18214. this.errorMessage = e2;
  18215. } finally {
  18216. this.loading = false;
  18217. }
  18218. },
  18219. // 回显 Cloud 数据
  18220. getCloudDataValue() {
  18221. if (this.isCloudDataList) {
  18222. return this.getCloudDataListValue();
  18223. }
  18224. if (this.isCloudDataTree) {
  18225. return this.getCloudDataTreeValue();
  18226. }
  18227. },
  18228. // 回显 Cloud 数据 (单列)
  18229. getCloudDataListValue() {
  18230. let where = [];
  18231. let whereField = this._getForeignKeyByField();
  18232. if (whereField) {
  18233. where.push(`${whereField} == '${this.dataValue}'`);
  18234. }
  18235. where = where.join(" || ");
  18236. if (this.where) {
  18237. where = `(${this.where}) && (${where})`;
  18238. }
  18239. return this.getCommand({
  18240. field: this._cloudDataPostField(),
  18241. where
  18242. }).then((res) => {
  18243. this.selected = res.result.data;
  18244. return res.result.data;
  18245. });
  18246. },
  18247. // 回显 Cloud 数据 (树形)
  18248. getCloudDataTreeValue() {
  18249. return this.getCommand({
  18250. field: this._cloudDataPostField(),
  18251. getTreePath: {
  18252. startWith: `${this.selfField}=='${this.dataValue}'`
  18253. }
  18254. }).then((res) => {
  18255. let treePath = [];
  18256. this._extractTreePath(res.result.data, treePath);
  18257. this.selected = treePath;
  18258. return treePath;
  18259. });
  18260. },
  18261. getCommand(options = {}) {
  18262. let db = Vs.database(this.spaceInfo);
  18263. const action = options.action || this.action;
  18264. if (action) {
  18265. db = db.action(action);
  18266. }
  18267. const collection = options.collection || this.collection;
  18268. db = db.collection(collection);
  18269. const where = options.where || this.where;
  18270. if (!(!where || !Object.keys(where).length)) {
  18271. db = db.where(where);
  18272. }
  18273. const field = options.field || this.field;
  18274. if (field) {
  18275. db = db.field(field);
  18276. }
  18277. const orderby = options.orderby || this.orderby;
  18278. if (orderby) {
  18279. db = db.orderBy(orderby);
  18280. }
  18281. const current = options.pageCurrent !== void 0 ? options.pageCurrent : this.page.current;
  18282. const size = options.pageSize !== void 0 ? options.pageSize : this.page.size;
  18283. const getCount = options.getcount !== void 0 ? options.getcount : this.getcount;
  18284. const getTree = options.gettree !== void 0 ? options.gettree : this.gettree;
  18285. const getOptions = {
  18286. getCount,
  18287. getTree
  18288. };
  18289. if (options.getTreePath) {
  18290. getOptions.getTreePath = options.getTreePath;
  18291. }
  18292. db = db.skip(size * (current - 1)).limit(size).get(getOptions);
  18293. return db;
  18294. },
  18295. _cloudDataPostField() {
  18296. let fields = [this.field];
  18297. if (this.parentField) {
  18298. fields.push(`${this.parentField} as parent_value`);
  18299. }
  18300. return fields.join(",");
  18301. },
  18302. _cloudDataTreeWhere() {
  18303. let result = [];
  18304. let selected = this.selected;
  18305. let parentField = this.parentField;
  18306. if (parentField) {
  18307. result.push(`${parentField} == null || ${parentField} == ""`);
  18308. }
  18309. if (selected.length) {
  18310. for (var i2 = 0; i2 < selected.length - 1; i2++) {
  18311. result.push(`${parentField} == '${selected[i2].value}'`);
  18312. }
  18313. }
  18314. let where = [];
  18315. if (this.where) {
  18316. where.push(`(${this.where})`);
  18317. }
  18318. if (result.length) {
  18319. where.push(`(${result.join(" || ")})`);
  18320. }
  18321. return where.join(" && ");
  18322. },
  18323. _cloudDataNodeWhere() {
  18324. let where = [];
  18325. let selected = this.selected;
  18326. if (selected.length) {
  18327. where.push(`${this.parentField} == '${selected[selected.length - 1].value}'`);
  18328. }
  18329. where = where.join(" || ");
  18330. if (this.where) {
  18331. return `(${this.where}) && (${where})`;
  18332. }
  18333. return where;
  18334. },
  18335. _getWhereByForeignKey() {
  18336. let result = [];
  18337. let whereField = this._getForeignKeyByField();
  18338. if (whereField) {
  18339. result.push(`${whereField} == '${this.dataValue}'`);
  18340. }
  18341. if (this.where) {
  18342. return `(${this.where}) && (${result.join(" || ")})`;
  18343. }
  18344. return result.join(" || ");
  18345. },
  18346. _getForeignKeyByField() {
  18347. let fields = this.field.split(",");
  18348. let whereField = null;
  18349. for (let i2 = 0; i2 < fields.length; i2++) {
  18350. const items = fields[i2].split("as");
  18351. if (items.length < 2) {
  18352. continue;
  18353. }
  18354. if (items[1].trim() === "value") {
  18355. whereField = items[0].trim();
  18356. break;
  18357. }
  18358. }
  18359. return whereField;
  18360. },
  18361. _updateBindData(node) {
  18362. const {
  18363. dataList,
  18364. hasNodes
  18365. } = this._filterData(this._treeData, this.selected);
  18366. let isleaf = this._stepSearh === false && !hasNodes;
  18367. if (node) {
  18368. node.isleaf = isleaf;
  18369. }
  18370. this.dataList = dataList;
  18371. this.selectedIndex = dataList.length - 1;
  18372. if (!isleaf && this.selected.length < dataList.length) {
  18373. this.selected.push({
  18374. value: null,
  18375. text: "请选择"
  18376. });
  18377. }
  18378. return {
  18379. isleaf,
  18380. hasNodes
  18381. };
  18382. },
  18383. _updateSelected() {
  18384. let dl = this.dataList;
  18385. let sl = this.selected;
  18386. let textField = this.map.text;
  18387. let valueField = this.map.value;
  18388. for (let i2 = 0; i2 < sl.length; i2++) {
  18389. let value = sl[i2].value;
  18390. let dl2 = dl[i2];
  18391. for (let j2 = 0; j2 < dl2.length; j2++) {
  18392. let item2 = dl2[j2];
  18393. if (item2[valueField] === value) {
  18394. sl[i2].text = item2[textField];
  18395. break;
  18396. }
  18397. }
  18398. }
  18399. },
  18400. _filterData(data, paths) {
  18401. let dataList = [];
  18402. let hasNodes = true;
  18403. dataList.push(data.filter((item) => {
  18404. return item.parent_value === null || item.parent_value === void 0 || item.parent_value === "";
  18405. }));
  18406. for (let i2 = 0; i2 < paths.length; i2++) {
  18407. let value = paths[i2].value;
  18408. let nodes = data.filter((item) => {
  18409. return item.parent_value === value;
  18410. });
  18411. if (nodes.length) {
  18412. dataList.push(nodes);
  18413. } else {
  18414. hasNodes = false;
  18415. }
  18416. }
  18417. return {
  18418. dataList,
  18419. hasNodes
  18420. };
  18421. },
  18422. _extractTree(nodes, result, parent_value) {
  18423. let valueField = this.map.value;
  18424. for (let i2 = 0; i2 < nodes.length; i2++) {
  18425. let node = nodes[i2];
  18426. let child = {};
  18427. for (let key in node) {
  18428. if (key !== "children") {
  18429. child[key] = node[key];
  18430. }
  18431. }
  18432. if (parent_value !== null && parent_value !== void 0 && parent_value !== "") {
  18433. child.parent_value = parent_value;
  18434. }
  18435. result.push(child);
  18436. let children = node.children;
  18437. if (children) {
  18438. this._extractTree(children, result, node[valueField]);
  18439. }
  18440. }
  18441. },
  18442. _extractTreePath(nodes, result) {
  18443. for (let i2 = 0; i2 < nodes.length; i2++) {
  18444. let node = nodes[i2];
  18445. let child = {};
  18446. for (let key in node) {
  18447. if (key !== "children") {
  18448. child[key] = node[key];
  18449. }
  18450. }
  18451. result.push(child);
  18452. let children = node.children;
  18453. if (children) {
  18454. this._extractTreePath(children, result);
  18455. }
  18456. }
  18457. },
  18458. _findNodePath(key, nodes, path = []) {
  18459. let textField = this.map.text;
  18460. let valueField = this.map.value;
  18461. for (let i2 = 0; i2 < nodes.length; i2++) {
  18462. let node = nodes[i2];
  18463. let children = node.children;
  18464. let text = node[textField];
  18465. let value = node[valueField];
  18466. path.push({
  18467. value,
  18468. text
  18469. });
  18470. if (value === key) {
  18471. return path;
  18472. }
  18473. if (children) {
  18474. const p2 = this._findNodePath(key, children, path);
  18475. if (p2.length) {
  18476. return p2;
  18477. }
  18478. }
  18479. path.pop();
  18480. }
  18481. return [];
  18482. }
  18483. }
  18484. };
  18485. const _sfc_main$o = {
  18486. name: "UniDataPickerView",
  18487. emits: ["nodeclick", "change", "datachange", "update:modelValue"],
  18488. mixins: [dataPicker],
  18489. props: {
  18490. managedMode: {
  18491. type: Boolean,
  18492. default: false
  18493. },
  18494. ellipsis: {
  18495. type: Boolean,
  18496. default: true
  18497. }
  18498. },
  18499. created() {
  18500. if (!this.managedMode) {
  18501. this.$nextTick(() => {
  18502. this.loadData();
  18503. });
  18504. }
  18505. },
  18506. methods: {
  18507. onPropsChange() {
  18508. this._treeData = [];
  18509. this.selectedIndex = 0;
  18510. this.$nextTick(() => {
  18511. this.loadData();
  18512. });
  18513. },
  18514. handleSelect(index) {
  18515. this.selectedIndex = index;
  18516. },
  18517. handleNodeClick(item, i2, j2) {
  18518. if (item.disable) {
  18519. return;
  18520. }
  18521. const node = this.dataList[i2][j2];
  18522. const text = node[this.map.text];
  18523. const value = node[this.map.value];
  18524. if (i2 < this.selected.length - 1) {
  18525. this.selected.splice(i2, this.selected.length - i2);
  18526. this.selected.push({
  18527. text,
  18528. value
  18529. });
  18530. } else if (i2 === this.selected.length - 1) {
  18531. this.selected.splice(i2, 1, {
  18532. text,
  18533. value
  18534. });
  18535. }
  18536. if (node.isleaf) {
  18537. this.onSelectedChange(node, node.isleaf);
  18538. return;
  18539. }
  18540. const {
  18541. isleaf,
  18542. hasNodes
  18543. } = this._updateBindData();
  18544. if (this.isLocalData) {
  18545. this.onSelectedChange(node, !hasNodes || isleaf);
  18546. } else if (this.isCloudDataList) {
  18547. this.onSelectedChange(node, true);
  18548. } else if (this.isCloudDataTree) {
  18549. if (isleaf) {
  18550. this.onSelectedChange(node, node.isleaf);
  18551. } else if (!hasNodes) {
  18552. this.loadCloudDataNode((data) => {
  18553. if (!data.length) {
  18554. node.isleaf = true;
  18555. } else {
  18556. this._treeData.push(...data);
  18557. this._updateBindData(node);
  18558. }
  18559. this.onSelectedChange(node, node.isleaf);
  18560. });
  18561. }
  18562. }
  18563. },
  18564. updateData(data) {
  18565. this._treeData = data.treeData;
  18566. this.selected = data.selected;
  18567. if (!this._treeData.length) {
  18568. this.loadData();
  18569. } else {
  18570. this._updateBindData();
  18571. }
  18572. },
  18573. onDataChange() {
  18574. this.$emit("datachange");
  18575. },
  18576. onSelectedChange(node, isleaf) {
  18577. if (isleaf) {
  18578. this._dispatchEvent();
  18579. }
  18580. if (node) {
  18581. this.$emit("nodeclick", node);
  18582. }
  18583. },
  18584. _dispatchEvent() {
  18585. this.$emit("change", this.selected.slice(0));
  18586. }
  18587. }
  18588. };
  18589. function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
  18590. const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_0$2);
  18591. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-data-pickerview" }, [
  18592. !_ctx.isCloudDataList ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
  18593. key: 0,
  18594. class: "selected-area",
  18595. "scroll-x": "true"
  18596. }, [
  18597. vue.createElementVNode("view", { class: "selected-list" }, [
  18598. (vue.openBlock(true), vue.createElementBlock(
  18599. vue.Fragment,
  18600. null,
  18601. vue.renderList(_ctx.selected, (item, index) => {
  18602. return vue.openBlock(), vue.createElementBlock(
  18603. vue.Fragment,
  18604. null,
  18605. [
  18606. item.text ? (vue.openBlock(), vue.createElementBlock("view", {
  18607. key: 0,
  18608. class: vue.normalizeClass(["selected-item", { "selected-item-active": index == _ctx.selectedIndex }]),
  18609. onClick: ($event) => $options.handleSelect(index)
  18610. }, [
  18611. vue.createElementVNode(
  18612. "text",
  18613. null,
  18614. vue.toDisplayString(item.text),
  18615. 1
  18616. /* TEXT */
  18617. )
  18618. ], 10, ["onClick"])) : vue.createCommentVNode("v-if", true)
  18619. ],
  18620. 64
  18621. /* STABLE_FRAGMENT */
  18622. );
  18623. }),
  18624. 256
  18625. /* UNKEYED_FRAGMENT */
  18626. ))
  18627. ])
  18628. ])) : vue.createCommentVNode("v-if", true),
  18629. vue.createElementVNode("view", { class: "tab-c" }, [
  18630. (vue.openBlock(true), vue.createElementBlock(
  18631. vue.Fragment,
  18632. null,
  18633. vue.renderList(_ctx.dataList, (child, i2) => {
  18634. return vue.openBlock(), vue.createElementBlock(
  18635. vue.Fragment,
  18636. null,
  18637. [
  18638. i2 == _ctx.selectedIndex ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
  18639. class: "list",
  18640. key: i2,
  18641. "scroll-y": true
  18642. }, [
  18643. (vue.openBlock(true), vue.createElementBlock(
  18644. vue.Fragment,
  18645. null,
  18646. vue.renderList(child, (item, j2) => {
  18647. return vue.openBlock(), vue.createElementBlock("view", {
  18648. class: vue.normalizeClass(["item", { "is-disabled": !!item.disable }]),
  18649. onClick: ($event) => $options.handleNodeClick(item, i2, j2)
  18650. }, [
  18651. vue.createElementVNode(
  18652. "text",
  18653. { class: "item-text" },
  18654. vue.toDisplayString(item[_ctx.map.text]),
  18655. 1
  18656. /* TEXT */
  18657. ),
  18658. _ctx.selected.length > i2 && item[_ctx.map.value] == _ctx.selected[i2].value ? (vue.openBlock(), vue.createElementBlock("view", {
  18659. key: 0,
  18660. class: "check"
  18661. })) : vue.createCommentVNode("v-if", true)
  18662. ], 10, ["onClick"]);
  18663. }),
  18664. 256
  18665. /* UNKEYED_FRAGMENT */
  18666. ))
  18667. ])) : vue.createCommentVNode("v-if", true)
  18668. ],
  18669. 64
  18670. /* STABLE_FRAGMENT */
  18671. );
  18672. }),
  18673. 256
  18674. /* UNKEYED_FRAGMENT */
  18675. )),
  18676. _ctx.loading ? (vue.openBlock(), vue.createElementBlock("view", {
  18677. key: 0,
  18678. class: "loading-cover"
  18679. }, [
  18680. vue.createVNode(_component_uni_load_more, {
  18681. class: "load-more",
  18682. contentText: _ctx.loadMore,
  18683. status: "loading"
  18684. }, null, 8, ["contentText"])
  18685. ])) : vue.createCommentVNode("v-if", true),
  18686. _ctx.errorMessage ? (vue.openBlock(), vue.createElementBlock("view", {
  18687. key: 1,
  18688. class: "error-message"
  18689. }, [
  18690. vue.createElementVNode(
  18691. "text",
  18692. { class: "error-text" },
  18693. vue.toDisplayString(_ctx.errorMessage),
  18694. 1
  18695. /* TEXT */
  18696. )
  18697. ])) : vue.createCommentVNode("v-if", true)
  18698. ])
  18699. ]);
  18700. }
  18701. const DataPickerView = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__scopeId", "data-v-9bf6d4b8"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue"]]);
  18702. const _sfc_main$n = {
  18703. name: "UniDataPicker",
  18704. emits: ["popupopened", "popupclosed", "nodeclick", "input", "change", "update:modelValue"],
  18705. mixins: [dataPicker],
  18706. components: {
  18707. DataPickerView
  18708. },
  18709. props: {
  18710. options: {
  18711. type: [Object, Array],
  18712. default() {
  18713. return {};
  18714. }
  18715. },
  18716. popupTitle: {
  18717. type: String,
  18718. default: "请选择"
  18719. },
  18720. placeholder: {
  18721. type: String,
  18722. default: "请选择"
  18723. },
  18724. heightMobile: {
  18725. type: String,
  18726. default: ""
  18727. },
  18728. readonly: {
  18729. type: Boolean,
  18730. default: false
  18731. },
  18732. clearIcon: {
  18733. type: Boolean,
  18734. default: true
  18735. },
  18736. border: {
  18737. type: Boolean,
  18738. default: true
  18739. },
  18740. split: {
  18741. type: String,
  18742. default: "/"
  18743. },
  18744. ellipsis: {
  18745. type: Boolean,
  18746. default: true
  18747. }
  18748. },
  18749. data() {
  18750. return {
  18751. isOpened: false,
  18752. inputSelected: []
  18753. };
  18754. },
  18755. created() {
  18756. this.$nextTick(() => {
  18757. this.load();
  18758. });
  18759. },
  18760. methods: {
  18761. clear() {
  18762. this.modelValue = null;
  18763. this._dispatchEvent([]);
  18764. },
  18765. onPropsChange() {
  18766. this._treeData = [];
  18767. this.selectedIndex = 0;
  18768. this.load();
  18769. },
  18770. load() {
  18771. if (this.readonly) {
  18772. this._processReadonly(this.localdata, this.dataValue);
  18773. return;
  18774. }
  18775. if (!this.hasValue) {
  18776. return;
  18777. }
  18778. if (this.isLocalData) {
  18779. this.loadData();
  18780. this.inputSelected = this.selected.slice(0);
  18781. } else if (this.isCloudDataList || this.isCloudDataTree) {
  18782. this.loading = true;
  18783. this.getCloudDataValue().then((res) => {
  18784. this.loading = false;
  18785. this.inputSelected = res;
  18786. }).catch((err) => {
  18787. this.loading = false;
  18788. this.errorMessage = err;
  18789. });
  18790. }
  18791. },
  18792. show() {
  18793. this.isOpened = true;
  18794. setTimeout(() => {
  18795. this.$refs.pickerView.updateData({
  18796. treeData: this._treeData,
  18797. selected: this.selected,
  18798. selectedIndex: this.selectedIndex
  18799. });
  18800. }, 200);
  18801. this.$emit("popupopened");
  18802. },
  18803. hide() {
  18804. this.isOpened = false;
  18805. this.$emit("popupclosed");
  18806. },
  18807. handleInput() {
  18808. if (this.readonly) {
  18809. return;
  18810. }
  18811. this.show();
  18812. },
  18813. handleClose(e2) {
  18814. this.hide();
  18815. },
  18816. onnodeclick(e2) {
  18817. this.$emit("nodeclick", e2);
  18818. },
  18819. ondatachange(e2) {
  18820. this._treeData = this.$refs.pickerView._treeData;
  18821. },
  18822. onchange(e2) {
  18823. this.hide();
  18824. this.$nextTick(() => {
  18825. this.inputSelected = e2;
  18826. });
  18827. this._dispatchEvent(e2);
  18828. },
  18829. _processReadonly(dataList, value) {
  18830. var isTree = dataList.findIndex((item2) => {
  18831. return item2.children;
  18832. });
  18833. if (isTree > -1) {
  18834. let inputValue;
  18835. if (Array.isArray(value)) {
  18836. inputValue = value[value.length - 1];
  18837. if (typeof inputValue === "object" && inputValue.value) {
  18838. inputValue = inputValue.value;
  18839. }
  18840. } else {
  18841. inputValue = value;
  18842. }
  18843. this.inputSelected = this._findNodePath(inputValue, this.localdata);
  18844. return;
  18845. }
  18846. if (!this.hasValue) {
  18847. this.inputSelected = [];
  18848. return;
  18849. }
  18850. let result = [];
  18851. for (let i2 = 0; i2 < value.length; i2++) {
  18852. var val = value[i2];
  18853. var item = dataList.find((v2) => {
  18854. return v2.value == val;
  18855. });
  18856. if (item) {
  18857. result.push(item);
  18858. }
  18859. }
  18860. if (result.length) {
  18861. this.inputSelected = result;
  18862. }
  18863. },
  18864. _filterForArray(data, valueArray) {
  18865. var result = [];
  18866. for (let i2 = 0; i2 < valueArray.length; i2++) {
  18867. var value = valueArray[i2];
  18868. var found = data.find((item) => {
  18869. return item.value == value;
  18870. });
  18871. if (found) {
  18872. result.push(found);
  18873. }
  18874. }
  18875. return result;
  18876. },
  18877. _dispatchEvent(selected) {
  18878. let item = {};
  18879. if (selected.length) {
  18880. var value = new Array(selected.length);
  18881. for (var i2 = 0; i2 < selected.length; i2++) {
  18882. value[i2] = selected[i2].value;
  18883. }
  18884. item = selected[selected.length - 1];
  18885. } else {
  18886. item.value = "";
  18887. }
  18888. if (this.formItem) {
  18889. this.formItem.setValue(item.value);
  18890. }
  18891. this.$emit("input", item.value);
  18892. this.$emit("update:modelValue", item.value);
  18893. this.$emit("change", {
  18894. detail: {
  18895. value: selected
  18896. }
  18897. });
  18898. }
  18899. }
  18900. };
  18901. function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
  18902. const _component_uni_load_more = resolveEasycom(vue.resolveDynamicComponent("uni-load-more"), __easycom_0$2);
  18903. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  18904. const _component_data_picker_view = vue.resolveComponent("data-picker-view");
  18905. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-data-tree" }, [
  18906. vue.createElementVNode("view", {
  18907. class: "uni-data-tree-input",
  18908. onClick: _cache[1] || (_cache[1] = (...args) => $options.handleInput && $options.handleInput(...args))
  18909. }, [
  18910. vue.renderSlot(_ctx.$slots, "default", {
  18911. options: $props.options,
  18912. data: $data.inputSelected,
  18913. error: _ctx.errorMessage
  18914. }, () => [
  18915. vue.createElementVNode(
  18916. "view",
  18917. {
  18918. class: vue.normalizeClass(["input-value", { "input-value-border": $props.border }])
  18919. },
  18920. [
  18921. _ctx.errorMessage ? (vue.openBlock(), vue.createElementBlock(
  18922. "text",
  18923. {
  18924. key: 0,
  18925. class: "selected-area error-text"
  18926. },
  18927. vue.toDisplayString(_ctx.errorMessage),
  18928. 1
  18929. /* TEXT */
  18930. )) : _ctx.loading && !$data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
  18931. key: 1,
  18932. class: "selected-area"
  18933. }, [
  18934. vue.createVNode(_component_uni_load_more, {
  18935. class: "load-more",
  18936. contentText: _ctx.loadMore,
  18937. status: "loading"
  18938. }, null, 8, ["contentText"])
  18939. ])) : $data.inputSelected.length ? (vue.openBlock(), vue.createElementBlock("scroll-view", {
  18940. key: 2,
  18941. class: "selected-area",
  18942. "scroll-x": "true"
  18943. }, [
  18944. vue.createElementVNode("view", { class: "selected-list" }, [
  18945. (vue.openBlock(true), vue.createElementBlock(
  18946. vue.Fragment,
  18947. null,
  18948. vue.renderList($data.inputSelected, (item, index) => {
  18949. return vue.openBlock(), vue.createElementBlock("view", {
  18950. class: "selected-item",
  18951. key: index
  18952. }, [
  18953. vue.createElementVNode(
  18954. "text",
  18955. { class: "text-color" },
  18956. vue.toDisplayString(item.text),
  18957. 1
  18958. /* TEXT */
  18959. ),
  18960. index < $data.inputSelected.length - 1 ? (vue.openBlock(), vue.createElementBlock(
  18961. "text",
  18962. {
  18963. key: 0,
  18964. class: "input-split-line"
  18965. },
  18966. vue.toDisplayString($props.split),
  18967. 1
  18968. /* TEXT */
  18969. )) : vue.createCommentVNode("v-if", true)
  18970. ]);
  18971. }),
  18972. 128
  18973. /* KEYED_FRAGMENT */
  18974. ))
  18975. ])
  18976. ])) : (vue.openBlock(), vue.createElementBlock(
  18977. "text",
  18978. {
  18979. key: 3,
  18980. class: "selected-area placeholder"
  18981. },
  18982. vue.toDisplayString($props.placeholder),
  18983. 1
  18984. /* TEXT */
  18985. )),
  18986. $props.clearIcon && !$props.readonly && $data.inputSelected.length ? (vue.openBlock(), vue.createElementBlock("view", {
  18987. key: 4,
  18988. class: "icon-clear",
  18989. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop"]))
  18990. }, [
  18991. vue.createVNode(_component_uni_icons, {
  18992. type: "clear",
  18993. color: "#c0c4cc",
  18994. size: "24"
  18995. })
  18996. ])) : vue.createCommentVNode("v-if", true),
  18997. (!$props.clearIcon || !$data.inputSelected.length) && !$props.readonly ? (vue.openBlock(), vue.createElementBlock("view", {
  18998. key: 5,
  18999. class: "arrow-area"
  19000. }, [
  19001. vue.createElementVNode("view", { class: "input-arrow" })
  19002. ])) : vue.createCommentVNode("v-if", true)
  19003. ],
  19004. 2
  19005. /* CLASS */
  19006. )
  19007. ], true)
  19008. ]),
  19009. $data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
  19010. key: 0,
  19011. class: "uni-data-tree-cover",
  19012. onClick: _cache[2] || (_cache[2] = (...args) => $options.handleClose && $options.handleClose(...args))
  19013. })) : vue.createCommentVNode("v-if", true),
  19014. $data.isOpened ? (vue.openBlock(), vue.createElementBlock("view", {
  19015. key: 1,
  19016. class: "uni-data-tree-dialog"
  19017. }, [
  19018. vue.createElementVNode("view", { class: "uni-popper__arrow" }),
  19019. vue.createElementVNode("view", { class: "dialog-caption" }, [
  19020. vue.createElementVNode("view", { class: "title-area" }, [
  19021. vue.createElementVNode(
  19022. "text",
  19023. { class: "dialog-title" },
  19024. vue.toDisplayString($props.popupTitle),
  19025. 1
  19026. /* TEXT */
  19027. )
  19028. ]),
  19029. vue.createElementVNode("view", {
  19030. class: "dialog-close",
  19031. onClick: _cache[3] || (_cache[3] = (...args) => $options.handleClose && $options.handleClose(...args))
  19032. }, [
  19033. vue.createElementVNode("view", {
  19034. class: "dialog-close-plus",
  19035. "data-id": "close"
  19036. }),
  19037. vue.createElementVNode("view", {
  19038. class: "dialog-close-plus dialog-close-rotate",
  19039. "data-id": "close"
  19040. })
  19041. ])
  19042. ]),
  19043. vue.createVNode(_component_data_picker_view, {
  19044. class: "picker-view",
  19045. ref: "pickerView",
  19046. modelValue: _ctx.dataValue,
  19047. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.dataValue = $event),
  19048. localdata: _ctx.localdata,
  19049. preload: _ctx.preload,
  19050. collection: _ctx.collection,
  19051. field: _ctx.field,
  19052. orderby: _ctx.orderby,
  19053. where: _ctx.where,
  19054. "step-searh": _ctx.stepSearh,
  19055. "self-field": _ctx.selfField,
  19056. "parent-field": _ctx.parentField,
  19057. "managed-mode": true,
  19058. map: _ctx.map,
  19059. ellipsis: $props.ellipsis,
  19060. onChange: $options.onchange,
  19061. onDatachange: $options.ondatachange,
  19062. onNodeclick: $options.onnodeclick
  19063. }, null, 8, ["modelValue", "localdata", "preload", "collection", "field", "orderby", "where", "step-searh", "self-field", "parent-field", "map", "ellipsis", "onChange", "onDatachange", "onNodeclick"])
  19064. ])) : vue.createCommentVNode("v-if", true)
  19065. ]);
  19066. }
  19067. const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m], ["__scopeId", "data-v-e10759db"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-data-picker/uni-data-picker.vue"]]);
  19068. const getBindParams = () => {
  19069. return http({
  19070. method: "GET",
  19071. url: "/admin/order.scanOrder/getBindParams"
  19072. });
  19073. };
  19074. const bindShipping = (data) => {
  19075. return http({
  19076. method: "POST",
  19077. url: "/admin/order.scanOrder/bindShipping",
  19078. data
  19079. });
  19080. };
  19081. const getWaybills = (data) => {
  19082. return http({
  19083. method: "POST",
  19084. url: "/admin/order.scanOrder/getWaybills",
  19085. data
  19086. });
  19087. };
  19088. const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
  19089. __name: "scanLotno",
  19090. setup(__props, { expose: __expose }) {
  19091. __expose();
  19092. const valiFormRef = vue.ref();
  19093. const loading = vue.ref(false);
  19094. const hidePage = vue.ref(false);
  19095. const focusType = vue.ref(true);
  19096. const editBatchNum = vue.ref(false);
  19097. const editPalletNum = vue.ref(false);
  19098. const scanLotnoHistory = vue.ref([]);
  19099. const messageRef = vue.ref();
  19100. const messageType = vue.ref();
  19101. const messageText = vue.ref();
  19102. let st2;
  19103. const valiFormData = vue.ref({
  19104. orderNum: "",
  19105. weight: "",
  19106. batchNum: "",
  19107. palletNum: "0"
  19108. });
  19109. const rules = vue.reactive({
  19110. orderNum: {
  19111. rules: [
  19112. {
  19113. required: true,
  19114. errorMessage: "单号不能为空"
  19115. }
  19116. ]
  19117. }
  19118. });
  19119. const options = vue.reactive({
  19120. batch: [],
  19121. pallet: []
  19122. });
  19123. const scanInput = async () => {
  19124. let status = await checkPermission();
  19125. if (status !== 1) {
  19126. return;
  19127. }
  19128. uni.scanCode({
  19129. success: (res) => {
  19130. valiFormData.value.orderNum = res.result;
  19131. onsubmit();
  19132. },
  19133. fail: (err) => {
  19134. }
  19135. });
  19136. };
  19137. const reset = () => {
  19138. loading.value = false;
  19139. valiFormData.value.orderNum = "";
  19140. valiFormData.value.weight = "";
  19141. };
  19142. const submitBatchNum = () => {
  19143. if (valiFormData.value.batchNum) {
  19144. editBatchNum.value = true;
  19145. } else {
  19146. messageType.value = "error";
  19147. messageText.value = "请选择批次号";
  19148. messageRef.value.open();
  19149. }
  19150. };
  19151. const batchNum = vue.computed(() => {
  19152. const res = options.batch.find((item) => item.value === valiFormData.value.batchNum);
  19153. return res == null ? void 0 : res.text;
  19154. });
  19155. const submitPalletNum = () => {
  19156. if (valiFormData.value.palletNum) {
  19157. editPalletNum.value = true;
  19158. } else {
  19159. messageType.value = "error";
  19160. messageText.value = "请选择托盘号";
  19161. messageRef.value.open();
  19162. }
  19163. };
  19164. const palletNum = vue.computed(() => {
  19165. function findTextByValue(arr, targetValue) {
  19166. for (let item of arr) {
  19167. if (item.value === targetValue) {
  19168. return item.text;
  19169. }
  19170. if (item.children && item.children.length > 0) {
  19171. const result = findTextByValue(item.children, targetValue);
  19172. if (result) {
  19173. return `${item.text}/${result}`;
  19174. }
  19175. }
  19176. }
  19177. return null;
  19178. }
  19179. const textPath = findTextByValue(options.pallet, valiFormData.value.palletNum);
  19180. return textPath;
  19181. });
  19182. const checkOrder = async () => {
  19183. loading.value = true;
  19184. uni.setStorageSync("waybills", []);
  19185. const res = await getWaybills({
  19186. order_no: valiFormData.value.orderNum,
  19187. batch_number: valiFormData.value.batchNum,
  19188. pallet_number: valiFormData.value.palletNum ? findPalletNumIdByValue(options.pallet, valiFormData.value.palletNum) : ""
  19189. });
  19190. loading.value = false;
  19191. if (res.code == 1) {
  19192. messageType.value = "success";
  19193. messageText.value = res.msg;
  19194. messageRef.value.open();
  19195. uni.setStorageSync("waybills", res.data.waybills);
  19196. uni.navigateTo({
  19197. url: "/pages/scanLotno/waybillsList"
  19198. });
  19199. } else {
  19200. messageType.value = "error";
  19201. messageText.value = res.msg;
  19202. messageRef.value.open();
  19203. }
  19204. };
  19205. const findPalletNumIdByValue = (data, targetValue) => {
  19206. for (let i2 = 0; i2 < data.length; i2++) {
  19207. const item = data[i2];
  19208. if (item.id === targetValue || item.value === targetValue) {
  19209. return [item.id];
  19210. } else if (item.children && item.children.length > 0) {
  19211. const childId = findPalletNumIdByValue(item.children, targetValue);
  19212. if (childId !== null) {
  19213. return childId;
  19214. }
  19215. }
  19216. }
  19217. return null;
  19218. };
  19219. const onsubmit = async () => {
  19220. st2 && clearTimeout(st2);
  19221. loading.value = true;
  19222. const res = await bindShipping({
  19223. order_no: valiFormData.value.orderNum,
  19224. reweighting: valiFormData.value.weight,
  19225. batch_number: valiFormData.value.batchNum,
  19226. pallet_number: valiFormData.value.palletNum ? findPalletNumIdByValue(options.pallet, valiFormData.value.palletNum) : ""
  19227. });
  19228. loading.value = false;
  19229. if (res.code == 1) {
  19230. messageType.value = "success";
  19231. messageText.value = res.msg;
  19232. messageRef.value.open();
  19233. if (res.data.labels && res.data.labels.length > 0) {
  19234. formatAppLog("log", "at pages/scanLotno/scanLotno.vue:288", "有打印面单");
  19235. }
  19236. const historyItem = {
  19237. orderNum: valiFormData.value.orderNum,
  19238. createTime: /* @__PURE__ */ new Date(),
  19239. type: valiFormData.value.batchNum ? "绑定批次" : "绑定托盘",
  19240. status: true
  19241. };
  19242. formatAppLog("log", "at pages/scanLotno/scanLotno.vue:300", "scanLotnoHistory--", scanLotnoHistory);
  19243. scanLotnoHistory.value.unshift(historyItem);
  19244. uni.setStorageSync("scanLotnoHistory", scanLotnoHistory.value);
  19245. getHistory();
  19246. } else {
  19247. messageType.value = "error";
  19248. messageText.value = res.msg;
  19249. messageRef.value.open();
  19250. const historyItem = {
  19251. orderNum: valiFormData.value.orderNum,
  19252. createTime: /* @__PURE__ */ new Date(),
  19253. type: valiFormData.value.batchNum ? "绑定批次" : "绑定托盘",
  19254. status: false
  19255. };
  19256. scanLotnoHistory.value.unshift(historyItem);
  19257. uni.setStorageSync("scanLotnoHistory", scanLotnoHistory.value);
  19258. getHistory();
  19259. }
  19260. st2 = setTimeout(() => {
  19261. reset();
  19262. setFocus();
  19263. st2 && clearTimeout(st2);
  19264. }, 1e3);
  19265. };
  19266. const getHistory = () => {
  19267. scanLotnoHistory.value = uni.getStorageSync("scanLotnoHistory") || [];
  19268. };
  19269. const keypress = (e2) => {
  19270. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  19271. ;
  19272. if (e2.keyCode == 66) {
  19273. onsubmit();
  19274. }
  19275. };
  19276. onLoad(() => {
  19277. plus.key.addEventListener("keyup", keypress);
  19278. });
  19279. onUnload(() => {
  19280. plus.key.removeEventListener("keyup", keypress);
  19281. });
  19282. onHide(() => {
  19283. hidePage.value = true;
  19284. plus.key.removeEventListener("keyup", keypress);
  19285. });
  19286. onBackPress(() => {
  19287. plus.key.removeEventListener("keyup", keypress);
  19288. });
  19289. onShow(() => {
  19290. hidePage.value = false;
  19291. _getBindParams();
  19292. getHistory();
  19293. });
  19294. const setFocus = () => {
  19295. if (hidePage.value) {
  19296. return;
  19297. }
  19298. focusType.value = false;
  19299. vue.nextTick(() => {
  19300. focusType.value = true;
  19301. });
  19302. };
  19303. const _getBindParams = async () => {
  19304. const res = await getBindParams();
  19305. if (res.code === 1) {
  19306. let transformData = function(data) {
  19307. return data.map((item) => {
  19308. const { id, value, label, ...rest } = item;
  19309. return {
  19310. id: id || value,
  19311. value,
  19312. text: label,
  19313. ...rest,
  19314. children: item.children ? transformData(item.children) : []
  19315. };
  19316. });
  19317. };
  19318. options.batch = res.data.batch_number.map((item) => {
  19319. return { text: item.name, value: item.id };
  19320. });
  19321. const shipping = transformData(res.data.shipping);
  19322. formatAppLog("log", "at pages/scanLotno/scanLotno.vue:412", "shipping", shipping);
  19323. options.pallet = shipping;
  19324. }
  19325. };
  19326. onNavigationBarButtonTap((event) => {
  19327. if (event.index === 0) {
  19328. uni.navigateTo({
  19329. url: "/pages/scanLotno/logList"
  19330. });
  19331. }
  19332. });
  19333. const __returned__ = { valiFormRef, loading, hidePage, focusType, editBatchNum, editPalletNum, scanLotnoHistory, messageRef, messageType, messageText, get st() {
  19334. return st2;
  19335. }, set st(v2) {
  19336. st2 = v2;
  19337. }, valiFormData, rules, options, scanInput, reset, submitBatchNum, batchNum, submitPalletNum, palletNum, checkOrder, findPalletNumIdByValue, onsubmit, getHistory, keypress, setFocus, _getBindParams };
  19338. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  19339. return __returned__;
  19340. }
  19341. });
  19342. function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
  19343. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$7);
  19344. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_0$4);
  19345. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$3);
  19346. const _component_uni_data_picker = resolveEasycom(vue.resolveDynamicComponent("uni-data-picker"), __easycom_1);
  19347. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$1);
  19348. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  19349. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_1$1);
  19350. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  19351. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  19352. vue.createVNode(_component_uni_forms, {
  19353. ref: "valiFormRef",
  19354. "label-align": "right",
  19355. "label-width": 80,
  19356. rules: $setup.rules,
  19357. modelValue: $setup.valiFormData
  19358. }, {
  19359. default: vue.withCtx(() => [
  19360. vue.createVNode(_component_uni_forms_item, {
  19361. label: "运单号码",
  19362. required: "",
  19363. name: "orderNum"
  19364. }, {
  19365. default: vue.withCtx(() => [
  19366. vue.createVNode(_component_uni_easyinput, {
  19367. modelValue: $setup.valiFormData.orderNum,
  19368. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.orderNum = $event),
  19369. placeholder: "请输入单号",
  19370. suffixIcon: "scan",
  19371. focus: $setup.focusType,
  19372. onIconClick: $setup.scanInput
  19373. }, null, 8, ["modelValue", "focus"])
  19374. ]),
  19375. _: 1
  19376. /* STABLE */
  19377. }),
  19378. vue.createVNode(_component_uni_forms_item, {
  19379. label: "复称重量",
  19380. name: "weight"
  19381. }, {
  19382. default: vue.withCtx(() => [
  19383. vue.createVNode(_component_uni_easyinput, {
  19384. modelValue: $setup.valiFormData.weight,
  19385. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.valiFormData.weight = $event),
  19386. placeholder: "请输入复称重量",
  19387. oninput: "value=value.replace(/[^\\d.]/g,'').replace(/^\\./g, '').replace(/\\.{2,}/g, '').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').match(/^\\d*(\\.?\\d{0,2})/g)[0] || null"
  19388. }, {
  19389. right: vue.withCtx(() => [
  19390. vue.createElementVNode("view", { class: "weight-right" }, "KG")
  19391. ]),
  19392. _: 1
  19393. /* STABLE */
  19394. }, 8, ["modelValue"])
  19395. ]),
  19396. _: 1
  19397. /* STABLE */
  19398. }),
  19399. vue.createCommentVNode(" <text class='weight-tip'>复称重量作用是确保句惠完整,防止工作人员计费称車后进行的其他操作引起的物品丢失问题</text> "),
  19400. vue.createVNode(_component_uni_forms_item, {
  19401. label: "绑定批次号",
  19402. name: "batchNum",
  19403. class: "select-item"
  19404. }, {
  19405. default: vue.withCtx(() => [
  19406. !$setup.editBatchNum ? (vue.openBlock(), vue.createBlock(_component_uni_data_select, {
  19407. key: 0,
  19408. modelValue: $setup.valiFormData.batchNum,
  19409. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.valiFormData.batchNum = $event),
  19410. placeholder: "请选择批次号",
  19411. localdata: $setup.options.batch,
  19412. clear: false
  19413. }, null, 8, ["modelValue", "localdata"])) : vue.createCommentVNode("v-if", true),
  19414. $setup.editBatchNum ? (vue.openBlock(), vue.createBlock(_component_uni_easyinput, {
  19415. key: 1,
  19416. value: $setup.batchNum,
  19417. disabled: $setup.editBatchNum
  19418. }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
  19419. !$setup.editBatchNum ? (vue.openBlock(), vue.createElementBlock("button", {
  19420. key: 2,
  19421. type: "primary",
  19422. onClick: $setup.submitBatchNum
  19423. }, "确认")) : vue.createCommentVNode("v-if", true),
  19424. $setup.editBatchNum ? (vue.openBlock(), vue.createElementBlock("button", {
  19425. key: 3,
  19426. type: "primary",
  19427. onClick: _cache[3] || (_cache[3] = ($event) => $setup.editBatchNum = false)
  19428. }, "修改")) : vue.createCommentVNode("v-if", true)
  19429. ]),
  19430. _: 1
  19431. /* STABLE */
  19432. }),
  19433. vue.createVNode(_component_uni_forms_item, {
  19434. label: "绑定托盘号",
  19435. name: "palletNum",
  19436. class: "select-item"
  19437. }, {
  19438. default: vue.withCtx(() => [
  19439. !$setup.editPalletNum ? (vue.openBlock(), vue.createBlock(_component_uni_data_picker, {
  19440. key: 0,
  19441. placeholder: "请选择托盘号",
  19442. "popup-title": "绑定托盘号",
  19443. localdata: $setup.options.pallet,
  19444. modelValue: $setup.valiFormData.palletNum,
  19445. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.valiFormData.palletNum = $event),
  19446. "clear-icon": false
  19447. }, null, 8, ["localdata", "modelValue"])) : vue.createCommentVNode("v-if", true),
  19448. $setup.editPalletNum ? (vue.openBlock(), vue.createBlock(_component_uni_easyinput, {
  19449. key: 1,
  19450. value: $setup.palletNum,
  19451. disabled: $setup.editPalletNum
  19452. }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
  19453. !$setup.editPalletNum ? (vue.openBlock(), vue.createElementBlock("button", {
  19454. key: 2,
  19455. type: "primary",
  19456. onClick: $setup.submitPalletNum
  19457. }, "确认")) : vue.createCommentVNode("v-if", true),
  19458. $setup.editPalletNum ? (vue.openBlock(), vue.createElementBlock("button", {
  19459. key: 3,
  19460. type: "primary",
  19461. onClick: _cache[5] || (_cache[5] = ($event) => $setup.editPalletNum = false)
  19462. }, "修改")) : vue.createCommentVNode("v-if", true)
  19463. ]),
  19464. _: 1
  19465. /* STABLE */
  19466. })
  19467. ]),
  19468. _: 1
  19469. /* STABLE */
  19470. }, 8, ["rules", "modelValue"]),
  19471. vue.createElementVNode("view", { class: "button-group" }, [
  19472. vue.createElementVNode("button", {
  19473. type: "default",
  19474. onClick: $setup.reset
  19475. }, "重置"),
  19476. vue.createElementVNode("button", {
  19477. type: "default",
  19478. onClick: $setup.checkOrder,
  19479. loading: $setup.loading
  19480. }, [
  19481. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  19482. key: 0,
  19483. type: "search",
  19484. size: "18"
  19485. })) : vue.createCommentVNode("v-if", true),
  19486. vue.createTextVNode(" 查看运单 ")
  19487. ], 8, ["loading"]),
  19488. vue.createElementVNode("button", {
  19489. type: "primary",
  19490. onClick: $setup.onsubmit,
  19491. loading: $setup.loading
  19492. }, [
  19493. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  19494. key: 0,
  19495. type: "checkmarkempty",
  19496. size: "18",
  19497. color: "white"
  19498. })) : vue.createCommentVNode("v-if", true),
  19499. vue.createTextVNode(" 提交 ")
  19500. ], 8, ["loading"])
  19501. ]),
  19502. $setup.scanLotnoHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  19503. key: 0,
  19504. class: "history"
  19505. }, [
  19506. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  19507. ])) : vue.createCommentVNode("v-if", true),
  19508. vue.createElementVNode("view", { class: "history" }, [
  19509. (vue.openBlock(true), vue.createElementBlock(
  19510. vue.Fragment,
  19511. null,
  19512. vue.renderList($setup.scanLotnoHistory.slice(0, 5), (item, i2) => {
  19513. return vue.openBlock(), vue.createElementBlock("view", {
  19514. class: "item",
  19515. key: i2
  19516. }, [
  19517. vue.createElementVNode(
  19518. "text",
  19519. { class: "type" },
  19520. vue.toDisplayString(item.type),
  19521. 1
  19522. /* TEXT */
  19523. ),
  19524. vue.createElementVNode(
  19525. "text",
  19526. {
  19527. class: "code",
  19528. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  19529. },
  19530. vue.toDisplayString(item.orderNum),
  19531. 5
  19532. /* TEXT, STYLE */
  19533. ),
  19534. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  19535. key: 0,
  19536. type: "checkmarkempty",
  19537. class: "status",
  19538. size: "16",
  19539. color: "green"
  19540. })) : (vue.openBlock(), vue.createElementBlock("text", {
  19541. key: 1,
  19542. class: "status fail"
  19543. }, "F")),
  19544. vue.createElementVNode(
  19545. "text",
  19546. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  19547. vue.toDisplayString("\r\n" + item.createTime),
  19548. 1
  19549. /* TEXT */
  19550. )
  19551. ]);
  19552. }),
  19553. 128
  19554. /* KEYED_FRAGMENT */
  19555. ))
  19556. ]),
  19557. vue.createVNode(
  19558. _component_uni_popup,
  19559. {
  19560. ref: "messageRef",
  19561. type: "message"
  19562. },
  19563. {
  19564. default: vue.withCtx(() => [
  19565. vue.createVNode(_component_uni_popup_message, {
  19566. type: $setup.messageType,
  19567. message: $setup.messageText,
  19568. duration: 2e3
  19569. }, null, 8, ["type", "message"])
  19570. ]),
  19571. _: 1
  19572. /* STABLE */
  19573. },
  19574. 512
  19575. /* NEED_PATCH */
  19576. )
  19577. ]);
  19578. }
  19579. const PagesScanLotnoScanLotno = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__file", "E:/demo/hmrabbit/src/pages/scanLotno/scanLotno.vue"]]);
  19580. const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
  19581. __name: "logList",
  19582. setup(__props, { expose: __expose }) {
  19583. __expose();
  19584. const scanLotnoHistory = vue.ref([]);
  19585. const getHistory = () => {
  19586. scanLotnoHistory.value = uni.getStorageSync("scanLotnoHistory");
  19587. };
  19588. onLoad(() => {
  19589. getHistory();
  19590. });
  19591. const __returned__ = { scanLotnoHistory, getHistory };
  19592. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  19593. return __returned__;
  19594. }
  19595. });
  19596. function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
  19597. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  19598. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  19599. (vue.openBlock(true), vue.createElementBlock(
  19600. vue.Fragment,
  19601. null,
  19602. vue.renderList($setup.scanLotnoHistory, (item, i2) => {
  19603. return vue.openBlock(), vue.createElementBlock("view", {
  19604. class: "item",
  19605. key: i2
  19606. }, [
  19607. vue.createElementVNode(
  19608. "text",
  19609. { class: "type" },
  19610. vue.toDisplayString(item.type),
  19611. 1
  19612. /* TEXT */
  19613. ),
  19614. vue.createElementVNode(
  19615. "text",
  19616. {
  19617. class: "code",
  19618. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  19619. },
  19620. vue.toDisplayString(item.orderNum),
  19621. 5
  19622. /* TEXT, STYLE */
  19623. ),
  19624. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  19625. key: 0,
  19626. type: "checkmarkempty",
  19627. class: "status",
  19628. size: "16",
  19629. color: "green"
  19630. })) : (vue.openBlock(), vue.createElementBlock("text", {
  19631. key: 1,
  19632. class: "status fail"
  19633. }, "F")),
  19634. vue.createElementVNode(
  19635. "text",
  19636. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  19637. vue.toDisplayString("\r\n" + item.createTime),
  19638. 1
  19639. /* TEXT */
  19640. )
  19641. ]);
  19642. }),
  19643. 128
  19644. /* KEYED_FRAGMENT */
  19645. )),
  19646. $setup.scanLotnoHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  19647. key: 0,
  19648. class: "is-empty"
  19649. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  19650. ]);
  19651. }
  19652. const PagesScanLotnoLogList = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$k], ["__scopeId", "data-v-01599952"], ["__file", "E:/demo/hmrabbit/src/pages/scanLotno/logList.vue"]]);
  19653. const _sfc_main$k = {
  19654. name: "UniSection",
  19655. emits: ["click"],
  19656. props: {
  19657. type: {
  19658. type: String,
  19659. default: ""
  19660. },
  19661. title: {
  19662. type: String,
  19663. required: true,
  19664. default: ""
  19665. },
  19666. titleFontSize: {
  19667. type: String,
  19668. default: "14px"
  19669. },
  19670. titleColor: {
  19671. type: String,
  19672. default: "#333"
  19673. },
  19674. subTitle: {
  19675. type: String,
  19676. default: ""
  19677. },
  19678. subTitleFontSize: {
  19679. type: String,
  19680. default: "12px"
  19681. },
  19682. subTitleColor: {
  19683. type: String,
  19684. default: "#999"
  19685. },
  19686. padding: {
  19687. type: [Boolean, String],
  19688. default: false
  19689. }
  19690. },
  19691. computed: {
  19692. _padding() {
  19693. if (typeof this.padding === "string") {
  19694. return this.padding;
  19695. }
  19696. return this.padding ? "10px" : "";
  19697. }
  19698. },
  19699. watch: {
  19700. title(newVal) {
  19701. if (uni.report && newVal !== "") {
  19702. uni.report("title", newVal);
  19703. }
  19704. }
  19705. },
  19706. methods: {
  19707. onClick() {
  19708. this.$emit("click");
  19709. }
  19710. }
  19711. };
  19712. function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
  19713. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-section" }, [
  19714. vue.createElementVNode("view", {
  19715. class: "uni-section-header",
  19716. onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args))
  19717. }, [
  19718. $props.type ? (vue.openBlock(), vue.createElementBlock(
  19719. "view",
  19720. {
  19721. key: 0,
  19722. class: vue.normalizeClass(["uni-section-header__decoration", $props.type])
  19723. },
  19724. null,
  19725. 2
  19726. /* CLASS */
  19727. )) : vue.renderSlot(_ctx.$slots, "decoration", { key: 1 }, void 0, true),
  19728. vue.createElementVNode("view", { class: "uni-section-header__content" }, [
  19729. vue.createElementVNode(
  19730. "text",
  19731. {
  19732. style: vue.normalizeStyle({ "font-size": $props.titleFontSize, "color": $props.titleColor }),
  19733. class: vue.normalizeClass(["uni-section__content-title", { "distraction": !$props.subTitle }])
  19734. },
  19735. vue.toDisplayString($props.title),
  19736. 7
  19737. /* TEXT, CLASS, STYLE */
  19738. ),
  19739. $props.subTitle ? (vue.openBlock(), vue.createElementBlock(
  19740. "text",
  19741. {
  19742. key: 0,
  19743. style: vue.normalizeStyle({ "font-size": $props.subTitleFontSize, "color": $props.subTitleColor }),
  19744. class: "uni-section-header__content-sub"
  19745. },
  19746. vue.toDisplayString($props.subTitle),
  19747. 5
  19748. /* TEXT, STYLE */
  19749. )) : vue.createCommentVNode("v-if", true)
  19750. ]),
  19751. vue.createElementVNode("view", { class: "uni-section-header__slot-right" }, [
  19752. vue.renderSlot(_ctx.$slots, "right", {}, void 0, true)
  19753. ])
  19754. ]),
  19755. vue.createElementVNode(
  19756. "view",
  19757. {
  19758. class: "uni-section-content",
  19759. style: vue.normalizeStyle({ padding: $options._padding })
  19760. },
  19761. [
  19762. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  19763. ],
  19764. 4
  19765. /* STYLE */
  19766. )
  19767. ]);
  19768. }
  19769. const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$j], ["__scopeId", "data-v-17c33c2a"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-section/uni-section.vue"]]);
  19770. const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
  19771. __name: "waybillsList",
  19772. setup(__props, { expose: __expose }) {
  19773. __expose();
  19774. const waybills = vue.ref([]);
  19775. const getHistory = () => {
  19776. waybills.value = uni.getStorageSync("waybills");
  19777. };
  19778. onLoad(() => {
  19779. getHistory();
  19780. });
  19781. const __returned__ = { waybills, getHistory };
  19782. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  19783. return __returned__;
  19784. }
  19785. });
  19786. function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
  19787. const _component_uni_section = resolveEasycom(vue.resolveDynamicComponent("uni-section"), __easycom_0$1);
  19788. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  19789. vue.createVNode(_component_uni_section, {
  19790. title: "数量: " + $setup.waybills.length
  19791. }, null, 8, ["title"]),
  19792. (vue.openBlock(true), vue.createElementBlock(
  19793. vue.Fragment,
  19794. null,
  19795. vue.renderList($setup.waybills, (item, i2) => {
  19796. return vue.openBlock(), vue.createElementBlock("view", {
  19797. class: "item",
  19798. key: i2
  19799. }, [
  19800. vue.createElementVNode(
  19801. "text",
  19802. {
  19803. class: "code",
  19804. style: { color: "#666" }
  19805. },
  19806. vue.toDisplayString(item.order_box_no),
  19807. 1
  19808. /* TEXT */
  19809. ),
  19810. vue.createElementVNode(
  19811. "text",
  19812. { class: "type" },
  19813. "重量: " + vue.toDisplayString(item.weight) + "KG",
  19814. 1
  19815. /* TEXT */
  19816. ),
  19817. vue.createElementVNode("view", { class: "sub-items" }, [
  19818. vue.createElementVNode("view", { class: "sub-item" }, [
  19819. vue.createElementVNode("text", { class: "type" }, "批次/船航/托盘"),
  19820. vue.createElementVNode(
  19821. "text",
  19822. { class: "type" },
  19823. vue.toDisplayString(item.batch_shipping_pallet),
  19824. 1
  19825. /* TEXT */
  19826. )
  19827. ]),
  19828. vue.createElementVNode("view", { class: "sub-item" }, [
  19829. vue.createElementVNode("text", { class: "type" }, "末公里运单号"),
  19830. vue.createElementVNode(
  19831. "text",
  19832. { class: "type" },
  19833. vue.toDisplayString(item.tracking_number || "无"),
  19834. 1
  19835. /* TEXT */
  19836. )
  19837. ])
  19838. ])
  19839. ]);
  19840. }),
  19841. 128
  19842. /* KEYED_FRAGMENT */
  19843. )),
  19844. $setup.waybills.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  19845. key: 0,
  19846. class: "is-empty"
  19847. }, "暂无运单")) : vue.createCommentVNode("v-if", true)
  19848. ]);
  19849. }
  19850. const PagesScanLotnoWaybillsList = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i], ["__scopeId", "data-v-9aaaa5da"], ["__file", "E:/demo/hmrabbit/src/pages/scanLotno/waybillsList.vue"]]);
  19851. const waybillNoOptions = () => {
  19852. return http({
  19853. method: "GET",
  19854. url: "/admin/warehouse.waybillNo/getOptions"
  19855. });
  19856. };
  19857. const addWaybillNo = (data) => {
  19858. return http({
  19859. method: "POST",
  19860. url: "/admin/warehouse.waybillNo/add",
  19861. data
  19862. });
  19863. };
  19864. const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
  19865. __name: "waybillNo",
  19866. setup(__props, { expose: __expose }) {
  19867. __expose();
  19868. const editSpaceNo = vue.ref(false);
  19869. const loading = vue.ref(false);
  19870. const hidePage = vue.ref(false);
  19871. const focusType = vue.ref(true);
  19872. const waybillNoHistory = vue.ref([]);
  19873. const messageRef = vue.ref();
  19874. const messageType = vue.ref();
  19875. const messageText = vue.ref();
  19876. let st2;
  19877. const valiFormData = vue.ref({
  19878. code: "",
  19879. space_id: ""
  19880. });
  19881. const rules = vue.reactive({
  19882. code: {
  19883. rules: [
  19884. {
  19885. required: true,
  19886. errorMessage: "单号不能为空"
  19887. }
  19888. ]
  19889. }
  19890. });
  19891. const options = vue.reactive({
  19892. space: []
  19893. });
  19894. const scanInput = async () => {
  19895. let status = await checkPermission();
  19896. if (status !== 1) {
  19897. return;
  19898. }
  19899. uni.scanCode({
  19900. success: (res) => {
  19901. valiFormData.value.code = res.result;
  19902. },
  19903. fail: (err) => {
  19904. }
  19905. });
  19906. };
  19907. const reset = () => {
  19908. loading.value = false;
  19909. valiFormData.value.code = "";
  19910. };
  19911. const submitSpace = () => {
  19912. if (valiFormData.value.space_id) {
  19913. editSpaceNo.value = true;
  19914. setFocus();
  19915. } else {
  19916. messageType.value = "error";
  19917. messageText.value = "请选择库位";
  19918. messageRef.value.open();
  19919. }
  19920. };
  19921. const space = vue.computed(() => {
  19922. const res = options.space.find((item) => item.value === valiFormData.value.space_id);
  19923. return res == null ? void 0 : res.text;
  19924. });
  19925. const findPalletNumIdByValue = (data, targetValue) => {
  19926. for (let i2 = 0; i2 < data.length; i2++) {
  19927. const item = data[i2];
  19928. if (item.id === targetValue || item.value === targetValue) {
  19929. return [item.id];
  19930. } else if (item.children && item.children.length > 0) {
  19931. const childId = findPalletNumIdByValue(item.children, targetValue);
  19932. if (childId !== null) {
  19933. return childId;
  19934. }
  19935. }
  19936. }
  19937. return null;
  19938. };
  19939. const onsubmit = async () => {
  19940. if (valiFormData.value.space_id && valiFormData.value.code) {
  19941. st2 && clearTimeout(st2);
  19942. loading.value = true;
  19943. const res = await addWaybillNo({
  19944. code: valiFormData.value.code,
  19945. space_id: valiFormData.value.space_id
  19946. });
  19947. loading.value = false;
  19948. const space2 = options.space.find((item) => item.value === valiFormData.value.space_id);
  19949. if (res.code == 1) {
  19950. messageType.value = "success";
  19951. messageText.value = res.msg;
  19952. messageRef.value.open();
  19953. const historyItem = {
  19954. code: valiFormData.value.code,
  19955. createTime: /* @__PURE__ */ new Date(),
  19956. type: "运单号",
  19957. space: space2.text,
  19958. status: true
  19959. };
  19960. waybillNoHistory.value.unshift(historyItem);
  19961. uni.setStorageSync("waybillNoHistory", waybillNoHistory.value);
  19962. getHistory();
  19963. } else {
  19964. messageType.value = "error";
  19965. messageText.value = res.msg;
  19966. messageRef.value.open();
  19967. const historyItem = {
  19968. code: valiFormData.value.code,
  19969. createTime: /* @__PURE__ */ new Date(),
  19970. type: "运单号",
  19971. space: space2.text,
  19972. status: false
  19973. };
  19974. waybillNoHistory.value.unshift(historyItem);
  19975. uni.setStorageSync("waybillNoHistory", waybillNoHistory.value);
  19976. getHistory();
  19977. }
  19978. st2 = setTimeout(() => {
  19979. reset();
  19980. setFocus();
  19981. st2 && clearTimeout(st2);
  19982. }, 1e3);
  19983. } else {
  19984. if (!valiFormData.value.space_id) {
  19985. messageType.value = "error";
  19986. messageText.value = "请选择库位";
  19987. messageRef.value.open();
  19988. }
  19989. if (!valiFormData.value.code) {
  19990. messageType.value = "error";
  19991. messageText.value = "请填写运单号";
  19992. messageRef.value.open();
  19993. }
  19994. }
  19995. };
  19996. const getHistory = () => {
  19997. waybillNoHistory.value = uni.getStorageSync("waybillNoHistory") || [];
  19998. };
  19999. const keypress = (e2) => {
  20000. if (e2.keyCode === 102 || e2.keyCode === 103 || e2.keyCode === 104)
  20001. ;
  20002. if (e2.keyCode == 66) {
  20003. onsubmit();
  20004. }
  20005. };
  20006. onLoad(() => {
  20007. plus.key.addEventListener("keyup", keypress);
  20008. });
  20009. onUnload(() => {
  20010. plus.key.removeEventListener("keyup", keypress);
  20011. });
  20012. onHide(() => {
  20013. hidePage.value = true;
  20014. plus.key.removeEventListener("keyup", keypress);
  20015. });
  20016. onBackPress(() => {
  20017. plus.key.removeEventListener("keyup", keypress);
  20018. });
  20019. onShow(() => {
  20020. hidePage.value = false;
  20021. getOptions();
  20022. getHistory();
  20023. });
  20024. const getOptions = async () => {
  20025. const res = await waybillNoOptions();
  20026. if (res.code === 1) {
  20027. for (let key in res.data.space_id) {
  20028. if (res.data.space_id.hasOwnProperty(key)) {
  20029. options.space.push({ text: res.data.space_id[key], value: key });
  20030. }
  20031. }
  20032. }
  20033. };
  20034. const setFocus = () => {
  20035. if (hidePage.value) {
  20036. return;
  20037. }
  20038. focusType.value = false;
  20039. vue.nextTick(() => {
  20040. focusType.value = true;
  20041. });
  20042. };
  20043. onNavigationBarButtonTap((event) => {
  20044. if (event.index === 0) {
  20045. uni.navigateTo({
  20046. url: "/pages/waybillNo/logList"
  20047. });
  20048. }
  20049. });
  20050. const __returned__ = { editSpaceNo, loading, hidePage, focusType, waybillNoHistory, messageRef, messageType, messageText, get st() {
  20051. return st2;
  20052. }, set st(v2) {
  20053. st2 = v2;
  20054. }, valiFormData, rules, options, scanInput, reset, submitSpace, space, findPalletNumIdByValue, onsubmit, getHistory, keypress, getOptions, setFocus };
  20055. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  20056. return __returned__;
  20057. }
  20058. });
  20059. function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
  20060. const _component_uni_data_select = resolveEasycom(vue.resolveDynamicComponent("uni-data-select"), __easycom_0$3);
  20061. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$7);
  20062. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$1);
  20063. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  20064. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_1$1);
  20065. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  20066. return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [
  20067. vue.createVNode(_component_uni_forms, {
  20068. ref: "valiForm",
  20069. "label-align": "right",
  20070. "label-width": 80,
  20071. rules: $setup.rules,
  20072. modelValue: $setup.valiFormData
  20073. }, {
  20074. default: vue.withCtx(() => [
  20075. vue.createElementVNode("view", { class: "space-select" }, [
  20076. !$setup.editSpaceNo ? (vue.openBlock(), vue.createBlock(_component_uni_data_select, {
  20077. key: 0,
  20078. modelValue: $setup.valiFormData.space_id,
  20079. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valiFormData.space_id = $event),
  20080. placeholder: "请选择库位",
  20081. localdata: $setup.options.space,
  20082. clear: false
  20083. }, null, 8, ["modelValue", "localdata"])) : vue.createCommentVNode("v-if", true),
  20084. $setup.editSpaceNo ? (vue.openBlock(), vue.createBlock(_component_uni_easyinput, {
  20085. key: 1,
  20086. value: $setup.space,
  20087. disabled: $setup.editSpaceNo
  20088. }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
  20089. !$setup.editSpaceNo ? (vue.openBlock(), vue.createElementBlock("button", {
  20090. key: 2,
  20091. type: "primary",
  20092. onClick: $setup.submitSpace
  20093. }, "确认")) : vue.createCommentVNode("v-if", true),
  20094. $setup.editSpaceNo ? (vue.openBlock(), vue.createElementBlock("button", {
  20095. key: 3,
  20096. type: "primary",
  20097. onClick: _cache[1] || (_cache[1] = ($event) => $setup.editSpaceNo = false)
  20098. }, "修改")) : vue.createCommentVNode("v-if", true)
  20099. ]),
  20100. vue.createElementVNode("view", null, [
  20101. vue.createVNode(_component_uni_easyinput, {
  20102. modelValue: $setup.valiFormData.code,
  20103. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.valiFormData.code = $event),
  20104. placeholder: "请输入运单号",
  20105. suffixIcon: "scan",
  20106. focus: $setup.focusType,
  20107. onIconClick: $setup.scanInput
  20108. }, null, 8, ["modelValue", "focus"])
  20109. ])
  20110. ]),
  20111. _: 1
  20112. /* STABLE */
  20113. }, 8, ["rules", "modelValue"]),
  20114. vue.createElementVNode("view", { class: "button-group" }, [
  20115. vue.createElementVNode("button", {
  20116. type: "default",
  20117. onClick: $setup.reset
  20118. }, "重置"),
  20119. vue.createElementVNode("button", {
  20120. type: "primary",
  20121. onClick: $setup.onsubmit,
  20122. loading: $setup.loading
  20123. }, [
  20124. !$setup.loading ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  20125. key: 0,
  20126. type: "checkmarkempty",
  20127. size: "18",
  20128. color: "white"
  20129. })) : vue.createCommentVNode("v-if", true),
  20130. vue.createTextVNode(" 提交 ")
  20131. ], 8, ["loading"])
  20132. ]),
  20133. $setup.waybillNoHistory.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  20134. key: 0,
  20135. class: "history"
  20136. }, [
  20137. vue.createElementVNode("text", { class: "title" }, "记录(最近5条)")
  20138. ])) : vue.createCommentVNode("v-if", true),
  20139. vue.createElementVNode("view", { class: "history" }, [
  20140. (vue.openBlock(true), vue.createElementBlock(
  20141. vue.Fragment,
  20142. null,
  20143. vue.renderList($setup.waybillNoHistory.slice(0, 5), (item, i2) => {
  20144. return vue.openBlock(), vue.createElementBlock("view", {
  20145. class: "item",
  20146. key: i2
  20147. }, [
  20148. vue.createElementVNode("view", null, [
  20149. vue.createElementVNode("view", null, [
  20150. vue.createElementVNode("text", { class: "type" }, "库位"),
  20151. vue.createElementVNode(
  20152. "text",
  20153. {
  20154. class: "code",
  20155. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  20156. },
  20157. vue.toDisplayString(item.space),
  20158. 5
  20159. /* TEXT, STYLE */
  20160. )
  20161. ]),
  20162. vue.createElementVNode("view", null, [
  20163. vue.createElementVNode("text", { class: "type" }, "单号"),
  20164. vue.createElementVNode(
  20165. "text",
  20166. {
  20167. class: "code",
  20168. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  20169. },
  20170. vue.toDisplayString(item.code),
  20171. 5
  20172. /* TEXT, STYLE */
  20173. )
  20174. ]),
  20175. vue.createElementVNode("view", { class: "space-time" }, [
  20176. vue.createElementVNode(
  20177. "text",
  20178. null,
  20179. vue.toDisplayString(item.createTime),
  20180. 1
  20181. /* TEXT */
  20182. )
  20183. ])
  20184. ]),
  20185. vue.createElementVNode("view", null, [
  20186. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  20187. key: 0,
  20188. type: "checkmarkempty",
  20189. class: "status",
  20190. size: "16",
  20191. color: "green"
  20192. })) : (vue.openBlock(), vue.createElementBlock("text", {
  20193. key: 1,
  20194. class: "status fail"
  20195. }, "F"))
  20196. ])
  20197. ]);
  20198. }),
  20199. 128
  20200. /* KEYED_FRAGMENT */
  20201. ))
  20202. ]),
  20203. vue.createVNode(
  20204. _component_uni_popup,
  20205. {
  20206. ref: "messageRef",
  20207. type: "message"
  20208. },
  20209. {
  20210. default: vue.withCtx(() => [
  20211. vue.createVNode(_component_uni_popup_message, {
  20212. type: $setup.messageType,
  20213. message: $setup.messageText,
  20214. duration: 2e3
  20215. }, null, 8, ["type", "message"])
  20216. ]),
  20217. _: 1
  20218. /* STABLE */
  20219. },
  20220. 512
  20221. /* NEED_PATCH */
  20222. )
  20223. ]);
  20224. }
  20225. const PagesWaybillNoWaybillNo = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__file", "E:/demo/hmrabbit/src/pages/waybillNo/waybillNo.vue"]]);
  20226. const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
  20227. __name: "logList",
  20228. setup(__props, { expose: __expose }) {
  20229. __expose();
  20230. const waybillNoHistory = vue.ref([]);
  20231. const getHistory = async () => {
  20232. waybillNoHistory.value = uni.getStorageSync("waybillNoHistory");
  20233. };
  20234. onLoad(async () => {
  20235. await getHistory();
  20236. });
  20237. const __returned__ = { waybillNoHistory, getHistory };
  20238. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  20239. return __returned__;
  20240. }
  20241. });
  20242. function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
  20243. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  20244. return vue.openBlock(), vue.createElementBlock("view", { class: "history" }, [
  20245. (vue.openBlock(true), vue.createElementBlock(
  20246. vue.Fragment,
  20247. null,
  20248. vue.renderList($setup.waybillNoHistory, (item, i2) => {
  20249. return vue.openBlock(), vue.createElementBlock("view", {
  20250. class: "item",
  20251. key: i2
  20252. }, [
  20253. vue.createCommentVNode(` <text class="type">库位</text>\r
  20254. <text clsaa="code" :style="{ color: item.status ? 'green' : '#666' }">{{ item.space }}</text>\r
  20255. <view>\r
  20256. <text class="type">单号</text>\r
  20257. <text class="code" ;style="{color : item.status ? 'green' : '#666'}">{{ item.code }}</text>\r
  20258. </view>\r
  20259. <view class="space-time">\r
  20260. <text>\r
  20261. {{ item.createTime }}\r
  20262. </text>\r
  20263. </view>\r
  20264. </view>\r
  20265. </view>\r
  20266. \r
  20267. <view v-if="waybillNoHistory.length === 0" class="is-empty">暂无历史</view>\r
  20268. <view class="history">\r
  20269. <view class="title">历史运单号</view>\r
  20270. <view v-for="(item, index) in waybillNoHistory" :key="index" class="item">\r
  20271. <view class="type">运单号:</view>\r
  20272. <view class="code">{{ item }}</view>\r
  20273. <view class="status">\r
  20274. <text class="fail">已失效</text>\r
  20275. </view>-`),
  20276. vue.createElementVNode(
  20277. "text",
  20278. {
  20279. class: "code",
  20280. style: vue.normalizeStyle({ color: item.status ? "green" : "#666" })
  20281. },
  20282. [
  20283. vue.createTextVNode(
  20284. vue.toDisplayString(item.orderNum) + " ",
  20285. 1
  20286. /* TEXT */
  20287. ),
  20288. item.batch_text ? (vue.openBlock(), vue.createElementBlock(
  20289. "text",
  20290. { key: 0 },
  20291. " 单号 " + vue.toDisplayString(item.batch_text),
  20292. 1
  20293. /* TEXT */
  20294. )) : vue.createCommentVNode("v-if", true),
  20295. item.space ? (vue.openBlock(), vue.createElementBlock(
  20296. "text",
  20297. { key: 1 },
  20298. " 库位 " + vue.toDisplayString(item.space),
  20299. 1
  20300. /* TEXT */
  20301. )) : vue.createCommentVNode("v-if", true),
  20302. vue.createTextVNode(
  20303. " " + vue.toDisplayString(item.type),
  20304. 1
  20305. /* TEXT */
  20306. )
  20307. ],
  20308. 4
  20309. /* STYLE */
  20310. ),
  20311. item.status ? (vue.openBlock(), vue.createBlock(_component_uni_icons, {
  20312. key: 0,
  20313. type: "checkmarkempty",
  20314. class: "status",
  20315. size: "16",
  20316. color: "green"
  20317. })) : (vue.openBlock(), vue.createElementBlock("text", {
  20318. key: 1,
  20319. class: "status fail"
  20320. }, "F")),
  20321. vue.createElementVNode(
  20322. "text",
  20323. { style: { "margin-left": "10rpx", "font-weight": "300" } },
  20324. vue.toDisplayString("\r\n" + item.createTime),
  20325. 1
  20326. /* TEXT */
  20327. )
  20328. ]);
  20329. }),
  20330. 128
  20331. /* KEYED_FRAGMENT */
  20332. )),
  20333. $setup.waybillNoHistory.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  20334. key: 0,
  20335. class: "is-empty"
  20336. }, "暂无历史")) : vue.createCommentVNode("v-if", true)
  20337. ]);
  20338. }
  20339. const PagesWaybillNoLogList = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g], ["__scopeId", "data-v-c93ee9b5"], ["__file", "E:/demo/hmrabbit/src/pages/waybillNo/logList.vue"]]);
  20340. const waybillPickUpOrders = (params) => {
  20341. return http({
  20342. method: "GET",
  20343. url: "/admin/pickup.waybillPickUpOrder/index",
  20344. data: params
  20345. });
  20346. };
  20347. const getPickUpById = (pick_up_order_id) => {
  20348. return http({
  20349. method: "GET",
  20350. url: "/admin/pickup.waybillPickUpOrder/detail",
  20351. data: { pick_up_order_id }
  20352. });
  20353. };
  20354. const getPickUpByWaybillNo = (waybill_no) => {
  20355. return http({
  20356. method: "GET",
  20357. url: "/admin/pickup.waybillPickUpOrder/getByWaybillNo",
  20358. data: { waybill_no }
  20359. });
  20360. };
  20361. const startOff = (data) => {
  20362. return http({
  20363. method: "POST",
  20364. url: "/admin/pickup.waybillPickUpOrder/startOff",
  20365. data
  20366. });
  20367. };
  20368. function collect(data) {
  20369. return http({
  20370. method: "POST",
  20371. url: "/admin/pickup.waybillPickUpOrder/collect",
  20372. data
  20373. });
  20374. }
  20375. function pickupDelivered(data) {
  20376. return http({
  20377. method: "POST",
  20378. url: "/admin/pickup.waybillPickUpOrder/delivered",
  20379. data
  20380. });
  20381. }
  20382. function deliveryToTheCourierPoint(data) {
  20383. return http({
  20384. method: "POST",
  20385. url: "/admin/pickup.waybillPickUpOrder/deliveryToTheCourierPoint",
  20386. data
  20387. });
  20388. }
  20389. const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
  20390. __name: "waybillPickUpOrder",
  20391. setup(__props, { expose: __expose }) {
  20392. __expose();
  20393. let sendOutURL = "";
  20394. let deliveredURL = "";
  20395. let refuseURL = "";
  20396. let createTrackPodURL = "";
  20397. let cancelFedExPickUpURL = "";
  20398. const loading = vue.ref(false);
  20399. const loadingBtn = vue.ref(false);
  20400. const searchValue = vue.ref();
  20401. const waybillDelivery = vue.ref([]);
  20402. const total = vue.ref();
  20403. const messageType = vue.ref();
  20404. const messageText = vue.ref();
  20405. const messageRef = vue.ref();
  20406. const showRightRef = vue.ref();
  20407. const params = vue.reactive({
  20408. page: 1,
  20409. limit: 10
  20410. });
  20411. const scrollLeft = vue.ref(0);
  20412. const contentScrollW = vue.ref(0);
  20413. const activeIndex = vue.ref(0);
  20414. const statusItems = vue.ref([
  20415. {
  20416. id: 1,
  20417. title: "全部",
  20418. value: 0
  20419. },
  20420. {
  20421. id: 2,
  20422. title: "待取件",
  20423. value: 2
  20424. },
  20425. {
  20426. id: 3,
  20427. title: "取件中",
  20428. value: 3
  20429. },
  20430. {
  20431. id: 4,
  20432. title: "部分取件",
  20433. value: 4
  20434. },
  20435. {
  20436. id: 5,
  20437. title: "全部取件",
  20438. value: 5
  20439. },
  20440. {
  20441. id: 6,
  20442. title: "部分投递",
  20443. value: 6
  20444. },
  20445. {
  20446. id: 7,
  20447. title: "全部投递",
  20448. value: 7
  20449. }
  20450. ]);
  20451. const changeMenu = (index) => {
  20452. activeIndex.value = index;
  20453. scrollLeft.value = statusItems.value[index].left - contentScrollW.value / 2 + statusItems.value[index].width / 2;
  20454. };
  20455. const resetForm = () => {
  20456. };
  20457. const confirmForm = () => {
  20458. showRightRef.value.close();
  20459. };
  20460. const copyOrderNo = (order_no) => {
  20461. uni.setClipboardData({
  20462. data: order_no,
  20463. success: function() {
  20464. uni.showToast({
  20465. title: "复制成功",
  20466. icon: "success",
  20467. duration: 2e3
  20468. });
  20469. },
  20470. fail: function() {
  20471. formatAppLog("log", "at pages/pickup/waybillPickUpOrder.vue:188", "复制失败");
  20472. }
  20473. });
  20474. };
  20475. const callPhone = (phoneNumber) => {
  20476. formatAppLog("log", "at pages/pickup/waybillPickUpOrder.vue:194", phoneNumber);
  20477. uni.makePhoneCall({
  20478. phoneNumber,
  20479. success: function() {
  20480. formatAppLog("log", "at pages/pickup/waybillPickUpOrder.vue:199", "拨打电话成功!");
  20481. },
  20482. fail: function() {
  20483. formatAppLog("log", "at pages/pickup/waybillPickUpOrder.vue:202", "拨打电话失败!");
  20484. }
  20485. });
  20486. };
  20487. const scanInput = async () => {
  20488. let status = await checkPermission();
  20489. if (status !== 1) {
  20490. return;
  20491. }
  20492. uni.scanCode({
  20493. success: (res) => {
  20494. formatAppLog("log", "at pages/pickup/waybillPickUpOrder.vue:229", "res---", res.result);
  20495. },
  20496. fail: (err) => {
  20497. }
  20498. });
  20499. };
  20500. const getList = async () => {
  20501. loading.value = true;
  20502. params.page = 1;
  20503. const res = await waybillPickUpOrders(params);
  20504. loading.value = false;
  20505. if (res.code == 1) {
  20506. waybillDelivery.value = res.data.list;
  20507. total.value = res.data.total;
  20508. } else {
  20509. messageType.value = "error";
  20510. messageText.value = res.msg;
  20511. messageRef.value.open();
  20512. }
  20513. };
  20514. onShow(() => {
  20515. getList();
  20516. });
  20517. vue.onMounted(() => {
  20518. getScrollW();
  20519. });
  20520. onNavigationBarButtonTap(async (event) => {
  20521. if (event.index === 0) {
  20522. const res = await getPickUpByWaybillNo("YTSEA2412080001GB01");
  20523. if (res.code == 1 && res.data.id) {
  20524. uni.navigateTo({
  20525. url: `/pages/pickup/waybillPickUpDetail?waybill_no=${res.data.waybill_no}`
  20526. });
  20527. } else {
  20528. messageType.value = "error";
  20529. messageText.value = "面单不存在";
  20530. messageRef.value.open();
  20531. }
  20532. }
  20533. });
  20534. const getScrollW = () => {
  20535. const instance = vue.getCurrentInstance();
  20536. const query = uni.createSelectorQuery().in(instance.proxy);
  20537. query.select(".scroll-view").boundingClientRect((data) => {
  20538. contentScrollW.value = data.width;
  20539. }).exec();
  20540. query.selectAll(".scroll-item").boundingClientRect((data) => {
  20541. let dataLen = data.length - 1;
  20542. for (let i2 = 0; i2 < dataLen; i2++) {
  20543. statusItems.value[i2].left = data[i2].left || 0;
  20544. statusItems.value[i2].width = data[i2].width;
  20545. }
  20546. }).exec();
  20547. };
  20548. const onScrolltolower = async () => {
  20549. if (waybillDelivery.value.length < total.value) {
  20550. params.page++;
  20551. } else {
  20552. return uni.showToast({ icon: "none", title: "没有更多数据了~" });
  20553. }
  20554. const res = await waybillPickUpOrders(params);
  20555. if (res.code == 1) {
  20556. waybillDelivery.value.push(...res.data.list);
  20557. total.value = res.data.total;
  20558. }
  20559. };
  20560. const __returned__ = { get sendOutURL() {
  20561. return sendOutURL;
  20562. }, set sendOutURL(v2) {
  20563. sendOutURL = v2;
  20564. }, get deliveredURL() {
  20565. return deliveredURL;
  20566. }, set deliveredURL(v2) {
  20567. deliveredURL = v2;
  20568. }, get refuseURL() {
  20569. return refuseURL;
  20570. }, set refuseURL(v2) {
  20571. refuseURL = v2;
  20572. }, get createTrackPodURL() {
  20573. return createTrackPodURL;
  20574. }, set createTrackPodURL(v2) {
  20575. createTrackPodURL = v2;
  20576. }, get cancelFedExPickUpURL() {
  20577. return cancelFedExPickUpURL;
  20578. }, set cancelFedExPickUpURL(v2) {
  20579. cancelFedExPickUpURL = v2;
  20580. }, loading, loadingBtn, searchValue, waybillDelivery, total, messageType, messageText, messageRef, showRightRef, params, scrollLeft, contentScrollW, activeIndex, statusItems, changeMenu, resetForm, confirmForm, copyOrderNo, callPhone, scanInput, getList, getScrollW, onScrolltolower };
  20581. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  20582. return __returned__;
  20583. }
  20584. });
  20585. function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
  20586. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$7);
  20587. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_1$1);
  20588. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  20589. return vue.openBlock(), vue.createElementBlock("view", { class: "viewport" }, [
  20590. vue.createCommentVNode(" 输入框和筛选按钮 "),
  20591. vue.createElementVNode("view", { class: "inputfilter" }, [
  20592. vue.createVNode(_component_uni_easyinput, {
  20593. modelValue: $setup.searchValue,
  20594. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.searchValue = $event),
  20595. placeholder: "请输入单号",
  20596. inputBorder: false
  20597. }, null, 8, ["modelValue"]),
  20598. vue.createElementVNode("view", { class: "filter" }, [
  20599. vue.createElementVNode("text", null, "筛选")
  20600. ])
  20601. ]),
  20602. vue.createCommentVNode(" 状态选项 "),
  20603. vue.createElementVNode("view", { class: "center-cut-menu" }, [
  20604. vue.createElementVNode("scroll-view", {
  20605. "scroll-x": true,
  20606. "scroll-with-animation": true,
  20607. "show-scrollbar": false,
  20608. class: "scroll-view",
  20609. "scroll-left": $setup.scrollLeft
  20610. }, [
  20611. vue.createElementVNode("view", { class: "scroll-item" }, [
  20612. (vue.openBlock(true), vue.createElementBlock(
  20613. vue.Fragment,
  20614. null,
  20615. vue.renderList($setup.statusItems, (item, index) => {
  20616. return vue.openBlock(), vue.createElementBlock("view", {
  20617. class: "scroll-item",
  20618. key: item.id,
  20619. onClick: ($event) => $setup.changeMenu(index)
  20620. }, [
  20621. vue.createElementVNode(
  20622. "text",
  20623. {
  20624. class: vue.normalizeClass(["item-text", $setup.activeIndex == index ? "active" : ""])
  20625. },
  20626. vue.toDisplayString(item.title),
  20627. 3
  20628. /* TEXT, CLASS */
  20629. )
  20630. ], 8, ["onClick"]);
  20631. }),
  20632. 128
  20633. /* KEYED_FRAGMENT */
  20634. ))
  20635. ])
  20636. ], 8, ["scroll-left"])
  20637. ]),
  20638. vue.createCommentVNode(" 列表 "),
  20639. vue.createElementVNode(
  20640. "scroll-view",
  20641. {
  20642. "enable-back-to-top": "",
  20643. "scroll-y": "",
  20644. class: "scroll-view",
  20645. onScrolltolower: $setup.onScrolltolower
  20646. },
  20647. [
  20648. vue.createElementVNode("view", { class: "orders" }, [
  20649. (vue.openBlock(true), vue.createElementBlock(
  20650. vue.Fragment,
  20651. null,
  20652. vue.renderList($setup.waybillDelivery, (item, i2) => {
  20653. var _a, _b, _c, _d, _e2, _f;
  20654. return vue.openBlock(), vue.createElementBlock("navigator", {
  20655. "hover-class": "none",
  20656. class: "navigator",
  20657. key: i2,
  20658. url: `/pages/pickup/waybillPickUpDetails?id=${item.id}`
  20659. }, [
  20660. vue.createElementVNode("view", { class: "order_no_state" }, [
  20661. vue.createElementVNode("view", { class: "order_no" }, [
  20662. vue.createElementVNode("text", { class: "title" }, "订单号"),
  20663. vue.createElementVNode(
  20664. "text",
  20665. { class: "content" },
  20666. vue.toDisplayString(item.order_no),
  20667. 1
  20668. /* TEXT */
  20669. )
  20670. ]),
  20671. vue.createElementVNode("view", { class: "order_state" }, [
  20672. vue.createElementVNode(
  20673. "text",
  20674. {
  20675. class: vue.normalizeClass(`state-${item.status}`)
  20676. },
  20677. vue.toDisplayString(item.status_text),
  20678. 3
  20679. /* TEXT, CLASS */
  20680. )
  20681. ])
  20682. ]),
  20683. vue.createElementVNode("view", { class: "pick_up_date" }, [
  20684. vue.createElementVNode(
  20685. "text",
  20686. null,
  20687. vue.toDisplayString(item.pick_up_date),
  20688. 1
  20689. /* TEXT */
  20690. )
  20691. ]),
  20692. vue.createElementVNode("view", { class: "segmentation-line" }),
  20693. vue.createElementVNode("view", { class: "address" }, [
  20694. vue.createElementVNode("view", { class: "user-info" }, [
  20695. vue.createElementVNode(
  20696. "text",
  20697. { class: "user" },
  20698. vue.toDisplayString(((_a = item.address) == null ? void 0 : _a.first_name) + " " + ((_b = item.address) == null ? void 0 : _b.last_name)),
  20699. 1
  20700. /* TEXT */
  20701. ),
  20702. vue.createElementVNode(
  20703. "text",
  20704. { class: "mobile" },
  20705. "+" + vue.toDisplayString(((_c = item.address) == null ? void 0 : _c.mobile_code) + " " + ((_d = item.address) == null ? void 0 : _d.mobile)),
  20706. 1
  20707. /* TEXT */
  20708. )
  20709. ]),
  20710. vue.createElementVNode("view", { class: "address-info" }, [
  20711. vue.createElementVNode(
  20712. "text",
  20713. null,
  20714. vue.toDisplayString((_e2 = item.address) == null ? void 0 : _e2.city),
  20715. 1
  20716. /* TEXT */
  20717. ),
  20718. vue.createElementVNode(
  20719. "text",
  20720. null,
  20721. vue.toDisplayString((_f = item.address) == null ? void 0 : _f.zip_code),
  20722. 1
  20723. /* TEXT */
  20724. )
  20725. ])
  20726. ]),
  20727. vue.createElementVNode("view", null, [
  20728. (vue.openBlock(true), vue.createElementBlock(
  20729. vue.Fragment,
  20730. null,
  20731. vue.renderList(item.goods, (good) => {
  20732. return vue.openBlock(), vue.createElementBlock("view", {
  20733. key: good.id,
  20734. class: "goods"
  20735. }, [
  20736. vue.createElementVNode("text", { class: "item" }, [
  20737. vue.createTextVNode(
  20738. vue.toDisplayString(good.name) + " ",
  20739. 1
  20740. /* TEXT */
  20741. ),
  20742. vue.createElementVNode(
  20743. "text",
  20744. { class: "qty" },
  20745. " x" + vue.toDisplayString(good.qty),
  20746. 1
  20747. /* TEXT */
  20748. )
  20749. ])
  20750. ]);
  20751. }),
  20752. 128
  20753. /* KEYED_FRAGMENT */
  20754. ))
  20755. ])
  20756. ], 8, ["url"]);
  20757. }),
  20758. 128
  20759. /* KEYED_FRAGMENT */
  20760. ))
  20761. ]),
  20762. vue.createElementVNode(
  20763. "view",
  20764. { class: "loading-text" },
  20765. vue.toDisplayString($setup.total === $setup.waybillDelivery.length ? "没有更多数据了~" : "正在加载..."),
  20766. 1
  20767. /* TEXT */
  20768. )
  20769. ],
  20770. 32
  20771. /* NEED_HYDRATION */
  20772. ),
  20773. vue.createVNode(
  20774. _component_uni_popup,
  20775. {
  20776. ref: "messageRef",
  20777. type: "message"
  20778. },
  20779. {
  20780. default: vue.withCtx(() => [
  20781. vue.createVNode(_component_uni_popup_message, {
  20782. type: $setup.messageType,
  20783. message: $setup.messageText,
  20784. duration: 2e3
  20785. }, null, 8, ["type", "message"])
  20786. ]),
  20787. _: 1
  20788. /* STABLE */
  20789. },
  20790. 512
  20791. /* NEED_PATCH */
  20792. )
  20793. ]);
  20794. }
  20795. const PagesPickupWaybillPickUpOrder = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f], ["__scopeId", "data-v-cb3c2bb0"], ["__file", "E:/demo/hmrabbit/src/pages/pickup/waybillPickUpOrder.vue"]]);
  20796. const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
  20797. __name: "waybillPickUpDetails",
  20798. props: {
  20799. id: { type: String, required: true }
  20800. },
  20801. setup(__props, { expose: __expose }) {
  20802. __expose();
  20803. const { safeAreaInsets } = uni.getSystemInfoSync();
  20804. const query = __props;
  20805. const messageRef = vue.ref();
  20806. const message = vue.ref({
  20807. type: "success",
  20808. text: ""
  20809. });
  20810. const details = vue.ref();
  20811. const getOrderByIdData = async () => {
  20812. const res = await getPickUpById(query.id);
  20813. details.value = res.data.details;
  20814. };
  20815. onShow(() => {
  20816. getOrderByIdData();
  20817. });
  20818. const onTapImage = (url) => {
  20819. uni.previewImage({
  20820. current: url,
  20821. urls: goods.value.mainPictures
  20822. });
  20823. };
  20824. const onButtonClick = async (id, value) => {
  20825. switch (value) {
  20826. case "start_off":
  20827. startOff({ id }).then((res) => {
  20828. getOrderByIdData();
  20829. message.value.text = "发出成功";
  20830. message.value.type = "success";
  20831. messageRef.value.open();
  20832. }).catch(() => {
  20833. message.value.text = "发出失败,请稍后重试";
  20834. message.value.type = "error";
  20835. messageRef.value.open();
  20836. });
  20837. break;
  20838. case "collect":
  20839. collect({ id }).then((res) => {
  20840. getOrderByIdData();
  20841. message.value.text = "揽收成功";
  20842. message.value.type = "success";
  20843. messageRef.value.open();
  20844. }).catch(() => {
  20845. message.value.text = "揽收失败,请稍后重试";
  20846. message.value.type = "error";
  20847. messageRef.value.open();
  20848. });
  20849. break;
  20850. case "arrive":
  20851. pickupDelivered({ id }).then((res) => {
  20852. getOrderByIdData();
  20853. message.value.text = "修改成功";
  20854. message.value.type = "success";
  20855. messageRef.value.open();
  20856. }).catch(() => {
  20857. message.value.text = "修改失败,请稍后重试";
  20858. message.value.type = "error";
  20859. messageRef.value.open();
  20860. });
  20861. break;
  20862. case "delivery_to_the_courier_point":
  20863. deliveryToTheCourierPoint({ id, courier_point: "", images: [""] }).then((res) => {
  20864. getOrderByIdData();
  20865. message.value.text = "修改成功";
  20866. message.value.type = "success";
  20867. messageRef.value.open();
  20868. }).catch(() => {
  20869. message.value.text = "修改失败,请稍后重试";
  20870. message.value.type = "error";
  20871. messageRef.value.open();
  20872. });
  20873. break;
  20874. }
  20875. };
  20876. const contactClient = () => {
  20877. uni.makePhoneCall({
  20878. phoneNumber: "13200000000"
  20879. });
  20880. };
  20881. const __returned__ = { safeAreaInsets, query, messageRef, message, details, getOrderByIdData, onTapImage, onButtonClick, contactClient };
  20882. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  20883. return __returned__;
  20884. }
  20885. });
  20886. function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
  20887. var _a;
  20888. const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_0$8);
  20889. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_1$1);
  20890. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  20891. return vue.openBlock(), vue.createElementBlock(
  20892. vue.Fragment,
  20893. null,
  20894. [
  20895. vue.createElementVNode("scroll-view", {
  20896. "enable-back-to-top": "",
  20897. "scroll-y": "",
  20898. class: "viewport"
  20899. }, [
  20900. vue.createElementVNode("view", { class: "detail panel" }, [
  20901. vue.createElementVNode("view", { class: "title" }, [
  20902. vue.createElementVNode("text", null, "运单列表")
  20903. ]),
  20904. vue.createElementVNode("view", { class: "content" }, [
  20905. vue.createElementVNode("view", { class: "properties" }, [
  20906. (vue.openBlock(true), vue.createElementBlock(
  20907. vue.Fragment,
  20908. null,
  20909. vue.renderList($setup.details, (item) => {
  20910. return vue.openBlock(), vue.createElementBlock("view", {
  20911. key: item.id,
  20912. class: "item"
  20913. }, [
  20914. vue.createElementVNode("navigator", {
  20915. url: `/pages/pickup/waybillPickUpDetail?waybill_no=${item.waybill_no}`
  20916. }, [
  20917. vue.createElementVNode("view", { class: "order_no_state" }, [
  20918. vue.createElementVNode("view", null, [
  20919. vue.createElementVNode(
  20920. "text",
  20921. null,
  20922. vue.toDisplayString(item.waybill_no),
  20923. 1
  20924. /* TEXT */
  20925. )
  20926. ]),
  20927. vue.createElementVNode("view", { class: "order_state" }, [
  20928. vue.createElementVNode(
  20929. "text",
  20930. {
  20931. class: vue.normalizeClass("state-" + item.status)
  20932. },
  20933. vue.toDisplayString(item.status_text),
  20934. 3
  20935. /* TEXT, CLASS */
  20936. )
  20937. ])
  20938. ])
  20939. ], 8, ["url"]),
  20940. vue.createElementVNode("view", { class: "info" }, [
  20941. vue.createElementVNode("view", null, [
  20942. vue.createTextVNode(" 预估重量: "),
  20943. vue.createElementVNode(
  20944. "text",
  20945. null,
  20946. vue.toDisplayString(item.estimated_weight) + "KG",
  20947. 1
  20948. /* TEXT */
  20949. )
  20950. ]),
  20951. vue.createElementVNode("view", null, [
  20952. vue.createTextVNode(" Ups 取件码: "),
  20953. vue.createElementVNode(
  20954. "text",
  20955. null,
  20956. vue.toDisplayString(item.ups_prn || "无"),
  20957. 1
  20958. /* TEXT */
  20959. )
  20960. ]),
  20961. vue.createElementVNode("view", null, [
  20962. vue.createTextVNode(" Ups 准备时间: "),
  20963. vue.createElementVNode(
  20964. "text",
  20965. null,
  20966. vue.toDisplayString(item.ups_ready_time || "无"),
  20967. 1
  20968. /* TEXT */
  20969. )
  20970. ]),
  20971. vue.createElementVNode("view", null, [
  20972. vue.createTextVNode(" Ups 截止时间: "),
  20973. vue.createElementVNode(
  20974. "text",
  20975. null,
  20976. vue.toDisplayString(item.ups_close_time || "无"),
  20977. 1
  20978. /* TEXT */
  20979. )
  20980. ]),
  20981. vue.createElementVNode("view", { class: "label-info" }, [
  20982. vue.createElementVNode("text", null, "面单"),
  20983. item.labels.length === 0 ? (vue.openBlock(), vue.createElementBlock("text", {
  20984. key: 0,
  20985. class: "empty"
  20986. }, "暂未生成")) : (vue.openBlock(), vue.createElementBlock("text", { key: 1 }, [
  20987. vue.createTextVNode(
  20988. "(" + vue.toDisplayString(item.labels.length) + ") ",
  20989. 1
  20990. /* TEXT */
  20991. ),
  20992. vue.createVNode(_component_uni_icons, {
  20993. type: "search",
  20994. size: "16",
  20995. color: "#007bff"
  20996. })
  20997. ]))
  20998. ])
  20999. ]),
  21000. vue.createCommentVNode(" 操作按钮 "),
  21001. vue.createElementVNode("view", { class: "operations" }, [
  21002. (vue.openBlock(true), vue.createElementBlock(
  21003. vue.Fragment,
  21004. null,
  21005. vue.renderList(item.operations, (operation) => {
  21006. return vue.openBlock(), vue.createElementBlock("view", {
  21007. key: operation.value
  21008. }, [
  21009. vue.createElementVNode("button", {
  21010. class: "mini-btn",
  21011. type: "primary",
  21012. size: "mini",
  21013. onClick: ($event) => $setup.onButtonClick(item.id, operation.value)
  21014. }, vue.toDisplayString(operation.text), 9, ["onClick"])
  21015. ]);
  21016. }),
  21017. 128
  21018. /* KEYED_FRAGMENT */
  21019. ))
  21020. ]),
  21021. vue.createElementVNode("view", { class: "title label" }, [
  21022. vue.createElementVNode("text", null, [
  21023. vue.createTextVNode("物品清单 "),
  21024. !item.goods.length ? (vue.openBlock(), vue.createElementBlock("text", {
  21025. key: 0,
  21026. class: "bln"
  21027. }, "无")) : vue.createCommentVNode("v-if", true)
  21028. ])
  21029. ]),
  21030. (vue.openBlock(true), vue.createElementBlock(
  21031. vue.Fragment,
  21032. null,
  21033. vue.renderList(item.goods, (good, g2) => {
  21034. return vue.openBlock(), vue.createElementBlock("view", {
  21035. key: g2,
  21036. class: "goods"
  21037. }, [
  21038. vue.createElementVNode("view", null, [
  21039. vue.createTextVNode("类型: "),
  21040. vue.createElementVNode(
  21041. "text",
  21042. null,
  21043. vue.toDisplayString(good.category_name),
  21044. 1
  21045. /* TEXT */
  21046. )
  21047. ]),
  21048. vue.createElementVNode("view", null, [
  21049. vue.createTextVNode("名称: "),
  21050. vue.createElementVNode(
  21051. "text",
  21052. null,
  21053. vue.toDisplayString(good.goods_name),
  21054. 1
  21055. /* TEXT */
  21056. ),
  21057. vue.createElementVNode(
  21058. "text",
  21059. { style: { "color": "#666666", "font-size": "22rpx" } },
  21060. vue.toDisplayString(" x" + good.qty),
  21061. 1
  21062. /* TEXT */
  21063. )
  21064. ]),
  21065. vue.createElementVNode("view", null, [
  21066. vue.createTextVNode("价格: "),
  21067. vue.createElementVNode(
  21068. "text",
  21069. null,
  21070. "£" + vue.toDisplayString(good.price),
  21071. 1
  21072. /* TEXT */
  21073. )
  21074. ]),
  21075. vue.createElementVNode("view", null, [
  21076. vue.createTextVNode("合计: "),
  21077. vue.createElementVNode(
  21078. "text",
  21079. null,
  21080. "£" + vue.toDisplayString(good.amount),
  21081. 1
  21082. /* TEXT */
  21083. )
  21084. ]),
  21085. vue.createCommentVNode(' <image\r\n class="image"\r\n v-for="item in good.images"\r\n :key="item"\r\n mode="widthFix"\r\n :src="item"\r\n ></image> ')
  21086. ]);
  21087. }),
  21088. 128
  21089. /* KEYED_FRAGMENT */
  21090. ))
  21091. ]);
  21092. }),
  21093. 128
  21094. /* KEYED_FRAGMENT */
  21095. ))
  21096. ]),
  21097. vue.createCommentVNode(" 图片详情 ")
  21098. ]),
  21099. vue.createVNode(
  21100. _component_uni_popup,
  21101. {
  21102. ref: "messageRef",
  21103. type: "message"
  21104. },
  21105. {
  21106. default: vue.withCtx(() => [
  21107. vue.createVNode(_component_uni_popup_message, {
  21108. type: $setup.message.type,
  21109. message: $setup.message.text,
  21110. duration: 2e3
  21111. }, null, 8, ["type", "message"])
  21112. ]),
  21113. _: 1
  21114. /* STABLE */
  21115. },
  21116. 512
  21117. /* NEED_PATCH */
  21118. )
  21119. ])
  21120. ]),
  21121. vue.createCommentVNode(" 用户操作 "),
  21122. $setup.details ? (vue.openBlock(), vue.createElementBlock(
  21123. "view",
  21124. {
  21125. key: 0,
  21126. class: "contact-client",
  21127. style: vue.normalizeStyle({ paddingBottom: ((_a = $setup.safeAreaInsets) == null ? void 0 : _a.bottom) + "px" })
  21128. },
  21129. [
  21130. vue.createElementVNode("view", { class: "buttons" }, [
  21131. vue.createElementVNode("view", {
  21132. onClick: $setup.contactClient,
  21133. class: "payment"
  21134. }, " 联系客户 ")
  21135. ])
  21136. ],
  21137. 4
  21138. /* STYLE */
  21139. )) : vue.createCommentVNode("v-if", true)
  21140. ],
  21141. 64
  21142. /* STABLE_FRAGMENT */
  21143. );
  21144. }
  21145. const PagesPickupWaybillPickUpDetails = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e], ["__file", "E:/demo/hmrabbit/src/pages/pickup/waybillPickUpDetails.vue"]]);
  21146. const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
  21147. __name: "waybillPickUpDetail",
  21148. props: {
  21149. waybill_no: { type: String, required: true }
  21150. },
  21151. setup(__props, { expose: __expose }) {
  21152. __expose();
  21153. const { safeAreaInsets } = uni.getSystemInfoSync();
  21154. const query = __props;
  21155. const detail = vue.ref();
  21156. const getOrderByIdData = async () => {
  21157. const res = await getPickUpByWaybillNo(query.waybill_no);
  21158. detail.value = res.data;
  21159. };
  21160. onLoad(() => {
  21161. getOrderByIdData();
  21162. });
  21163. const onTapImage = (url) => {
  21164. uni.previewImage({
  21165. current: url,
  21166. urls: goods.value.mainPictures
  21167. });
  21168. };
  21169. const contactClient = () => {
  21170. uni.makePhoneCall({
  21171. phoneNumber: "13200000000"
  21172. });
  21173. };
  21174. const __returned__ = { safeAreaInsets, query, detail, getOrderByIdData, onTapImage, contactClient };
  21175. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  21176. return __returned__;
  21177. }
  21178. });
  21179. function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
  21180. var _a;
  21181. return vue.openBlock(), vue.createElementBlock(
  21182. vue.Fragment,
  21183. null,
  21184. [
  21185. vue.createElementVNode("scroll-view", {
  21186. "enable-back-to-top": "",
  21187. "scroll-y": "",
  21188. class: "viewport"
  21189. }, [
  21190. vue.createElementVNode("view", { class: "detail panel" }, [
  21191. vue.createElementVNode("view", { class: "content" }, [
  21192. vue.createElementVNode("view", { class: "properties" }, [
  21193. $setup.detail ? (vue.openBlock(), vue.createElementBlock("view", {
  21194. key: 0,
  21195. class: "item"
  21196. }, [
  21197. vue.createElementVNode("view", { class: "order_no_state" }, [
  21198. vue.createElementVNode("view", null, [
  21199. vue.createElementVNode(
  21200. "text",
  21201. null,
  21202. vue.toDisplayString($setup.detail.waybill_no),
  21203. 1
  21204. /* TEXT */
  21205. )
  21206. ]),
  21207. vue.createElementVNode("view", { class: "order_state" }, [
  21208. vue.createElementVNode(
  21209. "text",
  21210. {
  21211. class: vue.normalizeClass("state-" + $setup.detail.status)
  21212. },
  21213. vue.toDisplayString($setup.detail.status_text),
  21214. 3
  21215. /* TEXT, CLASS */
  21216. )
  21217. ])
  21218. ]),
  21219. vue.createElementVNode("view", { class: "info" }, [
  21220. vue.createElementVNode("view", null, [
  21221. vue.createTextVNode(" 预估重量: "),
  21222. vue.createElementVNode(
  21223. "text",
  21224. null,
  21225. vue.toDisplayString($setup.detail.estimated_weight) + "KG",
  21226. 1
  21227. /* TEXT */
  21228. )
  21229. ]),
  21230. vue.createElementVNode("view", null, [
  21231. vue.createTextVNode(" Ups 取件码: "),
  21232. vue.createElementVNode(
  21233. "text",
  21234. null,
  21235. vue.toDisplayString($setup.detail.ups_prn || "无"),
  21236. 1
  21237. /* TEXT */
  21238. )
  21239. ]),
  21240. vue.createElementVNode("view", null, [
  21241. vue.createTextVNode(" Ups 准备时间: "),
  21242. vue.createElementVNode(
  21243. "text",
  21244. null,
  21245. vue.toDisplayString($setup.detail.ups_ready_time || "无"),
  21246. 1
  21247. /* TEXT */
  21248. )
  21249. ]),
  21250. vue.createElementVNode("view", null, [
  21251. vue.createTextVNode(" Ups 截止时间: "),
  21252. vue.createElementVNode(
  21253. "text",
  21254. null,
  21255. vue.toDisplayString($setup.detail.ups_close_time || "无"),
  21256. 1
  21257. /* TEXT */
  21258. )
  21259. ]),
  21260. vue.createElementVNode("view", null, " 面单 ")
  21261. ]),
  21262. vue.createElementVNode("view", { class: "title label" }, [
  21263. vue.createElementVNode("text", null, [
  21264. vue.createTextVNode("物品清单 "),
  21265. !$setup.detail.goods.length ? (vue.openBlock(), vue.createElementBlock("text", {
  21266. key: 0,
  21267. class: "bln"
  21268. }, "无")) : vue.createCommentVNode("v-if", true)
  21269. ])
  21270. ]),
  21271. (vue.openBlock(true), vue.createElementBlock(
  21272. vue.Fragment,
  21273. null,
  21274. vue.renderList($setup.detail.goods, (good, g2) => {
  21275. return vue.openBlock(), vue.createElementBlock("view", {
  21276. key: g2,
  21277. class: "goods"
  21278. }, [
  21279. vue.createElementVNode("view", null, [
  21280. vue.createTextVNode("类型: "),
  21281. vue.createElementVNode(
  21282. "text",
  21283. null,
  21284. vue.toDisplayString(good.category_name),
  21285. 1
  21286. /* TEXT */
  21287. )
  21288. ]),
  21289. vue.createElementVNode("view", null, [
  21290. vue.createTextVNode("名称: "),
  21291. vue.createElementVNode(
  21292. "text",
  21293. null,
  21294. vue.toDisplayString(good.goods_name),
  21295. 1
  21296. /* TEXT */
  21297. ),
  21298. vue.createElementVNode(
  21299. "text",
  21300. { style: { "color": "#666666", "font-size": "22rpx" } },
  21301. vue.toDisplayString(" x" + good.qty),
  21302. 1
  21303. /* TEXT */
  21304. )
  21305. ]),
  21306. vue.createElementVNode("view", null, [
  21307. vue.createTextVNode("价格: "),
  21308. vue.createElementVNode(
  21309. "text",
  21310. null,
  21311. "£" + vue.toDisplayString(good.price),
  21312. 1
  21313. /* TEXT */
  21314. )
  21315. ]),
  21316. vue.createElementVNode("view", null, [
  21317. vue.createTextVNode("合计: "),
  21318. vue.createElementVNode(
  21319. "text",
  21320. null,
  21321. "£" + vue.toDisplayString(good.amount),
  21322. 1
  21323. /* TEXT */
  21324. )
  21325. ]),
  21326. vue.createCommentVNode(' <image\r\n class="image"\r\n v-for="item in good.images"\r\n :key="item"\r\n mode="widthFix"\r\n :src="item"\r\n ></image> ')
  21327. ]);
  21328. }),
  21329. 128
  21330. /* KEYED_FRAGMENT */
  21331. ))
  21332. ])) : vue.createCommentVNode("v-if", true)
  21333. ]),
  21334. vue.createCommentVNode(" 图片详情 ")
  21335. ])
  21336. ])
  21337. ]),
  21338. vue.createCommentVNode(" 用户操作 "),
  21339. _ctx.details ? (vue.openBlock(), vue.createElementBlock(
  21340. "view",
  21341. {
  21342. key: 0,
  21343. class: "contact-client",
  21344. style: vue.normalizeStyle({ paddingBottom: ((_a = $setup.safeAreaInsets) == null ? void 0 : _a.bottom) + "px" })
  21345. },
  21346. [
  21347. vue.createElementVNode("view", { class: "buttons" }, [
  21348. vue.createElementVNode("view", {
  21349. onClick: $setup.contactClient,
  21350. class: "payment"
  21351. }, " 联系客户 ")
  21352. ])
  21353. ],
  21354. 4
  21355. /* STYLE */
  21356. )) : vue.createCommentVNode("v-if", true)
  21357. ],
  21358. 64
  21359. /* STABLE_FRAGMENT */
  21360. );
  21361. }
  21362. const PagesPickupWaybillPickUpDetail = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d], ["__file", "E:/demo/hmrabbit/src/pages/pickup/waybillPickUpDetail.vue"]]);
  21363. const _sfc_main$d = {
  21364. name: "UniDrawer",
  21365. components: {},
  21366. emits: ["change"],
  21367. props: {
  21368. /**
  21369. * 显示模式(左、右),只在初始化生效
  21370. */
  21371. mode: {
  21372. type: String,
  21373. default: ""
  21374. },
  21375. /**
  21376. * 蒙层显示状态
  21377. */
  21378. mask: {
  21379. type: Boolean,
  21380. default: true
  21381. },
  21382. /**
  21383. * 遮罩是否可点击关闭
  21384. */
  21385. maskClick: {
  21386. type: Boolean,
  21387. default: true
  21388. },
  21389. /**
  21390. * 抽屉宽度
  21391. */
  21392. width: {
  21393. type: Number,
  21394. default: 220
  21395. }
  21396. },
  21397. data() {
  21398. return {
  21399. visibleSync: false,
  21400. showDrawer: false,
  21401. rightMode: false,
  21402. watchTimer: null,
  21403. drawerWidth: 220
  21404. };
  21405. },
  21406. created() {
  21407. this.drawerWidth = this.width;
  21408. this.rightMode = this.mode === "right";
  21409. },
  21410. methods: {
  21411. clear() {
  21412. },
  21413. close(type) {
  21414. if (type === "mask" && !this.maskClick || !this.visibleSync)
  21415. return;
  21416. this._change("showDrawer", "visibleSync", false);
  21417. },
  21418. open() {
  21419. if (this.visibleSync)
  21420. return;
  21421. this._change("visibleSync", "showDrawer", true);
  21422. },
  21423. _change(param1, param2, status) {
  21424. this[param1] = status;
  21425. if (this.watchTimer) {
  21426. clearTimeout(this.watchTimer);
  21427. }
  21428. this.watchTimer = setTimeout(() => {
  21429. this[param2] = status;
  21430. this.$emit("change", status);
  21431. }, status ? 50 : 300);
  21432. }
  21433. }
  21434. };
  21435. function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
  21436. return $data.visibleSync ? (vue.openBlock(), vue.createElementBlock(
  21437. "view",
  21438. {
  21439. key: 0,
  21440. class: vue.normalizeClass([{ "uni-drawer--visible": $data.showDrawer }, "uni-drawer"]),
  21441. onTouchmove: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.clear && $options.clear(...args), ["stop", "prevent"]))
  21442. },
  21443. [
  21444. vue.createElementVNode(
  21445. "view",
  21446. {
  21447. class: vue.normalizeClass(["uni-drawer__mask", { "uni-drawer__mask--visible": $data.showDrawer && $props.mask }]),
  21448. onClick: _cache[0] || (_cache[0] = ($event) => $options.close("mask"))
  21449. },
  21450. null,
  21451. 2
  21452. /* CLASS */
  21453. ),
  21454. vue.createElementVNode(
  21455. "view",
  21456. {
  21457. class: vue.normalizeClass(["uni-drawer__content", { "uni-drawer--right": $data.rightMode, "uni-drawer--left": !$data.rightMode, "uni-drawer__content--visible": $data.showDrawer }]),
  21458. style: vue.normalizeStyle({ width: $data.drawerWidth + "px" })
  21459. },
  21460. [
  21461. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  21462. ],
  21463. 6
  21464. /* CLASS, STYLE */
  21465. )
  21466. ],
  21467. 34
  21468. /* CLASS, NEED_HYDRATION */
  21469. )) : vue.createCommentVNode("v-if", true);
  21470. }
  21471. const __easycom_3 = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c], ["__scopeId", "data-v-183a7e94"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-drawer/uni-drawer.vue"]]);
  21472. const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
  21473. __name: "waybillDeliveryOrder",
  21474. setup(__props, { expose: __expose }) {
  21475. __expose();
  21476. let pickupWaybillDeliveryOrderURL = "";
  21477. let sendOutURL = "";
  21478. let deliveredURL = "";
  21479. let refuseURL = "";
  21480. let createTrackPodURL = "";
  21481. let cancelFedExPickUpURL = "";
  21482. const loading = vue.ref(false);
  21483. const loadingBtn = vue.ref(false);
  21484. const token = vue.ref();
  21485. const searchValue = vue.ref();
  21486. const waybillDelivery = vue.ref([]);
  21487. const messageType = vue.ref();
  21488. const messageText = vue.ref();
  21489. const messageRef = vue.ref();
  21490. const showRightRef = vue.ref();
  21491. const resetForm = () => {
  21492. };
  21493. const confirmForm = () => {
  21494. showRightRef.value.close();
  21495. };
  21496. const copyOrderNo = (order_no) => {
  21497. uni.setClipboardData({
  21498. data: order_no,
  21499. success: function() {
  21500. uni.showToast({
  21501. title: "复制成功",
  21502. icon: "success",
  21503. duration: 2e3
  21504. });
  21505. },
  21506. fail: function() {
  21507. formatAppLog("log", "at pages/waybillDeliveryOrder/waybillDeliveryOrder.vue:121", "复制失败");
  21508. }
  21509. });
  21510. };
  21511. const callPhone = (phoneNumber) => {
  21512. formatAppLog("log", "at pages/waybillDeliveryOrder/waybillDeliveryOrder.vue:127", phoneNumber);
  21513. uni.makePhoneCall({
  21514. phoneNumber,
  21515. success: function() {
  21516. formatAppLog("log", "at pages/waybillDeliveryOrder/waybillDeliveryOrder.vue:132", "拨打电话成功!");
  21517. },
  21518. fail: function() {
  21519. formatAppLog("log", "at pages/waybillDeliveryOrder/waybillDeliveryOrder.vue:135", "拨打电话失败!");
  21520. }
  21521. });
  21522. };
  21523. const scanInput = async () => {
  21524. let status = await checkPermission();
  21525. if (status !== 1) {
  21526. return;
  21527. }
  21528. uni.scanCode({
  21529. success: (res) => {
  21530. },
  21531. fail: (err) => {
  21532. }
  21533. });
  21534. };
  21535. const itemClick = (item) => {
  21536. uni.setStorageSync("selectItem", item);
  21537. uni.navigateTo({
  21538. url: "/pages/waybillDeliveryOrder/orderInfo?id=" + item.id
  21539. });
  21540. };
  21541. const onButtonClick = async (row, value) => {
  21542. if (value === "send_out") {
  21543. sendOut({ id: row.id });
  21544. } else if (value === "delivered") {
  21545. updateDelivered({ id: row.id });
  21546. } else if (value === "refuse") {
  21547. updateRefuse({ id: row.id });
  21548. } else if (value === "create_track_pod") {
  21549. createTrackPod({ id: row.id });
  21550. } else if (value === "edit")
  21551. ;
  21552. else if (value === "generate_label")
  21553. ;
  21554. else if (value === "fedex_appointment_pick_up")
  21555. ;
  21556. else if (value === "print_get_back_label")
  21557. ;
  21558. else if (value === "fedex_cancel_pick_up") {
  21559. cancelFedExPickUp({ id: row.id });
  21560. }
  21561. };
  21562. const sendOut = (data) => {
  21563. loadingBtn.value = true;
  21564. uni.request({
  21565. url: sendOutURL,
  21566. method: "POST",
  21567. header: {
  21568. batoken: token.value
  21569. },
  21570. data,
  21571. success: ({ data: data2 }) => {
  21572. loadingBtn.value = false;
  21573. messageType.value = "success";
  21574. messageText.value = "发出成功";
  21575. messageRef.value.open();
  21576. },
  21577. fail: (err) => {
  21578. loadingBtn.value = false;
  21579. messageType.value = "error";
  21580. messageText.value = "发出失败,请稍后重试";
  21581. messageRef.value.open();
  21582. }
  21583. });
  21584. };
  21585. const updateDelivered = (data) => {
  21586. loadingBtn.value = true;
  21587. uni.request({
  21588. url: deliveredURL,
  21589. method: "POST",
  21590. header: {
  21591. batoken: token.value
  21592. },
  21593. data,
  21594. success: ({ data: data2 }) => {
  21595. loadingBtn.value = false;
  21596. messageType.value = "success";
  21597. messageText.value = "确认送达成功";
  21598. messageRef.value.open();
  21599. },
  21600. fail: (err) => {
  21601. loadingBtn.value = false;
  21602. messageType.value = "error";
  21603. messageText.value = "确认送达失败,请稍后重试";
  21604. messageRef.value.open();
  21605. }
  21606. });
  21607. };
  21608. const updateRefuse = (data) => {
  21609. loadingBtn.value = true;
  21610. uni.request({
  21611. url: refuseURL,
  21612. method: "POST",
  21613. header: {
  21614. batoken: token.value
  21615. },
  21616. data,
  21617. success: ({ data: data2 }) => {
  21618. loadingBtn.value = false;
  21619. messageType.value = "success";
  21620. messageText.value = "已拒绝签收";
  21621. messageRef.value.open();
  21622. },
  21623. fail: (err) => {
  21624. loadingBtn.value = false;
  21625. messageType.value = "error";
  21626. messageText.value = "修改失败,请稍后重试";
  21627. messageRef.value.open();
  21628. }
  21629. });
  21630. };
  21631. const createTrackPod = (data) => {
  21632. loadingBtn.value = true;
  21633. uni.request({
  21634. url: createTrackPodURL,
  21635. method: "POST",
  21636. header: {
  21637. batoken: token.value
  21638. },
  21639. data,
  21640. success: ({ data: data2 }) => {
  21641. loadingBtn.value = false;
  21642. messageType.value = "success";
  21643. messageText.value = "同步成功";
  21644. messageRef.value.open();
  21645. },
  21646. fail: (err) => {
  21647. loadingBtn.value = false;
  21648. messageType.value = "error";
  21649. messageText.value = "同步失败,请稍后重试";
  21650. messageRef.value.open();
  21651. }
  21652. });
  21653. };
  21654. const cancelFedExPickUp = (data) => {
  21655. loadingBtn.value = true;
  21656. uni.request({
  21657. url: cancelFedExPickUpURL,
  21658. method: "POST",
  21659. header: {
  21660. batoken: token.value
  21661. },
  21662. data,
  21663. success: ({ data: data2 }) => {
  21664. loadingBtn.value = false;
  21665. messageType.value = "success";
  21666. messageText.value = "操作成功";
  21667. messageRef.value.open();
  21668. },
  21669. fail: (err) => {
  21670. loadingBtn.value = false;
  21671. messageType.value = "error";
  21672. messageText.value = "操作失败,请稍后重试";
  21673. messageRef.value.open();
  21674. }
  21675. });
  21676. };
  21677. const getList = () => {
  21678. loading.value = true;
  21679. uni.request({
  21680. url: pickupWaybillDeliveryOrderURL + "/index",
  21681. method: "GET",
  21682. header: {
  21683. batoken: token.value
  21684. },
  21685. success: ({ data }) => {
  21686. loading.value = false;
  21687. formatAppLog("log", "at pages/waybillDeliveryOrder/waybillDeliveryOrder.vue:336", data);
  21688. if (data.code == 1) {
  21689. waybillDelivery.value = data.data.list;
  21690. } else {
  21691. messageType.value = "error";
  21692. messageText.value = data.msg;
  21693. messageRef.value.open();
  21694. }
  21695. },
  21696. fail: (err) => {
  21697. loading.value = false;
  21698. }
  21699. });
  21700. };
  21701. onLoad(() => {
  21702. token.value = uni.getStorageSync("token");
  21703. getList();
  21704. });
  21705. onNavigationBarButtonTap((event) => {
  21706. if (event.index === 0) {
  21707. showRightRef.value.open();
  21708. }
  21709. });
  21710. const __returned__ = { get pickupWaybillDeliveryOrderURL() {
  21711. return pickupWaybillDeliveryOrderURL;
  21712. }, set pickupWaybillDeliveryOrderURL(v2) {
  21713. pickupWaybillDeliveryOrderURL = v2;
  21714. }, get sendOutURL() {
  21715. return sendOutURL;
  21716. }, set sendOutURL(v2) {
  21717. sendOutURL = v2;
  21718. }, get deliveredURL() {
  21719. return deliveredURL;
  21720. }, set deliveredURL(v2) {
  21721. deliveredURL = v2;
  21722. }, get refuseURL() {
  21723. return refuseURL;
  21724. }, set refuseURL(v2) {
  21725. refuseURL = v2;
  21726. }, get createTrackPodURL() {
  21727. return createTrackPodURL;
  21728. }, set createTrackPodURL(v2) {
  21729. createTrackPodURL = v2;
  21730. }, get cancelFedExPickUpURL() {
  21731. return cancelFedExPickUpURL;
  21732. }, set cancelFedExPickUpURL(v2) {
  21733. cancelFedExPickUpURL = v2;
  21734. }, loading, loadingBtn, token, searchValue, waybillDelivery, messageType, messageText, messageRef, showRightRef, resetForm, confirmForm, copyOrderNo, callPhone, scanInput, itemClick, onButtonClick, sendOut, updateDelivered, updateRefuse, createTrackPod, cancelFedExPickUp, getList };
  21735. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  21736. return __returned__;
  21737. }
  21738. });
  21739. const _imports_0 = "/static/copy.png";
  21740. const _imports_1 = "/static/call.png";
  21741. function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
  21742. const _component_uni_easyinput = resolveEasycom(vue.resolveDynamicComponent("uni-easyinput"), __easycom_0$7);
  21743. const _component_uni_popup_message = resolveEasycom(vue.resolveDynamicComponent("uni-popup-message"), __easycom_1$1);
  21744. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  21745. const _component_uni_drawer = resolveEasycom(vue.resolveDynamicComponent("uni-drawer"), __easycom_3);
  21746. return vue.openBlock(), vue.createElementBlock("view", { class: "list" }, [
  21747. 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> '),
  21748. vue.createVNode(_component_uni_easyinput, {
  21749. modelValue: $setup.searchValue,
  21750. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.searchValue = $event),
  21751. placeholder: "请输入单号",
  21752. suffixIcon: "scan",
  21753. onIconClick: $setup.scanInput
  21754. }, null, 8, ["modelValue"]),
  21755. (vue.openBlock(true), vue.createElementBlock(
  21756. vue.Fragment,
  21757. null,
  21758. vue.renderList($setup.waybillDelivery, (item, i2) => {
  21759. return vue.openBlock(), vue.createElementBlock("view", {
  21760. class: "item",
  21761. key: i2,
  21762. onClick: ($event) => $setup.itemClick(item)
  21763. }, [
  21764. vue.createElementVNode("view", { class: "order-no" }, [
  21765. vue.createElementVNode(
  21766. "text",
  21767. null,
  21768. " 派送单号: " + vue.toDisplayString(item.order_no),
  21769. 1
  21770. /* TEXT */
  21771. ),
  21772. vue.createElementVNode("image", {
  21773. onClick: ($event) => $setup.copyOrderNo(item.order_no),
  21774. class: "icon",
  21775. src: _imports_0,
  21776. mode: "aspectFill"
  21777. }, null, 8, ["onClick"])
  21778. ]),
  21779. vue.createElementVNode("view", { class: "address-info" }, [
  21780. vue.createElementVNode("view", { class: "info" }, [
  21781. vue.createElementVNode("view", { class: "user" }, [
  21782. vue.createElementVNode(
  21783. "text",
  21784. null,
  21785. vue.toDisplayString(item.address.first_name + " " + item.address.last_name) + " " + vue.toDisplayString("+" + item.address.mobile_code + " " + item.address.mobile),
  21786. 1
  21787. /* TEXT */
  21788. ),
  21789. vue.createElementVNode("image", {
  21790. onClick: ($event) => $setup.callPhone(item.address.mobile_code + " " + item.address.mobile),
  21791. class: "icon",
  21792. src: _imports_1,
  21793. mode: "aspectFill"
  21794. }, null, 8, ["onClick"])
  21795. ]),
  21796. vue.createElementVNode("view", null, [
  21797. vue.createElementVNode("text", { class: "address" }, [
  21798. vue.createElementVNode(
  21799. "text",
  21800. { class: "city" },
  21801. vue.toDisplayString(item.address.city),
  21802. 1
  21803. /* TEXT */
  21804. ),
  21805. vue.createTextVNode(
  21806. " " + vue.toDisplayString(item.address.zip_code),
  21807. 1
  21808. /* TEXT */
  21809. )
  21810. ]),
  21811. vue.createElementVNode("image", {
  21812. onClick: ($event) => $setup.copyOrderNo(item.address.zip_code),
  21813. class: "icon",
  21814. src: _imports_0,
  21815. mode: "aspectFill"
  21816. }, null, 8, ["onClick"])
  21817. ])
  21818. ]),
  21819. vue.createElementVNode("view", { class: "info" })
  21820. ]),
  21821. vue.createElementVNode("view"),
  21822. vue.createElementVNode("view", { class: "operations" }, [
  21823. (vue.openBlock(true), vue.createElementBlock(
  21824. vue.Fragment,
  21825. null,
  21826. vue.renderList(item.operations, (operation, i22) => {
  21827. return vue.openBlock(), vue.createElementBlock("button", {
  21828. key: i22,
  21829. onClick: ($event) => $setup.onButtonClick(item, operation.value),
  21830. type: "info",
  21831. size: "mini"
  21832. }, vue.toDisplayString(operation.text), 9, ["onClick"]);
  21833. }),
  21834. 128
  21835. /* KEYED_FRAGMENT */
  21836. ))
  21837. ])
  21838. ], 8, ["onClick"]);
  21839. }),
  21840. 128
  21841. /* KEYED_FRAGMENT */
  21842. )),
  21843. $setup.waybillDelivery.length === 0 ? (vue.openBlock(), vue.createElementBlock("view", {
  21844. key: 0,
  21845. class: "is-empty"
  21846. }, "暂无派送单")) : vue.createCommentVNode("v-if", true),
  21847. vue.createVNode(
  21848. _component_uni_popup,
  21849. {
  21850. ref: "messageRef",
  21851. type: "message"
  21852. },
  21853. {
  21854. default: vue.withCtx(() => [
  21855. vue.createVNode(_component_uni_popup_message, {
  21856. type: $setup.messageType,
  21857. message: $setup.messageText,
  21858. duration: 2e3
  21859. }, null, 8, ["type", "message"])
  21860. ]),
  21861. _: 1
  21862. /* STABLE */
  21863. },
  21864. 512
  21865. /* NEED_PATCH */
  21866. ),
  21867. vue.createVNode(
  21868. _component_uni_drawer,
  21869. {
  21870. ref: "showRightRef",
  21871. mode: "right",
  21872. "mask-click": true
  21873. },
  21874. {
  21875. default: vue.withCtx(() => [
  21876. vue.createElementVNode("scroll-view", {
  21877. style: { "height": "100%" },
  21878. "scroll-y": "true"
  21879. }, [
  21880. vue.createElementVNode("view", { class: "button-group" }, [
  21881. vue.createElementVNode("button", {
  21882. onClick: $setup.resetForm,
  21883. type: "info"
  21884. }, "重置"),
  21885. vue.createElementVNode("button", {
  21886. onClick: $setup.confirmForm,
  21887. type: "primary"
  21888. }, "确认")
  21889. ])
  21890. ])
  21891. ]),
  21892. _: 1
  21893. /* STABLE */
  21894. },
  21895. 512
  21896. /* NEED_PATCH */
  21897. )
  21898. ]);
  21899. }
  21900. const PagesWaybillDeliveryOrderWaybillDeliveryOrder = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b], ["__scopeId", "data-v-b53c540c"], ["__file", "E:/demo/hmrabbit/src/pages/waybillDeliveryOrder/waybillDeliveryOrder.vue"]]);
  21901. const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
  21902. __name: "settings",
  21903. setup(__props, { expose: __expose }) {
  21904. __expose();
  21905. const memberStore = useMemberStore();
  21906. const onLogout = () => {
  21907. uni.showModal({
  21908. content: "是否退出登录?",
  21909. confirmColor: "#27BA9B",
  21910. success: (res) => {
  21911. if (res.confirm) {
  21912. memberStore.clearProfile();
  21913. uni.navigateBack();
  21914. }
  21915. }
  21916. });
  21917. };
  21918. const __returned__ = { memberStore, onLogout };
  21919. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  21920. return __returned__;
  21921. }
  21922. });
  21923. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  21924. return vue.openBlock(), vue.createElementBlock("view", { class: "viewport" }, [
  21925. vue.createCommentVNode(" 列表1 "),
  21926. $setup.memberStore.profile ? (vue.openBlock(), vue.createElementBlock("view", {
  21927. key: 0,
  21928. class: "list"
  21929. }, [
  21930. vue.createElementVNode("navigator", {
  21931. url: "/pagesMember/address/address",
  21932. "hover-class": "none",
  21933. class: "item arrow"
  21934. }, " 我的收货地址 ")
  21935. ])) : vue.createCommentVNode("v-if", true),
  21936. vue.createCommentVNode(" 列表3 "),
  21937. vue.createElementVNode("view", { class: "list" }, [
  21938. vue.createElementVNode("button", {
  21939. "hover-class": "none",
  21940. class: "item arrow"
  21941. }, "关于英途仓库")
  21942. ]),
  21943. vue.createCommentVNode(" 操作按钮 "),
  21944. $setup.memberStore.profile ? (vue.openBlock(), vue.createElementBlock("view", {
  21945. key: 1,
  21946. class: "action"
  21947. }, [
  21948. vue.createElementVNode("view", {
  21949. onClick: $setup.onLogout,
  21950. class: "button"
  21951. }, "退出登录")
  21952. ])) : vue.createCommentVNode("v-if", true)
  21953. ]);
  21954. }
  21955. const PagesMemberSettingsSettings = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a], ["__file", "E:/demo/hmrabbit/src/pagesMember/settings/settings.vue"]]);
  21956. const getMemberProfileAPI = () => {
  21957. return http({
  21958. method: "GET",
  21959. url: "/member/profile"
  21960. });
  21961. };
  21962. const putMemberProfileAPI = (data) => {
  21963. return http({
  21964. method: "PUT",
  21965. url: "/member/profile",
  21966. data
  21967. });
  21968. };
  21969. const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
  21970. __name: "profile",
  21971. setup(__props, { expose: __expose }) {
  21972. __expose();
  21973. const { safeAreaInsets } = uni.getSystemInfoSync();
  21974. const profile = vue.ref({});
  21975. const getMemberProfileData = async () => {
  21976. const res = await getMemberProfileAPI();
  21977. profile.value = res.result;
  21978. memberStore.profile.avatar = res.result.avatar;
  21979. memberStore.profile.nickname = res.result.nickname;
  21980. };
  21981. onLoad(() => {
  21982. getMemberProfileData();
  21983. });
  21984. const memberStore = useMemberStore();
  21985. const onAvatarChange = () => {
  21986. uni.chooseImage({
  21987. count: 1,
  21988. success: (res) => {
  21989. const tempFilePaths = res.tempFilePaths;
  21990. uploadFile(tempFilePaths[0]);
  21991. }
  21992. });
  21993. };
  21994. const uploadFile = (file) => {
  21995. uni.uploadFile({
  21996. url: "/member/profile/avatar",
  21997. name: "file",
  21998. filePath: file,
  21999. success: (res) => {
  22000. if (res.statusCode === 200) {
  22001. const avatar = JSON.parse(res.data).result.avatar;
  22002. profile.value.avatar = avatar;
  22003. memberStore.profile.avatar = avatar;
  22004. uni.showToast({ icon: "success", title: "更新成功" });
  22005. } else {
  22006. uni.showToast({ icon: "error", title: "出现错误" });
  22007. }
  22008. }
  22009. });
  22010. };
  22011. const onGenderChange = (ev) => {
  22012. profile.value.gender = ev.detail.value;
  22013. };
  22014. const onBirthdayChange = (ev) => {
  22015. profile.value.birthday = ev.detail.value;
  22016. };
  22017. let fullLocationCode = ["", "", ""];
  22018. const onFullLocationChange = (ev) => {
  22019. profile.value.fullLocation = ev.detail.value.join(" ");
  22020. fullLocationCode = ev.detail.code;
  22021. };
  22022. const onSubmit = async () => {
  22023. const { nickname, gender, birthday } = profile.value;
  22024. const res = await putMemberProfileAPI({
  22025. nickname,
  22026. gender,
  22027. birthday,
  22028. provinceCode: fullLocationCode[0],
  22029. cityCode: fullLocationCode[1],
  22030. countyCode: fullLocationCode[2]
  22031. });
  22032. memberStore.profile.nickname = res.result.nickname;
  22033. uni.showToast({ icon: "success", title: "保存成功" });
  22034. setTimeout(() => {
  22035. uni.navigateBack();
  22036. }, 400);
  22037. };
  22038. const __returned__ = { safeAreaInsets, profile, getMemberProfileData, memberStore, onAvatarChange, uploadFile, onGenderChange, onBirthdayChange, get fullLocationCode() {
  22039. return fullLocationCode;
  22040. }, set fullLocationCode(v2) {
  22041. fullLocationCode = v2;
  22042. }, onFullLocationChange, onSubmit, get formatDate() {
  22043. return formatDate;
  22044. } };
  22045. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  22046. return __returned__;
  22047. }
  22048. });
  22049. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  22050. var _a, _b, _c, _d, _e2, _f, _g, _h, _i;
  22051. return vue.openBlock(), vue.createElementBlock("view", { class: "viewport" }, [
  22052. vue.createCommentVNode(" 导航栏 "),
  22053. vue.createElementVNode(
  22054. "view",
  22055. {
  22056. class: "navbar",
  22057. style: vue.normalizeStyle({ paddingTop: ((_a = $setup.safeAreaInsets) == null ? void 0 : _a.top) + "px" })
  22058. },
  22059. [
  22060. vue.createElementVNode("navigator", {
  22061. "open-type": "navigateBack",
  22062. class: "back icon-left",
  22063. "hover-class": "none"
  22064. }),
  22065. vue.createElementVNode("view", { class: "title" }, "个人信息")
  22066. ],
  22067. 4
  22068. /* STYLE */
  22069. ),
  22070. vue.createCommentVNode(" 头像 "),
  22071. vue.createElementVNode("view", { class: "avatar" }, [
  22072. vue.createElementVNode("view", {
  22073. onClick: $setup.onAvatarChange,
  22074. class: "avatar-content"
  22075. }, [
  22076. vue.createElementVNode("image", {
  22077. class: "image",
  22078. src: (_b = $setup.profile) == null ? void 0 : _b.avatar,
  22079. mode: "aspectFill"
  22080. }, null, 8, ["src"]),
  22081. vue.createElementVNode("text", { class: "text" }, "点击修改头像")
  22082. ])
  22083. ]),
  22084. vue.createCommentVNode(" 表单 "),
  22085. vue.createElementVNode("view", { class: "form" }, [
  22086. vue.createCommentVNode(" 表单内容 "),
  22087. vue.createElementVNode("view", { class: "form-content" }, [
  22088. vue.createElementVNode("view", { class: "form-item" }, [
  22089. vue.createElementVNode("text", { class: "label" }, "账号"),
  22090. vue.createElementVNode(
  22091. "text",
  22092. { class: "account placeholder" },
  22093. vue.toDisplayString((_c = $setup.profile) == null ? void 0 : _c.account),
  22094. 1
  22095. /* TEXT */
  22096. )
  22097. ]),
  22098. vue.createElementVNode("view", { class: "form-item" }, [
  22099. vue.createElementVNode("text", { class: "label" }, "昵称"),
  22100. vue.withDirectives(vue.createElementVNode(
  22101. "input",
  22102. {
  22103. class: "input",
  22104. type: "text",
  22105. placeholder: "请填写昵称",
  22106. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.profile.nickname = $event)
  22107. },
  22108. null,
  22109. 512
  22110. /* NEED_PATCH */
  22111. ), [
  22112. [vue.vModelText, $setup.profile.nickname]
  22113. ])
  22114. ]),
  22115. vue.createElementVNode("view", { class: "form-item" }, [
  22116. vue.createElementVNode("text", { class: "label" }, "性别"),
  22117. vue.createElementVNode(
  22118. "radio-group",
  22119. { onChange: $setup.onGenderChange },
  22120. [
  22121. vue.createElementVNode("label", { class: "radio" }, [
  22122. vue.createElementVNode("radio", {
  22123. value: "男",
  22124. color: "#27ba9b",
  22125. checked: ((_d = $setup.profile) == null ? void 0 : _d.gender) === "男"
  22126. }, null, 8, ["checked"]),
  22127. vue.createTextVNode(" 男 ")
  22128. ]),
  22129. vue.createElementVNode("label", { class: "radio" }, [
  22130. vue.createElementVNode("radio", {
  22131. value: "女",
  22132. color: "#27ba9b",
  22133. checked: ((_e2 = $setup.profile) == null ? void 0 : _e2.gender) === "女"
  22134. }, null, 8, ["checked"]),
  22135. vue.createTextVNode(" 女 ")
  22136. ])
  22137. ],
  22138. 32
  22139. /* NEED_HYDRATION */
  22140. )
  22141. ]),
  22142. vue.createElementVNode("view", { class: "form-item" }, [
  22143. vue.createElementVNode("text", { class: "label" }, "生日"),
  22144. vue.createElementVNode("picker", {
  22145. onChange: $setup.onBirthdayChange,
  22146. mode: "date",
  22147. class: "picker",
  22148. value: (_f = $setup.profile) == null ? void 0 : _f.birthday,
  22149. start: "1900-01-01",
  22150. end: $setup.formatDate(/* @__PURE__ */ new Date())
  22151. }, [
  22152. ((_g = $setup.profile) == null ? void 0 : _g.birthday) ? (vue.openBlock(), vue.createElementBlock(
  22153. "view",
  22154. { key: 0 },
  22155. vue.toDisplayString((_h = $setup.profile) == null ? void 0 : _h.birthday),
  22156. 1
  22157. /* TEXT */
  22158. )) : (vue.openBlock(), vue.createElementBlock("view", {
  22159. key: 1,
  22160. class: "placeholder"
  22161. }, "请选择日期"))
  22162. ], 40, ["value", "end"])
  22163. ]),
  22164. vue.createCommentVNode(" 只有微信小程序端内置了省市区数据 "),
  22165. vue.createElementVNode("view", { class: "form-item" }, [
  22166. vue.createElementVNode("text", { class: "label" }, "职业"),
  22167. vue.createElementVNode("input", {
  22168. class: "input",
  22169. type: "text",
  22170. placeholder: "请填写职业",
  22171. value: (_i = $setup.profile) == null ? void 0 : _i.profession
  22172. }, null, 8, ["value"])
  22173. ])
  22174. ]),
  22175. vue.createCommentVNode(" 提交按钮 "),
  22176. vue.createElementVNode("button", {
  22177. onClick: $setup.onSubmit,
  22178. class: "form-button"
  22179. }, "保 存")
  22180. ])
  22181. ]);
  22182. }
  22183. const PagesMemberProfileProfile = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__file", "E:/demo/hmrabbit/src/pagesMember/profile/profile.vue"]]);
  22184. const postMemberAddressAPI = (data) => {
  22185. return http({
  22186. method: "POST",
  22187. url: "/member/address",
  22188. data
  22189. });
  22190. };
  22191. const getMemberAddressAPI = () => {
  22192. return http({
  22193. method: "GET",
  22194. url: "/member/address"
  22195. });
  22196. };
  22197. const getMemberAddressByIdAPI = (id) => {
  22198. return http({
  22199. method: "GET",
  22200. url: `/member/address/${id}`
  22201. });
  22202. };
  22203. const putMemberAddressByIdAPI = (id, data) => {
  22204. return http({
  22205. method: "PUT",
  22206. url: `/member/address/${id}`,
  22207. data
  22208. });
  22209. };
  22210. const deleteMemberAddressByIdAPI = (id) => {
  22211. return http({
  22212. method: "DELETE",
  22213. url: `/member/address/${id}`
  22214. });
  22215. };
  22216. const useAddressStore = defineStore("address", () => {
  22217. const selectedAddress = vue.ref();
  22218. const changeSelectedAddress = (val) => {
  22219. selectedAddress.value = val;
  22220. };
  22221. return {
  22222. selectedAddress,
  22223. changeSelectedAddress
  22224. };
  22225. });
  22226. const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
  22227. __name: "address",
  22228. setup(__props, { expose: __expose }) {
  22229. __expose();
  22230. const addressList = vue.ref([]);
  22231. const getMemberAddressData = async () => {
  22232. const res = await getMemberAddressAPI();
  22233. addressList.value = res.result;
  22234. };
  22235. onShow(() => {
  22236. getMemberAddressData();
  22237. });
  22238. const onDeleteAddress = (id) => {
  22239. uni.showModal({
  22240. content: "删除地址?",
  22241. confirmColor: "#27BA9B",
  22242. success: async (res) => {
  22243. if (res.confirm) {
  22244. await deleteMemberAddressByIdAPI(id);
  22245. getMemberAddressData();
  22246. }
  22247. }
  22248. });
  22249. };
  22250. const onChangeAddress = (item) => {
  22251. const addressStore = useAddressStore();
  22252. addressStore.changeSelectedAddress(item);
  22253. uni.navigateBack();
  22254. };
  22255. const __returned__ = { addressList, getMemberAddressData, onDeleteAddress, onChangeAddress };
  22256. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  22257. return __returned__;
  22258. }
  22259. });
  22260. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  22261. const _component_uni_swipe_action_item = resolveEasycom(vue.resolveDynamicComponent("uni-swipe-action-item"), __easycom_0$a);
  22262. const _component_uni_swipe_action = resolveEasycom(vue.resolveDynamicComponent("uni-swipe-action"), __easycom_1$2);
  22263. return vue.openBlock(), vue.createElementBlock("view", { class: "viewport" }, [
  22264. vue.createCommentVNode(" 地址列表 "),
  22265. vue.createElementVNode("scroll-view", {
  22266. "enable-back-to-top": "",
  22267. class: "scroll-view",
  22268. "scroll-y": ""
  22269. }, [
  22270. $setup.addressList.length ? (vue.openBlock(), vue.createElementBlock("view", {
  22271. key: 0,
  22272. class: "address"
  22273. }, [
  22274. vue.createVNode(_component_uni_swipe_action, { class: "address-list" }, {
  22275. default: vue.withCtx(() => [
  22276. vue.createCommentVNode(" 收货地址项 "),
  22277. (vue.openBlock(true), vue.createElementBlock(
  22278. vue.Fragment,
  22279. null,
  22280. vue.renderList($setup.addressList, (item) => {
  22281. return vue.openBlock(), vue.createBlock(
  22282. _component_uni_swipe_action_item,
  22283. {
  22284. class: "item",
  22285. key: item.id
  22286. },
  22287. {
  22288. right: vue.withCtx(() => [
  22289. vue.createElementVNode("button", {
  22290. onClick: ($event) => $setup.onDeleteAddress(item.id),
  22291. class: "delete-button"
  22292. }, "删除", 8, ["onClick"])
  22293. ]),
  22294. default: vue.withCtx(() => [
  22295. vue.createElementVNode("view", {
  22296. class: "item-content",
  22297. onClick: ($event) => $setup.onChangeAddress(item)
  22298. }, [
  22299. vue.createElementVNode("view", { class: "user" }, [
  22300. vue.createTextVNode(
  22301. vue.toDisplayString(item.receiver) + " ",
  22302. 1
  22303. /* TEXT */
  22304. ),
  22305. vue.createElementVNode(
  22306. "text",
  22307. { class: "contact" },
  22308. vue.toDisplayString(item.contact),
  22309. 1
  22310. /* TEXT */
  22311. ),
  22312. item.isDefault ? (vue.openBlock(), vue.createElementBlock("text", {
  22313. key: 0,
  22314. class: "badge"
  22315. }, "默认")) : vue.createCommentVNode("v-if", true)
  22316. ]),
  22317. vue.createElementVNode(
  22318. "view",
  22319. { class: "locate" },
  22320. vue.toDisplayString(item.fullLocation) + " " + vue.toDisplayString(item.address),
  22321. 1
  22322. /* TEXT */
  22323. ),
  22324. vue.createCommentVNode(" H5 端需添加 .prevent 阻止链接的默认行为 "),
  22325. vue.createElementVNode("navigator", {
  22326. class: "edit",
  22327. "hover-class": "none",
  22328. url: `/pagesMember/address-form/address-form?id=${item.id}`,
  22329. onClick: [
  22330. vue.withModifiers(() => {
  22331. }, ["stop"]),
  22332. vue.withModifiers(() => {
  22333. }, ["prevent"])
  22334. ]
  22335. }, " 修改 ", 8, ["url"])
  22336. ], 8, ["onClick"])
  22337. ]),
  22338. _: 2
  22339. /* DYNAMIC */
  22340. },
  22341. 1024
  22342. /* DYNAMIC_SLOTS */
  22343. );
  22344. }),
  22345. 128
  22346. /* KEYED_FRAGMENT */
  22347. ))
  22348. ]),
  22349. _: 1
  22350. /* STABLE */
  22351. })
  22352. ])) : (vue.openBlock(), vue.createElementBlock("view", {
  22353. key: 1,
  22354. class: "blank"
  22355. }, "暂无收货地址"))
  22356. ]),
  22357. vue.createCommentVNode(" 添加按钮 "),
  22358. vue.createElementVNode("view", { class: "add-btn" }, [
  22359. vue.createElementVNode("navigator", {
  22360. "hover-class": "none",
  22361. url: "/pagesMember/address-form/address-form"
  22362. }, " 新建地址 ")
  22363. ])
  22364. ]);
  22365. }
  22366. const PagesMemberAddressAddress = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__file", "E:/demo/hmrabbit/src/pagesMember/address/address.vue"]]);
  22367. const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
  22368. __name: "address-form",
  22369. props: {
  22370. id: { type: String, required: false }
  22371. },
  22372. setup(__props, { expose: __expose }) {
  22373. __expose();
  22374. const form = vue.ref({
  22375. receiver: "",
  22376. // 收货人
  22377. contact: "",
  22378. // 联系方式
  22379. fullLocation: "",
  22380. // 省市区(前端展示)
  22381. provinceCode: "",
  22382. // 省份编码(后端参数)
  22383. cityCode: "",
  22384. // 城市编码(后端参数)
  22385. countyCode: "",
  22386. // 区/县编码(后端参数)
  22387. address: "",
  22388. // 详细地址
  22389. isDefault: 0
  22390. // 默认地址,1为是,0为否
  22391. });
  22392. const query = __props;
  22393. const getMemberAddressByIdData = async () => {
  22394. if (query.id) {
  22395. const res = await getMemberAddressByIdAPI(query.id);
  22396. Object.assign(form.value, res.result);
  22397. }
  22398. };
  22399. onLoad(() => {
  22400. getMemberAddressByIdData();
  22401. });
  22402. uni.setNavigationBarTitle({ title: query.id ? "修改地址" : "新建地址" });
  22403. const onRegionChange = (ev) => {
  22404. form.value.fullLocation = ev.detail.value.join(" ");
  22405. const [provinceCode, cityCode, countyCode] = ev.detail.code;
  22406. Object.assign(form.value, { provinceCode, cityCode, countyCode });
  22407. };
  22408. const onSwitchChange = (ev) => {
  22409. form.value.isDefault = ev.detail.value ? 1 : 0;
  22410. };
  22411. const rules = {
  22412. receiver: {
  22413. rules: [{ required: true, errorMessage: "请输入收货人姓名" }]
  22414. },
  22415. contact: {
  22416. rules: [
  22417. { required: true, errorMessage: "请输入联系方式" },
  22418. { pattern: /^1[3-9]\d{9}$/, errorMessage: "手机号格式不正确" }
  22419. ]
  22420. },
  22421. countyCode: {
  22422. rules: [{ required: true, errorMessage: "请选择所在地区" }]
  22423. },
  22424. address: {
  22425. rules: [{ required: true, errorMessage: "请选择详细地址" }]
  22426. }
  22427. };
  22428. const formRef = vue.ref();
  22429. const onSubmit = async () => {
  22430. var _a, _b;
  22431. try {
  22432. await ((_b = (_a = formRef.value) == null ? void 0 : _a.validate) == null ? void 0 : _b.call(_a));
  22433. if (query.id) {
  22434. await putMemberAddressByIdAPI(query.id, form.value);
  22435. } else {
  22436. await postMemberAddressAPI(form.value);
  22437. }
  22438. uni.showToast({ icon: "success", title: query.id ? "修改成功" : "添加成功" });
  22439. setTimeout(() => {
  22440. uni.navigateBack();
  22441. }, 400);
  22442. } catch (error) {
  22443. uni.showToast({ icon: "error", title: "请填写完整信息" });
  22444. }
  22445. };
  22446. const onCityChange = (ev) => {
  22447. const [province, city, county] = ev.detail.value;
  22448. Object.assign(form.value, {
  22449. provinceCode: province.value,
  22450. cityCode: city.value,
  22451. countyCode: county.value
  22452. });
  22453. };
  22454. const __returned__ = { form, query, getMemberAddressByIdData, onRegionChange, onSwitchChange, rules, formRef, onSubmit, onCityChange };
  22455. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  22456. return __returned__;
  22457. }
  22458. });
  22459. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  22460. const _component_uni_forms_item = resolveEasycom(vue.resolveDynamicComponent("uni-forms-item"), __easycom_0$4);
  22461. const _component_uni_data_picker = resolveEasycom(vue.resolveDynamicComponent("uni-data-picker"), __easycom_1);
  22462. const _component_uni_forms = resolveEasycom(vue.resolveDynamicComponent("uni-forms"), __easycom_2$1);
  22463. return vue.openBlock(), vue.createElementBlock(
  22464. vue.Fragment,
  22465. null,
  22466. [
  22467. vue.createElementVNode("view", { class: "content" }, [
  22468. vue.createVNode(_component_uni_forms, {
  22469. rules: $setup.rules,
  22470. model: $setup.form,
  22471. ref: "formRef"
  22472. }, {
  22473. default: vue.withCtx(() => [
  22474. vue.createCommentVNode(" 表单内容 "),
  22475. vue.createVNode(_component_uni_forms_item, {
  22476. name: "receiver",
  22477. class: "form-item"
  22478. }, {
  22479. default: vue.withCtx(() => [
  22480. vue.createElementVNode("text", { class: "label" }, "收货人"),
  22481. vue.withDirectives(vue.createElementVNode(
  22482. "input",
  22483. {
  22484. class: "input",
  22485. placeholder: "请填写收货人姓名",
  22486. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.form.receiver = $event)
  22487. },
  22488. null,
  22489. 512
  22490. /* NEED_PATCH */
  22491. ), [
  22492. [vue.vModelText, $setup.form.receiver]
  22493. ])
  22494. ]),
  22495. _: 1
  22496. /* STABLE */
  22497. }),
  22498. vue.createVNode(_component_uni_forms_item, {
  22499. name: "contact",
  22500. class: "form-item"
  22501. }, {
  22502. default: vue.withCtx(() => [
  22503. vue.createElementVNode("text", { class: "label" }, "手机号码"),
  22504. vue.withDirectives(vue.createElementVNode(
  22505. "input",
  22506. {
  22507. class: "input",
  22508. placeholder: "请填写收货人手机号码",
  22509. maxlength: 11,
  22510. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.form.contact = $event)
  22511. },
  22512. null,
  22513. 512
  22514. /* NEED_PATCH */
  22515. ), [
  22516. [vue.vModelText, $setup.form.contact]
  22517. ])
  22518. ]),
  22519. _: 1
  22520. /* STABLE */
  22521. }),
  22522. vue.createVNode(_component_uni_forms_item, {
  22523. name: "countyCode",
  22524. class: "form-item"
  22525. }, {
  22526. default: vue.withCtx(() => [
  22527. vue.createElementVNode("text", { class: "label" }, "所在地区"),
  22528. vue.createVNode(_component_uni_data_picker, {
  22529. placeholder: "请选择地址",
  22530. "popup-title": "请选择城市",
  22531. collection: "opendb-city-china",
  22532. field: "code as value, name as text",
  22533. orderby: "value asc",
  22534. "step-searh": true,
  22535. "self-field": "code",
  22536. "parent-field": "parent_code",
  22537. onChange: $setup.onCityChange,
  22538. "clear-icon": false,
  22539. modelValue: $setup.form.countyCode,
  22540. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.form.countyCode = $event)
  22541. }, null, 8, ["modelValue"])
  22542. ]),
  22543. _: 1
  22544. /* STABLE */
  22545. }),
  22546. vue.createVNode(_component_uni_forms_item, {
  22547. name: "address",
  22548. class: "form-item"
  22549. }, {
  22550. default: vue.withCtx(() => [
  22551. vue.createElementVNode("text", { class: "label" }, "详细地址"),
  22552. vue.withDirectives(vue.createElementVNode(
  22553. "input",
  22554. {
  22555. class: "input",
  22556. placeholder: "街道、楼牌号等信息",
  22557. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.form.address = $event)
  22558. },
  22559. null,
  22560. 512
  22561. /* NEED_PATCH */
  22562. ), [
  22563. [vue.vModelText, $setup.form.address]
  22564. ])
  22565. ]),
  22566. _: 1
  22567. /* STABLE */
  22568. }),
  22569. vue.createElementVNode("view", { class: "form-item" }, [
  22570. vue.createElementVNode("label", { class: "label" }, "设为默认地址"),
  22571. vue.createElementVNode("switch", {
  22572. onChange: $setup.onSwitchChange,
  22573. class: "switch",
  22574. color: "#27ba9b",
  22575. checked: $setup.form.isDefault === 1
  22576. }, null, 40, ["checked"])
  22577. ])
  22578. ]),
  22579. _: 1
  22580. /* STABLE */
  22581. }, 8, ["model"])
  22582. ]),
  22583. vue.createCommentVNode(" 提交按钮 "),
  22584. vue.createElementVNode("button", {
  22585. onClick: $setup.onSubmit,
  22586. class: "button"
  22587. }, "保存并使用")
  22588. ],
  22589. 64
  22590. /* STABLE_FRAGMENT */
  22591. );
  22592. }
  22593. const PagesMemberAddressFormAddressForm = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__file", "E:/demo/hmrabbit/src/pagesMember/address-form/address-form.vue"]]);
  22594. const getMemberOrderPreAPI = () => {
  22595. return http({
  22596. method: "GET",
  22597. url: "/member/order/pre"
  22598. });
  22599. };
  22600. const getMemberOrderPreNowAPI = (data) => {
  22601. return http({
  22602. method: "GET",
  22603. url: "/member/order/pre/now",
  22604. data
  22605. });
  22606. };
  22607. const getMemberOrderRepurchaseByIdAPI = (id) => {
  22608. return http({
  22609. method: "GET",
  22610. url: `/member/order/repurchase/${id}`
  22611. });
  22612. };
  22613. const postMemberOrderAPI = (data) => {
  22614. return http({
  22615. method: "POST",
  22616. url: "/member/order",
  22617. data
  22618. });
  22619. };
  22620. const getMemberOrderByIdAPI = (id) => {
  22621. return http({
  22622. method: "GET",
  22623. url: `/member/order/${id}`
  22624. });
  22625. };
  22626. const getMemberOrderConsignmentByIdAPI = (id) => {
  22627. return http({
  22628. method: "GET",
  22629. url: `/member/order/consignment/${id}`
  22630. });
  22631. };
  22632. const putMemberOrderReceiptByIdAPI = (id) => {
  22633. return http({
  22634. method: "PUT",
  22635. url: `/member/order/${id}/receipt`
  22636. });
  22637. };
  22638. const getMemberOrderLogisticsByIdAPI = (id) => {
  22639. return http({
  22640. method: "GET",
  22641. url: `/member/order/${id}/logistics`
  22642. });
  22643. };
  22644. const deleteMemberOrderAPI = (data) => {
  22645. return http({
  22646. method: "DELETE",
  22647. url: `/member/order`,
  22648. data
  22649. });
  22650. };
  22651. const getMemberOrderCancelByIdAPI = (id, data) => {
  22652. return http({
  22653. method: "PUT",
  22654. url: `/member/order/${id}/cancel`,
  22655. data
  22656. });
  22657. };
  22658. const getMemberOrderAPI = (data) => {
  22659. return http({
  22660. method: "GET",
  22661. url: `/member/order`,
  22662. data
  22663. });
  22664. };
  22665. const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
  22666. __name: "create",
  22667. props: {
  22668. skuId: { type: String, required: false },
  22669. count: { type: String, required: false },
  22670. orderId: { type: String, required: false }
  22671. },
  22672. setup(__props, { expose: __expose }) {
  22673. __expose();
  22674. const { safeAreaInsets } = uni.getSystemInfoSync();
  22675. const buyerMessage = vue.ref("");
  22676. const deliveryList = vue.ref([
  22677. { type: 1, text: "时间不限 (周一至周日)" },
  22678. { type: 2, text: "工作日送 (周一至周五)" },
  22679. { type: 3, text: "周末配送 (周六至周日)" }
  22680. ]);
  22681. const activeIndex = vue.ref(0);
  22682. const activeDelivery = vue.computed(() => deliveryList.value[activeIndex.value]);
  22683. const onChangeDelivery = (ev) => {
  22684. activeIndex.value = ev.detail.value;
  22685. };
  22686. const query = __props;
  22687. const orderPre = vue.ref();
  22688. const getMemberOrderPreData = async () => {
  22689. if (query.count && query.skuId) {
  22690. const res = await getMemberOrderPreNowAPI({
  22691. count: query.count,
  22692. skuId: query.skuId
  22693. });
  22694. orderPre.value = res.result;
  22695. } else if (query.orderId) {
  22696. const res = await getMemberOrderRepurchaseByIdAPI(query.orderId);
  22697. orderPre.value = res.result;
  22698. } else {
  22699. const res = await getMemberOrderPreAPI();
  22700. orderPre.value = res.result;
  22701. }
  22702. };
  22703. onLoad(() => {
  22704. getMemberOrderPreData();
  22705. });
  22706. const addressStore = useAddressStore();
  22707. const selecteAddress = vue.computed(() => {
  22708. var _a;
  22709. return addressStore.selectedAddress || ((_a = orderPre.value) == null ? void 0 : _a.userAddresses.find((v2) => v2.isDefault));
  22710. });
  22711. const onOrderSubmit = async () => {
  22712. var _a, _b;
  22713. if (!((_a = selecteAddress.value) == null ? void 0 : _a.id)) {
  22714. return uni.showToast({ icon: "none", title: "请选择收货地址" });
  22715. }
  22716. const res = await postMemberOrderAPI({
  22717. addressId: (_b = selecteAddress.value) == null ? void 0 : _b.id,
  22718. buyerMessage: buyerMessage.value,
  22719. deliveryTimeType: activeDelivery.value.type,
  22720. goods: orderPre.value.goods.map((v2) => ({ count: v2.count, skuId: v2.skuId })),
  22721. payChannel: 2,
  22722. payType: 1
  22723. });
  22724. uni.redirectTo({ url: `/pagesOrder/detail/detail?id=${res.result.id}` });
  22725. };
  22726. const __returned__ = { safeAreaInsets, buyerMessage, deliveryList, activeIndex, activeDelivery, onChangeDelivery, query, orderPre, getMemberOrderPreData, addressStore, selecteAddress, onOrderSubmit };
  22727. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  22728. return __returned__;
  22729. }
  22730. });
  22731. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  22732. var _a, _b, _c, _d, _e2, _f;
  22733. return vue.openBlock(), vue.createElementBlock(
  22734. vue.Fragment,
  22735. null,
  22736. [
  22737. vue.createElementVNode("scroll-view", {
  22738. "enable-back-to-top": "",
  22739. "scroll-y": "",
  22740. class: "viewport"
  22741. }, [
  22742. vue.createCommentVNode(" 收货地址 "),
  22743. $setup.selecteAddress ? (vue.openBlock(), vue.createElementBlock("navigator", {
  22744. key: 0,
  22745. class: "shipment",
  22746. "hover-class": "none",
  22747. url: "/pagesMember/address/address?from=order"
  22748. }, [
  22749. vue.createElementVNode(
  22750. "view",
  22751. { class: "user" },
  22752. vue.toDisplayString($setup.selecteAddress.receiver) + " " + vue.toDisplayString($setup.selecteAddress.contact),
  22753. 1
  22754. /* TEXT */
  22755. ),
  22756. vue.createElementVNode(
  22757. "view",
  22758. { class: "address" },
  22759. vue.toDisplayString($setup.selecteAddress.fullLocation) + " " + vue.toDisplayString($setup.selecteAddress.address),
  22760. 1
  22761. /* TEXT */
  22762. ),
  22763. vue.createElementVNode("text", { class: "icon icon-right" })
  22764. ])) : (vue.openBlock(), vue.createElementBlock("navigator", {
  22765. key: 1,
  22766. class: "shipment",
  22767. "hover-class": "none",
  22768. url: "/pagesMember/address/address?from=order"
  22769. }, [
  22770. vue.createElementVNode("view", { class: "address" }, " 请选择收货地址 "),
  22771. vue.createElementVNode("text", { class: "icon icon-right" })
  22772. ])),
  22773. vue.createCommentVNode(" 商品信息 "),
  22774. vue.createElementVNode("view", { class: "goods" }, [
  22775. (vue.openBlock(true), vue.createElementBlock(
  22776. vue.Fragment,
  22777. null,
  22778. vue.renderList((_a = $setup.orderPre) == null ? void 0 : _a.goods, (item) => {
  22779. return vue.openBlock(), vue.createElementBlock("navigator", {
  22780. key: item.skuId,
  22781. url: `/pages/goods/goods?id=${item.id}`,
  22782. class: "item",
  22783. "hover-class": "none"
  22784. }, [
  22785. vue.createElementVNode("image", {
  22786. class: "picture",
  22787. src: item.picture
  22788. }, null, 8, ["src"]),
  22789. vue.createElementVNode("view", { class: "meta" }, [
  22790. vue.createElementVNode(
  22791. "view",
  22792. { class: "name ellipsis" },
  22793. vue.toDisplayString(item.name),
  22794. 1
  22795. /* TEXT */
  22796. ),
  22797. vue.createElementVNode(
  22798. "view",
  22799. { class: "attrs" },
  22800. vue.toDisplayString(item.attrsText),
  22801. 1
  22802. /* TEXT */
  22803. ),
  22804. vue.createElementVNode("view", { class: "prices" }, [
  22805. vue.createElementVNode(
  22806. "view",
  22807. { class: "pay-price symbol" },
  22808. vue.toDisplayString(item.payPrice),
  22809. 1
  22810. /* TEXT */
  22811. ),
  22812. vue.createElementVNode(
  22813. "view",
  22814. { class: "price symbol" },
  22815. vue.toDisplayString(item.price),
  22816. 1
  22817. /* TEXT */
  22818. )
  22819. ]),
  22820. vue.createElementVNode(
  22821. "view",
  22822. { class: "count" },
  22823. "x" + vue.toDisplayString(item.count),
  22824. 1
  22825. /* TEXT */
  22826. )
  22827. ])
  22828. ], 8, ["url"]);
  22829. }),
  22830. 128
  22831. /* KEYED_FRAGMENT */
  22832. ))
  22833. ]),
  22834. vue.createCommentVNode(" 配送及支付方式 "),
  22835. vue.createElementVNode("view", { class: "related" }, [
  22836. vue.createElementVNode("view", { class: "item" }, [
  22837. vue.createElementVNode("text", { class: "text" }, "配送时间"),
  22838. vue.createElementVNode("picker", {
  22839. range: $setup.deliveryList,
  22840. "range-key": "text",
  22841. onChange: $setup.onChangeDelivery
  22842. }, [
  22843. vue.createElementVNode(
  22844. "view",
  22845. { class: "icon-fonts picker" },
  22846. vue.toDisplayString($setup.activeDelivery.text),
  22847. 1
  22848. /* TEXT */
  22849. )
  22850. ], 40, ["range"])
  22851. ]),
  22852. vue.createElementVNode("view", { class: "item" }, [
  22853. vue.createElementVNode("text", { class: "text" }, "订单备注"),
  22854. vue.withDirectives(vue.createElementVNode(
  22855. "input",
  22856. {
  22857. class: "input",
  22858. "cursor-spacing": 30,
  22859. placeholder: "选题,建议留言前先与商家沟通确认",
  22860. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.buyerMessage = $event)
  22861. },
  22862. null,
  22863. 512
  22864. /* NEED_PATCH */
  22865. ), [
  22866. [vue.vModelText, $setup.buyerMessage]
  22867. ])
  22868. ])
  22869. ]),
  22870. vue.createCommentVNode(" 支付金额 "),
  22871. vue.createElementVNode("view", { class: "settlement" }, [
  22872. vue.createElementVNode("view", { class: "item" }, [
  22873. vue.createElementVNode("text", { class: "text" }, "商品总价: "),
  22874. vue.createElementVNode(
  22875. "text",
  22876. { class: "number symbol" },
  22877. vue.toDisplayString((_b = $setup.orderPre) == null ? void 0 : _b.summary.totalPrice.toFixed(2)),
  22878. 1
  22879. /* TEXT */
  22880. )
  22881. ]),
  22882. vue.createElementVNode("view", { class: "item" }, [
  22883. vue.createElementVNode("text", { class: "text" }, "运费: "),
  22884. vue.createElementVNode(
  22885. "text",
  22886. { class: "number symbol" },
  22887. vue.toDisplayString((_c = $setup.orderPre) == null ? void 0 : _c.summary.postFee.toFixed(2)),
  22888. 1
  22889. /* TEXT */
  22890. )
  22891. ])
  22892. ])
  22893. ]),
  22894. vue.createCommentVNode(" 吸底工具栏 "),
  22895. vue.createElementVNode(
  22896. "view",
  22897. {
  22898. class: "toolbar",
  22899. style: vue.normalizeStyle({ paddingBottom: ((_d = $setup.safeAreaInsets) == null ? void 0 : _d.bottom) + "px" })
  22900. },
  22901. [
  22902. vue.createElementVNode("view", { class: "total-pay symbol" }, [
  22903. vue.createElementVNode(
  22904. "text",
  22905. { class: "number" },
  22906. vue.toDisplayString((_e2 = $setup.orderPre) == null ? void 0 : _e2.summary.totalPayPrice.toFixed(2)),
  22907. 1
  22908. /* TEXT */
  22909. )
  22910. ]),
  22911. vue.createElementVNode(
  22912. "view",
  22913. {
  22914. class: vue.normalizeClass(["button", { disabled: !((_f = $setup.selecteAddress) == null ? void 0 : _f.id) }]),
  22915. onClick: $setup.onOrderSubmit
  22916. },
  22917. " 提交订单 ",
  22918. 2
  22919. /* CLASS */
  22920. )
  22921. ],
  22922. 4
  22923. /* STYLE */
  22924. )
  22925. ],
  22926. 64
  22927. /* STABLE_FRAGMENT */
  22928. );
  22929. }
  22930. const PagesOrderCreateCreate = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__file", "E:/demo/hmrabbit/src/pagesOrder/create/create.vue"]]);
  22931. const en = {
  22932. "uni-countdown.day": "day",
  22933. "uni-countdown.h": "h",
  22934. "uni-countdown.m": "m",
  22935. "uni-countdown.s": "s"
  22936. };
  22937. const zhHans = {
  22938. "uni-countdown.day": "天",
  22939. "uni-countdown.h": "时",
  22940. "uni-countdown.m": "分",
  22941. "uni-countdown.s": "秒"
  22942. };
  22943. const zhHant = {
  22944. "uni-countdown.day": "天",
  22945. "uni-countdown.h": "時",
  22946. "uni-countdown.m": "分",
  22947. "uni-countdown.s": "秒"
  22948. };
  22949. const messages = {
  22950. en,
  22951. "zh-Hans": zhHans,
  22952. "zh-Hant": zhHant
  22953. };
  22954. const {
  22955. t
  22956. } = initVueI18n(messages);
  22957. const _sfc_main$6 = {
  22958. name: "UniCountdown",
  22959. emits: ["timeup"],
  22960. props: {
  22961. showDay: {
  22962. type: Boolean,
  22963. default: true
  22964. },
  22965. showColon: {
  22966. type: Boolean,
  22967. default: true
  22968. },
  22969. start: {
  22970. type: Boolean,
  22971. default: true
  22972. },
  22973. backgroundColor: {
  22974. type: String,
  22975. default: ""
  22976. },
  22977. color: {
  22978. type: String,
  22979. default: "#333"
  22980. },
  22981. fontSize: {
  22982. type: Number,
  22983. default: 14
  22984. },
  22985. splitorColor: {
  22986. type: String,
  22987. default: "#333"
  22988. },
  22989. day: {
  22990. type: Number,
  22991. default: 0
  22992. },
  22993. hour: {
  22994. type: Number,
  22995. default: 0
  22996. },
  22997. minute: {
  22998. type: Number,
  22999. default: 0
  23000. },
  23001. second: {
  23002. type: Number,
  23003. default: 0
  23004. },
  23005. timestamp: {
  23006. type: Number,
  23007. default: 0
  23008. }
  23009. },
  23010. data() {
  23011. return {
  23012. timer: null,
  23013. syncFlag: false,
  23014. d: "00",
  23015. h: "00",
  23016. i: "00",
  23017. s: "00",
  23018. leftTime: 0,
  23019. seconds: 0
  23020. };
  23021. },
  23022. computed: {
  23023. dayText() {
  23024. return t("uni-countdown.day");
  23025. },
  23026. hourText(val) {
  23027. return t("uni-countdown.h");
  23028. },
  23029. minuteText(val) {
  23030. return t("uni-countdown.m");
  23031. },
  23032. secondText(val) {
  23033. return t("uni-countdown.s");
  23034. },
  23035. timeStyle() {
  23036. const {
  23037. color,
  23038. backgroundColor,
  23039. fontSize
  23040. } = this;
  23041. return {
  23042. color,
  23043. backgroundColor,
  23044. fontSize: `${fontSize}px`,
  23045. width: `${fontSize * 22 / 14}px`,
  23046. // 按字体大小为 14px 时的比例缩放
  23047. lineHeight: `${fontSize * 20 / 14}px`,
  23048. borderRadius: `${fontSize * 3 / 14}px`
  23049. };
  23050. },
  23051. splitorStyle() {
  23052. const { splitorColor, fontSize, backgroundColor } = this;
  23053. return {
  23054. color: splitorColor,
  23055. fontSize: `${fontSize * 12 / 14}px`,
  23056. margin: backgroundColor ? `${fontSize * 4 / 14}px` : ""
  23057. };
  23058. }
  23059. },
  23060. watch: {
  23061. day(val) {
  23062. this.changeFlag();
  23063. },
  23064. hour(val) {
  23065. this.changeFlag();
  23066. },
  23067. minute(val) {
  23068. this.changeFlag();
  23069. },
  23070. second(val) {
  23071. this.changeFlag();
  23072. },
  23073. start: {
  23074. immediate: true,
  23075. handler(newVal, oldVal) {
  23076. if (newVal) {
  23077. this.startData();
  23078. } else {
  23079. if (!oldVal)
  23080. return;
  23081. clearInterval(this.timer);
  23082. }
  23083. }
  23084. }
  23085. },
  23086. created: function(e2) {
  23087. this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second);
  23088. this.countDown();
  23089. },
  23090. unmounted() {
  23091. clearInterval(this.timer);
  23092. },
  23093. methods: {
  23094. toSeconds(timestamp, day, hours, minutes, seconds) {
  23095. if (timestamp) {
  23096. return timestamp - parseInt((/* @__PURE__ */ new Date()).getTime() / 1e3, 10);
  23097. }
  23098. return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds;
  23099. },
  23100. timeUp() {
  23101. clearInterval(this.timer);
  23102. this.$emit("timeup");
  23103. },
  23104. countDown() {
  23105. let seconds = this.seconds;
  23106. let [day, hour, minute, second] = [0, 0, 0, 0];
  23107. if (seconds > 0) {
  23108. day = Math.floor(seconds / (60 * 60 * 24));
  23109. hour = Math.floor(seconds / (60 * 60)) - day * 24;
  23110. minute = Math.floor(seconds / 60) - day * 24 * 60 - hour * 60;
  23111. second = Math.floor(seconds) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60;
  23112. } else {
  23113. this.timeUp();
  23114. }
  23115. if (day < 10) {
  23116. day = "0" + day;
  23117. }
  23118. if (hour < 10) {
  23119. hour = "0" + hour;
  23120. }
  23121. if (minute < 10) {
  23122. minute = "0" + minute;
  23123. }
  23124. if (second < 10) {
  23125. second = "0" + second;
  23126. }
  23127. this.d = day;
  23128. this.h = hour;
  23129. this.i = minute;
  23130. this.s = second;
  23131. },
  23132. startData() {
  23133. this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second);
  23134. if (this.seconds <= 0) {
  23135. this.seconds = this.toSeconds(0, 0, 0, 0, 0);
  23136. this.countDown();
  23137. return;
  23138. }
  23139. clearInterval(this.timer);
  23140. this.countDown();
  23141. this.timer = setInterval(() => {
  23142. this.seconds--;
  23143. if (this.seconds < 0) {
  23144. this.timeUp();
  23145. return;
  23146. }
  23147. this.countDown();
  23148. }, 1e3);
  23149. },
  23150. update() {
  23151. this.startData();
  23152. },
  23153. changeFlag() {
  23154. if (!this.syncFlag) {
  23155. this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second);
  23156. this.startData();
  23157. this.syncFlag = true;
  23158. }
  23159. }
  23160. }
  23161. };
  23162. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  23163. return vue.openBlock(), vue.createElementBlock("view", { class: "uni-countdown" }, [
  23164. $props.showDay ? (vue.openBlock(), vue.createElementBlock(
  23165. "text",
  23166. {
  23167. key: 0,
  23168. style: vue.normalizeStyle([$options.timeStyle]),
  23169. class: "uni-countdown__number"
  23170. },
  23171. vue.toDisplayString($data.d),
  23172. 5
  23173. /* TEXT, STYLE */
  23174. )) : vue.createCommentVNode("v-if", true),
  23175. $props.showDay ? (vue.openBlock(), vue.createElementBlock(
  23176. "text",
  23177. {
  23178. key: 1,
  23179. style: vue.normalizeStyle([$options.splitorStyle]),
  23180. class: "uni-countdown__splitor"
  23181. },
  23182. vue.toDisplayString($options.dayText),
  23183. 5
  23184. /* TEXT, STYLE */
  23185. )) : vue.createCommentVNode("v-if", true),
  23186. vue.createElementVNode(
  23187. "text",
  23188. {
  23189. style: vue.normalizeStyle([$options.timeStyle]),
  23190. class: "uni-countdown__number"
  23191. },
  23192. vue.toDisplayString($data.h),
  23193. 5
  23194. /* TEXT, STYLE */
  23195. ),
  23196. vue.createElementVNode(
  23197. "text",
  23198. {
  23199. style: vue.normalizeStyle([$options.splitorStyle]),
  23200. class: "uni-countdown__splitor"
  23201. },
  23202. vue.toDisplayString($props.showColon ? ":" : $options.hourText),
  23203. 5
  23204. /* TEXT, STYLE */
  23205. ),
  23206. vue.createElementVNode(
  23207. "text",
  23208. {
  23209. style: vue.normalizeStyle([$options.timeStyle]),
  23210. class: "uni-countdown__number"
  23211. },
  23212. vue.toDisplayString($data.i),
  23213. 5
  23214. /* TEXT, STYLE */
  23215. ),
  23216. vue.createElementVNode(
  23217. "text",
  23218. {
  23219. style: vue.normalizeStyle([$options.splitorStyle]),
  23220. class: "uni-countdown__splitor"
  23221. },
  23222. vue.toDisplayString($props.showColon ? ":" : $options.minuteText),
  23223. 5
  23224. /* TEXT, STYLE */
  23225. ),
  23226. vue.createElementVNode(
  23227. "text",
  23228. {
  23229. style: vue.normalizeStyle([$options.timeStyle]),
  23230. class: "uni-countdown__number"
  23231. },
  23232. vue.toDisplayString($data.s),
  23233. 5
  23234. /* TEXT, STYLE */
  23235. ),
  23236. !$props.showColon ? (vue.openBlock(), vue.createElementBlock(
  23237. "text",
  23238. {
  23239. key: 2,
  23240. style: vue.normalizeStyle([$options.splitorStyle]),
  23241. class: "uni-countdown__splitor"
  23242. },
  23243. vue.toDisplayString($options.secondText),
  23244. 5
  23245. /* TEXT, STYLE */
  23246. )) : vue.createCommentVNode("v-if", true)
  23247. ]);
  23248. }
  23249. const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__scopeId", "data-v-342c352a"], ["__file", "E:/demo/hmrabbit/node_modules/@dcloudio/uni-ui/lib/uni-countdown/uni-countdown.vue"]]);
  23250. var OrderState = /* @__PURE__ */ ((OrderState2) => {
  23251. OrderState2[OrderState2["DaiFuKuan"] = 1] = "DaiFuKuan";
  23252. OrderState2[OrderState2["DaiFaHuo"] = 2] = "DaiFaHuo";
  23253. OrderState2[OrderState2["DaiShouHuo"] = 3] = "DaiShouHuo";
  23254. OrderState2[OrderState2["DaiPingJia"] = 4] = "DaiPingJia";
  23255. OrderState2[OrderState2["YiWanCheng"] = 5] = "YiWanCheng";
  23256. OrderState2[OrderState2["YiQuXiao"] = 6] = "YiQuXiao";
  23257. return OrderState2;
  23258. })(OrderState || {});
  23259. const orderStateList = [
  23260. { id: 0, text: "" },
  23261. { id: 1, text: "待付款" },
  23262. { id: 2, text: "待发货" },
  23263. { id: 3, text: "待收货" },
  23264. { id: 4, text: "待评价" },
  23265. { id: 5, text: "已完成" },
  23266. { id: 6, text: "已取消" }
  23267. ];
  23268. const _sfc_main$5 = {};
  23269. function _sfc_render$4(_ctx, _cache) {
  23270. return vue.openBlock(), vue.createElementBlock("view", { class: "sk-container" }, [
  23271. vue.createElementVNode("scroll-view", {
  23272. "scroll-y": true,
  23273. class: "viewport sk-transparent",
  23274. id: "scroller",
  23275. "enable-back-to-top": true
  23276. }, [
  23277. vue.createElementVNode("view", {
  23278. class: "overview sk-image",
  23279. style: { "padding-top": "64px" }
  23280. }, [
  23281. vue.createElementVNode("view", { class: "status sk-transparent sk-text-0-0000-826 sk-text" }, "待收货")
  23282. ]),
  23283. vue.createElementVNode("view", { class: "shipment" }, [
  23284. vue.createElementVNode("navigator", {
  23285. class: "logistics sk-image sk-pseudo sk-pseudo-circle",
  23286. "hover-class": "none"
  23287. }, [
  23288. vue.createElementVNode("view", { class: "message sk-transparent sk-text-14-2857-512 sk-text" }, "小兔兔到了小福家里,请签收"),
  23289. vue.createElementVNode("view", { class: "date sk-transparent sk-text-14-2857-990 sk-text" }, "2023-04-15 23:23:04")
  23290. ]),
  23291. vue.createElementVNode("view", { class: "locate sk-image" }, [
  23292. vue.createElementVNode("view", { class: "user sk-transparent sk-text-14-2857-630 sk-text" }, "苏东坡 13633336666"),
  23293. vue.createElementVNode("view", { class: "address sk-transparent sk-text-14-2857-606 sk-text" }, "广东省 广州市 天河区吉山幼儿园")
  23294. ])
  23295. ]),
  23296. vue.createElementVNode("view", { class: "goods" }, [
  23297. vue.createElementVNode("view", { class: "item" }, [
  23298. vue.createElementVNode("navigator", {
  23299. class: "navigator",
  23300. "hover-class": "none"
  23301. }, [
  23302. vue.createElementVNode("image", { class: "cover sk-image" }),
  23303. vue.createElementVNode("view", { class: "meta" }, [
  23304. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-474 sk-text" }, "厚厚一按就干爽,埃及进口长绒棉毛巾"),
  23305. vue.createElementVNode("view", { class: "type sk-transparent sk-text-22-2222-237 sk-text" }, "超值4条装(灰蓝色+粉色+银灰+嫩黄)"),
  23306. vue.createElementVNode("view", { class: "price" }, [
  23307. vue.createElementVNode("view", { class: "actual" }, [
  23308. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  23309. vue.createElementVNode("text", { class: "sk-transparent sk-text-14-2857-102 sk-text" }, "68")
  23310. ])
  23311. ]),
  23312. vue.createElementVNode("view", { class: "quantity sk-transparent sk-opacity" }, "x1")
  23313. ])
  23314. ]),
  23315. vue.createElementVNode("navigator", {
  23316. class: "navigator",
  23317. "hover-class": "none"
  23318. }, [
  23319. vue.createElementVNode("image", { class: "cover sk-image" }),
  23320. vue.createElementVNode("view", { class: "meta" }, [
  23321. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-969 sk-text" }, "KJE金属色系轻量电动车骑行盔男女通用"),
  23322. vue.createElementVNode("view", { class: "type sk-transparent sk-text-22-2222-510 sk-text" }, "玫瑰金L"),
  23323. vue.createElementVNode("view", { class: "price" }, [
  23324. vue.createElementVNode("view", { class: "actual" }, [
  23325. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  23326. vue.createElementVNode("text", { class: "sk-transparent sk-text-14-2857-431 sk-text" }, "120")
  23327. ])
  23328. ]),
  23329. vue.createElementVNode("view", { class: "quantity sk-transparent sk-opacity" }, "x1")
  23330. ])
  23331. ]),
  23332. vue.createElementVNode("navigator", {
  23333. class: "navigator",
  23334. "hover-class": "none"
  23335. }, [
  23336. vue.createElementVNode("image", { class: "cover sk-image" }),
  23337. vue.createElementVNode("view", { class: "meta" }, [
  23338. vue.createElementVNode("view", { class: "name ellipsis sk-transparent sk-text-14-2857-130 sk-text" }, "源自澳洲进口羊毛,儿童奢暖羊毛被升级款"),
  23339. vue.createElementVNode("view", { class: "type sk-transparent sk-text-22-2222-110 sk-text" }, "春秋款, 100%羊毛款:150x200cm,适合1.2米/1.35米床"),
  23340. vue.createElementVNode("view", { class: "price" }, [
  23341. vue.createElementVNode("view", { class: "actual" }, [
  23342. vue.createElementVNode("text", { class: "symbol sk-transparent sk-opacity" }, "¥"),
  23343. vue.createElementVNode("text", { class: "sk-transparent sk-text-14-2857-273 sk-text" }, "289")
  23344. ])
  23345. ]),
  23346. vue.createElementVNode("view", { class: "quantity sk-transparent sk-opacity" }, "x1")
  23347. ])
  23348. ])
  23349. ]),
  23350. vue.createElementVNode("view", { class: "total" }, [
  23351. vue.createElementVNode("view", { class: "row" }, [
  23352. vue.createElementVNode("view", { class: "text sk-transparent sk-text-0-0000-302 sk-text" }, "商品总价: "),
  23353. vue.createElementVNode("view", { class: "symbol sk-transparent sk-text-0-0000-998 sk-text sk-pseudo sk-pseudo-circle" }, "477")
  23354. ]),
  23355. vue.createElementVNode("view", { class: "row" }, [
  23356. vue.createElementVNode("view", { class: "text sk-transparent sk-text-0-0000-912 sk-text" }, "运费: "),
  23357. vue.createElementVNode("view", { class: "symbol sk-transparent sk-text-0-0000-208 sk-text sk-pseudo sk-pseudo-circle" }, "2")
  23358. ]),
  23359. vue.createElementVNode("view", { class: "row" }, [
  23360. vue.createElementVNode("view", { class: "text sk-transparent sk-text-0-0000-538 sk-text" }, "应付金额: "),
  23361. vue.createElementVNode("view", { class: "symbol primary sk-transparent sk-text-0-0000-858 sk-text sk-pseudo sk-pseudo-circle" }, "479")
  23362. ])
  23363. ])
  23364. ]),
  23365. vue.createElementVNode("view", { class: "detail" }, [
  23366. vue.createElementVNode("view", { class: "title sk-transparent sk-text-0-0000-66 sk-text" }, "订单信息"),
  23367. vue.createElementVNode("view", { class: "row" }, [
  23368. vue.createElementVNode("view", { class: "item sk-transparent" }, [
  23369. vue.createTextVNode(" 订单编号: 1645809639951962113 "),
  23370. vue.createElementVNode("text", { class: "copy sk-transparent sk-text-0-0000-522 sk-text" }, "复制")
  23371. ]),
  23372. vue.createElementVNode("view", { class: "item sk-transparent sk-text-0-0000-353 sk-text" }, "下单时间: 2023-04-11 23:22:50")
  23373. ])
  23374. ]),
  23375. vue.createElementVNode("view", {
  23376. class: "toolbar",
  23377. style: { "padding-bottom": "34px" }
  23378. }, [
  23379. vue.createElementVNode("view", {
  23380. class: "button primary sk-transparent sk-text-31-9444-411 sk-text",
  23381. style: { "background-position-x": "50%" }
  23382. }, "再次购买")
  23383. ])
  23384. ])
  23385. ]);
  23386. }
  23387. const PageSkeleton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-b1ebad5e"], ["__file", "E:/demo/hmrabbit/src/pagesOrder/detail/components/PageSkeleton.vue"]]);
  23388. const getPayMockAPI = (data) => {
  23389. return http({
  23390. method: "GET",
  23391. url: "/pay/mock",
  23392. data
  23393. });
  23394. };
  23395. const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
  23396. __name: "detail",
  23397. props: {
  23398. id: { type: String, required: true }
  23399. },
  23400. setup(__props, { expose: __expose }) {
  23401. __expose();
  23402. const { safeAreaInsets } = uni.getSystemInfoSync();
  23403. const { guessRef, onScrolltolower } = useGuessList();
  23404. const popup2 = vue.ref();
  23405. const reasonList = vue.ref([
  23406. "商品无货",
  23407. "不想要了",
  23408. "商品信息填错了",
  23409. "地址信息填写错误",
  23410. "商品降价",
  23411. "其它"
  23412. ]);
  23413. const reason = vue.ref("");
  23414. const onCopy = (id) => {
  23415. uni.setClipboardData({ data: id });
  23416. };
  23417. const query = __props;
  23418. const pages2 = getCurrentPages();
  23419. const order = vue.ref();
  23420. const getMemberOrderByIdData = async () => {
  23421. const res = await getMemberOrderByIdAPI(query.id);
  23422. order.value = res.result;
  23423. if ([OrderState.DaiShouHuo, OrderState.DaiPingJia, OrderState.YiWanCheng].includes(
  23424. order.value.orderState
  23425. )) {
  23426. getMemberOrderLogisticsByIdData();
  23427. }
  23428. };
  23429. const logisticList = vue.ref([]);
  23430. const getMemberOrderLogisticsByIdData = async () => {
  23431. const res = await getMemberOrderLogisticsByIdAPI(query.id);
  23432. logisticList.value = res.result.list;
  23433. };
  23434. onLoad(() => {
  23435. getMemberOrderByIdData();
  23436. });
  23437. const onTimeup = () => {
  23438. order.value.orderState = OrderState.YiQuXiao;
  23439. };
  23440. const onOrderPay = async () => {
  23441. {
  23442. await getPayMockAPI({ orderId: query.id });
  23443. }
  23444. uni.redirectTo({ url: `/pagesOrder/payment/payment?id=${query.id}` });
  23445. };
  23446. const isDev = true;
  23447. const onOrderSend = async () => {
  23448. {
  23449. await getMemberOrderConsignmentByIdAPI(query.id);
  23450. uni.showToast({ icon: "success", title: "模拟发货完成" });
  23451. order.value.orderState = OrderState.DaiShouHuo;
  23452. }
  23453. };
  23454. const onOrderConfirm = () => {
  23455. uni.showModal({
  23456. content: "为保障您的权益,请收到货并确认无误后,再确认收货",
  23457. confirmColor: "#27BA9B",
  23458. success: async (success) => {
  23459. if (success.confirm) {
  23460. const res = await putMemberOrderReceiptByIdAPI(query.id);
  23461. order.value = res.result;
  23462. }
  23463. }
  23464. });
  23465. };
  23466. const onOrderDelete = () => {
  23467. uni.showModal({
  23468. content: "是否删除订单",
  23469. confirmColor: "#27BA9B",
  23470. success: async (success) => {
  23471. if (success.confirm) {
  23472. await deleteMemberOrderAPI({ ids: [query.id] });
  23473. uni.redirectTo({ url: "/pagesOrder/list/list" });
  23474. }
  23475. }
  23476. });
  23477. };
  23478. const onOrderCancel = async () => {
  23479. var _a;
  23480. const res = await getMemberOrderCancelByIdAPI(query.id, { cancelReason: reason.value });
  23481. order.value = res.result;
  23482. (_a = popup2.value) == null ? void 0 : _a.close();
  23483. uni.showToast({ icon: "none", title: "订单取消成功" });
  23484. };
  23485. const __returned__ = { safeAreaInsets, guessRef, onScrolltolower, popup: popup2, reasonList, reason, onCopy, query, pages: pages2, order, getMemberOrderByIdData, logisticList, getMemberOrderLogisticsByIdData, onTimeup, onOrderPay, isDev, onOrderSend, onOrderConfirm, onOrderDelete, onOrderCancel, get OrderState() {
  23486. return OrderState;
  23487. }, get orderStateList() {
  23488. return orderStateList;
  23489. }, PageSkeleton };
  23490. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  23491. return __returned__;
  23492. }
  23493. });
  23494. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  23495. var _a, _b, _c;
  23496. const _component_uni_countdown = resolveEasycom(vue.resolveDynamicComponent("uni-countdown"), __easycom_0);
  23497. const _component_XtxGuess = resolveEasycom(vue.resolveDynamicComponent("XtxGuess"), __easycom_0$9);
  23498. const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_2);
  23499. return vue.openBlock(), vue.createElementBlock(
  23500. vue.Fragment,
  23501. null,
  23502. [
  23503. vue.createCommentVNode(" 自定义导航栏: 默认透明不可见, scroll-view 滚动到 50 时展示 "),
  23504. vue.createElementVNode(
  23505. "view",
  23506. {
  23507. class: "navbar",
  23508. style: vue.normalizeStyle({ paddingTop: ((_a = $setup.safeAreaInsets) == null ? void 0 : _a.top) + "px" })
  23509. },
  23510. [
  23511. vue.createElementVNode("view", { class: "wrap" }, [
  23512. $setup.pages.length > 1 ? (vue.openBlock(), vue.createElementBlock("navigator", {
  23513. key: 0,
  23514. "open-type": "navigateBack",
  23515. class: "back icon-left"
  23516. })) : (vue.openBlock(), vue.createElementBlock("navigator", {
  23517. key: 1,
  23518. url: "/pages/index/index",
  23519. "open-type": "switchTab",
  23520. class: "back icon-home"
  23521. })),
  23522. vue.createElementVNode("view", { class: "title" }, "订单详情")
  23523. ])
  23524. ],
  23525. 4
  23526. /* STYLE */
  23527. ),
  23528. vue.createElementVNode(
  23529. "scroll-view",
  23530. {
  23531. "enable-back-to-top": "",
  23532. "scroll-y": "",
  23533. class: "viewport",
  23534. id: "scroller",
  23535. onScrolltolower: _cache[2] || (_cache[2] = (...args) => $setup.onScrolltolower && $setup.onScrolltolower(...args))
  23536. },
  23537. [
  23538. $setup.order ? (vue.openBlock(), vue.createElementBlock(
  23539. vue.Fragment,
  23540. { key: 0 },
  23541. [
  23542. vue.createCommentVNode(" 订单状态 "),
  23543. vue.createElementVNode(
  23544. "view",
  23545. {
  23546. class: "overview",
  23547. style: vue.normalizeStyle({ paddingTop: $setup.safeAreaInsets.top + 20 + "px" })
  23548. },
  23549. [
  23550. vue.createCommentVNode(" 待付款状态:展示倒计时 "),
  23551. $setup.order.orderState === $setup.OrderState.DaiFuKuan ? (vue.openBlock(), vue.createElementBlock(
  23552. vue.Fragment,
  23553. { key: 0 },
  23554. [
  23555. vue.createElementVNode("view", { class: "status icon-clock" }, "等待付款"),
  23556. vue.createElementVNode("view", { class: "tips" }, [
  23557. vue.createElementVNode(
  23558. "text",
  23559. { class: "money" },
  23560. "应付金额: ¥ " + vue.toDisplayString($setup.order.payMoney),
  23561. 1
  23562. /* TEXT */
  23563. ),
  23564. vue.createElementVNode("text", { class: "time" }, "支付剩余"),
  23565. vue.createVNode(_component_uni_countdown, {
  23566. second: $setup.order.countdown,
  23567. color: "#fff",
  23568. "splitor-color": "#fff",
  23569. "show-day": false,
  23570. "show-colon": false,
  23571. onTimeup: $setup.onTimeup
  23572. }, null, 8, ["second"])
  23573. ]),
  23574. vue.createElementVNode("view", {
  23575. class: "button",
  23576. onClick: $setup.onOrderPay
  23577. }, "去支付")
  23578. ],
  23579. 64
  23580. /* STABLE_FRAGMENT */
  23581. )) : (vue.openBlock(), vue.createElementBlock(
  23582. vue.Fragment,
  23583. { key: 1 },
  23584. [
  23585. vue.createCommentVNode(" 其他订单状态:展示再次购买按钮 "),
  23586. vue.createCommentVNode(" 订单状态文字 "),
  23587. vue.createElementVNode(
  23588. "view",
  23589. { class: "status" },
  23590. vue.toDisplayString($setup.orderStateList[$setup.order.orderState].text),
  23591. 1
  23592. /* TEXT */
  23593. ),
  23594. vue.createElementVNode("view", { class: "button-group" }, [
  23595. vue.createElementVNode("navigator", {
  23596. class: "button",
  23597. url: `/pagesOrder/create/create?orderId=${$setup.query.id}`,
  23598. "hover-class": "none"
  23599. }, " 再次购买 ", 8, ["url"]),
  23600. vue.createCommentVNode(" 待发货状态:模拟发货,开发期间使用,用于修改订单状态为已发货 "),
  23601. $setup.isDev && $setup.order.orderState == $setup.OrderState.DaiFaHuo ? (vue.openBlock(), vue.createElementBlock("view", {
  23602. key: 0,
  23603. onClick: $setup.onOrderSend,
  23604. class: "button"
  23605. }, " 模拟发货 ")) : vue.createCommentVNode("v-if", true),
  23606. vue.createCommentVNode(" 待收货状态: 展示确认收货按钮 "),
  23607. $setup.order.orderState === $setup.OrderState.DaiShouHuo ? (vue.openBlock(), vue.createElementBlock("view", {
  23608. key: 1,
  23609. onClick: $setup.onOrderConfirm,
  23610. class: "button"
  23611. }, " 确认收货 ")) : vue.createCommentVNode("v-if", true)
  23612. ])
  23613. ],
  23614. 64
  23615. /* STABLE_FRAGMENT */
  23616. ))
  23617. ],
  23618. 4
  23619. /* STYLE */
  23620. ),
  23621. vue.createCommentVNode(" 配送状态 "),
  23622. vue.createElementVNode("view", { class: "shipment" }, [
  23623. vue.createCommentVNode(" 订单物流信息 "),
  23624. (vue.openBlock(true), vue.createElementBlock(
  23625. vue.Fragment,
  23626. null,
  23627. vue.renderList($setup.logisticList, (item) => {
  23628. return vue.openBlock(), vue.createElementBlock("view", {
  23629. key: item.id,
  23630. class: "item"
  23631. }, [
  23632. vue.createElementVNode(
  23633. "view",
  23634. { class: "message" },
  23635. vue.toDisplayString(item.text),
  23636. 1
  23637. /* TEXT */
  23638. ),
  23639. vue.createElementVNode(
  23640. "view",
  23641. { class: "date" },
  23642. vue.toDisplayString(item.time),
  23643. 1
  23644. /* TEXT */
  23645. )
  23646. ]);
  23647. }),
  23648. 128
  23649. /* KEYED_FRAGMENT */
  23650. )),
  23651. vue.createCommentVNode(" 用户收货地址 "),
  23652. vue.createElementVNode("view", { class: "locate" }, [
  23653. vue.createElementVNode(
  23654. "view",
  23655. { class: "user" },
  23656. vue.toDisplayString($setup.order.receiverContact) + " " + vue.toDisplayString($setup.order.receiverMobile),
  23657. 1
  23658. /* TEXT */
  23659. ),
  23660. vue.createElementVNode(
  23661. "view",
  23662. { class: "address" },
  23663. vue.toDisplayString($setup.order.receiverAddress),
  23664. 1
  23665. /* TEXT */
  23666. )
  23667. ])
  23668. ]),
  23669. vue.createCommentVNode(" 商品信息 "),
  23670. vue.createElementVNode("view", { class: "goods" }, [
  23671. vue.createElementVNode("view", { class: "item" }, [
  23672. (vue.openBlock(true), vue.createElementBlock(
  23673. vue.Fragment,
  23674. null,
  23675. vue.renderList($setup.order.skus, (item) => {
  23676. return vue.openBlock(), vue.createElementBlock("navigator", {
  23677. class: "navigator",
  23678. key: item.id,
  23679. url: `/pages/goods/goods?id=${item.spuId}`,
  23680. "hover-class": "none"
  23681. }, [
  23682. vue.createElementVNode("image", {
  23683. class: "cover",
  23684. src: item.image
  23685. }, null, 8, ["src"]),
  23686. vue.createElementVNode("view", { class: "meta" }, [
  23687. vue.createElementVNode(
  23688. "view",
  23689. { class: "name ellipsis" },
  23690. vue.toDisplayString(item.name),
  23691. 1
  23692. /* TEXT */
  23693. ),
  23694. vue.createElementVNode(
  23695. "view",
  23696. { class: "type" },
  23697. vue.toDisplayString(item.attrsText),
  23698. 1
  23699. /* TEXT */
  23700. ),
  23701. vue.createElementVNode("view", { class: "price" }, [
  23702. vue.createElementVNode("view", { class: "actual" }, [
  23703. vue.createElementVNode("text", { class: "symbol" }, "¥"),
  23704. vue.createElementVNode(
  23705. "text",
  23706. null,
  23707. vue.toDisplayString(item.curPrice),
  23708. 1
  23709. /* TEXT */
  23710. )
  23711. ])
  23712. ]),
  23713. vue.createElementVNode(
  23714. "view",
  23715. { class: "quantity" },
  23716. "x" + vue.toDisplayString(item.quantity),
  23717. 1
  23718. /* TEXT */
  23719. )
  23720. ])
  23721. ], 8, ["url"]);
  23722. }),
  23723. 128
  23724. /* KEYED_FRAGMENT */
  23725. )),
  23726. vue.createCommentVNode(" 待评价状态:展示按钮 "),
  23727. $setup.order.orderState === $setup.OrderState.DaiPingJia ? (vue.openBlock(), vue.createElementBlock("view", {
  23728. key: 0,
  23729. class: "action"
  23730. }, [
  23731. vue.createElementVNode("view", { class: "button primary" }, "申请售后"),
  23732. vue.createElementVNode("navigator", {
  23733. url: "",
  23734. class: "button"
  23735. }, " 去评价 ")
  23736. ])) : vue.createCommentVNode("v-if", true)
  23737. ]),
  23738. vue.createCommentVNode(" 合计 "),
  23739. vue.createElementVNode("view", { class: "total" }, [
  23740. vue.createElementVNode("view", { class: "row" }, [
  23741. vue.createElementVNode("view", { class: "text" }, "商品总价: "),
  23742. vue.createElementVNode(
  23743. "view",
  23744. { class: "symbol" },
  23745. vue.toDisplayString($setup.order.totalMoney),
  23746. 1
  23747. /* TEXT */
  23748. )
  23749. ]),
  23750. vue.createElementVNode("view", { class: "row" }, [
  23751. vue.createElementVNode("view", { class: "text" }, "运费: "),
  23752. vue.createElementVNode(
  23753. "view",
  23754. { class: "symbol" },
  23755. vue.toDisplayString($setup.order.postFee),
  23756. 1
  23757. /* TEXT */
  23758. )
  23759. ]),
  23760. vue.createElementVNode("view", { class: "row" }, [
  23761. vue.createElementVNode("view", { class: "text" }, "应付金额: "),
  23762. vue.createElementVNode(
  23763. "view",
  23764. { class: "symbol primary" },
  23765. vue.toDisplayString($setup.order.payMoney),
  23766. 1
  23767. /* TEXT */
  23768. )
  23769. ])
  23770. ])
  23771. ]),
  23772. vue.createCommentVNode(" 订单信息 "),
  23773. vue.createElementVNode("view", { class: "detail" }, [
  23774. vue.createElementVNode("view", { class: "title" }, "订单信息"),
  23775. vue.createElementVNode("view", { class: "row" }, [
  23776. vue.createElementVNode("view", { class: "item" }, [
  23777. vue.createTextVNode(
  23778. " 订单编号: " + vue.toDisplayString($setup.query.id) + " ",
  23779. 1
  23780. /* TEXT */
  23781. ),
  23782. vue.createElementVNode("text", {
  23783. class: "copy",
  23784. onClick: _cache[0] || (_cache[0] = ($event) => $setup.onCopy($setup.query.id))
  23785. }, "复制")
  23786. ]),
  23787. vue.createElementVNode(
  23788. "view",
  23789. { class: "item" },
  23790. "下单时间: " + vue.toDisplayString($setup.order.createTime),
  23791. 1
  23792. /* TEXT */
  23793. )
  23794. ])
  23795. ]),
  23796. vue.createCommentVNode(" 猜你喜欢 "),
  23797. vue.createVNode(
  23798. _component_XtxGuess,
  23799. { ref: "guessRef" },
  23800. null,
  23801. 512
  23802. /* NEED_PATCH */
  23803. ),
  23804. vue.createCommentVNode(" 底部操作栏 "),
  23805. vue.createElementVNode(
  23806. "view",
  23807. {
  23808. class: "toolbar-height",
  23809. style: vue.normalizeStyle({ paddingBottom: ((_b = $setup.safeAreaInsets) == null ? void 0 : _b.bottom) + "px" })
  23810. },
  23811. null,
  23812. 4
  23813. /* STYLE */
  23814. ),
  23815. vue.createElementVNode(
  23816. "view",
  23817. {
  23818. class: "toolbar",
  23819. style: vue.normalizeStyle({ paddingBottom: ((_c = $setup.safeAreaInsets) == null ? void 0 : _c.bottom) + "px" })
  23820. },
  23821. [
  23822. vue.createCommentVNode(" 待付款状态:展示支付按钮 "),
  23823. $setup.order.orderState === $setup.OrderState.DaiFuKuan ? (vue.openBlock(), vue.createElementBlock(
  23824. vue.Fragment,
  23825. { key: 0 },
  23826. [
  23827. vue.createElementVNode("view", {
  23828. class: "button primary",
  23829. onClick: $setup.onOrderPay
  23830. }, " 去支付 "),
  23831. vue.createElementVNode("view", {
  23832. class: "button",
  23833. onClick: _cache[1] || (_cache[1] = ($event) => {
  23834. var _a2, _b2;
  23835. return (_b2 = (_a2 = $setup.popup) == null ? void 0 : _a2.open) == null ? void 0 : _b2.call(_a2);
  23836. })
  23837. }, " 取消订单 ")
  23838. ],
  23839. 64
  23840. /* STABLE_FRAGMENT */
  23841. )) : (vue.openBlock(), vue.createElementBlock(
  23842. vue.Fragment,
  23843. { key: 1 },
  23844. [
  23845. vue.createCommentVNode(" 其他订单状态:按需展示按钮 "),
  23846. vue.createElementVNode("navigator", {
  23847. class: "button secondary",
  23848. url: `/pagesOrder/create/create?orderId=${$setup.query.id}`,
  23849. "hover-class": "none"
  23850. }, " 再次购买 ", 8, ["url"]),
  23851. vue.createCommentVNode(" 待收货状态: 展示确认收货 "),
  23852. $setup.order.orderState === $setup.OrderState.DaiShouHuo ? (vue.openBlock(), vue.createElementBlock("view", {
  23853. key: 0,
  23854. class: "button primary",
  23855. onClick: $setup.onOrderConfirm
  23856. }, " 确认收货 ")) : vue.createCommentVNode("v-if", true),
  23857. vue.createCommentVNode(" 待评价状态: 展示去评价 "),
  23858. $setup.order.orderState === $setup.OrderState.DaiPingJia ? (vue.openBlock(), vue.createElementBlock("view", {
  23859. key: 1,
  23860. class: "button"
  23861. }, " 去评价 ")) : vue.createCommentVNode("v-if", true),
  23862. vue.createCommentVNode(" 待评价/已完成/已取消 状态: 展示删除订单 "),
  23863. $setup.order.orderState >= $setup.OrderState.DaiPingJia ? (vue.openBlock(), vue.createElementBlock("view", {
  23864. key: 2,
  23865. class: "button delete",
  23866. onClick: $setup.onOrderDelete
  23867. }, " 删除订单 ")) : vue.createCommentVNode("v-if", true)
  23868. ],
  23869. 64
  23870. /* STABLE_FRAGMENT */
  23871. ))
  23872. ],
  23873. 4
  23874. /* STYLE */
  23875. )
  23876. ],
  23877. 64
  23878. /* STABLE_FRAGMENT */
  23879. )) : (vue.openBlock(), vue.createElementBlock(
  23880. vue.Fragment,
  23881. { key: 1 },
  23882. [
  23883. vue.createCommentVNode(" 骨架屏组件 "),
  23884. vue.createVNode($setup["PageSkeleton"])
  23885. ],
  23886. 64
  23887. /* STABLE_FRAGMENT */
  23888. ))
  23889. ],
  23890. 32
  23891. /* NEED_HYDRATION */
  23892. ),
  23893. vue.createCommentVNode(" 取消订单弹窗 "),
  23894. vue.createVNode(
  23895. _component_uni_popup,
  23896. {
  23897. ref: "popup",
  23898. type: "bottom",
  23899. "background-color": "#fff"
  23900. },
  23901. {
  23902. default: vue.withCtx(() => [
  23903. vue.createElementVNode("view", { class: "popup-root" }, [
  23904. vue.createElementVNode("view", { class: "title" }, "订单取消"),
  23905. vue.createElementVNode("view", { class: "description" }, [
  23906. vue.createElementVNode("view", { class: "tips" }, "请选择取消订单的原因:"),
  23907. (vue.openBlock(true), vue.createElementBlock(
  23908. vue.Fragment,
  23909. null,
  23910. vue.renderList($setup.reasonList, (item) => {
  23911. return vue.openBlock(), vue.createElementBlock("view", {
  23912. class: "cell",
  23913. key: item,
  23914. onClick: ($event) => $setup.reason = item
  23915. }, [
  23916. vue.createElementVNode(
  23917. "text",
  23918. { class: "text" },
  23919. vue.toDisplayString(item),
  23920. 1
  23921. /* TEXT */
  23922. ),
  23923. vue.createElementVNode(
  23924. "text",
  23925. {
  23926. class: vue.normalizeClass(["icon", { checked: item === $setup.reason }])
  23927. },
  23928. null,
  23929. 2
  23930. /* CLASS */
  23931. )
  23932. ], 8, ["onClick"]);
  23933. }),
  23934. 128
  23935. /* KEYED_FRAGMENT */
  23936. ))
  23937. ]),
  23938. vue.createElementVNode("view", { class: "footer" }, [
  23939. vue.createElementVNode("view", {
  23940. class: "button",
  23941. onClick: _cache[3] || (_cache[3] = ($event) => {
  23942. var _a2, _b2;
  23943. return (_b2 = (_a2 = $setup.popup) == null ? void 0 : _a2.close) == null ? void 0 : _b2.call(_a2);
  23944. })
  23945. }, "取消"),
  23946. vue.createElementVNode("view", {
  23947. class: "button primary",
  23948. onClick: $setup.onOrderCancel
  23949. }, "确认")
  23950. ])
  23951. ])
  23952. ]),
  23953. _: 1
  23954. /* STABLE */
  23955. },
  23956. 512
  23957. /* NEED_PATCH */
  23958. )
  23959. ],
  23960. 64
  23961. /* STABLE_FRAGMENT */
  23962. );
  23963. }
  23964. const PagesOrderDetailDetail = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__file", "E:/demo/hmrabbit/src/pagesOrder/detail/detail.vue"]]);
  23965. const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
  23966. __name: "payment",
  23967. props: {
  23968. id: { type: String, required: true }
  23969. },
  23970. setup(__props, { expose: __expose }) {
  23971. __expose();
  23972. const query = __props;
  23973. const { guessRef, onScrolltolower } = useGuessList();
  23974. const __returned__ = { query, guessRef, onScrolltolower };
  23975. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  23976. return __returned__;
  23977. }
  23978. });
  23979. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  23980. const _component_XtxGuess = resolveEasycom(vue.resolveDynamicComponent("XtxGuess"), __easycom_0$9);
  23981. return vue.openBlock(), vue.createElementBlock(
  23982. "scroll-view",
  23983. {
  23984. "enable-back-to-top": "",
  23985. class: "viewport",
  23986. "scroll-y": "",
  23987. onScrolltolower: _cache[0] || (_cache[0] = (...args) => $setup.onScrolltolower && $setup.onScrolltolower(...args))
  23988. },
  23989. [
  23990. vue.createCommentVNode(" 订单状态 "),
  23991. vue.createElementVNode("view", { class: "overview" }, [
  23992. vue.createElementVNode("view", { class: "status icon-checked" }, "支付成功"),
  23993. vue.createElementVNode("view", { class: "buttons" }, [
  23994. vue.createElementVNode("navigator", {
  23995. "hover-class": "none",
  23996. class: "button navigator",
  23997. url: "/pages/index/index",
  23998. "open-type": "switchTab"
  23999. }, " 返回首页 "),
  24000. vue.createElementVNode("navigator", {
  24001. "hover-class": "none",
  24002. class: "button navigator",
  24003. url: `/pagesOrder/detail/detail?id=${$setup.query.id}`,
  24004. "open-type": "redirect"
  24005. }, " 查看订单 ", 8, ["url"])
  24006. ])
  24007. ]),
  24008. vue.createCommentVNode(" 猜你喜欢 "),
  24009. vue.createVNode(
  24010. _component_XtxGuess,
  24011. { ref: "guessRef" },
  24012. null,
  24013. 512
  24014. /* NEED_PATCH */
  24015. )
  24016. ],
  24017. 32
  24018. /* NEED_HYDRATION */
  24019. );
  24020. }
  24021. const PagesOrderPaymentPayment = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "E:/demo/hmrabbit/src/pagesOrder/payment/payment.vue"]]);
  24022. const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
  24023. __name: "OrderList",
  24024. props: {
  24025. orderState: { type: Number, required: true }
  24026. },
  24027. setup(__props, { expose: __expose }) {
  24028. __expose();
  24029. const { safeAreaInsets } = uni.getSystemInfoSync();
  24030. const props = __props;
  24031. const queryParams = {
  24032. page: 1,
  24033. pageSize: 5,
  24034. orderState: props.orderState
  24035. };
  24036. const orderList = vue.ref([]);
  24037. const isLoading = vue.ref(false);
  24038. const getMemberOrderData = async () => {
  24039. if (isLoading.value)
  24040. return;
  24041. if (isFinish.value === true) {
  24042. return uni.showToast({ icon: "none", title: "没有更多数据~" });
  24043. }
  24044. isLoading.value = true;
  24045. const res = await getMemberOrderAPI(queryParams);
  24046. isLoading.value = false;
  24047. orderList.value.push(...res.result.items);
  24048. if (queryParams.page < res.result.pages) {
  24049. queryParams.page++;
  24050. } else {
  24051. isFinish.value = true;
  24052. }
  24053. };
  24054. vue.onMounted(() => {
  24055. getMemberOrderData();
  24056. });
  24057. const onOrderPay = async (id) => {
  24058. {
  24059. await getPayMockAPI({ orderId: id });
  24060. }
  24061. uni.showToast({ title: "支付成功" });
  24062. const order = orderList.value.find((v2) => v2.id === id);
  24063. order.orderState = OrderState.DaiFaHuo;
  24064. };
  24065. const onOrderConfirm = (id) => {
  24066. uni.showModal({
  24067. content: "为保障您的权益,请收到货并确认无误后,再确认收货",
  24068. confirmColor: "#27BA9B",
  24069. success: async (res) => {
  24070. if (res.confirm) {
  24071. await putMemberOrderReceiptByIdAPI(id);
  24072. uni.showToast({ icon: "success", title: "确认收货成功" });
  24073. const order = orderList.value.find((v2) => v2.id === id);
  24074. order.orderState = OrderState.DaiPingJia;
  24075. }
  24076. }
  24077. });
  24078. };
  24079. const onOrderDelete = (id) => {
  24080. uni.showModal({
  24081. content: "你确定要删除该订单?",
  24082. confirmColor: "#27BA9B",
  24083. success: async (res) => {
  24084. if (res.confirm) {
  24085. await deleteMemberOrderAPI({ ids: [id] });
  24086. const index = orderList.value.findIndex((v2) => v2.id === id);
  24087. orderList.value.splice(index, 1);
  24088. }
  24089. }
  24090. });
  24091. };
  24092. const isFinish = vue.ref(false);
  24093. const isTriggered = vue.ref(false);
  24094. const onRefresherrefresh = async () => {
  24095. isTriggered.value = true;
  24096. queryParams.page = 1;
  24097. orderList.value = [];
  24098. isFinish.value = false;
  24099. await getMemberOrderData();
  24100. isTriggered.value = false;
  24101. };
  24102. const __returned__ = { safeAreaInsets, props, queryParams, orderList, isLoading, getMemberOrderData, onOrderPay, onOrderConfirm, onOrderDelete, isFinish, isTriggered, onRefresherrefresh, get OrderState() {
  24103. return OrderState;
  24104. }, get orderStateList() {
  24105. return orderStateList;
  24106. } };
  24107. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  24108. return __returned__;
  24109. }
  24110. });
  24111. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  24112. var _a;
  24113. return vue.openBlock(), vue.createElementBlock("scroll-view", {
  24114. "enable-back-to-top": "",
  24115. "scroll-y": "",
  24116. class: "orders",
  24117. "refresher-enabled": "",
  24118. "refresher-triggered": $setup.isTriggered,
  24119. onRefresherrefresh: $setup.onRefresherrefresh,
  24120. onScrolltolower: $setup.getMemberOrderData
  24121. }, [
  24122. (vue.openBlock(true), vue.createElementBlock(
  24123. vue.Fragment,
  24124. null,
  24125. vue.renderList($setup.orderList, (order) => {
  24126. return vue.openBlock(), vue.createElementBlock("view", {
  24127. class: "card",
  24128. key: order.id
  24129. }, [
  24130. vue.createCommentVNode(" 订单信息 "),
  24131. vue.createElementVNode("view", { class: "status" }, [
  24132. vue.createElementVNode(
  24133. "text",
  24134. { class: "date" },
  24135. vue.toDisplayString(order.createTime),
  24136. 1
  24137. /* TEXT */
  24138. ),
  24139. vue.createCommentVNode(" 订单状态文字 "),
  24140. vue.createElementVNode(
  24141. "text",
  24142. null,
  24143. vue.toDisplayString($setup.orderStateList[order.orderState].text),
  24144. 1
  24145. /* TEXT */
  24146. ),
  24147. vue.createCommentVNode(" 待评价/已完成/已取消 状态: 展示删除订单 "),
  24148. order.orderState >= $setup.OrderState.DaiPingJia ? (vue.openBlock(), vue.createElementBlock("text", {
  24149. key: 0,
  24150. class: "icon-delete",
  24151. onClick: ($event) => $setup.onOrderDelete(order.id)
  24152. }, null, 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
  24153. ]),
  24154. vue.createCommentVNode(" 商品信息,点击商品跳转到订单详情,不是商品详情 "),
  24155. (vue.openBlock(true), vue.createElementBlock(
  24156. vue.Fragment,
  24157. null,
  24158. vue.renderList(order.skus, (item) => {
  24159. return vue.openBlock(), vue.createElementBlock("navigator", {
  24160. key: item.id,
  24161. class: "goods",
  24162. url: `/pagesOrder/detail/detail?id=${order.id}`,
  24163. "hover-class": "none"
  24164. }, [
  24165. vue.createElementVNode("view", { class: "cover" }, [
  24166. vue.createElementVNode("image", {
  24167. class: "image",
  24168. mode: "aspectFit",
  24169. src: item.image
  24170. }, null, 8, ["src"])
  24171. ]),
  24172. vue.createElementVNode("view", { class: "meta" }, [
  24173. vue.createElementVNode(
  24174. "view",
  24175. { class: "name ellipsis" },
  24176. vue.toDisplayString(item.name),
  24177. 1
  24178. /* TEXT */
  24179. ),
  24180. vue.createElementVNode(
  24181. "view",
  24182. { class: "type" },
  24183. vue.toDisplayString(item.attrsText),
  24184. 1
  24185. /* TEXT */
  24186. )
  24187. ])
  24188. ], 8, ["url"]);
  24189. }),
  24190. 128
  24191. /* KEYED_FRAGMENT */
  24192. )),
  24193. vue.createCommentVNode(" 支付信息 "),
  24194. vue.createElementVNode("view", { class: "payment" }, [
  24195. vue.createElementVNode(
  24196. "text",
  24197. { class: "quantity" },
  24198. "共" + vue.toDisplayString(order.totalNum) + "件商品",
  24199. 1
  24200. /* TEXT */
  24201. ),
  24202. vue.createElementVNode("text", null, "实付"),
  24203. vue.createElementVNode("text", { class: "amount" }, [
  24204. vue.createElementVNode("text", { class: "symbol" }, "¥"),
  24205. vue.createTextVNode(
  24206. vue.toDisplayString(order.payMoney),
  24207. 1
  24208. /* TEXT */
  24209. )
  24210. ])
  24211. ]),
  24212. vue.createCommentVNode(" 订单操作按钮 "),
  24213. vue.createElementVNode("view", { class: "action" }, [
  24214. vue.createCommentVNode(" 待付款状态:显示去支付按钮 "),
  24215. order.orderState === $setup.OrderState.DaiFuKuan ? (vue.openBlock(), vue.createElementBlock("view", {
  24216. key: 0,
  24217. class: "button primary",
  24218. onClick: ($event) => $setup.onOrderPay(order.id)
  24219. }, "去支付", 8, ["onClick"])) : (vue.openBlock(), vue.createElementBlock(
  24220. vue.Fragment,
  24221. { key: 1 },
  24222. [
  24223. vue.createElementVNode("navigator", {
  24224. class: "button secondary",
  24225. url: `/pagesOrder/create/create?orderId=${order.id}`,
  24226. "hover-class": "none"
  24227. }, " 再次购买 ", 8, ["url"]),
  24228. vue.createCommentVNode(" 待收货状态: 展示确认收货 "),
  24229. order.orderState === $setup.OrderState.DaiShouHuo ? (vue.openBlock(), vue.createElementBlock("view", {
  24230. key: 0,
  24231. class: "button primary",
  24232. onClick: ($event) => $setup.onOrderConfirm(order.id)
  24233. }, " 确认收货 ", 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
  24234. ],
  24235. 64
  24236. /* STABLE_FRAGMENT */
  24237. ))
  24238. ])
  24239. ]);
  24240. }),
  24241. 128
  24242. /* KEYED_FRAGMENT */
  24243. )),
  24244. vue.createCommentVNode(" 底部提示文字 "),
  24245. vue.createElementVNode(
  24246. "view",
  24247. {
  24248. class: "loading-text",
  24249. style: vue.normalizeStyle({ paddingBottom: ((_a = $setup.safeAreaInsets) == null ? void 0 : _a.bottom) + "px" })
  24250. },
  24251. vue.toDisplayString($setup.isFinish ? "没有更多数据~" : "正在加载..."),
  24252. 5
  24253. /* TEXT, STYLE */
  24254. )
  24255. ], 40, ["refresher-triggered"]);
  24256. }
  24257. const OrderList = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-52fbdc30"], ["__file", "E:/demo/hmrabbit/src/pagesOrder/list/components/OrderList.vue"]]);
  24258. const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
  24259. __name: "list",
  24260. props: {
  24261. type: { type: String, required: true }
  24262. },
  24263. setup(__props, { expose: __expose }) {
  24264. __expose();
  24265. const query = __props;
  24266. const orderTabs = vue.ref([
  24267. { orderState: 0, title: "全部", isRender: false },
  24268. { orderState: 1, title: "待付款", isRender: false },
  24269. { orderState: 2, title: "待发货", isRender: false },
  24270. { orderState: 3, title: "待收货", isRender: false },
  24271. { orderState: 4, title: "待评价", isRender: false }
  24272. ]);
  24273. const activeIndex = vue.ref(orderTabs.value.findIndex((v2) => v2.orderState === Number(query.type)));
  24274. orderTabs.value[activeIndex.value].isRender = true;
  24275. const __returned__ = { query, orderTabs, activeIndex, OrderList };
  24276. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  24277. return __returned__;
  24278. }
  24279. });
  24280. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  24281. return vue.openBlock(), vue.createElementBlock("view", { class: "viewport" }, [
  24282. vue.createCommentVNode(" tabs "),
  24283. vue.createElementVNode("view", { class: "tabs" }, [
  24284. (vue.openBlock(true), vue.createElementBlock(
  24285. vue.Fragment,
  24286. null,
  24287. vue.renderList($setup.orderTabs, (item, index) => {
  24288. return vue.openBlock(), vue.createElementBlock("text", {
  24289. class: "item",
  24290. key: item.title,
  24291. onClick: () => {
  24292. $setup.activeIndex = index;
  24293. item.isRender = true;
  24294. }
  24295. }, vue.toDisplayString(item.title), 9, ["onClick"]);
  24296. }),
  24297. 128
  24298. /* KEYED_FRAGMENT */
  24299. )),
  24300. vue.createCommentVNode(" 游标 "),
  24301. vue.createElementVNode(
  24302. "view",
  24303. {
  24304. class: "cursor",
  24305. style: vue.normalizeStyle({ left: $setup.activeIndex * 20 + "%" })
  24306. },
  24307. null,
  24308. 4
  24309. /* STYLE */
  24310. )
  24311. ]),
  24312. vue.createCommentVNode(" 滑动容器 "),
  24313. vue.createElementVNode("swiper", {
  24314. class: "swiper",
  24315. current: $setup.activeIndex,
  24316. onChange: _cache[0] || (_cache[0] = ($event) => $setup.activeIndex = $event.detail.current)
  24317. }, [
  24318. vue.createCommentVNode(" 滑动项 "),
  24319. (vue.openBlock(true), vue.createElementBlock(
  24320. vue.Fragment,
  24321. null,
  24322. vue.renderList($setup.orderTabs, (item) => {
  24323. return vue.openBlock(), vue.createElementBlock("swiper-item", {
  24324. key: item.title
  24325. }, [
  24326. vue.createCommentVNode(" 订单列表 "),
  24327. item.isRender ? (vue.openBlock(), vue.createBlock($setup["OrderList"], {
  24328. key: 0,
  24329. "order-state": item.orderState
  24330. }, null, 8, ["order-state"])) : vue.createCommentVNode("v-if", true)
  24331. ]);
  24332. }),
  24333. 128
  24334. /* KEYED_FRAGMENT */
  24335. ))
  24336. ], 40, ["current"])
  24337. ]);
  24338. }
  24339. const PagesOrderListList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "E:/demo/hmrabbit/src/pagesOrder/list/list.vue"]]);
  24340. __definePage("pages/index/index", PagesIndexIndex);
  24341. __definePage("pages/category/category", PagesCategoryCategory);
  24342. __definePage("pages/cart/cart", PagesCartCart);
  24343. __definePage("pages/cart/cart2", PagesCartCart2);
  24344. __definePage("pages/my/my", PagesMyMy);
  24345. __definePage("pages/login/login", PagesLoginLogin);
  24346. __definePage("pages/hot/hot", PagesHotHot);
  24347. __definePage("pages/goods/goods", PagesGoodsGoods);
  24348. __definePage("pages/inbound/inbound", PagesInboundInbound);
  24349. __definePage("pages/inbound/logList", PagesInboundLogList);
  24350. __definePage("pages/weigh/weigh", PagesWeighWeigh);
  24351. __definePage("pages/weigh/logList", PagesWeighLogList);
  24352. __definePage("pages/outbound/outbound", PagesOutboundOutbound);
  24353. __definePage("pages/outbound/logList", PagesOutboundLogList);
  24354. __definePage("pages/warehouseScan/warehouseScan", PagesWarehouseScanWarehouseScan);
  24355. __definePage("pages/warehouseScan/logList", PagesWarehouseScanLogList);
  24356. __definePage("pages/printer/printer", PagesPrinterPrinter);
  24357. __definePage("pages/printer/logList", PagesPrinterLogList);
  24358. __definePage("pages/scanLotno/scanLotno", PagesScanLotnoScanLotno);
  24359. __definePage("pages/scanLotno/logList", PagesScanLotnoLogList);
  24360. __definePage("pages/scanLotno/waybillsList", PagesScanLotnoWaybillsList);
  24361. __definePage("pages/waybillNo/waybillNo", PagesWaybillNoWaybillNo);
  24362. __definePage("pages/waybillNo/logList", PagesWaybillNoLogList);
  24363. __definePage("pages/pickup/waybillPickUpOrder", PagesPickupWaybillPickUpOrder);
  24364. __definePage("pages/pickup/waybillPickUpDetails", PagesPickupWaybillPickUpDetails);
  24365. __definePage("pages/pickup/waybillPickUpDetail", PagesPickupWaybillPickUpDetail);
  24366. __definePage("pages/waybillDeliveryOrder/waybillDeliveryOrder", PagesWaybillDeliveryOrderWaybillDeliveryOrder);
  24367. __definePage("pagesMember/settings/settings", PagesMemberSettingsSettings);
  24368. __definePage("pagesMember/profile/profile", PagesMemberProfileProfile);
  24369. __definePage("pagesMember/address/address", PagesMemberAddressAddress);
  24370. __definePage("pagesMember/address-form/address-form", PagesMemberAddressFormAddressForm);
  24371. __definePage("pagesOrder/create/create", PagesOrderCreateCreate);
  24372. __definePage("pagesOrder/detail/detail", PagesOrderDetailDetail);
  24373. __definePage("pagesOrder/payment/payment", PagesOrderPaymentPayment);
  24374. __definePage("pagesOrder/list/list", PagesOrderListList);
  24375. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  24376. __name: "App",
  24377. setup(__props, { expose: __expose }) {
  24378. __expose();
  24379. onLaunch(() => {
  24380. formatAppLog("log", "at App.vue:5", "App Launch");
  24381. });
  24382. onShow(() => {
  24383. formatAppLog("log", "at App.vue:8", "App Show");
  24384. });
  24385. onHide(() => {
  24386. formatAppLog("log", "at App.vue:11", "App Hide");
  24387. });
  24388. const __returned__ = { get onLaunch() {
  24389. return onLaunch;
  24390. }, get onShow() {
  24391. return onShow;
  24392. }, get onHide() {
  24393. return onHide;
  24394. } };
  24395. Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
  24396. return __returned__;
  24397. }
  24398. });
  24399. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "E:/demo/hmrabbit/src/App.vue"]]);
  24400. function createApp() {
  24401. const app = vue.createVueApp(App);
  24402. app.use(pinia);
  24403. return {
  24404. app
  24405. };
  24406. }
  24407. const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
  24408. uni.Vuex = __Vuex__;
  24409. uni.Pinia = __Pinia__;
  24410. __app__.provide("__globalStyles", __uniConfig.styles);
  24411. __app__._component.mpType = "app";
  24412. __app__._component.render = () => {
  24413. };
  24414. __app__.mount("#app");
  24415. })(Vue);